MathorynMathematical Formula Database

Set Theory & Logic

Contrapositive

A conditional statement is logically equivalent to its contrapositive, but not to its converse q→pq\to p. Proof by contrapositive is used whenever it is easier to show that failing the conclusion forces failing the hypothesis.

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

Variables

pp
hypothesis
qq
conclusion
¬\neg
not

Example

Prove: if n2n^2 is even, then nn is even.

  1. Contrapositive: if nn is odd, then n2n^2 is odd.
  2. n=2k+1n=2k+1 gives n2=4k2+4k+1n^2=4k^2+4k+1, which is odd.
  3. Truth table: p→qp\to q and ¬q→¬p\neg q\to\neg p agree in all rows.

Answer: The statement holds; the equivalence is true in all 44 rows.

Related formulas