The best examples of examples of proof by contrapositive (explained like you’re in class with a great teacher)

If you’re hunting for clear, friendly examples of examples of proof by contrapositive, you’re in the right place. Instead of drowning you in formal symbols right away, we’ll walk through real examples step by step, the way a patient teacher would at the board. Along the way, you’ll see how the contrapositive trick turns some scary-looking “if–then” statements into something much easier to prove. In this guide, we’ll start with simple algebra and number theory examples of proof by contrapositive, then move to more realistic situations: logic puzzles, computer science style statements, and even a taste of analysis. These examples include both classic textbook problems and fresh, 2024-ready ways to think about them. By the end, you won’t just recognize an example of proof by contrapositive—you’ll know when and why to use it yourself, and you’ll have several go-to patterns you can reuse on homework, exams, and in your own problem solving.
Written by
Taylor
Published
Updated

Starting with simple examples of proof by contrapositive

Let’s skip the abstract theory and jump right into the best examples. Then we’ll unpack what’s going on.

Take the statement:

If an integer \(n\) is odd, then \(n^2\) is odd.

Most textbooks prove this directly, but it’s also a perfect example of proof by contrapositive. The original statement is:

If \(n\) is odd, then \(n^2\) is odd.

The contrapositive is:

If \(n^2\) is even, then \(n\) is even.

These two statements are logically equivalent: proving one automatically proves the other. Sometimes the contrapositive is easier to work with, which is exactly why we collect so many examples of proof by contrapositive when teaching proof strategies.

Here’s the proof, written in that style:

Assume \(n^2\) is even. Then there exists an integer \(k\) such that \(n^2 = 2k\). If \(n\) were odd, we could write \(n = 2m + 1\) for some integer \(m\). Then
[
n^2 = (2m + 1)^2 = 4m^2 + 4m + 1 = 2(2m^2 + 2m) + 1,
]
which is odd, not even. That contradicts our assumption that \(n^2\) is even. So \(n\) cannot be odd; it must be even.

We never directly touched “odd implies odd”; instead, we proved the contrapositive. This style will repeat in many of the best examples below.


Classic number theory examples of examples of proof by contrapositive

When teachers are hunting for the best examples of proof by contrapositive, they almost always start with integers. The structure is clean, and the logic stands out nicely.

Example 1: Divisibility by 3

Statement. If \(3\) does not divide \(n\), then \(3\) does not divide \(n^2\).

Contrapositive. If \(3\) divides \(n^2\), then \(3\) divides \(n\).

This contrapositive is a standard fact in number theory and appears in many intro courses (you’ll see similar reasoning in materials from places like MIT OpenCourseWare and other university resources).

Proof (by contrapositive).

Assume \(3\) divides \(n^2\). That means \(n^2 = 3k\) for some integer \(k\). There is a well-known result (often proved using modular arithmetic) that if a prime \(p\) divides a square \(n^2\), then \(p\) divides \(n\). Since \(3\) is prime, \(3\mid n^2\) implies \(3\mid n\).

Therefore, the contrapositive is true, and so the original statement is true.

Even if your class hasn’t covered primes formally, you can do a hands-on version using remainders mod 3. The point is: this is another clean example of proof by contrapositive where the backward direction is simpler than the forward one.

Example 2: Even product, even factor

Statement. If \(ab\) is odd, then \(a\) and \(b\) are both odd integers.

Contrapositive. If \(a\) or \(b\) is even, then \(ab\) is even.

Proof (by contrapositive).

Assume at least one of \(a\) or \(b\) is even. Without loss of generality, say \(a\) is even, so \(a = 2k\) for some integer \(k\). Then
[
ab = (2k)b = 2(kb),
]
which is a multiple of 2, so \(ab\) is even. That proves the contrapositive, and therefore the original statement.

This is one of the best examples to internalize, because the structure “if any factor is even, the product is even” shows up constantly in algebra and number theory.

Example 3: Square greater than 4 implies number greater than 2

Statement. For a real number \(x\), if \(x^2 > 4\), then \(|x| > 2\).

