I originally created this document as a place to demonstrate how to make tables in LaTeX, since that was something that came up in a recent meeting. But when we wanted a place to write a formal proof using the contrapositive, this document was convenient, and it made a good opportunity to illustrate how you can divide a LaTeX document into sections, too.
For an example of proofs using the contrapositive, consider this claim:
Theorem 1. For all real numbers \(x\) and all integers \(n \ne 0\), if \(x\) is an irrational number, then \(nx\) is also irrational.
Proof. We will show that for all real numbers \(x\) and all integers \(n \ne 0\), \(nx\) is irrational if \(x\) is by proving the contrapositive. The contrapositive of the theorem is “for all real numbers \(x\) and all integers \(n \ne 0\), if \(nx\) is rational than \(x\) is rational.” To prove this, we assume \(n\) is an integer and \(x\) is a real number such that \(nx\) is rational. From the definition of rational numbers, this means \(nx = \frac {a}{b}\) for integers \(a\) and \(b \ne 0\). Dividing by \(n\) then yields
This section presents an example of building simple tables in LaTeX. For example, here’s a truth table for “and.”
| \(P\) | \(Q\) | \(P \land Q\) |
| T | T | T |
| T | F | F |
| F | T | F |
| F | F | F |
Proof. We will prove that for all integers \(n\), \(n\) is even if and only if \(n+1\) is odd. We prove each direction separately.
We start by showing that if \(n\) is even, then \(n+1\) is odd. From the definition of even numbers, \(n = 2m\) for some integer \(m\). Therefore \(n+1 = 2m + 1\), which meets the definition of an odd integer.
Next we show that if \(n+1\) is odd, then \(n\) is even. Since \(n+1\) is odd \(n + 1 = 2m + 1\) for some integer \(m\), and thus \(n = 2m\). Since \(m\) is an integer, this \(n\) meets the definition of an even integer.
We have now shown that if \(n\) is even, then \(n+1\) is odd, and that if \(n+1\) is odd, then \(n\) is even. Together, these statements establish that \(n\) is even if and only if \(n+1\) is odd. □