In the remainder of the semester, we assume you have a good understanding of writing proofs, so this is a good time to review. For each technique below, the structure of the proof comes first, followed by examples from class with complete proofs.
Definitions and facts. An integer n is even if n=2k for some integer k, and odd if n=2k+1 for some integer k. Every integer is even or odd, and not both. For integers a and b, a∣b means b=ac for some integer c. A real number is rational if it equals a/b for some integers a,b with b=0; the fraction is in lowest terms if 1 is the only positive integer dividing both a and b. Every rational number can be written in lowest terms (take b>0 as small as possible).
1Proof by contrapositive
P⇒Q and ¬Q⇒¬P are equivalent, so a direct proof of ¬Q⇒¬P proves P⇒Q.
Structure
Proof (contrapositive). We prove: if ¬Q, then ¬P. Suppose ¬Q. … Therefore ¬P. ∎
Example 1Lecture 4
ClaimFor every integer n: if n2 is even, then n is even.
Proof (contrapositive). Since every integer is even or odd and not both, the contrapositive is: for every integer n, if n is odd, then n2 is odd. Let n be an arbitrary odd integer, so n=2k+1 for some integer k. Then n2=4k2+4k+1=2(2k2+2k)+1, and 2k2+2k is an integer, so n2 is odd. ∎
Example 2Lecture 4
ClaimFor all integers a and b: if a+b is odd, then a is odd or b is odd.
Proof (contrapositive). By De Morgan's law, the negation of “a is odd or b is odd” is “a is not odd and b is not odd”, that is, a and b are both even. So the contrapositive is: if a and b are both even, then a+b is even (that is, not odd). Let a and b be arbitrary even integers, say a=2k and b=2ℓ with k,ℓ integers. Then a+b=2(k+ℓ), and k+ℓ is an integer, so a+b is even. ∎
2Proof by contradiction
To prove a statement S, assume ¬S and reach something impossible. For an implication P⇒Q, the negation is P∧¬Q.
Structure
Proof (contradiction). Suppose, for contradiction, that ¬S. … This
contradicts …. Hence S. ∎
Example 3Lecture 4
Claim2 is irrational: no rational number has square 2.
Proof (contradiction). Suppose, for contradiction, that some rational number has square 2. Write it as a/b with a,b integers, b=0, in lowest terms. Then a2=2b2, so a2 is even, and by Example 1, a is even: a=2k for some integer k. Then 4k2=2b2, so b2=2k2 is even, and by Example 1 again, b is even. So 2 divides both a and b, which contradicts that a/b is in lowest terms. ∎
Example 4Lecture 4 · the pigeonhole principle
ClaimLet n≥1 be an integer. If more than n pigeons are placed in n holes, each pigeon in exactly one hole, then some hole holds at least two pigeons.
Four holes, five pigeons. If every hole held at most one pigeon, there would be at most 4.
Proof (contradiction). Suppose, for contradiction, that more than n pigeons are placed in n holes, each in exactly one hole, and that every hole holds at most one pigeon. Let pi be the number of pigeons in hole i. Then the number of pigeons is p1+p2+⋯+pn≤1+1+⋯+1=n, which contradicts that there are more than n. ∎
3Induction
Structure
To prove Sn for every integer n≥a: Base case. Prove Sa. Inductive hypothesis. Let k≥a be an arbitrary integer, and assume Sk. Inductive step. Prove Sk+1, using the hypothesis. Conclusion. By induction, Sn holds for every integer n≥a.
Example 5Lecture 6
ClaimFor every integer n≥1, 1+3+5+⋯+(2n−1)=n2.
Band k is an L of 2k−1 dots, and the bands fill the square: 1+3+5+7+9=52.
Proof (induction on n).
Base case. For n=1, both sides equal 1.
Inductive hypothesis. Let k≥1 be an arbitrary integer, and assume 1+3+⋯+(2k−1)=k2.
Inductive step. The sum of the first k+1 positive odd numbers is the sum of the first k plus 2(k+1)−1=2k+1. By the inductive hypothesis, 1+3+⋯+(2k−1)+(2k+1)=k2+2k+1=(k+1)2. By induction, the claim holds for every integer n≥1. ∎
Example 6Lecture 6
ClaimFor every integer n≥0, 3∣(4n−1).
Proof (induction on n).
Base case.40−1=0=3⋅0.
Inductive hypothesis. Let k≥0 be an arbitrary integer, and assume 3∣(4k−1): 4k−1=3a for some integer a.
Inductive step. By the inductive hypothesis, 4k+1−1=4(4k−1)+3=4⋅3a+3=3(4a+1), and 4a+1 is an integer, so 3∣(4k+1−1). By induction, the claim holds for every integer n≥0. ∎
Example 7Lecture 6
Claim2n>n2 for every integer n≥5.
n
1
2
3
4
5
6
7
2n
2
4
8
16
32
64
128
n2
1
4
9
16
25
36
49
2n>n2
yes
no
no
no
yes
yes
yes
The claim fails at n=2,3,4, so the base case is n=5.
Proof (induction on n).
Base case.25=32>25=52.
Inductive hypothesis. Let k≥5 be an arbitrary integer, and assume 2k>k2.
Inductive step. Multiplying the inductive hypothesis by 2 gives 2k+1>2k2. Since k−1≥4, we have 2k2−(k+1)2=(k−1)2−2≥14>0. So 2k+1>2k2>(k+1)2. By induction, the claim holds for every integer n≥5. ∎
4Strong induction
Structure
To prove Sn for every integer n≥a: Base cases. Prove Sa,Sa+1,…,Sb: as many as the step reaches back. Inductive hypothesis. Let k≥b be an arbitrary integer, and assume Sj for every
integer j with a≤j≤k. Inductive step. Prove Sk+1, using the hypothesis. Conclusion. By strong induction, Sn holds for every integer n≥a.
Example 8Lecture 6
ClaimLet F1=F2=1 and Fn=Fn−1+Fn−2 for n≥3. Then Fn<2n for every integer n≥1.
Proof (strong induction on n).
Base cases.F1=1<2 and F2=1<4.
Inductive hypothesis. Let k≥2 be an arbitrary integer, and assume Fj<2j for every integer j with 1≤j≤k.
Inductive step. Since k+1≥3, Fk+1=Fk+Fk−1, and 1≤k−1<k. By the inductive hypothesis, Fk+1=Fk+Fk−1<2k+2k−1<2k+2k=2k+1. By strong induction, the claim holds for every integer n≥1. ∎
Example 9Lecture 6
ClaimEvery integer n≥1 is a sum of distinct powers of 2: n=2a1+⋯+2ar for some r≥1 and distinct integers a1,…,ar≥0.
n
2m or 2m+1
powers of 2
13
2⋅6+1
23+22+20
6
2⋅3
22+21
3
2⋅1+1
21+20
1
base case
20
Read from the bottom up: double, and add 20 when n is odd. Each n comes from m, about n/2, which is why the hypothesis covers every j≤k.
Proof (strong induction on n).
Base case.1=20.
Inductive hypothesis. Let k≥1 be an arbitrary integer, and assume every integer j with 1≤j≤k is a sum of distinct powers of 2.
Inductive step. Let n=k+1. Since n is even or odd, n=2m or n=2m+1 for some integer m, and in either case n−1≤2m≤n. So 2m≥k≥1, which gives m≥1, and m≤(k+1)/2≤k. By the inductive hypothesis, m=2a1+⋯+2ar with distinct integers a1,…,ar≥0, so 2m=2a1+1+⋯+2ar+1,2m+1=2a1+1+⋯+2ar+1+20. The exponents a1+1,…,ar+1 are distinct and at least 1, so in both sums the exponents are distinct, and n is one of the two. By strong induction, the claim holds for every integer n≥1. ∎
Example 10Graph Theory I · Euler’s theorem
A graph has a finite nonempty set of vertices, and each edge is a set of two different vertices. A walk v0,v1,…,vℓ (ℓ≥0) uses the edges {vi−1,vi}, and it is closed if vℓ=v0; a single vertex is a walk with ℓ=0. An Euler tour is a closed walk that uses every edge exactly once. A graph is connected if any two of its vertices are joined by a walk, and its components are the classes of the relation “u and v are joined by a walk”. The claim is the “if” half of Euler's theorem; the “only if” half was proved in class by counting.
ClaimEvery connected graph in which every vertex has even degree has an Euler tour.
A connected graph in which every degree is even: b and c have degree 4, and every other vertex has degree 2.
(1) Start at a and walk along unused edges: a,b,c,a. Both edges at a are now used, so the walk stops, back where it started. This closed walk is C.
(2) Take out the edges of C. Three pieces are left: a on its own, the triangle b,f,g and the triangle c,d,e. Each has even degrees and fewer edges, so each has an Euler tour. (3) Each piece meets C, at a, b and c.
(4) Follow C, and go round each piece where C first reaches it: a,b,f,g,b,c,d,e,c,a. Every edge is used exactly once.
Proof (strong induction on the number of edges). Let G be a connected graph in which every vertex has even degree, and let m be the number of edges of G.
Base case.m=0. G has at least one vertex, and it cannot have two different vertices u and w: a walk from u to w would have to use an edge. So G has exactly one vertex v. The walk consisting of v alone is closed, and it uses every edge of G (there are none) exactly once, so it is an Euler tour.
Inductive hypothesis. Now let m≥1, and assume that every connected graph with fewer than m edges in which every vertex has even degree has an Euler tour.
Inductive step. We build an Euler tour of G.
(1) A closed walk. Pick a vertex v with an edge, and walk from v along unused edges until the current vertex has none left; this stops, as there are finitely many edges. If it stopped at some x=v, then each earlier visit to x used two edges at x and the last arrival one more, an odd number in all; as deg(x) is even, some edge at x would still be unused. So the walk ends at v: it is a closed walk C=c0,c1,…,cℓ with c0=cℓ=v and ℓ≥1, using no edge twice.
(2) The pieces. Let G′ be the graph with the vertices of G and the edges that C does not use; it has m−ℓ<m edges. C uses two edges at ci for each 0<i<ℓ, and the first and last edges at v, so every vertex has even degree in G′. Let H be a component of G′, with the edges of G′ between its vertices. Every edge of G′ at a vertex of H lies in H, so the degrees in H are those in G′, which are even; two vertices of H are joined by a walk in G′, which stays in H, so H is connected; and H has fewer than m edges. By the inductive hypothesis, H has an Euler tour.
(3) Each piece meets C. Let u be a vertex of a component H, and take a walk in G from u to v. Let w be its first vertex on C. Each edge of the walk before w has an endpoint off C, while an edge that C uses has both endpoints on C; so C does not use it, and these edges are in G′. So w lies in H.
(4) Splicing. For each component H, let iH be the least i with ci in H. If H has no edge, then H is the single vertex ciH, and its tour is that vertex alone. Otherwise H is connected with at least two vertices, so every vertex of H has an edge, and ciH lies on the tour w0,w1,…,ws of H (where ws=w0): say ciH=wj with 0≤j<s. Then wj,…,ws,w1,…,wj is a tour of H that starts and ends at ciH (if j=0, keep the tour as it is). Follow C, and at each ci go round the tours of all components H with iH=i. The result is a closed walk. Every edge of G is used by C or lies in exactly one component, C and each tour use their edges once, and each tour is inserted once; so the walk uses every edge of G exactly once: it is an Euler tour of G.
By strong induction on the number of edges, every connected graph in which every vertex has even degree has an Euler tour. ∎