Many results about divisibility of integers involve a fair bit of tedious work involving proof by cases; Result 5.2.5 is a good example of this. In that case we are interested in divisibility by 3 and so we use Euclidean division to separate the integers into 3 cases depending on their remainder. Much of that work can be simplified by introducing congruence.
Let \(a,b \in \mathbb{Z}\) and \(n \in \mathbb{N}\text{.}\) We say that \(a\) is congruent to \(b\) modulo \(n\) when \(n\mid(a-b)\text{.}\) The “n” is refered to as the modulus and we write the congruence as \(a \equiv b \mod n\text{.}\)
We prove both implications in turn. So start by assuming that \(a \equiv b \mod 2\text{.}\) Then we know that \(2 \mid (a-b)\) and thus \(a-b=2k\) for some \(k \in \mathbb{Z}\text{.}\) Now either \(a\) is even or odd.
When \(a\) is even, we know that \(a=2\ell\) for some integer \(\ell\text{,}\) and thus \(b=2\ell-2k\) and so is also even.
Perhaps the main reason that congruence modulo \(m\) is so important is that congruence interacts very nicely with basic arithmetic operations. This gives rise to what is known as modular arithmetic.
Let \(n \in \mathbb{N}\text{,}\) and let \(a,b,c,d \in \mathbb{Z}\) so that \(a \equiv c \mod n\) and \(b \equiv d \mod n\text{.}\) Hence \(a=c+nk, b=d+n\ell \) where \(k,\ell\) are integers.
We can write \((a+b) = (c+d) + n(k+\ell)\text{,}\) so \((a+b)-(c+d)=n(k+\ell)\text{.}\) Hence \((a+b) \equiv (c+d) \mod n\text{.}\)
We can now use this result to simplify some of our proof-by-cases proofs. Let’s start by reproving Result 5.2.5. And we start that by restating the result in terms of congruences:
We prove the contrapositive of the reverse implication, so assume that \(n \not\equiv 0 \mod 3\text{.}\) Thus either \(n \equiv 1 \mod 3\) or \(n \equiv 2 \mod 3\text{.}\)
When \(n \equiv 1 \mod 3\text{,}\)Theorem 5.3.3 tells us that \(n^2 \equiv 1 \mod 3\text{.}\)
Similarly, when \(n \equiv 2 \mod 3\text{,}\) we know that \(n^2 \equiv 4 \mod 3\text{.}\) And since \(4 \equiv 1 \mod 3\text{,}\) this means that \(n^2 \equiv 1 \mod 3\text{.}\)
Notice we are doing something a little sneaky in the proof. We deduced that since \(n^2 \equiv 4 \mod 3\) and \(4 \equiv 1 \mod 3\text{,}\) we know that \(n^2 \equiv 1 \mod 3\text{.}\) This is because congruence is transitive — a notion we will return to in Chapter 9. But since it is quite useful, let’s prove it now.
Let \(n \in \mathbb{N}\text{,}\) and let \(a,b,c \in \mathbb{Z}\) so that \(a \equiv b \mod n\) and \(b \equiv c \mod n\text{.}\) Then \(a \equiv c \mod n\text{.}\)
And, when \(a \equiv 2 \mod 3\text{,}\)\(a^2 \equiv 4 \mod 3\text{.}\) Since \(4 \equiv 1 \mod 3\text{,}\) we also have that \(a^2 \equiv 1 \mod 3\text{.}\)
So in either case \(a^2 \equiv 1 \mod 3\text{.}\) This also implies that \(b^2 \equiv 1 \mod 3\text{.}\) Thus \(a^2 - b^2 \equiv 0 \mod 3\text{.}\) So finally we can conclude that \(3 \mid (a^2-b^2)\) as required.