Ordinary equality compares integers exactly. In many arithmetic problems, however, only the remainder after division matters.
Motivation
Ordinary equality compares integers exactly. In many arithmetic problems, however, only the remainder after division matters.
For example, the integers
leave the same remainder when divided by :
From the viewpoint of remainders modulo , these integers behave identically.
This observation leads to the notion of congruence.
Definition of Congruence
Let , and let .
We say that is congruent to modulo if
This is written
Thus two integers are congruent modulo exactly when their difference is divisible by .
For example,
because
and
Similarly,
since
and
Congruence and Remainders
Two integers are congruent modulo if and only if they leave the same remainder upon division by .
For example,
because both integers leave remainder when divided by :
This interpretation makes congruence arithmetic intuitive. Modulo , integers are grouped according to their remainders.
Examples
Modulo
Every integer is congruent either to or to modulo .
Even integers satisfy
while odd integers satisfy
Thus parity is congruence modulo .
Modulo
Two integers are congruent modulo exactly when they have the same last decimal digit.
For example,
Similarly,
This explains why divisibility tests often depend only on final digits.
Congruence as an Equivalence Relation
Congruence modulo satisfies the three defining properties of an equivalence relation.
Reflexivity
For every integer ,
because
and
Symmetry
If
then
Indeed, if
then
Transitivity
If
and
then
Since
and
we have
Thus congruence partitions the integers into equivalence classes.
Residue Classes
Modulo , every integer belongs to exactly one of the residue classes
For example, modulo , every integer is congruent to exactly one of
The class of integers congruent to modulo is
These integers differ from one another by multiples of .
Residue classes form the foundation of modular arithmetic.
Compatibility with Arithmetic
Congruence behaves well under addition, subtraction, and multiplication.
If
and
then
and
For example,
and
Therefore
Indeed,
Similarly,
Since
the rule is confirmed.
Cancellation
Congruences may sometimes be canceled.
If
and
then
However, cancellation is not always valid without the coprimality condition.
For example,
since
But
The failure occurs because
Thus modular arithmetic differs subtly from ordinary arithmetic.
Congruence and Divisibility Tests
Congruences explain many elementary divisibility tests.
For example,
Therefore
If
then modulo ,
Thus an integer is divisible by exactly when the sum of its decimal digits is divisible by .
Similar arguments explain divisibility tests for , , and other integers.
Role in Number Theory
Congruence relations transform divisibility into arithmetic on residue classes. They allow integers to be studied modulo a fixed modulus, reducing infinitely many integers to finitely many cases.
This idea is central throughout number theory. Congruences appear in primality testing, Diophantine equations, cryptography, quadratic residues, algebraic number theory, and modular forms.
The notation
is therefore one of the most important languages of arithmetic.