Logic for the TMUA

Proof by Contradiction

What you will get from this section. You will learn the main structure of proof by contradiction, how it grows naturally from the contrapositive, and how to use it to prove both ordinary statements and if-then statements.

The main structure of proof by contradiction

Suppose we want to prove that a statement PP is true.

A proof by contradiction starts by temporarily assuming that the opposite, ¬P\neg P, is true, and proceeds to make a chain of deductions from ¬P\neg P, for example:

¬PABX.\neg P \Rightarrow A \Rightarrow B \Rightarrow\cdots\Rightarrow X.

At this point, we realise, however, that XX cannot actually be true, and ¬X\neg X is true. Thus we have established two facts:

  • (1): ¬PX\neg P \Rightarrow X,
  • (2): ¬X\neg X is true.

We also know that the contrapositive of (1) is true:

  • (3): ¬X¬(¬P)\neg X \Rightarrow \neg(\neg P), which is just ¬XP\neg X \Rightarrow P.

Now combining (2) and (3), we immediately deduce that PP must be true. This is the high-level structure of proofs by contradiction.

A useful short way to remember it is:

Assume the opposite, deduce something impossible, then conclude the original statement is true.

Example 1: There are infinitely many prime numbers

Proof: Suppose there are only finitely many prime numbers. Now let's see what can be deduced.

\Rightarrow It is then possible to make a complete and ordered list of them: {2,3,5,,Pn}\{2,3,5,\cdots,P_n\}, where PnP_n is the greatest prime in the world.

\Rightarrow It is possible to construct a number

Q=2×3×5××Pn+1,Q = 2\times 3\times 5\times \cdots \times P_n+1,

that is, the product of all the primes, plus 11.

\Rightarrow QQ is not a multiple of 22, or 33, or 55, or any prime in the list, since it is always 11 more than a multiple of each prime by construction.

\Rightarrow If QQ had any prime factor, that prime factor would have to be in the complete list above. But QQ is not divisible by any prime in the list.

\Rightarrow Therefore, QQ is not divisible by any smaller prime.

\Rightarrow QQ is prime.

\Rightarrow QPnQ \leq P_n, since PnP_n is the greatest prime in the world.

However, this last statement cannot be right, since by construction, Q>PnQ>P_n!

Informally, we can just say, this cannot be right, as we know Q>PnQ>P_n. Every time we assume "there are finitely many primes", we end up in this contradiction. Therefore, this first assumption is wrong, and its negation must be true: there are infinitely many primes.

Formal proof structure: Through the proof, we have established these facts:

  • (1) "There are only finitely many prime numbers" QPn\Rightarrow Q \leq P_n.
  • (2) Q>PnQ>P_n is true.

We also know that the contrapositive of (1) is true:

  • (3) Q>PnQ>P_n \Rightarrow "There are infinitely many prime numbers".

Now combining (2) and (3), the result immediately follows. That is, there are infinitely many prime numbers, and this concludes the proof.

Example 2: 2\sqrt{2} is irrational

Proof: Suppose 2\sqrt{2} is rational. Now let's see what can be deduced.

\Rightarrow It is possible to write 2\sqrt{2} as a fraction in lowest terms: 2=ab\sqrt{2}=\frac{a}{b}, where aa and bb are positive integers with no common factor greater than 11.

\Rightarrow 2=a2b22=\frac{a^2}{b^2}.

\Rightarrow a2=2b2a^2=2b^2.

\Rightarrow a2a^2 is even.

\Rightarrow aa is even.

\Rightarrow We can write a=2ka=2k for some positive integer kk.

\Rightarrow Substituting this into a2=2b2a^2=2b^2 gives (2k)2=2b2(2k)^2=2b^2.

\Rightarrow Therefore 4k2=2b24k^2=2b^2.

\Rightarrow 2k2=b22k^2=b^2.

\Rightarrow So b2b^2 is even.

\Rightarrow bb is even.

\Rightarrow We have now shown that aa and bb are both even, so they have a common factor of 22.

However, this cannot be right, because ab\frac{a}{b} was chosen to be in lowest terms.

Informally, we can just say: this cannot be right, as aa and bb cannot both be even if ab\frac{a}{b} is in lowest terms. Every time we assume "2\sqrt{2} is rational", we end up in this contradiction. Therefore, this first assumption is wrong, and its negation must be true: 2\sqrt{2} is irrational.

