Maths WorkshopMaths problems with full solutions
Exercise 182Logic, sets and proofs › RelationsL1Added 31 Oct 2026

Congruence is an equivalence relation

#relations#modular arithmetic

Statement

Let n≥2n\ge2 be an integer. For a,b∈Za,b\in\mathbb{Z}, write a≡b(modn)a\equiv b\pmod n when nn divides a−ba-b. Prove that ≡\equiv is an equivalence relation on Z\mathbb{Z}, and say how many equivalence classes it has.

Hint

Check reflexivity, symmetry and transitivity, then use division with remainder.

Show solutionHide solution

Solution

Reflexive. a−a=0a-a=0 is divisible by nn.

Symmetric. If n∣a−bn\mid a-b then n∣b−a=−(a−b)n\mid b-a=-(a-b).

Transitive. If n∣a−bn\mid a-b and n∣b−cn\mid b-c, then nn divides the sum (a−b)+(b−c)=a−c(a-b)+(b-c)=a-c.

Classes. Every integer aa can be written a=qn+ra=qn+r with 0≤r<n0\le r<n, so a≡ra\equiv r. Two different remainders r≠r′r\ne r' in {0,…,n−1}\{0,\dots,n-1\} differ by less than nn and are not 00, so they are not congruent. There are exactly nn classes.