Contrapositive. If \(|x| \le 2\), then \(x^2 \le 4\).

Proof (by contrapositive).

Assume \(|x| \le 2\). Then by the definition of absolute value, \(-2 \le x \le 2\). The function \(x \mapsto x^2\) on the interval \([-2,2]\) has maximum value 4 (at \(x = \pm 2\)), so \(x^2 \le 4\). That proves the contrapositive; therefore, the original statement holds.

This is a gentle bridge into calculus and analysis, and it’s a real example of proof by contrapositive that connects directly to inequalities and absolute values you’ll see again and again in higher math.


Everyday-style logic: real examples that feel less “textbook”

Not all examples of proof by contrapositive have to live in pure math land. The logic works just as well in everyday scenarios.

Example 4: Late to school and the bus

Statement. If you arrive at school on time, then you did not miss the first bus.

Call:

  • \(P\): “You arrive at school on time.”
  • \(Q\): “You miss the first bus.”

The statement is \(P \Rightarrow \lnot Q\).

Contrapositive. If you missed the first bus, then you did not arrive at school on time.

That’s \(Q \Rightarrow \lnot P\). In plain English, it sounds like the same idea, just flipped.

To “prove” this in a real-world sense, you’d justify the assumptions: maybe the first bus is the only one that gets you there before the bell. If you miss it, you’re late. The math structure is the same as the formal examples of proof by contrapositive: you assume the negation of the conclusion and show the negation of the hypothesis.

Example 5: Computer science flavored example

Statement. If a program terminates, then it does not enter an infinite loop.

Contrapositive. If a program enters an infinite loop, then it does not terminate.

In theoretical computer science, this style of reasoning is everywhere. You’ll see it in discussions of decidability, halting behavior, and logical implications in algorithm correctness (many CS departments, like those at major universities listed on .edu sites, use this style in their discrete math courses).

You can think of the proof as:

Assume the program enters an infinite loop. Then by definition, it keeps running forever and never reaches a terminating state. Therefore, it does not terminate.

Again, the backward direction is almost embarrassingly simple, which is exactly why this is a favorite example of proof by contrapositive in CS.


Deeper mathematical examples of proof by contrapositive

Now let’s push a bit further into standard undergraduate math territory. These examples include more symbolic reasoning, but we’ll keep the explanations grounded.

Example 6: Rational vs irrational square roots

Statement. If \(\sqrt{2}\) is rational, then there exist integers \(p, q\) with no common factor such that \(\sqrt{2} = \frac{p}{q}\).

Usually, we prove the contrapositive of a related statement:

If \(\sqrt{2} = \frac{p}{q}\) for integers \(p, q\) in lowest terms, then we reach a contradiction.

This classic proof (often found in intro proofs courses, like those from Harvard’s math department) is essentially a contrapositive-style argument showing: if you assume \(\sqrt{2}\) is rational, you end up with something impossible (both \(p\) and \(q\) even in “lowest terms”).

While this isn’t always labeled as “proof by contrapositive” in textbooks, the logical skeleton is the same: assume the opposite of what you want and show that the hypothesis can’t hold.

Example 7: Function injectivity

Here’s a more clearly structured example of proof by contrapositive involving functions.

Statement. Let \(f: \mathbb{R} \to \mathbb{R}\) be defined by \(f(x) = 3x + 5\). If \(f(x_1) = f(x_2)\), then \(x_1 = x_2\).

This is the definition of injective (one-to-one). We can prove it directly, but the contrapositive is just as natural.

Contrapositive. If \(x_1 \ne x_2\), then \(f(x_1) \ne f(x_2)\).

Proof (by contrapositive).

Assume \(x_1 \ne x_2\). Then \(x_1 - x_2 \ne 0\). Compute the difference:
[
f(x_1) - f(x_2) = (3x_1 + 5) - (3x_2 + 5) = 3(x_1 - x_2).
]
Since \(x_1 - x_2 \ne 0\), we have \(3(x_1 - x_2) \ne 0\), so \(f(x_1) \ne f(x_2)\). This proves the contrapositive, so the original statement holds.

This is a great example of proof by contrapositive to keep in your mental toolbox for linear functions and beyond.

Example 8: Set theory inclusion

Statement. For sets \(A, B, C\), if \(A \subseteq B\) and \(B \subseteq C\), then \(A \subseteq C\).

You’d usually prove this directly, but here’s a related statement that’s more naturally attacked with a contrapositive.

Statement (variant). If \(A \nsubseteq C\), then \(A \nsubseteq B\) or \(B \nsubseteq C\).

Contrapositive. If \(A \subseteq B\) and \(B \subseteq C\), then \(A \subseteq C\).

You can think of the variant as the contrapositive of the usual transitivity of subset. Working with elements, you’d argue:

Assume \(A \subseteq B\) and \(B \subseteq C\). Take any element \(x \in A\). Then \(x \in B\) (because \(A \subseteq B\)), and so \(x \in C\) (because \(B \subseteq C\)). Therefore, every element of \(A\) is in \(C\), so \(A \subseteq C\).

This pairing of a direct proof and its contrapositive form is a nice reminder that many examples of proof by contrapositive could just as well be done directly—but the contrapositive viewpoint often clarifies the underlying logic.


How to spot when contrapositive is the best example of a strategy

By now we’ve walked through several examples of examples of proof by contrapositive: integers, inequalities, functions, sets, and even a computer science scenario. So when should you choose this strategy on your own?

Some patterns to watch for:

  • The statement is an if–then: “If P, then Q.”
  • The hypothesis \(P\) is messy or hard to work with directly.
  • The negation of the conclusion, \(\lnot Q\), is easier to assume.
  • From \(\lnot Q\), you can push naturally toward \(\lnot P\).

In other words, the best examples feel like you’re “proving the opposite direction,” but logically you’re still proving the same thing, just in a more comfortable way.

A lot of modern teaching materials in 2024–2025 (both university notes and online open resources) emphasize this way of thinking: don’t force a direct proof if the contrapositive falls into place with two lines of algebra. Learning to recognize these patterns is part of becoming fluent in mathematical reasoning.

If you want more structured practice beyond the examples here, many universities host free proof-writing notes—searching for “proof by contrapositive pdf site:.edu” will show you up-to-date lecture notes from math departments across the U.S. and internationally.


Quick FAQ about proof by contrapositive (with examples)

Q: What are some standard textbook examples of proof by contrapositive?
Common examples include: “If \(n\) is odd, then \(n^2\) is odd,” “If \(ab\) is odd, then both \(a\) and \(b\) are odd,” and “If \(x^2 > 4\), then \(|x| > 2\).” All of these are usually proved more cleanly by working with the contrapositive.

Q: Can you give an example of a real-life statement that fits this pattern?
Yes. “If a person is eligible to vote in a U.S. federal election, then they are at least 18 years old.” The contrapositive is: “If a person is younger than 18, then they are not eligible to vote.” The second version is often easier to check in practice.

Q: How are proof by contrapositive and proof by contradiction different?
In proof by contrapositive, you replace “If P, then Q” with the equivalent “If not Q, then not P” and prove that. In proof by contradiction, you assume the original statement is false and try to reach an outright impossibility. They feel similar, but contrapositive proofs keep the logical structure cleaner.

Q: Do I always need to label that I’m using a contrapositive?
In homework or exams, it’s good style to say so explicitly: “We prove this by contrapositive.” In research papers or more advanced work, mathematicians often just write the backward direction without naming it, but the logic underneath is the same.

Q: Where can I find more examples of proof by contrapositive to practice?
Look at discrete math or “introduction to proof” course notes from universities (.edu sites). Many of them have entire sections with dozens of practice problems on implications, contrapositives, and related proof strategies.


If you keep these examples of examples of proof by contrapositive in your mental library, you’ll start spotting opportunities to use the method everywhere: in algebra, analysis, discrete math, computer science, and even in everyday arguments. The more you practice flipping “If P, then Q” into “If not Q, then not P,” the more natural and powerful this strategy will feel.

Explore More Mathematical Proof Strategies

Discover more examples and insights in this category.

View All Mathematical Proof Strategies