Skip to content
The Lumenary
Grades 9–12Ages 14–18 75 min

Proof: direct, contrapositive, contradiction and induction

How mathematicians turn "it seems to work" into "it must be so" — four methods, the dominoes of induction, and how to catch a proof that only looks right.

Formally verified · 22 LeanComputationally tested · 2 PythonAI-drafted · awaiting human reviewMathematically reviewed: Awaiting human review

Your guides: Chloe, Margaret, Gideon

MotivationH

Patterns that break

Mark points on a circle and join every pair of them by a straight chord, keeping the points in "general position" so that no three chords pass through one point. Count the regions into which the chords cut the disc.

points123456
regions124816?

The pattern is irresistible: surely 66 points give 3232 regions? They give 31.

Six points in general position on a circle and all fifteen chords between them. Count the regions carefully: there are 31, not 32.

The integers lesson met another trap: n2+n+41n^2 + n + 41 is prime for n=0,1,…,39n = 0, 1, \dots, 39 and then fails. Examples can suggest a truth, and one counterexample can destroy a false one — but no number of examples can establish a statement about infinitely many cases. For that we need proof. This lesson is a toolkit of the four methods mathematicians use most, and a guide to spotting proofs that only look right.

IntuitionH

What a proof is

A proof is a finite chain of steps leading from accepted starting points — definitions, axioms and theorems already proved — to the statement we want. Each step must be justified: anyone who checks it should agree that it follows. A proof is not a feeling of certainty, and not a pile of examples; it is an argument that would convince a careful sceptic.

Most statements we prove have the shape "if PP then QQ", possibly "for every nn". The methods of this lesson are four ways of organising the chain, each resting on a law of logic from propositional logic:

MethodTo proveWe assumeand deriveLogic behind it
directP→QP \to QPPQQthe meaning of →\to
casesP→QP \to Q, when PP means "AA or BB"AA, then separately BBQQ both times(A→Q)∧(B→Q)≡(A∨B)→Q(A \to Q) \wedge (B \to Q) \equiv (A \vee B) \to Q
contrapositiveP→QP \to Q¬Q\neg Q¬P\neg PP→Q≡¬Q→¬PP \to Q \equiv \neg Q \to \neg P
contradictionSS¬S\neg Ssomething impossible(¬S→⊥)→S(\neg S \to \bot) \to S is a tautology

The fourth row uses ⊥\bot for "a contradiction", a statement that is certainly false, such as "1=01 = 0" or "qq and not qq". The fifth tool, induction, is different: it is a property of the natural numbers themselves, and it is how we prove infinitely many statements P(0),P(1),P(2),…P(0), P(1), P(2), \dots in one go.

DefinitionsH

Definitions we will use

Definition— even, odd, divides

An integer nn is even if n=2kn = 2k for some integer kk, and odd if n=2k+1n = 2k + 1 for some integer kk. For integers aa and bb, aa divides bb, written a∣ba \mid b, if b=akb = ak for some integer kk.

We use one fact about integers, which follows from division with remainder: every integer is either even or odd, and not both. (Dividing nn by 22 leaves remainder 00 or 11, and the remainder is unique.)

Definition— prime

A prime is a natural number p>1p > 1 whose only positive divisors are 11 and pp. Every natural number n>1n > 1 has a smallest divisor d>1d > 1, and that dd is prime (a divisor of dd bigger than 11 would be a smaller divisor of nn).

Definition— induction

Ordinary induction. Let P(n)P(n) be a statement about natural numbers n=0,1,2,…n = 0, 1, 2, \dots If

  1. P(0)P(0) is true (the base case), and
  2. for every nn, P(n)P(n) implies P(n+1)P(n + 1) (the inductive step),

then P(n)P(n) is true for every natural number nn. (To start at another number n0n_0, take n0n_0 as the base case.)

Strong induction. If, for every nn, the truth of P(k)P(k) for all k<nk < n implies P(n)P(n), then P(n)P(n) is true for every nn.

The well-ordering principle. Every non-empty set of natural numbers has a least element.

ProofH

Direct proof and proof by cases

Theorem— Theorem 1

The sum of two odd integers is even.

Proof

Let mm and nn be odd. By definition m=2a+1m = 2a + 1 and n=2b+1n = 2b + 1 for some integers a,ba, b. Then

m+n=2a+2b+2=2(a+b+1),m + n = 2a + 2b + 2 = 2(a + b + 1),

and a+b+1a + b + 1 is an integer, so m+nm + n is even.

∎

Notice the shape: unpack the definitions of the hypothesis, compute, and repack into the definition of the conclusion. Most direct proofs look like this.

Theorem— Theorem 2 (divisibility is transitive)

For integers a,b,ca, b, c: if a∣ba \mid b and b∣cb \mid c, then a∣ca \mid c.

Proof

Since a∣ba \mid b, there is an integer kk with b=akb = ak; since b∣cb \mid c, there is an integer ll with c=blc = bl. Then c=(ak)l=a(kl)c = (ak)l = a(kl), and klkl is an integer, so a∣ca \mid c.

∎

Theorem— Theorem 3 (proof by cases)

For every integer nn, the number n(n+1)n(n + 1) is even.

Proof

Every integer is even or odd, so it is enough to treat the two cases.

Case 1: nn is even, say n=2kn = 2k. Then n(n+1)=2 k(n+1)n(n + 1) = 2\,k(n + 1), which is even.

Case 2: nn is odd, say n=2k+1n = 2k + 1. Then n+1=2(k+1)n + 1 = 2(k + 1) and n(n+1)=2 n(k+1)n(n + 1) = 2\,n(k + 1), which is even.

∎

ProofH

Proof by contrapositive

Theorem— Theorem 4

Let nn be an integer. If n2n^2 is even, then nn is even.

A direct attempt stalls: from n2=2kn^2 = 2k we would want to "take square roots", and 2k\sqrt{2k} tells us nothing useful. The contrapositive is easy.

Proof

We prove the contrapositive: if nn is not even, then n2n^2 is not even. If nn is not even, it is odd, n=2k+1n = 2k + 1. Then

n2=4k2+4k+1=2(2k2+2k)+1,n^2 = 4k^2 + 4k + 1 = 2(2k^2 + 2k) + 1,

which is odd, hence not even. Since a statement is equivalent to its contrapositive, the theorem is proved.

∎

Note

Be careful to prove the contrapositive ¬Q→¬P\neg Q \to \neg P and not the converse Q→PQ \to P. "If nn is even then n2n^2 is even" is true and easy — but it is a different theorem.

