Reading: MCS 9.6–9.8
Review proof of correctness of GCD (this has been added to the lecture 30 notes
Define Zn, the set of "modular numbers"
The next several lectures will explore the arithmetic of remainders. Usually these results are presented as a set of equations about congruence mod m or about remainders when divided by m (MCS does both).
Instead, we will raise the level of abstraction a bit. We will define a new kind of object (the modular number), and redefine operations like + and ⋅ for these objects. This is not a new process: you already have several kinds of things you know how to add and multiply: natural numbers, integer, rationals, reals, complex numbers, vectors, matrices, and random variables, to name a few. Each of these kinds of objects has a different algorithm for doing arithmetic on them; but because they all have a common interface, you have built up lots of intuition about how to manipulate them.
Definition: a is congruent to b (mod m), (written a≡b (mod m) or a≡mb). if m|b−a.
Note: It is easy to misinterpret this as a≡(b mod m); this interpretation leads to confusion. Think of the "mod m" as a big note on the side of your equations or proofs, not as part of your equations.
Note: ≡m is an equivalence relation (proof left as a review exercise).
Definition: The set Zn of modular numbers is defined by Zn=Z/≡m.
Recall that Z/≡m is the set of equivalence classes of integers by the relation ≡m: Zm={…,[−2]m,[−1]m,[0]m,[1]m,[2]m,…}, where [a]m={b∣b≡ma}. When the m is clear from context, we will simply write [a].
Note that [−1]=[m−1] (because m|m−1−(−1) so −1≡mm−1), and [−2]=[m−2], and [m]=[0] and [m+1]=[1], etc. In general, [a]=[rem(a,m)], so Zm can always be written as
Zm={[0]m,[1]m,[2]m,…,[m−1]m}
Key facts: the following are equivalent:
This follows from the definitions, with the exception of the equivalence of (3) and (4). To see that (3) implies (4), assume m|b−a. If we write a=qam+ra and b=qbm+rb, we see that km=(qb−qa)m+rb−ra. This means that rb−ra is a multiple of m. Since rb and ra are both less than m, we have −m<rb−ra<m; since 0 is the only multiple of m satisfying this property, rb−ra=0.