Tatal untuk bertukar halaman
Discrete Math · Discrete Mathematics
why checking examples is not enough
In 1772 Leonhard Euler noticed that gives a prime for n = 0, 1, 2, 3, … The figure plots each value as a bar, blue while it is prime.
It stays prime for 40 values in a row, n = 0 to 39. Then at n = 40 it gives 1681 = 41 × 41. (It had to fail by then: at n = 40 the formula is 40 · 41 + 41 = 41 · 41.)
Forty confirming examples did not make the claim “always prime” true. A proof is an argument that a statement holds in every case, built from definitions, axioms and statements already proved, with each step following by a rule of inference (Chapter 1).
This chapter is a toolkit of proof methods: direct proof (2.1), proof by contrapositive and by contradiction (2.2), mathematical induction (2.3) and strong induction (2.4), and how an induction can go wrong (2.5).
from the hypothesis, step by step, to the conclusion
To prove p → q directly, assume p and use definitions and known facts to reach q.
The definitions carry the proof. An integer n is even if for some integer k, and odd if .
Claim. The sum of two odd integers is even.
Proof. Let the odd integers be and , with a and b integers. Then
Since is an integer, the sum is even. ∎
The figure draws it for 7 and 5: each odd number is pairs of units with one left over (red). Put together, the two leftovers make one more pair: 7 + 5 = 12 = 2 · 6. The picture is one case; the algebra covers every a and b at once.
Notice the names: two different letters, a and b. Writing both odds as would silently assume they are equal, and prove only that is even.
proving a statement by its other face
When a direct proof stalls, two indirect methods help.
Proof by contrapositive. Since p → q ≡ ¬q → ¬p (1.2), prove the second instead. Claim: if is even, then n is even. Proof: suppose n is odd, . Then is odd. So an odd n gives an odd , which is the contrapositive. ∎
Proof by contradiction. Assume the statement is false and derive something impossible. Claim: is irrational. Proof: suppose in lowest terms. Then , so is even, so a is even (the claim just proved): . Then , so and b is even too. Both even contradicts lowest terms. ∎
Euclid’s proof that there are infinitely many primes (Elements, Book IX, Proposition 20) is the other classic. Suppose the primes were only . Let . Dividing N by any leaves remainder 1, so none of them divides N. But N > 1 has some prime factor, which is not on the list: a contradiction.
| primes used | N | factors of N |
|---|---|---|
| 2 | 3 | 3 |
| 2, 3 | 7 | 7 |
| 2, 3, 5 | 31 | 31 |
| 2, 3, 5, 7 | 211 | 211 |
| 2, 3, 5, 7, 11 | 2311 | 2311 |
| 2, 3, 5, 7, 11, 13 | 30031 | 59 × 509 |
Careful: N itself need not be prime. With the first 6 primes, 30031 = 59 × 509. The proof only needs N’s prime factors to be new.
a first domino, and every domino knocking over the next
To prove a statement P(n) for every integer n ≥ 1, induction proves two things:
Then P(1) gives P(2), which gives P(3), and so on, like a row of dominoes.
Claim. for every n ≥ 1.
Basis. .
Inductive step. Assume . Add to both sides:
which is the formula for . ∎
The figure shows why the formula is true. The sum is a staircase of n columns. A second, upside-down staircase fits on top, making an n by n + 1 rectangle, so twice the sum is . For n = 6: 1 + 2 + … + 6 = 6 · 7 / 2 = 21. The young Gauss reportedly found 1 + … + 100 = 5050 this way.
leaning on every earlier case, not just the last one
In strong induction the inductive step may assume P(j) for every j up to k, not only P(k). It proves the same statements as ordinary induction, but some proofs need to reach further back.
Claim. Every amount of postage of 12 cents or more can be made from 4-cent and 5-cent stamps.
Basis. Four cases, 12, 13, 14, 15:
| cents | stamps |
|---|---|
| 12 | 4 + 4 + 4 |
| 13 | 4 + 4 + 5 |
| 14 | 4 + 5 + 5 |
| 15 | 5 + 5 + 5 |
Inductive step. Let k ≥ 15, and assume every amount from 12 to k can be made. Then is at least 12 and at most k, so it can be made; add one 4-cent stamp to get . ∎
The step reaches back four cases, which is why it needs four bases. In the figure each row from 16 on is the row four above it plus a red 4-cent stamp.
The bound is sharp: 11 cents cannot be made (nor can 1, 2, 3, 6, 7). Strong induction is also how one proves that every integer ≥ 2 is a product of primes: k + 1 is either prime or a product of two smaller numbers, each covered by the hypothesis.
all horses are the same color?
An induction proof is only as good as its weakest step. George Pólya’s famous false proof shows how a step can quietly fail for one value of k.
“Claim.” In any group of n horses, all have the same color.
“Basis.” One horse has the same color as itself. True.
“Step.” Take k + 1 horses. The first k are one color by the hypothesis, and so are the last k. The two groups overlap, so all k + 1 share one color.
The flaw: the two groups share horses. For k + 1 = 5 they share 3, but for k + 1 = 2 they share none: the first horse and the second horse are separate groups, and nothing links their colors. The step from 1 to 2 fails, so every later domino is never knocked over.
The lesson: the inductive step must hold for every k from the base on. Check the smallest case of the step by hand.
A counterexample is the other way to show a claim false: one case where it fails, like n = 40 for Euler’s polynomial.