MATH 537 Class Notes
Ed Belk
Fall, 2014
1 Week One
1.1 Lecture One
Instructor: Greg Martin, Office Math 212 Text: Niven, Zuckerman & Montgomery
Conventions: N will denote the set of positive integers, and N0 the set of nonnegative integers. Unless otherwise stated, all variables are assumed to be elements of N. §1.2 – Divisibility
Definition: Let a, b ∈ Z with a 6= 0. Then a is said to divide b, denoted a|b, if there exists some c ∈ Z such that ac = b. If in addition a ∈ N, then a is called a divisor of b. Properties of Divisibility: For all a, b, c ∈ Z with a 6= 0, one has: • If a|b then ±a| ± b • 1|b, b|b, a|0 • If a|b and b|a then a = ±b
• If a|b and a|c, then a|(bx + cy) for any x, y ∈ Z If we assume that a and b are positive, we also have • If a|b then a ≤ b
The Division Algorithm: Let a, b ∈ N. Then there exist unique natural numbers q and r such that: 1. b = aq + r, and 2. 0 ≤ r < a Proof: We prove existence first; consider the set
R = {b − an : n ∈ N0} ∩ N0.
By the well-ordering axiom, R has a least element r, and we define q to be the nonnegative integer q such that b − aq = r. Then b = aq + r and r ≥ 0; moreover, if r ≥ a then one has
0 ≤ r − a = (b − aq) − a = b − a(q + 1) < b − aq + r, contradicting the minimality of r ∈ R, and we are done.
1 Now, suppose q0 and r0 are such that we have
b = aq + r = aq0 + r0.
Without loss of generality we may assume than r ≥ r0. Then
r − r0 = (b − aq) − (b − aq0) = a(q0 − q) ⇒ a|(r − r0); but 0 ≤ r − r0 ≤ r < a, and so the above equation is a contradiction unless r − r0 = 0, and the result is immediate. Greatest Common Divisor: Given any two integers a and b not both equal to zero, we define their greatest common divisor (commonly abbreviated gcd) to be the largest d ∈ N such that d|a and d|b; we write d = (a, b). Note that because a and b each have only finitely many divisors, the gcd is always well-defined.
Theorem 1.1.1 Let a, b ∈ Z, not both equal to zero. Then: 1. (a, b) = min S, where S = ({ax + by : x, y ∈ Z} ∩ N), and 2. For any c ∈ Z such that c|a and c|b, we have c|(a, b). The existence of integers x, y so that ax + by = (a, b) as in part (1) is known as B´ezout’sidentity. Proof: 1. Let m = min S, with u and v such that m = au + bv, and let g = (a, b); note that m ≤ a. Since g|a and g|b, we know from the properties of divisibility that g|m and so g ≤ m. Now, if m - a then by the division algorithm we may write a = mq + r with 0 < r < m, and thus
r = a − mq = a − q(au + bv) = a(1 − qu) + b(−qv) ∈ S, and we deduce that r ≥ m = min S, a contradiction; thus m|a. In the same fashion we show m|b, and so by definition m ≤ (a, b) = g, and we are done.
2. If c|a and c|b, then we know c|(ax + by) for every x, y ∈ Z, and in particular for those u, v such that (a, b) = au + bv, whose existence is guaranteed by part 1.
2 1.2 Lecture Two
Recall: B´ezout’sidentity states that (a, b) is the smallest positive integer that may be written ax + by, where x, y ∈ Z. Proposition 1.2.1 For a, b ∈ N, one has (ma, mb) = m(a, b). a b 1 a b Corollary 1: If d|a, d|b, then d , d = d (a, b); in particular, (a,b) , (a,b) = 1. Proof: Set g = (a, b), so that we may write ax + by = g, for some x, y ∈ Z. Then mg = (ma)x + (mb)y, thus mg ≥ (ma, mb). Furthermore, g|a and so mg|ma; similarly mg|mb, thus mg ≤ (ma, mb), and we are done. Definition: Two integers a and b are called relatively prime (or coprime) if (a, b) = 1. nb. We observe that (a, b) = 1 if and only if there exist x, y such that ax+by = 1. The corresponding statement with (a, b) = k > 1 is not, in general, true, however it is the case that
ax + by = k ⇒ (a, b)|k.
Proposition 1.2.2 If (a, n) = (b, n) = 1, then (ab, n) = 1. Proof: Suppose we have u, v, x, y so that au + nv = bx + ny = 1; then we have
1 = 1 · 1 = (au + nv)(bx + ny) = ab(ux) + n(auy + bvx + nvy), and the result is immediate. [Aside: Compare with the analagous result in commutative algebra. If R is a commutative, unital ring and I, J, K ⊂ R are ideals such that I + K = J + K = R, then IJ + K = R.] Proposition 1.2.3 If a|c, b|c, and (a, b) = 1, then ab|c. (Note that this is not, in general, true for (a, b) > 1, e.g. a = b = c = 2.) Proof: Choose m, n, x, y so that c = am = bn and ax + by = 1. Then
c = cax + cby = (bn)ax + (am)by = ab(nx + my), and we deduce that ab|c. Theorem 1.2.4 (Theorem 1.10, Niven) If d|ab and (b, d) = 1, then d|a. Proof: Exercise. nb. If d|a, d|b, then d|b + ax for any x ∈ Z. In fact, the condition is also necessary, as b = (b + ax) − x(a). The Euclidean Algorithm: How can we find the gcd of two integers, for example 537 and 105? By the division algorithm, we have 537 = 5 · 105 + 12, and so by the above note we know (537, 105) = (105, 12). Repeating this process, we see 105 = 8 · 12 + 9 ⇒ (105, 12) = (12, 9); 12 = 1 · 9 + 3 ⇒ (12, 9) = (9, 3);
3 9 = 3 · 3 + 0 ⇒ (9, 3) = (3, 0) = 3. Thus (537, 105) = 3. Notation: The least common multiple of a and b is denoted lcm(a, b) or, more commonly, [a, b]. Exercise: Show that (a, b)[a, b] = ab. §1.3 – Primes Definition: A natural number n is called prime if it has exactly two divisors. n is called composite if there exists some d with 1 < d < n such that d|n. The integer n = 1 is neither prime nor composite. Notation: Unless otherwise stated, p will denote a prime number. Lemma 1.2.5 (Euclid’s lemma) If p|ab, then p|a or p|b.
Proof: Suppose p - b. Then (p, b) = 1, and so by theorem 1.2.4 we know that p|a. Theorem 1.2.6 (The Fundamental Theorem of Arithmetic) Every n ∈ N, n > 2 may be written as the product of primes; moreover this expression is unique up to reordering of the factors. Proof: (existence) We use strong induction. The case n = 2 is trivial from the definition of a prime, therefore suppose n > 2. If n is prime we have the trivial factorization n = n, otherwise we may write n = ab, with 1 < a < n and 1 < b < n. By the inductive hypothesis we may write a = p1p2 ··· pk, b = q1q2 ··· ql, with each pi, qj prime, and the result is immediate. (uniqueness) Let n ∈ N and suppose we have
n = p1p2 ··· pk = q1q2 ··· ql, each pi, qj prime.
Since p1|q1q2 ··· ql we have by lemma 1.2.5 that p1|q1 or p1|q2 ··· ql. Repeating this process as many times as necessary, we find qt such that p1|qt, and by relabelling the qj if necessary we will assume t = 1. Since p1 6= 1 this implies that p1 = q1, as q1 has no other factors. We then cancel p1 = q1 on both sides of the equation and we have p2p3 ··· pk = q2q3 ··· ql.
We apply the same argument to this expression to obtain p2 = q2, p3 = q3, and so on; it follows that k = l, and we are done.
4 2 Week Two
2.1 Lecture Three
Doing a linear algebra problem backwards. Consider the augmented matrix
1 0 537 ; 0 1 105
x 537 this system clearly has solution = . Moreover, from basic linear algebra we know that the application y 105 of elementary row operations to this augmented system will not change the solution; therefore, with R1,R2 x 537 respectively denoting the first and second row of the matrix, we observe that = is also a solution y 105 to the augmented matrices 1 −5 12 (R → R − 5R ), 0 1 105 1 1 2 1 −5 12 (R → R − 8R ), −8 41 9 2 2 1 9 −46 3 (R → R − R ), −8 41 9 1 1 2 9 −46 3 (R → R − 3R ). −35 179 0 2 2 1 Thus we have the matrix equation 9 −46 537 3 = . −35 179 105 0 The first entry of this equation indicates that 9(537) + (−46)(105) = 3 = (537, 105), while the entries in the 105 537 second row of the matrix are −35 = − (537,105) and 179 = (537,105) . This operation is known as the extended Euclidean algorithm.
Lemma 2.1.1 Let a, b ∈ N and use the division algorithm to write b = aq + r with 0 ≤ r < a. Then a|b if and only if r = 0. Proof: If r = 0 then b = aq and we are done. Conversely, if a|b then a|b−ax for every x, and since r = a−bq < a, we must have r = 0. Theorem 2.1.2 (Euclid’s theorem) There are infinitely many prime numbers.
Proof: It suffices to show that every finite list of primes excludes at least one prime number. Let {p1, p2, . . . , pk} be a set of finitely many primes and let N = p1p2 ··· pk + 1. Then N ≥ 2 and so by the fundamental theorem of arithmetic N is the product of primes, so there exists some prime p such that p|N. Applying the division algorithm with N and any pj yields
N = pj(p1 ··· pj−1pj+1 ··· pk) + 1, which (since 1 < pj) by lemma 2.1.1 implies that pj - N for any j. Thus we deduce that p 6= pj for any j = 1, 2, . . . , k, and therefore that the set of primes {p1, p2, . . . , pk} is not exhaustive.
5 §2.1 – Congruences
Definition: Let m ∈ Z, m 6= 0. Given a, b ∈ Z, we say that a is congruent to b modulo m, written a ≡ b mod m, if m|(b − a). For example, we have
53 ≡ 7 mod 23, but 5 6≡ 37 mod 23.
Lemma 2.1.3 For fixed m 6= 0, “congruence modulo m” is an equivalence relation. Proof: Clearly a ≡ a mod m because m|0 = a − a, which proves reflexivity. Symmetry is an immediate consequence of the fact that m|(b − a) ⇔ m|(a − b), and to prove transitivity we observe that
a ≡ b mod m, b ≡ c mod m ⇒ m|(b − a), m|(c − b) ⇒ m|(c − b) + (b − a) = (c − a), and we are done. Thus in particular, congruence modulo m (as every equivalence relation) partitions Z into equivalence classes, called residue classes modulo m. For example, one residue class modulo 23 is the set
{..., −39, −16, 7, 30, 53,...}.
In general, a residue class modulo m is of the form {a + km : k ∈ Z}. Note in particular that a ≡ b mod m if and only if a and b have the same remainder when dividing by m. Lemma 2.1.4 Suppose a ≡ b mod m, c ≡ d mod m. Then: 1. If d|m then a ≡ b mod d, 2. a + c ≡ b + d mod m, 3. ac = bd mod m. Proof: We prove only (3), as the others are clear from the definitions: since m|(b − a), m|(c − d), we must have that m divides c(b − a) + b(d − c) = bd − ac, and the result follows. The last two parts of lemma 2.1.4 imply further that a − c ≡ b − d mod m, and more generally, if f(X) ∈ k k Z[X], then f(a) ≡ f(b) mod m whenever a ≡ b mod m. In particular, we have that a ≡ b mod m for any k ∈ N. Question: If j ≡ k mod m, do we have aj ≡ ak mod m? In general, no: some counterexamples include a = 2, m = 3 or a = 2, m = 4. We have seen that the operations of addition, subtraction, and multiplication behave well with respect to congruence modulo m; does division? Again, in general the answer is no:
18 ≡ 28 mod 10, but 9 6≡ 14 mod 10, as we might expect if we were allowed to “divide by 2.” m Theorem 2.1.5 (Theorem 2.3, Niven) We have ax ≡ ay mod m if and only if x ≡ y mod (a,m) . In particular, if (a, m) = 1 then ax ≡ ay mod m ⇔ x ≡ y mod m.
6 m a m a Proof: Suppose ax ≡ ay mod m so that m|a(y−x); then we have (a,m) | (a,m) (y−x), and since (a,m) , (a,m) = 1 m m m m we know that (a,m) |(y − x), hence x ≡ y mod (a,m) . Now, suppose x ≡ y mod (a,m) so that (a,m) |(y − x). Then m a we certainly have a (a,m) |a(y −x), hence (a,m) m|a(y −x) and so in particular m|a(y −x), and we are done. Definition: Given m ∈ Z, m 6= 0, a complete residue system modulo m is a set containing exactly one element from each residue class modulo m. For example, with m = 5 we may take any of the sets
{0, 1, 2, 3, 4}, {1, 2, 3, 4, 5}, {−2, −1, 0, 1, 2}, or {−17, 60, 101, 12, −111}.
A reduced residue system is a set of representatives from all residue classes relatively prime to m; continuing in the same example, we may take
{1, 2, 3, 4} or {537, −7, 1, 99999929}.
7 2.2 Lecture Four
Recall:A reduced residue system modulo m is a set consisting of exactly one element form each residue class modulo m whose elements are relatively prime to m; these are called reduced residue classes. Equivalently, we may take any complete residue system modulo m, and discard all elements d such that (d, m) > 1. Example: If m = 10, a complete residue system is given by {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; by discarding all elements not relatively prime to 10, we obtain the reduced residue system {1, 3, 7, 9}. If m is prime, a reduced residue system is given by {1, 2, . . . , m − 1}.
Definition: The Euler φ-function (or Euler totient function) is the function which assigns to m ∈ N the cardinality of a reduced residue system modulo m; that is,
φ(m) = #{1 ≤ i ≤ m :(i, m) = 1}.
For example, φ(10) = 4, and φ(p) = p − 1 for any prime p.
Lemma 2.2.1 Let {r1, r2, . . . , rφ(m)} be a reduced residue system modulo m and let a ∈ Z with (a, m) = 1. Then {ar1, ar2, . . . , arφ(m)} is also a reduced residue system modulo m. For example, with m = 10, a = 13, we see that {13, 39, 91, 117} = {13 · 1, 13 · 3, 13 · 7, 13 · 9} is a reduced residue system modulo 10.
Proof: By assumption a and each rj are relatively prime to m, and so each arj is also relatively prime to m. Moreover, if ari, arj lie in the same residue class, then one has
ari ≡ arj mod m.
By theorem 2.1.5, we may cancel a (which is relatively prime to the modulus) to yield the congruence
ri ≡ rj mod m, and hence (since we began with a reduced residue system) we know that i = j, and the result is immediate. Theorem 2.2.2 (Euler’s theorem) If (a, m) = 1, then aφ(m) ≡ 1 mod m.
Proof: Let {r1, r2, . . . , rφ(m)} be a reduced residue system modulo m. Then by lemma 2.2.1, the elements ar1, ar2, . . . , arφ(m) are congruent (in some order) to the elements r1, r2, . . . , rφ(m), and therefore
r1r2 ··· rφ(m) ≡ (ar1)(ar2) ··· (arφ(m)) mod m φ(m) ≡ a r1r2 ··· rφ(m) mod m.
Since (r1r2 ··· rφ(m), m) = 1, we may cancel it, and the result follows. p−1 Corollary 1: (Fermat’s little theorem) If p is prime and p - a, then a ≡ 1 mod p, and for all a ∈ Z one has ap ≡ a mod p. Corollary 2: Let (a, m) = 1. If there exist e and f with e ≡ f mod φ(m), then ae ≡ af mod m. For example, 537 ≡ 1 mod 4, and since 4 = φ(10) we have that 3537 ≡ 31 mod 10.
8 Proof: Suppose without loss of generality that f ≥ e and write f = e + kφ(m). We have
af = ae+kφ(m) = ae(aφ(m))k ≡ ae(1)k mod m ≡ ae mod m, as claimed. Definition: Given a, m ∈ Z with m 6= 0, we call x ∈ Z a (multiplicative) inverse of a modulo m if ax ≡ 1 mod m. Theorem 2.2.3 (Theorem 2.9, Niven) If (a, m) > 1, then a has no inverse modulo m. If (a, m) = 1, then there exists a unique reduced residue class modulo m which contains all inverses of a. We denote any such inverse as a¯ or a−1. Note that the notation a−1 is justified, as for example if we define a−k to be (a−1)k mod m, then we indeed have (ak)−1 = (a−1)k. Proof: Let g = (a, m); note that if ax ≡ 1 mod m then ax ≡ 1 mod g, and since g|a this congruence becomes 0x ≡ 1 mod g, a contradiction unless g = 1. Thus with the assumption that g = 1, we first prove uniqueness: if ax ≡ 1 mod m and ay ≡ 1 mod m, then ax ≡ ay mod m, hence (since (a, m) = 1) x ≡ y mod m, as claimed. To show existence, we give two short proofs: (1) By Euler’s theorem, we have 1 ≡ aφ(m) mod m ≡ a · aφ(m)−1 mod m, so we may take a−1 = aφ(m)−1. (2) Since (a, m) = 1, there exist integers u, v such that au + bv = 1. Taking this equation modulo m yields the congruence au ≡ 1 mod m, and so we may take a−1 = u.
9 2.3 Lecture Five
Calculating inverses: Suppose we want to calculate the (multiplicative) inverse of 9 modulo 20; note that this calculation is well-defined, as (9, 20) = 1. We perform the Euclidean algorithm:
20 = 9 · 2 + 2; 9 = 2 · 4 + 1
⇒ 1 = 9 − 2 · 4 = 9 − 2 · (20 − 2 · 9) = 9 · 9 − 4 · 20. Taking this last equation modulo 20, we see that 92 ≡ 1 mod 20, so 9−1 ≡ 9 mod 20. The same equation also tells us that 20−1 ≡ 4 mod 9. One clearly has
20−1 ≡ 1 mod 19, 19−1 ≡ −1 mod 20,
19−1 ≡ 1 mod 9, 9−1 ≡ −2 mod 19.
Definition: A collection of integers m1, m2, . . . , mr are called pairwise coprime (or pairwise relatively prime) if (mi, mj) = 1 for all i 6= j. Note that this is stronger than the statement that (m1, m2, . . . , mr) = 1. For example, (6, 10, 15) = 1, but (6, 10) = 2, (6, 15) = 3, (10, 15) = 5.
Theorem 2.3.1 (Theorem 2.18, Niven; the Chinese remainder theorem) Let m1, m2, . . . , mr be pairwise co- prime, and let {a1, a2, . . . , mr} be any set of integers. Then there exists a solution x to the system of congruences
x ≡ a1 mod m1,
x ≡ a2 mod m2, . .
x ≡ ar mod mr, and moreover the set of all solutions is exactly the residue class of x modulo M = m1m2 ··· mr. Proof: For j = 1, 2, . . . , r, let N = m1m2···mr , and note that (m ,N ) = 1. Therefore we may define b to be j mj j j j the inverse of Nj modulo mj, so Njbj ≡ 1 mod mj. Set
r X x0 = Njbjaj; j=1 we claim that x0 solves our system. Indeed, modulo mj, each Ni with i 6= j is congruent to 0 modulo mj, and so x0 ≡ (Njbj)aj mod mj ≡ aj mod mj, as claimed. Now, if x ≡ x0 mod M, then in particular for each j we have x ≡ x0 mod mj ≡ aj mod mj, so x is also a solution. Finally, if y is any solution to our system, then y ≡ aj mod mj ≡ x0 mod mj for every j, so mj|(y − x0). Since the mi are pairwise coprime, we have m1m2|(y − x0), m1m2m3|(y − x0), and so on, until we obtain M|(y − x0), and we are done.
Remark: If m1, m2, . . . , mr are not pairwise coprime, then there may be no solution, or there may be one residue class of solutions modulo [m1, m2, . . . , mr]. For example, the system
x ≡ 0 mod 6,
x ≡ 1 mod 4,
10 has no solution, while x ≡ 0 mod 6, x ≡ 2 mod 4, has as its solution the residue class of 6 modulo 12. Example: Greg steals B boxes of 20 Timbits each. There are an equal number of each of the 9 flavours, and one extra to fill the last box. In class, he divides the Timbits equally among the 19 students, with 4 leftover for himself. What is the smallest possible value of B? Solution: Let t be the total number of Timbits; we have
t ≡ 0 mod 20, t ≡ 1 mod 9, t ≡ 4 mod 19.
Set m1 = 20, m2 = 9, m3 = 19; then
N1 = 171,N2 = 380,N3 = 180.
−1 −1 −1 −1 We need b1 ≡ N1 mod m1 ≡ (9 · 19) mod 20 ≡ (9) (19) mod 20 ≡ 11 mod 20, from our previous work. Similarly, b2 ≡ 5 mod 9, b3 ≡ −2 mod 19. Hence
x0 = N1b1a1 + N2b2a2 + N3b3a3 = (171)(11)(0) + (380)(5)(1) + (180)(−2)(4) = 460.
Structural comments: Let Zm = Z/mZ be the set of residue classes modulo m. If d|m, then there is a well-defined projection map πd : Zm → Zd given by
πd(a mod m) = a mod d.
Note that this map is not well-defined if d - m. Now, let m1, m2, . . . , mr be pairwise coprime. We have a map
π : Zm1m2···mr −→ Zm1 × Zm2 × · · · × Zmr , given in each component Zmi by πmi . The Chinese remainder theorem gives a map
ρ : Zm1 × Zm2 × · · · × Zmr −→ Zm1m2···mr such that π ◦ ρ = id. Since each set is finite, we know that π and ρ are bijections. One can check that: 1. π and ρ respect coprimality, and 2. π and ρ respect multiplication and addition. × Hence, π and ρ are ring isomorphisms. In particular, if Zm is the set of reduced residue classes modulo m, then × × × × π :(Zm1m2···mr ) −→ Zm1 × Zm2 × · · · × Zmr is an isomorphism of multiplicative groups. It follows from this, and the formula for the Euler φ-function, that φ(m1m2 ··· mr) = φ(m1)φ(m2) ··· φ(mr).
11 3 Week Three
3.1 Lecture Six
Suppose n ∈ N has prime factorization α1 α2 αr n = p1 p2 ··· pr , with αi > 0 and pi 6= pj for all i 6= j. Then as discussed last time, we have maps
π : Zm1m2···mr −→ Zm1 × Zm2 × · · · × Zmr ,
ρ : Zm1 × Zm2 × · · · × Zmr −→ Zm1m2···mr , where π = π α1 × π α2 × · · · × π αr and ρ is the map given by the Chinese remainder theorem. These maps are p1 p2 pr mutual inverses, and moreover are ring isomorphisms. In particular, these maps respect coprimality, and so their restrictions to their respective multiplicative groups of units yield mutually inverse group isomorphisms
× × × × π˜ :(Zm1m2···mr ) −→ Zm1 × Zm2 × · · · × Zmr ,
× × × × ρ˜ : Zm1 × Zm2 × · · · × Zmr −→ (Zm1m2···mr ) . × By definition, (Zn) has cardinality φ(n), and so it follows that
φ(m1m2 ··· mr) = φ(m1)φ(m2) ··· φ(mr).
Thus we are led to compute φ(pα) for prime p; but since the only 1 ≤ k ≤ pα with (pα, k) > 1 must have (pα, k) = p, we deduce that exactly the multiples of p are not relatively prime to pα, hence φ(pα) = pα − pα−1 = α 1 p 1 − p . It follows that Y 1 φ(n) = n 1 − , p p|n with the product running over all prime divisors p of n.
Lemma 3.1.1 Fix m ∈ N, and consider the following statements: 1. x2 ≡ 1 mod m 2. x−1 ≡ x mod m 3. x ≡ ±1 mod m For any m, one has (1) if and only if (2), and that (3) implies (1). If m is prime, then all three are equivalent. Proof: The first statement is clear, as is the statement that (3) implies (1). Thus we will assume m is prime; then one has (3) if and only if m|x2 − 1 = (x + 1)(x − 1). Thus by Euclid’s lemma we have m|x + 1 or m|x − 1, and the result is immediate. We saw in the last lecture that 9−1 ≡ 9 mod 20, but clearly 9 6≡ ±1 mod 20. The same is true for 11 ≡ −9 mod 20. Theorem 3.1.2 (Wilson’s theorem) If p is prime, then (p − 1)! ≡ −1 mod p.
12 Proof: The cases p = 2, p = 3 are clear by computation. For p > 3, we pair off the numbers {2, 3, . . . , p − 2} p−3 as {a1, b1, a2, b2, . . . , ak, bk}, where k = 2 and aibi ≡ 1 mod p. We know that this is well-defined by lemma 3.1.1, and the fact that inverses modulo p are unique. One then has
(p − 1)! = 1 · 2 ··· (p − 1) = 1 · (p − 1) · a1b1 ··· akbk ≡ 1 · (p − 1) · 1 · 1 ··· 1 mod p ≡ −1 mod p, as claimed. §2.2 – Solutions of congruences How many solutions has X4 + 2X3 + X + 1 ≡ 0 mod 5? As integers, we have solutions x ∈ {· · · , −14, −13, −9, −8, −4, −3, 1, 2, 6, 7, 11, 12, ···}. As residue classes modulo 5, we have only x ≡ 1 mod 5 and x ≡ 2 mod 5; we say that our congruence has only 2 solutions modulo 5.
Definition: Given a polynomial f(X) ∈ Z[X], the number of solutions of f(X) ≡ 0 mod m, denoted σf (m), is the number of residue classes modulo m which satisfy the congruence; equivalently,
σf (m) = #{1 ≤ x ≤ m : f(x) ≡ 0 mod m}.
2 Example: Let f(X) = X − 1. We saw that σf (20) ≥ 4, while by lemma 3.1.1 we know that if p is an odd prime then σf (p) = 2, while σf (2) = 1. We begin our investigation by studying linear congruences of the form ax ≡ b mod m.
Theorem 3.1.3 (Theorem 2.17, Niven) Let m ∈ N and set f(X) = aX − b, a, b ∈ Z. Set g = (a, m). Then σf (m) = 0 unless g|b, in which case σf (m) = g. Proof: If ax ≡ b mod m, then ax ≡ b mod g, i.e. 0x ≡ b mod g, since g|a, and hence we must have g|b. Now, suppose g|b and write a = αg, b = βg, m = µg. Then ax ≡ b mod m ⇔ αx ≡ β mod µ, by theorem 2.1.5. But (α, µ) = 1 by construction, so α−1 modulo µ exists, and we have the unique solution −1 m given by x ≡ α β mod µ. This yields g = µ solutions modulo m, as claimed. Example: Let m = 100 and g = 5, so that µ = 20. Then x ≡ 14 mod 20 if and only if x ≡ 14, 34, 54, 74, or 94 modulo 100.
e1 e2 er Let m have prime factorization m = p1 p2 ··· pr . By the Chinese remainder theorem, the congruence f(x) ≡ 0 mod m is equivalent to the system of congruences
e1 f(x) ≡ 0 mod p1 , e2 f(x) ≡ 0 mod p2 , . .
er f(x) ≡ 0 mod pr .
13 In particular, this implies that r Y ei σf (m) = σf (pi ), i=1 and thus it suffices to study polynomial congruences modulo prime powers; this will be the focus of our next lecture.
14 3.2 Lecture Seven
Exercise: Prove that the product of any k consecutive integers is a multiple of k!. Solution: The pigeonhole principle implies that among any k consecutive integers must be a multiple of 1, of 2, and so on up to k, but this is not quite enough, since these numbers need not be pairwise coprime. Instead, we may prove it one prime at a time, from which the general case follows. On the other hand, we may simply use the identity j(j − 1) ··· (j − k + 1) j! j = = ∈ , k! k!(j − k)! k Z from which the fact is apparent; granted, the last method is a Deus ex machina. §2.6 – Prime power moduli
Lemma 3.2.1 Let f(X) ∈ C[X] have degree d. Then for any a ∈ C, we have f 00(a) f (d)(a) f(a + h) = f(a) + hf 0(a) + h2 + ··· + hd . 2! d!
Proof: Fix a; both expressions above are polynomials in h of degree d, and their zeroth derivatives agree at h = 0, as do their first derivatives, second, and so on up to the dth derivatives. Thus their derivative, which is a polynomial in h of degree at most d, is divisible by hd+1, which implies that they must, in fact, be equal. nb. With the notion of a derivative not defined here, we instead will use the formal derivative of a polynomial or power series, i.e.
m m X n 0 X n−1 if f(X) = anX , then f (X) = nanX , m ∈ N0 ∪ {∞}. n=0 n=0
f (k)(a) Lemma 3.2.2 If f(X) ∈ Z[X], then for any a ∈ Z, k ∈ N, we have that k! is an integer. d X n Proof: Write f(X) = anX , an ∈ Z. Then n=0
d f (k)(a) X n(n − 1) ··· (n − k + 1) = an−k, k! k! n=0
n(n−1)···(n−k+1) and by the exercise we know that k! ∈ Z. j Theorem 3.2.3 (Hensel’s lemma) Let f(X) ∈ Z[X] and let p be a prime power. Suppose there exists a ∈ Z so that f(a) ≡ 0 mod pj and f 0(a) 6≡ 0 mod p. Then there exists a unique integer t, 0 ≤ t < p such that f(a + tpj) ≡ 0 mod pj+1. Example: Take f(X) = X2 − 2, a = 4, pj = 71. Then
f(4) = 16 − 2 ≡ 0 mod 7, f 0(4) = 2(4) 6≡ 0 mod 7.
It follows that exactly one element of {4, 11, 18, 25, 32, 39, 46} is a root of f(X) modulo 72; it turns out to be 39.
15 Note that the residue class a modulo pj is the union of the p residue classes a + tpj, 0 ≤ t < p. The one which is a root modulo pj+1 is called a lift of a. Proof of Hensel’s lemma: By lemma 3.2.1, we may write
(tpj)2f 00(a) (tpj)df (d)(a) f(a + tpj) = f(a) + tpjf 0(a) + + ··· + . 2! d! Taking this expression modulo pj+1 yields
f(a + tpj) ≡ f(a) + tpjf 0(a) mod pj+1.
Since f(a) ≡ 0 mod pj, we have that this is the case if and only if
f(a) ≡ −tf 0(a) mod p. pj
Since f 0(a) 6≡ 0 mod p, we have that f 0(a) is a unit modulo pj+1, and so we find the unique class t to be given by −(f 0(a))−1f(a) t ≡ mod p, pj as can be easily verified. f(a) 14 0 Example: Using the same example from before, we calculate pj = 7 = 2, f (a) = 8 ≡ 1 mod 7, so we ought to take t = −(1)−1(2) ≡ 5 mod 7, and indeed
f(4 + 5 · 7) = f(39) = 1519 ≡ 0 mod 72.
0 Corollary 1: Given f(X) ∈ Z[X], a prime p, and a ∈ Z with f(a) ≡ 0 mod p and f (a) 6≡ 0 mod p, then for j j every j ≥ 2 there exists a unique lift of a to a root of f modulo p ; that is, a unique residue class aj mod p such that j f(aj) ≡ 0 mod p and aj ≡ a mod p.
Proof: Exercise. (hint: use induction and Hensel’s lemma)
Remark: The aj of the corollary are given recursively by a1 = a and, for j ≥ 1,
0 −1 aj+1 = aj − f (aj) f(aj). nb. The condition f 0(a) 6≡ 0 mod p is the condition that a is a nonsingular root of f(X) modulo p. As written, this formula fails for singular roots: consider f(X) = X2. Then a = 0 is a root modulo p, and every lift of a is a root of f modulo p2. Similarly, for g(X) = X2 − p, a = 0 is a root modulo p, but no lifts of a are roots modulo p2. There is a more general version of Hensel’s lemma (theorem 2.24 of Niven) which accommodates such roots. Fact: There exist polynomials, such as
(X2 − 2)(X2 − 17)(X2 − 34), or 3X3 + 4Y 3 + 5Z3, which have roots modulo m for every m ∈ N, but have no roots over the rationals.
16 3.3 Lecture Eight
§2.7 – Prime modulus P j P j Definition: Let f(X) = ajX , g(X) = bjX ∈ Z[X]. We will say that f(X) is congruent to g(X) modulo m, written f(X) ≡ g(X) mod m, if aj ≡ bj mod m for every j. In other words, f(X) ≡ g(X) mod m ∼ if and only if f(X) and g(X) have the same image in (Z[X])/(m) = (Z/mZ)[X]. 2 Example: Suppose f(X) = 15X + 3X + 8 ∈ Z[X]. We note that deg f = 2 over Z, but deg f = 1 over Z5, and deg f = 0 over Z3. Lemma 3.3.1 Let p be prime, a an integer, and f(X) ∈ Z[X]. If f(a) ≡ 0 mod p, then there exists g(X) ∈ Z[X] with deg g = deg f − 1 such that
f(X) ≡ (X − a)g(X) mod p.
Proof: We saw in our last lecture that (with d = deg f)
f 00(a) f (d)(a) f(a + h) = f(a) + hf 0(a) + h2 + ··· + hd . 2! d! We set d X f (j) g(X) = (X − a)j−1 , j! j=1 and we have that f(X) = f(a) + (X − a)g(X) ≡ (X − a)g(X) mod p.
f (d)(a) Note that the leading coefficient of f(X) is d! and that deg g = d − 1. Observe that the primality condition is necessary; indeed, if f(X) = X2 − 1, then f has roots ±1, but we may factor f(X) = (X − 5)(X + 5).
Theorem 3.3.2 (Theorem 2.26, Niven) Let f(X) ∈ Z[X], deg f = d modulo p, with p prime. Then f has at most d roots modulo p. Proof: We induct on deg f. For deg f = 0 the result is clear, so suppose deg f = d > 0. If f has no roots modulo p we are done; otherwise, write
f(X) ≡ (X − a)g(X) mod p, where f(a) = 0 and deg g = d − 1, as guaranteed by lemma 3.3.1. Since p is prime, any root of f(X) modulo p is a root of X − a or g(X). By the inductive hypothesis, g has at most d − 1 roots modulo p, and X − a has a single root modulo p, from which we deduce the result. Example: Consider f(X) = Xp − X with p prime. By Fermat’s little theorem, every residue class modulo p is a root of f, and by lemma 3.3.1 it follows that
f(X) = X(X − 1)(X − 2) ··· (X − p + 1) mod p.
Comparing coefficients yields some interesting congruences, among which we have in the coefficient of Xp−1
0 + 1 + 2 + ··· + (p − 1) ≡ 0 mod p, p > 2,
17 and in the coefficient of Xp−2 X jk ≡ 0 mod p, p > 3. 0≤j (p − 1)! ≡ −1 mod p. Remark: This example implies that if f(X), g(X) ∈ Z[X] are such that f(a) ≡ g(a) mod p for every a ∈ Z, then f(X) − g(X) ≡ h(X)(Xp − X) mod p for some h(X) ∈ Z[X]. In fact, this condition is also sufficient. Proposition 3.3.3 Let F (X) be any function (i.e. set map) from Zp to Zp. Then there exists a unique polynomial g(X) modulo p of degree at most p − 1 such that F (a) ≡ g(a) mod p for every a ∈ Z. Proof: We show uniqueness first. If g(X), h(X) both satisfy the condition, then from our remark above we have that p g(X) − h(X) = q(X)(X − X), some q(X) ∈ Z[X]. Comparing degrees, we see that we must have g = h. For existence, we give two proofs. First of all, if we set p−1 X g(X) = (1 − (X − a)p−1)F (a), a=0 then by Fermat’s little theorem we see that g(a0) ≡ (1 − 0)F (a0) mod p ≡ F (a0) mod p. p p Alternatively, we observe that there are exactly p functions Zp → Zp, and there are exactly p polynomials over Zp of degree at most p − 1. No two of these polynomials give the same function, and it follows that the two sets must coincide. Corollary 1: (Corollary 2.30, Niven) Let p be prime and suppose that d|(p − 1). Then Xd − 1 has exactly d roots modulo p. Proof: By theorem 3.3.2 there are most d roots, so we need only show there are at least d roots. Note that Xp−1 − 1 ≡ (X − 1)(X − 2) ··· (X − p + 1) mod p has exactly p − 1 roots modulo p. Since d|(p − 1), we have Xp−1 − 1 = (Xd − 1)(Xp−1−d + Xp−1−2d + ··· + X2d + Xd + 1). The second factor has at most p − 1 − d roots modulo p, and so by the pigeonhole principle Xd − 1 must have at least d roots modulo p, as claimed. §2.8 – Primitive roots and power residues Consider the congruence Xn ≡ 1 mod m; note that any solution a must satisfy (a, n) = 1. Definition: Given a with (a, m) = 1, the multiplicative order of a modulo m (often called simply the order of a) is the least positive integer k such that ak ≡ 1 mod m. One sometimes says that a belongs to the exponent k modulo m. 18 Example: Let m = 11, a = 3. We have 31 ≡ 3 mod 11, 32 ≡ 2 mod 11, 33 ≡ 5 mod 11, 34 ≡ 4 mod 11, 35 ≡ 1 mod 11, and we see that the order of 3 modulo 11 is 5. Fact: The order of a modulo m always divides φ(m). 19 4 Week Four 4.1 Lecture Nine Lemma 4.1.1 (Lemma 2.31, Niven) ak ≡ 1 mod m if and only if the order of a modulo m divides k. Proof: Let h be the order of a modulo m. If h|k, we have k = hq for some q, hence ak = ahq = (ah)q ≡ 1q mod m ≡ 1 mod m. Conversely, if ak ≡ 1 mod m, we may use the division algorithm to write k = hq + r, 0 ≤ r < h. One then has 1 ≡ ak mod m ≡ (ah)qar mod m ≡ ar mod m. Since h is the minimal positive integer such that ah ≡ 1 mod m, it follows that r = 0, and we are done. If (a, m) = 1, then the order of a modulo m divides φ(m). k h Lemma 4.1.2 (Lemma 2.33, Niven) If a has order h modulo m, then a has order (h,k) modulo m. 2 h For example, the order of a modulo m is 2 if h is even, and h if h is odd. Proof: The following statements about positive integers j are equivalent: 1. (ak)j ≡ 1 mod m 2. h|(kj) h k 3. (h,k) | (h,k) j h 4. (h,k) |j h It follows that the least positive j satisfying (4), and hence (1), is exactly j = (h,k) . × Remark: The subgroup of Zm generated by a is a cyclic group of order h. The same proof shows that the h smallest positive integer y such that ky ≡ 0 mod h is y = (h,k) . Lemma 4.1.3 Let a have order r modulo m, and let b have order s modulo m. Then the order of ab modulo rs rs [r,s] m divides (r,s) = [r, s], and moreover is a multiple of (r,s)2 = (r,s) . In particular (Lemma 2.34, Niven), if (r, s) = 1, then the order of ab modulo m is exactly rs. Proof: Let t be the order of ab modulo m. Then (ab)rs/(r,s) = (ar)s/(r,s)(bs)r/(r,s) ≡ (1)(1) mod m ≡ 1 mod m, rs and it follows that t| (r,s) . We also have ast ≡ ast(bs)t mod m ≡ ((ab)t)s mod m ≡ 1 mod m, r s r s r s hence r|st, so (r,s) | (r,s) t ⇒ (r,s) |t. By a symmetric argument we may show that (r,s) |t, and since (r,s) , (r,s) = 1 rs it follows that (r,s)2 |t. Definition: An integer a is called a primitive root modulo m if it has order φ(m) modulo m. In this case, × Zm is the cyclic group of order φ(m). 20 Proposition 4.1.4 If m has a primitive root, then it has exactly φ(φ(m)) primitive roots. Proof: Let g be a primitive root modulo m. Then we have a reduced residue system modulo m given by 2 φ(m) j φ(m) {g, g , . . . , g }. By lemma 4.1.2, the order of g modulo m is exactly (j,φ(m)) , which equals φ(m) exactly when (j, φ(m)) = 1. There are exactly φ(φ(m)) such residue classes, and we are done. r Lemma 4.1.5 (Lemma 2.35, Niven) Let p, q be primes and let r ∈ N be such that q |(p − 1). Then there are qr − qr−1 residue classes of order qr modulo p. Proof: The order of a modulo p divides qr if and only if aqr ≡ 1 mod p. This congruence has exactly qr solutions by corollary 1 of proposition 3.3.3. The order of a modulo p divides qr−1 if and only if aqr−1 ≡ 1 mod p, which has exactly qr−1 solutions. The result is now immediate. Theorem 4.1.6 (Theorem 2.36, Niven) Every prime p has a primitive root. Proof: If p = 2 the result is immediate, so assume p is odd and write p − 1 in its prime factorization r1 r2 rk p − 1 = q1 q2 ··· qk . rj For each 1 ≤ j ≤ k, let aj be some integer of order qj modulo p, whose existence is guaranteed by lemma 4.1.5. ri rj r1 r2 Since (qi , qj ) = 1 for all i 6= j, we have by lemma 2.34 of Niven that a1a2 has order q1 q2 modulo p, that r1 r2 r3 a1a2a3 has order q1 q2 q3 modulo p, and continuing in this fashion, we eventually see that a1a2 ··· ak has order p − 1 modulo p, as claimed. 21 4.2 Lecture Ten Example: Modulo 5, the reduced residue classes are 1, 2, 3, and 4, with respective orders 1, 4, 4, and 2; we see that 2 and 3 are the φ(φ(5)) primitive roots modulo 5. What are the primitive roots modulo 25? Exactly {2, 3, 8, 12, 13, 17, 22, 23}. Note that there are 8 = φ(φ(25)) of them, and that all are also primitive roots modulo 5. In fact, we may lift any primitive root modulo p to p − 1 primitive roots modulo p2, and for j ≥ 2, any primitive root modulo pj lifts to exactly p primitive roots modulo pj+1. Proposition 4.2.1 For n ≥ 1, we have X φ(d) = n. d|n 1 2 n Proof: The fractions { n , n ,..., n } are not all in lowest terms; when we do so, we may consider their denomi- nators. For every divisor d of n, exactly φ(d) of these fractions have denominator d; indeed, these fractions are exactly k(n/d) : 1 ≤ k ≤ d, (k, d) = 1 . n Since there are exactly n fractions in our original set, the result follows. Alternative proof of the existence of primitive roots modulo p: We use strong induction to find the number of elements of order k modulo p, namely φ(k) if k | (p − 1), and 0 if k - (p − 1). The case k = 1 is trivial. For k > 1, k | (p − 1), we first note that X X φ(k) + φ(d) = φ(d) = k. d|k, d|k d Since p is prime, there are exactly k solutions to the congruence xk ≡ 1 mod p, which are exactly those x modulo p with order dividing k. This, again, is exactly the sum X #{x : ordp(x) = k} + #{x : ordp(x) = d}, d|k, d r−2 gp (p−1) 6≡ 1 mod pr. Moreover, the converse holds if g is a primitive root modulo pr−1. Proof: If g is a primitive root modulo pr, then r r−1 r−2 ordpr (g) = φ(p ) = p (p − 1) > p (p − 1), 22 from which it follows that r−2 gp (p−1) 6≡ 1 mod pr. Now, suppose that g is a primitive root modulo pr−1 and that r−2 gp (p−1) 6≡ 1 mod pr. The order of g modulo pr divides φ(pr) = pr−1(p − 1), and by lemma 4.2.2 must be a multiple of pr−2(p − 1). r−2 Since ordpr (g) 6= p (p − 1) by assumption, we deduce the result. Theorem 4.2.4 Primitive roots exist modulo p2 for any prime p. Proof: Let g be a primitve root modulo p and consider the lifts g + tp modulo p2, 0 ≤ t ≤ p − 1. We claim that all but one of these lifts are primitive roots modulo p2. Indeed, by proposition 4.2.3 it suffices to show that exactly one lift satifsies (g + tp)p−1 ≡ 1 mod p2. Let f(X) = Xp−1 − 1. Then g is a root of f(X) modulo p, and f 0(g) = (p − 1)gp−2 6≡ 0 mod p. Thus g is a nonsingular root of f modulo p, and so by Hensel’s lemma exactly one lift of g is a root of f modulo p2; every other such lift must then yield a primitive root. Lemma 4.2.5 If g is a primitive root modulo p2, then it is also a primitive root modulo p. Proof: If ak ≡ 1 mod p, then apk − 1 = (ak − 1)((ak)p−1 + (ak)p−2 + ··· + ak + 1). Both factors are multiples of p, so it follows that apk ≡ 1 mod p2. In particular, if g is a primitive root modulo p2, then gpk 6≡ 1 mod p2 for k = 1, 2, . . . , p − 2. Hence gk 6≡ 1 mod p for 1 ≤ k ≤ p − 2, and it follows that the order of g modulo p is p − 1. Next, we will consider primitive roots modulo pr for r ≥ 3. No more degenerate cases arise here, except when p = 2. In this case, there are no primitive roots modulo 2r for any r ≥ 3. 23 4.3 Lecture Eleven Theorem 4.3.1 Let p be an odd prime and let r ≥ 2. Then any primitve root modulo p2 is a primitive root modulo pr. Proof: We induct on r. The case r = 2 is trivial, so for r > 2 assume g is a primitive root modulo pr; we will show that g is a primitive root modulo pr+1. Indeed, by proposition 4.2.3 we have that r−2 gp (p−1) 6≡ 1 mod pr, and so by the same proposition it suffices to show that gpr−1(p−1) 6≡ 1 mod pr+1. By Euler’s theorem we have that r−2 gp (p−1) ≡ 1 mod pr−1, so we can write gpr−2(p−1) = 1 + npr−1 for some n 6≡ 0 mod p. By the binomial theorem we have that p r−1 X p gp (p−1) = (1 + npr−1)p = (npr−1)k, k n=0