In this section,
will be a field, unless stated otherwise.
Modular arithmetic with polynomials is very similar to modular arithmetic with integers.
If
then we say
is congruent to
modulo
,
written
,
if
divides the polynomial
.
proof: All of these are left as an exercise, except for the last one.
Assume
and
. Then
.
By the unique factorization theorem,
.
In general, when computing a polynomial modulo
, we may always replace
,
,
, ...
by
and
,
,
, ...
by
. For example,
.
For each fixed non-zero
,
the congruence relation
defines an equivalence
relation (in the sense of §1.7.2).
Let
denote an equivalence class, which we call the congruence class (or residue class) of
and
This collection of congruence classes is denoted
As in the integral case treated in chapter 1, the following result, is a consequence of the Euclidean algorithm.
The polynomial
in the above lemma is called
the inverse of
modulo
,
written
.
proof:
(only if) Assume
.
There are
such that
, by the Euclidean algorithm
(more precisely, by Corollary 2.2.16).
Thus
.
(if) Assume
.
There is a polynomial
such that
.
By Corollary 2.2.16 again,
we must have
.