ProofH

Proof by contradiction

To prove SS by contradiction, assume ¬S\neg S and reason until you reach something impossible. Since true assumptions cannot lead to a false conclusion by valid steps, the assumption ¬S\neg S must be false — so SS is true.

Theorem— Theorem 5 (Euclid)

There are infinitely many prime numbers.

Proof

Suppose, for a contradiction, that there are only finitely many primes, and list them all: p1,p2,…,pkp_1, p_2, \dots, p_k. Let

N=p1p2⋯pk+1.N = p_1 p_2 \cdots p_k + 1 .

Then N>1N > 1, so NN has a smallest divisor q>1q > 1, and qq is prime. Since our list contains every prime, q=piq = p_i for some ii. But then qq divides the product p1⋯pkp_1 \cdots p_k and also NN, so it divides their difference N−p1⋯pk=1N - p_1 \cdots p_k = 1. No prime divides 11. This contradiction shows that the assumption was false: there are infinitely many primes.

∎

Note

The proof shows more: any finite list of primes misses the prime qq. Euclid himself (Elements, Book IX, Proposition 20) argued this way — "prime numbers are more than any assigned multitude of primes" — so the contradiction is optional. Notice also what the proof does not say: NN itself need not be prime. For the first six primes, 2⋅3⋅5⋅7⋅11⋅13+1=30031=59⋅5092 \cdot 3 \cdot 5 \cdot 7 \cdot 11 \cdot 13 + 1 = 30031 = 59 \cdot 509.

Theorem— Theorem 6

2\sqrt{2} is irrational: there are no integers a,ba, b with b≠0b \neq 0 and (a/b)2=2(a/b)^2 = 2.

Proof

Suppose there were. Cancelling common factors, we may assume aa and bb are not both even. From a2=2b2a^2 = 2b^2, a2a^2 is even, so aa is even by Theorem 4: a=2ca = 2c. Then 4c2=2b24c^2 = 2b^2, so b2=2c2b^2 = 2c^2 is even, and bb is even by Theorem 4 again. Now aa and bb are both even — a contradiction.

∎

This classic chains two methods: a contradiction whose key step is the contrapositive Theorem 4. More on irrational numbers in real numbers.

ProofH

Induction

Picture an infinite row of dominoes. If the first falls, and each falling domino knocks over the next, then all of them fall. The base case pushes the first domino; the inductive step guarantees the chain reaction.

