Proof and Reasoning

Proof by Contrapositive Step by Step

Learn when and how to prove an if-then claim through its contrapositive, with a five-step routine and worked examples from several areas.

Key takeaways

  • The contrapositive of "if P, then Q" is "if not Q, then not P", and it is true in exactly the same cases.
  • Choose it when the negated conclusion is easier to work with than the original hypothesis.
  • Negate carefully: "and" becomes "or", and "all" becomes "at least one is not".
  • Say at the start that you are proving the contrapositive, and close by restating the original claim.
  • Do not confuse it with the converse, which is a different statement.

To prove "if P, then Q" by contrapositive, you prove "if not Q, then not P" instead. The two statements are logically equivalent, so establishing the second establishes the first. You assume the conclusion fails and show that the hypothesis must fail too.

The method helps when "not Q" gives you something concrete to calculate with and P does not. Once you spot that, the rest is usually a short direct argument.

Why it is allowed

"If P, then Q" can fail in only one way: P is true while Q is false. "If not Q, then not P" can fail only when "not Q" is true while "not P" is false, which means Q is false and P is true. That is the same single failure. Two statements with identical failure cases say the same thing.

An everyday version: "if it is a square, then it has four sides" says the same as "if it does not have four sides, it is not a square".

The converse, "if it has four sides, it is a square", is a different and false claim. The distinctions are laid out in converse, inverse and contrapositive.

The five steps

  1. Write the claim in the form "if P, then Q", keeping background assumptions separate.
  2. Write "not Q" and "not P" precisely.
  3. State that you will prove "if not Q, then not P".
  4. Prove it directly: assume "not Q", unpack definitions and reason to "not P".
  5. Conclude that the original statement follows.
The contrapositive routine
1 Identify P and Q Separate hypothesis from conclusion 2 Negate both Write not Q and not P with care 3 Announce Say you prove if not Q, then not P 4 Argue directly Start from not Q and reach not P 5 Close Restate the original claim as proved Identify P and Q Separate hypothesis from conclusion 1 Negate both Write not Q and not P with care 2 Announce Say you prove if not Q, then not P 3 Argue directly Start from not Q and reach not P 4 Close Restate the original claim as proved 5

Example 1: even squares

Claim: for an integer n, if n² is even, then n is even.

A direct attempt starts with n² = 2k and gets stuck, since a square root tells you nothing about divisibility. Negate instead. "n is not even" means "n is odd", and "n² is not even" means "n² is odd".

Proof. We prove the contrapositive: if n is odd, then n² is odd. Let n = 2k + 1 for an integer k. Then n² = 4k² + 4k + 1 = 2(2k² + 2k) + 1, which is odd. Therefore, if n² is even, n is even. ∎

This small result is the key step in the standard proof that √2 is irrational.

Example 2: an expression and its input

Claim: for an integer x, if x² − 6x + 5 is even, then x is odd.

The hypothesis is an awkward quadratic. The negated conclusion, "x is even", is simple.

Proof. We prove that if x is even, then x² − 6x + 5 is odd. Let x = 2k. Then x² − 6x + 5 = 4k² − 12k + 5 = 2(2k² − 6k + 2) + 1. Since 2k² − 6k + 2 is an integer, the expression is odd. ∎

Check with x = 4: 16 − 24 + 5 = −3, which is odd. With x = 3: 9 − 18 + 5 = −4, even, and 3 is odd, as the claim requires.

Example 3: a sum and its parts

Claim: for real numbers x and y, if x + y ≥ 2, then x ≥ 1 or y ≥ 1.

Here the conclusion is an "or", which is hard to aim at directly. Its negation is an "and", which gives you two facts at once.

not (x ≥ 1 or y ≥ 1)    means    x < 1 and y < 1
not (x + y ≥ 2)         means    x + y < 2

Proof. Suppose x < 1 and y < 1. Adding the inequalities gives x + y < 2. This proves the contrapositive, so if x + y ≥ 2, then at least one of x and y is at least 1. ∎

The whole proof is one line of arithmetic. All the work was in negating correctly, using De Morgan's laws.

The same shape gives an averaging principle: if a total is at least n, spread over n quantities, then some quantity is at least 1. It is a cousin of the pigeonhole principle.

Example 4: a condition for primes

Claim: for a positive integer n, if 2ⁿ − 1 is prime, then n is prime.

The hypothesis concerns a large number about which you know little. The negation of the conclusion, "n is not prime", gives you either n = 1 or a factorization n = ab with a, b > 1.

