Direct Proof, Contrapositive and Contradiction
Prove statements about integers directly, by contrapositive and by contradiction, disprove claims with counterexamples, and avoid circular reasoning.
Welcome back!
Step 1 of 13Learn
What a proof is
A programmer tests a sorting function on 10,000 random arrays and it works every time. Is it correct? Not necessarily: a bug might appear only for an array with repeated values in a particular order. Testing can find bugs, but it can't prove their absence. A proof can.
A proof is a chain of logical steps that starts from definitions, assumptions and previously proven facts and ends at the claim, with every step justified. Most statements you'll prove have the form "if P, then Q," often with an implied "for all": "For every integer n, if n is odd, then n² is odd."
Proofs depend on precise definitions. Two you'll use constantly:
- An integer n is even if n = 2k for some integer k.
- An integer n is odd if n = 2k + 1 for some integer k.
Direct proof. Assume P, then reason forward until you reach Q.
Claim. If n is odd, then n² is odd.
Proof. Suppose n is odd. Then n = 2k + 1 for some integer k. So
n² = (2k + 1)² = 4k² + 4k + 1 = 2(2k² + 2k) + 1.
Since 2k² + 2k is an integer, n² has the form 2m + 1, so n² is odd. ∎
Notice the structure: unpack the hypothesis with a definition, do algebra, then repackage the result to match the definition in the conclusion. That pattern handles a surprising share of beginning proofs.
Step 2 of 13Practice · Diagram
The proof toolkit
Which tool disproves a "for all" statement?
Tap the shape that answers the question, then press Check.
- Prove or disprove
- Direct proof
Assume p, reason step by step to q.
- Contrapositive
Prove ¬q → ¬p instead.
- Contradiction
Assume the statement is false and derive something impossible.
- Proof by cases
Split into possibilities and handle each.
- Induction
For statements about all n ≥ some start. Next lesson.
- Counterexample
One case where the statement fails.
Step 3 of 13Practice · Fill in the blanks
Fill in the blanks
Complete the direct proof that the sum of two even integers is even. Let a = 2j and b = 2k. Then a + b = 2(), which is even because it is 2 times an integer.
Step 4 of 13Learn
Proof by contrapositive
Sometimes the direct route is awkward. Try proving "if n² is even, then n is even" directly: n² = 2k, so n = √(2k)… and you're stuck, because square roots don't play well with evenness.
Remember that p → q is equivalent to its contrapositive ¬q → ¬p. So prove that instead.
Claim. If n² is even, then n is even.
Proof (by contrapositive). We prove: if n is not even, then n² is not even. Suppose n is odd. By the direct proof above, n² is odd, so n² is not even. Since the contrapositive is true, the original statement is true. ∎
That's the whole proof, because the hard work was already done.
When to use the contrapositive: when the conclusion's negation gives you something concrete to work with. "n is even" is hard to start from when you only know n², but "n is odd" hands you n = 2k + 1. Statements whose conclusions are negative ("then x is not rational," "then the graph is not connected") are often easier in contrapositive form, because negating them gives something positive.
Proof by cases. If the hypothesis naturally splits into possibilities, handle each separately. To prove that n² + n is always even, consider two cases. If n is even, n = 2k and n² + n = 4k² + 2k = 2(2k² + k). If n is odd, n = 2k + 1 and n² + n = (2k + 1)(2k + 2) = 2(2k + 1)(k + 1). Even either way. (A slicker argument: n² + n = n(n + 1) is a product of consecutive integers, one of which is even.)
Step 5 of 13Diagram
The contrapositive route for n² even ⇒ n even
Tap a shape with to see more.
- Goal: n² even → n even
Hard to start from n² = 2k.
- Prove: n odd → n² odd
The contrapositive, logically equivalent.
- n = 2k + 1
Odd gives a concrete form to work with.
- n² = 2(2k² + 2k) + 1
Which is odd.
- Original statement holds ∎
Step 6 of 13Practice · Choose one
Which statement is the right one to prove when proving "if 3n + 2 is odd, then n is odd" by contrapositive?
Step 7 of 13Learn
Proof by contradiction
Proof by contradiction assumes the statement is false and shows that this leads to something impossible. Since a false assumption caused the contradiction, the statement must be true.
The most famous example is over 2,000 years old.
Claim. √2 is irrational (it can't be written as a fraction of integers).
Proof. Suppose, for contradiction, that √2 = a/b, where a and b are integers with b ≠ 0 and the fraction is in lowest terms (no common factor). Squaring gives 2 = a²/b², so a² = 2b². Then a² is even, so a is even (the contrapositive proof above), say a = 2c. Substituting, 4c² = 2b², so b² = 2c², which makes b² even and therefore b even. But then a and b are both even, sharing the factor 2, contradicting lowest terms. So √2 is irrational. ∎
Another classic: there are infinitely many primes (Euclid). Suppose there were only finitely many: p₁, p₂, …, pₙ. Consider N = p₁p₂⋯pₙ + 1. Dividing N by any pᵢ leaves remainder 1, so no pᵢ divides N. But every integer greater than 1 has a prime factor, so N has a prime factor not on the list. Contradiction.
A subtle point: N itself need not be prime. With primes 2, 3, 5, 7, 11, 13, N = 30,031 = 59 × 509. The argument only needs N to have some prime factor missing from the list.
Disproving with a counterexample. To show a universal claim is false, one counterexample suffices. "Every odd number is prime" fails at 9.
Step 8 of 13Compare
Three proof techniques
| Aspect | Direct | Contrapositive | Contradiction |
|---|---|---|---|
| You assume | p | ¬q | p and ¬q (the statement is false) |
| You show | q | ¬p | Something impossible |
| Best when | p gives a usable form | ¬q is concrete, q is not | The claim is "not" or "no ... exists" |
| Classic example | Even + even is even | n² even ⇒ n even | √2 is irrational |
Step 9 of 13Practice · Put in order
Put the steps of the proof that √2 is irrational in order.
Drag the items, or use the arrow buttons, to put them in order.
- Square both sides to get a² = 2b²
- Note that a and b share the factor 2, contradicting lowest terms
- Substitute to get b² = 2c², so b is even
- Conclude a is even, so write a = 2c
- Assume √2 = a/b in lowest terms
Step 10 of 13Practice · Spot the mistake
This "proof" claims that if n² is a multiple of 4, then n is a multiple of 4. Which step is the error?
Step 11 of 13Note
Step 12 of 13Practice · Sort into groups
Which technique fits each claim most naturally?
Tap an item, then tap its group (or drag it there).
Step 13 of 13Practice · True or false
Checking that a statement holds for n = 1 through n = 1,000,000 proves it holds for all positive integers.
Lesson complete!