MA3H1 Topics in Number Theory. Samir Siksek

Similar documents
MA3H1 TOPICS IN NUMBER THEORY PART III

Math 4400/6400 Homework #8 solutions. 1. Let P be an odd integer (not necessarily prime). Show that modulo 2,

The Hasse Minkowski Theorem Lee Dicker University of Minnesota, REU Summer 2001

x 2 a mod m. has a solution. Theorem 13.2 (Euler s Criterion). Let p be an odd prime. The congruence x 2 1 mod p,

HENSEL S LEMMA KEITH CONRAD

MA257: INTRODUCTION TO NUMBER THEORY LECTURE NOTES 2018

MATH 3240Q Introduction to Number Theory Homework 7

MATH342 Practice Exam

MATH 2710: NOTES FOR ANALYSIS

Math 104B: Number Theory II (Winter 2012)

Algebraic Number Theory

MAS 4203 Number Theory. M. Yotov

NUMBER SYSTEMS. Number theory is the study of the integers. We denote the set of integers by Z:

MATH 361: NUMBER THEORY EIGHTH LECTURE

By Evan Chen OTIS, Internal Use

t s (p). An Introduction

Elementary Analysis in Q p

Practice Final Solutions

Pythagorean triples and sums of squares

Sets of Real Numbers

3 Properties of Dedekind domains

Introductory Number Theory

A CONCRETE EXAMPLE OF PRIME BEHAVIOR IN QUADRATIC FIELDS. 1. Abstract

Representing Integers as the Sum of Two Squares in the Ring Z n

Math 261 Exam 2. November 7, The use of notes and books is NOT allowed.

Practice Final Solutions

GAUSSIAN INTEGERS HUNG HO

On the Multiplicative Order of a n Modulo n

Elementary Number Theory

Quadratic Reciprocity

Mersenne and Fermat Numbers

CHAPTER 6. Prime Numbers. Definition and Fundamental Results

MAT 311 Solutions to Final Exam Practice

Quadratic Residues, Quadratic Reciprocity. 2 4 So we may as well start with x 2 a mod p. p 1 1 mod p a 2 ±1 mod p

1 Overview and revision

Mobius Functions, Legendre Symbols, and Discriminants

Elementary Number Theory Review. Franz Luef

2 Arithmetic. 2.1 Greatest common divisors. This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}.

1. multiplication is commutative and associative;

Number Theory Proof Portfolio

Jacobi symbols and application to primality

Number Theory Naoki Sato

ERRATA AND SUPPLEMENTARY MATERIAL FOR A FRIENDLY INTRODUCTION TO NUMBER THEORY FOURTH EDITION

Algebraic number theory LTCC Solutions to Problem Sheet 2

Introduction to Arithmetic Geometry Fall 2013 Lecture #10 10/8/2013

ALGEBRA. 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers

We collect some results that might be covered in a first course in algebraic number theory.

RECIPROCITY LAWS JEREMY BOOHER

A Curious Property of the Decimal Expansion of Reciprocals of Primes

Elementary Number Theory MARUCO. Summer, 2018

AN INTRODUCTION TO GAUSS S NUMBER THEORY. Andrew Granville

NUMBER SYSTEMS. Number theory is the study of the integers. We denote the set of integers by Z:

MATH 371 Class notes/outline October 15, 2013

Chapter 5. Number Theory. 5.1 Base b representations

QUADRATIC RECIPROCITY

The Euler Phi Function

Chapter 3. Number Theory. Part of G12ALN. Contents

p-adic Measures and Bernoulli Numbers

1 Integers and the Euclidean algorithm

.4. Congruences. We say that a is congruent to b modulo N i.e. a b mod N i N divides a b or equivalently i a%n = b%n. So a is congruent modulo N to an

Frobenius Elements, the Chebotarev Density Theorem, and Reciprocity

An integer p is prime if p > 1 and p has exactly two positive divisors, 1 and p.

QUADRATIC RECIPROCITY

Factor Rings and their decompositions in the Eisenstein integers Ring Z [ω]

#A47 INTEGERS 15 (2015) QUADRATIC DIOPHANTINE EQUATIONS WITH INFINITELY MANY SOLUTIONS IN POSITIVE INTEGERS

HOMEWORK # 4 MARIA SIMBIRSKY SANDY ROGERS MATTHEW WELSH

MATH 371 Class notes/outline September 24, 2013

Primes - Problem Sheet 5 - Solutions

RATIONAL AND INTEGRAL POINTS ON CURVES. Andrew Granville. Table of Contents

Part IA Numbers and Sets

SOME SUMS OVER IRREDUCIBLE POLYNOMIALS

= 1 2x. x 2 a ) 0 (mod p n ), (x 2 + 2a + a2. x a ) 2

MATH 361: NUMBER THEORY ELEVENTH LECTURE

A SURVEY OF PRIMALITY TESTS

Maths 4 Number Theory Notes 2012 Chris Smyth, University of Edinburgh ed.ac.uk

QUADRATIC RECIPROCITY

On the Rank of the Elliptic Curve y 2 = x(x p)(x 2)

PRIME NUMBERS YANKI LEKILI

[Ch 3, 4] Logic and Proofs (2) 1. Valid and Invalid Arguments ( 2.3, 3.4) 400 lecture note #2. 1) Basics

6 Binary Quadratic forms

Characteristics of Fibonacci-type Sequences

ON THE LEAST SIGNIFICANT p ADIC DIGITS OF CERTAIN LUCAS NUMBERS

Real Analysis 1 Fall Homework 3. a n.

Public-key Cryptography: Theory and Practice

CERIAS Tech Report The period of the Bell numbers modulo a prime by Peter Montgomery, Sangil Nahm, Samuel Wagstaff Jr Center for Education

Chapter 8. P-adic numbers. 8.1 Absolute values

ARITHMETIC PROGRESSIONS OF POLYGONAL NUMBERS WITH COMMON DIFFERENCE A POLYGONAL NUMBER

Math 5330 Spring Notes Prime Numbers

A review of the foundations of perfectoid spaces

(Workshop on Harmonic Analysis on symmetric spaces I.S.I. Bangalore : 9th July 2004) B.Sury

Factorability in the ring Z[ 5]

Elementary Properties of the Integers

DISCRIMINANTS IN TOWERS

16 The Quadratic Reciprocity Law

A FEW EQUIVALENCES OF WALL-SUN-SUN PRIME CONJECTURE

Solvability and Number of Roots of Bi-Quadratic Equations over p adic Fields

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer?

Contribution of Problems

MATH 152 NOTES MOOR XU NOTES FROM A COURSE BY KANNAN SOUNDARARAJAN

Diophantine Equations and Congruences

Transcription:

MA3H1 Toics in Number Theory Samir Siksek Samir Siksek, Mathematics Institute, University of Warwick, Coventry, CV4 7AL, United Kingdom E-mail address: samir.siksek@gmail.com

Contents Chater 0. Prologue 5 1. What s This? 5 2. The Queen of Mathematics 5 Chater 1. Review 7 1. Divisibility 7 2. Ideals 8 3. Greatest Common Divisors 9 4. Euler s Lemma 10 5. The Euclidean Algorithm 10 6. Primes and Irreducibles 11 7. Corimality 13 8. ord 13 9. Congruences 15 10. The Chinese Remainder Theorem 19 Chater 2. Multilicative Structure Modulo m 21 1. Euler s ϕ Revisited 21 2. Orders Modulo m 22 3. Primitive Roots 23 Chater 3. Quadratic Recirocity 27 1. Quadratic Residues and Non-Residues 27 2. Quadratic Residues and Primitive Roots 27 3. First Proerties of the Legendre Symbol 28 4. The Law of Quadratic Recirocity 29 5. The Sheer Pleasure of Quadratic Recirocity 34 Chater 4. -adic Numbers 37 1. Congruences Modulo m 37 2. -Adic Absolute Value 39 3. Convergence 41 4. Oerations on Q 44 5. Convergence of Series 47 6. -adic Integers 47 3

4 CONTENTS 7. Hensel s Lemma Revisited 49 8. The Hasse Princile 51 Chater 5. Geometry of Numbers 55 1. The Two Squares Theorem 55 2. Areas of Ellises and Volumes of Ellisoids 56 3. The Four Squares Theorem 58 4. Proof of Minkowski s Theorem 60 Chater 6. Irrationality and Transcendence 63 1. Irrationality: First Stes 63 2. The irrationality of e 64 3. What about Transcendental Numbers? 65 Aendix X. Last Year s Exam 69

