Divisibility and congruence [019Z]
- September 22, 2026
- Marcelo Fiore, Jon Sterling
Definition Congruence [01A2]
- September 22, 2026
- Marcelo Fiore, Jon Sterling
Fix a positive integer m. For integers a and b, we say that a is congruent to b modulo m, and write a \equiv b \mod m, to mean that m \mid (a-b).
In other words, two integers are congruent modulo m when their difference is divisible by m.
Example [01A3]
- September 22, 2026
- Marcelo Fiore, Jon Sterling
Three illustrative examples of congruence:
- 18 \equiv 2 \mod 4, because 18-2 = 16 and 4\mid 16.
- 2\equiv -2 \mod 4, because 2-(-2) = 4 and 4\mid 4.
- 18\equiv -2\mod 4, because 18-(-2)=20 and 4 \mid 20.
The notion of congruence vastly generalises that of parity (even/oddness):
Proposition Parity in terms of congruence [01A4]
- September 22, 2026
- Marcelo Fiore, Jon Sterling
For every integer n,
- n is even if and only if n\equiv 0\mod 2;
- n is odd if and only if n\equiv 1\mod 2.
Proof.
- September 22, 2026
- Marcelo Fiore, Jon Sterling
Prove this as homework. You may check your work after your attempt by clicking this text.
- n\equiv 0\mod 2 holds if and only if 2\mid n by definition, because n-0=n. It therefore suffices to show that n is even/non-odd if and only if n is divisible by 2. This may be shown by induction on n, which we will learn how to argue properly later in the course (but which you may already know how to do).
- n\equiv 1\mod 2 holds, by definition, if and only if 2\mid n-1, which is the same as to say that there exists some integer k such that 2k = n-1. This is equivalent to 2k+1=n, which is precisely the statement that n is odd.