Proof. We show that if n is not prime, then 2ⁿ − 1 is not prime. If n = 1, then 2ⁿ − 1 = 1, which is not prime. Otherwise n = ab with 1 < a < n and b > 1. Put t = 2ᵃ. Then 2ⁿ − 1 = tᵇ − 1 = (t − 1)(tᵇ⁻¹ + tᵇ⁻² + ... + t + 1). Since a > 1, the first factor t − 1 = 2ᵃ − 1 is at least 3. Since b > 1, the second factor is at least t + 1, which is at least 5. So 2ⁿ − 1 is a product of two integers greater than 1, and it is not prime. ∎

For n = 6, taking a = 2 and b = 3 gives 63 = 3 × 21. The converse is false: 11 is prime, but 2¹¹ − 1 = 2047 = 23 × 89.

Example 5: injective functions

A function f is injective if different inputs give different outputs: a ≠ b implies f(a) ≠ f(b). Working with "not equal" is clumsy, so textbooks usually check the contrapositive, f(a) = f(b) implies a = b.

Proof that f(x) = 3x − 7 is injective on the reals. Suppose f(a) = f(b). Then 3a − 7 = 3b − 7, so 3a = 3b, and a = b. ∎

By contrast, g(x) = x² is not injective on the reals, since g(2) = g(−2) while 2 ≠ −2. Restricted to x ≥ 0 it is: a² = b² gives (a − b)(a + b) = 0, so either a = b or a = −b, and with both nonnegative the second forces a = b = 0.

Example 6: a statement about divisibility

Claim: for integers a and b, if ab is not divisible by 3, then neither a nor b is divisible by 3.

The hypothesis is a "not divisible" statement, which gives you nothing to substitute. Negate the conclusion: "a is divisible by 3 or b is divisible by 3". Negate the hypothesis: "ab is divisible by 3".

Proof. Suppose a is divisible by 3, so a = 3k for an integer k. Then ab = 3(kb), which is divisible by 3. If instead b is divisible by 3, the same argument applies with the roles of a and b exchanged. This proves the contrapositive. ∎

The converse is also true here, but it rests on a deeper fact: 3 is prime, so it cannot divide a product without dividing a factor. With 4 in place of 3 the converse fails, since 4 divides 2 × 2 and does not divide 2.

Recognizing a good candidate

Feature of "if P, then Q" Why the contrapositive helps
P is about a complicated expression, Q about a plain variable Starting from the variable lets you compute
Q is an "or" statement Its negation supplies two facts
Q says something is "not equal" or "not divisible" Its negation is an equation
P says something is "prime" or "irrational" The conclusion's negation may give a factorization or fraction

If both forms look equally hard, sketch the first lines of each and see which gives you more to do.

Mistakes to avoid

  • Proving the converse by accident. Assuming Q and deriving P shows "if Q, then P".
  • Proving the inverse, "if not P, then not Q", which is equivalent to the converse.
  • Negating the background assumptions. If n is an integer throughout, it stays an integer.
  • Botching a compound negation, such as turning "x ≥ 1 or y ≥ 1" into "x < 1 or y < 1".
  • Forgetting special cases, such as n = 1 in Example 4.

Contrapositive or contradiction?

In a proof by contradiction of the same claim, you assume both P and "not Q" and look for any impossibility. In a contrapositive proof, you assume only "not Q" and aim at one definite target, "not P".

The second is more focused, and the reader knows where it is going. Contradiction is more flexible, because both assumptions can be used. When your contradiction turns out to be exactly "P and not P", and P played no other role, rewrite the argument as a contrapositive.

Some claims need both directions of an equivalence. To show "n² is even if and only if n is even", prove one direction directly and the other by contrapositive. That pairing is very common, as described in if and only if proofs.

How to write the opening and close

Readers should never have to guess which statement you are proving. Open with a sentence such as "We prove the contrapositive: if n is odd, then n² is odd." Spelling out the new statement lets the reader check your negations before any algebra begins.

Close by returning to the original wording: "Therefore, if n² is even, then n is even." Without that line, a hurried reader may think you proved something about odd numbers that was never asked for.

In scratch work, writing the two negations side by side with the originals takes a minute and prevents most errors.

Practice claims

Prove that if 3n + 2 is odd, then n is odd. Prove that if n² is not divisible by 4, then n is odd. Prove that if the product ab of two integers is odd, then both a and b are odd.

For the third, the negation of the conclusion is "a is even or b is even". Take one of them, say a = 2k, and note that ab = 2(kb). The other case is the same with the names swapped.

Written for 4Mathematics with AI writing tools and not reviewed line by line by a person. Check anything you rely on against a textbook or primary source. Report an error.

Keep reading

All 41 articles in Proof and Reasoning →

Latest news on this topic