MathLabs

Competition mathematics and problem solving

Proof by contradiction

A proof technique that assumes the opposite of what is claimed and derives a contradiction.

IntuitionAssume the opposite, then watch it collapse

Suppose a detective wants to prove a suspect was at the scene of a crime. Instead of finding direct evidence, the detective says: "Suppose the suspect was not there. Then they could not have left this footprint, which only they could make. But the footprint is right here — contradiction. So the suspect must have been there." This is exactly the shape of proof by contradiction: to prove a statement PP, assume its opposite ¬P\neg P, follow the logical consequences faithfully, and show they collide with something already known to be true. Since a false assumption is the only way to reach an impossible conclusion, ¬P\neg P must be false, so PP holds.

A parabola plot of y equals x squared minus 2, crossing the x-axis at the irrational point x equals square root of 2.
The curve y=x2−2y=x^2-2 crosses zero exactly at x=2x=\sqrt{2}; the proof by contradiction below shows this crossing point can never be a ratio of two integers.

SchoolThe logical shape of a contradiction proof

Definition: Proof by contradiction

To prove a statement PP by contradiction, assume ¬P\neg P (the opposite of PP), and derive from it, using only valid logical steps and facts already established, some statement QQ together with its negation ¬Q\neg Q. Since Q∧¬QQ \wedge \neg Q is always false, the assumption ¬P\neg P that led to it must be false, so PP is true.

¬P⇒(Q∧¬Q)\neg P \Rightarrow (Q \wedge \neg Q)

Here PP is the statement we want to prove, and QQ is any statement whose truth and falsity we can both derive from ¬P\neg P — often QQ is a fact already known to be true (like "gcd⁡(p,q)=1\gcd(p,q)=1") whose negation we accidentally derive. Once ¬P⇒(Q∧¬Q)\neg P \Rightarrow (Q \wedge \neg Q) is established and Q∧¬QQ \wedge \neg Q is impossible, logic forces ¬P\neg P itself to be impossible, i.e. PP holds.

2=pq,gcd⁡(p,q)=1\sqrt{2} = \frac{p}{q}, \quad \gcd(p,q)=1

This second line is the concrete assumption used to open the classic proof that 2\sqrt{2} is irrational: here pp and qq are integers with q≠0q \neq 0, and requiring gcd⁡(p,q)=1\gcd(p,q)=1 means the fraction pq\frac{p}{q} is already written in lowest terms. The proof (given in full below) shows this assumption forces both pp and qq to be even, contradicting gcd⁡(p,q)=1\gcd(p,q)=1.

Comparing proof strategies
MethodAssumptionGoal
Direct proofPPDerive QQ directly from PP using known facts
Contradiction¬P\neg PDerive both QQ and ¬Q\neg Q from ¬P\neg P
Infinite descentA minimal counterexample existsConstruct a strictly smaller counterexample, contradicting minimality

UndergraduateTwo classical contradiction proofs

2\sqrt{2} is irrational, that is, there are no integers p,qp,q with q≠0q \neq 0 such that 2=pq\sqrt{2} = \frac{p}{q}.

Why is it true?

There is no direct algebraic way to show a number is not a ratio of integers, since that would mean checking infinitely many fractions; contradiction sidesteps this by assuming such a fraction exists in lowest terms and mining that single assumption for an impossible parity fact.

Proof

Suppose, for contradiction, that 2\sqrt{2} is rational. Then we can write 2=pq\sqrt{2} = \frac{p}{q} for integers p,qp,q with q≠0q \neq 0, and by cancelling common factors we may assume gcd⁡(p,q)=1\gcd(p,q)=1 (the fraction is in lowest terms).

Squaring both sides gives 2=p2q22 = \frac{p^2}{q^2}, so p2=2q2p^2 = 2q^2. This means p2p^2 is even. Since the square of an odd number is odd, pp itself must be even; write p=2kp = 2k for some integer kk.

Substituting back, (2k)2=2q2(2k)^2 = 2q^2, so 4k2=2q24k^2 = 2q^2, which simplifies to q2=2k2q^2 = 2k^2. This means q2q^2 is even, so by the same reasoning qq must also be even.

But now both pp and qq are even, so 22 divides both of them, contradicting the assumption that gcd⁡(p,q)=1\gcd(p,q)=1. This contradiction shows that the original assumption — that 2\sqrt{2} can be written as pq\frac{p}{q} — must be false. Therefore 2\sqrt{2} is irrational.

There are infinitely many prime numbers.

Why is it true?

It is impossible to directly list infinitely many primes to verify the claim, so contradiction instead assumes a finite complete list exists and manufactures, from that very list, a number that exposes the list as incomplete.

Proof

Suppose, for contradiction, that there are only finitely many primes, and let p1,p2,…,pnp_1, p_2, \dots, p_n be the complete list of all of them.

