Congruence is an equivalence relation
Reflexive, symmetric, transitive — so it partitions ℤ into m classes, one per remainder.
a ≡ b (mod m) when m | (a − b). Congruence is an equivalence relation, addition and multiplication respect it, and cancellation is where it stops behaving like ordinary arithmetic.
Core ideas
Congruence is Sets, Relations, and Functions's equivalence relation applied to the integers, and the classes support arithmetic.
Reflexive, symmetric, transitive — so it partitions ℤ into m classes, one per remainder.
The result's class depends only on the inputs' classes, which is what makes arithmetic on classes legitimate.
ac ≡ bc (mod m) gives a ≡ b only when gcd(c, m) = 1. This is the one familiar rule that fails.
The material
The definition, the well-definedness proof, and the rule that fails.
For m > 0, a ≡ b (mod m) means m | (a − b); equivalently, a and b leave the same remainder on division by m.
It is reflexive (m | 0), symmetric (m | (a−b) gives m | (b−a)) and transitive (m | (a−b) and m | (b−c) give m | (a−c) by the linear-combination property).
By “Equivalence Relations and Partitions” in Sets, Relations, and Functions it therefore partitions ℤ into equivalence classes. There are exactly m of them, one for each remainder 0, 1, …, m−1, and the set of classes is written ℤ/mℤ or ℤ_m.
If a ≡ b (mod m) and c ≡ d (mod m), then a + c ≡ b + d and ac ≡ bd (mod m).
Write a = b + ms and c = d + mt. Then a + c = (b + d) + m(s + t), so the sums are congruent.
And ac = (b + ms)(d + mt) = bd + m(bt + ds + mst), so the products are congruent.
□
This is the well-definedness check “Functions” in Sets, Relations, and Functions warned about, carried out. It says arithmetic on classes is legitimate: the answer does not depend on which representatives were used, so [3] + [4] = [7] is a statement about classes rather than about the numbers 3 and 4.
The practical consequence is that a computation may be reduced at any point. To find 17 · 23 (mod 5), reduce first: 2 · 3 = 6 ≡ 1, rather than computing 391 and dividing.
2 · 3 = 6 ≡ 16 = 2 · 8 (mod 10), and yet 3 ≢ 8 (mod 10). The factor 2 cannot be cancelled because gcd(2, 10) = 2 ≠ 1.
If ac ≡ bc (mod m) and gcd(c, m) = 1, then a ≡ b (mod m).
gcd(c,m) = 1 gives an inverse c⁻¹ by “Bézout's Identity and Modular Inverses”. Multiplying both sides by it leaves a ≡ b.
□
2 · 5 = 10 ≡ 0 (mod 10) with neither factor zero. In ℤ_10 there are nonzero elements whose product is zero — impossible in ℤ, and the reason ℤ_10 is not a field.
ℤ_p for prime p has no zero divisors and every nonzero element has an inverse: it is a field. For composite m, exactly the elements coprime to m are invertible, and there are φ(m) of them.
Since 10 ≡ 1 (mod 9), any number is congruent mod 9 to its digit sum. To check 4321 × 5678 = 24 534 638: digit sums are 10 ≡ 1 and 26 ≡ 8, product 8; the claimed answer has digit sum 35 ≡ 8. Consistent — and the check would catch most single digit errors, though not a transposition.
Interactive
Algorithms with their traces
Method
Reduce early and often.
17 · 23 (mod 5) is 2 · 3 (mod 5). Well-definedness is what makes this legitimate and it keeps the numbers small.
Both operations respect congruence. Subtraction too, since it is addition of a negative.
ac ≡ bc gives a ≡ b only when gcd(c,m) = 1. This is the rule that catches people.
Add m if the result is negative. Conventional representatives make answers comparable.
That is 7¹⁰⁰ mod 10, and the powers cycle.
The cycle length 4 is not a coincidence: φ(10) = 4, and Euler's theorem in “Fermat's Little Theorem and Euler's Theorem” guarantees 7^{φ(10)} ≡ 1 whenever gcd(7,10) = 1. “Modular Exponentiation” turns this into a general algorithm.
Compute 123 · 456 (mod 7) by reducing each factor first. Two small multiplications rather than one large one, and the answer is the same because congruence respects multiplication.
Something to change about this lesson? Write it down, tick it off when it is handled, and export the list when you want to act on it. Kept in this browser only: nothing is sent anywhere, and nobody is notified.
No recommendations yet for this lesson.