Contrapositive (in mathematics and logics)
The Contrapositive: An Interactive Guide
Unlock a fundamental concept in logic and math.
What is a Contrapositive?
In logic, every conditional statement of the form "If P, then Q" has a special partner called the contrapositive. The most important thing to remember is that a statement and its contrapositive are logically equivalent — if one is true, the other is guaranteed to be true as well.
A conditional statement has two parts: the hypothesis (P) and the conclusion (Q). To get the contrapositive, you simply swap the hypothesis and conclusion, and then negate both of them.
Original Statement
P → Q
"If P, then Q"
Contrapositive
¬Q → ¬P
"If not Q, then not P"
See The Transformation
Click the button below to watch the two-step process of creating a contrapositive: swapping the parts and then negating them.
Build Your Own
Now it's your turn. Use the dropdowns to construct the correct contrapositive for each statement and check your answer.
Example 1: A Rainy Day
Original: "If it is raining, then the ground is wet."
Construct the Contrapositive:
Example 2: An Inequality
Original: "If x > 5, then x² > 25."
Construct the Contrapositive:
Why Does This Matter?
The contrapositive is more than just a logical curiosity; it's a powerful tool, especially in mathematics and computer science. Sometimes, trying to directly prove a statement ("If P, then Q") can be very difficult.
Because the contrapositive ("If not Q, then not P") is logically equivalent, proving it is the same as proving the original statement. Often, the contrapositive is much simpler to prove, providing an elegant and efficient path to a valid conclusion. This technique is known as proof by contraposition.