rmykkänen

notes

Congruences

date

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∈Za, b, m \in \mathbb{Z}, with m>0m > 0. aa is said to be congruent to bb modulo mm, denoted a≡ba \equiv b mod mm, if m∣a−bm \mid a - b. In this form, mm is said to be the modulus of the congruence. Conversely, a≢ba \not\equiv b mod mm denotes that aa is not congruent to bb modulo mm.

Congruence modulo mm is an equivalence relation on Z\mathbb{Z}

Let a∈Za \in \mathbb{Z}. Since any integer divides 00, m∣0m \mid 0, therefore m∣a−am \mid a - a and a≡aa \equiv a mod mm. That makes congruence reflexive on Z\mathbb{Z}.

Let a,b∈Za, b \in \mathbb{Z}. Assume that a≡ba \equiv b mod mm. That's m∣a−bm \mid a - b, or equivalently m∣(−1)(a−b)m \mid (-1)(a - b) Distribute the (−1)(-1) for m∣(b−a)m \mid (b - a). This shows that a≡ba \equiv b mod mm   ⟹  \implies b≡ab \equiv a mod mm, so congruence is symmetric.

Let a,b,c∈Za, b, c \in \mathbb{Z}. Assume that a≡ba \equiv b mod mm and that b≡cb \equiv c mod mm. Then m∣a−bm \mid a - b and m∣b−cm \mid b - c. Therefore, m∣(a−b)+(b−c)  ⟹  m∣a−cm \mid (a - b) + (b - c) \implies m \mid a - c. Congruence mod mm is hence transitive.

Because congruence mod mm is reflexive, symmetric, and transitive, it's an equivalence relation on Z\mathbb{Z}. ■{\blacksquare}

Z\mathbb{Z} is partitioned into equivalence classes under congruence mod mm

Denote [x][x] as the equivalence class containing xx.

Consider Z\mathbb{Z} under congruence modulo 44. We'll find 44 equivalence classes:

  • [0]={x∈Z:x≡0[0] = \{x \in \mathbb{Z}: x \equiv 0 mod 4}4 \}
  • [1]={x∈Z:x≡1[1] = \{x \in \mathbb{Z}: x \equiv 1 mod 4}4 \}
  • [2]={x∈Z:x≡2[2] = \{x \in \mathbb{Z}: x \equiv 2 mod 4}4 \}
  • [3]={x∈Z:x≡3[3] = \{x \in \mathbb{Z}: x \equiv 3 mod 4}4 \}

We can express the equivalence class [2][2], for example, as:

  • {x∈Z:x≡2\{x \in \mathbb{Z}: x \equiv 2 mod 4}4 \}
  • {x∈Z:4∣x−2}\{x \in \mathbb{Z}: 4 \mid x - 2\}
  • {x:x−2=4n\{x: x - 2 = 4n for some n∈Z}n \in \mathbb{Z}\}
  • {x:x=4n+2\{x: x = 4n + 2 for some n∈Z}n \in \mathbb{Z}\}
  • {...,−6,−2,2,6,10,...}\{..., -6, -2, 2, 6, 10, ...\}

Complete residue systems

A set of integers such that every integer is congruent modulo mm to exactly one integer of the set is said to be a complete residue system mod mm.

{0,1,...,m−1}\{0, 1, ..., m-1\} is a complete residue system mod mm

We'll first show that every integer is congruent mod mm to at least one integer in {0,1,..,m−1}\{0, 1, .., m-1\}. Let a∈Za \in \mathbb{Z}. By the division algorithm, there exist q,r∈Zq, r \in \mathbb{Z} such that a=mq+ra = mq + r, with 0<=r<m0 <= r < m.

a=mq+r  ⟹  a−r=mqa = mq + r \implies a - r = mq, so m∣a−rm \mid a - r, or a≡ra \equiv r mod mm.

