 
 equipped with a binary operation
 equipped with a binary operation
 (denoted by multiplication below)
and an identity element
 (denoted by multiplication below)
and an identity element  such that:
 such that:
 , we have
, we have 
 .
.
 , we have
, we have  , and there exists
, and there exists  such that
 such that 
 .
.
 is a set equipped with binary operations
 is a set equipped with binary operations
 and
 and  and elements
 and elements  such that
 such that 
 is an abelian group under
 is an abelian group under  ,
and for all
,
and for all 
 we have
 we have
 
 
 .
.
 for all
 for all  , then we
call
, then we
call  a commutative ring.
 a commutative ring.
In this section we define the ring 
 of integers modulo
 of integers modulo  ,
introduce the Euler
,
introduce the Euler  -function,
 and relate it to the multiplicative
order of certain elements of
-function,
 and relate it to the multiplicative
order of certain elements of 
 .
.
If 
 and
 and 
 , we say that
, we say that  is congruent
    to
 is congruent
    to  modulo
 modulo  if
 if  , and write
, and write 
 .
Let
.
Let 
 be the ideal of
 be the ideal of 
 generated by
 generated by  .
.
 )    
The ring of integers modulo
)    
The ring of integers modulo  is the quotient ring
is the quotient ring 
 of equivalence classes of integers
modulo
 of equivalence classes of integers
modulo  .  It is equipped with its natural ring structure:
.  It is equipped with its natural ring structure:
 
 
 
 as follows:
 as follows:
sage: R = Integers(3) sage: list(R) [0, 1, 2]
We use the notation 
 because
 because 
 is the quotient of
the ring
 is the quotient of
the ring 
 by the ideal
 by the ideal 
 of multiples of
 of multiples of  .  Because
.  Because
 is the quotient of a ring by an ideal, the ring structure
on
 is the quotient of a ring by an ideal, the ring structure
on 
 induces a ring structure on
 induces a ring structure on 
 .  
We often let
.  
We often let  or
 or  denote the equivalence class
denote the equivalence class 
 of
 of  .
.  
 is a ring such that for every
nonzero element
 is a ring such that for every
nonzero element  there is an element
 there is an element  such that
such that  .
.  
For example, if  is a prime, then
 is a prime, then 
 is a
field (see
Exercise 2.12).
 is a
field (see
Exercise 2.12).
We call the natural reduction map 
 , which sends
, which sends  to
 to 
 , reduction modulo
, reduction modulo  .  We also say that
.  We also say that  is a 
lift of
 is a 
lift of 
 .  Thus, e.g.,
.  Thus, e.g.,  is a lift of
 is a lift of  mod
 mod  ,
since
,
since 
 .
.
We can use that arithmetic in 
 is well defined is to
derive tests for divisibility by
 is well defined is to
derive tests for divisibility by  (see
Exercise 2.8).
 (see
Exercise 2.8).
 
where the digits of
 are
 are  ,
,  ,
,  , etc.
Since
, etc.
Since 
 ,
,
 
from which the proposition follows.