Formal proof structure:

Through the proof, we have established these facts:

  • (1) "2\sqrt{2} is rational" \Rightarrow "aa and bb are both even".
  • (2) "aa and bb are not both even", since ab\frac{a}{b} was chosen to be in lowest terms.

We also know that the contrapositive of (1) is true:

  • (3) "aa and bb are not both even" \Rightarrow "2\sqrt{2} is irrational".

Now combining (2) and (3), the result immediately follows. That is, 2\sqrt{2} is irrational, and this concludes the proof.

Proving "if PP then QQ" by contradiction

Sometimes we want to prove an implication:

PQ.P \Rightarrow Q.

We can rephrase this as:

given P, prove Q.\text{given } P,\text{ prove } Q.

So we treat PP as a known fact, and our goal becomes proving QQ. The proof structure is the same as before, except that we now have the additional known fact PP.

Example 3: if n2n^2 is odd, then nn is odd

We rephrase this as:

given that n2 is odd, prove that n is odd.\text{given that } n^2 \text{ is odd},\text{ prove that } n \text{ is odd}.

Proof: Suppose we are given that n2n^2 is odd, and assume for contradiction that nn is even.

\Rightarrow n=2kn=2k where kk is an integer.

\Rightarrow n2=(2k)2=4k2=2(2k2)n^2=(2k)^2=4k^2=2(2k^2).

\Rightarrow n2n^2 is even.

But this is wrong, since we were given that n2n^2 is odd. Every time we assume "nn is even", we end up in this contradiction. Therefore, this first assumption is wrong, and its negation must be true: nn must be odd.

Formal proof structure:

Through the proof, we have established, or know, these facts:

  • (1) "nn is even" \Rightarrow "n2n^2 is even".
  • (2) "n2n^2 is odd" is true.

We also know that the contrapositive of (1) is true:

  • (3) "n2n^2 is odd" \Rightarrow "nn is odd".

Now combining (2) and (3), the result immediately follows. That is, given that n2n^2 is odd, nn is odd, and this concludes the proof.

Example 4: if n2n^2 is divisible by a prime pp, then nn is divisible by pp

We prove this for a positive integer nn and a prime number pp.

Before we begin, the symbol \mid means "divides". For example:

pnp \mid n

means "pp divides nn", or equivalently, "nn is divisible by pp".

We prove this for a positive integer nn and a prime number pp.

We rephrase the statement as:

given that pn2, prove that pn.\text{given that } p \mid n^2,\text{ prove that } p \mid n.

Proof: Suppose we are given that pn2p \mid n^2, and assume for contradiction that pnp \nmid n.

\Rightarrow Since pp is prime and pnp \nmid n, the prime pp does not appear in the prime factorisation of nn.

\Rightarrow Therefore, pp does not appear in the prime factorisation of n2n^2.

\Rightarrow pn2p \nmid n^2.

But this is wrong, since we were given that pn2p \mid n^2. Every time we assume "pnp \nmid n", we end up in this contradiction. Therefore, this first assumption is wrong, and its negation must be true: pnp \mid n.

Formal proof structure:

Through the proof, we have established, or know, these facts:

  • (1) "pnp \nmid n" \Rightarrow "pn2p \nmid n^2".
  • (2) "pn2p \mid n^2" is true.

We also know that the contrapositive of (1) is true:

  • (3) "pn2p \mid n^2" \Rightarrow "pnp \mid n".

Now combining (2) and (3), the result immediately follows. That is, given that pn2p \mid n^2, pnp \mid n, and this concludes the proof.

Summary

  • To prove PP by contradiction, assume ¬P\neg P.
  • Then deduce something impossible.
  • Since ¬P\neg P leads to something impossible, ¬P\neg P cannot be true.
  • Therefore PP must be true.
  • For an if-then statement PQP \Rightarrow Q, treat PP as a known condition and prove QQ by contradiction.
  • The logical structure is closely connected to the contrapositive: if ¬PX\neg P \Rightarrow X and ¬X\neg X is true, then PP must be true.

Worksheets

Practise proving statements by contradiction: assuming the opposite ¬P\neg P, deducing an impossible consequence, and concluding that PP must be true — including classic examples and how the method relates to the contrapositive. Each worksheet below comes as a PDF with fully worked solutions.