Logic and Proof

☰ Contents

A proof is an argument that covers every case at once, including the cases nobody will ever check. Checking a thousand cases is evidence. A proof settles the question. The methods below are the shapes that argument can take.

What are the pieces of a mathematical argument?

A mathematical argument is built from a few kinds of statement. A definition fixes what a word means; it is a choice, so it is neither true nor false. A proposition is a claim that is either true or false. A theorem is a proposition that has been proved, a lemma is a smaller theorem proved on the way to a bigger one, and a corollary follows from a theorem in a step or two. Define a multiple of 3 as 3k for a whole number k. Then "the sum of two multiples of 3 is a multiple of 3" becomes a theorem once 3a + 3b = 3(a + b) is shown, and the same claim for three multiples is a corollary. The labels matter because a proof may use only definitions and statements already proved. A conjecture seems true but has no proof yet. An instance is not a proof: 6 + 9 = 15 illustrates the theorem without proving it.

what it isdefinitionfixes a meaningpropositiona claim, true or falsetheorema claim with a proof
Mathematics uses three kinds of sentence, and they do three different jobs. Full lesson: Definitions, Propositions and Theorems

This is why arguing about whether 1 is prime goes nowhere. The definition leaves 1 out so that every whole number has exactly one prime factorization. That is a choice, not a discovery.

Statements are joined by and, or and not, and a truth table lists every combination of true and false so that each connective is pinned down. In mathematics or is inclusive: P or Q is true when both hold.

PQP and QP or Q1TTTT2TFFT3FTFT4FFFF
P or Q is true in three cases. In mathematics or includes the case where both hold. Full lesson: Logical Connectives and Truth Tables

The negation of a statement is true exactly when the statement is false, and it must deny no more than that. The negation of x > 5 is x ≤ 5, not x < 5, because x = 5 was never ruled out. Under a negation and becomes or, and or becomes and. These are De Morgan's laws.

not (P and Q)at least one of them fails(not P) or (not Q)
Denying that both hold only says at least one fails. And becomes or under a negation. Full lesson: Negating a Statement

See Definitions, Propositions and Theorems, Logical Connectives and Truth Tables and Negating a Statement.

Now you

the shape is a square and blue

What is the negation of the statement drawn?

Why is the contrapositive true and the converse not?

A conditional statement "if P then Q" is false in only one case: P true and Q false. The contrapositive, "if not Q then not P", fails in exactly that case, so it is true whenever the original is. The converse, "if Q then P", fails when Q is true and P is false, a different case, so it can be false while the original is true. Take "if a number ends in 0, it is divisible by 5". Its contrapositive, "if a number is not divisible by 5, it does not end in 0", is true. Its converse, "if a number is divisible by 5, it ends in 0", is false: 15 = 3 × 5 ends in 5. When both directions hold, the statement is an "if and only if", and each direction needs its own proof. For the original, the breaking case never occurs: a number ending in 0 is a multiple of 10, and 10 = 2 × 5.

whole numbersmultiple of 4even·P ⇒ Qthe statement·¬Q ⇒ ¬Pcontrapositive·Q ⇒ Pconverse·¬P ⇒ ¬Qinversen = 8

a statement and its contrapositive are broken by the same numbers, which is why one is true whenever the other is

Find a number that makes the converse false

It is written P ⇒ Q, with P the hypothesis and Q the conclusion. When P is false the conditional promises nothing, so it cannot be broken.

PQif P then Q1TTT2TFF3FTT4FFT
Only one case breaks the promise: the hypothesis is true and the conclusion is false. Full lesson: Conditional Statements

In symbols the converse is Q ⇒ P, and the contrapositive is not Q ⇒ not P. With "if n is a multiple of 4 then n is even", the converse fails at n = 6, while the contrapositive, "if n is not even then n is not a multiple of 4", is true.

A truth table settles it in four rows. The columns for P ⇒ Q and not Q ⇒ not P agree in every row, so the two statements are logically equivalent. The converse pairs off with the inverse, not P ⇒ not Q, in the same way.

PQP→Q¬Q→¬P1TTTT2TFFF3FTTT4FFTT
The two columns agree in all four cases, so the two statements say the same thing. Full lesson: The Contrapositive
sayspair oneoriginal, contrapositivepair twoconverse, inverse
So the four statements fall into two pairs, and the pairs need not agree with each other. Full lesson: The Contrapositive

