In ordinary arithmetic, division by a nonzero number means multiplication by its reciprocal. Modular arithmetic is more delicate. A residue class may or may not have a...
Division in Modular Arithmetic
In ordinary arithmetic, division by a nonzero number means multiplication by its reciprocal. Modular arithmetic is more delicate. A residue class may or may not have a multiplicative inverse.
Let and be integers with . A modular inverse of modulo is an integer satisfying
When such a exists, we write
This means that multiplication by can be undone modulo .
Existence Criterion
An integer has a multiplicative inverse modulo if and only if
Indeed, the congruence
means that
for some integer . Equivalently,
Thus is an integer linear combination of and . By Bezout’s criterion, this happens exactly when
So invertibility modulo is exactly the same as coprimality with .
Example
Find the inverse of modulo .
Since
an inverse exists.
Use the Euclidean algorithm:
Now work backward:
Since
we get
Since
we obtain
Thus
Therefore
Indeed,
Uniqueness of Inverses
If an inverse exists, it is unique modulo .
Suppose
and
Then
Since , cancellation is valid modulo , so
Thus all inverses of modulo lie in one residue class.
Units Modulo
A residue class is called a unit if it has a multiplicative inverse in .
The set of all units modulo is denoted by
It consists exactly of the classes
such that
For example, modulo , the units are
The classes , , , , and are not units because each has a common divisor greater than with .
Prime Moduli
If is prime, then every nonzero residue class modulo is invertible.
Indeed, if
then , so
Therefore has an inverse.
Thus
is a field. This means that addition, subtraction, multiplication, and division by nonzero classes are all possible.
For example, modulo ,
because
Composite Moduli
If is composite, not every nonzero class modulo is invertible.
For example, modulo , the class is a unit because
Its inverse is itself:
But is not a unit because
There is no integer such that
The obstruction is common divisibility.
Solving Congruences by Inverses
When
the linear congruence
can be solved by multiplying both sides by :
For example, solve
Since
we have
Therefore
Inverses and the Extended Euclidean Algorithm
The extended Euclidean algorithm is the standard method for finding modular inverses.
To find , compute integers and such that
If
then
Reducing modulo , we obtain
Hence
This gives an efficient and constructive procedure.
Role in Number Theory
Modular inverses make division possible in modular arithmetic, but only for classes coprime to the modulus.
They are essential in solving linear congruences, proving Euler’s theorem, constructing the Chinese remainder theorem, and building cryptographic systems.
The main principle is that modular division is not governed by whether , but by whether
Coprimality replaces nonzero-ness as the correct condition for invertibility modulo .