CHAPTER 0 Prologue 1. What s This? These are my lecture notes for MA3H1 Toics in Number Theory, with the usual Siksek trademarks. Thanks go to Jenny Cooley, Samantha Pilgram and Vandita Patel for corrections. Please send comments, misrints and corrections to samir.siksek@gmail.com. 2. The Queen of Mathematics Gauss wrote that mathematics is the queen of sciences and number theory is the queen of mathematics. In this module we hoe to cover some fascinating but fairly elementary asects of the subject, to ensure maximal enjoyment with minimal rerequisites. Toics covered should include: (1) A review of the number theory you met in the first year Foundations module (rimes, unique factorisation, greatest common divisors, modular arithmetic, Chinese Remainder Theorem). (2) Structure of Z/mZ and U m. (3) -adic numbers. (4) Geometry of Numbers. (5) Diohantine equations. (6) The Hasse Princile for ternary quadratic forms. (7) Counterexamles to the Hasse Princile. (8) Irrationality and transcendence. 5

CHAPTER 1 Review You ve sent the last two or three years thinking about rings, toological saces, manifolds, and so on. This chater reminds you of the heros of your mathematical childhood: the integers. We review some of their roerties which you have seen before, but erhas not for a long time. 1. Divisibility Definition. Let a, b be integers. We say that a divides b and write a b if there exists an integer c such that b = ac. The following lemma gives easy roerties of divisibility; all have one-line roofs from the definition. Lemma 1.1. (Easy Proerties of Divisibility) For all integers a, b, c and k: (1) a 0; (2) if a b then a kb; (3) if a b and a c then a (b ± c); (4) if a b and b c then a c; (5) if a b and b a then a = ±b. (6) if a b and b 0 then a b ; (7) (±1) a for all integers a; (8) if a (±1) then a = ±1. Examle 1.1. Show that 42 (7 n 7) for all ositive integers n. Answer. This is easy to do using congruences (have a go). But let us try to do it from the definition of divisibility using induction on n. It is obvious for n = 1. Suose it is true for n = k. That is, suose that 42 (7 k 7). In other words, 7 k 7 = 42c for some integer c. Then so 7 k+1 7 2 = 7 42c 7 k+1 7 = 7 42c + 42 = 42(7c + 1). As c is an integer, 7c + 1 is an integer, so 42 (7 k+1 7). 7

8 1. REVIEW Theorem 1.2. (Division with remainder) Let a, b be integers with b ositive. Then there are unique integers q, r satisfying a = qb + r and 0 r b 1. Here q is called the quotient and r the remainder on dividing a by b. The uniqueness is certainly needed to say the quotient and the remainder. Proof. Let us rove uniqueness first. Suose that a = qb + r, a = q b + r where q, q, r, r are integers and 0 r, r b 1. Without loss of generality, we can suose that r < r. Subtracting we see that so (q q )b + r r = 0 (q q )b = r r. Hence 0 r r b 1 and r r is a multile of b. Therefore r r = 0, so r = r and q = q. This roves uniqueness. Let us now rove the existence of q and r. Suose first that a 0. In Foundations you have done this case using the well-ordering rincile. Kee b fixed and let a be the least non-negative counterexamle to the statement of the theorem. If 0 a b 1 then we can take q = 0 and r = a. So a b. Now let a 1 = a b. Then 0 a 1 < a. Hence a 1 = q 1 b + r 1 where q 1 and r 1 are integers and 0 r 1 b 1. Now just let q = q 1 + 1 and r = r 1, and so a = qb + r. The roof is comlete for a 0. What about for a < 0? 2. Ideals Definition. An ideal in Z is a subset I satisfying the following three roerties: (i) 0 I, (ii) if a, b I then a + b I, (iii) if a I and r Z then ra I. The rincial ideal of Z generated by a is the subset (a) = az = {ka k Z}. In other words, (a) is the set of multiles of a. It is very easy to check that every rincial ideal is an ideal 1. 1 If you have done Algebra II then you will know that the converse is not true in every ring, but is true for Z.

3. GREATEST COMMON DIVISORS 9 Proosition 1.3. Let I be an ideal in Z. Then I is rincial. Moreover, there is a unique non-negative integer a such that I = (a). Proof. Let I be an ideal of Z; we want to show that I is rincial. If I = {0} then I = (0) and we re finished, so suose I {0}. Then I must contain a non-zero element. From (iii) in the definition, we know that if a I then a I. Thus I must have a ositive element. Let a be the least ositive element of I. Again by (iii) we have that (a) I. We want to show that I = (a). Suose otherwise. Then there is some b I\(a). By Theorem 1.2 we can write b = qa+r where 0 r < a. If r = 0 then b (a) giving a contradiction. Hence 0 < r < a. Moreover r = b qa I using (iii) and (ii). This contradicts the fact that a is the smallest ositive element of I. Hence I = (a). Finally we want to show that a is the unique non-negative element satisfying I = (a). Suose I = (b) with b non-negative. Then a b and b a so a = ±b, and so a = b. 3. Greatest Common Divisors Theorem 1.4. Let a 1,..., a n be a finite set of elements of Z. 1. There exists a unique integer d satisfying (i) d divides a i for i = 1,..., n; (ii) if c divides a i for i = 1,..., n then c divides d; (iii) d 0. 2. The integer d can be exressed in the form d = u 1 a 1 + u 2 a 2 + + u n a n where u 1,..., u n Z. Definition. For a 1,..., a n Z we define their greatest common divisor (or GCD) to be the integer d satisfying roerties (i iii) of Theorem 1.4. Some books and lecturers call this the highest common factor. We shall denote the GCD of a 1,..., a n by gcd(a 1,..., a n ). Again some books and lecturers used the notation (a 1,..., a n ). Proof of Theorem 1.4. Let { n } I = x i a i : x 1,..., x n Z. i=1 In other words I is the set of all linear combinations of the a i with integer coefficients. It is very easy to see that I is an ideal (use the definition of ideal). By Proosition 1.3 we know that I = (d) for some unique non-negative integer d; in other words, every element of I is a multile of d and d is non-negative. We will rove that d satisfies the statement of Theorem 1.4. It certainly satisfies (iii) and moreover since

10 1. REVIEW it is an element of I and I is the set of integral linear combinations of the a i, it satisfies 2. Clearly a 1,..., a n I so the a i are multiles of d. This roves (i). Let us rove (ii). Suose c divides all the a i. Thus a i = k i c for integers k i for i = 1,..., n. Moreover as d I, with u i Z. So d = u 1 a 1 + + u n a n, d = (u 1 k 1 + + u n k n )c. Hence c d. This roves (ii) and comletes the roof of Theorem 1.4. 4. Euler s Lemma The fact that the gcd can exressed as a linear combination is used again and again. For examle, in the roof of the following crucial lemma. Lemma 1.5. (Euler s Lemma) If u vw and gcd(u, v) = 1 then u w. Proof. Since gcd(u, v) = 1 we can, using Theorem 1.4, write 1 = au + bv for some a, b Z. Multily by w to obtain w = auw + bvw. Now since u vw we can write vw = cu for some c Z, hence w = auw + bvw = (aw + bc)u, so u w as required. 5. The Euclidean Algorithm Lemma 1.6. If a = qb + r then gcd(a, b) = gcd(b, r). Proof. Note that for any integer c c a and c b c b and c r. Hence gcd(a, b) gcd(b, r) and gcd(b, r) gcd(a, b), and so gcd(a, b) = ± gcd(b, r). As both are non-negative, they must be equal. Lemma 1.6 is the basis for the Euclidean Algorithm for comuting the GCD, which you did in Foundations. Here is an examle.

