Contrapositive

Learn how to form the contrapositive of an if-then statement, why it always has the same truth value as the original, and how to use it to reason about numbers.

Intermediate25 minLesson

Definition

The contrapositive of an if-then statement "If pp, then qq" (p→qp \to q) is the statement "If not qq, then not pp":
¬q→¬p\neg q \to \neg p
To build it you do two things: swap the hypothesis and the conclusion, and negate both of them.
Key fact: a statement and its contrapositive are logically equivalent. They are always both true or both false. The truth table shows it, row by row:
pq¬p¬qp→q¬q→¬pTTFFTTTFFTFFFTTFTTFFTTTT\begin{array}{c|c|c|c|c|c} p & q & \neg p & \neg q & p \to q & \neg q \to \neg p \\ \hline T & T & F & F & T & T \\ T & F & F & T & F & F \\ F & T & T & F & T & T \\ F & F & T & T & T & T \end{array}
The last two columns are identical, so we write p→q≡¬q→¬pp \to q \equiv \neg q \to \neg p. (The interactive table in this lesson checks this for you: its last column, (p→q)↔(¬q→¬p)(p \to q) \leftrightarrow (\neg q \to \neg p), is T in every row.)
The four related statements of p→qp \to q:
  • Original: p→qp \to q
  • Converse: q→pq \to p (swap only)
  • Inverse: ¬p→¬q\neg p \to \neg q (negate only)
  • Contrapositive: ¬q→¬p\neg q \to \neg p (swap and negate)
The original and the contrapositive always agree. The converse and the inverse also always agree with each other, because the inverse is the contrapositive of the converse.

Try it now

What is the contrapositive of p→qp \to q?

Worked Examples

Write the contrapositive of: "If a number is divisible by 1010, then it ends in 00."

1

Identify the hypothesis pp and the conclusion qq

pp: a number is divisible by 1010. qq: it ends in 00. → Two parts found

2

Negate both parts

¬p\neg p: the number is not divisible by 1010. ¬q\neg q: it does not end in 00. → Both parts negated

3

Swap the order and write ¬q→¬p\neg q \to \neg p

Put the negated conclusion first and the negated hypothesis second. → If a number does not end in 00, then it is not divisible by 1010.

Common Mistakes

Only swapping the parts and calling q→pq \to p the contrapositive

Why it's wrong: Swapping without negating gives the converse, which can be false even when the original is true.

Correct: Swap and negate both parts: the contrapositive of p→qp \to q is ¬q→¬p\neg q \to \neg p.

Negating "x>5x > 5" as "x<5x < 5"

Why it's wrong: This forgets the case x=5x = 5. Every number is either greater than 55 or not greater than 55, and "not greater" includes 55 itself.

Correct: The negation of x>5x > 5 is x≤5x \le 5, and the negation of x≥5x \ge 5 is x<5x < 5.

Assuming the converse of a true statement is also true

Why it's wrong: "If x=4x = 4, then x2=16x^2 = 16" is true, but "If x2=16x^2 = 16, then x=4x = 4" is false, because x=−4x = -4 also works.

Correct: Only the contrapositive is guaranteed to share the truth value of the original. The converse must be checked separately.

Getting lost in double negatives

Why it's wrong: For "If it is not raining, then I walk to school", students write "If I do not walk, then it is not not raining" or even drop a negation by accident.

Correct: Negating "not raining" gives "raining". The contrapositive is "If I do not walk to school, then it is raining."

Interactive Visual

Truth Table

Expressionp → q ↔ ¬q → ¬p
pqp → q¬q¬p¬q → ¬pp → q ↔ ¬q → ¬p
TTTFFTT
TFFTFFT
FTTFTTT
FFTTTTT

T= TrueF= False

Truth Table

p → q
pqp → q
TTT
TFF
FTT
FFT

T= TrueF= False

Interactive Sandbox

Expression Calculator

Try these:

History

No calculations yet

Practice Problems

18 problems
Problem 1 of 18
Easy

What is the contrapositive of p→qp \to q?

Why It Matters

The contrapositive gives you a second door into the same statement, and sometimes that door is much easier to open:
  • Number facts: To show that 27502750 is not divisible by 66, it is enough to see that it is not divisible by 33
  • Checking work: If a correct answer must be a whole number and you get 4.54.5, you know something went wrong
  • Computer programs: "If the password is correct, the door opens." The door stayed closed, so the password was wrong
  • Proofs: Later you will prove statements like "If n2n^2 is even, then nn is even" by proving the contrapositive instead
Knowing which related statements agree also protects you from a very common error: assuming that the converse of a true statement must be true.

Real World Applications

