Overview

Congruence allows a calculation to retain only the information relevant to a modulus. It turns infinitely many integers into finitely many classes while preserving addition and multiplication. This is useful for divisibility tests, integer equations and finite algebra. A congruence is not an approximate equality: it is an exact statement about divisibility of a difference.

Prerequisites

Know integer divisibility and division with remainder. For inverse calculations, use gcds and the Bézout identity. The modulus in this article is a positive integer mm; allowing other conventions is possible but does not help the basic construction.

Definition and conventions

Write a≡b(modm)a\equiv b\pmod m when m∣(a−b)m\mid(a-b). This is an equivalence relation. The equivalence class of aa consists of the integers a+kma+km for k∈Zk\in\mathbb Z. Every class has a unique representative among 0,1,…,m−10,1,\ldots,m-1, but the class is not identical to that chosen representative.

The quotient Z/mZ\mathbb Z/m\mathbb Z consists of these classes. Define [a]+[b]=[a+b][a]+[b]=[a+b] and [a][b]=[ab][a][b]=[ab]. These operations are well-defined because replacing either input by a congruent integer changes the result by a multiple of mm. When m=1m=1, there is just one class.

Intuition

Think of reducing a computation to a remainder without repeatedly choosing a new representative. The class remembers a whole family of integers. Multiplication and addition respect this reduction, so intermediate numbers can be replaced by smaller convenient values. Division is different: not every nonzero class has a multiplicative inverse.

Examples and non-examples

Since −13−2=−15-13-2=-15, one has −13≡2(mod5)-13\equiv2\pmod5. Squaring gives 169≡4(mod5)169\equiv4\pmod5 without computing a quotient of 169169.

Modulo 88, 3⋅3≡13\cdot3\equiv1, so the inverse of 33 is 33. But 22 has no inverse: every product 2x2x is even and cannot be congruent to 11. The congruence 2x≡2y(mod8)2x\equiv2y\pmod8 does not force x≡y(mod8)x\equiv y\pmod8; take x=1x=1 and y=5y=5.

Important properties

A class [a][a] is invertible precisely when gcd⁡(a,m)=1\gcd(a,m)=1. A Bézout identity gives an inverse when the gcd is one. Conversely, an inverse implies ax−my=1ax-my=1 for some integers, so every common divisor of a,ma,m divides one.

More generally, ax≡b(modm)ax\equiv b\pmod m is solvable exactly when d=gcd⁡(a,m)d=\gcd(a,m) divides bb. Necessity follows from divisibility of ax−myax-my. Sufficiency follows by multiplying a Bézout identity by b/db/d. Cancellation by a nonunit may reduce the modulus rather than preserve it, which explains the failure in the example above.

Connections and further reading

Prime moduli give finite fields; composite moduli usually give zero divisors. The Chinese remainder theorem decomposes a composite modulus with coprime factors into independent calculations. Milne, Chapter 1 connects congruences with quotient rings and ideals.