Discrete MathProof Techniques

Proof by Contrapositive

To prove P → Q, prove ¬Q → ¬P instead: to show "if n² is even, then n is even," show that odd n gives odd n².

Not started Jump to practice

Sometimes a direct proof gets stuck because the hypothesis gives you nothing to compute with. Knowing that "$n^{2}$ is even" does not hand you a formula for $n$. The fix uses an equivalence you already know: a conditional and its contrapositive are true together.

Key idea

To prove $P \to Q$ by contrapositive, prove $\neg Q \to \neg P$ directly instead: assume $Q$ is false and show $P$ is false. Since $P \to Q \equiv \neg Q \to \neg P$, this proves the original statement.

Why it works

The two statements have identical truth tables: each is false only when $P$ is true and $Q$ is false. So a proof of one is a proof of the other. The switch helps when $\neg Q$ is the easier starting point. "$n$ is not even" gives $n = 2k + 1$, something you can square and expand.

Worked examples

Worked example: If $n^{2}$ is even, then $n$ is even

Prove: for every integer $n$, if $n^{2}$ is even, then $n$ is even.
  1. Contrapositive: if $n$ is not even (odd), then $n^{2}$ is not even (odd).
  2. Assume $n$ is odd: $n = 2k + 1$. Then $n^{2} = 4k^{2} + 4k + 1 = 2(2k^{2} + 2k) + 1$.
  3. That is odd, so the contrapositive is proved, and with it the original statement.

Answer: Proved via: $n$ odd implies $n^{2} = 2(2k^{2} + 2k) + 1$ is odd.

Worked example: An "or" in the conclusion

Prove: for real numbers $x$ and $y$, if $x + y \ge 10$, then $x \ge 5$ or $y \ge 5$.
  1. Negate the conclusion with De Morgan: not ($x \ge 5$ or $y \ge 5$) is $x < 5$ and $y < 5$.
  2. Contrapositive: if $x < 5$ and $y < 5$, then $x + y < 10$.
  3. Adding the inequalities gives $x + y < 5 + 5 = 10$. Done.

Answer: Proved via: $x < 5$ and $y < 5$ give $x + y < 10$.

Worked example: A linear expression

Prove: if $3n + 5$ is odd, then $n$ is even.
  1. Contrapositive: if $n$ is odd, then $3n + 5$ is even.
  2. Let $n = 2k + 1$. Then $3n + 5 = 6k + 3 + 5 = 6k + 8 = 2(3k + 4)$.
  3. That is even, which proves the contrapositive.

Answer: Proved via $3n + 5 = 2(3k + 4)$ when $n$ is odd.

Common mistake

Proving the converse by accident. To prove "if $n^{2}$ is even, then $n$ is even," some students assume $n$ is even and show $n^{2}$ is even. That proves the converse $Q \to P$, a different statement (and here an easier, true one, which makes the slip hard to notice). Check: the contrapositive starts from the negation of the conclusion and ends at the negation of the hypothesis. Both parts get negated, and they swap places.

Practice

Pass with 3 right answers, the last 2 in a row. Each right answer earns 2 XP.

Loading practice…

Builds on

Leads to

Sources and further reading

  • Oscar Levin, Discrete Mathematics: An Open Introduction (3rd ed.), section "Proofs" (proof by contrapositive)
  • MIT OpenCourseWare 6.042J Mathematics for Computer Science (Lehman, Leighton and Meyer), chapter "Proofs"
  • Richard Hammack, Book of Proof (3rd ed.), chapter "Contrapositive Proof"
@teddyrookbook GitHub