Survey of Mathematics

0.2 Proof techniques

Almost every proof uses one of six shapes (direct, contrapositive, contradiction, cases, induction, well-ordering). Knowing the shape tells you what to assume, what to show, and where to start.

Beyond the courseCS 240 (direct proof, contrapositive, contradiction, induction)Hammack, Book of Proof, ch. 4 to 10Velleman, How to Prove It, ch. 3 and 6

Chapter 0.1 showed how to read a statement. This chapter is about what to do next. The logical shape of a statement mostly decides how to start its proof. “If P then Q” says: assume P, aim for Q. “For every nn” says: take an arbitrary nn. “There exists” says: build one. When a direct start gets stuck, there are four standard ways around it. You will see every one of them again throughout this book.

Before you start

Chapter 0.1: implication, contrapositive, and negation.

Quick checkTo prove 'if P then Q' by contradiction, what do you assume?
Quick checkAn integer is even when it can be written as 2k2k for some integer kk. Which of these shows that 14 is even?

The picture: what each technique assumes and aims for

To proveTechniqueYou assumeYou aim to show
P⇒QP \Rightarrow QdirectPPQQ
P⇒QP \Rightarrow Qcontrapositive¬Q\neg Q¬P\neg P
P⇒QP \Rightarrow QcontradictionPP and ¬Q\neg Qsomething impossible
P⇒QP \Rightarrow QcasesPP, split into cases that cover everythingQQ in each case
∀n≥1: S(n)\forall n \ge 1:\ S(n)inductionS(1)S(1); then S(k)S(k)S(k+1)S(k + 1)
∀n: S(n)\forall n:\ S(n)well-orderinga smallest nn with S(n)S(n) falsea smaller one, or a contradiction

The table is the whole chapter in one view. The rest shows each row working, and how to choose.

Where this came from· Two thousand years of the same tricks

Greek mathematicians already needed these tricks. Around 350 BCE Aristotle used the diagonal of a square as his example of an argument by contradiction: if the diagonal and the side were commensurable (a whole-number ratio), the same number would be both odd and even. That is the proof that 2\sqrt 2 is irrational. Euclid’s Elements (around 300 BCE, Book IX) shows that any finite list of primes is missing one, by multiplying the primes together and adding 1. Early uses of induction are credited to al-Karaji (around 1000 CE) and Gersonides (who lived 1288 to 1344), and Blaise Pascal stated it explicitly in his treatise on the arithmetical triangle (written around 1654, published in 1665). The name “mathematical induction” is credited to Augustus De Morgan, who used it in 1838. The problem each trick solved was the same: prove a claim about infinitely many cases, or about numbers you cannot list, with a finite argument.

Definitions and techniques

Direct proof

Definition B

Direct proof

A direct proof of P⇒QP \Rightarrow Q assumes PP and reaches QQ through steps, each justified by a definition, an axiom, or an earlier result.

In one lineTo prove 'if P then Q': assume P, then derive Q one justified step at a time.

Why it existsIt is the default; most proofs in this book are direct.

Two moves make direct proofs work. The first is to unfold definitions (replace “even” by ”=2k= 2k for some integer kk”). The second is to work towards the form the conclusion needs (if the conclusion says “odd”, aim for "=2(integer)+1= 2(\text{integer}) + 1").

Worked example
Prove: if nn is odd, then n2n^2 is odd.

Solution.

  1. Assume the hypothesis, and unfold it. Let nn be odd. Then n=2k+1n = 2k + 1 for some integer kk. Definition of odd. The letter kk names the integer the definition promises.
  2. Compute what the conclusion is about. n2=(2k+1)2=4k2+4k+1n^2 = (2k + 1)^2 = 4k^2 + 4k + 1. Algebra on the expression we have.
  3. Rewrite in the form the conclusion needs. n2=2(2k2+2k)+1n^2 = 2(2k^2 + 2k) + 1. ‘Odd’ means 2(integer)+12(\text{integer}) + 1, so we factor a 2 out of everything except the 1.
  4. Check the bracket is an integer. 2k2+2k2k^2 + 2k is an integer because kk is. Sums and products of integers are integers. Without this line the form proves nothing.

Answer. n2=2m+1n^2 = 2m + 1 with m=2k2+2km = 2k^2 + 2k an integer, so n2n^2 is odd. ■\blacksquare

Watch out· Parity proofs: compare forms, never divide

To show a number is even or odd, write it as 2(integer)2(\text{integer}) or 2(integer)+12(\text{integer}) + 1. Do not divide by 2 and “solve for kk”: k=(n−1)/2k = (n - 1)/2 tells you nothing until you show it is an integer, which is the original question again.

Divisibility works the same way. For integers aa and bb, we say aa divides bb, written a∣ba \mid b, when b=akb = ak for some integer kk. To use a∣ba \mid b in a proof, unfold it to b=akb = ak. To prove a∣ca \mid c, produce an integer kk with c=akc = ak.

Worked example
Prove directly: if a∣ba \mid b and a∣ca \mid c, then a∣(b+c)a \mid (b + c).

Solution.

  1. Assume the hypothesis and unfold it. Let a,b,ca, b, c be integers with a∣ba \mid b and a∣ca \mid c. Then b=ajb = aj and c=akc = ak for some integers jj and kk. Definition of divides. Two different letters, jj and kk, because the two multipliers need not be equal.
  2. Compute the thing the conclusion is about. b+c=aj+ak=a(j+k)b + c = aj + ak = a(j + k). The conclusion asks for b+c=a⋅(integer)b + c = a \cdot (\text{integer}), so we factor aa out.
  3. Check the bracket is an integer. j+kj + k is an integer because jj and kk are. Sums of integers are integers. Without this the form proves nothing.

