19 Lecture 3 S
19 Lecture 3 S
Definition 18 Let
Zm = {0, 1, . . . , m − 1}.
For any a, b ∈ Zm , we define
a + b = ia,b and a × b = ja,b
such that 0 ≤ ia,b ≤ m − 1, 0 ≤ ja,b ≤ m − 1 and
a + b ≡ ia,b mod m and a × b ≡ ja,b mod m.
The main idea to define + and × is to identify
numbers larger than m by a number in the range
from 0, . . . , m − 1. In fact, we are simply doing
modulus arithmetic.
Note that + and × defined on Zm satisfy the usual
rules such as associate law, commutative law,
distributive law etc.
Commutative law: For any a, b in Zm ,
a + b ≡ b + a mod m, a × b = b × a mod m.
Associative law: For any a, b, c in Zm ,
a + (b + c) ≡ (a + b) + c mod m,
a × (b × c) = (a × b) × c mod m.
Distributive law: For any a, b, c in Zm ,
a × (b + c) ≡ (a × b) + (a × c) mod m.
These laws help simplifying calculations.
However, the arithmetic in Zm is quite different from
that in Z. For example, it is possible that there exist
a, b ∈ Zm such that a 6= 0 and b 6= 0 but a × b = 0.
To see that, just check that 2 × 2 = 0 in Z4 .
Example. In Z71 , find 31 × 24, 2130 and the inverse
of 20.
31 × 24 ≡ 744 ≡ 34 mod 71. Therefore,
31 × 24 = 34 in Z71 .
Now, 212 = 441 = 15, 214 = 152 = 225 = 12,
218 = 122 = 144 = 2, 2116 = 22 = 4. Therefore,
2130 = 2116+8+4+2 = 4 × 2 × 12 × 15 = 20.
Observe that 71 = 20 × 3 + 11,
20 = 11 + 9, 11 = 9 + 2 and 9 = 2 × 4 + 1.
Therefore,
1 = 9 − 2 × 4 = 9 − (11 − 9) × 4 = 5 × 9 − 11 × 4
= 5 × (20 − 11) − 11 × 4 = 5 × 20 − 11 × 9 =
5 × 20 − (71 − 3 × 20) × 9 = 32 × 20 − 71 × 9.
Therefore, 32 × 20 = 1 in Z71 .
Theorem 19 Let p be a prime number. Then for
any integer a with p - a, ap−1 ≡ 1 mod p. In other
words, for any a ∈ Zp , if a 6= 0, then ap−1 = 1.
The above result is no longer true if p is not a
prime. That is, if p is not a prime, ap−1 needs not
be 1 in Zp . This property of prime number can be
used as a test if p is a prime number.
Example. In Z14 , show that 313 6= 1.
To prove Theorem 19, we need to use the fact that
when p is prime and if a, b, c in Zp , a 6= 0 and
ab = ac, then b = c.
It follows that if a 6= 0, then
a × 1, a × 2, . . . , a × (p − 1) are distinct nonzero
elements in Zp . Therefore,
= 1 · 2 · · · (p − 1).
Hence, ap−1 = 1.
Example. Prove that Z7 = {0, 1, 3, 32 , 33 , 34 , 35 }
but Z7 6= {0, 1, 2, 22 , 23 , 24 , 25 }.
Definition 20 We define
Z∗m = {1 ≤ i ≤ (m − 1) : gcd(i, m) = 1}
Example.
∗
1 Z6 = {1, 5} and φ(6) = 2.
∗
2 Z8 = {1, 3, 5, 7} and φ(8) = 4.
∗
3 Z9 = {1, 2, 4, 5, 7, 8} and φ(9) = 6.
primes.
Theorem 22 Let m be an integer. For any a ∈ Z∗m ,
aφ(m) = 1.