Furthermore, 0<=r<m  ⟹  r∈{0,1,...,m−1}0 <= r < m \implies r \in \{0, 1, ..., m-1\}, so every integer is congruent mod mm 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∈Za \in \mathbb{Z} and let r1,r2∈{0,1,...,m−1}r_1, r_2 \in \{0, 1, ..., m-1\}. Assume that a≡r1a \equiv r_1 mod mm and that a≡r2a \equiv r_2 mod mm. Then r1≡r2r_1 \equiv r_2 mod mm, which implies m∣r1−r2m \mid r_1 - r_2.

Recall that r1,r2∈{0,1,...,m−1}r_1, r_2 \in \{0, 1, ..., m-1\}. This means that −(m−1)<=r1−r2<=m−1-(m-1) <= r_1 - r_2 <= m - 1. Since m∣r1−r2m \mid r_1 - r_2, we have that r1−r2=0r_1 - r_2 = 0 or r1=r2r_1 = r_2. So every integer is congruent modulo mm to at most one integer in {0,1,...,m−1}\{0, 1, ..., m-1\}. ■\blacksquare

The set of least nonnegative residues mod mm

The set {0,1,...,m−1}\{0, 1, ..., m-1\} is said to be the set of least nonnegative residues mod mm.

Some arithmetic properties of the congruence relation

Let a,b,c,d∈Za, b, c, d \in \mathbb{Z} such that a≡ba \equiv b mod mm and c≡dc \equiv d mod mm. This implies:

(a)\textbf{(a)}: (a+c)≡(b+d)(a+c) \equiv (b+d) mod mm \newline (b)\textbf{(b)}: ac≡bdac \equiv bd mod mm

Since a≡ba \equiv b mod mm and c≡dc \equiv d mod mm, we have that m∣a−bm \mid a - b and that m∣c−dm \mid c - d. This means that m∣(a−b)+(c−d)m \mid (a-b) + (c-d), which is equivalent to m∣(a+c)−(b+d)m \mid (a+c) - (b+d), implying (a+c)≡(b+d)(a+c) \equiv (b+d) mod mm.

For the second part, note that m∣a−bm \mid a - b implies m∣c(a−b)m \mid c(a-b). Conversely, m∣c−dm \mid c - d implies m∣b(c−d)m \mid b(c-d). So m∣c(a−b)+b(c−d)m \mid c(a-b) + b(c-d), which is equivalent to m∣ac−bdm \mid ac - bd, from which ac≡bdac \equiv bd mod mm. ■\blacksquare

In terms of equivalence classes,

(a’)\textbf{(a')}: [a]+[c]=[a+c][a] + [c] = [a + c]\newline (b’)\textbf{(b')}: [a][c]=[ac][a][c] = [ac]

One final note is that the cancellation law of multiplication does not hold in general for congruence modulo mm. In other words, 6a≡6b6a \equiv 6b mod 33 does not imply that a≡ba \equiv b mod 33.

Let a,b,c∈Za, b, c \in \mathbb{Z}. Then ca≡cbca \equiv cb mod mm iff a≡ba \equiv b mod (m/(c,m))(m/(c, m)).

Assume that ca≡cbca \equiv cb mod mm and let dd = (c,m)(c, m). We have m∣ca−cb=c(a−b)m \mid ca-cb = c(a-b). Divide both sides by dd for (m/d)∣(c/d)(a−b)(m/d) \mid (c/d)(a-b). We have (m/d,c/d)=1(m/d, c/d) = 1, so m/d∣a−bm/d \mid a - b and a≡ba \equiv b mod m/dm/d.

For the if direction, let d=(c,m)d = (c, m) and assume a≡ba \equiv b mod m/dm/d. Then m/d∣a−bm/d \mid a - b so m∣ad−bdm \mid ad - bd. So m∣(c/d)(ad−bd)=ca−cbm \mid (c/d)(ad-bd) = ca - cb and ca≡cbca \equiv cb mod mm as desired.