Answer. b+c=a(j+k)b + c = a(j + k) with j+kj + k an integer, so a∣(b+c)a \mid (b + c). ■\blacksquare

Quick checkWhich 'proof' is a valid proof that n2n^2 is even for every even integer nn?

Proof by contrapositive

Definition B

Proof by contrapositive

A proof by contrapositive of P⇒QP \Rightarrow Q is a direct proof of ¬Q⇒¬P\neg Q \Rightarrow \neg P. It proves the original, because the two are equivalent.

In one lineTo prove 'if P then Q', prove 'if not Q then not P' directly; the two statements are equivalent.

Why it existsSometimes 'not Q' gives you something concrete to unfold while P does not.

When to use it: when the hypothesis PP is hard to unfold but ¬Q\neg Q is easy.

Worked example
Prove: if n2n^2 is even, then nn is even.

Solution.

  1. Notice the direct route is awkward. "n2=2kn^2 = 2k" does not easily tell you anything about nn (taking square roots leaves the integers). Spotting a stuck start is the signal to switch technique.
  2. Write the contrapositive. If nn is not even (so odd), then n2n^2 is not even (so odd). For integers, ‘not even’ is the same as ‘odd’.
  3. Prove it directly. That is exactly the previous worked example: odd nn gives odd n2n^2. Reuse a proved result.

Answer. The contrapositive is true, so the statement is true. ■\blacksquare

Worked example
Choose a technique and prove: for integers aa and bb, if abab is even, then aa is even or bb is even.

Solution.

  1. Try the direct start. Assume ab=2kab = 2k. This says nothing about aa or bb alone, and we cannot split 2k2k into a piece for each. The hypothesis is not concrete, which is the signal to try the contrapositive.
  2. Write the contrapositive using the negation rules. The conclusion is ”aa even OR bb even”. Its negation is ”aa not even AND bb not even” (De Morgan, rule 2 of 0.1). So the contrapositive is: if aa and bb are both odd, then abab is odd. Negating a conclusion with ‘or’ gives ‘and’, and for integers ‘not even’ means ‘odd’.
  3. Unfold the new hypothesis. a=2j+1a = 2j + 1 and b=2k+1b = 2k + 1 for integers j,kj, k. Now we have two concrete formulas to compute with.
  4. Multiply and aim for the odd form. ab=4jk+2j+2k+1=2(2jk+j+k)+1ab = 4jk + 2j + 2k + 1 = 2(2jk + j + k) + 1. Odd means 2(integer)+12(\text{integer}) + 1, so we factor 2 out of everything except the 1.
  5. Check the bracket is an integer. 2jk+j+k2jk + j + k is an integer because jj and kk are. Sums and products of integers are integers.

Answer. The contrapositive is true, so the original statement is true. ■\blacksquare

Proof by contradiction

Definition B

Proof by contradiction

A proof by contradiction of a statement SS assumes ¬S\neg S and derives a contradiction: a statement known to be false, such as "1=01 = 0", or a pair RR and ¬R\neg R. Since a true assumption cannot lead to a false conclusion, ¬S\neg S must be false, so SS is true. For S=(P⇒Q)S = (P \Rightarrow Q) the assumption is PP and ¬Q\neg Q.

In one lineAssume the statement is false and derive something impossible; then it cannot be false.

Why it existsIt gives you an extra assumption (the negation) to work with, which is often what a stuck proof needs.

Worked example CS 240 Exam 1
Prove by contradiction: if 3n+43n + 4 is odd, then n−3n - 3 is even (for integers nn).

Solution.

  1. Assume the negation, exactly. Suppose 3n+43n + 4 is odd AND n−3n - 3 is odd. The negation of ‘if P then Q’ is ‘P and not Q’. Both facts are now available.
  2. Unfold both. 3n+4=2a+13n + 4 = 2a + 1 and n−3=2b+1n - 3 = 2b + 1 for some integers a,ba, b. Definition of odd, with a different letter for each, since they need not be equal.
  3. Express nn from the simpler one. n=2b+4n = 2b + 4. The second equation pins nn down.
  4. Substitute into the other. 3n+4=3(2b+4)+4=6b+16=2(3b+8)3n + 4 = 3(2b + 4) + 4 = 6b + 16 = 2(3b + 8). Now compute 3n+43n + 4 a second way.
  5. Compare the two forms. 3n+43n + 4 is 2(3b+8)2(3b + 8), which is even, and also 2a+12a + 1, which is odd. Compare forms. Do not divide by 2 or solve for aa.
  6. Contradiction. No integer is both even and odd. An even number leaves remainder 0 on division by 2, an odd one remainder 1 (the division algorithm, 0.5).

Answer. The assumption is impossible, so the statement is true. ■\blacksquare (A direct proof also works: if 3n+43n + 4 is odd, then 3n3n is odd, so nn is odd, so n−3n - 3 is even. Contradiction is not the only way; it is one tool.)

Contradiction is the natural tool for statements that say something does NOT exist. A real number is rational if it equals p/qp/q for integers p,qp, q with q≠0q \ne 0, and irrational if it is not rational. ”xx is irrational” says “no such p,qp, q exist”, so the negation hands us a pp and a qq to compute with.

Theorem B known to Aristotle; standard

The square root of 2 is irrational

