Knaph

The course as a book

Logic Level 4: Proof, Step by Step

Show that an argument is valid the way mathematicians do - one small, checked step at a time - with rules for not, and, or and if, supposing for a while, and the strategies that find a proof.

What a Proof Is

A Chain of Small Steps

Someone gives you an argument with twenty different claims in it. You want to know if it is valid. A truth table would work, but how big would it be? And is there a smarter way?

Tables grow too fast

A truth table has one row for every way the letters can be true or false. Each new letter doubles the number of rows. Two letters give 4 rows. Ten letters give 1,024 rows. Twenty letters give 1,048,576 rows: over a million.

Four cards show how a truth table grows: two letters need 4 rows, three need 8, ten need 1,024 and twenty need 1,048,576.

No one checks a million rows by hand. Later in logic we will meet kinds of claims where tables do not work at all. We need another tool. It is called a proof.

What a proof is

A proof is a numbered list of lines. Every line is one of two things. It is a premise, a claim we were given. Or it follows from earlier lines by a rule, a small step we can check. Next to each line is its reason, in the Why column.

Here is a proof with three lines. Key: P = It rains. Q = The street is wet.

#LineWhy
1P → Qpremise
2Ppremise
3Q→E 1, 2

A proof with three numbered lines: P arrow Q and P are premises, and line 3, Q, is justified by the rule arrow-E using lines 1 and 2. A key explains P and Q.

Line 1 says: if it rains, the street is wet. Line 2 says: it rains. Line 3 says: the street is wet. Its reason is →E 1, 2. That is the rule called if-out (→E), used on lines 1 and 2. If an if-then is true and its if-part is true, the then-part must be true. The next lesson looks at this rule closely.

Why a proof shows validity

Think of a ladder. You cannot jump to the top. But every rung is a small, safe step. In a proof every line is a small, safe step from lines you already trust. If the premises are true, line 3 must be true. So the argument is valid.

This is an old idea. Euclid's Elements (about 300 BC) built geometry from small steps, each with a reason. A mathematical proof works the same way. A logic proof is stricter: the allowed steps are listed in advance.

Remember what a proof does not do. It does not show that the premises are true. It shows that the conclusion follows if they are.

Careful

A proof of an argument shows it is valid. It never shows that the premises are true.

Try it at home

  1. Write a recipe you know as numbered steps. Next to each step write why you can do it.
  2. Start at 2 and double it again and again. How many doublings pass 1,000? Compare with ten letters.
  3. Copy the three-line proof and cover the Why column. Say the reason for each line yourself.

Words to know

  • proof - a numbered list of lines, each a premise or a step from earlier lines by a rule
  • premise - a claim we are given and may write on a line
  • rule - a small step we have checked and may use, written in the Why column
  • Why column - the part of each line that says its reason

Big idea

A proof is a numbered chain of small steps, each a premise or a rule used on earlier lines, and it shows an argument is valid without checking a million rows.

Lesson page →

The First Rule

If Sam has the key, he can open the door. Sam has the key. So Sam can open the door. You did not need a table for that. Can we turn a step like this into a rule that always works?

A rule is a checked shape

A rule of inference is a tiny argument shape. We check it once, with a truth table, and then we trust it for ever. Here is the shape:

P → Q
P
So Q

Only the first row of the table makes both premises true, and there Q is true too. No row has true premises and a false conclusion, so the shape is valid.

A truth table for P, Q and P arrow Q with four rows. Row 1, where P and Q are both true, is circled: both premises are true there and so is Q. No row has true premises and a false Q.

Naming and using it

We call this rule if-out (→E). The E is for out: the if-then is used, and the then-part comes out. Logicians also call it modus ponens. Here it is in a proof. Key: P = Sam has the key. Q = Sam can open the door.

#LineWhy
1P → Qpremise
2Ppremise
3Q→E 1, 2

The Why says →E 1, 2: the rule, then the two lines it uses. The order of the numbers does not matter. →E 2, 1 is just as good. P and Q can stand for any claims, long or short, as long as the lines have exactly this shape.

The exact shape

A rule needs its exact shape. Suppose we have P → Q and Q. Nothing follows. Sam can open the door if he has the key. The door is open. Maybe someone left it open. This is the trap from Level 1, affirming the then-part, now in rule form.

Two boxes side by side. The green one shows that P arrow Q and P give Q. The red one shows that P arrow Q and Q give nothing.

The rule goes one way only: from the if-part to the then-part.

Careful

Never write P from P → Q and Q. The rule needs the if-part, not the then-part.

Try it at home

  1. Write an if-then that is true of your day, and its if-part. Write what →E lets you write.
  2. Take the same if-then and its then-part. Find another way the then-part could be true.
  3. Draw the four-row table for P → Q. Circle the one row where both P → Q and P are true.

Words to know

  • rule of inference - a small argument shape, checked once and then trusted
  • if-out (→E) - from an if-then and its if-part, write the then-part
  • exact shape - the rule works only on lines that have its pattern
  • citation - the rule and the line numbers it uses, such as →E 1, 2

Big idea

A rule is an argument shape checked once by a table. If-out (→E) takes an if-then and its if-part and gives the then-part, and it never works backwards.

Lesson page →

And-In and And-Out

You know it is Monday. You know it is snowing. Joining the two facts is easy. But is it safe to say "It is Monday or it is snowing" when you only know it is Monday?

Joining and splitting

Key for this lesson: P = It is Monday. Q = It is snowing. The rule and-in (∧I) joins two lines: from A and from B, write A ∧ B. It is safe because an and is true when both sides are true.

#LineWhy
1Ppremise
2Qpremise
3P ∧ Q∧I 1, 2

The rule and-out (∧E) splits an and: from A ∧ B, write A, or write B. It is safe because an and is true only when both sides are true. Here we split once and join again in the other order.

#LineWhy
1P ∧ Qpremise
2Q∧E 1
3P∧E 1
4Q ∧ P∧I 2, 3

Three cards. And-in takes A and B and gives A and B joined. And-out takes A and B joined and gives A, or B. Or-in takes A and gives A or B.

The odd one: or-in

The rule or-in (∨I) says: from A, write A ∨ B, where B is any claim at all. It feels odd. We never heard about snow in line 1.

#LineWhy
1Ppremise
2P ∨ Q∨I 1

But it is valid. An or needs only one true side, and we know the left side is true. "It is Monday, so it is Monday or it is snowing" says nothing wrong. It just says less than we know. We may also write Q ∨ P, with the new claim on the left.

Where and-out stops

And-out works only on an and. Say line 1 is P ∨ Q. We may not write P by ∧E. The or can be true when only Q is true, and then P is false.

Line 1 says P or Q. Line 2 says P by and-out. It is drawn in red because it is wrong: line 1 is an or and not an and.

To use an or we need another rule, or-out. It comes later in this course.

Careful

∧E is for an and only. From P ∨ Q it gives nothing.

Try it at home

  1. Write two true facts about your day. Join them with ∧I. Then split the result again with ∧E.
  2. Write a true fact. Use ∨I to add any other claim after an or. Say why it is still true.
  3. Take "I like tea or I like coffee". Explain why we cannot use ∧E to get "I like tea".

Words to know

  • and-in (∧I) - from A and from B, write A ∧ B
  • and-out (∧E) - from A ∧ B, write A, or write B
  • or-in (∨I) - from A, write A ∨ B for any B
  • citation - the rule and the lines it uses, such as ∧I 1, 2

Big idea

And-in joins, and-out splits an and, and or-in adds any claim after an or; and-out never works on an or.

Lesson page →

Working Backwards from the Goal

You want to cross a town. You know where you stand and where you must end. Smart travellers read the map from the end too. How do we find a proof, not only check one?

Premises on top, goal at the bottom

Take this argument. Key: P = The bell rings. Q = Class starts. R = Mia is ready. Premises: P ∧ Q and P → R. Goal: R ∧ Q. Write the premises at the top and the goal at the bottom. The lines between are a gap.

