Two integers are related under congruence if their difference is evenly divisible by a third fixed positive integer.
Definition of congruence
Let a,b,m∈Z, with m>0. a is said to be congruent to b modulo m, denoted a≡b mod m, if m∣a−b. In this form, m is said to be the modulus of the congruence. Conversely, a≡b mod m denotes that a is not congruent to b modulo m.
Congruence modulo m is an equivalence relation on Z
Let a∈Z. Since any integer divides 0, m∣0, therefore m∣a−a and a≡a mod m. That makes congruence reflexive on Z.
Let a,b∈Z. Assume that a≡b mod m. That's m∣a−b, or equivalently m∣(−1)(a−b) Distribute the (−1) for m∣(b−a). This shows that a≡b mod m ⟹ b≡a mod m, so congruence is symmetric.
Let a,b,c∈Z. Assume that a≡b mod m and that b≡c mod m. Then m∣a−b and m∣b−c. Therefore, m∣(a−b)+(b−c)⟹m∣a−c. Congruence mod m is hence transitive.
Because congruence mod m is reflexive, symmetric, and transitive, it's an equivalence relation on Z. ■
Z is partitioned into equivalence classes under congruence mod m
Denote [x] as the equivalence class containing x.
Consider Z under congruence modulo 4. We'll find 4 equivalence classes:
- [0]={x∈Z:x≡0 mod 4}
- [1]={x∈Z:x≡1 mod 4}
- [2]={x∈Z:x≡2 mod 4}
- [3]={x∈Z:x≡3 mod 4}
We can express the equivalence class [2], for example, as:
- {x∈Z:x≡2 mod 4}
- {x∈Z:4∣x−2}
- {x:x−2=4n for some n∈Z}
- {x:x=4n+2 for some n∈Z}
- {...,−6,−2,2,6,10,...}
Complete residue systems
A set of integers such that every integer is congruent modulo m to exactly one integer of the set is said to be a complete residue system mod m.
{0,1,...,m−1} is a complete residue system mod m
We'll first show that every integer is congruent mod m to at least one integer in {0,1,..,m−1}. Let a∈Z. By the division algorithm, there exist q,r∈Z such that a=mq+r, with 0<=r<m.
a=mq+r⟹a−r=mq, so m∣a−r, or a≡r mod m.
Furthermore, 0<=r<m⟹r∈{0,1,...,m−1}, so every integer is congruent mod m to at least one in the set. To complete the proof, we need to show that it's equivalent to at most one.
Let a∈Z and let r1,r2∈{0,1,...,m−1}. Assume that a≡r1 mod m and that a≡r2 mod m. Then r1≡r2 mod m, which implies m∣r1−r2.
Recall that r1,r2∈{0,1,...,m−1}. This means that −(m−1)<=r1−r2<=m−1. Since m∣r1−r2, we have that r1−r2=0 or r1=r2. So every integer is congruent modulo m to at most one integer in {0,1,...,m−1}. ■
The set of least nonnegative residues mod m
The set {0,1,...,m−1} is said to be the set of least nonnegative residues mod m.
Some arithmetic properties of the congruence relation
Let a,b,c,d∈Z such that a≡b mod m and c≡d mod m. This implies:
(a): (a+c)≡(b+d) mod m
(b): ac≡bd mod m
Since a≡b mod m and c≡d mod m, we have that m∣a−b and that m∣c−d. This means that m∣(a−b)+(c−d), which is equivalent to m∣(a+c)−(b+d), implying (a+c)≡(b+d) mod m.
For the second part, note that m∣a−b implies m∣c(a−b). Conversely, m∣c−d implies m∣b(c−d). So m∣c(a−b)+b(c−d), which is equivalent to m∣ac−bd, from which ac≡bd mod m. ■
In terms of equivalence classes,
(a’): [a]+[c]=[a+c]
(b’): [a][c]=[ac]
One final note is that the cancellation law of multiplication does not hold in general for congruence modulo m. In other words, 6a≡6b mod 3 does not imply that a≡b mod 3.
Let a,b,c∈Z. Then ca≡cb mod m iff a≡b mod (m/(c,m)).
Assume that ca≡cb mod m and let d = (c,m). We have m∣ca−cb=c(a−b). Divide both sides by d for (m/d)∣(c/d)(a−b). We have (m/d,c/d)=1, so m/d∣a−b and a≡b mod m/d.
For the if direction, let d=(c,m) and assume a≡b mod m/d. Then m/d∣a−b so m∣ad−bd. So m∣(c/d)(ad−bd)=ca−cb and ca≡cb mod m as desired.