2\sqrt 2 is not a rational number: there are no integers p,qp, q with q≠0q \ne 0 and (p/q)2=2(p/q)^2 = 2.

In one lineThere are no integers p,qp, q with (p/q)2=2(p/q)^2 = 2.

Why it is trueA fraction in lowest terms cannot have both top and bottom even, but p2=2q2p^2 = 2q^2 forces both to be even.

Proofstandard
The idea: Assume √2 = p/q in lowest terms. Squaring shows p is even, then that q is even, so the fraction was not in lowest terms.
Suppose 2=p/q\sqrt 2 = p/q with p,qp, q integers, q≠0q \ne 0.
Proof by contradiction: assume the negation of 'not rational'.
Choose the fraction in lowest terms: pp and qq have no common factor bigger than 1.
Any fraction can be reduced by dividing top and bottom by their common factors, so we may choose this form.This choice is what the contradiction will break.
p2=2q2p^2 = 2q^2, so p2p^2 is even.
Square both sides and multiply by q2q^2.
So pp is even: p=2rp = 2r for an integer rr.
'If n2n^2 is even then nn is even', proved above by contrapositive.
4r2=2q24r^2 = 2q^2, so q2=2r2q^2 = 2r^2, and q2q^2 is even.
Substitute p=2rp = 2r and divide both sides by 2.
So qq is even.
The same result again.
pp and qq share the factor 2. Contradiction. So 2\sqrt 2 is irrational. ■\blacksquare
Both are even, so 2 is a common factor, contradicting lowest terms.
Proof workshopRebuild the proof that the square root of 2 is irrational

