6.3 Combining congruence classes
In the previous section we saw that ‘‘congruence modulo ’’
is an example of an equivalence relation on the set ; there are
congruence classes, , , , and , which
partition , meaning that every integer lies in exactly one of
these classes. (Of course, there is nothing special about the natural
number here.) In this section we shall see that it is possible to
give the collection of these classes an arithmetic, which in many ways
is similar to the ordinary arithmetic of the integers themselves, but
has the advantage of being much simpler; using it we shall be able to
answer some apparently difficult questions very easily.
We start with a piece of notation.
Notation 6.3.1
Given , we write for the set
of congruence classes modulo .
Thus . Our goal is to
decide how to equip the set with an addition and a
multiplication.
We begin with addition, and for definiteness work in ; this
means that we need, for example, to define the sum of and .
Since , the obvious thing to do is to set this to
be ; but we have to be rather careful here, for
the following reason. What we seem to be doing is taking two
representative elements of the classes and , adding the
elements and then taking the class containing the sum. However, the
integer is only one of many representatives of the
class ; likewise with the representative of
the class . If we had chosen other representatives, is it
conceivable that we might have ended up with a different class for the
sum? For example, we could instead have chosen representatives
of and of ; then we
would have calculated and obtained the
class as the sum. Since ,
in this case the answer is in fact the same; but we need to be sure
that it will always be the same, no matter which
representatives are chosen.
To make the point that this is not obvious, let us first consider a
situation where things do not work properly. Continue to work in
, but instead of addition let us attempt to define taking
powers; given , can we define
as the class containing ? Let
and . If we take the representatives
and , then we
have . However, if instead we had taken
the representative (and still
), then we would have got
. Now
; so taking different representatives
changes the final class, and we cannot define in
this way.
So there genuinely is something to be shown if our attempt to define
addition is to work. Of course, we do not want to have to do lots of
checks like that above (we would in fact need to do infinitely many!).
Instead we require a general result, which generalizes
Lemma 5.1.7.
Lemma 6.3.2
Suppose that and , where
and . Then ,
and .
Proof. Take such that
and . Then we have
|
|
|
so that . Moreover,
|
|
|
so that , and finally
|
|
|
so that .
Lemma 6.3.2 enables us to make the following definition without
any ambiguity.
Definition 6.3.3
Given and ,
define ,
and .
Our ‘‘new’’ addition and multiplication inherit many properties from
the ordinary versions; for example, for all we have
and , and therefore
|
|
|
Moreover,
our system also has subtraction: in we may regard as
, so in we set
as
expected. (As in , however, division is another matter.)
Since the set is finite, we may give addition and
multiplication tables listing the results of combining any two
classes. In , for example, we obtain the following.
|
|
|
In we obtain instead these tables.
|
|
|
Lemma 6.3.2 shows that if then ; so we have the concept of ‘‘squares modulo ’’. The
following result is easy.
Proposition 6.3.5
All squares are congruent to or
modulo .
Example 6.3.6
We have .
Moreover, .
Proof. Let be given. Since each integer is congruent to
either , , or
modulo , there are four cases to consider:
-
•
if , then ;
-
•
if , then ;
-
•
if , then ;
-
•
otherwise , and .
Note that this result can be read from the main diagonal of the
multiplication table in given above.
Corollary 6.3.7
Suppose that is congruent to
modulo . Then cannot be expressed as the sum of two
squares.
Example 6.3.8
is not a sum of two squares because
, so and hence
Proof. We shall prove the statement by contraposition. To do so, we
begin by expressing it symbolically; it can be rewritten as
‘‘’’, where
|
|
|
Recall
from Example 2.3.7 that the law of contraposition
implies that the statement ‘‘’’ is
logically equivalent to ‘‘’’, that is,
‘‘’’.
To prove this final statement, suppose that is true, so that for some . By
Proposition 6.3.5, and are
congruent to either or
modulo , so there are four cases to consider:
-
•
if and
, then ;
-
•
if and
, then ; the case where
and is
similar;
-
•
if and
, then .
Hence in each case , so is
never satisfied, and the result follows.
Our observation above about taking squares modulo extends to cubes
or indeed any powers: if then
for any . (Do not confuse this with the remarks earlier about
the impossibility of defining for classes
and ; there we were attempting to raise one class to the power
of another class, whereas what is being claimed here is simply
that it makes sense to raise a class to a given power.)
This result enables us to simplify certain expressions when working
modulo .
Example 6.3.10
Find without considering any numbers greater
than .
Note: this means ‘‘find
such that ’’.
Solution. We compute , ,
, so that
|
|
|
Example 6.3.11
Find the remainder on dividing by without considering
any numbers greater than .
Solution. We compute and
|
|
|
so that
|
|
|
so the remainder is
Example 6.3.12
Show that for each .
Solution. We have , so that
,
and hence
|
|
|
Likewise, we see that , so
that
|
|
|
and thus , which proves the result.
What we have succeeded in defining in this section is called modular arithmetic; it has the great advantage over ordinary
arithmetic of requiring only very small calculations as the set
involved is finite, but as we have seen it sometimes enables us to
answer questions which would otherwise seem impossibly hard.