Consider the number N=p1p2⋯pn+1N = p_1 p_2 \cdots p_n + 1. Since N>1N > 1, it must have at least one prime divisor; call it pp (every integer greater than 11 has a prime factor).

By assumption, p1,…,pnp_1, \dots, p_n is the list of all primes, so pp must equal pip_i for some ii. In particular, pp divides the product p1p2⋯pnp_1 p_2 \cdots p_n.

But pp also divides N=p1p2⋯pn+1N = p_1 p_2 \cdots p_n + 1. If pp divides both p1p2⋯pnp_1 p_2 \cdots p_n and NN, then pp divides their difference: p∣(N−p1p2⋯pn)=1p \mid \big(N - p_1 p_2 \cdots p_n\big) = 1.

No prime number can divide 11, since every prime is greater than 11. This is a contradiction. Therefore the original assumption — that there are only finitely many primes — must be false, so there are infinitely many primes.

UndergraduateReal-World Applications and Worked Examples

Proof by contradiction is a working tool far beyond competition math: computer scientists use it to prove impossibility results (no algorithm can solve the halting problem, no comparison sort beats nlog⁡nn\log n in the worst case), cryptographers rely on it to argue that breaking a scheme would imply solving a problem believed to be hard, and engineers use it to argue safety-critical impossibility claims ("if the pressure exceeded this value, the seal would have failed, but the seal is intact, so the pressure never exceeded it"). Infinite descent, a variant that assumes a minimal counterexample and shrinks it, is especially common in number theory and algorithm-termination arguments. The two examples below show contradiction and infinite descent applied to concrete combinatorics problems.

Example: The deficient chessboard: a contradiction in tiling

An 8×88 \times 8 chessboard has its two opposite corner squares removed, leaving 6262 squares. Prove that this board cannot be completely covered by 3131 dominoes, each covering exactly 22 adjacent squares.

Solution

Suppose, for contradiction, that such a tiling by 3131 dominoes exists.

Color the chessboard in the usual alternating black and white pattern, so it has 3232 black and 3232 white squares. Every domino, since it covers two adjacent squares, always covers exactly one black square and one white square (adjacent squares always have opposite colors).

Therefore, a tiling using 3131 dominoes would cover exactly 3131 black squares and 3131 white squares — 6262 squares total, split evenly by color.

However, the two opposite corners of a standard chessboard are always the same color (this is a property of the standard coloring). Removing them removes 22 squares of one color, leaving 3030 squares of that color and 3232 squares of the other color.

This means the board actually has 3030 squares of one color and 3232 of the other, which cannot be split into 3131-and-3131 by any tiling. This contradicts the count from Step 3 (exactly 3131 of each color), so the assumed tiling cannot exist.

Example: Infinite descent: no nontrivial solution to a2=2b2a^2=2b^2

Use infinite descent to prove that the equation a2=2b2a^2 = 2b^2 has no solution in positive integers a,ba,b.

Solution

Suppose, for contradiction, that a positive integer solution exists. Among all positive integer solutions (a,b)(a,b), choose one with bb as small as possible — this is possible because the positive integers are well-ordered (any nonempty set of positive integers has a smallest element).

From a2=2b2a^2 = 2b^2, the right side is even, so a2a^2 is even, and hence aa itself is even (the square of an odd number is odd). Write a=2a1a = 2a_1 for some positive integer a1a_1.

Substituting, (2a1)2=2b2(2a_1)^2 = 2b^2 gives 4a12=2b24a_1^2 = 2b^2, so b2=2a12b^2 = 2a_1^2. By the same reasoning as before, b2b^2 is even, so bb is even; write b=2b1b = 2b_1.

Substituting again, 2a12=(2b1)2=4b122a_1^2 = (2b_1)^2 = 4b_1^2, so a12=2b12a_1^2 = 2b_1^2. This means (a1,b1)(a_1,b_1) is also a positive integer solution of the same equation a12=2b12a_1^2=2b_1^2, and since b=2b1b = 2b_1, we have b1=b/2<bb_1 = b/2 < b.

This contradicts the choice of (a,b)(a,b) as the solution with smallest possible bb, since (a1,b1)(a_1,b_1) is a solution with an even smaller second coordinate. This contradiction shows that no positive integer solution to a2=2b2a^2=2b^2 can exist.

Proof by contradiction proves a proposition PP by assuming ¬P\neg P and deriving a contradiction of the form:

In the classic proof that 2\sqrt{2} is irrational, assuming 2=pq\sqrt{2} = \frac{p}{q} in lowest terms and squaring gives p2=2q2p^2 = 2q^2. What is immediately concluded about pp?

In Euclid's proof, assuming primes p1,…,pnp_1,\dots,p_n are all the primes, the number N=p1p2⋯pn+1N=p_1p_2\cdots p_n+1 leads to a contradiction because:

For the deficient chessboard with two opposite corners removed, the contradiction in the domino-tiling proof arises because a tiling would need: