Proof by contrapositive almost always needs you to negate a quantified sentence. "Every prime is…" becomes "There exists a prime that is not…" You cannot set up the contrapositive correctly unless you can flip quantifiers cleanly — and that is where most students slip.

This page is a tiny "negation lab." Drag the slider through four stages and watch a quantified sentence transform step by step into its negation. The two rules you need are:

\lnot(\forall x \, P(x)) \ \equiv\ \exists x \, \lnot P(x)
\lnot(\exists x \, P(x)) \ \equiv\ \forall x \, \lnot P(x)

"Every x satisfies P" is wrong precisely when some x fails to satisfy P. "Some x satisfies P" is wrong precisely when every x fails. Those two lines are the entire quantifier-flip toolkit.

Why this matters for the contrapositive

The contrapositive of a universally quantified implication is also universally quantified, but with the hypothesis and conclusion negated. For example:

To write the contrapositive you need to negate "n is even" into "n is odd" — a predicate negation, not a quantifier flip. But when you want to disprove a universally quantified statement, or to negate a compound hypothesis, you also need the quantifier rules above. They are the housekeeping rules that keep the logic straight.

Why quantifier flip and contrapositive are linked: the contrapositive of "∀x (P → Q)" is itself a universal statement. To negate either the hypothesis or the conclusion inside the quantifier, you use the predicate-level rules (De Morgan, double negation). To negate the whole statement (for counterexample-hunting or contradiction arguments), you use the quantifier rules above. Both sets of rules live in the same toolkit.

Walk through the negation

Start with the sentence: "For every real number x, x^2 \geq 0." Slide through each stage and watch the negation assemble.

The sentence "$\forall x \, (x^2 \geq 0)$" is negated in three moves: wrap with $\lnot$, flip $\forall$ to $\exists$, distribute $\lnot$ onto the predicate $(x^2 \geq 0) \to (x^2 < 0)$. The final form has no $\lnot$ visible — the negation has been absorbed into a positive-looking sentence. That is the goal of a clean negation: eliminate all visible $\lnot$ symbols.

Now the ∃ case

Start with "There exists an integer n such that n^2 = 5." Its negation:

\lnot \exists n \, (n^2 = 5) \ \equiv\ \forall n \, \lnot(n^2 = 5) \ \equiv\ \forall n \, (n^2 \neq 5)

"No integer has 5 as its square" — which is true (no integer squares to 5), so the original statement was false. The flip here is dual to the \forall case: a negated existential becomes a universal, with negation distributed onto the predicate.

A compound example

Negate: "For every real x, if x > 0, then x^2 > 0."

In symbols: \forall x \, (x > 0 \Rightarrow x^2 > 0).

Read aloud: "there exists a positive real x whose square is \leq 0." This is false (positive reals have positive squares) — which is consistent with the original being true.

Why the implication negation produced "x > 0 AND x^2 \leq 0": the only way "A \Rightarrow B" can fail is for A to hold while B does not. That is the conjunction A \land \lnot B. This rule is essential for setting up the hypothesis of a proof by contradiction, where you assume "there exists a counterexample — something that makes A true and B false."

The two rules, one more time

\lnot(\forall x \, P(x)) \ \equiv\ \exists x \, \lnot P(x)
\lnot(\exists x \, P(x)) \ \equiv\ \forall x \, \lnot P(x)

These are sometimes called the "quantifier De Morgan laws," because they are the direct quantifier analogues of De Morgan's laws for AND and OR. Once you have internalised them, negating a quantified statement becomes a purely mechanical move — no thought required.

The benefit for proof by contrapositive is direct: when you need to set up the contrapositive of a statement that starts with "\forall x \ldots," you leave the \forall alone (the contrapositive of a universal statement is still universal) and only negate-and-flip the inside. But when you need to disprove a universal claim, or set up a proof by contradiction, the rules above are what carry you from "everyone satisfies P" to "someone does not," which is the concrete object you can work with.

Related: Proof by Contrapositive · Logic and Propositions · Quantifier Flipper — ∀x P(x) Negates to ∃x ¬P(x) · Negation of 'If A, Then B' Is 'A and Not B'