A proof sketch. Lines 1 and 2 are the premises P and Q joined, and P arrow R. Line 3 is a gap marked with a question mark. Line 4 is the goal, R and Q joined.

Now we ask two questions. What do we want? Which rule could give it, and what would it need?

Working backwards

We want R ∧ Q. An and is made by and-in (∧I). It needs R on one line and Q on another. So there are two new goals: R, and Q.

Q is easy: line 1 is P ∧ Q, so ∧E gives Q. For R we ask again. An if-then gives R by →E, and line 2 is P → R. It needs P on an earlier line. That is a new goal: P. And P comes from line 1 by ∧E.

A chain of goals. The goal R and Q needs R and needs Q. R needs P arrow R and P. Both P and Q come from line 1 by and-out.

Forwards and backwards meet

Now write the pieces in order, from the top.

#LineWhy
1P ∧ Qpremise
2P → Rpremise
3P∧E 1
4R→E 2, 3
5Q∧E 1
6R ∧ Q∧I 4, 5

Check each line. Line 3 splits an and. Line 4 uses if-out on lines 2 and 3. Line 5 splits line 1 again. Line 6 joins lines 4 and 5. The goal is reached.

If a rule needs a line you do not have, that line becomes the new goal. We can also work forwards: from P ∧ Q, ∧E gives P and Q at once. Switch between both ways until they meet.

Careful

A line can be valid and still useless. Ask each time: does this get me nearer the goal?

Try it at home

  1. Take the argument P ∧ Q, P → R, so R ∧ Q. Cover this lesson and find the proof yourself.
  2. Write the premises P → Q and Q → R and P. Your goal is R. Ask which rule gives R, then what it needs.
  3. Next time you plan a trip or a recipe, write the end result first and ask what comes just before it.

Words to know

  • goal - the claim at the bottom that the proof must reach
  • working backwards - asking which rule gives the goal and what it needs
  • working forwards - writing what the premises give by rules
  • gap - the lines still missing between premises and goal

Big idea

To find a proof, put the premises at the top and the goal at the bottom, then ask which rule gives the goal and what it needs, until forwards and backwards meet.

Lesson page →

Supposing for a While

Supposing for a While

"Suppose we take the train. Then we arrive at ten." Nobody said we are taking the train. We only asked what would follow if we did. Can a proof do the same?

Supposing in daily life

People suppose all the time. "Suppose it rains tomorrow. Then the match is off." You do not claim that it will rain. You try the idea out and see what comes of it. When you have your answer, you stop supposing and go back to what you really know.

A dashed frame holds the words suppose we take the train and then we arrive at ten, and outside it a note says nobody claimed we take the train.

A proof can do this too. The supposition is called an assumption. It opens a box, and the box lasts until we stop supposing.

The box

Key: P = We take the train. Q = We arrive at ten. R = The shop is open. The premises are P → Q and R. Inside the box we suppose P.

#LineWhy
1P → Qpremise
2Rpremise
3│ Passume
4│ Q→E 1, 3
5│ RR 2

A proof with five lines: two premises, then a box that opens with the assumption P on line 3, uses arrow-E on line 4 and repeats R from line 2 on line 5.

Line 3 opens the box. Its reason is assume. It is not a premise and nobody claims it. Line 4 uses →E on lines 1 and 3, and gives Q. This is the right thing to say: if we take the train, we arrive at ten.

Line 5 uses a new rule, repeat (R). It copies a line we already have. Line 2 is outside the box, but a line inside the box may use any earlier line, inside or outside. The box ends under line 5. Next lesson shows what we may write when a box ends.

What a box does to its lines

Every line inside the box depends on the assumption. Line 4 is true only if P is. So when the box closes, we may not use line 4 alone. We cannot write Q below the box and say "it follows from line 4". We never proved that we take the train.

A proof where a box on lines 2 and 3 has closed and line 4 outside it cites line 3 with the rule repeat; line 4 is red, marked as a mistake.

Here is the whole set of box rules. An assumption opens a box. Lines inside may use lines above them, inside or outside. When the box closes, its lines cannot be used one by one. Only the whole box can be used, and we cite it by its first and last line, like 3-5. Boxes may sit inside boxes, but never overlap. Every box must close before the proof ends.

Logicians used boxes like this from 1934, when Gentzen and Jaśkowski invented natural deduction. Fitch drew the boxes as we do in 1952.

Careful

A line inside a box is not a claim about the real world. It is only true if the assumption is.

Try it at home

  1. Think of three "suppose ..." sentences you said this week. What did you not claim?
  2. Copy the five-line proof. Draw a pencil box round lines 3 to 5.
  3. Check each line in the box: which earlier lines could it use, inside or outside?

Words to know

  • assumption - a claim we only suppose, to see what follows; written with the reason assume
  • box - the frame round the lines that depend on an assumption
  • repeat (R) - a rule that copies an earlier line we may still use
  • close a box - stop supposing; the lines inside can then only be used as a whole box

Big idea

An assumption opens a box; inside it lines may use anything above, but once the box closes only the whole box can be used.

Lesson page →

Proving an If

A friend says: "If you press this button, the light turns on." How would you show it is true without anyone pressing it? You would suppose the button is pressed and follow the wires.

The rule: if-in

We want to prove an if-then claim, A → B. The new rule is if-in (→I). Assume A. Reach B inside the box. Close the box, and write A → B.

An if-then does not say that A is true. It only promises B when A is. So supposing A and reaching B is exactly what the promise needs.

Three steps drawn as cards: assume A and open a box, reach B inside the box, close the box and write A arrow B.

A proof with if-in

Key: P = It rains. Q = The street is wet. R = The bus is late. Premises: P → Q and Q → R. Goal: P → R. Ask first: what do we want? An if-then. What gives it? →I. What does it need? A box that assumes P and reaches R.

#LineWhy
1P → Qpremise
2Q → Rpremise
3│ Passume
4│ Q→E 1, 3
5│ R→E 2, 4
6P → R→I 3-5

A six-line proof: premises P arrow Q and Q arrow R, a box from line 3 to line 5 that assumes P and reaches R, and line 6, P arrow R, by arrow-I on lines 3 to 5.

Line 4: P and P → Q give Q by →E. Line 5: Q and Q → R give R by →E. The box ends at R. Line 6 is outside the box. It cites the whole box, 3-5, and says: if it rains, the bus is late. We did not say it rains.

The common mistake

A learner reaches R in the box and writes R below it. That is wrong. R depended on the assumption P, and the assumption is gone. Only the if-then A → B may leave the box, because it carries the assumption inside it.

A proof like the last one, but line 6 says R by arrow-I 3 to 5 and is marked red, because arrow-I gives P arrow R, not R.

Why is the right line safe? Think of a table. P → R is false only when P is true and R is false. But inside the box, whenever P holds, R follows. So that case cannot happen.

Careful

→I gives the whole if-then A → B, never B alone.

Try it at home

  1. Say it aloud: "If it rains, the street is wet. If the street is wet, the bus is late. So if it rains, the bus is late."
  2. Copy the six-line proof. Hide line 6 and rebuild it from the box.
  3. Think of an if-then you could prove by supposing the if-part. Write the box lines.

Words to know

  • if-in (→I) - from a box that assumes A and reaches B, write A → B
  • assume - the reason for the first line of a box
  • citing a box - writing its first and last line numbers, like 3-5

Big idea

To prove A → B, assume A in a box, reach B, close the box and write A → B citing the whole box.

Lesson page →

Either Way, as a Rule

You go to work by bus or by bike. If you take the bus you are late. If you take the bike you are late. Which way will you go? You do not know, but you do know you will be late. How can a proof say so?

The rule: or-out

We know an or: B ∨ K. One side is true, but we do not know which. The rule or-out (∨E) deals with both sides. From A ∨ B, one box that assumes A and reaches C, and one box that assumes B and reaches the same C, write C.

In Level 3 we called this argument by cases. Now it is a rule with two boxes.

