Skip to main content

Discrete Mathematical Structures

Subsection 1.4.3 Proof by contraposition

In TheoremΒ 1.2.1.10 we have shown that the contrapositive of \(p\implies q\) is logically equivalent to \(\lnot q \implies \lnot p\text{.}\)
Thus proving \(p\implies q\) is true is the same as proving \(\lnot q \implies\lnot p\) is true. This is called proof by contraposition .

Example 1.4.3.2. Even square.

Let \(n\) be an integer. Prove that if \(n^2\) is even, then \(n\) is even.
Answer.
To prove
β€œIf \(n^2\) is even, then \(n\) is even.”
it is sufficient to prove the contrapositive
β€œIf \(n\) is odd, then \(n^2\) is odd.”
Suppose \(n\) is odd.
Then there exists an integer \(k\) such that \(n = 2k + 1\text{.}\) With this we get
\begin{equation*} n^2 = (2k + 1)^2 = 4k^2 + 4k + 1 = 2(2k^2 + 2k) + 1. \end{equation*}
Since \(k\) is an integer, we have that \(m=2k^2 + 2k\) is an integer, and so
\begin{equation*} n^2=2m+1 \end{equation*}
is odd.
We have proven β€œIf \(n\) is odd, then \(n^2\) is odd” is true and thus the original proposition β€œIf \(n^2\) is even, then \(n\) is even.” also is true.

Example 1.4.3.3. If \(a\cdot b+ 6\) is odd.

Prove that if \(a\cdot b+ 6\) is odd then both \(a\) and \(b\) are odd.
Answer.
We prove
β€œIf \(a\cdot b+ 6\) is odd then both \(a\) and \(b\) are odd.”
by contrapositive, that is we prove
β€œIf not both \(a\) and \(b\) are odd then \(a\cdot b+ 6\) is even.”
If not both \(a\) and \(b\) are odd we are in one of the following cases:
  1. \(a\) is even and \(b\) is even, or
  2. \(a\) is even and \(b\) is odd, or
  3. \(a\) is odd and \(b\) is even.
We consider each of the three cases separately.
  1. Suppose \(a\) is even and \(b\) is even.
    Then there are integers \(k\) and \(\ell\) such that \(a=2k\) and \(b=2\ell\text{.}\) We get
    \begin{equation*} a\cdot b+6=(2k)(2\ell)+6=2(2k\ell)+6=2(2k\ell+3). \end{equation*}
    Since \(k\) and \(\ell\) are integers \((2k\ell+3)\) is also an integer. Thus by DefinitionΒ 1.4.1.1 we have that \(a\cdot b+6\) is even.
  2. Suppose \(a\) is even and \(b\) is odd.
    Then there are integers \(k\) and \(\ell\) such that \(a=2k\) and \(b=2\ell+1\text{.}\) We get
    \begin{equation*} a\cdot b+6=(2k)(2\ell+1)+6=2k(\ell\cdot 1)+6=2(k(\ell+1)+3). \end{equation*}
    Since \(k\) and \(\ell\) are integers \((k(\ell+1)+3)\) is also an integer. Thus by DefinitionΒ 1.4.1.1 we have that \(a\cdot b+6\) is even.
  3. Suppose \(a\) is odd and \(b\) is even.
    Then there are integers \(k\) and \(\ell\) such that \(a=2k+1\) and \(b=2\ell\text{.}\) We get
    \begin{equation*} a\cdot b+6=(2k+1)(2\ell)+6=2(\ell\cdot(2k+1)+3). \end{equation*}
    Since \(k\) and \(\ell\) are integers \((\ell\cdot(2k+1)+3)\) is also an integer. Thus by DefinitionΒ 1.4.1.1 we have that \(a\cdot b+6\) is even.
Because in each of the three cases we found that \(a\cdot b+6\) is even, we have proven that β€œif not both \(a\) and \(b\) are odd \(a\cdot b+ 6\) is even”, which concludes our prove.