6. PRIMES AND IRREDUCIBLES 11 Examle 5.1. To find the greatest common divisor of 1890 and 909 using the Euclidean Algorithm you would write 1890 = 2 909 + 72, therefore 909 = 12 72 + 45, 72 = 1 45 + 27, 45 = 1 27 + 18, 27 = 1 18 + 9, 18 = 2 9 + 0, gcd(1890, 909) = gcd(909, 72) = gcd(72, 45) = gcd(45, 27) = gcd(27, 18) = gcd(18, 9) = gcd(9, 0) = 9. You also know, or should know, how to use the above to exress the GCD, in this case 9, as a linear combination of 1890 and 909: 9 = 27 18 = 27 (45 27) = 45 + 2 27 = 45 + 2(72 45) = 2 72 3 45 = 2 72 3(909 12 72) = 3 909 + 38 72 = 3 909 + 38(1890 2 909) = 38 1890 79 909. 6. Primes and Irreducibles Definition. An integer > 1 is a rime if it satisfies the roerty: for all integers a, b, if ab then a or b. An integer > 1 is irreducible if its only factors are ±1 and ±. Of course, you will immediately say that rimes and irreducibles are the same thing, which is true but we have to rove it. If you think the roof should be trivial, ut these notes down and try it yourself. Theorem 1.7. (irreducibles and rimes are the same) > 1 is irreducible if and only if it is rime. Proof. Let > 1 be a rime. We want to show that is irreducible; i.e. that the only factors of are ±1 and ±. Suose a Z is a factor of. Then we can write = ab where b Z. Then ab. Since is a rime, by definition, we have a or b. Let s look at these ossibilities searately: (a) Suose first that a. Then a and a so a = ±. (b) Suose that b. Then b = c for some c Z. Hence = ab = ac, so ac = 1 and so a = ±1.

12 1. REVIEW In other words, the only factors of are ±1 and ±, so is irreducible. Now we have to do the converse direction. Let > 1 be irreducible. We want to show that is rime. So suose that ab and we want to show that a or b. Let d = gcd(a, ). Then d. As is irreducible, d = ±1 or d = ±, but GCDs are non-negative, so d = 1 or d =. If d = then a (as d = is the GCD of a and ). Suose d = 1; i.e. gcd(a, ) = 1. Using ab and Euler s Lemma (Lemma 1.5) we obtain that b. Hence either a or b, and so must be rime. From now on we will not mention the word irreducible again, as irreducibles are the same as rimes. But what is vital is to know that the two definitions are equivalent. A ositive integer m > 1 which is not a rime is called a comosite. Note that m > 1 is a comosite iff we can write m = ab with 1 < a, b < m. You ll have no trouble seeing why the following lemma is true. Lemma 1.8. If a 1... a n where is a rime then a i for some i = 1,..., n. Theorem 1.9. (The Fundamental Theorem of Arithmetic) Every ositive integer n can be written as a roduct of rime numbers, this factorisation into rimes is unique u to the order of the factors. Proof. Let us rove the existence of factorisation into rimes first and then the uniquenss. The roof is by induction. Note that n = 1 is regarded as the emty roduct of rimes. If n is a rime then there is nothing to rove. Suose that n > 1 is comosite. Then we can write n = ab with 1 < a, b < n. By the inductive hyothesis, a, b can be written as roducts of rimes and so n = ab is a roduct of rimes. This roves the existence. Now let us rove the uniqueness. Again we do this by induction. This is clear for n = 1. Suose n > 1 and uniquness is established for m < n. Suose n = 1 r = q 1 q s where the i and the q j are rimes. We want to show that r = s and the i and q j are the same u to ordering. Now r q 1 q s and so r q j for some j. By reordering the qs we may assume that r q s and so r = q s. Cancelling we obtain 1 r 1 = q 1 q s 1. By the inductive hyothesis, r 1 = s 1 and q 1,, q s 1 are a rearrangement of 1,, r 1. Hence r = s and q 1,, q s is a rearrangement of 1,, r.

8. ord 13 You should have no trouble remembering the following theorem or its roof from Foundations. Theorem 1.10. (Euclid) There are infinitely many rimes. Proof. Suose that there are finitely many and let them be 1,..., n. Let N = 1 2 n + 1. Then N 2 and so by the Fundamental Theorem of Arithmetic must have a rime divisor. This must be one of 1,..., n ; say it s i. Then i N and i 1 1 n. Hence i divides N 1 1 n = 1 giving a contradiction. This roof is a model for many other roofs. For examle, we ll show later that there are infinitely many rimes 1 (mod 4), 3 (mod 4), 1 (mod 3) etc. 7. Corimality Definition. We say that integers m 1, m 2,..., m n are corime if gcd(m 1, m 2,..., m n ) = 1. We say that integers m 1,..., m n are airwise corime if gcd(m i, m j ) = 1 whenever i j. Lemma 1.11. Let m 1,..., m n be airwise corime integers and suose m i x for all i. Then M x where M = m i. Proof. Let us rove it for n = 2. The general case then follows by induction. So m 1 x and m 2 x where gcd(m 1, m 2 ) = 1. We can write x = km 1 for some integer k. So m 2 km 1 and by Euler s Lemma (Lemma 1.5) we have that m 2 k. So k = cm 2 for some integer c. Hence x = km 1 = cm 1 m 2 = cm, which gives the desired M x. 8. ord Let be a rime, and let n be a non-zero integer. We define ord (n) by the roerty e = ord (n) if and only if e n and e+1 n. In a sense, ord (n) measures how divisible n is by owers of. We define ord (0) =. Examle 8.1. If n = 2 3 3 2 7, then ord 2 (n) = 3, ord 3 (n) = 2, ord 7 (n) = 1 and ord (n) = 0 for all rimes 2, 3, 7.

14 1. REVIEW We extend ord to a function Q Z { } by defining ( a ) ord = ord (a) ord (b) b for any non-zero integers a, b. Exercise 8.2. Check that ord is well-defined on Q. In other words, if a, b, c, d are integers and a/b = c/d then ord (a/b) = ord (c/d). Theorem 1.12. (Another formulation of the Fundamental Theorem of Arithmetic) Every non-zero rational number α can be exressed uniquely in the form α = ± P ord(α) where P is the set of all rimes. Note the following obvious corollary. Corollary 1.13. Let α, β be non-zero rationals. (i) α = ±β if and only if ord (α) = ord (β) for all rimes. (ii) α = ±1 if and only if ord (α) = 0 for all rimes. (iii) α is a square of some other rational if and only if ord (α) is even for all rimes. The following is the fundamental theorem about ord. Theorem 1.14. (Proerties of ord ) Let be a rime, and α, β rational numbers. Then, (1) ord (αβ) = ord (α) + ord (β). (2) ord (α+β) min{ord (α), ord (β)} with equality if ord (α) ord (β). Before roving Theorem 1.14 we need the following observation whose roof is an easy exercise. Lemma 1.15. Any non-zero rational α can be written as α = ord(α) a b where a, b are integers and a, b. Proof of Theorem 1.14. Part (1) is obvious from Lemma 1.15. Let s rove art (2). Write α = u a b, β = v c d

9. CONGRUENCES 15 where does not divide a, b, c, d. Here u = ord (α) and v = ord (β). Without loss of generality, we suose that u v. Then ( a α + β = u b + c ) v u = u ad + v u bc. d bd Note that bd. However, we don t know if the integer ad + v u bc is divisible by, so let s write ad + v u bc = w e, where e and w 0, and write f = bd. Hence and so α + β = u+w e f ord (α + β) = u + w u = min(u, v) = min(ord (α), ord (β)). To comlete the roof, suose that ord (α) ord (β), or in other words, u v. Since we are assuming u v we have u < v and so v u > 0. Now if (ad + v u bc) then ad which contradicts a, d. Hence (ad + v u bc) which says that w = 0. We obtain the desired equality ord (α + β) = u + w = u = min(u, v) = min(ord (α), ord (β)). 9. Congruences We are still revising the material you have met in the first year Foundations module. Definition. Let a, b and m be integers with m ositive. We say a is congruent to b modulo m and write a b (mod m) if and only if m (a b). Lemma 1.16. Congruence modulo a fixed ositive integer m is an equivalence relation: Reflexive: a a (mod m) for all integers a; Symmetric: if a b (mod m) then b a (mod m); Transitive: if a b (mod m) and b c (mod m) then a c (mod m). The equivalence classes are reresented by 0, 1,..., m 1. In other words, every integer is congruent to recisely one of 0, 1,..., m 1 modulo m. Lemma 1.17. (a) If a b (mod m) and c d (mod m) then a + c b + d (mod m) and ac bd (mod m). (b) If a b (mod m) and d m then a b (mod d).