The bus and bike proof drawn in full: premises B or K, B arrow L and K arrow L, a box assuming B reaching L, a box assuming K reaching L, and line 8 L by or-out.

Bus or bike

Key: B = I take the bus. K = I take the bike. L = I am late. Premises: B ∨ K, B → L, K → L. Goal: L.

#LineWhy
1B ∨ Kpremise
2B → Lpremise
3K → Lpremise
4│ Bassume
5│ L→E 2, 4
6│ Kassume
7│ L→E 3, 6
8L∨E 1, 4-5, 6-7

The first box handles the bus. The second box handles the bike. Both end in L. That is why we may write L outside, citing line 1 and both boxes: 1, 4-5, 6-7. Each box is its own: line 5 is not usable in the second box.

Swapping an or

Here is a short one: from P ∨ Q, prove Q ∨ P. We want Q ∨ P. What gives it? ∨E, because we have an or. Each box must reach Q ∨ P.

#LineWhy
1P ∨ Qpremise
2│ Passume
3│ Q ∨ P∨I 2
4│ Qassume
5│ Q ∨ P∨I 4
6Q ∨ P∨E 1, 2-3, 4-5

A six-line proof of Q or P from P or Q: two boxes, one assuming P and one assuming Q, each reaching Q or P by or-in, and line 6 by or-out.

In box one, ∨I turns P into Q ∨ P. In box two, ∨I turns Q into Q ∨ P. Both boxes reach the same line, so ∨E gives it. We need two boxes because we do not know which side of the or is true.

Careful

Both boxes must reach the same claim. Two different endings do not give ∨E.

Try it at home

  1. Think of a choice where both options lead to the same result. Write the key and the three premises.
  2. Copy the bus proof. Cover lines 5 and 7 and fill them in again.
  3. Change the bus proof so the bike box reaches M instead of L. Why does the last line fail?

Words to know

  • or-out (∨E) - from A ∨ B, a box A...C and a box B...C, write C
  • case - one side of an or, supposed in its own box
  • same ending - both boxes must reach exactly the same claim C

Big idea

To use an or, suppose each side in its own box; if both boxes reach the same claim, that claim follows by or-out.

Lesson page →

Both Ways Round

A shape is a square if and only if it has four equal sides and four right angles. Each half of that sentence is an if-then. How do we prove a claim that goes both ways?

Two rules for iff

The sign ↔ means "if and only if": it goes both ways. We have two rules. iff-out (↔E) uses it: from A ↔ B and A, write B. From A ↔ B and B, write A. It works either way round.

iff-in (↔I) builds it. It needs two boxes. One box assumes A and reaches B. The other assumes B and reaches A. Then write A ↔ B.

A square and its definition joined by a double arrow: a square if and only if four equal sides and four right angles, with iff-out reading it in either direction.

Q iff P from P iff Q

Let us prove: from P ↔ Q, write Q ↔ P. We want an iff. What gives it? ↔I. What does it need? A box from Q to P, and a box from P to Q.

#LineWhy
1P ↔ Qpremise
2│ Qassume
3│ P↔E 1, 2
4│ Passume
5│ Q↔E 1, 4
6Q ↔ P↔I 2-3, 4-5

A six-line proof: premise P iff Q, a box assuming Q that reaches P, a box assuming P that reaches Q, and line 6, Q iff P, by iff-in on lines 2 to 3 and 4 to 5.

Line 3: from P ↔ Q and Q, iff-out gives P. Line 5: from P ↔ Q and P, it gives Q. Line 6 cites both boxes. The first box goes from Q to P and the second from P to Q. Together they say: Q ↔ P.

A definition used both ways

Key: S = The shape is a square. E = It has four equal sides and four right angles. Given S ↔ E and that the shape is a square, iff-out gives E. Given S ↔ E and that the shape has E, iff-out gives S.

That is what a definition does in maths. It can be read from left to right, and from right to left. To prove a definition, you must show both directions: that is two boxes.

You can see the same idea in algebraic identities: an identity can be used from either side.

Careful

One box is not enough for ↔I. The second box must go the other way, from B to A.

Try it at home

  1. Write an "if and only if" you know. Split it into two if-thens, one each way.
  2. Copy the Q ↔ P proof. Swap P and Q everywhere. Is it still correct?
  3. Find a definition in a school book. Read it left to right, then right to left.

Words to know

  • iff-out (↔E) - from A ↔ B and one side, write the other side
  • iff-in (↔I) - from a box A...B and a box B...A, write A ↔ B
  • both ways - an iff says each side gives the other

Big idea

An iff is used either way round by iff-out, and proved with two boxes, one in each direction, by iff-in.

Lesson page →

Proving Not

Proving a Not

"Suppose the shop is open. Then its lights are on. But I can see its lights are off. So the shop is not open." Nobody doubts this. How does a proof say it?

The clash

Sometimes a proof reaches a claim and its opposite together, such as Q and ¬Q. We mark that with a new symbol, ⊥. Read it "a clash". It is not a letter. It only says: we have hit a claim and its opposite.

The rule that writes it is not-out (¬E). From A and ¬A, write ⊥. It is like the if-out rule, but for a clash: it needs the exact pair, a claim and its not.

A claim Q in a blue panel and its opposite not-Q in an amber panel point with arrows to a red box holding the clash symbol.

The rule: not-in

Now we want to prove a not-claim, ¬A. The new rule is not-in (¬I). Assume A. Reach ⊥ inside the box. Close the box, and write ¬A.

This is Level 2's proof by impossibility, now written as a rule. If supposing A leads to a clash, then A cannot be true, so ¬A is.

Three steps drawn as cards: assume A and open a box, reach the clash inside the box, close the box and write not-A.

A proof with not-in

Key: P = The shop is open. Q = The lights are on. Premises: P → Q and ¬Q. Goal: ¬P. Ask first: what do we want? A not. What gives it? ¬I. So we assume P and look for ⊥.

#LineWhy
1P → Qpremise
2¬Qpremise
3│ Passume
4│ Q→E 1, 3
5│ ⊥¬E 4, 2
6¬P¬I 3-5

A six-line proof: two premises, then a box that assumes P on line 3, gets Q by arrow-E on line 4 and a clash on line 5, and line 6 outside the box writes not-P by not-in, citing 3 to 5.

Line 4 is →E on lines 1 and 3. Line 5 is ¬E: line 4 is Q and line 2 is ¬Q, a claim and its not. Line 6 closes the box and cites it whole, 3-5. The box ends in ⊥, so ¬P is safe.

This is the pattern "modus tollens" from Level 1: from A → B and ¬B, write ¬A. Here we proved it by hand. Later we may take it as a shortcut.

Careful

¬I needs a box that ends in ⊥. A box that ends in any other line cannot prove a not.

Try it at home

  1. Say "suppose ... but ... so not ..." about something at home, like the bus or the rain.
  2. Copy the six-line proof. Colour the box. Which two lines clash?
  3. Swap the key: P = It rains, Q = The ground is wet. Read the proof aloud.

Words to know

  • clash (⊥) - a mark that we reached a claim and its opposite
  • not-out (¬E) - from A and ¬A, write ⊥
  • not-in (¬I) - from a box that assumes A and ends in ⊥, write ¬A

Big idea

To prove a not-claim, assume the claim, reach a clash, close the box and write its opposite.

Lesson page →

From a Clash, Anything

A friend says: "It is raining and it is not raining. So the moon is made of cheese." That sounds silly, yet a proof can really allow it. What is going on?

The rule: clash-out

The last new rule is clash-out (X). From ⊥, you may write any claim you like.

A clash is a claim and its opposite together. If we have both, the proof has already gone wrong, so every line is allowed. Here is the smallest case. Premises: P and ¬P. Goal: Q.

#LineWhy
1Ppremise
2¬Ppremise
3⊥¬E 1, 2
4QX 3

A four-line proof: premises P and not-P, a clash on line 3 by not-out, and the unrelated claim Q on line 4 by clash-out.

Why it works

