← CMPSC 360 course homepage
CMPSC 360 · Fall 2026

Review on Proofs

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 nn is even if n=2kn = 2k for some integer kk, and odd if n=2k+1n = 2k + 1 for some integer kk. Every integer is even or odd, and not both. For integers aa and bb, a∣ba \mid b means b=acb = ac for some integer cc. A real number is rational if it equals a/ba/b for some integers a,ba, b with b≠0b \neq 0; the fraction is in lowest terms if 11 is the only positive integer dividing both aa and bb. Every rational number can be written in lowest terms (take b>0b > 0 as small as possible).

1Proof by contrapositive

P⇒QP \Rightarrow Q and ¬Q⇒¬P\neg Q \Rightarrow \neg P are equivalent, so a direct proof of ¬Q⇒¬P\neg Q \Rightarrow \neg P proves P⇒QP \Rightarrow Q.

Structure
Proof (contrapositive). We prove: if ¬Q\neg Q, then ¬P\neg P. Suppose ¬Q\neg Q. … Therefore ¬P\neg P. ∎
Example 1Lecture 4

ClaimFor every integer nn: if n2n^2 is even, then nn is even.

Example 2Lecture 4

ClaimFor all integers aa and bb: if a+ba + b is odd, then aa is odd or bb is odd.

2Proof by contradiction

To prove a statement SS, assume ¬S\neg S and reach something impossible. For an implication P⇒QP \Rightarrow Q, the negation is P∧¬QP \wedge \neg Q.

Structure
Proof (contradiction). Suppose, for contradiction, that ¬S\neg S. … This contradicts …. Hence SS. ∎
Example 3Lecture 4

Claim2\sqrt{2} is irrational: no rational number has square 22.

Example 4Lecture 4 · the pigeonhole principle

ClaimLet n≥1n \ge 1 be an integer. If more than nn pigeons are placed in nn holes, each pigeon in exactly one hole, then some hole holds at least two pigeons.

hole 1hole 2hole 3hole 4
Four holes, five pigeons. If every hole held at most one pigeon, there would be at most 44.

3Induction

Structure
To prove SnS_n for every integer n≥an \ge a:
Base case. Prove SaS_a.
Inductive hypothesis. Let k≥ak \ge a be an arbitrary integer, and assume SkS_k.
Inductive step. Prove Sk+1S_{k+1}, using the hypothesis.
Conclusion. By induction, SnS_n holds for every integer n≥an \ge a.
Example 5Lecture 6

ClaimFor every integer n≥1n \ge 1, 1+3+5+⋯+(2n−1)=n21 + 3 + 5 + \cdots + (2n - 1) = n^2.

13579
Band kk is an L of 2k−12k - 1 dots, and the bands fill the square: 1+3+5+7+9=521 + 3 + 5 + 7 + 9 = 5^2.
Example 6Lecture 6

ClaimFor every integer n≥0n \ge 0, 3∣(4n−1)3 \mid (4^n - 1).

Example 7Lecture 6

Claim2n>n22^n > n^2 for every integer n≥5n \ge 5.

nn1234567
2n2^n248163264128
n2n^214916253649
2n>n22^n > n^2yesnononoyesyesyes
The claim fails at n=2,3,4n = 2, 3, 4, so the base case is n=5n = 5.

4Strong induction

Structure
To prove SnS_n for every integer n≥an \ge a:
Base cases. Prove Sa,Sa+1,…,SbS_a, S_{a+1}, \dots, S_b: as many as the step reaches back.
Inductive hypothesis. Let k≥bk \ge b be an arbitrary integer, and assume SjS_j for every integer jj with a≤j≤ka \le j \le k.
Inductive step. Prove Sk+1S_{k+1}, using the hypothesis.
Conclusion. By strong induction, SnS_n holds for every integer n≥an \ge a.
Example 8Lecture 6

ClaimLet F1=F2=1F_1 = F_2 = 1 and Fn=Fn−1+Fn−2F_n = F_{n-1} + F_{n-2} for n≥3n \ge 3. Then Fn<2nF_n < 2^n for every integer n≥1n \ge 1.

Example 9Lecture 6

ClaimEvery integer n≥1n \ge 1 is a sum of distinct powers of 22: n=2a1+⋯+2arn = 2^{a_1} + \cdots + 2^{a_r} for some r≥1r \ge 1 and distinct integers a1,…,ar≥0a_1, \dots, a_r \ge 0.

nn2m2m or 2m+12m+1powers of 22
13132⋅6+12 \cdot 6 + 123+22+202^3 + 2^2 + 2^0
662⋅32 \cdot 322+212^2 + 2^1
332⋅1+12 \cdot 1 + 121+202^1 + 2^0
11base case202^0
Read from the bottom up: double, and add 202^0 when nn is odd. Each nn comes from mm, about n/2n/2, which is why the hypothesis covers every j≤kj \le k.
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ℓv_0, v_1, \dots, v_\ell (ℓ≥0\ell \ge 0) uses the edges {vi−1,vi}\{v_{i-1}, v_i\}, and it is closed if vℓ=v0v_\ell = v_0; a single vertex is a walk with ℓ=0\ell = 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 “uu and vv 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.

123123456789abcfgde

A connected graph in which every degree is even: bb and cc have degree 44, and every other vertex has degree 22.