16 1. REVIEW (c) If a b (mod m) then na nb (mod nm). (d) If ac bc (mod m) then a b (mod m ) where m = In articular, if gcd(c, m) = 1 and ac bc (mod m) then a b (mod m). m. gcd(c,m) Proof. Parts (a), (b), (c) are easy consequences of the definition and the roerties of divisibility. Let us rove (d), so suose ac bc (mod m). Suose first that gcd(c, m) = 1 which is easier. Then m c(a b) and so by Euler s Lemma (Lemma 1.5), m (a b) which gives a b (mod m). Now let s do the general case. Let d = gcd(c, m) and let c = c/d and m = m/d. Observe that gcd(c, m ) = 1. From ac bc (mod m), we know that m (ac bc) which means (a b)c = km for some integer k. Dividing both sides by d we obtain (a b)c = km and so m (a b)c. As gcd(c, m ) = 1, Euler s Lemma tells us that m (a b). Hence a b (mod m ) as required. Examle 9.1. You should be very careful with cancellation where congruences are involved. For examle, 100 60 (mod 8), but 10 6 (mod 8). However, using art (d) of the above lemma to cancel the factor of 10, we get 10 6 (mod 8/ gcd(8, 10)) which means 10 6 (mod 4) and this is true. 9.1. Inverses modulo m. Lemma 1.18. Suose that a, m are integers with m 1. Then there exists an integer b such that ab 1 (mod m) if and only if gcd(a, m) = 1. Proof. Suose gcd(a, m) = 1. We know from Euclid s algorithm that there are integers b, c such that ab + cm = 1. Reducing modulo m we obtain ab 1 (mod m) as required. To rove the converse, suose ab 1 (mod m). Thus ab 1 = km for some integer k. Write g = gcd(a, m). Now g a and g m, so g ab and g km. Hence g (ab km) = 1. Thus gcd(a, m) = g = 1 comleting the roof. You should ay secial attention to the above roof as it gives us a ractical way of inverting elements modulo m; see the following examle.

9. CONGRUENCES 17 Examle 9.2. Let us find the inverse of 502 modulo 2001. One way of doing this is to try all the numbers b = 0, 1,, 2000 and see which one satisfies 502b 1 (mod 2001). Using Euclid s algorithm is much faster! 2001 = 3 502 + 495, 502 = 1 495 + 7, 495 = 70 7 + 5, 7 = 1 5 + 2, 5 = 2 2 + 1. Therefore gcd(502, 2001) = 1. Moreover, 1 = 5 2 2 = 5 2(7 5) = 2 7 + 3 5 = 2 7 + 3(495 70 7) = 3 495 212 7 = 3 495 212(502 495) = 212 502 + 215 495 = 212 502 + 215(2001 3 502) = 215 2001 857 502. Reducing 215 2001 857 502 = 1 modulo 2001 we obtain 857 502 1 (mod 2001), so the inverse of 502 is 857 2001 857 1144 (mod 2001). 9.2. Comlete Residue Systems. A comlete residue system modulo m is a set of m integers {a 1, a 2,..., a m } such that a i a j (mod m) whenever i j. Examle 9.3. The set {0, 1, 2, 4} isn t a comlete residue system modulo 5, since it has too few elements. The set {0, 1, 2, 3, 6} also isn t a comlete residue system since 6 1 (mod 5). However, {0, 1, 2, 3, 4} is a comlete residue system modulo 5 and so is {2, 3, 4, 5, 6} and so is {0, 6, 3, 13, 24}. Lemma 1.19. (a) Let {a 1,..., a m } be a comlete residue system modulo m, then every integer is congruent to recisely one a i modulo m. (b) Let {a 1,..., a m } and {b 1,..., b m } be comlete residue systems modulo m. Then, after reordering the b i if necessary, a i b i (mod m) for all i. Proof. Let c i be the unique integer in {0, 1,..., m 1} satisfying c i a i (mod m). Since a i a j (mod m) whenever i j, we have c i c j (mod m) and so c i c j. Hence c 1, c 2,..., c m are m distinct elements of the set {0, 1,..., m 1}, which itself has recisely m distinct

18 1. REVIEW elements. Hence c 1, c 2,..., c m is a rearrangment of {0, 1,..., m 1}. This quickly roves arts (a) and (b). 9.3. Reduced Residue Systems. Definition. We define Euler s ϕ-function as follows. Let m 1. Let ϕ(m) be the number of integers a in the set {0, 1,..., m 1} satisfying gcd(a, m) = 1. If you like symbols, ϕ(m) = #{a 0 a m 1 and gcd(a, m) = 1}. Examle 9.4. You ll have no trouble seeing, for examle, that ϕ(5) = 4 and ϕ(24) = 8. Definition. A reduced residue system modulo m is a set {a 1, a 2,..., a ϕ(m) } of ϕ(m) elements such that gcd(a i, m) = 1 for all i and a i a j (mod m) whenever i j. Examle 9.5. {1, 3, 5, 7} is a reduced residue system modulo 8, and so is {7, 5, 9, 5}. However {2, 3, 5, 7} isn t, nor is {1, 3, 5} nor is {1, 3, 5, 13}. There are no rizes for guessing what comes next. Lemma 1.20. (a) Let {a 1,..., a ϕ(m) } be a reduced residue system modulo m, then every integer a satisfying gcd(a, m) = 1 is congruent to recisely one a i modulo m. (b) Let {a 1,..., a ϕ(m) } and {b 1,..., b ϕ(m) } be reduced residue systems modulo m. Then, after reordering the b i if necessary, a i b i (mod m) for all i. The roof is left as an exercise. You have to follow the same stes as in the roof of Lemma 1.19, but you ll need the following lemma, whose roof is also an exercise. Lemma 1.21. If a b (mod m) then gcd(a, m) = gcd(b, m). Lemma 1.22. If {a 1,..., a ϕ(m) } is a reduced residue system modulo m, and gcd(c, m) = 1 then {ca 1, ca 2,..., ca ϕ(m) } is also a reduced residue system modulo m. Proof. Note that the set {ca 1, ca 2,..., ca ϕ(m) } has recisely ϕ(m) elements and that all are corime to m. Suose i j. We want to show that ca i ca j (mod m), so suose that ca i ca j (mod m). Since gcd(c, m) = 1 we obtain that a i a j (mod m) by art (d) of Lemma 1.17; this contradicts the fact that {a 1,..., a ϕ(m) } is a reduced residue system modulo m. 9.4. The Theorems of Fermat and Euler.

10. THE CHINESE REMAINDER THEOREM 19 Theorem 1.23. (Euler s Theorem) If gcd(c, m) = 1 then c ϕ(m) 1 (mod m). Proof. Suose first that {a 1,..., a ϕ(m) } and {b 1,..., b ϕ(m) } are reduced residue systems modulo m. By art (b) of Lemma 1.20 we have ϕ(m) i=1 a i ϕ(m) i=1 b i (mod m). Now let {a 1,..., a ϕ(m) } be any reduced residue system and observe that {ca 1, ca 2,..., ca ϕ(m) } is also a reduced residue system by Lemma 1.22. Hence ϕ(m) i=1 a i ϕ(m) i=1 ca i (mod m). We may rewrite this as A c ϕ(m) A (mod m) where A = a i. Clearly gcd(a, m) = 1, and by art (d) of Lemma 1.17 we obtain c ϕ(m) 1 (mod m). Corollary 1.24. (Fermat s Little Theorem) (i) If is a rime and a then a 1 1 (mod ). (ii) If is a rime and a is any integer then a a (mod ). Proof. Let be a rime. Note that the only integer in the set {0, 1,..., 1} that is not corime with is 0. Hence, by definition of ϕ, we have ϕ() = 1. Now (i) follows from Euler s Theorem. Let us rove (ii). If a then (ii) follows from (i) on multilying both sides by a. If a then (ii) is obvious since both sides are congruent to 0 modulo. 10. The Chinese Remainder Theorem Theorem 1.25. (The Chinese Remainder Theorem) Let a 1,..., a n and m 1,..., m n be integers with m i ositive and gcd(m i, m j ) = 1 whenever i j. Write M = m i. Then there exists a unique integer x such that x a i (mod m i ) for i = 1, 2,..., n and 0 x M 1. Moreover, if x also satisfies x a i (mod m i ) then x x (mod M). For the roof we need a the following lemma.