Say it in words. We have P. So "P or Q" is true, because an or needs only one true side. We also have ¬P, so we cross off the P side. Only Q is left. Any claim can take Q's place, so any claim follows.

The claim P or Q with the P side crossed off by a red line because not-P is known, leaving Q to stand alone.

Crossing off, as a proof

Level 3 used this trick: from P ∨ Q and ¬P, write Q. Now we prove it with or-out and clash-out. Ask: what do we want? Q. What gives it? ∨E, so one box for each side of the or.

#LineWhy
1P ∨ Qpremise
2¬Ppremise
3│ Passume
4│ ⊥¬E 3, 2
5│ QX 4
6│ Qassume
7│ QR 6
8Q∨E 1, 3-5, 6-7

An eight-line proof with two boxes: the first assumes P, finds a clash and writes Q by clash-out, the second assumes Q and repeats it, and line 8 writes Q by or-out.

The first box shows that the P side cannot be true. The second box is easy. Both boxes reach Q, so ∨E writes it.

Is it dangerous? Not for true premises, because true claims never clash. But someone who believes a claim and its opposite can "prove" anything. That is why logicians fear inconsistent beliefs.

Careful

X does not make Q true. It only says: the proof has reached a clash, so this line is not a risk.

Try it at home

  1. Write P and ¬P with a key, such as P = The door is locked. Then write a claim that has nothing to do with it.
  2. Check the crossing-off proof. Which box shows the P side is impossible?
  3. Find a story where two people say opposite things. What can you not trust?

Words to know

  • clash-out (X) - from ⊥, write any claim
  • explosion - the way one clash lets every claim follow
  • inconsistent - holding a claim and its opposite together

Big idea

From a clash any claim follows, which is harmless for true premises and fatal for inconsistent ones.

Lesson page →

The Indirect Proof

You want to show that your friend is at home. You cannot see in. So you think: "Suppose he is not home. Then the lamp would be off. But the lamp is on." You win by ruling out the opposite. Can a proof do that?

The rule: indirect proof

The new rule is indirect proof (IP). To prove A, assume ¬A. Reach ⊥ inside the box. Close the box, and write A.

Compare it with not-in. ¬I assumes A and writes ¬A. IP assumes ¬A and writes A. So ¬I proves a not-claim, and IP proves a claim by killing its opposite.

Two cards side by side: not-in assumes A and writes not-A, and indirect proof assumes not-A and writes A.

Removing a double not

First goal: from ¬¬P, write P. A double not says "it is not the case that not P". Ask: what do we want? P. What gives it? IP, so we assume ¬P.

#LineWhy
1¬¬Ppremise
2│ ¬Passume
3│ ⊥¬E 2, 1
4PIP 2-3

A four-line proof: premise not-not-P, a box that assumes not-P and gets a clash by not-out, and P on line 4 by indirect proof citing 2 to 3.

Line 3 is ¬E: line 2 is ¬P and line 1 is ¬¬P, a claim and its not. The box ends in ⊥, so line 4 writes P.

A harder one

Premises: ¬P → Q and ¬Q. Goal: P. We cannot get P by a forward rule. So assume ¬P and aim for a clash.

#LineWhy
1¬P → Qpremise
2¬Qpremise
3│ ¬Passume
4│ Q→E 1, 3
5│ ⊥¬E 4, 2
6PIP 3-5

A six-line proof: two premises, then a box that assumes not-P, gets Q by arrow-E and a clash by not-out, and line 6 writes P by indirect proof citing 3 to 5.

Line 4 is →E on lines 1 and 3. Line 5 is ¬E on Q and ¬Q. Then IP 3-5 gives P.

A few logicians, called intuitionists, refuse IP. They say a clash only shows the opposite is false, not that the claim is proved. We use IP, as most mathematicians do.

Careful

Do not use IP when the goal is a not-claim ¬A. Assume A and use ¬I. IP is for goals that are not a not.

Try it at home

  1. Say in words: "Suppose it is not so. Then ... but ... So it is so."
  2. Copy the harder proof. Underline the assumption and the clash.
  3. Try the same goal P with not-in. Why does the box not give P?

Words to know

  • indirect proof (IP) - from a box that assumes ¬A and ends in ⊥, write A
  • double not - a not in front of a not, such as ¬¬P
  • intuitionist - a logician who does not accept IP

Big idea

Indirect proof assumes the opposite of the goal, reaches a clash, and writes the goal.

Lesson page →

Proofs with No Premises

Every proof so far began with premises. Is there anything we can prove with none? Yes, and these claims are always true, whatever the world is like.

Starting from nothing

A proof with no premises, and every box closed, proves a theorem. A theorem needs no help from the world. First: P → P. We want an if-then, so →I: assume P, reach P.

#LineWhy
1│ Passume
2│ PR 1
3P → P→I 1-2

A three-line proof with no premises: a box assumes P and repeats it, and line 3 writes P arrow P by if-in citing 1 to 2.

Next: P → (Q → P). The goal is an if-then, so assume P. Inside, the goal is Q → P, so assume Q. Then repeat P.

#LineWhy
1│ Passume
2│ │ Qassume
3│ │ PR 1
4│ Q → P→I 2-3
5P → (Q → P)→I 1-4

Here one box sits inside another. Line 3 may use line 1, which is outside its own box but still open.

A theorem that needs a trick

Now P ∨ ¬P. Key: P = It rains. Either it rains or it does not. Ask: what do we want? An or. Could ∨I give it? We would need P or ¬P, and we have neither. So use IP: assume ¬(P ∨ ¬P) and look for ⊥.

An eight-line proof with no premises: an outer box assumes not-(P or not-P); inside it a second box assumes P and ends in a clash, line 5 writes not-P by not-in, line 6 writes P or not-P by or-in, line 7 is a clash, and line 8 writes P or not-P by indirect proof.

Walk through it. Line 1 assumes the opposite of the goal. Line 2 assumes P in a box inside the first. Line 3 is ∨I on P. Line 4 is ¬E on lines 3 and 1: a claim and its not. Line 5 closes the small box and writes ¬P by ¬I 2-4. Line 6 is ∨I on ¬P. Line 7 is ¬E on lines 6 and 1: a clash again. Line 8 closes the big box with IP 1-7. No premises, and every box closed.

What theorems are

Level 3 called a claim that is true in every row of its table a tautology. Theorems are exactly the always-true claims. We have proved three of them without any table. Much later we prove that the two lists are the same.

Careful

Every box must close before the proof ends. A proof with no premises and an open box proves nothing.

Try it at home

  1. Make a truth table for P → P. Is every row true?
  2. Copy the P ∨ ¬P proof. Draw the two boxes in two colours.
  3. Say P ∨ ¬P about the weather. Is it a claim about weather at all?

Words to know

  • theorem - a claim proved from no premises, with every box closed
  • no premises - a proof that starts with an assumption, not a given

Big idea

A proof with no premises and every box closed proves a theorem, a claim true whatever the world is like.

Lesson page →

Shortcuts and Swaps

A Rule Earned by Proof

In the last module we proved "If P then Q. Not Q. So not P" in six lines. Must we write all six lines every time the pattern comes back? Or can a proof earn a shortcut?

A proof used as a tool

A derived rule is a rule we prove once from the basic rules, and then use as a single step. It is like a tool you built yourself. You build it with care once. After that you just pick it up.

A derived rule adds no new power. Anything it proves, the basic rules could prove too, only with more lines.

Three cards in a row: prove it once from the basic rules, give it a name, then use it as one step in later proofs.

Modus tollens (MT)

Here is the six-line proof from before. Premises: P → Q and ¬Q. It proves ¬P by not-in.

#LineWhy
1P → Qpremise
2¬Qpremise
3│ Passume
4│ Q→E 1, 3
5│ ⊥¬E 4, 2
6¬P¬I 3-5

It was proved once, for any claims. So we name it modus tollens (MT): from A → B and ¬B, write ¬A. Now the proof is three lines.

#LineWhy
1P → Qpremise
2¬Qpremise
3¬PMT 1, 2

