A proof is a logical argument establishing the truth of a statement. Four core techniques appear constantly in CS theory.
| Method | Strategy | When to use |
|---|---|---|
| Direct proof | Assume P, derive Q | Most straightforward "if P then Q" |
| Proof by contrapositive | Prove ¬Q ⇒ ¬P | When negating is easier than proving directly |
| Proof by contradiction | Assume ¬P, derive a contradiction | Showing something cannot exist |
| Mathematical induction | Base case + inductive step | Statements about natural numbers |
Claim: If n is even, then n² is even.
Claim: √2 is irrational.
Claim: 1 + 2 + 3 + … + n = n(n+1)/2 for all n ≥ 1.
1. Prove by direct proof: if n is odd, n² is odd.
2. Use induction to prove: ∑i=1n (2i−1) = n².
A direct proof of 'P implies Q' starts by
Proof by contradiction assumes
The inductive step must show
Proof by contrapositive proves 'P implies Q' by proving
To disprove a universal statement ∀x P(x) you need