20 1. REVIEW Lemma 1.26. With notation as in the Chinese Remainder Theorem, there exists integers u 1, u 2,..., u n such that { 1 (mod m i ) (1) u i 0 (mod m j ) whenever j i. Proof. Let us rove this for u 1. Put M 1 = j 1 m j. Then gcd(m 1, M 1 ) = 1 and by Euclid s Algorithm there are integers r 1 and s 1 such that r 1 m 1 + s 1 M 1 = 1. Let u 1 = s 1 M 1. Clearly u 1 satisfies (1). Now the roof of the Chinese Remainder Theorem is easy. Proof of the Chinese Remainder Theorem. Let the u i be as in Lemma 1.26. Write y = a 1 u 1 + a 2 u 2 + + a n u n. From (1) we see that y a i (mod m i ). Now let x satisfy 0 x M 1 and x y (mod M). Clearly x y (mod m i ) for all i and so x a i (mod m i ) for all i. The uniqueness of x follows from the second art of the Chinese Remainder Theorem that we re about to rove. Suose also that x a i (mod m i ) for all i. Then m i (x x) for all i. By Lemma 1.11, as the m i are corime, M (x x) where M = m i. You should ay articular attention to the roof of the Chinese Remainder Theorem. It s constructive; this means that it gives us a ractical method of solving a system of simultaneous congruences. Once again it is the Euclidean Algorithm that does the work, and so you must make sure that you know how to use it to exress the gcd as a linear combination. See the following examle. Examle 10.1. Solve the simultaneous congruences x 3 (mod 4), x 5 (mod 7). Answer: Using Euclid s Algorithm you will see that 2 4 1 7 = 1. Let u 1 = 1 7 = 7 and u 2 = 2 4 = 8. Note that { { 1 (mod 4), 0 (mod 4), u 1 u 2 0 (mod 7), 1 (mod 7). Now let y = 3 u 1 + 5 u 2 = 21 + 40 = 19. Then the solutions to the simultaneous congruences are recisely those values of x such that x 19 (mod 28).

CHAPTER 2 Multilicative Structure Modulo m 1. Euler s ϕ Revisited With the hel of the Chinese Remainder Theorem we will derive a convenient formula for ϕ. For this we have to revisit reduced residue systems. Lemma 2.1. If gcd(m 1, m 2 ) = 1 then ϕ(m 1 m 2 ) = ϕ(m 1 )ϕ(m 2 ). Proof. For a ositive integer m define U(m) = {a 0 a m 1 and gcd(a, m) = 1}. Note that ϕ(m) = #U(m). Now let m 1, m 2 be corime and write M = m 1 m 2. We will shortly define a bijection f : U(m 1 ) U(m 2 ) U(M). You know if two finite sets are related by a bijection then they have the same number of elements. Assuming the existence of the bijection f we obtain ϕ(m 1 m 2 ) = ϕ(m) = #U(M) = # (U(m 1 ) U(m 2 )) = #U(m 1 ) #U(m 2 ) = ϕ(m 1 )ϕ(m 2 ). So to comlete the roof all we have to do is to define f and show that it s a bijection. Now let a i U(m i ) for i = 1, 2. Let f(a 1, a 2 ) be the unique x satisfying 0 x M 1 and x a i (mod m i ) whose existence is guaranteed by the Chinese Remainder Theorem. For the ma f to be well-defined, we have to show that gcd(x, M) = 1. However, gcd(x, m i ) = gcd(a i, m i ) = 1 and as M = m 1 m 2 we obtain that gcd(x, M) = 1 as required. Thus f(a 1, a 2 ) = x is in U(M). Now let us show that f is 1 1. Suose that x = f(a 1, a 2 ) = f(b 1, b 2 ). Then x a i (mod m i ) and x b i (mod m i ) and so a i b i (mod m i ). As 0 a i, b i m i 1, we have a i = b i for i = 1, 2, so that f is 1 1. Finally let us show that f is onto. Let c U(M). Let a i be the unique integer satisfying 0 a i m i 1 and c a i (mod m i ). Then gcd(a i, m i ) = gcd(c, m i ) and this divides gcd(c, M) = 1. Hence gcd(a i, m i ) = 1 so a i U(m i ). Now f(a 1, a 2 ) = x is the unique integer 21

22 2. MULTIPLICATIVE STRUCTURE MODULO m satisfying x a i (mod m i ) and 0 x m i 1. But c satisfies these roerties, so c = x = f(a 1, a 2 ). This shows that f is onto, and so is a bijection. Theorem 2.2. Let m 2 be an integer and let n m = be its factorisation into rime owers with r i 1. Then n ϕ(m) = r i 1 i ( i 1). i=1 i=1 Proof. We will rove that if is a rime and r 1 then ϕ( r ) = r 1 ( 1). The theorem follows from this and Lemma 2.1. By definition, ϕ( r ) is the number of integers m in the interval 0 m r 1 that are corime with r ; in otherwords not divisible by. There are r integers in the interval, and the ones divisible by are 0,, 2, 3,..., ( r 1 1). Clearly there are r 1 integers in the interval that are divisible by, so ϕ( r ) = r r 1 = r 1 ( 1) as required. r i i 2. Orders Modulo m Definition. Let gcd(a, m) = 1. We define the order of a modulo m to be the least ositive integer d such that a d 1 (mod m). Lemma 2.3. Suose a u a v 1 (mod m). and let w = gcd(u, v). Then a w 1 (mod m). Proof. By Euclid s Algorithm, there are r, s such that w = ru + sv. So that a w = (a u ) r (a v ) s 1 (mod m). Theorem 2.4. Let gcd(a, m) = 1, and let d be the order of a modulo m. (i) If a e 1 (mod m) then d e. (ii) d ϕ(m). In articular, if m = is rime then d ( 1).

3. PRIMITIVE ROOTS 23 Proof. Let d be the order of a modulo m. Then a d 1 (mod m) by definition of order. Suose that a e 1 (mod m). By Lemma 2.3, a d 1 (mod m) where d = gcd(d, e). Note that d d and so d d. But by definition of order, d is the least ositive integer satisfying a d 1 (mod m). Hence d d and so d = d. As d e we have d e. This roves (i). Part (ii) follows from (i) and Euler s Theorem. Lemma 2.5. Let gcd(g i, m) = 1 for i = 1, 2 and suose that g i has order d i modulo m. Suose that gcd(d 1, d 2 ) = 1. Then g 1 g 2 has order d 1 d 2 modulo m. Proof. Let d be the order of g = g 1 g 2 modulo m. Note that g d 1d 2 = (g d 1 1 ) d 2 (g d 2 2 ) d 1 1 (mod m). Hence by Theorem 2.4, d d 1 d 2. From g d 1 (mod m) we obtain g d 1g d 2 1 (mod m) and raising both sides to d 2 we have that g dd 2 1 (g d 2 2 ) d 1 (mod m). But g d 2 2 1 (mod m), so g dd 2 1 1 (mod m). By Theorem 2.4, d 1 dd 2. Since gcd(d 1, d 2 ) = 1, Euler s Lemma tells us that d 1 d. Likewise d 2 d. So d 1 d 2 d. As we ve already observed that d d 1 d 2 we obtain that d = d 1 d 2. 3. Primitive Roots Lemma 2.6. Let be a rime and X an indeterminate. Then X 1 1 (X 1)(X 2) (X ( 1)) (mod ). Proof. By Fermat s Little Theorem, a 1 1 (mod ) for a = 1, 2,..., 1. So X 1 1 must have a = 1, 2,, 1 as roots modulo. Thus, modulo, the olynomial (X 1)(X 2) (X ( 1)) is a factor of X 1 1. But both are monic of degree 1, so they must be the same modulo. Lemma 2.7. Let be a rime. If n ( 1) then x n 1 (mod ) has exactly n incongruent solutions modulo. Proof. Let 1 = nd. Recall the factorization X 1 1 = X nd 1 = (X n 1)(X n(d 1) + X n(d 2) + + 1).

24 2. MULTIPLICATIVE STRUCTURE MODULO m By Lemma 2.6, X 1 1 factors comletely modulo and has distinct roots. Since X n 1 is a factor of X 1 1, it must also factor comletely and have distinct roots modulo. This roves the lemma. Definition. A rimitive root modulo is a number g such that g and g has order 1. Theorem 2.8. If g is a rimitive root modulo then 1, g, g 2,..., g 2 is a reduced residue system modulo. In articular, for every integer a 0 (mod ), there is a unique 0 r 2 such that a g r (mod ). Proof. The second art follows from the first and the definition of a reduced residue system. Let us rove the first art. Note that every element of 1, g, g 2,..., g 2 is corime to and the set has 1 = ϕ() elements. All we have to do is to show that no two elements of this set are congruent modulo. Now suose g r g s (mod ) where 0 r s 2. Then g s r 1 (mod ). By definition of rimitive root, g has order 1 and so ( 1) (s r). This is imossible unless s = r. Theorem 2.9. If is rime, there exists a rimitive root modulo. Proof. Want to find an integer g such that g and has order 1 modulo. Let the rime-ower factorization of 1 be By Lemma 2.7, x qe i i x qe i 1 i 1 = q e 1 1 q e 2 2... q er r. 1 (mod ) has q e i i incongruent solutions modulo, and 1 (mod ) has q e i 1 i incongruent solutions modulo. So there must be some integer g i with g qe i i i 1 (mod ), g qei 1 i i 1 (mod ). Thus g i has exact order q e i i modulo. Let g = g 1 g 2... g r. By Lemma 2.5, g has order 1 modulo, and so g is a rimitive root. Here is a ast exam question. Examle 3.1. Find a rimitive root for 149. You may use the following observations: 149 = 2 2 37+1, 5 37 44 4 1 (mod 149), 44 2 1 (mod 149). Answer. The order of 5 modulo 149 divides 37. But the only ositive divisors of 37 are 1 and 37. Moreover, 5 1 1 (mod 149), so 5 has order 37 modulo 149.

3. PRIMITIVE ROOTS 25 The order of 44 modulo 149 divides 4 and so is 1, 2 or 4. But 44 1 1 (mod 149), and 44 2 = 1936 148 1 (mod 149). Hence the order of 44 is 4. Now we use Lemma 2.5. Since gcd(37, 4) = 1, we find that the order of 20 = 5 4 modulo 149 is 37 4 = 149 1. Hence 20 is a rimitive root modulo 149.

CHAPTER 3 Quadratic Recirocity 1. Quadratic Residues and Non-Residues Definition. Let gcd(a, m) = 1. We say that a is a quadratic residue modulo m if the congruence x 2 a (mod m) has a solution. Otherwise we say that a is a quadratic non-residue. Examle 1.1. Note that 1 2 6 2 1, 2 2 5 2 4, 3 2 4 2 2 (mod 7). Hence the quadratic residues modulo 7 are 1, 2 and 4. The quadratic non-residues modulo 7 are 3, 5 and 6. Definition. Let be an odd rime. Let ( ) a 1 if a is a quadratic residue modulo = 1 if a is a quadratic non-residue modulo 0 if a. ( ) a The symbol is called a Legendre symbol. The Legendre symbol is extremely convenient for discussing quadratic residues. Examle 1.2. From Examle 1.1 we have ( ) ( ) ( ) ( ) 0 1 2 4 = 0, = = = 1, 7 7 7 7 and ( ) ( ) ( ) 3 5 6 = = = 1. 7 7 7 We will focus on quadratic residues modulo rimes and return to quadratic residues modulo arbitrary ositive integers later. 2. Quadratic Residues and Primitive Roots Lemma 3.1. Let be an odd rime and let g be a rimitive root modulo. 27

28 3. QUADRATIC RECIPROCITY The quadratic residues modulo are of the form g r where 0 r 2 and r is even. The quadratic non-residues are of the form g r where 0 r 2 and r is odd. In articular, exactly half the non-zero residues are quadratic residues modulo and the other half are quadratic non-residues. Proof. Let g be a rimitive root modulo. Modulo, the integers 1 a 1 are a rearrangement of the integers 1, g,..., g 2, since both lists are reduced residue systems. Note that g r is certainly a quadratic residue modulo for all even integers r. Let us rove the converse. Suose that g r x 2 (mod ). Then we can write x g s (mod ) for some 0 s 2. Thus g r 2s 1 (mod ). As g is a rimitive root, 1 divides r 2s. But 1 is even so r 2s is even and so r is even. Thus we know that g r is a quadratic residue modulo if and only if r is even. Hence the quadratic residues modulo are 1, g 2, g 4,..., g 3 and the quadratic non-residues are g, g 3, g 5,..., g 2. This roves the lemma. Before we start roving roerties of the Legendre symbol, we need another imortant fact about rimitive roots. Lemma 3.2. Let be an odd rime and g a rimitive root modulo. Then g ( 1)/2 1 (mod ). Proof. Let h = g ( 1)/2. Then h 2 = g 1 1 (mod ). So (h 2 1) = (h + 1)(h 1). Hence h ±1 (mod ). If h 1 (mod ) then g ( 1)/2 1 (mod ) contradicting the fact that the order of g (a rimitive root) is exactly 1. Hence h 1 (mod ) which is what we want. 3. First Proerties of the Legendre Symbol Proosition 3.3. Let be an odd rime, and a, b integers. ( ) ( ) a b (i) If a b (mod ) then =. ( ) a (ii) (Euler s Criterion) a ( 1)/2 (mod ). ( ) ( ) ( ) ab a b (iii) For integers a, b we have =.

4. THE LAW OF QUADRATIC RECIPROCITY 29 Proof. (i) follows straightaway from the definition, and (iii) follows from (ii). Let s rove (ii). Let a be an integer. If a then ( ) a = 0 a ( 1)/2 (mod ). Hence suose that a. Let g be a rimitive root modulo. We know from Lemma 3.1 that a g r (mod ) for some 0 r 2 and that r is even if and only if a is a quadratic residue. Hence a ( 1)/2 ( g ( 1)/2) r ( 1) r (mod ) by Lemma 3.2. This roves (ii). 4. The Law of Quadratic Recirocity The main theorem on quadratic recirocity is the Law of Quadratic Recirocity. Theorem 3.4. Let and q be distinct odd rimes. Then ( ) ( ) q (a) (Law of Quadratic Recirocity) = ( 1) ( 1) (q 1) 2 2. q (b) (First Sulement to the Law of Quadratic Recirocity) ( ) { 1 1 if 1 (mod 4) = 1 if 3 (mod 4). (c) (Second Sulement to the Law of Quadratic Recirocity) = ( ) { 2 1 if 1, 7 (mod 8) 1 if 3, 5 (mod 8). Remark. Note that we can rehrase the Law of Quadratic Recirocity as follows: ( ( q q ) ( ) q = ) ( ) = q if q 3 (mod 4) if 1 or q 1 (mod 4) Examle 4.1. Is 94 a square modulo 257? One way to decide this is to run through the integers x = 0, 1,..., 256 and see if 94 x 2 (mod 257). It is much quicker to use Proosition 3.3 and the Law of

30 3. QUADRATIC RECIPROCITY Quadratic Recirocity. ( ) ( ) ( ) 94 2 47 = by Proosition 3.3 257 257 257 ( ) 47 = using the second sulement 257 ( ) 257 = since 257 1 (mod 4) 47 ( ) 22 = 257 22 (mod 47) 47 ( ) ( ) 2 11 = 47 47 ( ) 11 = 47 ( ) 47 = 11 47 3 (mod 4) 11 ( ) 3 = 11 ( ) 11 = 3 11 3 (mod 4) 3 ( ) 2 = 11 2 (mod 3) 3 = 1 using the second sulement. Hence 94 is not a square modulo 47. Actually the roof of the first sulement is straightforward. Proof of the First Sulement. By Euler s Criterion (Proosition 3.3), ( ) 1 ( 1) 1 2 (mod ). ( ) 1 Thus = 1 if and only if ( 1)/2 is even. This is the case if and only if 1 (mod 4). To rove the Law of Quadratic Recirocity we need Gauss Lemma.

4. THE LAW OF QUADRATIC RECIPROCITY 31 Theorem 3.5. (Gauss Lemma) Let be an odd rime and write { S = 1, 2,..., 1 }. 2 For integer n let n be the unique integer satisfying n n (mod ) and /2 < n < /2. Let a and let âs = {âs : s S}. Define µ(a) to be the number of negative members of the set âs. Then ( ) a = ( 1) µ(a). Examle 4.2. Let us determine ( 3 11) using Gauss Lemma. Note that and S = {1, 2, 3, 4, 5} 3S = { 3, 6, 9, 12, 15} = {3, 5, 2, 1, 4}. Thus µ(3) = 2 and so ( 3 11) = 1. Proof of Gauss Lemma. We will show that ( 1) µ(a) a ( 1)/2 1 (mod ). Gauss Lemma will then follow from Euler s Criterion. By definition, µ(a) is the number of negative elements in âs. Let âs = { âs : s S}. We claim that âs = S. Let s assume this for the moment and use it to comlete the roof. We will return to rove the claim later on. Now s = as S = âs s S t âs t = s S âs by definition of âs = ( 1) µ(a) s S âs âs = âs for recisely µ(a) values of s S ( 1) µ(a) s S as since as âs (mod ) ( 1) µ(a) a ( 1)/2 s S s (mod ) since #S = ( 1)/2. Cancelling s S s we obtain the desired conclusion that ( 1)µ(a) a ( 1)/2 1 (mod ).

32 3. QUADRATIC RECIPROCITY It remains to rove our claim that âs = S. Suose s S. Then /2 < âs < /2 so 0 âs < /2. But âs 0 since a and s. Hence âs S. This shows that âs S. To show that the two sets are equal, we must show that the have the same number of elements. Suose that s, t S satisfy âs = ât. Then as ±at (mod ) and so s ±t (mod ). But /2 < s, ±t < /2, so their difference can t be divisible by unless it is 0. Thus s = ±t. But s, t S so s = t. This shows that âs has as many elements as S, comleting the roof. Gauss Lemma enables us to rove the second sulement to the Law of Quadratic Recirocity. Proof of the Second Sulement. We want to show that ( ) { 2 1 if 1, 7 (mod 8) = 1 if 3, 5 (mod 8). Consider the case 1 (mod 8); the other cases are similar and are left as an exercise. Then = 8m + 1 for some integer ( m. ) Here ( 1)/2 = 4m. We will aly Gauss Lemma to determine. For this we need to comute 2x where x = 1, 2,..., 4m. Now for x = 1, 2,..., 2m we have 0 < 2x < /2 and so 2x = 2x which is ositive. However, for x = 2m + 1, 2m + 2,..., 4m we have /2 < 2x < and 2x = 2x which is negative. Hence µ(2) = 2m, so by Gauss Lemma ( ) 2 = 1. Proof of the Law of Quadratic Recirocity. The original roof is due to Gauss. Gauss altogether gave eight different roofs of LQR, and there are hundreds of ublished roofs. The roof we give is due to Eisenstein. It starts with the following trigonometric identity which everyone knows. Let m be an odd ositive integer and let Then (2) sin mx sin x S m = { 1, 2, 3,..., m 1 2 = ( 4)(m 1)/2 t S m }. 2 ( sin 2 x sin 2 2πt ). m Observe that if u v (mod ) then 2πu/ and 2πv/ differ by a multile of 2π and so sin(2πu/) = sin(2πv/). Let sgn(u) denote the

4. THE LAW OF QUADRATIC RECIPROCITY 33 sign of u so that u = sgn(u) u. Then sin(2πu/) = sgn(u) sin(2π u /). Now for s S, qs qs sgn( qs) qs (mod ). Thus sin 2πqs 2π qs = sgn( qs) sin. In the notation of Gauss Lemma, exactly µ(q) of the qs are negative. Hence ( ) q = sgn( qs). s S From the last two equations, sin 2πqs s S = ( ) q sin s S 2π qs. However, from the roof of Gauss s Lemma, { qs : s S } = qs = S. Hence sin 2πqs ( ) q = sin 2πs, s S s S which can be rewritten as ( ) q = s S sin(2πqs/) sin(2πs/). Using the identity (2) with m = q and x = 2πs/ we obtain ( ) q = ( 4) ( (q 1)/2 sin 2 (2πs/) sin 2 (2πt/q) ) s S t S q ( = ( 4) ( 1)(q 1)/4 sin 2 (2πs/) sin 2 (2πt/q) ), s S,t S q as S has ( 1)/2 members. Now interchanging and q we have ( ) ( = ( 4) (q 1)( 1)/4 sin 2 (2πt/q) sin 2 (2πs/) ). q s S,t S q The right-hand sides of the last two equations are identical excet for a minus sign for each term in the roduct. But there are (#S )(#S q ) = ( 1) (q 1) terms in the roduct. Thus 2 2 ( q ) ( q ) = ( 1) ( 1) 2 (q 1) 2,

34 3. QUADRATIC RECIPROCITY comleting the roof. 5. The Sheer Pleasure of Quadratic Recirocity Did you enjoy the roof of the Law of Quadratic Recirocity? Or did the flicker of light at the end of the long, dark tunnel not seem worth it? If you re having doubts reare to disel them: we re going to exhilarate ourselves with several alications of LQR. 5.1. Mersenne Numbers. You have met the Mersenne numbers M n = 2 n 1 in the homework, and know that if n is comosite then so is M n. What if n = q is rime; is M q necessarily rime? Comuting the first few we find M 2 = 3, M 3 = 7, M 5 = 31, M 7 = 127, which are all rime numbers. Now M 11 = 2047 which is already not entirely trivial to factor by hand. The following theorem gives us a large suly of Mersenne numbers M q where q is rime but M q is comosite. Theorem 3.6. Let q 3 (mod 4) be a rime such that = 2q + 1 is also rime. Then divides M q. In articular, for q > 3, M q is comosite. Before roving Theorem 3.6 let us aly it with q = 11. Note that q 3 (mod 4) and = 2q + 1 = 23 is rime. Then according to the Theorem 3.6, divides M q and indeed we find that M 11 = 2047 = 23 89. You can use the same argument to find a factor of M q for q = 11, 23, 83, 131, 179, 191, 239, 251, 359, 419, 431, 443, 491, 659,... Proof of Theorem 3.6. Since q 3 (mod 4), we have that = 2q + 1 7 (mod 8). Hence ( ) 2 = 1. But by Euler s Criterion 2 q = 2 1 2 ( ) 2 = 1 (mod ). Hence M q = 2 q 1 is divisible by. To rove the last statement in Theorem 3.6, observe that M q is comosite if M q >. This is the same as 2 q 1 > 2q + 1 which is satisfied if q > 3.

5. THE SHEER PLEASURE OF QUADRATIC RECIPROCITY 35 5.2. A Diohantine Equation. A Diohantine equation is one where we are interested in integer solutions. It can be very hard to determine all the solutions of a Diohantine equations (e.g. Fermat s Last Theorem). However, quadratic recirocity can sometimes be used to show that there are no solutions. Here is an examle. Theorem 3.7. The equation has no solutions with x, y Z. y 2 = x 3 5 Proof. We roceed by contradiction. Suose that x, y Z satisfy y 2 = x 3 5. If x is even then y 2 5 3 (mod 8) which is imossible as the squares modulo 8 are 0, 1 and 4. Thus x is odd. Now rewrite the equation as y 2 + 4 = x 3 1 = (x 1)(x 2 + x + 1). Note that x 2 + x + 1 = odd + odd + odd and so is odd. Moreover x 2 + x + 1 is ositive (e.g. by comleting the square). Let be a rime divisor of x 2 + x + 1. Then (y 2 + 4) and so y 2 4 (mod ). Hence ( ) 1 = 1. Thus 1 (mod 4). As this is true of all rime divisors of x 2 + x + 1 we have x 2 + x + 1 1 (mod 4). If x 1 (mod 4) then x 2 + x + 1 3 (mod 4) giving a contradiction. Hence x 3 (mod 4). Hence y 2 x 3 5 3 5 2 (mod 4), which is imossible.

CHAPTER 4 -adic Numbers 1. Congruences Modulo m In quadratic recirocity we studied congruences of the form x 2 a (mod ). We now turn our attention to situations where is relaced by a ower of. We shall need the following lemma whose roof is an easy exercise, but try out a few examles first to convince yourself that it is true. Lemma 4.1. Let f(x) Z[X] and let n > 0 be an integer. Then f (n) (X)/n! has integer coefficients. Next is Hensel s Lemma which is the main result of this section. Theorem 4.2. (Hensel s Lemma) Let f(x) Z[X]. rime and m 1. Suose a Z satisfies f(a) 0 (mod m ), f (a) 0 (mod ). Then there exists some b Z such that (3) b a (mod m ), f(b) 0 (mod m+1 ). We say that we lift a to a solution modulo m+1. Proof of Hensel s Lemma. By Taylor s Theorem Let be a f(a + x) = f(a) + f (a)x + f (2) (a) x 2 + + f (n) (a) x n 2! n! where n is the degree of f (note that all higher derivatives vanish). We want b to satisfy two conditions, one of them that b a (mod m ). Let us write b = a + m y where the integer y will be determined later. Then f(b) = f(a) + m f (a)y + 2m (integer). Since f(a) 0 (mod m ) we have f(a) = m c where c is an integer. Thus f(b) = m (c + f (a)y) + 2m (integer). Note that m+1 2m. To make f(b) 0 (mod m+1 ) it is enough to choose y so that (c + f (a)y). In otherwords, we want y so that f (a)y c (mod ). But f (a) 0 (mod ) and so is invertible 37

38 4. -ADIC NUMBERS modulo. Let h satisfy hf (a) 1 (mod ). Then we choose y = hc and take b = a hc m and then both congruences in (3) are satisfied. The roof of Hensel s Lemma is constructive; this means that it can be used to solve congruences modulo rime owers. You need to ractice Hensel s Lemma a few times to get the hang of it. The following examle will hel show you how. Examle 1.1. Solve the congruence x 2 2 (mod 7 3 ). Answer: It is easy to solve x 2 2 (mod 7) by trying all the values modulo 7. We get that x 3, 4 (mod 7). Note that obviously if u is a solution then u is also a solution. Next we solve x 2 2 (mod 7 2 ). Note that any solution must also satisfy x 2 2 (mod 7) and so x 3, 4 (mod 7). Suose first that x 3 (mod 7). Then x = 3 + 7y where y is an integer. Substituting in x 2 2 (mod 7 2 ) we obtain or equivalently 9 + 42y + 49y 2 2 (mod 7 2 ) 7(1 + 6y) 0 (mod 7 2 ) or equivalently 1 + 6y 0 (mod 7), so y 1 (mod 7), so we obtain that x = 3 + 7y 3 + 7 = 10 (mod 7 2 ). Similarly, if x 4 (mod 7) then x 39 (mod 49) (which is the same as 10 modulo 49). Now let us solve x 2 2 (mod 7 3 ). Then x 10, 39 (mod 7 2 ). Suose first x 10 (mod 7 2 ). Then x = 10 + 7 2 z for some integer z. Hence 100 + 2 10 7 2 z + 7 4 z 2 2 (mod 7 3 ). Note 100 2 = 98 = 2 7 2. Thus 7 2 2(1 + 10z) 0 (mod 7 3 ). This is equivalent to 1 + 10z 0 (mod 7) which gives z 2 (mod 7). Hence x = 10 + 7 2 z = 108 (mod 7 3 ). Similarly starting from x 39 (mod 7 2 ) would give x 235 (mod 7 3 ). In the above examle, we note that to obtain a solution modulo 7 2 we had to add 7y = 1 7 and to obtain a solution modulo 7 3 we had to add a 7 2 z = 2 7 2. We can continue this calculation and write u our solutions in the following suggestive manner:

2. -ADIC ABSOLUTE VALUE 39 m solutions to x 2 2 (mod 7 m ) 1 ±3 2 ±(3 + 7) 3 ±(3 + 7 + 2 7 2 ) 4 ±(3 + 7 + 2 7 2 + 6 7 3 ) 5 ±(3 + 7 + 2 7 2 + 6 7 3 + 7 4 ) We are writing solutions as a series in owers of 7 with coefficients between 0 and 6. This suggests very much an analogy with decimal exansions. We immediately begin to wonder if the series converges in any sense. Of course it does not converge in the sense of 1st year analysis as the owers of 7 are tending to infinity. However we will change our notion of large and small to make it converge. 2. -Adic Absolute Value Before we define the -adic absolute value, it is worth recalling ord and its roerties. Remember that if is a rime and α is a non-zero rational, then ord (α) is the unique integer such that α = ord(α) a, a, b Z, a, b. b We defined ord (0) = +. Recall also that one formulation of the Unique Factorization Theorem says that any non-zero rational α can be written as (4) α = ± P ord(α), where P is the set of all rimes. Of course only finitely many of the exonents ord (α) are non-zero, so the roduct makes sense. Definition. Let be a rime and α a non-zero rational number. We define the -adic absolute value of α to be α = ord(α). We define 0 = 0 which is consistent with our convention that ord (0) = +. Examle 2.1. Let α = 50/27. Then 2 1 = 2 3 3 = 3 α = 5 2 = 5 1 2, 3, 5. Now evaluate P α. What do you notice.

40 4. -ADIC NUMBERS Examle 2.2. Notice that r = r, so owers of with ositive exonent are actually small. It now looks likely that the series where we seem to be exanding 2 as a owerseries in 7 does converge. We will come to that soon, but first we need some roerties of the -adic absolute value. Theorem 4.3. Let be a rime and α, β Q. Then (i) α 0. Moreover, α = 0 iff α = 0. (ii) αβ = α β. (iii) α + β max{ α, β }, with equality if α β. Inequality (iii) is called the ultrametric inequality. Notice that it imlies the triangle inequality α + β α + β but is actually much stronger. Proof of Theorem 4.3. We ll leave (i) and (ii) as exercises. Let s do (iii). Recall the following roerty of ord : (5) ord (α + β) min{ord (α), ord (β)} with equality if ord (α) ord (β). Write r = ord (α), s = ord (β), t = ord (α + β), and suose that r s. Then t min(r, s) = r. Hence α + β = t r = max{ r, s } = max{ α, β }. Now suose that α β. Then r s which means that r s. Hence ord (α) ord (β) and we have equality in (5). Hence t = r and so α + β = t = r = max{ r, s } = max{ α, β }. Examle 2.3. The triangle inequality is true for the -adic absolute value, so everything you roved reviously for the ordinary absolute value using the triangle inequality also holds for the -adic absolute value. But the ultrametric inequality is much stronger. Notice the following striking consequence of the ultrametric inequality. Let C be a constant and a rime. Consider the set {α Q : α C}. This is a disc centred at the origin. However, the ultrametric inequality tells us that if we add two elements in this disc, we stay inside it. Comare this with what haens if you add two elements of the disc in the comlex lane {α C : α C}.

3. CONVERGENCE 41 Here it is easy to add two elements in the disc so that you leave the disc. The triangle inequality for the usual absolute value will tell you that if α C and β C then α + β 2C, so you can see that the ultrametric inequality is much stronger than the triangle inequality. Theorem 4.4. (The Product Formula) Let α be a non-zero rational number. Then α P α = 1, where P is the set of rimes. Proof. Prove this using (4). Notice that all but finitely many terms in the roduct are 1, so the roduct makes sense. 3. Convergence Definition. We say that the series of rational numbers {a n } n=1 converges -adically to a Q if lim a n a = 0. n We can also exress this in terms of esilons: the series {a n } n=1 converges to a Q if for every ɛ > 0, there is some N such that for all n N, we have a n a < ɛ. A series j=1 a j converges -adically if the sequence of artial sums s n = n j=1 a j converges -adically. Examle 3.1. Let a Q. It is easy to see that the constant sequence {a} n=1 converges -adically to a. Examle 3.2. The sequence { n } n=1 converges to 0 -adically since n 0 = n 0 as n. Examle 3.3. Consider 5-adically the series The n-th artial sum is 1 + 5 + 5 2 + 5 3 +. s n = 1 + 5 + + 5 n 1 = 5n 1 5 1 = 5n 4 1 4. As 5 n 0, it seems that the sequence of artial sums is converging to 1/4. Let s check this: s n ( 1/4) 5 = 5 n /4 5 = 5 n 0 as n. Hence {s n } n=1 converges 5-adically to 1/4 and we can write 1 + 5 + 5 2 + = 1 4.