Divisibility Checks and Check Digits

Many codes and quick mental checks rely on divisibility rules, and the contrapositive is what lets you reject a number without dividing.

Example:

Rule: if a number is divisible by 99, its digit sum is divisible by 99. The digit sum of 58125812 is 1616, so 58125812 cannot be divisible by 99.

1Try It Yourself

Rule: if a number is divisible by 99, then its digit sum is divisible by 99. A clerk checks the code number 43724372.

Is 43724372 divisible by 99?

Step 1: Write the mathematical expression

Write the digit sum of 43724372 as an addition:

Free Shipping Rules

Online shops often have rules like "If your order is 50 dollars or more, shipping is free." The contrapositive tells you what a shipping fee on your receipt means.

Example:

Contrapositive: if you paid for shipping, your order was less than 50 dollars. A receipt with a shipping fee proves the order was under the limit.

2Try It Yourself

Rule: if an order totals 50 dollars or more, shipping is free. Anna paid a shipping fee. Her basket had a book for 18 dollars and a lamp for 27 dollars.

What was her order total, and how much more would she have needed for free shipping?

Step 1: Write the mathematical expression

Write the order total as an addition:

Reading League Tables

Sports fans use the contrapositive to rule things out from the points table without watching every game.

Example:

In a league with 33 points for a win, 11 for a draw and 00 for a loss: if a team won all 55 games, it has 1515 points. A team with fewer than 1515 points did not win every game.

3Try It Yourself

Rule: if a team wins all 55 of its games, then it has 1515 points (33 per win, 11 per draw, 00 per loss). Team Blue has 1313 points after 55 games.

Did Team Blue win all its games, and at most how many games could it have won?

Step 1: Write the mathematical expression

Write the points for 55 wins as a multiplication:

Key Takeaways

  • 1The contrapositive of p→qp \to q is ¬q→¬p\neg q \to \neg p: swap the two parts and negate both
  • 2A statement and its contrapositive are logically equivalent: they are always both true or both false
  • 3The truth table shows it: p→qp \to q and ¬q→¬p\neg q \to \neg p are both false only in the row pp true, qq false
  • 4The converse q→pq \to p and the inverse ¬p→¬q\neg p \to \neg q agree with each other, but not necessarily with the original
  • 5Negate carefully: the opposite of x>5x > 5 is x≤5x \le 5, and the opposite of odd is even
  • 6When a statement is hard to check directly, check its contrapositive instead, for example "if nn is odd, then n2n^2 is odd"

Frequently Asked Questions

The original p→qp \to q says: whenever pp happens, qq happens. So if qq did not happen, pp cannot have happened either, otherwise qq would have followed. That is exactly ¬q→¬p\neg q \to \neg p. The truth table confirms it in all four cases.
The original p→qp \to q says: whenever pp happens, qq happens. So if qq did not happen, pp cannot have happened either, otherwise qq would have followed. That is exactly ¬q→¬p\neg q \to \neg p. The truth table confirms it in all four cases.
Both negate the two parts, but the inverse keeps the order (¬p→¬q\neg p \to \neg q) while the contrapositive also swaps it (¬q→¬p\neg q \to \neg p). The contrapositive is equivalent to the original; the inverse is equivalent to the converse.
Yes. They are equivalent, so they always share their truth value. "If a number is even, then it is divisible by 44" is false (66 is a counterexample), and so is "If a number is not divisible by 44, then it is not even", with the same counterexample 66.
No. Using the contrapositive means you prove ¬q→¬p\neg q \to \neg p directly instead of p→qp \to q. A proof by contradiction assumes the whole statement is false and reaches an impossible result. Both methods appear in the proofs topic.

Glossary

Contrapositive
The statement ¬q→¬p\neg q \to \neg p formed from p→qp \to q by swapping and negating both parts
Converse
The statement q→pq \to p, formed by swapping hypothesis and conclusion
Inverse
The statement ¬p→¬q\neg p \to \neg q, formed by negating hypothesis and conclusion without swapping
Negation
The opposite of a statement, written ¬p\neg p; it is true exactly when pp is false
Logically equivalent
Two statements that have the same truth value in every row of a truth table, written with ≡\equiv

Formula Card

Contrapositive

p→q≡¬q→¬pp \to q \equiv \neg q \to \neg p

Swap and negate both parts; always equivalent to the original

Converse and inverse

q→p≡¬p→¬qq \to p \equiv \neg p \to \neg q

Equivalent to each other, but not necessarily to the original

Negating inequalities

¬(x>a)  ⟺  x≤a\neg(x > a) \iff x \le a

The negation of "greater than" is "less than or equal to"

More in This Topic