PMATH 340 Lecture Notes on Elementary Number Theory
Total Page:16
File Type:pdf, Size:1020Kb
PMATH 340 Lecture Notes on Elementary Number Theory Anton Mosunov Department of Pure Mathematics University of Waterloo Winter, 2017 Contents 1 Introduction . .3 2 Divisibility. Factorization of Integers. The Fundamental Theorem of Arithmetic . .5 3 Greatest Common Divisor. Least Common Multiple. Bezout’s´ Lemma. .9 4 Diophantine Equations. The Linear Diophantine Equation ax + by = c ........... 15 5 Euclidean Algorithm. Extended Euclidean Algorithm . 18 6 Congruences. The Double-and-Add Algorithm . 24 7 The Ring of Residue Classes Zn .................. 29 8 Linear Congruences . 31 ? 9 The Group of Units Zn ....................... 33 10 Euler’s Theorem and Fermat’s Little Theorem . 36 11 The Chinese Remainder Theorem . 38 12 Polynomial Congruences . 41 13 The Discrete Logarithm Problem. ? The Order of Elements in Zn .................... 45 14 The Primitive Root Theorem . 50 15 Big-O Notation . 53 16 Primality Testing . 56 16.1 Trial Division . 57 16.2 Fermat’s Primality Test . 58 16.3 Miller-Rabin Primality Test . 61 17 Public Key Cryptosystems. The RSA Cryptosystem . 62 18 The Diffie-Hellman Key Exchange Protocol . 67 19 Integer Factorization . 69 1 19.1 Fermat’s Factorization Method . 70 19.2 Dixon’s Factorization Method . 72 20 Quadratic Residues . 75 21 The Law of Quadratic Reciprocity . 81 22 Multiplicative Functions . 86 23 The Mobius¨ Inversion . 91 24 The Prime Number Theorem . 95 25 The Density of Squarefree Numbers . 96 26 Perfect Numbers . 101 27 Pythagorean Triples . 104 28 Fermat’s Infinite Descent. Fermat’s Last Theorem . 105 29 Gaussian Integers . 110 30 Fermat’s Theorem on Sums of Two Squares . 120 31 Continued Fractions . 124 32 The Pell’s Equation . 135 33 Algebraic and Transcendental Numbers. Liouville’s Approximation Theorem . 137 34 Elliptic Curves . 140 2 1 Introduction This is a course on number theory, undoubtedly the oldest mathematical discipline known to the world. Number theory studies the properties of numbers. These may be integers, likep −2;0 or 7, or rational numbers like 1=3 or −7=9, or algebraic numbers like 2 or i, or transcendental numbers like e or p. Though most of the course will be dedicated to Elementary Number Theory, which studies con- gruences and various divisibility properties of the integers, we will also dedicate several lectures to Analytic Number Theory, Algebraic Number Theory, and other subareas of number theory. There are many interesting questions that one might ask about numbers. In search for answers to these questions mathematicians unravel fascinating proper- ties of numbers, some of which are quite profound. Here are several curious facts about prime numbers: 1. Every odd number exceeding 5 can be expressed as a sum of three primes (Helfgott-Vinogardov Theorem, 2013. In 1954, Vinogardov proved the re- sult for all odd n > B for some B, and in 2013 Helfgott demonstrated that one can take B = 5); 2. There are infinitely many prime numbers p and q such that jp − qj ≤ 246 (Zhang’s Theorem, 2013. Zhang proved the result for 7 · 107, and in 2014 the constant was reduced to 246 by Maynard, Tao, Konyagin and Ford); 3. For all n ≥ exp(exp(33:217)) there always exists a prime between n3 and (n + 1)3 (Ingham’s Theorem, 1937. Ingham proved the result for all n ≥ B for some B, and in 2014 Dudek demonstrated that one can take B as above); 4. There are infinitely many primes of the form x2 + y4 (Friedlander-Iwaniec Theorem, 1997); 5. Up to x > 1, there are “approximately” x=logx prime numbers (Prime Num- ber Theorem, 1896); 6. Given a positive integer d, there exist distinct prime numbers p1; p2;:::; pd which form an arithmetic progression (Green-Tao Theorem, 2004). Despite the simplicity of their formulations, all of these results are highly non- trivial and their proofs reside on some deep theories. For example, the Green-Tao 3 Theorem resides on Szemeredi’s´ Theorem, which in turn uses the theory of ran- dom graphs. There are many number theoretical problems out there that are still open. At the 1912 International Congress of Mathematicians, the German mathematician Edmund Landau listed the following four basic problems about primes that still remain unresolved: 1. Can every even integer greater than 2 be written as a sum of two primes? (Goldbach’s Conjecture, 1742); 2. Are there infinitely many prime numbers p and q such that jp − qj = 2? (Twin Prime Conjecture, 1849); 3. Does there always exist a prime between two consecutive perfect squares? (Legendre’s Conjecture, circa 1800); 4. Are there infinitely many primes of the form n2 + 1? (see Bunyakovsky’s Conjecture, 1857). It is widely believed that the answer to each of the questions above is “yes”. There is a lot of computational evidence towards each of them, and for some of them conjectural asymptotic formulas were established. However, none of them are proved. Aside from being an interesting theoretical subject, number theory also has many practical applications. It is widely used in cryptographic protocols, such as RSA (Rivest-Shamir-Adleman, 1977), the Diffie-Hellman protocol (1976), and ECIES (Elliptic Curve Integrated Encryption Scheme). These protocols rely on certain fundamental properties of finite fields (RSA, D-H) and elliptic curves de- fined over them (ECIES). For example, consider the Discrete Logarithm Problem: given a prime p and integers c;m, one may ask whether there exists an integer d such that cd − m is divisible by p, and if so, what is its value. We may write this in the form of a congruence cd ≡ m (mod p): When p is extremely large (hundreds of digits) and c;m are chosen properly, this problem is widely believed to be intractable; that is, no modern computer can solve it in a reasonable amount of time (the computation would require billions of 4 years). This property is used in many cryptosystems, including the first two men- tioned above. Many cryptosystems, like RSA, can be broken by quantum comput- ers. The construction of protocols infeasible to attacks by quantum computers is a subject of Post Quantum Cryptography and number theory plays a crucial role there (see the Lattice-Based or Isogeny-Based Cryptography). 2 Divisibility. Factorization of Integers. The Fundamental Theorem of Arithmetic Before we proceed, let us invoke a little bit of notation: N = f1;2;3;:::g — the natural numbers; Z = f0;±1;±2;:::g — the ring of integers; m Q = n : m 2 Z;n 2 N — the field of fractions; R — the field of real numbers; C = fa + bi: a;b 2 R;i2 = −1g — the field of complex numbers. We call Z a ring because 0;1 2 Z and a;b 2 Z implies a±b 2 Z and a · b 2 Z. In other words, Z is closed under addition, subtraction and multiplication. Note, however, that a;b 2 Z with b 6= 0 does not imply that a=b 2 Z, so it is not closed under division. A collection that is closed under addition, subtraction, multipli- cation and division by a non-zero element is called a field. According to this definition, every field is also a ring. Exercise 2.1. Demonstrate the proper inclusions in N(Z(Q(R(C. No proofs are required. Definition 2.2. Let a;b 2 Z. We say that a divides b, or that a is a factor of b, when b = ak for some k 2 Z. We write a j b if this is the case, and a - b otherwise. Example 2.3. 3 j 12 because 12 = 3 · 4; 3 - 13; −1 j 7 because 7 = (−1) · (−7); 0 - 3. Proposition 2.4. 1 Let a;b;c;x;y 2 Z. 1. If a j b and b j c, then a j c; 1Proposition 1.2 in Frank Zorzitto, A Taste of Number Theory. 5 2. If c j a and c j b, then c j ax ± by; 3. If c j a and c - b, then c - a ± b; 4. If a j b and b 6= 0, then jaj ≤ jbj; 5. If a j b and b j a, then a = ±b; 6. If a j b, then ±a j ±b; 7. 1 j a for all a 2 Z; 8.a j 0 for all a 2 Z; 9. 0 j a if and only if a = 0. Proof. Exercise. Definition 2.5. Let p ≥ 2 be a natural number. Then p is called prime if the only positive integers that divide p are 1 and p itself. It is called composite otherwise. We remark that 1 is neither prime nor composite. We will also use the above terminology only with respect to integers exceeding 1 (so according to this con- vention −3 is not prime and −6 is not composite). Exercise 2.6. Among the collection −5;1;5;6, which numbers are prime? Theorem 2.7. For each integer n ≥ 2 there exists a prime p such that p j n. Proof. We will prove this result using strong induction on n. Base case. For n = 2 we have 2 j n. Since 2 is prime, the theorem holds. Induction hypothesis. Suppose that the theorem is true for n = 2;3;:::;k. Induction step. We will show that the theorem is true for n = k + 1. If n is prime the result holds. Otherwise there exists a positive integer d such that d j n, d 6= 1 and d 6= n. By property 4 of Proposition 2.4 we have d ≤ n, and since d 6= 1 and d 6= n we conclude that 2 ≤ d ≤ n − 1 = k.