As such, this relation partitions the set
Z
into equivalence classes. We denote the equivalence class
containing the integer
a
by [
a
mod
n
], or when
n
is clear from context, we may simply write [
a
].
Historically, these equivalence classes are called
residue classes modulo
n
, and we shall adopt
this terminology here as well.
It is easy to see from the definitions that
[
a
mod
n
] =
a
+
n
Z
:=
{
a
+
nz
:
z
∈
Z
}
.
Note that a given residue class modulo
n
has many different “names”; e.g., the residue class [1] is
the same as the residue class [1+
n
]. For any integer
a
in a residue class, we call
a
a
representative
of that class.
Theorem 2.7
For a positive integer
n
, there are precisely
n
distinct residue classes modulo
n
,
namely,
[
a
]
for
0
≤
a < n
. Moreover, for any
k
∈
Z
, the residue classes
[
k
+
a
]
for
0
≤
a < n
are
distinct and therefore include all residue classes modulo
n
.
Proof.
Exercise.
2
Fix a positive integer
n
.
Let us define
Z
n
as the set of residue classes modulo
n
.
We can
“equip”
Z
n
with binary operators defining addition and multiplication in a natural way as follows:
for
a, b
∈
Z
, we define
[
a
] + [
b
] := [
a
+
b
]
,
and we define
[
a
]
·
[
b
] := [
a
·
b
]
.
Of course, one has to check this definition is unambiguous, i.e., that the addition and multiplica
tion operators are well defined, in the sense that the sum or product of two residue classes does not
depend on which particular representatives of the classes are chosen in the above definitions. More
precisely, one must check that if [
a
] = [
a
0
] and [
b
] = [
b
0
], then [
a
op
b
] = [
a
0
op
b
0
], for op
∈ {
+
,
·}
.
However, this property follows immediately from Theorem 2.1.
These definitions of addition and multiplication operators on
Z
n
yield a very natural algebraic
structure whose salient properties are as follows:
Theorem 2.8
Let
n
be a positive integer, and consider the set
Z
n
of residue classes modulo
n
with
addition and multiplication of residue classes as defined above.
For all
a, b, c
∈
Z
, we have
1.
[
a
] + [
b
] = [
b
] + [
a
]
(addition is commutative),
2.
([
a
] + [
b
]) + [
c
] = [
a
] + ([
b
] + [
c
])
(addition is associative),
3.
[
a
] + [0] = [
a
]
(existence of additive identity),
4.
[
a
] + [

a
] = [0]
(existence of additive inverses),
5.
[
a
]
·
[
b
] = [
b
]
·
[
a
]
(multiplication is commutative),
6.
([
a
]
·
[
b
])
·
[
c
] = [
a
]
·
([
b
]
·
[
c
])
(multiplication is associative),
7.
[
a
]
·
([
b
] + [
c
]) = [
a
]
·
[
b
] + [
a
]
·
[
c
]
(multiplication distributes over addition)
8