Two proofs side by side: the long one with a box has six lines, and the short one has three lines with modus tollens on line 3.

Disjunctive syllogism (DS)

The second shortcut comes from the crossing-off proof. Disjunctive syllogism (DS): from A ∨ B and ¬A, write B. If one side of an or is false, the other side must be true.

Key: P = Ana has the red key. Q = Ana has the blue key. Premises: P ∨ Q and ¬P. Ask: what do we want? Q. What gives it? DS.

#LineWhy
1P ∨ Qpremise
2¬Ppremise
3QDS 1, 2

A shortcut is a step like any other, so it needs the right lines. Here is a mixed proof. Premises: R → S, ¬S and ¬R → T. Goal: T.

#LineWhy
1R → Spremise
2¬Spremise
3¬R → Tpremise
4¬RMT 1, 2
5T→E 3, 4

Line 4 is MT on lines 1 and 2. Line 5 is →E on lines 3 and 4. To unfold line 4 into basic rules, put the six-line proof of MT in its place.

Careful

MT needs ¬B, the not of the then-part. From A → B and B you cannot write A. That is the mistake called affirming the then-part.

Try it at home

  1. Copy the three-line MT proof. Next to it, copy the six-line proof. Count the lines saved.
  2. Make a key for DS about your own life, like two places a friend could be, and read the proof aloud.
  3. Take the mixed proof. Rewrite line 4 as six lines of basic rules. Does the proof still work?

Words to know

  • derived rule - a rule proved once from the basic rules, then used as one step
  • modus tollens (MT) - from A → B and ¬B, write ¬A
  • disjunctive syllogism (DS) - from A ∨ B and ¬A, write B

Big idea

A derived rule is proved once from the basic rules and then used as one step: it saves lines but adds no power.

Lesson page →

More Shortcuts

"If it rains, the match is off. If the match is off, we go to the cinema." So if it rains, we go to the cinema. We saw this chain before. Which shortcuts does it give us?

Hypothetical syllogism (HS)

In an earlier proof we chained two if-thens with a box: assume the first if-part, use →E twice, close with →I. That proof can be named once. Hypothetical syllogism (HS): from A → B and B → C, write A → C.

Side by side, the long proof has six lines and the short proof has three.

Two proofs side by side: the long one assumes P in a box, uses arrow-E twice and closes with arrow-I, and the short one writes the same last line with HS on line 3.

Double negation (DNE)

Two nots cancel. Double negation (DNE): from ¬¬A, write A. We proved this with indirect proof: assume ¬A, find a clash with ¬¬A, and write A. Now it is one step. Premises: ¬¬P and P → Q. Goal: Q.

#LineWhy
1¬¬Ppremise
2P → Qpremise
3PDNE 1
4Q→E 2, 3

DNE needs exactly two nots in front of the whole line. One not is not enough.

Excluded middle (LEM)

The theorem P ∨ ¬P was proved in the last module with no premises. Since it is proved, we may write it at any time, for any claim, with no lines to cite. We call that step excluded middle (LEM). It gives an or to feed or-out.

Key: P = It rains. Q = We take a coat. Premises: P → Q and ¬P → Q. Goal: Q. Ask: what gives Q? ∨E, but we need an or. LEM gives one.

#LineWhy
1P → Qpremise
2¬P → Qpremise
3P ∨ ¬PLEM
4│ Passume
5│ Q→E 1, 4
6│ ¬Passume
7│ Q→E 2, 6
8Q∨E 3, 4-5, 6-7

An eight-line proof: two premises, line 3 writes P or not-P by LEM, two boxes each reach Q, and line 8 writes Q by or-out citing 3, 4 to 5 and 6 to 7.

Every shortcut can still be unfolded into basic rules. A shortcut only saves lines.

Careful

DNE works on ¬¬A, not on a single ¬A. HS needs the then-part of the first if-then to match the if-part of the second.

Try it at home

  1. Say the rain and cinema chain aloud. Which two claims are chained?
  2. Copy the LEM proof. Colour the two boxes in two colours. Which line do both boxes reach?
  3. Make your own P ∨ ¬P about something at home. Is it always true?

Words to know

  • hypothetical syllogism (HS) - from A → B and B → C, write A → C
  • double negation (DNE) - from ¬¬A, write A
  • excluded middle (LEM) - a theorem you may write any time: P ∨ ¬P

Big idea

Three more shortcuts, HS, DNE and LEM, each come from a proof we already did, so none adds new power.

Lesson page →

Swapping Equal Parts

In the sum 3 + (2 + 2), you may swap 2 + 2 for 4 inside the brackets, and the total stays 7. Can a logic proof swap a part inside a line in the same way?

Whole lines and parts

The basic rules work on whole lines. They look at the main connective only. Take ¬(P ∧ Q). Its main connective is ¬, so it is a not-claim. ∧E does not apply, and writing ¬P from it by ∧E is a mistake.

A replacement rule is different. It swaps a part inside a line for an equivalent part. Two parts are equivalent when they always have the same truth value. Swapping one for the other cannot change the value of the whole, just as 2 + 2 and 4 are interchangeable in a sum. (Compare algebraic identities.)

The line P → not-not-Q with its part not-not-Q lifted out and replaced by Q, giving P → Q, with a label saying the part has the same truth value.

De Morgan and double negation

De Morgan (DeM) has two forms. Break the bar and change the connective. ¬(A ∧ B) and ¬A ∨ ¬B are equivalent. So are ¬(A ∨ B) and ¬A ∧ ¬B. In Level 3 we checked both with a table. Both directions are allowed.

Two swaps drawn with double arrows: not-(A and B) swaps with not-A or not-B, and not-(A or B) swaps with not-A and not-B.

Double negation also has a swap form, DN: ¬¬A and A may replace each other anywhere, in both directions, even inside a longer line. (DNE from the last lesson only removes two nots from a whole line.) Premise: P → ¬¬Q. The part ¬¬Q becomes Q.

#LineWhy
1P → ¬¬Qpremise
2P → QDN 1

A proof with De Morgan

Key: P = It is cold. Q = It is windy. Premises: ¬(P ∧ Q) (it is not both cold and windy) and P. Goal: ¬Q. Ask: what do we want? ¬Q. What gives it? DS, if we first have an or. DeM gives the or from line 1. DS then needs ¬¬P, and DN gives it from P (adding two nots is the other direction of the swap).

#LineWhy
1¬(P ∧ Q)premise
2Ppremise
3¬P ∨ ¬QDeM 1
4¬¬PDN 2
5¬QDS 3, 4

A five-line proof: two premises, line 3 swaps the not-and into not-P or not-Q by De Morgan, line 4 writes not-not-P by DN, and line 5 writes not-Q by DS.

Check line 5. DS needs A ∨ B and ¬A. Line 3 is ¬P ∨ ¬Q, so A is ¬P, and ¬A is ¬¬P, which is line 4. It writes ¬Q.

Is this a new power? No. A replacement is still a safe step, since equal parts never change the whole.

Careful

Never use ∧E on ¬(P ∧ Q). It is a not-claim, not an and. Swap it with DeM first, and then use a rule that fits.

Try it at home

  1. Make a truth table for ¬(P ∧ Q) and for ¬P ∨ ¬Q. Do all four rows agree?
  2. Say ¬(P ∨ Q) in English with a key, then say ¬P ∧ ¬Q. Do they mean the same?
  3. Copy the five-line proof. Underline the line where a swap happens.

Words to know

  • replacement rule - a rule that swaps a part inside a line for an equivalent part
  • De Morgan (DeM) - ¬(A ∧ B) swaps with ¬A ∨ ¬B, and ¬(A ∨ B) swaps with ¬A ∧ ¬B
  • double negation (DN) - ¬¬A and A swap with each other, both ways
  • equivalent - always having the same truth value

Big idea

A replacement rule swaps an equivalent part inside a line, because equal parts never change the value of the whole.

Lesson page →

Proof or Counterexample

A friend spends an hour on an argument and finds no proof. "So it must be invalid," she says. Is she right? What do we know when a proof fails?

