Chapter 2 Handouts Math 302
Chapter 2 Handouts Math 302
Example 2. Is it possible to add 1 to a square integer and obtain 3 times another square integer?
We’ll soon see how to answer both of these questions using the theory of congruences.
Congruence modulo n
Definition 3. Let a, b, n ∈ Z, with n > 0. We say that a is congruent to b modulo n, and write
a ≡ b (mod n),
if n | (a − b).
Example 4. Determine whether the following statements are true or false:
(a) 17 ≡ 5 (mod 6)
Theorem 5. Fix a positive integer n. Then the relation of congruence modulo n is an “equivalence relation”
on the set of integers. That is, for any a, b, c ∈ Z, the following three properties hold:
Example 2 (again).
3
Congruence classes
Definition 7. Let a, n ∈ Z, with n > 0. The congruence class of a modulo n is
[a]n = [a] = b ∈ Z b ≡ a (mod n) ,
i.e., the set of all integers that are congruent to a modulo n.
Remark 8. When we want to be more precise, we will use the notation [a]n . If n is clear from context, we
will just write [a]. (The notation [a] is more commonly used in the textbook.)
Notice that
b ≡ a (mod n) ⇐⇒ n | (b − a)
⇐⇒ b − a = nk for some k ∈ Z
⇐⇒ b = a + nk for some k ∈ Z
(b) [−3]4 =
(c) [9]4 =
Theorem 10. Fix an integer n > 0. For any two integers a, c ∈ Z, we have
(a)
(b) If a 6≡ c (mod n), then [a]n and [c]n are disjoint sets.
In particular, any two congruence classes modulo n are either disjoint or identical.
Corollary 11. Fix an integer n > 0.
(a) Let a ∈ Z and suppose r is the remainder when a is divided by n. Then [a]n = [r]n .
(b) There are exactly n distinct congruence classes modulo n, namely
[0], [1], [2], . . . , [n − 2], [n − 1].
Example 12. Modulo 4 we have
[0] = {. . . , −8, −4, 0, 4, 8, . . .}
[1] = {. . . , −7, −3, 1, 5, 9, . . .}
[2] = {. . . , −6, −2, 2, 6, 10, . . .}
[3] = {. . . , −5, −1, 3, 7, 11, . . .}
Definition 13. The set of all congruence classes modulo n is denoted by Zn .
Remark 14. Instead of using the notation Zn , it’s also common to use the notation Z/nZ. But we won’t
use this in our class.
4
Some problems
(1) Decide whether the following statements are true or false:
(a) 2 ∈ [5]10
(b) [10]5 ∈ Z5
(2) (a) Suppose that (a, n) = 1. If ab ≡ ac (mod n), prove that b ≡ c (mod n).
(b) Translate the result in part (a) into a statement about congruence classes in Zn .
(3) If [a] = [1] in Zn , prove that (a, n) = 1. Show that the converse may be false.
1
Example 2. Two students are adding the same two congruence classes C1 and C2 in Z7 .
• Student A chooses to write them as C1 = [3] and C2 = [6].
• Student B chooses to write them as C1 = [−4] and C2 = [20].
When they use Definition 1 to calculate C1 ⊕ C2 , do they get the same answer?
Remark 3. More succinctly, the definition of addition and multiplication on Zn can we written as
[a] ⊕ [c] := [a + c], [a] [c] := [ac].
Example 4. Fill in the following addition and multiplication tables for Z3 = { [0], [1], [2] }
⊕ [0] [1] [2] [0] [1] [2]
[0] [0]
[1] [1]
[2] [2]
Some problems
(1) Find all solutions in Z5 to the cubic equation
X 3 ⊕ [7] X ⊕ [−7] = [0].
Note. We following the usual order of operations from high school algebra. So in this problem we
compute X 3 and [7] X first and then perform the addition.
(2) Prove or disprove: If [a] [b] = [0] in Zn , then [a] = [0] or [b] = [0].
Here’s one of the two main theorems from this section (which must be stated using the precise notation):
Theorem 2. Let a, n be integers, with n > 1. The element [a] ∈ Zn is a unit if and only if (a, n) = 1.
The following is the other main theorem, which is just a rephrasing of Theorem 2.8 from the book using
the terminology in Definition 1 above:
Theorem 3. Fix an integer n > 1. The following are equivalent:
(a) The integer n is prime.
(b) Every nonzero a ∈ Zn is a unit.
(c) There are no zero divisors in Zn .
Thus if n is prime then Zn behaves a lot like the number systems Q, R, and C. (Usually we write p for a
prime and talk about Zp , as in the title of the section.) On the other hand, if n is composite then arithmetic
in Zn is not as “nice”, in the sense that you will have strange things like zero divisors and some nonzero
elements won’t be units.
Some problems
(1) (a) If a is a unit in Zn , prove that a is not a zero divisor.
(b) If a is a zero divisor in Zn , prove that a is not a unit.
Hint. What is the contrapositive of this statement?
(2) What are the units in Z9 ? What are the zero divisors?