P is sufficient for Q when P guarantees Q, and P is necessary for Q when Q cannot happen without P. When a condition is both, the statement reads "P if and only if Q", and proving it means proving P ⇒ Q and Q ⇒ P. Leaving out one direction leaves the claim unproved.

See Conditional Statements, The Converse and the Inverse, The Contrapositive, Necessary and Sufficient Conditions and If and Only If.

Now you

saysconverseif Q then Pinverseif not P then not Qcontraposif not Q then not P

Which statement always agrees with the converse?

saysconverseif Q then Pinverseif not P then not Qcontraposif not Q then not P

Which of the three has to be true whenever the original is?

How do quantifiers change a statement?

A quantifier says how many objects a claim covers. "For all", written ∀, claims something of every object in a set; "there exists", written ∃, claims that at least one object has the property. They are proved and disproved in opposite ways. A for-all claim needs an argument covering every case, and one counterexample disproves it. A there-exists claim needs one example, and disproving it means ruling out every case. So "every prime is odd" falls to the prime 2, while "some square ends in 6" is proved by 4 × 4 = 16. The reason is negation: the negation of a for-all claim is a there-exists claim. The order of quantifiers changes the meaning. "For every x there is a larger y" is true for whole numbers, since y = x + 1 works, but "there is a y larger than every x" claims a largest number and is false. To negate a quantified claim, swap the quantifier and negate what follows it.

6x₁x₂x₃x₄x₅x₆x₇x₈∀x: x ≤ 6 true∃x: x > 6 false

every x ≤ 6, so ∀x: x ≤ 6 is true and ∃x: x > 6 is false: the two statements are each other's negation and always disagree

Lift x₅ above 6 and read both statements

proved bybroken byfor allan argumentone exampleexistsone examplean argument
A for all claim is proved by an argument and broken by one example. Exists is the reverse. Full lesson: For All and There Exists

"Every person has a mother" and "there is a person who is the mother of everyone" use the same quantifiers in opposite orders, and only the first is true.

The negation of "every swan is white" is "some swan is not white", not "no swan is white", which claims far more.

not: all primes are oddand 2 is that primesome prime is not odd
Not all primes are odd. The negation says some prime is not odd, and 2 is that prime. Full lesson: Negating a Quantified Statement

See For All and There Exists and Negating a Quantified Statement.

Now you

there exists a whole n with

What is the negation of the statement drawn?

What are the standard ways to prove something?

Most proofs use one of six methods: direct proof, proof by the contrapositive, proof by exhaustion, disproof by counterexample, a uniqueness proof, and proof by induction. A direct proof assumes the hypothesis and takes forced steps to the conclusion. To prove that the product of two odd numbers is odd, write them as 2a + 1 and 2b + 1; their product is 4ab + 2a + 2b + 1, which is 2(2ab + a + b) + 1, so it is odd. For instance, 7 × 9 = 63 = 2 × 31 + 1. The shape of the claim chooses the method. When the hypothesis gives little to work with, as in "if n² is odd then n is odd", prove the contrapositive. A few cases call for exhaustion, a false claim for one counterexample, and a claim about every whole number for induction. A proof is complete only when each step follows from earlier ones, so name what justifies every line.

To show that the sum of two even numbers is even, write them as 2a and 2b. The sum is 2(a + b), which is 2 times a whole number, so it is even.

the movestartassume the hypothesismiddleforced steps onlyendstate the conclusion
That is the whole method: assume the hypothesis, take forced steps, state the conclusion. Full lesson: Direct Proof

Proof by the contrapositive proves not Q ⇒ not P instead, and it is the right choice when the negated statements are easier to work with. To prove that if n² is even then n is even, start from "n is odd": n = 2k + 1, so n² = 4k² + 4k + 1, which is odd. That proves the claim, with no extra step.

Proof by exhaustion splits the claim into a finite list of cases and proves each one. Check first that the cases leave nothing out. "n is even or odd" covers every whole number. "n is prime or composite" does not, because 1 is neither.

Disproof by counterexample ends a general claim with one case where it fails. n² + n + 41 is prime for every n from 0 to 39, and that proves nothing.

n = 41:
every term carries a factor of 41
= 41(41 + 1 + 1)
At n = 41 every term carries a factor of 41, so the value is 41 × 43, which is not prime. Full lesson: Disproof by Counterexample