Two kinds of answer

A proof shows that an argument is valid. Every rule we use was checked by a table: it never leads from true lines to a false line. So a proof can never "prove" an invalid argument.

A counterexample shows that an argument is invalid. In a table, it is a bad row: all premises true, conclusion false.

But a failed search shows nothing. Perhaps no proof exists. Perhaps we were not clever enough to find it. (That every valid argument does have a proof is a result we meet much later.)

Two doors: trying a proof leads to the answer valid if one is found, trying a table leads to the answer invalid if a bad row is found, and a failed proof attempt alone leads to a question mark.

Try both at once

The best method is to try both, side by side. Start with two arguments. Key: P = It rains. Q = The street is wet.

If P then Q
Not Q
So not P

A proof exists: MT on the two premises gives ¬P. The argument is valid. A table agrees: the only row with both premises true is FF, and there the conclusion ¬P is true.

#LineWhy
1P → Qpremise
2¬Qpremise
3¬PMT 1, 2

Now change the second premise.

If P then Q
Not P
So not Q

No proof comes. So we test with a table. Premises: P → Q and ¬P. Conclusion: ¬Q.

PQP → Q¬P¬Q
TTTFF
TFFFT
FTTTF
FFTTT

A four-row truth table for the argument if P then Q, not P, so not Q, with the third row circled in amber because both premises are true and the conclusion is false.

Reading the bad row

Row 3 has P false and Q true. Both premises are true: P → Q is true, since its if-part is false, and ¬P is true. The conclusion ¬Q is false. This is the bad row.

In words: it does not rain, but the street is wet for another reason, like a washing truck. The premises hold and the conclusion fails. The argument is invalid, and no proof can exist for it.

So the plan is simple. Try a proof. Try the short table test. One of them gives a clear answer.

Careful

A failed proof is not a counterexample. Only a bad row in a table shows that an argument is invalid.

Try it at home

  1. Make the four-row table for the first argument, P → Q and ¬Q. Is there a bad row?
  2. Change the key to P = The bell rings and Q = School starts. Read both arguments aloud.
  3. Find a different reason, like the washing truck, that makes row 3 true in real life.

Words to know

  • proof - a chain of rule steps that shows an argument is valid
  • counterexample - a case where all premises are true and the conclusion is false
  • bad row - a table row with all premises true and the conclusion false

Big idea

A proof shows that an argument is valid, a bad row shows that it is invalid, and a failed search shows nothing.

Lesson page →

English into Proofs

Harder Translations

"If it rains, then if the bus is late, I walk." That is an if inside an if. Real English is full of such claims. How do we write them in letters without changing what they say?

An if inside an if

Key: R = It rains. B = The bus is late. W = I walk. The sentence says: if R, then (if B, then W). The inner if sits inside brackets: R → (B → W). The brackets matter. (R → B) → W says something else: "If rain always makes the bus late, then I walk."

In a proof, an if inside an if matches a box inside a box. Premise: (R ∧ B) → W. Goal: R → (B → W). Ask: what do we want? An if, so we assume its if-part. Do it twice.

#LineWhy
1(R ∧ B) → Wpremise
2│ Rassume
3│ │ Bassume
4│ │ R ∧ B∧I 2, 3
5│ │ W→E 1, 4
6│ B → W→I 3-5
7R → (B → W)→I 2-6

A proof with a small box inside a bigger box: the inner box closes on line 6 with if-in, and the outer box closes on line 7 with the goal.

Only if, unless, neither...nor

These words go inside bigger claims too. Three rules from before still hold.

Only if "I walk only if the bus is late" is W → B. Walking needs a late bus. Unless: "The match goes ahead unless it rains" is ¬R → M, with M = The match goes ahead. If it does not rain, it goes ahead. Neither...nor: "If neither Ali nor Bo comes, we cancel" is ¬(A ∨ B) → C.

Find the main connective first. In each of these it is the arrow, and the small claims sit on its two sides.

Three cards, each with an English word and its symbols: only if gives W → B, unless gives not R → M, and neither nor gives not of A or B.

When English says two things

Some sentences have two readings. "Ana brings bread and cheese or fruit." With B = bread, C = cheese and F = fruit, there are two ways to bracket it. Reading 1: (B ∧ C) ∨ F, bread with cheese, or else fruit. Reading 2: B ∧ (C ∨ F), bread, and also cheese or fruit.

They differ. Suppose Ana brings only fruit. Reading 1 is true, because F is true. Reading 2 is false, because B is false. When a sentence is unclear, write both readings. Then choose, or ask the speaker.

Two readings of one sentence side by side, with the case where Ana brings only fruit: the first reading is true and the second is false.

Two more phrases. "P provided that Q" is an if: Q → P. "P just in case Q" is P ↔ Q, the if and only if of logic books.

Careful

In everyday speech "just in case" often means "as a precaution", and people say "if" when they mean "if and only if". Logic books fix the meaning: only "just in case" and "if and only if" give ↔.

Try it at home

  1. Write "If you ask, then if I can, I will help" in letters, with a key. Where do the brackets go?
  2. Find an English sentence with "and" and "or" together. Write both readings and say who would be pleased by each.
  3. Take "I leave unless you call". Write it as an if. Say what happens if you do call.

Words to know

  • only if - A only if B is A → B: A needs B
  • unless - A unless B is ¬B → A: if B does not happen, A does
  • two readings - one sentence that can be bracketed in two ways, so it says two different things
  • just in case - in logic books, the same as if and only if (↔)

Big idea

Write the key, find the main connective, keep the brackets, and when English has two readings, write both.

Lesson page →

The Missing Step

"It rained last night. So the match was called off." It sounds fine. But try to prove it, line by line. Where does the proof get stuck, and what does that tell us?

A proof that gets stuck

Key: R = It rained last night. M = The match was called off. Premise: R. Goal: M.

Ask: what do we want? M. What gives M? The usual way is →E, from an if-then ending in M, and its if-part. But we hold no if-then. No rule makes M out of R alone. The proof is stuck.

A proof with line 1, R, as the only premise, a gap marked with a question mark on line 2, and the goal M on line 3 that has no way to be reached.

The stuck place shows the missing premise

The stuck place tells us exactly what is missing: a line that would let →E work. Here it is R → M: "If it rained, the match was called off." Add it as a premise and the proof closes.

#LineWhy
1Rpremise
2R → Mpremise (added)
3M→E 2, 1

We chose R → M because it is the weakest premise that works. It claims no more than the proof needs. Any other added premise that finishes the proof would already imply it.

The same proof with the missing premise added as line 2, R arrow M, so that line 3, M, follows by if-out from lines 2 and 1.

Is the new premise true?

Now the real question comes: is R → M true? Maybe not. A covered pitch can stay dry in the rain. The proof did its work. It showed what we must believe for the argument to hold.

Two cases are different. In the first, the missing premise is plain and probably true, like "If Ana has a ticket, she can enter". The argument was only incomplete. In the second, the only premise that works is one we have no reason to believe, like "If many people like pizza, the moon is made of cheese". Then the argument is bad, not just incomplete.

Careful

Adding a premise does not prove the conclusion. It only moves the question to the new premise, and that must be checked.

Try it at home

  1. Take the argument "Sam is a student, so Sam pays less." Write a key, start a proof and find the gap.
  2. Write the weakest premise that fills the gap. Then write one stronger premise that would also work. Which one is safer?
  3. Ask a friend whether your added premise is true. Do they agree?

Words to know

  • missing premise - a claim the argument needs but does not say
  • weakest premise - the premise that claims least while still letting the proof finish
  • stuck place - the line where no rule can go further, which shows what is missing

Big idea

A stuck proof points at the missing premise: add the weakest one that works, then ask if it is true.

Lesson page →

Proving an Everyday Argument

Mum's cake has vanished. Ben or Cleo took it. Ben's shirt is clean. Can we prove who did it, one careful step at a time?

The case in letters