Tap the lines in the order a proof would write them. Each line can only use what is already above it.

    Quick checkIn the proof that 2\sqrt 2 is irrational, which step would fail if we had NOT chosen the fraction in lowest terms?
    Worked example
    Prove by contradiction: if xx is irrational, then x+1x + 1 is irrational.

    Solution.

    1. Write the assumption, exactly. Suppose xx is irrational AND x+1x + 1 is rational. The negation of ‘if P then Q’ is ‘P and not Q’. Not-Q here is ‘rational’, since ‘not irrational’ means rational.
    2. Unfold the rational one. x+1=p/qx + 1 = p/q for integers p,qp, q with q≠0q \ne 0. Definition of rational. This is the concrete fact we were missing in a direct proof.
    3. Solve for xx. x=p/q−1=(p−q)/qx = p/q - 1 = (p - q)/q. Subtract 1 and use a common denominator.
    4. Check the target form. p−qp - q is an integer and qq is a non-zero integer. So xx is rational. That is exactly the definition of rational, including the condition q≠0q \ne 0.
    5. State the contradiction. xx is rational and xx is irrational. No number is both, and step 1 gave us ‘irrational’.

    Answer. The assumption is impossible, so if xx is irrational then x+1x + 1 is irrational. ■\blacksquare

    Watch out· Contradiction can hide a direct proof

    If your contradiction proof never uses the assumption ¬Q\neg Q, it was really a direct proof of QQ from PP, wrapped in an unnecessary layer. Unwrap it. A direct proof is shorter and easier to check.

    Proof by cases

    Definition B

    Proof by cases

    A proof by cases divides the hypothesis into finitely many cases C1,…,CmC_1, \dots, C_m such that every situation falls into at least one, and proves the conclusion in each case.

    In one lineSplit the situation into cases that together cover every possibility, and prove the statement in each.

    Why it existsWhen one argument cannot handle every object, separate arguments for separate kinds often can.

    Worked example
    Prove: for every integer nn, n2+nn^2 + n is even.

    Solution.

    1. Choose cases that cover everything. Every integer is even or odd. The cases must leave nothing out; say why they are exhaustive.
    2. Case nn even. n=2kn = 2k, so n2+n=4k2+2k=2(2k2+k)n^2 + n = 4k^2 + 2k = 2(2k^2 + k), even. Unfold and factor out 2.
    3. Case nn odd. n=2k+1n = 2k + 1, so n2+n=(4k2+4k+1)+(2k+1)=2(2k2+3k+1)n^2 + n = (4k^2 + 4k + 1) + (2k + 1) = 2(2k^2 + 3k + 1), even. Same method.

    Answer. Even in both cases, hence for every integer. ■\blacksquare (A one-line proof also exists: n2+n=n(n+1)n^2 + n = n(n + 1) is a product of two consecutive integers, one of which is even. Looking for structure often removes the need for cases.)

    Quick checkYou want to prove a statement about every integer nn by cases. Which choice of cases is valid?

    Induction

    Definition B

    Mathematical induction

    Mathematical induction proves ∀n≥1: S(n)\forall n \ge 1:\ S(n) by proving two things:

    1. Base case: S(1)S(1) is true.
    2. Inductive step: for every k≥1k \ge 1, if S(k)S(k) is true then S(k+1)S(k + 1) is true.

    The assumption ”S(k)S(k) is true” inside step 2 is the induction hypothesis.

    In one lineTo prove S(n) for every n ≥ 1: prove S(1), and prove that S(k) implies S(k+1) for every k ≥ 1.

    Why it existsInfinitely many statements cannot be checked one by one, but a single argument for the step from k to k+1 covers them all.

    Why· Why induction works: dominoes, and a proof

    Step 1 knocks over the first domino; step 2 says each falling domino knocks over the next. So all of them fall. As a proof: suppose some S(n)S(n) were false. Among the nn with S(n)S(n) false, take the smallest (the well-ordering principle below). It is not 1, by the base case. So n−1≥1n - 1 \ge 1 and S(n−1)S(n - 1) is true, because nn was the smallest failure. The inductive step then gives S(n)S(n) true, a contradiction.

    Your answerUse the formula just proved to find 1+2+3+⋯+201 + 2 + 3 + \dots + 20.

    Induction also proves statements that are not formulas. The inductive step then often rewrites the case k+1k + 1 so that the case kk appears inside it.

    Worked example
    Prove by induction: 66 divides 7n−17^n - 1 for every n≥1n \ge 1.

    Solution.

    1. State S(n)S(n). S(n)S(n): ”7n−1=6m7^n - 1 = 6m for some integer mm”. Divisibility has to be unfolded into an equation before we can compute with it.
    2. Base case. n=1n = 1: 71−1=6=6⋅17^1 - 1 = 6 = 6 \cdot 1. S(1)S(1) is true, so the first domino falls.
    3. Assume S(k)S(k) for one fixed k≥1k \ge 1. 7k−1=6m7^k - 1 = 6m with mm an integer. This is the induction hypothesis. We assume only the case kk, not all cases.
    4. Rewrite the case k+1k + 1 so that 7k−17^k - 1 appears. 7k+1−1=7⋅7k−1=7(7k−1)+7−1=7(7k−1)+67^{k+1} - 1 = 7 \cdot 7^k - 1 = 7(7^k - 1) + 7 - 1 = 7(7^k - 1) + 6. We add and subtract 7 to create the bracket 7k−17^k - 1, because that is the quantity the hypothesis talks about.
    5. Substitute the hypothesis and factor. 7k+1−1=7⋅6m+6=6(7m+1)7^{k+1} - 1 = 7 \cdot 6m + 6 = 6(7m + 1). Replace 7k−17^k - 1 by 6m6m. Both terms now contain 6, so it factors out.
    6. Check the bracket. 7m+17m + 1 is an integer. The form 6⋅(integer)6 \cdot (\text{integer}) is what S(k+1)S(k+1) demands.

    Answer. S(1)S(1) is true and S(k)⇒S(k+1)S(k) \Rightarrow S(k+1) for every k≥1k \ge 1, so 6∣7n−16 \mid 7^n - 1 for all n≥1n \ge 1. ■\blacksquare (Check: 72−1=48=6⋅87^2 - 1 = 48 = 6 \cdot 8, and 7⋅1+1=87 \cdot 1 + 1 = 8 with m=1m = 1 from n=1n = 1.)

    Worked example
    Prove by induction: n!>2nn! > 2^n for every n≥4n \ge 4. (Here n!=1⋅2⋯nn! = 1 \cdot 2 \cdots n.)

    Solution.

    1. Find where the claim starts being true. 1!=1<21! = 1 < 2, 2!=2<42! = 2 < 4, 3!=6<83! = 6 < 8, but 4!=24>164! = 24 > 16. The claim is false for n=1,2,3n = 1, 2, 3. The base case must be a true case, so it is n=4n = 4.
    2. Base case. 4!=24>16=244! = 24 > 16 = 2^4. The first domino.
    3. Assume S(k)S(k) for a fixed k≥4k \ge 4. k!>2kk! > 2^k. The induction hypothesis.
    4. Build the case k+1k + 1 from the hypothesis. (k+1)!=(k+1)⋅k!>(k+1)⋅2k(k+1)! = (k+1)\cdot k! > (k+1) \cdot 2^k. Factorials grow by multiplying by the next number, and the hypothesis lets us replace k!k! by the smaller 2k2^k. Multiplying a strict inequality by the positive number k+1k + 1 keeps its direction.
    5. Compare with the target 2k+12^{k+1}. Since k≥4k \ge 4, we have k+1≥5>2k + 1 \ge 5 > 2, so (k+1)⋅2k>2⋅2k=2k+1(k+1) \cdot 2^k > 2 \cdot 2^k = 2^{k+1}. Here is where k≥4k \ge 4 is used. It makes the multiplier at least 2.

    Answer. (k+1)!>2k+1(k+1)! > 2^{k+1}, so the step works for every k≥4k \ge 4. With the base case, n!>2nn! > 2^n for all n≥4n \ge 4. ■\blacksquare

    Your answerWhat is the smallest positive integer nn for which n!>2nn! > 2^n?
    Worked example
    Prove by induction: 2n>n22^n > n^2 for every n≥5n \ge 5.

    Solution.

    1. Find where the claim starts to hold. Compare 2n2^n with n2n^2: for n=2n = 2 it is 44 against 44 (equal, so not “greater”), for n=3n = 3 it is 88 against 99, for n=4n = 4 it is 1616 against 1616, and for n=5n = 5 it is 3232 against 2525. The base case must be a true case from which the step works. The inequality fails at 2, 3 and 4, so we start at 5.
    2. Base case. n=5n = 5: 32>2532 > 25. The first domino.
    3. Assume S(k)S(k) for a fixed k≥5k \ge 5. 2k>k22^k > k^2. The induction hypothesis.
    4. Start from the case k+1k + 1 and use the hypothesis. 2k+1=2⋅2k>2k22^{k+1} = 2 \cdot 2^k > 2k^2. Doubling both sides of the hypothesis.
    5. Compare 2k22k^2 with the target (k+1)2(k+1)^2. 2k2−(k+1)2=k2−2k−1=(k−1)2−22k^2 - (k+1)^2 = k^2 - 2k - 1 = (k-1)^2 - 2, which is positive for k≥3k \ge 3, in particular for k≥5k \ge 5. We need 2k2≥(k+1)22k^2 \ge (k+1)^2. This is where the size of kk is used.
    6. Chain the inequalities. 2k+1>2k2≥(k+1)22^{k+1} > 2k^2 \ge (k+1)^2. The first step is the hypothesis, the second is step 5.

    Answer. The step holds for every k≥5k \ge 5 and the base case holds, so 2n>n22^n > n^2 for all n≥5n \ge 5. ■\blacksquare

    Worked example classic
    Find the flaw: 'Claim: all positive integers are equal. Proof by induction on m=max⁡(a,b)m = \max(a, b): if max⁡(a,b)=1\max(a, b) = 1 then a=b=1a = b = 1. If max⁡(a,b)=k+1\max(a, b) = k + 1, then max⁡(a−1,b−1)=k\max(a-1, b-1) = k, so a−1=b−1a - 1 = b - 1 by the hypothesis, so a=ba = b.'

    Solution.

    1. Check the base case. If max⁡(a,b)=1\max(a, b) = 1 then aa and bb are positive integers at most 1, so both are 1. The base case is fine, so the flaw is in the step.
    2. Check the step with the smallest numbers. Take k=1k = 1, a=2a = 2, b=1b = 1, so max⁡(a,b)=2=k+1\max(a, b) = 2 = k + 1. Then a−1=1a - 1 = 1 and b−1=0b - 1 = 0. Test the step on its first real case. A false conclusion must break somewhere, and small cases break first.
    3. Find the broken hypothesis. The induction hypothesis speaks only about POSITIVE integers, and 00 is not positive. The step used the hypothesis on a pair outside its range.
    4. Conclude. The step "S(k)⇒S(k+1)S(k) \Rightarrow S(k+1)" is false for k=1k = 1. A valid induction needs the step for EVERY k≥1k \ge 1, including the first.

    Answer. The inductive step fails when one of a−1a - 1, b−1b - 1 is 0, so the proof is invalid. A proof by induction is only as good as its weakest step.

    Worked example
    Find the flaw: 'Claim: 1+2+⋯+n=(2n+1)281 + 2 + \dots + n = \frac{(2n+1)^2}{8} for all n≥1n \ge 1. Proof: assume it for kk. Then 1+⋯+k+(k+1)=(2k+1)28+(k+1)=(2k+3)281 + \dots + k + (k+1) = \frac{(2k+1)^2}{8} + (k + 1) = \frac{(2k+3)^2}{8}, which is the claim for k+1k + 1.'

    Solution.

    1. Check the algebra of the step. (2k+1)28+(k+1)=4k2+4k+1+8k+88=4k2+12k+98=(2k+3)28\frac{(2k+1)^2}{8} + (k+1) = \frac{4k^2 + 4k + 1 + 8k + 8}{8} = \frac{4k^2 + 12k + 9}{8} = \frac{(2k+3)^2}{8}. The step is correct. We should not assume a proof is wrong in the place we first look.
    2. Look for the missing part. No base case was checked. An induction needs both the base case and the step.
    3. Test the base case. At n=1n = 1: left side 11, right side 328=98\frac{3^2}{8} = \frac98. These differ. The formula fails at n=1n = 1, so the first domino never falls.

    Answer. The step is valid and the claim is false, because the base case fails. The true formula is n(n+1)2\frac{n(n+1)}{2}, which differs from (2n+1)28\frac{(2n+1)^2}{8} by the constant 18\frac18.

    Definition B

    Strong induction

    Strong induction proves ∀n≥1: S(n)\forall n \ge 1:\ S(n) from the base case S(1)S(1) and the step: for every k≥1k \ge 1, if S(1),…,S(k)S(1), \dots, S(k) are all true, then S(k+1)S(k + 1) is true. It is no stronger logically than ordinary induction (apply ordinary induction to ”S(1)S(1) and … and S(n)S(n)”), but it is often more convenient.

    In one lineIn the inductive step you may assume S(1), S(2), …, S(k) all at once, not only S(k).

    Why it existsSome statements about n depend on cases much smaller than n − 1, such as factoring n into smaller numbers.

    Worked example
    Prove: every integer n≥2n \ge 2 is a prime or a product of primes.

    Solution.

    1. Set up strong induction from 2. S(n)S(n): ”nn is a prime or a product of primes”, for n≥2n \ge 2. Base case n=2n = 2: 2 is prime. Induction can start at any integer, as long as the base case matches.
    2. Assume S(2),…,S(k)S(2), \dots, S(k) and look at k+1k + 1. If k+1k + 1 is prime, done. Split into the two possibilities: prime or not.
    3. Otherwise factor it. k+1=abk + 1 = ab with 2≤a,b≤k2 \le a, b \le k. ‘Not prime’ means it has a factor other than 1 and itself, and both factors are then smaller than k+1k + 1.
    4. Use the strong hypothesis on BOTH factors. aa and bb are each a prime or a product of primes, so abab is a product of primes. aa and bb can be anywhere between 2 and kk, not just kk. That is why ordinary induction is not enough here.

    Answer. By strong induction, every n≥2n \ge 2 is a product of primes (a prime counts as a product of one prime). ■\blacksquare Uniqueness of the factorisation is harder; it is in 0.5.

    Worked example
    Prove by strong induction: every amount of n≥8n \ge 8 rupees can be paid using only 3-rupee and 5-rupee coins.

    Solution.

    1. Say what is to be shown. S(n)S(n): n=3a+5bn = 3a + 5b for some integers a,b≥0a, b \ge 0. ‘Paid with coins’ means a count of each coin, and counts cannot be negative.
    2. Choose the step first, to see how many base cases we need. To reach k+1k + 1 we add one 3-rupee coin to a payment of k+1−3=k−2k + 1 - 3 = k - 2. The step reaches back 3 places, so we may need 3 base cases. The step comes first so that it tells us how many bases to check.
    3. Base cases. 8=3+58 = 3 + 5, 9=3⋅39 = 3 \cdot 3, 10=5⋅210 = 5 \cdot 2. Three consecutive values, because the step reaches back 3.
    4. Strong step. Let k+1≥11k + 1 \ge 11 and assume S(8),…,S(k)S(8), \dots, S(k). Since k+1≥11k + 1 \ge 11, we have k−2≥8k - 2 \ge 8, so S(k−2)S(k-2) holds: k−2=3a+5bk - 2 = 3a + 5b. The hypothesis for k−2k - 2 is available only because strong induction lets us use ALL earlier cases, not just S(k)S(k). We need k−2≥8k - 2 \ge 8 to be inside the range of the claim.
    5. Add the coin. k+1=(k−2)+3=3(a+1)+5bk + 1 = (k - 2) + 3 = 3(a + 1) + 5b, with a+1,b≥0a + 1, b \ge 0. This is the required form.

    Answer. Every n≥8n \ge 8 can be paid. ■\blacksquare (Only the amounts 1,2,4,71, 2, 4, 7 cannot be paid, which is why the claim starts at 8. With 4-rupee and 5-rupee coins the step reaches back 4 places, so it needs four base cases, 12,13,14,1512, 13, 14, 15. That is one of the problems below.)

    Your answerWhat is the largest amount of rupees that CANNOT be paid with 3-rupee and 5-rupee coins?
    Definition B

    Well-ordering principle

    The well-ordering principle: every non-empty set of positive integers has a smallest element. (It fails for the reals: the set of positive reals has no smallest element.)

    In one lineEvery non-empty set of positive integers has a smallest element.

    Why it existsIt lets you study a 'smallest counterexample', which is often easier than the general case; it is equivalent to induction.

    Worked example
    Use the well-ordering principle to prove: n<2nn < 2^n for every integer n≥1n \ge 1.

    Solution.

    1. Assume the claim fails somewhere. Let FF be the set of integers n≥1n \ge 1 with n≥2nn \ge 2^n. Suppose FF is not empty. This is a proof by contradiction. The set FF collects all the counterexamples.
    2. Take the smallest counterexample. By well-ordering, FF has a smallest element mm. Now we have one specific counterexample, and everything below mm is known to be fine.
    3. Rule out m=1m = 1. 1<2=211 < 2 = 2^1, so 1∉F1 \notin F. Hence m≥2m \ge 2 and m−1≥1m - 1 \ge 1. We want to use the case m−1m - 1, so it must be a positive integer.
    4. Use minimality. m−1<mm - 1 < m, so m−1∉Fm - 1 \notin F. That is, m−1<2m−1m - 1 < 2^{m-1}. mm is the smallest element of FF, so nothing smaller is in FF.
    5. Double it. Since both sides are integers, m−1<2m−1m - 1 < 2^{m-1} gives m≤2m−1m \le 2^{m-1}, so 2m=2⋅2m−1≥2m2^m = 2 \cdot 2^{m-1} \ge 2m. Between integers, ‘less than’ lets us add 1 to the left side. Then double both sides.
    6. Reach the contradiction. 2m≥m+1>m2m \ge m + 1 > m because m≥1m \ge 1, so 2m>m2^m > m, which says m∉Fm \notin F. We assumed m∈Fm \in F, that is m≥2mm \ge 2^m.

    Answer. FF must be empty, so n<2nn < 2^n for every n≥1n \ge 1. ■\blacksquare

    Quick checkWhich of these is the best fit for STRONG induction rather than ordinary induction?
    Quick checkIn the inductive step for 1+⋯+n=n(n+1)21 + \dots + n = \frac{n(n+1)}{2}, what may you assume?
    Quick checkWhich technique fits best: 'If n3n^3 is odd, then nn is odd'?

    How to choose

    1. Try direct first. Unfold the hypothesis and the conclusion into definitions; see if you can bridge them.
    2. Stuck because the hypothesis gives nothing concrete? Try the contrapositive.
    3. Stuck because you need an extra fact to work with? Try contradiction.
    4. The objects come in a few different kinds? Use cases.
    5. The statement is “for every nn” and case nn is built from smaller cases? Use induction (strong induction if it uses several earlier cases).
    Worked example
    Choose and carry out a technique: prove there are infinitely many primes.

    Solution.

    1. Read the statement. “Infinitely many” is a negation: “not finitely many”. Statements that are themselves negations are natural for contradiction.
    2. Assume the negation. Suppose the only primes are p1,…,pmp_1, \dots, p_m. Contradiction gives us a concrete finite list to work with.
    3. Build a new number. N=p1p2⋯pm+1N = p_1 p_2 \cdots p_m + 1. Each pip_i divides the product, so dividing NN by pip_i leaves remainder 1.
    4. Use the factorisation result. N≥2N \ge 2, so NN has a prime factor pp (previous example). Every integer at least 2 is a product of primes.
    5. Derive the contradiction. pp must be some pip_i, but no pip_i divides NN. Remainder 1, not 0.

    Answer. No finite list contains every prime. ■\blacksquare (This is Euclid’s idea. He wrote it as “any finite list of primes is missing one” and did not use contradiction; the version above is the modern retelling. The list is not empty because 2 is a prime.)

    Your answerTake the first six primes 2,3,5,7,11,132, 3, 5, 7, 11, 13 and form N=2⋅3⋅5⋅7⋅11⋅13+1=30031N = 2 \cdot 3 \cdot 5 \cdot 7 \cdot 11 \cdot 13 + 1 = 30031. What is the smallest prime that divides NN?
    Proof workshopGive the reason for each line of Euclid's proof

    Each line of the proof is shown in order. Choose the reason that justifies it, then press Check.

    1. Suppose the only primes are p1,…,pmp_1, \dots, p_m.
    2. Let N=p1p2⋯pm+1N = p_1 p_2 \cdots p_m + 1.
    3. Dividing NN by any pip_i leaves remainder 1.
    4. N≥2N \ge 2, so NN has a prime factor pp.
    5. Then pp equals some pip_i, but no pip_i divides NN. Contradiction.

    Where it is used

    Used inside maths· Inside maths: every chapter of this book

    Rank–nullity (2.3) is a direct proof; “an implication equals its contrapositive” (0.1) underlies every contrapositive proof; the k+1k + 1 theorem (2.2) is an induction whose step is elimination; uniqueness of the zero vector (2.1) is a “suppose there were two” argument; and the irrationality of 2\sqrt 2 is the model for every “this number is not of that form” proof in analysis.

    Used in the real world· Computer science: proving programs correct

    A loop invariant is an induction. To prove that “after ii passes of insertion sort, the first ii items are sorted”, you check i=1i = 1 (base case) and show one more pass keeps the property (inductive step). Merge sort’s correctness is strong induction: sorting nn items relies on sorting two halves of size about n/2n/2, not n−1n - 1. Proof assistants check such induction proofs by machine. The seL4 microkernel, for example, has a machine-checked proof in the Isabelle/HOL assistant (first completed in 2009) that its code does what its specification says.

    Traps

    Watch out· Assuming what you want to prove

    In an induction step, assume S(k)S(k), not ”S(n)S(n) for all nn”. In a direct proof, do not start from the conclusion and “work backwards” to something true unless every step reverses: x=−1⇒x2=1x = -1 \Rightarrow x^2 = 1 is fine, but x2=1x^2 = 1 does not give x=−1x = -1.

    Watch out· Contradiction: assume P AND not Q

    For “if P then Q”, the contradiction assumption is both PP and ¬Q\neg Q. Assuming only ¬Q\neg Q, or “if P then not Q”, sets up the wrong proof.

    Watch out· Cases must cover everything

    Before using cases, say why they are exhaustive (“every integer is even or odd”). A missing case is a missing proof.

    Watch out· Base case at the right place

    If the statement is for n≥2n \ge 2, the base case is n=2n = 2. Induction that skips the base case can “prove” false things: ”n=n+1n = n + 1 for all nn” has a valid inductive step and no base case.

    Problems

    check

    Which technique would you try first, and what would you assume? (a) If aa and bb are odd, then abab is odd. (b) If abab is even, then aa or bb is even. (c) 2n>n2^n > n for every n≥1n \ge 1.

    Solution

    (a) Direct: assume a=2j+1a = 2j + 1, b=2k+1b = 2k + 1. (b) Contrapositive: assume aa and bb are both odd, show abab odd, which is (a). (c) Induction on nn.

    check

    What is wrong with this “proof” that n2n^2 is even for even nn: “Take n=4n = 4. Then n2=16n^2 = 16, which is even.”

    Solution

    It checks one example. The statement is about every even nn, so the proof must use an arbitrary even n=2kn = 2k: n2=4k2=2(2k2)n^2 = 4k^2 = 2(2k^2).

    check

    Write the assumption for a proof by contradiction of “If xx is irrational, then x+1x + 1 is irrational.”

    Solution

    xx is irrational AND x+1x + 1 is rational.

    useHammack ch. 4 style

    Prove directly: if a∣ba \mid b and b∣cb \mid c then a∣ca \mid c. (Here a∣ba \mid b, read ”aa divides bb”, means b=akb = ak for some integer kk.)

    Solution

    b=akb = ak and c=bmc = bm for integers k,mk, m. Then c=(ak)m=a(km)c = (ak)m = a(km), and kmkm is an integer, so a∣ca \mid c.

    use

    Prove by contrapositive: if n2−6n+5n^2 - 6n + 5 is even, then nn is odd.

    Solution

    Contrapositive: if nn is even, then n2−6n+5n^2 - 6n + 5 is odd. With n=2kn = 2k: 4k2−12k+5=2(2k2−6k+2)+14k^2 - 12k + 5 = 2(2k^2 - 6k + 2) + 1, odd.

    use

    Prove by induction: 1+3+5+⋯+(2n−1)=n21 + 3 + 5 + \dots + (2n - 1) = n^2 for every n≥1n \ge 1.

    Solution

    Base: 1=121 = 1^2. Step: assume 1+⋯+(2k−1)=k21 + \dots + (2k - 1) = k^2. Then adding the next odd number, 2(k+1)−1=2k+12(k+1) - 1 = 2k + 1, gives k2+2k+1=(k+1)2k^2 + 2k + 1 = (k + 1)^2.

    prove

    Prove that 3\sqrt 3 is irrational. Where does the proof for 2\sqrt 2 need changing?

    Solution

    Suppose 3=p/q\sqrt 3 = p/q in lowest terms, so p2=3q2p^2 = 3q^2. Then 3∣p23 \mid p^2. Since 3 is prime, 3∣p3 \mid p (Euclid’s lemma, 0.5; or check by cases p=3k,3k+1,3k+2p = 3k, 3k+1, 3k+2: squares are 9k29k^2, 3(3k2+2k)+13(3k^2 + 2k) + 1, 3(3k2+4k+1)+13(3k^2 + 4k + 1) + 1, so only the first is divisible by 3). Write p=3rp = 3r: 9r2=3q29r^2 = 3q^2, so q2=3r2q^2 = 3r^2 and 3∣q3 \mid q. Both divisible by 3, contradiction. The change: “even” becomes “divisible by 3”, and the fact about squares needs the cases argument.

    prove

    Prove by induction that n3−nn^3 - n is divisible by 3 for every n≥1n \ge 1.

    Solution

    Base: 1−1=0=3⋅01 - 1 = 0 = 3 \cdot 0. Step: (k+1)3−(k+1)=k3+3k2+3k+1−k−1=(k3−k)+3(k2+k)(k + 1)^3 - (k + 1) = k^3 + 3k^2 + 3k + 1 - k - 1 = (k^3 - k) + 3(k^2 + k). By the hypothesis k3−k=3mk^3 - k = 3m, so the whole is 3(m+k2+k)3(m + k^2 + k).

    prove

    Use the well-ordering principle to prove that every integer n≥2n \ge 2 has a prime factor (without using the previous examples).

    Solution

    Suppose not. Then the set of integers n≥2n \ge 2 with no prime factor is non-empty, so it has a smallest element mm. mm is not prime (a prime is its own prime factor), so m=abm = ab with 2≤a<m2 \le a < m. Since a<ma < m, aa has a prime factor pp, and p∣a∣mp \mid a \mid m, so pp is a prime factor of mm. Contradiction.

    prove

    Find the flaw: “Claim: all horses are the same colour. Induction on the number nn of horses. Base n=1n = 1: true. Step: given k+1k + 1 horses, remove one: the remaining kk are the same colour. Remove a different one: those kk are the same colour. The groups overlap, so all k+1k + 1 are the same colour.”

    Solution

    The step fails from k=1k = 1 to k+1=2k + 1 = 2. With two horses, the two groups of size 1 do not overlap, so nothing links their colours. The step “for every k≥1k \ge 1” is false at k=1k = 1, so the induction breaks.

    stretchclassic

    Every integer n≥12n \ge 12 can be written as 4a+5b4a + 5b with a,b≥0a, b \ge 0 integers. Prove it with strong induction using four base cases.

    Solution

    Base cases: 12=4⋅312 = 4 \cdot 3, 13=4⋅2+513 = 4 \cdot 2 + 5, 14=4+5⋅214 = 4 + 5 \cdot 2, 15=5⋅315 = 5 \cdot 3. Step: for k+1≥16k + 1 \ge 16, the number k+1−4=k−3≥12k + 1 - 4 = k - 3 \ge 12 is covered by the strong hypothesis: k−3=4a+5bk - 3 = 4a + 5b. Then k+1=4(a+1)+5bk + 1 = 4(a + 1) + 5b. Four base cases are needed because the step reaches back 4 places.

    stretch

    Prove that 2n>n22^n > n^2 for every n≥5n \ge 5. Why does the claim fail for n=2,3,4n = 2, 3, 4, and what does that say about choosing the base case?

    Solution

    Base n=5n = 5: 32>2532 > 25. Step (for k≥5k \ge 5): 2k+1=2⋅2k>2k22^{k+1} = 2 \cdot 2^k > 2k^2. We need 2k2≥(k+1)22k^2 \ge (k+1)^2, that is k2−2k−1≥0k^2 - 2k - 1 \ge 0, true for k≥3k \ge 3. So 2k+1>(k+1)22^{k+1} > (k+1)^2. For n=2,3,4n = 2, 3, 4: 4=44 = 4, 8<98 < 9, 16=1616 = 16, so the claim is false there. The base case must be a value where the claim is true AND from which the step works.

    Summary

    • The shape of the statement chooses the start. If-then: assume the hypothesis. For every: take an arbitrary object. There exists: build one.
    • Direct: assume PP, derive QQ. Unfold definitions; aim for the form the conclusion needs.
    • Contrapositive: prove ¬Q⇒¬P\neg Q \Rightarrow \neg P instead. Same theorem.
    • Contradiction: assume PP and ¬Q\neg Q, derive the impossible. In parity proofs, compare 2(… )2(\dots) with 2(… )+12(\dots) + 1; never divide.
    • Cases: split into cases that cover everything; say why they do.
    • Induction: base case plus "S(k)⇒S(k+1)S(k) \Rightarrow S(k+1)". Strong induction may assume all earlier cases. Well-ordering studies the smallest counterexample. All three are the same idea.

    Watch and read

    The same ideas explained by someone else. Use these when an explanation here does not land.

    Where this sits

    Comes from
    0.1 How to read a theorem
    Leads to
    2.1 Vector spaces and subspaces
    Same idea elsewhere
    CS 240: The same techniques, now used on harder statements. CS 240 Exam 1's contradiction problem is worked here in full.
    MATH 431: Probability proofs (for example that the expectation of a sum is the sum of expectations) are direct proofs from definitions; counting arguments often use cases.
    Algorithms: Correctness proofs of loops are induction (the loop invariant). Strong induction proves divide-and-conquer algorithms like merge sort correct.