Congruence modulo $n$ groups integers according to their remainders after division by $n$. If two integers have the same remainder, they are congruent modulo $n$.
From Congruence to Classes
Congruence modulo groups integers according to their remainders after division by . If two integers have the same remainder, they are congruent modulo .
For example,
because
and
The integers congruent to modulo form the set
This set is called a residue class modulo .
Definition
Let . For an integer , the residue class of modulo is the set
Equivalently,
Thus a residue class contains all integers that differ from by a multiple of .
For example,
Each element of this set leaves remainder when divided by .
Representatives
Any integer belonging to a residue class may be used to name it. Such an integer is called a representative of the class.
For example,
These are not three different classes. They are three names for the same class.
The division algorithm gives a preferred set of representatives:
Every integer is congruent modulo to exactly one of these integers.
Thus modulo , the complete list of residue classes is
Partition of the Integers
Residue classes modulo partition the integers. This means two things.
First, every integer lies in some residue class.
Second, two residue classes are either identical or disjoint.
For example, modulo , the integers split into the four classes
Every integer appears in exactly one of these four sets.
Equality of Residue Classes
Two residue classes modulo are equal precisely when their representatives are congruent:
if and only if
Indeed, if , then every integer congruent to is also congruent to , so the classes are equal.
Conversely, if the classes are equal, then , so
Thus residue classes are determined by congruence, not by the particular representative chosen.
Arithmetic of Classes
Addition and multiplication of residue classes are defined by
and
These definitions are meaningful because congruence is compatible with addition and multiplication.
For example, modulo ,
Also,
The result depends only on the residue classes, not on the chosen representatives.
Well-Definedness
To say that class arithmetic is well defined means that choosing different representatives gives the same answer.
Suppose
and
Then
and
Therefore
and
This justifies arithmetic on residue classes.
The Ring of Residue Classes
The set of all residue classes modulo is denoted by
It consists of
With addition and multiplication defined by residue classes, this set forms a finite arithmetic system.
For example,
Inside this system,
and
The arithmetic “wraps around” after reaching the modulus.
Units Modulo
A residue class is called a unit if it has a multiplicative inverse modulo . That is, there exists a class such that
This is equivalent to
Such an inverse exists exactly when
For example, modulo , the units are
The class is not a unit because
Role in Number Theory
Residue classes turn congruence into algebra. Instead of working with infinitely many integers, one works with finitely many classes modulo .
This finite viewpoint is powerful. It underlies modular arithmetic, linear congruences, the Chinese remainder theorem, Euler’s theorem, Fermat’s little theorem, quadratic residues, and many cryptographic systems.
Residue classes show that arithmetic can be studied locally modulo a fixed integer, while still retaining information about the original integers.