Theorem— Theorem 7 (Gauss's formula)

For every natural number nn:   0+1+2+⋯+n=n(n+1)2\;0 + 1 + 2 + \dots + n = \dfrac{n(n + 1)}{2}.

Proof

Let P(n)P(n) be the statement 0+1+⋯+n=n(n+1)/20 + 1 + \dots + n = n(n+1)/2.

Base case. P(0)P(0) says 0=0⋅1/20 = 0 \cdot 1/2, which is true.

Inductive step. Let nn be a natural number and assume P(n)P(n) (the induction hypothesis). Then

0+1+⋯+n+(n+1)=n(n+1)2+(n+1)=(n+1)(n+2)2,0 + 1 + \dots + n + (n + 1) = \frac{n(n + 1)}{2} + (n + 1) = \frac{(n + 1)(n + 2)}{2},

which is P(n+1)P(n + 1). By induction, P(n)P(n) holds for every nn.

∎

A proof without words of Gauss's formula for n = 4: two staircases of 1 + 2 + 3 + 4 squares fill a 4 by 5 rectangle, so 1 + 2 + 3 + 4 = (4 × 5) / 2.

A much-retold story has the young Carl Friedrich Gauss adding 1+2+⋯+1001 + 2 + \dots + 100 in moments by pairing 1+1001 + 100, 2+992 + 99, …, fifty pairs of 101101. The details of the story are uncertain, but the pairing idea is the picture above.

Theorem— Theorem 8

For every natural number nn:   1+3+5+⋯+(2n−1)=n2\;1 + 3 + 5 + \dots + (2n - 1) = n^2.

Proof

Base case n=0n = 0: the empty sum is 0=020 = 0^2. Inductive step: if the first nn odd numbers add up to n2n^2, then the first n+1n + 1 add up to n2+(2n+1)=(n+1)2n^2 + (2n + 1) = (n + 1)^2.

∎

Why the base case matters. Consider the claim "n2+n+1n^2 + n + 1 is even for every nn". The inductive step works perfectly: (n+1)2+(n+1)+1=(n2+n+1)+2(n+1)(n+1)^2 + (n+1) + 1 = (n^2 + n + 1) + 2(n + 1), so if n2+n+1n^2 + n + 1 were even, the next value would be even too. But the base case fails — 02+0+1=10^2 + 0 + 1 = 1 is odd — and in fact, by Theorem 3, n2+n=n(n+1)n^2 + n = n(n+1) is always even, so n2+n+1n^2 + n + 1 is never even. The dominoes are lined up beautifully; nobody pushed the first one.

Strong induction lets the inductive step use all earlier cases, not just the previous one.

Theorem— Theorem 9 (stamps)

With stamps worth 33 and 55 (in any currency), every amount of at least 88 can be made exactly.

Proof

Let P(n)P(n) be "n=3a+5bn = 3a + 5b for some natural numbers a,ba, b". We prove P(n)P(n) for every n≥8n \ge 8 by strong induction. The amounts 8=3+58 = 3 + 5, 9=3+3+39 = 3 + 3 + 3 and 10=5+510 = 5 + 5 can be made. Now let n≥11n \ge 11 and assume P(k)P(k) for every kk with 8≤k<n8 \le k < n. Since n−3≥8n - 3 \ge 8, the amount n−3n - 3 can be made, n−3=3a+5bn - 3 = 3a + 5b; adding one more 33 gives n=3(a+1)+5bn = 3(a + 1) + 5b.

∎

The step reaches back three places, which is why we needed three starting cases. Strong induction also proves that every natural number n>1n > 1 is a product of primes: either nn is prime, or n=abn = ab with 1<a,b<n1 < a, b < n, and aa and bb are products of primes by the induction hypothesis — the existence half of the fundamental theorem of arithmetic.

Theorem— Theorem 10 (three equivalent principles)

Given the basic arithmetic of N\mathbb{N}, ordinary induction, strong induction and the well-ordering principle imply one another.

Proof

Ordinary ⇒ strong. Assume the hypothesis of strong induction for PP. Let Q(n)Q(n) be "P(k)P(k) holds for every k<nk < n". Q(0)Q(0) is true, since there is no k<0k < 0. If Q(n)Q(n) holds, then P(n)P(n) holds by the hypothesis of strong induction, so Q(n+1)Q(n + 1) holds. By ordinary induction Q(n)Q(n) holds for every nn; and P(n)P(n) follows from Q(n+1)Q(n + 1).

Strong ⇒ well-ordering. Let SS be a set of natural numbers with no least element; we show SS is empty. Let P(n)P(n) be "n∉Sn \notin S". If P(k)P(k) holds for all k<nk < n, then n∉Sn \notin S — otherwise nn would be the least element of SS. By strong induction, no nn is in SS. So every non-empty set has a least element.

Well-ordering ⇒ ordinary. Suppose P(0)P(0) holds and P(n)→P(n+1)P(n) \to P(n + 1) for every nn, but PP fails somewhere. Let mm be the least nn for which P(n)P(n) fails. Then m≠0m \neq 0, so m=j+1m = j + 1; since j<mj < m, P(j)P(j) holds, and therefore P(j+1)=P(m)P(j + 1) = P(m) holds — a contradiction.

∎

Explore

Explore: the logic behind the methods

Each method rests on a tautology. Check them in the truth-table explorer.

Why proof by contradiction works

If not-s leads to a contradiction (q and not q), then s. Is this true in every row?

Read as: (¬s → (q ∧ ¬q)) → s

Use the symbols ¬ ∧ ∨ → ↔, the words not, and, or, implies, iff, or ASCII ~ & | -> <->. Variables are single lowercase letters. ¬ binds tightest, then ∧, ∨, →, ↔; p → q → r means p → (q → r).

Try:

Tautology — true in all 4 rows.

qs¬s¬qq ∧ ¬q¬s → q ∧ ¬q(¬s → q ∧ ¬q) → s
TTFFFTT
TFTFFFT
FTFTFTT
FFTTFFT

4 rows: one for every way of making the 2 variables true or false.

Things to try:

  • Change the formula to (p -> q) <-> (~q -> ~p) — the contrapositive method.
  • Try ((a -> q) and (b -> q)) <-> ((a or b) -> q) — proof by cases.
  • Try the mistaken method (p -> q) <-> (q -> p): proving the converse instead. Which row breaks it?
ExplanationH

Spot the error

Learning to find the flaw in a wrong proof is as important as writing a right one. Each of these "proofs" has exactly one fatal step. Try to find it before reading the diagnosis.

Example— All horses are the same colour

Claim: in every set of n≥1n \ge 1 horses, all the horses have the same colour. "Proof" by induction: one horse has the same colour as itself. Now take n+1n + 1 horses. Remove one: the remaining nn have one colour, by the induction hypothesis. Put it back and remove a different one: again the remaining nn share one colour. The two groups overlap, so all n+1n + 1 horses share a colour.

Diagnosis: the inductive step fails from n=1n = 1 to n=2n = 2. With two horses, the two groups of size one do not overlap, so nothing connects their colours. An inductive step must work for every nn, including the smallest. (This puzzle is usually credited to George Pólya.)

Example— 2 = 1

"Proof": let a=ba = b. Then a2=aba^2 = ab, so a2−b2=ab−b2a^2 - b^2 = ab - b^2, that is, (a+b)(a−b)=b(a−b)(a + b)(a - b) = b(a - b). Cancelling, a+b=ba + b = b, so 2b=b2b = b and 2=12 = 1.

Diagnosis: "cancelling" divides by a−ba - b, which is 00. Hidden assumptions — here, that a number is non-zero — are the most common flaw in algebraic proofs.

Example— The largest natural number is 1

"Proof": let NN be the largest natural number. Since N2≥NN^2 \ge N and NN is the largest, N2=NN^2 = N, so N=0N = 0 or N=1N = 1; and 1>01 > 0, so N=1N = 1.

Diagnosis: the first sentence assumes, without justification, that a largest natural number exists. Every step after that is correct — which shows only that the assumption is false. (This is known as Perron's paradox.) A contradiction blames some assumption; make sure it is the one you meant to refute.

Example— A circular proof

Claim: if n2n^2 is even then nn is even. "Proof": let nn be even, n=2kn = 2k; then n2=4k2=2(2k2)n^2 = 4k^2 = 2(2k^2) is even.

Diagnosis: this proves the converse. It assumes the conclusion ("nn is even") and derives the hypothesis. Compare it with the proof of Theorem 4.

Formal mathematicsF

The proofs, checked by Lean

Every theorem of this lesson is proved in Lean below, almost always in the same way as in the text. Direct proofs unpack definitions with obtain and repack them; ring does the algebra.

odd_add_oddLean 4Proved here from basic factsFormally verified
/-- **Direct proof.** The sum of two odd integers is even: if `m = 2a + 1` and `n = 2b + 1`, then
`m + n = 2(a + b + 1)`. (Mathlib's `Even k` means `k = r + r` for some `r`.) -/
theorem odd_add_odd {m n : ℤ} (hm : Odd m) (hn : Odd n) : Even (m + n) := by
  obtain ⟨a, rfl⟩ := hm
  obtain ⟨b, rfl⟩ := hn
  exact ⟨a + b + 1, by ring⟩
Axioms used: propextformal/Lumenary/ProofTechniques.leanTry it in the Lean web editor
dvd_transLean 4Proved here from basic factsFormally verified
/-- **Direct proof.** Divisibility is transitive: if `b = a·k` and `c = b·l` then `c = a·(k·l)`. -/
theorem dvd_trans {a b c : ℤ} (hab : a ∣ b) (hbc : b ∣ c) : a ∣ c := by
  obtain ⟨k, rfl⟩ := hab
  obtain ⟨l, rfl⟩ := hbc
  exact ⟨k * l, by ring⟩
Axioms used: propextformal/Lumenary/ProofTechniques.leanTry it in the Lean web editor
even_mul_succLean 4Proved here from basic factsFormally verified
/-- **Proof by cases.** For every integer `n`, the product `n(n + 1)` is even.
Case 1: `n = 2k` is even, so `n(n + 1) = 2·(k(n + 1))`.
Case 2: `n = 2k + 1` is odd, so `n + 1 = 2(k + 1)` and `n(n + 1) = 2·(n(k + 1))`. -/
theorem even_mul_succ (n : ℤ) : Even (n * (n + 1)) := by
  rcases Int.even_or_odd n with ⟨k, hk⟩ | ⟨k, hk⟩
  · exact ⟨k * (n + 1), by rw [hk]; ring⟩
  · exact ⟨n * (k + 1), by rw [hk]; ring⟩
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/ProofTechniques.leanTry it in the Lean web editor

The contrapositive proof uses by_contra: assume n is not even and derive a contradiction with the hypothesis. Mathlib proves the same fact as part of a general lemma about powers.

odd_sq_of_oddLean 4Proved here from basic factsFormally verified
/-- The square of an odd integer is odd: `(2k + 1)² = 2(2k² + 2k) + 1`. -/
theorem odd_sq_of_odd {n : ℤ} (h : Odd n) : Odd (n ^ 2) := by
  obtain ⟨k, rfl⟩ := h
  exact ⟨2 * k ^ 2 + 2 * k, by ring⟩
Axioms used: propextformal/Lumenary/ProofTechniques.leanTry it in the Lean web editor
even_of_even_sqLean 4Proved here from basic factsFormally verified
/-- **Proof by contrapositive.** If `n²` is even, then `n` is even. We prove the contrapositive
instead: if `n` is not even, it is odd, so `n²` is odd (`odd_sq_of_odd`), hence not even. -/
theorem even_of_even_sq (n : ℤ) (h : Even (n ^ 2)) : Even n := by
  by_contra hn
  have hodd : Odd (n ^ 2) := odd_sq_of_odd (Int.not_even_iff_odd.mp hn)
  exact (Int.not_even_iff_odd.mpr hodd) h
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/ProofTechniques.leanTry it in the Lean web editor
even_of_even_sq_libraryLean 4Applies a library theoremFormally verified
/-- The same theorem from Mathlib's `Int.even_pow : Even (m ^ n) ↔ Even m ∧ n ≠ 0`. -/
theorem even_of_even_sq_library (n : ℤ) (h : Even (n ^ 2)) : Even n :=
  (Int.even_pow.mp h).1
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/ProofTechniques.leanTry it in the Lean web editor

Euclid's theorem in the "every finite list misses a prime" form. Nat.minFac N is the smallest factor of N bigger than 1.

exists_prime_not_memLean 4Proved here from basic factsFormally verified
/-- **Euclid's theorem.** Every finite set `S` of primes misses some prime.
Let `N = (∏ p ∈ S, p) + 1` and let `q` be the smallest factor of `N` that is bigger than `1`
(it is prime). If `q` were in `S`, it would divide both the product and `N`, hence their
difference `1` — a contradiction. Note that `N` itself need not be prime. -/
theorem exists_prime_not_mem (S : Finset ℕ) (hS : ∀ p ∈ S, p.Prime) :
    ∃ q, q.Prime ∧ q ∉ S := by
  have hpos : 0 < ∏ p ∈ S, p := Finset.prod_pos fun p hp => (hS p hp).pos
  have hN : (∏ p ∈ S, p) + 1 ≠ 1 := by omega
  refine ⟨Nat.minFac ((∏ p ∈ S, p) + 1), Nat.minFac_prime hN, fun hmem => ?_⟩
  have hdvd_prod : Nat.minFac ((∏ p ∈ S, p) + 1) ∣ ∏ p ∈ S, p := Finset.dvd_prod_of_mem _ hmem
  have hdvd_N := Nat.minFac_dvd ((∏ p ∈ S, p) + 1)
  have hdvd_one : Nat.minFac ((∏ p ∈ S, p) + 1) ∣ 1 := (Nat.dvd_add_right hdvd_prod).mp hdvd_N
  exact (Nat.minFac_prime hN).one_lt.ne' (Nat.dvd_one.mp hdvd_one)
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/ProofTechniques.leanTry it in the Lean web editor
exists_infinite_primesLean 4Applies a library theoremFormally verified
/-- There are primes as large as we like: Mathlib's `Nat.exists_infinite_primes`, proved with
the smallest prime factor of `n! + 1`. -/
theorem exists_infinite_primes (n : ℕ) : ∃ p, n ≤ p ∧ p.Prime :=
  Nat.exists_infinite_primes n
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/ProofTechniques.leanTry it in the Lean web editor

For 2\sqrt{2} the Lean proof avoids "cancel common factors" and uses infinite descent instead: a solution of a2=2b2a^2 = 2b^2 with b≠0b \neq 0 would produce a smaller one, c2=2d2c^2 = 2d^2 with a=2ca = 2c and b=2db = 2d, and that is impossible by strong induction. (Pierre de Fermat made this method famous in the 17th century.)

sq_eq_two_mul_sqLean 4Proved here from basic factsFormally verified
/-- **√2 is irrational**, in the form: if `a² = 2b²` for natural numbers `a, b`, then `b = 0`.
Proof by *infinite descent* (strong induction on `b`): `a²` is even, so `a = 2c`; then `b² = 2c²`,
so `b = 2d`; then `c² = 2d²` is a smaller solution, and by the induction hypothesis `d = 0`, so
`b = 0`. (Evenness of a square is Mathlib's `Nat.even_pow`; the lesson proves it as Theorem 4.) -/
theorem sq_eq_two_mul_sq (a b : ℕ) (h : a ^ 2 = 2 * b ^ 2) : b = 0 := by
  induction b using Nat.strong_induction_on generalizing a with
  | _ b ih =>
    have ha : Even a := (Nat.even_pow.mp ⟨b ^ 2, by rw [h]; ring⟩).1
    obtain ⟨c, rfl⟩ := ha
    have hb2 : b ^ 2 = 2 * c ^ 2 := by nlinarith
    have hb : Even b := (Nat.even_pow.mp ⟨c ^ 2, by rw [hb2]; ring⟩).1
    obtain ⟨d, rfl⟩ := hb
    have hc : c ^ 2 = 2 * d ^ 2 := by nlinarith
    by_contra hne
    have hd : d = 0 := ih d (by omega) c hc
    omega
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/ProofTechniques.leanTry it in the Lean web editor

Induction proofs use induction n with | zero => … | succ n ih => …, where ih is the induction hypothesis. To avoid fractions, Gauss's formula is stated as 2(0+1+⋯+n)=n(n+1)2(0 + 1 + \dots + n) = n(n + 1); the calc block follows the human proof line by line.

gauss_sumLean 4Proved here from basic factsFormally verified
/-- **Gauss's formula, by induction:** `2·(0 + 1 + ⋯ + n) = n(n + 1)`.
Base case: both sides are `0`. Inductive step: if `2·(0 + ⋯ + n) = n(n + 1)`, then
`2·(0 + ⋯ + n + (n + 1)) = n(n + 1) + 2(n + 1) = (n + 1)(n + 2)`. -/
theorem gauss_sum (n : ℕ) : 2 * ∑ i ∈ range (n + 1), i = n * (n + 1) := by
  induction n with
  | zero => rfl
  | succ n ih =>
    calc 2 * ∑ i ∈ range (n + 1 + 1), i
        = 2 * ∑ i ∈ range (n + 1), i + 2 * (n + 1) := by rw [sum_range_succ, mul_add]
      _ = n * (n + 1) + 2 * (n + 1) := by rw [ih]
      _ = (n + 1) * (n + 1 + 1) := by ring
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/ProofTechniques.leanTry it in the Lean web editor
gauss_sum_libraryLean 4Applies a library theoremFormally verified
/-- Mathlib's version, `Finset.sum_range_id_mul_two : (∑ i ∈ range n, i) * 2 = n * (n - 1)`. -/
theorem gauss_sum_library (n : ℕ) : (∑ i ∈ range n, i) * 2 = n * (n - 1) :=
  sum_range_id_mul_two n
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/ProofTechniques.leanTry it in the Lean web editor
sum_oddLean 4Proved here from basic factsFormally verified
/-- **The odd numbers add up to squares:** `1 + 3 + ⋯ + (2n − 1) = n²`, by induction.
The inductive step is `n² + (2n + 1) = (n + 1)²`. -/
theorem sum_odd (n : ℕ) : ∑ i ∈ range n, (2 * i + 1) = n ^ 2 := by
  induction n with
  | zero => rfl
  | succ n ih => rw [sum_range_succ, ih]; ring
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/ProofTechniques.leanTry it in the Lean web editor
stampsLean 4Proved here from basic factsFormally verified
/-- **Strong induction.** Every whole number `n ≥ 8` is a sum of 3s and 5s.
The cases `8 = 3 + 5`, `9 = 3 + 3 + 3` and `10 = 5 + 5` start things off; for `n ≥ 11` the
number `n − 3 ≥ 8` is smaller, so (strong induction hypothesis) it is `3a + 5b`, and then
`n = 3(a + 1) + 5b`. The step reaches back *three* places, which ordinary induction cannot do
directly. -/
theorem stamps (n : ℕ) (hn : 8 ≤ n) : ∃ a b : ℕ, n = 3 * a + 5 * b := by
  induction n using Nat.strong_induction_on with
  | _ n ih =>
    rcases (show n = 8 ∨ n = 9 ∨ n = 10 ∨ 11 ≤ n by omega) with h | h | h | h
    · exact ⟨1, 1, by omega⟩
    · exact ⟨3, 0, by omega⟩
    · exact ⟨0, 2, by omega⟩
    · obtain ⟨a, b, hab⟩ := ih (n - 3) (by omega) (by omega)
      exact ⟨a + 1, b, by omega⟩
Axioms used: propext, Quot.soundformal/Lumenary/ProofTechniques.leanTry it in the Lean web editor

The fake theorem: Lean happily proves the inductive step — and also proves that the statement is false for every nn.

false_step_holdsLean 4Proved here from basic factsFormally verified
/-- A **fake induction**: *if* `n² + n + 1` were even, *then* `(n + 1)² + (n + 1) + 1` would be
even too, because the second number is the first plus `2(n + 1)`. The inductive step is fine… -/
theorem false_step_holds (n : ℕ) (h : Even (n ^ 2 + n + 1)) :
    Even ((n + 1) ^ 2 + (n + 1) + 1) := by
  have e : (n + 1) ^ 2 + (n + 1) + 1 = (n ^ 2 + n + 1) + 2 * (n + 1) := by ring
  rw [e]
  exact h.add (even_two_mul (n + 1))
Axioms used: propextformal/Lumenary/ProofTechniques.leanTry it in the Lean web editor
never_evenLean 4Proved here from basic factsFormally verified
/-- …but the base case fails, and in fact the claim is false for **every** `n`: `n² + n = n(n + 1)`
is even (it is a product of consecutive numbers), so `n² + n + 1` is odd. -/
theorem never_even (n : ℕ) : ¬ Even (n ^ 2 + n + 1) := by
  have h : Even (n * (n + 1)) := Nat.even_mul_succ_self n
  have e : n ^ 2 + n + 1 = n * (n + 1) + 1 := by ring
  rw [e, Nat.even_add_one]
  exact not_not.mpr h
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/ProofTechniques.leanTry it in the Lean web editor
OrdinaryInductionLean 4Formally verified
/-- The principle of **ordinary induction** for `ℕ`, stated as a proposition. -/
def OrdinaryInduction : Prop :=
  ∀ P : ℕ → Prop, P 0 → (∀ n, P n → P (n + 1)) → ∀ n, P n
Axioms used: No axiomsformal/Lumenary/ProofTechniques.leanTry it in the Lean web editor
StrongInductionLean 4Formally verified
/-- The principle of **strong induction**: if `P n` follows whenever `P k` holds for all `k < n`,
then `P n` holds for every `n`. (No separate base case: for `n = 0` there are no `k < 0`.) -/
def StrongInduction : Prop :=
  ∀ P : ℕ → Prop, (∀ n, (∀ k < n, P k) → P n) → ∀ n, P n
Axioms used: No axiomsformal/Lumenary/ProofTechniques.leanTry it in the Lean web editor
WellOrderingLean 4Formally verified
/-- The **well-ordering principle**: every non-empty set of natural numbers has a least element. -/
def WellOrdering : Prop :=
  ∀ S : Set ℕ, S.Nonempty → ∃ m ∈ S, ∀ k ∈ S, m ≤ k
Axioms used: No axiomsformal/Lumenary/ProofTechniques.leanTry it in the Lean web editor
ordinaryInduction_holdsLean 4Applies a library theoremFormally verified
/-- Ordinary induction holds: it is the recursor `Nat.rec` that comes with the definition of `ℕ`. -/
theorem ordinaryInduction_holds : OrdinaryInduction :=
  fun _ h0 hs n => Nat.rec h0 hs n
Axioms used: No axiomsformal/Lumenary/ProofTechniques.leanTry it in the Lean web editor
strong_of_ordinaryLean 4Proved here from basic factsFormally verified
/-- **Ordinary ⇒ strong induction.** Apply ordinary induction to the stronger statement
`Q n := ∀ k < n, P k`. `Q 0` is vacuous; and if `Q n` holds then `P n` holds by the hypothesis,
so `Q (n + 1)` holds. Finally `P n` follows from `Q (n + 1)`.
(All three principles are theorems about `ℕ` in Lean; what these proofs show is that each one can
be *derived* from the previous one, using only basic arithmetic facts.) -/
theorem strong_of_ordinary (ind : OrdinaryInduction) : StrongInduction := by
  intro P h n
  have hQ : ∀ m, ∀ k < m, P k := by
    refine ind (fun m => ∀ k < m, P k) (fun k hk => absurd hk (Nat.not_lt_zero k)) ?_
    intro m hm k hk
    rcases Nat.lt_succ_iff_lt_or_eq.mp hk with hlt | heq
    · exact hm k hlt
    · rw [heq]; exact h m hm
  exact hQ (n + 1) n (Nat.lt_succ_self n)
Axioms used: No axiomsformal/Lumenary/ProofTechniques.leanTry it in the Lean web editor
wellOrdering_of_strongLean 4Proved here from basic factsFormally verified
/-- **Strong induction ⇒ well-ordering.** Suppose `S` had no least element. By strong induction,
no `n` is in `S`: if all `k < n` are outside `S` and `n ∈ S`, then `n` would be the least element.
So `S` is empty, contradicting the hypothesis. -/
theorem wellOrdering_of_strong (sind : StrongInduction) : WellOrdering := by
  intro S hne
  by_contra hno
  push Not at hno
  have hout : ∀ n, n ∉ S := by
    refine sind (fun n => n ∉ S) ?_
    intro n ih hn
    obtain ⟨k, hkS, hkn⟩ := hno n hn
    exact ih k hkn hkS
  obtain ⟨x, hx⟩ := hne
  exact hout x hx
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/ProofTechniques.leanTry it in the Lean web editor
ordinary_of_wellOrderingLean 4Proved here from basic factsFormally verified
/-- **Well-ordering ⇒ ordinary induction.** If `P 0` and `P n → P (n + 1)`, but `P` failed
somewhere, let `m` be the *least* failure. `m ≠ 0` because `P 0` holds, so `m = j + 1`; and `j < m`
means `P j` holds, hence `P (j + 1) = P m` holds — a contradiction. -/
theorem ordinary_of_wellOrdering (wo : WellOrdering) : OrdinaryInduction := by
  intro P h0 hs n
  by_contra hn
  obtain ⟨m, hm, hmin⟩ := wo {k | ¬ P k} ⟨n, hn⟩
  cases m with
  | zero => exact hm h0
  | succ j =>
    have hj : P j := by
      by_contra hj
      have := hmin j hj
      omega
    exact hm (hs j hj)
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/ProofTechniques.leanTry it in the Lean web editor

A subtle point: all three principles are theorems about N\mathbb{N} in Lean, so the implications between them could be proved trivially by ignoring the hypothesis. What makes these proofs meaningful is that they do not: each uses only its hypothesis and elementary arithmetic, exactly as in Theorem 10.

ComputationC

Evidence, counterexamples and proof

Regions of a circle: a pattern that breaksPythonExact computationCounterexampleComputationally tested
"""Circle regions: a pattern that breaks.

Put n points on a circle and draw every chord between them. How many regions
does the disc fall into? For n = 1, 2, 3, 4, 5 the answers are 1, 2, 4, 8, 16,
which suggests 2**(n - 1). For n = 6 the answer is 31.

We count regions exactly. The points are rational points of the unit circle,
((1 - t^2)/(1 + t^2), 2t/(1 + t^2)), so every chord crossing is computed with
exact fractions. The chords cut the disc into a connected plane graph, and
Euler's formula V - E + F = 2 then gives

    regions = 1 + (number of chords) + sum over crossing points P of (m_P - 1),

where m_P is the number of chords through P. (Each chord adds one region, and
each crossing on it adds one more.) If no three chords meet at a point this is
1 + C(n, 2) + C(n, 4), which is not a power of 2 for n = 6. If three chords
do meet - as the three diameters of a symmetric hexagon do - the count drops.

Runs unchanged in the browser (Pyodide) using only the standard library.
"""

from fractions import Fraction
from itertools import combinations
from math import comb

def circle_point(t):
    """The rational point of the unit circle with parameter t (a Fraction)."""
    t = Fraction(t)
    d = 1 + t * t
    return ((1 - t * t) / d, 2 * t / d)

def crossing(a, b, c, d):
    """The point where chords ab and cd cross strictly inside both, or None."""
    (x1, y1), (x2, y2), (x3, y3), (x4, y4) = a, b, c, d
    den = (x2 - x1) * (y4 - y3) - (y2 - y1) * (x4 - x3)
    if den == 0:
        return None
    s = ((x3 - x1) * (y4 - y3) - (y3 - y1) * (x4 - x3)) / den
    u = ((x3 - x1) * (y2 - y1) - (y3 - y1) * (x2 - x1)) / den
    if 0 < s < 1 and 0 < u < 1:
        return (x1 + s * (x2 - x1), y1 + s * (y2 - y1))
    return None

def regions(points):
    """Number of regions into which all chords between ``points`` cut the disc."""
    chords = list(combinations(points, 2))
    through = {}
    for (i, ch1), (j, ch2) in combinations(enumerate(chords), 2):
        if set(ch1) & set(ch2):
            continue                        # chords sharing an endpoint
        p = crossing(*ch1, *ch2)
        if p is not None:
            through.setdefault(p, set()).update((i, j))
    return 1 + len(chords) + sum(len(s) - 1 for s in through.values())

def general_position_formula(n):
    """1 + C(n, 2) + C(n, 4): the count when no three chords are concurrent."""
    return 1 + comb(n, 2) + comb(n, 4)

#: Parameters giving points in general position for n <= 8.
PARAMS = [Fraction(k, 7) for k in (0, 2, 5, 9, 14, 22, 37, 61)]

#: Three antipodal pairs: the three diameters all pass through the centre.
HEXAGON_WITH_DIAMETERS = [(Fraction(1), Fraction(0)), (Fraction(-1), Fraction(0)),
                          (Fraction(3, 5), Fraction(4, 5)),
                          (Fraction(-3, 5), Fraction(-4, 5)),
                          (Fraction(-3, 5), Fraction(4, 5)),
                          (Fraction(3, 5), Fraction(-4, 5))]

def main():
    print(" n  regions  2^(n-1)  1+C(n,2)+C(n,4)")
    for n in range(1, 9):
        r = regions([circle_point(t) for t in PARAMS[:n]])
        guess = 2 ** (n - 1)
        mark = "" if r == guess else "   <- pattern broken"
        print(f"{n:2d}  {r:7d}  {guess:7d}  {general_position_formula(n):15d}{mark}")
    print()
    r6 = regions(HEXAGON_WITH_DIAMETERS)
    print(f"Six points forming three diameters (concurrent at the centre): {r6}")
    print("The count depends on the positions, not only on n.")
    print()
    print("Epistemic status: exact counts for these particular point sets, using")
    print("rational arithmetic and Euler's formula (a theorem). They refute the")
    print("guess 2^(n-1): one counterexample suffices. The general formula for")
    print("points in general position needs a proof; numbers cannot supply it.")

if __name__ == "__main__":
    main()
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

The counts 1,2,4,8,161, 2, 4, 8, 16 really do continue 31,57,9931, 57, 99: the general formula for points in general position is 1+(n2)+(n4)1 + \binom{n}{2} + \binom{n}{4}, which a counting argument (with Euler's formula V−E+F=2V - E + F = 2) proves. And when three chords meet at one point the count drops — so even "the number of regions for nn points" needs the hypothesis of general position.

Euclid's numbers and induction formulas, checkedPythonExact computationExhaustive finite checkComputationally tested
"""Euclid's numbers, and evidence versus proof for induction formulas.

Euclid's proof that there are infinitely many primes multiplies the primes of
a finite list and adds 1. The result N need not be prime itself - but every
prime factor of N is missing from the list. Here we factor N for the lists of
the first k primes, k = 1, ..., 9, and check that each factor is new.

Then we test two formulas proved by induction in the lesson,
1 + 2 + ... + n = n(n + 1)/2 and 1 + 3 + ... + (2n - 1) = n^2, for every n up
to 10 000, and a false claim whose inductive step works but whose base case
fails: "n^2 + n + 1 is even".

Runs unchanged in the browser (Pyodide) using only the standard library.
"""

from math import prod

def first_primes(k):
    """The first k primes."""
    primes = []
    n = 2
    while len(primes) < k:
        if all(n % p for p in primes if p * p <= n):
            primes.append(n)
        n += 1
    return primes

def factorize(n):
    """Prime factorisation of n >= 2 by trial division, as a sorted list."""
    if n < 2:
        raise ValueError("n must be at least 2")
    factors = []
    d = 2
    while d * d <= n:
        while n % d == 0:
            factors.append(d)
            n //= d
        d += 1
    if n > 1:
        factors.append(n)
    return factors

def euclid_number(primes):
    """The product of the given primes, plus one."""
    return prod(primes) + 1

def first_failure(claim, upto):
    """The least n in 0..upto with claim(n) false, or None."""
    for n in range(upto + 1):
        if not claim(n):
            return n
    return None

def step_difference(n):
    """(n+1)^2 + (n+1) + 1 minus n^2 + n + 1: always 2(n + 1), an even number,
    which is why "n^2 + n + 1 even" would pass from n to n + 1."""
    return ((n + 1) ** 2 + (n + 1) + 1) - (n * n + n + 1)

def running_check(term, closed_form, upto):
    """Check sum_{i < n} term(i) == closed_form(n) for n = 0..upto,
    accumulating the sum; return the first n where it fails, or None."""
    total = 0
    for n in range(upto + 1):
        if total != closed_form(n):
            return n
        total += term(n)
    return None

def main():
    print(" k  2*3*...*p_k + 1   factorisation           all factors new?")
    for k in range(1, 10):
        ps = first_primes(k)
        n = euclid_number(ps)
        fs = factorize(n)
        shown = " * ".join(map(str, fs)) if len(fs) > 1 else "prime"
        new = all(f not in ps for f in fs)
        print(f"{k:2d}  {n:15d}   {shown:22}  {'yes' if new else 'NO'}")
    print()
    upto = 10_000
    g = running_check(lambda i: i, lambda n: n * (n - 1) // 2, upto)
    o = running_check(lambda i: 2 * i + 1, lambda n: n * n, upto)
    print(f"Gauss: 0+1+...+(n-1) = n(n-1)/2, n <= {upto}: "
          f"{'no failure' if g is None else g}")
    print(f"Odd numbers: 1+3+...+(2n-1) = n^2, n <= {upto}: "
          f"{'no failure' if o is None else o}")
    step = all(step_difference(n) == 2 * (n + 1) for n in range(upto + 1))
    base = first_failure(lambda n: (n * n + n + 1) % 2 == 0, upto)
    print("'n^2+n+1 is even': consecutive values differ by 2(n+1) for all")
    print(f"  n <= {upto}: {step}. So the inductive step works - yet the claim")
    print(f"  fails at n = {base}, the base case, and in fact at every n.")
    print()
    print("Epistemic status: exact arithmetic. The factorisations are complete")
    print("and show that Euclid's numbers need not be prime. The formula checks")
    print("cover n <= 10000 only - finite evidence. The induction proofs in the")
    print("lesson cover every n; the last line shows why a base case is needed.")

if __name__ == "__main__":
    main()
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

The factorisations show every prime factor of p1⋯pk+1p_1 \cdots p_k + 1 is new, as Euclid's proof guarantees — and that the number itself is often not prime. Checking Gauss's formula for n≤10 000n \le 10\,000 is reassuring but finite; the induction proof covers every nn at once.

Exercises

Exercises

1. Proof: direct, contrapositive, contradiction and induction

Warm-upHuman

You want to prove “if n2n^2 is odd, then nn is odd” by contrapositive. What do you assume at the start?

Choose one

2. Proof: direct, contrapositive, contradiction and induction

Warm-upHuman

Use Gauss's formula to compute 1+2+3+⋯+2001 + 2 + 3 + \dots + 200.

3. Proof: direct, contrapositive, contradiction and induction

CoreHuman

In the “all horses are the same colour” induction, where exactly does the argument break down?

Choose one

4. Proof: direct, contrapositive, contradiction and induction

CoreHuman

Let N=2⋅3⋅5⋅7⋅11⋅13+1=30031N = 2 \cdot 3 \cdot 5 \cdot 7 \cdot 11 \cdot 13 + 1 = 30031. What does Euclid's argument guarantee about NN?

Choose one

5. Proof: direct, contrapositive, contradiction and induction

CoreHuman

With an unlimited supply of stamps worth 33 and 77, what is the largest amount that cannot be made exactly?

6. Proof: direct, contrapositive, contradiction and induction

CoreHuman

Which of these statements is proved most naturally by strong induction rather than ordinary induction?

Choose one

7. Proof: direct, contrapositive, contradiction and induction

CoreHuman

“Let a=ba = b. Then a2=aba^2 = ab, so a2−b2=ab−b2a^2 - b^2 = ab - b^2, so (a+b)(a−b)=b(a−b)(a+b)(a-b) = b(a-b), so a+b=ba + b = b, so 2b=b2b = b, so 2=12 = 1.” Which step is invalid?

Choose one

8. Proof: direct, contrapositive, contradiction and induction

StretchHuman

A student proves: “if n2+n+1n^2 + n + 1 is even, then (n+1)2+(n+1)+1(n+1)^2 + (n+1) + 1 is even”, and concludes by induction that n2+n+1n^2 + n + 1 is even for all nn. Which statement is correct?

Choose one

9. Proof: direct, contrapositive, contradiction and induction

CoreFormal

Which Lean proposition expresses the principle of ordinary induction for the natural numbers?

Choose one

10. Proof: direct, contrapositive, contradiction and induction

StretchComputational

Write is_prime(n) and first_failure(claim, limit), which returns the least n with 0 <= n <= limit for which claim(n) is false, or None if there is none. Use them to find the first n for which n2+n+41n^2 + n + 41 is not prime. Why does your search not prove anything about the values beyond limit?

Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.
Common misconceptionsH

Common misconceptions

Misconception

"I checked it for many numbers, so it is proved." Examples are evidence, not proof. The circle regions agree with 2n−12^{n-1} five times and then fail; n2+n+41n^2 + n + 41 is prime forty times and then fails.

Misconception

Proving the converse instead of the statement. To prove "if n2n^2 is even then nn is even" you must start from "n2n^2 is even" (or, by contrapositive, from "nn is odd"). Starting from "nn is even" proves a different theorem.

Misconception

"The inductive step is the real work, so the base case can be skipped." Without a base case an induction proves nothing: "n2+n+1n^2 + n + 1 is even" has a valid inductive step and is false for every nn.

Misconception

Assuming what is to be proved. A proof that uses its conclusion as a step — perhaps hidden in a phrase like "clearly" or in a diagram — is circular, however long it is.

Misconception

Blaming the wrong assumption. A contradiction shows that at least one of your assumptions is false. If you made an extra, unjustified assumption along the way ("let NN be the largest natural number"), the contradiction may be its fault, not the fault of the hypothesis you meant to refute.

Misconception

"Euclid's proof shows that p1p2⋯pk+1p_1 p_2 \cdots p_k + 1 is prime." It shows only that its prime factors are new. 2⋅3⋅5⋅7⋅11⋅13+1=59⋅5092 \cdot 3 \cdot 5 \cdot 7 \cdot 11 \cdot 13 + 1 = 59 \cdot 509.

ViewpointsH

Many ways of seeing

Logic— proofs as mathematical objects

Logicians study proofs themselves. In a formal system a proof is a finite object — a list or tree of formulas, each an axiom or obtained from earlier ones by a rule — and checking it is mechanical, as Lean does. Gerhard Gentzen's work in the 1930s made the structure of proofs a subject of its own; see proof theory. Logic also distinguishes our methods sharply: proving ¬P\neg P by assuming PP and deriving a contradiction is fine in every logic, but proving PP by refuting ¬P\neg P uses the law of excluded middle, which constructive mathematicians do not assume. Euclid's theorem survives either way, because his argument actually constructs a new prime.

Computation— induction is recursion

A proof by induction is a recipe: to get P(5)P(5), start from P(0)P(0) and apply the inductive step five times. Under the propositions-as-types correspondence this is literally a recursive program, and in Lean the proof of gauss_sum is a recursive function on natural numbers. Programmers use the same idea to prove loops correct: a loop invariant is a statement true before the first iteration (base case) and preserved by each iteration (inductive step). See algorithms, correctness and efficiency.

Combinatorics— proof by counting

A different kind of proof of Gauss's formula counts one set in two ways. How many ways are there to choose two different numbers from {0,1,…,n}\{0, 1, \dots, n\}? Choosing the larger one first: if it is jj, there are jj choices for the smaller, giving 0+1+⋯+n0 + 1 + \dots + n. On the other hand the number of pairs from n+1n + 1 objects is (n+12)=(n+1)n2\binom{n+1}{2} = \frac{(n+1)n}{2}. Such double counting arguments often explain a formula better than an induction, which verifies it.

Geometry— proofs without words

The staircase picture proves Gauss's formula for every nn at once, if one reads it as a general construction. The odd-number formula has a picture too: an n×nn \times n square grows into an (n+1)×(n+1)(n+1) \times (n+1) square by adding an L-shaped border of 2n+12n + 1 squares — the shape the Pythagoreans called a gnomon. Pictures can mislead (the circle regions!), so a picture becomes a proof only when we can say precisely why it works for every case.

History & global context

History and global context

  • Euclid's Elements (Alexandria, around 300 BCE) organised geometry and number theory as a chain of propositions deduced from definitions and postulates — the model of mathematical proof for two thousand years. Book IX, Proposition 20 is the infinitude of primes; Book VII contains the theory of divisibility used in our next number-theory lesson.
  • China. In his commentary (263 CE) on The Nine Chapters on the Mathematical Art, Liu Hui justified the book's procedures with careful arguments, for example dissection proofs of area and volume formulas.
  • India. The Yuktibhāṣā of Jyeṣṭhadeva (Kerala, around 1530) explains in detail the reasons (yukti) behind the infinite series of Mādhava's school, including arguments that proceed step by step through all whole numbers.
  • Early induction. Around 1000 CE al-Karajī in Baghdad gave arguments about sums of cubes and binomial coefficients that pass from each case to the next, which historians see as an early form of induction; Levi ben Gershon (Gersonides, 1321), Francesco Maurolico (1575) and Blaise Pascal (1654) used the method more explicitly. The name "mathematical induction" was popularised by Augustus De Morgan in 1838.
  • Foundations. Richard Dedekind (1888) and Giuseppe Peano (1889) made induction one of the defining properties of the natural numbers.
Further reading

Further reading

  • Daniel J. Velleman, How to Prove It: A Structured Approach (1994) — the standard first book on writing proofs.
  • Richard Hammack, Book of Proof (2009; later editions freely available from the author) — direct, contrapositive, contradiction and induction, with many exercises.
  • George Pólya, How to Solve It (1945) — how to find a proof in the first place.
  • Imre Lakatos, Proofs and Refutations (1976) — a dialogue about how proofs, counterexamples and definitions evolve together.