Proof by contrapositive

In logic, the contrapositive of a conditional statement is formed by negating both terms and reversing the direction of inference. Explicitly, the contrapositive of the statement "if A, then B" is "if not B, then not A." A statement and its contrapositive are logically equivalent: if the statement is true, then its contrapositive is true, and vice versa.

In mathematics, proof by contraposition is a rule of inference used in proofs. This rule infers a conditional statement from its contrapositive. In other words, the conclusion "if A, then B" is drawn from the single premise "if not B, then not A."

Example

Let x be an integer.

To prove: If x² is even, then x is even.

Although a direct proof can be given, we choose to prove this statement by contraposition. The contrapositive of the above statement is:

If x is not even, then x² is not even.

This latter statement can be proven as follows. Suppose x is not even. Then x is odd. The product of two odd numbers is odd, hence x² = x·x is odd. Thus x² is not even.

Having proved the contrapositive, we infer the original statement.

The validity of this method can be demonstrated by use of a truth table:

p q $\lnot$ p $\lnot$ q pq $\lnot$ q$\lnot$ p
T T F F T T
T F F T F F
F T T F T T
F F T T T T