Proof by Contrapositive
A proof by contrapositive proves “if P, then Q” by giving a direct proof of its contrapositive, “if not Q, then not P.” The two statements are logically equivalent, so proving one proves the other. Use it when “not Q” gives you more to work with than P does, as in “if n² is even, then n is even.”
Before this lesson: Direct Proof and Logical Equivalence
Why proof by contrapositive works
The contrapositive of p → q is ¬q → ¬p: switch the hypothesis and conclusion and negate both. You met it with the converse and inverse in conditional statements. A truth table shows the conditional and its contrapositive always have the same truth value.
| p | q | p \to q | \lnot q | \lnot p | \lnot q \to \lnot p |
|---|---|---|---|---|---|
| T | T | T | F | F | T |
| T | F | F | T | F | F |
| F | T | T | F | T | T |
| F | F | T | T | T | T |
The third and last columns match in every row, so p → q ≡ ¬q → ¬p. A proof of either one is a proof of the other.
p \to q \;\equiv\; \lnot q \to \lnot p
How to write a proof by contrapositive
- Identify the hypothesis P and the conclusion Q.
- Write the negations ¬Q and ¬P carefully. “Not even” means odd, “not greater than” means less than or equal to, and “not (A or B)” means “not A and not B.”
- State the contrapositive: “We prove that if ¬Q, then ¬P.”
- Assume ¬Q and give a direct proof that ¬P follows.
- Conclude that the original statement is true, because it is equivalent to what you proved.
When to use a contrapositive
Try it when the hypothesis is about a complicated expression (like n2 or 3n + 2) and the conclusion is about a simple one (like n). Starting from n2 = 2k gives no easy way to describe n, but starting from n = 2k + 1 does. It also helps when the conclusion has “or” or “not” in it, because the negation turns those into “and” or a positive fact.
Proof by contrapositive examples
Example 1: If n² is even, then n is even
Prove for every integer n: if n2 is even, then n is even.
\text{If } n \text{ is odd, then } n^2 \text{ is odd.}State the contrapositive: “not even” is “odd” for both parts.
n = 2k + 1
Assume n is odd, so n = 2k + 1 for some integer k.
n^2 = 4k^2 + 4k + 1
Square both sides by expanding the square of a binomial.
n^2 = 2(2k^2 + 2k) + 1
Factor 2 out of the first two terms; 2k² + 2k is an integer.
Answer: n2 is odd whenever n is odd. That proves the contrapositive, so if n2 is even, then n is even.
Example 2: If 3n + 2 is odd, then n is odd
Prove for every integer n: if 3n + 2 is odd, then n is odd.
\text{If } n \text{ is even, then } 3n + 2 \text{ is even.}State the contrapositive.
n = 2k
Assume n is even, so n = 2k for some integer k.
3n + 2 = 3(2k) + 2
Substitute.
3n + 2 = 6k + 2
Multiply.
3n + 2 = 2(3k + 1)
Factor out 2 (factoring out the GCF); 3k + 1 is an integer.
Answer: 3n + 2 is even whenever n is even, so if 3n + 2 is odd, then n is odd.
Example 3: A conclusion with “or”
Prove for all integers x and y: if xy is even, then x is even or y is even.
\lnot(x \text{ even} \lor y \text{ even}) \equiv x \text{ odd} \land y \text{ odd}Negate the conclusion with De Morgan’s law.
\text{If } x \text{ and } y \text{ are odd, then } xy \text{ is odd.}State the contrapositive.
x = 2a + 1,\quad y = 2b + 1
Assume both are odd, with a and b integers.
xy = (2a + 1)(2b + 1)
Multiply.
xy = 4ab + 2a + 2b + 1
Expand (multiplying binomials).
xy = 2(2ab + a + b) + 1
Factor 2 out of the first three terms; 2ab + a + b is an integer.
Answer: xy is odd when x and y are both odd. So if xy is even, at least one of x and y is even.
Example 4: An inequality with real numbers
Prove for every real number x: if x3 + x > 0, then x > 0.
\text{If } x \le 0, \text{ then } x^3 + x \le 0.State the contrapositive: “not greater than 0” is “less than or equal to 0.”
x \le 0
Assume x ≤ 0.
x^2 \ge 0
A square is never negative.
x^3 = x \cdot x^2 \le 0
A number that is 0 or negative times a number that is 0 or positive is 0 or negative.
x^3 + x \le 0 + 0
Add the two inequalities x³ ≤ 0 and x ≤ 0.
x^3 + x \le 0
Simplify.
Answer: x3 + x ≤ 0 whenever x ≤ 0, so if x3 + x > 0, then x > 0.
Example 5: Ticket sales (word problem)
A club’s 10 members sold 101 raffle tickets in all. Prove that at least one member sold 11 or more tickets.
\text{If every member sold at most 10, the total is at most 100.}State the contrapositive of “if the total is 101, someone sold at least 11.”
t_1 \le 10,\ t_2 \le 10,\ \dots,\ t_{10} \le 10Assume each member’s count tᵢ is at most 10.
t_1 + t_2 + \dots + t_{10} \le 10 \cdot 10Add the 10 inequalities.
t_1 + t_2 + \dots + t_{10} \le 100Multiply.
100 \lt 101
So the total can’t be 101.
Answer: if no one sold 11 or more, the club sold at most 100 tickets. The club sold 101, so some member sold at least 11. This is the idea behind the pigeonhole principle, covered later in this course.
Common mistakes
| Mistake | Example of the error | Fix |
|---|---|---|
| Proving the converse | Proving “if n is even, then n² is even” for “if n² is even, then n is even” | The converse q → p is a different statement. Negate both parts and switch them. |
| Proving the inverse | Proving “if n² is odd, then n is odd” | That is ¬p → ¬q, the inverse. The contrapositive switches the order too. |
| Negating an inequality wrongly | Negating x > 0 as x < 0 | The negation of x > 0 is x ≤ 0, which includes 0. |
| Negating “or” as “or” | Negating “x even or y even” as “x odd or y odd” | Use De Morgan’s law: “x odd and y odd.” |
| Not saying which statement you prove | Starting with “Assume n is odd” with no explanation | Write the contrapositive first, so the reader knows the plan. |
| Confusing it with contradiction | Assuming P and ¬Q, then proving ¬P | That is a proof by contradiction. A contrapositive proof assumes only ¬Q. |
Related ideas
The next lesson, Proof by Contradiction, assumes the whole statement is false and finds something impossible. Proof by contrapositive is a special, tidier case of that idea. Both rest on modus tollens: from p → q and ¬q you may conclude ¬p.
Practice problems
- Write the contrapositive of “If a polygon is a square, then it has four sides.”
- Write the contrapositive of “If n is divisible by 6, then n is divisible by 3.”
- For real x, write the contrapositive of “If x > 2, then x2 > 4.”
- Prove for every integer n: if n2 is odd, then n is odd.
- Prove for every integer n: if 5n + 3 is even, then n is odd.
- Prove for every integer n: if n3 is even, then n is even.
- Prove for all integers x and y: if x + y is odd, then x is odd or y is odd.
- Prove for every integer a: if a2 is not divisible by 4, then a is odd.
- Prove for positive real numbers a and b: if ab > 100, then a > 10 or b > 10.
- A garage has 6 levels and 61 cars are parked in it. Prove that some level has at least 11 cars.
Show answers
1.
\lnot q \to \lnot p
Negate both parts and switch them.
Answer: If a polygon does not have four sides, then it is not a square.
2.
\lnot q \to \lnot p
Negate both parts and switch them.
Answer: If n is not divisible by 3, then n is not divisible by 6.
3.
\lnot(x^2 \gt 4) \equiv x^2 \le 4
Negate the conclusion.
\lnot(x \gt 2) \equiv x \le 2
Negate the hypothesis.
Answer: If x² ≤ 4, then x ≤ 2.
4.
\text{If } n \text{ is even, then } n^2 \text{ is even.}State the contrapositive.
n = 2k
Assume n is even, with k an integer.
n^2 = 4k^2
Square both sides.
n^2 = 2(2k^2)
Write 4 as 2 · 2; 2k² is an integer.
Answer: proved; n² is even when n is even, so if n² is odd, then n is odd
5.
\text{If } n \text{ is even, then } 5n + 3 \text{ is odd.}State the contrapositive.
n = 2k
Assume n is even, with k an integer.
5n + 3 = 5(2k) + 3
Substitute.
5n + 3 = 10k + 3
Multiply.
5n + 3 = 10k + 2 + 1
Write 3 as 2 + 1.
5n + 3 = 2(5k + 1) + 1
Factor 2 out of 10k + 2; 5k + 1 is an integer.
Answer: proved; 5n + 3 is odd when n is even
6.
\text{If } n \text{ is odd, then } n^3 \text{ is odd.}State the contrapositive.
n = 2k + 1
Assume n is odd, with k an integer.
n^3 = (2k + 1)^3
Cube both sides.
n^3 = 8k^3 + 12k^2 + 6k + 1
Expand with the binomial theorem (coefficients 1, 3, 3, 1).
n^3 = 2(4k^3 + 6k^2 + 3k) + 1
Factor 2 out of the first three terms; 4k³ + 6k² + 3k is an integer.
Answer: proved; n³ is odd when n is odd, so if n³ is even, then n is even
7.
\text{If } x \text{ and } y \text{ are even, then } x + y \text{ is even.}State the contrapositive; De Morgan’s law turns “odd or odd” into “even and even.”
x = 2a,\quad y = 2b
Assume both are even, with a and b integers.
x + y = 2a + 2b
Add.
x + y = 2(a + b)
Factor out 2; a + b is an integer.
Answer: proved; x + y is even when both are even
8.
\text{If } a \text{ is even, then } 4 \mid a^2.State the contrapositive: “not odd” is “even,” and “not (not divisible)” is “divisible.”
a = 2k
Assume a is even, with k an integer.
a^2 = 4k^2
Square both sides; k² is an integer.
Answer: proved; 4 divides a² when a is even
9.
\text{If } a \le 10 \text{ and } b \le 10, \text{ then } ab \le 100.State the contrapositive with De Morgan’s law.
ab \le 10b
Multiply a ≤ 10 by the positive number b (multiplying an inequality by a positive number keeps the sign).
10b \le 100
Multiply b ≤ 10 by 10.
ab \le 100
Combine the two inequalities.
Answer: proved; so if ab > 100, then a > 10 or b > 10
10.
\text{If every level has at most 10 cars, the total is at most 60.}State the contrapositive.
c_1 + c_2 + \dots + c_6 \le 6 \cdot 10
Add the 6 inequalities cᵢ ≤ 10.
c_1 + c_2 + \dots + c_6 \le 60
Multiply.
60 \lt 61
So the total can’t be 61.
Answer: some level has at least 11 cars
Proof by contrapositive FAQ
What is a proof by contrapositive?
It proves “if P, then Q” by proving “if not Q, then not P” instead. The two statements are logically equivalent, so one proof covers both.
When should you use proof by contrapositive?
Use it when a direct proof stalls because the hypothesis is hard to unpack, such as n2 = 2k, or when the conclusion contains “or” or “not.” Negating often gives a simpler starting point.
Is the contrapositive the same as the converse?
No. The converse of p → q is q → p, which can be false even when p → q is true. Only the contrapositive, ¬q → ¬p, is equivalent to the original.
What is the difference between proof by contrapositive and proof by contradiction?
A proof by contrapositive assumes ¬Q and proves ¬P directly. A proof by contradiction assumes P and ¬Q together and shows that this leads to something impossible.
Summary
- The contrapositive of p → q is ¬q → ¬p, and the two are logically equivalent.
- To prove “if P, then Q,” you may assume ¬Q and prove ¬P with a direct proof.
- Negate carefully: “not even” is odd, “not >” is ≤, and “not (A or B)” is “not A and not B.”
- The converse and inverse are not equivalent to the original statement.
- Use it when the conclusion is simpler to negate than the hypothesis is to unpack.
Previous lesson: Direct Proof
Next lesson: Proof by Contradiction
Back to the Discrete Math Index