We'll assume some basic knowledge. We'll assume familiarity with the various definitions of primes:
is prime if it cannot be factored as a product of two integers greater than
; equivalently, whenever integers
satisfy
, then
or
; equivalently, whenever
, the greatest common divisor of
and
(written
) is
. We'll assume familiarity also with unique prime factorization and with basic properties of congruences.
Given a prime
, let
, also written
, denote the
-element set
, with operations of addition and multiplication defined modulo
.
Usually, one thinks of
as the set of equivalence classes of integers, where two integers are equivalent if they are congruent modulo
; here we consider it instead to be set-theoretically contained in
, because this will prove slightly more convenient later. It's evident that our arithmetic operations are well-defined on this set. We claim that
is a field: that the two operations of addition and multiplication satisfy the associative, commutative, and distributive laws, that each operation has an identity (0 for addition and
for multiplication), that every element has an additive inverse, and that every element except 0 has a multiplicative inverse. All of the properties except for the last follow readily from the corresponding properties of addition and multiplication among the integers, so detailed proofs won't be needed. Showing the existence of multiplicative inverses is slightly harder. We give two proofs.
Suppose
. Then
, so
. Then, the Euclidean algorithm gives integers
such that
in
; so,
modulo
. Thus, reducing
modulo
gives an inverse for
in
.
A more constructive proof follows from this
Theorem. (Fermat's Little Theorem) For
any integer,
.
Proof. We use induction. If
, the statement is obvious. Now, given the statement for
, we seek to prove it for
. But
If
is nonzero, Fermat tells us that
; since
is prime,
, or
in
. So,
is an inverse for
. We now have proved
Fact.
is a field.
In particular, nonzero elements of
may be meaningfully raised to any integral power, positive or negative.
It may seem confusing to let the numbers
denote elements both of
and of the integers
, since the operations are defined differently, but the alternative would be notational bureaucracy, so we'll continue relying on context to make the difference clear as long as possible. When we declare explicitly that variables lie in
, however, all operations done on them will also occur in
unless otherwise stated.