Here is the case. "Ben or Cleo took the cake. If Ben took it, there would be crumbs on his shirt. There are no crumbs on his shirt. So Cleo took it."

Key: B = Ben took the cake. C = Cleo took the cake. S = There are crumbs on Ben's shirt. Premises: B ∨ C, B → S and ¬S. Goal: C.

The case as a picture: three claim boxes for the premises, B or C, if B then S, and not S, an arrow, and the conclusion C in a green box.

The proof, with boxes

Ask: what do we want? C. What gives it? We have an or, so ∨E. We need two boxes: one that starts with B, one that starts with C, and both end in C.

In the first box we assume B. Then S follows, and that clashes with ¬S. From a clash, anything follows, even C. In the second box we assume C, and repeat it.

#LineWhy
1B ∨ Cpremise
2B → Spremise
3¬Spremise
4│ Bassume
5│ S→E 2, 4
6│ ⊥¬E 5, 3
7│ CX 6
8│ Cassume
9│ CR 8
10C∨E 1, 4-7, 8-9

Line 10 cites the or and the two boxes, as ∨E needs. Every box is closed, and no line inside a closed box is used outside it.

The ten-line proof with its two boxes marked: the first box runs from line 4 to line 7, the second from line 8 to line 9, and line 10 is highlighted.

Are the premises true?

The proof shows the argument is valid: if the premises are true, Cleo took it. It does not show that they are true. So we ask the old question: is the argument also sound?

Premise 2 is the weak one. Ben may have wiped his shirt, or eaten the cake at the table. If so, the argument is valid but not sound, and we have not found the thief. Proof checks the shape. Evidence checks the premises.

The shortcuts of the last module make it shorter. MT on lines 2 and 3 gives ¬B. Then DS on lines 1 and ¬B gives C. That is five lines in all. The boxes above show every step that those shortcuts hide.

Careful

A valid proof is not a true conclusion. If one premise is false, the proof still stands, but the conclusion may be false.

Try it at home

  1. Write your own small case: two suspects, one clue for each. Make a key with letters.
  2. Write the premises and the goal. Ask: what do we want, what gives it?
  3. Try the proof with boxes. Then ask of each premise: could it be false?

Words to know

  • key - the list that says what each letter means
  • valid - if the premises are true, the conclusion must be true
  • sound - valid, and all the premises are true

Big idea

Write the key, make the letters, prove it with boxes, and then ask if the premises are true.

Lesson page →

Checking a Proof

Let P = The moon is made of cheese and Q = Mice live there. Here is a proof: "P → Q. P. So Q." Can you check it without knowing anything about the moon?

Checking by rule alone

Yes, you can. Line 3 says →E on lines 1 and 2. Line 1 is P → Q. Line 2 is P. →E allows Q. The step is right. We never asked whether the moon is cheese.

That is the point of rules. Each line can be checked by its shape, with no understanding of the topic. A checker needs only the rule list, the lines, and a careful eye.

#LineWhy
1P → Qpremise
2Ppremise
3Q→E 1, 2

Computers check proofs this way. A proof assistant such as Lean accepts a proof only if every line obeys a rule.

Three cards in a row for checking one line: which rule, which lines are cited, and whether the lines have the right shape, with a tick on the last card.

Four common faults

Check every line against four questions. 1. Wrong shape. The rule does not fit. From P → Q and Q, you cannot write P by →E. That is affirming the then-part. 2. A closed box. A line inside a box can be used only inside that box. 3. Wrong lines cited. The rule fits, but the numbers point to other lines. 4. A box left open. Every box must close before the proof ends.

Here is a proof with one fault. Premises: P → Q and Q. Goal: P.

#LineWhy
1P → Qpremise
2Qpremise
3P→E 1, 2

→E needs the if-part, P, on a line. Line 2 is the then-part, Q. Line 3 is the fault of the wrong shape.

Four cards, one for each fault: wrong shape, a closed box, wrong lines cited, and a box left open, each with a short example line.

How to hunt a fault

Go down the lines from the top. For each line, ask: which rule? Which lines? Do the lines have the shape the rule wants? Is each cited line still usable? The first line that fails is your fault. A line can look right and still be wrong. The rule list decides, not the feeling.

A proof with no fault proves that the argument is valid. Later, we will see why proofs can be trusted.

Careful

Finding no fault in line 5 does not clear line 3. Check every line, one by one.

Try it at home

  1. Copy a proof from this module. Change one citation to a wrong number and ask a friend to find it.
  2. Write a three-line proof that uses →E the wrong way, with the then-part. Mark the fault.
  3. Check a proof by covering all its lines except the line you are checking and its cited lines.

Words to know

  • fault - a line that breaks a rule of proof
  • wrong shape - the lines cited do not have the form the rule wants
  • proof assistant - a program that checks every line of a proof by its rule

Big idea

Every line of a proof can be checked by rule alone: look for a wrong shape, a closed box, wrong lines, or a box left open.

Lesson page →

Strategy and the Big Picture

One Card of Rules

A board game comes with a card that lists every move. A new player learns the game from that card. Proofs have a card too, and it fits in your hand. What is on it, and why do the moves feel so natural?

Two rules for each connective

Every connective has an in-rule and an out-rule. The in-rule says what it takes to prove a claim of that shape. The out-rule says what you may do with such a claim once you have it.

Take ∧. To prove A ∧ B you must get both A and B: that is and-in (∧I). Once you hold A ∧ B you may take either side: that is and-out (∧E). The other connectives work the same way, and the whole system fits on one card.

A card with five rows, one for each of and, or, if, iff and not, showing the in-rule and the out-rule of each in a few words.

Look at the shapes on the card. The in-rules for →, ↔ and ¬ need a box, because to prove an if you suppose its if-part. The out-rule for ∨ needs two boxes, because an or gives two cases. The rest use plain lines.

There is one more pair. ⊥ (a clash) can be turned into anything by clash-out (X). And indirect proof (IP) turns a box that assumes ¬A and reaches ⊥ into A.

Why "natural"?

The system is called natural deduction because its moves copy how people really argue. We suppose something and see what follows. We split a problem into cases. We suppose the opposite and look for a clash.

Gentzen and Jaśkowski, working apart, built it in 1934. Fitch drew the boxes in 1952, the way we draw them. Proof assistants such as Lean and Coq still check proofs with rules of this kind.

Three panels: suppose, which opens a box and ends with if-in; cases, which uses two boxes and ends with or-out; and clash, which ends with not-in or indirect proof.

There are other proof systems, with tables of rules or with trees. They prove the same claims. We use this one because it is the closest to speech.

Using the card

A short proof shows the card at work. From P ∧ Q we build Q ∧ P. First an out-rule, twice. Then an in-rule.

#LineWhy
1P ∧ Qpremise
2P∧E 1
3Q∧E 1
4Q ∧ P∧I 3, 2

Lines 2 and 3 take the premise apart. Line 4 builds a new claim. When you are stuck, ask: do I need to build this claim, or use one I have? Building asks for an in-rule. Using asks for an out-rule.

Careful

Do not mix the two up. To use A ∧ B you take it apart (out). To get A ∧ B you must first have both sides (in).

Try it at home

  1. Copy the card onto a small piece of paper. Keep it beside your notebook.
  2. For each of ∧, ∨, → write one sentence: what must I show to prove it, and what can I do with it?
  3. Prove P ∧ Q from P ∧ R and Q ∧ S. Mark each line as an in-rule or an out-rule.

Words to know

  • in-rule - says what it takes to prove a claim of that shape
  • out-rule - says what you may do with a claim of that shape
  • natural deduction - a proof system whose rules copy how people argue

Big idea

Every connective has an in-rule that builds it and an out-rule that uses it, and together they make one card.

Lesson page →

Which Rule Next?

You open a puzzle box with no instructions. Where do you start? In a proof the answer is: look at what you want, then at what you have. Which rule do we try next?

Look at the goal

The main connective of the goal tells you the first move.