A claim that exactly one object exists needs two arguments: produce one object that works, then take any two that work and show they are equal. Proof by induction shows a statement holds at n = 1 and that each case forces the next; it is taught in the sequences and series guide.

See Direct Proof, Proof by the Contrapositive, Proof by Exhaustion, Disproof by Counterexample, Proving Existence and Uniqueness and Proof by Induction.

Now you

assume Pforced stepsconclude Q

What does a direct proof never do?

assume Pforced stepsconclude Q

A direct proof of "if n is odd then n² is odd" starts how?

Two counting arguments with their own names

The pigeonhole principle says that when more objects than boxes are placed into the boxes, some box holds at least two. It proves that a pair exists without saying which pair, and often that is all a proof needs.

still to deal2111
The fifth object has nowhere new to go, so some box ends up holding two. Full lesson: The Pigeonhole Principle

Counting by a bijection matches two collections one to one, with nothing left over, to prove they have the same size. A set of n elements has 2ⁿ subsets, because each subset matches exactly one string of n yes-or-no choices.

*×*×|×*×*×*×|×*×*jars of 2, 3 and 2
Write the coins as stars and the walls between jars as bars, in one row. Full lesson: Counting by a Bijection

See The Pigeonhole Principle and Counting by a Bijection.

Which inequalities are worth knowing by name?

Four inequalities are worth knowing by name: the triangle inequality, the AM-GM inequality, the Cauchy-Schwarz inequality, and the growth ordering of exponentials, polynomials and logarithms. Each bounds a quantity when an exact value is hard to find or not needed. The AM-GM inequality is the most used: for nonnegative a and b, the arithmetic mean (a + b)/2 is at least the geometric mean √(ab). With a = 9 and b = 1, (9 + 1) ÷ 2 = 5 and √9 = 3, and 5 ≥ 3. It holds because a square is never negative: the square of √a − √b is at least 0, which rearranges into the inequality. Equality needs a = b, and that is how the inequality finds a minimum. For x > 0, x + 1/x ≥ 2, with the minimum at x = 1, because the geometric mean of x and 1/x is 1. Try a value: x = 4 gives 4 + 1/4, which is above 2.

(a + b)/2 = 4√(ab) = 3.464a = 2b = 6

the altitude √(ab) = 3.464 is half a chord, so it is shorter than the radius (a + b)/2 = 4: (a + b)/2 ≥ √(ab)

Slide the split until the altitude reaches the radius

The triangle inequality says that in any triangle with sides a, b and c, a + b ≥ c. Written as |a + b| ≤ |a| + |b|, it holds for numbers, vectors and complex numbers.

abc
Walk straight from one corner to another along c, or go around by way of a and b. Full lesson: The Triangle Inequality

In symbols the inequality is (a + b)/2 ≥ √(ab), with equality only when a = b. The proof is one square: (√a − √b)² ≥ 0, so a − 2√(ab) + b ≥ 0. Rearrange to a + b ≥ 2√(ab) and halve both sides. Among rectangles of a fixed area, the square has the smallest perimeter.

The Cauchy–Schwarz inequality says that the dot product of two vectors is at most the product of their lengths, |a · b| ≤ |a| |b|, because a · b = |a| |b| cos θ and a cosine never exceeds 1.

a|a|b|b|θ
Two vectors meet at an angle, and the dot product is |a| |b| cos θ. Full lesson: The Cauchy–Schwarz Inequality

The growth ordering says that in the long run an exponential outgrows every polynomial, and a polynomial outgrows every logarithm. A large power delays the crossing point but does not remove it.

log₂nn²2ⁿn = 421616n = 8364256n = 16425665536
At n = 4 both n² and 2ⁿ equal 16. By n = 16, n² is 256 and 2ⁿ is 65536. Full lesson: Polynomial, Exponential and Logarithmic Growth

See The Triangle Inequality, The Arithmetic Mean–Geometric Mean Inequality, The Cauchy–Schwarz Inequality and Polynomial, Exponential and Logarithmic Growth.

Now you

a = 49, b = 1one is an averagecompare the two means

Take a = 49 and b = 1. Which is the arithmetic mean?

a = 4, b = 1one is an averagecompare the two means

Take a = 4 and b = 1. Which is the arithmetic mean?

How do you find a proof when you are stuck?

