244 32 8MB
English Pages 185 [187] Year 2022
STUDENT MATHEMATICAL LIBRARY Volume 99
Finite Fields, with Applications to Combinatorics Kannan Soundararajan
Finite Fields, with Applications to Combinatorics
STUDENT MATHEMATICAL LIBRARY Volume 99
Finite Fields, with Applications to Combinatorics Kannan Soundararajan
EDITORIAL COMMITTEE John McCleary Rosa C. Orellana (Chair)
Paul Pollack Kavita Ramanan
2020 Mathematics Subject Classi๏ฌcation. Primary 11-01, 05-01, 12-01, 11A07, 11A51, 05B10, 12E20. For additional information and updates on this book, visit www.ams.org/bookpages/stml-99 Library of Congress Cataloging-in-Publication Data Cataloging-in-Publication Data has been applied for by the AMS. See http://www.loc.gov/publish/cip/. DOI: https://doi.org/10.1090/stml/99 Copying and reprinting. Individual readers of this publication, and nonpro๏ฌt libraries acting for them, are permitted to make fair use of the material, such as to copy select pages for use in teaching or research. Permission is granted to quote brief passages from this publication in reviews, provided the customary acknowledgment of the source is given. Republication, systematic copying, or multiple reproduction of any material in this publication is permitted only under license from the American Mathematical Society. Requests for permission to reuse portions of AMS publication content are handled by the Copyright Clearance Center. For more information, please visit www.ams.org/ publications/pubpermissions. Send requests for translation rights and licensed reprints to reprint-permission@ ams.org.
c 2022 by the author. All rights reserved. Printed in the United States of America. โ The paper used in this book is acid-free and falls within the guidelines
established to ensure permanence and durability. Visit the AMS home page at https://www.ams.org/ 10 9 8 7 6 5 4 3 2 1
27 26 25 24 23 22
To Waheeda and Kesi
Contents
Preface Chapter 1.
xi Primes and factorization
1
ยง1.1. Groups
1
ยง1.2. Rings
4
ยง1.3. Integral domains and fields
6
ยง1.4. Divisibility: primes and irreducibles
9
ยง1.5. Ideals and Principal Ideal Domains (PIDs)
12
ยง1.6. Greatest common divisors
13
ยง1.7. Unique factorization
15
ยง1.8. Euclidean domains
17
ยง1.9. Exercises
21
Chapter 2.
Primes in the integers
27
ยง2.1. The infinitude of primes
27
ยง2.2. Bertrandโs postulate
32
ยง2.3. How many primes are there?
38
ยง2.4. Exercises
41
Chapter 3.
Congruences in rings
ยง3.1. Congruences and quotient rings
45 45 vii
viii
Contents
ยง3.2. The ring โค/๐โค
49
ยง3.3. Prime ideals and maximal ideals
51
ยง3.4. Primes in the Gaussian integers
55
ยง3.5. Exercises
58
Chapter 4.
Primes in polynomial rings: constructing finite fields
63
ยง4.1. Primes in the polynomial ring over a field
63
ยง4.2. An analogue of the proof of Bertrandโs postulate
68
ยง4.3. An analogue of Eulerโs proof
71
ยง4.4. Mรถbius inversion and a formula for ๐(๐; ๐ฝ๐ )
74
ยง4.5. Exercises
79
Chapter 5.
The additive and multiplicative structures of finite fields
83
ยง5.1. More about groups: cyclic groups
83
ยง5.2. More about groups: Lagrangeโs theorem
87
ยง5.3. The additive structure of finite fields
90
ยง5.4. The multiplicative structure of finite fields
95
ยง5.5. Exercises
97
Chapter 6.
Understanding the structure of โค/๐โค
ยง6.1. The Chinese Remainder Theorem ยง6.2. The structure of the multiplicative group (โค/๐โค)ร
99 99 103
ยง6.3. Existence of primitive roots mod ๐๐ : Proof of Theorem 6.10 105 ยง6.4. Exercises Chapter 7.
Combinatorial applications of finite fields
108 111
ยง7.1. Sidon sets and perfect difference sets
111
ยง7.2. Proof of Theorem 7.3
116
ยง7.3. The Erdลs-Turรกn boundโProof of Theorem 7.4
117
ยง7.4. Perfect difference setsโProof of Theorem 7.8
121
ยง7.5. A little more on finite fields
124
ยง7.6. De Bruijn sequences
126
ยง7.7. A magic trick
129
Contents
ix
ยง7.8. Exercises Chapter 8.
130
The AKS Primality Test
135
ยง8.1. What is a rapid algorithm?
135
ยง8.2. Primality and factoring
137
ยง8.3. The basic idea behind AKS
141
ยง8.4. The algorithm
143
ยง8.5. Running time analysis
144
ยง8.6. Proof of Lemma 8.8
145
ยง8.7. Generating new relations from old
146
ยง8.8. Proof of Theorem 8.9
147
ยง8.9. Exercises
152
Chapter 9.
Synopsis of finite fields
ยง9.1. Exercises
155 161
Bibliography
165
Index
169
Preface
This book arose out of my experiences with teaching Math 62DM at Stanford, a course which I developed in 2016 and have taught over the last several years. The course is aimed primarily at highly motivated firstyear students at Stanford who were potential honors math majors. The traditional first-year honors sequence targeted to these undergraduates was a year-long three quarter sequence covering multivariable calculus and linear algebra, differential forms, and ordinary differential equations. Some years back, together with several colleagues, we felt that an alternative sequence aimed at introducing ideas of modern mathematics with a discrete flavor might also be welcome to incoming students, especially those with an interest in computer science. This alternative sequence focuses on linear algebra (lectures shared with the traditional sequence students) with applications to combinatorics in the first quarter, finite fields and applications (the subject of this book, and the middle quarter of the sequence), and probability and random processes in the third quarter. The prerequisites for reading this book are minimal: familiarity with proof writing, some linear algebra (mainly a little familiarity with vector spaces over a field), and one variable calculus is assumed. The book then develops from scratch the theory of finite fields, constructing all of these, and showing why these are unique (up to isomorphism). The
xi
xii
Preface
topic of finite fields is used to introduce the student to ideas from algebra and number theory. As a payoff, several combinatorial applications of finite fields are given: Sidon sets and perfect difference sets, De Bruijn sequences and a magic trick of Persi Diaconis, and the polynomial time algorithm for primality testing due to Agrawal, Kayal and Saxena. The book forms the basis for a one quarter (ten weeks) intensive course at Stanford, with students meeting five days a week (four lectures plus a discussion session). Students can expect to develop familiarity with ideas in algebra (groups, rings and fields), and elementary number theory, which would help with later classes where these are developed in greater detail. Past students of the course have enjoyed seeing the marquee primality test application tying together the many disparate topics from the course. I am grateful to the many students at Stanford who took this course. This book was shaped by my interactions with them. I am also grateful to the wonderful TAโs who helped with the course, including Jonathan Love, Graham White, Sarah Peluse, Vivian Kuperberg, and Max Xu. I am especially indebted to Vineet Gupta, Emmanuel Kowalski, Vivian Kuperberg, and Jonathan Love who read drafts of the book, and offered detailed and extremely helpful suggestions. Thanks are due to Ina Mette for her patience, and to the STML series editorial board for their valuable feedback on early drafts of this project. While writing this book, I have been supported by grants from the National Science Foundation, and a Simons Investigator award from the Simons Foundation. Finally, I am grateful to the Staats- und Universitรคts Bibliothek (SUB) Gรถttingen for kindly permitting me to use the table from Gaussโs Nachlass that appears on page 39 (call number SUB Gรถttingen, Cod. Ms. Gauss Math. 18, fol. 2r.). Kannan Soundararajan
Chapter 1
Primes and factorization
This chapter gives a brief introduction to some ideas in algebra and number theory. The central objects of study in number theory are the integers โค = {. . . , โ3, โ2, โ1, 0, 1, 2, 3, . . .}, the natural numbers โ = {1, 2, 3, . . .}, and the rational numbers โ = {๐/๐ โถ ๐, ๐ โ โค, ๐ โ 0}. These objects are among the simplest examples of algebraic structures that we shall study throughout the book. The integers are one of the simplest examples of a group (under the operation of addition), and they also form a ring under addition and multiplication. The rationals are one of the simplest examples of a field. We shall begin by defining these notions carefully. Our immediate goal after that will be to discuss prime numbers and factorization. In particular, we shall show that integers admit a unique factorization into prime numbers, but we will develop the notions and proofs so that they generalize to other interesting rings as wellโfor example, to the ring of Gaussian integers โค[๐], and to the ring of polynomials over a field (both defined below).
1.1. Groups Definition 1.1. A group is a set ๐บ with a binary operation, denoted โ
(or โ, or +, or ร, or just omitted), satisfying the following properties: โข If ๐ and ๐ are in ๐บ then ๐ โ
๐ is also in ๐บ. โข Associativity: For any ๐, ๐, ๐ in ๐บ we have ๐ โ
(๐ โ
๐) = (๐ โ
๐) โ
๐. 1
2
1. Primes and factorization
โข There is an identity element (denoted ๐) with the property that for any ๐ โ ๐บ one has ๐ โ
๐ = ๐ โ
๐ = ๐. โข For every ๐ โ ๐บ there is an inverse element ๐โ1 such that ๐ โ
๐โ1 = ๐โ1 โ
๐ = ๐. Note that in our definition we do not insist that ๐ โ
๐ = ๐ โ
๐ for all ๐ and ๐. Groups in which ๐ โ
๐ = ๐ โ
๐ are called commutative (or abelian) groups. In our definition of a group, we only required the existence of an identity element ๐, but in fact one can see that such an identity element must be unique. For, if ๐ 1 and ๐ 2 were two identity elements for a group ๐บ, then we must have ๐ 1 โ
๐ 2 = ๐ 1 (since ๐ 2 is an identity), and also that ๐ 1 โ
๐ 2 = ๐ 2 (since ๐ 1 is an identity), and therefore ๐ 1 = ๐ 2 . Similarly you should check that there is a unique inverse for any element ๐ โ ๐บ (see Exercise 1(i) below). Another useful property that follows from the definition is the cancellation law. If ๐, ๐, ๐ are any elements of a group ๐บ with ๐๐ = ๐๐, then we can โcancel ๐ on both sidesโ and conclude that ๐ = ๐. Precisely, multiply both sides of the relation ๐๐ = ๐๐ (on the left) with ๐โ1 , obtaining ๐โ1 (๐๐) = ๐โ1 (๐๐). Using the associative property we find ๐โ1 (๐๐) = (๐โ1 ๐)๐ = ๐๐ = ๐ and similarly ๐โ1 (๐๐) = (๐โ1 ๐)๐ = ๐๐ = ๐, and thus the cancellation law is justified. Example 1.2. The set of integers โค with the usual addition operation forms an abelian group. The identity is 0 and the inverse of a number ๐ is โ๐. The rational numbers โ, the real numbers โ, and the complex numbers โ are all examples of abelian groups under the usual addition operation. The non-zero rational numbers (denoted โร ), non-zero real numbers โร , and non-zero complex numbers โร are groups under the usual multiplication operation (with the identity being 1 now). Example 1.3. Let ๐บ be a group with the operation denoted by โ
. If ๐ is an element of ๐บ, then we can โmultiplyโ ๐ with itself (precisely, we are using the operation โ
on ๐ repeatedly), arriving at elements ๐ โ
๐ which we denote naturally by ๐2 , ๐ โ
๐ โ
๐ = ๐3 , and so on. Considering also the inverse of ๐, namely ๐โ1 , we are led to elements ๐โ2 , ๐โ3 , and so on.
1.1. Groups
3
Note that the inverse of ๐๐ is simply ๐โ๐ , and that the โlaw of exponentsโ holds: ๐๐ โ
๐๐ = ๐๐+๐ . Consider the set ๐ป = {๐๐ โถ ๐ โ โค}, which is a subset of ๐บ, and in fact is also a group in its own right under the same operation โ
(check that the properties in the definition hold). The set ๐ป is an example of a subgroup of ๐บ, and is known as the cyclic group generated by the element ๐. For example, if we consider the group โค under addition, then the subgroup generated by 2 consists of all the even numbers {2๐ โถ ๐ โ โค}. For other examples, consider the group โโ of non-zero complex numbers under multiplication. The group generated by ๐ consists of the infinite set {๐๐ โถ ๐ โ โค}. We can also obtain finite subgroups: the group generated by 1 is simply {1}, while the group generated by โ1 has two elements {1, โ1}. More generally, for any natural number ๐ we can start with the complex number ๐2๐๐/๐ (an ๐-th root of unity), and this generates the ๐element group {๐2๐๐/๐ , ๐4๐๐/๐ , ๐6๐๐/๐ , . . . ๐2๐๐๐/๐ = 1}. This gives one way of thinking about the cyclic group of size ๐.
Example 1.4. While we will only be concerned with the simplest groups (like โค) and most of our discussions will involve abelian groups, we give a few important examples of non-abelian groups. As one example of a group that is not abelian, (and which you might have encountered before in linear algebra) look at 2ร2 matrices with real entries and determinant not equal to zero. The group operation here is matrix multiplication, and the identity element of the group is the identity matrix. The condition that the determinant is not zero allows one to invert matrices. This group is denoted as ๐บ๐ฟ2 (โ) (here ๐บ๐ฟ stands for General Linear), and you can similarly think of ๐ ร ๐ matrices with real entries and non-zero determinant obtaining the group ๐บ๐ฟ๐ (โ). Another related example is to look at ๐ ร ๐ matrices with real entries and determinant equal to 1, and again with matrix multiplication as the group operationโthis group is denoted by ๐๐ฟ๐ (โ) (with ๐๐ฟ standing for Special Linear, and โspecialโ indicating here the specification that the determinant is 1). A third example is the symmetric group ๐๐ of all permutations of an ๐-element set (usually thought of as {1, 2, . . . , ๐}). By a โpermutationโ we mean a bijective function on the ๐-element set, and the group operation here is composition of functions. You may have encountered permutations while discussing the determinant in linear algebra.
4
1. Primes and factorization
1.2. Rings Definition 1.5. A ring ๐
is a set together with two binary operations, usually denoted by + and ร, and satisfying the following properties: โข Under the operation +, the set ๐
forms an abelian group. The (additive) identity of this group is denoted by 0. โข The operation ร is associative ๐ ร (๐ ร ๐) = (๐ ร ๐) ร ๐. โข Multiplication is distributive over addition: ๐ ร (๐ + ๐) = ๐ ร ๐ + ๐ ร ๐,
and
(๐ + ๐) ร ๐ = ๐ ร ๐ + ๐ ร ๐.
Two other desirable properties, which need not be satisfied by general rings, are: โข Commutativity of multiplication: ๐ ร ๐ = ๐ ร ๐. โข Existence of a multiplicative identity: There exists an element 1 with ๐ ร 1 = 1 ร ๐ = ๐ for all ๐ โ ๐
. A ring which satisfies the last two properties above is called a commutative ring with identity. We will only be interested in such commutative rings with identity, but it may be useful to have one example of a non-commutative ring. A natural example, related to Example 1.4 for groups, is the ring ๐๐ (โ) of ๐ ร ๐ matrices with real entries with the usual operations of matrix addition and multiplication. From now on, ring will always mean, for us, a commutative ring with identity. We will remind you of this assumption from time to time, but it is assumed throughout the text. In any ring ๐
, 0 ร ๐ = 0 for all ๐ โ ๐
. To see this, note that 0 ร ๐ = (0 + 0) ร ๐ = 0 ร ๐ + 0 ร ๐ by the distributive law. Canceling one 0 ร ๐ from both sides of the relation 0 ร ๐ = 0 ร ๐ + 0 ร ๐ (recall that we are allowed to cancel in a group), we obtain 0 ร ๐ = 0. Example 1.6. If the multiplicative identity 1 is the same as the additive identity 0, then the ring can have only one element 0: indeed, we must have 1 ร ๐ = ๐ = 0 ร ๐ = 0. This is a trivial example of a ring, called the zero ring; it consists of one element 0, and is described by the boring properties 0 + 0 = 0 ร 0 = 0. We shall henceforth assume that 0 โ 1, to avoid this example.
1.2. Rings
5
Example 1.7. Note that โค is a commutative ring with identity for the usual addition and multiplication operations. The additive identity is 0 and the multiplicative identity is 1. Example 1.8. The Gaussian integers are defined by โค[๐] = {๐ + ๐๐ โถ ๐, ๐ โ โค}, and this forms a commutative ring with identity under the usual operations of addition and multiplication. Precisely, here ๐ is a symbol denoting โโ1, so that any occurrence of ๐ ร ๐ may be replaced with โ1. Adding ๐+๐๐ to ๐+๐๐ results in (๐+๐)+(๐+๐)๐, and multiplying (๐ + ๐๐) and (๐ + ๐๐) results in ๐๐ + ๐๐๐ + ๐๐๐ + ๐๐๐ ร ๐ (as demanded by the distributive law), which simplifies to (๐๐ โ ๐๐) + (๐๐ + ๐๐)๐. Similarly you may check that โค[โโ5] = {๐ + ๐โโ5 โถ ๐, ๐ โ โค} (for example) is also a ring, under usual addition and multiplication. Again, think of โโ5 as standing for some symbol which when multiplied with itself yields โ5. Later on, while discussing quotient rings, we shall give a more precise description of what exactly we are doing in these two examples. Example 1.9. You may have seen something about congruences in the integers, which we will discuss in more detail and generality later. Let ๐ โฅ 2 be a natural number. We say that two integers ๐ and ๐ are congruent mod ๐ if ๐ divides their difference ๐ โ ๐. By a congruence class ๐ mod ๐ we mean the set of all integers that are congruent to ๐ mod ๐. Any integer lies in precisely one of the congruence classes 0 mod ๐, 1 mod ๐, . . ., ๐ โ 1 mod ๐ (the remainder obtained upon dividing by ๐). These ๐ congruence classes inherit operations + and ร from addition and subtraction in the integers. By this we mean that if we add any two integers in the congruence classes ๐ mod ๐ and ๐ mod ๐, then we will obtain an integer in the congruence class (๐ + ๐) mod ๐; and similarly if we multiply two such integers, we would obtain an integer in the congruence class ๐๐ mod ๐. The ring obtained in this way is denoted by โค/๐โค and is a finite ring of size ๐. As mentioned already, we will discuss this notion more precisely later (see Section 3.2), and work towards understanding the structure of this ring. For the present, you may wish to consider special cases such as ๐ = 2, 3, or 6 and check how the ring operations work in these cases. Example 1.10. Given a ring ๐
, we can form an important example of a ring by considering polynomials in a variable ๐ฅ with coefficients in the ring ๐
. This is known as the polynomial ring over ๐
and is denoted by
6
1. Primes and factorization
๐
[๐ฅ]. The elements of ๐
[๐ฅ] are polynomials of the form ๐(๐ฅ) = ๐0 + ๐1 ๐ฅ + . . . + ๐๐ ๐ฅ๐ , where ๐ is a non-negative integer, and ๐0 , . . ., ๐๐ are elements of the ring ๐
. Usually one has in mind that ๐๐ โ 0, so that ๐ฅ๐ is the leading power of ๐ฅ in the polynomial ๐(๐ฅ), but be careful to allow for the zero polynomial ๐(๐ฅ) = 0 where all the coefficients are 0. If ๐(๐ฅ) = ๐0 +๐1 ๐ฅ+. . .+๐๐ ๐ฅ๐ is another polynomial with coefficients in ๐
, then their sum (๐ + ๐) is defined as the polynomial (๐ + ๐)(๐ฅ) = โ๐ ๐๐ ๐ฅ๐ with ๐๐ = ๐๐ + ๐๐ (with the understanding that ๐๐ = 0 for ๐ > ๐, and ๐๐ = 0 for ๐ > ๐); although we havenโt specified the range of values for ๐, clearly ๐๐ = 0 if ๐ > max(๐, ๐). Similarly the product of the two polynomials ๐ and ๐ is given by (๐๐)(๐ฅ) = ๐0 ๐0 + (๐1 ๐0 + ๐0 ๐1 )๐ฅ + . . . + ๐๐ ๐๐ ๐ฅ๐+๐ . You would already be familiar with polynomials whose coefficients are real numbers (the polynomial ring โ[๐ฅ]) or complex numbers (the ring โ[๐ฅ]), and we can now consider further examples such as โค[๐ฅ], or the more exotic (โค/6โค)[๐ฅ].
1.3. Integral domains and fields Let ๐
be a ring (as always, commutative with identity and with 0 โ 1). Since ๐
forms a group under addition, we have the cancellation law ๐ + ๐ = ๐ + ๐ implies ๐ = ๐. Is there a cancellation law for multiplication? Since 0 ร ๐ = 0 for all elements ๐ โ ๐
, we may have 0 ร ๐ = 0 ร ๐ without necessarily having ๐ = ๐. Less trivially, even if ๐ โ 0 it may happen that ๐๐ = ๐๐ without ๐ being equal to ๐. For example, in the ring โค/6โค we have 2 mod 6 ร 3 mod 6 = 4 mod 6 ร 3 mod 6 (both are 0 mod 6) but 2 mod 6 โ 4 mod 6. The problem is that it is possible for rings ๐
to have non-zero elements ๐ and ๐ such that the product ๐๐ equals 0. Indeed in โค/6โค we have 2 mod 6 ร 3 mod 6 = 0 mod 6. We isolate this undesired behavior, and define a class of rings that are better behaved and permit cancellation with respect to multiplication. Definition 1.11. Let ๐
be a commutative ring with identity, and with 0 โ 1. A non-zero element ๐ of ๐
is called a zero divisor if there is a nonzero element ๐ with ๐๐ = 0. A ring ๐
that has no zero divisors is called an integral domain. Example 1.12. The ring โค, and the ring of Gaussian integers โค[๐] are both integral domains. To see why โค[๐] is an integral domain, note that
1.3. Integral domains and fields
7
(๐ + ๐๐) ร (๐ + ๐๐) = 0 implies that (๐ โ ๐๐)(๐ + ๐๐)(๐ + ๐๐)(๐ โ ๐๐) = (๐2 + ๐2 )(๐2 + ๐ 2 ) = 0. The last relation gives that a product of nonnegative integers is 0, so that either ๐2 + ๐2 = 0 (so that ๐ = ๐ = 0) or ๐2 + ๐ 2 = 0 (so that ๐ = ๐ = 0). Lemma 1.13. Let ๐
be an integral domain, and let ๐ be a non-zero element of ๐
. If ๐๐ = ๐๐ then ๐ = ๐. Proof. Rewrite the relation ๐๐ = ๐๐ as ๐๐ โ ๐๐ = 0, or ๐(๐ โ ๐) = 0 (here by ๐ โ ๐ we naturally mean ๐ + (โ๐)). Since ๐
is an integral domain, the relation ๐(๐โ๐) = 0 implies that either ๐ = 0 or ๐โ๐ = 0. By assumption ๐ โ 0, and so we must have ๐ โ ๐ = 0, or ๐ = ๐. โก Note that this proof is different from that of the cancellation law in a group, because the element ๐ โ ๐
may not have a multiplicative inverse; nevertheless, ruling out zero divisors is sufficient to make the cancellation law work. Definition 1.14. Let ๐
be a ring, and ๐ be a non-zero polynomial in ๐
[๐ฅ]. Write ๐ = ๐0 + ๐1 ๐ฅ + . . . + ๐๐ ๐ฅ๐ , with ๐๐ โ 0. Then we call ๐ the degree of the polynomial ๐, and denote it by deg(๐). Note that the degree of the zero polynomial is left undefined; one convention is to define it to be โโ. We may expect that if two non-zero polynomials ๐ and ๐ are multiplied, then the degree of ๐๐ should be the sum of the degree of ๐ and the degree of ๐. But this may fail owing to zero divisors in ๐
: for example the polynomials 2๐ฅ and 3๐ฅ in (โค/6โค)[๐ฅ] both have degree 1, but their product is the zero polynomial of undefined degree. For integral domains, our expectation about degrees is true. Proposition 1.15. Let ๐
be an integral domain. Then the polynomial ring ๐
[๐ฅ] is also an integral domain. Moreover, if ๐ and ๐ are non-zero polynomials in ๐
[๐ฅ] then the degree of ๐๐ equals the sum of the degrees of ๐ and ๐. Proof. Let ๐ be a non-zero polynomial. Then we may write ๐(๐ฅ) = ๐๐ ๐ฅ๐ + ๐๐โ1 ๐ฅ๐โ1 + . . . + ๐0 , where ๐๐ โ ๐
, and ๐๐ โ 0. The degree of ๐ is then ๐, which is a non-negative integer. Let ๐ be another non-zero polynomial ๐(๐ฅ) = ๐๐ ๐ฅ๐ + . . . + ๐0 with ๐๐ โ 0, so that ๐ has degree ๐. Then ๐(๐ฅ)๐(๐ฅ) = ๐๐ ๐๐ ๐ฅ๐+๐ + lower powers of ๐ฅ, and since ๐
is an
8
1. Primes and factorization
integral domain ๐๐ ๐๐ โ 0. Thus ๐(๐ฅ)๐(๐ฅ) is a non-zero polynomial of degree ๐ + ๐, proving our proposition. โก Example 1.16. Thus โค[๐ฅ], โ[๐ฅ], โ[๐ฅ], โค[๐ฅ, ๐ฆ] = (โค[๐ฅ])[๐ฆ] are all integral domains. Definition 1.17. In a ring ๐
, elements that have multiplicative inverses are called units. Thus, ๐ข โ ๐
is a unit if there exists ๐ฃ โ ๐
with ๐ข๐ฃ = 1. Since 0 ร ๐ = 0 for all ๐ โ ๐
, we cannot expect 0 to be a unit (recall that we are ignoring the zero ring where 0 = 1). Further, if ๐ is a zero divisor, then ๐ cannot be a unit. To see this, suppose there is a multiplicative inverse ๐โ1 of ๐ (thus ๐๐โ1 = 1), and also a non-zero element ๐ โ ๐
with ๐๐ = 0. Then we must have 0 = ๐โ1 ร 0 = ๐โ1 ร ๐๐ = ๐, which contradicts ๐ being non-zero. Check that the units of a ring ๐
(always commutative with identity) form a group under multiplication: this group is denoted by ๐
ร . Example 1.18. The units of โค are just ยฑ1. For instance, we may see this by considering the size, or absolute value, of integers. If ๐ is a non-zero integer, with an inverse ๐โ1 , then 1 = ๐๐โ1 and so 1 = |๐| ร |๐โ1 |. Thus either ๐ or ๐โ1 must have absolute value at most 1, but the only non-zero integers with absolute value at most 1 are ยฑ1. The units in the Gaussian integers โค[๐] are ยฑ1, and ยฑ๐. Again we may see this by using a notion of size, or absolute value; this time using the absolute value of complex numbers, or more precisely the square of the absolute value in the complex numbers. Consider ๐ โถ โค[๐] โ โคโฅ0 defined by ๐(๐ + ๐๐) = ๐2 + ๐2 , and ๐ is often called a norm function. You should check that the norm is multiplicative, by which we mean that ๐(๐ผ๐ฝ) = ๐(๐ผ)๐(๐ฝ). Therefore if ๐ข is a unit then ๐(๐ข) = 1 (for ๐ข๐ฃ = 1 and so ๐(๐ข)๐(๐ฃ) = 1, and both ๐(๐ข) and ๐(๐ฃ) are non-negative integers). Since ๐2 + ๐2 = 1 only if ๐ = ยฑ1 and ๐ = 0, or ๐ = 0 and ๐ = ยฑ1, it follows that the units in โค[๐] are ยฑ1 and ยฑ๐. Definition 1.19. A field is an integral domain ๐
where all non-zero elements are units. Example 1.20. You would already be familiar with the field of rational numbers โ, real numbers โ, and complex numbers โ.
1.4. Divisibility: primes and irreducibles
9
Example 1.21. A less familiar example may be โ(๐) = {๐ + ๐๐ โถ ๐, ๐ โ โ}. You should check that this is a field (see Exercise 7 below), and note that this field bears the same relation to the ring of Gaussian integers โค[๐] that the field of rational numbers โ bears to the ring โค. Recall โ is obtained from โค by considering fractions ๐/๐ (with ๐, ๐ โ โค, and ๐ โ 0) with the understanding that two fractions ๐1 /๐1 and ๐2 /๐2 are equal if ๐1 ๐2 = ๐2 ๐1 . Similarly โ(๐) may be obtained from โค[๐] by considering fractions (๐ + ๐๐)/(๐ + ๐๐), with ๐ + ๐๐ โ 0. More generally, starting with an integral domain ๐
we may construct a field of fractions by considering expressions ๐/๐ with ๐, ๐ โ ๐
and ๐ โ 0, with the understanding that ๐1 /๐1 and ๐2 /๐2 are the same if ๐1 ๐2 = ๐2 ๐1 (as in the familiar example โ). One adds and multiplies such fractions in the usual way ๐1 /๐1 + ๐2 /๐2 = (๐1 ๐2 + ๐2 ๐1 )/(๐1 ๐2 ), and ๐1 /๐1 ร ๐2 /๐2 = (๐1 ๐2 )/(๐1 ๐2 ). You may be familiar with another example of this construction: Starting with the polynomial ring โ[๐ฅ], which is an integral domain, we obtain the field of rational functions โ(๐ฅ) which consists of expressions ๐(๐ฅ)/๐(๐ฅ) where ๐, ๐ are elements of โ[๐ฅ] with ๐ โ 0. Example 1.22. Check that โค/2โค and โค/3โค are fields, but โค/6โค is not a field (indeed, it is not an integral domain). These give our first examples of finite fields, and one of our goals in this book is to determine and describe all such finite fields. Example 1.23. If ๐ฝ is a field, then the units of the polynomial ring ๐ฝ[๐ฅ] are the non-zero constants in ๐ฝ.
1.4. Divisibility: primes and irreducibles With these preliminaries in place, we turn to the main goal of this chapter, which is to develop ideas of divisibility and factorization in rings, generalizing the familiar notion of prime numbers in the integers and the factorization of integers into prime numbers. Let us begin with the definition (and notation) for divisibility. Definition 1.24. Let ๐
be a ring, and let ๐ and ๐ be elements of ๐
. We say that ๐ divides ๐, and write ๐|๐, if there is an element ๐ โ ๐
such that ๐ = ๐๐.
10
1. Primes and factorization
Example 1.25. Since all our rings have a multiplicative identity 1, note that ๐|๐ for any ๐ โ ๐
. If ๐|๐ and ๐|๐ then check that ๐|๐. Further note that ๐|0 for any ๐ โ ๐
. Example 1.26. If ๐ in ๐
is a unit, then ๐|๐ for any ๐ โ ๐
(since we can write ๐ = ๐(๐โ1 ๐)). This remark implies that the notion of divisibility is not interesting in a field. Indeed, in a field every non-zero element is a unit, and therefore all non-zero elements divide all elements of a field. Example 1.27. A natural question that arises from our definition is whether ๐ is unique when we write ๐ = ๐๐. Note that if ๐ = 0, then ๐ must also be 0, but ๐ may be an arbitrary element of the ring. Let us avoid this pathological case, and ask what happens when ๐ โ 0. Consider the ring ๐
= โค/15โค, and take ๐ = 3 mod 15 and ๐ = 0 mod 15. Note that ๐|๐ here, but we may write ๐ = ๐๐ with ๐ = 0, 5, or 10 mod 15. Another weird feature of this ring is that 3 mod 15 divides 6 mod 15, but also 6 mod 15 divides 3 mod 15 = 3 ร 6 mod 15. This allows us to factor 3 mod 15 indefinitely: 3 mod 15 = 3 ร 6 mod 15 = 3 ร 6 ร 6 mod 15, and so on. The weirdness in this example arises from zero divisors, and to avoid such pitfalls, we shall develop ideas of divisibility and factorizations in the context of integral domains. If ๐
is an integral domain, and ๐|๐ with ๐ โ 0, then there is a unique way to write ๐ = ๐๐. Indeed, if ๐ = ๐๐ 1 = ๐๐ 2 , then we may use Lemma 1.13 to cancel ๐ and conclude that ๐ 1 = ๐ 2 . Lemma 1.28. Let ๐
be an integral domain. If ๐ and ๐ are non-zero elements of ๐
and ๐|๐ and ๐|๐ then ๐ = ๐๐ข for a unit ๐ข. Proof. Since ๐|๐ we may write ๐ = ๐๐. Since ๐|๐ we may write ๐ = ๐๐. Therefore ๐ = ๐๐ = ๐๐๐. Since ๐
is an integral domain, and ๐ โ 0 we may use Lemma 1.13 to cancel ๐ from both sides of the relation ๐ = ๐๐๐. Thus we obtain 1 = ๐๐, so that ๐ and ๐ are units. This proves the lemma. โก If ๐ and ๐ are elements of a ring ๐
with ๐ = ๐๐ข for a unit ๐ข, then ๐ and ๐ are called associates. Our observations so far suggest that to develop ideas of factorization and irreducibility in rings, we should focus on integral domains: the theory for fields is uninteresting, while the presence of zero divisors leads to pathologies as in Example 1.27. In the next few sections we will develop
1.4. Divisibility: primes and irreducibles
11
a satisfactory theory of factorization into primes or irreducibles, which will cover important examples such as the integers โค, the Gaussian integers โค[๐], and the polynomial ring ๐ฝ[๐ฅ] over any field ๐ฝ. We begin by defining the notions of prime and irreducible, which will turn out to be the same in some important examples (such as the integers), but which in general are different notions. Definition 1.29. Let ๐
be an integral domain. An element ๐, not zero and not a unit, is called irreducible if ๐ = ๐๐ implies that either ๐ or ๐ is a unit. An element ๐ (not zero or a unit) is called reducible if it is not irreducible. In other words, an irreducible element cannot be factored as a product of two elements in ๐
, except in trivial ways writing it as a unit times an associate. In the integers, this definition of an irreducible gives numbers ๐ that are only divisible by ยฑ1 and ยฑ๐. Definition 1.30. Let ๐
be an integral domain. An element ๐, not zero and not a unit, is called prime if ๐|๐๐ implies ๐|๐ or ๐|๐. Lemma 1.31. In any integral domain, all primes are irreducibles. Proof. Suppose ๐ is prime, and write ๐ = ๐๐. We will show that ๐ or ๐ must necessarily be a unit, so that ๐ would be irreducible. Since ๐ is prime and ๐|๐๐, either ๐|๐ or ๐|๐. Say ๐|๐, so that ๐ = ๐๐. Then ๐ = ๐๐ = ๐๐๐, and cancelling ๐ from both sides of ๐ = ๐๐๐ we obtain ๐๐ = 1. Therefore ๐ is a unit, completing our proof. โก Example 1.32. The converse to Lemma 1.31 is not true in general, and there are integral domains in which not all irreducibles are primes. For instance, in the integral domain โค[โโ5] one can show that 2, 3, (1 + โโ5) and (1โโโ5) are all irreducible (see Exercise 11 below). However, 2 divides (1+ โโ5)ร(1โ โโ5) = 6 but 2 does not divide either (1+ โโ5) or (1 โ โโ5). In other words, in โค[โโ5] the element 2 is irreducible but not prime. In the next section we shall describe a particularly nice class of integral domains in which the notions of primes and irreducibles match. The point of the two definitions (as we shall soon see) is that it is often easy to prove the existence of a factorization of elements into irreducibles, and it is often easy to prove that a factorization into primes is unique. So it would indeed be nice if the two notions were the same!
12
1. Primes and factorization
1.5. Ideals and Principal Ideal Domains (PIDs) We begin with the definition of an ideal which will be a key concept in our later discussions. Definition 1.33. Let ๐
be a ring (as always commutative with identity). A non-empty subset ๐ผ of ๐
is called an ideal if (i) ๐ + ๐ belongs to ๐ผ for all ๐ and ๐ in ๐ผ, and (ii) ๐๐ belongs to ๐ผ for all ๐ โ ๐ผ and all ๐ โ ๐
. Example 1.34. Since ideals are non-empty, every ideal contains some element ๐, and therefore contains 0 ร ๐ = 0. Thus every ideal contains 0, and the set {0} itself forms an ideal, called the zero ideal. Further, the whole ring ๐
is also an ideal. If an ideal ๐ผ contains a unit ๐ข, then it must contain ๐ข๐ขโ1 = 1, and hence must contain all elements in ๐
(upon using property (ii)). Thus if ๐
is a field, then there are only two ideals in ๐
, namely {0} and ๐
. Example 1.35. If ๐ is any element in ๐
, then the set of multiples of ๐, namely {๐๐ โถ ๐ โ ๐
}, forms an ideal. We denote this ideal by (๐), and call this the ideal generated by ๐. More generally, if ๐1 , . . ., ๐๐ are elements of ๐
, then the ideal generated by them is (๐1 , . . . , ๐๐ ) = {๐1 ๐1 + ๐2 ๐2 + . . . + ๐๐ ๐๐ โถ ๐1 , . . . , ๐๐ โ ๐
}. You should check that this is indeed an ideal. Definition 1.36. In any ring ๐
an ideal (๐) generated by one element is called a principal ideal. An integral domain where every ideal is principal is called a Principal Ideal Domain (abbreviated PID). Example 1.37. The integers form a basic example of a PID. To see this, suppose ๐ผ is an ideal in โค. If ๐ผ = {0} then it is clearly principal. Suppose then that ๐ผ contains non-zero elements, and let ๐ be the smallest positive integer in ๐ผ. We claim that ๐ผ = (๐) is the set of multiples of ๐. If this is not true then there must be some integer ๐ โ ๐ผ which is not a multiple of ๐. Divide ๐ by ๐ to extract a quotient and remainder: thus ๐ = ๐๐ + ๐ with 1 โค ๐ < ๐. Since ๐ and ๐๐ are in the ideal ๐ผ, it follows that ๐ must also be in ๐ผ. But this contradicts the assumption that ๐ was the smallest positive integer in ๐ผ. In Section 1.8 we shall generalize this idea and give further examples of PIDs.
1.6. Greatest common divisors
13
Example 1.38. The polynomial ring over the integers โค[๐ฅ] gives an example of a familiar integral domain that is not a PID. Consider the ideal ๐ผ generated by 2 and ๐ฅ. Thus ๐ผ consists of all polynomials of the form 2๐ + ๐ฅ๐ with ๐ and ๐ โ โค[๐ฅ]. Or, in other words, the elements of ๐ผ are all polynomials ๐0 + ๐1 ๐ฅ + . . . + ๐๐ ๐ฅ๐ with ๐๐ โ โค and satisfying the extra condition that the constant coefficient ๐0 is even. Suppose ๐ผ is principal, and generated by โ โ โค[๐ฅ]. Since 2 โ ๐ผ, we must have โ|2, forcing โ to be ยฑ1, or ยฑ2. But โ = ยฑ1 is not possible since ๐ผ is not all of โค[๐ฅ] (for instance 1 โ ๐ผ), and โ = ยฑ2 is not possible since 2 + ๐ฅ โ ๐ผ.
1.6. Greatest common divisors Definition 1.39. Let ๐ and ๐ be two elements in an integral domain ๐
, with at least one of ๐ or ๐ being non-zero. An element ๐ โ ๐
that divides both ๐ and ๐ is called a common divisor of ๐ and ๐. A common divisor ๐ of ๐ and ๐ is called a greatest common divisor if every common divisor of ๐ and ๐ also divides ๐. Note, we have not said anything about the existence or uniqueness of the greatest common divisor. Indeed in Exercise 11 below, you will find an example of an integral domain where there are are elements that do not have a greatest common divisor. Further, if a greatest common divisor ๐ exists, then you should check that ๐๐ข is also a greatest common divisor for any unit ๐ข. But apart from this, the greatest common divisor (if it exists) is uniqueโfor if ๐1 and ๐2 are two greatest common divisors then ๐1 |๐2 (since ๐1 is a common divisor and ๐2 is a greatest common divisor) and similarly ๐2 |๐1 , and now use Lemma 1.28 to conclude that ๐1 and ๐2 are associates. We may sometimes refer to โthe greatest common divisorโ (when a greatest common divisor exists), but this refers to an arbitrary choice among the associates. We now show that in a PID, the greatest common divisor of two elements can always be found, and moreover it is a linear combination of the two elements. Proposition 1.40. If ๐
is a PID then there exists a greatest common divisor ๐ for any two elements ๐ and ๐ (not both zero). Further we may write ๐ = ๐๐ฅ + ๐๐ฆ for some elements ๐ฅ, ๐ฆ in ๐
.
14
1. Primes and factorization
Proof. Given ๐ and ๐ consider the ideal ๐ผ = (๐, ๐) generated by ๐ and ๐. That is, ๐ผ = {๐๐ฅ + ๐๐ฆ โถ ๐ฅ, ๐ฆ โ ๐
}. Since ๐
is a PID, the ideal ๐ผ must be principal. Say ๐ผ = (๐). We claim that ๐ is a gcd of ๐ and ๐ (and all other gcdโs are associates of ๐). Note that ๐ผ consists of the multiples of ๐, and since ๐ผ contains ๐ and ๐, it follows that ๐ and ๐ are both multiples of ๐. Thus ๐ is a common divisor of ๐ and ๐. If ๐ is a common divisor of ๐ and ๐, then ๐ divides all elements of the form ๐๐ฅ + ๐๐ฆ; that is, ๐ divides all elements of ๐ผ. Therefore ๐ must divide ๐. This proves that ๐ is a gcd, and the proposition follows. โก Example 1.41. In the integral domain โค[๐ฅ] the only common divisors of 2 and ๐ฅ are the units ยฑ1. Therefore their gcd may be taken as 1. However note that 1 cannot be written as a linear combination 2๐ + ๐ฅ๐ with ๐, ๐ โ โค[๐ฅ]. This is in keeping with what we already saw in Example 1.38: โค[๐ฅ] is not a PID. Recall that in Lemma 1.31 we established that in any integral domain all primes are irreducible. We now establish a partial converse, showing that in a PID all irreducibles are prime. Proposition 1.42. Let ๐
be a principal ideal domain. An element of ๐
is irreducible if and only if it is prime. Proof. We already know that primes are irreducible, so what remains is to show that irrreducibles are prime. Let ๐ be an irreducible in ๐
, and we wish to show that ๐ is prime. Suppose ๐ divides ๐๐ and ๐ does not divide ๐; we now show that ๐ must divide ๐, which will complete the proof. Consider the gcd of ๐ and ๐. Since ๐ is irreducible, it has no factors besides units and associates of ๐. Since ๐ does not divide ๐, it follows that the gcd of ๐ and ๐ can only be a unit, and so we may take the gcd to be 1 (which is associate to all units). Therefore Proposition 1.40 tells us that 1 = ๐๐ฅ + ๐๐ฆ for some elements ๐ฅ and ๐ฆ in ๐
. Multiplying both sides by ๐ we find that ๐ = ๐๐๐ฅ + ๐๐๐ฆ. Since ๐|๐๐, we have ๐|๐๐๐ฅ, and obviously ๐ divides ๐๐๐ฆ. Therefore ๐ must divide ๐ = ๐๐๐ฅ + ๐๐๐ฆ, which is what we wanted. โก
1.7. Unique factorization
15
1.7. Unique factorization We are now ready to address the questions of the existence and uniqueness of factorization into irreducibles in integral domains. Let us begin by defining the problem precisely. Let ๐
be an integral domain. By factoring an element ๐ โ ๐
(nonzero) into irreducibles, we mean writing ๐ = ๐ข๐1 ๐2 โฏ ๐ ๐ , where ๐ข is a unit, and the ๐ ๐ are irreducibles (possibly with repetitions). The first question is whether such a factorization exists. If it does, the next question is whether it is unique. To clarify what uniqueness means, suppose ๐ = ๐ข๐1 ๐2 โฏ ๐ ๐ = ๐ฃ๐1 ๐2 โฏ ๐โ are two factorizations. Then we would like to assert that ๐ = โ, and that each ๐ ๐ can be paired with an associate ๐๐ โthat is, apart from units/associates the ๐ ๐ โs and ๐๐ โs are just permutations of the same list of elements. Definition 1.43. An integral domain where every non-zero element has a unique factorization into irreducibles as above is called a Unique Factorization Domain (UFD). Proposition 1.44. In a UFD, primes and irreducibles are the same. Further, any two elements ๐ and ๐ (not both 0) have a gcd. Proof. Suppose ๐
is a UFD, and let ๐ โ ๐
be irreducible. We wish to show that ๐ is prime. Suppose ๐ divides ๐๐. Factor ๐ into irreducibles ๐ = ๐ข๐1 โฏ ๐ ๐ , and ๐ into irreducibles ๐ = ๐ฃ๐1 โฏ ๐โ . Thus ๐๐ = ๐ข๐ฃ๐1 โฏ ๐ ๐ ๐1 โฏ ๐โ is the unique factorization of ๐๐ into irreducibles. Since ๐ is an irreducible dividing ๐๐, it must be the case that ๐ is an associate of one of ๐1 , . . ., ๐ ๐ , ๐1 , . . ., ๐โ . If it is an associate of one of the ๐ ๐ โs then ๐|๐, and if it is an associate of one of the ๐๐ โs then ๐|๐. Thus we have shown that ๐|๐๐ implies ๐|๐ or ๐|๐; in other words, ๐ is prime. To show that the gcd of any two elements ๐ and ๐ exists, factor ๐ and ๐ into irreducibles (or, what we now know to be the same, ๐ ๐ ๐ primes). Let us express these factorizations as ๐ = ๐ข๐11 ๐22 โฏ ๐๐๐ and ๐๐ ๐1 ๐2 ๐ = ๐ฃ๐1 ๐2 โฏ ๐๐ where the ๐1 , . . ., ๐ ๐ are distinct primes (all the
16
1. Primes and factorization
primes appearing in the factorization of either ๐ or ๐) and the exponents ๐ ๐ and ๐๐ are non-negative integers. Then you should check that min(๐๐ ,๐๐ ) min(๐1 ,๐1 ) min(๐2 ,๐2 ) ๐1 ๐2 . . . ๐๐ is the gcd of ๐ and ๐. โก Theorem 1.45. Every PID is a UFD. Proof of the existence of a factorization. Let ๐
be a PID, and take a non-zero element ๐ in ๐
. If ๐ is a unit or is irreducible, then we may stop. Else we can find a factor ๐1 of ๐ with ๐1 not being a unit, and ๐1 not an associate of ๐ (that is, ๐ = ๐1 ๐1 with both ๐1 and ๐1 not being units). If ๐1 is irreducible, then look at whether ๐1 is irreducible. Else extract a factor ๐2 of ๐1 , which again is neither a unit nor an associate of ๐1 . Keep proceeding in this manner. If the process terminates then we would have found a factorization into irreducibles. If the process does not terminate, then we must have a chain ๐, ๐1 , ๐2 , . . . with ๐๐+1 |๐๐ , and ๐๐+1 not a unit, and not an associate of ๐๐ . We need to show that this last situation cannot happen. Since ๐1 |๐, it follows that the ideal (๐) (being the set of multiples of ๐) is contained in the ideal (๐1 ) (because a multiple of ๐ is automatically a multiple of ๐1 ). Thus the discussion above gives a chain of ideals (๐) โ (๐1 ) โ (๐2 ) . . . . We will now show that this chain stabilizes and gives the same ideal from some point onwards. Let ๐ผ denote the union โช๐ (๐๐ ). We claim that ๐ผ is an ideal. Indeed if ๐ โ ๐ผ then for some ๐ we must have ๐ โ (๐๐ ), and therefore ๐๐ โ (๐๐ ) for any element ๐ โ ๐
, which implies ๐๐ โ ๐ผ. Similarly if ๐ and ๐ are in ๐ผ then ๐ โ (๐๐ ) and ๐ โ (๐๐ ) for some ๐ and ๐, and if ๐ โค ๐ (say) then both are contained in (๐๐ ), and therefore so is their sum, which must now also be in ๐ผ. This verifies that ๐ผ is an ideal. Since ๐
is a PID it follows that ๐ผ = (๐) from some ๐ โ ๐ผ. But then ๐ must be contained in some (๐๐ ). So for any ๐ โฅ ๐, we have (๐) โ (๐๐ ) โ (๐๐ ) โ ๐ผ = (๐), and so all ideals from (๐๐ ) onwards are equal to ๐ผ = (๐), and the chain has stabilized. Once the chain stabilizes we have (๐๐ ) = (๐๐+1 ), which means that ๐๐ and ๐๐+1 are multiplies of each other, and therefore must be associates. But this contradicts our assumption, and thus completes the proof of the existence of a factorization. โก
1.8. Euclidean domains
17
The same proof of the existence of a factorization into irreducibles would work in integral domains where every ideal is generated by finitely many elements โ such rings are called Noetherian, after the mathematician Emmy Noether.
Proof of the uniqueness of factorization. Suppose that ๐ can be factored into irreducibles as ๐ข๐1 โฏ ๐ ๐ and also as ๐ฃ๐1 โฏ ๐โ where the ๐ ๐ and ๐๐ are irreducibles. By Proposition 1.42 we know that the irreducibles ๐ ๐ and ๐๐ are also primes. Now ๐1 divides ๐1 โฏ ๐โ , and since ๐1 is prime we must have ๐1 divides ๐๐ for some ๐. Since ๐๐ is irreducible, this forces ๐1 to be an associate of ๐๐ . Since weโre in an integral domain, we can โcancelโ (but recall how we did this in Lemma 1.13) ๐1 and ๐๐ from both sides of the equation ๐ข๐1 โฏ ๐ ๐ = ๐ฃ๐1 โฏ ๐โ , and repeat the argument. This proves the uniqueness part. โก At present, we know from Example 1.37 that the integers โค form a PID and are therefore a UFD. In the next section, we shall see more examples of PIDs by generalizing the ideas in Example 1.37. There is no converse to Theorem 1.45: there are UFDs that are not PIDs. Without going into details, let us point out that the polynomial ring โค[๐ฅ] is a UFD (this may not be surprising to you, but does require proof), but we saw already in Example 1.38 that โค[๐ฅ] is not a PID.
1.8. Euclidean domains A particularly nice family of rings (which will all be PIDs) are Euclidean domains, which generalize the idea in Example 1.37. Definition 1.46. An integral domain ๐
is said to have a division algorithm if there is a โnorm functionโ ๐ โถ ๐
โ {0} โ โคโฅ0 with the following property: If ๐ and ๐ are elements of ๐
with ๐ โ 0, then there exists a โquotientโ ๐ and a โremainderโ ๐ such that ๐ = ๐๐ + ๐, and either ๐ = 0, or ๐(๐) < ๐(๐). An integral domain ๐
is called Euclidean if it possesses a division algorithm.
18
1. Primes and factorization
The key fact in the division algorithm is that the remainder ๐ can be made smaller in size (using the norm function ๐ as a notion of size) than ๐. Example 1.47. The integers โค satisfy a division algorithm with the norm ๐ being the absolute value of an integer ๐. One way to form the remainder when dividing ๐ by ๐ is to subtract an appropriate multiple of ๐ so that one lands inside the interval [0, |๐|). This is what we discussed in Example 1.37. Another possibility is to use signed remainders, and ensure that โ|๐|/2 โค ๐ < |๐|/2, so that here |๐| โค |๐|/2. One way to think of the division algorithm is that we are looking at the rational number ๐/๐ and the quotient ๐ is the largest integer below ๐/๐ (also known as the floor โ๐/๐โ). For the signed remainder case take instead the quotient to be the integer nearest to ๐/๐. Example 1.48. We now show that the Gaussian integers โค[๐] are also a Euclidean domain. The norm map is ๐(๐ + ๐๐) = ๐2 + ๐2 , which is the square of the absolute value of the complex number ๐ + ๐๐, and we claim that with this map the Gaussian integers satisfy a division algorithm. To see this, suppose ๐ผ and ๐ฝ โ 0 are in โค[๐]. Note that we can divide ๐ผ by ๐ฝ in the field โ(๐) = {๐ฅ + ๐๐ฆ โถ ๐ฅ, ๐ฆ โ โ} (see Example 1.21): one does this by โrationalizing the denominatorโ, that is, multiplying numerator and denominator by the complex conjugate ๐ฝ. So we can find rational numbers ๐ฅ and ๐ฆ such that ๐ผ = ๐ฅ + ๐๐ฆ. ๐ฝ Now take the nearest integer ๐ to ๐ฅ, and ๐ to ๐ฆ and set ๐ = ๐ + ๐ ๐ โ โค[๐]. Note that ๐ผ ๐ผ ๐ผ = ๐ฝ = ๐๐ฝ + ( โ ๐)๐ฝ, ๐ฝ ๐ฝ and we are thinking of ๐ โ โค[๐] as the quotient and ๐ผ ๐ผ โ ๐๐ฝ = ( โ ๐)๐ฝ = ((๐ฅ โ ๐) + ๐(๐ฆ โ ๐ ))๐ฝ โ โค[๐] ๐ฝ as the remainder. Since |๐ โ ๐ฅ| โค 1/2 and |๐ โ ๐ฆ| โค 1/2, we obtain ๐(๐ฝ) 1 1 . ๐(๐ผ โ ๐๐ฝ) = ๐(๐ฝ)((๐ โ ๐ฅ)2 + (๐ โ ๐ฆ)2 ) โค ( + )๐(๐ฝ) = 4 4 2 Thus we have found a remainder with smaller norm than ๐ฝ, and so the division algorithm holds. Note that above we made use of the fact that the norm ๐(๐ฅ + ๐๐ฆ) = ๐ฅ2 + ๐ฆ2 may be thought of also as a function on
1.8. Euclidean domains
19
โ(๐) and satisfies the multiplicative property that ๐(๐ผ๐ฝ) = ๐(๐ผ)๐(๐ฝ) (see Example 1.18). We should add a warning here that even though the same word โnormโ is used in Example 1.18 and in the definition of the division algorithm, the two notions are distinct. In particular, the norm in the definition of the division algorithm need not be multiplicative (see the next example). Exercises 17 and 18 will give further examples of Euclidean domains where variants of this technique work. It can be quite difficult to determine whether a given integral domain is Euclidean or not. For instance, for a long time it was unknown whether the ring โค[โ14] is Euclidean, and only recently has this been determined to be Euclidean (due to M. Harper [13]). Example 1.49. The polynomial ring over a field ๐ฝ, namely ๐ฝ[๐ฅ], is our third (and important) example of a Euclidean domain. The Euclidean norm function here is the degree of a polynomial. The division algorithm is given by long division of polynomials. Suppose we want to divide ๐(๐ฅ) = ๐๐ ๐ฅ๐ + . . . + ๐0 by ๐(๐ฅ) = ๐๐ ๐ฅ๐ + . . . + ๐0 (with ๐(๐ฅ) โ 0) and extract a remainder of degree < ๐. If ๐ < ๐, then simply write ๐(๐ฅ) = 0 โ
๐(๐ฅ) + ๐(๐ฅ). If ๐ โฅ ๐, then note that ๐(๐ฅ) โ (๐๐ /๐๐ )๐ฅ๐โ๐ ๐(๐ฅ) is a polynomial of degree โค (๐ โ 1), and we can now try to divide this polynomial by ๐(๐ฅ) and extract a remainder. So by induction the proof goes through. Notice that the norm used here, the degree of a polynomial, is not multiplicative. Indeed the degree of the product of two polynomials is the sum of the degrees of the factors. Note that the key property used here is that (๐๐ /๐๐ ) makes sense because we are working over a field ๐ฝ. It would not be enough to work just over an integral domain. For example in the polynomial ring โค[๐ฅ] we cannot divide ๐ฅ2 by 2๐ฅ and get a remainder of degree < 1. In fact, we shall see shortly that โค[๐ฅ] is not a Euclidean domain. Proposition 1.50. Every Euclidean domain is a principal ideal domain. Proof. The proof follows closely the argument in Example 1.37. Suppose ๐
is a Euclidean domain, and let ๐ผ be an ideal in ๐
. If ๐ผ = {0} there is nothing to prove. Suppose then that ๐ผ is larger, and look at the norms
20
1. Primes and factorization
of all the non-zero elements of ๐ผ. All these norms lie in the set of nonnegative integers, and so we may find an element ๐ โ ๐ผ (with ๐ โ 0) of smallest norm. We claim that the ideal ๐ผ is the set of multiples of ๐. Suppose instead that ๐ is an element of ๐ผ with ๐ not dividing ๐. Then we may write (by the division algorithm) ๐ = ๐๐ + ๐ with ๐ โ 0 and ๐(๐) < ๐(๐). Since ๐ = ๐ โ ๐๐, we must also have ๐ โ ๐ผ, but this contradicts the minimality of ๐(๐). Therefore ๐ผ is the principal ideal (๐). โก Example 1.51. The ring โค[๐ฅ] is not a principal ideal domain, and therefore not a Euclidean domain. Exercise 19 shows that the ring ๐
= โค[(1+ โโ19)/2] is not a Euclidean domain. However one can show that this ring is a PID; thus the converse to Proposition 1.50 does not hold. Since every Euclidean domain is a PID, and every PID is a UFD, we conclude that the Gaussian integers and the polynomial ring over a field are both UFDs. In the next chapter, we shall discuss primes in the usual integers. Later in ยง3.4 we shall discuss what primes look like in the Gaussian integers, and in ยง4.1 we shall discuss primes in the polynomial ring over a field, which will be of importance in our construction of finite fields. Integral domains: โค[โโ5], โค[โ15], โค[โโ13] UFD: โค[๐ฅ], โ[๐ฅ, ๐ฆ] PID: โค[(1 + โโ19)/2], โค[(1 + โโ163)/2] Euclidean domains: โค, โค[๐], ๐ฝ[๐ฅ], โค[โ14], โค[โ2]
The figure above depicts the inclusions among our notions of integral domains, UFDโs, PIDโs, and Euclidean domains, and also gives examples (just for information, and not with complete proofs) to show that
1.9. Exercises
21
these inclusions are strict. Some, but by no means all, of these examples will be discussed further in the exercises. We end this chapter with one last remark on gcdโs. In a UFD we saw that the gcd of any two elements ๐ and ๐ (not both zero) exists, and in a PID we saw that the gcd may be expressed as a linear combination ๐๐ฅ + ๐๐ฆ with ๐ฅ, ๐ฆ โ ๐
. In a Euclidean domain, we can go one step better and give an algorithm to compute the gcd, and to find ๐ฅ and ๐ฆ as well. This is known as the Euclidean algorithm. The Euclidean algorithm. Let ๐ and ๐ be two elements (not both zero) in a Euclidean domain ๐
. If ๐ = 0 then the gcd is ๐ (or an associate of ๐), and clearly the gcd is ๐ ร 1 + ๐ ร 0. If ๐ โ 0, then use the division algorithm to write ๐ = ๐๐ + ๐; if ๐ = 0 then ๐ is the gcd. If ๐ โ 0, then ๐(๐) < ๐(๐) (by the division algorithm), and now note that the gcd of ๐ and ๐ is the same as the gcd of ๐ and ๐ (check this carefully!). Said differently, the ideal (๐, ๐) is the same as the ideal (๐, ๐). Now use the same procedure with the pair ๐, ๐ replaced by the pair ๐, ๐. Note that if you have an expression for the gcd of ๐ and ๐ as ๐๐ฃ + ๐๐ค then substituting ๐ = ๐ โ ๐๐ we obtain a linear combination of ๐ and ๐, namely ๐๐ฃ + (๐ โ ๐๐)๐ค = ๐๐ค + ๐(๐ฃ โ ๐๐ค). Note that the Euclidean algorithm works by progressively finding elements of smaller norm in the ideal (๐, ๐) until we find a non-zero element with smallest norm. Compare this with the proof of Proposition 1.50. Finally note that in โค (use signed remainders), or โค[๐], the Euclidean algorithm is very rapid since at each step the norm decreases (at least) by a factor of 2. We havenโt discussed precisely what it means to be a rapid algorithm, but we will turn to this in Chapter 8.
1.9. Exercises 1. Let ๐บ be a group. (i) Show that every element ๐ โ ๐บ has a unique inverse. (ii) Suppose that for any two elements ๐ฅ and ๐ฆ in ๐บ we have (๐ฅ๐ฆ)โ1 = ๐ฅ ๐ฆ . Show that ๐บ is abelian. โ1 โ1
22
1. Primes and factorization
2. Consider โ2 = {(๐ฅ, ๐ฆ) โถ ๐ฅ, ๐ฆ โ โ} with operations of + and ร defined by component-wise addition and multiplication. Give a brief explanation of why โ2 is a ring with these operations. Is this ring an integral domain? Describe the units and zero divisors (if any) in this ring. 3. Let ๐ โ 0 denote a symbol with ๐2 = 0. Define a ring โค[๐] = {๐ + ๐๐ โถ ๐, ๐ โ โค} with the natural way of adding and multiplying (subject to the ๐ ร ๐ = 0 requirement). This is vague, but what I really want is for you to work out what is intended, and it should remind you of calculus and โinfinitesimalsโ. Is this ring an integral domain? Describe the units in this ring. 4. In any ring ๐
, show that if ๐ข is a unit then so are the powers ๐ข๐ for any ๐ โ โค. (Interpret ๐ข๐ as ๐ข multiplied by itself ๐ times, for positive integers ๐; interpret ๐ข0 as 1; and ๐ขโ๐ as (๐ขโ1 )๐ .) 5. Show that โค[โ2] = {๐ + ๐โ2 โถ ๐, ๐ โ โค}, โค[โ3] = {๐ + ๐โ3 โถ ๐, ๐ โ โค} and โค[โ7] = {๐ + ๐โ7 โถ ๐, ๐ โ โค} are all rings, and indeed integral domains (with usual addition and multiplication). In explaining why these are integral domains, you may assume that โ2, โ3 and โ7 are irrational, but you must explain why that is relevant. In this problem, I donโt want you to think of โ2, โ3, โ7 as real numbers (and therefore of these rings as subrings of the real numbers), but instead as just symbols whose squares equal 2, 3 and 7, rather like ๐ in Problem 3 which we could have thought of as โ0. 6. Show that the rings โค[โ2], โค[โ3] and โค[โ7] all have infinitely many units. 7. Define โ(๐) = {๐ + ๐๐ โถ ๐, ๐ โ โ} and โ(โ7) = {๐ + ๐โ7 โถ ๐, ๐ โ โ}. Show that these are examples of fields. 8. Let ๐
be a finite ring. Let ๐ be an element of ๐
, and assume that ๐ โ 0 and that ๐ is not a zero divisor. Show that the map ๐๐ โถ ๐
โ ๐
defined by ๐๐ (๐) = ๐๐ (thus ๐๐ is the map โmultiplication by ๐โ) is a bijection. Conclude that ๐ is a unit. 9. Let ๐ผ and ๐ฝ be two ideals in a ring ๐
. Prove that ๐ผ โฉ ๐ฝ is also an ideal in ๐
.
1.9. Exercises
23
10. Given two ideals (๐) and (๐) in the integers โค, describe the ideal (๐) โฉ (๐). Is (๐) โช (๐) necessarily an ideal? Describe the smallest ideal that contains both (๐) and (๐). 11. Consider the ring โค[โโ5] = {๐ + ๐โโ5 โถ ๐, ๐ โ โค} and define the norm ๐(๐+๐โโ5) = ๐2 +5๐2 . (Note: we are only calling this function a norm, but it is not required to satisfy the properties of a (Euclidean) norm as in Definition 1.46. Indeed the point of this exercise is to show that โค[โโ5] is not a UFD, and hence not a PID, and hence not a Euclidean domain.) (i) Prove that the norm is multiplicative: that is, ๐(๐ผ๐ฝ) = ๐(๐ผ)๐(๐ฝ) for any ๐ผ, ๐ฝ in the ring. Determine the units in the ring. Show that if the norm of an element is prime (as an integer) then that element is irreducible. (ii) Prove that 2, 3, 1 + โโ5 and 1 โ โโ5 are all irreducibles, and so 6 = 2 ร 3 = (1 + โโ5)(1 โ โโ5) is a genuine failure of uniqueness of factorization into irreducibles. Thus โค[โโ5] is not a UFD. (iii) Give two elements ๐, ๐ in this ring for which no greatest common divisor exists. (iv) Give an example of an ideal in this ring that is not principal. 12. Using the norm in Exercise 11 as a notion of size, show that every non-zero element in โค[โโ5] can be factored into irreducibles. 13. Let ๐
be a ring, and ๐ด and ๐ต be two ideals in ๐
. Define ๐ด๐ต to be the ๐ set of all elements in ๐
of the form โ๐=1 ๐๐ ๐๐ for any natural number ๐, and with ๐๐ โ ๐ด and ๐๐ โ ๐ต. Show that ๐ด๐ต is an ideal of ๐
. 14. Let ๐
be the ring โค[โโ5] and define the four ideals ๐ด = (2, 1 + โโ5), ๐ต = (3, 1 + โโ5), ๐ถ = (2, 1 โ โโ5), ๐ท = (3, 1 โ โโ5). (i) Show that ๐ด = ๐ถ, and compute the products (as defined in Exercise 13) ๐ด๐ต, ๐ด๐ถ, ๐ต๐ท, and ๐ถ๐ท. (ii) As ideals in ๐
, note the factorizations (6) = (2) ร (3) = (1 + โโ5) ร (1 โ โโ5).
24
1. Primes and factorization
How does your work in part (i) suggest a way to restore unique factorization (at the level of ideals)? Explain briefly. Historically, ideals originated in attempts to rectify the failure of unique factorization that was observed in rings such as โค[โโ5]. Nineteenth century mathematicians were motivated by problems such as Fermatโs last theorem to study factorization in general integral domains, and recognized that the failure of unique factorization foiled many attempts at proving Fermatโs last theorem. This story is part of algebraic number theory, and see [17] for an introduction. 15. A ring (commutative with identity, as usual) is called Noetherian if every ideal can be generated by finitely many elements in the ring. Let ๐
be an integral domain, and suppose ๐
is Noetherian. Show that all non-zero elements in ๐
admit a factorization into irreducibles. 16. Let ๐
be a Euclidean domain with associated โnorm functionโ ๐. If ๐(๐) = 0 for some non-zero element ๐ of ๐
, show that ๐ must be a unit. 17. (i) Let ๐ be a positive integer congruent to 3 (mod 4). Show that โค[(1 + โโ๐)/2] = {๐ + ๐(1 + โโ๐)/2 โถ ๐, ๐ โ โค} is an integral domain. (ii) Define the norm ๐ 2 ๐๐2 ๐(๐ + ๐(1 + โโ๐)/2) = (๐ + ) + . 2 4 Prove that this function takes values in the non-negative integers, and is multiplicative ๐(๐ผ๐ฝ) = ๐(๐ผ)๐(๐ฝ) for any two elements in the ring. (iii) Prove that when ๐ = 3, 7, and 11 these rings are Euclidean. 18. Show that the rings โค[โ2] = {๐ + ๐โ2 โถ ๐, ๐ โ โค}, โค[โ3] = {๐ + ๐โ3 โถ ๐, ๐ โ โค}, and โค[โโ2] = {๐+๐โโ2 โถ ๐, ๐ โ โค} are all Euclidean domains. Hint: Try to generalize the notion of norm from Exercise 17 (multiply by an appropriate โconjugateโ) and see whether it satisfies the division algorithm. 19. This exercise shows that the ring ๐
= โค[(1 + โโ19)/2] is not Euclidean. (i) Prove that the only units of ๐
are ยฑ1.
1.9. Exercises
25
(ii) Suppose there is a norm function on ๐
that makes ๐
Euclidean (this need not be the same function as in Exercise 17). Let ๐ be an element in ๐
with ๐ โ 0, ยฑ1 and having smallest norm. Prove that for any ๐ โ ๐
, we must have ๐ |๐ or ๐ |(๐ + 1) or ๐ |(๐ โ 1). (iii) Taking ๐ = 2, and now using the norm in Exercise 17 (or otherwise), show that ๐ must be ยฑ2 or ยฑ3. Show that neither ยฑ2 nor ยฑ3 has the property given in (ii) above, completing the proof.
Chapter 2
Primes in the integers
In this chapter, we discuss in more detail the prime elements in the ring of integers โค. Multiplying by one of the units ยฑ1, we may restrict attention to the positive integers that are prime, which is the familiar sequence that begins with 2, 3, 5, 7, . . . . The existence and uniqueness of factorization of integers into primes is sometimes called the Fundamental Theorem of Arithmetic, and we know this already from our work in Chapter 1. After giving a few different proofs of the infinitude of primes, the main result of this chapter establishes Bertrandโs postulate that there is always a prime between ๐ and 2๐.
2.1. The infinitude of primes 2.1.1. Euclidโs proof. You may already be familiar with the classical proof of Euclid. Suppose ๐1 , . . ., ๐๐ are distinct primes (which we will take to be positive integers), and consider ๐ = ๐1 โฏ ๐๐ + 1. Then ๐ is a natural number which is not divisible by the primes ๐1 , . . ., ๐๐ (since it leaves a remainder 1 when divided by any of these primes). If ๐ (which is larger than 1 and therefore not a unit) is factored into primes, the primes appearing in this factorization cannot be among ๐1 , . . ., ๐๐ . Therefore there is at least one prime different from ๐1 , . . ., ๐๐ , and so there are infinitely many primes. Here is a variant of Euclidโs argument. For each ๐ โฅ 1 we claim that there is a prime larger than ๐, and so there are infinitely many primes. 27
28
2. Primes in the integers
Just look at ๐! +1; it cannot be divisible by any prime โค ๐, and therefore any prime factor of ๐! +1 is an example of a prime larger than ๐. 2.1.2. Primes and the natural numbers. In this second proof, we will use some easy counting ideas to show that there must be infinitely many primes. The idea is simple: all natural numbers are built out of primes, and we know there are lots of natural numbers. If there are only finitely many primes, we can then show that there cannot be too many natural numbers, which would be a contradiction. Suppose there are only finitely many primes ๐1 , . . ., ๐๐ . Then every ๐ ๐ natural number ๐ can be expressed as ๐1 1 โฏ ๐๐๐ by the fundamental theorem, where the exponents ๐1 , . . ., ๐๐ are non-negative integers. Now each exponent ๐๐ is either even or odd, and so we can express it as ๐๐ = 2๐๐ + ๐๐ where ๐๐ = 0 or 1, and ๐๐ is non-negative. With this notation, ๐ ๐ we see that ๐ can be written as ๐๐2 , where ๐ = ๐11 โฏ ๐๐๐ is a square-free number (composed of the primes ๐1 , . . ., ๐๐ each appearing to exponent ๐ ๐ at most 1), and ๐ = ๐1 1 โฏ ๐๐๐ . Now let us count how many natural numbers there are up to ๐ (which is assumed to be a large natural number). Obviously the answer is ๐. However, by our analysis above, this is also the same as counting numbers of the form ๐๐2 below ๐ with ๐ square-free. The number of possible choices for ๐ is 2๐ , since there are only ๐ primes and for each prime there are two choices for the exponent. For each ๐, there are at most โ๐ permissible choices for ๐. Therefore, counted this way, there can only be โค 2๐ โ๐ natural numbers below ๐. Thus we must have ๐ โค 2๐ โ๐, which is plainly nonsense by choosing ๐ = 4๐ + 1 say. Therefore there must be infinitely many primes. For any real number ๐ฅ, we denote by ๐(๐ฅ) the number of primes below ๐ฅ. We have now seen two proofs that ๐(๐ฅ) โ โ as ๐ฅ โ โ. The second proof gives us a little more precise information. Namely, it shows that for any natural number ๐ we must have ๐ โค 2๐(๐) โ๐. Rearranging, we obtain that ๐(๐) โฅ log2 โ๐ =
log ๐ , 2 log 2
2.1. The infinitude of primes
29
where for us log will always mean the natural logarithm (that is, logarithm to the base ๐). This is not a very good bound, but it is a small first step in quantifying how ๐(๐) tends to infinity with ๐. 2.1.3. Primes and information. This is a small variant of our previous proof, but it admits an amusing interpretation. Suppose ๐1 , . . ., ๐๐ are all the primes. Then how many positive integers can there be less ๐ ๐ than 2๐ ? Each such integer may be written as ๐1 1 โฏ ๐๐๐ , where the exponents ๐๐ must be integers satisfying 0 โค ๐๐ < ๐ (since the primes are all at least 2). Therefore each exponent has at most ๐ possibilities, and so there can be at most ๐ ๐ positive integers below 2๐ . But the true answer is 2๐ โ 1, and if ๐ is chosen to be very large in comparison to ๐, the exponential growth of 2๐ โ 1 will overwhelm the polynomial bound ๐ ๐. Now for the interpretation. How many bits of information are needed to specify all the positive integers up to 2๐ ? Clearly at least ๐ bits are needed. If there were only finitely many primes ๐1 , . . ., ๐๐ , then the numbers below 2๐ may be specified by giving the exponents ๐1 , . . ., ๐๐ appearing in their prime factorization. But the exponents are nonnegative integers below ๐, and each such exponent may be specified using โlog2 ๐โ bits using the binary expansion. It follows that all numbers up to 2๐ may be specified using โค ๐โlog2 ๐โ bits, which is absurd because for large ๐ the function ๐ log2 ๐ (note that ๐ is a constant here) grows much more slowly than ๐. 2.1.4. Eulerโs proof of the infinitude of primes. Our next proof is due to Euler, and this proof is notable as the first to introduce ideas from analysis to study primes. Throughout the letter ๐ will be used to denote prime numbers. The idea is to consider for any natural number ๐, the following product over all the primes below ๐, 1 โ1 โ (1 โ ) . ๐ ๐โค๐ By the geometric series the above equals โ (1 + ๐โค๐
1 1 1 + + + . . . ). ๐ ๐2 ๐3
30
2. Primes in the integers
Multiply out the terms in this product (try it for ๐ = 3 say). Many terms will arise; for example, if ๐ โฅ 3 then we will get terms like 1/(2๐ 3๐ ) by taking the 1/2๐ term in the ๐ = 2 expression, and the 1/3๐ term in the ๐ = 3 expression. Explain why if the factorization of ๐ is composed only of primes below ๐ then 1/๐ will appear as a term when expanding out the product. Explain why such a term 1/๐ will appear exactly once. Therefore (2.1)
โ (1 + ๐โค๐
1 1 + ... ) = + ๐ ๐2
โ ๐ ๐|๐ โน ๐โค๐
1 , ๐
where the sum is over all natural numbers ๐ whose prime factors are all at most ๐. Note that ๐ = 1 is included in the sum, since the condition ๐|๐ โน ๐ โค ๐ is then vacuously true. Now consider the sum on the right side of (2.1). All the terms that appear there are positive. Moreover, any ๐ โค ๐ must appear on the right side of (2.1), since all the primes dividing such ๐ are necessarily at most ๐. Therefore, the right side of (2.1) is at least the harmonic sum ๐
1 . ๐ ๐=1
๐ป๐ โ โ
(2.2)
So far our argument gives that for any ๐ โฅ 1 one has ๐
(2.3)
โ (1 โ ๐โค๐
1 โ1 1 ) โฅ โ . ๐ ๐ ๐=1
You may already know that the harmonic sum ๐ป๐ tends to infinity as ๐ โ โ, and we shall make this more precise soon. If you grant that, then (2.3) gives another proof of the infinitude of primes: If there were only finitely many primes, then the left side of (2.3) would remain bounded (after some point the product wonโt change) as ๐ โ โ, whereas we know that the right side goes to infinity. We now work out good bounds for ๐ป๐ , and extract a little bit more out of our work in (2.3). Lemma 2.1. For all natural numbers ๐ โฅ 1 we have ๐
1 โค log ๐ + 1. ๐ ๐=1
log(๐ + 1) โค ๐ป๐ = โ
2.1. The infinitude of primes
31
Proof. The lemma makes two assertions: the lower bound that ๐ป๐ โฅ log(๐ + 1), and the upper bound that ๐ป๐ โค log ๐ + 1. To prove both of these, let us note the intermediate set of inequalities ๐+1
1 โคโซ ๐+1 ๐
(2.4)
๐๐ก 1 โค , ๐ก ๐
for all natural numbers ๐ โฅ 1. These inequalities follow because for ๐ โค ๐ก โค ๐ + 1, one has 1/(๐ + 1) โค 1/๐ก โค 1/๐. Using the lower bound for 1/๐ in (2.4) for ๐ = 1, . . ., ๐ we obtain ๐
๐
1 โฅ โโซ ๐ ๐=1 ๐=1 ๐ โ
๐+1
๐๐ก =โซ ๐ก 1
๐+1
๐๐ก = log(๐ + 1), ๐ก
which is the lower bound for ๐ป๐ that we want. Using the upper bound for 1/(๐ + 1) in (2.4) for ๐ = 1, . . ., ๐ โ 1, we obtain ๐โ1
๐โ1
1 โค1+ โ โซ ๐+1 ๐=1 ๐
๐ป๐ = 1 + โ ๐=1
๐+1
๐
๐๐ก ๐๐ก =1+โซ = 1 + log ๐. ๐ก ๐ก 1
This gives our upper bound for ๐ป๐ , and completes the proof.
โก
Putting everything together, we have shown that โ (1 โ
(2.5)
๐โค๐
1 โ1 1 ) โฅ โ โฅ log(๐ + 1). ๐ ๐ ๐โค๐
As we noted already, this proves the infinitude of primes, since the right side of (2.5) visibly tends to infinity as ๐ โ โ. We now refine this proof, and show that the sum of reciprocals of the primes diverges. Taking logarithms on both sides of (2.5), we obtain (2.6)
log โ (1 โ ๐โค๐
1 โ1 1 โ1 ) = โ log (1 โ ) โฅ log log(๐ + 1). ๐ ๐ ๐โค๐
Now observe that for any ๐ฅ โฅ 0 one has 1+๐ฅ
log(1 + ๐ฅ) = โซ 1
๐๐ก โคโซ ๐ก 1
1+๐ฅ
๐๐ก = ๐ฅ.
Therefore log (1 โ
๐ 1 โ1 1 1 = log (1 + , ) = log )โค ๐ ๐โ1 ๐โ1 ๐โ1
32
2. Primes in the integers
and inputting this estimate in (2.6), we conclude that โ
(2.7)
๐โค๐
1 โฅ log log(๐ + 1). ๐โ1
This is almost what we want, except that weโd prefer to obtain a bound for the closely related โ๐โค๐ 1/๐ instead. Observe that โ ๐โค๐
1 1 1 , = โ + โ ๐ โ 1 ๐โค๐ ๐ ๐โค๐ ๐(๐ โ 1)
and the second sum in the right side above may be bounded by โค โ 2โค๐โค๐
1 1 1 1 = โ ( โ )=1โ , ๐ ๐(๐ โ 1) 2โค๐โค๐ ๐ โ 1 ๐
where the last equality holds by โtelescoping.โ Using this in (2.7), we finally obtain 1 โ + 1 โฅ log log(๐ + 1), ๐ ๐โค๐ or in other words (2.8)
โ ๐โค๐
1 โฅ log log(๐ + 1) โ 1. ๐
We know that the harmonic sum ๐ป๐ grows to infinity with ๐, and Lemma 2.1 gives a quantification of how it grows. Similarly, from (2.8) we know that the sum of the reciprocals of the primes diverges, and moreover we can quantify the rate at which โ๐โค๐ 1/๐ tends to infinity. Note that there can be infinite sequences of natural numbers, whose sum of reciprocals is nevertheless convergent. For example, the perfect squares are an infinite sequence, but the sum of their reciprocals converges. Indeed, another famous achievement of Euler was to show that โ โ๐=1 1/๐2 = ๐2 /6. In a sense, the divergence of the sum of reciprocals of primes indicates that there are more primes than squares. Weโll discuss in Section 2.3 a little bit more about how ๐(๐ฅ) (the number of primes below ๐ฅ) grows with ๐ฅ.
2.2. Bertrandโs postulate The goal of this section is to prove the main result of this chapter, Bertrandโs postulate.
2.2. Bertrandโs postulate
33
Theorem 2.2. For every natural number ๐ โฅ 1, there is a prime ๐ with (๐ + 1) โค ๐ โค 2๐. Although the result is named after Bertrand, it was first proved by the Russian mathematician Chebyshev in 1850. We give a proof due to Paul Erdลs which builds upon an idea of Ramanujan. The central idea in this proof is to consider the middle binomial coefficients (2๐)! 2๐ , ( )= ๐ ๐! ๐! which we know combinatorially to be an integer since it counts the number of ways of choosing ๐ objects out of 2๐. We approach this binomial coefficient in two different ways: (i) by computing its prime factorization (giving in passing a different proof that it is an integer), and (ii) by using that it is the largest of the binomial coefficients (2๐ ) to give lower ๐ bounds on its size. If there are no primes ๐ in the range ๐ + 1 โค ๐ โค 2๐, then from the prime factorization we can obtain upper bounds for the size of (2๐ ) which will be seen to contradict the lower bounds obtained ๐ in (ii). Let us begin our understanding of the factorization of (2๐ ) by first ๐ determining the prime factorization of ๐!. Lemma 2.3. For any ๐ โ โ we may factor ๐! as ๐! = โ ๐๐๐ ๐โค๐
where the exponents ๐๐ are given by โ
๐ ๐ ๐ ๐๐ = โ โ + โ 2 โ + . . . = โ โ ๐ โ. ๐ ๐ ๐ ๐=1 Note that the sum in the lemma is really just a finite sum: once ๐๐ exceeds ๐, we have โ๐/๐๐ โ = 0. Thus only the terms ๐ up to log๐ ๐ = (log ๐)/(log ๐) are relevant. Proof. Since ๐! = 1 ร 2 ร โฏ ร ๐, the prime factorization of ๐! can only involve the primes below ๐. So what really needs proving is the formula for the exponents ๐๐ . How many natural numbers up to ๐ are multiples of ๐? Since the multiples of ๐ below ๐ are of the form ๐๐ with 1 โค ๐ โค ๐/๐, the answer
34
2. Primes in the integers
is clearly โ๐/๐โ. Each of these multiples of ๐ will contribute 1 towards the exponent ๐๐ , but some may contribute more than 1. The multiples of ๐2 will contribute at least 2, and there are โ๐/๐2 โ of these. And then the multiples of ๐3 will contribute at least 3, and these will be counted thrice in our formula: once from being a multiple of ๐, once from being a multiple of ๐2 and once from being a multiple of ๐3 . And so on. โก Lemma 2.3 allows us to compute the prime factorization of (2๐ ). ๐ Proposition 2.4. The prime factorization of (2๐ ) is given by ๐ (
2๐ ) = โ ๐๐๐ , ๐ ๐โค2๐
where the exponents ๐๐ are determined by โ
(2.9)
๐๐ = โ (โ ๐=1
2๐ ๐ โ โ 2โ ๐ โ). ๐๐ ๐
The exponents ๐๐ satisfy the following properties: (i) For all ๐ we have 0 โค ๐๐ โค โlog(2๐)/ log ๐โ. (ii) If ๐ > โ2๐ then ๐๐ = 0 or 1. (iii) If ๐ โฅ 5 and 2๐/3 < ๐ โค ๐ then ๐๐ = 0. (iv) If (๐ + 1) โค ๐ โค 2๐ then ๐๐ = 1. Proof. Applying Lemma 2.3, we see that the power of ๐ that divides โ (2๐)! is โ๐=1 โ2๐/๐๐ โ, while the power of ๐ that divides (๐! )2 is โ 2 โ๐=1 โ๐/๐๐ โ. Subtracting the second quantity from the first gives the power of ๐ dividing (2๐ ), and this establishes the formula (2.9) for ๐๐ . ๐ Let us define a function ๐ by setting ๐(๐ฅ) = โ2๐ฅโ โ 2โ๐ฅโ โ
so that the formula for ๐๐ may be written as ๐๐ = โ๐=1 ๐(๐/๐๐ ). Note that ๐(๐ฅ + 1) = โ2(๐ฅ + 1)โ โ 2โ๐ฅ + 1โ = โ2๐ฅโ + 2 โ 2(โ๐ฅโ + 1) = ๐(๐ฅ).
2.2. Bertrandโs postulate
35
Thus ๐ is periodic in ๐ฅ with period 1, and so it is enough to understand what ๐ does for 0 โค ๐ฅ < 1. Here we may quickly check that 0 ๐(๐ฅ) = { 1
if 0 โค ๐ฅ < if
1 2
1 2
โค ๐ฅ < 1.
In other words, ๐(๐ฅ) takes only the values 0 (if the โfractional partโ of ๐ฅ is < 1/2) and 1 (if the โfractional partโ is โฅ 1/2). We now establish the four assertions on ๐๐ . Note that the sum in (2.9) is really finite, and we need only consider terms ๐๐ โค 2๐, or in other words ๐ โค (log(2๐))/ log ๐. Therefore, for all ๐ we have โ
๐๐ =
๐(๐/๐๐ ) โค
โ ๐โค(log 2๐)/ log ๐
๐โค(log(2๐))/ log ๐
1=โ
log(2๐) โ, log ๐
which gives the first assertion (i). Further, if ๐ > โ2๐ then only the term ๐ = 1 in (2.9) can be non-zero, and so ๐๐ = ๐(๐/๐) = 0 or 1, which proves (ii). If ๐ โฅ 5 then 2๐/3 > โ2๐, and therefore in the range 2๐/3 < ๐ โค ๐ we have ๐๐ = ๐(๐/๐) = 0 because 1 โค ๐/๐ < 3/2. This proves assertion (iii). Finally, if (๐ + 1) โค ๐ โค 2๐, then automatically ๐ > โ2๐ and so 1 โก ๐๐ = ๐(๐/๐) = 1 since 2 โค ๐/๐ < 1. This yields assertion (iv). Next we give a lower bound for the size of the middle binomial coefficient (2๐ ). ๐ Proposition 2.5. For ๐ โฅ 1 we have (
2๐ 22๐ . )โฅ 2๐ ๐
Proof. If ๐ โฅ 1 then the middle binomial coefficient is the largest of the binomial coefficients (2๐ ) (check!), and moreover it is at least 2 = ๐ ). Thus ) + (2๐ (2๐ 2๐ 0 (
1 2๐ 2๐ 2๐ 2๐ 2๐ )โฅ ({( ) + ( )} + ( ) + . . . + ( )), ๐ 2๐ 0 2๐ 1 2๐ โ 1
and since 2๐ 2๐ 2๐ ( ) + ( ) + . . . + ( ) = (1 + 1)2๐ = 22๐ , 0 1 2๐
36
2. Primes in the integers โก
the stated lower bound follows. Proposition 2.6. For all real numbers ๐ฅ โฅ 1 we have โ ๐ โค 4๐ฅ . ๐โค๐ฅ
We now prove Bertrandโs postulate, assuming the validity of Proposition 2.6. We shall prove Proposition 2.6 immediately afterwards. Proof of Theorem 2.2. Observe that 2, 3, 5, 7, 13, 23, 43, 83, 163, 317, 631 is a sequence of prime numbers with each successive term being less than twice the previous one. Do you see why this verifies Bertrandโs postulate for ๐ up to 630? It remains to consider larger values of ๐. Let us suppose that ๐ โฅ 631 is such that there is no prime in [๐ + 1, 2๐]. By Proposition 2.4 and the assumption that there is no prime in [๐ + 1, 2๐] it follows that 2๐ ( ) = โ ๐๐๐ โค โ ๐log(2๐)/ log ๐ ๐ ๐โค2๐/3 ๐โคโ2๐
โ
๐.
โ2๐ 6/ log 2 = 8.656 . . ., and therefore for all ๐ฆ โฅ 32 we have ๐(๐ฆ) โฅ ๐(32) = 32 โ 6 ร 5 = 2 > 0. Since ๐ฅ = โ2๐ โฅ โ2 ร 631 > โ1024 = 32, we have arrived at a contradiction! Therefore for ๐ โฅ 631 there must be a prime in the interval [๐ + 1, 2๐], and our proof of Bertrandโs postulate is complete. โก It remains lastly to establish Proposition 2.6. Proof of Proposition 2.6. It suffices to establish the proposition when ๐ฅ is an integer. To establish the integer case, we argue by (strong) induction. Clearly the result is true for ๐ฅ = 1 and ๐ฅ = 2. Now suppose the result holds for all integers 1, 2, . . ., ๐ฅ โ 1 and we want to establish it for ๐ฅ. If ๐ฅ โฅ 4 is even, then ๐ฅ is not prime, and using the induction hypothesis we find โ ๐ = โ ๐ โค 4๐ฅโ1 < 4๐ฅ . ๐โค๐ฅ
๐โค๐ฅโ1
Therefore we may suppose that ๐ฅ = 2๐+1 is odd. Observe that every prime ๐ in the range ๐ + 2 โค ๐ โค 2๐ + 1 divides the binomial coefficient (2๐+1)! (2๐+1 ) = ๐!(๐+1)! , since such primes visibly divide the numerator but not ๐ the denominator. Therefore โ
๐โค(
๐+2โค๐โค2๐+1
2๐ + 1 ), ๐
and combining this with our induction hypothesis we find (2.10)
โ ๐= โ ๐ร ๐โค2๐+1
๐โค๐+1
โ ๐+2โค๐โค2๐+1
๐ โค 4๐+1 ร (
2๐ + 1 ). ๐
38
2. Primes in the integers
Now (2๐+1 ) and so ) = (2๐+1 ๐+1 ๐ 2(
2๐ + 1 2๐ + 1 2๐ + 1 )=( )+( ) ๐ ๐ ๐+1 1. Riemann showed that one can extend the definition of ๐(๐ ), by a process known as analytic continuation, to the entire complex plane (apart from a singularity at ๐ = 1). He then gave a marvelous explicit formula connecting prime numbers with the zeros of the zeta function. Riemann realized that Gaussโs conjecture for ๐(๐ฅ) could be resolved if ๐(๐ ) โ 0 for complex numbers ๐ with Re(๐ ) โฅ 1. Based in part on numerical investigations, Riemann conjectured that all non1 trivial zeros of ๐(๐ ) lie on a line with Re(๐ ) = 2 โ this is the famous Riemann Hypothesis. Eventually in 1895 the prime number theorem was established by Hadamard and de la Vallรฉe Poussin, by pushing through Riemannโs plan. The Riemann Hypothesis however is still unsolved, and has become one of the most important open problems in mathematics. Here is an easily understandable equivalent form of the Riemann Hypothesis, stated just
2.4. Exercises
41
in terms of prime numbers: For all ๐ฅ โฅ 2657, ๐ฅ
|๐(๐ฅ) โ โซ | 0
๐๐ก | 1 โ๐ฅ log ๐ฅ. โค log ๐ก | 8๐
10
For example, up to 10 there are 455052511 primes, and the difference between this and the approximation li(1010 ) is only about 3100. For more information on prime numbers and number theory, take a look at [18, 21, 27].
2.4. Exercises ๐
1. Prove that ๐|๐๐ if and only if (๐,๐) |๐. Here, and elsewhere, (๐, ๐) denotes the gcd of the integers ๐ and ๐. The notation (๐, ๐) is identical to the notation for the ideal generated by ๐ and ๐; this is apt because the ideal generated by ๐ and ๐ is a principal ideal generated by their gcd. 2. Show that ๐|(๐ โ 1)! for every composite number ๐ > 4. (A natural number bigger than 1 is called composite if it is not prime.) 3. For every ๐ > 1 show that ๐4 + ๐2 + 1 is not prime. 4. Irrational numbers. The following are in ascending order of difficulty: although the last part contains all others, you may want to do the parts in order to get an idea of how to prove that. (i) Show that โ๐ is irrational for any prime ๐. (ii) Show that โ๐ is irrational unless ๐ is the square of an integer. (iii) Suppose ๐ผ is a solution to the polynomial equation ๐ฅ๐ +๐1 ๐ฅ๐โ1 + ๐2 ๐ฅ + . . . + ๐๐ = 0 where ๐1 , . . ., ๐๐ are integers. Show that either ๐ผ is an integer or ๐ผ is irrational. ๐โ2
5. Show that for all ๐ โ โ we have (๐! +1, (๐ + 1)! +1) = 1. 6. Let ๐น๐ denote the Fibonacci sequence defined by ๐น1 = 1, ๐น2 = 1, and ๐น๐ + ๐น๐+1 = ๐น๐+2 . Prove that for all ๐ โ โ the two consecutive Fibonacci numbers ๐น๐ and ๐น๐+1 are coprime (that is, (๐น๐ , ๐น๐+1 ) = 1). By working out examples, and generalizing, determine explicitly (with proof) integers ๐ฅ and ๐ฆ such that ๐น๐ ๐ฅ + ๐น๐+1 ๐ฆ = 1.
42
2. Primes in the integers ๐
7. The ๐th Fermat number is ๐น๐ โ 22 + 1. If ๐ > ๐ show that ๐น๐ divides ๐น๐ โ 2. Conclude that any two different Fermat numbers are coprime. Use this observation to give another proof that there are infinitely many primes. 8. Adapt Euclidโs proof to show that there are infinitely many primes in โค[๐] and ๐ฝ[๐ฅ] for any field ๐ฝ. 9. (i) Let ๐ be a polynomial with integer coefficients. Suppose ๐ and ๐ are integers with ๐ dividing ๐ โ ๐. Prove that ๐ divides ๐(๐) โ ๐(๐). (ii) Let ๐(๐ฅ) = ๐ฅ(๐ฅ โ 2) + 2. Let ๐0 = 3, and let ๐๐+1 = ๐(๐๐ ), so that ๐1 = 5, ๐2 = 17 etc. Show that if a prime ๐ divides ๐๐ , then ๐ cannot divide ๐๐ for all ๐ > ๐. (iii) Conclude that (๐๐ , ๐๐ ) = 1 if ๐ and ๐ are distinct, and deduce that there are infinitely many primes. Exercise 9 comes from [11], which has much more on related proofs of the infinitude of primes. 10. The ring of formal power series โ[[๐ฅ]] is defined as the set โ
{ โ ๐๐ ๐ฅ๐ โถ ๐๐ โ โ} ๐=0
with the operations of addition and multiplication defined as follows: โ
โ
โ
โ ๐๐ ๐ฅ๐ + โ ๐๐ ๐ฅ๐ = โ (๐๐ + ๐๐ )๐ฅ๐ ๐=0
๐=0
๐=0
and โ
โ
โ
( โ ๐๐ ๐ฅ๐ ) ร ( โ ๐๐ ๐ฅ๐ ) = โ ๐๐ ๐ฅ๐ , ๐=0
๐=0
๐
with ๐๐ = โ ๐๐ ๐๐โ๐ .
๐=0
๐=0
Convince yourself that this is indeed a ring. (i) Explain why โ[[๐ฅ]] is an integral domain. โ
(ii) Prove that โ๐=0 ๐๐ ๐ฅ๐ is a unit if and only if ๐0 โ 0. (iii) Prove that โ[[๐ฅ]] is a PID, and that every ideal is generated by ๐ฅ๐ for some non-negative integer ๐. (iv) Prove that, apart from associates, there is exactly one prime in โ[[๐ฅ]]; namely ๐ฅ. (v) Why doesnโt Euclidโs proof work here?
2.4. Exercises
43
11. Write the natural number ๐ in base ๐ notation. Say ๐ = ๐0 + ๐1 ๐ + ๐2 ๐2 + . . . + ๐๐ ๐๐ where each ๐๐ is between 0 and ๐ โ 1. (i) Show that ๐๐ = โ๐/๐๐ โ โ ๐โ๐/๐๐+1 โ. (ii) Prove that the largest power of ๐ dividing ๐! equals (๐ โ ๐(๐)) , (๐ โ 1) where ๐(๐) = ๐0 + ๐1 + . . . + ๐๐ denotes the sum of the base ๐-digits of ๐. 12. Let ๐ฅ be a positive real number, and let ๐ be a positive integer. Prove that ๐โ1 ๐ โ โ๐ฅ + โ = โ๐๐ฅโ. ๐ ๐=0 13. (Chebyshev) Prove that (30๐)! ๐! (15๐)! (10๐)! (6๐)! is a natural number for every ๐ โ โ. 14. Prove that
(9๐)! (2๐)! (6๐)! (4๐)! ๐! is a natural number for every ๐ โ โ. 15. Prove that
(12๐)! (2๐)! (7๐)! (4๐)! (3๐)! is a natural number for every ๐ โ โ.
Exercises 13, 14, 15 give three examples out of 52 such โsporadicโ examples of integral factorial ratios; see [4, 26] for this classification, and related problems. 16. Prove that the Catalan number ๐ถ๐ =
1 2๐ ( ) ๐+1 ๐
is an integer for all ๐ โ โ. Note: this is easy if you realize that ๐ถ๐ = 2๐ ), but I would like you to show (using Lemma 2.3 for instance) )โ(๐+1 (2๐ ๐ that the power of a prime ๐ dividing ๐ถ๐ is non-negative.
44
2. Primes in the integers
17. By contemplating the middle binomial coefficient (2๐ ), prove that for ๐ any ๐ โฅ 1 2๐ ๐(2๐) โฅ log 2 โ 1. log(2๐) 18. Prove that for all ๐ โฅ 2 we have ๐(2๐) โ ๐(๐) โค
2๐ log 2 . log ๐
19. Let ๐๐ denote the least common multiple of the first ๐ natural numbers 1, 2, . . ., ๐. (i) What is the power of ๐ dividing ๐๐ ? Prove that log ๐ log ๐๐ = โ log ๐โ โ โค (log ๐)๐(๐). log ๐ ๐โค๐ (ii) Let ๐(๐ฅ) = โ๐ ๐๐ ๐ฅ๐ be a polynomial with integer coefficients and with degree โค ๐ โ 1. Prove that 1
๐๐ โซ ๐(๐ฅ)๐๐ฅ โ โค. 0 ๐
(iii) Take ๐๐ (๐ฅ) = ๐ฅ (1 โ ๐ฅ)๐ and use (b) to show that 1
๐2๐+1 โซ ๐๐ (๐ฅ)๐๐ฅ โฅ 1. 0
(iv) Show that
1 โซ0 ๐๐ (๐ฅ)๐๐ฅ
โค 4โ๐ and deduce that
๐2๐+1 โฅ 4๐ and ๐(2๐ + 1) โฅ
(2 log 2)๐ . log(2๐ + 1)
This approach to the Chebyshev bounds for ๐(๐) was first discovered by Gelfond and Schnirelman, and rediscovered by Nair [20]; for more on its history, and improvements, see Chapter 10 of Montgomery [19].
Chapter 3
Congruences in rings
The main goal of this chapter is to introduce the notion of a quotient ring, which will play a key role in our construction of finite fields. Given a ring ๐
and an ideal ๐ผ in ๐
, we shall describe how to construct a quotient ring ๐
/๐ผ. This construction generalizes the notion of congruences in the integers, which we discussed briefly in Example 1.9 and which corresponds to the situation ๐
= โค, ๐ผ = ๐โค leading to the quotient ring โค/๐โค. After describing the general construction, we shall discuss the case of โค/๐โค in a little more detail. When ๐ = ๐ is a prime in the integers, the rings โค/๐โค will give our first examples of finite fields. When is the quotient ring ๐
/๐ผ an integral domain? When is it a field? In ยง3.3 we characterize these properties of ๐
/๐ผ in terms of properties of the ideal ๐ผ. Finally as an application of these ideas we determine in ยง3.4 the primes in the Gaussian integers โค[๐]. This will give a classical result of Fermat that every prime of the form 4๐ + 1 can be written as a sum of two squares, and also yield interesting finite fields of size ๐2 when ๐ is of the form 4๐ + 3.
3.1. Congruences and quotient rings Let ๐
be a ring (commutative as always, with identity 1). While we will be especially interested in examples like ๐
= โค, or โค[๐], or the polynomial ring ๐ฝ[๐ฅ] over a field ๐ฝ, for the present ๐
could be any ring (not necessarily an integral domain for instance). Let ๐ผ be an ideal of ๐
. 45
46
3. Congruences in rings
Definition 3.1. We say that two elements ๐ and ๐ are congruent modulo ๐ผ if ๐ โ ๐ belongs to the ideal ๐ผ, and we will write this as ๐ โก ๐ mod ๐ผ. By ๐ mod ๐ผ (which we call a congruence class) we mean the set of all elements in ๐
that are congruent to ๐ mod ๐ผ: ๐ mod ๐ผ = {๐ โ ๐
โถ ๐ โก ๐ mod ๐ผ}. Since ๐ mod ๐ผ consists of elements ๐ + ๐ with ๐ โ ๐ผ, we may sometimes also denote ๐ mod ๐ผ by ๐ + ๐ผ. The notion of a congruence is an example of an equivalence relation. Let us recall quickly what this means. Definition 3.2. Let ๐ be a set, and let โผ be a binary relation on ๐ (that is, given two elements ๐ and ๐, either the relation ๐ โผ ๐ holds, or it does not hold). The relation โผ is called an equivalence relation if the following three properties hold: (i) The relation is reflexive, which means ๐ โผ ๐ for all ๐ โ ๐. (ii) The relation is symmetric, which means that ๐ โผ ๐ holds if and only if ๐ โผ ๐ holds, for any two elements ๐, ๐ โ ๐. (iii) The relation is transitive: If ๐ โผ ๐ and ๐ โผ ๐ hold, then it follows that ๐ โผ ๐ holds. The notion of an equivalence relation generalizes the notion of equality, which clearly satisfies the reflexive, symmetry and transitive properties. You may easily check that our definition of congruence mod ๐ผ satisfies the criteria for being an equivalence relation. For example, let us check the transitive property. Note that ๐ โก ๐ mod ๐ผ means that ๐ โ ๐ โ ๐ผ, and ๐ โก ๐ mod ๐ผ means that ๐ โ ๐ โ ๐ผ. Therefore if ๐ โผ ๐ and ๐ โผ ๐ hold, then ๐ โ ๐ = (๐ โ ๐) + (๐ โ ๐) must be in ๐ผ which establishes that ๐ โก ๐ mod ๐ผ. In general, given a set ๐ with an equivalence relation โผ, for any element ๐ โ ๐ we can consider the set [๐] of all elements ๐ โ ๐ with ๐ โผ ๐. Such sets [๐] are called equivalence classes. If [๐] and [๐] are two equivalence classes, then either they are identical sets, or they are disjoint. Indeed if an element ๐ belonged to both [๐] and [๐] then ๐ โผ ๐ and ๐ โผ ๐, which by symmetry and transitivity forces ๐ โผ ๐. If ๐ โผ ๐ then note that any element ๐ฅ with ๐ โผ ๐ฅ will also satisfy ๐ โผ ๐ฅ (check), and similarly any element ๐ฆ with ๐ โผ ๐ฆ will satisfy ๐ โผ ๐ฆ, so that [๐] = [๐].
3.1. Congruences and quotient rings
47
The set ๐ can then be decomposed as a union of equivalence classes, ๐ = โช๐โ๐ [๐], and since two distinct equivalence classes are disjoint, we in fact obtain a partition of the set ๐ into disjoint equivalence classes. With these preliminary observations in place, we are ready to define the quotient ring ๐
/๐ผ. Definition 3.3. Let ๐
be a ring, and ๐ผ an ideal in ๐
. The quotient ring ๐
/๐ผ consists of the set of all congruence classes mod ๐ผ {๐ mod ๐ผ โถ ๐ โ ๐
} together with binary operations +, ร on such congruence classes defined by (3.1)
๐ mod ๐ผ + ๐ mod ๐ผ = (๐ + ๐) mod ๐ผ,
and (3.2)
(๐ mod ๐ผ) ร (๐ mod ๐ผ) = (๐ ร ๐) mod ๐ผ.
To clarify, the left sides of (3.1) and (3.2) are defining the operations of + and ร on congruence classes mod ๐ผ using the known definitions of + and ร in the ring ๐
, which are found in the expressions ๐ + ๐ and ๐ ร ๐ on the right sides of (3.1) and (3.2). There is a further point that requires careful thinking through: we must check that the operations described in (3.1) and (3.2) are well defined. What does this mean? Suppose ๐โฒ and ๐โฒ are elements of ๐
with ๐โฒ โก ๐ mod ๐ผ and ๐โฒ โก ๐ mod ๐ผ. Then the congruence classes ๐ mod ๐ผ and ๐โฒ mod ๐ผ are identical, and similarly so are ๐ mod ๐ผ and ๐โฒ mod ๐ผ. In order for (3.1) and (3.2) to be well defined we must check that ๐โฒ + ๐โฒ โก ๐ + ๐ mod ๐ผ and that ๐โฒ ๐โฒ โก ๐๐ mod ๐ผ, so that there is no inconsistency. To check this, suppose ๐โฒ = ๐ + ๐ and ๐โฒ = ๐ + ๐ where ๐ and ๐ are in the ideal ๐ผ. Then ๐โฒ + ๐โฒ = (๐ + ๐) + (๐ + ๐), and since ๐ + ๐ is in the ideal ๐ผ it follows that ๐โฒ + ๐โฒ โก ๐ + ๐ mod ๐ผ as we wanted. Similarly ๐โฒ ๐โฒ = (๐ + ๐)(๐ + ๐) = ๐๐ + ๐๐ + ๐๐ + ๐๐, and note that ๐๐, ๐๐, ๐๐ are all in ๐ผ and therefore so is ๐๐ + ๐๐ + ๐๐. This shows that ๐โฒ ๐โฒ โก ๐๐ mod ๐ผ as needed. Now that the definitions of + and ร in ๐
/๐ผ have been clarified, and shown to be well defined, you should now check that with these operations ๐
/๐ผ forms a commutative ring with identity. For example, the
48
3. Congruences in rings
additive identity is given by the congruence class 0 mod ๐ผ, and the multiplicative identity by 1 mod ๐ผ. Check that under the operation of addition, the set ๐
/๐ผ of all equivalence classes mod ๐ผ forms a group. Check that multiplication is commutative, and distributes over addition. Example 3.4. In any ring ๐
you can take the ideal ๐ผ = {0}. Then two elements are congruent mod(0) only if they are equal, and so the congruence classes are the same as the elements of the ring. At the other extreme, if we take ๐ผ = ๐
then all elements of the ring are congruent to each other, and there is only one congruence class 0 mod ๐ผ. Thus ๐
/๐ผ here is the trivial zero ring. Example 3.5. If ๐
= โค and ๐ผ = (๐), the ideal consisting of multiples of the natural number ๐, then we recover the notion of congruences mod ๐, which may be familiar to you, and which we discussed briefly in Example 1.9. Recall that here we write ๐ โก ๐ mod ๐ to mean ๐|(๐ โ ๐), and mod (๐) has been abbreviated to mod ๐. We shall discuss this ring a little more in the next section, and also in Chapter 6. Here note that ๐ mod ๐ is the same as ๐ + ๐ mod ๐ or ๐ โ 17๐ mod ๐ etc. An explicit partition of โค into equivalence classes mod ๐ is the union of ๐ mod ๐ for 0 โค ๐ โค ๐ โ 1. In โค it is common to call ๐ mod ๐ a residue class, and we may sometimes use the phrase complete set of residue classes mod ๐ to refer to a collection of distinct residue classes with union โค. The notion of quotient ring we have developed is an instance of a general theme in mathematics of taking quotients of various structures. In linear algebra you may have encountered the idea of a quotient space of a vector space by a subspace. To give another example (which you will encounter in much more detail in a group theory course), if ๐บ is a group and ๐ป is a subgroup of ๐บ then you can think of the quotient ๐บ/๐ป as equivalence classes under the relation that ๐1 and ๐2 in ๐บ are treated the same if ๐โ1 2 ๐1 is in the subgroup ๐ป. In general, the quotient ๐บ/๐ป will not inherit a group structure and does so only when ๐ป is a special kind of subgroup (known as a normal subgroup). For abelian (that is, commutative) groups, all subgroups are normal, and in this setting you may wish to check that ๐บ/๐ป forms a group. We will discuss this idea further in ยง5.2.
3.2. The ring โค/๐โค
49
3.2. The ring โค/๐โค Let us look a little more closely at the ring โค/๐โค. We start with the additive structure of this ring, which is easy to understand. The congruence class 1 mod ๐ can be added to itself many times and generates 2 mod ๐, 3 mod ๐, . . ., (๐ โ 1) mod ๐, and then ๐ โก 0 mod ๐. This is an example of a cyclic group, which is a group generated by the powers (positive and negative) of some element. The group โค is also a cyclic group, generated by 1, but that group is infinite in contrast to the additive group โค/๐โค which is finite with ๐ elements. You may recall that we discussed cyclic groups and subgroups briefly in Example 1.3, and we will return to them later in ยง5.1. Understanding the multiplicative structure needs more work, and we shall return to this problem in Chapter 5. For the present let us consider the problem of determining the units in โค/๐โค. Recall that in any ring ๐
, the units form a multiplicative group which we denote by ๐
ร . What then are the elements of the multiplicative group of units (โค/๐โค)ร ? Definition 3.6. A residue class ๐ mod ๐ is called reduced if (๐, ๐) = 1 (where (๐, ๐) denotes the gcd of ๐ and ๐). If two integers have gcd 1, they are called coprime. The number of reduced residue classes mod ๐ is called Eulerโs totient function, and is denoted by ๐(๐). Thus ๐(๐) denotes the number of integers ๐ that are coprime to ๐ with 1 โค ๐ โค ๐.
Lemma 3.7. The multiplicative units of โค/๐โค are precisely the reduced residue classes. Thus for every reduced residue class ๐ mod ๐ there exists a reduced residue class ๐ mod ๐ such that ๐๐ โก 1 mod ๐; in the sequel, we shall write the multiplicative inverse of ๐ mod ๐ as ๐โ1 mod ๐. Proof. Suppose first that ๐ mod ๐ is a unit. This means that there is a residue class ๐ mod ๐ with ๐๐ mod ๐ being the multiplicative identity 1 mod ๐. Thus ๐๐ โก 1 mod ๐ which implies that (๐๐, ๐) = 1, and therefore (๐, ๐) = 1. Thus ๐ mod ๐ is reduced. Conversely, suppose that ๐ mod ๐ is reduced. We must find its inverse ๐ mod ๐. Since (๐, ๐) = 1, by the Euclidean algorithm (or simply because โค is a PID), we have ๐๐ฅ + ๐๐ฆ = 1 for some integers ๐ฅ and ๐ฆ. But then ๐๐ฅ โก 1 mod ๐ and ๐ฅ mod ๐ is the sought after inverse. โก
50
3. Congruences in rings
In Chapter 6 we shall understand the structure of the group of reduced residues (โค/๐โค)ร , which is a good bit more complicated than the simple cyclic structure of the additive group โค/๐โค. Now let us consider when โค/๐โค is an integral domain, and when it is a field. Proposition 3.8. If ๐ is composite (that is, it is not a prime number) then โค/๐โค is not an integral domain. If ๐ = ๐ is a prime number, then โค/๐โค = โค/๐โค is a field (and thus an integral domain). Proof. If ๐ = ๐๐ (with ๐ and ๐ being positive integers with neither ๐ nor ๐ being 1) is composite, then ๐ mod ๐ and ๐ mod ๐ are zero divisors in the ring โค/๐โค. Thus this ring is not an integral domain. Now suppose that ๐ = ๐ is a prime. If ๐ is not a multiple of ๐ then ๐ must be coprime to ๐. Thus all non-zero elements in โค/๐โค are units (or reduced residues), and therefore โค/๐โค is a field. โก We shall also denote โค/๐โค as ๐ฝ๐ to indicate that it is a field of size ๐. One of our main goals will be to construct finite fields of order ๐๐ for all prime powers ๐๐ , and further to show that these are all the possible finite fields. The fields of prime power order cannot be constructed just using quotients of โค. For instance, the field of size ๐2 is not the ring โค/๐2 โค which, as mentioned above, is not even an integral domain! We end this section by establishing Wilsonโs theorem together with a variant of it, which we will use in Section 3.4 to determine all the primes in the Gaussian integers. Theorem 3.9. If ๐ is a prime number then (3.3)
(๐ โ 1)! โก โ1 mod ๐.
Further, if ๐ is an odd prime then (3.4)
(
๐โ1 2 )! 2
โก (โ1)
๐+1 2
mod ๐.
The right side of (3.4) is โ1 if ๐ โก 1 mod 4, and is +1 if ๐ โก 3 mod 4. Proof. Let us begin with Wilsonโs theorem, which is the statement in (3.3). When ๐ = 2 the statement is that 1! โก โ1 mod 2, which is clear. Now suppose ๐ โฅ 3, and write out (๐โ1)! as 1ร2รโฏร(๐โ1). The idea is that all the terms here correspond to reduced residue classes mod ๐, and therefore we may pair them off with their inverse, and in that way
3.3. Prime ideals and maximal ideals
51
simplify the product mod ๐. We must be a little careful though, for it may happen that a reduced residue class is its own inverse, and so cannot be paired off in this way. Which reduced residue classes mod ๐ are their own inverse? We are looking for reduced residue classes ๐ฅ mod ๐ such that ๐ฅ ร ๐ฅ โก ๐ฅ2 โก 1 mod ๐. In other words ๐ must divide (๐ฅ2 โ1) = (๐ฅ+1)(๐ฅโ1), and since ๐ is prime, this means that ๐|(๐ฅ + 1) or ๐|(๐ฅ โ 1). Therefore, the only reduced residue classes mod ๐ that are their own inverse are 1 mod ๐, and โ1 โก (๐โ1) mod ๐. The remaining reduced residue classes ๐ mod ๐ with 2 โค ๐ โค ๐ โ 2 may all be paired off with their inverses. It follows that (๐ โ 1)! โก 1 ร (2 ร โฏ ร (๐ โ 2)) ร (๐ โ 1) โก 1 ร (๐ โ 1) โก โ1 mod ๐, which is (3.3). To deduce (3.4), note that (๐โ1)
(๐โ1)/2
โ
(๐โ1)/2
๐ = โ (๐ โ ๐) โก โ (โ๐) mod ๐
๐=(๐+1)/2
๐=1
โก (โ1)
๐=1 ๐โ1 2
๐โ1 ( 2 )!
mod๐,
and so (๐โ1)/2
๐โ1
(๐ โ 1)! = โ ๐ ๐=1
โก (โ1)
โ
๐
๐=(๐+1)/2 ๐โ1 2
(
๐โ1 2 )! 2
mod๐.
Appealing now to Wilsonโs theorem (3.3), and noting that (โ1) ๐โ1 (โ1)โ 2 , we deduce that (
๐โ1 2 )! 2
โก (โ1)
๐โ1 2
(๐ โ 1)! โก (โ1)
yielding (3.4).
๐+1 2
๐โ1 2
=
mod ๐, โก
3.3. Prime ideals and maximal ideals So far we have seen that for any ring ๐
and an ideal ๐ผ we can form a quotient ring ๐
/๐ผ, and we discussed in a bit more detail the special case of โค/๐โค. In the special case โค/๐โค, we found that the quotient ring is an integral domain (and in fact a field) precisely when ๐ is a prime. What
52
3. Congruences in rings
happens more generally? When do we get integral domains as quotients, and when do we get fields? In this section we describe how to characterize those ideals for which the quotient ring is an integral domain, and how to characterize those ideals for which the quotient ring is a field. Definition 3.10. Let ๐
be a ring, and let ๐ be an ideal of ๐
. Then ๐ is called a prime ideal if (i) ๐ โ ๐
, and (ii) whenever ๐๐ lies in ๐ we must have either ๐ โ ๐, or ๐ โ ๐. Example 3.11. When is (0) a prime ideal? Recall our usual assumption that the ring ๐
is not the zero ring. Then the requirement for (0) to be prime is that if ๐๐ = 0 then either ๐ or ๐ must be 0. In other words, the zero ideal is prime precisely when ๐
is an integral domain. Of course, we usually care about more interesting ideals than this! Example 3.12. Suppose ๐
is a PID, and let ๐ be an ideal of ๐
. Since ๐
is a PID, we may write ๐ = (๐) for some element ๐ of ๐
. Suppose that ๐ is not the zero ideal, nor all of ๐
. This is equivalent to ๐ โ 0, and ๐ not being a unit in ๐
. What does it mean to say that ๐ is a prime ideal? The criterion (ii) for ๐ to be a prime ideal may be restated as saying that whenever ๐๐ is a multiple of ๐ (which is the same as ๐๐ โ (๐)) then either ๐ or ๐ must be a multiple of ๐. Thus, the ideal ๐ is prime exactly when the element ๐ is a prime. Since primes and irreducibles are the same in a PID, we could also say that ๐ must be irreducible. In particular, the prime ideals in โค are (0) and the ideals (๐) for prime numbers ๐. Proposition 3.13. Let ๐
be a ring and ๐ผ an ideal of ๐
. The quotient ring ๐
/๐ผ is an integral domain precisely when ๐ผ is a prime ideal. Proof. Suppose ๐ผ is a prime ideal. We must show that the quotient ๐
/๐ผ has no zero divisors. Suppose to the contrary that there are nonzero classes ๐ mod ๐ผ and ๐ mod ๐ผ (non-zero elements of ๐
/๐ผ) with ๐๐ โก 0 mod ๐ผ. The statement ๐๐ โก 0 mod ๐ผ means that ๐๐ โ ๐ผ, and since ๐ผ is a prime ideal either ๐ or ๐ must be in ๐ผ, so that either ๐ โก 0 mod ๐ผ or ๐ โก 0 mod ๐ผ. Contradiction! Conversely, suppose ๐
/๐ผ is an integral domain. Being an integral domain, ๐
/๐ผ is not the zero ring, and therefore ๐ผ is not the whole ring ๐
. Thus, if ๐ผ is not a prime ideal, then there must exist elements ๐, ๐ in ๐
with ๐๐ โ ๐ผ but with neither ๐ nor ๐ being an element of ๐ผ. But
3.3. Prime ideals and maximal ideals
53
then ๐ mod ๐ผ and ๐ mod ๐ผ would be non-zero congruence classes that multiply to give ๐๐ โก 0 mod ๐ผ. This contradicts the assumption that ๐
/๐ผ is an integral domain. โก Example 3.14. If ๐ is an irreducible in a PID ๐
, then ๐
/(๐) is an integral domain. For example, in ๐
= โ[๐ฅ] the polynomial ๐ฅ2 โ ๐ฅ โ 1 is irreducible (check this), and therefore (๐ฅ2 โ ๐ฅ โ 1) is a prime ideal and the quotient โ[๐ฅ]/(๐ฅ2 โ ๐ฅ โ 1) is an integral domain. Example 3.15. Consider ๐
= โค[๐ฅ], which we saw in Example 1.38 is not a PID. Consider the ideal ๐ผ = (2) which consists of all polynomials in โค[๐ฅ] whose coefficients are even. What does the quotient ๐
/๐ผ look like? What we are doing is to take any polynomial in โค[๐ฅ] and reduce its coefficients mod 2. In other words the quotient may be thought of as the ring (โค/2โค)[๐ฅ], which is an integral domain. Therefore the ideal (2) is a prime ideal in ๐
. Similarly, consider the ideal (๐ฅ) which consists of all polynomials in โค[๐ฅ] with constant term 0. The quotient โค[๐ฅ]/(๐ฅ) then keeps track of only the constant term of a polynomial, and thus looks like the ring โค. Since โค is an integral domain, we see that (๐ฅ) is also a prime ideal. Our next goal is to characterize the ideals ๐ผ for which ๐
/๐ผ is a field. Definition 3.16. Let ๐
be a ring, and let ๐ be an ideal of ๐
. Then ๐ is called a maximal ideal if (i) ๐ โ ๐
, and (ii) the only ideals that contain ๐ are ๐ itself and the whole ring ๐
. Example 3.17. When is (0) a maximal ideal? With our usual assumption that ๐
is not the zero ring, (0) is maximal if and only if ๐
has no ideals besides (0) and ๐
. This is the same as wanting ๐
to be a field. Example 3.18. Suppose ๐
is a PID, and let ๐ = (๐) be an ideal with ๐ โ (0) and ๐ โ ๐
. When is ๐ maximal? Recall that if ๐ = (๐) is another ideal, then ๐ is contained in ๐ exactly when ๐ divides ๐. Thus if ๐ is irreducible (or equivalently prime), the only ideals containing ๐ are ๐ and ๐
, so that ๐ is maximal. On the other hand, if ๐ = ๐๐ is reducible, then (๐) and (๐) would be examples of ideals containing (๐). Thus, in a PID non-zero maximal ideals and prime ideals are the same, and they both correspond to ideals that are generated by prime (or irreducible) elements of the ring. The zero ideal is a prime ideal in
54
3. Congruences in rings
a PID (indeed in any integral domain), but need not be maximal; for example in โค the zero ideal is prime, but not maximal. Proposition 3.19. If ๐ is an ideal of ๐
then the quotient ๐
/๐ is a field precisely when ๐ is a maximal ideal. In particular, every maximal ideal is a prime ideal. Proof. Suppose ๐ is a maximal ideal, and let ๐ be any element not in ๐. Consider the ideal ๐ generated by โaddingโ ๐ to ๐: that is, take ๐ = {๐๐ฅ + ๐ โถ ๐ฅ โ ๐
, ๐ โ ๐}. Check that ๐ is indeed an ideal, and note that it strictly contains ๐. Therefore by the maximality of ๐ we must have ๐ = ๐
. It follows that for some ๐ฅ โ ๐
and some ๐ โ ๐ we must have 1 = ๐๐ฅ + ๐, so that ๐๐ฅ โก 1 mod ๐. Thus every nonzero element ๐ mod ๐ of ๐
/๐ has an inverse (namely, ๐ฅ mod ๐), and the quotient ๐
/๐ is a field. Since fields are always integral domains, we may also conclude by Proposition 3.13 that ๐ is a prime ideal. Now let us consider the converse statement. Suppose ๐
/๐ is a field, and we want to show that ๐ is maximal. Notice that ๐ cannot be ๐
, since ๐
/๐ is a field and therefore not the zero ring. Let ๐ be an ideal that strictly contains ๐; we will show that ๐ must be the full ring ๐
. Let ๐ be an element of ๐ but not ๐. Then ๐ mod ๐ is a non-zero congruence class, and thus has an inverse. That is, there exists ๐ฅ โ ๐
with ๐๐ฅ = 1+๐ for some ๐ โ ๐. But ๐๐ฅ is in ๐ (since ๐ is an ideal) and ๐ โ ๐ (since ๐ contains ๐) and therefore 1 = ๐๐ฅ โ ๐ is also in ๐. But this means that ๐ = ๐
. We conclude that ๐ is maximal. โก Example 3.20. In Example 3.14, we considered the quotient ring of the PID โ[๐ฅ] by the prime ideal (๐ฅ2 โ๐ฅโ1). Since prime ideals and maximal ideals are the same in a PID, we see that โ[๐ฅ]/(๐ฅ2 โ ๐ฅ โ 1) is in fact a field. Its elements are congruence classes ๐ + ๐๐ฅ mod (๐ฅ2 โ ๐ฅ โ 1), with ๐, ๐ โ โ, and the ring operations on these congruence classes correspond to usual addition and multiplication of polynomials together with the ability to simplify ๐ฅ2 โ ๐ฅ โ 1 to 0. In the real numbers the golden ratio ๐ = (1 + โ5)/2 is a real number satisfying the equation ๐2 โ ๐ โ 1 = 0, and this symbol ๐ plays exactly the same role as ๐ฅ in our field โ[๐ฅ]/(๐ฅ2 โ ๐ฅ โ 1). In other words, we may think of the field โ(๐) = {๐ + ๐๐ โถ ๐, ๐ โ โ} as being the same as โ[๐ฅ]/(๐ฅ2 โ ๐ฅ โ 1).
3.4. Primes in the Gaussian integers
55
Example 3.21. In Example 3.15, we considered ๐
= โค[๐ฅ] and the ideals (2) and (๐ฅ), which we showed are prime ideals. We saw that the quotient โค[๐ฅ]/(2) may be thought of as (โค/2โค)[๐ฅ] and that the quotient โค[๐ฅ]/(๐ฅ) may be thought of as โค. These quotients are thus integral domains, but not fields. Therefore neither (2) nor (๐ฅ) is a maximal ideal. Indeed they are both contained in the ideal (2, ๐ฅ). The quotient โค[๐ฅ]/(2, ๐ฅ) consists of the congruence classes 0 mod (2, ๐ฅ) and 1 mod (2, ๐ฅ), which has the same structure as the field with two elements โค/2โค = ๐ฝ2 . The ideal (2, ๐ฅ) is therefore maximal. We round out this section by recording two more propositions. Proposition 3.22. Let ๐
be a PID. Then the non-zero prime ideals of ๐
are (๐) where ๐ โ ๐
is an irreducible (or, equivalently, prime), and these ideals are also maximal. Thus for every irreducible ๐ โ ๐
, the quotient ๐
/(๐) is a field. Proof. The proposition merely records our discussion in Example 3.12, Example 3.18, and Proposition 3.19. โก Proposition 3.23. Every finite integral domain is a field. Proof. Problem 8 of Chapter 1 shows that in a finite ring ๐
any element ๐ that is not zero and not a zero divisor must be a unit. It follows that in a finite integral domain ๐
, all non-zero elements are units, so that ๐
is a field. Here is an alternative proof. Let ๐ be a non-zero element of the integral domain ๐
. We must show that ๐ is a unit (that is, has a multiplicative inverse). Look at the powers of ๐: ๐, ๐2 , ๐3 , . . .. Since the ring is finite, we must have ๐๐ = ๐๐+๐ for some natural numbers ๐ and ๐. Thus ๐๐ (๐๐ โ 1) = 0, and since we are in an integral domain, we must have ๐๐ = 1. But then ๐(๐๐โ1 ) = 1 and so ๐๐โ1 is the desired multiplicative inverse of ๐. โก
3.4. Primes in the Gaussian integers From Chapter 1, we already know that the ring of Gaussian integers โค[๐] is a Euclidean domain, and therefore a PID, and therefore a UFD. What are the irreducibles (equivalently primes) in this ring? Once we identify these, their quotients will be fields by Proposition 3.22, and we will obtain some interesting new finite fields in this way.
56
3. Congruences in rings
A key tool in understanding this situation will be the norm function: ๐ โถ โค[๐] โ โคโฅ0 defined by ๐(๐ + ๐๐) = ๐2 + ๐2 . Recall that the norm is multiplicative ๐(๐ผ๐ฝ) = ๐(๐ผ)๐(๐ฝ) for ๐ผ, ๐ฝ โ โค[๐] and that the units in โค[๐] correspond to the elements of norm 1 namely ยฑ1, and ยฑ๐ (see Example 1.18). Here is a simple criterion to recognize some irreducibles in โค[๐]. Lemma 3.24. Suppose ๐ + ๐๐ โ โค[๐] has norm ๐2 + ๐2 = ๐ for a prime number ๐ (in the usual integers). Then ๐+๐๐ is an irreducible (equivalently prime) in โค[๐]. Proof. Suppose (๐ + ๐๐) factors as ๐๐ with ๐, ๐ โ โค[๐]. Then we must have ๐(๐+๐๐) = ๐(๐)๐(๐), and since ๐(๐+๐๐) is assumed to be a prime number, this forces either ๐(๐) or ๐(๐) to be 1, so that either ๐ or ๐ must be a unit. Thus there is no non-trivial way to factor ๐ + ๐๐, so that ๐ + ๐๐ must be irreducible. โก The next result gives a complete description of all the primes in โค[๐]. Theorem 3.25. Let ๐ denote an irreducible in โค[๐]. Then one of the following three cases holds: (i) The norm of ๐ is 2, and ๐ is an associate of 1 + ๐. (ii) The norm of ๐ equals a prime integer ๐ โก 1 mod 4. In this case ๐ may be expressed as ๐2 + ๐2 = (๐ + ๐๐)(๐ โ ๐๐) for some ๐, ๐ โ โค. Apart from associates, there are exactly two such irreducibles with norm ๐, namely ๐ + ๐๐ and ๐ โ ๐๐, and so ๐ is an associate of one of these. (iii) The norm of ๐ is ๐2 for a prime ๐ โก 3 mod 4, and ๐ is an associate of ๐. Proof. Let ๐ be an irreducible in โค[๐], and consider the prime ideal (๐). What are the integers (elements of โค) in this idealโnamely (๐) โฉ โค? If we call this set ๐, note that 0 โ ๐ and ๐(๐) = ๐๐ is a non-zero integer in ๐. First we claim that ๐ is an ideal in โค. Indeed if ๐, ๐ are in ๐ then they are both integers in (๐), and their sum ๐ + ๐ is also an integer, and also in (๐); thus ๐ + ๐ โ (๐) โฉ โค = ๐. Similarly if ๐ โ ๐ and ๐ โ โค, then the product ๐๐ is both an integer as well as an element of ๐ (since ๐ โ (๐) and ๐ โ โค[๐]), and therefore ๐๐ lies in ๐. This establishes the claim.
3.4. Primes in the Gaussian integers
57
Next we claim that ๐ is in fact a prime ideal in โค. If ๐ and ๐ are two integers with ๐๐ โ ๐, then ๐๐ lies in (๐), and since (๐) is a prime ideal, either ๐ or ๐ must be in ๐. Since ๐ and ๐ were already known to be integers, it follows that either ๐ or ๐ must lie in (๐) โฉ โค = ๐. From our work so far, we know that ๐ = (๐) โฉ โค is a non-zero prime ideal in โค, so that ๐ = ๐โค for some prime number ๐. Suppose first that ๐ = 2. Note that 2 is not an irreducible in โค[๐] since it factors as 2 = (1 + ๐)(1 โ ๐) = (โ๐)(1 + ๐)2 = ๐(1 โ ๐)2 . Note that 1 + ๐ and 1 โ ๐ are associates of each other, and they are irreducible since their norm is 2 which is a prime in โค. Since 2 = (โ๐)(1+๐)2 belongs to the prime ideal (๐), we must have 1 + ๐ โ (๐). Since 1 + ๐ is irreducible, and ๐ divides it, we must have ๐ being an associate of 1 + ๐. This is the case described in part (i). Suppose next that ๐ โก 1 mod 4. We claim once again that ๐ is not an irreducible in โค[๐]. To prove this, we will use the variant of Wilsonโs theorem from Section 3.2! Since (โ1)(๐+1)/2 = โ1 (for ๐ โก 1 mod 4), from (3.4) of Theorem 3.9 it follows that there is an integer ๐ with ๐2 โก โ1 mod ๐โjust take ๐ = ((๐ โ 1)/2)!. Thus ๐ divides ๐2 + 1 = (๐ + ๐)(๐ โ ๐), but note that ๐ does not divide ๐ + ๐ or ๐ โ ๐. Therefore ๐ is not a prime (and hence not an irreducible) in โค[๐]. Since ๐ is reducible in โค[๐] it must factor as ๐ = ๐ผ๐ฝ with ๐ผ, ๐ฝ โ โค[๐] and neither of them a unit. But then we have ๐(๐) = ๐2 = ๐(๐ผ)๐(๐ฝ), and since neither ๐ผ nor ๐ฝ is a unit we must have ๐(๐ผ) = ๐(๐ฝ) = ๐. If we write ๐ผ as ๐+๐๐, it follows that ๐ = ๐(๐+๐๐) = ๐2 +๐2 = (๐+๐๐)(๐โ๐๐), so that ๐ฝ must be ๐ โ ๐๐. By Lemma 3.24 both ๐ผ = ๐ + ๐๐ and ๐ฝ = ๐ โ ๐๐ must be irreducibles in โค[๐], since their norm is the prime number ๐. Finally since ๐ lies in (๐), ๐ must be a multiple of ๐, so that ๐ must be an associate of either the irreducible ๐ผ or the irreducible ๐ฝ. This proves the second case described in the theorem, and note that we have established the non-obvious fact that every prime ๐ โก 1 mod 4 is the sum of two squares! It remains to consider the last case when ๐ โก 3 mod 4. We claim that ๐ is irreducible in โค[๐]. For, if ๐ can be reduced, then there must be an element ๐ + ๐๐ of norm ๐, which means that ๐ = ๐2 + ๐2 . But every
58
3. Congruences in rings
square of an integer is either 0 or 1 mod 4, and so the sum of two squares is either 0, 1, or 2 mod 4. Since ๐ โก 3 mod 4, it cannot be a sum of two squares. So ๐ is irreducible, and since ๐ divides ๐, we must have that ๐ is an associate of ๐. This completes our proof. โก Let us isolate two interesting facts furnished by Theorem 3.25: Corollary 3.26. Every prime ๐ โก 1 mod 4 is a sum of two squares: ๐ = ๐2 + ๐2 with ๐, ๐ both integers. For every prime ๐ โก 3 mod 4, the quotient ring โค[๐]/๐โค[๐] is a finite field with ๐2 elements. As a set of representatives for the congruence classes mod ๐โค[๐] we may take ๐+๐๐ mod ๐โค[๐] where 0 โค ๐, ๐ โค ๐ โ 1. Proof. The first statement was explicitly mentioned in the statement of Theorem 3.25. As for the second statement, when ๐ โก 3 mod 4 is a prime in the integers, it remains prime in the ring โค[๐]. Since โค[๐] is a PID, the ideal ๐โค[๐] is not just prime, but also maximal and the quotient โค[๐]/๐โค[๐] is a field. Lastly it is a simple matter to check that for any prime ๐ (not just those โก 3 mod 4), the equivalence classes ๐ + ๐๐ mod ๐โค[๐] for 0 โค ๐, ๐ โค ๐ โ 1 are all distinct, and their union gives all of โค[๐]. โก
3.5. Exercises 1. Let โ denote the field of real numbers. Describe the quotient ring โ[๐ฅ]/(๐ฅ2 + 1). Is this object already familiar to you? Explain. 2. Let ๐
denote the polynomial ring โค[๐ฅ] and ๐ผ denote the ideal (๐ฅ2 ) in ๐
. Describe the quotient ring ๐
/๐ผ, giving the units in that ring and describing the zero divisors (if any). Compare briefly this problem with Exercise 3 of Chapter 1. 3. Let ๐ be a positive integer congruent to 3 mod 4, and write ๐ = 4โ โ 1. Describe the quotient ring โค[๐ฅ]/(๐ฅ2 โ ๐ฅ + โ): by this I mean that you should describe the equivalence classes (by giving a representative for each equivalence class), and explain how to add and multiply equivalence classes. Is there a connection between this ring, and the one you encountered in Exercise 17(i) of Chapter 1? Explain briefly. 4. Show that the additive group โค/๐โค is generated by the residue class ๐ mod ๐ if and only if (๐, ๐) = 1.
3.5. Exercises ๐
59 ๐
๐
5. Let ๐ = ๐11 ๐22 โฏ ๐๐๐ denote the prime factorization of the natural number ๐, where the ๐๐ are distinct primes, and the exponents ๐๐ are natural numbers. Show that the total number of integers ๐ (positive and negative) that divide ๐ equals 2(1 + ๐ 1 )(1 + ๐ 2 ) โฏ (1 + ๐ ๐ ). ๐
๐
๐
6. Let ๐ = ๐11 ๐22 โฏ ๐๐๐ denote the prime factorization of the natural number ๐, where the ๐๐ are distinct primes, and the exponents ๐๐ are natural numbers. In terms of the numbers ๐๐ , how many ideals does the ring โค/๐โค have? 7. For any prime ๐ and any natural numbers ๐ โฅ ๐ show that (
๐๐ ๐ ) โก ( ) mod ๐. ๐๐ ๐
8. Let ๐ โฅ 2 be a natural number, and put ๐ = โ ๐. 1โค๐โค๐ (๐,๐)=1
Let ๐ denote the set of reduced residue classes ๐ mod ๐ such that ๐ 2 โก 1 mod ๐. Show that ๐ โก ( โ ๐ ) mod ๐. 1โค๐ โค๐ ๐ โ๐
Deduce Wilsonโs theorem: (๐ โ 1)! โก โ1 (mod ๐) for prime numbers ๐. 9. If ๐ is prime show that (๐โ1 ) โก (โ1)๐ mod ๐ for all 0 โค ๐ โค ๐ โ 1. ๐ 10. Let ๐
be the ring โค[๐ฅ] and let ๐ผ denote the ideal (๐ฅ2 + 1). (i) Describe the quotient ring ๐
/๐ผ. Give an explicit description of representatives for all congruence classes mod ๐ผ. Multiply the congruence classes 3+4๐ฅ mod ๐ผ and 3โ4๐ฅ mod ๐ผ, and give the answer in terms of the representatives you chose. (ii) What kind of ideal is ๐ผ? Does it happen to be a prime, or maximal ideal? (iii) If ๐ผ is not a maximal ideal, give explicitly an ideal ๐ฝ that strictly contains ๐ผ and is not all of ๐
. 11. Let ๐
be a ring, and let ๐ be a subring of ๐
. That is, ๐ is a subset of ๐
, such that ๐ contains identity elements 0 and 1 in ๐
, and ๐ forms a ring
60
3. Congruences in rings
under the two operations of ๐
. If ๐ is a prime ideal in ๐
, show that ๐ โฉ ๐ is a prime ideal in ๐. 12. Let ๐
be a ring, and let ๐ be a subring of ๐
. Show, by means of an example, that if ๐ is a maximal ideal in ๐
, then ๐ โฉ ๐ need not be a a maximal ideal in ๐. 13. (i) Let ๐ be a prime with ๐ โก 1 mod 4. Show that there are exactly 8 ways to write ๐ as the sum of two squares of integers. For example, 5 = (ยฑ1)2 + (ยฑ2)2 = (ยฑ2)2 + (ยฑ1)2 โyou may complain rightly that the eight ways are really just one, but at least there should be no confusion about what I mean by 8 ways! (ii) Let ๐1 , . . ., ๐ ๐ denote ๐ distinct primes all congruent to 1 mod 4. Show that the number of ways of writing ๐1 โฏ ๐ ๐ as the sum of two squares of integers equals 4 ร 2๐ . 14. Let ๐
denote the ring โค[โโ2], which from Exercise 18 of Chapter 1 you know to be a Euclidean domain. In this exercise, we are concerned with the primes in this ring ๐
. (i) What are the units in ๐
? If ๐ โ ๐
is an irreducible, show that (๐) โฉ โค is a prime ideal in โค. (ii) Prove that every prime integer ๐ โก 5 mod 8, or โก 7 mod 8 remains a prime in the ring ๐
= โค[โโ2]. (iii) Show that 3, 11, 17, 19, 41, and 43 all split into the product of two primes in ๐
. Would you care to make a guess as to what all the primes in ๐
are? What would you need to prove your guess? (iv) Exhibit a field with 25 elements, and give a few illustrations of how addition and multiplication in your field work. (This is to familiarize yourself with such objects, so work out as many examples as may be helpful to you.) Part (iii) is open ended, of course, but it should get you to revisit our work on โค[๐], and you should be able to come up with an educated guess! 15. By thinking about unique factorization in โค[๐] prove that integer solutions to the Pythagorean equation ๐ฅ2 +๐ฆ2 = ๐ง2 may be parametrized (up to changing signs of ๐ฅ, ๐ฆ, or ๐ง) as (๐(๐2 โ ๐2 ), 2๐๐๐, ๐(๐2 + ๐2 ))
3.5. Exercises
61
(or flipping ๐ฅ and ๐ฆ by (2๐๐๐, ๐(๐2 โ ๐2 ), ๐(๐2 + ๐2 ))). Here ๐, ๐ and ๐ are integers.
Chapter 4
Primes in polynomial rings: constructing finite fields
In this chapter we consider the polynomial ring ๐ฝ[๐ฅ] where ๐ฝ is a finite field. For instance, think of ๐ฝ as being the main example that we know so far of a finite field, namely ๐ฝ๐ = โค/๐โค. Our goal is to determine the primes in ๐ฝ[๐ฅ]. Since we know that ๐ฝ[๐ฅ] is a Euclidean domain (and therefore a PID), if ๐ is an irreducible (equivalently prime) in ๐ฝ[๐ฅ], then the quotient ring ๐ฝ[๐ฅ]/(๐) will give a field. In this way we shall show that there exists a finite field of size ๐๐ for every prime power ๐๐ .
4.1. Primes in the polynomial ring over a field As mentioned above, our goal is to understand primes (equivalently irreducibles) in the polynomial ring ๐ฝ[๐ฅ] where ๐ฝ is a field. We will be mainly interested in the case where ๐ฝ is a finite field (at present we know the examples ๐ฝ๐ , and for primes ๐ โก 3 mod 4 we have seen finite fields of size ๐2 in our work on โค[๐]). But to start, it may be helpful to consider also familiar fields such as โ, โ, or โ. So far when we have discussed polynomials, we have thought of them as formal expressions ๐0 + ๐1 ๐ฅ + . . . + ๐๐ ๐ฅ๐ without making any reference to them as functions. Let us now make use of this natural idea. Given a polynomial ๐ โ ๐ฝ[๐ฅ], we can โplug inโ values in ๐ฝ for ๐ฅ and in 63
64
4. Primes in polynomial rings: constructing finite fields
this way think of the polynomial as giving rise to a function ๐ โถ ๐ฝ โ ๐ฝ. It is a simple matter to check (and you should check!) that if ๐ and ๐ are polynomials in ๐ฝ[๐ฅ] then when the polynomial ๐ + ๐ is evaluated at ๐ผ โ ๐ฝ the result is the sum of evaluating ๐ and ๐ at ๐ผ. Similarly (๐๐)(๐ผ) equals ๐(๐ผ)๐(๐ผ). Example 4.1. There are only 4 possible functions from ๐ฝ2 to ๐ฝ2 , but there are infinitely many polynomials in ๐ฝ2 [๐ฅ]. So when we view a polynomial in ๐ฝ2 [๐ฅ] as a function from ๐ฝ2 โ ๐ฝ2 , we may lose a lot of information about ๐ and many different polynomials may give rise to the same function. For instance the polynomials ๐ฅ, ๐ฅ2 , ๐ฅ3 , . . . all give rise to the same function from ๐ฝ2 to ๐ฝ2 (taking 0 to 0, and 1 to 1), but they are all different elements of ๐ฝ2 [๐ฅ]. Definition 4.2. Let ๐ โ ๐ฝ[๐ฅ] be a polynomial with coefficients in the field ๐ฝ. An element ๐ผ โ ๐ฝ is called a root of ๐ if ๐(๐ผ) = 0. Lemma 4.3. Let ๐ฝ be a field, and let ๐ โ ๐ฝ[๐ฅ] be a non-zero polynomial. If ๐ผ โ ๐ฝ is a root of ๐ then ๐(๐ฅ) = (๐ฅ โ ๐ผ)๐(๐ฅ) for a polynomial ๐ โ ๐ฝ[๐ฅ]. Moreover, if ๐ has degree ๐ then ๐ can have at most ๐ distinct roots in ๐ฝ. Proof. Let us begin with the first assertion. Use the division algorithm to write ๐(๐ฅ) = (๐ฅโ๐ผ)๐(๐ฅ)+๐(๐ฅ), where either ๐(๐ฅ) is zero (in which case ๐(๐ฅ) = (๐ฅ โ ๐ผ)๐(๐ฅ) as desired), or ๐(๐ฅ) is of degree 0 which means that it is a non-zero constant ๐. We now show that the second case cannot arise. Indeed, evaluating the relation ๐(๐ฅ) = (๐ฅ โ ๐ผ)๐(๐ฅ) + ๐(๐ฅ) at ๐ฅ = ๐ผ, we obtain 0 = 0 โ
๐(๐ผ) + ๐(๐ผ), so that ๐(๐ผ) = ๐ = 0. To prove the second statement, we use induction. Polynomials of degree 0 are non-zero constants, and thus have no roots. Let now ๐ be a polynomial of degree ๐ โฅ 1, and suppose that the result has been established for all smaller degrees. If ๐ has no roots, then there is nothing to prove. If ๐ has a root ๐ผ, we may write ๐(๐ฅ) = (๐ฅ โ ๐ผ)๐(๐ฅ) for ๐ of degree ๐ โ 1. By the induction hypothesis ๐ has at most ๐ โ 1 roots, and the roots of ๐ must be either ๐ผ or among the roots of ๐, which completes our proof. โก Example 4.4. In the ring (โค/15โค)[๐ฅ], the polynomial ๐ฅ2 โ 1 has 4 roots, namely ๐ฅ โก 1, โ1, 4, โ4 mod 15. How do you reconcile this with our result above?
4.1. Primes in the polynomial ring over a field
65
Definition 4.5. A polynomial ๐ โ ๐ฝ[๐ฅ] is called monic if its leading coefficient (that is, coefficient of the largest power of ๐ฅ) is 1. Thus a monic polynomial of degree ๐ looks like ๐(๐ฅ) = ๐ฅ๐ + ๐๐โ1 ๐ฅ๐โ1 + . . . + ๐0 , and every non-zero polynomial in ๐ฝ[๐ฅ] can be written as a non-zero constant times a monic polynomial. The units of ๐ฝ[๐ฅ] are the non-zero constants in ๐ฝ. By restricting to monic polynomials we are basically getting rid of the units, in much the same way that rather than thinking of factorization in โค we are used to getting rid of the sign ยฑ1 and restricting to factorization in the positive integers โ. Thus, refining our original question a little, what are the monic irreducible polynomials in ๐ฝ[๐ฅ]? As a first observation, note that all monic polynomials of degree 1, namely ๐ฅ โ ๐ผ with ๐ผ โ ๐ฝ, are irreducible. Example 4.6. You may have heard of the Fundamental Theorem of Algebra (which we wonโt prove here) which guarantees that every nonconstant polynomial in โ[๐ฅ] has a root. This implies that the only monic irreducible polynomials in โ[๐ฅ] are the linear polynomials (๐ฅ โ ๐ผ) for ๐ผ โ โ, and every polynomial of higher degree may be factored into these linear polynomials. We know that the quotient rings โ[๐ฅ]/(๐ฅ โ ๐ผ) are fields, but in fact these turn out to be essentially just โ. Indeed, note that the equivalence classes ๐ฝ mod (๐ฅ โ ๐ผ) with ๐ฝ โ โ are disjoint, and partition โ[๐ฅ]โif ๐ is a polynomial in โ[๐ฅ] then ๐(๐ฅ) โก ๐(๐ผ) mod (๐ฅ โ ๐ผ). Example 4.7. The situation in โ[๐ฅ] is also not too bad. We already know that all monic polynomials of degree 1, namely (๐ฅ โ ๐) with ๐ โ โ, are irreducible. There are also irreducible quadratics ๐ฅ2 +๐๐ฅ+๐ with ๐, ๐ โ โ such that the discriminant ๐2 โ 4๐ < 0. Such quadratic polynomials do not have real roots, and thus cannot be factored into linear polynomials and therefore must be irreducible. These are all the irreducible polynomials in โ[๐ฅ]. Indeed if ๐ is a polynomial in โ[๐ฅ] with a real root then it is divisible by some linear polynomial ๐ฅ โ ๐. On the other hand, if ๐ has a complex root ๐ผ which is not real, then the complex conjugate ๐ผ must also be a root of ๐, and ๐ will be divisible by the quadratic polynomial (๐ฅ โ ๐ผ)(๐ฅ โ ๐ผ) = ๐ฅ2 โ (๐ผ + ๐ผ)๐ฅ + |๐ผ|2 โ โ[๐ฅ].
66
4. Primes in polynomial rings: constructing finite fields
You should stop and work out what examples of fields arise when we quotient โ[๐ฅ] by (๐ฅ โ ๐), or by an irreducible quadratic (๐ฅ2 + ๐๐ฅ + ๐). Example 4.8. The story for โ[๐ฅ] is more complicated, or much more interesting, depending on your perspective! There are a lot more examples of irreducible polynomials: for example, ๐ฅ2 โ 2, ๐ฅ2 + 5, ๐ฅ3 โ 2, 1 + ๐ฅ + ๐ฅ2 + ๐ฅ3 + ๐ฅ4 are all examples of irreducible polynomials. Taking the quotient of โ[๐ฅ] by the ideal generated by any of these irreducible polynomials gives rise to what are called number fields. A lot of work has gone into trying to understand such fields, and you may encounter them in courses on algebraic number theory, or in Galois theory. Marcus [17] gives a friendly introduction to such fields. Let us finally turn to the question of chief interest for us. Let ๐ฝ = ๐ฝ๐ be a finite field with ๐ elements. If you like you could just think of the familiar example ๐ฝ๐ = โค/๐โค with ๐ = ๐ a prime number, but the arguments work equally well if we start with any finite field. Our goal is to show that there exist monic irreducible polynomials ๐ of every degree ๐ in ๐ฝ๐ [๐ฅ]. Then the quotient ring ๐ฝ๐ [๐ฅ]/(๐) would be a field, and we shall see that its size is ๐๐ . In particular, starting with the fields ๐ฝ๐ , this process would produce fields of every prime power size ๐๐ , and we shall see in the next chapter that every finite field must necessarily have size a prime power. Given a natural number ๐, define ๐(๐; ๐ฝ๐ ) = #{๐ โถ ๐ โ ๐ฝ๐ [๐ฅ], deg(๐) = ๐, (4.1)
with ๐ monic and irreducible},
where deg(๐) denotes the degree of a polynomial ๐. In the next section we will rework our proof of Bertrandโs postulate (see ยง2.2) to show the following key result, and deduce from it that there must be monic irreducibles of every degree. Theorem 4.9. Suppose we are given a field ๐ฝ๐ with ๐ elements, and let ๐(๐; ๐ฝ๐ ) be as in (4.1). Then for all natural numbers ๐ we have (4.2)
๐๐ = โ ๐๐(๐; ๐ฝ๐ ). ๐|๐
Corollary 4.10. For all natural numbers ๐ we have ๐๐ ๐๐ โ 2(๐โ๐/2โ โ 1) โค ๐(๐; ๐ฝ๐ ) โค . ๐ ๐
4.1. Primes in the polynomial ring over a field
67
In particular, for every natural number ๐, there exists a monic irreducible polynomial in ๐ฝ๐ [๐ฅ] of degree ๐. The notation ๐(๐; ๐ฝ๐ ) may remind you of the notation ๐(๐ฅ) that we used to count primes below ๐ฅ. In fact, there is a strong analogy between these two situations, as we shall see in Sections 4.2 and 4.3. For the present, let us note that Gaussโs conjecture for ๐(๐ฅ) (which we discussed in Section 2.3) asserts that (roughly speaking) a number ๐ has about a 1/ log ๐ chance of being prime. Analogously, Corollary 4.10 reveals that a monic polynomial in ๐ฝ๐ [๐ฅ] of degree ๐ has about a 1/๐ chance of being irreducible. In Section 2.3 we mentioned the Riemann Hypothesis which predicts that ๐(๐ฅ) is approximated by li(๐ฅ) to accuracy about โ๐ฅ. Corollary 4.10 shows that in the ๐ฝ๐ [๐ฅ] setting the analogue of the Riemann Hypothesis can be established! Indeed, it shows that ๐(๐; ๐ฝ๐ ) may be approximated by ๐๐ /๐ to accuracy about โ๐๐ . We have already mentioned before that the existence of such monic irreducible polynomials leads to the existence of finite fields of size ๐๐ for every prime power ๐๐ . Let us now flesh out this consequence carefully. Theorem 4.11. For every prime power ๐ = ๐๐ there exists a finite field of size ๐.
Proof. Start with the known finite field of size ๐: ๐ฝ๐ = โค/๐โค. Recall that the ring ๐ฝ๐ [๐ฅ] is a Euclidean domain, and hence a PID. Pick a monic irreducible polynomial ๐ โ ๐ฝ๐ [๐ฅ] of degree ๐, which exists by Corollary 4.10. Since ๐ is irreducible (and hence prime), the ideal (๐) is a prime ideal. In fact, since we are working in a PID this ideal is also maximal (see Chapter 3, Proposition 3.22). Since (๐) is maximal, the quotient ring ๐ฝ๐ [๐ฅ]/(๐) is a field. The last thing is to check the size of this field ๐ฝ๐ [๐ฅ]/(๐). Using the division algorithm, we may express every polynomial in ๐ฝ๐ [๐ฅ] as a multiple of ๐ plus a remainder, which is either zero or a polynomial of degree โค ๐ โ 1. The number of such remainder polynomials is clearly ๐๐ , and moreover the difference of any two distinct polynomials of degree โค ๐ โ 1 is a non-zero polynomial of degree โค ๐ โ 1 and so cannot be a multiple of ๐. Therefore the quotient ๐ฝ๐ [๐ฅ]/(๐) has exactly ๐๐ elements as claimed. โก
68
4. Primes in polynomial rings: constructing finite fields
More generally, we could start with any known field ๐ฝ๐ of size ๐, and using a monic irreducible ๐ of degree ๐ (which exists by Corollary 4.10) we would obtain a field ๐ฝ๐ [๐ฅ]/(๐) of size ๐๐ . This follows from the argument of Theorem 4.11. The rest of this chapter is organized as follows. In the next section we shall prove Theorem 4.9 and Corollary 4.10 by finding analogues of our work on Bertrandโs postulate. Then in ยง4.3, we revisit Eulerโs proof of the infinitude of primes, and sketch a related argument which gives another proof of the fundamental relation (4.2). Finally, in ยง4.4 we show how the relation (4.2) (and other such relations) may be โinvertedโ to obtain an exact formula for ๐(๐; ๐ฝ๐ ).
4.2. An analogue of the proof of Bertrandโs postulate Recall that in Section 2.2 we established Bertrandโs postulate which guarantees the existence of a prime ๐ with ๐+1 โค ๐ โค 2๐ for all ๐. If we apply this with ๐ = 2๐ for a natural number ๐, then we see that there always exists a prime number with ๐+1 binary digits: 2๐ +๐๐โ1 2๐โ1 +. . .+๐0 with all ๐๐ โ {0, 1}. This problem bears a similarity to our problem of finding monic irreducibles ๐ฅ๐ + ๐๐โ1 ๐ฅ๐โ1 + . . . + ๐0 where the coefficients ๐๐ arise from the ๐-element set ๐ฝ๐ . In this section we develop analogues of the ideas in Section 2.2, and thus establish Theorem 4.9 and Corollary 4.10. Our proof of Bertrandโs postulate revolved around factorials and the middle binomial coefficient (2๐ ) ). We then played off the size of (2๐ ๐ ๐ against its prime factorization. Let us begin by thinking of an analogue of the factorial in the context of ๐ฝ๐ [๐ฅ]. Define (4.3)
โฑ๐ =
โ
๐,
๐โ๐ฝ๐ [๐ฅ] ๐ monic deg(๐)=๐
so that โฑ๐ is the product of all monic polynomials of degree ๐. Note that โฑ๐ is a monic polynomial in ๐ฝ๐ [๐ฅ] of degree ๐๐๐ (since it is the product of ๐๐ polynomials each of degree ๐). Note that โฑ๐ is only an approximate analogue of the factorial, since we multiply only the monic polynomials of degree exactly ๐, rather than all the monic polynomials of degree at most ๐. In analogy with Lemma 2.3, let us determine the prime factorization of โฑ๐ .
4.2. An analogue of the proof of Bertrandโs postulate
69
Lemma 4.12. We may factor โฑ๐ as โ
โฑ๐ =
๐ ๐(๐) ,
๐ monic, irreducible deg(P)โค๐
where, if we denote deg(๐) by ๐, the exponent ๐(๐) is given by ๐(๐) = โ ๐๐โโ๐ . โโค๐/๐
Proof. The proof parallels our argument in Lemma 2.3 closely. It is clear that only monic irreducibles ๐ with degree at most ๐ are relevant to the factorization of โฑ๐ and what needs proving is the formula for the exponent ๐(๐). How many monic polynomials of degree ๐ are divisible by the monic irreducible ๐ of degree ๐? If we write ๐ as ๐๐, then ๐ is a monic polynomial of degree ๐ โ ๐, and thus there are ๐๐โ๐ possibilities for ๐. Each such polynomial ๐ contributes 1 to the exponent ๐(๐), but some may contribute more than 1. The number of polynomials that are divisible by ๐ 2 is ๐๐โ2๐ , provided 2๐ โค ๐, and these contribute at least 2 to ๐(๐), and are counted twice in our formula, once from being a multiple of ๐, and once from being a multiple of ๐2 . And so on. โก (2๐)!
We now want an analogue of the binomial coefficient (2๐ ) = ๐!2 , ๐ ๐ and this will be played by โฑ๐ /โฑ๐โ1 . Here is one plausible reason for considering this analogue. The binomial coefficient (2๐ ) has an equal num๐ ber of terms appearing in the products in the numerator (namely 2๐) ๐ and denominator (๐ terms, each appearing twice). Likewise โฑ๐ /โฑ๐โ1 also has an equal number of terms appearing in the numerator (namely ๐๐ ) and denominator (๐๐โ1 terms, each appearing ๐ times). While the binomial coefficient is clearly an integer, it is not at all ๐ clear why the quantity โฑ๐ /โฑ๐โ1 should be a polynomial in ๐ฝ๐ [๐ฅ] rather than just a ratio of polynomials. But, very pleasantly, it turns out that ๐ โฑ๐ /โฑ๐โ1 is in ๐ฝ๐ [๐ฅ], and later (see Theorem 9.1 in Chapter 9) we shall see exactly what this polynomial is. ๐
Lemma 4.13. The polynomial โฑ๐โ1 divides the polynomial โฑ๐ . More precisely, we have the factorization โฑ๐ โ = ๐. (4.4) ๐ โฑ๐โ1 ๐ monic, irreducible deg(๐)|๐
70
4. Primes in polynomial rings: constructing finite fields
Proof. Let ๐ be a monic irreducible with ๐ = deg(๐) โค ๐. Let us compare the power of ๐ dividing the numerator โฑ๐ with the power of ๐ divid๐ ing the denominator โฑ๐โ1 . Our goal is to show that if ๐ does not divide ๐, then the two exponents match, while if ๐|๐ then there is one more power of ๐ in the numerator than in the denominator. Suppose first that ๐ does not divide ๐. Then ๐/๐ is not an integer, and using Lemma 4.12 the power of ๐ dividing โฑ๐ equals โ ๐๐โโ๐ = โโค๐/๐
๐๐โโ๐ = ๐
โ โโค(๐โ1)/๐
๐๐โ1โโ๐ .
โ โโค(๐โ1)/๐
But the right side is simply ๐ times the power of ๐ dividing โฑ๐โ1 . Thus in this case ๐ divides to an equal power the numerator โฑ๐ and the de๐ nominator โฑ๐โ1 . Suppose now that ๐ divides ๐. Thus ๐/๐ is an integer, and the power of ๐ dividing โฑ๐ is now โ ๐๐โโ๐ = โโค๐/๐
โ
๐๐โโ๐ + 1 = 1 + ๐
โ
๐๐โ1โโ๐ ,
โโค(๐โ1)/๐
โโค(๐โ1)/๐
which is 1 more than the power of ๐ dividing
๐ โฑ๐โ1 .
โก
Proof of Theorem 4.9. Recall that our goal is to establish the identity (4.2): ๐๐ = โ ๐๐(๐; ๐ฝ๐ ). ๐|๐
Let us compute the degrees on both sides of the relation (4.4). In our analogy with the proof of Bertrandโs postulate, the degree of a polynomial plays the role of the size of an integer. Since the degree of โฑ๐ is ๐๐๐ , computing the degree on the left side of (4.4) gives deg(โฑ๐ ) โ ๐deg(โฑ๐โ1 ) = ๐๐๐ โ ๐((๐ โ 1)๐๐โ1 ) = ๐๐ . On the other hand, the degree of the right side of (4.4) is โ ๐#{๐ โถ ๐ monic, irreducible of degree ๐} = โ ๐๐(๐; ๐ฝ๐ ). ๐|๐
๐|๐
Equating these two expressions proves the theorem. Proof of Corollary 4.10. Our main goal is to establish the bounds ๐๐ ๐๐ โ 2(๐โ๐/2โ โ 1) โค ๐(๐; ๐ฝ๐ ) โค . ๐ ๐
โก
4.3. An analogue of Eulerโs proof
71
First let us establish the upper bound on ๐(๐; ๐ฝ๐ ), which follows at once from Theorem 4.9. Indeed, since ๐(๐; ๐ฝ๐ ) is always non-negative, ๐๐(๐; ๐ฝ๐ ) โค โ ๐๐(๐; ๐ฝ๐ ) = ๐๐ , ๐|๐
so that ๐(๐; ๐ฝ๐ ) โค ๐๐ /๐ as claimed. Now we turn to the lower bound. Using the upper bound just established, we get (4.5)
๐๐(๐; ๐ฝ๐ ) = ๐๐ โ โ ๐๐(๐; ๐ฝ๐ ) โฅ ๐๐ โ โ ๐๐ . ๐|๐ ๐ ๐ with ๐๐ = ๐๐ , then ๐๐โ๐ = 1 so that ๐ โ ๐ would be a non-zero element in ๐. Thus in this case ๐บ is infinite. Define ๐ โถ ๐บ โ โค by setting ๐(๐๐ ) = ๐. Since all the elements ๐๐ are distinct, this is a bijection. Further, clearly, ๐(๐๐ ร ๐โ ) = ๐(๐๐+โ ) = ๐ + โ = ๐(๐๐ ) + ๐(๐โ ), so that ๐ sets up an isomorphism between ๐บ and โค. Observe that the right side above is compatible with our definition in (5.1) since the group operation in โค is addition. Now suppose that ๐ = (๐), so that ๐โ๐ = 1 for all โ โ โค. For any integer ๐, it follows that ๐๐ = ๐๐+โ๐ , or in other words the values ๐๐ really depend only on the residue class ๐ mod ๐. Note that the elements
86
5. Additive and multiplicative structures
๐๐ with 0 โค ๐ โค ๐ โ 1 are all distinct; for if 0 โค ๐ < ๐ โค ๐ โ 1 with ๐๐ = ๐๐ then ๐ โ ๐ would be an element of ๐ with 0 < ๐ โ ๐ < ๐, which is impossible. Thus in this case ๐บ = {1 = ๐0 , ๐1 , . . . , ๐๐โ1 }, and we can define a map ๐ โถ ๐บ โ โค/๐โค by setting ๐(๐๐ ) = ๐ mod ๐. This map gives the desired isomorphism. โก Thus the structure of a cyclic group is entirely determined by its size. We will sometimes denote a cyclic group of size ๐ by ๐ถ๐ . A first step in understanding a general group ๐บ would be to understand the cyclic groups generated by elements ๐ โ ๐บ. Definition 5.4. Let ๐บ be a group, and let ๐ be an element of ๐บ. Consider the cyclic subgroup of ๐บ generated by ๐: ๐ป = {๐๐ โถ ๐ โ โค}. If the group ๐ป is finite, then we call the size of this group the order of the element ๐ โ ๐บ. If ๐ป is infinite, we say that ๐ has infinite order. Proposition 5.5. Let ๐ be an element of finite order in the group ๐บ. Then the order of ๐ is the smallest natural number ๐ such that ๐๐ equals the identity element of ๐บ. Proof. This was essentially discussed in our proof of Proposition 5.3. As in that proof, if we set ๐ to be the set of all integers ๐ such that ๐๐ = 1, then ๐ is an ideal of โค and must equal (๐) for some natural number ๐. Then ๐ is the size of the group generated by ๐, which is isomorphic to โค/๐โค. Thus ๐ is the order, and since ๐ = (๐), we also have that ๐ is the smallest natural number such that ๐๐ = 1. โก We end this section by giving a complete description of all the possible orders of elements in a finite cyclic group, together with how many elements have that order. Proposition 5.6. Let ๐บ be a cyclic group of size ๐, and let ๐ denote a generator of this group. Then for each integer ๐, the element ๐๐ has order ๐/(๐, ๐). For every divisor ๐ of ๐, there are exactly ๐(๐) elements of ๐บ with order ๐. In particular, there are ๐(๐) generators of the group ๐บ. Proof. Suppose ๐๐ has order ๐. Then ๐๐๐ = 1 in ๐บ, and since ๐ has order ๐, this means that ๐ divides ๐๐ (as we saw in the proof of Proposition 5.5). Now a small exercise using the Euclidean algorithm should show that ๐/(๐, ๐) must divide ๐ (see Exercise 1 from Chapter 2). Further ๐
5.2. More about groups: Lagrangeโs theorem
87
times ๐/(๐, ๐) is a multiple of ๐, and so (๐๐ )๐/(๐,๐) = 1. This establishes that the order of ๐๐ is ๐/(๐, ๐). As ๐ ranges from 1 to ๐ (so that ๐๐ ranges over all elements of ๐บ), the possible values for (๐, ๐) = ๐ are the divisors of ๐. Writing ๐ = ๐โ, the number of ๐ in 1 to ๐ with (๐, ๐) = ๐ equals the number of โ in 1 to ๐/๐ that are coprime to ๐/๐. In other words, there are ๐(๐/๐) such values of โ, and so ๐(๐/๐) values of ๐ with (๐, ๐) = ๐. Thus we have shown that for every divisor ๐ of ๐, there are exactly ๐(๐/๐) elements of ๐บ with order ๐/๐. Writing ๐ = ๐๐, we see that ๐ = ๐/๐ ranges over the divisors of ๐, and the proposition follows. โก Since each of the ๐ elements in ๐บ must have some order ๐|๐, we may also conclude that ๐ = โ๐|๐ ๐(๐); a relation we already saw in Proposition 4.21 (and the proofs are quite similar).
5.2. More about groups: Lagrangeโs theorem We just saw that in a cyclic group of size ๐, all elements have order dividing ๐. A beautiful theorem of Lagrange establishes that in any finite group ๐บ (abelian or not), the order of any element must always divide the size of the group. Theorem 5.7 (Lagrangeโs theorem). Let ๐บ be a finite group, and let ๐ป be any subgroup of ๐บ. Then the size of ๐ป divides the size of ๐บ. In particular, the order of any element ๐ โ ๐บ divides the size of the group. Proof. Given a subgroup ๐ป and an element ๐ โ ๐บ, define ๐๐ป = {๐โ โถ โ โ ๐ป}. Such sets are called left cosets. Note that each left coset ๐๐ป has exactly |๐ป| elements in it, since ๐โ1 = ๐โ2 implies that โ1 = โ2 . Further, if ๐1 ๐ป and ๐2 ๐ป are two such cosets, we claim that they are either identical sets, or they are disjoint. For if ๐1 โ1 = ๐2 โ2 for some โ1 , โ2 โ ๐ป then ๐1 = ๐2 โ3 with โ3 = โ2 โ1โ1 โ ๐ป. Therefore any ๐1 โ may be written as ๐2 (โ3 โ) and so lies in the coset ๐2 ๐ป. It follows that ๐1 ๐ป โ ๐2 ๐ป. By symmetry ๐2 ๐ป โ ๐1 ๐ป and the two sets must be the same. Now start with ๐1 = 1 and ๐ป1 = ๐1 ๐ป = ๐ป. If this accounts for all of ๐บ, then we stop, and note that |๐ป| = |๐บ| and so |๐ป| divides |๐บ|.
88
5. Additive and multiplicative structures
Otherwise pick ๐2 to be some element in ๐บ but not in ๐ป1 , and put ๐ป2 = ๐2 ๐ป. Note that ๐ป1 and ๐ป2 have the same number of elements (namely |๐ป|) and are disjoint (else they would have to be the same, forcing ๐2 โ ๐ป1 ). Now either ๐บ = ๐ป1 โช ๐ป2 , in which case |๐บ| = 2|๐ป| and we are done. Or we can pick ๐3 โ ๐บ but not in ๐ป1 โช ๐ป2 , and now consider ๐ป3 = ๐3 ๐ป. Note that since ๐3 is not in ๐ป1 or ๐ป2 , ๐ป3 cannot be exactly ๐ป1 or exactly ๐ป2 . So ๐ป3 is disjoint from ๐ป1 and ๐ป2 , and so on. Since ๐บ is finite, we must end up with a partition of ๐บ into say ๐ disjoint cosets ๐ป1 โช ๐ป2 โช โฏ โช ๐ป๐ , and so |๐บ| = ๐|๐ป| as desired. If we take ๐ป to be the subgroup generated by ๐, it follows that the order of the element ๐ divides the size of the group, |๐บ|. โก
Here is another way to phrase our proof of Lagrangeโs theorem. Define a binary relation โผ on ๐บ by saying that ๐1 โผ ๐2 holds exactly when ๐โ1 2 ๐1 is an element of ๐ป. This is also the same (you should check this) as saying that ๐1 โผ ๐2 holds exactly when ๐1 and ๐2 belong to the same left coset ๐1 ๐ป = ๐2 ๐ป. Check further that โผ is an equivalence relation, and the equivalence classes are precisely the left cosets. Since we can partition ๐บ as a disjoint union of equivalence classes, Lagrangeโs theorem follows. In our proof of Lagrangeโs theorem, we used left cosets. One could equally well use right cosets ๐ป๐ = {โ๐ โถ โ โ ๐ป}, which corresponds to the equivalence relation ๐1 โ ๐2 exactly when ๐1 ๐โ1 2 โ ๐ป. If the group ๐บ is abelian, then the notions of right and left cosets are identical. In fact, this can happen even when ๐บ is not abelian, and the subgroup ๐ป might still satisfy the nice property that ๐๐ป = ๐ป๐ for all ๐ โ ๐บ. Such nice subgroups ๐ป are called normal, and they play an important role in understanding the structure of groups. This discussion of cosets and partitioning ๐บ into equivalence classes may remind you of our earlier discussion of quotient rings. It is natural to ask whether the set of left cosets {๐๐ป โถ ๐ โ ๐บ} can be given a group structure by defining the product of ๐1 ๐ป and ๐2 ๐ป to be (๐1 ๐2 )๐ป. One must check however that this notion is well defined: namely, if we picked any other element ๐โฒ1 โ ๐1 ๐ป and ๐โฒ2 โ ๐2 ๐ป, we would need to make sure that the coset ๐1 ๐2 ๐ป is the same as ๐โฒ1 ๐โฒ2 ๐ป. This does indeed hold when ๐บ is abelian (and so we get here a quotient group ๐บ/๐ป), but it
5.2. More about groups: Lagrangeโs theorem
89
does not hold in general. In fact the notion is well defined exactly when the subgroup ๐ป is normal! Let us now return to the situations of interest for us, which are all abelian groups, and record some immediate and interesting consequences of Lagrangeโs theorem. Corollary 5.8 (Fermat). If ๐ is a prime number then ๐๐ โก ๐ mod ๐ for all integers ๐. Proof. Consider the multiplicative group (โค/๐โค)ร , which has size ๐โ1. Lagrangeโs theorem gives that if ๐ is the order of any reduced residue ๐ mod ๐ (so ๐๐ โก 1 mod ๐) then ๐ divides ๐ โ 1. Thus ๐๐โ1 = (๐๐ )(๐โ1)/๐ โก 1 mod ๐, and it follows that ๐๐ = ๐ ร ๐๐โ1 โก ๐ mod ๐ for (๐, ๐) = 1. If ๐|๐ then clearly ๐๐ โก 0 mod ๐ and ๐ โก 0 mod ๐, so that the result holds in this case also. โก We saw earlier in (4.8), that if โ is prime and there is a field ๐ฝ๐ of size ๐ then ๐(โ; ๐ฝ๐ ) = (๐โ โ ๐)/โ. Since ๐(โ; ๐ฝ๐ ) is an integer, we know that โ must divide ๐โ โ ๐ (if there is a field of size ๐). Now from Fermatโs theorem we recognize that for all integers ๐, if โ is prime then โ must divide ๐โ โ ๐. Corollary 5.9 (Euler). Let ๐ be a natural number, and let ๐(๐) denote the Euler ๐-function (which is the size of the multiplicative group (โค/๐โค)ร ). Then for any (๐, ๐) = 1 we have ๐๐(๐) โก 1 mod ๐. Proof. Apply Lagrangeโs theorem to the group (โค/๐โค)ร .
โก
With Lagrangeโs theorem we can make a first step in understanding the additive and multiplicative groups of a finite field. Corollary 5.10. Let ๐ฝ๐ be a finite field with ๐ elements. Then for all ๐ผ โ ๐ฝ๐ we have (5.2)
๐๐ผ = 0,
and (5.3)
๐ผ๐ = ๐ผ.
90
5. Additive and multiplicative structures
Proof. We should first clarify that when we write ๐๐ผ in (5.2), we mean the result of adding ๐ผ to itself ๐ times; just as ๐ผ๐ denotes the result of multiplying ๐ผ by itself ๐ times. We mention this explicitly to draw attention to a possible ambiguity. We denote the multiplicative identity in our field by 1, and this could also just denote the natural number 1. Similarly, it is tempting to write 2 for the element 1 + 1 in the field and so on. Thus ๐ could either have denoted the natural number ๐, or the element 1 + . . . + 1 (added ๐ times) in the field (which should be 0 according to (5.2)). In the additive group ๐ฝ๐ , the element ๐ผ must have order dividing ๐ by Lagrange, and this gives (5.2). The proof of (5.3) is exactly like our proof of Corollary 5.8. If ๐ผ = 0 then so is ๐ผ๐ so that (5.3) holds. If ๐ผ โ 0 then ๐ผ belongs to the multiplicative group ๐ฝ๐ร which has ๐ โ 1 elements. By Lagrange ๐ผ๐โ1 = 1, and so once again ๐ผ๐ = ๐ผ. โก
5.3. The additive structure of finite fields In Definition 5.2 we explained what it means for two groups to be isomorphic. In a similar fashion we can make precise what it means for rings or fields to be isomorphic. Definition 5.11. Let ๐
and ๐ be two rings. We say that ๐
and ๐ are isomorphic if there is a bijection ๐ โถ ๐
โ ๐ such that for all ๐1 , ๐2 โ ๐
we have (5.4)
๐(๐1 + ๐2 ) = ๐(๐1 ) + ๐(๐2 ), and ๐(๐1 ๐2 ) = ๐(๐1 )๐(๐2 ).
Similarly, if ๐น and ๐พ are two fields, then we say that ๐น and ๐พ are isomorphic if there is a bijection ๐ โถ ๐น โ ๐พ with the relations in (5.4) holding for all elements ๐1 , ๐2 in the field ๐น. In other words, two fields are isomorphic exactly when they are isomorphic when viewed just as rings. Let ๐ฝ be a field. To start with, let us allow ๐ฝ to be finite or infinite, and later specialize to the case of finite fields. What is the order of 1 in the additive group of ๐ฝ? It could either be infinite, or a finite number (which we will soon see must be a prime number). Let us begin with the case when 1 has infinite order.
5.3. The additive structure of finite fields
91
Proposition 5.12. Let ๐ฝ be a field, and suppose that 1 has infinite order in the additive group of ๐ฝ. Then ๐ฝ contains in it a field isomorphic to the field of rational numbers โ. Proof. For clarity let us denote the multiplicative identity in the field by 1๐น . Our assumption is that this element has infinite order, which means that under addition 1๐น generates an infinite cyclic group, which we know must be isomorphic to โค (see Proposition 5.3). Indeed the isomorphism is simply given by identifying 1๐น + 1๐น + . . . + 1๐น (summed ๐ times, and which we could denote by ๐๐น ) with the natural number ๐, and similarly โ๐๐น being identified with โ๐. But since ๐น is a field, we must also have a multiplicative inverse for ๐๐น (assuming ๐ โ 0), which we may denote by 1/๐๐น , and this forces us further to have other fractions ๐๐น /๐๐น . Identifying the fraction ๐๐น /๐๐น with the rational number ๐/๐ shows that ๐ฝ contains inside it a field isomorphic to โ. โก Next consider the case when the order of 1 is finite. Proposition 5.13. Let ๐ฝ be a field, and suppose that 1 has finite order in the additive group of ๐ฝ. Then the order of 1 must be a prime number ๐, and for every ๐ผ โ ๐ฝ we have ๐๐ผ = 0, where ๐๐ผ is the result of adding ๐ผ to itself ๐ times. Further the field ๐ฝ contains in it a field isomorphic to ๐ฝ๐ . Proof. Again for clarity let 1๐น denote the multiplicative identity of the field, and suppose its order is ๐. We wish to show that ๐ is prime. Suppose to the contrary that ๐ = ๐๐ is composite with ๐ and ๐ both natural numbers smaller than ๐. Let ๐๐น denote the result of adding 1๐น to itself ๐ times, and ๐๐น the result of adding 1๐น to itself ๐ times. Note that ๐๐น and ๐๐น are both non-zero, since ๐ and ๐ are smaller than the order of 1๐น (which is ๐). What is ๐๐น ร ๐๐น ? If we expand it out using the distributive law, we see that we must have 1๐น added to itself ๐๐ = ๐ times. But by assumption 1๐น added to itself ๐ times gives 0. In other words ๐๐น ร ๐๐น = 0, which means that ๐๐น and ๐๐น are zero divisors, contradicting ๐ฝ being a field. Thus the order of 1๐น must be a prime number ๐. Since ๐1๐น = 0, it follows by the distributive law that ๐๐ผ = 0 for all ๐ผ โ ๐ฝ.
92
5. Additive and multiplicative structures
Now ๐ฝ contains inside it the ๐-element set {1๐น , 2๐น , . . . , (๐ โ 1)๐น , 0} generated additively by the element 1๐น . We claim that these ๐ elements form a field, the point being that we can identify these elements ๐๐น with the corresponding residue class ๐ mod ๐. How can we find the inverse of a non-zero element in this set ๐๐น ? Simply take the inverse of ๐ mod ๐ in โค/๐โค, say this is ๐ mod ๐, and then the distributive law gives ๐๐น ร ๐๐น = (๐๐) ร 1๐น = 1๐น , since ๐๐ โก 1 mod ๐. Thus the set {1๐น , 2๐น , . . . , (๐ โ 1)๐น , 0} forms a field contained in ๐ฝ, and upon identifying ๐๐น with the residue class ๐ mod ๐, this field is clearly isomorphic to ๐ฝ๐ . โก Definition 5.14. A field ๐ฝ is said to be of characteristic zero if the order of 1 is infinite. If the order of 1 is finite, then this order ๐ (which is a prime number) is called the characteristic of the field ๐ฝ, and then the field is said to be of finite characteristic, or of characteristic ๐. So far we have seen that the โsmallest fieldโ of characteristic zero is the field โ of rational numbers, in the sense that any field of characteristic zero contains an isomorphic copy of โ. Correspondingly, the smallest field of characteristic ๐ is ๐ฝ๐ = โค/๐โค, and every field of characteristic ๐ contains a copy of ๐ฝ๐ . Example 5.15. Clearly every field of characteristic zero must be infinite, and every finite field necessarily has finite characteristic ๐. But it is also possible for fields of characteristic ๐ to be infinite. To see this consider the polynomial ring ๐ฝ๐ [๐ฅ]. Since this is an integral domain, we may form its field of fractions, obtaining all โrational functionsโ ๐(๐ฅ)/๐(๐ฅ) with ๐, ๐ โ ๐ฝ๐ [๐ฅ] and ๐ โ 0. This field is denoted by ๐ฝ๐ (๐ฅ), and is clearly infinite, but still of characteristic ๐. Suppose now that ๐พ is a field, containing inside it a field ๐น (which we may naturally call a subfield of ๐พ). We introduce a new way of thinking about the relationship between ๐พ and ๐น. Temporarily, let us forget that we know how to multiply elements in ๐พ, and just focus on adding elements in ๐พ, and multiplying elements in ๐พ by elements in ๐น. The resulting structure may remind you of the idea of a vector space from linear algebra. Think of the elements of ๐น as โscalarsโ and the elements of ๐พ as โvectors.โ We then have a notion of what it means to add vectors (just addition in the field ๐พ), and the vectors form an abelian group under addition. We also have a notion of scalar multiplication (multiplying elements in ๐พ by elements in ๐น), and this notion satisfies ๐(๐๐ฃ) = (๐๐)๐ฃ
5.3. The additive structure of finite fields
93
together with the distributive laws (๐ + ๐)๐ฃ = ๐๐ฃ + ๐๐ฃ and ๐(๐ฃ + ๐ค) = ๐๐ฃ + ๐๐ค (for scalars ๐, ๐ โ ๐น and vectors ๐ฃ, ๐ค โ ๐พ). In other words, the axioms of a vector space over a field are satisfied, and we may view ๐พ as a vector space over ๐น. Example 5.16. The field โ may be viewed as a vector space over the field โ. The dimension of โ as a vector space is 2, as โ may be spanned by the two vectors 1 and ๐ which are linearly independent over โ. All that is missing in this picture is the knowledge of how to multiply two complex numbers ๐1 + ๐1 ๐ and ๐2 + ๐2 ๐, which we are ignoring temporarily. The field โ may be viewed as a vector space over โ, but this is a more complicated situation, being an example of an infinite dimensional vector space. We are now ready to describe the additive structure of finite fields, as well as to explain why the sizes of finite fields must be prime powers. Theorem 5.17. Let ๐ฝ๐ be a finite field with characteristic ๐, so that ๐ฝ๐ contains ๐ฝ๐ . Additively, ๐ฝ๐ has the structure of a finite dimensional vector space over ๐ฝ๐ . If ๐ denotes this dimension, then ๐ = ๐๐ must be a power of the prime ๐, and we may find ๐ elements ๐ฃ 1 , . . ., ๐ฃ ๐ โ ๐ฝ๐ such that all the ๐๐ elements of ๐ฝ๐ may be expressed uniquely as a linear combination ๐1 ๐ฃ 1 + ๐2 ๐ฃ 2 + . . . + ๐๐ ๐ฃ ๐ , where the coefficients ๐1 , . . ., ๐๐ lie in the finite field ๐ฝ๐ . Proof. We discussed above how ๐ฝ๐ may be viewed as a vector space over ๐ฝ๐ , and since ๐ฝ๐ is finite, the vector space must be finite dimensional. We may then find a basis for this vector space, and the dimension is the size of this basis. If ๐ฃ 1 , . . ., ๐ฃ ๐ is a basis for ๐ฝ๐ over the field ๐ฝ๐ , then the sums ๐1 ๐ฃ 1 + . . . + ๐๐ ๐ฃ ๐ with ๐๐ โ ๐ฝ๐ must all be distinct (else there would be a linear relation among the ๐ฃ 1 , . . ., ๐ฃ ๐ ) and must give all elements of ๐ฝ๐ (since these vectors must span the whole space). It follows that ๐ฝ๐ must have ๐๐ elements, completing the proof of the theorem. If you need a review of the linear algebra mentioned above, here is the same proof developed from scratch. Pick any non-zero element ๐ฃ 1 โ ๐ฝ๐ . By its span over ๐ฝ๐ we mean Span(๐ฃ 1 ) = {๐1 ๐ฃ 1 โถ ๐1 โ ๐ฝ๐ }, which has ๐ elements. If these are all the elements of ๐ฝ๐ , then the dimension ๐ is 1 and ๐ = ๐, and our proof is finished.
94
5. Additive and multiplicative structures
Otherwise we may find an element ๐ฃ 2 โ ๐ฝ๐ with ๐ฃ 2 โ Span(๐ฃ 1 ). Consider now the span of ๐ฃ 1 and ๐ฃ 2 : namely, Span(๐ฃ 1 , ๐ฃ 2 ) = {๐1 ๐ฃ 1 + ๐2 ๐ฃ 2 โถ ๐1 , ๐2 โ ๐ฝ๐ }. We claim that these elements are all distinct so that Span(๐ฃ 1 , ๐ฃ 2 ) has size ๐2 . Indeed if ๐1 ๐ฃ 1 + ๐2 ๐ฃ 2 = ๐1 ๐ฃ 1 + ๐2 ๐ฃ 2 , then (๐1 โ๐2 )๐ฃ 2 = (๐2 โ๐1 )๐ฃ 1 , and since ๐ฃ 2 โ Span(๐ฃ 1 ) we must have ๐1 โ๐2 = 0, and then (๐2 โ ๐1 )๐ฃ 1 = 0 forces ๐1 = ๐2 . If Span(๐ฃ 1 , ๐ฃ 2 ) = ๐ฝ๐ , then the dimension ๐ is 2, and ๐ = ๐2 , and the proof is complete. Else find ๐ฃ 3 โ ๐ฝ๐ with ๐ฃ 3 โ Span(๐ฃ 1 , ๐ฃ 2 ), and then consider Span(๐ฃ 1 , ๐ฃ 2 , ๐ฃ 3 ). And so on. The process must stop since ๐ฝ๐ is finite. โก Example 5.18. Suppose ๐ โ ๐ฝ๐ [๐ฅ] is a monic irreducible polynomial of degree ๐, and consider the field ๐ฝ๐ [๐ฅ]/(๐). Some elements in this field are ๐ฅ, ๐ฅ + 1, ๐ฅ(๐ฅ + 1), ๐ฅ3 + 1, all of these representing congruence classes ๐ฅ + (๐), ๐ฅ + 1 + (๐), etc. By the division algorithm every element in ๐ฝ๐ [๐ฅ] lies in a congruence class ๐(๐ฅ) + (๐) where ๐ โ ๐ฝ๐ [๐ฅ] is a polynomial of degree at most ๐ โ 1 (with ๐ possibly being the zero polynomial). Thus 1, ๐ฅ, ๐ฅ2 , . . ., ๐ฅ๐โ1 forms a basis over ๐ฝ๐ for this field. As with general vector spaces, there are of course many other possible ways of writing down a basis. We have thus determined the additive structure of finite fields. Every such field must have ๐ = ๐๐ elements for some prime power ๐๐ , and then additively ๐ฝ๐ is a vector space of dimension ๐ over ๐ฝ๐ . Picking a basis, we may think of the additive group of ๐ฝ๐ as ๐ฝ๐๐ = {(๐1 , . . . , ๐๐ ) โถ ๐๐ โ ๐ฝ๐ } with the addition law on the ๐-tuples being componentwise addition of the โcoordinatesโ in ๐ฝ๐ . The structure that we have just described is a special case of a general construction known as the direct product. Definition 5.19. Let ๐บ 1 and ๐บ 2 be two groups. The direct product ๐บ 1 ร ๐บ 2 is defined as the set ๐บ 1 ร ๐บ 2 = {(๐1 , ๐2 ) โถ ๐1 โ ๐บ 1 , ๐2 โ ๐บ 2 }, with a group operation given by component-wise multiplication. That is, (๐1 , ๐2 ) ร (โ1 , โ2 ) = (๐1 โ1 , ๐2 โ2 ), where the first coordinates are multiplied using the group law in ๐บ 1 and the second coordinates using the law on ๐บ 2 .
5.4. The multiplicative structure of finite fields
95
Corollary 5.20. Let ๐ฝ๐ be a finite field of size ๐ = ๐๐ . The additive group of ๐ฝ๐ is isomorphic to the direct product ๐ถ๐ ร ๐ถ๐ ร . . . ร ๐ถ๐ of ๐ cyclic groups ๐ถ๐ of size ๐. The additive group of ๐ฝ๐ has one element of order 1 (namely 0), and the remaining ๐ โ 1 elements all have order ๐. We end this section with one last result on the possible sizes of subfields of ๐ฝ๐ . Proposition 5.21. Let ๐ฝ๐ be a field with characteristic ๐, and size ๐ = ๐๐ . If ๐พ is a subfield of ๐ฝ๐ , then ๐พ has ๐๐ elements for some divisor ๐ of ๐. Proof. The point is that ๐ฝ๐ may be thought of as a vector space over ๐พ (exactly as in Theorem 5.17). If ๐ is the dimension of this vector space, then ๐ must be |๐พ|๐ , which forces |๐พ| = ๐๐ with ๐๐ = ๐, so that ๐ is a divisor of ๐. โก Notice that Proposition 5.21 places a stronger constraint on the size of the subfield ๐พ than just requiring that |๐พ| divides ๐ (which is equivalent to ๐ โค ๐, whereas we must in fact have ๐ divides ๐). To illustrate, a field of size 16 = 24 can only have subfields of size 21 = 2, 22 = 4, or 24 , but not one of size 8 = 23 .
5.4. The multiplicative structure of finite fields Let ๐ฝ๐ denote a finite field with ๐ elements. So far, we know that there exist such fields when ๐ = ๐๐ is a prime power, and that there are no other ๐ for which a finite field exists. We have just discussed the structure of the additive group in ๐ฝ๐ , and now we turn to the multiplicative structure of ๐ฝ๐ โnamely, the structure of the group ๐ฝร๐ which has size ๐ โ 1. Theorem 5.22. The multiplicative group ๐ฝร๐ is cyclic. Thus there exists ๐ผ โ ๐ฝร๐ with order ๐ โ 1, and all the elements of ๐ฝร๐ may be written as ๐ผ๐ with 1 โค ๐ โค ๐ โ 1. Now that ๐ฝร๐ is known to be cyclic, you should recall Proposition 5.6 which tells you about the order of all elements of ๐ฝร๐ . In particular, it follows that ๐ฝร๐ has ๐(๐ โ 1) generators. To prepare for the theorem, we need two lemmas, but first one piece of notation. If ๐ is a prime and ๐๐ |๐ but ๐๐+1 does not divide ๐ (so that
96
5. Additive and multiplicative structures
๐๐ is the exact power of ๐ dividing ๐) then we shall write ๐๐ โ๐ (read ๐๐ exactly divides ๐). Lemma 5.23. Let ๐ฝ๐ be a field with ๐ elements, and suppose that โ is a prime with โ๐ โ(๐ โ 1), where ๐ โฅ 1 is a natural number. Then there exists an element ๐ in ๐ฝร๐ with order โ๐ . Proof. Consider the polynomial equation ๐ฅ(๐โ1)/โ โ 1 = 0. This is a polynomial equation in ๐ฝ๐ [๐ฅ], and the polynomial has degree (๐ โ 1)/โ. Therefore there are at most (๐ โ 1)/โ solutions to this congruence (this is the important factor theorem for polynomials, see Lemma 4.3). It follows that there are some elements of ๐ฝร๐ that are not roots of ๐ฅ(๐โ1)/โ โ 1, which means that there must exist some ๐ฝ โ ๐ฝร๐ whose order does not divide (๐ โ 1)/โ. Since the order of ๐ฝ must divide ๐ โ 1 (by Lagrangeโs theorem, see Corollary 5.10), this means that the order of ๐ฝ must be a multiple of โ๐ ; say it is โ๐ ๐. But then the order of ๐ = ๐ฝ ๐ is simply โ๐ , which proves our lemma. โก Lemma 5.24. Suppose that ๐บ is a finite abelian group, and that ๐ โ ๐บ has order ๐ and ๐ โ ๐บ has order โ. If (๐, โ) = 1 then ๐๐ โ ๐บ has order ๐โ. Proof. Since ๐บ is commutative, (๐๐)๐โ = ๐๐โ ๐๐โ = 1. Thus the order of ๐๐ is some factor of ๐โ. Next we show that ๐โ must divide the order of ๐๐, which will complete our proof. Suppose ๐ is the order of ๐๐, so that (๐๐)๐ = ๐๐ ๐๐ = 1. Raising this to the power ๐, we find that (๐๐)๐๐ = ๐๐๐ = 1, so that โ (the order of ๐) must divide ๐๐. Since (โ, ๐) = 1, it follows that โ divides ๐. Similarly, raising to the power โ instead we can see that ๐ divides ๐. Again since (๐, โ) = 1 it follows that ๐โ divides ๐, as we desired. โก ๐
๐
๐
Proof of Theorem 5.22. Suppose ๐ โ 1 = ๐1 1 ๐2 2 โฏ ๐๐ ๐ is the prime factorization of ๐ โ 1, where the ๐ ๐ are distinct primes with ๐๐ โฅ 1. By Lemma 5.23 there exist elements ๐1 , . . ., ๐๐ โ ๐ฝร๐ with ๐๐ having order ๐๐
๐๐ . Applying Lemma 5.24 repeatedly, the product ๐1 โฏ ๐๐ has order ๐ ๐ ๐1 1 โฏ ๐๐ ๐ = ๐ โ 1. In other words, we have produced ๐ผ = ๐1 โฏ ๐๐ โ ๐ฝร๐ with order ๐โ1, and so all the elements of ๐ฝร๐ are simply powers of ๐ผ. โก
5.5. Exercises
97
5.5. Exercises 1. Prove that the notion of isomorphism of groups satisfies the reflexive, symmetry, and transitive properties of an equivalence relation. 2. Let ๐ mod ๐ be a reduced residue class and let its order be ๐. Show that the order of ๐๐ mod ๐ is also ๐, where ๐ is any integer coprime to ๐. 3. Let ๐ be a prime with ๐ โ 2, 5. Prove that the decimal expansion of 1/๐ has exactly ๐ digits that repeat, where ๐ is the order of 10 mod ๐. For example 1/7 = 142857/999999 = 0.142857 has six repeating digits, and the order of 10 mod 7 is also equal to 6. 4. Let ๐ and ๐ be positive integers with ๐ โฅ 2. Show that ๐ โฃ ๐(๐๐ โ 1). (Hint: consider the order of ๐ mod (๐๐ โ 1).) 5. Let ๐ be an odd prime, and let ๐ be coprime to ๐. If ๐ โข 1 mod ๐, prove that ๐ divides 1 + ๐ + ๐2 + . . . + ๐๐โ2 . 6. Let ๐บ be a group, and let ๐ป be a subgroup of ๐บ. Define a relation by saying that ๐1 โผ ๐2 precisely if ๐โ1 1 ๐2 โ ๐ป. Prove that โผ is an equivalence relation. 7. Let ๐บ and ๐ป be two groups. Suppose ๐ โ ๐บ has order ๐, and โ โ ๐ป has order ๐. Show that (๐, โ) โ ๐บ ร ๐ป has order [๐, ๐], where [๐, ๐] denotes the least common multiple (lcm) of ๐ and ๐. 8. Suppose ๐ and ๐ are coprime positive integers. Show that the direct product ๐ถ๐ ร ๐ถ๐ of the cyclic groups of size ๐ and ๐ is isomorphic to the cyclic group ๐ถ๐๐ of size ๐๐. 9. Suppose ๐ and ๐ are two positive integers with (๐, ๐) > 1. Show that ๐ถ๐ ร ๐ถ๐ is not a cyclic group. 10. Suppose ๐ โก 2 mod 3 is prime. Show that the map ๐ โถ ๐ฝ๐ร โ ๐ฝ๐ร defined by ๐(๐) = ๐3 is a bijection. 11. Suppose ๐ โก 1 mod 3 is prime. Show that the map ๐ โถ ๐ฝ๐ร โ ๐ฝ๐ร given by ๐(๐) = ๐3 is not a bijection. Deduce that there is some ๐ โ ๐ฝ๐ร such that ๐ฅ3 โ ๐ is an irreducible polynomial in ๐ฝ๐ [๐ฅ]. 12. Let ๐ be a prime. Show that ๐ฅ๐ โ ๐ฅ and ๐ฅ(๐ฅ โ 1)(๐ฅ โ 2) โฏ (๐ฅ โ (๐ โ 1)) are the same polynomial in ๐ฝ๐ [๐ฅ]. Deduce Wilsonโs theorem.
98
5. Additive and multiplicative structures
13. Let ๐ be a polynomial of degree ๐ in ๐ฝ๐ [๐ฅ]. Show that ๐ has exactly ๐ distinct roots mod ๐ if and only if ๐(๐ฅ) divides ๐ฅ๐ โ ๐ฅ in ๐ฝ๐ [๐ฅ]. (That is, there is a polynomial ๐ โ ๐ฝ๐ [๐ฅ] such that ๐ฅ๐ โ ๐ฅ = ๐๐ in ๐ฝ๐ [๐ฅ].) 14. Let ๐ฝ be a finite field with characteristic ๐. Define a map ๐ โถ ๐ฝ โ ๐ฝ by ๐(๐ผ) = ๐ผ๐ . (i) Show that for any two elements ๐ผ, ๐ฝ in ๐ฝ we have ๐(๐ผ + ๐ฝ) = (๐ผ + ๐ฝ)๐ = ๐ผ๐ + ๐ฝ ๐ = ๐(๐ผ) + ๐(๐ฝ). (ii) Show that ๐ is a bijection. (iii) Show that ๐ โถ ๐ฝ โ ๐ฝ is an isomorphism of fields. (iv) Show that the elements ๐ผ of ๐ฝ satisfying ๐(๐ผ) = ๐ผ form the subfield ๐ฝ๐ contained in ๐ฝ. 15. Let ๐ be a prime with ๐ โก 3 mod 4. Let ๐ฝ denote the field โค[๐]/(๐). Prove that if ๐ + ๐๐ is an element of ๐ฝ, then (๐ + ๐๐)๐ = ๐ โ ๐๐.
Chapter 6
Understanding the structure of โค/๐โค
This chapter takes a little break from developing finite fields, and uses the ideas developed so far to understand the structure of the quotient rings โค/๐โค, which we discussed previously in ยง3.2. Throughout, we have in mind that ๐ โฅ 2 is a positive integer. The additive group in this ring is easy to understand: it is a cyclic group of size ๐. Here we flesh out the structure of the multiplicative group of units (โค/๐โค)ร , which is a group of size ๐(๐). When ๐ is a prime number ๐, we know from our work in ยง5.4 that the multiplicative group (โค/๐โค)ร is cyclic (being the multiplicative group of a field). The main result of this chapter will give a complete description of (โค/๐โค)ร , identifying in particular the values of ๐ for which this group is cyclic.
6.1. The Chinese Remainder Theorem An important step in understanding the structure of the ring โค/๐โค is the Chinese Remainder Theorem. This will allow us to focus on โค/๐๐ โค for prime powers ๐๐ , which will turn out to be a simpler structure to untangle. Proposition 6.1. Let ๐ and ๐ be two coprime natural numbers. Let ๐ mod ๐ and ๐ mod ๐ be two residue classes. Then there is a unique 99
100
6. Understanding the structure of โค/๐โค
residue class ๐ mod ๐๐ such that the set {๐ฅ โ โค โถ ๐ฅ โก ๐ mod ๐, ๐ฅ โก ๐ mod ๐} equals the residue class ๐ mod ๐๐. Proof. First let us show that there exists an integer ๐ with ๐ โก ๐ mod ๐, and with ๐ โก ๐ mod ๐. Since ๐ and ๐ are coprime we may find integers ๐ and โ with ๐๐ + ๐โ = 1. We claim that the integer ๐ = ๐๐๐ + ๐๐โ satisfies the two desired congruences. Indeed, viewed mod ๐ we have ๐ = ๐๐๐ + ๐๐โ โก ๐๐โ โก ๐(1 โ ๐๐) โก ๐ mod ๐, and viewed mod ๐ we have ๐ = ๐๐๐ + ๐๐โ โก ๐๐๐ โก ๐(1 โ ๐โ) โก ๐ mod ๐. Once we have found an integer ๐ satisfying both congruences, it is clear that any integer ๐ + ๐๐๐ will also satisfy both congruences. Thus all elements in the residue class ๐ mod ๐๐ satisfy both congruences. Finally if ๐ฅ is any integer with ๐ฅ โก ๐ mod ๐ and ๐ฅ โก ๐ mod ๐, then we must have ๐ฅ โ ๐ โก 0 mod ๐, and ๐ฅ โ ๐ โก 0 mod ๐. Thus ๐ and ๐ must both divide ๐ฅ โ ๐, and since ๐ and ๐ are coprime, this means ๐๐ divides ๐ฅ โ ๐, or ๐ฅ โก ๐ mod ๐๐. โก In Definition 5.19 we defined the direct product of two groups, and in exactly the same way we may define the direct product of two rings. Definition 6.2. Let ๐
and ๐ be two rings (commutative with identity as always). Then the direct product ๐
ร ๐ is defined as the set ๐
ร ๐ = {(๐, ๐ ) โถ ๐ โ ๐
, ๐ โ ๐} together with ring operations defined by component-wise addition and multiplication. That is (๐1 , ๐ 1 ) + (๐2 , ๐ 2 ) = (๐1 + ๐2 , ๐ 1 + ๐ 2 ), and (๐1 , ๐ 1 ) ร (๐2 , ๐ 2 ) = (๐1 ๐2 , ๐ 1 ๐ 2 ). Example 6.3. Note that the direct product ๐
ร ๐ forms a commutative ring with identity. The additive identity in ๐
ร ๐ is (0, 0) where the 0 in the first coordinate is the additive identity in ๐
, and the 0 in the second coordinate denotes the additive identity in ๐. Similarly, the multiplicative identity in ๐
ร ๐ is (1, 1). You should check that the unit group of
6.1. The Chinese Remainder Theorem
101
๐
ร ๐ is ๐
ร ร ๐ ร , which is the direct product of the unit groups of ๐
and ๐. In Proposition 6.1 we saw that if ๐ and ๐ are coprime, then to any pair of residue classes ๐ mod ๐ and ๐ mod ๐ we may associate a residue class ๐ mod ๐๐. The correspondence given there is a bijection. For example, the residue class ๐ mod ๐๐ will arise from the pair of residue classes ๐ mod ๐ and ๐ mod ๐, so that the correspondence is surjective. Since there are ๐๐ pairs (๐ mod ๐, ๐ mod ๐) and ๐๐ residue classes ๐ mod ๐๐, we see that the correspondence must therefore be a bijection. Naturally there are many possible bijections between two sets of the same cardinality. The bijection of Proposition 6.1 is special in that it gives a ring isomorphism between โค/๐โค ร โค/๐โค and โค/๐๐โค. Theorem 6.4 (The Chinese Remainder Theorem). Let ๐ and ๐ be two coprime natural numbers. Then there is a ring isomorphism ๐ โถ โค/๐โค ร โค/๐โค โ โค/๐๐โค, where the map ๐ is the correspondence given in Proposition 6.1. Proof. To clarify, the map ๐ is given by ๐(๐ mod ๐, ๐ mod ๐) = ๐ mod ๐๐, where ๐ mod ๐๐ = {๐ฅ โ โค โถ ๐ฅ โก ๐ mod ๐, ๐ฅ โก ๐ mod ๐}. We have already discussed why this is a bijection, and what remains is to show that ๐ preserves the ring structure. Suppose that ๐(๐1 mod ๐, ๐1 mod ๐) = ๐ 1 mod ๐๐, and ๐(๐2 mod ๐, ๐2 mod ๐) = ๐ 2 mod ๐๐. What we then want is ๐(๐1 + ๐2 mod ๐, ๐1 + ๐2 mod ๐) = ๐ 1 + ๐ 2 mod ๐๐. This is indeed true because the elements in ๐ 1 + ๐ 2 mod ๐๐ will clearly be โก ๐1 + ๐2 mod ๐, and โก ๐1 + ๐2 mod ๐. Thus, addition of residue classes mod ๐๐ corresponds exactly to component-wise addition in โค/๐โครโค/๐โค. Similar considerations apply to multiplication, and therefore we have a ring isomorphism as claimed. โก
102
6. Understanding the structure of โค/๐โค
Example 6.5. The condition that ๐ and ๐ are coprime is crucial in the Chinese Remainder Theorem. For example, in Proposition 6.1 we started with the important relation ๐๐ + ๐โ = 1, which of course cannot hold if ๐ and ๐ have a common factor. You can also easily see why there cannot be any solution lying in 3 mod 10 and 5 mod 15, for example. See Exercise 1 below for a version when the moduli are not coprime. If ๐1 , ๐2 , . . ., ๐๐ are pairwise coprime (that is, any two are coprime to each other) then you should have little difficulty in extending the Chinese Remainder Theorem to obtain an isomorphism between the rings โค/(๐1 โฏ ๐๐ )โค and โค/๐1 โค ร โฏ ร โค/๐๐ โค. Summarizing our work so far, we record the following corollary. ๐
๐
Corollary 6.6. Write the prime factorization of ๐ as ๐ = ๐11 โฏ ๐๐๐ , where ๐ ๐1 , . . ., ๐ ๐ are distinct primes. Then the ring โค/๐โค is isomorphic to โค/๐11 โคร ๐๐ ร โฏรโค/๐๐ โค. In particular, the multiplicative group (โค/๐โค) is isomorphic ๐ ๐ to (โค/๐11 โค)ร ร โฏ ร (โค/๐๐๐ โค)ร . Example 6.7. We saw earlier in Proposition 4.21 that the Euler ๐-function is multiplicative. The Chinese Remainder Theorem gives us another explanation of this fact: if ๐ and ๐ are coprime then the groups (โค/๐๐โค)ร and (โค/๐โค)ร ร (โค/๐โค)ร are isomorphic, and therefore their sizes ๐(๐๐) and ๐(๐)๐(๐) must be the same. We end this section with a brief discussion of the Chinese Remainder Theorem in a general ring ๐
(commutative with identity as always). Definition 6.8. Let ๐
be a ring, and let ๐ผ and ๐ฝ be two ideals of ๐
. We say that ๐ผ and ๐ฝ are comaximal if there exists ๐ โ ๐ผ and ๐ โ ๐ฝ with ๐ + ๐ = 1. Example 6.9. If ๐
= โค then the ideals (๐) and (๐) are comaximal exactly when ๐ and ๐ are coprime. Suppose ๐ผ and ๐ฝ are comaximal ideals in a ring ๐
. Given a congruence class ๐ mod ๐ผ and a congruence class ๐ mod ๐ฝ, we would like to describe the elements in ๐
that are both โก ๐ mod ๐ผ and โก ๐ mod ๐ฝ. If such an element ๐ โ ๐
exists, then note that any element in ๐ mod ๐ผ โฉ ๐ฝ would also have the same property. (Check or recall from Exercise 9 of Chapter 1 that ๐ผ โฉ ๐ฝ is also an ideal in ๐
.) Further if some other ๐ was also ๐ mod ๐ผ and ๐ mod ๐ฝ then ๐ โ ๐ must be in ๐ผ and in ๐ฝ and so in
6.2. The structure of the multiplicative group (โค/๐โค)ร
103
๐ผ โฉ ๐ฝโin other words, all solutions to the pair of congruences must be in ๐ mod ๐ผ โฉ ๐ฝ. Why does such an ๐ exist? We use the comaximality property of ๐ผ and ๐ฝ: recall ๐ + ๐ = 1 for some ๐ โ ๐ผ and ๐ โ ๐ฝ. Now consider ๐ = ๐๐ + ๐๐. Since ๐๐ โ ๐ผ, ๐ โก ๐๐ mod ๐ผ, and since ๐ = 1 โ ๐ โก 1 mod ๐ผ, we conclude that ๐ โก ๐ mod ๐ผ. Similarly we find ๐ โก ๐ mod ๐ฝ. In other words we have found a correspondence between pairs of residue classes mod ๐ผ and mod ๐ฝ and a residue class mod ๐ผ โฉ ๐ฝ. This generalizes Proposition 6.1 and, indeed, the proofs are entirely similar. Further, exactly as in Theorem 6.4, we have a ring isomorphism between ๐
/๐ผ ร ๐
/๐ฝ and ๐
/(๐ผ โฉ ๐ฝ). One last remark: when ๐ผ and ๐ฝ are comaximal, you should check (this is Exercise 5 below) that ๐ผ โฉ ๐ฝ = ๐ผ๐ฝ, where ๐ผ๐ฝ denotes the product of the two ideals ๐ผ and ๐ฝ (which was defined in Exercise 13 of Chapter 1).
6.2. The structure of the multiplicative group (โค/๐โค)ร Our goal is to understand the structure of the multiplicative group (โค/๐โค)ร , which has size ๐(๐). To give an idea of what it means to understand this group, here are some questions that we might want to answer. For what values of ๐ is this group cyclic? What are the possible orders of elements in (โค/๐โค)ร and how many elements are there of each possible order? ๐
๐
If ๐11 โฏ ๐๐๐ is the prime factorization of ๐, then the Chinese Re๐ mainder Theorem allows us to understand (โค/๐โค)ร as (โค/๐11 โค)ร ร โฏ ร ๐๐ ร (โค/๐๐ โค) . This reduces our problem to understanding the groups (โค/๐๐ โค)ร for prime powers ๐๐ . We already know that the group (โค/๐โค)ร is cyclic, since it forms the multiplicative group of the field ๐ฝ๐ = โค/๐โค. For all odd primes ๐ (that is, for ๐ > 2), it turns out that the groups (โค/๐๐ โค)ร are also cyclic, and the story for powers of 2 is slightly more complicated. Theorem 6.10. If ๐ is an odd prime, then the group (โค/๐๐ โค)ร is cyclic for all ๐ โฅ 1. Thus the group (โค/๐๐ โค)ร is isomorphic to ๐ถ๐(๐๐ ) . Example 6.11. In number theory books, a generator of the group (โค/๐๐ โค)ร is also known as a primitive root mod ๐๐ . Recall Proposition 5.6 which describes the orders of elements of cyclic groups. It follows that there are ๐(๐(๐๐ )) primitive roots mod ๐๐ for odd prime powers ๐๐ .
104
6. Understanding the structure of โค/๐โค
For powers of 2, we have the following supplement to Theorem 6.10, whose proof will be left as an exercise for you (see Exercise 13 below). Theorem 6.12 (Supplement to Theorem 6.10). The groups (โค/2โค)ร and (โค/4โค)ร are cyclic. If ๐ โฅ 3 then the order of 5 mod 2๐ is 2๐โ2 . Moreover every reduced residue class mod 2๐ can be written as ยฑ1 ร 5๐ . Thus, for ๐ โฅ 3, the group (โค/2๐ โค)ร is isomorphic to ๐ถ2 ร ๐ถ2๐โ2 . Combining Theorems 6.10 and 6.12 with the Chinese Remainder Theorem, we can give a description of the group (โค/๐โค)ร . Corollary 6.13. (i) Suppose 8 does not divide ๐, and write the prime fac๐ ๐ torization of ๐ as ๐ = ๐11 โฏ ๐๐๐ . Then (โค/๐โค)ร is isomorphic to the product of cyclic groups ๐ถ๐(๐๐1 ) ร โฏ ร ๐ถ๐(๐๐๐ ) . 1
๐
๐
๐
(ii) Suppose 8|๐, and write ๐ = 2๐ โ
๐22 โฏ ๐๐๐ . Then (โค/๐โค)ร is isomorphic to ๐ถ2 ร ๐ถ2๐โ2 ร ๐ถ๐(๐๐2 ) ร โฏ ร ๐ถ๐(๐๐๐ ) . 2
๐
Thus for all ๐, we have described the group (โค/๐โค)ร as a direct product of cyclic groups. In fact, more generally, every finite abelian group may be decomposed as a product of cyclic groups (and still more generally, every finitely generated abelian group may be decomposed in such a way). This result is known as the fundamental theorem of finitely generated abelian groups, and you would encounter it in a group theory course. We already saw another instance of this theorem: the additive group in a finite field with characteristic ๐ is the product of several copies of the cyclic group of size ๐. Let us now see how this abstract description of the group (โค/๐โค)ร answers the questions posed at the beginning of this section. Let us begin with the second question about the possible orders of elements in (โค/๐โค)ร . Definition 6.14. The Carmichael function ๐ โถ โ โ โ is defined as follows. Set ๐(1) = 1, and, if ๐ is an odd prime, define for prime powers ๐๐ > 1 ๐(๐๐ ) = ๐(๐๐ ) = ๐๐โ1 (๐ โ 1). Put ๐(2) = 1, ๐(4) = 2, and for ๐ โฅ 3 define ๐(2๐ ) = 2๐โ2 .
6.3. Proof of Theorem 6.10 ๐
105
๐
Finally, if ๐ = ๐11 โฏ ๐๐๐ then define ๐
๐
๐(๐) = lcm[๐(๐11 ), โฏ , ๐(๐๐๐ )]. The significance of this definition may be seen from the following refinement of Eulerโs theorem. Theorem 6.15 (Refining Eulerโs theorem). Every reduced residue class ๐ mod ๐ has order dividing ๐(๐). Moreover there exist residue classes ๐ mod ๐ with order exactly equal to ๐(๐). Sketch proof. Exercise 7 of Chapter 5 asked you to show that if ๐บ and ๐ป are any two groups, and ๐ โ ๐บ has order ๐ and โ โ ๐ป has order ๐, then (๐, โ) โ ๐บ ร ๐ป has order [๐, ๐] (the lcm of ๐ and ๐). It follows that ๐ ๐ if ๐ = ๐11 โฏ ๐๐๐ then the reduced ๐ mod ๐ has order equal to the least ๐ common multiple of the order of ๐ mod ๐๐ ๐ for all 1 โค ๐ โค ๐. If ๐ is an odd prime, then ๐(๐๐ ) = ๐(๐๐ ) and Theorem 6.10 showed that the orders of elements in (โค/๐๐ โค)ร divide ๐(๐๐ ), and that there is an element with order ๐(๐๐ ). The same conclusion holds for powers of 2 by Theorem 6.12 and our definition of ๐(2๐ ). This completes our sketch proof, and you should fill in the details. โก The answer to the first question on when the group (โค/๐โค)ร is cyclic is contained in the following result (which you are invited to prove in Exercise 11 below). Theorem 6.16. The group (โค/๐โค)ร is cyclic if and only if (i) ๐ = ๐๐ or ๐ = 2๐๐ for some odd prime ๐; (ii) ๐ = 2 or ๐ = 4.
6.3. Existence of primitive roots mod ๐๐ : Proof of Theorem 6.10 Throughout, let ๐ denote an odd prime. If ๐ = 1 then the congruence classes mod ๐๐ form the field ๐ฝ๐ , and we have already shown in ยง5.4 that the group ๐ฝ๐ร is cyclic. Thus there is a primitive root ๐ mod ๐, and we now want to find primitive roots mod ๐๐ for higher prime powers. Given a residue class ๐ mod ๐, for 0 โค ๐ โค ๐ โ 1 the residue classes ๐ + ๐๐ mod ๐ are all the same, but viewed mod ๐2 the residue classes ๐ + ๐๐ mod ๐2 are all distinct. We say that the residue class ๐ mod ๐
106
6. Understanding the structure of โค/๐โค
โliftsโ to these ๐ residue classes mod ๐2 : namely ๐, ๐ + ๐, ๐ + 2๐, . . . , ๐ + ๐(๐ โ 1) mod ๐2 , or equivalently that the residue classes ๐ + ๐๐ mod ๐2 โlie aboveโ ๐ mod ๐. Similarly, we can think of residue classes ๐ mod ๐๐ lifting to the residue classes ๐ + ๐๐๐ mod ๐๐+1 (for 0 โค ๐ โค ๐ โ 1 say). Proposition 6.17. Let ๐ be an odd prime. (i) For each primitive root ๐ mod ๐ there are exactly ๐ โ 1 residue classes ๐ + ๐๐ mod ๐2 lying above ๐ mod ๐ that are primitive roots mod ๐2 . (ii) If ๐ โฅ 2 then every primitive root ๐ mod ๐๐ lifts to ๐ primitive roots ๐ + ๐๐๐ mod ๐๐+1 ( for 0 โค ๐ โค ๐ โ 1). Example 6.18. There are ๐(๐ โ 1) primitive roots mod ๐, and the first part of Proposition 6.17 tells us that these give rise to (๐ โ 1)๐(๐ โ 1) primitive roots mod ๐2 . Note that if ๐ generates all the reduced residue classes mod ๐2 then it must clearly generate all the reduced residue classes mod ๐, so that these account for all the primitive roots mod ๐2 . This is consistent with our prior knowledge that there must be ๐(๐(๐2 )) generators of the cyclic group ๐ถ๐(๐2 ) : indeed ๐(๐(๐2 )) = ๐(๐(๐ โ 1)) = ๐(๐)๐(๐ โ 1) = (๐ โ 1)๐(๐ โ 1). Similarly, for ๐ โฅ 2 the ๐(๐(๐๐ )) = ๐(๐๐โ1 (๐ โ 1)) = ๐๐โ2 (๐ โ 1)๐(๐ โ 1) primitive roots mod ๐๐ lift to ๐๐(๐(๐๐ )) = ๐๐โ1 (๐ โ 1)๐(๐ โ 1) primitive roots mod ๐๐+1 which is consistent with ๐(๐(๐๐+1 )). A key step in proving Proposition 6.17 is the following simple observation (which holds also for the prime ๐ = 2). Lemma 6.19. Let ๐ be any prime (including 2). Let ๐ โฅ 1 be a natural number and ๐ an integer with (๐, ๐) = 1. Suppose โ is the order of ๐ mod ๐๐ . Then the order of ๐ mod ๐๐+1 is either โ or ๐โ. Proof. Suppose ๐๐ โก 1 mod ๐๐+1 . Then certainly ๐๐ โก 1 mod ๐๐ . Therefore the order of ๐ mod ๐๐ , which is โ, must divide ๐. It follows that โ divides the order of ๐ mod ๐๐+1 . Now write ๐โ = 1 + ๐ ๐๐ for some integer ๐ , and consider ๐โ๐ = (1 + ๐ ๐๐ )๐ . Expand this out using the binomial theorem: ๐ ๐ ๐ (1 + ๐ ๐๐ )๐ = 1 + ( )๐ ๐๐ + ( )(๐ ๐๐ )2 + . . . + ( )(๐ ๐๐ )๐ . 1 2 ๐
6.3. Proof of Theorem 6.10
107
Since (๐ ๐๐ )๐ โก 0 mod ๐๐+1 for all ๐ โฅ 2, and ๐ ( )๐ ๐๐ = ๐ ๐๐+1 โก 0 mod ๐๐+1 , 1 we see that (1 + ๐ ๐๐ )๐ โก 1 mod ๐๐+1 . Thus ๐โ๐ โก 1 mod ๐๐+1 ; or in other words, the order of ๐ mod ๐๐+1 divides โ๐. We have shown that the order of ๐ mod ๐๐+1 is a multiple of โ, and that it divides ๐โ. The only choices are โ and ๐โ. โก Proof of Proposition 6.17 (Part i). Let us start with the first assertion about lifting primitive roots from mod ๐ to mod ๐2 . For each 0 โค ๐ โค ๐ โ 1 note that ๐ + ๐๐ โก ๐ mod ๐ is a primitive root mod ๐. Therefore by Lemma 6.19, ๐ + ๐๐ mod ๐2 has order either (๐ โ 1) or ๐(๐ โ 1). We shall prove that for exactly one value of ๐ the order is ๐โ1, and therefore for the remaining (๐ โ 1) values of ๐ the order equals ๐(๐ โ 1). If (๐ + ๐๐) mod ๐2 has order ๐ โ 1, then (๐ + ๐๐)๐โ1 โก 1 mod ๐2 . Expand using the binomial theorem: (๐ + ๐๐)๐โ1 = ๐๐โ1 + (
๐โ1 ๐โ1 )(๐๐)๐๐โ2 + ( )(๐๐)2 ๐๐โ3 1 2
๐โ1 + ... + ( )(๐๐)๐โ1 . ๐โ1 From the third term onwards we get multiples of ๐2 . So ๐โ1 (๐ + ๐๐)๐โ1 โก ๐๐โ1 + ( )(๐๐)๐๐โ2 โก ๐๐โ1 + (๐ โ 1)๐๐๐๐โ2 1 โก (๐๐โ1 โ ๐๐๐๐โ2 ) mod ๐2 . If we write ๐๐โ1 = 1 + ๐ ๐, then the above is 1 + ๐(๐ โ ๐๐๐โ2 ) mod ๐2 and this is 1 mod ๐2 if and only if ๐ โก ๐๐๐โ2 mod ๐
or equivalently
๐๐ โก ๐๐๐โ1 โก ๐ mod ๐.
Thus there is exactly one possible value of ๐ with 0 โค ๐ โค ๐ โ 1 (namely ๐ โก ๐๐ mod ๐) for which ๐ + ๐๐ mod ๐2 has order (๐ โ 1). This proves what we wanted. โก Proof of Proposition 6.17 (Part ii). Let us see how to lift from a primitive root mod ๐2 to a primitive root mod ๐3 , and generalizing this is straightforward and left to you. Suppose ๐ mod ๐2 is a primitive root.
108
6. Understanding the structure of โค/๐โค
Then we claim that ๐ is automatically a primitive root mod ๐3 . This proves (ii) because ๐ + ๐๐2 โก ๐ mod ๐2 will then be a primitive root mod ๐3 for all ๐. Let us start with ๐ mod ๐. Since ๐ generates all reduced residue classes mod ๐2 , it must generate all reduced residue classes mod ๐, and so is a primitive root. Write ๐๐โ1 = 1 + ๐ ๐, say. Note that ๐ cannot be a multiple of ๐, or else the order of ๐ mod ๐2 would be (๐ โ 1). Now what is ๐๐(๐โ1) ? Expanding out by the binomial theorem, ๐ ๐ (1 + ๐ ๐)๐ = 1 + ๐ ๐2 + ( )(๐ ๐)2 + . . . + ( )(๐ ๐)๐ โก 1 + ๐ ๐2 mod ๐3 , 2 ๐ because (๐ ๐)๐ will be a multiple of ๐3 for ๐ โฅ 3, and for the term (๐2)(๐ ๐)2 the binomial coefficient gives an extra factor of ๐. Since ๐ is not a multiple of ๐, this congruence shows that ๐ mod ๐3 cannot have order ๐(๐ โ 1), and therefore by Lemma 6.19 its order must be ๐2 (๐ โ 1). That is, ๐ is a primitive root mod ๐3 . โก
6.4. Exercises 1. Let ๐ and ๐ be natural numbers and ๐ mod ๐ and ๐ mod ๐ be given residue classes. Show that there is a solution to the congruences ๐ฅ โก ๐ mod ๐ and ๐ฅ โก ๐ mod ๐ if and only if ๐ โก ๐ mod ๐ where ๐ = (๐, ๐). If ๐ โก ๐ mod ๐ show that the solution ๐ฅ is unique mod[๐, ๐]. Here [๐, ๐] denotes the least common multiple of ๐ and ๐. 2. If ๐ is a prime prove that (๐ โ 1)! โก (๐ โ 1) mod (1 + 2 + 3 + . . . + (๐ โ 1)). 3. Let ๐ be a primitive root mod ๐. Show that (๐ โ 1)! โก ๐ โ
๐2 โ
๐3 โฏ โ
๐๐โ1 โก ๐๐(๐โ1)/2 mod ๐, and conclude Wilsonโs theorem. 4. Let ๐ be a natural number, and ๐ be a prime. Show that ๐โ1
โ1 mod ๐ โ ๐๐ โก { 0 mod ๐ ๐=1
if (๐ โ 1) divides ๐ if (๐ โ 1) does not divide ๐.
5. If ๐ผ and ๐ฝ are comaximal ideals in a ring ๐
show that ๐ผ๐ฝ = ๐ผ โฉ ๐ฝ.
6.4. Exercises
109
6. Prove that the sequence ๐๐ is periodic mod ๐, where ๐ is prime. Determine the least period. (That is, find the least number โ such that (๐ + โ)๐+โ โก ๐๐ mod ๐ for all ๐.) 7. Set ๐๐ = 11 + 22 + 33 + . . . + ๐๐ . Prove that this sequence is periodic mod ๐, and determine the least period. 8. A composite number ๐ is called a Carmichael number if ๐๐โ1 โก 1 mod ๐ for all ๐ with (๐, ๐) = 1. Show that 561, 1105, and 1729 are Carmichael numbers. 9. As in Exercise 8, a composite number ๐ is called a Carmichael number if ๐๐โ1 โก 1 mod ๐ for all reduced reside classes ๐ mod ๐. (i) Show that a composite number ๐ is Carmichael if and only if ๐(๐) divides ๐ โ 1. (ii) Show that a Carmichael number ๐ cannot be divisible by the square of any prime. (iii) If ๐ = ๐1 โฏ ๐ ๐ , with ๐ โฅ 2 and ๐1 , . . ., ๐ ๐ being distinct, show that ๐ is Carmichael if and only if ๐๐ โ 1 divides ๐ โ 1 for all ๐. 10. Prove that the Carmichael function ๐(๐) is at most ๐(๐)/2 unless ๐ is of the form ๐๐ or 2๐๐ for an odd prime ๐, or unless ๐ = 2 or ๐ = 4. 11. Prove Theorem 6.16. 12. This problem gives a generalization of the strategy used to lift primitive roots mod ๐ to primitive roots mod ๐2 . Let ๐ be a polynomial of degree ๐ with integer coefficients and leading coefficient 1, and let ๐โฒ denote its derivative. Let ๐ be a solution to ๐(๐ฅ) โก 0 mod ๐. (i) If ๐โฒ (๐) โข 0 mod ๐ then show that the solution ๐ mod ๐ lifts (or gives rise) to a unique solution mod ๐2 . (ii) If ๐โฒ (๐) โก 0 mod ๐, but ๐(๐) โข 0 mod ๐2 then show that ๐ does not lift to a solution mod ๐2 . (iii) If ๐โฒ (๐) โก 0 mod ๐ and ๐(๐) โก 0 mod ๐2 show that ๐ gives rise to ๐ solutions mod ๐2 . (iv) What is the maximum number of solutions that ๐(๐ฅ) โก 0 mod ๐2 can have? ๐
13. Prove, by induction or otherwise, that for every ๐ โฅ 0 that 52 โก 1 mod 2๐+2 but โข 1 mod 2๐+3 . Conclude that the order of 5 mod 2๐ is 2๐โ2 for all ๐ โฅ 2. Prove that every reduced residue class mod 2๐ may be
110
6. Understanding the structure of โค/๐โค
expressed as ยฑ1 times a power of 5, and that โ1 is not a power of 5. In short, prove Theorem 6.12.
Chapter 7
Combinatorial applications of finite fields
In this chapter, we will use our work on finite fields to construct interesting combinatorial objects. In particular, we will discuss constructions of Sidon sets and perfect difference sets, and De Bruijn sequences. Even though these combinatorial objects are defined in settings like the integers, or residue classes mod ๐, we shall see that they are not easy to construct without some (hidden) insight coming from finite fields. And, on the flip side, constructing these combinatorial objects will involve working concretely with finite fields, and thus add to our understanding of these objects. In particular, we have described earlier the structure of the additive and multiplicative groups in a finite field, and we shall now see how these structures interact with each other.
7.1. Sidon sets and perfect difference sets Definition 7.1. A Sidon set is a finite set of integers ๐ = {๐1 , ๐2 , . . . , ๐๐ } such that the sums ๐๐ + ๐๐ with 1 โค ๐ โค ๐ โค ๐ are all distinct. 111
112
7. Combinatorial applications of finite fields
Example 7.2. If ๐ is a Sidon set, then the set ๐ + ๐ obtained by translating all the elements of ๐ด by an integer ๐ is also a Sidon set. Thus we may confine attention to Sidon sets of natural numbers. If we take ๐๐ = 2๐โ1 for 1 โค ๐ โค ๐, then all the pairwise sums are distinct. This gives a Sidon set of ๐ natural numbers in [1, 2๐โ1 ]. This example however produces a very small Sidon set: in [1, ๐] it gives a Sidon set with about log2 ๐ elements. Can one construct larger Sidon sets? Given ๐ what is the maximal size of a Sidon set in [1, ๐]? This problem arose in work of Sidon in the 1930โs concerning Fourier series. One of our goals in this chapter is to construct Sidon sets of size ๐ in [1, ๐2 โ1] for prime powers ๐. There is an extensive literature on this topic, which is still an area of active research, and we refer you to [12, 22] for much further information. Theorem 7.3 (Singer; Bose). Let ๐ be a prime power. There is a Sidon set ๐ of ๐ integers in [1, ๐2 โ 1]. In the other direction, we can also show that a Sidon set in [1, ๐] cannot be too big. Theorem 7.4 (ErdลsโTurรกn). Let ๐ be a Sidon set in [1, ๐]. Then 1
|๐| โค โ๐ + โ2๐ 4 . To construct a large Sidon set in [1, ๐], we can simply pick the largest prime ๐ below โ๐, and use Theorem 7.3 to find a Sidon set in [1, ๐2 โ1]. Since, by Bertrandโs postulate, we can always find a prime ๐ in (โ๐/2, โ๐), we find that for all ๐ there is a Sidon set of size at least โ๐/2, and for some ๐ (e.g., squares of primes) we get nearly โ๐ elements in the Sidon set. Actually, one can considerably improve upon Bertrandโs postulate, and there is always a prime between ๐ฅ and ๐ฅ(1 + ๐) for any ๐ > 0 and ๐ฅ large enough. This follows from the prime number theorem which we briefly mentioned in ยง2.3, and it shows that there are Sidon sets in [1, ๐] with โฅ โ๐(1 โ ๐) elements for all ๐ large enough (given ๐ > 0). In fact a deep theorem states that for large ๐ there is always a prime between two consecutive cubes ๐3 and (๐+1)3 (so that one can find a prime ๐ very close to โ๐), and a famous open problem is to show that there is always a prime between two consecutive squares ๐2 and (๐ + 1)2 .
7.1. Sidon sets and perfect difference sets
113
In other words, the construction of Theorem 7.3 and the bound of Theorem 7.4 are pretty close to each other, and one understands well the size of the largest Sidon set in [1, ๐]. This is a rare situation in extremal combinatorics where we are able to determine asymptotically the true answer. Example 7.5. Let us give a simple preliminary upper bound for the size of a Sidon set in [1, ๐]. If the Sidon set has size ๐, then the number of sums ๐๐ + ๐๐ with 1 โค ๐ โค ๐ โค ๐ is ๐ ๐(๐ + 1) . ( )+๐= 2 2 By definition these sums must all be distinct, and they lie in the interval [2, 2๐] which contains 2๐โ1 integers. It follows that ๐(๐+1)/2 โค 2๐โ1, so that ๐(๐ + 1) โค 4๐ โ 2 which gives ๐ โค 2โ๐. A little trick allows us to do slightly better. If the sums ๐๐ + ๐๐ are all distinct, it must also be the case that the differences ๐๐ โ๐๐ are all distinct for 1 โค ๐ < ๐ โค ๐ (here we omitted ๐ = ๐ which gives the difference 0). There are (๐2) such differences, all lying in the interval [1, ๐ โ 1]. Therefore we must have (๐2) โค ๐ โ 1 from which it follows that 1 1 1 2 (๐ โ ) = ๐(๐ โ 1) + โค 2(๐ โ 1) + < 2๐, 2 4 4 so that (7.1)
1
๐ < โ2๐ + 2 .
Example 7.6. Example 7.5 shows why one cannot have Sidon sets with more than about โ2๐ elements, which will be improved further in Theorem 7.4. Should we be surprised that there exist Sidon sets in [1, ๐] of size about โ๐ as guaranteed by Theorem 7.3? This may seem more of a psychological question than a mathematical one! One way to address it would be to pick a large number like ๐ = 1024, and to search (for example by writing a computer program) for the largest Sidon set that you can find in [1, 1024]. Another idea is to consider a random set โฌ of ๐ elements chosen from [1, ๐] and ask how likely is it that this a Sidon set? Consider ๐+๐โ ๐ โ ๐ with ๐, ๐, ๐, ๐ distinct elements in โฌ. There are (๐4) โ ๐4 /24 such expressions, and they all lie in [โ2๐, 2๐]. If these values were evenly spread out over [โ2๐, 2๐], then we may think of the chance that ๐ + ๐ โ
114
7. Combinatorial applications of finite fields
๐ โ ๐ = 0 is about 1 in 4๐. If ๐4 /24 is large in comparison to 4๐, then it seems very likely that there would be a โcollisionโ ๐ + ๐ โ ๐ โ ๐ = 0 so that the set โฌ would not be a Sidon set. This reasoning suggests that 1 a random set with substantially more than ๐ 4 elements is unlikely to be a Sidon set. So we should be surprised that there exists a Sidon set with as many as โ๐ elements! The reasoning above is closely related to the birthday problem: in a room with 23 people, the probability that two 1 people share the same birthday is about 2 . We observed in Example 7.5 that if the sums ๐๐ + ๐๐ are all distinct (apart from the order ๐๐ + ๐๐ = ๐๐ + ๐๐ ), then the differences ๐๐ โ ๐๐ with ๐ โ ๐ must also all be distinct. This gives a (loose) connection between Sidon sets and our next object of interest: perfect difference sets. Definition 7.7. A set of residues {๐1 , ๐2 , . . . , ๐๐+1 mod ๐} is called a perfect difference set if every non-zero residue class mod ๐ can be expressed as ๐๐ โ๐๐ for some unique choice of ๐ and ๐. Since the number of possible differences among ๐๐ and ๐๐ (with ๐ โ ๐) is ๐(๐ + 1), clearly the modulus ๐ must equal ๐2 + ๐ + 1. Theorem 7.8 (Singer). If ๐ is a prime power, then there is a perfect difference set mod ๐2 + ๐ + 1. Example 7.9. Here are three examples of perfect difference sets: {1, 2 mod 3}, {1, 2, 4 mod 7}, and {1, 2, 5, 7 mod 13}. Take the perfect difference set {1, 2, 4 mod 7} and translate it by residue classes mod 7: thus we get the 7 sets {1, 2, 4 mod 7}, {2, 3, 5 mod 7}, {3, 4, 6 mod 7}, {4, 5, 0 mod 7}, {5, 6, 1 mod 7}, {6, 0, 2 mod 7}, and {0, 1, 3 mod 7}. Note that (i) each set contains exactly three residue classes, (ii) each residue class appears in exactly three sets, (iii) any two sets intersect in a unique residue class, and (iv) any two residue classes lie in a unique set. Do the same with the perfect difference set mod 13. Definition 7.10. A (combinatorial) finite projective plane of order ๐ is a collection of ๐2 + ๐ + 1 โpointsโ and ๐2 + ๐ + 1 โlinesโ (sets of points) such that (i) every line contains ๐ + 1 points, (ii) every point lies on ๐ + 1 lines, (iii) any two distinct lines intersect at exactly one point, and (iv) and two distinct points lie on exactly one line.
7.1. Sidon sets and perfect difference sets
115
1
5
4 7
2
6
3
The figure above depicts a finite projective plane of order 2, known as the Fano plane. It has seven points, numbered above 1 through 7. The seven lines are the sets {1, 2, 4}, {2, 3, 6}, {1, 3, 5}, {1, 6, 7}, {2, 5, 7}, {3, 4, 7}, and {4, 5, 6}. Generalizing Example 7.9, one can start with a perfect difference set and by translating it obtain a finite projective plane. There is also a natural way to construct finite projective planes using finite fields (see Exercise 7), and these are important objects in algebra and geometry. In combinatorics, a longstanding open problem is whether perfect difference sets are only possible when ๐ is either 1 or a prime power. This has been checked for ๐ up to twenty billion [8], but the general problem remains unsolved. Recently, Sarah Peluse [23] established an asymptotic version of this conjecture, showing that the number of ๐ below ๐ฅ for which there exists a perfect difference set mod ๐2 + ๐ + 1 is asymptotically of the same size as the number of prime powers below ๐ฅ. It is also believed that finite projective planes only exist when ๐ is 1, or a prime power. Not much is known about this problemโin the 1980s, combining many ideas with a massive computer search, it was shown that there are no finite projective planes of order 10 (see Lam [16]). It remains an open problem to show that there are no finite projective planes of order 12.
116
7. Combinatorial applications of finite fields
To round out this discussion, let me mention that finite projective planes are a special case of a more general combinatorial object called a design. Given parameters (๐, ๐, ๐, ๐), a design with these parameters means the following: Let ๐ be a set with ๐ elements. A collection of ๐-element subsets of ๐ is called a design, if every ๐-element subset of ๐ is contained in exactly ๐ elements of this collection. The story here is far from being settled, and in 2014, Peter Keevash made important progress in showing the existence of designs for a large class of parameters. See Gowers [9] and Kalai [15] for friendly introductions to the work of Keevash. You may find it easier to grasp the flavor of these combinatorial problems by contemplating the following puzzle by Kirkman, which appeared in 1850 in The Ladyโs and Gentlemanโs DiaryโโFifteen young ladies in a school walk out three abreast for seven days in succession: it is required to arrange them daily so that no two shall walk twice abreast.โ
7.2. Proof of Theorem 7.3 For clarity, we restrict ourselves to ๐ being a prime number, but the same proof works with small changes for ๐ a prime power (Exercise 2). Suppose ๐ = ๐ is a prime number. We work in the field ๐ฝ๐2 with ๐2 elements. We know that the multiplicative group ๐ฝ๐ร2 is cyclic, and so pick a generator ๐ผ for this group. Consider the elements ๐ผ๐ โ ๐ผ as ๐ ranges from 1 to ๐2 โ 1. These are all distinct, and range over all elements of ๐ฝ๐2 with the exception of โ๐ผ (which cannot occur since ๐ผ๐ cannot be 0). In particular, all the ๐ elements in ๐ฝ๐ appear among these values. Take ๐ = {๐ โ [1, ๐2 โ 1] โถ ๐ผ๐ โ ๐ผ โ ๐ฝ๐ }, so that ๐ is a subset of size ๐ in [1, ๐2 โ 1]. We claim that ๐ is a Sidon set. Suppose, to the contrary, that ๐1 + ๐2 = ๐3 + ๐4 for two distinct pairs ๐1 โค ๐2 and ๐3 โค ๐4 . For each ๐ = 1, 2, 3, 4, put ๐ผ๐๐ = ๐ผ + ๐๐ where ๐๐ lies in ๐ฝ๐ by construction. Since ๐1 + ๐2 = ๐3 + ๐4 we have ๐ผ๐1 ๐ผ๐2 = ๐ผ๐3 ๐ผ๐4 , which means that (๐ผ + ๐1 )(๐ผ + ๐2 ) = (๐ผ + ๐3 )(๐ผ + ๐4 ).
7.3. The Erdลs-Turรกn boundโProof of Theorem 7.4
117
Cancelling the ๐ผ2 terms, we find that ๐ผ satisfies a linear relation over ๐ฝ๐ , namely (7.2)
(๐1 + ๐2 )๐ผ + ๐1 ๐2 = (๐3 + ๐4 )๐ผ + ๐3 ๐4 .
Note that ๐ผ โ ๐ฝ๐ ; otherwise the powers of ๐ผ would all be in ๐ฝ๐ contradicting our choice of ๐ผ as a generator of the multiplicative group ๐ฝ๐ร2 . Thus the relation (7.2) must be trivial and ๐1 + ๐2 = ๐3 + ๐4 and ๐1 ๐2 = ๐3 ๐4 . But these last relations imply that in ๐ฝ๐ [๐ฅ], one has (๐ฅ + ๐1 )(๐ฅ + ๐2 ) = (๐ฅ + ๐3 )(๐ฅ + ๐4 ). Unique factorization in ๐ฝ๐ [๐ฅ] now tells us that either ๐ฅ + ๐1 is the same as ๐ฅ + ๐3 (and ๐ฅ + ๐2 then equals ๐ฅ + ๐4 ), or that ๐ฅ + ๐1 equals ๐ฅ + ๐4 (and ๐ฅ + ๐2 equals ๐ฅ + ๐3 ). In other words, one must have ๐1 = ๐3 and ๐2 = ๐4 , or ๐1 = ๐4 and ๐2 = ๐3 . Thus the pairs (๐1 , ๐2 ), and (๐3 , ๐4 ) cannot be different, and ๐ is a Sidon set.
7.3. The Erdลs-Turรกn boundโProof of Theorem 7.4 Let ๐ = {๐1 , . . . , ๐๐ } be a Sidon set in [1, ๐]. We have already seen a 1 preliminary bound ๐ < โ2๐ + 2 in (7.1) and our goal is to improve upon this. Let ๐ฅ be a natural number, to be chosen later. Imagine an interval of length ๐ฅ which we shall slide around and see how many elements of ๐ land inside it. Thus let โ๐ฅ < ๐ โค ๐ โ 1 denote an integer, and for each such integer put ๐(๐) = ๐ โฉ (๐, ๐ + ๐ฅ]. The proof is based on studying the first two moments of the sequence of values |๐(๐)|, namely ๐โ1
โ ๐=โ๐ฅ+1
๐โ1
|๐(๐)|,
and
โ
|๐(๐)|2 .
๐=โ๐ฅ+1
Such moments are often very informativeโthe first moment may be thought of as trying to understand the mean (or average) value of the sequence |๐(๐)|, and the second moment is closely related to the variance of this sequence. In the statistical study of any sequence, the mean and
118
7. Combinatorial applications of finite fields
variance are of fundamental importance, and our proof of the Erdลsโ Turรกn bound is built around understanding these two moments for a careful choice of the parameter ๐ฅ. Let us begin with the first moment, or equivalently with understanding the mean of |๐(๐)|. Note that ๐โ1
๐โ1
โ
โ
|๐(๐)| =
๐=โ๐ฅ+1
#{๐ โถ ๐ โ ๐(๐)}
๐=โ๐ฅ+1
= โ #{๐ โถ ๐ โ ๐(๐)} ๐โ๐
= |๐|๐ฅ, since each ๐ โ ๐ belongs to exactly ๐ฅ sets ๐(๐), namely those ๐ with ๐ โ ๐ฅ โค ๐ < ๐. Therefore ๐โ1
โ
(7.3)
|๐(๐)| = ๐ฅ|๐| = ๐ฅ๐.
๐=โ๐ฅ+1
The mean of |๐(๐)| would simply be this first moment divided by the number of possibilities for ๐, namely ๐ + ๐ฅ โ 1. Now let us turn to the second moment, beginning with a general lower bound for it. This lower bound indeed holds for any sequence of real numbers. Suppose ๐ฆ1 , ๐ฆ2 , . . ., ๐ฆ๐ are any ๐ real numbers, and let ๐ฆ = (๐ฆ1 + . . . + ๐ฆ๐ )/๐ denote their mean. Then their variance is defined by ๐
1 โ (๐ฆ โ ๐ฆ)2 . ๐ ๐=1 ๐ Being a sum of squares, this variance is clearly non-negative. Moreover, expanding out the square we may write it as ๐
๐
๐
2 2 1 1 1 โ (๐ฆ2 โ 2๐ฆ๐ฆ๐ + ๐ฆ ) = โ ๐ฆ๐2 โ 2๐ฆ โ ๐ฆ๐ + ๐ฆ ๐ ๐=1 ๐ ๐ ๐=1 ๐ ๐=1 ๐
=
2 1 โ ๐ฆ2 โ ๐ฆ . ๐ ๐=1 ๐
This relation shows how the second moment of the sequence ๐ฆ๐ is closely related to its variance. Moreover, since the variance is non-negative, we
7.3. The Erdลs-Turรกn boundโProof of Theorem 7.4
119
conclude that ๐
๐
2 1 1 โ ๐ฆ 2 โฅ ( โ ๐ฆ๐ ) , ๐ ๐=1 ๐ ๐ ๐=1
or equivalently that ๐
๐
โ ๐ฆ๐2 โฅ ๐=1
2 1 ( โ ๐ฆ๐ ) . ๐ ๐=1
You could also have recognized this inequality as a consequence of one of the most useful tools from analysisโthe CauchyโSchwarz inequality! Recall that this states (for any real or complex numbers ๐ฅ๐ , ๐ฆ๐ ) ๐
2
๐
๐
๐=1
๐=1
| โ ๐ฅ ๐ฆ | โค ( โ |๐ฅ |2 )( โ |๐ฆ |2 ). ๐ ๐| ๐ ๐ | ๐=1
The inequality for the second moment that we derived above follows upon taking ๐ฅ๐ = 1. Applying the above estimate to the sequence of values |๐(๐)|, we conclude that ๐โ1
๐โ1
โ
|๐(๐)|2 โฅ
๐=โ๐ฅ+1
(7.4)
=
2 1 ( โ |๐(๐)|) ๐ + ๐ฅ โ 1 ๐=โ๐ฅ+1
๐ฅ2 ๐2 , ๐+๐ฅโ1
upon using (7.3). So far we have not used that ๐ is a Sidon set. We now make crucial use of this fact, and obtain an upper bound for the second moment, which we will compare with the lower bound (7.4). Consider ๐โ1
โ ๐=โ๐ฅ+1
๐โ1
(
|๐(๐)| ) = โ #{(๐, ๐) โถ ๐ < ๐, ๐, ๐ โ ๐(๐)} 2 ๐=โ๐ฅ+1 = #{(๐, ๐, ๐) โถ ๐ < ๐, ๐, ๐ โ ๐(๐)}.
If we are given ๐ and ๐ in ๐ with ๐ < ๐, then how many ๐ are there with (๐, ๐, ๐) being a triple counted above? Clearly we must have ๐ โ ๐ โ [1, ๐ฅ โ 1] if both ๐ and ๐ are to be in ๐(๐) for some ๐, and in that case there are exactly ๐ฅ โ (๐ โ ๐) possible values for ๐ (namely those ๐ that
120
7. Combinatorial applications of finite fields
lie in the interval [๐ โ ๐ฅ, ๐ โ 1]). Therefore โ
#{(๐, ๐, ๐) โถ ๐ < ๐, ๐, ๐ โ ๐(๐)} =
(๐ฅ โ ๐).
๐,๐โ๐ ๐=๐โ๐โ[1,๐ฅโ1]
Now note that since ๐ is a Sidon set, if we are given a value ๐ โ [1, ๐ฅ โ1], then it can appear as a difference of two elements ๐ < ๐ โ ๐ in at most one way. Therefore ๐ฅโ1
โ
(๐ฅ โ ๐) โค โ (๐ฅ โ ๐) =
๐,๐โ๐ ๐=๐โ๐โ[1,๐ฅโ1]
๐=1
๐ฅ(๐ฅ โ 1) . 2
In other words, we have established that ๐โ1
(7.5)
๐โ1
|๐(๐)|2 โ |๐(๐)| ๐ฅ(๐ฅ โ 1) |๐(๐)| โค . ( )= โ 2 2 2 ๐=โ๐ฅ+1 ๐=โ๐ฅ+1 โ
Using (7.3), we may rewrite the inequality above as ๐โ1
๐โ1
|๐(๐)|2 โค ๐ฅ(๐ฅ โ 1) +
โ ๐=โ๐ฅ+1
โ
|๐(๐)|
๐=โ๐ฅ+1
(7.6)
= ๐ฅ(๐ฅ + ๐ โ 1).
This is the upper bound that we wanted for the second moment. Let us now compare the lower bound (7.4) with the upper bound (7.6). These give (7.7)
๐ฅ๐2 โค (๐ฅ + ๐ โ 1)(๐ + ๐ฅ โ 1).
Now it is simply a matter of performing some calculus style optimization to get our theoremโthe parameter ๐ฅ is still free for us to choose, and we wish to find a choice for ๐ฅ which could be used in (7.7) to deduce a good upper bound for ๐. But we can make life a little easier by using the upper 1 bound we already know for ๐, namely ๐ โค โ2๐ + 2 , in the right side of (7.7). Using this bound, we find (7.8)
๐2 โค
(๐ฅ + โ2๐) (๐ + ๐ฅ โ 1). ๐ฅ
All that remains is to choose ๐ฅ, and naturally we should choose it in such a way that the right side of the estimate (7.8) above becomes smallest. Once again we can use calculus to choose ๐ฅ carefully, and then
7.4. Perfect difference setsโProof of Theorem 7.8
121
the theorem would followโI strongly urge you to pause and try that, or attempt some rough calculations to get a sense of what the smallest value for the right side is (or, write code to do this for numerical values of ๐). Alternatively, if we imagine that ๐ฅ is large compared with โ๐, but small compared with ๐, then we can see that (๐ฅ + โ2๐)/๐ฅ would be close to 1, while ๐ + ๐ฅ โ 1 would be roughly ๐. Thus for such values of ๐ฅ, the right side of (7.8) is roughly ๐, and we would get the bound of the theorem. Clearly, we should be winning! 3
Motivated by the above heuristic, let us choose ๐ฅ = โ๐ 4 โ which lies 3 3 between ๐ 4 and ๐ 4 + 1. Then the right side of (7.8) is โค (1 +
โ2๐ 3
3
)(๐ + ๐ 4 ) < ๐(1 +
โ2 1
2
) .
๐4
๐4 It follows that ๐ โค โ๐(1 +
โ2 ๐
1 4
1
) = โ๐ + โ2๐ 4 .
This wraps up our proof.
7.4. Perfect difference setsโProof of Theorem 7.8 Our construction of perfect difference sets is a variation of the argument behind Theorem 7.3. Again for clarity, let us restrict to the case when ๐ is prime, and the general prime power case only needs some cosmetic changes (Exercise 5). We now work in a field ๐ฝ๐3 of size ๐3 , which contains the finite field with ๐ elements ๐ฝ๐ . Let ๐ผ be a generator of the multiplicative group ๐ฝ๐ร3 . We begin with a key observation, which we shall set in a more general context in the next section. Lemma 7.11. The element ๐ผ satisfies a cubic relation over ๐ฝ๐ , that is, ๐ผ3 = ๐0 + ๐1 ๐ผ + ๐2 ๐ผ2 for some ๐0 , ๐1 and ๐2 in ๐ฝ๐ . But, ๐ผ cannot satisfy any non-trivial quadratic relation over ๐ฝ๐ . Proof. Since ๐ฝ๐3 is a vector space of dimension 3 over ๐ฝ๐ , there must be a ๐ฝ๐ -linear relation among the four vectors 1, ๐ผ, ๐ผ2 and ๐ผ3 . In other words ๐ผ satisfies a cubic polynomial relation ๐0 + ๐1 ๐ผ + ๐2 ๐ผ2 + ๐3 ๐ผ3 = 0
122
7. Combinatorial applications of finite fields
with ๐0 , ๐1 , ๐2 , ๐3 in ๐ฝ๐ , not all zero. If ๐3 โ 0, then we may divide through by ๐3 , obtaining a cubic relation as claimed in the lemma. It remains to show that ๐3 โ 0, or, in other words, that one cannot have a non-trivial quadratic relation ๐0 + ๐1 ๐ผ + ๐2 ๐ผ2 = 0. If there were such a relation, note that ๐2 must be non-zero (otherwise, we would have a relation ๐0 +๐1 ๐ผ = 0, which is impossible since ๐ผ โ ๐ฝ๐ ). Thus, dividing through by ๐2 , we find that ๐ผ2 lies in the span of 1 and ๐ผ, and we claim that this forces all powers of ๐ผ to be in the span of 1 and ๐ผ. Indeed, if ๐ผ2 = ๐ + ๐๐ผ, then ๐ผ3 = (๐ + ๐๐ผ)๐ผ = ๐๐ผ + ๐๐ผ2 = ๐๐ผ + ๐(๐ + ๐๐ผ), and so on. However the powers of ๐ผ generate ๐ฝ๐ร3 (which has ๐3 โ 1 elements), whereas the span of 1 and ๐ผ contains only ๐2 elements. โก Since ๐ผ generates ๐ฝ๐ร3 , as โ varies over all residue classes mod (๐3 โ 1), the elements ๐ผโ range over all the non-zero elements of ๐ฝ๐ร3 , which we may also think of as the non-zero elements in the span of 1, ๐ผ, ๐ผ2 . For some special exponents โ, it may happen that ๐ผโ lies in the span of 1 and ๐ผ. We will focus on these exponents. Thus define โ = {โ mod (๐3 โ 1) โถ ๐ผโ = ๐ + ๐๐ผ, ๐, ๐ โ ๐ฝ๐ }. Since ๐ผโ cannot be zero, we must omit the possibility ๐ = ๐ = 0 above, and the remaining ๐2 โ 1 elements of the span of 1 and ๐ผ will all occur. Thus โ is a set of ๐2 โ 1 residue classes mod (๐3 โ 1). Lemma 7.12. If ๐ผ generates ๐ฝ๐ร3 , then the elements of ๐ฝ๐ร are 2 +๐+1)๐
๐ผ(๐
,
with 1 โค ๐ โค ๐ โ 1. Proof. The equation ๐ฅ๐โ1 = 1 has exactly ๐โ1 solutions in ๐ฝ๐3 , namely all the elements in ๐ฝ๐ร . Clearly 2 +๐+1)
(๐ผ๐(๐ 2
3 โ1)
)๐โ1 = ๐ผ๐(๐
= 1,
so that ๐ผ๐(๐ +๐+1) is a solution to ๐ฅ๐โ1 = 1. Therefore, the ๐ โ 1 distinct 2 โก values ๐ผ๐(๐ +๐+1) give all the elements of ๐ฝ๐ร as claimed.
7.4. Perfect difference setsโProof of Theorem 7.8
123
Lemma 7.12 tells us that if โ mod (๐3 โ 1) belongs to โ, then so do the residue classes โ + (๐2 + ๐ + 1)๐ mod (๐3 โ 1) 2
for 1 โค ๐ โค (๐ โ 1). Indeed, since ๐ผ(๐ +๐+1)๐ lies in ๐ฝ๐ร by Lemma 7.12, 2 it follows that if ๐ผโ lies in the span of 1 and ๐ผ, then so will ๐ผโ+(๐ +๐+1)๐ . Therefore the set โ, which was initially defined as a set of (๐2 โ1) residue classes mod (๐3 โ 1), may be thought of as (๐ + 1) residue classes mod (๐2 + ๐ + 1), with each residue class mod (๐2 + ๐ + 1) accounting for (๐ โ 1) residue classes mod (๐3 โ 1). Write these ๐ + 1 residue classes mod (๐2 + ๐ + 1) as โ1 , โ2 , . . . , โ๐+1 mod (๐2 + ๐ + 1), and suppose for concreteness that the representatives โ๐ have been chosen to lie in 1 โค โ๐ โค ๐2 + ๐ + 1. We claim that โ1 , . . ., โ๐+1 form a perfect difference set mod (๐2 + ๐ + 1). Thus what we want to show is that if we pick four residue classes โแต , โ๐ฃ , โ๐ค , โ๐ง from the โ๐ , then the congruence โแต โ โ๐ฃ โก โ๐ค โ โ๐ง mod (๐2 + ๐ + 1) can only hold if ๐ข = ๐ฃ and ๐ค = ๐ง, or if ๐ข = ๐ค and ๐ฃ = ๐ง. Then all the non-zero differences would be distinct, and must give all the non-zero residue classes mod (๐2 + ๐ + 1) (since there are ๐2 + ๐ such differences, and an equal number of non-zero residue classes). Why is this true? From the way in which we selected the set โ, we may write ๐ผโ๐ข = ๐แต + ๐แต ๐ผ, ๐ผโ๐ฃ = ๐๐ฃ + ๐๐ฃ ๐ผ, ๐ผโ๐ค = ๐๐ค + ๐๐ค ๐ผ,
๐ผโ๐ง = ๐๐ง + ๐๐ง ๐ผ,
where ๐แต , ๐๐ฃ , ๐๐ค , ๐๐ง , ๐แต , ๐๐ฃ , ๐๐ค , ๐๐ง are all in ๐ฝ๐ . If โแต โ โ๐ฃ โก โ๐ค โ โ๐ง mod ๐2 + ๐ + 1, then โแต + โ๐ง โก โ๐ฃ + โ๐ค mod (๐2 + ๐ + 1), and in view of Lemma 7.12, this means that ๐ผโ๐ข +โ๐ง = ๐๐ผโ๐ฃ +โ๐ค , for some ๐ โ ๐ฝ๐ร . In other words, (๐แต + ๐แต ๐ผ)(๐๐ง + ๐๐ง ๐ผ) = ๐(๐๐ฃ + ๐๐ฃ ๐ผ)(๐๐ค + ๐๐ค ๐ผ). But this gives a quadratic equation (with coefficients in ๐ฝ๐ ) that must be satisfied by ๐ผ, which we know is impossible by Lemma 7.11 unless the
124
7. Combinatorial applications of finite fields
quadratic equation is trivial (all coefficients being zero). Equivalently, we must have as an identity in ๐ฝ๐ [๐ฅ] (๐แต + ๐แต ๐ฅ)(๐๐ง + ๐๐ง ๐ฅ) = ๐(๐๐ฃ + ๐๐ฃ ๐ฅ)(๐๐ค + ๐๐ค ๐ฅ). By unique factorization in ๐ฝ๐ [๐ฅ], we must therefore have that either ๐แต + ๐แต ๐ฅ and ๐๐ฃ + ๐๐ฃ ๐ฅ are ๐ฝ๐ร multiples of each other (and then ๐๐ง + ๐๐ง ๐ฅ and ๐๐ค + ๐๐ค ๐ฅ are similarly associates), or that ๐แต + ๐แต ๐ฅ and ๐๐ค + ๐๐ค ๐ฅ are associates (and ๐๐ง + ๐๐ง ๐ฅ and ๐๐ฃ + ๐๐ฃ ๐ฅ are associates). But again by Lemma 7.12 these force โแต โก โ๐ฃ mod (๐2 + ๐ + 1) (and so โ๐ง โก โ๐ค mod (๐2 + ๐ + 1)) or that โแต โก โ๐ค mod (๐2 + ๐ + 1) (and so โ๐ง โก โ๐ฃ mod (๐2 + ๐ + 1)). This completes our proof.
7.5. A little more on finite fields Let us expand a little more on Lemma 7.11 used in the previous section. This will add to our understanding of finite fields, and will be of use in coming applications. Starting with a finite field ๐ฝ๐ , we showed how to construct bigger fields of size ๐โ by taking a monic irreducible of degree โ in ๐ฝ๐ [๐ฅ] and forming ๐ฝ๐ [๐ฅ]/(๐(๐ฅ)). We now show that all finite fields appear in this way. Later (see Corollary 9.2) we shall show that in addition, all finite fields of a given size have the same structure (that is, all finite fields of a given size are isomorphic). Suppose that ๐พ = ๐ฝ๐โ is a finite field containing the field ๐น = ๐ฝ๐ . We know that the bigger field ๐พ may be viewed as a vector space of dimension โ over ๐น. Take any element ๐ผ โ ๐พ ร , and consider the โ + 1 elements 1, ๐ผ, ๐ผ2 , . . ., ๐ผโ in ๐พ. Since the dimension of ๐พ over ๐น is โ, there must be a linear combination (with coefficients in ๐น, not all zero) among these elements. In other words, there must be a nonzero polynomial of degree at most โ in ๐ฝ๐ [๐ฅ] for which ๐ผ is a root. We can flesh this out a little bit more. Proposition 7.13. Let ๐พ be a field of size ๐โ containing the field ๐น of size ๐. Then every element ๐ผ โ ๐พ ร is the root of some polynomial in ๐น[๐ฅ] of degree at most โ. Further, there is a unique monic polynomial in ๐น[๐ฅ] of smallest degree for which ๐ผ is a root, which is known as the minimal polynomial for ๐ผ over ๐น, and every polynomial having ๐ผ as a root is a multiple of the minimal polynomial. Finally, the minimal polynomial is irreducible.
7.5. A little more on finite fields
125
Proof. Consider the set of all polynomials in ๐น[๐ฅ] = ๐ฝ๐ [๐ฅ] for which ๐ผ is a root. As observed above this set contains some non-zero polynomial of degree at most โ. If ๐ and ๐ are polynomials with ๐ผ as a root, then so is ๐ + ๐. And, if ๐ has ๐ผ as a root, then so does ๐๐ for any polynomial ๐ โ ๐น[๐ฅ]. In other words, this set of polynomials is an ideal. Since ๐น[๐ฅ] is a PID (indeed, a Euclidean domain), this ideal must be (๐) for some polynomial ๐, which we may assume to be monic (since all elements of ๐น ร are units in ๐น[๐ฅ]). The polynomial ๐ is the minimal polynomial described in the proposition. If the minimal polynomial ๐ is reducible and factors as ๐โ, then ๐ผ must be a root of ๐ or โ. But these have smaller degree than ๐, which is a contradiction. Therefore the minimal polynomial is irreducible. โก Let ๐น and ๐พ be as above, and let ๐ผ be an element of ๐พ. From Proposition 7.13 we know that ๐ผ has a minimal polynomial, say ๐(๐ฅ) โ ๐น[๐ฅ], which is monic and irreducible, has ๐ผ for a rootโthat is, ๐(๐ผ) = 0โand is the polynomial of smallest degree in ๐น[๐ฅ] with ๐ผ as a root. Since ๐ is irreducible, we know that ๐น[๐ฅ]/(๐(๐ฅ)) gives rise to a field. Suppose ๐ has degree ๐, and define ๐น[๐ผ] = {๐0 + ๐1 ๐ผ + . . . + ๐๐ ๐ผ๐ โถ ๐๐ โ ๐น, ๐ โ โ}. Although at first ๐น[๐ผ] looks infinite, it is really only a finite set with ๐๐ elements. This is because ๐ผ๐ can be expressed in terms of smaller powers of ๐ผ (using ๐(๐ผ) = 0) and similarly for all higher powers of ๐ผ, and so every element of ๐น[๐ผ] can be rewritten as ๐0 + ๐1 ๐ผ + . . . + ๐๐โ1 ๐ผ๐โ1 with ๐๐ โ ๐น, and all such expressions are distinct (since ๐ผ cannot satisfy any polynomial relation of degree less than ๐). We can be even more precise: given ๐(๐ฅ) โ ๐น[๐ฅ] we can replace ๐ฅ by ๐ผ and arrive at ๐(๐ผ) โ ๐น[๐ผ]. Note that adding and multiplying in ๐น[๐ผ] correspond in this way to adding and multiplying in ๐น[๐ฅ] (and then evaluating at ๐ฅ = ๐ผ). Moreover, if two polynomials ๐(๐ฅ) and ๐(๐ฅ) โ ๐น[๐ฅ] differ by some multiple of ๐(๐ฅ) (that is, are in the same equivalence class in ๐น[๐ฅ]/(๐(๐ฅ))) then they evaluate to the same element ๐(๐ผ) = ๐(๐ผ) โ ๐น[๐ผ]. In other words, we have set up an isomorphism between ๐น[๐ผ] and the field ๐น[๐ฅ]/(๐(๐ฅ)). We have discussed this kind of isomorphism a few times already: For instance, in Example 3.20 we discussed how โ[๐ฅ]/(๐ฅ2 โ ๐ฅ โ 1) may be thought of as the field โ(๐) with ๐ = (1 + โ5)/2 being the golden ratio, and Exercise 1 of Chapter 3
126
7. Combinatorial applications of finite fields
wanted you to see how โ[๐ฅ]/(๐ฅ2 + 1) is similar to โ. To make sure you understand what is going on fully, you should stop and explain why any element ๐0 + ๐1 ๐ผ + . . . + ๐๐โ1 ๐ผ๐โ1 โ ๐น[๐ผ] with not all ๐๐ โs being 0 has a multiplicative inverse. We summarize the above discussion in the following proposition. Proposition 7.14. Let ๐น be a field with ๐ elements, and ๐พ a field with ๐โ elements containing ๐น. Then for every ๐ผ โ ๐พ with minimal polynomial ๐(๐ฅ) โ ๐น[๐ฅ], we have the field generated by ๐ผ: ๐น[๐ผ] = {๐0 + ๐1 ๐ผ + . . . + ๐๐ ๐ผ๐ โถ ๐๐ โ ๐น, ๐ โ โ}. This field contains ๐น and is contained in ๐พ, and if ๐ has degree ๐ then ๐น[๐ผ] has size ๐๐ and is isomorphic to ๐น[๐ฅ]/(๐(๐ฅ)). Finally, the degree ๐ of ๐ must be a divisor of โ. Proof. Only the last assertion was not discussed above. This follows from the argument of Proposition 5.21. Since ๐น[๐ผ] is a subfield of ๐พ, we may view ๐พ as a vector space over ๐น[๐ผ]. If the dimension of this vector space is ๐ then we must have |๐พ| = ๐โ = |๐น[๐ผ]|๐ = ๐๐๐ , so that ๐ must be a divisor of โ. โก Corollary 7.15. If ๐พ and ๐น are as above, then there is an element ๐ฝ โ ๐พ with ๐พ = ๐น[๐ฝ]. In particular, every field of size ๐โ is isomorphic to ๐น[๐ฅ]/(๐(๐ฅ)) for a monic irreducible polynomial ๐(๐ฅ) โ ๐น[๐ฅ] of degree โ. Proof. Take ๐ฝ to be a generator of the multiplicative group ๐พ ร . Then ๐น[๐ฝ] must contain all powers of ๐ฝ, and therefore all of ๐พ ร , so that ๐น[๐ฝ] = ๐พ. โก
7.6. De Bruijn sequences Definition 7.16. Suppose we are given an alphabet with ๐ letters. A De Bruijn sequence of order โ is a cyclic string of ๐โ letters of the alphabet, such that every string of โ letters appears exactly once as a subsequence of this string. Here โcyclicโ means that the string has โwrap-aroundโ, and once we get to the ๐โ th letter we return to the beginning. Example 7.17. The sequence 0, 0, 0, 1, 0, 1, 1, 1
7.6. De Bruijn sequences
127
is a De Bruijn sequence of order 3 on the alphabet {0, 1}. The sequence 0, 0, 1, 2, 2, 0, 2, 1, 1 is a De Bruijn sequence of order 2 on the alphabet {0, 1, 2}. (Where is the subsequence 1, 1, 0?) De Bruijn sequences on ๐ letters and of order โ always exist, and while they are rare compared to all possible strings of length ๐โ , there is still a plentiful supply of De Bruijn sequences. There are many ways to construct them, but a particularly efficient method involves finite fields. For simplicity, we shall restrict ourselves to the case when ๐ = ๐ is a prime power, but from these cases it is not difficult to obtain De Bruijn sequences for all ๐ (see Exercise 8). Theorem 7.18. Let ๐ = ๐ be a prime power, and โ a natural number. Then there exists a De Bruijn sequence of order โ on an alphabet of size ๐. Proof. Consider a finite field ๐ฝ๐ of size ๐, and extend it to a field ๐ฝ๐โ containing ๐ฝ๐ โrecall that this can be done using a monic irreducible over ๐ฝ๐ [๐ฅ] of degree โ. Now pick a generator ๐ผ for the group ๐ฝร๐โ . From our work in ยง7.5, and since ๐ฝ๐ [๐ผ] = ๐ฝ๐โ , we know that ๐ผ has a minimal polynomial of degree โ, which means that there is a relation (7.9)
๐ผโ = ๐0 + ๐1 ๐ผ + . . . + ๐โโ1 ๐ผโโ1 ,
with ๐๐ โ ๐ฝ๐ . Now let ๐ denote any linear map from ๐ฝ๐โ to ๐ฝ๐ . That is, ๐ satisfies ๐(๐ข + ๐ฃ) = ๐(๐ข) + ๐(๐ฃ), for all ๐ข, ๐ฃ โ ๐ฝ๐โ and ๐(๐๐ข) = ๐๐(๐ข), for ๐ โ ๐ฝ๐ , and ๐ข โ ๐ฝ๐โ . We assume that ๐ is non-trivial, meaning that it is not identically zero on all the elements of ๐ฝ๐โ . Recall that ๐ฝ๐โ may be viewed as an โ-dimensional vector space over ๐ฝ๐ , and you may have encountered linear maps in a linear algebra class. Linear maps from a vector space to the field of scalars (like our map ๐) are also called linear functionals. As ๐ goes from 1 to ๐โ โ 1, look at the sequence of elements in ๐ฝ๐ formed by ๐(๐ผ๐ ). We claim that this sequence (considered as a cyclic string) contains every string of โ elements from ๐ฝ๐ as a subsequence exactly once, except for the string of โ zeros which does not appear as a
128
7. Combinatorial applications of finite fields
subsequence. To get a De Bruijn sequence, find a place in our sequence with โ โ 1 zeros, and insert an extra zero there. It remains to prove our claim. We show that no string of length โ can repeat in the ๐โ โ 1 vales ๐(๐ผ๐ ), and that the string of โ zeros cannot appear โ if we can do this, then there would be ๐โ โ 1 possible subsequences, and ๐โ โ 1 possible strings each of which can appear at most once, and so each must appear exactly once. Suppose instead that some string repeats. Thus for two different starting points ๐ and ๐ we have ๐(๐ผ๐+๐ ) = ๐(๐ผ๐+๐ ) for ๐ = 0, 1, . . ., โ โ 1. Since ๐ is linear, this means that ๐(๐ผ๐ (๐ผ๐ โ ๐ผ๐ )) = 0 for all ๐ = 0, . . ., โ โ 1. In other words, the โ vectors ๐ผ๐ (๐ผ๐ โ ๐ผ๐ ) all lie in the null space of ๐. If these vectors were all linearly independent, then the null space of ๐ would be an โ dimensional vector space over ๐ฝ๐ and would thus be all of ๐ฝ๐โ . However, we assumed that ๐ is non-trivial, and so this cannot be, and there must be some linear relation among ๐ผ๐ (๐ผ๐ โ ๐ผ๐ ) (for ๐ = 0, 1, . . ., โ โ 1). That is, for some ๐๐ โ ๐ฝ๐ not all zero, โโ1
( โ ๐๐ ๐ผ๐ )(๐ผ๐ โ ๐ผ๐ ) = 0. ๐=0
The minimal polynomial for ๐ผ has degree โ, and so the first factor cannot be zero. Further, ๐ผ has order ๐โ โ 1 in ๐ฝร๐โ , and so ๐ผ๐ โ ๐ผ๐ = 0 implies ๐ โก ๐ mod ๐โ โ 1. But this means (taking into account โwrap-aroundโ) that the two starting points were the same after all. So no string can appear more than once. Similarly, the string of โ zeros cannot appear, because then we would have ๐(๐ผ๐+๐ ) = 0 for ๐ = 0, 1, . . ., โ โ 1. Then these elements ๐ผ๐+๐ are all in the null space of ๐, and since ๐ is non-trivial, they cannot all be linearly independent. Therefore we must have a non-trivial relation โโ1 โ๐=0 ๐๐ ๐ผ๐ = 0, but this is impossible since the minimal polynomial for ๐ผ has degree โ. This completes our proof. โก Example 7.19. Let us consider De Bruijn sequences of order 2 with the alphabet ๐ฝ3 . The polynomial ๐(๐ฅ) = ๐ฅ2 โ ๐ฅ โ 1 โ ๐ฝ3 [๐ฅ] is irreducible, and so ๐ฝ3 [๐ฅ]/(๐(๐ฅ)) is a finite field with 9 elements. The additive group is a vector space of dimension 2 with 1, ๐ฅ as one possible basis. The element ๐ฅ generates the non-zero elements of this field:
7.7. A magic trick
129
๐ฅ1 = ๐ฅ, ๐ฅ2 = ๐ฅ + 1, ๐ฅ3 = ๐ฅ(๐ฅ + 1) = 2๐ฅ + 1, ๐ฅ4 = 2๐ฅ2 + ๐ฅ = 2 = โ1, ๐ฅ5 = โ๐ฅ, ๐ฅ6 = โ๐ฅ โ 1, ๐ฅ7 = ๐ฅ โ 1, ๐ฅ8 = 1. For the linear functional ๐, write any element ๐ฃ as ๐+๐๐ฅ, and take ๐(๐ฃ) = ๐โthis is one possible example, you could also have taken ๐(๐ฃ) = ๐, or ๐ + ๐ etc. Thus ๐(๐ฅ) = 0, ๐(๐ฅ2 ) = 1, ๐(๐ฅ3 ) = 1, ๐(๐ฅ4 ) = 2, ๐(๐ฅ5 ) = 0, ๐(๐ฅ6 ) = 2, ๐(๐ฅ7 ) = 2, ๐(๐ฅ8 ) = 1. Adding a zero at the beginning, gives the De Bruijn sequence 0, 0, 1, 1, 2, 0, 2, 2, 1.
7.7. A magic trick A magician (say, Persi Diaconis) throws a deck of cards to the audience, and invites them to cut the deck and place the top portion of the cut below the bottom. This can be done a few times. Then an audience member is invited to take the top card and pass the deck to another person who takes the next top card, and so on until five audience members each have one card. The magician concentrates and feels that the aura of the red cards is stronger. He invites those with red cards to raise a hand. Then he tells each audience member what card they have! How does the trick work? The deck thatโs thrown out has really only 31 cards. The information of which of the five cards are red and which are black โ five bits of information, which means 32 possibilities โ is enough to work out the cards of each audience member. An elegant way to do this (and not requiring a prodigious memory) is to use our proof of Theorem 7.18, working in the finite field with 32 elements. Let us pick a monic irreducible polynomial of degree 5 in ๐ฝ2 [๐ฅ]โ for convenience, take ๐(๐ฅ) = ๐ฅ5 + ๐ฅ2 + 1. Let us work over the field ๐ฝ2 [๐ฅ]/(๐(๐ฅ)) and note that ๐ฅ generates the multiplicative group (since the size of the group is 31, which is prime, and ๐ฅ is clearly not the identity element 1 mod ๐). We may write the powers of ๐ฅ as a linear combination of 1, ๐ฅ, ๐ฅ2 , ๐ฅ3 , and ๐ฅ4 , and for the linear functional ๐ let us take the constant term in such an expression. This generates a sequence of length 31, with the string of 5 zeros omitted from all the possible strings of length 5.
130
7. Combinatorial applications of finite fields
Arrange a deck of 31 cards using the following code: for, say, the seventh card, use the terms 7 through 11 of our sequence. Use the first bit to indicate black (0) or red (1) suit; the second bit to specify major (spade and hearts, use 1) or minor (clubs and diamonds, use 0) suit; and the remaining 3 bits specify 8 numbers, and use them for ๐ด, 2, 3, 4, 5, 6, 7, 8 (binary expansion plus 1). Performing cuts to the deck does not change meaningfully this cyclic order. The configuration of the audience members with red cards tells you five bits of our De Bruijn sequence, and using the code one can easily figure out the first card. For example, if the second and fourth audience members had red cardsโso we have 0, 1, 0, 1, 0โthen the first person has the 3 of spades. How do we figure out the rest of the cards? Suppose the bits we have now came from ๐(๐ผ๐ ), ๐(๐ผ๐+1 ), . . ., ๐(๐ผ๐+4 ). Then the next bit would be ๐(๐ผ๐+5 ) = ๐(๐ผ๐ (๐ผ2 + 1)) = ๐(๐ผ๐ ) + ๐(๐ผ๐+2 ), which in our case is 0. So the second card corresponds to 1, 0, 1, 0, 0 and must be the five of diamonds. And so on. This trick illustrates a key feature of our construction of the De Bruijn sequence of order โ. Starting with any โ initial letters (apart from all zeros), one can run a simple recurrence (depending on the equation (7.9) satisfied by ๐ผ) and continue the sequence forwardโonly a small memory is needed, and the calculation is rapid. This construction is an example of what is known as a linear feedback shift register, and our theorem describes how to find one with maximal period. I learned of this magic trick from my colleague Persi Diaconis, whose book with Ron Graham [5] gives a wonderful account of several other magic tricks exploiting De Bruijn sequences and other mathematical ideas.
7.8. Exercises 1. Think through the proof of Theorem 7.3 to extract the following proposition: There is a set ๐ of ๐ residue classes mod (๐2 โ 1) such that every residue class ๐ mod (๐2 โ 1) with ๐ not a multiple of ๐ + 1 can be expressed uniquely as a difference of two elements of ๐. 2. Adapt the argument of Theorem 7.3 for a general prime power ๐.
7.8. Exercises
131
3. This exercise gives a variant of Theorem 7.3 (due to Ruzsa): There is a Sidon set of size ๐โ1 in [1, ๐2 โ๐]. Let ๐ denote a primitive root mod ๐. For each 1 โค ๐ก โค ๐ โ 1 let ๐(๐ก) denote the residue class mod (๐2 โ ๐) given by ๐(๐ก) โก ๐ก mod (๐ โ 1) and ๐(๐ก) โก ๐๐ก mod ๐. Choose a representative for ๐(๐ก) mod (๐2 โ ๐) in the interval [1, ๐2 โ ๐]. Show that the set of such representatives is a Sidon set. 4. Think through the proof of Theorem 7.4, and, either by performing 1 calculus starting from (7.7) or otherwise, show that |๐| โค โ๐ + ๐ 4 + ๐ถ for some constant ๐ถ. (You should be able to take ๐ถ = 10 without too much fuss.) For a long time, apart from the value of ๐ถ, this was the best bound known in Theorem 7.4. However, recently in [3] the bound has 1 been improved slightly to โค โ๐ + 0.998๐ 4 for large ๐. 5. Adapt the argument of Theorem 7.8 for a general prime power ๐. 6. Let ๐ be a perfect difference set mod ๐2 + ๐ + 1. For each ๐ mod ๐2 + ๐ + 1 define the set ๐๐ = {๐ + ๐ mod ๐2 + ๐ + 1 โถ ๐ โ ๐}. Thinking of the residue classes mod ๐2 + ๐ + 1 as points, and the sets ๐๐ as lines, show that we obtain in this way a finite projective plane of order ๐. 7. This exercise constructs the projective plane ๐2 (๐ฝ๐ ). Let ๐ฝ๐ denote a field with ๐ elements. Let ๐ denote the set of size ๐3 โ 1, given by ๐ = {(๐, ๐, ๐) โถ ๐, ๐, ๐ โ ๐ฝ๐ , not all of ๐, ๐, ๐ are zero}. Points. Say that (๐1 , ๐1 , ๐ 1 ) and (๐2 , ๐2 , ๐ 2 ) in ๐ are equivalent if there exists ๐ โ ๐ฝร๐ with ๐2 = ๐1 ๐, ๐2 = ๐1 ๐ and ๐ 2 = ๐ 1 ๐. Show that this defines an equivalence relation, and splits ๐ into ๐2 + ๐ + 1 equivalence classes. We call these equivalence classes โpointsโ. Lines. Given two distinct (that is, not equivalent to each other) points (๐1 , ๐1 , ๐ 1 ) and (๐2 , ๐2 , ๐ 2 ) as above, define the โlineโ joining them to be the points of the form (๐๐1 + ๐๐2 , ๐๐1 + ๐๐2 , ๐๐ 1 + ๐๐ 2 ) where ๐, ๐ are elements of ๐ฝ๐ , not both of them being zero. With these definitions, prove that one obtains a finite projective plane of order ๐. That is, each line has ๐ + 1 points, each point lies on
132
7. Combinatorial applications of finite fields
๐+1 lines, any two distinct lines intersect at a unique point, and any two distinct points lie on a unique line. 8. Let ๐ and ๐ be two coprime integers and let ๐ด and ๐ต be two alphabets with ๐ and ๐ letters respectively. Starting with a De Bruijn sequence of order โ on each of the alphabets ๐ด and ๐ต, construct a De Bruijn sequence of order โ on an alphabet ๐ถ with ๐๐ letters. 9. Show that there is a set ๐ of ๐ elements in [1, ๐3 โ 1] such that all possible sums of three elements of ๐ are distinct (apart from rearranging the summands): that is, ๐1 + ๐2 + ๐3 = ๐1 + ๐2 + ๐3 with ๐1 , ๐2 , ๐3 , ๐1 , ๐2 , ๐3 all in ๐ only holds if the ๐1 , ๐2 , ๐3 are a permutation of ๐1 , ๐2 , ๐3 . 10. Generalize Exercise 9 to produce ๐ elements in [1, ๐๐ โ 1] with all possible ๐-fold sums being distinct. 11. Suppose ๐ is a set of ๐ elements in [1, ๐] such that all possible sums of three elements of ๐ are distinct (apart from rearranging the summands, as in Exercise 9). Show that 1
๐ โค (18๐) 3 + 2. 1
12. Improve the upper bound in Exercise 11 to obtain ๐ โค (6๐) 3 + 2. You donโt have to work as hard as in the Erdลs-Turรกn theorem, just a little trick is needed. 13. Define the greedy Sidon sequence as follows: Start with ๐1 = 1 and for ๐ > 1 take ๐๐ to be the smallest natural number such that the pairwise sums ๐๐ + ๐๐ for ๐ โค ๐ โค ๐ are all distinct. Thus ๐1 = 1, ๐2 = 2, ๐3 = 4, ๐4 = 8, ๐5 = 13, and so on. Show that ๐๐ โค (๐ โ 1)3 + 1. 14. Let ๐ be a set of integers with ๐ elements. Let ๐ + ๐ denote the set of integers ๐ that can be written as ๐ + ๐ with ๐, ๐ โ ๐. Let ๐(๐) denote the number of ways of writing ๐ as ๐ + ๐ with ๐ and ๐ being elements of ๐ (note that if ๐ = ๐ + ๐ with ๐ โ ๐ then ๐ + ๐ and ๐ + ๐ will be count as two different way of writing ๐), so that ๐(๐) = 0 unless ๐ โ ๐ + ๐. What is โ๐โ๐+๐ ๐(๐)? Prove that |๐ + ๐| โค ๐(๐ + 1)/2, and that โ ๐(๐)2 โฅ 2๐2 โ 2๐. ๐โ๐+๐
7.8. Exercises
133
15. Keep the notation of Exercise 14. Suppose ๐ is a Sidon set. What is โ๐ ๐(๐)2 in this case? 16. Let ๐ = ๐2 and let ๐ผ be a generator of the multiplicative group ๐ฝร๐ . What are the exponents ๐ for which ๐ผ๐ is an element of ๐ฝ๐ร ? Explain.
Chapter 8
The AKS Primality Test
First, a word from Gauss! The problem of distinguishing prime numbers from composite numbers and of resolving the latter into their prime factors is known to be one of the most important and useful in arithmetic. It has engaged the industry and wisdom of ancient and modern geometers to such an extent that it would be superfluous to discuss the problem at length. . . . Further, the dignity of the science itself seems to require that every possible means be explored for the solution of a problem so elegant and so celebrated. (Disquisitiones Arithmeticae, Article 329) In this chapter, we describe a remarkable result of Agrawal, Kayal and Saxena (abbreviated AKS) which gives a rapid algorithm to determine whether a given number is prime, thus providing finally an answer to Gaussโs problem of distinguishing prime numbers from composite numbers. Pleasingly, the ideas behind this algorithm synthesize many of the topics that we have developed so far.
8.1. What is a rapid algorithm? Let us first give a definition of what is meant by a rapid algorithm. Definition 8.1. By a rapid algorithm (or a polynomial time algorithm) we mean an algorithm that executes in time (that is, number of bit operations that are needed) that may be bounded by a polynomial in the size of the input. By size of the input we mean the number of bits that 135
136
8. The AKS Primality Test
are needed to specify the input. By a bit operation we mean an output resulting from two input bits. Note that we are concerned here only with the complexity of an algorithm with respect to time; another important consideration could be the memory needed for an algorithm. Also, the definition above is of theoretical interest and gives a good intuitive sense of what a rapid algorithm means. In practice, one would also like that the degree of the polynomial should not be large, and that the coefficients involved are small. Example 8.2. The input size of a natural number ๐ is โlog2 ๐โ+1, which is the number of bits used in the binary representation of ๐. Since we are ignoring constants in our understanding of the complexity of algorithms, we will think of the input size of ๐ as being log ๐ (while it really is about (log ๐)/ log 2 โ 1.4 log ๐). Thus an algorithm taking a natural number ๐ as an input is rapid if it executes in time that is bounded by a polynomial in log ๐. Example 8.3. The basic operations of arithmetic may be performed in polynomial time. For example, consider adding ๐ and ๐, and suppose that ๐ โค ๐. Then the inputs ๐ and ๐ require about log ๐ bits. To find the sum ๐ and ๐, we must add corresponding bits in the binary representations of ๐ and ๐, and keep track of carries (if needed). This gives a rapid algorithm, taking a constant times log ๐ operations. Here it is convenient to introduce the ๐ (โbig Oโ) notation, and write this complexity as ๐(log ๐) to indicate that it is bounded by some unspecified constant times log ๐. Similarly, one can subtract ๐ from ๐ in time ๐(log ๐). The usual grade school algorithm for multiplying two natural numbers ๐ and ๐ executes in time ๐(log ๐ log ๐); if ๐ โค ๐ then we may bound this by ๐((log ๐)2 ). But here one can be more clever, and come up with a faster algorithm. The simplest version of such an algorithm is due to Karatsuba, but the key idea may even be traced back to Gauss. Consider multiplying two linear polynomials ๐๐ฅ + ๐ and ๐๐ฅ + ๐ with say ๐, ๐, ๐, ๐ in โค. One might think that it is necessary to compute four products ๐๐, ๐๐, ๐๐, ๐๐ to determine the answer, but in fact it is enough to consider three products! Indeed (๐๐ฅ + ๐)(๐๐ฅ + ๐) = ๐๐๐ฅ2 + (๐๐ + ๐๐)๐ฅ + ๐๐, and we compute ๐๐, ๐๐, and (๐ + ๐)(๐ + ๐); these allow us to determine the coefficient of ๐ฅ since ๐๐ + ๐๐ = (๐ + ๐)(๐ + ๐) โ ๐๐ โ ๐๐. To see how this gives a faster way to multiply, suppose we are given
8.2. Primality and factoring
137
two 2๐ bit numbers which we write as 2๐ ๐ + ๐ and 2๐ ๐ + ๐ so that ๐, ๐, ๐ and ๐ are ๐-bit numbers. The usual algorithm for multiplication would use four products involving the ๐-bit numbers ๐, ๐, ๐, ๐, but we have just seen that this may be achieved using three such multiplications (and a few more subtractions). This represents an improvement, and iterating this scheme gives an algorithm for multiplying two integers ๐ and ๐ (with ๐ โค ๐) that executes in time ๐((log ๐)๐
) with ๐
= log2 3 = 1.58 . . .. Still further advances have been made, and a recent algorithm of Harvey and van der Hoeven [14] allows one to multiply ๐ and ๐ in time ๐(log ๐(log log ๐)), so that multiplication is nearly as rapid as addition. We do not need these intricate algorithms, however, and we simply wanted to illustrate that multiplication may be performed rapidly. Similarly, the usual algorithm for division allows one to divide ๐ by ๐ (say ๐ โฅ ๐) and extract a quotient and remainder in time ๐((log ๐)(log ๐)). Example 8.4. Check that the Euclidean algorithm gives a rapid way to compute the gcd of two natural numbers ๐ and ๐ (Exercise 1 below).
8.2. Primality and factoring Given a large integer ๐, the two main questions of interest for us are (i) to determine whether ๐ is prime or composite, and (ii) to factor ๐ into primes. Naturally the second problem of factoring ๐ will also solve the problem of determining whether ๐ is prime or composite. However it turns out that there is a rapid algorithm to resolve the question of primality (this is the AKS algorithm, which is the focus of this chapter), while there is no known polynomial time algorithm for factoring. Example 8.5. A simple way to factor ๐ is trial division. Consider integers ๐ with 2 โค ๐ โค โ๐, and check whether ๐ divides ๐. If so, then we have factored ๐ as ๐ ร (๐/๐) and we can repeat the procedure with the smaller factors ๐ and ๐/๐. If no such factor ๐ below โ๐ is found, then ๐ must be prime. The problem with this algorithm is that it could take ๐(โ๐(log ๐)2 ) operations to runโeach trial division takes about (log ๐)2 steps, and there are โ๐ such divisions to be checked. We could restrict attention to just prime values of ๐, but then we would also have to check that ๐ is prime, and it is not clear if this would be faster. Note that a run time of ๐(โ๐(log ๐)2 ) is not polynomial time in the input size, which is
138
8. The AKS Primality Test 1
log ๐. Indeed โ๐ = exp( 2 log ๐), so this algorithm is exponential in the size of the input. There are more ingenious ways of trying to factor integers, including algorithms that are expected to run in time 1
2
๐(exp(๐ถ(log ๐) 3 (log log ๐) 3 )) for a suitable constant ๐ถ (see [24] for a beautiful acount). This running time is much faster than the exponential trial division method, but still not as fast as polynomial time. So far as we know, factoring remains a difficult problem computationally. The (presumed) difficulty of factoring has been turned to good use in cryptography, where one exploits the idea that there are certain operations that may be performed quickly, but reversing the operations may be difficult computationally. Thus it is very easy to take say two large primes ๐ and ๐ and multiply them together to form ๐ = ๐๐, but at present we do not have equally rapid algorithms for taking the large number ๐ and determining the prime factors ๐ and ๐. The RSA public key cryptosystem (RSA stands for Rivest, Shamir and Adelman) exploits the difficulty of factoring to give a way of encoding secret messages where everyone knows how to encode (public key), but which is nevertheless still difficult to decode for anyone but the intended recipient (who can decode using a private key). This is of practical importance since, for example, an internet store may want anyone to be able to send them a coded credit card number, but one would hope that no eavesdropper would be able to decode the credit card information. Here is how RSA works. The store picks two large primes ๐ and ๐ and multiplies them together to form ๐ = ๐๐. The store can also readily compute ๐(๐) = (๐ โ 1)(๐ โ 1). Next they choose a large random number ๐ (for coding) coprime to ๐(๐), and compute ๐ (for decoding) with ๐๐ โก 1 mod ๐(๐) (this can be computed rapidly by the Euclidean algorithm). Now the store tells everyone what ๐ and ๐ are, and keep secret the factorization ๐ = ๐๐, ๐(๐) and ๐. Suppose you want to send the store the secret number ๐ in the range [1, ๐]. We assume that ๐ is coprime to ๐, which is very likely to be the case (why?). You compute ๐๐ mod ๐ (which we shall see in Example 8.6 below can be done rapidly) and send this to the store. To decode ๐ rapidly, the store, which knows ๐, simply computes (๐๐ )๐ mod ๐ which
8.2. Primality and factoring
139
is ๐๐๐ โก ๐1+โ๐(๐) โก ๐ mod ๐, upon recalling that ๐๐ = 1 + โ๐(๐) for some integer โ, and using Eulerโs theorem. Any eavesdropper will only see ๐๐ mod ๐, and not the secret word ๐; we do not know a rapid way to compute ๐ given ๐๐ and ๐. However, if the eavesdropper could factor ๐ into the primes ๐ and ๐, then they could compute ๐(๐) and ๐ and recover the message ๐ as the store did. Thus the security of the RSA cryptosystem depends on the eavesdropper not knowing a rapid algorithm for factoring. Example 8.6. Given a large natural number ๐, and natural numbers ๐ and ๐ below ๐ with (๐, ๐) = 1, can we compute ๐๐ mod ๐ rapidly? We needed this in our discussion of RSA above, when we wanted to compute ๐๐ mod ๐ and (๐๐ )๐ mod ๐. There is a clever, rapid way to compute ๐๐ mod ๐, known as repeated squaring. Starting with ๐ mod ๐, we square to get ๐2 mod ๐, and square that to get ๐4 mod ๐, and so on, until ๐ ๐2 mod ๐ where 2๐ โค ๐ < 2๐+1 . There are about log ๐ such squarings to perform, and each squaring takes ๐((log ๐)2 ) stepsโwe must square a number below ๐ and reduce the answer mod ๐. Thus it takes ๐ ๐((log ๐)3 ) steps to generate ๐2 mod ๐ for all 0 โค ๐ โค ๐. Finally, express ๐ ๐ in binary as ๐ = โ๐=0 ๐๐ 2๐ , with each ๐๐ = 0 or 1, and multiply together ๐
the values of ๐2 mod ๐ with ๐๐ = 1. This involves ๐(log ๐) multiplications of numbers below ๐ (reducing mod ๐ after each multiplication) and takes again ๐((log ๐)3 ) steps. Thus ๐๐ mod ๐ may be computed in time ๐((log ๐)3 ), which is rapid. Another example of a problem that is computationally difficult (again, as far as we know) is the discrete logarithm problem. We have already seen that the group (โค/๐โค)ร is cyclic, and there are primitive roots ๐ mod ๐. Given such a primitive root ๐, repeated squaring (as in Example 8.6) gives a rapid algorithm to compute ๐๐ฅ mod ๐ for any number ๐ฅ with 1 โค ๐ฅ โค (๐ โ 1). The discrete logarithm problem asks to reverse this: given ๐ and ๐๐ฅ mod ๐ can you find in polynomial time what ๐ฅ (which looks like a logarithm) is? Just as the difficulty of factoring allowed for the interesting RSA cryptosystem, the difficulty of the discrete logarithm problem can be exploited in an interesting way. It forms the basis for the DiffieโHellman
140
8. The AKS Primality Test
key exchange protocol, which permits two people to share a common secret word while only exchanging messages that everyone can see. How can this be done? Suppose ๐ is a large prime and ๐ is a primitive root mod ๐, and ๐ and ๐ are known to everyone. Akhnaten chooses a secret word ๐ and sends Nefertiti ๐๐ mod ๐. Nefertiti chooses a secret word ๐ and sends Akhnaten ๐๐ mod ๐. Akhnaten can now compute (๐๐ )๐ = ๐๐๐ mod ๐, and Nefertiti can compute (๐๐ )๐ = ๐๐๐ mod ๐. Thus they can share the secret ๐๐๐ mod ๐. Eavesdroppers can only see ๐, ๐๐ , and ๐๐ mod ๐, but from this information there is no known way to compute ๐๐๐ โsince no one knows how to find the discrete logs ๐ and ๐ quickly. The shared message ๐๐๐ can then be used by Akhnaten and Nefertiti as a basis for other coding procedures. For both the factoring problem and the discrete logarithm problem there is a polynomial time algorithm (due to Peter Shor [25]) based on quantum computers, but no one has yet built a practical quantum computer. Yet another interesting problem is to find large primes quicklyโfor example, in RSA we needed two large primes ๐ and ๐. At the moment there is no known rapid algorithm that is guaranteed to work quickly and that will find a prime larger than a given bound ๐. However, even though we canโt prove that it works, we can simply run over integers larger than ๐, checking each one for primality and stop when we find the first prime. This does in fact work well practically, but raises the question of how to check quickly whether a number ๐ is prime? This brings us to the central problem of the chapter: rapid algorithms for primality testing. How is it possible to have an algorithm to check whether ๐ is prime without trying to factor ๐? Fermatโs theorem gives a clue. If ๐ is prime, then we know that ๐๐โ1 โก 1 mod ๐ for all (๐, ๐) = 1. Suppose we can find a reduced residue class ๐ mod ๐ such that ๐๐โ1 โข 1 mod ๐ (note that by Example 8.6 we can check this criterion rapidly). This would then prove that ๐ is not prime, without finding a factor for ๐. If somehow ๐๐โ1 does turn out to be 1 mod ๐, then ๐ is called a pseudoprime to the base ๐. In this case, ๐ could be prime or composite, and we cannot come to any definite conclusion. But we may simply pick a different value of ๐ and try again. If this pseudoprime test works for many values of ๐ we may be reasonably confident that ๐ is prime.
8.3. The basic idea behind AKS
141
Unfortunately the test given above does not always work. There are composite numbers ๐, known as Carmichael numbers, such that ๐๐โ1 โก 1 mod ๐ for all reduced residues ๐ mod ๐. You have already seen from Exercise 8 of Chapter 6 that 561, 1105, and 1729 are Carmichael numbers โ in fact these are the first three Carmichael numbers. Moreover, Alford, Granville and Pomerance [2] established in the 1990s that there are infinitely many such Carmichael numbers. However, there is a modified pseudoprime test which is guaranteed to work rapidly, at least if the Generalized Riemann Hypothesis (an important, but wide open, conjecture) is true! This is known as the strong pseudoprime test, and is described in Exercise 7 below; this test still forms the basis for primality testing in many computer packages. Finally in 2002, Agrawal, Kayal and Saxena [1] created a sensation by coming up with a rapid polynomial time primality test, which is an ingenious modification of these pseudoprime tests. The test is deterministic, and can be shown to work in polynomial time without relying on any unproved hypothesis. Notably, Kayal and Saxena were undergraduates when they did this work! Our goal in the rest of this chapter will be to understand the AKS algorithm, as it has come to be known. We will see that the argument involves working with finite fields, and a lot of cleverness. We follow largely the original treatment in [1]; the exposition in [10] gives many further references and later refinements.
8.3. The basic idea behind AKS In the previous section, we observed that one can try to use a โconverse to Fermatโs little theoremโ as a primality test, but unfortunately this doesnโt always work. The key idea behind the AKS test is to use a variant of the pseudoprime test, but extended to polynomials. Lemma 8.7. Suppose ๐ is a natural number, and ๐ an integer coprime to ๐. The number ๐ is prime if and only if the relation (๐ฅ + ๐)๐ โก ๐ฅ๐ + ๐ mod ๐ holds. The congruence above means that the polynomials (๐ฅ+๐)๐ and ๐ฅ๐ + ๐ in โค[๐ฅ] differ by an element in the ideal (๐) = ๐โค[๐ฅ]. Another way to say this is to reduce the coefficients of polynomials in โค[๐ฅ] modulo ๐, so
142
8. The AKS Primality Test
that we are working in the polynomial ring (โค/๐โค)[๐ฅ], where we want the relation (๐ฅ + ๐)๐ = ๐ฅ๐ + ๐. Proof. Suppose first that ๐ = ๐ is a prime. Observe that ๐! ๐ ( )= ๐ ๐! (๐ โ ๐)! is a multiple of ๐ for all 1 โค ๐ โค ๐ โ 1. Therefore, using the binomial theorem, we have ๐โ1
๐ (๐ฅ + ๐)๐ = ๐ฅ๐ + โ ( )๐ฅ๐โ๐ ๐๐ + ๐๐ โก ๐ฅ๐ + ๐๐ mod ๐ ๐ ๐=1 โก ๐ฅ๐ + ๐ mod ๐, where the last relation holds because ๐๐ โก ๐ mod ๐ for all ๐ โ โค by Fermat. This proves one direction of the lemma. Conversely, if ๐ is not prime, then by Exercise 2 below there is some 1 โค ๐ โค ๐ โ 1 with (๐๐) not being a multiple of ๐. Therefore in this case the binomial theorem shows that the coefficients of ๐ฅ๐โ๐ (or ๐ฅ๐ ) on both sides of the identity of the lemma do not match mod ๐. โก So we can use Lemma 8.7 as a test to check whether ๐ is prime. But, as it stands, this is not a very useful test because in order to check whether (๐ฅ + ๐)๐ โก ๐ฅ๐ + ๐ mod ๐ we must compare ๐ coefficients, and this will take at least ๐ operations to do. The key idea behind the AKS test is instead to check whether (8.1)
(๐ฅ + ๐)๐ โก ๐ฅ๐ + ๐
mod ๐ผ,
where ๐ผ is the ideal in โค[๐ฅ] given by ๐ผ = (๐, ๐ฅ๐ โ 1) = {๐๐(๐ฅ) + (๐ฅ๐ โ 1)๐(๐ฅ) โถ ๐, ๐ โ โค[๐ฅ]}, for a suitable value of ๐ and some (not too many) values of ๐. Why is it faster to check congruences mod ๐ผ rather than mod ๐? In reducing mod ๐ผ, we can reduce mod ๐ the coefficients of any polynomial. Further we can replace ๐ฅ๐๐ by 1, since ๐ฅ๐๐ โ 1 is a multiple of (๐ฅ๐ โ 1), and thus it is enough to consider terms ๐ฅ๐ with 0 โค ๐ < ๐. In other words, working mod ๐ผ, we may restrict attention to polynomi๐โ1 als โ๐=0 ๐๐ ๐ฅ๐ , with the coefficients ๐๐ taken mod ๐, so that ๐๐ may be thought of as integers below ๐. Thus, for example, we could compute (๐ฅ + ๐)๐ mod ๐ผ by repeated squaring, keeping in mind that we only have
8.4. The algorithm
143
to multiply polynomials of degree at most ๐ and coefficients at most ๐. If ๐ is small (like a power of log ๐), then this could be done rapidly. In the next section, we describe the AKS algorithm precisely. Then in ยง8.5 we analyze its running time. Finally we explain the proof of why the algorithm works.
8.4. The algorithm If ๐ < 106 is a small number, then a quick trial division will settle the issue. Thus in what follows, we shall assume that ๐ โฅ 106 is a reasonably large number. Step 1. First we check that ๐ is not a perfect power. One can rapidly do this, because if ๐ = ๐๐ for some ๐ โฅ 2, then we must have ๐ โค log2 ๐. So there are not many choices for ๐, and for each choice ๐, we can compute quickly whether ๐ is a ๐th power or not (we will go over this in more detail in the next section). If ๐ is a ๐th power for some ๐ โฅ 2, we stop and output that ๐ is composite. Step 2. Second, let us check that ๐ has no prime factor smaller than 100(log ๐)5 . Since there are only 100(log ๐)5 divisions to check, this too is rapid. If we do find a small prime factor, of course we can stop and declare ๐ to be composite. Step 3. Find the smallest integer ๐ such that the order of ๐ mod ๐ is โฅ 9(log ๐)2 . It is crucial that there is a small value of ๐ with this property, and this is guaranteed by the following lemma (proved in Section 8.6). Lemma 8.8. Assume that ๐ โฅ 106 is such that ๐ is not divisible by any prime number below 100(log ๐)5 . There exists ๐ โค 100(log ๐)5 such that the order of ๐ mod ๐ is at least 9(log ๐)2 . Step 4. This involves checking the following key identity: (8.2)
(๐ฅ + ๐)๐ โก ๐ฅ๐ + ๐
mod (๐, ๐ฅ๐ โ 1),
for various values of ๐ โ โค. To clarify, the identity means that (๐ฅ + ๐)๐ (which is in โค[๐ฅ]) differs from ๐ฅ๐ +๐ by an element in the ideal (๐, ๐ฅ๐ โ1) of โค[๐ฅ] โ or in other words, the difference (๐ฅ + ๐)๐ โ ๐ฅ๐ โ ๐ can be expressed as ๐๐(๐ฅ) + (๐ฅ๐ โ 1)๐(๐ฅ) where ๐ and ๐ are in โค[๐ฅ]. We are now at the most important point of the AKS algorithm: Theorem 8.9 (Agrawal, Kayal, and Saxena (2002)). Let ๐ โฅ 106 be given, with ๐ not a perfect power. Let ๐ be natural number such that all prime
144
8. The AKS Primality Test
factors of ๐ are larger than ๐, and such that the order of ๐ mod ๐ is at least 9(log ๐)2 . Then the key identity (8.2) holds for all 1 โค ๐ โค ๐ if and only if ๐ is a prime number. Thus, in Step 4, it is enough to check (8.2) for all 1 โค ๐ โค ๐ โค 100(log ๐)5 and if ๐ satisfies all these identities we can declare it to be prime. Note that one half of Theorem 8.9 is easy: if ๐ is prime then (๐ฅ + ๐)๐ โก ๐ฅ๐ + ๐ mod ๐ for all natural numbers ๐ by Lemma 8.7, so that (8.2) holds for all ๐ and all ๐ in this case. The interesting bit is the converse, that if the key identity holds for sufficiently many cases, then ๐ must be prime.
8.5. Running time analysis Let us now analyze how long the AKS algorithm takes. Our goal is just to show that it is a polynomial time algorithm, and we donโt make an effort to optimize every detail. We shall show that the algorithm runs in ๐((log ๐)18 ) steps. Step 1. Given ๐ โฅ 2 and ๐, how long does it take to check if ๐ is a ๐th power? To check if ๐ is a ๐th power, the idea is just to start working out the binary expansion of ๐1/๐ . The ๐th root will have about (log2 ๐)/๐ bits, and to figure out each bit we will have to take the ๐th power of some number and check if it is larger than ๐ or not. To compute the ๐th power of a number with โ bits takes ๐(โโ
โ+โโ
2โ+. . .+โโ
๐โ) = ๐(โ2 ๐2 ) stepsโ this is just multiplying a number to itself many times, without even using repeated squaring. Thus to determine a bit of ๐1/๐ takes ๐((log ๐)2 ) steps, and determining the full ๐((log ๐)/๐) bits takes ๐((log ๐)3 /๐) steps. In other words, to check if ๐ is a ๐th power takes ๐((log ๐)3 ) steps, and doing this for each 2 โค ๐ โค log2 ๐ we can check if ๐ is a perfect power in ๐((log ๐)4 ) steps. Step 2. Here we need to divide ๐ by numbers up to about 100(log ๐)5 . Each division takes ๐((log ๐)(log log ๐)) stepsโthe log log ๐ comes from the number of bits in a number of size 100(log ๐)5 . So, in total, this step takes ๐((log ๐)6 log log ๐) operations, which may be bounded by ๐((log ๐)7 ) for simplicity. Step 3. For each ๐ with 2 โค ๐ โค 100(log ๐)5 we must compute the order of ๐ mod ๐, which we want to be large. Once again, we are content to argue very crudely: given ๐ we simply compute ๐1 , ๐2 , . . ., ๐๐พ , all mod ๐,
8.6. Proof of Lemma 8.8
145
with ๐พ = โ9(log ๐)2 โ, and check whether any of these is 1 mod ๐. We begin by reducing ๐ mod ๐, which takes about ๐((log ๐)(log ๐)) operations. Every subsequent computation of ๐๐ mod ๐ (for 2 โค ๐ โค ๐พ) involves multiplying two numbers below ๐ and reducing mod ๐, which takes ๐((log ๐)2 ) steps. Thus for a given ๐, we may check whether the order of ๐ mod ๐ exceeds ๐พ in ๐((log ๐)(log ๐) + ๐พ(log ๐)2 ) = ๐((log ๐)2 (log ๐)2 ) steps. Let us bound this more simply by ๐((log ๐)3 ). Performing this for each ๐ in our range, we can complete Step 3 and find a suitable ๐ in ๐((log ๐)8 ) operations. Step 4. Here we must verify the key identity (8.2) for ๐ values of ๐. For each ๐, by repeated squaring we must perform on the order of log ๐ multiplications of polynomials mod(๐, ๐ฅ๐ โ 1). Each such multiplication involves computing ๐ coefficients, and each coefficient involves about ๐ multiplications of numbers of size at most ๐โtherefore each polynomial multiplication takes about ๐(๐2 (log ๐)2 ) steps. So for each ๐ our identity may be checked in about ๐(๐2 (log ๐)3 ) steps. And finally ranging over all ๐ โค ๐, we can complete Step 4 in ๐(๐3 (log ๐)3 ) which is ๐((log ๐)18 ). This is the bottleneck stepโwe have been wasteful in some parts of our analysis above, but at any rate it should be clear that we have a polynomial time algorithm!
8.6. Proof of Lemma 8.8 We now prove Lemma 8.8, which asserts that if ๐ is not divisible by any prime below 100(log ๐)5 , then there exists an integer ๐ โค 100(log ๐)5 with the order of ๐ mod ๐ being at least 9(log ๐)2 . Suppose instead that all ๐ โค ๐
= 2โ50(log ๐)5 โ are such that the order of ๐ mod ๐ is at most ๐พ = โ9(log ๐)2 โ. This means that each ๐ โค ๐
divides some ๐๐ โ 1 with ๐ โค ๐พ. Therefore, ๐พ
(8.3)
(lcm of all 1 โค ๐ โค ๐
) divides โ(๐๐ โ 1). ๐=1
We shall obtain a contradiction by establishing an upper bound for the right side of (8.3), and a lower bound for the left sideโthe goal will be to have the lower bound larger than the upper bound, which would be impossible as a larger number cannot divide a smaller one. Clearly
146
8. The AKS Primality Test
the right side of (8.3) is ๐พ
โค โ ๐๐ = exp ( ๐=1
๐พ(๐พ + 1) log ๐) โค exp(45(log ๐)5 ). 2
Recall from Chapter 2, Proposition 2.4 (parts (i, ii)) that (
๐
) divides โ ๐โlog ๐
/ log ๐โ = lcm of 1 โค ๐ โค ๐
. ๐
/2 ๐โค๐
Thus the left side of (8.3) is at least (
2๐
๐
, )โฅ ๐
๐
/2
๐
upon using Proposition 2.5 to bound (๐
/2 ). The assumption that ๐ is divisible by no prime below ๐
clearly implies that ๐
โค ๐, and by definition ๐
= 2โ50(log ๐)5 โ โฅ 99(log ๐)5 . We conclude that the left side of (8.3) is 5
โฅ
299(log ๐) 5 โฅ 298(log ๐) โฅ exp(49(log ๐)5 ), ๐
since 22 = 4 > ๐. Clearly this lower bound is in conflict with our upper bound, and thus we obtain a contradiction to our assumption that for all ๐ โค ๐
the order of ๐ mod ๐ is at most โ9(log ๐)2 โ. This completes our proof of Lemma 8.8.
8.7. Generating new relations from old The key to proving Theorem 8.9 is that (8.2) for different values of ๐ can be used to generate many other similar relations. If there is a composite ๐ satisfying (8.2) for many values of ๐, then eventually we will obtain so many relations that in a suitable field we will be able to cook up a polynomial with more roots than its degree, thus getting a contradiction. Lemma 8.10. Suppose ๐, ๐ and ๐ are such that (๐ฅ + ๐)๐ โก ๐ฅ๐ + ๐
mod (๐, ๐ฅ๐ โ 1).
Let ๐ be a prime factor of ๐. Then the relation (8.4)
(๐ฅ + ๐)๐ โก ๐ฅ๐ + ๐
mod (๐, ๐ฅ๐ โ 1)
holds for all ๐ of the form ๐๐ ๐๐ with ๐ and ๐ being non-negative integers.
8.8. Proof of Theorem 8.9
147
Proof. By assumption the relation (8.4) holds for ๐ = ๐. By the binomial theorem, as in Lemma 8.7, the relation (8.4) also holds for ๐ = ๐โ indeed (๐ฅ + ๐)๐ โก ๐ฅ๐ + ๐๐ โก ๐ฅ๐ + ๐ mod ๐. To prove our lemma, we establish that if (8.4) holds for ๐ = ๐ and ๐ = โ then it also holds for ๐ = ๐โ. Indeed โ
(๐ฅ + ๐)๐โ = ((๐ฅ + ๐)๐ ) โก (๐ฅ๐ + ๐)โ
mod (๐, ๐ฅ๐ โ 1),
upon using (8.4) for ๐ = ๐. Now (8.4) with ๐ = โ (and replacing ๐ฅ by ๐ฆ) gives (๐ฆ + ๐)โ โก ๐ฆโ + ๐ mod (๐, ๐ฆ๐ โ 1), and if we take ๐ฆ = ๐ฅ๐ it follows that (๐ฅ๐ + ๐)โ โก ๐ฅ๐โ + ๐ mod (๐, ๐ฅ๐๐ โ 1). Since ๐ฅ๐ โ 1 divides ๐ฅ๐๐ โ 1, we conclude that (๐ฅ๐ + ๐)โ โก ๐ฅ๐โ + ๐ mod (๐, ๐ฅ๐ โ 1), which completes our proof.
โก
8.8. Proof of Theorem 8.9 Suppose ๐ โฅ 106 is not a perfect power. Suppose that ๐ is not divisible by any prime at most ๐, and that the order of ๐ mod ๐ is โฅ 9(log ๐)2 . Suppose that (8.2) holds for all 1 โค ๐ โค ๐. We must now show that ๐ is a prime. Suppose it is not, and let ๐ be a prime factor of ๐. Observe that we need this prime ๐ only in the proof that the AKS algorithm works, and it plays no role in the algorithm itself. Define a set of positive integers by โณ = {๐๐ ๐๐ โถ ๐ โฅ 0, ๐ โฅ 0}. From Lemma 8.10 we know that for all 1 โค ๐ โค ๐ and all ๐ โ โณ (๐ฅ + ๐)๐ โก ๐ฅ๐ + ๐ mod (๐, ๐ฅ๐ โ 1). This is a congruence in the ring โค[๐ฅ], and means that (8.5)
(๐ฅ + ๐)๐ = ๐ฅ๐ + ๐ + ๐๐(๐ฅ) + (๐ฅ๐ โ 1)๐(๐ฅ),
for suitable polynomials ๐ and ๐ in โค[๐ฅ].
148
8. The AKS Primality Test
Instead of working with such relations in โค[๐ฅ], we will find it more convenient to work with relations in an appropriate finite field. Let us now define this field over which we shall work. Suppose ๐ mod ๐ has order ๐โthus ๐|(๐๐ โ1), and ๐ does not divide (๐๐ โ1) for any ๐ < ๐. It is conceivable that ๐ could be 1, which would happen in case ๐ โก 1 mod ๐. We will work in a finite field ๐ฝ๐ with ๐ = ๐๐ elements. ๐
Let ๐ฝ be a generator of ๐ฝร๐ , and take ๐ผ = ๐ฝ (๐ โ1)/๐ . Thus ๐ผ is an element of ๐ฝร๐ whose order is exactly ๐, and in particular ๐ผ๐ = 1. Consider now the relation (8.5). Plug in ๐ฅ = ๐ผ in this relation, to obtain an identity in the field ๐ฝ๐ : (๐ผ + ๐)๐ = ๐ผ๐ + ๐ + ๐๐(๐ผ) + (๐ผ๐ โ 1)๐(๐ผ). Since ๐ฝ๐ has characteristic ๐, clearly ๐๐(๐ผ) = 0. Further, since ๐ผ๐ = 1, we have (๐ผ๐ โ 1)๐(๐ผ) = 0. In other words, the relations (8.5) become in ๐ฝ๐ the relations (8.6)
(๐ผ + ๐)๐ = ๐ผ๐ + ๐,
holding for all 1 โค ๐ โค ๐, and all ๐ โ โณ. Our goal is to show that all these relations in ๐ฝ๐ will force a contradiction to our assumption that ๐ is composite. Why should we be suspicious of the relations in (8.6)? Suppose we find two different integers ๐1 and ๐2 โ โณ with ๐1 โก ๐2 mod ๐. Since ๐ผ has order ๐, we must have ๐ผ๐1 โก ๐ผ๐2 so that the right hand sides of (8.6) would be identical for ๐ = ๐1 and ๐ = ๐2 . However it is not at all clear why one must have (๐ผ + ๐)๐1 = (๐ผ + ๐)๐2 . The proof below exploits this difference in the structure of the right and left sides of (8.6) by producing small values of ๐1 , ๐2 โ โณ with ๐1 โ ๐2 but ๐1 โก ๐2 mod ๐. Lemma 8.11. Let โ denote the subgroup of (โค/๐โค)ร generated by ๐ and ๐, and let โ denote the size of โ. Then โ โฅ 9(log ๐)2 , and there exist two distinct elements ๐1 , ๐2 โ โณ with ๐1 , ๐2 โค ๐2โโ , and ๐1 โก ๐1 mod ๐.
8.8. Proof of Theorem 8.9
149
Proof. The elements of โ are simply the elements of โณ reduced mod ๐. Note that inverses are automatically included among the elements ๐๐ ๐๐ with ๐ โฅ 0, and ๐ โฅ 0, because (for example) ๐โ1 mod ๐ may be expressed as ๐๐(๐)โ1 mod ๐. The group โ contains all the powers of ๐, and since the order of ๐ mod ๐ is โฅ 9(log ๐)2 by construction, we see that โ โฅ 9(log ๐)2 . It remains now to show that there are two distinct elements ๐1 , ๐2 โ โณ with ๐1 , ๐2 โค ๐2โโ and ๐1 โก ๐2 mod ๐. To see this, consider the elements ๐๐ ๐๐ โ โณ with 0 โค ๐ โค โโโโ and 0 โค ๐ โค โโโโ. There are (1 + โโโโ)2 > โ such integers, and they are all distinct since ๐ is not a perfect power, and so in particular ๐ is not a power of ๐. If these integers are reduced mod ๐ then they must lie in the group โ which has size โ. By the pigeonhole principle, it follows that there are two such distinct numbers ๐1 and ๐2 with ๐1 โก ๐2 mod ๐; moreover both ๐1 and ๐2 are below ๐โโ ๐โโ < ๐2โโ . โก To make use of this, we will next define a subgroup ๐ข of ๐ฝร๐ motivated by the relations (8.6). We will use Lemma 8.11 to obtain an upper bound on the size of this group (see Lemma 8.12 below). Then in Lemma 8.13 we shall obtain a lower bound for the size of ๐ข. Both bounds will rely crucially on the relations (8.6) together with the fact that a polynomial of degree ๐ over ๐ฝ๐ cannot have more than ๐ roots. The upper and lower bounds will then be shown to contradict each other, completing our proof. Lemma 8.12. The elements ๐ผ + ๐ with 1 โค ๐ โค ๐ all lie in ๐ฝร๐ . Let ๐ข denote the subgroup of ๐ฝร๐ generated by the elements ๐ผ + ๐ with 1 โค ๐ โค ๐. The size of the group ๐ข is |๐ข| โค ๐2โโ . Proof. Let us first show that all the elements ๐ผ + ๐ with 1 โค ๐ โค ๐ are in ๐ฝร๐ . If not, then ๐ผ + ๐ = 0 for some 1 โค ๐ โค ๐, and then (8.6) applied to ๐ = ๐ gives 0 = (๐ผ + ๐)๐ = ๐ผ๐ + ๐, so that one must have ๐ผ๐ = โ๐ = ๐ผ. Since ๐ผ has order ๐, this means that ๐ โก 1 mod ๐, which contradicts our assumption that the order of ๐ mod ๐ is at least 9(log ๐)2 . We remark that this possibility that ๐ผ + ๐ equals 0 only arises if ๐ = ๐ (so that ๐ โก 1 mod ๐), which was allowed in
150
8. The AKS Primality Test
our definition of the field ๐ฝ๐ . We could also have avoided this possibility by selecting a prime ๐ dividing ๐ with ๐ โข 1 mod ๐; such a prime must exist since ๐ โข 1 mod ๐. Having established that ๐ผ + ๐ belongs to ๐ฝร๐ for all 1 โค ๐ โค ๐, we can now proceed to the subgroup ๐ข of ๐ฝร๐ generated by these elements. Concretely, the group ๐ข consists of all elements of the form ๐
โ(๐ผ + ๐)๐๐ , ๐=1
where the exponents ๐ ๐ are non-negative integers. Note that this does form a groupโinverses are included, because all elements have finite order, and so for example (๐ผ + ๐)โ1 = (๐ผ + ๐)(๐โ1)โ1 . It remains now to establish the upper bound on the size of ๐ข. Let ๐1 and ๐2 be the elements of โณ produced by Lemma 8.11. Thus ๐1 and ๐2 are unequal, both lying below ๐2โโ , and with ๐1 โก ๐2 mod ๐. Consider the equation ๐ฅ๐1 = ๐ฅ๐2 . Being a polynomial equation of degree at most ๐2โโ , clearly this equation can have at most ๐2โโ roots in ๐ฝ๐ . We claim that all the elements of ๐ข are solutions to this equation, and then the lemma would follow. ๐
To prove our claim, suppose ๐ = โ๐=1 (๐ผ + ๐)๐๐ is an element of ๐ข. Then, using (8.6), we see that ๐
๐๐
๐๐1 = โ ((๐ผ + ๐)๐1 )
๐
= โ(๐ผ๐1 + ๐)๐๐ ,
๐=1
๐=1
and similarly ๐
๐๐2 = โ(๐ผ๐2 + ๐)๐๐ . ๐=1
But now ๐1 โก ๐2 mod ๐, and ๐ผ๐ = 1, so that ๐ผ๐1 = ๐ผ๐2 . Therefore our expressions for ๐๐1 and ๐๐2 are identical, and ๐ is a solution to the โก equation ๐ฅ๐1 = ๐ฅ๐2 , as claimed. Lemma 8.13. The elements ๐
๐
โ(๐ผ + ๐)๐๐ with โ ๐ ๐ โค โ โ 1 ๐=1
๐=1
are all distinct. Therefore ๐ข has size |๐ข| โฅ 2โ .
8.8. Proof of Theorem 8.9
151
Proof. Suppose instead that there are two such products ๐
๐
โ(๐ผ + ๐)๐๐
โ(๐ผ + ๐)๐๐
and
๐=1
๐=1 ๐
๐
with ๐ ๐ , ๐๐ โฅ 0 and โ๐=1 ๐ ๐ , โ๐=1 ๐๐ both less than โ, that happen to be the same element in ๐ฝ๐ . Naturally, we assume that the exponents ๐ ๐ are not all equal to the exponents ๐๐ . Consider the two polynomials in ๐ฝ๐ [๐ฅ] given by ๐
๐
๐ธ(๐ฅ) = โ(๐ฅ + ๐)๐๐ ,
๐น(๐ฅ) = โ(๐ฅ + ๐)๐๐ .
and
๐=1
๐=1
Since ๐ > ๐ (we assumed that ๐ has no prime factors at most ๐), the expressions for ๐ธ(๐ฅ) and ๐น(๐ฅ) give the factorizations of these two polynomials (the point is that no term ๐ฅ + ๐ equals ๐ฅ + ๐ for ๐ and ๐ below ๐), and so ๐ธ(๐ฅ) and ๐น(๐ฅ) are distinct polynomials in ๐ฝ๐ [๐ฅ]. Put ฮ(๐ฅ) = ๐ธ(๐ฅ) โ ๐น(๐ฅ), so that ฮ is a non-zero polynomial in ๐ฝ๐ [๐ฅ] with degree less than โ. Therefore, ฮ can have at most โ โ 1 roots in the field ๐ฝ๐ . The goal is now to show that ฮ has too many roots. Clearly ฮ(๐ผ) = 0โthis is how we chose our polynomials ๐ธ and ๐น. The relation (8.6) now produces more roots. For any ๐ โ โณ, note that ๐
๐
๐ธ(๐ผ๐ ) = โ(๐ผ๐ + ๐)๐๐ = โ(๐ผ + ๐)๐๐๐ = ๐ธ(๐ผ)๐ , ๐=1
๐=1
and similarly, ๐น(๐ผ๐ ) = ๐น(๐ผ)๐ , so that ฮ(๐ผ๐ ) = 0. Now, note that two elements ๐ผ๐1 and ๐ผ๐2 are equal if and only if ๐1 โก ๐2 mod ๐. Therefore we have produced โ roots of ฮ, one for each element of the group โ. This is a contradiction! Thus we have established the first claim of ๐ ๐ the lemma, that the elements โ๐=1 (๐ผ + ๐)๐๐ with โ๐=1 ๐ ๐ โค โ โ 1 are all distinct. To get our lower bound for the size of ๐ข, just consider all the ways of choosing a subset of [1, ๐] of size at most โ โ 1โin doing so, we are ๐ only considering ๐ ๐ = 0 or 1 with โ๐=1 ๐ ๐ โค โ โ 1. Since ๐ โฅ โ + 1, the
152
8. The AKS Primality Test
number of such subsets is ๐ ๐ ๐ โ+1 โ+1 โ+1 ( ) + ( ) + ... + ( )โฅ( )+( ) + ... + ( ) 0 1 โโ1 0 1 โโ1 = 2โ+1 โ โ โ 2 โฅ 2โ , since โ โฅ 2. This gives the stated lower bound for |๐ข|.
๐
โก
Comparing the bounds of Lemmas 8.12 and 8.13, we must have 2โ โค , which upon taking logarithms implies that
2โโ
โโค(
2 2 log ๐) < 9(log ๐)2 . log 2
But this contradicts our lower bound โ โฅ 9(log ๐)2 , completing our proof!
8.9. Exercises 1. Let ๐ and ๐ be two positive integers. Give an analysis of the running time of the Euclidean algorithm to compute (๐, ๐). 2. Suppose ๐ is a natural number, and ๐ is a prime factor of ๐ with ๐๐ โ๐. Show that ๐๐ does not divide (๐๐). 3. (Love in Kleptopia, C. Calderbank via Peter Winkler [28]) Jan and Maria have fallen in love (via the internet) and Jan wishes to mail her a ring. Unfortunately, they live in the country of Kleptopia where anything sent through the mail will be stolen unless it is enclosed in a padlocked box. Jan and Maria each have plenty of padlocks, but none to which the other has a key. How can Jan get the ring safely into Mariaโs hands? 4. Suppose ๐ = 6๐+1, ๐ = 12๐+1 and ๐ = 18๐+1 are all prime. Show that ๐๐๐ is a Carmichael number. Find a Carmichael number different from 561, 1105, and 1729โof course, feel free to use a computer! 5. In the AKS algorithm, show that it is enough to check the key identity (8.2) in Section 8.4 for ๐ up to ๐ถโ๐ log ๐ for a suitable constant ๐ถ. This will give a speed-up to the AKS test.
8.9. Exercises
153
6. In her work on Fermatโs last theorem, Sophie Germain established a result for primes ๐ for which 2๐ + 1 is also prime. Such primes are called Sophie Germain primes. (i) If ๐ and โ = 2๐ + 1 are a Sophie Germain pair, then what can you say about the possible orders of an element ๐ mod โ? (ii) It is widely believed that there are infinitely many Sophie Germain pairs. In fact, we may expect that every interval [๐, 2๐] (for say ๐ โฅ 106 ) contains at least โ๐ primes ๐ with 2๐+1 also being prime. Assuming this Conjecture, show that one can find a value of ๐ โค ๐ถ(log ๐)2 (for a suitable constant ๐ถ) with the order of ๐ mod ๐ being at least 9(log ๐)2 . (That is, one can improve here the upper bound for ๐ in Lemma 8.8.) 7. The strong pseudoprime test for a number ๐ and a base ๐ < ๐ runs as follows: (a) Check that ๐ is odd and coprime to ๐. (b) Write ๐ โ 1 = 2๐ ๐ with ๐ odd. Check if ๐๐ โก 1 mod ๐, and if ๐ not check if ๐2 ๐ โก โ1 mod ๐ for some 0 โค ๐ โค ๐ โ 1. (i) If ๐ meets all of these checks then it could be prime or it could be composite. Prove that if it fails these checks, then ๐ is definitely composite. (ii) The Generalized Riemann Hypothesis (GRH) implies that if ๐ is composite, then it fails the strong pseudoprime test for some ๐ โค 2(log ๐)2 . Give an analysis of the running time for this test (conditional on GRH). 8. (i) Let ๐ โฅ 1 be a natural number. Show that โ ๐ โฅ 22๐ (2๐)โโ2๐ . ๐โค2๐
(ii) If ๐ is large enough (e.g., if ๐ โฅ 106 , but you donโt have to prove this bound) prove that there exists an odd prime ๐ โค 2๐ such that the order of 2 in (โค/๐โค)ร is at least โโ2๐โ.
Chapter 9
Synopsis of finite fields
In this chapter we summarize all that we have discussed about finite fields so far, and add a little bit more toward understanding them. In particular, we shall explain why all finite fields of the same size are isomorphic. Let us begin by recalling how we constructed finite fields. We started with a given field ๐ฝ๐ with ๐ elements, which could for example be the concrete field ๐ฝ๐ = โค/๐โค with ๐ elements. Then we considered the polynomial ring ๐ฝ๐ [๐ฅ], which is a Euclidean domain (see Example 1.49), and therefore a PID (see Proposition 1.50). Thus an irreducible polynomial ๐ โ ๐ฝ๐ [๐ฅ] of degree ๐ gives rise to a maximal ideal (๐) in ๐ฝ๐ [๐ฅ] (see Example 3.18), and the quotient ring ๐ฝ๐ [๐ฅ]/(๐) gives a field of size ๐๐ (see Proposition 3.19 and Theorem 4.11). We established the existence of irreducible polynomials of degree ๐ by giving a formula for ๐(๐; ๐ฝ๐ ), the number of monic irreducibles of degree ๐. In Corollaries 4.10 and 4.20 of Chapter 4, we showed that ๐(๐; ๐ฝ๐ ) = โฅ
1 โ ๐(๐)๐๐/๐ ๐ ๐|๐ 1 ๐ (๐ โ 2(๐โ๐/2โ โ 1)), ๐
and so there is an irreducible of each degree ๐. Given the existence of a field with size ๐, this argument shows the existence of a field of size ๐๐ . 155
156
9. Synopsis of finite fields
Starting with the field ๐ฝ๐ = โค/๐โค, in this manner we produced finite fields of size ๐๐ for every prime power (see Theorem 4.11). The characteristic and the additive structure. Given a field with ๐ฝ๐ with ๐ elements, we consider the order of 1 in the additive group of this field. This order must be a prime number ๐, which is called the characteristic of the field, and every ๐ผ โ ๐ฝ๐ satisfies ๐๐ผ = (๐ผ + ๐ผ + . . . + ๐ผ) = 0 (see Proposition 5.13). That is, every non-zero element of the field has order ๐ in the additive group. Further, the field ๐ฝ๐ must contain the field ๐ฝ๐ (all the elements generated by 1 additively), and ๐ฝ๐ has the structure of a finite dimensional vector space over the field ๐ฝ๐ . If ๐ is the dimension of this vector space then ๐ = ๐๐ , and thus all finite fields have prime power size (see Theorem 5.17). Similar reasoning showed that if ๐ฝ๐ is a field of size ๐ = ๐๐ , and ๐พ is a subfield of ๐ฝ๐ then the size of ๐พ must be ๐๐ for some divisor ๐ of ๐ (see Proposition 5.21). The multiplicative structure. In Section 5.4 we showed that the multiplicative group of a finite field ๐ฝ๐ is cyclic (see Theorem 5.22). By our general reasoning on cyclic groups (see Section 5.1), the multiplicative group ๐ฝร๐ has ๐(๐โ1) generators (see Proposition 5.6). One key fact used in our proof is that a polynomial of degree ๐ over a field has at most ๐ roots (see Lemma 4.3). In Chapter 6 we discussed the structure of the multiplicative group of reduced residues (โค/๐โค)ร . In particular, we showed that (โค/๐๐ โค)ร is cyclic for odd prime powers ๐๐ (see Theorem 6.10). But, be careful not to confuse โค/๐๐ โค with the field with ๐๐ elementsโfor ๐ = 1 these are the same, but for ๐ โฅ 2 note that โค/๐๐ โค is not even an integral domain. Minimal polynomials. Let ๐น be a field of size ๐, and let ๐พ be a field of size ๐๐ containing ๐น. Given ๐ผ โ ๐พ ร in Section 7.5 we showed that ๐ผ satisfies a polynomial relation (in ๐น[๐ฅ]) of degree at most ๐. Further, the set of all polynomials in ๐น[๐ฅ] that have ๐ผ as a root is an ideal, generated by a unique monic irreducible polynomial ๐(๐ฅ). The minimal polynomial is the monic polynomial of smallest degree that has ๐ผ as a root (see Proposition 7.13). We also showed that the set ๐น[๐ผ] consisting of all expressions of the form ๐0 + ๐1 ๐ผ + . . . + ๐๐ ๐ผ๐ with ๐๐ โ ๐น is a field, and that it is a subfield of ๐พ. Moreover this field ๐น[๐ผ] is isomorphic to ๐น[๐ฅ]/(๐(๐ฅ)). Since a
9. Synopsis of finite fields
157
subfield of ๐พ (and containing ๐น) must have size ๐๐ for some divisor ๐ of ๐, it also follows that the minimal polynomial ๐(๐ฅ) has degree ๐ dividing ๐ (see Proposition 7.14). Taking ๐ผ to be a generator of ๐พ ร , we see that the finite field ๐พ is isomorphic to ๐น[๐ฅ]/(๐(๐ฅ)) for some polynomial ๐ of degree ๐ (see Corollary 7.15). Thus our construction of finite fields captures all the possible finite fields. We have recapitulated our work so far on finite fields, and next we add a bit more to their understanding. Specifically we would like to address the following natural questions. 1. Why are all finite fields of the same size isomorphic? 2. Given a finite field ๐พ of size ๐๐ , what are its subfields? We know that the possible subfields must necessarily have size ๐๐ with ๐|๐, but do all these possibilities actually occur? How many subfields can there be of each size? 3. Every element ๐ผ in a field of size ๐๐ satisfies a minimal polynomial (in ๐ฝ๐ [๐ฅ]) of degree at most ๐. What are the other roots of this polynomial? Theorem 9.1. Let ๐น be a finite field with ๐ elements, with ๐ being the power of a prime ๐. Let ๐พ be a field containing ๐น with |๐พ| = ๐๐ . Then in ๐ ๐พ[๐ฅ] we can factor ๐ฅ๐ โ ๐ฅ completely into linear factors: (9.1)
๐
๐ฅ๐ โ ๐ฅ = โ (๐ฅ โ ๐ผ). ๐ผโ๐พ ๐
Further in ๐น[๐ฅ] we may factor ๐ฅ๐ โ ๐ฅ as (9.2)
๐
๐ฅ๐ โ ๐ฅ = โ ๐|๐
โ
๐(๐ฅ),
๐ deg(๐)=๐
where the product is over all monic irreducible polynomials ๐ โ ๐น[๐ฅ] of degree ๐. Proof. The first equation, (9.1), simply encodes that all elements ๐ผ โ ๐พ ๐ satisfy ๐ผ๐ โ ๐ผ = 0 (see Corollary 5.10), so that they are all roots of ๐ ๐ฅ๐ โ ๐ฅ. Since this polynomial has degree ๐๐ , these are all the roots of the polynomial, and the factorization follows.
158
9. Synopsis of finite fields
To show the second part, we will establish that the right side of (9.2) also has every element ๐ผ โ ๐พ as a root. Since the right side of (9.2) is monic, and has degree โ๐|๐ ๐๐(๐; ๐น) = ๐๐ by Theorem 4.9, the desired conclusion (9.2) would follow. Every ๐ผ โ ๐พ satisfies a minimal polynomial (in ๐น[๐ฅ]), which is irreducible of degree ๐ dividing ๐. Therefore there is a monic irreducible ๐ โ ๐น[๐ฅ] of degree ๐ dividing ๐ for which ๐ผ is a root. In other words, every element of ๐พ is a root of the right side of (9.2), and the theorem has been established. โก Recall that in our proof of Theorem 4.9 (see in particular (4.4) of Lemma 4.13), a crucial step was to identify the degree of the right side of (9.2) as being ๐๐ . We have now added a little more to that proof, by recognizing what polynomial this is. We are now ready to answer our first two questions. Corollary 9.2. All finite fields of size ๐ = ๐๐ are isomorphic to each otherโin other words, up to isomorphism there is only one finite field of each prime power order. Further, the finite field ๐พ of size ๐ = ๐๐ contains subfields of size ๐๐ for each divisor ๐ of ๐. In fact, ๐พ contains a unique subfield of size ๐๐ for each divisor ๐ of ๐, namely the set of ๐๐ solutions to ๐ the equation ๐ฅ๐ โ ๐ฅ = 0. Proof. Let ๐พ be a finite field with ๐ = ๐๐ elements, so that ๐พ contains the field ๐น = ๐ฝ๐ with ๐ elements. By Theorem 9.1 we know that every monic irreducible polynomial ๐ โ ๐ฝ๐ [๐ฅ] with degree ๐ dividing ๐ has a root ๐ผ in ๐พ. Clearly the minimal polynomial for ๐ผ (in ๐ฝ๐ [๐ฅ]) is the polynomial ๐ (because the minimal polynomial for ๐ผ must divide ๐, which is irreducible), and the field ๐ฝ๐ [๐ผ] is a subfield of ๐น with size ๐๐ . This proves our second assertion that ๐พ contains a subfield of size ๐๐ for every divisor ๐ of ๐. If ๐ฟ is a subfield of ๐น with size ๐๐ , then every element of ๐ฟ satisfies ๐ the equation ๐ฅ|๐ฟ| โ ๐ฅ = ๐ฅ๐ โ ๐ฅ = 0. Since this equation cannot have more than ๐๐ solutions in ๐พ, the field ๐ฟ is unique and consists of all the solutions in ๐พ to this equation. This proves our third assertion. For the first assertion, we restrict attention to monic irreducibles in ๐ฝ๐ [๐ฅ] of degree ๐. If ๐ผ โ ๐พ is a root of such a polynomial then ๐ฝ๐ [๐ผ] must be the same as ๐พ (since ๐ฝ๐ [๐ผ] is clearly contained in ๐พ, and has the same
9. Synopsis of finite fields
159
size as ๐พ). We discussed in Section 7.5 (see Corollary 7.15) why ๐ฝ๐ [๐ผ] is isomorphic to ๐ฝ๐ [๐ฅ]/(๐(๐ฅ)). Thus ๐พ is isomorphic to all fields of the form ๐ฝ๐ [๐ฅ]/(๐(๐ฅ)) for all irreducibles of degree ๐. Since these exhaust all the ways of creating finite fields, all finite fields of a given size are isomorphic to each other. โก Example 9.3. There is a very strong sense in which there is only one field of size ๐. Namely, if ๐น is a field of size ๐, then the multiplicative identity 1 in ๐น has additive order ๐, and the elements of ๐น are simply the elements 1, 1 + 1, . . ., ๐ ร 1 = 0. As we have remarked earlier, this sets up an isomorphism between ๐น and ๐ฝ๐ = โค/๐โค, with the multiplicative identity 1 โ ๐น being identified with the multiplicative identity 1 mod ๐ in โค/๐โค. In short, there is no choice at all in how we make this isomorphism between ๐น and ๐ฝ๐ . The situation for prime power orders is different, and there can be many different isomorphisms among fields. For example, Exercise 14 from Chapter 5 asks you to show that if ๐ฝ is a finite field with characteristic ๐ then the map ๐ โถ ๐ฝ โ ๐ฝ given by ๐(๐ผ) = ๐ผ๐ is an isomorphism of fields. Isomorphisms of a field to itself are also known as automorphisms. You can get more such automorphisms by iterating this map ๐. Exercise 15 from Chapter 5 gives a concrete example of this for the field โค[๐]/(๐) when ๐ โก 3 mod 4. Here the map ๐ takes an element ๐ + ๐๐ โ โค[๐]/(๐) to its โconjugateโ ๐ โ ๐๐, and this map is a field isomorphism. Hereโs one way to appreciate what Theorem 9.1 and Corollary 9.2 tell us. Take an irreducible polynomial ๐ of degree ๐ and construct the finite field ๐ฝ๐ [๐ฅ]/(๐(๐ฅ)). Then in this field any other irreducible polynomial of degree ๐ that you select will also have roots! In fact, every irreducible polynomial of degree ๐ will factor completely into linear polynomials in your fieldโthat is, will have exactly ๐ roots. Our third question asks for information about these other roots. Theorem 9.4. Let ๐พ be a field with ๐ elements, with ๐ = ๐๐ . Let ๐ โ ๐ฝ๐ [๐ฅ] be an irreducible polynomial with degree ๐|๐. Then ๐ has a root ๐ผ โ ๐พ, and there are ๐ distinct roots of ๐ in ๐พ which are given by 0
2
๐โ1
๐ผ = ๐ผ ๐ , ๐ผ ๐ , ๐ผ ๐ , . . . , ๐ผ๐
.
160
9. Synopsis of finite fields
Proof. If ๐ผ = 0, then the polynomial ๐ is simply ๐ฅ of degree 1, and there is nothing to prove. Suppose then that ๐ผ โ 0 below. Exercise 2 below asks you to show that if ๐ โ ๐ฝ๐ [๐ฅ] then ๐(๐ฅ)๐ = 2 ๐(๐ฅ๐ ). So if ๐ has a root ๐ผ โ ๐พ, then ๐ผ๐ , ๐ผ๐ , . . . are also roots of ๐. Now if ๐ is irreducible of degree ๐, then from our work in Theorem 9.1 and Corollary 9.2, we know that ๐ has a root ๐ผ in ๐พ. Moreover ๐ is the minimal polynomial (in ๐ฝ๐ [๐ฅ]) for ๐ผ, and the field ๐ฝ๐ [๐ผ] has size ๐๐ and ๐
is a subfield of ๐พ. In particular ๐ผ๐ = ๐ผ, and therefore the multiplicative order of ๐ผ is a divisor of ๐๐ โ 1. ๐โ1
We claim that ๐ผ, ๐ผ๐ , . . ., ๐ผ๐ are all distinct, in which case they ๐ ๐ would be all the roots of ๐. If not, then some ๐ผ๐ must equal ๐ผ๐ , with say ๐ = ๐ + โ with 1 โค โ < ๐. Then ๐
โ โ1)
๐ผ๐ (๐
=1
so that the order of ๐ผ must divide ๐๐ (๐โ โ1). Since we know that the order โ of ๐ผ divides ๐๐ โ 1, and thus is coprime to ๐, we must have ๐ผ๐ โ1 = 1. That is, the order of ๐ผ must divide ๐โ โ 1, as well as ๐๐ โ 1, which forces (โ,๐) (by Exercise 3 below) the order to divide ๐(โ,๐) โ 1. But then ๐ผ๐ = (โ,๐) ๐ผ, and (as in Corollary 9.2) ๐ฝ๐ [๐ผ] would be the subfield of ๐พ size ๐ (โ,๐)
โ ๐ฅ = 0. Therefore, all the given as the solutions to the equation ๐ฅ๐ ๐๐ elements ๐ผ for 0 โค ๐ โค ๐ โ 1 are distinct, and the theorem follows. โก Given a field ๐พ with ๐ = ๐๐ elements, we noted earlier that if ๐ผ is a generator of ๐พ ร then the minimal polynomial of ๐ผ (in ๐ฝ๐ [๐ฅ]) has degree ๐, and ๐พ = ๐ฝ๐ [๐ผ]. But there we left open what happens for other elements ๐ผ โ ๐พ ร . We can now answer that question. Corollary 9.5. Let ๐พ be a field with ๐ = ๐๐ elements. Let ๐ผ โ ๐พ ร be an element of order โ. Let ๐ denote the order of ๐ mod โ. Then the minimal polynomial of ๐ผ (in ๐ฝ๐ [๐ฅ]) has degree ๐. Proof. Suppose the minimal polynomial for ๐ผ has degree ๐. Then ๐ฝ๐ [๐ผ] has size ๐๐ , and therefore โ must divide ๐๐ โ 1. Since ๐ is the order of ๐ modulo โ, it follows that ๐ must divide ๐, so that ๐ โค ๐. On the other hand, the roots of the minimal polynomial are (by The2 ๐โ1 orem 9.4) given by ๐ผ, ๐ผ๐ , ๐ผ๐ , . . ., ๐ผ๐ and these must all be distinct. But
9.1. Exercises
161
๐
๐ผ๐ = ๐ผ (since โ|(๐๐ โ 1)), and so we must have ๐ โค ๐. Thus ๐ = ๐, as claimed. โก Definition 9.6. A monic irreducible polynomial ๐(๐ฅ) โ ๐ฝ๐ [๐ฅ] is called a primitive polynomial if ๐ฅ generates the multiplicative group in the field ๐ฝ๐ [๐ฅ]/(๐(๐ฅ)). Corollary 9.7. There are ๐(๐๐ โ 1)/๐ primitive polynomials of degree ๐. Recall that Exercise 4 of Chapter 5 asked you to prove that ๐ divides ๐(๐๐ โ 1) for any two positive integers ๐ and ๐ โฅ 2. Proof. Take a field ๐ฝ๐ with size ๐๐ . The cyclic group ๐ฝร๐ has ๐(๐โ1) generators. Primitive polynomials are the same as minimal polynomials of 2 ๐ these generators. If ๐ผ is a generator, then so are ๐ผ๐ , ๐ผ๐ , . . ., ๐ผ๐ = ๐ผ, and these are all the roots of the minimal polynomial for ๐ผ. So each primitive polynomial corresponds to ๐ generators of ๐ฝร๐ , and the corollary follows. โก Primitive polynomials are of interest in coding theory, where finite fields are of great use. We give a small taste of an error correcting Hamming code in Exercise 6 below, and refer you to [7] for a friendly introduction. Some of the material we have touched upon in our discussion here (Example 9.3 and Theorem 9.4) is related to Galois theory, and the finite fields ๐ฝ๐ are also sometimes called Galois fields and denoted by ๐บ๐น(๐). For a lucid treatment of Galois theory as well as an elaboration of many of the topics in algebra that we have touched upon, see [6].
9.1. Exercises 1. Prove the following statements from scratch, without appealing to Theorem 9.1. (i) Let ๐ฝ๐ be a finite field with ๐ = ๐๐ elements. Let ๐ผ be an element of and let ๐(๐ฅ) โ ๐ฝ๐ [๐ฅ] be the minimal polynomial for ๐ผ. Show that in the ring ๐ฝ๐ [๐ฅ] ๐(๐ฅ)|(๐ฅ๐โ1 โ 1). ๐ฝร๐
(ii) Let โ(๐ฅ) โ ๐ฝ๐ [๐ฅ] be an irreducible polynomial of degree ๐. Show ๐
that โ(๐ฅ) divides ๐ฅ๐ โ ๐ฅ. (iii) If ๐|๐ show that ๐๐ โ 1 divides ๐๐ โ 1.
162
9. Synopsis of finite fields (iv) Let ๐(๐ฅ) โ ๐ฝ๐ [๐ฅ] be an irreducible polynomial of degree ๐ with ๐
๐|๐. Show that ๐(๐ฅ) divides ๐ฅ๐ โ ๐ฅ. 2. Let ๐ = ๐๐ be a prime power. (i) Let ๐ โ ๐ฝ๐ [๐ฅ] be a polynomial. Show that ๐(๐ฅ)๐ = ๐(๐ฅ๐ ). (ii) Let ๐ โ ๐ฝ๐ [๐ฅ] be a polynomial, and suppose ๐ผ โ ๐ฝ๐ is a root of ๐. Show that ๐ผ๐ is also a root of ๐. 3. (i) Let ๐ be a prime, and ๐ and ๐ be natural numbers. Show that the gcd of ๐๐ โ 1 and ๐๐ โ 1 equals ๐(๐,๐) โ 1. (ii) Suppose ๐ and ๐ are natural numbers, and consider the polynomials ๐ฅ๐ โ 1 and ๐ฅ๐ โ 1 in ๐ฝ๐ [๐ฅ]. Suppose that an irreducible ๐ divides both ๐ฅ๐ โ 1 and ๐ฅ๐ โ 1. Show that ๐ divides ๐ฅ(๐,๐) โ 1. 4. Take two different monic irreducible polynomials of degree 2 in ๐ฝ7 [๐ฅ], say ๐ and ๐. Use these two polynomials to construct two fields of size 49: thus, ๐น1 = ๐ฝ7 [๐ฅ]/(๐(๐ฅ)) and ๐น2 = ๐ฝ7 [๐ฅ]/(๐(๐ฅ)). Exhibit explicitly an isomorphism between these fields. That is, construct a bijection ๐ โถ ๐น1 โ ๐น2 such that ๐(๐ + ๐) = ๐(๐) + ๐(๐) and ๐(๐๐) = ๐(๐)๐(๐) holds for all ๐ and ๐ in ๐น1 . 5. Let ๐น be a finite field with ๐ = ๐๐ elements. Let ๐ผ be an element of ๐น, and let ๐ be a divisor of ๐. Show that ๐
๐ผ๐ + ๐ผ๐
2๐
+ . . . + ๐ผ๐
๐
lies in the subfield of ๐น with ๐๐ elements. 6. Let ๐ โฅ 2 be a natural number, and put ๐ = 2๐ โ 1. Let ๐น be a field with 2๐ elements. (i) Show that there is a monic irreducible polynomial โ โ ๐ฝ2 [๐ฅ] of degree ๐ with a root ๐ผ โ ๐น such that ๐ผ generates the multiplicative group ๐นร. (ii) Consider the set of multiples of โ of degree at most ๐ โ 1: thus ๐ฎ = {๐ โ ๐ฝ2 [๐ฅ] โถ degree(๐) โค ๐ โ 1, โ(๐ฅ)|๐(๐ฅ)}. (Here ๐ฎ will be taken to include the zero polynomial.) Show that |๐ฎ| = 2๐โ๐ .
9.1. Exercises
163
(iii) If ๐(๐ฅ) = ๐0 + ๐1 ๐ฅ + . . . + ๐๐โ1 ๐ฅ๐โ1 and ๐(๐ฅ) = ๐0 + ๐1 ๐ฅ + . . . + ๐๐โ1 ๐ฅ๐โ1 are two distinct polynomials in ๐ฎ, then show that there must be at least three values of 0 โค ๐ โค ๐ โ 1 with ๐๐ โ ๐๐ . Remark: This is one way to get a Hamming code. 7. Let ๐(๐ฅ) = ๐ฅ3 + ๐๐ฅ2 + ๐๐ฅ + ๐ be an irreducible polynomial in ๐ฝ๐ [๐ฅ]. Let ๐น be a field of size ๐3 . (i) Explain why ๐ has a root in the field ๐น. (ii) Let ๐ผ be a root of ๐ in ๐น. Prove that 2
2
๐ = ๐ผ1+๐ + ๐ผ1+๐ + ๐ผ๐+๐ .
Bibliography
[1] Manindra Agrawal, Neeraj Kayal, and Nitin Saxena, PRIMES is in P, Ann. of Math. (2) 160 (2004), no. 2, 781โ793, DOI 10.4007/annals.2004.160.781. MR2123939 [2] W. R. Alford, Andrew Granville, and Carl Pomerance, There are infinitely many Carmichael numbers, Ann. of Math. (2) 139 (1994), no. 3, 703โ722, DOI 10.2307/2118576. MR1283874 [3] Jรณzsef Balogh, Zoltรกn Fรผredi, and Souktik Roy, An upper bound on the size of Sidon sets, 2021. [4] Jonathan W. Bober, Factorial ratios, hypergeometric series, and a family of step functions, J. Lond. Math. Soc. (2) 79 (2009), no. 2, 422โ 444, DOI 10.1112/jlms/jdn078. MR2496522 [5] Persi Diaconis and Ron Graham, Magical mathematics, Princeton University Press, Princeton, NJ, 2012. The mathematical ideas that animate great magic tricks; With a foreword by Martin Gardner. MR2858033 [6] David S. Dummit and Richard M. Foote, Abstract algebra, 3rd ed., John Wiley & Sons, Inc., Hoboken, NJ, 2004. MR2286236 [7] Paul Garrett, The mathematics of coding theory, Pearson Prentice Hall, Upper Saddle River, NJ, 2004. Information, compression, error correction, and finite fields. MR2235369 [8] Daniel M. Gordon, On difference sets with small ๐, J. Algebraic Combin. 55 (2022), no. 1, 109โ115, DOI 10.1007/s10801-020-00992-x. MR4382628 165
166
Bibliography
[9] W. T. Gowers, Probabilistic combinatorics and the recent work of Peter Keevash, Bull. Amer. Math. Soc. (N.S.) 54 (2017), no. 1, 107โ116, DOI 10.1090/bull/1553. MR3584100 [10] Andrew Granville, It is easy to determine whether a given integer is prime, Bull. Amer. Math. Soc. (N.S.) 42 (2005), no. 1, 3โ38, DOI 10.1090/S0273-0979-04-01037-7. MR2115065 [11] Andrew Granville, Using dynamical systems to construct infinitely many primes, Amer. Math. Monthly 125 (2018), no. 6, 483โ496, DOI 10.1080/00029890.2018.1447732. MR3806263 [12] Heini Halberstam and Klaus Friedrich Roth, Sequences, 2nd ed., Springer-Verlag, New York-Berlin, 1983. MR687978 [13] Malcolm Harper, โค[โ14] is Euclidean, Canad. J. Math. 56 (2004), no. 1, 55โ70, DOI 10.4153/CJM-2004-003-9. MR2031122 [14] David Harvey and Joris van der Hoeven, Integer multiplication in time ๐(๐ log ๐), Ann. of Math. (2) 193 (2021), no. 2, 563โ617, DOI 10.4007/annals.2021.193.2.4. MR4224716 [15] Gil Kalai, Designs exist! [after Peter Keevash], Astรฉrisque 380, Sรฉminaire Bourbaki. Vol. 2014/2015 (2016), Exp. No. 1100, 399โ422. MR3522180 [16] C. W. H. Lam, The search for a finite projective plane of order 10, Amer. Math. Monthly 98 (1991), no. 4, 305โ318, DOI 10.2307/2323798. MR1103185 [17] Daniel A. Marcus, Number fields, Universitext, Springer, Cham, 2018. Second edition of [ MR0457396]; With a foreword by Barry Mazur, DOI 10.1007/978-3-319-90233-3. MR3822326 [18] Barry Mazur and William Stein, Prime numbers and the Riemann hypothesis, Cambridge University Press, Cambridge, 2016, DOI 10.1017/CBO9781316182277. MR3616260 [19] Hugh L. Montgomery, Ten lectures on the interface between analytic number theory and harmonic analysis, CBMS Regional Conference Series in Mathematics, vol. 84, Published for the Conference Board of the Mathematical Sciences, Washington, DC; by the American Mathematical Society, Providence, RI, 1994, DOI 10.1090/cbms/084. MR1297543 [20] M. Nair, On Chebyshev-type inequalities for primes, Amer. Math. Monthly 89 (1982), no. 2, 126โ129, DOI 10.2307/2320934. MR643279
Bibliography
167
[21] Ivan Niven, Herbert S. Zuckerman, and Hugh L. Montgomery, An introduction to the theory of numbers, 5th ed., John Wiley & Sons, Inc., New York, 1991. MR1083765 [22] Kevin OโBryant, A complete annotated bibliography of work related to Sidon sequences, Electron. J. Combin. DS11 (2004), no. Dynamic Surveys, 39. MR4336213 [23] Sarah Peluse, An asymptotic version of the prime power conjecture for perfect difference sets, Math. Ann. 380 (2021), no. 3-4, 1387โ1425, DOI 10.1007/s00208-021-02188-5. MR4297189 [24] Carl Pomerance, A tale of two sieves, Notices Amer. Math. Soc. 43 (1996), no. 12, 1473โ1485. MR1416721 [25] Peter W. Shor, Polynomial-time algorithms for prime factorization and discrete logarithms on a quantum computer, SIAM J. Comput. 26 (1997), no. 5, 1484โ1509, DOI 10.1137/S0097539795293172. MR1471990 [26] K. Soundararajan, Integral factorial ratios, Duke Math. J. 171 (2022), no. 3, 633โ672, DOI 10.1215/00127094-2021-0017. MR4383251 [27] Gรฉrald Tenenbaum and Michel Mendรจs France, The prime numbers and their distribution, Student Mathematical Library, vol. 6, American Mathematical Society, Providence, RI, 2000. Translated from the 1997 French original by Philip G. Spain, DOI 10.1090/stml/006. MR1756233 [28] Peter Winkler, Mathematical puzzles: a connoisseurโs collection, A K Peters, Ltd., Natick, MA, 2004. MR2034896
Index
abelian, 2 AKS algorithm, 137 arithmetic function, 81 associates, 10
Dirichlet convolution, 81 discrete logarithm problem, 139 divisibility, 9 division algorithm, 17
Bertrandโs postulate, 32 binary operation, 1 binomial coefficients, 33 birthday problem, 114
equivalence class, 46 equivalence relation, 46 Euclidean algorithm, 21 Euclidean domain, 17 Eulerโs theorem, 89 Eulerโs totient function, 49
Carmichael numbers, 141 CauchyโSchwarz inequality, 119 characteristic of a field, 83, 92 characteristic zero, 92 Chinese Remainder Theorem, 99 comaximal ideals, 102 common divisor, 13 completely multiplicative function, 81 composite number, 41 congruence class, 46 congruences, 5 coprime, 49 coset, 87 cyclic group, 3, 49, 83 De Bruijn sequence, 126 degree of a polynomial, 7 design, 115 DiffieโHellman key exchange, 140 direct product of groups, 94 direct product of rings, 100
factoring, 138 Fano plane, 115 Fermatโs little theorem, 89 field, 1, 8 field of fractions, 9 finite characteristic, 92 finite projective plane, 115 Fundamental Theorem of Algebra, 65 Fundamental Theorem of Arithmetic, 27 Gaussian integers, 1 generator of a group, 86 greatest common divisor, 13 group, 1 harmonic sum, 30 ideal, 12
169
170
Index
integral domain, 6, 7 irreducible, 11 isomorphism, 83 isomorphism of fields, 90 isomorphism of groups, 84 isomorphism of rings, 90
square-free number, 75 strong pseudoprime, 141 subfield, 92
Lagrangeโs theorem, 87
variance, 118 vector space, 83, 93
maximal ideal, 53 mean, 118 minimal polynomial, 125 moments, 118 monic polynomial, 65 multiplicative function, 75 Mรถbius function, 75 Mรถbius inversion formula, 74 Noetherian ring, 17 normal subgroup, 88 order of an element, 86 partition into equivalence classes, 47 perfect difference set, 114 polynomial ring, 5 polynomial time algorithm, 136 polynomials, 1 primality testing, 140 prime, 11 prime ideal, 52 prime number theorem, 40 primitive polynomial, 161 principal ideal, 12 principal ideal domain (PID), 12 pseudoprime, 140 public key cryptosystem, 138 quotient ring, 45 rapid algorithm, 136 rational functions, 9 reduced residue class, 49 repeated squaring, 139 residue class, 48 Riemann hypothesis, 40 ring, 1, 4 root of a polynomial, 64 Sidon set, 111
unique factorization domain (UFD), 15 units, 8
Wilsonโs theorem, 50 zero divisor, 6 zero ring, 4
Selected Published Titles in This Series 99 Kannan Soundararajan, Finite Fields, with Applications to Combinatorics, 2022 98 Gregory F. Lawler, Random Explorations, 2022 97 Anthony Bonato, An Invitation to Pursuit-Evasion Games and Graph Theory, 2022 96 Hilยด ario Alencar, Walcy Santos, and Gregยด orio Silva Neto, Di๏ฌerential Geometry of Plane Curves, 2022 95 Jยจ org Bewersdor๏ฌ, Galois Theory for Beginners: A Historical Perspective, Second Edition, 2021 94 James Bisgard, Analysis and Linear Algebra: The Singular Value Decomposition and Applications, 2021 93 Iva Stavrov, Curvature of Space and Time, with an Introduction to Geometric Analysis, 2020 92 Roger Plymen, The Great Prime Number Race, 2020 91 Eric S. Egge, An Introduction to Symmetric Functions and Their Combinatorics, 2019 90 Nicholas A. Scoville, Discrete Morse Theory, 2019 89 Martin Hils and Franยธ cois Loeser, A First Journey through Logic, 2019 88 M. Ram Murty and Brandon Fodden, Hilbertโs Tenth Problem, 2019 87 Matthew Katz and Jan Reimann, An Introduction to Ramsey Theory, 2018 86 Peter Frankl and Norihide Tokushige, Extremal Problems for Finite Sets, 2018 85 Joel H. Shapiro, Volterra Adventures, 2018 84 Paul Pollack, A Conversational Introduction to Algebraic Number Theory, 2017 83 Thomas R. Shemanske, Modern Cryptography and Elliptic Curves, 2017 82 A. R. Wadsworth, Problems in Abstract Algebra, 2017 81 Vaughn Climenhaga and Anatole Katok, From Groups to Geometry and Back, 2017 80 Matt DeVos and Deborah A. Kent, Game Theory, 2016 79 Kristopher Tapp, Matrix Groups for Undergraduates, Second Edition, 2016 78 Gail S. Nelson, A User-Friendly Introduction to Lebesgue Measure and Integration, 2015 77 Wolfgang Kยจ uhnel, Di๏ฌerential Geometry: Curves โ Surfaces โ Manifolds, Third Edition, 2015
For a complete list of titles in this series, visit the AMS Bookstore at www.ams.org/bookstore/stmlseries/.
This book uses finite field theory as a hook to introduce the reader to a range of ideas from algebra and number theory. It constructs all finite fields from scratch and shows that they are unique up to isomorphism. As a payoff, several combinatorial applications of finite fields are given: Sidon sets and perfect difference sets, de Bruijn sequences and a magic trick of Persi Diaconis, and the polynomial time algorithm for primality testing due to Agrawal, Kayal and Saxena. The book forms the basis for a one term intensive course with students meeting weekly for multiple lectures and a discussion session. Readers can expect to develop familiarity with ideas in algebra (groups, rings and fields), and elementary number theory, which would help with later classes where these are developed in greater detail. And they will enjoy seeing the AKS primality test application tying together the many disparate topics from the book. The pre-requisites for reading this book are minimal: familiarity with proof writing, some linear algebra, and one variable calculus is assumed. This book is aimed at incoming undergraduate students with a strong interest in mathematics or computer science.
For additional information and updates on this book, visit www.ams.org/bookpages/stml-99
STML/99