GoalFirst move
A → Bassume A in a box, aim for B, close with →I
¬Aassume A, aim for ⊥, close with ¬I
A ∧ Bprove A, prove B, join with ∧I
A ∨ Bprove one side, then ∨I
A ↔ Btwo boxes, A to B and B to A, then ↔I

If you cannot reach either side of an or, use indirect proof: assume ¬(A ∨ B) and aim for ⊥. It works for any goal, but try the goal's own move first, because it is usually shorter.

A card with two columns. On the left, look at the goal. On the right, look at the premises: an and is taken apart, an or means cases, an if needs its if-part.

Look at the premises

Then look at what you hold. An and premise: take it apart with ∧E. An or premise: plan cases, one box for each side, both aiming for the same claim, then ∨E. An if premise: use →E as soon as you have its if-part, or aim to get that if-part.

Work forwards from the premises and backwards from the goal. Stop when the two meet.

One proof, found in order

Key: P = It rains. Q = It snows. R = We stay in. Premises: P → R and Q → R. Goal: (P ∨ Q) → R.

What do we want? An if. So we assume its if-part, P ∨ Q, and aim for R. Now we hold an or. So we plan cases: assume P and aim for R, then assume Q and aim for R. What gives R in each case? →E with a premise.

#LineWhy
1P → Rpremise
2Q → Rpremise
3│ P ∨ Qassume
4│ │ Passume
5│ │ R→E 1, 4
6│ │ Qassume
7│ │ R→E 2, 6
8│ R∨E 3, 4-5, 6-7
9(P ∨ Q) → R→I 3-8

The nine-line proof drawn with its boxes: a big box from line 3 to line 8, and inside it two small boxes for the cases P and Q.

Line 8 closes the two case boxes. Line 9 closes the big box. Each step came from one question about the goal or the premises.

Careful

Do not start by assuming something at random. A box needs a reason: the goal asked for it, or an or premise asked for cases.

Try it at home

  1. Write the goal P ↔ Q. Draw the two boxes it needs, leaving the middle empty.
  2. Take premises A ∨ B, A → C, B → C and goal C. Which strategy do the premises ask for?
  3. Find a proof of P → (Q → P) by asking the goal's question twice.

Words to know

  • goal - the claim at the bottom of a proof, the one we want
  • strategy - a plan for choosing the next rule
  • cases - one box for each side of an or

Big idea

Ask what the goal's main connective needs, then what the premises offer, and try indirect proof when you are stuck.

Lesson page →

Logic Inside Maths Proofs

Euclid wrote his Elements about 300 BC, and it is still a model of careful proof. Do mathematicians use other rules than ours? No. Their proofs are written in words, but the moves are the ones on our card. Can you spot them?

Assume, reach, if-in

Claim: the sum of two even numbers is even. An even number is 2 times a whole number. Proof: take two even numbers, a and b. So a = 2 × m and b = 2 × n for whole numbers m and n. Then a + b = 2 × m + 2 × n = 2 × (m + n). That is 2 times a whole number, so a + b is even.

We supposed "a and b are even" and reached "a + b is even". That is a box closed by if-in: if two numbers are even, then their sum is even. The words "take two even numbers" open the box.

Three cards, one for each maths proof, naming its logic move: assume, reach and if-in; cases and or-out; suppose, clash and not-in.

Cases

Claim: n × (n + 1) is even for any whole number n. A whole number is even or odd, and each case gets its own box. If n is even, then n = 2 × k, so n × (n + 1) = 2 × k × (n + 1), which is even.

If n is odd, then n = 2 × k + 1. So n + 1 = 2 × k + 2 = 2 × (k + 1). Then n × (n + 1) = n × 2 × (k + 1), which is even too.

Both boxes reach the same claim. So by or-out (∨E) the claim holds. Write E = n is even, O = n is odd and M = n × (n + 1) is even. Arithmetic gives E → M and O → M. The proof is then the shape from the last lesson.

#LineWhy
1E ∨ Opremise
2E → Mpremise
3O → Mpremise
4│ Eassume
5│ M→E 2, 4
6│ Oassume
7│ M→E 3, 6
8M∨E 1, 4-5, 6-7

A proof with two case boxes side by side, one assuming E and one assuming O, both reaching M, closed on the last line by or-out.

Suppose there is one

Claim: there is no largest whole number. Suppose there is one, and call it N. Then N + 1 is also a whole number. It is bigger than N. But N is the largest. That is a clash.

So the supposition was wrong. The box that assumed "there is a largest whole number" reached ⊥, and not-in (¬I) lets us write its opposite. For more on this style of reasoning, see mathematical proof.

Notice the strategy table at work. The goal was a not, so we assumed the thing and aimed for ⊥.

Careful

One case is not enough. If you split into cases, each side of the or needs its own box that reaches the same claim.

Try it at home

  1. Prove in words: the sum of an even number and an odd number is odd. Which move did you use?
  2. Find the cases in this claim: any whole number n gives n × n with the same parity as n. Write both boxes.
  3. Say what the box assumes and what it must reach in "there is no smallest positive fraction".

Words to know

  • even - 2 times a whole number
  • odd - 2 times a whole number, plus 1
  • parity - whether a whole number is even or odd

Big idea

Maths proofs in words use the same moves as our card: assume and reach, cases, and suppose and clash.

Lesson page →

A Long Proof, Start to Finish

Here is a school puzzle. "If Ana or Ben is elected, the gym is not free." Can we prove it from four plain facts? A long proof is only a short one done many times. What is the plan, and what do we check at the end?

The argument and its plan

Key: A = Ana is elected. B = Ben is elected. M = There is a match day. F = The field is booked. G = The gym is free. Premises: if Ana is elected, there is a match day. If Ben is elected, there is a match day. If there is a match day, the field is booked. If the field is booked, the gym is not free.

A → M
B → M
M → F
F → ¬G
So (A ∨ B) → ¬G

Plan by strategy. The goal is an if, so assume its if-part, A ∨ B, and aim for ¬G. We hold an or, so we need cases. In each case a chain of →E steps leads to ¬G.

The fifteen-line proof: four premises, a big box from line 5 to line 14, and inside it two case boxes, lines 6 to 9 for Ana and 10 to 13 for Ben.

The proof, checked

#LineWhy
1A → Mpremise
2B → Mpremise
3M → Fpremise
4F → ¬Gpremise
5│ A ∨ Bassume
6│ │ Aassume
7│ │ M→E 1, 6
8│ │ F→E 3, 7
9│ │ ¬G→E 4, 8
10│ │ Bassume
11│ │ M→E 2, 10
12│ │ F→E 3, 11
13│ │ ¬G→E 4, 12
14│ ¬G∨E 5, 6-9, 10-13
15(A ∨ B) → ¬G→I 5-14

Check it line by line. Lines 7-9: →E needs the if and its if-part. Line 14: ∨E cites the or and both boxes, and both end in ¬G. Line 15: →I cites the whole outer box, which starts with A ∨ B and ends with ¬G. Every box is closed. Lines 7-9 and 11-13 are the same chain, once for each case.

Sound or not?

The proof shows the argument is valid: the conclusion follows from the premises. Is it sound? Only if the premises are true in this school. If the gym is free on match days, the last premise is false, and the proof proves nothing about the real gym.

A checklist for any proof: key and letters; premises and goal; a plan by strategy; every line justified; every citation right; every box closed; then, for an English argument, are the premises true?

A checklist of six steps, from the key at the top down to the question of whether the premises are true.

Careful

A checked proof does not make the conclusion true. It shows the conclusion follows. The premises still need to be true.

Try it at home

  1. Change the argument: drop the last premise. Which line of the proof breaks, and why?
  2. Write your own four-premise puzzle with a key. Plan the proof in words before you draw a line.
  3. Check a friend's proof with the checklist. Mark each tick or cross.

Words to know

  • valid - the conclusion must be true whenever the premises are
  • sound - valid, and the premises are true
  • checklist - a list of things to check every time

Big idea

A long proof is a plan followed line by line, and the end of the job is always the same question: are the premises true?

Lesson page →