When you are stuck, use a heuristic: a method for finding a proof rather than writing one. Three do most of the work: working backward from the goal, solving a simpler version first, and moving from special cases to the general one. Suppose you want the number of diagonals of an n-sided polygon. Count small cases: a square has 2, a pentagon 5, and a hexagon 9. Each vertex joins n − 3 others by a diagonal, and each diagonal has two ends, which suggests n(n − 3)/2. Small cases help because they can be checked by hand and they expose the pattern a general argument must explain. A pattern is not a proof, though: the counting argument proves the formula, not the table. Working backward changes the order of writing: you find the steps from the goal, then write the proof forward from the hypothesis. Test the formula on a counted case: for a hexagon, 6 × 3 ÷ 2 = 9.

Working backward from the goal starts at the conclusion and asks what would produce it, then what would produce that, until the requirement is something already known.

Solving a simpler problem first shrinks the problem until it can be done by hand, and the small cases show the rule.

diagonals4 sides25 sides56 sides9
Draw the small cases instead. Four, five and six sides can all be counted by hand. Full lesson: Solving a Simpler Problem First

Going from a special case to every case needs a general argument. Adding the odd numbers in order gives 1, 4, 9, 16, and that is a conjecture until an argument covers every n. Check also that the special case used nothing the general case lacks. A proof that quietly assumes a right angle, or positive numbers, has proved a narrower theorem than it claims.

1357
An n by n square is built from L-shaped layers, and each layer holds an odd number of dots. Full lesson: From a Special Case to Every Case

Finding the flaw in an argument is the reverse skill. In the classic proofs that 1 = 2, the false conclusion means one step is unjustified, and it is usually a division by a − b when a = b, which is division by 0.

worth checkingdivideby something zerosquare rootsign lostassumethe conclusion used
A few moves account for most flaws, so check those first when a conclusion is absurd. Full lesson: Finding the Flaw in an Argument

See Working Backwards from the Goal, Solving a Simpler Problem First, From a Special Case to Every Case and Finding the Flaw in an Argument.

The mistakes worth naming

Where this leads next

The geometry proofs in the lines, angles and Pythagoras guide are direct proofs with diagrams, and the circle theorems in the congruence and circle theorems guide are a chain of them. Induction is developed with the sequences and series it proves. The pigeonhole principle and bijections are used again in the sets and counting guide.

Your turn

Three to try — tap what you get.

If it rains, the ground gets wet. The ground is not wet. So

A counterexample

"All primes are odd" is disproved by

Questions and answers

What is the difference between the converse and the contrapositive?
The converse of 'if P then Q' is 'if Q then P', a different statement that may be false. The contrapositive is 'if not Q then not P', and it is exactly as true as the original. 'If a number is divisible by 4 then it is even' is true; its converse is false, since 6 is even; its contrapositive, 'an odd number is not divisible by 4', is true. Proving the contrapositive proves the original.
How do you negate a statement with for all in it?
Swap the quantifier and negate what follows. The negation of every swan is white is not no swan is white, but there exists a swan that is not white. Likewise the negation of there exists a solution is every candidate fails to be a solution. This is why disproving a universal claim needs only one counterexample, while disproving an existence claim requires ruling out every case.
What is the pigeonhole principle?
If more items are placed into fewer containers, some container holds at least two items. It sounds too obvious to be useful and it proves surprising things: among any 13 people two share a birth month, and in any group of 6 people there are three mutual acquaintances or three mutual strangers. Its power is that it guarantees something exists without identifying it, which is often all a proof needs.
Why does one counterexample disprove a statement?
Because a universal statement claims something about every case, so a single case where it fails makes the claim false with nothing left to argue. The number of examples that do work is irrelevant. Euler's conjecture stood for nearly two hundred years and was ended by one counterexample. The asymmetry is exact: proving a universal claim requires an argument covering all cases, while disproving it requires only one instance.
What does necessary and sufficient mean?
A sufficient condition guarantees the result, and a necessary condition must hold for the result to be possible. Being divisible by 4 is sufficient for being even but not necessary; being even is necessary for being divisible by 4 but not sufficient. When a condition is both, it characterizes the result exactly, and the statement is written as if and only if, which requires proving the implication in both directions.
What is the AM-GM inequality?
The arithmetic mean of non-negative numbers is never less than their geometric mean: for two numbers, (a + b)/2 ≥ √(ab), with equality only when a = b. It follows from a square never being negative: expanding (√a − √b)² ≥ 0 gives the result in one line. It is the standard tool for proving that a quantity has a minimum without using calculus.
Mr. Chalk