Topology of Numbers - Hatcher
Topology of Numbers - Hatcher
Topology of Numbers - Hatcher
Allen Hatcher
Chapter 0. A Preview . . . . . . . . . . . . . . . . . . . . . . . . 1
Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Preface
This book will remain available online in electronic form for free downloading
after it has been published in the traditional paper form. The web address where it
can be found is
http://www.math.cornell.edu/˜hatcher
Also available here will be a list of corrections as well as possible revisions and addi-
tions to the book. Readers are encouraged to send comments and corrections to the
email address posted on the web page.
In this preliminary Chapter 0 we introduce by means of examples some of the
main themes of Number Theory, particularly those that will be emphasized in the rest
of the book.
Pythagorean Triples
Let us begin by considering right triangles whose sides all have integer lengths.
The most familiar example is the (3, 4, 5) right triangle, but there are many others as
well, such as the (5, 12, 13) right triangle. Thus we are looking for triples (a, b, c) of
positive integers such that a2 + b2 = c 2 . Such triples are called Pythagorean triples
because of the connection with the Pythagorean Theorem. Our goal will be a formula
that gives them all. The ancient Greeks knew such a formula, and even before the
Greeks the ancient Babylonians must have known a lot about Pythagorean triples be-
cause one of their clay tablets from nearly 4000 years ago has been found which gives a
list of 15 different Pythagorean triples, the largest of which is (12709, 13500, 18541) .
(Actually the tablet only gives the numbers a and c from each triple (a, b, c) for some
unknown reason, but it is easy to compute b from a and c .)
There is an easy way to create infinitely many Pythagorean triples from a given
one just by multiplying each of its three numbers by an arbitrary number n . For
example, from (3, 4, 5) we get (6, 8, 10) , (9, 12, 15) , (12, 16, 20) , and so on. This
process produces right triangles that are all similar to each other, so in a sense they
are not essentially different triples. In our search for Pythagorean triples there is
thus no harm in restricting our attention to triples (a, b, c) whose three numbers
have no common factor. Such triples are called primitive. The large Babylonian triple
mentioned above is primitive, since the prime factorization of 13500 is 22 33 53 but
the other two numbers in the triple are not divisible by 2 , 3 , or 5 .
A fact worth noting in passing is that if two of the three numbers in a Pythagorean
triple (a, b, c) have a common factor n , then n is also a factor of the third number.
This follows easily from the equation a2 + b2 = c 2 , since for example if n divides a
and b then n2 divides a2 and b2 , so n2 divides their sum c 2 , hence n divides c .
2 Chapter 0 — A Preview
The coordinates a/c and b/c are rational numbers, so each Pythagorean triple gives a
rational point on the circle, a point whose coordinates are both rational. Notice that
multiplying each of a , b , and c by the same nonzero integer n yields the same point
(x, y) on the circle. Going in the other direction, given a rational point on the circle,
we can find a common denominator for its two coordinates so that it has the form
a/ , b/
c c and hence gives a Pythagorean triple (a, b, c) . We can assume this triple is
primitive by canceling any common factor of a , b , and c , and this does not change
the point a/c , b/c . The two fractions a/c and b/c must then be in lowest terms since
we observed earlier that if two of a , b , c have a common factor, then all three have
a common factor.
From the preceding observations we can conclude that the problem of finding
all Pythagorean triples is equivalent to finding all rational points on the unit circle
x 2 + y 2 = 1 . More specifically, there is an exact one-to-one correspondence between
primitive Pythagorean triples and rational points on the unit circle that lie in the
interior of the first quadrant (since we want all of a, b, c, x, y to be positive).
In order to find all the rational points on the circle x 2 + y 2 = 1 we will use
a construction that starts with one rational point and creates many more rational
points from this one starting point. The four obvious rational points on the circle are
the intersections of the circle with the coordinate axes, which are the points (±1, 0)
and (0, ±1) . It does not matter which one we choose as the starting point, so let
us choose (0, 1) . Now consider a line which
intersects the circle in this point (0, 1) and
some other point P , as in the figure at the
right. If the line has slope m , its equation
will be y = mx + 1 . If we denote the point
where the line intersects the x- axis by (r , 0) ,
then m = − 1/r so the equation for the line
can be rewritten as y = 1 − x/r . Here we
assume r is nonzero since r = 0 corresponds to the slope m being infinite and the
point P being (0, −1) , a rational point we already know about. To find the coordinates
of the point P in terms of r when r ≠ 0 we substitute y = 1 − x/r into the equation
Chapter 0 — A Preview 3
These formulas give the ratios x = a/c and y = b/c for all Pythagorean triples
(a, b, c) , so they determine all Pythagorean triples up to multiplication by a constant.
2 2
The simplest way to realize the ratios a/c = 2pq/p 2 + q 2 and b/c = p --- q /p 2 + q 2 is
just to take
(a, b, c) = (2pq, p 2 − q2 , p 2 + q2 )
The Pythagorean triples given by this formula may not be primitive, however. For
example if x and y are both odd then p 2 − q2 and p 2 + q2 are both even, as is 2pq ,
so the triple could be simplified by dividing by 2 . The nonprimitive triples obtained
in this way are the starred entries in the table below.
Notice that the primitive versions of the starred triples occur higher in the table, but
with a and b switched. This is a general phenomenon, as we will see in the course of
proving the following basic result:
Proof: We have seen that the formula (a, b, c) = (2pq, p 2 − q2 , p 2 + q2 ) yields all
Pythagorean triples up to multiplication by a constant, so we just need to investigate
when the formula gives a primitive triple and what to do when it gives a nonprimitive
triple. As before we can assume that p and q have no common divisor, and we can
assume that p > q in order for the middle coordinate b = p 2 − q2 to be positive.
Case 1: Suppose p and q have opposite parity. If all three of 2pq , p 2 − q2 , and
p 2 + q2 have a common divisor d > 1 then d would have to be odd since p 2 − q2 and
Chapter 0 — A Preview 5
p 2 + q2 are odd when p and q have opposite parity. Furthermore, since d is a divisor
of both p 2 − q2 and p 2 + q2 it must divide their sum (p 2 + q2 ) + (p 2 − q2 ) = 2p 2
and their difference (p 2 + q2 ) − (p 2 − q2 ) = 2q2 . However, since d is odd it would
then have to divide p 2 and q2 , forcing p and q to have a common factor (since any
prime factor of d would have to divide p and q ). This contradicts the assumption
that p and q had no common factors, so we conclude that (2pq, p 2 − q2 , p 2 + q2 ) is
primitive if p and q have opposite parity.
Case 2: Suppose p and q have the same parity, hence they are both odd since if
they were both even they would have the common factor of 2 . Because p and q are
both odd, their sum and difference are both even and we can write p + q = 2P and
p − q = 2Q for some integers P and Q . Any common factor of P and Q would have
to divide P + Q = 1/2(p + q) + 1/2(p − q) = p and P − Q = 1/2(p + q) − 1/2(p − q) = q ,
so P and Q have no common factors. In terms of P and Q our Pythagorean triple
becomes
(a, b, c) = 2pq, p 2 − q2 , p 2 + q2
= 2(P + Q)(P − Q), (P + Q)2 − (P − Q)2 , (P + Q)2 + (P − Q)2
= 2(P 2 − Q2 ), 4P Q, 2(P 2 + Q2 )
= 2 P 2 − Q2 , 2P Q, P 2 + Q2
After canceling the factor of 2 in front of this last expression we get a new Pythagorean
triple of the same type that we started with but with the first two coordinates switched.
This new triple is primitive by Case 1 since P and Q cannot both be odd, because if
they were, then p = P + Q and q = P − Q would both be even, which is impossible
since they have no common factor.
From Cases 1 and 2 we can conclude that if we allow ourselves to switch the first
two coordinates, then we get all primitive Pythagorean triples from the formula by
restricting p and q to be of opposite parity and have no common factors. ⊓
⊔
where p and q have no common factor and are not both odd. Determining whether
a given number can be expressed in the form 2pq , p 2 − q2 , or p 2 + q2 is a special
6 Chapter 0 — A Preview
case of the general question of deciding when an equation Ap 2 + Bpq + Cq2 = n has
an integer solution p , q , for given integers A , B , C , and n . Expressions of the form
Ax 2 + Bxy + Cy 2 are called quadratic forms. These will be the main topic studied
in Chapters 4–8, where we will develop some general theory addressing the question
of what values a quadratic form takes on when all the numbers involved are integers.
For now, let us just look at the special cases at hand.
First let us consider which numbers occur as a or b in primitive Pythagorean
triples (a, b, c) . A trivial case is the equation 02 + 12 = 12 which shows that 0 and
1 can be realized by the triple (0, 1, 1) which is primitive, so let us focus on realizing
numbers bigger than 1 . If we look at the earlier table of Pythagorean triples we see
that all the numbers up to 15 can be realized as a or b in primitive triples except for
2 , 6 , 10 , and 14 . This might lead us to guess that the numbers realizable as a or b in
primitive Pythagorean triples are the numbers not of the form 4k + 2 . This is indeed
true, and can be proved as follows. First note that since 2pq is even, p 2 − q2 must
be odd, otherwise both a and b would be even, violating primitivity. Now, every odd
number is expressible in the form p 2 − q2 since 2k + 1 = (k + 1)2 − k2 , so in fact every
odd number is the difference between two consecutive squares. Taking p = k + 1 and
q = k yields a primitive triple since k and k + 1 always have opposite parity and no
common factors. This takes care of realizing odd numbers. For even numbers, they
would have to be expressible as 2pq with p and q of opposite parity, which forces
pq to be even so 2pq is a multiple of 4 and hence cannot be of the form 4k + 2 . On
the other hand, if we take p = 2k and q = 1 then 2pq = 4k with p and q having
opposite parity and no common factors.
To summarize, we have shown that all positive numbers 2k+1 and 4k occur as a
or b in primitive Pythagorean triples but none of the numbers 4k + 2 occur. To finish
the story, note that a number a = 4k + 2 which cannot be realized in a primitive triple
can be realized by a nonprimitive triple just by taking a triple (a, b, c) with a = 2k + 1
and doubling each of a , b , and c . Thus all numbers can be realized as a or b in
Pythagorean triples (a, b, c) .
Now let us ask which numbers c can occur in Pythagorean triples (a, b, c) , so we
are trying to find a solution of p 2 + q2 = c for a given number c . Pythagorean triples
(p, q, r ) give solutions when c is equal to a square r 2 , but we are asking now about
arbitrary numbers c . It suffices to figure out which numbers c occur in primitive
triples (a, b, c) , since by multiplying the numbers c in primitive triples by arbitrary
numbers we get the numbers c in arbitrary triples. A look at the earlier table shows
that the numbers c that can be realized by primitive triples (a, b, c) seem to be fairly
rare: only 5, 13, 17, 25, 29, 37, 41, 53, 61, 65, and 85 occur in the table. These are all
odd, and in fact they are all of the form 4k + 1 . This always has to be true because
p and q are of opposite parity, so one is an even number 2k and the other an odd
number 2l + 1 . Squaring, we get (2k)2 = 4k2 and (2l + 1)2 = 4(l2 + l) + 1 . Thus the
Chapter 0 — A Preview 7
square of an even number has the form 4u and the square of an odd number has the
form 4v + 1 . Hence p 2 + q2 has the form 4(u + v) + 1 , or more simply, just 4k + 1 .
The argument we just gave can be expressed more concisely using congruences
modulo 4 . We will assume the reader has seen something about congruences before,
but to recall the terminology: two numbers a and b are said to be congruent modulo a
number n if their difference a − b is a multiple of n . When n is negative, congruence
modulo n is equivalent to congruence modulo |n| so there is no loss of generality
in restricting attention just to congruence modulo positive numbers. Congruence
modulo 0 is the same as equality so there is little reason to consider this case. One
writes a ≡ b mod n to mean that a is congruent to b modulo n , with the word
“modulo” abbreviated to “mod”. One can tell whether two numbers are congruent
mod n by dividing each of them by n and checking whether the remainders, which
lie between 0 and n − 1 , are equal. Every number is congruent mod n to one of the
numbers 0, 1, 2, · · · , n − 1 , and no two of these numbers are congruent to each other,
so there are exactly n congruence classes of numbers mod n , where a congruence
class means all the numbers congruent to a given number. In the preceding paragraph
we were in effect dealing with congruence classes mod 4 and we saw that the square
of an even number is congruent to 0 mod 4 while the square of an odd number is
congruent to 1 mod 4 , hence p 2 + q2 is congruent to 0 + 1 or 1 + 0 mod 4 when p
and q have opposite parity, so p 2 + q2 ≡ 1 mod 4 .
Returning to the question of which numbers occur as c in primitive Pythagorean
triples (a, b, c) , we have seen that c ≡ 1 mod 4 , but looking at the list 5, 13, 17, 25, 29 ,
37, 41, 53, 61, 65, 85 again we can observe the more interesting fact that most of these
numbers are primes, and the ones that are not primes are products of earlier primes
in the list: 25 = 5·5 , 65 = 5·13 , 85 = 5·17 . From this somewhat slim evidence
one might conjecture that the numbers c occurring in primitive Pythagorean triples
are exactly the numbers that are products of primes congruent to 1 mod 4 . The first
prime satisfying this condition that is not on the original list is 73 , and this is realized
as p 2 + q2 = 82 + 32 , in the triple (48, 55, 73) . The next two primes congruent to 1
mod 4 are 89 = 82 +52 and 97 = 92 +42 , so the conjecture continues to look good. As
further evidence for the conjecture, numbers congruent to 1 mod 4 that are not on
the list such as 9 = 3·3 , 21 = 3·7 , 33 = 3·11 , 45 = 32 ·5 , 49 = 7·7 , and 57 = 3·19
each have a prime factor that is not congruent to 1 mod 4 .
More generally if we ask which numbers can be expressed as p 2 + q2 for integers
p and q having no common divisor, without requiring them to have opposite parity,
then we will also get the numbers c in the starred entries of the earlier table. As we
saw in the proof of the proposition about Pythagorean triples, these values of c are
just the doubles of the values of c in primitive Pythagorean triples. Thus one can
conjecture that the numbers expressible as p 2 + q2 for positive integers p and q
having no common divisor are the products of primes congruent to 1 mod 4 and the
8 Chapter 0 — A Preview
doubles of these products. This conjecture is correct, but proving it is not easy. We
will do this in Chapter 6.
After this it is easy to go the last step and ask which numbers are sums p 2 + q2
for arbitrary positive integers p and q . Now we are free to multiply p and q by the
same positive integer k , which multiplies p 2 + q2 by k2 . This leads to the answer
that the numbers expressible as p 2 + q2 , besides 0 and 1 , are all the numbers n
for which each prime factor congruent to 3 mod 4 occurs to an even power in the
prime factorization of n . Thus the sequence of numbers that are sums of two squares
begins 0, 1, 2, 4, 5, 8, 9, 10, 13, 16, 17, 18, 20, 25, 26, 29, 32, 34, 36, 37, 40, · · ·.
Another question one can ask about Pythagorean triples is how many there are
with two of the three numbers differing only by 1 . In the earlier table there are
several: (3, 4, 5) , (5, 12, 13) , (7, 24, 25) , (20, 21, 29) , (9, 40, 41) , (11, 60, 61) , and
(13, 84, 85) . As the pairs of numbers that differ by 1 get larger, the corresponding
right triangles are either approximately 45-45-90 right triangles as with the triple
(20, 21, 29) , or long thin triangles as with (13, 84, 85) . To analyze the possibilities,
note first that if two of the numbers in a triple (a, b, c) differ by 1 then the triple
has to be primitive, so we can use our formula (a, b, c) = (2pq, p 2 − q2 , p 2 + q2 ) .
If b and c differ by 1 then we would have (p 2 + q2 ) − (p 2 − q2 ) = 2q2 = 1 which
is impossible. If a and c differ by 1 then we have p 2 + q2 − 2pq = (p − q)2 = 1
so p − q = ±1 , and in fact p − q = +1 since we must have p > q in order for
b = p 2 − q2 to be positive. Thus we get the infinite sequence of solutions (p, q) =
(2, 1), (3, 2), (4, 3), · · · with corresponding triples (4, 3, 5), (12, 5, 13), (24, 7, 25), · · ·.
Note that these are the same triples we obtained earlier that realize all the odd values
b = 3, 5, 7, · · ·.
The remaining case is that a and b differ by 1 . Thus we have the equation
p 2 − 2pq − q2 = ±1 . The left side does not factor using integer coefficients, so it is
not so easy to find integer solutions this time. In the table there are only the two triples
(4, 3, 5) and (20, 21, 29) , with (p, q) = (2, 1) and (5, 2) . After some trial and error one
could find the next solution (p, q) = (12, 5) which gives the triple (120, 119, 169) . Is
there a pattern in the solutions (2, 1), (5, 2), (12, 5) ? One has the numbers 1, 2, 5, 12 ,
and perhaps it is not too great a leap to notice that the third number is twice the second
plus the first, while the fourth number is twice the third plus the second. If this pattern
continued, the next number would be 29 = 2·12+5 , giving (p, q) = (29, 12) , and this
does indeed satisfy p 2 −2pq −q2 = 1 , yielding the Pythagorean triple (696, 697, 985) .
These numbers are increasing rather rapidly, and the next case (p, q) = (70, 29) yields
an even bigger Pythagorean triple (4060, 4059, 5741) . Could there be other solutions
of p 2 − 2pq − q2 = ±1 with smaller numbers that we missed? We will develop tools in
Chapters 4 and 5 to find all the integer solutions, and it will turn out that the sequence
we have just discovered gives them all.
Chapter 0 — A Preview 9
Although the quadratic form p 2 − 2pq − q2 does not factor using integer coeffi-
cients, it can be simplified slightly be rewriting it as (p − q)2 − 2q2 . Then if we change
variables by setting (x, y) = (p − q, q) we obtain the quadratic form x 2 − 2y 2 . Find-
ing integer solutions of x 2 − 2y 2 = n is equivalent to finding integer solutions of
p 2 − 2pq − q2 = n since integer values of p and q give integer values of x and y ,
and conversely, integer values of x and y give integer values of p and q since when
we solve for p and q in terms of x and y we again get equations with integer coef-
ficients: (p, q) = (x + y, y) . Thus the quadratic forms p 2 − 2pq − q2 and x 2 − 2y 2
are completely equivalent, and finding integer solutions of p 2 − 2pq − q2 = ±1 is
equivalent to finding integer solutions of x 2 − 2y 2 = ±1 .
The equation x 2 − 2y 2 = ±1 is an instance of the equation x 2 − Dy 2 = ±1 which
is known as Pell’s equation (although sometimes this term is used only when the right
side of the equation is +1 and the other case is called the negative Pell equation).
This is a very famous equation in number theory which has arisen in many different
contexts going back hundreds of years. We will develop techniques for finding all
integer solutions of Pell’s equation for arbitrary values of D in Chapters 4 and 5. It
is interesting that certain fairly small values of D can force the solutions to be quite
large. For example for D = 61 the smallest positive integer solution of x 2 − 61y 2 = 1
is the rather large pair
As far back as the eleventh and twelfth centuries mathematicians in India knew how to
find this solution. It was rediscovered in the seventeenth century by Fermat in France,
who also gave the smallest solution of x 2 − 109y 2 = 1 , the even larger pair
The way that the size of the smallest solution of x 2 − Dy 2 = 1 depends upon D is
very erratic and is still not well understood today.
was obtained by simply squaring the equation (p + qi)(p − qi) = c . Let us see what
happens when we multiply these various products out:
a + bi = (p + qi)2 = (p 2 − q2 ) + (2pq)i
hence a = p 2 − q2 and b = 2pq
a − bi = (p − qi)2 = (p 2 − q2 ) − (2pq)i
hence again a = p 2 − q2 and b = 2pq
c = (p + qi)(p − qi) = p 2 + q2
Thus we have miraculously recovered the formulas for Pythagorean triples that we
obtained earlier by geometric means (with a and b switched, which does not really
matter):
a = p 2 − q2 b = 2pq c = p 2 + q2
Of course, our derivation of these formulas just now depended on several assumptions
that we have not justified, but it does suggest that looking at complex numbers of the
form a+bi where a and b are integers might be a good idea. These complex numbers
a+bi with a and b integers are called Gaussian integers, after the first mathematician
to make a thorough algebraic study of them, C. F. Gauss, some 200 years ago. We will
develop the basic properties of Gaussian integers in Chapter 8, in particular explaining
why the derivation of the formulas above is valid.
be rational. Then the equation y − 1 = m(x − 1) implies that y will also be rational,
and hence we obtain a rational point (x, y) on the curve for each rational value of
m . Conversely, if x and y are both rational then obviously m = y ---1/x ---1 will be
rational. Thus one obtains a dense set of rational points on the circle x 2 + y 2 = 2 ,
since the slope m can be any rational number. An exercise at the end of the chapter
is to work out the formulas explicitly.
Note that the point (1, −1) is a rational point on the circle which does not arise
from the formulas parametrizing x and y in terms of m since it corresponds to
m = ∞ . This is analogous to the earlier case of the circle x 2 + y 2 = 1 where the
point (0, −1) corresponded to m = ∞ and r = 0 . For the circle x 2 + y 2 = 2 we
could just as well use the parameter r instead of m , with (r , 0) the point where the
line through (1, 1) intersects the x- axis. There are simple formulas relating r and
m , namely r = m ---1/m and m = 1/1--- r . From this viewpoint the exceptional slope
m = ∞ corresponds to r = 1 which is not exceptional for the parametrization by r ,
while the exceptional value r = ∞ corresponds to the nonexceptional value m = 0
when the line through (1, 1) is parallel to the x- axis.
If we consider the circle x 2 + y 2 = 3 instead of x 2 + y 2 = 2 then there are no
obvious rational points. And in fact this circle contains no rational points at all. For if
there were a rational point, this would yield a solution of the equation a2 + b2 = 3c 2
by integers a , b , and c with c ≠ 0 . We can assume a , b , and c have no common
factor. Then a and b cannot both be even, otherwise the left side of the equation
would be even, forcing c to be even, so a , b , and c would have a common factor
of 2 . To complete the argument we look at the equation modulo 4 . As we saw earlier,
the square of an even number is 0 mod 4 , while the square of an odd number is 1
mod 4 . Thus, modulo 4 , the left side of the equation is either 0 + 1 , 1 + 0 , or 1 + 1
since a and b are not both even. So the left side is either 1 or 2 mod 4 . However,
the right side is either 3·0 or 3·1 mod 4 . We conclude that there can be no integer
solutions of a2 + b2 = 3c 2 with c ≠ 0 . When c = 0 there is of course the trivial
solution (a, b, c) = (0, 0, 0) but this is not interesting so we will generally disregard
it in equations of this type.
The technique we just used to show that a2 + b2 = 3c 2 has no nontrivial integer
solutions can be used in many other situations as well. The underlying reasoning is
that if an equation with integer coefficients has an integer solution, then this gives
a solution modulo n for all numbers n . For solutions modulo n there are only a
finite number of possibilities to check, although for large n this is a large finite num-
ber. If one can find a single value of n for which there is no solution modulo n ,
then the original equation has no integer solutions. However, this implication is not
reversible, as it is possible for an equation to have solutions modulo n for every num-
ber n and still have no actual integer solutions. A concrete example is the equation
2x 2 + 7y 2 = 1 . This obviously has no integer solutions, yet it does have solutions
12 Chapter 0 — A Preview
modulo n for each n , although this is certainly not obvious. Note that the ellipse
2x 2 + 7y 2 = 1 does contain rational points such as 1/3, 1/3 and 3/5, 1/5 . These can
in fact be used to show that 2x 2 + 7y 2 = 1 has solutions modulo n for each n , as
we will show in Section 2.3 of Chapter 2 when we study congruences in more detail.
In Chapter 6 we will find a complete answer to the question of when the circle
x + y 2 = n contains rational points by showing that there are rational points on this
2
circle only when there are integer points on it. This reduces the problem to one we
considered earlier, finding the integers n that are sums of two squares.
Determining when a quadratic curve contains rational points turns out to be much
easier than determining when it has integer points. The general problem reduces
fairly quickly to finding rational points on ellipses or hyperbolas of the special form
Ax 2 + By 2 = C where A , B , and C are integers that are not divisible by squares
greater than 1 , and such that no two of A , B , and C have a common factor. A
theorem of Legendre then asserts that the curve Ax 2 + By 2 = C contains rational
points exactly when three congruence conditions modulo A , B , and C are satisfied,
namely AC must be congruent mod B to the square of some number, and likewise BC
must be a square mod A and −AB must be a square mod C . (There is also the obvious
condition that A and B cannot both have opposite sign from C .) For example if C = 1
this reduces just to saying that each of A and B is congruent to a square modulo the
other one since the congruence condition mod C holds automatically when C = 1 .
For the ellipse 2x 2 + 7y 2 = 1 this agrees with what we saw earlier since 2 is a square
mod 7 , namely 32 , and 7 is a square mod 2 , namely 12 , so Legendre’s theorem
guarantees that the curve has a rational point. In the case of the circle x 2 + y 2 = 3
the congruence conditions reduce simply to −1 being a square mod 3 , which it is not
since every number is congruent to 0 , 1 , or 2 mod 3 so the squares mod 3 are just
0 and 1 since 22 ≡ 1 mod 3 .
Diophantine Equations
Equations like x 2 + y 2 = z 2 or x 2 − Dy 2 = 1 that involve polynomials with
integer coefficients, and where the solutions sought are required to be integers, or
perhaps just rationals, are called Diophantine equations after the Greek mathemati-
cian Diophantus (ca. 250 A.D.) who wrote a book about these equations that was very
influential when European mathematicians started to consider this topic much later
in the 1600s. Usually Diophantine equations are very hard to solve because of the
restriction to integer solutions. The first really interesting case is quadratic Diophan-
tine equations. By the year 1800 there was quite a lot known about the quadratic case,
and we will be focusing on this case in this book.
Diophantine equations of higher degree than quadratic are much more challeng-
Chapter 0 — A Preview 13
Fermat’s Last Theorem is equivalent to the statement that these curves have no ra-
tional points except their intersections with the coordinate axes, where x or y is 0 .
These examples show that it is possible for a curve defined by an equation of degree
greater than 2 to contain only a finite number of rational points (either two points or
four points here, depending on whether n is odd or even) whereas quadratic curves
like x 2 + y 2 = n contain either no rational points or an infinite dense set of rational
points.
After quadratic curves the next case that has been studied in great depth is cubic
curves such as the curves defined by equations y 2 = x 3 + ax 2 + bx + c . These are
known as elliptic curves, not because they are ellipses but because of a connection
with the problem of computing the length of an arc of an ellipse. Depending on the
14 Chapter 0 — A Preview
values of the coefficients a, b, c elliptic curves can have either one or two connected
pieces as in the figures below:
In some cases the number of rational points is finite, any number from 0 to 10 as
well as 12 or 16 according to a difficult theorem of Mazur. In other cases the number
of rational points is infinite and they form a dense set in the curve, or possibly just in
the component that stretches to infinity when there are two components. There is no
simple way known for predicting the number of rational points from the coefficients.
Interestingly, elliptic curves play an important role in the proof of Fermat’s Last The-
orem. Their theory is much deeper than for quadratic curves, and so elliptic curves
are well beyond the scope of this book.
Although we will not be discussing this later in the book, another way to gen-
eralize quadratic curves, in a different direction from considering cubic and higher
degree curves, is to keep the quadratic condition but introduce more variables. After
quadratic curves the next case would be quadratic surfaces, or as they are usually
called, quadric surfaces. These are surfaces in three-dimensional space defined by an
equation Q(x, y, z) = n where Q(x, y, z) is a quadratic function of three variables.
Perhaps the simplest example is the equation x 2 + y 2 + z 2 = 1 which defines the
sphere of radius 1 with center at the origin. Other quadric surfaces are ellipsoids,
paraboloids, hyperboloids, and certain cones and cylinders.
Much of the theory of quadric surfaces parallels that for quadratic curves. To
illustrate, let us consider the problem of finding all the rational points on the sphere
x 2 + y 2 + z 2 = 1 , the triples (x, y, z) of rational numbers that satisfy this equation.
Some obvious rational points are the points where the sphere meets the coordinate
axes such as the point (0, 0, 1) on the z- axis. Following what we did for the circle
x 2 +y 2 = 1 , consider a line from (0, 0, 1) to a point (u, v, 0) in the xy- plane. This line
intersects the sphere at some point (x, y, z) , and we want to find formulas expressing
x , y , and z in terms of u and v . To do this we use the following figure:
Chapter 0 — A Preview 15
Suppose we look at the vertical plane containing the triangle ONQ . From our earlier
analysis of rational points on a circle of radius 1 we know that if the segment OQ has
2
length |OQ| = r , then |OP ′ | = 2r/r 2 + 1 and z = r ---1/r 2 + 1 . From the right triangle
OBQ we see that u2 + v 2 = r 2 . The triangle OBQ is similar to the triangle OAP ′ and
the scaling factor to go from OBQ to OAP ′ is
|OP ′ | 2r /(r 2 + 1) 2
= = 2
|OQ| r r +1
Hence
2 2u 2 2v
x= ·u = 2 and y= ·v = 2
r2 +1 u + v2 + 1 r2 +1 u + v2 + 1
Also we have
r2 − 1 u2 + v 2 − 1
z= 2 = 2
r +1 u + v2 + 1
Summarizing, we have expressed x , y , and z in terms of u and v by the formulas
2u 2v u2 + v 2 − 1
x= y= z=
u + v2 + 1
2 u + v2 + 1
2 u2 + v 2 + 1
We can also express u and v in terms of x , y , and z . The projection of the point P =
(x, y, z) onto the xz- plane is the point (x, 0, z) which is on the line through B and N .
The slope of this line is − 1/u so the equation for the line is z = 1 − x/u . Solving this
for u gives u = x/1--- z . Interchanging x and y corresponds to interchanging u and
v so we also have v = y/1--- z .
From the formulas relating (x, y, z) to (u, v) we see that x , y , and z are rational
exactly when u and v are rational. Thus we have formulas for all the rational points
(x, y, z) on the sphere except for the pole (0, 0, 1) in terms of rational parameters u
and v .
16 Chapter 0 — A Preview
Here is a short table giving a few rational points on the sphere and the corre-
sponding integer solutions of the equation a2 + b2 + c 2 = d2 :
cannot be expressed as sums of three squares by the following argument. The squares
mod 8 are 02 = 0 , (±1)2 = 1 , (±2)2 = 4 , (±3)2 = 9 ≡ 1 , and 42 = 16 ≡ 0 , so the
squares of even numbers are 0 or 4 mod 8 and the squares of odd numbers are 1
mod 8 . Obviously 7 cannot be realized as a sum of three terms 0 , 1 , or 4 , so numbers
congruent to 7 mod 8 cannot be sums of three squares.
To rule out numbers 4(8k+7) as sums of three squares we can work mod 4 where
the squares are just 0 and 1 . If we have x 2 + y 2 + z 2 = 4n then x 2 + y 2 + z 2 ≡ 0
mod 4 , and the only way to get 0 as a sum of three numbers 0 or 1 is as 0 + 0 + 0 .
This means each of x , y , and z must be even, so we can cancel a 4 from both sides
of the equation x 2 + y 2 + z 2 = 4n to get n expressed as a sum of three squares.
Thus numbers 4(8k + 7) are never realizable as sums of three squares since 8k + 7
is never a sum of three squares. Repeating this argument, we see that 16(8k + 7) is
never a sum of three squares since 4(8k + 7) is not a sum of three squares. Similarly
4l (8k + 7) is never a sum of three squares for any larger exponent l .
The converse statement that every number not of the form 4l (8k + 7) is express-
ible as a sum of three squares is true but is much harder to prove. This was first done
by Legendre.
This answers the question of when the sphere x 2 + y 2 + z 2 = n contains integer
points, but could it contain rational points without containing integer points? Let us
show that this cannot happen. A rational point on x 2 + y 2 + z 2 = n is equivalent to
an integer solution of a2 + b2 + c 2 = nd2 . It will suffice to show that if n is not a
sum of three squares then neither is nd2 for any integer d . An equivalent statement
is that if n is of the form 4l (8k + 7) then so is nd2 . To prove this, let us write d
as 2p q with q odd and p ≥ 0 , hence d2 = 4p q2 with q2 ≡ 1 mod 8 since q is odd.
Thus we have nd2 = 4l+p (8k + 7)q2 where the product (8k + 7)q2 is 7 mod 8 since
8k + 7 is 7 mod 8 and q2 is 1 mod 8 . This shows what we wanted, that if n is of
the form 4l (8k + 7) then so is nd2 .
For a general quadric surface defined by a quadratic equation with integer coef-
ficients there is a theorem due to Minkowski, analogous to Legendre’s theorem for
quadratic curves, that says that rational points exist exactly when certain congruence
conditions are satisfied. In general, having rational points on a quadric surface is not
equivalent to having integer points as it was for spheres, and the existence of integer
points is a more delicate question.
Moving on to four variables, one could ask about integer or rational points on the
spheres x 2 + y 2 + z 2 + w 2 = n in four-dimensional space. Integers that could not
be expressed as the sum of three squares can be realized as sums of four squares,
for example 7 = 22 + 12 + 12 + 12 and 15 = 32 + 22 + 12 + 12 , and it is a theorem
of Lagrange that every positive number can be expressed as the sum of four squares.
Thus the spheres x 2 + y 2 + z 2 + w 2 = n always contain integer points.
Minkowski’s theorem remains true for quadratic equations with integer coeffi-
18 Chapter 0 — A Preview
cients in any number of variables, as does the fact that the existence of a single rational
solution implies that rational solutions are dense.
Exercises
1. (a) Make a list of the 16 primitive Pythagorean triples (a, b, c) with c ≤ 100 ,
regarding (a, b, c) and (b, a, c) as the same triple.
(b) How many more would there be if we allowed nonprimitive triples?
(c) How many triples (primitive or not) are there with c = 65 ?
3. (a) Show that there are only a finite number of Pythagorean triples (a, b, c) with a
equal to a given number n .
(b) Show that there are only a finite number of Pythagorean triples (a, b, c) with c
equal to a given number n .
4. Find an infinite sequence of primitive Pythagorean triples where two of the numbers
in each triple differ by 2 .
5. Find a right triangle whose sides have integer lengths and whose acute angles are
close to 30 and 60 degrees by first finding the irrational value of r that corresponds to
a right triangle with acute angles exactly 30 and 60 degrees, then choosing a rational
number close to this irrational value of r .
6. Find a right triangle whose sides have integer lengths and where one of the two
shorter sides is approximately twice as long as the other, using a method like the one
in the preceding problem. (One possible answer might be the (8, 15, 17) triangle, or
a triangle similar to this, but you should do better than this.)
8. (a) Derive formulas that give all the rational points on the circle x 2 + y 2 = 2 in
terms of a rational parameter m , the slope of the line through the point (1, 1) on the
circle. (The value m = ∞ should be allowed as well, yielding the point (1, −1) .) The
calculations may be a little messy, but they eventually simplify to give formulas that
are not too complicated:
m2 − 2m − 1 −m2 − 2m + 1
x= y=
m2 + 1 m2 + 1
Chapter 0 — A Preview 19
(b) Using these formulas, find five different rational points on the circle in the first
quadrant, and hence five solutions of a2 + b2 = 2c 2 with positive integers a , b , c .
(c) The equation a2 + b2 = 2c 2 can be rewritten as c 2 = 1/2 a2 + b2 , which says that
c 2 is the average of a2 and b2 , or in other words, the squares a2 , c 2 , b2 form an
arithmetic progression. One can assume a < b by switching a and b if necessary.
Find four such arithmetic progressions of three increasing squares where in each case
the three numbers have no common divisors.
9. (a) Find formulas that give all the rational points on the upper branch of the hyper-
bola y 2 − x 2 = 1 .
(b) Can you find any relationship between these rational points and Pythagorean
triples?
10. (a) Show that the equation x 2 − 2y 2 = ±3 has no integer solutions by considering
this equation modulo 8 .
(b) Show that there are no primitive Pythagorean triples (a, b, c) with a and b differ-
ing by 3 .
11. Show there are no rational points on the circle x 2 + y 2 = 3 using congruences
modulo 3 instead of modulo 4 .
12. Show that for every Pythagorean triple (a, b, c) the product abc must be divisible
by 60 . (It suffices to show that abc is divisible by 3 , 4 , and 5 .)
13. Using congruences modulo 8 show that primitive solutions of a2 + b2 + c 2 = d2
must have d odd and must have two of a, b, c even and the other odd.
14. Show that if the curve x n + y n = 1 has a rational point with x and y nonzero,
then it has a rational point with x and y positive. (Hint: Consider the equation
an + bn = c n .)
Our goal is to use geometry to study numbers. Of the various kinds of numbers,
the simplest are integers, along with their ratios, the rational numbers. Usually one
thinks of rational numbers geometrically as points along a line, interspersed with
irrational numbers as well. In this chapter we introduce a two-dimensional pictorial
representation of rational numbers that displays certain interesting relations between
them that we will be exploring. This diagram, along with several variants of it that
will be introduced later, is known as the Farey diagram. The origin of the name will
be explained when we get to one of these variants.
Here is what the Farey diagram looks like:
What is shown here is not the whole diagram but only a finite part of it. The actual
diagram has infinitely many curvilinear triangles, getting smaller and smaller out near
Section 1.1 — The Mediant Rule 21
the boundary circle. The diagram can be constructed by first inscribing the two big
triangles in the circle, then adding the four triangles that share an edge with the two
big triangles, then the eight triangles sharing an edge with these four, then sixteen
more triangles, and so on forever. With a little practice one can draw the diagram
without lifting one’s pencil from the paper: First draw the outer circle starting at the
left or right side, then the diameter, then make the two large triangles, then the four
next-largest triangles, etc.
Our first task will be to explain how the vertices of all the triangles are labeled
with rational numbers. Perhaps the reader can guess what the rules are before we
spell them out in detail.
There is another version of the Farey diagram with the boundary circle straight-
ened out to a line:
Here the diagram fills up the upper half of the xy- plane, with the vertex 1/0 of the
original Farey diagram positioned “at infinity” so it is not actually shown in the new
version. The edges of the diagram with one endpoint at 1/0 are drawn as vertical lines
with lower endpoints at the integer points on the x- axis. All the other edges of the
diagram are semicircles with endpoints on the x- axis, and we can position these so
that the vertex labeled a/b is actually the number a/b on the x- axis. This is possible
since when we construct the diagram by adding more and more curvilinear triangles,
we can place the new vertex of each triangle at any point between its outer two vertices,
so we just choose this new vertex to be at the mediant of the outer two vertices.
In the previous chapter we described how rational points (x, y) on the unit cir-
cle x 2 + y 2 = 1 correspond to rational points p/q on the x- axis by means of lines
through the point (0, 1) on the circle. Using this correspondence, we can label the
rational points on the circle by the corresponding rational points on the x- axis and
then construct a new Farey diagram in the circle by filling in triangles by the mediant
rule just as before.
This gives a version of the circular Farey diagram that is rotated by 90 degrees to put
1/ at the top of the circle, and there are also some perturbations of the positions of the
0
other vertices and the shapes of the triangles. For our purposes these perturbations
Section 1.1 — The Mediant Rule 23
will not make much of a difference since it will usually be just the combinatorial
pattern of the triangles that is important. We drew the circular Farey diagram the way
we did at the beginning of the chapter because it looks more symmetric and is easier
to draw since one does not have to figure out the exact positions of the vertices.
The next figure shows the relationship between the new circular Farey diagram
and Pythagorean triples (a, b, c) using the formulas (a, b, c) = (2pq, p 2 − q2 , p 2 + q2 )
p
that we found in the previous
chapter. The vertex with label /q thus has coordinates
2 2
(x, y) = a/c , b/c = 2pq/p 2 + q 2 , p --- q /p 2 + q 2 .
The construction we have described for the Farey diagram involves an inductive
process where more and more edges and vertex labels are added in succession. With
a construction like this it is not easy to tell by a simple calculation whether or not two
given rational numbers a/b and c/d are joined by an edge in the diagram. Fortunately
there is such a criterion:
Proposition 1.1. For each pair of fractions a/b and c/d , including ±1/0 , there exists
an edge in the Farey diagram with endpoints
labeled a/b and c/d if and only if the
determinant ad − bc of the matrix a c
b d is equal to ±1 .
What this means is that if one starts with the rational numbers together with
±1/ arranged in order around a circle and one inserts circular arcs inside this cir-
0
cle meeting it perpendicularly and joining each pair of fractions a/b and c/d such
24 Chapter 1 — The Farey Diagram
that ad − bc = ±1 , with the circular arc replaced by a diameter in case a/b and
c/ are diametrically opposite on the circle, then no two of these arcs will cross,
d
and they will divide the interior of the cir-
cle into non-overlapping curvilinear tri-
angles. This is really quite remarkable
when you think about it, and it does not
happen for other values of the determi-
nant besides ±1 . For example, for deter-
minant ±2 the edges would be the dotted
arcs in the figure at the right. Here there
are three arcs crossing in each triangle of
the original Farey diagram, and these arcs
divide each triangle of the Farey diagram
into six smaller triangles.
The sign of the determinant ad − bc has a simple interpretation for fractions a/b
and c/d with positive denominators since in this case the inequality ad − bc > 0 is
equivalent to a/b > c/d and ad − bc < 0 is equivalent to a/b < c/d . Thus the sign of
the determinant tells which of a/b or c/d is larger.
Corollary 1.2. The mediant rule for labeling the vertices in the Farey diagram
always produces labels a/b that are fractions in lowest terms.
This would follow automatically if it was always true that the mediant of two
fractions in lowest terms is again in lowest terms, but this is not always the case. For
26 Chapter 1 — The Farey Diagram
example, the mediant of 1/3 and 2/3 is 3/6 , and the mediant of 2/7 and 3/8 is 5/15 .
Somehow cases like this do not occur in the Farey diagram.
Before deducing the corollary let us introduce a bit of standard terminology. For a
fraction a/b to be in lowest terms means that a and b have no common factor greater
than 1 . This is equivalent to saying that the prime factorizations of a and b have no
prime factor in common. When this is the case we say that a and b are coprime. An
alternative terminology is to say that a and b are relatively prime.
Proof: From the way the Farey diagram is constructed, each labeled vertex a/b is
joined to some other labeled vertex c/d by an edge of the diagram. By the easier half
of the preceding proposition we have ad − bc = ±1 . This implies that a and b are
coprime since any common divisor of a and b must divide the products ad and bc ,
hence also the difference ad − bc = ±1 , but the only divisors of ±1 are ±1 . ⊓
⊔
The preceding proposition can also be used to prove another basic fact about the
Farey diagram:
Proposition 1.3. Every fraction p/q in lowest terms occurs as the label on some
vertex in the Farey diagram.
Proof: We may assume p and q are nonzero since 0/1 and 1/0 certainly occur as labels
in the diagram. Since the negative labels in the diagram are just the negatives of the
positive labels, we can assume p and q are in fact positive. It will suffice to show
that if p and q are coprime then there is an edge in the diagram whose endpoints are
labeled p/q and r/s for some integers r and s . By Proposition 1.1 this is equivalent
to the existence of integers
r and s such that ps − qr = ±1 .
xy
Consider a matrix p q where the integers x and y are yet to be determined.
In the proof of Proposition 1.1 there was a procedure for repeatedly subtracting the
column with smaller second entry from the column with larger second entry until a
matrix with equal second entries is obtained. Subtracting one column from the other
does not affect the coprimeness
of the two second entries, so when the procedure
xy
is applied to the matrix p q to produce a matrix with equal second entries, these
entries must be 1 . If we choose
a matrix of determinant ±1 whose lower two en-
1 0
tries are 1 , say thematrix 1 1 , and then we reverse the sequence of operations
xy
performed on p q to get 1 ’s in the second row,the resulting sequence
of opera-
1 0 r s
tions of adding one column to the other converts 1 1 into a matrix p q of the
same determinant ±1 . Thus we have integers r and s such that r q − ps = ±1 , or
equivalently ps − qr = ±1 . ⊓
⊔
Implicit in this proof is a method for solving Diophantine equations of the form
px − qy = ±1 for any two given coprime positive integers p and q . In Section 2.3
of the next chapter we will make this procedure explicit and streamline it to be more
efficient.
Section 1.2 — Farey Series 27
Exercises
1. There is another version of the Farey diagram in which the vertex labeled p/q is
placed at the point (q, p) in the plane, so p/q is the slope of the line through the
origin and (q, p) . The edges of this new Farey diagram are straight line segments
connecting the pairs of vertices that are connected in the original Farey diagram. For
example there is a triangle with vertices (1, 0) , (0, 1) , and (1, 1) corresponding to the
big triangle in the upper half of the circular Farey diagram. With this model of the
Farey diagram the operation of forming the mediant of two fractions just corresponds
to standard vector addition (a, b) + (c, d) = (a + c, b + d) .
What you are asked to do in this problem is just to draw the portion of the new
Farey diagram consisting of all the triangles whose vertices (q, p) satisfy 0 ≤ q ≤ 5
and 0 ≤ p ≤ 5 . Note that since fractions p/q labeling vertices are always in lowest
terms, the points (q, p) such that q and p have a common divisor greater than 1 are
not vertices of the diagram.
2. Consider a vertex of the Farey diagram labeled a/b with b > 1 . Show that of all
the labels on vertices connected to the a/b vertex by an edge of the diagram, exactly
two have denominator smaller than b .
3. If a/b , c/d , and e/f are fractions in lowest terms such that e/f is the mediant of
a/ and c/ , is it necessarily true that there is a triangle in the Farey diagram with
b d
vertices a/b , c/d , and e/f ? Give either a proof or a counterexample.
7 3 67 14 1 0 0 1
4. (a) Reduce each of the matrices 16 7 and 24 5 to either 0 1 or 1 0 by
repeatedly subtracting one column from the other as in the proof of Proposition
1.1.
a c
(b) Use Proposition 1.1 to show that this can be done for any matrix b d with non-
negative entries and determinant ±1 .
This process has an interesting property that is really quite surprising when one
first sees it:
Each time a new number is inserted, it forms the third vertex of a triangle whose
other two vertices are its two nearest neighbors among the numbers already listed,
and if these two neighbors are a/b and c/d then the new vertex is exactly the
mediant a + c/b + d .
The discovery of this curious phenomenon in the early 1800s was initially attributed
to a geologist and amateur mathematician named Farey, although it turned out that
he was not the first person to have noticed it. In spite of this confusion, the sequence
of fractions a/b between 0 and 1 with denominator less than or equal to a given
number n is usually called the n th Farey series Fn . For example, here is F7 :
0 1 1 1 1 2 1 2 3 1 4 3 2 5 3 4 5 6 1
1 7 6 5 4 7 3 5 7 2 7 5 3 7 4 5 6 7 1
These numbers trace out the up-and-down path across the bottom of the figure above.
For the next Farey series F8 we would insert 1/8 between 0/1 and 1/7 , 3/8 between 1/3
and 2/5 , 5/8 between 3/5 and 2/3 , and finally 7/8 between 6/7 and 1/1 .
There is a cleaner way to draw the preceding diagram using straight lines in
a square, as shown in the figure at the
right. One can construct this diagram in
stages, as indicated in the sequence of fig-
ures below. Start with a square together
with its diagonals and a vertical line from
their intersection point down to the bot-
tom edge of the square. Next, connect
the resulting midpoint of the lower edge
of the square to the two upper corners of
the square and drop vertical lines down
from the two new intersection points this
produces. Now add a W-shaped zigzag
and drop verticals again. It should then
be clear how to continue.
A nice feature of this construction is that if we start with a square whose sides
have length 1 and place this square so that its bottom edge lies along the x- axis with
Section 1.2 — Farey Series 29
the lower left corner of the square at the origin, then the construction assigns labels
to the vertices along the bottom edge of the square that are exactly the x- coordinates
of these points. Thus the vertex labeled 1/2 really is at the midpoint of the bottom
edge of the square, and the vertices labeled 1/3 and 2/3 really are 1/3 and 2/3 of the
way along this edge, and so forth. In order to verify this fact the key observation
is the following: For a vertical line segment in the diagram whose lower endpoint is
at the point a/b , 0 on the x- axis, the upper end-
point is at the point a/b , 1/b . This is obviously
true at the first stage of the construction, and it con-
tinues to hold at each successive stage since for a
quadrilateral whose four vertices have coordinates
as shown in the figure at the right, the two diago-
nals intersect at the point a + c/b + d , 1/b + d . For
example, to verify that a + c/b + d , 1/b + d is on the
upward diagonal line from a/b , 0 to c/d , 1/d it
suffices to show that the line segments from a/b , 0 to a + c/b + d , 1/b + d and from
a + c/ 1 c 1
b + d , /b + d to /d , /d have the same slope. These slopes are
1/ b b
b+d
a + c/ a = =
b + d − /b b(a + c) − a(b + d) bc − ad
1/ 1
d − /b + d b+d−d b
and c/ − a + c/ = =
d b+d c(b + d) − d(a + c) bc − ad
so they are equal. The same argument works for the other diagonal by interchanging
a/ and c/ . Note that the denominator bc − ad in the slope formulas above is ±1
b d
since /b and c/d are the endpoints of an edge of the Farey diagram. Thus each
a
diagonal line in the square Farey diagram has integer slope, and this integer is, up to
sign, the denominator of the rational number where the line meets the x- axis.
Going back to the square diagram, this fact that we have just shown implies that
the successive Farey series can be obtained by taking the vertices that lie above the
line y = 1/2 , then the vertices above y = 1/3 , then above y = 1/4 , and so on.
We can form a linear version of the full Farey diagram by placing copies of the
square side by side along the x- axis:
30 Chapter 1 — The Farey Diagram
Here the vertical segments in the horizontal strip are not part of the resulting Farey
diagram, which consists just of the triangles with nonvertical edges, along with the
infinite “triangles” above the strip with a vertex at 1/0 . The original halfplane Farey
diagram can be obtained from this linear Farey diagram by shrinking each vertical
segment in the horizontal strip down to its lower endpoint while bending each straight
edge of a triangle into a semicircle with endpoints on the x- axis.
Another version of the Farey diagram can be constructed from an array of circles
in the upper halfplane tangent to the x- axis and to each other as in the following
figure:
This arrangement of tangent circles can be built in stages, starting with circles of
diameter 1 tangent to the x- axis at the integer points. At the next stage a smaller
circle is inserted in each gap between adjacent pairs of circles from the first stage.
This creates new gaps and one then puts a still smaller circle in each of these gaps.
The process can then be repeated indefinitely all along the x- axis.
If we connect the centers of each pair of tangent circles by a line segment passing
through the point of tangency we obtain a pattern of triangles that is combinatorially
equivalent to the pattern of triangles in the linear Farey diagram, but compressed
closer to the x- axis. The vertices of these triangles are the centers of the various
tangent circles, and we can label these centers by rational numbers, starting with an
integer label n/1 at the center of the large circle tangent to the x- axis at the point n ,
and then labeling all the other centers by applying the mediant rule repeatedly.
The surprising thing about this construction is that the circle whose center is
labeled a/b is tangent to the x- axis at exactly the point a/b on the x- axis. This can
be verified as follows. For an edge of the Farey diagram with endpoints labeled a/b and
c/ let us draw two circles tangent to each other and
d
tangent to the x- axis at the points a/b and c/d . Let
the radii of these two circles be r and s respectively.
Note that r and s are not uniquely determined by
a/ and c/ , and in fact we can choose r arbitrarily
b d
and then this determines s , with s becoming small
as r becomes large and vice versa. We can find a
Section 1.2 — Farey Series 31
formula for how r and s are related by applying the Pythagorean theorem to the
right triangle shown in the figure. The horizontal side of this triangle has length
c/ − a/ and the vertical side has length r − s . The condition for the two circles
d b
to be tangent is that the hypotenuse of the triangle has length r + s . Thus we obtain
the equation
2
2 c a
(r − s) + − = (r + s)2
d b
which simplifies to
2
bc − ad
= 4r s
bd
Since we assumed the fractions a/b and c/d were the endpoints of an edge in the
Farey diagram we have ad − bc = ±1 , so the preceding equation simplifies further
1 2
to bd = 4r s . The easiest way to assure that this holds is to let r = 1/2b 2 and
s = 1/2d 2 , so that r depends only on a/b and s depends only on c/d . Thus we
are choosing the diameter of each circle to be the reciprocal of the square of the
denominator of the fraction where the circle is tangent to the x- axis. This is consistent
with how we chose the initial large circles tangent to the x- axis at integer points.
Then when we build the Farey diagram inductively by adding more and more vertices
labeled according to the mediant rule, each new vertex labeled a + c/b + d between
vertices labeled a/b and c/d is the center of a circle of diameter 1/(b + d) 2 tangent to
the x- axis at a + c/b + d and tangent to each of the two circles labeled a/b and c/d of
diameters 1/b 2 and 1/d 2 that are tangent to the x- axis at a/b and c/d .
The circles tangent to the x- axis constructed in this way are called Ford circles
after their discoverer L. R. Ford. From the formula for their diameters we see that the
Ford circles whose diameter is greater than a fixed number are just the ones associated
to the fractions in a Farey series, if we restrict attention to the circles tangent to the
x- axis at points between 0 and 1 .
Another very nice feature of Ford circles is that when we superimpose them on
the upper halfplane Farey diagram, the semicircles of the Farey diagram intersect the
Ford circles orthogonally at the points of tangency of the Ford circles, as shown in the
following figure.
32 Chapter 1 — The Farey Diagram
The fact that the circles and semicircles intersect orthogonally at the tangency points
of the circles can be verified by considering the tangent lines to the circles at the
points where two circles are tangent. The key fact
is that for any two nonparallel tangent lines to a
circle, the distances from the points of tangency to
the intersection point of the two tangent lines are
equal. This is because reflecting across the radial
line through the intersection point takes one tan-
gent line to the other.
Exercises
3. In the diagram of Ford circles consider a vertical line x = r for r a real number.
Show that this line intersects a finite number of Ford circles if r is rational and an in-
finite number of Ford circles if r is irrational. Deduce that for each irrational number
r there exists an infinite sequence of rational numbers pn /q n approaching r such
that pn 1
r− <
qn 2
2q n
for each n , namely the fractions pn /q n labeling the circles that the line x = r crosses.
4. Suppose two Ford circles tangent to the x- axis at points a/b and c/d are tangent
to each other. Show that the point of tangency between the two circles is the point
ab + cd 1
,
b 2 + d2 b 2 + d2
so in particular the coordinates of this point are rational. Hint: What proportion of
the way along the line segment joining the two centers is the point of tangency? This
same proportion will apply to x- coordinates and y- coordinates separately.
Continued fractions are expressions of the following sort:
7 1 67 1
−
−− = −
−−
−−
−−
−−
−−−
− −
−−
− −
−− = 2+ −
−−
−−
−−−
−−−
−−−
−−
−−−
−−−
−−
16 1 24 1
2 +−−
−−−
−−−−
− 1 + −
−−−−
−−
−−−
−−
−−−
−−
1 1
3 +− −
− 3 +−−−
−−
−−−
−−
2 1
1 +−−−
4
To compute the value of a continued fraction one starts in the lower right corner and
works one’s way upward. For example in the continued fraction for 7/16 one starts
with 3 + 1/2 = 7/2 , then taking 1 over this gives 2/7 , and adding 2 to this gives 16/7 ,
and finally 1 over this gives 7/16 .
As we will see, continued fractions are closely related to the Farey diagram. The
fact that all rational numbers occur as labels on vertices in the Farey diagram is a
reflection of the fact that every rational number has an expression as a continued
fraction. We will also consider continued fractions with infinitely many terms ex-
tending downward to the right. These will give expressions for irrational numbers,
somewhat akin to the way in which irrational numbers can be expressed as infinite
decimals. Continued fractions have the advantage that rational numbers are express-
ible as finite continued fractions whereas the decimal representations for rationals
are not generally finite but just eventually periodic. Infinite continued fractions that
are eventually periodic correspond to a special class of irrational numbers, those that
√
are roots of quadratic equations with integer coefficients, like 2 .
In these ways continued fractions are better than decimals, but on the other hand
simple operations like addition and multiplication do not have nice descriptions in
terms of continued fractions, even if one restricts attention just to rational numbers.
In spite of these limitations continued fractions are quite useful in number theory,
for example in solving certain Diophantine equations including linear ones as we will
see in the last section of this chapter.
34 Chapter 2 — Continued Fractions
The numbers ai are assumed to be positive integers except for a0 which can be any
integer, positive, negative, or zero. When it is zero it can be omitted from the formula.
To write a continued fraction in more compact form on a single line one can write it
as p/q = a0 + 1 a1 + 1 a2 + · · · + 1 an with diagonal arrows to indicate the extended
horizontal bars in the previous notation. For example 7/16 = 1 2 + 1 3 + 1 2 and
67/ = 2+ 1 1 + 1 3 + 1 1 + 1 4 . An even more concise notation that is sometimes used
24
is [a0 ; a1 , a2 , · · · , an ] , or just [a1 , a2 , · · · , an ] when there is no a0 term. However
we will use the more suggestive arrow notation in this book.
To compute the continued fraction for a given rational number one starts in the
upper left corner and works one’s way downward, as the following example shows:
The key steps are the equations 67/24 = 2 + 19/24 , 24/19 = 1 + 5/19 , 19/5 = 3 + 4/5 , and
5/ = 1 + 1/ . If we clear fractions in each of these equations we obtain the first four
4 4
of the five equations at the right which show a sequence
of repeated divisions starting with a given pair of positive
integers, 67 and 24 in this case. One first divides the
smaller number into the larger to obtain a quotient and a
remainder which is smaller than the divisor. Then at each
successive step one divides the previous remainder into
the previous divisor. The process stops when one obtains a remainder of zero. This
process is known as the Euclidean Algorithm. The numbers in the shaded box are the
quotients of the successive divisions and are sometimes called the partial quotients.
These are the numbers ai in the continued fraction for 67/24 .
Section 2.1 — Finite Continued Fractions 35
One of the classical uses for the Euclidean algorithm is to find the greatest com-
mon divisor of two given numbers. If one applies the algorithm to two numbers
p and q , dividing the smaller into the larger, then the remainder into the first divi-
sor, and so on, then the greatest common divisor of p and
q turns out to be the last nonzero remainder. For exam-
ple, starting with p = 72 and q = 201 the calculation is
shown at the right, and the last nonzero remainder is 3 ,
which is the greatest common divisor of 72 and 201 . (In
fact the fraction 201/72 equals 67/24 , which explains why
the successive quotients for this example are the same as in the preceding example.)
It is easy to see from the displayed equations why 3 has to be the greatest common
divisor of 72 and 201 , since from the first equation it follows that any divisor of 72
and 201 must also divide 57 , then the second equation shows it must divide 15 , the
third equation then shows it must divide 12 , and the fourth equation shows it must
divide 3 , the last nonzero remainder. Conversely, if a number divides the last nonzero
remainder 3 , then the last equation shows it must also divide 12 , and the next-to-last
equation then shows it must divide 15 , and so on until we conclude that it divides all
the numbers not in the shaded rectangle, including the original two numbers 72 and
201 . The same reasoning applies in general.
A more obvious way to try to compute the greatest common divisor of two num-
bers would be to factor each of them into a product of primes, then look to see which
primes occurred as factors of both, and to what power. But to factor a large number
into its prime factors is a very laborious and time-consuming process. For example,
even a large computer would have a hard time factoring a number with a hundred or
more digits into primes, so it would not be feasible to find the greatest common divi-
sor of a pair of numbers of this size in this way. However, the computer would have
no trouble applying the Euclidean algorithm to find their greatest common divisor.
Having seen what continued fractions are, let us now see what they have to do with
the Farey diagram. Some examples will illustrate this best, so let us first look at the
continued fraction for 7/16 again. This has 2, 3, 2 as its sequence of partial quotients.
We use these three numbers to build a strip of three large triangles subdivided into
2 , 3 , and 2 smaller triangles, from left to right:
We can think of the strip as being formed from three “fans”, where the first fan is made
36 Chapter 2 — Continued Fractions
from the first 2 smaller triangles, the second fan from the next 3 smaller triangles,
and the third fan from the last 2 smaller triangles. Now we begin labeling the vertices
of this strip. On the left edge we start with the labels 1/0 and 0/1 . Then we use the
mediant rule for computing the third label of each triangle in succession as we move
from left to right in the strip. Thus we insert, in order, the labels 1/1 , 1/2 , 1/3 , 2/5 , 3/7 ,
4/ , and finally 7/16 .
9
Was it just an accident that the final label was the fraction 7/16 that we started
with, or does this always happen? Here is a second example:
Again the final vertex on the right has the same label as the fraction we started with.
In fact this always works for fractions p/q between 0 and 1 . For fractions larger
than 1 the procedure works if we modify it by replacing the numerator 0 of the label
0/
1with a0 , the initial integer in the continued fraction p/q = a0 + 1 a1 + · · · + 1 an .
Thus 0/1 is replaced by a 0 /1 . This is illustrated by the 67/24 example:
For comparison, here is the corresponding strip for the reciprocal, 24/67 :
Now let us see how all this relates to the Farey diagram. Since the initial edge of
the strip joining 1/ and a 0 / is an edge of the Farey diagram and the rule for labeling
0 1
subsequent vertices along the strip is the mediant rule, each of the triangles in the
strip is a triangle in the Farey diagram, so the strip of triangles can be regarded as
a sequence of adjacent triangles in the diagram. Here is what this looks like for the
fraction 7/16 in the circular Farey diagram, slightly distorted for visual clarity:
Section 2.1 — Finite Continued Fractions 37
In the strip of triangles for a fraction p/q there is a zigzag path from 1/0 to p/q
that we have indicated by the heavily shaded edges. The vertices that this zigzag
path passes through have a special signif-
icance. They are the fractions that occur
as the values of successively larger initial
portions of the continued fraction, as il-
lustrated in the example of 67/24 shown
at the right. These fractions are called the
convergents for the given fraction. Thus
the convergents for 67/24 are 2 , 3 , 11/4 ,
14/ , and 67/
5 24 itself.
From the preceding examples one can
see that each successive vertex label p i /q i
along the zigzag path for a continued fraction p/q = a0 + 1 a1 +· · ·+ 1 an is computed
in terms of the two preceding vertex labels according to the rule
pi ap + pi−2
= i i−1
qi ai qi−1 + qi−2
This is because the mediant rule is being applied ai times, “adding” p i−1 /q i−1 to the
previously obtained fraction each time until the next label p i /q i is obtained.
the left and right by the vertical lines above 0/1 and 1/1 , and bounded below by the
semicircle from 0/1 to 1/1 .
This example is typical of the general case, where the zigzag path for a continued
fraction p/q = a0 + 1 a1 + · · · + 1 an becomes a “pinball path” in the Farey diagram,
starting down the vertical line from 1/0 to a 0 /1 , then turning left across a1 triangles,
then right across a2 triangles, then left across a3 triangles, continuing to alternate
left and right turns until reaching the final vertex p/q . Two consequences of this are:
(1) The convergents are alternately smaller than and greater than p/q .
(2) The triangles that form the strip of triangles for p/q are exactly the triangles in
the Farey diagram that lie directly above the point p/q on the x- axis.
We will show that the label pn /q n on the final vertex in this strip is equal to p/q ,
the value of the continued fraction. Replacing n by i , we conclude that this holds
Section 2.1 — Finite Continued Fractions 39
We can multiply this product out starting either from the left or from the right. Sup-
pose first that we multiply starting at the left. The two columns of the first matrix give
the two fractions 1/ and a 0 / labeling the left edge of the strip of triangles. When
0 1
we multiply the first matrix by the second matrix we get
! ! ! !
1 a0 0 1 a0 1 + a0 a1 p0 p1
= =
0 1 1 a1 1 a1 q0 q1
The two columns here give the fractions at the ends of the second edge of the zigzag
path. The same thing happens for subsequent matrix multiplications, as multiplying
by the next matrix in the product takes the matrix corresponding to one edge of the
zigzag path to the matrix corresponding to the next edge:
! ! ! !
pi−2 pi−1 0 1 pi−1 pi−2 + ai pi−1 pi−1 pi
= =
qi−2 qi−1 1 ai qi−1 qi−2 + ai qi−1 qi−1 qi
In the end, when all the matrices have been multiplied, we obtain the matrix corre-
sponding to the last edge in the strip from pn−1 /q n−1 to pn /q n . Thus the second
p p
column of the product P is q n , and what remains to show is that this equals q
n
where p/q is the value of the continued fraction a0 + 1 a1 + · · · + 1 an .
The value of the continued fraction a0 + 1 a1 +· · ·+ 1 an is computed by working
from right to left. If we let ri /s i be the value of the tail 1 ai + 1 ai+1 + · · · + 1 an of
the continued fraction, then we have
rn 1 ri 1 si+1 p r a s + r1
= , = = , and = a0 + 1 = 0 1
sn an si r ai si+1 + ri+1 q s1 s1
ai + i+1
si+1
This means that when we multiply out the product P starting from the right, the
second columns will be successively
! ! ! !
rn rn−1 r1 p
, , ··· , , and finally
sn sn−1 s1 q
40 Chapter 2 — Continued Fractions
pn p pn /
We already showed the second column of P is q n , so /q = q n and the proof
is complete. ⊓
⊔
An interesting fact that can be deduced from the preceding proof is that for a
continued fraction 1 a1 + · · · + 1 an with no initial integer a0 , if we reverse the order
of the numbers ai , this leaves the denominator unchanged. For example
1 1 1 13 1 1 1 7
2+ 3+ 4 = 30 and 4+ 3+ 2 = 30
To see why this must always be true we use the operation of transposing a matrix to
interchange its rows and columns. For a 2 × 2 matrix this just amounts to interchang-
a b
ing the upper-right and lower-left entries, so the transpose of a matrix A = c d is
a c
AT = b d . Transposing a product of matrices reverses the order of the factors, so
one has (AB)T = B T AT as the reader can check by direct calculation. In the product
! ! ! !
0 1 0 1 0 1 pn−1 pn
··· =
1 a1 1 a2 1 an qn−1 qn
the individual matrices on the left side of the equation are symmetric with respect to
transposition, so the transpose of the product is obtained by just reversing the order
of the factors: ! ! ! !
0 1 0 1 0 1 pn−1 qn−1
··· =
1 an 1 an−1 1 a1 pn qn
Thus we see that reversing the order of the terms a1 , · · · , an leaves the denominator
qn unchanged, as claimed.
There is also a fairly simple relationship between the numerators. In the example
of 13/30 and 7/30 we see that the product of the numerators, 91 , is congruent to
1 modulo the denominator. In the general case the product of the numerators is
pn qn−1 and this is congruent to (−1)n+1 modulo
denominator qn . To verify this,
the
0 1
we note that the determinant of each factor 1 a is −1 so since the determinant
i
of a product is the product of the determinants, we have pn−1 qn − pn qn−1 = (−1)n ,
which implies that pn qn−1 is congruent to (−1)n+1 modulo qn .
Exercises
2. (a) Compute the continued fraction for 38/83 and display the steps of the Euclidean
algorithm for 38 and 83 as a sequence of equations involving only integers.
Section 2.1 — Finite Continued Fractions 41
(b) For the same number 38/83 compute the associated strip of triangles (with large tri-
angles subdivided into fans of smaller triangles), including the labeling of the vertices
of all the triangles.
(c) Take the continued fraction 1 a1 + 1 a2 + · · · + 1 an you got in part (a) and reverse
the order of the numbers ai to get a continued fraction 1 an + 1 an−1 + · · · + 1 a1 .
Compute the value p/q of this continued fraction, and also compute the strip of tri-
angles for this fraction p/q . What is the relationship between p/q and 38/83 ?
4. (a) A rectangle whose sides have lengths 13 and 48 can be partitioned into squares
in the following way:
Determine the lengths of the sides of all the squares, and relate the numbers of squares
of each size to the continued fraction for 13/48 .
(b) Draw the analogous figure decomposing a rectangle of sides 19 and 42 into
squares, and relate this to the continued fraction for 19/42 .
5. This exercise is intended to illustrate the proof of Theorem 2.1 in the concrete case
of the continued fraction 1 2 + 1 3 + 1 4 + 1 5 .
0 1 0 1 0 1 0 1
(a) Write down the product A1 A2 A3 A4 = 1 a 1 a2 1 a3 1 a4
associated to
1
1 1 1 1
2+ 3+ 4+ 5.
(b) Compute the four matrices A1 , A1 A2 , A1 A2 A3 , A1 A2 A3 A4 and relate these to the
edges of the zigzag path in the strip of triangles for 1 2 + 1 3 + 1 4 + 1 5 .
(c) Compute the four matrices A4 , A3 A4 , A2 A3 A4 , A1 A2 A3 A4 and relate these to the
successive fractions that one gets when one computes the value of 1 2 +1 3 +1 4 +1 5 ,
namely 1 5 , 1 4 + 1 5 , 1 3 + 1 4 + 1 5 , and 1 2 + 1 3 + 1 4 + 1 5 .
6. Compute the strip of triangles corresponding to the
continued
fraction
for 7/19 and
3 7 1 0
compare this with the sequence of matrices reducing 8 19 to 0 1 by a sequence of
operations subtracting one column from the other. (See the proof of Proposition 1.1.)
7. Show that the continued fraction for a rational number is unique except for re-
placing a final term 1 an by 1 an ---1 + 1 1 when an > 1 . For example 1 3 + 1 5 =
1 1 1
3+ 4+ 1.
42 Chapter 2 — Continued Fractions
Notice that these fractions after 1/0 are the successive ratios of the famous Fibonacci
sequence 0, 1, 1, 2, 3, 5, 8, 13, 21, · · · where each number after the initial 0 and 1 is
the sum of its two predecessors. The sequence of convergents is thus 0/1 , 1/1 , 1/2 ,
2/ , 3/ , 5/ , 8/ , · · · , the vertices along the zigzag path.
3 5 8 13
that x has to be equal to y . Thus the sequence of convergents along the edges of
the infinite strip of triangles converges to a unique real number x . (This is why the
convergents are called convergents.)
This argument works for arbitrary infinite continued fractions, so we have shown
the following general result:
This limit is by definition the value of the infinite continued fraction. There is a
simple method for computing the value in the example involving Fibonacci numbers.
We begin by setting
x = 1 1 + 1 1+ 1 1+ ···
We know x is positive, so this rules out the negative root and we are left with the final
√ √
value x = (−1 + 5)/2 . The reciprocal 1/x = 1 + x = (1 + 5)/2 ≈ 1.618 is known
as the golden ratio because of its many interesting and beautiful properties.
Proof: In the upper halfplane Farey diagram consider the vertical line L going upward
from a given irrational number x on the x- axis. The lower endpoint of L is not a
vertex of the Farey diagram since x is irrational. Thus as we move downward along
L we cross a sequence of triangles, entering each triangle by crossing its upper edge
and leaving the triangle by crossing one of its two lower edges at a point between
the two endpoints of this edge. When we exit one triangle we are entering another,
so the sequence of triangles and edges we cross must be infinite. The left and right
endpoints of the edges in the sequence must be approaching the single point x by
the argument we gave earlier, so the edges themselves are approaching x . It cannot
happen that an infinite number of successive edges in the sequence have a common
vertex since these edges would then be approaching this vertex, which would mean
that x was rational. Thus the triangles crossed by the line L form an infinite strip
consisting of an infinite sequence of fans with their pivot vertices on alternate sides
of the strip. The zigzag path along this strip then gives a continued fraction for x .
44 Chapter 2 — Continued Fractions
For the uniqueness, we have seen that an infinite continued fraction for x cor-
responds to a zigzag path in the infinite strip of triangles lying above x . This set
of triangles is unique so the strip is unique, and there is only one path in this strip
that starts at 1/0 and then does left and right turns alternately, starting with a left
turn. The initial turn must be to the left because the first two convergents are a0 and
a0 + 1/a 1 , with a0 + 1/a 1 > a0 since a1 > 0 . After the path traverses the initial edge
from 1/ to a 0 / no subsequent edge of the path can be in the border of the strip
0 1
since this would entail two successive left turns or two successive right turns. ⊓
⊔
From the preceding arguments we can see fairly explicitly why the triangles in the
upper halfplane Farey diagram completely cover the upper halfplane, so every point
(x, y) with y > 0 lies either in the interior of some triangle or on the common edge
between two triangles. To see this, consider the vertical line L in the upper halfplane
through the given point (x, y) . If x is an integer then (x, y) is on one of the vertical
edges of the diagram, so we can assume x is not an integer and hence L is not one
of the vertical edges of the diagram. The line L will then be contained in the strip of
triangles corresponding to the continued fraction for x . This is a finite strip if x is
rational and an infinite strip if x is irrational. In either case the point (x, y) , being
in L , will be in one of the triangles of the strip or on an edge separating two triangles
in the strip.
Let us consider now how the continued fraction for an irrational number can be
computed. Recall first how the continued fraction a0 + 1 a1 + 1 a2 + · · · + 1 an for
a rational number is computed, as in the example of 67/24 = 2 + 1 1 + 1 3 + 1 1 + 1 4
earlier in the chapter. We first write 67/24 = 2 + 19/24 which gives a0 = 2 , then we
write 24/19 = 1 + 5/19 so a1 = 1 , then 19/5 = 3 + 4/5 so a2 = 3 , then 5/4 = 1 + 1/4
so a3 = 1 and finally 4/1 = 4 + 0 so a4 = 4 . This finishes the process and we have
67/ 1 1 1 1 1 1 1 1
24 = a0 + a1 + a2 + a3 + a4 = 2 + 1 + 3 + 1 + 4 .
In summary, the steps are:
(1) Write the given number x as x = a0 + r1 where a0 is an integer and 0 ≤ r1 < 1 .
(2) Write 1/r 1 as 1/r 1 = a1 + r2 where a1 is an integer and 0 ≤ r2 < 1 .
(3) Write 1/r 2 as 1/r 2 = a2 + r3 where a2 is an integer and 0 ≤ r3 < 1 .
And so on, repeatedly.
If x is a rational number the “remainders” ri are rational numbers with decreas-
ing denominators until we reach a remainder rn which is zero and the process stops
after finitely many steps. We can apply the same procedure if x is irrational, but in
this case the equations defining the remainders ri show that each successive ri must
be irrational and in particular nonzero. Thus the process goes on forever, yielding an
infinite continued fraction.
One can see this is the continued fraction for x by the following argument. Sup-
pose the continued fraction for x is a0 + 1 a1 + 1 a2 +· · · . We can write this continued
Section 2.2 — Infinite Continued Fractions 45
We can check this calculation by finding the value of the continued fraction in the same
way that we did earlier for 1 1 + 1 1 + 1 1 + · · · . First we set x = 1 2 + 1 2 + 1 2 + · · · .
Taking reciprocals gives 1/x = 2+ 1 2 + 1 2 + 1 2 +· · · = 2+x . From 1/x = 2+x we get
√
the quadratic equation x 2 + 2x − 1 = 0 with roots x = −1 ± 2 . Since x is positive we
√
can discard the negative root. Thus we have −1 + 2 = 1 2 + 1 2 + 1 2 + · · · . Adding
√
1 to both sides of this equation gives the formula for 2 as a continued fraction.
√
We can get good rational approximations to 2 by computing the convergents in
its continued fraction 1 + 1 2 + 1 2 + 1 2 + · · · . It is a little easier to compute the
√
convergents in 2 + 1 2 + 1 2 + 1 2 + · · · = 1 + 2 and then subtract 1 from each of
these. For 2 + 1 2 + 1 2 + 1 2 + · · · the convergents are:
2 5 12 29 70 169 408 985
···
1 2 5 12 29 70 169 408
Notice that the sequence of numbers 1, 2, 5, 12, 29, 70, 169, · · · is constructed in a
way somewhat analogous to the Fibonacci sequence, except that each number is twice
the preceding number plus the number before that. p
2 = 1.41421356 · · ·
(It is easy to see why this has to be true, because each
1/ = 1.00000000 · · ·
convergent is constructed from the previous one by in- 1
vergents lie between these two since the convergents 239/ = 1.41420118 · · ·
169
occur along a zigzag path in the Farey diagram. This 577/ = 1.41421568 · · ·
408
is true generally for all infinite continued fractions.
√ √
We can compute the continued fraction for 3 by the same method as for 2 ,
but something slightly different happens:
√ √ √ √
(1) 3 = 1 + ( 3 − 1) with a0 = 1 since 3 is between 1 and 2 . Thus r1 = 3 − 1 .
p p
p p p
(2) 1/r 1 = 1/ 3 ---1 = 1/ 3 ---1 · 3 + 1/ 3 + 1 = 3 + 1/2 . This is between 1 and 2 since its
√ p p
numerator 3 + 1 is between 2 and 3 . Thus a1 = 1 and 3 + 1/2 = 1 + 3 ---1/2
p
with r2 = 3 ---1/2 .
p √ √
p p p
(3) 1/r 2 = 2/ 3 ---1 = 2/ 3 ---1 · 3 + 1/ 3 + 1 = 3 + 1 = 2 + ( 3 − 1) with a2 = 2 and
√
r3 = 3 − 1 .
√
Now the remainder r3 = 3 − 1 is the same as r1 , so instead of the same step being
√
repeated infinitely often as happened for 2, the same two steps will repeat infinitely
often. This means we get the continued fraction
p
3 = 1 + 1 1 + 1 2+ 1 1+ 1 2 + 1 1 + 1 2 + ···
Section 2.2 — Infinite Continued Fractions 47
Checking this takes a little more work than before. We begin by isolating the part of
the continued fraction that repeats periodically, so we set
x = 1 1+ 1 2+ 1 1 + 1 2 + 1 1 + 1 2 + ···
Thus we have x/1--- x = 2+x which simplifies to the quadratic equation x 2 +2x −2 = 0
√ √
with roots x = −1 ± 3. Again the negative root is discarded and we get x = −1 + 3 ,
√
so 3 = 1 + x = 1 + 1 1 + 1 2 + 1 1 + 1 2 + 1 1 + 1 2 + · · · which agrees with the
answer we obtained previously.
To simplify the notation we will write a bar over a block of terms in a continued
fraction that repeats infinitely often, for example
p p
2= 1+1 2 and 3= 1+1 1+1 2
It is true in general that for every positive integer n that is not a square, the
√
continued fraction for n has the form a0 + 1 a1 + 1 a2 + · · · + 1 ak . The length of
the period (the repeating block) can be large, for example
p
46 = 6 + 1 1 + 1 3 + 1 1 + 1 1 + 1 2 + 1 6 + 1 2 + 1 1 + 1 1 + 1 3 + 1 1 + 1 12
This example illustrates two other curious facts about the continued fraction for an
√
irrational number n :
(i) The last term of the period ( 12 in the example) is always twice the first term a0
(the initial 6 ).
(ii) If the last term of the period is omitted, the preceding terms in the period form
a palindrome, reading the same backwards as forwards.
We will see in Section 4.2 of Chapter 4 how these two properties follow from certain
symmetry properties of the infinite strip of triangles in the Farey diagram associated
√
to the continued fraction for n .
48 Chapter 2 — Continued Fractions
It is natural to ask exactly which irrational numbers have continued fractions that
are periodic or at least eventually periodic, like for example
1 + 1 4 + 1 3 + 1 5 + 1 7 = 1 2 + 1 4 + 1 3 + 1 5 + 1 7 + 1 3 + 1 5 + 1 7 + ···
2
e = 2 + 1 1 + 1 2 + 1 1 + 1 1+ 1 4 + 1 1 + 1 1+ 1 6+ 1 1 + ···
Thus the terms are grouped by threes with successive even numbers as middle de-
nominators. Even simpler are the continued fractions for certain numbers built from
e that have arithmetic progressions for their denominators:
e−1 1
= 2 + 1 6 + 1 10 + 1 14 + · · ·
e+1
e2 − 1 1
= 1 + 1 3+ 1 5+ 1 7 + ···
e2 + 1
The continued fractions for e and (e − 1)/(e + 1) were discovered by Euler in 1737
while the formula for (e2 − 1)/(e2 + 1) was found by Lambert in 1766 as a special
case of a slightly more complicated formula for (ex − 1)/(ex + 1) .
Section 2.2 — Infinite Continued Fractions 49
√
3
For 2 and π , however, the continued fractions have no known pattern. For π
the continued fraction begins
π = 3 + 1 7 + 1 15 + 1 1 + 1 292 + · · ·
Here the first four convergents are 3 , 22/7 , 333/106 , and 355/113 . We recognize 22/7 as
the familiar approximation 3 1/7 to π . The convergent 355/113 is a particularly good
approximation to π since its decimal expansion begins 3.14159282 whereas π =
3.14159265 · · ·. It is no accident that the convergent 355/113 obtained by truncating
the continued fraction just before the 292 term gives a good approximation to π
since it is a general fact that a convergent immediately preceding a large term in the
continued fraction always gives an especially good approximation. This is because the
next edge in the zigzag path will be rather small when viewed in the upper halfplane
Farey diagram since it is the lower edge of a fan with a large number of triangles, and
the value of the continued fraction lies somewhere between the two ends of this small
edge.
There are nice continued fractions for π if one allows numerators larger than 1 ,
as in the following formula discovered by Euler:
2 2 2 2
π = 3 + 1 6 + 3 6 + 5 6 + 7 6 + ···
However, it is the continued fractions with numerator 1 that have the best properties,
so we will not consider the more general sort in this book.
Exercises
therefore 67·5 − 24·14 = −1 . Thus we obtain the solution (x, y) = (−5, −14) .
The fact that 67/24 lies to the right of 14/5 in the Farey diagram is a consequence
of the strip of triangles having an even number of fans. With an odd number of fans
the situation would be reversed. The number of fans is the number of terms in the
continued fraction after the initial integer, so we see that it is not really necessary to
draw the strip of triangles to figure out the correct sign.
Another way to determine the sign without using the diagram is by computing
67·5 − 24·14 mod 10 to see whether we get +1 or −1 mod 10 . Computing mod 10
means ignoring all but the last digit, so we get 7·5 − 4·4 = 19 ≡ −1 mod 10 and
hence the sign is negative.
We can get other solutions to 67x − 24y = 1 by using other edges of the Farey
diagram with endpoint 67/24 instead of the edge from 14/5 . For example we could
use the edge to 67/24 in the lower border of the strip of triangles. By the mediant
rule this edge joins 53/19 to 67/24 , so we have 67·19 − 24·53 = ±1 and this time
the plus sign is correct, giving the solution (x, y) = (19, 53) . All the other edges
connected to 67/24 are obtained by repeatedly “adding” 67/24 either to 14/5 for edges
above 67/24 , or to 53/19 for edges below 67/24 . In the former case these are the edges
leading to the fractions 14 + 67k/5 + 24k for positive integers k , and in the latter case
they are the edges to 53 + 67k/19 + 24k for positive integers k . Notice that if we let k be
negative in one of these formulas we get the fractions given by the other formula. For
example in 53 + 67k/19 + 24k the values k = −1, −2, · · · give the fractions ---14/ ---5 = 14/5 ,
---81/ 81/ , · · · which are the values of 14 + 67k/
---29 = 29 5 + 24k for k = 0, 1, · · ·. This
means that the general solution of 67x − 24y = 1 is (x, y) = (19 + 24k, 53 + 67k)
for arbitrary integers k . Alternatively we could write the general solution as (x, y) =
(−5 − 24k, −14 − 67k) or as (x, y) = (−5 + 24k, −14 + 67k) since k can be replaced
by −k .
This example illustrates a general fact:
Here we do not need to assume a and b are positive, so by changing the sign of
b we can write the equation as ax + by = n with general solution (p − bk, q + ak) ,
or alternatively as (p + bk, q − ak) .
Proof: One solution (x, y) = (p, q) of ax −by = n is given. For an arbitrary solution
(x, y) we look at the difference (x − p, y − q) which we denote as (x0 , y0 ) . This
satisfies ax0 − by0 = 0 , or in other words, ax0 = by0 . Since a and b are coprime,
the equation ax0 = by0 must have the form a(bk) = b(ak) for some integer k ,
with x0 = bk and y0 = ak . Hence every solution of ax − by = n has the form
52 Chapter 2 — Continued Fractions
Linear Diophantine equations with more than two variables can be solved by re-
duction to the case of two variables. Consider for example a three-variable equation
ax + by + cz = n . Any number that divides all three coefficients a, b, c must also
divide n if a solution is to exist, and in this case we can simplify the equation by
dividing it by the greatest common divisor of a , b , and c , so we may as well assume
that the greatest common divisor of a , b , and c is 1 .
As an example that is typical of the general case for three variables, consider the
equation 6x + 10y + 15z = 7 . Here the greatest common divisor of 6 , 10 , and 15
is 1 , although when taken two at a time they have larger common divisors: 2 for 6
and 10 , 3 for 6 and 15 , and 5 for 10 and 15 .
The idea for solving 6x +10y +15z = 7 is to write it first as 2(3x +5y)+15z = 7
and then to rewrite this as the two equations 3x + 5y = w and 2w + 15z = 7 . The
first equation 3x + 5y = w has solutions for every w since 3 and 5 are coprime,
and we can find the solutions by first solving 3x + 5y = 1 and then multiplying these
Section 2.3 — Linear Diophantine Equations 53
solutions by w . Since the coefficients 3 and 5 are so small, we can find a solution
of 3x + 5y = 1 by inspection rather than computing continued fractions, and we
see that (x, y) = (2, −1) is a solution. Then (x, y) = (2w, −w) is a solution of
3x + 5y = w . Applying Proposition 2.4, the general solution of 3x + 5y = w can
therefore be written as (x, y) = (2w + 5s, −w − 3s) for s an arbitrary integer.
Next we solve 2w + 15z = 7 . A solution of 2w + 15z = 1 is (w, z) = (8, −1) so a
solution of 2w + 15z = 7 is (w, z) = (56, −7) . The general solution of 2w + 15z = 7
is then (w, z) = (56 + 15t, −7 − 2t) for arbitrary integers t . Alternatively, we could
notice that 2w + 15z = 7 has the simpler solution (w, z) = (−4, 1) , obtained either
by inspection or by letting t = −4 in the pair (56 + 15t, −7 − 2t) . Hence the general
solution of 2w + 15z = 7 can also be written as (w, z) = (−4 + 15t, 1 − 2t) .
Using (w, z) = (−4 + 15t, 1 − 2t) we now substitute w = −4 + 15t into the earlier
formula (x, y) = (2w + 5s, −w − 3s) to obtain the final answer
(x, y, z) = (2(−4 + 15t) + 5s, −(−4 + 15t) − 3s, 1 − 2t)
= (−8 + 5s + 30t, 4 − 3s − 15t, 1 − 2t)
where s and t are arbitrary integers. In the spirit of Proposition 2.4 we can say
that a particular solution of 6x + 10y + 15z = 7 is (−8, 4, 1) , obtained by setting
s = t = 0 , and the general solution is obtained by adding this particular solution to
(5s + 30t, −3s − 15t, −2t) which is the general solution of the associated equation
6x + 10y + 15z = 0 with right side zero.
The situation for equations with more variables is similar to what happened in
this example, with an equation in n variables breaking up into n − 1 equations in
two variables. Each of these has solutions depending on an integer parameter, so the
solutions of the n- variable equation depend on n − 1 independent parameters.
We can apply what we have learned about linear Diophantine equations to derive a
general fact about congruences often referred to as the Chinese Remainder Theorem
since it was used in ancient Chinese manuscripts to solve mathematical puzzles of a
certain type.
mod 15 have no common solution since the first congruence implies x ≡ 2 mod 3
while the second congruence implies x ≡ 1 mod 3 . Here we are using the following
general fact about congruences that will be used often:
If a congruence a ≡ b holds mod n then it holds mod d for each divisor d of n .
This is true because if n divides a − b then so does d for each divisor d of n .
Proof of Proposition 2.5: Let us first prove the existence of a common solution x
when there are just two congruences x ≡ a1 mod m1 and x ≡ a2 mod m2 . In
this case the desired number x will have the form x = a1 + x1 m1 = a2 + x2 m2 for
some pair of yet-to-be-determined numbers x1 and x2 . We can rewrite the equation
a1 + x1 m1 = a2 + x2 m2 as m1 x1 − m2 x2 = a2 − a1 . We know that this equation has
a solution (x1 , x2 ) with integers x1 and x2 whenever m1 and m2 are coprime. This
is obtained by first finding integers n1 and n2 such that m1 n1 + m2 n2 = 1 and then
multiplying this equation by a2 −a1 to get (a2 −a1 )m1 n1 +(a2 −a1 )m2 n2 = a2 −a1 .
Then in the equation m1 x1 − m2 x2 = a2 − a1 we may choose x1 = (a2 − a1 )n1 and
x2 = (a2 − a1 )(−n2 ) . Thus we have
x = a1 + x1 m1
= a1 + m1 (a2 − a1 )n1
= a1 (1 − m1 n1 ) + a2 m1 n1
= a1 m2 n2 + a2 m1 n1 since 1 − m1 n1 = m2 n2
As an illustration of the method in this proof let us find all numbers that are
congruent to 7 mod 9 and to 8 mod 11 . First we find a solution of 9n1 + 11n2 = 1
Section 2.3 — Linear Diophantine Equations 55
by the earlier methods. One such solution is (n1 , n2 ) = (5, −4) . The formula x =
a1 m2 n2 + a2 m1 n1 then gives x = −7·11·4 + 8·9·5 = −308 + 360 = 52 . We are free
to change this by adding any multiple of 9·11 , so the general solution is 52 + 99t for
arbitrary integers t . If we were to modify the problem by adding a third congruence
condition such as x ≡ 4 mod 7 then we would just be solving the two congruences
x ≡ 52 mod 99 and x ≡ 4 mod 7 by the same method.
There is a geometric picture that gives a way of visualizing what the Chinese
Remainder Theorem is saying. Consider the case of two simultaneous congruences
x ≡ a mod m and x ≡ b mod n where m and n are coprime. We can then label
the mn unit squares in an m × n rectangle by the numbers 1, 2, 3, · · · starting in the
lower left corner and continuing upward to the right at a 45 degree angle as shown in
the following figure for the case of a 9 × 4 rectangle:
Whenever we run over the top edge we jump back to the bottom in order to continue,
and when we reach the right edge we jump back to the left edge. This amounts to
taking congruence classes mod m horizontally and mod n vertically. What the Chi-
nese Remainder Theorem says is that when m and n are coprime, each unit square
in the m × n rectangle is labeled exactly once by a number from 1 to mn . (Without
the coprimeness some squares would have no labels while others would have mul-
tiple labels.) The figure thus illustrates that specifying a congruence class mod mn
is equivalent to specifying a pair of congruence classes mod m and mod n via the
projections onto the two axes.
For the case of three simultaneous congruences there is an analogous picture with
a three-dimensional rectangular box partitioned into unit cubes. More generally, for
k congruences one would be dealing with a k- dimensional box.
Here the 12 unshaded squares are what is left after columns 3 , 6 , and 9 are excluded
along with rows 2 and 4 . In other words we delete multiples of 2 and 3 , leaving the
numbers 1, 5, 7, 11, 13, 17, 19, 23, 25, 29, 31, 35 as the numbers less than 36 that are
coprime to 36 .
In the corresponding three-dimensional picture for k = 3 we would be omitting
the cubes in certain slices parallel to the three coordinate planes, and similarly for
k > 3.
We can now obtain a formula for the Euler phi function ϕ(n) which counts the
number of congruence classes mod n of integers coprime to n . The arguments above
r r r r
show that ϕ(n) = ϕ(p11 ) · · · ϕ(pkk ) when n = p11 · · · pkk for distinct primes pi .
For a prime p we have ϕ(p r ) = p r − p r −1 = p r −1 (p − 1) since we are counting how
many numbers remain from 1, 2, 3, · · · , p r when we delete p, 2p, 3p, · · · , (p r −1 )p =
p r . Thus we have the formula
r −1 r −1 r −1
ϕ(n) = p11 (p1 − 1)p22 (p2 − 1) · · · pkk (pk − 1)
p1 − 1 p2 − 1 pk − 1
=n ···
p1 p2 pk
If we omit the factor n from this last product, the remaining product of the terms
(pi ---1)/
pi tells what proportion of the numbers less than n are coprime to n . Notice
that this does not depend on the exponents ri . For example ϕ(36) = ϕ(4)ϕ(9) =
2·6 = 12 , which is 1/2 · 2/3 = 1/3 times 36 , in agreement with the preceding figure.
Section 2.3 — Linear Diophantine Equations 57
The way that ϕ(n) varies with n is rather erratic since the prime factorizations
of adjacent numbers are not related. For example we have ϕ(1000) = ϕ(23 53 ) =
22 (2 − 1)52 (5 − 1) = 400 , in agreement with the fact that the numbers coprime to 2
and 5 are the numbers with last digit 1 , 3 , 7 , or 9 , which means four out of every ten
numbers or 400 out of the first 1000 numbers. For the adjacent numbers 999 and
1001 we have ϕ(999) = ϕ(33 ·37) = 18·36 = 648 and ϕ(1001) = ϕ(7·11·13) =
6·10·12 = 720 .
so let us consider now the general problem of determining when a quadratic curve
ax 2 + bxy + cy 2 = d contains rational points. Here a , b , c , and d are rational
numbers but there is no loss of generality in assuming they are integers since we can
multiply the equation by a common denominator for a , b , c , and d if they are not
all integers.
The first step is to reduce to the case that b = 0 . If a ≠ 0 we can write
b 2 b2 2
ax 2 + bxy + cy 2 = a x + y + c− y
2a 4a
Proof: First we show that these congruence conditions must be satisfied if a solution
exists. For suppose that we have a solution (x, y, z) ≠ (0, 0, 0) of ax 2 + by 2 = cz 2 .
We can assume each pair of x, y, z is coprime since for example if a prime p divides
x and y then p 2 divides ax 2 + by 2 hence it divides cz 2 , which implies p divides
z since c is squarefree. Then the solution (x, y, z) could be simplified by dividing
by p .
The equation ax 2 + by 2 = cz 2 implies that ax 2 ≡ cz 2 mod b . Multiplying by
c we get acx 2 ≡ c 2 z 2 mod b . Now, x and b are coprime since any prime dividing
both would divide ax 2 + by 2 = cz 2 and so would divide c or z , neither of which is
possible since b and c are coprime and x and z are coprime. Since x is coprime
to b it has a multiplicative inverse mod b . Multiplying the congruence acx 2 ≡ c 2 z 2
60 Chapter 2 — Continued Fractions
mod b by the square of this inverse, we conclude that ac is a square mod b . In the
same way we see that bc is a square mod a and −ab is a square mod c .
The converse is considerably harder to prove, so let us first outline what the
strategy will be. For convenience we use the more symmetric equation ax 2 + by 2 +
cz 2 = 0 . If the left side of this equation could be factored as
ax 2 + by 2 + cz 2 = a1 x + b1 y + c1 z a2 x + b2 y + c2 z
for positive real numbers α , β , and γ that are not necessarily integers. To count
how many triples (x, y, z) satisfy (∗) let λ(α) be the number of integers x with
0 ≤ x < α , so λ(α) = α if α is an integer and λ(α) = 1 + ⌊α⌋ if α is not an integer,
where ⌊α⌋ is the largest integer less than or equal to α . Thus λ(α) > α if α is not
an integer. The number of triples (x, y, z) satisfying (∗) is then λ(α)λ(β)λ(γ) .
If λ(α)λ(β)λ(γ) > |abc| there must exist two different triples (x ′ , y ′ , z ′ ) and
(x ′′ , y ′′ , z ′′ ) satisfying (∗) such that a1 x ′ + b1 y ′ + c1 z ′ ≡ a1 x ′′ + b1 y ′′ + c1 z ′′
mod abc . The triple (x, y, z) = (x ′ − x ′′ , y ′ − y ′′ , z ′ − z ′′ ) ≠ (0, 0, 0) will then satisfy
a1 x + b1 y + c1 z ≡ 0 mod abc . The triple |x|, |y|, |z| will also satisfy (∗) so
x 2 < α2 , y 2 < β2 , and z 2 < γ 2 .
For the triple (x, y, z) we have ax 2 + by 2 + cz 2 ≡ 0 mod abc from the factor-
ization of ax 2 + by 2 + cz 2 mod abc . Since a , b , and c do not all have the same
sign we can assume two are positive and one is negative by multiplying the equation
by −1 if necessary. After a possible permutation of the coefficients we can assume
that a > 0 , b > 0 , and c < 0 . Since x 2 < α2 , y 2 < β2 , and z 2 < γ 2 we then have
0, ±1, ±2, ±3, ±4, ±5, ±6 , and ±7 so the squares mod 15 are obtained by squaring
these to get 0, 1, 4, 9, 16 ≡ 1, 25 ≡ 10, 36 ≡ 6 , and 49 ≡ 4 . Thus only five of the fifteen
congruence classes mod 15 are squares mod 15 , namely 0, 1, 4, 6 , and 10 . This ap-
proach becomes tedious for large values of n , but in Section 6.2 we will develop more
efficient methods for determining whether a number m is a square mod n , which
turns out to be quite a subtle question.
Exercises
1. (a) Find all integer solutions of the equations 40x + 89y = 1 and 40x + 89y = 5 .
(b) Find another equation ax + by = 1 with integer coefficients a and b that has an
integer solution in common with 40x + 89y = 1 . [Hint: use the Farey diagram.]
2. Find all integers x satisfying the congruence 31x ≡ 1 mod 71 , and then do the
same for the congruence 31x ≡ 10 mod 71 . Are the solutions unique mod 71 , i.e.,
unique up to adding multiples of 71 ?
3. Find all integer solutions of the equation 9x + 12y + 20z = 4 , and do this more
generally for 9x + 12y + 20z = n .
4. Find all solutions of the simultaneous congruences x ≡ 6 mod 13 and x ≡ 7
mod 18 .
5. Show that for the Euler phi function the values ϕ(n) approach infinity as n ap-
proaches infinity. In other words, show that for each number N > 0 there are only
finitely many numbers n with ϕ(n) < N .
6. For each n ≤ 10 determine which numbers are squares mod n by direct calculation.
7. Determine which curves ax 2 + by 2 = c contain rational points for each triple of
coprime integers a, b, c chosen from the numbers 1, 2, 3, 5 . When rational points
exist, find a specific one.
One thing one notices about the various versions of the Farey diagram is their
symmetry. For the circular Farey diagram the symmetries are the reflections across
the horizontal and vertical axes and the 180 degree rotation about the center. For
the upper halfplane Farey diagram there are symmetries that translate the diagram
by any integer distance to the left or the right, as well as reflections across certain
vertical lines, the vertical lines through an integer or half-integer point on the x- axis.
The Farey diagram could also be drawn to have 120 degree rotational symmetry and
three reflectional symmetries.
Our purpose in this chapter is to study all possible symmetries of the Farey diagram,
where we interpret the word “symmetry” in a broader sense than the familiar meaning
from Euclidean geometry. For our purposes, symmetries will be invertible transfor-
mations that take vertices to vertices, edges to edges, and triangles to triangles. There
are simple algebraic formulas for these more general symmetries, and these formulas
lead to effective means of calculation. An application in this chapter will be to comput-
ing the values of periodic or eventually periodic continued fractions, and symmetries
of the diagram will play key roles in later chapters as well.
transformation T x/y = --- y/x . For the upper halfplane Farey diagram the horizontal
translation to the right by n units is T x/y = x/y + n = x + ny/y , while a leftward
translation is T x/y = x/y − n = x --- ny/y . All these formulas work equally well for
the fraction x/y = ±1/0 with the exception of x/y ± n , where the alternative forms
x + ny/ and x --- ny/ are preferable and give T ±1/ = ±1/ .
y y 0 0
In these examples the transformations have the form T x/y = ax + by/cx + dy
for integers a, b, c, d . Another notation is to let z = x/y and then we have
x ax + by a x/y + b az + b
T (z) = T = = =
y cx + dy x
c /y + d cz + d
A transformation of the type T x/y = ax + by/cx + dy or T (z) = az + b/cz + d is called
a linear fractional transformation since it is defined by a fraction whose numerator
and denominator are linear functions. Fractions x/y , including ±1/0 , correspond to
pairs (x, y) and from this point of view linear fractional transformations T x/y =
ax + by/
cx + dy correspond to linear T
transformations
(x, y) = (ax + by, cx + dy) .
x a b x ax + by
In matrix notation this becomes T y = c d y = cx + dy .
Linear fractional transformations T x/y = ax + by/cx + dy that give symmetries
of the Farey diagram must take vertices to vertices and edges to edges, so let us see
what this means for the coefficients a, b, c, d which we will always assume are inte-
gers. Vertices of the Farey diagram are fractions p/q in lowest terms, including ±1/0 ,
with p/q determining the same vertex as --- p/ --- q . This ambiguity causes no problem
for linear fractional transformations T x/y = ax + by/cx + dy since ax + by/cx + dy =
--- ax --- by/ p --- p/
--- cx --- dy so T /q = T --- q . For T to take vertices to vertices means
that for a fraction p/q in lowest terms we would like T p/q = ap + bq/cp + dq to be in
lowest terms as well. For T to take edges to edges means that if p/q , r/s is an edge
we want ap + bq/cp + dq , ar
+ bs/
cr + ds to be an edge also. In matrix terms
this last
pr ap + bq ar + bs
thatif q s has determinant ±1 then cp + dq cr + ds , which is
condition is saying
a b pr
the product c d q s , should also have determinant ±1 . It is a general fact that
the determinant of the product of two matrices is the product of the determinants of
the two matrices.
(For 2 × 2 matrices this is easy to check
by a direct calculation.)
ap + bq ar + bs p r
Thus for cp + dq cr + ds to have determinant
±1 when q s has determinant ±1
a b
the exact condition we need is that c d should have determinant ±1 .
Proposition 3.1. If the matrix ac db with integer entries has determinant ±1 then
the associated linear fractional transformation T x/y = ax + by/cx + dy takes ver-
tices in the Farey diagram to vertices in the diagram and it takes each pair of
vertices that are joined by an edge to another pair of vertices that are joined by an
edge.
It follows that T must take triangles in the diagram to triangles in the diagram
since triangles correspond to sets of three vertices, any two of which are the endpoints
of an edge.
Section 3.1 — Linear Fractional Transformations 65
We will use the notation LF (Z) for the set of all linear fractional transformations
a b
T x/y = ax + by/cx + dy with coefficients a, b, c, d in Z such that the matrix c d
has determinant ±1 . (Here Z is the set of integers.)
a b a b --- a --- b
Changing a matrix c d to its negative − c d = --- c --- d produces the same
linear fractional transformation since --- ax --- by/ --- cx --- dy = ax + by/cx + dy . This is in
fact the only way that different matrices with integer entries and determinant ±1 can
give the same linear fractional transformation, by the following argument. The trans-
formation T x/y = ax
+ by/ 1 a 0 b
cx + dy takes /0 to /c and /1 to /d so T determines
a b
each column of c d up to a sign. Changing the sign of both columns gives the
same transformation so the only question is whether changing the sign of one col-
umn could give the same transformation. Changing the sign of the first column has
the same effect as changing the sign of the second column since changing the sign of
both columns gives the same transformation. So suppose that we change the sign of
the second column, changing ax + by/cx + dy to ax --- by/cx --- dy . If we apply these two
transformations to 1/1 we get a + b/c + d and a --- b/c --- d . These fractions are in lowest
terms by the previous proposition, so if they give the same vertex of the Farey diagram
we would have either a + b = a − b and c + d = c − d , hence b = 0 and d = 0 , or we
would have a + b = b − a and c + d = d − c , hence a = 0 and c = 0 . In either case
the condition ad − bc = ±1 is violated. Thus we see that changing the sign of only
a b
one column of c d gives a different transformation, finishing the argument.
If we are given two linear fractional transformations T x/y = ax + by/cx + dy and
S x/y = ex + fy/gx + hy then we can compose them to get another linear fractional
transformation:
a(ex + f y) + b(gx + hy) (ae + bg)x + (af + bh)y
T S x/y = =
c(ex + f y) + d(gx + hy) (ce + dg)x + (cf + dh)y
ae + bg af + bh
a b e f
The matrix of this transformation is just the product = ce + dg cf + dh ,
c d g h
so composition of linear fractional transformations corresponds to matrix multipli-
cation. It follows that if T and S are in LF (Z) then so is their composition T S , which
is also referred to as their product.
A transformation T in LF (Z) has an inverse T −1 in LF (Z) because the inverse
of a 2 × 2 matrix is given by the formula
!−1 !
a b 1 d −b
=
c d ad − bc −c a
66 Chapter 3 — Symmetries of the Farey Diagram
so if a, b, c, d are integers with ad − bc = ±1 then the inverse matrix also has integer
entries and determinant ±1 . When computing the inverse of a transformation in
LF (Z) the factor 1/ad --- bc can be ignored since it is ±1 and replacing a matrix by its
negative gives the same linear fractional transformation, as we observed above.
a b
For a matrix A = c d the key property of its inverse A−1 is that both products
1 0
AA−1 and A−1 A are equal to the identity matrix 0 1 , corresponding to the identity
transformation I x/y = x/y . Thus for any transformation T in LF (Z) we have
T T −1 = I and T −1 T = I . The formula T −1 T = I implies that T gives a one-to-
one transformation of vertices since if two vertices v1 and v2 have the same image
T (v1 ) = T (v2 ) then we must have T −1 T (v1 ) = T −1 T (v2 ) so v1 = v2 and hence
T cannot send two different vertices to the same vertex, which means it is one-to-one
as a transformation from vertices to vertices. Also, the formula T T −1 = I implies
that every vertex v1 is the image T (v2 ) of some vertex v2 since we can write v1 =
T T −1 (v1 ) and let v2 = T −1 (v1 ) . The same reasoning applies not just for vertices
but also for edges and triangles. Thus T can never send two edges to the same edge
or two triangles to the same triangle, and every edge or triangle is the image of some
edge or triangle.
all triangles. A translation of the upper halfplane diagram by any number of units
left or right preserves orientations of triangles while a reflection across a vertical line
through an integer or half-integer point on the x- axis reverses orientations.
a b
As we have seen, the matrix c d corresponding to a linear fractional transfor-
mation ax + by/cx + dy is unique up to multiplication by −1 . The determinant ad−bc
does not change when each of a, b, c, d is changed to its negative, so each transfor-
mation in LF (Z) has a well-defined determinant, either +1 or −1 . The sign has a
geometric interpretation:
′ ′ ′
(a) For any two triangles p/q , r/s , t/u and p/q ′, r /s ′, t /u ′ in the
Proposition 3.3.
Farey diagram there is a unique transformation in LF (Z) taking p/q , r/s , t/u to
p/′ ′, r /′ ′, t ′/ ′ .
q s u
p/ , r/ ′ ′
(b) For any two edges and p/q ′, r /s ′ there is a unique orientation-
q s
′ ′
preserving transformation in LF (Z) taking p/q , r/s to p/q ′, r /s ′ .
p/ , r/ ′ ′
Proof: For a given pair of edges q and p/q ′, r /s ′ let T1 be the
s transforma-
p r p′ r ′
tion with matrix q s and let T2 be the transformation with matrix q ′ s ′ , so T1
′ ′
takes 1/0 , 0/1 to p/q , r/s and T2 takes 1/0 , 0/1 to p/q ′, r /s ′ . The composition
′ ′
T = T2 T1−1 then takes p/q , r/s to p/q ′, r /s ′ . Hence T takes p/q , r/s , t/u to either
p/′ ′, r /′ ′, t ′/ ′ or the other triangle p/′ ′, r /′ ′, t ′′/ ′′ having p/′ r′
q s u q s u q ′, /s ′ as an edge.
For one of these two possibilities T is orientation-preserving and for the other T is
orientation-reversing. We can change whether T preserves or reverses orientation by
changing the signs in one column of the matrix of T1 or T2 . Thus we can arrange that
′ ′ ′
T takes p/q , r/s , t/u to p/q ′, r /s ′, t /u ′ .
A transformation in LF (Z) taking p/q , r/s , t/u p/′ ′, r /′ ′, t ′/ ′ is unique
toq s u
p r t
since it must take the three triangles sharing an edge with /q , /s , /u to the three
′ ′ ′
triangles sharing the corresponding edges with p/q ′, r /s ′, t /u ′ , and then this deter-
mines where the next layer of six triangles sharing an edge with the three triangles
adjacent to p/q , r/s , t/u are sent, and so on until all triangles are accounted for.
′ ′
For part (b) we have found a product T2 T1−1 taking p/q , r/s to p/q ′, r /s ′ , and if
this product is orientation-reversing we can make it orientation-preserving by chang-
ing the sign of one column of the matrix of T1 or T2 . An orientation-preserving
′ ′
transformation taking p/q , r/s to p/q ′, r /s ′ is unique since if it preserves orienta-
tions this determines where it sends the two triangles adjacent to p/q , r/s and then
uniqueness follows from the uniqueness in part (a). ⊓
⊔
In the remainder of this section we will describe five fairly simple types of sym-
metries of the Farey diagram given by elements of LF (Z) . Two other slightly more
complicated types of symmetries will be described in the next section where they arise
in connection with continued fractions.
(1) The diagram can be reflected across any of its edges, leaving this edge fixed and in-
terchanging the two triangles adjacent to it. This then determines where all the other
triangles are sent. The simplest case is reflection across 1/0 , 0/1 , the transformation
T x/y = --- x/y . To obtain a reflection
across an arbitrary edge a/b , c/d let S be the
a c −1 a/ , c/
transformation with matrix b d . The composition ST S sends b d first to
−1
1/ , 0/
0 1 by S , then T leaves this edge fixed, then S sends it back to a/b , c/d .
Thus ST S −1 leaves a/b , c/d fixed so ST S −1 is either the identity transformation or
reflection across a/b , c/d . The transformations S and S −1 either both preserve ori-
entation or both reverse orientation, while T reverses orientation, so ST S −1 reverses
orientation and is therefore reflection across the edge a/b , c/d . Its matrix can easily
Section 3.1 — Linear Fractional Transformations 69
be computed:
! ! ! ! ! !
a c −1 0 d −c −a c d −c −ad − bc 2ac
= =
b d 0 1 −b a −b d −b a −2bd ad + bc
1/ , 1/ ---3 2
For example, the matrix giving reflection across 1 2 is ---4 3
which one can
check by noting that its determinant is −1 and it fixes /11 and 1/ .
2
(3) The diagram can be rotated 180 degrees about the midpoint of any edge, inter-
changing the two adjacent triangles. This rotation is the composition of the reflection
across this edge and the reflection across the arc perpendicular to the edge. Rotation
about the midpoint of 1/0 , 0/1 is T x/y = --- y/x so rotation about the midpoint of
an edge a/b , c/d is ST S −1 with the same S as before since ST S −1 interchanges the
endpoints of a/b , c/d and is orientation-preserving.
(4) The diagram can be rotated by 120 degrees in either direction about the center-
point of any triangle, the point of intersection of the three dotted arcs that cross the
triangle in the figure above. In particular this rotates the triangle itself about its cen-
terpoint. A simple case is the rotation of the triangle 1/ , 0/ , 1/ by 120 degrees
0 1 1
counterclockwise.
This is given by the transformation T x/y = y/y --- x with matrix
0 1
---1 1
which has determinant 1 and takes the edge 1/0 , 0/1 to 0/1 , 1/1 . For ro-
tation of an arbitrary triangle a/b , c/d , e/f we may assume its vertices have been
ordered
give it a counterclockwise orientation, so the transformation S with ma-
to
a c
trix b d takes 1/0 , 0/1 , 1/1 to this triangle. Then ST S −1 rotates a/b , c/d , e/f by
120 degrees counterclockwise since it is orientation-preserving and takes a/b , c/d
to c/d , e/f . Again the matrix for ST S −1 could easily be computed.
(5) The diagram can be pivoted about any vertex v . If the vertices joined to v by
edges are labeled vi for all integers i , with vi joined to vi+1 by an edge, then there
70 Chapter 3 — Symmetries of the Farey Diagram
where for the last equality we use the fact that ad − bc = 1 , so that c and d do not
appear in the final answer, reflecting the fact that the pivoting transformation
only
1 0
depends on a/b and n . For example when a/b = 0/1 we get the matrix --- n 1 for
pivoting n steps counterclockwise about 0/1 .
Exercises
1. Find a formula for the linear fractional transformation that rotates the triangle
0/ , 1/ , 1/ to 1/1 , 0/1 , 1/2 .
1 2 1
2. Find the two orientation-reversing linear fractional transformations that take the
edge 1/2 , 1/3 to itself, possibly interchanging its two ends.
3. Find a formula for the linear fractional transformation that reflects the upper half-
plane version of the Farey diagram across the vertical line x = 3/2 .
4. Compute the matrix of the transformation that reflects the Farey diagram across
an arc perpendicular to an edge a/b , c/d , and do the same for the 180 degree rota-
tion about the centerpoint of this edge, and for the 120 degree rotation of a triangle
a/ , c/ , e/ .
b d f
5. Express the transformation T x/y = --- y/x in four different ways as a composition
of three pivoting transformations about 1/0 or 0/1 .
6. (a) Find all the transformations in LF (Z) that fix the vertex 1/0 , that is, take this
vertex to itself.
(b) Find all the transformations in LF (Z) that fix 0/1 .
(c) Determine which of the transformations in (a) and (b) are reflections and describe
these reflections.
(d) Show that if the transformation T fixes x/y then ST S −1 fixes S x/y .
Section 3.2 — Translations and Glide Reflections 71
(e) Find all the transformations in LF (Z) that fix 1/1 . Check that T x/y = y/x is
among the transformations you have found.
We would like to find a linear fractional transformation that gives the rightward trans-
lation of this strip that
exhibits
the periodicity. The only possibility is the transfor-
4 19
mation with matrix 9 43 since this sends the edge 1/0 , 0/1 to 4/9 , 19/43 and is
orientation-preserving since the matrix has determinant 1 in view of the inequality
4/ > 19/43 , which can be verified either by a calculation or by visualizing how the strip
9
lies inside the circular Farey diagram, with the part of the strip to the right of the edge
1/ , 0/ lying in the upper half of the diagram.
0 1
4 19
To see that the transformation T with matrix 9 43
really does translate the
strip along itself we can argue as follows. Let us label the 10 triangles between the
edges 1/0 , 0/1 and 4/9 , 19/43 as t1 , t2 , · · · , t10 from left to right, and then continue
this labeling with the subsequent triangles t11 , t12 , · · · to the right. We can build the
part of the strip to the right of the edge 1/0 , 0/1 by starting with this edge and first
adding the vertex v1 just to the right of 1/0 to form the triangle t1 , then adding
the vertex v2 to form t2 , and so on repeatedly, adding successive vertices vi on
one border of the strip or the other to form the successive triangles ti . Since T is
orientation-preserving and takes 1/0 , 0/1 to 4/9 , 19/43 it must take the triangle t1
to the triangle t11 just to the right of the edge 4/9 , 19/43 , so T takes v1 to v11 . The
triangle t2 must then be taken to t12 so v2 is taken to v12 . In the same way we have
T (ti ) = ti+10 and T (vi ) = vi+10 for all i ≥ 1 so T translates the right half of the
strip along itself. For the left half of the strip we can apply similar reasoning to T −1 .
Thus T −1 sends t10 to the triangle just to the left of 1/0 , 0/1 , then it sends t9 to the
second triangle to the left of 1/0 , 0/1 , and so on. We conclude from all this that T is
indeed a translation of the strip along itself.
72 Chapter 3 — Symmetries of the Farey Diagram
The fractions labeling the vertices along the zigzag path in the strip moving to-
ward the right are the convergents to 1 2 + 1 3 + 1 1 + 1 4 . Call these convergents
z1 , z2 , · · · and their limit z . When we apply the translation T we are taking each
convergent to a later convergent in the sequence, so both the sequence {zn } and the
sequence {T (zn )} converge to z . On the other hand the sequence {T (zn )} converges
to T (z) since this is just saying that 4z n + 19/9z n + 43 converges to 4z + 19/9z + 43 as zn
converges to z . Thus we have T (z) = z .
In summary, what we have just argued is that the value z of the periodic continued
fraction 1 2 + 1 3 + 1 1 + 1 4 satisfies the equation T (z) = z , which is saying that
z is a fixed point of the transformation T . Since T (z) = 4z + 19/9z + 43 the equation
T (z) = z becomes 4z + 19/9z + 43 = z which simplifies to 9z 2 + 39z − 19 = 0 . The roots
of this equation are given by the quadratic formula:
√ √ √ √
−39 ± 392 + 4·9·19 −39 ± 3 132 + 4·19 −13 ± 245 −13 ± 7 5
z= = = =
18 18 6 6
The positive root is the one that the right half of the infinite strip converges to, so we
have determined the value of the continued fraction:
√
1 −13 + 7 5
2 +1 13 +1 +1 4 = 6
√
Incidentally, the other root (−13 − 7 5)/6 has an interpretation in terms of the di-
agram as well: It is the limit of the numbers labeling the vertices of the zigzag path
moving off to the left rather than to the right. This follows by the same sort of argu-
ment as above.
A periodic continued fraction with period of odd length has an associated infinite
strip with a different type of symmetry. As an example, consider 1 1 + 1 2 + 1 3 .
Here the associated strip is
This strip is taken to itself by a transformation that takes 1/0 , 0/1 to 2/3 , 7/10 by
combining a translation along the strip with reflection across the horizontal axis of
the strip. A transformation of this type is called a glide reflection. The only linear
fractional transformation
that could realize this glide reflection is the transformation
2 7
with matrix 3 10 since this takes 1/0 , 0/1 to 2/3 , 7/10 and is orientation-reversing
as its determinant is −1 since 2/3 < 7/10 . To check that this transformation gives
a glide reflection of the strip one can argue as in the preceding example that each
successive triangle to the right or left of 1/0 , 0/1 is moved along the strip in the same
way that the glide reflection moves it, keeping in mind that orientations are now being
reversed by both the glide reflection and the linear fractional transformation. The
Section 3.2 — Translations and Glide Reflections 73
reasoning shows that the translation or glide reflection symmetry of a periodic infinite
strip in the Farey diagram can always be realized by a linear fractional transformation.
Just as in the preceding example the value of the continued fraction can be de-
termined by solving the equation T (z) = z where T is the glide reflection. Thus we
√
have 2z + 7/3z + 10 = z which simplifies to 3z 2 + 8z − 7 = 0 with roots (−4 ± 37)/3 .
The positive root gives the value of the continued fraction:
√
1 +1 +1 −4 + 37
1 2 3 = 3
Continued fractions that are only eventually periodic can be treated in a similar
fashion. For example, consider 1 2 + 1 2 + 1 1 + 1 2 + 1 3 . The corresponding infinite
strip is
In this case if we discard the triangles corresponding to the initial nonperiodic part of
1 1
the continued fraction, 2+ 2, and then extend the remaining periodic part in both
directions, we obtain a periodic strip that is carried to itself by the glide reflection T
taking 1/2 , 2/5 to 8/19 , 27/64 :
The procedure we have used in these examples works in general for any irrational
number z whose continued fraction is eventually periodic. From the periodic part of
the continued fraction one constructs a periodic infinite strip in the Farey diagram,
where the periodicity is given by a transformation T (z) = az + b/cz + d in LF (Z) , with
T either a translation or a glide reflection of the strip. As we argued in the first
example, the number z satisfies the equation T (z) = z . This becomes the quadratic
equation az + b = cz 2 + dz with integer coefficients, or in more standard form,
cz 2 + (d − a)z − b = 0 . We would like to apply the quadratic formula to find the roots
of this equation, but in order to do this the coefficient c must be nonzero. Suppose on
the contrary that c was zero. Then the determinant condition ad − bc = ±1would
a b ±1 b
force a to be ±1 , and then from the first column of the matrix c d = 0 d
we see that T would take the vertex ±1/0 of the Farey diagram to itself. However a
translation or glide reflection symmetry of a periodic infinite strip cannot take any
vertex to itself since no vertex along the strip is taken to itself, and the other vertices
lie in the complement of the strip which consists of disjoint pieces, each containing
all the vertices lying on one side of an edge in the border of the strip, and a translation
or glide reflection of the strip takes each of these pieces to a different piece.
Knowing that c is nonzero, we can apply the quadratic formula to deduce that
√
the roots of the equation cz 2 + (d − a)z − b = 0 have the form A + B n with A and
B rational numbers and n an integer. We know that the real number z defined by
the given continued fraction is a root of the equation so n cannot be negative, and it
cannot be a square since z is irrational.
Thus we have an argument that proves one half of Lagrange’s Theorem:
The converse statement that the continued fraction for every quadratic irrational
is periodic or eventually periodic will be proved in Proposition 4.1 and Theorem 5.2.
Here the first fan in the strip opens upward and the last fan opens downward, but there
are three other possibilities depending on whether the first and last fans open upward
a b
or downward. When a/c > b/d as in the figure then ad − bc = +1 so the matrix c d
defines an orientation-preserving transformation in LF (Z) taking the edge 1/0 , 0/1
to a/c , b/d . This is a translation of the infinite periodic strip obtained by extending
the finite strip from 1/0 , 0/1 to a/c , b/d periodically in both directions.
We can move the edge 1/ , 0/ to a/ , b/ by a sequence of pivoting trans-
0 1 c d
formations, one for each fan. One first pivots the edge 1/0 , 0/1 across a fan of a1
triangles to the second edge of the zigzag path, then this edge is pivoted across the
a2 triangles in the second fan to the next edge of the zigzag path, and so on until we
reach the right edge a/c , b/d . These pivotings are alternately in the clockwise and
counterclockwise
direction,
and the simplest pivotings of these two types are given
1 0 1 n
by matrices n 1 and 0 1 with n > 0 , pivoting n steps clockwise about 0/1 or
counterclockwise about 1/0 in the two cases. For the configuration of fans shown in
the figure let us consider the product
! ! ! ! ! !
1 0 1 a2 1 0 1 a4 1 0 1 ak
···
a1 1 0 1 a3 1 0 1 ak−1 1 0 1
These pivoting matrices alternate between clockwise and counterclockwise as they
should, with the number of steps being a1 , a2 , · · · , ak as we want. However there
seem to be two things wrong with this product. First, the order of the terms appears
to be backwards since when we compose transformations we proceed from right to
left, so this product would first pivot ak steps, then ak−1 steps, and so on, whereas
we want to move the edge 1/0 , 0/1 across the strip by first pivoting a1 steps, then a2
steps, and so on. The other problem is that each pivoting transformation in the prod-
uct is pivoting about either 0/1 or 1/0 whereas the pivotings that move the 1/0 , 0/1
edge across the strip are pivoting about a sequence of different vertices.
Surprisingly enough, these two problems canceleachother out, and the product
a b
displayed above is actually correct and does equal c d . To see why, suppose we
superimpose a copy of the strip on top of the circular Farey diagram, but with the right
edge a/c , b/d lying on top of the edge 1/0 , 0/1 and each triangle in the rest of the
strip lying exactly on top of a corresponding triangle in the lower half of the diagram.
If we apply the last matrix of the product to this repositioned strip, this pivots the
76 Chapter 3 — Symmetries of the Farey Diagram
strip so that the next-to-last edge of the zigzag path lies on top of 1/ , 0/ . Then
0 1
applying the next-to-last matrix in the product to the newly positioned strip pivots it
so that the third-to-last edge of the zigzag path lies on top of 1/0 , 0/1 . Continuing
in this way, we end up with the left edge of the strip lying on top of 1/0 , 0/1 . This
means that the product of all the matrices takes the strip back to its original position,
so the product takes 1/0 , 0/1 to the right edge of the strip, as we wanted.
The other three possibilities for whether the first and last fans open upward or
downward
are treated in a similar fashion. For each fan opening upward one uses a
1 0
matrix a 1 giving a pivoting transformation about 0/1 and for each fan opening
i
1 a
downward one uses a matrix 0 1i pivoting about 1/0 .
9 4
As an example consider the matrix 29 13 which has determinant 1 and corre-
sponds to the edge 9/29 , 4/13 with 9/29 > 4/13 . The corresponding strip in the Farey
diagram is obtained by computing the continued fraction 9/29 = 1 3 + 1 4 + 1 2 as in
the first figure below.
9 4 1 0 1 4 1 0 13 29
From this we can read off that = 3 1 0 1 2 1 . Similarly for 4 9 we
29 13
13 29 1 3 1 0 1 2
have 29/9 = 3+ 1 4 + 1 2 as in the second figure so 4 9 = 0 1 4 1 0 1 . Notice
that in both these cases the first and last fans in the strip open in the same direction,
so if we extend the strip to an infinite periodic strip this would produce adjacent fans
with three and two triangles opening in the same direction, and each of these pairs of
fans could be combined to give a single fan with five triangles.
Glide reflection symmetries of infinite periodic strips cannot be expressed as
products of pivoting transformations since pivotings are orientation-preserving, but
glide reflections can be expressed as products of very simple glide reflections that, like
pivotings, move an edge across a single
fan
but are orientation-reversing. An example
0 1
is the transformation with matrix 1 n
for an integer n > 0 . This transformation
takes the edge 1/ , 0/ to 0/ , 1/ and is orientation-reversing, a glide reflection
0 1 1 n
symmetry of an infinite
strip in which each fan has n triangles. A transformation
n1
with matrix 1 0 has similar behavior, taking 1/0 , 0/1 to n/1 , 1/0 .
4 9
For example the matrix 13 29 of determinant −1 gives a glide reflection taking
the left edge of the first strip in the preceding figure to the right edge. This glide
reflection is a symmetry of the infinite strip obtained by first applying the glide reflec-
tion to the given strip to get a strip twice as long, then taking the periodic extension
4 9
of this doubled
strip
in both
directions. The corresponding factorization of 13 29
4 9 0 1 0 1 0 1
is 13 29
= 13 1 4 1 2
, as one can check by the method we used in the case of
Section 3.2 — Translations and Glide Reflections 77
translations of a periodic strip, placing a copy of the strip on top of the Farey diagram
with the right edge of the strip on top of the edge 1/0 , 0/1 , but with the copy flipped
over since we are now dealing witha glide
reflection.
a b
More generally, for any matrix c d of positive integers with determinant ±1 we
have an associated strip from the edge 1/0, 0/1 to a/c, b/d , and
we canexpress this
1 n 1 0 0 1 n 1
matrix as a product of the basic matrices 0 1 , n 1 , 1 n , or 1 0 , by putting
arrows on the edges of the zigzag path in the strip to indicate orientations of the edges,
with the left edge oriented from 1/0 to 0/1 and the right edge oriented from a/c to b/d
and the intermediate edges oriented arbitrarily. Theseorientations,
together
with
the
1 n 1 0 0 1 n1
directions that the fans open,
determine
the factors 0 1
, n1 , 1 n
, or 1 0
a b
in the product representing c d .
For example in the proof of Theorem 2.1 we made use of the following product:
! ! ! !
1 a0 0 1 0 1 0 1
···
0 1 1 a1 1 a2 1 an
with the last fan on the right opening either downward as shown or possibly upward,
depending on whether n is even or odd. The first fan has both its left and right edges
oriented downward so the first matrix in the product gives the corresponding pivoting
transformation, but all the other fans have both edges oriented to the right so they
correspond to glide reflections,
the other matrices in the product. If a0 = 0 the first
1 0
matrix is the identity matrix 0 1 so it can be omitted, and the first fan is omitted
as well.
We have seen seven different types of symmetries of the Farey diagram. The four
that preserve orientation are rotations about the midpoint of an edge or the center-
point of a triangle, pivotings about a vertex, and translations of a periodic strip, and
the three that reverse orientation are reflections across an edge or an arc perpen-
dicular to an edge, and glide reflections. These seven types along with the identity
transformation in fact give a complete list of all the types of symmetries of the Farey
diagram. This fact will not be needed in the rest of the book so we will not digress to
give a proof.
78 Chapter 3 — Symmetries of the Farey Diagram
Exercises
1. Compute the value of each of the following continued fractions by first drawing the
associated infinite strip of triangles, then finding a linear fractional transformation T
in LF (Z) that gives the periodicity in the strip, then solving T (z) = z .
(a) 1 2 + 1 5
(b) 1 2 + 1 1 + 1 1
(c) 1 1 + 1 1 + 1 1 + 1 1 + 1 1 + 1 2
(d) 2 + 1 1 + 1 1 + 1 4
(e) 2 + 1 1 + 1 1 + 1 1 + 1 4
(f) 1 1 + 1 1 + 1 2 + 1 3
2. Find an infinite
periodic strip of triangles in the Farey diagram
suchthatthe
trans-
0 1 0 1 0 1 1 2
formation 1 2
is a glide reflection along this strip and 1 2 1 2
= 2 5
is a
translation along the strip.
3. Express the following transformations as compositions of pivot transformations:
(a) T x/y = 13x + 3y/69x + 16y (b) T x/y = 10x + 33y/33x + 109y
Finding Pythagorean triples is answering the question of when the sum of two
squares is equal to a square. This leads naturally to the broader question of exactly
which numbers are sums of two squares. Thus one asks, when does an equation
x 2 + y 2 = n have integer solutions, and how can one find these solutions? The brute
force approach of simply plugging in values for x and y leads to the following list
of all solutions for n ≤ 50 (apart from interchanging x and y ):
1 = 12 + 02 , 2 = 12 + 12 , 4 = 22 + 02 , 5 = 22 + 12 , 8 = 22 + 22 , 9 = 32 + 02 ,
10 = 32 + 12 , 13 = 32 + 22 , 16 = 42 + 02 , 17 = 42 + 12 , 18 = 32 + 32 ,
20 = 42 + 22 , 25 = 52 + 02 = 42 + 32 , 26 = 52 + 12 , 29 = 52 + 22 , 32 = 42 + 42 ,
34 = 52 + 32 , 36 = 62 + 02 , 37 = 62 + 12 , 40 = 62 + 22 , 41 = 52 + 42 ,
45 = 62 + 32 , 49 = 72 + 02 , 50 = 52 + 52 = 72 + 12
Notice that in some cases there is more than one way to write n as a sum of two
squares. Our first goal will be to describe a more efficient way to find the integer
solutions of x 2 +y 2 = n and to display them graphically in a way that helps illuminate
their structure. The technique for doing this will work not just for the function x 2 +y 2
but also for any function Q(x, y) = ax 2 + bxy + cy 2 , where a , b , and c are integer
constants. Such a function Q(x, y) with at least one of the coefficients a, b, c nonzero
is called a quadratic form, or sometimes just a form for short.
Solving x 2 + y 2 = n amounts to representing n in the form of the sum of two
squares. More generally, solving Q(x, y) = n is called representing n by the form
Q(x, y) . So the overall goal is to solve the representation problem: Which numbers n
are represented by a given form Q(x, y) , and how does one find such representations.
Before starting to describe the method for displaying the values of a quadratic
form graphically let us make a preliminary observation: If the greatest common divisor
of two integers x and y is d , then we can write x = dx ′ , y = dy ′ , and Q(x, y) =
d2 Q(x ′ , y ′ ) where the greatest common divisor of x ′ and y ′ is 1 . Hence it suffices
to find the values of Q on primitive pairs (x, y) , the pairs whose greatest common
divisor is 1 , and then multiply these values by arbitrary squares d2 .
80 Chapter 4 — Quadratic Forms
The dual tree has a vertex in the center of each triangle of the Farey diagram, and
Section 4.1 — The Topograph 81
it has an edge crossing each edge of the Farey diagram. As with the Farey diagram,
we can only draw a finite part of the dual tree. The actual dual tree has branching
that repeats infinitely often, an unending bifurcation process with smaller and smaller
twigs.
The tree divides the interior of the large circle into regions, each of which is
adjacent to one vertex of the original diagram. We can write the value Q(x, y) in the
region adjacent to the vertex x/y . This is shown in the figure below for the quadratic
form Q(x, y) = x 2 +y 2 , where to unclutter the picture we no longer draw the triangles
of the original Farey diagram.
For example the 13 in the region adjacent to the fraction 2/3 represents the value
22 + 32 , and the 29 in the region adjacent to 5/2 represents the value 52 + 22 .
For a quadratic form Q this picture showing the values Q(x, y) is called the
topograph of Q . It turns out that there is a very simple method for computing the
topograph from just a very small amount of initial data. This method is based on the
following fact:
We can check this in the topograph of x 2 + y 2 shown above. Consider for exam-
ple one of the edges separating the values 1 and 2 . The values in the four regions
surrounding this edge are 1, 1, 2, 5 and the arithmetic progression is 1, 1 + 2, 5 . For
an edge separating the values 1 and 5 the arithmetic progression is 2, 1 + 5, 10 . For
82 Chapter 4 — Quadratic Forms
In the first case we start with the values 1 and 2 together with the 3 just above them.
These determine the value 9 above the 2 via the arithmetic progression 1 , 2 + 3 , 9 .
Similarly the 6 above the 1 is determined by the arithmetic progression 2 , 1 + 3 ,
6 . Next one can fill in the 19 next to the 9 we just computed, using the arithmetic
progression 3 , 2 + 9 , 19 , and so on for as long as one likes.
The procedure for the other form x 2 − 2y 2 is just the same, but here there are
negative as well as positive values. The edges that separate positive values from
negative values will be important later, so we have indicated these edges by special
shading.
Perhaps the most noticeable thing in both the examples x 2 + 2y 2 and x 2 − 2y 2
is the fact that the values in the lower half of the topograph are the same as those in
the upper half. We could have predicted in advance that this would happen because
Q(x, y) = Q(−x, y) whenever Q(x, y) = ax 2 + cy 2 , with no xy term. The topo-
graph for x 2 +y 2 has even more symmetry since the values of x 2 +y 2 are unchanged
when x and y are switched, so the topograph has left-right symmetry as well.
Given any three integers a , b , and c which are not all zero there is always a
quadratic form whose topograph has these three numbers surrounding a vertex since
the form ax 2 + (c − a − b)xy + by 2 takes the values a , b , and c for (x, y) equal to
(1, 0) , (0, 1) , and (1, 1) .
Section 4.1 — The Topograph 83
Proof of the Arithmetic Progression Rule: Let the two vertices of the Farey diagram
corresponding to the values q and r have labels x 1 /y 1 and x 2 /y 2 as in the figure
below. Then by the mediant rule for labeling vertices, the labels on the p and s regions
are the fractions shown. Note that these labels are correct even when x 1 /y 1 = 1/0
and x 2 /y 2 = 0/1 .
Similarly we have
The omitted terms in (· · ·) are the same in both cases, namely the terms involving
both subscripts 1 and 2 . If we compute p + s by adding the two formulas together,
the terms (· · ·) will cancel, leaving just p + s = (q + r ) + (q + r ) . This equation can be
rewritten as (q + r ) − p = s − (q + r ) , which just says that p, q + r , s is an arithmetic
progression. ⊓
⊔
Exercises
1. Draw the topograph for the form Q(x, y) = 2x 2 + 5y 2 , showing all the values of
Q(x, y) ≤ 60 in the topograph, with the associated fractional labels x/y . If there
is symmetry in the topograph, you only need to draw one half of the topograph and
state that the other half is symmetric.
2. Do the same for the form Q(x, y) = 2x 2 + xy + 2y 2 , in this case displaying all
values Q(x, y) ≤ 40 in the topograph.
3. Do the same for the form Q(x, y) = x 2 − y 2 , showing all the values between +30
and −30 in the topograph, but omitting the labels x/y this time.
84 Chapter 4 — Quadratic Forms
5. Find the quadratic form Q(x, y) for which Q(3, 5) = Q(4, 7) = Q(7, 12) = 1 by
first drawing a strip in the Farey diagram containing the triangles 1/0 , 0/1 , 1/1 and
3/ , 4/ , 7/ 7
5 7 12 (this can be done using the continued fraction for /12 ), then adding the
edges of the dual tree that meet these triangles, then filling in values of the topograph
starting with the given values.
4.2 Periodicity
For most quadratic forms that take on both positive and negative values, such as
x − 2y 2 , there is another way of drawing the topograph that reveals some hidden
2
To construct this, one can first build the separator line starting with the three values
Q(1, 0) = 1 , Q(0, 1) = −2 , and Q(1, 1) = −1 . Place these as shown in part (a) of the
figure below, with a horizontal line segment separating the positive from the negative
values.
Section 4.2 — Periodicity 85
To extend the separator line one step farther to the right, apply the arithmetic progres-
sion rule to compute the next value 2 using the arithmetic progression −2, 1 − 1, 2 .
Since this value 2 is positive, we place it above the horizontal line and insert a vertical
edge to separate this 2 from the 1 to the left of it, as in (b) of the figure. Now we
repeat the process with the next arithmetic progression 1, 2 − 1, 1 and put the new 1
above the horizontal line with a vertical edge separating it from the preceding 2 , as
shown in (c). At the next step we compute the next value −2 and place it below the
horizontal line since it is negative, giving (d). One more step produces (e) where we see
that further repetitions will produce a pattern that repeats periodically as we move to
the right. The arithmetic progression rule also implies that it repeats periodically to
the left, so it is periodic in both directions:
Thus we have the periodic separator line. To get the rest of the topograph we can
then work our way upward and downward from the separator line, as shown in the
original figure. As one moves upward from the separator line, the values of Q become
larger and larger, approaching +∞ monotonically, and as one moves downward the
values approach −∞ monotonically. The reason for this will become clear in the next
chapter when we discuss something called the Monotonicity Property.
An interesting property of this form x 2 − 2y 2 that is evident from its topograph
is that it takes on the same negative values as positive values. This would have been
hard to predict from the formula x 2 − 2y 2 . Indeed, for the similar-looking quadratic
form x 2 − 3y 2 the negative values are quite different from the positive values, as one
can see in its straightened-out topograph:
√
used to compute the continued fraction for d. As an example let us look at the case
d = 2 . The relevant portion of the topograph for x 2 − 2y 2 is the strip along the line
separating the positive and negative values:
This is a part of the dual tree of the Farey diagram. If we superimpose the triangles
of the Farey diagram corresponding to this part of the dual tree we obtain an infinite
strip of triangles:
Ignoring the dotted triangles to the left, the infinite strip of triangles corresponds to
the infinite continued fraction 1 + 1 2 . We saw how to compute the value of this
continued fraction in Chapter 2, but there is an easier way using the quadratic form
x 2 − 2y 2 . For fractions x/y labeling the vertices along the infinite strip, the corre-
sponding values n = x 2 − 2y 2 are either ±1 or ±2 . We can rewrite the equation
2
x 2 − 2y 2 = n as x/y = 2 + n/y 2 . As we go farther and farther to the right in the
infinite strip, both x and y are getting larger and larger while n only varies through
finitely many values, namely ±1 and ±2 , so the quantity n/y 2 is approaching 0 . The
2 2
equation x/y = 2 + n/y 2 then implies that x/y is approaching 2 , so x/y is
√
approaching 2 . Since these fractions x/y are the convergents for the infinite con-
tinued fraction 1 + 1 2 that corresponds to the infinite strip, this implies that the
√
value of the continued fraction 1 + 1 2 is 2.
As another example, the quadratic form x 2 − 3y 2 can be used to compute the
√
continued fraction 3 = 1 + 1 1 + 1 2 by the same reasoning:
After looking at these two examples one can see that it is not really necessary to draw
the strip of triangles, and one can just read off the continued fraction directly from
the periodic separator line. Let us illustrate this by considering the form x 2 − 10y 2 :
Section 4.2 — Periodicity 87
If one moves toward the right along the separator line starting at a point in the edge
separating the 1/0 region from the 0/1 region, one first encounters 3 edges leading off
to the right (downward), then 6 edges leading off to the left (upward), then 6 edges
leading off to the right, and thereafter 6 edges leading off to the left and right alter-
√
nately. This means that the continued fraction for 10 is 3 + 1 6 .
Here is a more complicated example showing how to compute the continued frac-
√
tion for 19 from the form x 2 − 19y 2 :
√
From this we read off that 19 = 4 + 1 2 + 1 1 + 1 3 + 1 1 + 1 2 + 1 8 .
In the next chapter we will prove that the topographs of forms x 2 − dy 2 always
have a periodic separator line when d is a positive integer that is not a square. As
in the examples above, this separator line always includes the edge of the topograph
separating the 1/0 and 0/1 regions since the form takes the positive value +1 at 1/0
and the negative value −d at 0/1 . In addition to being periodic, the separator line also
has mirror symmetry with respect to reflection across the vertical line through the 1/0
and 0/1 regions. This is because the form x 2 − dy 2 has no xy term, so replacing
x/ by --- x/ does not change the value of the form. Replacing x/ by --- x/ reflects
y y y y
the circular Farey diagram across the horizontal edge from 1/0 to 0/1 , and this reflects
the periodic separator line across the vertical line through the 1/0 and 0/1 regions.
Once the separator line has symmetry with respect to this vertical line, the periodicity
forces it to have mirror symmetry with respect to an infinite sequence of vertical lines,
the dotted lines in the figure below for the form x 2 − 19y 2 :
88 Chapter 4 — Quadratic Forms
√
These mirror symmetries imply that the continued fraction for d has the form
p
d = a0 + 1 a1 + 1 a2 + · · · + 1 an
As before there is a horizontal translation giving the periodicity and there are mirror
symmetries across vertical lines, but now there is an extra glide reflection along the
strip that interchanges the positive and negative values of the form. Performing this
glide reflection twice in succession gives the translational periodicity. Notice that
there are also 180 degree rotational symmetries about the points marked with dots
on the separator line, and these rotations account for the palindromic middle part of
the continued fraction
p
13 = 3 + 1 1 + 1 1 + 1 1 + 1 1 + 1 6
The fact that the periodic part has odd length corresponds to the separator line having
the glide reflection symmetry. We could rewrite the continued fraction to have a
periodic part of even length by doubling the period,
p
13 = 3 + 1 1 + 1 1 + 1 1 + 1 1 + 1 6 + 1 1 + 1 1 + 1 1 + 1 1 + 1 6
and this corresponds to ignoring the glide reflection and just considering the transla-
tional periodicity.
We have been using quadratic forms x 2 −dy 2 to compute the continued fractions
√
for irrational numbers d , but everything works just the same for irrational numbers
p
p/q using the quadratic form qx 2 − py 2 in place of x 2 − dy 2 . Following the same
2
reasoning as before, if the equation qx 2 −py 2 = n is rewritten as q x/y = p + n/y 2
Section 4.2 — Periodicity 89
then we see that as we move out along the periodic separator line the numbers x and
y approach infinity while n cycles through finitely many values, so the term n/y 2
approaches 0 and the fractions x/y approach a number z satisfying qz 2 = p , so
p
z = p/q . This argument depends of course on the existence of a periodic separator
line, and we will prove in the next chapter that forms qx 2 −py 2 always have a periodic
p
separator line if p and q are positive and the roots ± p/q of qz 2 − p = 0 are
irrational.
Here are some examples. For the first one we use the form 3x 2 − 7y 2 to compute
p
the continued fraction for 7/3.
p
This gives 7/3 = 1 + 1 1 + 1 1 + 1 8 + 1 1 + 1 1 + 1 2 . For comparison, we can
p
compute the continued fraction for 3/7 from the topograph of 7x 2 − 3y 2 :
The separator line here is obtained from the previous one by reflecting across a hor-
izontal axis and changing the sign of the labels. These modifications correspond to
changing 3x 2 − 7y 2 to 3y 2 − 7x 2 by first interchanging x and y which reflects the
Farey diagram and hence also the topograph, and then changing the sign of the re-
sulting form 3y 2 − 7x 2 to get 7x 2 − 3y 2 . From the separator line for 7x 2 − 3y 2 we
p
then read off the continued fraction 1 1 + 1 1 + 1 1 + 1 8 + 1 1 + 1 1 + 1 2 for 3/7.
p
This is the reciprocal of the previous continued fraction since 3/7 is the reciprocal
p
of 7/3.
For the next example we use 10x 2 − 29y 2 to compute the continued fraction for
p
29/10,
p
with the result that 29/10 = 1 + 1 1 + 1 2 + 1 2 + 1 1 + 1 2 . The period of odd
length here corresponds to the existence of the glide reflection and 180 degree rotation
symmetries.
90 Chapter 4 — Quadratic Forms
The palindrome property and the relation an = 2a0 that we observed in the continued
√ p
fraction for d still hold for irrational numbers p/q . The key point is that the form
qx 2 − py 2 is unchanged when the sign of x is changed, so its topograph has mirror
symmetry with respect to reflection across a line through the 1/0 and 0/1 regions, and
this symmetry implies the special properties of the continued fraction.
p
One might ask whether the irrational numbers p/q are the only numbers having
a continued fraction a0 + 1 a1 + · · · + 1 an or 1 a0 + 1 a1 + · · · + 1 an satisfying
the palindrome property and the relation an = 2a0 . Here we should restrict atten-
tion only to positive irrational numbers since the numbers a0 , a1 , · · · , an must all be
positive. The answer is Yes, as we will see later in this section.
More generally, quadratic forms can be used to compute the continued fractions
for all quadratic irrationals. To illustrate the general method let us find the continued
√
fraction for (10 + 2)/14 which is a root of the equation 14z 2 − 20z + 7 = 0 . The
associated quadratic form is 14x 2 −20xy +7y 2 , obtained by setting z = x/y and then
multiplying by y 2 . We would like to find a periodic separator line in the topograph of
this form. To do this we start with the three values at 1/0 , 0/1 , and 1/1 , which are the
positive numbers 14 , 7 , and 1 , and then use the arithmetic progression rule to move
in a direction that leads to negative values since the separator line separates positive
and negative values of the form. In this way we are led to a separator line which is
indeed periodic:
This figure lies in the upper half of the circular Farey diagram where the fractions
x/ labeling the regions in the topograph are positive. If we follow the separator line
y
out to either end the labels x/y have both x and y increasing monotonically and
approaching infinity, as a consequence of the mediant rule for labeling vertices of the
Farey diagram. Hence the values
2
14z 2 − 20z + 7 = 14 x/y − 20 x/y + 7 = (14x 2 − 20xy + 7y 2 )/y 2
are approaching zero since the values of the numerator 14x 2 − 20xy + 7y 2 on the
right just cycle through a finite set of numbers repeatedly, the values of the form along
Section 4.2 — Periodicity 91
the separator line, while the denominators y 2 approach infinity. Thus the labels x/y
are approaching the roots of the equation 14z 2 − 20z + 7 = 0 . Since we are in the
√
upper half of the Farey diagram, the smaller of the two roots, which is (10 − 2)/14 ,
√
is the limit toward the right along the separator line and the larger root (10 + 2)/14
is the limit toward the left.
To get the continued fraction for the smaller root we follow the path in the topo-
graph that starts with the edge between 1/0 and 0/1 , then zigzags up to the separator
line, then goes out this line to the right. If we straighten this path out it looks like the
following:
We will show that this procedure works for all quadratic irrational numbers, and
this will prove the harder half of Lagrange’s Theorem:
Proposition 4.1. The continued fraction for every quadratic irrational is eventually
periodic.
The proof will involve associating a quadratic form to each quadratic irrational,
and we will need to use the fact that the quadratic forms arising in this way all have
periodic separator lines. This will be proved in the next chapter, so the proof will not
be officially complete until then.
Before beginning the proof let us examine more closely the structure of all infinite
strips in the Farey diagram, whether periodic or not. By an infinite strip in the Farey
92 Chapter 4 — Quadratic Forms
To see how the strip lies in the upper halfplane model of the Farey diagram let L be a
line running down the middle of the strip from end to end. Viewing L as a path in the
upper halfplane model of the Farey diagram, L cannot cross only vertical edges, the
edges with one end at 1/0 , otherwise the strip would consist of a single infinite fan,
which is not allowed as an infinite strip. Thus L must cross some semicircular edges.
As we move along L crossing such a semicircular edge in the downward direction into
the adjacent triangle, the next edge that L crosses will be one of the other two shorter
semicircular edges of this triangle, moving downward again. All subsequent crossings
will then be downward as well. The semicircles crossed are becoming smaller and
smaller with diameters approaching zero, as we saw in our initial discussion of infinite
continued fractions, and there is a unique limiting point α on the x- axis for this end
of the strip of triangles. This is the unique point that lies between the two endpoints
of each semicircular edge crossed by L on its downward path.
Consider the vertical line Vα going upward from α . Near its lower end Vα will
pass through triangles of the strip. If the whole line Vα does not stay entirely within
the strip as we move upward, it will eventually leave the strip by crossing the upper
semicircular edge of a triangle T of the strip as in the first figure below.
In this case the line L , which passes through the same upward sequence of triangles
as Vα until reaching T , must exit T by turning and crossing the other smaller semi-
circular edge of T in the downward direction. After crossing this edge L will then
continue downward forever, passing through all the triangles of the other end of the
strip and limiting on an irrational number β . The vertical line Vβ going upward from
β will pass through the same set of triangles until reaching the triangle T where it
will also exit the strip by crossing the upper edge of T . We can then deform L so
that it consists of the parts of Vα and Vβ below T joined by a bending arc within T .
Notice that the vertex 1/0 is not a vertex of the strip in this case.
Section 4.2 — Periodicity 93
The other possibility is that Vα stays in the strip forever as we move upward, so
eventually it lies in a triangle Tα of the strip having 1/0 as a vertex as in the second
figure above. One end of the line L runs parallel to Vα until it reaches Tα then it
turns right or left to cross a finite number of other triangles having 1/0 as a vertex
before turning downward to cross the lower edge of one of these triangles Tβ . After
this it will travel monotonically downward, limiting on an irrational number β in the
x- axis. We can deform L to consist of parts of Vα and the vertical line Vβ through
β , joined by an arc crossing from Tα to Tβ .
One conclusion we can draw from this analysis of the infinite strip is that its
endpoints α and β cannot be the same number. This can be seen from the two figures
above where in the first figure α and β lie below the two different lower edges of the
triangle T , and in the second figure α and β lie below the two different triangles Tα
and Tβ with a vertex at 1/0 .
Another consequence is that the labels x/y on the vertices along the infinite strip
must have denominators y approaching infinity at the ends of the strip and numer-
ators x approaching either +∞ or −∞ depending on the sign of the endpoint α or
β being approached. This is because the labels are given by repeated applications of
the mediant rule as we move vertically down either end of L toward α or β so |x|
and y always increase as each new triangle is added to the strip. (Near the ends of
the strip the labels x/y are approaching α or β so neither x nor y is 0 .)
We can also deduce that for each pair of distinct irrationals α and β there is
a unique infinite strip in the Farey diagram whose ends converge to α and β . This
is because α and β determine the vertical lines Vα and Vβ in the figures and these
determine the triangles T or Tα and Tβ since in the case that α and β lie in the same
interval in the x- axis between consecutive integers, T is the smallest triangle of the
Farey diagram whose projection to the x- axis contains both α and β , while in the
case that α and β lie in different intervals between consecutive integers the triangles
Tα and Tβ are the triangles with vertex 1/0 that project to these two intervals.
A nice way to construct an infinite strip joining any two irrationals α and β is
to take all the triangles in the Farey diagram that meet the semicircle in the upper
halfplane with endpoints α and β . This semicircle can cross an edge of the Farey
diagram only once since if two semicircles in the upper halfplane with endpoints on
the x- axis intersect in more than one point then they must coincide. Nor can two
semicircles with endpoints on the x- axis be tangent unless the point of tangency is
one of the endpoints, but this does not happen here since α and β are irrational while
the endpoints of edges of the Farey diagram are rational. From these observations we
see that if the semicircle from α to β intersects a triangle of the Farey diagram, then
it crosses this triangle from one edge to another edge. The semicircle cannot cross an
infinite number of triangles having a common vertex, otherwise the semicircle would
contain points arbitrarily close to the common vertex, which is impossible since the
94 Chapter 4 — Quadratic Forms
common vertex cannot be either of the irrational numbers α and β . Thus the union
of all the triangles crossed by the semicircle is an infinite strip.
We have seen that an infinite strip is uniquely determined by its endpoints, so
this implies that the semicircle from α to β crosses exactly the same triangles as the
line we constructed earlier consisting of two vertical segments joined at the top by
a 180 degree bend. This may seem odd at first glance, but what it means is that the
height of the vertical segments cannot be too large compared to the distance between
them.
The construction of a strip connecting two irrational numbers α and β via the
semicircle with endpoints α and β works equally well when α or β is rational, but
in this case the strip has only a finite number of triangles at a rational end. A very
special case is when α and β are the endpoints of an edge of the Farey diagram, when
the strip degenerates to just this edge.
√
Proof of Proposition 4.1: Quadratic irrationals are the numbers α = A + B n where
A and B are rational, B is nonzero, and n is a positive integer that is not a square.
The first step in the proof will be to find a quadratic equation with integer coefficients
having α as a root. From the quadratic formula we know the other root will have
√
to be the conjugate α = A − B n , with α ≠ α since B ≠ 0 . A quadratic equation
having α and α as roots is then (z − α)(z − α) = 0 . Multiplied out, this becomes
z 2 − (α + α)z + αα = z 2 − 2Az + (A2 − B 2 n) = 0 which has rational coefficients since A
and B are rational. After multiplying by a common denominator for the coefficients
this becomes an equation az 2 + bz + c = 0 with integer coefficients having α and α
as roots. Here a > 0 since it is the common denominator we multiplied by.
The polynomial az 2 + bz + c determines a quadratic form ax 2 + bxy + cy 2 . This
form has two special properties:
(1) Its topograph contains both positive and negative values. This is because the
polynomial az 2 +bz+c = a(z−α)(z−α) takes negative values when z is between
the two roots α and α , where the two factors in parentheses have opposite sign,
and positive values when z is greater than both roots or less than both roots, so
the two parenthetical factors have the same sign. Thus there are rational numbers
z = x/y where the left side of the equation
2
a x/y + b x/y + c = ax 2 + bxy + cy 2 /y 2
has both signs, hence the same is true for the numerator on the right.
(2) The topograph does not contain the value 0 . For suppose there is a pair (x, y) ≠
(0, 0) with ax 2 + bxy + cy 2 = 0 . We cannot have y = 0 , otherwise x would also
be 0 since a ≠ 0 . Then since y ≠ 0 the displayed equation in (1) above would
say that x/y was a rational root of az 2 + bz + c = 0 , contradicting the fact that
its roots α and α are irrational.
Section 4.2 — Periodicity 95
In Theorem 5.2 in the next chapter we will show that every form ax 2 + bxy + cy 2
satisfying these two conditions has a periodic separator line in its topograph. This
corresponds to an infinite periodic strip in the Farey diagram. We claim that the ends
of this strip must be at the roots α and α of the equation az 2 + bz + c = 0 . To see
why, consider the labels x/y on the vertices along this strip. Since the denominators
y approach infinity as we go out to either end of the periodic infinite strip while the
values of the form ax 2 + bxy + cy 2 cycle through finitely many values, it follows
that the values of the right side of the equation
2
a x/y + b x/y + c = ax 2 + bxy + cy 2 /y 2
are approaching zero. This means that the vertex labels x/y are approaching a root
of the equation az 2 + bz + c = 0 . We saw earlier that the two ends of the strip are at
two different irrational numbers, so the two ends of the strip are at the two roots α
and α , as claimed.
To get the continued fraction for the given root α we take the strip consisting
of all the triangles in the upper halfplane Farey diagram that meet the vertical line
through α . This strip will start at the vertex 1/0 at the top and then move downward
through an infinite sequence of triangles that eventually coincide with the triangles
in one end of the infinite periodic strip. This means that the continued fraction for α
is eventually periodic. ⊓
⊔
Proof: Suppose the continued fraction for a quadratic irrational α satisfies these
conditions. In particular α must be positive since a0 is positive, being half the positive
number an . The strip in the Farey diagram corresponding to this continued fraction
starts at the 1/0 , 0/1 edge and goes out to α at its end. Combining this strip with its
reflection across the 1/0 , 0/1 edge gives an infinite strip with mirror symmetry across
the 1/0 , 0/1 edge, and this strip is periodic everywhere, even at the junction along
the 1/0 , 0/1 edge since an = 2a0 . The other end of this strip is α since we have seen
that the two endpoints of a periodic strip satisfy a single quadratic equation T (z) = z
where T is the periodicity transformation. The two roots α and α of this equation are
conjugates but they are also negatives of each other by the mirror symmetry across
√
the edge 1/0 , 0/1 so we have α = −α . Writing α as A + B n with A and B rational,
√
the equation α = −α implies that A = 0 . Since α is positive we then have α = B n
with B > 0 . Thus α is the square root of the positive rational number B 2 n . ⊓
⊔
96 Chapter 4 — Quadratic Forms
The next result answers another natural question one might ask:
Proposition 4.3. Every periodic line in the dual tree of the Farey diagram occurs
as the separator line for some form.
Proof: Given a periodic line, the periodicity of this line and of the corresponding
infinite strip is realized by some linear fractional transformation T . As we have seen,
the endpoints of the strip are the fixed points of T , the solutions of T (z) = z . This
can be rewritten as a quadratic equation az 2 + bz + c = 0 with integer coefficients.
The coefficient a must be nonzero, otherwise we would have an equation bz + c = 0
with only one root if b ≠ 0 , while if b = 0 the equation would have no roots if c ≠ 0 .
If c = 0 as well as a = 0 and b = 0 the equation would degenerate to 0 = 0 , meaning
that every z satisfied T (z) = z so T would be the identity transformation rather
than the periodicity transformation, a contradiction. Thus a must be nonzero, and
by multiplying the equation by −1 if necessary we may assume that a > 0 .
We claim that the the periodic line we started with is a separator line in the topo-
graph of the form ax 2 + bxy + cy 2 . This just means that the values of the form at
vertices along one edge of the associated periodic strip are all positive and the values
along the other edge are all negative. To see why this is so let us factor az 2 + bz + c
as a(z − α)(z − α) where α and α are the roots of az 2 + bz + c = 0 at the ends of the
strip. From this factorization and the fact that a is positive we see that the product
a(z − α)(z − α) is negative if z is between α and α and positive if z is greater than
both α and α or less than both α and α . (We saw this previously in the proof of
Proposition 4.1.) Taking z to be a rational number x/y , the equation
2
a x/y + b x/y + c = ax 2 + bxy + cy 2 /y 2
implies that the form ax 2 + bxy + cy 2 takes negative values for x/y in the interval
between α and α and positive values for x/y outside this interval, assuming x/y ≠ 1/0
so we are not dividing by 0 in the equation above.
In terms of the circular Farey diagram the roots α and α divide the boundary cir-
cle into two arcs, with the form taking positive values at vertices in one arc and nega-
tive values at vertices in the other arc, with the possible
exception of the vertex 1/0 . However, this vertex is not
actually exceptional since it lies in the arc with posi-
tive values and the form takes the value a > 0 when
x/ = 1/ . This proves what we wanted since vertices
y 0
along one edge of the strip lie in one arc and vertices
along the other edge lie in the other arc. ⊓
⊔
To illustrate the procedure in the preceding proof let us find a quadratic form
whose periodic separator line is the following:
Section 4.2 — Periodicity 97
The fractional labels correspond to vertices of the underlying Farey diagram, and
1 25 0
sends /0 to /36 and /1
from these we see that the translation giving the periodicity
25 84
to 84/121 . The matrix of this transformation is 36 121 so it is the transformation
T (z) = 25z + 84/36z + 121 . The fixed points of T are determined by setting this equal
to z . The resulting equation simplifies to 36z 2 +96z −84 = 0 or just 3z 2 +8z −7 = 0 .
The roots α and α of this equation az 2 + bz + c = 0 are the fixed points, but we do
not actually have to compute them since we know the quadratic form we want is then
ax 2 + bxy + cy 2 which in this example is just 3x 2 + 8xy − 7y 2 . As a check, we can
compute the separator line of this form:
This provides a realization of the given periodic line as the separator line of a hyper-
bolic form. Any constant multiple of this form would also have the same separator line
since we would just be multiplying all the labels along the line by the same constant.
We could have simplified the calculation in this example by observing that the
periodic line we started with is taken to itself by a glide reflection that moves the line
only half as far along itself as the translation T that we used. This glide reflection is
T ′ (z) = 2z + 7/3z+10 and it has the same fixed points as T so we could use the equation
T ′ (z) = z instead of T (z) = z . Thus we have 2z + 7/3z+10 = z which simplifies more
directly to 3z 2 + 8z − 7 = 0 , the same final equation as before.
Exercises
1. Determine the periodic separator line in the topograph for each of the following
quadratic forms. (You do not need to include the fractional labels x/y .)
(a) x 2 − 7y 2 (b) 3x 2 − 4y 2 (c) x 2 + xy − y 2
2. For the following quadratic forms, draw enough of the topograph, starting with
the edge separating the 1/0 and 0/1 regions, to locate the periodic separator line, and
include the separator line itself in your topograph.
(a) x 2 + 3xy + y 2 (b) 6x 2 + 18xy + 13y 2 (c) 37x 2 − 104xy + 73y 2
98 Chapter 4 — Quadratic Forms
3. Using your answers in the first problem above, write down the continued fraction
√ √ √
expansions for 7 , 2 3/3 , and (−1 + 5)/2 .
4. Use a quadratic form to compute continued fractions for the following pairs of
numbers:
√ √ √ √
(a) (3 + 6)/2 and (3 − 6)/2 (b) (11 + 13)/6 and (11 − 13)/6
√ √
(c) (14 + 7)/9 and (14 − 7)/9
5. Compute the periodic separator line for the form x 2 − 43y 2 and use this to find
√
the continued fraction for 43.
√
6. Use the form x 2 − 2n2 y 2 to compute the continued fraction for n 2 for n =
1, 2, 3, 4, 5 .
√
7. Compute the continued fraction for 21 using the form x 2 −21y 2 . Can you explain
p
the relationship between this continued fraction and the one for 7/3 computed in
this section?
8. (a) Find a quadratic form whose periodic separator line has the following pattern:
(b) Generalize part (a) by replacing each pair of upward edges with m upward edges
and each triple of downward edges with n downward edges.
Ignoring the label 741/170 for the moment, the other fractional labels are the first few
√
convergents for the continued fraction for 19 that we computed before, which is
4 + 1 2 + 1 1 + 1 3 + 1 1 + 1 2 + 1 8 . These fractional labels are the labels on the
vertices of the zigzag path in the infinite strip of triangles in the Farey diagram, which
we can imagine being superimposed on the separator line in the figure. The fractional
label we are most interested in is the 170/39 in the upper right because this is the label
on a region where the value of the form x 2 − 19y 2 is 1 . This means exactly that
(x, y) = (170, 39) is a solution of x 2 − 19y 2 = 1 . In terms of continued fractions,
the fraction 170/39 is the value of the initial portion 4 + 1 2 + 1 1 + 1 3 + 1 1 + 1 2 of
√
the continued fraction for 19, with the final term of the period omitted.
Since the topograph of x 2 − 19y 2 is periodic along the separator line, there are
infinitely many different solutions of x 2 − 19y 2 = 1 along the separator line. Going
toward the left just gives the negatives --- x/y of the fractions x/y to the right, so since
we are only interested in the positive solutions it will suffice to see what happens
toward the right. One way to do this is to use the linear fractional transformation
that gives the periodicity translation toward the right. This transformation sends the
edge 1/0 , 0/1 of the Farey diagram to the edge 170/39 , 741/170 . Here 741/170 is the
value of the continued fraction 4 + 1 2 + 1 1 + 1 3 + 1 1 + 1 2 + 1 4 obtained from
√
the continued fraction for 19 by replacing the final number 8 in the period by one-
half of its value, 4 . The figure above shows why this is the right thing to do. We then
2 2
x − 19y
get an infinite sequence of larger and larger positive solutions of = 1 by
170 741
repeatedly applying the periodicity transformation with matrix 39 170 to go from
one solution to the next. For example,
! ! !
170 741 170 57799
=
39 170 39 13260
so the next solution of x 2 − 19y 2 = 1 after (170, 39) is (57799, 13260) , and we could
compute more solutions if we wanted. Obviously they are getting large rather quickly.
170 741
The two 170 ’s in the matrix 39 170 can hardly be just a coincidence. Notice
also that the entry 741 factors as 19·39 which hardly seems like it should be just a
coincidence either. Let us check that these numbers had to occur. In general, for the
form x 2 − dy 2 let us suppose that we have found the first solution (x, y) = (p, q)
after (1, 0) for Pell’s equation x 2 − dy 2 = 1 , so p 2 − dq2 = 1 . Then based on the
previous example we suspect that the periodicity transformation is the transformation
100 Chapter 4 — Quadratic Forms
To check that this is correct the main thing to verify is that T preserves the values of
the quadratic form. When we plug in (px + dqy, qx + dy) for (x, y) in x 2 − dy 2
we get
so T does preserve the values of the form. In particular T takes regions in the to-
pograph with positive values to other such regions, and similarly for regions with
p dq
negative values, so the separator line is taken to itself. The determinant of q p is
p 2 − dq2 = 1 which is positive so T preserves orientation and hence it has to be a
translation along the separator line. Since we chose (p, q) to be the first solution of
x 2 − dy 2 = 1 after (1, 0) it follows that T is the periodicity transformation and all
occurrences of the label 1 along the separator line are images of the one at 1/0 under
positive or negative powers of T . (We have not actually proved yet that periodic sep-
arator lines always exist for forms x 2 − dy 2 , but this will be shown in Theorem 5.2
in the next chapter.)
There are no other solutions of x 2 − 19y 2 = 1 besides the ones along the sep-
arator line because, as we will see in Section 5.1, the values in a topograph with a
separator line change in a monotonic fashion as one moves away from the separa-
tor line, steadily increasing toward +∞ on the positive side of the separator line and
steadily decreasing toward −∞ on the negative side. Thus the value 1 can occur only
along the separator line itself. The monotonicity property also implies that the value
−1 never appears in the topograph of x 2 − 19y 2 since it does not appear along the
separator line, so the negative Pell equation x 2 − 19y 2 = −1 has no integer solutions.
For an example where x 2 − dy 2 = −1 does have solutions, let us look again at
the earlier example of x 2 − 13y 2 .
Exercises
(I) Q(x, y) takes on both positive and negative values but not 0 . In this case we
call Q a hyperbolic form.
(II) Q(x, y) takes on both positive and negative values and also the value 0 . Then
we call Q a 0 - hyperbolic form.
(III) Q(x, y) takes on only positive values or only negative values. Then we call Q
an elliptic form.
(IV) Q takes on the value 0 and either positive or negative values, but not both.
Then Q is called a parabolic form.
Discriminants play a central role in the theory of quadratic forms. A natural question
to ask is whether every integer occurs as the discriminant of some form, and this is
easy to answer. For a form ax 2 + bxy + cy 2 we have ∆ = b2 − 4ac , and this is
congruent to b2 mod 4 . A square such as b2 is always congruent to 0 or 1 mod 4 ,
so the discriminant of a form is always congruent to 0 or 1 mod 4 . Conversely, for
every integer ∆ congruent to 0 or 1 mod 4 there exists a form whose discriminant
is ∆ since:
x 2 − ky 2 has discriminant ∆ = 4k
x 2 + xy − ky 2 has discriminant ∆ = 4k + 1
We will call this property the Second Arithmetic Progression Rule. To see why it is
true, start with the edge labeled h in the figure, with the adjacent regions labeled p
and q . The original Arithmetic Progression Rule then gives the value p + q + h in the
next region to the right. From this we can deduce that the label on the edge between
the regions labeled p and p + q + h must be h + 2p since this is the increment from
q to p + (p + q + h) . Thus the edge label increases by 2p when we move from one
104 Chapter 5 — The Classification of Quadratic Forms
edge to the next edge to the right, so by repeated applications of this fact we see that
we have an arithmetic progression of edge labels all along the border of the region
labeled p .
Another thing worth noting at this point is something that we will refer to as the
Monotonicity Property . This says that in the figure at
the right, if the three labels p , q , and h adjacent to
an edge are all positive, then so are the three labels
for the next two edges in front of this edge, and the
new labels are larger than the old labels. It follows
that when one continues forward out this part of the
topograph, all the labels become monotonically larger
the farther one goes. Similarly, when the original three labels are negative, all the
labels become larger and larger negative.
Next we have a very useful way to compute the discriminant of a form directly
from its topograph:
Proof: For the given form Q(x, y) = ax 2 + bxy + cy 2 , the 1/0 and 0/1 regions in
the topograph are labeled a and c , and the edge in the topograph
separating these two regions has h = b since the 1/1 region is
labeled a + b + c . So the statement of the proposition is correct
for this edge. For other edges we proceed by induction, moving
farther and farther out the tree. For the induction step suppose
we have two adjacent edges labeled h and k as in the figure, and
suppose inductively that the discriminant equals h2 −4pq . We have r = p+q+h , and
from the second arithmetic progression rule we know that k = h + 2q . Then we have
k2 − 4qr = (h + 2q)2 − 4q(p + q + h) = h2 + 4hq + 4q2 − 4pq − 4q2 − 4hq = h2 − 4pq ,
which means that the result holds for the edge labeled k as well. ⊓
⊔
Elliptic forms have fairly simple qualitative behavior so let us look at these forms
first. Recall that we defined a form Q(x, y) to be elliptic if it takes on only positive
or only negative values at all integer pairs (x, y) 6= (0, 0) . The positive and negative
cases are equivalent since one can switch from one to the other just by putting a minus
sign in front of Q . Thus it suffices to consider the case that Q takes on only positive
values, and we will always assume we are in this case whenever we are dealing with
elliptic forms. We will also generally assume when we look at topographs of elliptic
forms that the orientations of the edges are chosen so as to give positive h - values,
unless we state otherwise.
For a positive elliptic form Q let p be the minimum positive value taken on by
Q , so Q(x, y) = p for some (x, y) ≠ (0, 0) . Here (x, y) must be a primitive pair
Section 5.1 — The Four Types of Forms 105
otherwise Q would take on a smaller positive value than p . Thus there is a region
in the topograph of Q with the label p . All the edges having one endpoint at this
region must be oriented away from the region, by the arithmetic
progression rule and the assumption that p is the minimum value
of Q . The monotonicity property then implies that all edges farther
away from the p region are also oriented away from the region, and
the values of Q increase steadily as one moves away from the p
region.
For the edges making up the border of the p region we know
that the h - labels on these edges form an arithmetic progression
with increment 2p , provided that we temporarily re-orient these edges so that they
all point in the same direction. If some edge bordering the p region has the label h = 0
then the topograph has the form shown in the first figure below, with the orientations
on edges that give positive h - labels. An example of such a form is px 2 + qy 2 . We
call the 0 - labeled edge a source edge since all other edges are oriented away from
this edge.
The other possibility is that no edge bordering the p region has label h = 0 .
Then since the labels on these edges form an arithmetic progression, there must be
some vertex where the terms in the progression change sign. Thus when we orient the
edges to give positive h - labels, all three edges meeting at this vertex will be oriented
away from the vertex, as in the second figure above. We call this a source vertex since
all edges in the topograph are oriented away from this vertex.
If the three regions surrounding a source vertex are labeled p, q, r
then the fact that the three edges leading from this vertex all point
away from the vertex is equivalent to the three inequalities p < q + r ,
q < p + r , and r < p + q . These are called triangle inequalities since they are satisfied
by the lengths of the three sides of any triangle. In the case of a source edge one of
the inequalities becomes an equality, for example r = p + q in the earlier figure with
a source edge.
As we know, any three integers p, q, r can be realized as the three labels surround-
ing a vertex in the topograph of some form. If these are positive integers satisfying
the triangle inequalities then this vertex is the source vertex of an elliptic form since
these inequalities imply that the three edges at this vertex are oriented away from
106 Chapter 5 — The Classification of Quadratic Forms
the vertex, so the monotonicity property guarantees that all values of the form are
positive. The situation for source edges is simpler since any two positive integers p
and q determine an elliptic form with a source edge having adjacent regions labeled
p and q as in the earlier figure.
Now let us move on to hyperbolic forms, whose topographs have quite a different
appearance from the topographs of elliptic forms. Most notably, the topographs of
hyperbolic forms always contain a periodic separator line of the sort that we saw in
several of the examples in the previous chapter. Here is the general statement:
Theorem 5.2. In the topograph of a hyperbolic form the edges for which the two
adjacent regions are labeled by numbers of opposite sign form a line which is
infinite in both directions, and the topograph is periodic along this line, with other
edges of the topograph leading off the line on both sides.
Proof: For a hyperbolic form Q all regions in the topograph have labels that are either
positive or negative, never zero, and there must exist two regions of opposite sign.
By moving along a path in the topograph joining two such regions we will somewhere
encounter two adjacent regions of opposite sign. Thus there must exist edges whose
two adjacent regions have opposite sign. Let us call these edges separating edges.
At an end of a separating edge the value of Q in the next region must be either
positive or negative since Q does not take the value 0 :
This implies that exactly one of the two edges at each end of the first separating edge
is also a separating edge. Repeating this argument, we see that each separating edge
is part of a line of separating edges that is infinite in both directions, and the edges
that lead off from this line are not separating edges.
The monotonicity property implies that as we move off this line of separating
edges the values of Q are steadily increasing through positive integers on the posi-
tive side and steadily decreasing through negative integers on the negative side. In
particular this means that there are no other separating edges that are not on the
initial separator line, so there is only one separator line.
It remains to prove that the topograph is periodic along the separator line. We
can assume all the edges along the separator line are oriented in the same direction
by changing the signs of the h values if necessary. For an edge of the separator line
labeled h with adjacent regions labeled p and −q with p > 0 and q > 0 , we know
that h2 + 4pq is the discriminant ∆ , by Proposition 5.1. The equation ∆ = h2 + 4pq
with p and q positive implies that ∆ is positive and furthermore that each of |h| ,
p , and q is less than ∆ . Thus there are only finitely many possible values for h , p ,
and q along the separator line since ∆ is a constant depending only on Q . It follows
Section 5.1 — The Four Types of Forms 107
that there are only finitely many possible combinations of values h , p , and q at each
edge on the separator line. Since the separator line is infinite, there must then be two
edges on the line that have the same values of h , p , and q . Since the topograph is
uniquely determined by the three labels h , p , q at a single edge, the translation of
the line along itself that takes one edge to another edge with the same three labels
must preserve all the labels on the line. This shows that the separator line is periodic.
There must be edges leading away from the separator line on both the positive
and the negative side, otherwise there would be just a single region on one side of
the line and then the second arithmetic progression rule would say that the h labels
along the line formed an infinite arithmetic progression with nonzero increment 2p
where p is the label on the region in question. However, this would contradict the
fact that these h labels are periodic. ⊓
⊔
The qualitative behavior of the topograph of a hyperbolic form away from the
separator line fits the pattern we have seen in examples. Since the separator line is
periodic the whole topograph is periodic, consisting of repeating sequences of trees
leading off from the separator line on each side, with monotonically increasing pos-
itive values of the form on each tree on the positive side of the separator line and
monotonically decreasing negative values on the negative side, as a consequence of
the monotonicity property.
The remaining types of forms to consider are parabolic forms and 0 - hyperbolic
forms. These turn out to be less interesting, and they play only a minor role in the
theory of quadratic forms.
Parabolic and 0 - hyperbolic forms are the forms whose topograph contains at
least one region labeled 0 . By the second arithmetic progression rule, each edge
adjacent to a 0 region has the same label h , and from this it follows that the labels
on the regions adjacent to the 0 region form an arithmetic progression:
Thus the form is parabolic, taking on only positive or only negative values away from
the 0 region. An example of a form with this topograph is Q(x, y) = qx 2 . Notice
108 Chapter 5 — The Classification of Quadratic Forms
that the topograph is periodic along the 0 region since it consists of the same tree
pattern repeated infinitely often.
The remaining case is that the label h on the edges bordering a 0 region is
nonzero. The arithmetic progression of values of Q adjacent to the 0 region is
then not constant, so it includes both positive and negative numbers, and hence Q is
0 - hyperbolic. If the arithmetic progression includes
the value 0 , this gives a second 0 region adjacent to
the first one, and the topograph is as shown at the
right. An example of a form with this topograph is
Q(x, y) = qxy , with the two 0 regions at x/y = 1/0
and 0/1 .
If the arithmetic progression of values of Q adjacent to the 0 region does not
include 0 , there will be an edge separating the positive from the negative values in
the progression. We can extend this separating edge to a line of separating edges
as we did with hyperbolic forms, but the extension will eventually have to terminate
with a second 0 region, otherwise the reasoning we used in the hyperbolic case would
yield two edges along this line having the same h and the same positive and negative
labels on the two adjacent regions, which would force the line to be periodic and
hence extend infinitely far in both directions, which is impossible since it began at a
0 region at one end. Thus the topograph contains a finite separator line connecting
two 0 regions. An example of such a form is Q(x, y) = qxy − py 2 = (qx − py)y
which has the value 0 at x/y = 1/0 and at x/y = p/q . Here we must have |q| > 1 for
the two 0 regions to be nonadjacent. The separator line must then follow the strip of
triangles in the Farey diagram corresponding to the continued fraction for p/q . For
example, for p/q = 2/5 the topograph of the form 5xy − 2y 2 = (5x − 2y)y is the
following:
This completes our description of what the topographs of the four types of forms
look like. We can also deduce the characterization of each type in terms of the dis-
criminant:
Proposition 5.3. The four types of forms are distinguished by their discriminants,
which are negative for elliptic forms, positive nonsquares for hyperbolic forms,
positive squares for 0 -hyperbolic forms, and zero for parabolic forms.
Section 5.1 — The Four Types of Forms 109
Proof: Consider first an elliptic form Q , which we may assume takes on only positive
values since changing Q to −Q does not change the discriminant. The topograph
of Q contains either a source vertex or a source edge. For a source edge with the
label h = 0 separating regions with positive labels p and q the discriminant is ∆ =
h2 − 4pq = −4pq , which is negative. For a source vertex with adjacent regions having
positive labels p, q, r , the edge between the p and q regions is labeled h = p + q − r
so we have
∆ = h2 − 4pq = (p + q − r )2 − 4pq
= p 2 + q2 + r 2 − 2pq − 2pr − 2qr
= p(p − q − r ) + q(q − p − r ) + r (r − p − q)
In the last line the three quantities in parentheses are negative by the triangle inequal-
ities, so ∆ is negative.
For a parabolic form the topograph contains a region labeled 0 bordered by edges
labeled 0 , so ∆ = h2 − 4pq = 0 . A 0 - hyperbolic form has a region labeled 0 bordered
by edges all having the same nonzero label h so ∆ = h2 , a positive square.
For an edge in the separator line for a hyperbolic form the adjacent regions have
labels p and −q with p and q positive so ∆ = h2 + 4pq is positive. To see that
∆ is not a square, suppose the form is ax 2 + bxy + cy 2 . Here a must be nonzero,
otherwise the form would have the value 0 at (x, y) = (1, 0) , which is impossible for a
hyperbolic form. If the discriminant was a square then the equation az 2 + bz + c = 0
would have a rational root z = x/y with y ≠ 0 by the familiar quadratic formula
√ 2
z = (−b ± b2 − 4ac)/2a . Thus we would have a x/y + b x/y + c = 0 and hence
ax 2 + bxy + cy 2 = 0 so the form would have the value 0 at a pair (x, y) with y 6= 0 ,
which is again impossible for a hyperbolic form. ⊓
⊔
Proof: Consider first the hyperbolic and parabolic cases. Suppose (x, y) is a solution
of Q(x, y) = n . If (x, y) is a primitive pair, then n appears in the topograph of
Q so by periodicity it appears infinitely often, giving infinitely many solutions of
Q(x, y) = n . If there is a nonprimitive solution (x, y) then it is d times a primitive
pair (x ′ , y ′ ) with Q(x ′ , y ′ ) = n/d 2 . The latter equation has infinitely many solutions
(x ′ , y ′ ) by what we just showed, hence Q(x, y) = n has infinitely many solutions
(x, y) = (dx ′ , dy ′ ) .
For elliptic and 0 - hyperbolic forms there is no periodicity and the monotonicity
property implies that each number appears in the topograph at most a finite number
110 Chapter 5 — The Classification of Quadratic Forms
of times. Thus Q(x, y) = n can have only finitely many primitive solutions. If it had
infinitely many nonprimitive solutions, these would yield infinitely many primitive
solutions of equations Q(x, y) = m for certain divisors m of n . However, this is
impossible since each equation Q(x, y) = m for a fixed m can have only finitely
many primitive solutions and n has only finitely many divisors since we assume it is
nonzero. ⊓
⊔
Exercises
1. (a) Find two elliptic forms ax 2 + cy 2 that have the same discriminant but take on
different sets of values. Draw enough of the topographs of the two forms to make it
apparent that they do not have exactly the same sets of values. Include the source
vertex or source edge in the topographs. (Remember that the topograph only shows
the values Q(x, y) for primitive pairs (x, y) .)
(b) Do the same thing with hyperbolic forms ax 2 + cy 2 . Include the separator lines
in their topographs.
2. (a) Show the quadratic form Q(x, y) = 92x 2 −74xy +15y 2 is elliptic by computing
its discriminant.
(b) Find the source vertex or edge in the topograph of this form.
(c) Using the topograph of this form, find all the integer solutions of 92x 2 − 74xy +
15y 2 = 60 , and explain why your list of solutions is a complete list. (There are exactly
four pairs of solutions ±(x, y) , three of which will be visible in the topograph.)
3. Show that if a form takes the same value on two adjacent regions of its topograph,
then these regions are both adjacent to the source vertex or edge when the form is
elliptic, or both lie along the separator line when the form is hyperbolic.
4. Show that the minimum value of |h| for all the edges in the border of a given
region in the topograph of an elliptic or hyperbolic form occurs at an edge having an
endpoint that achieves the minimum distance to the separator line or source vertex
or edge of all vertices in the border of the given region.
Let us look at elliptic forms first to see how to determine all the different equiv-
alence classes for a given discriminant in this case. As usual it suffices to consider
112 Chapter 5 — The Classification of Quadratic Forms
This equation implies that h must have the same parity as D , and we can bound the
choices for h by the inequalities 4h2 ≤ 4a2 ≤ 4ac = D + h2 which imply 3h2 ≤ D ,
or h2 ≤ D/3 . This limits h to a finite number of possibilities, and for each of these
values of h we just need to find all of the finitely many factorizations of h2 + D as
4ac with a ≤ c and h ≤ a . In particular this shows that there are just finitely many
equivalence classes of elliptic forms of a given discriminant.
As an example consider the case ∆ = −260 , so D = 260 . Since ∆ is even, so is h ,
and we must have h2 ≤ 260/3 so h must be 0 , 2 , 4 , 6 , or 8 . The corresponding values
of a and c that are possible can then be computed from the equation 4ac = 260+h2 ,
always keeping in mind the requirement that h ≤ a ≤ c . The possibilities are shown
in the following table:
h ac (a, c)
0 65 (1, 65), (5, 13)
2 66 (2, 33), (3, 22), (6, 11)
4 69 —
6 74 —
8 81 (9, 9)
In the first two topographs the central edge is a source edge, and in the last four
topographs the lower vertex is a source vertex.
One might wonder what would happen if we continued the table with larger values
of h not satisfying h2 ≤ 260/3 . For example for h = 10 we would have ac = 90 so the
condition a ≤ c would force a to be 9 or less, violating the condition h ≤ a . Larger
values of h would run into similar difficulties. The condition h2 ≤ D/3 saves one the
trouble of trying larger values of h .
From the topographs it is apparent that these two forms are not equivalent, and also
that the negatives of these two forms, −x 2 + 15y 2 and −3x 2 + 5y 2 , give two more
inequivalent forms, for a total of four equivalence classes so far. To see whether
there are others we use the formula ∆ = 60 = h2 + 4pq relating the values p and
−q along an edge labeled h in the separator line, with p > 0 and q > 0 . The various
possibilities are listed in the table below. The equation ∆ = h2 + 4pq implies that h
and ∆ must have the same parity, just as in the elliptic case.
h pq (p, q)
0 15 (1, 15), (3, 5), (5, 3), (15, 1)
2 14 (1, 14), (2, 7), (7, 2), (14, 1)
4 11 (1, 11), (11, 1)
6 6 (1, 6), (2, 3), (3, 2), (6, 1)
Each pair of values for (p, q) in the table occurs at some edge along the separator
line in one of the two topographs shown above or the negatives of these topographs.
Hence every form of discriminant 60 is equivalent to one of these four. If it had
not been true that all the possibilities in the table occurred in the topographs of the
forms we started with, we could have used these other possibilities for h , p , and q to
generate new topographs and hence new forms, eventually exhausting all the finitely
many possibilities.
The procedure in this example works for all hyperbolic forms. One makes a list
of all the positive integer solutions of ∆ = h2 + 4pq , then one constructs separator
lines that realize all the resulting pairs (p, q) . The different separator lines corre-
spond exactly to the different equivalence classes of forms of discriminant ∆ . Each
solution (h, p, q) gives a form px 2 + hxy − qy 2 . These are organized into “cycles”
corresponding to the pairs (p, −q) occurring along one of the periodic separator lines.
Thus in the preceding example with ∆ = 60 the 14 pairs (p, q) in the table give rise
to the four cycles along the four different separator lines.
A hyperbolic form ax 2 + bxy + cy 2 belongs to one of the cycles for the discrim-
inant ∆ = b2 − 4ac exactly when a > 0 and c < 0 since a and c are the numbers p
and −q lying on opposite sides of an edge of the separator line, when (x, y) = (1, 0)
and (0, 1) .
If we superimpose the separator line of a hyperbolic form on the associated in-
finite strip in the Farey diagram, we see that the forms within a cycle correspond to
the edges of the Farey diagram that lie in the strip and join one border of the strip to
the other. For example, for the form 3x 2 − 5y 2 we obtain the following picture, with
fans of two triangles alternating with fans of three triangles:
Section 5.2 — Equivalence of Forms 115
The number of forms within a cycle can be fairly large in general. The situation can
be improved somewhat by considering only the “most important” forms in the cycle,
namely the forms that correspond to those edges in the strip that separate pairs of
adjacent fans, indicated by heavier lines in the figure above. In terms of the topograph
itself these are the edges in the separator line whose two endpoints have edges leading
away from the separator line on opposite sides. The forms corresponding to these
edges are traditionally called the reduced forms within the given equivalence class. In
the example of discriminant 60 these are the forms with (p, q) = (1, 6) , (6, 1) , (3, 2) ,
and (2, 3) . These are the forms x 2 +6xy −6y 2 , 6x 2 +6xy −y 2 , 3x 2 +6xy −2y 2 , and
2x 2 + 6xy − 3y 2 . In this example there is just one reduced form for each cycle, but
in more complicated examples there can be any number of reduced forms in a cycle.
Note that the reduced forms do not necessarily give the simplest-looking forms, which
in this example were the original forms x 2 − 15y 2 and 3x 2 − 5y 2 along with their
negatives −x 2 + 15y 2 and −3x 2 + 5y 2 , or alternatively 15x 2 − y 2 and 5x 2 − 3y 2 .
For 0 - hyperbolic forms it is rather easy to determine all the equivalence classes
of forms of a fixed discriminant. As we saw in our initial discussion of 0 - hyperbolic
forms, their topographs contain two regions labeled 0 , and the labels on the regions
adjacent to each 0 - region form an arithmetic progression with increment given by the
label on the edges bordering the 0 - region. Previously we called this label h but now
let us change notation and call it q . We may assume q is positive by re-orienting the
edges if necessary. The discriminant is ∆ = q2 so both 0 - regions must have the same
edge label q . Either one of the two arithmetic progressions determines the form up to
equivalence since two successive terms in the progression together with the 0 in the
adjacent region give the three values of the form around a vertex in the topograph.
The form qxy − py 2 has discriminant q2 and has −p as one term of the arith-
metic progression adjacent to the 0 - region x/y = 1/0 , namely in the region x/y = 0/1 .
Thus every 0 - hyperbolic form of discriminant q2 is equivalent to one of these forms
qxy − py 2 . Arithmetic progressions with increment q can be thought of as congru-
ence classes mod q , so only the mod q value of p affects the arithmetic progression
and hence we may assume 0 ≤ p < q . The number of equivalence classes of 0 - hyper-
bolic forms of discriminant q2 is therefore at most q , the number of congruence
classes mod q . However, the number of equivalence classes could be smaller since
each form has two 0 regions and hence two arithmetic progressions, which could be
the same or different. Since either arithmetic progression determines the form, if the
two progressions are the same then the topograph must have a mirror symmetry in-
terchanging the two 0 - regions. This always happens for example if the two 0 - regions
touch, which is the case p = 0 so the form is qxy and the mirror symmetry just in-
terchanges x and y . If we let r denote the number of forms qxy − py 2 without
mirror symmetry then the number of equivalence classes of 0 - hyperbolic forms of
discriminant q2 is q − r since each form without mirror symmetry has two different
116 Chapter 5 — The Classification of Quadratic Forms
For parabolic forms it is easy to describe what all the different equivalence classes
are since we have seen exactly what their topographs look like: There is a single region
labeled 0 and all the regions adjacent to this have the same label q , which can be any
nonzero integer, positive or negative. The integer q thus determines the equivalence
class, so there is one equivalence class of parabolic forms for each nonzero integer q ,
with qx 2 being one form in this equivalence class. Parabolic forms all have discrimi-
nant 0 , so in this case there are infinitely many different equivalence classes with the
same discriminant.
We have now shown how to compute all the equivalence classes of forms of a
given discriminant for each of the four types of forms. In particular we have proved
the following general fact:
Theorem 5.5. There are only a finite number of equivalence classes of forms with
a given nonzero discriminant.
Exercises
1. (a) For positive elliptic forms of discriminant ∆ = −D , verify that the smallest
value of D for which there are at least two inequivalent forms of discriminant −D is
D = 12 .
(b) If we add the requirement that all forms under consideration are primitive, then
what is the smallest D ?
3. Find two elliptic forms that are not equivalent but take on the same three smallest
values a < b < c .
6. (a) Find the smallest positive nonsquare discriminant for which there is more than
one equivalence class of forms of that discriminant. (In particular, show that all
smaller discriminants have only one equivalence class.)
(b) Find the smallest positive nonsquare discriminant for which there are two inequiv-
alent forms of that discriminant, neither of which is simply the negative of the other.
In the first two topographs the central edge is a source edge and in the other four
the lower vertex is a source vertex. Whenever there is a source edge the topograph
has mirror symmetry across a line perpendicular to the source edge. When there is
a source vertex there is mirror symmetry only when at least two of the three sur-
rounding values of the form are equal, as in the third and sixth topographs above,
but not the fourth or fifth topographs. Thus the mirror images of the fourth and
fifth topographs correspond to two more quadratic forms which are not equivalent to
them under any orientation-preserving transformation. With the more refined notion
of proper equivalence there are therefore eight proper equivalence classes of forms
of discriminant −260 .
To obtain explicit formulas for the mirror image forms we can interchange the
coefficients a and c in ax 2 + bxy + cy 2 , which corresponds to interchanging x and
y , reflecting the topograph across a vertical line. Alternatively we could change the
sign of b , corresponding to changing the sign of either x or y and thus reflecting
the topograph across a horizontal line.
For a general discriminant ∆ each equivalence class of forms of discriminant ∆
gives rise to two proper equivalence classes except when the class contains forms
with mirror symmetry, in which case equivalence and proper equivalence amount to
the same thing since every orientation-reversing equivalence can be converted into
118 Chapter 5 — The Classification of Quadratic Forms
Multiplying a form by an integer d > 1 does not change its essential features in
any significant way, so it is reasonable when classifying forms to restrict attention just
to primitive forms, the forms that are not proper multiples of other forms. In other
words, one considers only the forms ax 2 + bxy + cy 2 for which a , b , and c have
no common divisor greater than 1 . The primitivity of a form is detectable just from
the numbers appearing in its topograph since all the numbers in the topograph of a
nonprimitive form are divisible by some number d > 1 , and conversely if all numbers
in the topograph of a form ax 2 +bxy +cy 2 are divisible by d then in particular a , c ,
and a + b + c , the values at (1, 0) , (0, 1) , and (1, 1) , are divisible by d which implies
that b is also divisible by d so the whole form is divisible by d . Thus primitivity
is a property of equivalence classes of forms. Multiplying a form by d multiplies its
discriminant by d2 , so nonprimitive forms of discriminant ∆ exist exactly when ∆ is
a square times another discriminant. For example, when ∆ = −12 = 4(−3) one has
the primitive form x 2 + 3y 2 as well as the nonprimitive form 2x 2 + 2xy + 2y 2 which
is twice the form x 2 + xy + y 2 of discriminant −3 .
inant even though it is divisible by a square, 4 , since the other factor 2 is not the
discriminant of any form, as it is not congruent to 0 or 1 mod 4 . Technically 1 is a
fundamental discriminant according to our definition, but we will exclude this trivial
case. Thus fundamental discriminants are never squares, so fundamental discrim-
inants appear only for elliptic and hyperbolic forms. With 1 excluded it is easy to
check that the fundamental discriminants ∆ with |∆| < 40 are 5 , 8 , 12 , 13 , 17 , 20 ,
21 , 24 , 28 , 29 , 33 , 37 and −3 , −4 , −7 , −8 , −11 , −15 , −19 , −20 , −23 , −24 , −31 ,
−35 , −39 .
It is not hard to characterize precisely the discriminants ∆ that are fundamental.
First write ∆ = 2k n with k ≥ 0 and n odd, possibly negative. If any odd square
divides n then we can factor this out of ∆ and still get a discriminant since odd
squares are congruent to 1 mod 4 so multiplying by an odd square does not affect
whether a number is 0 or 1 mod 4 . The exponent k in 2k can never be 1 since this
would imply ∆ ≡ 2 mod 4 . If k ≥ 4 we can factor powers of 4 out of ∆ until we have
k equal to 2 or 3 and still have a discriminant. If k = 3 we cannot factor a 4 out of
∆ since this would give the excluded case k = 1 . If k = 2 we can factor 4 = 2k out of
∆ exactly when n ≡ 1 mod 4 . Finally, when k = 0 we have ∆ = n so we must have
n ≡ 1 mod 4 . Thus fundamental discriminants other than −4 and ±8 are of three
types:
(1) ∆ = n with |n| a product of distinct odd primes and n ≡ 1 mod 4 .
(2) ∆ = 4n with |n| a product of distinct odd primes and n ≡ 3 mod 4 .
(3) ∆ = 8n with |n| a product of distinct odd primes.
Every nonsquare discriminant can be factored uniquely as ∆ = d2 ∆′ where ∆′ is a
fundamental discriminant and d ≥ 1 . The number d is called the conductor of ∆ .
Fundamental discriminants are those whose conductor is 1 . Conductors will become
important when we study the deeper properties of forms in later chapters. The class
number h∆ is always a multiple of h∆′ and there is a not too complicated formula
for what this multiple is, so the determination of class numbers reduces largely to the
case of fundamental discriminants. However, we will not be going into more detail on
the relationship between h∆ and h∆′ since this would lead us somewhat outside the
scope of the book.
The question of which discriminants have class number 1 has been much studied.
This amounts to finding the discriminants for which all primitive forms are equivalent
since if all primitive forms are equivalent, they are all equivalent to the principal form
which has mirror symmetry so they are all properly equivalent to the principal form.
For elliptic forms the following nine fundamental discriminants have class num-
ber 1 : ∆ = −3, −4, −7, −8, −11, −19, −43, −67, −163
In addition there are four more which are not fundamental: −12, −16, −27, −28 . It
was conjectured by Gauss around 1800 that there are no other negative discriminants
120 Chapter 5 — The Classification of Quadratic Forms
of class number 1 . Over a century later in the 1930s it was shown that there is at
most one more, and then in the 1950s and 60s Gauss’s conjecture was finally proved
completely.
Another result from the 1930s is that for each number n there are only finitely
many negative discriminants with class number n . Finding what these discriminants
are is a difficult problem, however, and so far this has been done only in the range
n ≤ 100 .
The situation for positive discriminants with class number 1 is not as well un-
derstood. Computations show that there are a large number of positive fundamental
discriminants with class number 1 , and it seems likely that there are in fact infinitely
many. However, this has not been proved and remains one of the most basic unsolved
problems about quadratic forms. If one allows nonfundamental discriminants then
it is known that there are infinitely many with h∆ = 1 , including for example the
discriminants ∆ = 22k+1 for k ≥ 1 and ∆ = 52k+1 for k ≥ 0 .
D
7 x2 + x + 2 2
11 x2 + x + 3 35
19 x2 + x + 5 5 7 11 17
43 x 2 + x + 11 11 13 17 23 31 41 53 67 83 101
67 x 2 + x + 17 17 19 23 29 37 47 59 73 89 107 127 149 173 199 227 257
Section 5.3 — The Class Number 121
Satisfactory explanations are known for the occurrence of so many prime values of
these quadratic polynomials but they involve fairly deep theory. It is curious that the
lists of prime values account for all primes less than 100 except 79 .
Suppose one asks about the next 40 values of x 2 + x + 41 after the value 412
when x = 40 . The next value, when x = 41 , is 1763 = 41·43 , also not a prime. After
this the next two values are primes, then comes 2021 = 43·47 , then four primes,
then 2491 = 47·53 , then six primes, then 3233 = 53·61 , then eight primes, then
4331 = 61·71 , then ten primes, then 5893 = 71·83 . This last number was for x = 76 ,
and the next four values are prime as well for x = 77, 78, 79, 80 , completing the
second 40 values. But then the pattern breaks down when x = 81 where one gets
the value 6683 = 41·163 . Thus, before the breakdown, not only were we getting
sequences of 2, 4, 6, 8, 10 primes but the non-prime values were the products of
two successive terms in the original sequence of prime values 41, 43, 47, 53, 61, · · · .
All this seems quite surprising, even if the nice patterns do not continue forever. A
partial explanation can be found in the fact that the polynomial P (x) = x 2 + x + 41
satisfies the identity P (40 + n2 ) = P (n − 1)P (n) as one can easily check, so when
n = 1, 2, 3, · · · we get P (41) = P (0)P (1) = 41·43 , P (44) = 43·47 , P (49) = 47·53 ,
P (56) = 53·61 , etc. However this does not explain why the intervening values of
P (x) should be prime. The polynomials in the table above exhibit similar behavior.
Exercises
2. In this extended exercise the goal will be to show that the only negative even dis-
criminants with class number 1 are −4 , −8 , −12 , −16 , and −28 . (Note that of these,
only −4 and −8 are fundamental discriminants.) The strategy will be to exhibit an
explicit reduced primitive form Q different from the principal form x 2 + dy 2 for
each discriminant −4d with d > 4 except d = 7 . This will be done by breaking the
problem into several cases, where in each case a form Q will be given and you are
to show that this form has the desired properties, namely it is of discriminant −4d ,
primitive, reduced, and different from the principal form. You should also check that
the cases considered cover all possibilities.
(a) Suppose d is not a prime power. Then it can be factored as d = ac where 1 < a < c
and a and c are coprime. In this case let Q be the form ax 2 + cy 2 .
(b) The form ax 2 + 2xy + cy 2 will work provided that d + 1 factors as d + 1 = ac
where a and c are coprime and 1 < a < c . If d is odd, for example a power of an odd
prime, then d + 1 is even so it has such a factorization d + 1 = ac unless d + 1 = 2n .
(c) If d = 2n the cases we need to consider are n ≥ 3 since we assume d > 4 . When
n = 3 take Q to be 3x 2 + 2xy + 3y 2 and when n ≥ 4 take Q to be 4x 2 + 4xy +
122 Chapter 5 — The Classification of Quadratic Forms
(2n−2 + 1)y 2 .
(d) When d + 1 = 2n the cases of interest are n ≥ 3 . When n = 3 we have d = 7
which is one of the allowed exceptions with class number 1 . When n = 4 we have
d = 15 and 3x 2 + 5y 2 works as in part (a). When n = 5 we have d = 31 and we take
the form 5x 2 + 4xy + 7y 2 . When n ≥ 6 we use the form 8x 2 + 6xy + (2n−3 + 1)y 2 .
3. Show that the class number for discriminant ∆ = q2 > 1 is ϕ(q) where ϕ(q) is
the number of positive integers less than q and coprime to q .
Elliptic forms can have mirror symmetries as well, as we saw in the earlier example
∆ = −260 where two topographs had mirror symmetry across a line perpendicular to
an edge and two had symmetry across a line containing an edge.
There is a simple characterization of when each of the two types of mirror sym-
metry occurs in terms of coefficients:
Proposition 5.6. (i) The forms whose topograph has a mirror symmetry reflecting
across a line perpendicular to an edge and passing through its midpoint are exactly
the forms equivalent to a form ax 2 + cy 2 .
Section 5.4 — Symmetries of Forms 123
(ii) The forms whose topograph has a mirror symmetry reflecting across a line
containing an edge of the topograph are exactly the forms equivalent to a form
ax 2 + bxy + ay 2 . Alternatively, one could take forms ax 2 + axy + cy 2 , or forms
ax 2 + cxy + cy 2 .
The first figure shows the labels surrounding an edge in a topograph, the central edge
in the figure. There is a mirror symmetry across a line perpendicular to this edge
exactly when b = 0 since the labels a + b + c and a − b + c above and below the edge
must be equal. This symmetry is shown in the second figure as reflection across the
dotted line. The other type of mirror symmetry is reflection across the line containing
the central edge, as in the third figure. This occurs exactly when a = c , and in this
case d = 2a + b and e = 2a − b . A form whose topograph has one of these two types
of mirror symmetry is thus equivalent to a form ax 2 + cy 2 or ax 2 + bxy + ay 2 ,
respectively, where the region to the left of the central edge is the 1/0 region and the
region to the right is the 0/1 region.
For the second type of mirror symmetry we could also choose one of the upper two
edges to be the edge between the 1/0 and 0/1 regions and then the form would become
ax 2 + dxy + dy 2 or dx 2 + dxy + ay 2 . Conversely, every form ax 2 + dxy + dy 2 or
dx 2 + dxy + ay 2 has the mirror symmetry shown in the figure since for example the
upper left edge labeled d together with the adjacent regions labeled a and d force
the region on the right to also be labeled a . ⊓
⊔
next chapter. For fundamental discriminants we will see that the numbers appearing
on reflector lines are exactly the divisors of the discriminant, but for nonfundamental
discriminants this need not be true.
Let us consider now what sorts of symmetries are possible in general for the vari-
ous types of forms, beginning with elliptic forms. For an elliptic form each symmetry
must take the source vertex or edge to itself since this is where the smallest values
of the form occur. In the case of a source edge, if a symmetry does not interchange
the two ends of the source edge then the symmetry must be either the identity or a
reflection across a line containing the source edge. If a symmetry does interchange
the two ends of a source edge then it must either be a reflection across a line perpen-
dicular to the edge or a 180 degree rotation of the topograph about the midpoint of
the edge. Referring to the figure at the right, this rotation can only
give a symmetry if a = c and a+b +c = a−b +c which is equivalent
to having b = 0 . Thus the form is ax 2 + ay 2 so if it is primitive it
is just x 2 + y 2 . Note that multiplying any form by a constant does
not affect its symmetries so there is no harm in considering only
primitive forms. For the form x 2 + y 2 note also that this form has
both types of mirror symmetries, and the composition of these two
mirror symmetries is the 180 degree rotational symmetry.
For a source vertex, a symmetry must take this vertex to itself. If a symmetry is
orientation-preserving and not the identity then it must be a rotation about the source
vertex by either one-third or two-thirds of a full turn. In either case this means that
the three labels around the source vertex must be equal, so if the source vertex is
the lower vertex in the figure above then the condition is a = c = a − b + c , which is
equivalent to saying a = b = c . The form is then ax 2 + axy + ay 2 so if it is primitive
it is x 2 + xy + y 2 . The only other sort of symmetry for a source vertex is reflection
across a line containing one of the three edges that meet at the source vertex. The
only time there can be more than one such symmetry is when all three adjacent labels
are equal so we are again in the situation of a form ax 2 + axy + ay 2 .
For an elliptic form ax 2 + bxy + cy 2 that is reduced, so 0 ≤ b ≤ a ≤ c , it is
easy to recognize exactly when symmetries occur, namely when at least one of these
three inequalities becomes an equality. Again using the figure above, when b = 0 one
has a source edge with a mirror symmetry across the perpendicular line. When b = a
we have a − b + c = c so there is a mirror symmetry across the lower right edge.
And when a = c one has mirror symmetry across the central edge. Since a and c
are the two smallest labels on regions in the topograph, we see that reduced forms
ax 2 + bxy + ay 2 occur when the smaller two of the three labels at the source vertex
are equal, and reduced forms ax 2 + axy + cy 2 occur when the larger two labels are
equal, at 0/1 and ---1/1 .
Certain combinations of equalities in 0 ≤ b ≤ a ≤ c are also possible. If b = 0 and
Section 5.4 — Symmetries of Forms 125
a = c the form is a(x 2 + y 2 ) with a source edge and both types of mirror symmetry
as well as 180 degree rotational symmetry. Another possibility is that b = a = c so
the form is a(x 2 + xy + y 2 ) with the symmetries described earlier. These are the
only combinations of equalities that can occur since we must have a > 0 so 0 = b = a
is impossible.
For reduced elliptic forms this exhausts all the possible symmetries since if we
have strict inequalities 0 < b < a < c then the values of the form in the four regions
shown in the figure above are all distinct. The first time this occurs is when the
inequalities are 0 < 1 < 2 < 3 so the form is 2x 2 + xy + 3y 2 of discriminant −23 .
Now consider hyperbolic forms. These all have periodic separator lines so they
always have translational symmetries, and the question is what other sorts of sym-
metries are possible. For a hyperbolic form each symmetry must take the separator
line to itself since this line consists of the edges that separate positive from negative
values of the form. It is a simple geometric fact that a symmetry of a line L that is
divided into a sequence of edges, say of length 1 , extending to infinity in both direc-
tions, must be either a translation along L by some integer distance in either direction,
or a reflection of L fixing either a vertex of L or the midpoint of an edge of L and
interchanging the two halves of L on either side of the fixed point. This can be seen
as follows. Symmetries of L are assumed to take vertices to vertices, so suppose the
symmetry T sends a vertex v to the vertex T (v) . Then if T preserves the orientation
of L it must be a translation along L by the distance from v to T (v) as one can see
by considering what T does to the two edges adjacent to v , then to the next two
adjacent edges on either side, then the next two edges, and so on. If T reverses the
orientation of L then either T (v) = v or T fixes the midpoint of the segment from v
to T (v) since it sends this segment to a segment of the same length with one end at
T (v) but extending back toward v since T reverses orientation of L . Thus T fixes a
point of L in either case, and it follows that T must reflect L across this fixed point,
as one can again see by considering the edge or edges containing the fixed point, then
the next two edges, and so on. If the distance from v to T (v) is an even integer the
midpoint between v and T (v) will be a vertex and if it odd the midpoint will be a
midpoint of an edge.
Returning to the situation of a symmetry T of the topograph of a hyperbolic form
that takes the separator line L to itself, T must also take the side of L with positive
labels to itself, so T preserves orientation of the plane exactly when it preserves ori-
entation of L . Thus the only orientation-preserving symmetries of the topograph are
translations along the separator line, and the only orientation-reversing symmetries
are the two kinds of reflections across lines perpendicular to L .
If the separator line of a hyperbolic form has a mirror symmetry then because of
periodicity there has to be at least one reflector line in each period, but in fact there are
exactly two reflector lines in each period. To see this, let T be the translation by one
126 Chapter 5 — The Classification of Quadratic Forms
period and let R1 be a reflection across a reflector line L1 . Consider the composition
T R1 , reflecting first by R1 then translating by T , so T R1 is an orientation-reversing
symmetry. If L2 is the line halfway between L1 and T (L1 ) then T (R1 (L2 )) = L2 as
we can see in the first figure below.
Let us define the symmetric class number, hs∆ to be the number of equivalence
classes of primitive forms of discriminant ∆ with mirror symmetry. Recall that equiv-
alence is the same as proper equivalence for forms with mirror symmetry. The or-
dinary class number h∆ is thus hs∆ plus twice the number of equivalence classes of
primitive forms without mirror symmetry. We have h∆ ≥ hs∆ , and in fact h∆ is always
an integer multiple of hs∆ as we will see in Proposition 7.17.
In contrast with h∆ it is possible to compute hs∆ explicitly. Here is the result for
elliptic and hyperbolic forms:
Proof: By Proposition 5.6 every form with mirror symmetry is equivalent to a form
ax 2 + cy 2 or ax 2 + axy + cy 2 . The strategy will be to count how many of these
special forms there are that are primitive with discriminant ∆ , then determine which
of these special forms are equivalent.
For counting the special forms ax 2 + cy 2 and ax 2 + axy + cy 2 we may assume
a > 0 since a is the value of the form when (x, y) = (1, 0) and for elliptic forms
we only consider those with positive values, while for hyperbolic forms we are free to
change a form to its negative so it suffices to count only those with a > 0 and then
double the result.
Case 1: Forms ax 2 + cy 2 . Then ∆ = −4ac = 4δ for δ = −ac . Primitivity of the
form is equivalent to a and c being coprime. The only way to have coprime factors a
and c of δ = −ac is to take an arbitrary subset of the distinct primes dividing δ and
let a be the product of these primes each raised to the same power as in δ (so a = 1
′
when we choose the empty subset). The number of such subsets is 2k where k′ is the
128 Chapter 5 — The Classification of Quadratic Forms
′
number of distinct prime divisors of δ , so there are 2k primitive forms ax 2 + cy 2
with a > 0 .
Case 2: Forms ax 2 + axy + cy 2 with ∆ odd. We have ∆ = a2 − 4ac so ∆ and a
have the same parity. From ∆ = a(a − 4c) we see that a divides ∆ . We claim that
each divisor a of ∆ gives rise to a form ax 2 + axy + cy 2 of discriminant ∆ . Solving
∆ = a2 −4ac for c gives c = (a2 −∆)/4a . The numerator is divisible by 4 since a and
∆ are odd and hence a2 and ∆ are both 1 mod 4 , making the numerator 0 mod 4 .
The numerator is also divisible by a if a divides ∆ . Since 4 and a are coprime when
a is odd it follows that 4a divides the numerator so c is an integer and we get a form
ax 2 + axy + cy 2 of discriminant ∆ . This form is primitive exactly when a and c
are coprime. This is equivalent to saying that the two factors of ∆ = a(a − 4c) are
coprime since any divisor of a and c must divide the two factors, and conversely any
divisor of the two factors must divide a and 4c , hence also c since this divisor of
the odd number a must be odd. As in Case 1, the only way to obtain a factorization
∆ = a(a−4c) with the two factors coprime is to take an arbitrary subset of the distinct
primes dividing ∆ and let a be the product of these primes each raised to the same
power as in ∆ . The number of such subsets is 2k so this is the number of primitive
forms ax 2 + axy + cy 2 with a > 0 when ∆ is odd.
There remain the forms ax 2 + axy + cy 2 with ∆ = 4δ . Again ∆ and a have the
same parity since ∆ = a2 − 4ac , so a is even, say a = 2d . From ∆ = a2 − 4ac we
then have δ = d2 − 2dc = d(d − 2c) .
Case 3: Forms ax 2 + axy + cy 2 with ∆ = 4δ and a = 2d for odd d . By primitivity
c must be odd. The two factors of δ = d(d − 2c) are odd and must be distinct
mod 4 since c is odd. Thus one factor is 1 mod 4 and the other is 3 mod 4 , so
δ ≡ 3 mod 4 , say δ = 4m + 3 . We claim that when δ = 4m + 3 , each divisor d
of δ gives rise to a form ax 2 + axy + cy 2 with a = 2d . To show this, note first
that d must be odd since it divides δ which is odd. Solving δ = d(d − 2c) for c
gives c = (d2 − δ)/2d . Since d and δ are odd, the numerator d2 − δ is even hence
divisible by the 2 in the denominator. The numerator is also divisible by the d in
the denominator if d divides δ . Since d is odd, this implies that 2d divides the
numerator, so c is an integer for each divisor d of δ . In fact c is an odd integer since
the numerator d2 − δ is 2 mod 4 and so cd = (d2 − δ)/2 is odd, forcing c to be
odd. For the form ax 2 + axy + cy 2 to be primitive means that a and c are coprime.
Since c is odd and a = 2d this is equivalent to c and d being coprime. This in turn is
equivalent to the two factors of δ = d(d − 2c) being coprime since c and d are odd.
Thus when δ = 4m + 3 we get a primitive form ax 2 + axy + cy 2 for each choice of
a subset of the distinct prime divisors of δ since this determines d as before, and d
′
determines c and a . The number of primitive forms ax 2 + axy + cy 2 is then 2k
when ∆ is even and a = 2d with d odd, where k′ is the number of distinct prime
divisors of δ as in Case 1.
Section 5.4 — Symmetries of Forms 129
∆ odd 4δ , δ = 4m + 1 4δ , δ = 4m + 3
Cases (2) (1) (1) & (3)
k′ ′ ′ ′
∆<0 2 k
2 =2 k−1
2k + 2k = 2k +1 = 2k
′ ′ ′ ′
∆>0 2k+1 2k +1 = 2k 2k +1 + 2k +1 = 2k +2 = 2k+1
∆ 4δ , δ = 8m 4δ , δ even, δ ≠ 8m
Cases (1) & (4) (1)
k′ k′ k′ +1 k+1 ′
∆<0 2 +2 =2 =2 2k = 2k
′ ′ ′ ′
∆>0 2k +1 + 2k +1 = 2k +2 = 2k+2 2k +1 = 2k+1
Comparing the results in the table with the statement of the theorem, we see that the
proof will be finished when we show that under the relation of equivalence the special
forms split up into pairs when ∆ < 0 and into groups of four when ∆ > 0 .
Two easy cases that can be disposed of first are ∆ = −3 and ∆ = −4 . Here all
forms are equivalent and are primitive, and k = 1 , so the theorem is true since the
exceptional cases (i) and (ii) in the theorem do not apply.
Our earlier analysis of symmetries of elliptic and hyperbolic forms shows that the
only time that reflector lines can intersect is for elliptic forms equivalent to ax 2 +ay 2
or ax 2 + axy + ay 2 , so when we restrict to primitive forms this means ∆ = −3 or
∆ = −4 . Thus we may assume from now on that reflector lines do not intersect.
130 Chapter 5 — The Classification of Quadratic Forms
We illustrate the theorem with an example, the first negative discriminant with
four distinct prime divisors, ∆ = −420 = −3·4·5·7 . In this case ∆ = 4(4m+3) so the
theorem says there are 23 = 8 equivalence classes of symmetric primitive forms. If
we compute all the reduced forms for ∆ = −420 by the method earlier in the chapter
we get the following table, with the letter b replacing h so we are finding solutions
of b2 + 420 = 4ac with 0 ≤ b ≤ a ≤ c . The entries [a, b, c] in the last column give
the reduced forms ax 2 + bxy + cy 2 .
b ac (a, c) [a, b, c]
0 105 (1, 105) [1, 0, 105]
(3, 35) [3, 0, 35]
(5, 21) [5, 0, 21]
(7, 15) [7, 0, 15]
2 106 (2, 53) [2, 2, 53]
4 109 —
6 114 (6, 19) [6, 6, 19]
8 121 (11, 11) [11, 8, 11]
10 130 (10, 13) [10, 10, 13]
Thus all forms of discriminant −420 are symmetric. The first four have b = 0 so
these arise in Case 1 in the proof of the theorem where we set ∆ = 4δ , so δ =
−3·5·7 and we get a form [a, 0, c] for each positive divisor a of δ , the eight numbers
Section 5.4 — Symmetries of Forms 131
1, 3, 5, 7, 15, 21, 35 , and 105 . These forms [a, 0, c] are the first four entries in the last
column of the table along with the equivalent forms obtained by reversing a and c .
The remaining four forms in the last column have b nonzero and are instances of
forms [a, a, c] and [a, b, a] . The relevant parts of the topographs of these four
forms are shown in the figure. Each edge in the figure gives a form [a, b, a] , [a, a, c] ,
or [a, c, c] . For example the third figure gives the forms [11, 8, 11] , [11, 14, 14] ,
[14, 14, 11] , [11, 30, 30] , and [30, 30, 11] . In the proof of the theorem we were only
counting the forms [a, a, c] , not [a, b, a] or [a, c, c] . According to Case 3 in the proof
of the theorem the numbers a in the forms [a, a, c] should be twice the numbers a in
the forms [a, 0, c] , and they are: 2 = 2·1 , 6 = 2·3 , 10 = 2·5 , 14 = 2·7 , 30 = 2·15 ,
42 = 2·21 , 70 = 2·35 , and 210 = 2·105 .
Proof: Consider first the case ∆ > 0 . If we are not in one of the exceptional cases (i)
and (ii) in the theorem then ∆ must have just one distinct prime divisor so it must be
a power of a prime, in fact an odd power if it is not a square. Thus for p odd we have
∆ = p 2k+1 and we must have p ≡ 1 mod 4 in order to have ∆ ≡ 1 mod 4 . For odd
powers of p = 2 the only possibility is ∆ = 8 since ∆ cannot be 2 and odd powers
beyond 8 are of the form ∆ = 32m , the exceptional case (ii) where hs∆ ≥ 2 so this is
ruled out as well. In the exceptional case (i) we have ∆ = 4(4m + 1) with 4m + 1 a
prime power p 2k+1 with p ≡ 1 mod 4 since ∆ = 4p 2k is a square.
When ∆ < 0 the reasoning is similar, the main difference being that −p 2k and
−4p 2k are ruled out, not because squares are excluded, but because p 2k is always 1
mod 4 when p is odd, so −p 2k is 3 mod 4 . This rules out −p 2k as a discriminant,
and it rules out −4p 2k being an exceptional case ∆ = 4(4m + 1) .
Requiring ∆ to be a fundamental discriminant eliminates the cases ∆ = −16 and
±4p 2k+1 and restricts the exponent in ±p 2k+1 to be 1 . ⊓
⊔
We have mentioned the fact that h∆ is always a multiple of hs∆ , which will be
proved in Proposition 7.17. This tells us nothing about h∆ when hs∆ = 1 , but we will
also prove that hs∆ = 1 exactly when h∆ is odd. Thus the preceding corollary gives a
way to determine whether h∆ is even or odd. In the examples we have looked at so
far h∆ has been either 1 or even, but odd numbers greater than 1 can also occur as
class numbers. The table below gives some examples for negative discriminants, so
we are finding the solutions of h2 + |∆| = 4ac with 0 ≤ h ≤ a ≤ c as usual.
132 Chapter 5 — The Classification of Quadratic Forms
∆ h ac (a, c) h∆
−23 1 6 (1, 6), (2, 3) 3
−47 1 12 (1, 12), (2, 6), (3, 4) 5
3 14 —
−71 1 18 (1, 18), (2, 9), (3, 6) 7
3 20 (4, 5)
−199 1 50 (1, 50), (2, 25), (5, 10) 9
3 52 (4, 13)
5 56 (7, 8)
7 62 —
−167 1 42 (1, 42), (2, 21), (3, 14), (6, 7) 11
3 44 (4, 11)
5 48 (6, 8)
7 54 —
−191 1 48 (1, 48), (2, 24), (3, 16), (4, 12), (6, 8) 13
3 50 (5, 10)
5 54 (6, 9)
7 60 —
−239 1 60 (1, 60), (2, 30), (3, 20), (4, 15), (5, 12), (6, 10) 15
3 62 —
5 66 (6, 11)
7 72 (8, 9)
The examples in the table are all fundamental discriminants, and in each case they
are the first negative discriminant with the given class number.
Besides the cases when hs∆ = 1 another nice situation is when h∆ = hs∆ so all
primitive forms of discriminant ∆ have mirror symmetry. We call such discriminants
fully symmetric. As we will see in the following chapters, forms with fully symmetric
discriminants have very special properties. A table at the end of the book lists the 101
known negative discriminants that are fully symmetric, ranging from −3 to −7392 .
Of these, 65 are fundamental discriminants, the largest being −5460 . Since 5460
factors as 3·4·5·7·13 with five distinct prime factors, Theorem 5.9 says that hs∆ =
24 = 16 . This is in fact the largest value of hs∆ among the 101 discriminants in the list.
Computer calculations have extended to much larger negative discriminants without
finding any more that are fully symmetric. It has not yet been proved that no more
exist, although it is known that there are at most two more. For positive discriminants
there are probably infinitely many that are fully symmetric since it is likely that there
are already infinitely many with h∆ = 1 .
Section 5.4 — Symmetries of Forms 133
Among the examples of hyperbolic forms we have considered there were some
whose topograph had a “symmetry” which was a glide reflection along the separator
line that had the effect of changing each value to its negative rather than preserving
the values. These are not actual symmetries according to the definition we have given,
so let us call such a transformation that takes each value of a form to its negative a
skew symmetry . (Compare this with skew-symmetric matrices in linear algebra which
equal the negative of their transpose.)
A skew symmetry must take the separator line to itself while interchanging the
two sides of the separator line, so it either translates the separator line along itself and
hence is a glide reflection, or it reflects the separator line, interchanging its two ends
as well as the two sides of the separator line, making it a 180 degree rotation about
a point of the separator line. Examples of forms with this sort of skew symmetry
occurred in Chapter 4, the forms x 2 − 13y 2 and 10x 2 − 29y 2 .
The figures below show forms whose separator lines have all the possible combi-
nations of symmetries and skew symmetries.
The first form has all four types: translations, mirror symmetries, glide reflections,
and rotations. The next three forms have only one type of symmetry or skew symmetry
besides translations, while the last form has only translational symmetries and no
mirror symmetries or skew symmetries. It is not possible to have two of the three
types of non-translational symmetries and skew symmetries without having the third
since the composition of two of these three types gives the third type. One can see
this by considering the effect of a symmetry or skew symmetry on the orientation of
the plane and the orientation of the separator line. The four possible combinations
134 Chapter 5 — The Classification of Quadratic Forms
distinguish the four types of transformations according to the following chart, where a
plus sign means orientation-preserving and a minus sign means orientation-reversing.
plane orientation line orientation
translation + +
rotation + −
glide reflection − +
reflection − −
Exercises
1. Show that the number of symmetries of an elliptic form, including the identity
transformation, is 1 , 2 , 4 , or 6 .
3. In the text an example was given of a hyperbolic form having only translational
symmetries and no skew symmetries, the form 5x 2 + 14xy − 10y 2 . Find another
example of the same sort which is not equivalent to this form or a constant times it.
[First find a separator line with the desired properties, without any labels along the
line, then find a form realizing that separator line.]
5. Verify that the following discriminants are fully symmetric, so all primitive forms
of that discriminant have mirror symmetry:
(a) −195 (b) −660 (c) 195
6. Show that the topograph of a primitive 0 - hyperbolic form qxy − py 2 has mirror
symmetry exactly when p 2 ≡ 1 mod q , and has rotational skew symmetry exactly
when p 2 ≡ −1 mod q . (See the discussion in Chapter 2 about the relation between
the continued fraction for p/q and the continued fraction obtained by reversing the
order of the terms.)
Thus primitive forms correspond exactly to rays from the origin passing through
lattice points. These are the same as rays passing through points (a, b, c) with rational
coordinates since denominators can always be eliminated by multiplying a , b , and c
by a common denominator.
Since the discriminant ∆ = b2 − 4ac plays such an important role in the clas-
sification of forms, let us see how this fits into the picture in (a, b, c) coordinates.
When b2 − 4ac is zero we have the special class of parabolic forms, and the points
in R3 satisfying the equation b2 − 4ac = 0 form a double cone with the common
vertex of the two cones at the origin. The double
cone intersects the ac- plane in the a- axis and
the c- axis. The central axis of the double cone is
the line a = c in the ac- plane. Points (a, b, c)
inside either cone have b2 − 4ac < 0 so the lat-
tice points inside the cones correspond to elliptic
forms. Positive elliptic forms have a > 0 and c > 0 so they lie inside the cone pro-
jecting to the first quadrant of the ac- plane. We call this the positive cone. Inside the
other cone are the negative elliptic forms, those with a < 0 and c < 0 . Outside the
cones is a single region consisting of points with b2 − 4ac > 0 so the lattice points
here correspond to hyperbolic forms and 0 - hyperbolic forms.
If one slices the positive cone via the vertical plane a + c = 1 perpendicular to
the axis of the cone then the intersection of the cone with this plane is an ellipse
which we denote E . The top and bottom
points of E are (a, b, c) = 1/2 , ±1, 1/2 so
its height is 2 . The left and right points of E
√
are (1, 0, 0) and (0, 0, 1) so its width is 2 .
Thus E is somewhat elongated vertically. If
we wanted, we could compress the vertical
coordinate to make E a circle, but there is
no special advantage to doing this.
If we take a lattice point (a, b, c) corresponding to a primitive positive elliptic
form and project this lattice point along the ray to the origin passing through (a, b, c) ,
this ray intersects the plane a+c = 1 in the point a/a + c , b/a + c , c/a + c since the sum
of the first and third coordinates of this point is 1 . This point lies inside the ellipse
E and has rational coordinates. Conversely, every point inside E with rational coor-
dinates is the radial projection of a unique primitive positive elliptic form, obtained
by multiplying the coordinates of the point by the least common multiple of their de-
nominators. Thus the rational points inside E parametrize primitive positive elliptic
forms. We will use the notation [a, b, c] to denote both the form ax 2 + bxy + cy 2
and the corresponding rational point a/a + c , b/a + c , c/a + c inside E . The figure be-
low shows some examples, including a few parabolic forms on E itself.
Section 5.5 — Charting All Forms 137
In the figure the lines radiating out from the points [1, 0, 0] and [0, 0, 1] consist of
the points [a, b, c] with a fixed ratio b/a or b/c . The ratios a/c are fixed along vertical
lines. Two out of three of these ratios determine the third since b/a · a/c = b/c .
Of special interest are the reduced primitive elliptic forms [a, b, c] , which are
those satisfying 0 ≤ b ≤ a ≤ c where a , b , and c have no common divisor. These
correspond to the rational points in the shaded triangle in the figure above, with
vertices [1, 1, 1] , [1, 0, 1] , and [0, 0, 1] . The edges of the triangle correspond to one
of the three inequalities 0 ≤ b ≤ a ≤ c becoming an equality, so b = 0 for the lower
edge, a = c for the vertical edge, and a = b for the hypotenuse. Thus the three edges
correspond to the reduced forms with mirror symmetry, the forms [a, 0, c] for the
bottom edge, [a, b, a] for the left edge, and [a, a, c] for the diagonal edge. Points in
the interior of the triangle correspond to forms without mirror symmetry.
Just as rational points inside the ellipse E correspond to primitive positive elliptic
forms, the rational points on E itself correspond to primitive positive parabolic forms.
As we know, every parabolic form is equivalent to the form ax 2 for some nonzero
integer a . For this to be primitive means that a = ±1 , so every positive primitive
parabolic form is equivalent to x 2 . Equivalent forms are those that can be obtained
from each other by a change of variable replacing (x, y) by (px + qy, r x + sy) for
138 Chapter 5 — The Classification of Quadratic Forms
some integers p, q, r , s satisfying ps − qr = ±1 . For the form x 2 this means that the
primitive positive parabolic forms are the forms (px + qy)2 = p 2 x 2 + 2pqxy + q2 y 2
for any pair of coprime integers p and q . In [a, b, c] notation this is [p 2 , 2pq, q2 ] ,
defining a point on the ellipse E .
More concisely, we could label the rational point on E corresponding to the form
(px + qy)2 just by the fraction p/q . Thus at the left and right sides of E we have
the fractions 1/0 and 0/1 corresponding to the forms x 2 and y 2 , while at the top and
bottom of E we have 1/1 and ---1/1 corresponding to (x+y)2 and (x−y)2 = (−x+y)2 .
Note that changing the signs of both p and q does not change the form (px + qy)2
or the fraction p/q . In the first quadrant of the ellipse the fractions p/q increase
monotonically from 0/1 to 1/1 since the ratio b/c equals 2p/q and b is increasing
while c is decreasing so 2p/q is increasing, and hence so is p/q . Similarly in the
second quadrant the values of p/q increase from 1/1 to 1/0 since we have b/a = 2q/p
which decreases as b decreases and a increases. In the lower half of the ellipse we
have just the negatives of the values in the upper half since the sign of b has changed
from plus to minus.
This labeling of the rational points of E by fractions p/q seems very similar to the
labeling of vertices in the circular Farey diagram. As we saw in Section 1.1, if the Farey
diagram is drawn with 1/0 at the top of the unit circle in the xy- plane, then the point
2 2
on the unit circle labeled p/q has coordinates (x, y) = 2pq/p 2 + q 2 , p --- q /p 2 + q 2 .
After rotating the circle to put 1/0 on the left side by replacing (x, y) by (−y, x) this
2 2
becomes q --- p /p 2 + q 2 , 2pq/p 2 + q 2 . Here the y- coordinate 2pq/p 2 + q 2 is the same
as the b- coordinate of the point of E labeled p/q , which is the point
2 2
(a, b, c) = p /p 2 + q 2 , 2pq/p 2 + q 2 , q /p 2 + q 2
Since the vertical coordinates of points in either the left or right half of the unit circle
or the ellipse E determine the horizontal coordinates uniquely, this means that the
Section 5.5 — Charting All Forms 139
labeling of points of E by fractions p/q is really the same as in the circular Farey
diagram.
Let us return now to the general picture of how forms ax 2 + bxy + cy 2 are
represented by points (a, b, c) in R3 . As we know, a change of variables by a linear
transformation T sends (x, y) to T (x, y) = (px + qy, r x + sy) , where p, q, r , s
are integers with ps − qr = ±1 . This change of variables transforms each form into
an equivalent form. To see the effect of this change of variables on the coefficients
(a, b, c) of a form Q(x, y) = ax 2 + bxy + cy 2 we do a simple calculation:
Q(px + qy, r x + sy) = a(px + qy)2 + b(px + qy)(r x + sy) + c(r x + sy)2
= (ap 2 + bpr + cr 2 )x 2 + (2apq + bps + bqr + 2cr s)xy
+ (aq2 + bqs + cs 2 )y 2
This means that the (a, b, c) coordinates of points in R3 are transformed according
to the formula
T ∗ (a, b, c) = p 2 a + pr b + r 2 c, 2pqa + (ps + qr )b + 2r sc, q2 a + qsb + s 2 c
Since T ∗ is a linear transformation, it takes lines to lines and planes to planes, but T ∗
also has another special geometric property. Since equivalent forms have the same
discriminant, this means that each surface defined by an equation b2 − 4ac = k for k
a constant is taken to itself by T ∗ . In particular, the double cone b2 −4ac = 0 is taken
to itself, and in fact each of the two cones separately is taken to itself since one cone
consists of positive parabolic forms and the other cone of negative parabolic forms (as
one can see just by looking at the coefficients a and c ), and positive parabolic forms
are never equivalent to negative parabolic forms. When k > 0 the surface b2 −4ac = k
is a hyperboloid of one sheet and when k < 0 it is a hyperboloid of two sheets. In the
case of two sheets the lattice points on one sheet give positive elliptic forms and the
lattice points on the other sheet give negative elliptic forms.
Since T ∗ takes lines through the origin to lines through the origin and the double
cone b2 − 4ac = 0 to itself, this means that T ∗ gives a transformation of the ellipse E
to itself, taking rational points to rational points since rational points on E correspond
to lattice points on the cones. Regarding E as the boundary circle of the Farey diagram,
we know that linear fractional transformations give symmetries of the Farey diagram,
also taking rational points on the boundary circle to rational boundary points. And
in fact, the transformation of this circle defined by T ∗ is exactly one of these linear
fractional transformations. This is because T ∗ takes the parabolic form (dx+ey)2 to
140 Chapter 5 — The Classification of Quadratic Forms
2 2
the form d(px +qy)+e(r x +sy) = (dp +er )x +(dq+es)y so in the fractional
labeling of points of E this says T ∗ (d/e ) = pd + re/qd + se which is a linear fractional
transformation. If we write this using the variables x and y instead of d and e it
would be T ∗ (x/y ) = px + ry/qx + sy . This is not quite the same as the linear fractional
transformation T (x/y ) = px + qy/rx + sy defined by the original change of variables
T (x, y) = (px + qy, r x + sy) , but rather T ∗ is obtained from T by transposing the
matrix of T , interchanging the off-diagonal terms q and r .
Via radial projection, the transformation T ∗ determines a transformation not just
of E but also of the interior of E in the plane a + c = 1 . This transformation, which
we still call T ∗ for simplicity, takes lines inside E to lines inside E since T ∗ takes
planes through the origin to planes through the origin.
This leads us to consider a “linear” version of the Farey
diagram in which each circular arc of the original Farey
diagram is replaced by a straight line segment joining
the two endpoints of the circular arc. These line seg-
ments divide the interior of E into triangles, just as the
original Farey diagram divides the disk into curvilinear
triangles. The transformation T ∗ takes each of these tri-
angles onto another triangle, analogous to the way that
linear fractional transformations provide symmetries of
the original Farey diagram.
Suppose we divide each triangle of the linear Farey diagram into six smaller trian-
gles as in the figure at the right, by adding diagonals to each quadrilateral formed by
two adjacent triangles of the Farey diagram. The trans-
formation T ∗ takes each of these small triangles onto
another small triangle since it takes lines to lines. One
of these small triangles is the triangle defined by the in-
equalities 0 ≤ b ≤ a ≤ c that we considered earlier. The
fact that every positive primitive elliptic form is equiv-
alent to exactly one reduced form, corresponding to a
rational point in this special triangle, is now visible ge-
ometrically as the fact that there is always exactly one
transformation T ∗ taking a given small triangle to this
one special small triangle.
Elliptic forms whose topograph contains a source edge are equivalent to forms
ax + cy 2 so these are the forms corresponding to rational points on the edges of
2
the original linear Farey diagram, before the subdivision into smaller triangles. These
are the forms whose topograph has a symmetry reflecting across a line perpendicular
to the source edge. (This line is just the edge in the Farey diagram containing the
given form.) The other type of reflectional symmetry in the topograph of an elliptic
Section 5.5 — Charting All Forms 141
form is reflection across an edge of the topograph. Forms with this sort of symmetry
correspond to rational points in the dotted edges in the preceding figure, the edges
we added to subdivide the Farey diagram into the smaller triangles. The dotted edges
are of two types according to whether the two equal values of the form in the three
regions surrounding the source vertex occur for the smallest value of the form (wide
dotted edges) or the next-to-smallest value of the form (narrow dotted edges). Note
that the wide dotted edges form the dual tree of the Farey diagram.
Let us turn our attention now to hyperbolic and 0 - hyperbolic forms, which cor-
respond to integer lattice points that lie outside the two cones. As a preliminary
observation, note that for a point (a, b, c) outside the double cone there are exactly
two planes in R3 that are tangent to the double cone and pass through (a, b, c) .
Each of these planes is tangent to the double cone along a line through the origin.
The two tangent planes through (a, b, c) are
determined by their intersection with the plane
a + c = 1 , which consists of two lines tangent
to the ellipse E . These two lines can either in-
tersect or be parallel. The latter possibility oc-
curs when the point (a, b, c) lies in the plane
a + c = 0 , so the two tangent planes intersect
in a line in this plane. For example, if the point
(a, b, c) we start with happens to lie on the b- axis, then the tangent planes are the
ab- plane and the bc- plane. These intersect the plane a + c = 1 in the two vertical
tangent lines to the ellipse E .
Our goal will be to show the following:
Proof: We begin with a few preliminary remarks that will allow us to treat the hyper-
bolic and 0 - hyperbolic cases in the same way. A form Q(x, y) = ax 2 + bxy + cy 2
of positive discriminant can always be factored as (px + qy)(r x + sy) with p, q, r , s
real numbers since if a = 0 we have the factorization y(bx + cy) and if a ≠ 0 then
the associated quadratic equation ax 2 + bx + c = 0 has positive discriminant so it
has two distinct real roots α and β , leading to the factorization ax 2 + bxy + cy 2 =
a(x − αy)(x − βy) which can be rewritten as (px + qy)(r x + sy) by incorporating a
into either factor. If Q is hyperbolic then the discriminant is not a square and hence
the factorization (px + qy)(r x + sy) will involve coefficients that are quadratic irra-
142 Chapter 5 — The Classification of Quadratic Forms
as t varies over all real numbers. When t = 0 or t = 1 we obtain the two forms
Q0 = (px + qy)(r x + sy) and Q1 = (px + qy)2 so these forms lie on L . Also, we
can see that the forms Qt do form a straight line in R3 by rewriting the formula for
Qt (x, y) as ax 2 + bxy + cy 2 with the coefficients a, b, c given by:
(a, b, c) = pr (1 − t) + p 2 t, (ps + qr )(1 − t) + 2pqt, qs(1 − t) + q2 t
This defines a line since p, q, r , s are constants, so each coordinate is a linear function
of t . Since the forms Qt factor as the product of two linear factors, they have non-
negative discriminant for all t . This means that the line L does not go into the interior
of either cone. It also does not pass through the origin since if it did, it would have
to be a subset of the double cone since it contains the form Q1 which lies in the
double cone. From these facts we deduce that L must be a tangent line to the double
cone. Hence the plane containing L and the origin must be tangent to the double cone
along the line containing the origin and Q1 . The same reasoning shows that the other
tangent plane that passes through (px + qy)(r x + sy) intersects the double cone
along the line containing the origin and (r x + sy)2 .
The labels of the points of E corresponding to the two forms (px + qy)2 and
(r x+sy)2 are p/q and r/s according to the convention we have adopted. On the other
hand, when the form (px + qy)(r x + sy) is hyperbolic the ends of the separator line
in its topograph are at the two points where this form is zero, which occur when x/y
is --- q/p and --- s/r . These are the negative reciprocals of the previous two points p/q
and r/s so they are the diametrically opposite points in E . Similarly, when the form
(px + qy)(r x + sy) is 0 - hyperbolic the vertices of the Farey diagram where it is zero
are at --- q/p and --- s/r , again diametrically opposite p/q and r/s . ⊓
⊔
Section 5.5 — Charting All Forms 143
It might have been nicer if the statement of the previous proposition did not
involve passing to diametrically opposite points, but to achieve this we would have had
to use a different rule for labeling the points of E , with the label p/q corresponding
to the form (qx − py)2 instead of (px + qy)2 . This 180 degree rotation of the labels
would put the negative labels in the upper half of E rather than the lower half, which
does not seem like a good idea.
Next let us investigate how hyperbolic and 0 - hyperbolic forms are distributed
over the lattice points outside the double cone b2 −4ac = 0 . This is easier to visualize
if we project such points radially into the plane a + c = 1 . This only works for forms
ax 2 +bxy +cy 2 with a+c > 0 , but the forms with a+c < 0 are just the negatives of
these so they give nothing essentially new. The forms with a + c = 0 will be covered
after we deal with those with a + c > 0 .
Forms with a + c > 0 that are hyperbolic or 0 - hyperbolic correspond via radial
projection to points in the plane a + c = 1 outside the ellipse E . As we have seen,
each such point determines a pair of tangent lines to E intersecting at the given point.
For a 0 - hyperbolic form (px + qy)(r x + sy) the points of tangency in E have
rational labels p/q and r/s . We know that every 0 - hyperbolic form is equivalent to
a form y(r x + sy) with a = 0 , so p/q = 0/1 and one line of tangency is the vertical
line tangent to E on the right side. The form y(r x + sy) corresponds to the point
(0, r , s) in the plane a = 0 tangent to the double cone. Projecting radially into the
vertical tangent line to E , we obtain the points (0, r/s , 1) , where r/s is an arbitrary
rational number. Thus 0 - hyperbolic forms are dense in this vertical tangent line to E .
Choosing any rational number r/s , the other tangent line for the form y(r x + sy) is
tangent to E at the point labeled r/s .
An arbitrary 0 - hyperbolic form (px + qy)(r x + sy) is obtained from one with
p/ = 0/ by applying a linear fractional transformation T taking 0/ to p/ , so the
q 1 1 q
0 p
vertical tangent line to E at /1 is taken to the tangent line at /q , and the dense set of
0 - hyperbolic forms in the vertical tangent line is taken to a dense set of 0 - hyperbolic
forms in the tangent line at p/q . Thus we see that the 0 - hyperbolic forms in the plane
a + c = 1 consist of all the rational points on all the tangent lines to E at rational
points p/q of E .
In the case of a hyperbolic form ax 2 + bxy + cy 2 with a + c > 0 the two tangent
lines intersect E at a pair of conjugate quadratic irrationals, the negative reciprocals of
the roots α and α of the equation ax 2 + bx + c = 0 . Since α determines α uniquely,
one tangent line determines the other uniquely, unlike the situation for 0 - hyperbolic
forms whose rational tangency points p/q and r/s can be varied independently. A
consequence of this uniqueness for hyperbolic forms is that each of the two tangent
lines contains only one rational point, the intersection point of the two lines, since any
other rational point would correspond to another form having one of its tangent lines
the same as for ax 2 + bxy + cy 2 and the other tangent line different, contradicting
144 Chapter 5 — The Classification of Quadratic Forms
the previous observation that each tangent line for a hyperbolic form determines the
other. (The hypothetical second form would also be hyperbolic since the common
tangency point for the two forms is not a rational point on E .)
The points in the plane a + c = 1 that correspond to 0 - hyperbolic forms are
dense in the region of this plane outside E since for an arbitrary point in this region
we can first take the two tangent lines to E through this point and then take a pair
of nearby lines that are tangent at rational points of E since points in E with rational
labels are dense in E . It is also true that points in the plane a + c = 1 that correspond
to hyperbolic forms are dense in the region outside E . To see this we can proceed
in two steps. First consider the case of a point in this region whose two tangent
lines to E are tangent at irrational points of E . These two irrational points are the
endpoints of an infinite strip in the Farey diagram that need not be periodic. However
we can approximate this strip by a periodic strip by taking a long finite segment of
the infinite strip and then repeating this periodically at each end. This means that the
given point in the region outside E lies arbitrarily close to points corresponding to
hyperbolic forms. Finally, a completely arbitrary point in the region outside E can be
approximated by points whose tangent lines to E touch E at irrational points since
irrational numbers are dense in real numbers.
It remains to consider hyperbolic and 0 - hyperbolic forms (px + qy)(r x + sy)
corresponding to points (a, b, c) in the plane a + c = 0 . Such a form determines
a line through the origin in this plane, and the tangent planes to the double cone
that intersect in this line intersect the plane a + c = 1 in two parallel lines tangent
to E at two diametrically opposite points p/q and --- q/p . This means that the form is
(px +qy)(qx −py) , up to a constant multiple. If p/q is rational this is a 0 - hyperbolic
form. Examples are:
— xy with vertical tangents to E at 1/0 and 0/1 .
— x 2 − y 2 = (x + y)(x − y) with horizontal tangents to E at 1/1 and ---1/1 .
— 2x 2 − 3xy − 2y 2 = (2x + y)(x − 2y) with parallel tangents at 2/1 and ---1/2 .
If p/q and --- q/p are conjugate quadratic irrationals then we have a hyperbolic form
ax 2 + bxy + cy 2 = a(x − α)(x − α) where αα = −1 since c = −a when a + c = 0 .
Thus α and α are negative reciprocals of each other that are interchanged by 180
degree rotation of E . As examples we have:
√ √
2 2 −1 + 5 −1 − 5
x + xy − y = x − y x− y
2 √ 2 √
−1 + 17 −1 − 17
2 2
2x + xy − 2y = 2 x − y x− y
4 4
One can consider a pair of parallel tangent lines to E as the limit of a pair of inter-
secting tangents where the point of intersection moves farther and farther away from
E in a certain direction which becomes the direction of the pair of parallel tangents.
With the various things we have learned about quadratic forms so far, let us
return to the basic representation problem of determining what values a given form
Q(x, y) = ax 2 + bxy + cy 2 can take on when x and y are integers, or in other
words, which numbers can be represented as ax 2 + bxy + cy 2 for some choice of
integers x and y . Remember that it suffices to restrict attention to the values of Q
appearing in the topograph since these are the values for primitive pairs (x, y) , and
to get all other values one just multiplies the values in the topograph by arbitrary
squares. With this in mind we will adopt the following convention in the rest of the
book:
This differs from the traditional terminology in which any solution of n = Q(x, y) is
called a representation of n , without requiring (x, y) to be a primitive pair, and when
(x, y) is primitive it is called a proper or primitive representation of n . However,
since we will rarely consider the case that (x, y) is not a primitive pair, it will save
many words not to have to insert the extra modifier for every representation.
We will focus on forms that are either elliptic or hyperbolic, as these are the most
interesting cases.
in the first quadrant of the topograph. Part of this quadrant is shown in the figure
below, somewhat distorted to fit more numbers into the picture.
146 Chapter 6 — Representations by Quadratic Forms
What is shown is all the numbers in the topograph that are less than 100 . At first
glance it may be hard to detect any patterns here. Both even and odd numbers occur,
but none of the even numbers are divisible by 4 so they are all twice an odd number,
and in fact an odd number that appears in the topograph. Considering the odd num-
bers, one notices they are all congruent to 1 mod 4 and not 3 mod 4 , which is the
other possibility for odd numbers. On the other hand, not all odd numbers congruent
to 1 mod 4 appear in the topograph. Up to 100 , the ones that are missing are 9 ,
21 , 33 , 45 , 49 , 57 , 69 , 77 , 81 , and 93 . Each of these has at least one prime factor
congruent to 3 mod 4 , while all the odd numbers that do appear have all their prime
factors congruent to 1 mod 4 . Conversely, all products of primes congruent to 1
mod 4 are in the topograph.
This leads us to guess that the following statements might be true:
In both statements the index k denoting the number of prime factors pi is al-
lowed to be zero as well as any positive integer. The restriction a ≤ 1 in the first
statement disappears in the second statement since higher powers of 2 can occur
when we multiply by arbitrary squares.
We will prove the conjecture later in the chapter. A weaker form of the conjecture
can be proved just by considering congruences mod 4 as follows. An even number
squared is congruent to 0 mod 4 and an odd number squared is congruent to 1
mod 4 , so x 2 + y 2 must be congruent to 0 , 1 , or 2 mod 4 . Moreover, the only way
that x 2 + y 2 can be 0 mod 4 is for both x and y to be even, which cannot happen
for primitive pairs. Thus all numbers in the topograph must be congruent to 1 or 2
mod 4 . This says that the odd numbers in the topograph are congruent to 1 mod 4
and the even numbers are each twice an odd number.
However, these simple observations say nothing about the role played by primes
and prime factorizations, nor do they include any positive assertions about which
Section 6.1 — Three Levels of Complexity 147
Let us look at a second example to see whether the same sorts of patterns occur,
this time for the form Q(x, y) = x 2 + 2y 2 . Here is a portion of its topograph showing
all values less than 100 , with the lower half of the topograph omitted since it is just
the mirror image of the upper half:
Again the even values are just the doubles of the odd values. The odd prime values are
3, 11, 17, 19, 41, 43, 59, 67, 73, 83, 89, 97 and the other odd values are all the products
of these primes. The odd prime values are not determined by their values mod 4
in this case, but instead by their values mod 8 since the primes we just listed are
exactly the primes less than 100 that are congruent to 1 or 3 mod 8 . Apart from
this change, the answer to the representation problem for x 2 + 2y 2 is completely
analogous to the answer for x 2 + y 2 . Namely, the numbers represented by x 2 + 2y 2
are the numbers n = 2a p1 p2 · · · pk with a ≤ 1 and each pi a prime congruent to 1
or 3 mod 8 . Using congruences mod 8 we could easily prove the weaker statement
that all numbers represented by x 2 + 2y 2 must be congruent to 1, 2, 3 , or 6 mod 8 ,
so all odd numbers in the topograph must be congruent to 1 or 3 mod 8 and all even
numbers must be twice an odd number.
These two examples were elliptic forms, but the same sort of behavior can occur
for hyperbolic forms as we see in the next example, the form x 2 − 2y 2 . The negative
values of this form happen to be just the negatives of the positive values, so we need
only show the positive values in the topograph:
148 Chapter 6 — Representations by Quadratic Forms
Here the primes that occur are 2 and primes congruent to ±1 mod 8 . The nonprime
values that occur are the products of primes congruent to ±1 mod 8 and twice these
products. Again there is a weaker statement that can be proved using just congruences
mod 8 .
In these three examples the guiding principle was to look at prime factorizations
and at primes modulo certain numbers, the numbers 4 , 8 , and 8 in the three cases.
Notice that these numbers are just the absolute values of the discriminants −4 , −8 ,
and 8 . Looking at primes mod |∆| turns out to be a key idea for all quadratic forms.
Another example of the same sort is the form x 2 + xy + y 2 of discriminant −3 .
This time it is the prime 3 that plays a special role rather than 2 .
We only have to draw one-sixth of the topograph because of all the symmetries. Notice
that all the values are odd, so the prime 2 plays no role here. Since the discriminant
is −3 we are led to consider congruences mod 3 . The primes in the topograph are
3 and the primes congruent to 1 mod 3 (which in particular excludes the prime 2 ),
namely the primes 7, 13, 19, 31, 37, 43, 61, 67, 73, 79, 97. The nonprime values are the
products of these primes with the restriction that the prime 3 never has an exponent
greater than 1 . This is analogous to the prime 2 never having an exponent greater
than 1 in the preceding examples. In all four examples the “special” primes whose
exponents are restricted are just the prime divisors of the discriminant. This is a
general phenomenon, that primes dividing the discriminant behave differently from
primes that do not divide the discriminant.
A special feature of the discriminants −4 , −8 , 8 , and −3 is that in each case all
forms of that discriminant are equivalent. We will see that the representation problem
always has the same type of answer for discriminants with a single equivalence class
of forms.
Before going on to the next level of complexity let us digress to describe a nice
property that forms of the first level of complexity have. As we know, if an equa-
tion Q(x, y) = n has an integer solution (x, y) then so does Q(x, y) = m2 n for
every integer m . The converse is not always true however. For example the equation
2x 2 + 7y 2 = 9 has the solution (x, y) = (1, 1) but 2x 2 + 7y 2 = 1 obviously has no
solution with x and y integers. Nevertheless, this converse property does hold for
Section 6.1 — Three Levels of Complexity 149
forms such as those in the preceding four examples where the numbers n for which
Q(x, y) = n has an integer solution are exactly the numbers that can be factored as
n = m2 p1 p2 · · · pk for primes pi satisfying certain conditions and m an arbitrary
integer. This is because if a number n has a factorization of this type then we can
cancel any square factor of n and the result still has a factorization of the same type.
Let us apply this “square-cancellation” property in the case of the form x 2 +y 2 to
determine the numbers n such that the circle x 2 + y 2 = n contains a rational point,
and hence, as in Chapter 0, an infinite dense set of rational points. Suppose first that
the circle x 2 + y 2 = n contains a rational point, so after putting the two coordinates
over a common denominator the point is (x, y) = a/c , b/c . The equation x 2 +y 2 = n
then becomes a2 + b2 = c 2 n . This means that the equation x 2 + y 2 = c 2 n has
an integer solution. Then the square-cancellation property implies that the original
equation x 2 + y 2 = n has an integer solution. Thus we see that if there are rational
points on the circle x 2 + y 2 = n then there are integer points on it. This is not
something that is true for all quadratic curves, as shown by the example of the ellipse
2x 2 + 7y 2 = 1 which has rational points such as 1/3 , 1/3 but no integer points.
From the solution to the representation problem for x 2 + y 2 we deduce that the
circle x 2 + y 2 = n contains rational points exactly when n = m2 p1 p2 · · · pk where
m is an arbitrary integer and each pi is either 2 or a prime congruent to 1 mod 4 .
The first few values of n satisfying this condition are 1 , 2 , 4 , 5 , 8 , 9 , 10 , 13 , 16 , 17 ,
18 , 20, · · ·.
Now let us look at some examples with a second level of complexity. First consider
the case of discriminant 40 where the class number is 2 and two nonequivalent forms
are x 2 − 10y 2 and 2x 2 − 5y 2 . The topographs below show the positive values less
than 100 . The topographs are periodic and also have mirror symmetry so it suffices
to show half of one period. There is no need to show any more of the negative values
since these will just be the negatives of the positive values.
150 Chapter 6 — Representations by Quadratic Forms
For the form x 2 − 10y 2 the prime values less than 100 are 31, 41, 71, 79, 89 .
These are the primes congruent to ±1 or ±9 mod 40 , the discriminant. However, in
contrast to what happened in the previous examples, there are many nonprime values
of this form that are not products of these prime values. The prime factors of these
nonprime values are 2, 3, 5, 13, 37, 43 , none of which occur in the topograph of the
first form. Rather miraculously, these prime values are realized instead by the second
form 2x 2 − 5y 2 . The prime values this form takes on are 2 and 5 , which are the
prime divisors of the discriminant 40 , along with primes congruent to ±3 and ±13
mod 40 , namely 3, 13, 37, 43, 53, 67 , and 83 .
Apart from the primes 2 and 5 that divide the discriminant, the possible values
of primes mod 40 are ±1, ±3, ±7, ±9, ±11, ±13, ±17, ±19 since even numbers and
multiples of 5 are excluded. There are sixteen different congruence classes here,
and exactly half of them, eight, are realized by one or the other of the two forms
x 2 − 10y 2 and 2x 2 − 5y 2 , with four classes realized by each form. The other eight
congruence classes are not realized by any form of discriminant 40 since every form
of discriminant 40 is equivalent to one of the two forms x 2 − 10y 2 or 2x 2 − 5y 2 , as
is easily checked by the methods from the previous chapter.
This turns out to be a general phenomenon valid for all elliptic and hyperbolic
forms: If one excludes the primes that divide the discriminant, then the prime values
of quadratic forms of that discriminant are exactly the primes in half of the congruence
classes modulo the discriminant of numbers coprime to the discriminant. This will
be proved in Proposition 6.22. Also, each form represents primes in the same number
of congruence classes. For ∆ = 40 this is four congruence classes for each form.
The primes 2 and 5 that divide the discriminant occur in the topographs only to
the first power, nor are any numbers in the topographs divisible by 22 or 52 . This
agrees with what happened in the earlier examples. Apart from this restriction it
appears that each product of primes represented by Q1 or Q2 is also represented
by Q1 or Q2 . The problem is to decide which form represents which products. For
numbers in the topographs not divisible by 2 or 5 it seems that these numbers are
subject to the same congruence conditions as for primes, so they are congruent to ±1
or ±9 for Q1 and to ±3 or ±13 for Q2 .
If one includes numbers divisible by 2 or 5 the following statements seem to be
true, provided that numbers divisible by 22 or 52 are excluded:
(1) The product of two numbers represented by Q1 is again represented by Q1 .
(2) The product of two numbers represented by Q2 is represented by Q1 .
(3) The product of a number represented by Q1 with a number represented by Q2
is represented by Q2 .
For example, for (1) the numbers 6 , 9 , and 10 appear in the topograph of Q1 hence
so do 6·9 , 9·9 , and 9·10 , but not 6·10 since this is divisible by 22 . For (2) the
numbers 2 , 3 , and 5 are in the topograph of Q2 so 2·3 , 3·3 , 2·5 , and 3·5 are in
Section 6.1 — Three Levels of Complexity 151
the topograph of Q1 but not 2·2 or 5·5 . The product 2·3·5 is then in the topograph
of Q2 by (3) .
An abbreviated way of writing the statements (1)–(3) is by the formulas Q1 Q1 =
Q1 , Q2 Q2 = Q1 , and Q1 Q2 = Q2 . One can see that these are formally the same as
the rules for addition of integers mod 2 : 0 + 0 = 0 , 1 + 1 = 0 , and 0 + 1 = 1 . The two
formulas Q1 Q1 = Q1 and Q1 Q2 = Q2 say that Q1 serves as an identity element “ 1 ”
for this multiplication operation, and then the formula Q2 Q2 = Q1 can be interpreted
as saying that Q2 is equal to its own inverse, so Q2 = Q2−1 .
This way of “multiplying” forms is more than just shorthand notation, and in
Chapter 7 we will develop a general method for forming products of primitive forms
of a fixed discriminant that will be a key ingredient in reducing the representation
problem to the special case of representing primes.
The various observations we have made so far about the two forms of discriminant
40 lead to the following:
For example, the topograph of Q1 contains the even powers of 3 while the topo-
graph of Q2 contains the odd powers. Another consequence is that the even values
in one topograph are just the doubles of the odd values in the other topograph.
This characterization of numbers represented by these two forms also implies
that no number is represented by both Q1 and Q2 . However, for some discriminants
it is possible for two nonequivalent forms of that discriminant to represent the same
nonzero number, as we will see.
The Conjecture will be proved piece by piece as we gradually develop the neces-
sary general theory. The first statement will be an application of Theorem 6.8 together
with later facts in Section 6.2. The second statement will be an application of Propo-
sition 6.19 and the rest of the Conjecture will use results from Chapter 7, particularly
Theorem 7.7.
Let us look at another example where the representation problem has an answer
that is qualitatively similar to the preceding example but just a little more complicated,
the case of discriminant −84 . Here there are twice as many equivalence classes of
forms, four instead of two, with topographs shown below.
152 Chapter 6 — Representations by Quadratic Forms
The primes dividing the discriminant −84 are 2 , 3 , and 7 , and these primes are each
represented by one of the forms. In fact the divisors of the discriminant that appear
in the topographs are 1, 2, 3, 6, 7, 14, 21 , and 42 which are precisely the squarefree
divisors of the discriminant, where a number is called squarefree if it is not divisible
by any square greater than 1 . These squarefree divisors of ∆ are exactly the numbers
appearing on reflector lines of mirror symmetries of the topographs. This was the
case also in the previous examples, as one can check, and is a general phenomenon
for fundamental discriminants as a consequence of Corollary 5.7, Theorem 6.8, and
Proposition 6.17.
For the primes not dividing the discriminant, we will show later in the chapter
that the primes represented by each form are as follows:
This agrees with what is shown in the four topographs above, and one could expand
the topographs to get further evidence that these are the right answers. Passing from
primes to arbitrary numbers appearing in at least one of the topographs, these appear
to be exactly the products 2a 3b 7c p1 · · · pk with a, b, c ≤ 1 and each pi one of the
other primes represented by Q1 , Q2 , Q3 , or Q4 .
One can work out hypothetical rules for multiplying the forms by considering
how products of two primes are represented. For example, 3 is represented by Q2
and 11 is represented by Q3 , while their product 3·11 = 33 is represented by Q4 , so
we might guess that Q2 Q3 = Q4 . Some other products that give the same conclusion
Section 6.1 — Three Levels of Complexity 153
are 3·2 = 6 , 3·23 = 69 , 7·2 = 14 , 7·11 = 77 , and 31·2 = 62 . In the same way one
can determine tentative rules for all the products Qi Qj , with the following results:
These multiplication rules are formally identical to how one would add pairs (m, n) of
integers mod 2 by adding their two coordinates separately. The form Q1 corresponds
to the pair (0, 0) and the first of the three rules above becomes the formula (0, 0) +
(m, n) = (m, n) . The forms Q2 , Q3 , and Q4 correspond to (1, 0) , (0, 1) , and (1, 1)
in any order, and then the second rule above becomes (m, n) + (m, n) = (0, 0) which
is valid for addition mod 2 , while the third rule becomes the fact that the sum of any
two of (1, 0) , (0, 1) , and (1, 1) is equal to the third if we do addition mod 2 .
The multiplication rules determine which form represents a given number n by
replacing each prime in the prime factorization of n by the form Qi that represents
it, then multiplying out the resulting product using the three multiplication rules,
keeping in mind that 2 , 3 , and 7 can never occur with an exponent greater than 1 .
For example, for n = 70 = 2·5·7 we get the product Q3 Q4 Q2 which equals Q1
and so 70 is represented by Q1 , as the topograph shows. For n = 66 = 2·3·11
we get Q3 Q2 Q3 = Q2 and 66 is represented by Q2 . In general, for a number
a b c
n = 2 3 7 p1 · · · pk we can determine which form represents n by the follow-
ing steps. First compute the number qi of prime factors of n represented by Qi .
Next compute the sum q1 (0, 0) + q2 (1, 0) + q3 (0, 1) + q4 (1, 1) = (q2 + q4 , q3 + q4 )
where (0, 0), (1, 0), (0, 1), (1, 1) correspond to Q1 , Q2 , Q3 , Q4 respectively. The re-
sulting sum (m, n) then tells which form represents n .
An interesting feature of all the forms at the first or second level of complexity
that we have examined so far is that their topographs have mirror symmetry. This is
actually a general phenomenon: Whenever all the forms of a given discriminant have
mirror symmetry, then one can determine which primes are represented by each form
just in terms of congruence conditions modulo the discriminant. And in fact this is
the only time when congruences modulo the discriminant determine how primes are
represented, at least if one restricts attention just to primitive forms. This will be
shown in Corollary 6.28 later in the chapter. In Chapter 5 we called discriminants for
which all primitive forms have mirror symmetry fully symmetric discriminants, and we
observed that they are unfortunately rather rare, with only 101 negative discriminants
known to have this property, and probably no more.
Now we move on to the third level of complexity, illustrated by the case ∆ = −56
where there are three equivalence classes of forms, with topographs shown below.
The first two topographs have mirror symmetry but the third topograph does not, so
154 Chapter 6 — Representations by Quadratic Forms
the third form counts twice when determining the class number for discriminant −56 ,
which is therefore 4 rather than 3 .
The behavior of divisors of the discriminant is the same as in the previous examples.
Only the squarefree divisors appear, 1 , 2 , 7 , and 14 , and these are the numbers
appearing on the reflector lines.
In the examples at the first two levels of complexity it was possible to determine
which numbers are represented by a given form by looking at primes and which con-
gruence classes they fall into modulo the discriminant. The primes represented by a
given form were exactly the primes in certain congruence classes modulo the discrim-
inant. This is no longer true for discriminant −56 however. For example the primes
23 and 79 are congruent mod 56 , and yet 23 is represented by Q1 = x 2 + 14y 2 since
Q1 (3, 1) = 23 , while 79 is represented by Q2 = 2x 2 + 7y 2 since Q2 (6, 1) = 79 .
Another nice property that held in the previous examples was that no number
appeared in more than one topograph for the given discriminant, but this too fails
for discriminant −56 since there are many nonprimes that occur in the topographs
Section 6.1 — Three Levels of Complexity 155
of both Q1 and Q2 starting with 15, 30, 39, 57, 65, 78, 95, 105, 114, 130, and 135 .
Apart from the primes 2 and 7 that divide the discriminant −56 , all other primes
belong to the following 24 congruence classes mod 56 , corresponding to odd num-
bers less than 56 not divisible by 7 :
1 3 5 9 11 13 15 17 19 23 25 27 29 31 33 37 39 41 43 45 47 51 53 55
The six congruence classes whose prime elements are represented by Q1 or Q2 are
indicated by underlines, and the six congruence classes whose prime elements are
represented by Q3 are indicated by overlines. Primes not represented by any of the
three forms are in the remaining twelve congruence classes.
The new thing that happens in this example is that one cannot tell whether a
prime is represented by Q1 or Q2 just by considering congruence classes mod the
discriminant. We saw this for the pair of primes 23 and 79 , and another such pair
visible in the topographs is 71 and 127 . By extending the topographs we could find
many more such pairs. One might try using congruences modulo some other number
besides 56 , but it is known that this does not help.
Congruences mod 56 suffice to tell which primes are represented by Q3 , but
there is a different sort of novel behavior involving Q3 when we look at representing
products of primes. To illustrate this, observe that the primes 3 and 5 are represented
by Q3 but their product 15 is represented by both Q1 and Q2 . This means there is
some ambiguity about whether the product Q3 Q3 should be Q1 or Q2 . The same
thing happens in fact for any pair of coprime numbers represented by Q3 , for example
5 and 6 whose product is represented by both Q1 and Q2 .
For other products Qi Qj there seems to be no ambiguity. The principal form Q1
acts as the identity for multiplication, while Q2 Q2 = Q1 and Q2 Q3 = Q3 , although
this last formula is somewhat odd since it seems to imply that Q3 does not have a
multiplicative inverse since if it did, we could multiply the equation Q2 Q3 = Q3 by
this inverse to get Q2 = Q1 .
There is a way out of these difficulties, discovered by Gauss. The troublesome
form Q3 is different from the other forms in this example and in the preceding
examples in that it does not have mirror symmetry. Thus the equivalence class of
Q3 splits into two proper equivalence classes, with Q3 having a mirror image form
Q4 = 3x 2 − 2xy + 5y 2 obtained from Q3 by changing the sign of either x or y and
hence changing the coefficient of xy to its negative. Using Q4 we can then resolve the
ambiguous product Q3 Q3 by setting Q3 Q3 = Q2 = Q4 Q4 and Q3 Q4 = Q1 so that Q4
is the inverse of Q3 . This means that each Qi has its inverse given by the mirror im-
age topograph since Q1 and Q2 have mirror symmetry and equal their own inverses.
The rigorous justification for the formulas Q3 Q3 = Q2 = Q4 Q4 and Q3 Q4 = Q1 will
come in Chapter 7, but for the moment one can check that these formulas are at least
consistent with the topographs.
156 Chapter 6 — Representations by Quadratic Forms
We will show in Chapter 7 that the set of proper equivalence classes of primitive
forms of fixed discriminant always has a multiplication operation compatible with
multiplying values of forms of that discriminant in the way illustrated by the preceding
examples. This multiplication operation gives this set the structure of a group, that
is, a set with an associative multiplication operation for which there is an element of
the set that functions as an identity for the multiplication, and such that each element
of the set has a multiplicative inverse in the set whose product with the given element
is the identity element. The set of proper equivalence classes of primitive forms with
this group structure is called the class group for the given discriminant. The identity
element is the class of the principal form, and the inverse of a class is obtained by
taking the mirror image topograph.
The class group has the additional property that the multiplication is commuta-
tive. This makes its algebraic structure much simpler than the typical noncommuta-
tive group. An example of a noncommutative group that we have seen is the group
LF (Z) of linear fractional transformations, where the multiplication comes from mul-
tiplication of 2 × 2 matrices, or equivalently, composition of the transformations.
Section 6.1 — Three Levels of Complexity 157
For a given discriminant, if the numbers represented by two primitive forms can-
not be distinguished by congruences mod the discriminant, then these two forms are
said to belong to the same genus. Thus in the preceding example of discriminant −56
the two forms Q1 and Q2 are of the same genus while Q3 is of a different genus from
Q1 and Q2 , so there are two different genera (“genera” is the plural of “genus”).
Equivalent forms always belong to the same genus since their topographs contain
exactly the same numbers. The first two of the three levels of complexity we have
described correspond to the discriminants where there is only one equivalence class
in each genus. As we stated earlier, this desirable situation is also characterized by
the condition that all primitive forms of the given discriminant have mirror symmetry.
For larger discriminants there can be large numbers of genera and large numbers of
equivalence classes within a genus. However, for a fixed discriminant there are always
the same number of proper equivalence classes within each genus, as we will show in
Proposition 7.24. This is illustrated by the case ∆ = −56 where one genus consists of
Q1 and Q2 and the other genus consists of Q3 and Q4 .
The examples in this section show the significance of primes in certain congruence
classes for solving the representation problem. In the examples there seems to be no
shortage of primes in each of the relevant congruence classes. For example, for the
form x 2 + y 2 the primes represented, apart from 2 , seem to be the primes congruent
to 1 mod 4 , the primes of the form 4k + 1 starting with 5, 13, 17, 29, 37, 41, 53, · · ·.
The other possibility for odd primes is the sequence 3, 7, 11, 19, 23, 31, 43, 47, · · ·,
primes of the form 4k + 3 , or equivalently 4k − 1 .
Such sequences form arithmetic progressions an + b for fixed positive integers
a and b and varying n = 0, 1, 2, 3, · · ·. It is natural to ask whether there are infinitely
many primes in each arithmetic progression an + b . For this to be true an obvious re-
striction is that a and b should be coprime since any common divisor of a and b will
divide every number an + b , so there could be at most one prime in the progression.
A famous theorem of Dirichlet from 1837 asserts that every arithmetic progres-
sion an + b with a and b coprime contains an infinite number of primes. This can
be rephrased as saying that within each congruence class of numbers x ≡ b mod a
there are infinitely many primes whenever a and b are coprime. Dirichlet’s theorem
actually says more, that primes are approximately equally distributed among the var-
ious congruence classes mod a for a fixed a . For example, there are approximately
as many primes p = 4n + 1 as there are primes p = 4n − 1 .
Dirichlet’s Theorem is not easy to prove, and a proof would require methods quite
different for anything else in this book so we will not be giving a proof. However a
few special cases of Dirichlet’s Theorem can be proved by elementary arguments. The
simplest case is the arithmetic progression 3, 7, 11, · · · of numbers n = 4n − 1 , using
a variant of Euclid’s proof that there are infinitely many primes. Recall how Euclid’s
argument goes. Suppose that p1 , · · · , pk is a finite list of primes, and consider the
158 Chapter 6 — Representations by Quadratic Forms
We have just seen three quadratic forms that represent infinitely many primes, for
discriminants −4 , −3 , and 5 , and Proposition 6.18 provides other examples for each
discriminant with class number 1 . (Nonprimitive forms obviously cannot represent
infinitely many primes, so these forms can be ignored.) For discriminants with larger
class numbers Proposition 6.18 only implies that there is at least one form represent-
ing infinitely many primes. However there is another hard theorem of Dirichlet which
does say that each primitive form of nonsquare discriminant represents infinitely
many primes.
Exercises
2. Do the same things for the form x 2 + xy + 2y 2 , except that this time you only
need to consider values less than 50 instead of 100 .
(e) Characterize the nonprime values in the topograph of Q1 in terms of their factor-
izations into primes in the lists in part (c), and then do the same thing for Q2 . Your
answers should be in terms of whether there are an even or an odd number of prime
factors from certain of the lists.
(f) Summarize the previous parts by giving a criterion for which numbers n the equa-
tion Q1 (x, y) = n has an integer solution and likewise for the equation Q2 (x, y) = n .
4. This problem will show how things can be more complicated than in the previous
problems.
(a) Show that the number of equivalence classes of forms of discriminant −23 is 2
while the number of proper equivalence classes is 3 , and find reduced forms Q1 and
Q2 of discriminant −23 that are not equivalent.
(b) Draw the topographs of Q1 and Q2 up to the value 70 . (Again you do not have to
repeat symmetric parts.)
(c) Find a number n that occurs in both topographs, and find the x and y values that
give Q1 (x1 , y1 ) = n = Q2 (x2 , y2 ) . (This sort of thing never happens in the previous
problems.)
(d) Find a prime p1 in the topograph of Q1 and a different prime p2 in the topograph
of Q2 such that p1 and p2 are congruent mod |∆| = 23 . (This sort of thing also
never happens in the previous problems.)
5. Show there are infinitely many primes of the form 6m − 1 by an argument similar
to the one used for 4m − 1 .
Note that if n is negative then “mod 4n” means the same thing as “mod 4|n|”
since being divisible by a number d is equivalent to being divisible by −d when we
are considering both positive and negative numbers.
side of this edge. The equation ∆ = h2 − 4nk implies the congruence ∆ ≡ h2 mod 4n
so ∆ is a square mod 4n .
Conversely, suppose that ∆ is the square of some integer h mod 4n . This means
that h2 − ∆ is an integer times 4n , or in other words h2 − ∆ = 4nk for some k . This
equation can be rewritten as ∆ = h2 − 4nk , so the form nx 2 + hxy + ky 2 has
discriminant ∆ , and this form represents n when (x, y) = (1, 0) . ⊓
⊔
Let us see what this proposition implies about representing small numbers n .
For n = 1 it says that there is a form of discriminant ∆ representing 1 if and only
if ∆ is a square mod 4 . The squares mod 4 are 0 and 1 , and we already know that
discriminants of forms are always congruent to 0 or 1 mod 4 . So we conclude that for
every possible value of the discriminant there exists a form that represents 1 . This is
not new information, however, since the principal forms x 2 + dy 2 and x 2 + xy + dy 2
represent 1 and there is a principal form in each discriminant.
In the next case n = 2 the possible values of the discriminant mod 4n = 8 are
0, 1, 4, 5 , and the squares mod 8 are 0, 1, 4 since 02 = 0 , (±1)2 = 1 , (±2)2 = 4 ,
(±3)2 ≡ 1 , and (±4)2 ≡ 0 . Thus 2 is not represented by any form of discriminant
∆ when ∆ ≡ 5 mod 8 , but for all other discriminants there is a form representing 2 .
Explicit forms representing 2 are 2x 2 −ky 2 for ∆ = 8k , 2x 2 +xy −ky 2 for ∆ = 8k+1 ,
and 2x 2 + 2xy − ky 2 for ∆ = 8k + 4 .
Moving on to the next case n = 3 , the discriminants mod 12 are 0, 1, 4, 5, 8, 9
and the squares mod 12 are 0, 1, 4, 9 since 02 = 0 , (±1)2 = 1 , (±2)2 = 4 , (±3)2 =
9 , (±4)2 ≡ 4 , (±5)2 ≡ 1 , and (±6)2 ≡ 0 . The excluded discriminants are thus
those congruent to 5 or 8 mod 12 . Again explicit forms are easily given, the forms
3x 2 + hxy − ky 2 with ∆ = 12k + h2 for h = 0, 1, 2, 3 .
We could continue in this direction, exploring which discriminants have forms
that represent a given number, but this is not really the question we want to answer,
which is to start with a given discriminant and decide which numbers are represented
in this discriminant. The sort of answer we are looking for, based on the various
examples we looked at earlier, is also a different sort of congruence condition, with
congruence modulo the discriminant rather than congruence mod 4n . So there is
more work to be done before we would have the sort of answer we want. Nevertheless,
the representability criterion in Proposition 6.2 is the starting point.
Proposition 6.3. If two coprime numbers m and n are both represented in dis-
criminant ∆ then so is their product mn .
Applying this repeatedly, we see that if a number n has the prime factorization
e e e
n = p11 · · · pkk for distinct primes pi , and if pi i is represented in discriminant ∆ for
Section 6.2 — Representations in a Fixed Discriminant 163
Lemma 6.4. If a number x is a square mod m1 and is also a square mod m2 where
m1 and m2 are coprime, then x is a square mod m1 m2 .
For example, the number 2 is a square mod 7 (since 32 ≡ 2 mod 7 ) and also mod
17 (since 62 ≡ 2 mod 17 ) so 2 must also be a square mod 7·17 = 119 . And in fact
2 ≡ 112 mod 119 .
Proof: This will be a consequence of the Chinese Remainder Theorem. If x is a square
mod m1 and also a square mod m2 then there are numbers a1 and a2 such that
x ≡ a21 mod m1 and x ≡ a22 mod m2 . If m1 and m2 are coprime then by the
Chinese Remainder Theorem there is a number a that is congruent to a1 mod m1
and to a2 mod m2 , hence a2 ≡ a21 mod m1 and a2 ≡ a22 mod m2 . Thus x ≡ a2
mod m1 and mod m2 . This implies x ≡ a2 mod m1 m2 since the difference x − a2
is divisible by both m1 and m2 and hence by their product m1 m2 since m1 and m2
are coprime. This shows that x is a square mod m1 m2 . ⊓
⊔
Proof of Proposition 6.3: Let m and n be coprime. At least one of them must be
odd, say n is odd. If m and n are represented in discriminant ∆ then ∆ is a square
mod 4m and mod 4n , hence also mod n . Since 4m and n are coprime the lemma
then says that ∆ is a square mod 4mn , so mn is represented in discriminant ∆ . ⊓
⊔
Next we try to reduce further from prime powers to primes themselves. This is
possible for most primes by the following more technical result:
Lemma 6.5. If a number x is a square mod p for an odd prime p not dividing x ,
then x is also a square mod p r for each r > 1 . The corresponding statement for
the prime p = 2 is that if an odd number x is a square mod 8 then x is also a
square mod 2r for each r > 3 .
Proof of Lemma 6.5: We will show that if x is a square mod p r then it is also a
square mod p r +1 , assuming r ≥ 1 in the case that p is odd and r ≥ 3 in the case
p = 2 . By induction this will prove the lemma.
We begin by assuming that x is a square mod p r , so there is a number y such
that x ≡ y 2 mod p r or in other words p r divides x − y 2 , say x − y 2 = p r l for
164 Chapter 6 — Representations by Quadratic Forms
In the examples for the representation problem that we looked at in the preceding
section we saw that primes that divide the discriminant behave differently from primes
that do not, and the differences begin at this point:
For the problem of determining which primes are represented in a given discrim-
inant we already know when 2 is represented and we know that primes dividing the
discriminant are always represented. After these special cases what remains are the
odd primes not dividing the discriminant, which can be regarded as the generic case.
An odd prime p will be represented in discriminant ∆ exactly when ∆ is a square
mod p . Let us introduce some convenient notation for this condition. For
p an odd
a
prime and a an integer not divisible by p , define the Legendre symbol p by
a +1 if a is a square mod p
=
p −1 if a is not a square mod p
78 2 3 13 2
we factor 78 to get = 89 89 89 . By property (3) we have 89 = +1 since
89
3 89 13 89
89 ≡ 1 mod 8 . Next, reciprocity gives 89 = 3 and 89 = 13 since 89 ≡ 1
a
mod 4 . After this we use the fact that p depends only on the value of a mod p to
89 2 89 11 2
reduce 3 to 3 and 13 to 13 . Using property (3) again we have 3 = −1 ,
11
confirming the obvious fact that 2 is not a square mod 3 . For 13 , reciprocity says
13 2
this equals 11 . This reduces to 11 = −1 . Summarizing, we have
78 2 3 13
= = +1 −1 −1 = +1
89 89 89 89
so we see that 78 is a square mod 89 , even though we have not found an actual
number x such that x 2 ≡ 78 mod 89 .
In this example we used the fact that the modulus 89 was prime, but we have
already seen how to reduce to the case of prime moduli. For example if we wanted to
determine whether 78 is a square mod 88 we know this is the case exactly when it is
a square mod 8 and mod 11 . The squares mod 8 are 0 , 1 , and 4 whereas 78 ≡ 6
mod 8 so 78 is not a square mod 8 and therefore not mod 88 either, even though
78 ≡ 1 mod 11 so 78 is a square mod 11 .
Returning now to quadratic forms, let us see what the basic properties of Legendre
symbols tell us about which primes are represented by some of the forms discussed
at the beginning of the chapter. In the first four cases the class number is 1 so we will
be determining which primes are represented by the given form, and Theorem 6.8
will then say exactly which numbers are represented by this form, confirming the
conjectures made when we looked at the topographs.
---3
p > 3 we can evaluate p using quadratic reciprocity:
(+1) p if p = 4k + 1
---3 ---1 3 3
= =
p p p (−1) − p if p = 4k + 3
3
p p p
so we get 3
in both cases.
Since 3
only depends on p mod 3 , we have 3
= +1
p
if p ≡ 1 mod 3 and 3
= −1 if p ≡ 2 mod 3 . (Since p ≠ 3 we do not need to
consider the possibility p ≡ 0 mod 3 .) The conclusion is that the primes represented
by x 2 + xy + y 2 are 3 and the primes p ≡ 1 mod 3 .
Our next result generalizes Theorem 6.8 to cover all discriminants. As one can
see, the general statement is considerably more complicated than for fundamental
discriminants.
q mod 8 1 3 5 7
e all ≤s−1 ≤s ≤s−1
Examples will be given following the proof. The main part of the proof is con-
tained in a lemma:
170 Chapter 6 — Representations by Quadratic Forms
Lemma 6.12. For a given prime p suppose that a number x divisible by p factors
as p q where p does not divide q , so p s is the largest power of p dividing x .
s
Then:
(a) x is a square mod p r for each r ≤ s .
(b) If r > s and s is odd then x is not a square mod p r .
(c) If r > s and s is even then x is a square mod p r if and only if q is a square
mod p r −s .
Proof: Part (a) is easy since x is 0 mod p s hence also mod p r if r ≤ s , and 0 is
always a square mod anything.
For (b) we assume r > s and s is odd. Suppose p s q is a square mod p r , so
p s q = y 2 + lp r for some integers y and l . Then p s divides y 2 + lp r and it divides
lp r (since r > s ) so p s divides y 2 . Since s is assumed to be odd and the exponent of
p in y 2 must be even, this implies p s+1 divides y 2 . It also divides lp r since s +1 ≤ r ,
so from the equation p s q = y 2 + lp r we conclude that p divides q , contrary to the
definition of q . This contradiction shows that p s q is not a square mod p r when
r > s and s is odd, so statement (b) is proved.
For (c) we assume r > s and s is even. As in part (b), if p s q is a square mod p r
we have an equation p s q = y 2 + lp r and this implies that p s divides y 2 . Since s
is now even, this means y 2 = p s z 2 for some number z . Canceling p s from p s q =
y 2 + lp r yields an equation q = z 2 + lp r −s , which says that q is a square mod p r −s .
Conversely, if q is a square mod p r −s we have an equation q = z 2 + lp r −s and hence
p s q = p s z 2 + lp r . Since s is even, this says that p s q is a square mod p r . ⊓
⊔
Proof of Theorem 6.11: As in the proof of Theorem 6.8 the question reduces to
representing powers of primes. We know that all powers of a prime not dividing
the discriminant ∆ are represented if the prime itself is represented. We also know
that primes p dividing ∆ are represented, and their powers p e with e > 1 cannot
be represented unless p divides the conductor. For the remaining case of primes
dividing the conductor we will apply the preceding lemma with x = ∆ .
For odd p dividing ∆ we need to determine when ∆ is a square mod p e . By the
lemma the times this happens are when e ≤ s , or when e > s and s is even and q is
a square mod p e−s . When e > s this last condition
amounts just to q being a square
q
mod p by Lemma 6.5, or in other words p = +1 .
When p = 2 we need to determine when ∆ is a square mod 4·2e = 2e+2 . By the
lemma this happens only when e ≤ s − 2 or when s is even and q (which is odd) is
a square mod 2e+2−s . If e = s − 1 then e + 2 − s = 1 and every q is a square mod
2e+2−s = 2 . If e = s then e + 2 − s = 2 and q is a square mod 2e+2−s = 4 only when
q = 4k + 1 . And if e ≥ s + 1 then e + 2 − s ≥ 3 and q is a square mod 2e+2−s only
when it is a square mod 8 , which means q = 8k + 1 . ⊓
⊔
Section 6.2 — Representations in a Fixed Discriminant 171
Let us look at two examples illustrating some of the more subtle possibilities
in the preceding theorem. The examples involve the rather simple forms x 2 + ny 2
whose discriminant −4n is sometimes not a fundamental discriminant such as when
n is congruent to 3 mod 4 . The examples will be the cases n = 3, 7 .
Example: ∆ = −12 with conductor 2 . The two forms here are Q1 = x 2 + 3y 2 and
the nonprimitive form Q2 = 2x 2 + 2xy + 2y 2 .
---12
The primes represented in discriminant −12 are 2 , 3 , and primes p with p =
p
---3 ---1 3
p = p p = 3 = +1 , so these are the primes p ≡ 1 mod 3 . By Theorem 6.11
the numbers represented in discriminant −12 are the numbers n = 2a 3b p1 · · · pk
with a ≤ 2 , b ≤ 1 , and each pi a prime congruent to 1 mod 3 . (When we apply the
theorem for pi = 2 we have s = 2 and q = −3 .) We can in fact determine which
of Q1 and Q2 is giving these representations. The form Q2 is twice x 2 + xy + y 2
and we have already determined which numbers the latter form represents, namely
the products 3b p1 · · · pk with b ≤ 1 and each prime pi ≡ 1 mod 3 . Thus, of the
numbers represented by Q1 or Q2 , the numbers represented by Q2 are those with
a = 1 . None of these numbers with a = 1 are represented by Q1 since x 2 + 3y 2 is
never 2 mod 4 , as x 2 and y 2 must be 0 or 1 mod 4 .
Example: ∆ = −28 with conductor 2 again. Here the only two forms up to equiva-
lence are Q1 = x 2 + 7y 2 and Q2 = 2x 2 + 2xy + 4y 2 which is not primitive.
---28
The primes represented in discriminant −28 are 2 , 7 , and odd primes p with p =
p
---1 7
p p = 7 = +1 so p ≡ 1, 2, 4 mod 7 . According to Theorem 6.11 the numbers
represented by Q1 or Q2 are the numbers n = 2a 7b p1 · · · pk with b ≤ 1 and each
pi an odd prime congruent to 1 , 2 , or 4 mod 7 . There is no restriction on a since
when we apply the theorem with pi = 2 we have s = 2 and q = −7 = 8l + 1 .
172 Chapter 6 — Representations by Quadratic Forms
We can say exactly which numbers are represented by Q2 since it is twice the
form x 2 + xy + 2y 2 of discriminant −7 , which is a fundamental discriminant of
class number 1 so Theorem 6.8 tells us which numbers this form represents, namely
the numbers 7b p1 · · · pk with b ≤ 1 and primes pi ≡ 1, 2, 4 mod 7 , including now
the possibility pi = 2 . Thus Q2 represents exactly the numbers 2a 7b p1 · · · pk with
a ≥ 1 , b ≤ 1 and odd primes pi ≡ 1, 2, 4 mod 7 . Hence Q1 must represent at least
the numbers 2a 7b p1 · · · pk with a = 0 , b ≤ 1 , and odd primes pi ≡ 1, 2, 4 mod 7 .
These numbers are all odd since a = 0 , but Q1 also represents some even numbers
since x 2 + 7y 2 is even whenever both x and y are odd.
From the topograph we might conjecture that Q1 represents exactly the numbers
2a 7b p1 · · · pk with a ≠ 1, 2 and the same conditions on b and the primes pi as
before. For example one can see that 8 , 16 , 32 , 64 , and 128 are represented. It is
not difficult to exclude a = 1 and a = 2 by considering the values of x 2 + 7y 2 mod 4
and mod 8 . To see that Q1 represents all the predicted numbers with a ≥ 3 we use
the following result.
For nonfundamental discriminants Theorem 6.11 says nothing about whether the
representing forms are primitive. As we will see in Theorem 7.7, determining the
numbers represented by primitive forms of a given discriminant also reduces to the
special case of representing prime powers by primitive forms. Namely, a product of
k
powers pi i of distinct primes pi is represented by a primitive form exactly when each
k
of the prime powers pi i is represented by a primitive form. Most prime powers are
represented only by primitive forms, according to the following easy result:
Section 6.2 — Representations in a Fixed Discriminant 173
For primes dividing the conductor one can get some idea of the complications
that can occur from the table on the next page. This lists all the equivalence classes of
forms, both primitive and nonprimitive, for nonfundamental negative discriminants
up to −99 , along with the prime powers p k represented by these forms for primes
p dividing the conductor d . To save space the table uses the abbreviated notation
[a, b, c] for the form ax 2 + bxy + cy 2 .
Some information in the table can be deduced from the earlier Proposition 6.13,
such as the fact that if nonprimitive forms of a given discriminant represent all powers
p k with k ≥ 1 then primitive forms of that discriminant represent all powers p k with
k ≥ 3 . This statement is optimal for some discriminants such as −28 and −60 but
not for others such as −72 and −99 where p 2 is also represented by a primitive form.
In the table one can see that primitive forms represent powers of primes dividing
the conductor but not these primes themselves. As we will show in Proposition 6.15,
a prime can only be represented by a single equivalence class of forms of a given dis-
criminant, and a prime p dividing the conductor for discriminant ∆ is represented by
p times the principal form of discriminant ∆/p 2 , so p is represented by a nonprimi-
tive form and hence cannot also be represented by a primitive form. The uniqueness
of forms representing primes holds also for powers of primes that do not divide the
conductor, but we see from the table that this uniqueness may not hold for primes
that do divide the conductor, even if we restrict attention just to primitive forms, as
for example in the case ∆ = −32 where 23 is represented by two nonequivalent prim-
itive forms, or discriminants −72 and −99 where there are infinitely many different
powers p k represented by different primitive forms.
The entries in the table where Theorem 6.11 says that only finitely many powers
k
p are represented can be checked just by drawing topographs, but in the other cases
one must use general theory. We already explained the first case ∆ = −28 in the
earlier analysis of the form x 2 + 7y 2 . For the next case ∆ = −60 the methods in the
next section will suffice. A technique for handling the last few cases in the table will
be explained at the end of Chapter 8.
174 Chapter 6 — Representations by Quadratic Forms
∆ d Q prim. pk Q nonprim. p k
−12 2 [1, 0, 3] 22 2[1, 1, 1] 21
−16 2 [1, 0, 4] 22 , 23 2[1, 0, 1] 21 , 22
−27 3 [1, 1, 7] 32 , 33 3[1, 1, 1] 31 , 32
−28 2 [1, 0, 7] 23 , 24 , 25 , · · · 2[1, 1, 2] 21 , 22 , 23 , · · ·
−32 2 [1, 0, 8] 23 2[1, 0, 2] 21 , 22
[3, 2, 3] 22 , 23
−36 3 [1, 0, 9] 32 3[1, 0, 1] 31
[2, 2, 5] 32
−44 2 [1, 0, 11] — 2[1, 1, 3] 21
[3, 2, 4] 22
−48 4 [1, 0, 12] 24 2[1, 0, 3] 21 , 23
[3, 0, 4] 22 , 24 4[1, 1, 1] 22
−60 2 [1, 0, 15] 24 , 26 , 28 , 210 , · · · 2[1, 1, 4] 21 , 23 , 25 , 27 , · · ·
[3, 0, 5] 23 , 25 , 27 , 29 , · · · 2[2, 1, 2] 22 , 24 , 26 , 28 , · · ·
−63 3 [1, 1, 16] — 3[1, 1, 2] 31
[2, 1, 8] 32
[4, 1, 4] 32
−64 4 [1, 0, 16] 24 , 25 2[1, 0, 4] 21 , 23 , 24
[4, 4, 5] 22 , 24 , 25 4[1, 0, 1] 22 , 23
−72 3 [1, 0, 18] 33 , 34 , 35 , 36 , · · · 3[1, 0, 2] 31 , 32 , 33 , 34 , · · ·
[2, 0, 9] 32 , 33 , 34 , 35 , · · ·
−75 5 [1, 1, 19] 52 5[1, 1, 1] 51
[3, 3, 7] 52
−76 2 [1, 0, 19] — 2[1, 1, 5] 21
[4, 2, 5] 22
−80 2 [1, 0, 20] — 2[1, 0, 5] 21
[4, 0, 5] 22 2[2, 2, 3] 22
[3, 2, 7] 23
−92 2 [1, 0, 23] 25 , 28 , 211 , 214 , · · · 2[1, 1, 6] 21 , 24 , 27 , 210 , · · ·
[3, 2, 8] 23 , 24 , 26 , 27 , · · · 2[2, 1, 3] 22 , 23 , 25 , 26 , 28 , 29 , · · ·
−96 2 [1, 0, 24] — 2[1, 0, 6] 21
[3, 0, 8] 23 2[2, 0, 3] 22
[5, 2, 5] 23
[4, 4, 7] 22
−99 3 [1, 1, 25] 33 , 34 , 35 , 36 , · · · 3[1, 1, 3] 31 , 32 , 33 , 34 , · · ·
[5, 1, 5] 32 , 33 , 34 , 35 , · · ·
Section 6.2 — Representations in a Fixed Discriminant 175
In the previous section we saw examples where two nonequivalent forms of the
same discriminant both represent the same number. However, this does not happen
for representations of 1 or primes or powers of most primes:
Proposition 6.15. If Q1 and Q2 are two forms of the same discriminant that both
represent the same prime p or both represent 1 , then Q1 and Q2 are equivalent.
The same conclusion holds when Q1 and Q2 both represent the same power p k of
an odd prime p that does not divide the discriminant.
The last statement is also true for p = 2 but the proof is more difficult so we will
wait until the next chapter to deduce this from a more general result, Theorem 7.7.
Examples showing that powers of primes dividing the discriminant can be represented
by nonequivalent forms of the same discriminant can be found in the table on the
previous page. In these examples the prime in question divides the conductor, not
just the discriminant, but this has to be the case since for primes p dividing the
discriminant but not the conductor the only power p k represented by a form of the
given discriminant is p itself, by Proposition 6.7.
Proposition 6.16. If the topograph of a form has two regions with the same label
n where n is either 1 , a prime, or a power of an odd prime not dividing the dis-
criminant, then there is a symmetry of the topograph that takes one region labeled
n to the other. Similarly, for positive discriminants and for the same numbers n ,
if there is one region labeled n and another labeled −n then there is a skew sym-
metry taking one region to the other.
Proof: Suppose first that there are two regions having the same label n . As we saw
in the proof of the preceding proposition, each of these regions is adjacent to an edge
with the same label h and hence the labels q across these edges are also the same.
This means there is a symmetry taking one region labeled n to the other.
The other case is that one region is labeled n and the other −n . The topographs
of the given form Q and its negative −Q then each have a region labeled n so there
is an equivalence from Q to −Q taking the n - region for Q to the n - region for −Q .
This equivalence can be regarded as a skew symmetry of Q taking the n - region to
the −n - region. ⊓
⊔
Section 6.2 — Representations in a Fixed Discriminant 177
We can be more specific about forms that represent prime divisors of the discrim-
inant, and more generally divisors of the discriminant that are products of distinct
primes:
The first two topographs have a single reflector line while the third has two reflector
lines. The squarefree positive divisors of the discriminant are 1, 2, 3, 6 and these each
appear in a unique topograph, always on a reflector line. The non-squarefree divisors
9 and 18 appear in two topographs, once on a reflector line and once not on a reflector
line in each case. The remaining non-squarefree divisors 4, 12, 36 do not appear in
any of the topographs.
Examples like this can only occur when ∆ is not a fundamental discriminant
since divisors of a fundamental discriminant can only be represented when they are
squarefree, as we saw in Theorem 6.8.
Proof of Proposition 6.17: We know from Theorem 6.11 that each squarefree divisor
a of ∆ is represented by some form Q of discriminant ∆ , so a appears in the to-
pograph of Q . (This can also be deduced just from Lemma 6.4 and Proposition 6.7.)
If b is one of the labels on an edge bordering the region labeled a then we have
∆ = b2 − 4ac for c the label on the other region adjacent to the b edge. Since we
assume a divides ∆ = b2 − 4ac it must also divide b2 , and if a is squarefree it will
therefore divide b . Thus we have b = ma for some integer m . The labels on the
edges bordering the a region form an arithmetic progression with increment 2a so
these are the numbers b + 2ka as k ranges over all integers. Since b = ma we can
factor b + 2ka as (m + 2k)a . The numbers m + 2k for varying k form an arithmetic
178 Chapter 6 — Representations by Quadratic Forms
progression consisting of all even numbers if m is even and all odd numbers if m is
odd. Thus we can choose k so that m + 2k is either 0 or 1 , and hence the arithmetic
progression (m + 2k)a contains either 0 or a . This means one of the edge labels on
the border of the a region is either 0 or a ,
with the topograph near this edge having the
shape shown in the figure. From this we see
that there is a reflector line passing through
the a region and the form is equivalent to ei-
ther ax 2 + cy 2 or ax 2 + axy + cy 2 .
To finish the proof we only need to see that there cannot be two forms ax 2 + cy 2
and ax 2 + axy + c ′ y 2 with the same a and the same discriminant. Equating the
discriminants of these two forms, we would have −4ac = a2 − 4ac ′ and therefore
a = 4(c ′ − c) , but a would then be divisible by 4 and thus not squarefree. ⊓
⊔
For the last result in this section we will use a variant of Euclid’s proof that there
are infinitely many primes to prove the following general statement:
Proposition 6.18. For each discriminant ∆ the set of primes represented in discrim-
inant ∆ is infinite.
Exercises
3. Verify that the statement of quadratic reciprocity is true for the following pairs of
primes (p, q) : (3, 5) , (3, 7) , (3, 13) , (5, 13) , (7, 11) , and (13, 17) .
30 99 506
4. Evaluate the following Legendre symbols: 101 , 101 , 967 .
a
5. Show that p can always be computed just from the four basic properties of
Legendre symbols.
6. Determine which numbers in the range from 40 to 50 are squares mod 132 .
7. (a) Using quadratic reciprocity determine which primes are represented by some
form of discriminant 17 .
(b) Show that all forms of discriminant 17 are equivalent to the form x 2 + xy − 4y 2 .
(c) Draw enough of the topograph of x 2 + xy − 4y 2 to show all values between −70
and 70 , and verify that the primes that occur are precisely the ones predicted by your
answer in part (a).
8. Determine which primes are represented by at least one form of the following
discriminants: (a) 21 (b) −19 (c) −20 (d) −24 .
9. Show that every prime is represented by at least one of the forms x 2 +y 2 , x 2 +2y 2 ,
and x 2 − 2y 2 .
10. Consider forms Q = ax 2 +bxy +cy 2 of discriminant ∆ . Show that the following
three conditions are equivalent:
(1) The coefficients a , b , and c of Q are all odd.
(2) Q represents only odd numbers.
(3) ∆ ≡ 5 mod 8 .
11. For which fundamental discriminants ∆ is there a form of discriminant ∆ repre-
senting |∆| ? What about nonfundamental discriminants?
12. In terms of their prime factorizations, which numbers are sums of two nonzero
squares? Which squares are sums of two nonzero squares?
13. Show that if the form x 2 + ny 2 represents 2k with n odd and k > 0 then n ≡ 7
mod 8 except when (n, k) = (1, 1) and (3, 2) .
14. Show that for each prime p dividing the conductor for discriminant ∆ there is at
least one primitive form of discriminant ∆ that represents a power of p . [Hint: Use
induction on the highest power of p dividing the conductor, along with Theorem 6.11
and Propositions 6.13 and 6.14.]
180 Chapter 6 — Representations by Quadratic Forms
Before proving this let us see how it applies in the case ∆ = 40 with p = 5 . The
class number here is 2 corresponding to the forms x 2 − 10y 2 and 2x 2 − 5y 2 .
n
According to the proposition, for each of the two forms the value of 5
must be the
same
for all numbers n in the topograph not divisible by 5 . To determine the value
n
of 5 for each form it therefore suffices to compute it for a single number n . The
simplest thing is just
to compute it for (x, y) = (1, 0) or
(0,1) . Choosing (1, 0) , for
2 2 1 2 2 2
x − 10y we have 5 = +1 and for 2x − 5y we have 5 = −1 . The proposition
2 2
says that all numbers n in the topograph of x − 10y not divisible
then by 5 have
n 2 2 n
5
= +1 , hence n ≡ ±1 mod 5 , while for 2x − 5y we have 5 = −1 , hence
n ≡ ±2 mod 5 . Thus the last digits of the numbers in the topograph of x 2 − 10y 2
must be 0 , 1 , 4 , 5 , 6 , or 9 and for 2x 2 −5y 2 the last digits must be 0 , 2 , 3 , 5 , 7 , or 8 .
Note that the congruences n ≡ ±1 and n ≡ ±2 mod 5 are consistent with the fact
Section 6.3 — Genus and Characters 181
that for both forms the negative values are just the negatives of the positive values.
(The proposition holds for negative as well as positive numbers in topographs.)
p
40 2
We know that p = p 5 must equal +1 for primes p ≠ 2, 5 represented by
either form, so for x 2 − 10y 2 this product must be (+1)(+1) while for 2x 2 − 5y 2 it
must be (−1)(−1) .
1 3 7 9 11 13 17 19 21 23 27 29 31 33 37 39
2
+1 −1 +1 +1 −1 −1 +1 −1 −1 +1 −1 −1 +1 +1 −1 +1
p
p
5
+1 −1 −1 +1 +1 −1 −1 +1 +1 −1 −1 +1 +1 −1 −1 +1
Q1 Q2 Q1 Q2 Q2 Q1 Q2 Q1
From the table we can see exactly which primes each of these two forms represents,
namely x 2 − 10y 2 represents primes p ≡ 1, 9, 31, 39 mod 40 while 2x 2 − 5y 2 rep-
resents primes p ≡ 3, 13, 27, 37 mod 40 .
Proof of Proposition 6.19: For an edge in the topograph labeled h with adjacent
regions labeled n and k we have ∆ = h2 − 4nk . If p is a prime dividing ∆ this
implies that 4nk ≡ h2 mod p . Thusif neither n nor k is divisible
2 by p and p is
4nk 4nk h
odd then the Legendre symbol p is defined and p = p = +1 . Since
4nk 4 n k 4 n k
p = p p p and p = +1 this implies p = p . In other words, the
n
symbol p takes the same value on any two adjacent regions of the topograph of Q
labeled by numbers not divisible by p . To finish the proof we will use the following
fact:
Lemma 6.20. Given a form Q and a prime p dividing the discriminant of Q , then
any two regions in the topograph of Q where the value of Q is not divisible by p
can be connected by a path passing only through such regions.
Assuming
this, the proposition easily follows since we have seen that the value
n
of p is the same for any two adjacent regions with label not divisible by p . ⊓
⊔
Proof of the Lemma: Let us call regions in the topograph of Q whose label is not
divisible by p good regions, and the other regions bad regions. We can assume that
at least one region is good, otherwise there is nothing to prove. What we will show
is that no two bad regions can be adjacent. Thus a path in the topograph from one
good region to another cannot pass through two consecutive bad regions, and if it
does pass through a bad region then a detour around this region allows this bad
region to be avoided, creating a new path passing
through one fewer bad region as in the figure at the
right. By repeating this detouring process as often
as necessary we eventually obtain a path avoiding
bad regions entirely, still starting and ending at the
same two given good regions.
182 Chapter 6 — Representations by Quadratic Forms
To see that no two adjacent regions are bad, suppose this is false, so there are
two adjacent regions whose Q values n and k are both divisible by p . If the edge
separating these two regions is labeled h then we have an equation ∆ = h2 −4nk , and
since we assume p divides ∆ this implies that p divides h as well as n and k . Thus
the form nx 2 + hxy + ky 2 , which is equivalent to Q , is equal to p times another
form. This implies that all regions in the topograph of Q are bad. This contradicts
an earlier assumption so we conclude that there are no adjacent bad regions. ⊓
⊔
n
A useful observation is that the value of p for numbers n in the topograph of
a form ax 2 + bxy + cy 2 with discriminant divisible by p can always be determined
just by looking at the coefficients a and c . This is because a and c appear in adjacent
regions of the topograph, so if both these coefficients were divisible by p , this would
imply that b was also divisible by p since p divides b2 − 4ac , so the whole form
would be divisible by p . Excluding this uninteresting possibility, we see
that at least
n
one of a and c is not divisible by p and we can use this to compute p .
Let us look at another example, the discriminant ∆ = −84 = −22 ·3·7 with three
different prime factors. For this discriminant there are four equivalence classes of
forms: Q1 = x 2 + 21y 2 , Q2 = 3x 2 + 7y 2 , Q3 = 2x 2 + 2xy + 11y 2 , and Q4 =
5x 2 + 4xy + 5y 2 . The topographs of these forms were shown earlier in the chapter.
To see which odd primes are represented in discriminant −84 we compute:
p p
---84 ---1 3 4 7 ---1 3 7 ---1
p = p p p p = p p p = p 3 7
43 47 53 55 59 61 65 67 71 73 79 83
---1
−1 −1 +1 −1 −1 +1 +1 −1 −1 +1 −1 −1
p
p
3
+1 −1 −1 +1 −1 +1 −1 +1 −1 +1 +1 −1
p
+1 −1 +1 −1 −1 −1 +1 +1 +1 −1 +1 −1
7
Q2 Q3
p p
---1
The twelve cases when the product p 3 7
is +1 give the congruence classes
of primes not dividing ∆ that are represented by one pof
the four
p forms, and we can
determine which form it is by looking at the values of 3 and 7 for each of the four
Section 6.3 — Genus and Characters 183
Another case we looked at was ∆ = −56 where there were three inequivalent
forms
Q1 = x 2 +14y 2
, Q2=p2x
2 2 2 2
+ 7y , and Q3 = 3x + 2xy + 5y . Here we have
---56 ---1 2 7 2
p = p p p = p 7 . The table of values for these Legendre symbols for
congruence classes of numbers mod 56 not divisible by 2 or 7 is:
1 3 5 9 11 13 15 17 19 23 25 27
2
+1 −1 −1 +1 −1 −1 +1 +1 −1 +1 +1 −1
p
p
+1 −1 −1 +1 +1 −1 +1 −1 −1 +1 +1 −1
7
Q1 Q1 Q1 Q1 Q1
Q2 Q3 Q3 Q2 Q3 Q2 Q3 Q2 Q2 Q3
29 31 33 37 39 41 43 45 47 51 53 55
2
−1 +1 +1 −1 +1 +1 −1 −1 +1 −1 −1 +1
p
p
+1 −1 −1 +1 +1 −1 +1 −1 −1 +1 +1 −1
7
Q1
Q2
Q3
p
2
From the table we see that p 7 is (+1)(+1) for p ≡ 1, 9, 15, 23, 25, 39 mod 56 and
(−1)(−1) for p ≡ 3, 5, 13, 19, 27, 45 mod 56 . Thus the primes that are represented
in discriminant −56 are the primes in these twelve p congruence classes, along with 2
and 7 , the prime divisors of 56 . Moreover, since 7 has the value +1 for numbers in
the topographs of Q1 and Q2 not divisible by 7 , and the value −1 for numbers in the
topograph of Q3 not divisible by 7 , we can deduce that primes p ≡ 1, 9, 15, 23, 25, 39
mod 56 are represented by Q1 or Q2 while primes p ≡ 3, 5, 13, 19, 27, 45 mod 56
are represented by Q3 . However the values of the Legendre symbols in the table do
not allow us to distinguish between Q1 and Q2 .
Each row in one of the tables above can be regarded as a function assigning a
number ±1 to each congruence class of numbers n coprime to the discriminant ∆ .
Such a function is called a character and the table is called a character table. There
is one column in the table for each congruence class of numbers coprime to ∆ so the
number of columns is ϕ(|∆|) where ϕ is the Euler phi function from Section 2.3. For
n
each odd prime p dividing ∆ there is a character given by the Legendre symbol p .
There is sometimes also a character associated to the prime 2 in a somewhat less
transparent way. In the example ∆ = −84 this is the character defined by the first
row of the table, which assigns the values +1 to numbers n = 4k + 1 and −1 to
184 Chapter 6 — Representations by Quadratic Forms
we can also introduce the notation χp for the earlier character defined
By analogy
n
by χp (n) = p for p an odd prime and n not divisible by p .
As another example illustrating the use of characters let us determine which pow-
ers of 2 are represented by the two forms x 2 + 15y 2 and 3x 2 + 5y 2 of discriminant
−60 . This is not a fundamental discriminant since it is 4 times the fundamental dis-
criminant −15 , so the conductor is 2 which is why the question of determining the
forms representing powers of 2 is more subtle, as we saw in the previous section. In
both the discriminants −15 and −60 we have the characters χ3 and χ5 and we can
use either one of these for this application so we will use χ3 .
First consider discriminant −15 where the class number is 2 corresponding to the
two forms x 2 + xy + 4y 2 and 2x 2 + xy + 2y 2 . The second form represents 2 which
does not divide the discriminant −15 so all powers of 2 are represented by one or the
other of these two forms. To determine which form it is for each power we use the
character χ3 . This has the value +1 on numbers not divisible by 3 in the topograph
of x 2 + xy + 4y 2 since 1 is one of these numbers and χ3 (1) = +1 . Similarly χ3 has
the value −1 for the other form 2x 2 + xy + 2y 2 since 2 appears in the
topograph
k
k k k 2k 2
of this form and χ3 (2) = −1 . We have χ3 (2 ) = (−1) since χ3 (2 ) = 3 = 3 .
Hence x 2 + xy + 4y 2 represents only the even powers of 2 and 2x 2 + xy + 2y 2
represents only the odd powers.
For discriminant −60 the class number is also 2 , corresponding to the forms
x + 15y 2 and 3x 2 + 5y 2 . Obviously neither of these forms represents 2 or 4 .
2
Let us consider now how characters can be associated to the prime 2 in general.
Since characters arise from primes that divide the discriminant, this means we are
interested in even discriminants, and the characters we are looking for should assign a
value ±1 to each number not divisible by 2 , that is, to each odd number. We would like
the analog of Proposition 6.19 to hold, so characters for the prime 2 should take the
same value on all odd numbers in the topograph of a form of the given discriminant.
By Lemma 6.20 this just means that the characters should have the same value for
odd numbers in adjacent regions of the topographs.
Even discriminants are multiples of 4 so can be written as ∆ = 4δ . For adjacent
regions in a topograph with labels n and k we have ∆ = h2 − 4nk where h is the
label on the edge between the two regions. Since ∆ is even, so is h and we can write
h = 2l . The discriminant equation then becomes 4δ = 4l2 − 4nk or just δ = l2 − nk .
There will turn out to be six different cases. The first two are when δ is odd, which
means that ∆ is divisible by 4 but not 8 . In these two cases we consider congruences
mod 4 , the highest power of 2 dividing ∆ . Since δ is odd and both n and k are odd,
the equation δ = l2 − nk implies that l must be even, so l2 ≡ 0 mod 4 and we have
nk ≡ −δ mod 4 . Multiplying both sides of this congruence by k , we get n ≡ −δk
mod 4 since k2 ≡ 1 mod 4 , k being odd. Multiplying the congruence n ≡ −δk by k
again gives the previous congruence nk ≡ −δ so the two congruences are equivalent.
Case 2: δ = 4m + 1 . The difference from the previous case is that the congruence
condition is now n ≡ −k mod 4 . This means the mod 4 value of odd numbers in the
topograph is not constant, and so we do not get a character for the prime 2 . As an
example, consider the form x 2 + 3y 2 with ∆ = −12 and δ = −3 .
186 Chapter 6 — Representations by Quadratic Forms
Here there are odd numbers in the topograph congruent to both 1 and 3 mod 4 .
The situation is not improved by considering odd numbers mod 8 instead of mod 4
since the topograph contains numbers congruent to each of 1, 3, 5, 7 mod 8 . Trying
congruences modulo higher powers of 2 does not help either.
The absence of a character for the prime 2 when δ = 4m + 1 could perhaps
∆
have been predicted from the calculation of p . Since pδ is odd
p we have ∆ =
∆ 1 r
= 4p1· · ·pr for odd primes p1 , · · · , pr and so p = p · · · p . This equals
4δ
p p
p1 · · · pr of pi ’s congruent to 3 mod 4 is even when δ =
since the number
4m + 1 . Thus the value of ∆
p depends only on the characters associated to the odd
prime factors of ∆ .
There remain the cases that δ is even. The next two cases are when ∆ is divisible
by 8 but not by 16 . After that is the case that ∆ is divisible by 16 but not by 32 ,
and finally the case that ∆ is divisible by 32 . In all these cases we will consider
congruences mod 8 , so the equation δ = l2 − nk becomes δ ≡ l2 − nk mod 8 . Since
δ is now even while n and k are still odd, this congruence implies l is odd, and so
l2 ≡ 1 mod 8 and the congruence can be written as nk ≡ 1 − δ mod 8 . Since k2 ≡ 1
mod 8 when k is odd, we can multiply both sides of the congruence nk ≡ 1 − δ by k
to obtain the equivalent congruence n ≡ (1 − δ)k mod 8 .
1 5 7 11 13 17 19 23
χ8′ +1 −1 −1 +1 −1 +1 +1 −1
χ3 +1 −1 +1 −1 +1 −1 +1 −1
Thus Q1 represents primes p ≡ 1, 19 mod 24 and Q2 represents primes p ≡ 5, 23
mod 24 .
1 5 7 11 13 17 19 23 25 29 31 35 37 41 43 47
χ4 +1 +1 −1 −1 +1 +1 −1 −1 +1 +1 −1 −1 +1 +1 −1 −1
χ3 +1 −1 +1 −1 +1 −1 +1 −1 +1 −1 +1 −1 +1 −1 +1 −1
Q1 Q2 Q1 Q2 Q1 Q2 Q1 Q2
p
---1
The columns repeat every four columns since p and 3 are determined by the
value of p mod 12 . In contrast with earlier examples, the representability of a prime
p > 3 in discriminant −48 is determined by one character, χ3 , and the other character
χ4 serves only to decide which of the forms Q1 and Q2 achieves the representation.
The character χ4 says nothing about the nonprimitive forms Q3 and Q4 whose values
are all even. On the other hand, from χ3 we can deduce that all values of Q3 not
divisible by 3 must be congruent to 2 mod 3 while for Q4 they must be congruent
to 1 mod 3 . This could also have been deduced from applying χ3 to the associated
primitive forms x 2 + 3y 2 and x 2 + xy + y 2 .
two independent characters for the prime 2 . The full character table is then just a
four-fold repetition of the previous shorter table:
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31
χ4 +1 −1 +1 −1 +1 −1 +1 −1 +1 −1 +1 −1 +1 −1 +1 −1
χ8 +1 −1 −1 +1 +1 −1 −1 +1 +1 −1 −1 +1 +1 −1 −1 +1
Q1 Q2 Q1 Q2 Q1 Q2 Q1 Q2
This finishes the analysis of the six cases for characters associated to the prime 2 .
To summarize we have:
Proposition 6.21. The characters associated to the prime 2 are given in the follow-
ing table:
We have now defined a set of characters for each discriminant ∆ , with one char-
acter for each odd prime dividing ∆ and either zero, one, or two characters for the
prime 2 when ∆ is even. The character table for discriminant ∆ has one row for each
of these characters.
If one restricts attention to fundamental discriminants then the only relevant
columns in the table in the preceding proposition are the second, third, and fourth
columns on the right. Thus the characters for the prime 2 that arise in the three cases
of fundamental discriminants are exactly χ4 , χ8 , and χ8′ .
∆
Another useful observation is that the value of the Legendre symbol p is de-
termined
by the characters for discriminant ∆ . From Proposition 6.9 the formulas for
∆ s
p are given by the second column of the following table, where ∆ = ε2 p1 · · · pk
for ε = ±1 and odd primes pi . The product of characters corresponding to each
product of Legendre symbols in the second column is given in the third column.
∆
∆ p X∆
p p
22l (4m + 1) p1 · · · pk χp1 · · · χpk
---1 p p
22l (4m + 3) p p1 · · · pk χ4 χp1 · · · χpk
2 p p
22l+1 (4m + 1) p p1 · · · pk χ8 χp1 · · · χpk
---1 2 p p
22l+1 (4m + 3) p p p ··· p χ8′ χp1 · · · χpk
1 k
For the prime 2 we can compare this table with the one in Proposition 6.21. The
first four of the six cases
in the earlier table are included in the four cases here, so
∆
characters determine p in these cases. When ∆ = 16(2m + 1) in the previous table
Next let us verify that some of the special features of the character tables in the
earlier examples hold in general.
in these cases are the combinations with an even number of −1 ’s. This need not be
true for nonfundamental discriminants as the earlier example ∆ = −48 shows.
From statement (3) in the proposition we immediately deduce:
Corollary 6.23. For hyperbolic and elliptic forms, the primes not dividing the dis-
criminant ∆ that are represented by forms of discriminant ∆ are the primes in
exactly half of the congruence classes mod ∆ of numbers coprime to ∆ .
For the proof of Proposition 6.22 we will need the following fact:
r −1
Lemma 6.24. For a power p r of an odd prime p exactly half of the r
p − p
a
congruence classes mod p r of numbers a not divisible by p satisfy p = +1 .
Proof: First we do the case r = 1 . The p − 1 nonzero congruence classes mod p are
±1, ±2, · · · , ± 1/2 p −1 . The two numbers +a and −a in each pair ±a have the same
square, so there are at most 1/2 p − 1 different nonzero squares mod p . In fact there
are exactly this many since if a2 ≡ b2 mod p then p divides a2 − b2 = (a − b)(a + b) ,
so since p is prime it must divide either a − b or a + b which means that either a ≡ b
or a ≡ −b mod p . Thus exactly half of the p − 1 nonzero congruence classes mod p
are squares, so the lemma is proved when r = 1 .
a
Now suppose r > 1 . The value of p depends only on the congruence class of
a
a mod p so there are the same number of numbers a with p = +1 in each of the
intervals [0, p] , [p, 2p] , [2p, 3p] , etc. There are p r −1 of these intervals in [0, p r ] .
Thus half of the p r −1 (p− 1) r
=p −p
r −1 r
classes mod p of numbers a
congruence
a a
not divisible by p have p = +1 and half have p = −1 . ⊔
⊓
r −1
a given combination of values ±1 is the product of these numbers 1/2 pi i (pi − 1) .
When s > 0 but there is no character for the prime 2 the product of the numbers
1/ p ri −1 (p − 1) is multiplied by 2s−1 since this is the number of odd congruence
2 i i
classes mod 2s . If there is one character for the prime 2 the number 2s−1 is cut in
half, and if there are two characters for the prime 2 it is cut in half again. Thus in all
cases the number of columns realizing a given combination of ±1 ’s is independent
of the combination.
For (3), consider the definition of X∆ which has four different cases depending
on the prime factorization of ∆ . If ∆ is a square then the applicable formula is the
first of the four formulas since an odd square is 1 mod 4 , and in fact the formula
degenerates to just the constant +1 since its terms all cancel out, as each prime factor
of ∆ occurs to an even power. When ∆ is not a square then the terms in the first of
the four formulas do not all cancel out, and in the other three formulas there is also
at least one term remaining after cancellations, either χ4 , χ8 , or χ8′ .
In view of property (2), to prove (3) it will suffice to show that when ∆ is not
a square, the set of combinations of values ±1 in columns of the character table
that give X∆ = +1 has the same number of elements as the set of combinations
that give X∆ = −1 . But this is obviously true since we can interchange these two
sets by choosing one term in the formula for X∆ that remains after cancellation and
switching the sign of the value ±1 for this term, keeping the values for the other
characters unchanged. ⊓
⊔
Recall the concept of genus that was introduced earlier. The idea was that if two
forms of the same discriminant cannot be distinguished by looking only at their values
modulo the discriminant then they should be regarded as having the same genus. Here
it is best to restrict attention just to primitive forms. We can now give this notion a
more precise definition by saying that two primitive forms of discriminant ∆ have
the same genus if each character for discriminant ∆ takes the same value on the two
forms, where the value of a character on a form means its value on all numbers in the
topograph of the form not divisible by the prime associated to the character.
In fact there is always a single number in the topograph that can be used to
evaluate all the characters, according to the following general result:
Proposition 6.25. Given a positive integer n and a primitive form Q that represents
at least one positive number, then Q represents a positive number coprime to n .
For the application to evaluating characters we choose n = |∆| for ∆ the discrim-
inant of Q (which we assume is nonzero to avoid trivialities).
(1) If p does not divide a let (x, y) be a primitive pair with p dividing y but
not x . Then p will not divide ax 2 + bxy + cy 2 . For example we could take
(x, y) = (1, p) .
(2) If p divides a but not c let (x, y) be a primitive pair with p dividing x but
not y . Then p will not divide ax 2 + bxy + cy 2 . For example we could take
(x, y) = (p, 1) .
(3) If p divides both a and c then it will not divide b since Q is primitive. In this
case let (x, y) be a primitive pair with neither x nor y divisible by p . Then p
will not divide ax 2 + bxy + cy 2 . For example we could take (x, y) = (1, 1) .
This finishes the proof when n is prime. For a general n let p1 , · · · , pk be its distinct
prime divisors. For each pi let (xi , yi ) be (1, pi ) , (pi , 1) , or (1, 1) according to which
of the three cases above applies to pi . Now let x = x1 · · · xk and y = y1 · · · yk .
Then x and y are coprime since no pi is a factor of both x and y . If the number
ax 2 + bxy + cy 2 is not coprime to n it will be divisible by some pi . If case (1) applies
to pi then pi divides y but not x so pi does not divide ax 2 + bxy + cy 2 . Likewise
if cases (2) or (3) apply to pi then pi does not divide ax 2 + bxy + cy 2 . Thus no pi
can divide ax 2 + bxy + cy 2 . Finally, ax 2 + bxy + cy 2 is positive since x and y are
positive as are the coefficients except possibly b which is either positive or zero. ⊓
⊔
Theorem 6.26. If ∆ is not a square then the number of genera of primitive forms
of discriminant ∆ is 2κ−1 where κ is the number of characters in discriminant ∆ .
This turns out to be fairly hard to prove. The original proof by Gauss required
a somewhat lengthy digression into the theory of quadratic forms in three variables.
An exposition of this proof can be found in the book by Flath listed in the Bibliogra-
phy. We will give a different proof that deduces the result rather quickly from things
we have already done, together with Dirichlet’s Theorem about primes in arithmetic
progressions discussed at the end of Section 6.1, which we will not prove. We will
not need the full strength of Dirichlet’s theorem, and in fact all we will actually need
is that each congruence class of numbers x ≡ b mod a contains at least one prime
greater than 2 if a and b are coprime. One might think this would be easier to prove
than that there are infinitely many primes in the congruence class, but this seems not
to be the case.
Section 6.3 — Genus and Characters 193
Proof of Theorem 6.26 using Dirichlet’s Theorem: We have seen that for each prim-
itive form Q of discriminant ∆ there is a number n coprime to ∆ that is represented
by Q . Then X∆ (n) is defined, and we saw when we defined X∆ that X∆ (n) = +1
when n is represented by a form of discriminant ∆ . In the proof of Proposition 6.22
we showed that exactly half of the 2κ possible combinations of ±1 ’s have X∆ = +1 ,
so the number of genera of forms is at most 2κ−1 .
To show that the number of genera is at least 2κ−1 consider a combination of ±1 ’s
with X∆ = +1 . By Proposition 6.22 this combination occurs in some column of the
character table. This column corresponds to some number n coprime to ∆ . By Dirich-
let’s Theorem there exists a prime p congruent to n mod ∆ . We have X∆ (p) = +1 , so
since p is prime this implies that p is represented by some form of discriminant ∆ .
This form must be primitive, otherwise every number it represents would be divisible
by some number d > 1 dividing ∆ so it could not represent p which is coprime to ∆ .
Thus every combination of ±1 ’s with X∆ = +1 is realized by some primitive form, so
the number of genera is at least 2κ−1 . ⊓
⊔
This may seem a little surprising since there is no apparent connection between
genera and mirror symmetry. A possible explanation might be that each genus con-
tains exactly one equivalence class of primitive forms with mirror symmetry, but this
is not always true. For example when ∆ = −56 we saw earlier in the chapter that there
are two genera and two equivalence classes of mirror symmetric forms, but both these
forms belong to the same genus. The true explanation will come in Chapter 7 when
we study the class group.
Proof: The number of equivalence classes of primitive forms with mirror symmetry
was computed in Theorem 5.9 to be 2k−1 in most cases, where k is the number of
distinct prime divisors of ∆ . The exceptions are discriminants ∆ = 4(4m + 1) when
2k−1 is replaced by 2k−2 , and ∆ = 32m when 2k−1 is replaced by 2k . In the nonexcep-
tional cases we have k = κ , the number of characters in discriminant ∆ since there is
one character for each prime dividing ∆ . When ∆ = 4(4m + 1) there is no character
for the prime 2 so κ = k − 1 , and when ∆ = 32m there are two characters for the
prime 2 so κ = k + 1 . The result follows. ⊓
⊔
Corollary 6.28. For a fixed discriminant ∆ , each genus of primitive forms consists
of a single equivalence class of forms if and only if all the topographs of primitive
forms of discriminant ∆ have mirror symmetry.
194 Chapter 6 — Representations by Quadratic Forms
Proof: Let E(∆) be the set of equivalence classes of primitive forms of discriminant
∆ and let G(∆) be the set of genera of primitive forms of discriminant ∆ . There
is a natural function Φ : E(∆) → G(∆) assigning to each equivalence class of forms
the genus of these forms. The function Φ is onto since there is at least one form in
each genus, by the definition of genus. If all primitive forms of discriminant ∆ have
mirror symmetry then the previous corollary says that the sets E(∆) and G(∆) have
the same number of elements. Then since Φ is onto it must also be one-to-one. This
means that each genus consists of a single equivalence class of forms.
Conversely, if each genus consists of a single equivalence class then Φ is one-to-
one. Since Φ is also onto, this means it is a one-to-one correspondence so E(∆) and
G(∆) have the same number of elements. By the preceding corollary this means that
the equivalence classes of primitive forms with mirror symmetry account for all the
elements of E(∆) , and the proof is complete. ⊓
⊔
Exercises
1. For the following discriminants determine the class number and a form in each
class, then use a character table to determine which primes are represented by each
of the forms, at least to the extent that this can be determined by characters. Also
determine the various genera.
(a) −24 (b) 24 (c) −39 (d) −96
4. Find the smallest positive discriminant for which the number of genera is 16 . How
does the answer change if only fundamental discriminants are allowed?
5. Show that for a positive nonsquare discriminant ∆ , if the principal form represents
−1 then all odd primes p dividing ∆ must satisfy p ≡ 1 mod 4 . (Use χp .)
6. Use Propositions 6.1 and 6.25 to show that in each nonzero discriminant there
exists a form that represents an infinite number of primes.
Section 6.4 — Proof of Quadratic Reciprocity 195
Step 1. In what follows we will always use p to denote an odd prime, and the symbol
a will always denote an arbitrary nonzero integer not divisible by p . When we write
a congruence such as a ≡ b this will always mean congruence mod p , even if we do
not explicitly say mod p .
Euler’s formula is
a p−1
≡a 2
mod p
p
2
For
example, for p = 11 Euler’s formula says 11
≡ 25 = 32 ≡ −1 mod 11 and
3
11
≡ 35 = 243 ≡ +1 mod 11 . These are the correct values since the squares mod
11 are (±1)2 = 1 , (±2)2 = 4 , (±3)2 = 9 , (±4)2
≡ 5 , and (±5)2 ≡ 3 .
a
Euler’s formula determines the value of p uniquely since +1 and −1 are not
p−1
congruent mod p since p > 2 . It is not immediately obvious that the number a 2
Before proving Euler’s formula we will need to derive a few preliminary facts
about congruences modulo a prime p . First let us note that each of the numbers
a = 1, 2, · · · , p − 1 has a multiplicative inverse mod p . This is a special case of the
196 Chapter 6 — Representations by Quadratic Forms
fact that each number coprime to a number n has a multiplicative inverse mod n as
we saw in Section 2.3. (This was because the equation ax + ny = 1 has an integer
solution (x, y) whenever a and n are coprime.) Any two choices for an inverse to
a mod p are congruent mod p since if ax ≡ 1 and ax ′ ≡ 1 then multiplying both
sides of ax ′ ≡ 1 by x gives xax ′ ≡ x , and xa ≡ 1 so we conclude that x ≡ x ′ .
Which numbers equal their own inverse mod p ? If a·a ≡ 1 , then we can rewrite
this as a2 − 1 ≡ 0 , or equivalently (a + 1)(a − 1) ≡ 0 . This is certainly a valid con-
gruence if a ≡ ±1 , so suppose that a 6≡ ±1 . The factor a + 1 is then not congruent
to 0 mod p so it has a multiplicative inverse mod p , and if we multiply the congru-
ence (a + 1)(a − 1) ≡ 0 by this inverse, we get a − 1 ≡ 0 so a ≡ 1 , contradicting
the assumption that a 6≡ ±1 . This argument shows that the only numbers among
1, 2, · · · , p − 1 that are congruent to their inverses mod p are 1 and p − 1 .
An application of this fact is a result known as Wilson’s Theorem:
To see why this is true, observe that in the product (p − 1)! = (1)(2) · · · (p − 1) each
factor other than 1 and p − 1 can be paired with its multiplicative inverse mod p and
these two terms multiply together to give 1 mod p , so the whole product is congruent
to just (1)(p − 1) mod p . Since p − 1 ≡ −1 mod p this gives Wilson’s Theorem.
Now let us prove the following congruence known as Fermat’s Little Theorem:
To see this, note first that the numbers a, 2a, 3a, · · · , (p − 1)a are all distinct mod p
since we know that a has a multiplicative inverse mod p , so in a congruence ma ≡ na
we can multiply both sides by the inverse of a to deduce that m ≡ n . Let us call this
property that ma ≡ na implies m ≡ n the cancellation property for congruences
mod p .
It follows from the cancellation property that the set {a, 2a, 3a, · · · , (p − 1)a}
is the same mod p as {1, 2, 3, · · · , p − 1} since both sets have p − 1 elements and
neither set contains numbers that are 0 mod p . (If ma ≡ 0 then multiplying by the
inverse of a gives m ≡ 0 .) If we take the product of all the numbers in each of these
two sets we obtain the congruence
a
The other case is that p = −1 so a is not a square mod p . Observe first that
the congruence xy ≡ a has a solution y mod p for each x 6≡ 0 since x has an
inverse x −1 mod p so we can take y = x −1 a . Moreover the solution y is unique
mod p since xy1 ≡ xy2 implies y1 ≡ y2 by the cancellation property. Since we
are in the case that a is not a square mod p the solution y of xy ≡ a satisfies
y 6≡ x . Thus the numbers 1, 2, 3, · · · , p − 1 are divided up into 1/2 p − 1 pairs
{x1 , y1 }, {x2 , y2 }, · · · , {x p−1 , y p−1 } with xi yi ≡ a for each i . Multiplying all these
2 2
1/ (p − 1) pairs together, we get
2
p−1
a 2 ≡ x1 y1 x2 y2 · · · x p−1 y p−1
2 2
The product on the right is just a rearrangement of (1)(2)(3) · · · (p −1) , and Wilson’s
Theorem says that this product is congruent to −1 mod p . Thus we see that Euler’s
p−1
a a
formula p ≡ a 2 holds also when p = −1 , completing the proof in both cases.
A more refined question one can ask is how many lattice points below the diagonal
have even x- coordinate and how many have odd x- coordinate. Here there is no
guarantee that these two numbers must be equal, and indeed if they were equal then
both numbers would have to be 1/4 p − 1 a − 1 but this fraction need not be an
integer, for example when p = 7 and a = 4 .
We denote the number of lattice points that are below the diagonal and have even
x- coordinate by the letter e . Here is a figure showing the values of e when p = 7 and
a ranges from 1 to 6 :
To prove this formula we first derive a formula for e . The segment of the vertical line
x = u between the x- axis and the diagonal has length u· a/p = ua/p since the slope
of the diagonal is a/p . If u is a positive integer the number of lattice points on this
line segment is ua/p , the greatest integer n ≤ ua/p . If we add up these numbers
of lattice points for u running through the set of even numbers E = {2, 4, · · · , p − 1}
we get
X
e= ua/
p
E
ua
The way to compute /p is to apply the division algorithm for integers, dividing
p into ua to obtain ua/p as the quotient with a remainder that we denote r (u) .
Thus we have the formula
ua = p ua/p + r (u) (1)
Section 6.4 — Proof of Quadratic Reciprocity 199
The formula ua = p ua/p + r (u) implies that ua/p has the same parity as r (u)
P P
since u is even and p is odd. Hence E ua/p has the same parity as E r (u) . Since
P
e = E ua/p , this implies that the number (−1)e that we are interested in can also
be computed as
P
(−1)e = (−1) E r (u)
(2)
With this last expression in mind we will focus our attention on the remainders r (u) .
The number r (u) lies strictly between 0 and p and can be either even or odd,
but in both cases we can say that (−1)r (u) r (u) is congruent to an even number in
the interval (0, p) since if r (u) is odd, so is (−1)r (u) r (u) and then adding p to this
gives an even number between 0 and p . Thus there is always an even number s(u)
between 1 and p that is congruent to (−1)r (u) r (u) mod p . Obviously s(u) is unique
since no two numbers in the interval (0, p) are congruent mod p .
A key fact about these even numbers s(u) is that they are all distinct as u varies
over the set E . For suppose we have s(u) = s(v) for another even number v in E .
Thus r (u) ≡ ±r (v) mod p , which implies au ≡ ±av mod p in view of the equa-
tion (1) above. We can cancel the a from both sides of the congruence au ≡ ±av to
get u ≡ ±v . However we cannot have u ≡ −v because the number between 0 and p
that is congruent to −v is p − v , so we would have u = p − v which is impossible
since u and v are even while p is odd. Thus we must have u ≡ +v , hence u = v
since these are numbers strictly between 0 and p . This shows that the numbers s(u)
are all distinct.
200 Chapter 6 — Representations by Quadratic Forms
Now consider the product of all the numbers (−1)r (u) r (u) as u ranges over the
set E . Written out, this is
h ih i h i
(−1)r (2) r (2) (−1)r (4) r (4) · · · (−1)r (p−1) r (p − 1) (3)
On the other hand, by the definition of the numbers s(u) the product (3) is congruent
mod p to [s(2)][s(4)] · · · [s(p−1)] . There are 1/2 p−1 factors here and they are all
distinct even numbers in the interval (0, p) as we showed in the previous paragraph,
so they are just a rearrangement of the numbers 2, 4, · · · , p − 1 . Thus we have the
congruence
h ih i h i
(−1)r (2) 2a (−1)r (4) 4a · · · (−1)r (p−1) (p − 1)a ≡ (2)(4) · · · (p − 1) mod p
We can cancel the factors 2, 4, · · · , p − 1 from both sides of this congruence to obtain
P p−1
r (u)
(−1) E
a 2 ≡ 1 mod p
P p−1
r (u)
Both the factors (−1) E
and a 2 are ±1 mod p and their product is 1 so they
must be equal mod p (using the fact that 1 and −1 are not congruent modulo an
p−1
a
odd prime). By Euler’s formula we have a 2 ≡ p mod p , so from the earlier
a
formula (2) we conclude that p = (−1)e . This finishes Step 2.
q
From Step 2 we know that p = (−1)e where e is the number of lattice points
with even x- coordinate inside the rectangle and below the diagonal. Suppose that
Section 6.4 — Proof of Quadratic Reciprocity 201
we divide the rectangle into two equal halves separated by the vertical line x = p/2
which does not pass through any lattice points since p is odd. This vertical line cuts
off two smaller triangles from the two large triangles above and below the diagonal of
the rectangle. Call the lower small triangle L and the upper one U , and let l and u
denote the number of lattice points with even x- coordinate in the interiors of L and
U respectively. Note that u has the same parity as the number of lattice points with
even x- coordinate in the interior of the quadrilateral below U in the right half of the
rectangle since each column of lattice points inside the rectangle has q − 1 points, an
even number. Thus e has the same parity as l + u , hence (−1)e = (−1)l+u .
The next thing to notice is that rotating the triangle U by 180 degrees about the
center of the rectangle carries it onto the triangle L . This rotation takes the lattice
points inside U with even x- coordinate onto
the lattice points inside L with odd x-
q
coordinate. Thus we obtain the formula p = (−1)t where t is the total number of
lattice points inside the triangle L . p ′
Reversing the roles of p and q , we can also say that q = (−1)t where t ′ is
the number of lattice points inside the triangle L′ with edges on the diagonal of the
rectangle, the horizontal line y = q/2 , and the y- axis. Then t + t ′ is the number of
lattice points in the interior of the small rectangle formed by L and L′ together. This
p−1 q−1
number is just 2 · 2 . Thus we have
q p p−1 q−1
= (−1)t (−1)t = (−1)t+t = (−1) 2 · 2
′ ′
p q
which finally finishes the proof of quadratic reciprocity. ⊓
⊔
a 2
We can also use the geometric interpretation of p to prove the formula for p
that was stated earlier in this chapter, namely
2 +1 if p = 8k ± 1
=
p −1 if p = 8k ± 3
We have shown that p = (−1)e where e is the number of lattice points inside a
2
p × 2 rectangle lying below the diagonal and having even x- coordinate, as indicated
in the following figure which shows the diagonals for p = 3, 5, 7, · · · , 17 :
Another way to describe e is to say that it is equal to the number of even integers
in the interval from p/2 to p . We do not need to assume that p is prime in order
202 Chapter 6 — Representations by Quadratic Forms
to count these points below the diagonals, just that p is odd. One can see what the
pattern is just by looking at the figure: Each time p increases by 2 there is one more
even number at the right end of the interval p/2 , p , and there may or may not be
one fewer even number at the left end of the interval, depending on whether p is
increasing from 4k − 1 to 4k + 1 or from 4k + 1 to 4k + 3 . It follows that the parity
of e depends only on the value of p mod 8 as in the table for p ≤ 17 , so e is even
for p ≡ ±1 mod 8 and e is odd for p ≡ ±3 mod 8 .
Exercises
1. As a sort of converse to Wilson’s theorem, show that if n is not a prime then (n−1)!
is not congruent to −1 mod n . More precisely, when n > 4 and n is not prime, show
that n divides (n − 1)! , so (n − 1)! ≡ 0 mod n . What happens when n = 4 ?
Since we will often be dealing with several different forms at a time it will be
convenient to shorten the notation by writing a form ax 2 + bxy + cy 2 simply as
[a, b, c] , retaining only the essential information of the coefficients. We are restricting
attention to discriminants that are not squares so the outer coefficients a and c must
always be nonzero.
Recall that a number a is represented by a form Q if and only if a appears
in the topograph of Q , and this in turn is equivalent to a appearing as the leading
coefficient of a form [a, b, c] equivalent to Q . A simple observation is that if a factors
as a = a1 a2 then the forms [a1 a2 , b, c] , [a1 , b, a2 c] , and [a2 , b, a1 c] all have the
same discriminant. This shows that if a number a is represented in discriminant ∆
then so is each divisor of a , as we saw in Proposition 6.1.
A form [a1 a2 , b, c] can thus be split into two forms [a1 , b, a2 c] and [a2 , b, a1 c]
of the same discriminant. One might wonder about the reverse process of combin-
ing or “multiplying” the two forms [a1 , b, a2 c] and [a2 , b, a1 c] to obtain the form
[a1 a2 , b, c] . For example the product of [2, 0, 15] and [3, 0, 10] would be [6, 0, 5] .
The main goal in this section will be to show that this simple way to multiply certain
special pairs of forms is nevertheless sufficiently general to give a well-defined mul-
tiplication operation on the set of proper equivalence classes of primitive forms of a
given discriminant.
A pair of forms [a1 , b, a2 c] and [a2 , b, a1 c] is said to be concordant. For two
forms to be concordant is obviously a very strong condition since not only are the
second coefficients of the two forms equal, but also the first coefficient of each form
divides the third coefficient of the other form. Furthermore the discriminants of the
two forms are equal. Conversely, suppose that two forms [a1 , b, c1 ] and [a2 , b, c2 ]
with the same middle coefficient have the same discriminant. Then a1 c1 = a2 c2 ,
so if a1 divides c2 , say c2 = a1 c for some integer c , then a1 c1 = a2 c2 = a2 a1 c
so in particular a1 c1 = a2 a1 c , and since a1 is nonzero we can cancel it from this
equation to get c1 = a2 c . The two forms are thus [a1 , b, a2 c] and [a2 , b, a1 c] so
they are concordant. This argument shows in fact that for two forms [a1 , b, c1 ] and
[a2 , b, c2 ] of the same discriminant, if a1 divides c2 then it automatically follows that
a2 divides c1 .
Since we wish to consider only primitive forms the following result will be useful:
Lemma 7.1. If the concordant forms [a1 , b, a2 c] and [a2 , b, a1 c] are primitive then
so is their product [a1 a2 , b, c] . If a1 and a2 are coprime the converse is also true:
If [a1 a2 , b, c] is primitive then so are [a1 , b, a2 c] and [a2 , b, a1 c] .
Section 7.1 — Multiplication of Forms 205
Some extra condition is needed in the converse since for example the primitive
form [4, 0, 1] factors as the product of the nonprimitive concordant forms [2, 0, 2]
and [2, 0, 2] .
Proof: If the coefficients of [a1 a2 , b, c] have a common divisor then they have a com-
mon prime divisor, which will divide either a1 or a2 , as well as b and c , so one of
the forms [a1 , b, a2 c] and [a2 , b, a1 c] will not be primitive. This gives the first state-
ment. For the second, if one of [a1 , b, a2 c] and [a2 , b, a1 c] is not primitive, say
[a1 , b, a2 c] , then its coefficients will be divisible by some prime p . If a1 and a2 are
coprime, then p dividing a1 and a2 c implies that p divides c . Thus p divides all
three coefficients of [a1 a2 , b, c] , making it nonprimitive. ⊓
⊔
Lemma 7.3. For each pair of forms Q1 = [a1 , b1 , c1 ] and Q2 = [a2 , b2 , c2 ] of the
same discriminant with a1 and a2 coprime there exists a pair of forms [a1 , b, a2 c]
and [a2 , b, a1 c] that are concordant to each other and properly equivalent to Q1
and Q2 respectively.
Proof: The main step will be to find two forms properly equivalent to Q1 and Q2 that
have the same first coefficients as Q1 and Q2 and have equal second coefficients. To
do this we begin by recalling that the edges in the topograph of a form have integer
labels, with the sign of a label changing when the orientation of the edge is reversed.
For a region in the topograph of Q1 labeled a1 let us orient the edges bordering this
region all in the same direction so that the region lies to the left as we move along
the edges in the direction specified by their orientation. The edge labels then form
an arithmetic progression with increment 2a1 . One of these edges is labeled b1 , so
the other edge labels are b1 + 2a1 m for m varying over all integers. Similarly, in
the topograph of Q2 we have a region labeled a2 whose bordering edges have labels
b2 + 2a2 n for all integers n .
We would like one of the edge labels b1 + 2a1 m to equal one of the edge labels
b2 +2a2 n . This means we would like to find integers m and n satisfying the equation
b1 + 2a1 m = b2 + 2a2 n , or equivalently a1 m − a2 n = (b2 − b1 )/2 . Note that the right
side of this equation is an integer since the edge labels in a topograph always have
the same parity as the discriminant, which is the same for both forms by assumption.
From Section 2.3 we know the equation a1 m−a2 n = (b2 −b1 )/2 always has an integer
solution (m, n) if a1 and a2 are coprime. Thus we can find edges bordering the a1
and a2 regions with the same label b . The two given forms are therefore equivalent
206 Chapter 7 — The Class Group for Quadratic Forms
to forms [a1 , b, c1′ ] and [a2 , b, c2′ ] , and in fact properly equivalent because of the way
we have oriented the edges bordering the a1 and a2 regions.
Equating the discriminants of these two forms [a1 , b, c1′ ] and [a2 , b, c2′ ] leads
to the equation a1 c1′ = a2 c2′ and since a1 and a2 are coprime this implies that a1
divides c2′ , so c2′ = a1 c for some integer c . The equation a1 c1′ = a2 c2′ then becomes
a1 c1′ = a2 a1 c , which implies that c1′ = a2 c since a1 is nonzero. Thus we have two
concordant forms [a1 , b, a2 c] and [a2 , b, a1 c] properly equivalent to the original
forms [a1 , b1 , c1 ] and [a2 , b2 , c2 ] . ⊓
⊔
To illustrate how to multiply forms let us look at a few examples in the case
∆ = −104 . Here there are four equivalence classes of forms:
Since only the first two forms have mirror symmetry, the class number is 6 . We will
be somewhat free with the notation and use the same symbol Qi to denote any form
properly equivalent to the original form Qi .
Let us compute the product of Q2 and Q3 using the method in the proof of
Lemma 7.3. To begin we need regions in the topographs of Q2 and Q3 with coprime
labels, so the simplest thing is to use the region labeled 2 in the topograph of Q2
and the region labeled 3 in the topograph of Q3 . For the Q2 topograph the edge
between the 2 and 13 regions is labeled 0 so the next edges bordering the 2 region
are labeled 4, 8, 12, · · ·. For the 3 region in the topograph of Q3 the bordering edges
are labeled 2, 8, 14, · · · starting with the edge adjacent to the 9 region. The number 8
is in both these arithmetic progressions so we choose this for b . In the Q2 topograph
Section 7.1 — Multiplication of Forms 207
this edge labeled 8 is between the regions labeled 2 and 21 so the form we want is
[2, 8, 21] . For Q3 the edge labeled 8 is between the 3 and 14 regions so the form
corresponding to this edge is [3, 8, 14] . The product of these two concordant forms
is then [6, 8, 7] . The values of this form at (x, y) = (0, 1) , (1, 0) , and (1, 1) are 6 , 7 ,
and 21 so from the topograph of Q4 we see that this form is properly equivalent to
Q4 . Thus we have Q2 Q3 = Q4 .
The product Q4 Q4 , or in other words Q42 , can be computed in the same way using
the regions in the topograph of Q4 with the coprime labels 5 and 6 . For the edges
bordering the 5 region the labels starting with the edge between the 5 and 6 regions
are 4, 14, 24, · · ·. For the edges bordering the 6 region we can start with the same
edge but now this edge must be oriented in the opposite direction in order to have
the 6 region on our left as we move forward. The edge labels are then −4, 8, 20, · · ·.
Continuing these arithmetic progressions a little farther we find the common label 44
on the edge between the 5 and 102 regions, and on the edge between the 6 and 85
regions. Thus we have the concordant forms [5, 44, 102] and [6, 44, 85] , with product
[30, 44, 17] . The coefficients 30 and 17 appear in adjacent regions in the topograph
of Q3 so Q42 is properly equivalent to either Q3 or the mirror image form. We can
determine which by evaluating [30, 44, 17] at (x, y) = (−1, 1) , giving the value 3 .
Thus in the topograph of [30, 44, 17] the values 30, 17, 3 appear in clockwise order
around a vertex, while in the topograph of Q3 they are in counterclockwise order, so
these two topographs are mirror images and hence Q42 is properly equivalent to the
mirror image form of Q3 .
In these examples there were a number of choices made in order to compute
the products Qi Qj . Thus for computing Q2 Q3 we first chose the regions labeled 2
and 3 in the topographs of Q2 and Q3 , but we could have chosen any region in one
topograph and then chosen any of the infinitely many regions in the other topograph
with a label coprime to the label of the first region. After choosing the regions labeled
2 and 3 we then chose edges bordering these regions having the same label b , and
there are infinitely many possibilities to choose from here too. For the 2 region the
edge labels are the integers 8 + 4k and for the 3 region they are the integers 8 + 6k
so the common edge labels are the integers 8 + 12k , which are in fact all the edge
labels for the 6 region in the topograph of Q4 . It is not at all obvious that the various
choices that were made for the two topographs always lead to the same result that
Q2 Q3 = Q4 . Our next task will be to prove that this is true not just for this calculation
but in general.
What we wish to prove is the crucial fact that multiplication of proper equivalence
classes of primitive forms by choosing a concordant pair of forms in these classes does
not depend on which concordant pair we choose. This can be phrased in the following
way:
208 Chapter 7 — The Class Group for Quadratic Forms
Proof of Proposition 7.4: To abbreviate notation we will use the symbol ≈ for proper
equivalence of forms.
Let Q1 = [a1 , b, a2 c] and Q2 = [a2 , b, a1 c] , with Q1′ = [a′1 , b′ , a′2 c ′ ] and Q2′ =
[a′2 , b′ , a′1 c ′ ] . To begin the proof we look at the special case that Q1 = Q1′ , so a1 = a′1 ,
b = b′ , and a2 c = a′2 c ′ . We
assume
Q2 ≈ Q2′ so by the remarks preceding the proof
pq
there is an integer matrix r s of determinant 1 such that
! ! ! !
p r a2 b a′2 b s −q
=
q s b a1 c b a1 c ′ −r p
Multiplied out, this becomes
! !
a2 p + br bp + a1 cr bp − a′2 q a′2 s − br
= (∗)
a2 q + bs bq + a1 cs bs − a1 c ′ r
a1 c ′ p − bq
′ ′
p q
To show Q1 Q2 ≈ Q1 Q2′ we would like to find an integer matrix r ′ s ′ of determi-
nant 1 such that
! ! ! !
p′ r′ a1 a2 b a1 a′2 b s ′ −q′
=
q′ s′ b c b c′ −r ′ p ′
Section 7.1 — Multiplication of Forms 209
or in other words
! !
a1 a2 p ′ + br ′ bp ′ + cr ′ a1 a′2 s ′ − br ′ bp ′ − a1 a′2 q′
= (∗∗)
a1 a2 q′ + bs ′ bq′ + cs ′ bs ′ − c ′ r ′ c ′ p ′ − bq′
We can convert the upper left entries in the two matrices in ( ∗ ) to the corresponding
entries in ( ∗∗ ) by multiplying by a1 if we choose p ′ = p , s ′ = s , and r ′ = a1 r . Then
the equality of the upper left entries in ( ∗ ) will imply equality of the upper left entries
in ( ∗∗ ). If we further choose q′ = q/a1 then the upper right entries in ( ∗ ) will be
equal to the corresponding entries in ( ∗∗ ), and the same will be true for the lower
left entries. The lower right entries in ( ∗ ) will be a1 times those in ( ∗∗ ) so the lower
right entries in ( ∗∗ ) will be equal as well. Thus we arrive at the matrix
! !
p ′ q′ p q/a1
=
r ′ s′ a1 r s
pq
Note that this matrix has the same determinant as r s . The only problem is that
the entry q′ = q/a1 will only be an integer if a1 divides q . To guarantee that it does,
observe that the equality of the upper right entries in ( ∗ ) implies that a1 cr = −a′2 q ,
so if a1 is coprime to a′2 then a1 will divide q . Thus we have proved the proposition
in the special case Q1 = Q1′ provided that a1 and a′2 are coprime.
In the case just considered we assumed Q1 = Q1′ which implied that b = b′ . Now
let us assume merely that b = b′ along with the previous hypothesis that a1 and a′2
are coprime. Under these conditions the desired equivalence Q1 Q2 ≈ Q1′ Q2′ will be
obtained as the combination of two equivalences Q1 Q2 ≈ Q1 Q2′ ≈ Q1′ Q2′ , but first we
have to check that Q1 and Q2′ are concordant so that Q1 Q2′ is defined. Since b = b′
and the determinants of Q1 and Q1′ are equal we have a1 a2 c = a′1 a′2 c ′ . Since a1 and
a′2 are coprime it follows that a1 divides a′1 c ′ . As we saw earlier, this implies that
the forms Q1 = [a1 , b, a2 c] and Q2′ = [a′2 , b, a′1 c ′ ] are concordant.
Assuming that a1 and a′2 are coprime, the previous case Q1 = Q1′ now gives
an equivalence Q1 Q2 ≈ Q1 Q2′ . Switching the roles of Q1 and Q2′ as well as Q1′ and
Q2 , this argument also shows Q1 Q2′ ≈ Q1′ Q2′ using the same assumption that a′2 and
a1 are coprime. We conclude that Q1 Q2 ≈ Q1′ Q2′ when a1 and a′2 are coprime and
b = b′ .
Next we consider how to arrange that b = b′ . The hypothesis that will allow
this is that a1 a2 is coprime to a′1 a′2 , which is equivalent to saying that each of a1
and a2 is coprime to each of a′1 and a′2 . If a1 a2 and a′1 a′2 are coprime we know by
an argument in the proof of Lemma 7.3 that the arithmetic progressions b + a1 a2 m
and b′ + a′1 a′2 n have a common value B . This will also be a value in each of the
arithmetic progressions b + a1 m , b + a2 n , b′ + a′1 m , and b′ + a′2 n . Thus we have
forms Q e i′ = [a′i , B, cei′ ] ≈ Qi′ .
e i = [ai , B, cei ] ≈ Qi for i = 1, 2 , and similarly Q
e 1 and Q
Let us check that Q e 2 are concordant. This will be true if the first coef-
ficient of one form divides the third coefficient of the other, say a2 divides ce1 . The
210 Chapter 7 — The Class Group for Quadratic Forms
Proposition 7.5. If Q1 and Q2 are concordant forms with product Q1 Q2 then each
product Q1 (x1 , y1 )Q2 (x2 , y2 ) can be expressed as Q1 Q2 (X, Y ) where X and Y are
certain explicit functions of (x1 , y1 ) and (x2 , y2 ) given in terms of the coefficients
of Q1 and Q2 .
There are nine terms here and we label them (1)–(9) as shown. We want to choose X
and Y so that the sum of these nine terms is equal to a1 a2 X 2 + bXY + cY 2 . Only
the terms (1) and (9) contain the factor a1 a2 appearing in a1 a2 X 2 so to get (1) it is
reasonable to start with X = x1 x2 . Then to get (9) we expand this to
X = x1 x2 ± cy1 y2
where we allow a sign ± for flexibility later in the calculation. Now we have
This gives (1) and (9) but the middle term does not appear among (1)–(9) so we will
have to have something that cancels it later.
Next, to get the term (2) we start with Y = a1 x1 y2 so that bXY starts with
a1 bx12 x2 y2 which is (2). For symmetry let us expand Y = a1 x1 y2 to
Y = a 1 x 1 y2 + a 2 x 2 y1
which gives
If we choose the sign ± in X to be minus then the middle term of cY 2 cancels the
middle term of a1 a2 X 2 , but this gives the terms (6) and (8) in bXY the wrong sign
so we will need other terms to compensate for this. We have also not yet accounted
for the term (5). To get this let us add another term to Y so that X and Y are now
X = x1 x2 − cy1 y2
Y = a1 x1 y2 + a2 x2 y1 + by1 y2
Then we have
a1 a2 X 2 = a1 a2 x12 x22 − 2a1 a2 cx1 x2 y1 y2 + a1 a2 c 2 y1 y2
| {z } | {z }
(1) (9)
Now when we add everything up the unlabeled terms cancel and the remaining terms
combine to give precisely the terms (1)–(9). ⊓
⊔
As a very simple illustration let us consider the case ∆ = −24 where there are
the two reduced forms [1, 0, 6] and [2, 0, 3] . The form [1, 0, 6] is concordant to it-
self and we have [1, 0, 6][1, 0, 6] = [1, 0, 6] . Also [1, 0, 6] is concordant to [2, 0, 3]
and we have [1, 0, 6][2, 0, 3] = [2, 0, 3] . However [2, 0, 3] is not concordant to it-
self, although it is concordant to [3, 0, 2] which is equivalent to [2, 0, 3] and in fact
properly equivalent to it since both forms have mirror symmetry. Thus we have
[2, 0, 3][3, 0, 2] = [6, 0, 1] which is properly equivalent to [1, 0, 6] . If we apply the
preceding proposition with Q1 = [2, 0, 3] and Q2 = [3, 0, 2] then we have a1 = 2 ,
a2 = 3 , b = 0 , and c = 1 , so the formulas for X and Y are X = x1 x2 − y1 y2 and
Y = 2x1 y2 + 3x2 y1 . The calculations in the proof then give
To express this in terms of the original two forms [1, 0, 6] and [2, 0, 3] we change
variables by switching x2 and y2 and then we interchange the two terms on the right
to get
This shows explicitly that the product of two numbers 2x 2 +3y 2 is a number x 2 +6y 2 .
In a similar way we can obtain formulas
Other discriminants can be handled in the same way although the calculations can
become complicated. One would start with a list of forms, one for each proper
equivalence class of forms of the given discriminant. For each pair of forms on the
list one would find a properly equivalent pair of concordant forms [a1 , b, a2 c] and
[a2 , b, a1 c] , with suitable changes of variables to convert the given pair of forms to the
concordant pair. Then one would apply the formulas for X and Y in the proposition,
and finally one would do another change of variables to convert a1 a2 X 2 + bXY + cY 2
to a form on the original list.
Exercises
divides c1′ and we can write c1′ = a2 a3 c for some integer c . Equating discriminants
then gives c2′ = a1 a3 c and c3′ = a1 a2 c . Thus we have the three forms [a1 , b, a2 a3 c] ,
[a2 , b, a1 a3 c] , and [a3 , b, a1 a2 c] , and each pair of these forms is concordant. If
we multiply the first two forms we get [a1 a2 , b, a3 c] , and then multiplying this by
the third form [a3 , b, a1 a2 c] gives [a1 a2 a3 , b, c] . We get the same result if we first
multiply the second and third forms and then multiply their product by the first form.
This proves associativity.
We have now shown the following basic fact:
Proposition 7.6. CG(∆) is a group, that is, the multiplication is associative, there
is an identity element whose product with any element is that element, and each
element has an inverse, so that the product of an element and its inverse is the
identity element.
We can now re-examine some of the examples in the first section of Chapter 6 to
verify that the conjectured group structures on CG(∆) are in fact correct.
First consider the case ∆ = 40 . Here there were two equivalence classes of forms,
given by Q1 = x 2 −10y 2 and Q2 = 2x 2 −5y 2 . Both topographs have mirror symmetry
so proper equivalence is the same as equivalence. Thus the group CG(∆) has two
elements, and we will use the same symbols Q1 and Q2 for these elements of CG(∆) .
The identity element of CG(∆) is Q1 since this is the principal form. Since Q2 = Q2−1
by the mirror symmetry of its topograph, we have Q2 Q2 = Q1 , the identity element
Section 7.2 — The Class Group for Forms 215
of CG(∆) . This determines the group structure in CG(∆) completely, and it agrees
with what we predicted from the topographs in Section 6.1.
Next consider the case ∆ = −84 where there were four equivalence classes of
forms Q1 , Q2 , Q3 , and Q4 . All four topographs have mirror symmetry so CG(∆)
has four elements. The principal form Q1 gives the identity element, and Qi Qi = Q1
for each i by the mirror symmetry. It remains to determine the products Q2 Q3 ,
Q2 Q4 , and Q3 Q4 . For Q2 Q3 , this cannot be Q1 otherwise Q3 would be Q2−1 . Also
Q2 Q3 cannot be Q2 otherwise Q3 would be the identity element Q1 , and similarly
Q2 Q3 cannot be Q3 . Therefore we must have Q2 Q3 = Q4 . The same reasoning shows
that Q2 Q4 = Q3 and Q3 Q4 = Q2 .
In more complicated cases it can be helpful to use the fact that if two primitive
forms Q1 and Q2 of the discriminant ∆ represent coprime numbers a1 and a2 then
their product Q1 Q2 represents a1 a2 . This is a consequence of results in the previous
section, particularly Lemma 7.3. For example in the preceding case ∆ = −84 we could
also show that Q2 Q3 = Q4 by looking at the topographs to see that Q2 represents 3
and Q3 represents 2 so Q2 Q3 must represent 6 . The only element of CG(∆) whose
topograph contains 6 is Q4 , so Q2 Q3 = Q4 . Similarly one sees that Q2 Q4 = Q3 using
the numbers 3 and 5 , and Q3 Q4 = Q2 using 2 and 5 . We could also deduce the last
two formulas from Q2 Q3 = Q4 by multiplying both sides by Q2 or Q3 .
The next example from Section 6.1 is ∆ = −56 where there were three equivalence
classes of forms Q1 , Q2 , and Q3 . For Q1 and Q2 the topographs have mirror symme-
try but not for Q3 so there is another form Q4 whose topograph is the mirror image
of the one for Q3 , with Q4 = Q3−1 in CG(∆) . Again we have Q1 the identity in CG(∆)
and we have Q2 Q2 = Q1 by mirror symmetry. However it is not so easy to determine
Q3 Q3 . The topograph of Q3 contains 3 and 5 so the topograph of Q3 Q3 must con-
tain 15 , but 15 is in the topographs of both Q1 and Q2 so this is inconclusive. The
same thing happens for other pairs of primes in the topograph of Q3 such as 3, 13 or
5, 19 . However, since the topograph of Q3 does not have mirror symmetry, we know
that Q3 is not Q3−1 hence Q3 Q3 is not Q1 so it must be Q2 . Thus all four elements of
CG(∆) are powers of Q3 , namely Q3 , Q32 = Q2 , Q34 = Q22 = Q1 , and Q33 = Q4 since
Q34 = Q1 implies Q33 = Q3−1 which is Q4 . This determines the structure of CG(∆)
completely. For example Q2 Q4 = Q32 Q33 = Q35 = Q3 since Q34 = Q1 .
In the preceding examples the group CG(∆) was small enough that its structure
could be determined just from the topographs. This is not always the case in more
complicated examples, however. One difficulty is that a form Q and its inverse Q−1
have mirror image topographs containing exactly the same numbers, so from the
topographs one may be able to compute a product Qi Qj = Qk±1 but one cannot always
tell which exponent +1 or −1 is correct. Another problem is that some numbers can
appear in more than one topograph.
We illustrate these difficulties with an example, discriminant ∆ = −104 where
216 Chapter 7 — The Class Group for Quadratic Forms
we showed the topographs of the four equivalence classes of forms in the previous
section. Since the first two forms Q1 and Q2 have mirror symmetry while the second
two Q3 and Q4 do not, the group CG(∆) has six elements, with the principal form
Q1 the identity and Q22 = Q1 . From the product 3·17 = 51 we see that Q32 is Q1 ,
Q3 , or Q3−1 , but Q1 is ruled out since the topograph of Q3 does not have mirror
symmetry, and Q3 is ruled out since Q32 = Q3 would imply Q3 = Q1 . Thus Q32 = Q3−1 ,
or equivalently, Q33 = Q1 . Similarly, we can try to compute Q42 from the product
5·7 = 35 which appears in the topographs of Q1 and Q3 . The possibility that Q42 is
Q1 is ruled out since Q4 does not have mirror symmetry. Thus Q42 = Q3±1 , but we
cannot tell which exponent is correct from the topographs and the argument we used
to compute Q32 does not work here. In fact we computed Q42 in the previous section
by finding a pair of concordant forms properly equivalent to Q4 , and it turned out
that Q42 was Q3−1 , the mirror image of Q3 .
Let us see what the higher powers of Q4 are. Note first that Q46 = (Q42 )3 =
(Q3−1 )3 = Q1 since (Q3−1 )3 is the inverse of Q33 = Q1 . From Q46 = Q1 we obtain
Q45 = Q4−1 and Q44 = Q4−2 = Q3 . For Q43 we have (Q43 )2 = Q46 = Q1 so Q43 has mirror
symmetry making it either Q1 or Q2 , but Q43 = Q1 is impossible since it would say
that Q42 is Q4−1 rather than Q3−1 . Thus Q43 = Q2 and so the six elements of CG(∆)
are the powers Q4i for i = 1, 2, 3, 4, 5, 6 with Q46 the identity. This determines the
multiplication in CG(∆) completely. We will see in Section 7.3 that a group with
six elements and commutative multiplication always contains an element whose first
through sixth powers are all the elements of the group.
Now we come to our main application of the class group, which is to the problem
of determining which primitive forms of a given discriminant ∆ represent a given
number n . It will suffice to consider only the case that n is positive. This is no
restriction when ∆ < 0 since there is no need to consider elliptic forms with negative
values. When ∆ > 0 , if we know which forms represent positive n then the negatives
of these forms will be the forms representing −n . The only forms representing 1 are
the forms equivalent to the principal form so we can assume n > 1 .
Here is the main result, where for convenience we continue to use the same symbol
for a primitive form and for the element of CG(∆) that it determines:
e e
Theorem 7.7. (1) Let a number n > 1 be factored as n = p11 · · · pkk for distinct
primes pi with ei > 0 for each i . Then the primitive forms of discriminant ∆ that
represent n are the products Q1 · · · Qk where Qi is a primitive form representing
p ei .
(2) The forms of discriminant ∆ representing a power p e of a prime p not dividing
∆ are primitive and are exactly the forms Q±e where Q is a form representing p .
If p divides ∆ but not the conductor then the only power of p represented in
discriminant ∆ is p itself, and it is represented by a primitive form.
Section 7.2 — The Class Group for Forms 217
The theorem says nothing about the primitive forms that represent powers of a
prime dividing the conductor, and indeed this is a delicate question as the examples
in the large table in Section 6.2 show. In the first statement in (2) the form Q is unique
up to equivalence by Proposition 6.15. It may or may not have mirror symmetry, so
Q and Q−1 may be different elements of CG(∆) and the same is true of Qe and Q−e .
In the second statement of (2) a form Q representing p is unique up to equivalence
and is symmetric by Proposition 6.17 so there is no need to consider Q−1 .
If ∆ is a fundamental discriminant then the conductor is 1 so the theorem gives a
full reduction of the representation problem for nonprimes to the corresponding prob-
e e ±e1 ±ek
lem for primes: The forms representing p11 · · · pkk are the products Q1 · · · Qk
where Qi represents pi and ei = 1 if pi divides ∆ . For nonfundamental discrimi-
e e
nants one obtains all primitive forms representing p11 · · · pkk by modifying the pre-
vious statement to allow some of the primes pi to divide the conductor, replacing the
±ei e
corresponding terms Qi by any primitive forms Qi that represent pi i .
As a special case, the only forms representing a power p e of a prime p not divid-
ing the discriminant are Qe and Q−e where Q represents p . Since Q−e is the inverse
of Qe in CG(∆) , these two forms are equivalent so there is only one equivalence class
of forms representing p e . When p is odd this was proved in Proposition 6.15, and
now we see that it holds also for p = 2 .
When there are two or more distinct prime factors pi the choices between Qei
and Q−ei can lead to nonequivalent forms representing the same number. For ex-
ample for a product p1 p2 of two different primes there can be four different proper
equivalence classes Q1±1 Q2±1 for the four choices of signs, and these can give two
different equivalence classes, even if Q1 = Q2 .
with any two forms in the product on the right being concordant.
e e
In particular for the prime factorization n = p11 · · · pkk we have [n, b, c] =
e e e
Q1 · · · Qk for Qi = [pi i , b, nc/pi i ] , a form representing pi i . By Lemma 7.1 the
form [n, b, c] is primitive if and only if each Qi is primitive since the primes pi are
assumed to be distinct. This proves half of statement (1), that each primitive form
representing n can be expressed as a product Q1 · · · Qk with Qi a primitive form
e
representing pi i . The other half is the statement that a product Q1 · · · Qk is prim-
e
itive and represents n if each Qi is primitive and represents pi i . This follows by
218 Chapter 7 — The Class Group for Quadratic Forms
e e
applying Lemma 7.3 repeatedly, first to forms [p11 , b1 , c1 ] and [p22 , b2 , c2 ] properly
equivalent to Q1 and Q2 , then to the product of the two resulting forms and a form
e
[p33 , b3 , c3 ] properly equivalent to Q3 , and so on.
For part (2) of the theorem, a form representing p e is properly equivalent to a
form [p e , b, c] . As above, this factors as [p e , b, c] = [p, b, p e−1 c]e . If p does not
divide the conductor then the forms Q = [p, b, p e−1 c] representing p and Qe =
[p e , b, c] representing p e are primitive by Proposition 6.14. Since forms represent-
ing primes are unique up to equivalence, any form representing p must be properly
equivalent to Q or Q−1 . Hence the form we started with that represents p e is properly
equivalent to the eth power of Q or Q−1 , that is, to Qe or Q−e .
If p divides ∆ but not the conductor then Proposition 6.7 says that p is repre-
sented by a form of discriminant ∆ but no higher power of p is represented. The
form representing p is primitive by Proposition 6.14. ⊓
⊔
where the first sum is over subscripts i such that pi is represented by Q and similarly
for the second sum with Q2 in place of Q . The sign ± in the second sum can be
ignored since Q2 = Q−2 . As we saw in Section 6.3 the forms Q0 and Q2 make up
one genus while Q and the equivalent form Q3 = Q−1 make up the other genus. The
parity of e thus determines the genus of the forms representing n . (Recall that forms
representing a given number all belong to the same genus.) From the formula for e
Section 7.2 — The Class Group for Forms 219
we can deduce that n is represented by both Q0 and Q2 exactly when e is even and
at least one ei in the first sum is odd since this is the only time when the choice of
the signs ± matters.
As another example, when ∆ = −104 we computed CG(∆) to have six elements,
the first through sixth powers of the form Q4 = [5, 4, 6] with Q46 = Q1 , the identity
in CG(∆) . We can obtain most of this structure a little more efficiently now using
the preceding theorem. Looking at the topographs we see that 5 , 52 , and 53 are
represented by Q4 , Q3 , and Q2 so Q42 = Q3±1 and Q43 = Q2±1 which is Q2 since the
topograph of Q2 has mirror symmetry. Since Q22 = Q1 it follows that Q46 = Q22 = Q1
so Q45 = Q4−1 and Q44 = Q4−2 = Q3∓1 . We cannot determine which sign in Q42 = Q3±1 is
correct just from the topographs, but we showed that Q42 = Q3−1 earlier.
e e
The forms representing a number n = p11 · · · pkk when ∆ = −104 can be de-
scribed in a similar way to the preceding example with ∆ = −56 . For ∆ = −104 the
exceptional primes pi with ei ≤ 1 are 2 and 13 . The forms representing n are the
products (Qq1 )±e1 · · · (Qqk )±ek where Qqi is the power of Q = Q4 representing pi
with qi either 0 , 1 , 2 , or 3 . Writing this product as Qe where only the value of e
mod 6 matters, the formula for e now has another term:
X X X
e= ±ei + ±2ei + ±3ei
Q Q2 Q3
The parity of e again determines the genus, with one genus consisting of Q0 and
Q2 (which is equivalent to Q4 ) and the other genus consisting of Q and Q3 (with
Q5 = Q−1 equivalent to Q ). From the formula for e one could work out when a
number is represented by both forms within a genus and when it is represented by
only one form. Note that for the formula above it does not matter whether Q42 is Q3
or Q3−1 since both these forms represent the same numbers.
Exercises
1. For discriminant ∆ = −47 show the class number is 5 and determine the multipli-
cation rules for the five proper equivalence classes of forms.
2. Determine the numbers represented by each of the two forms [1, 1, 6] and [2, 1, 3] .
3. Show that the numbers represented by x 2 + 4y 2 are the numbers 2m p1 · · · pk
where m is 0 , 2 , or 3 and each pi is a prime congruent to 1 mod 4 .
4. Show that if two forms Q1 and Q2 in the class group CG(∆) represent coprime
numbers n1 and n2 then their product Q1 Q2 represents n1 n2 . Give an example
where this fails without the coprimeness assumption, even if n1 and n2 are coprime
to ∆ .
5. For a fixed discriminant ∆ consider the set S∆ of primes that do not divide the
conductor and are represented by primitive forms with mirror symmetry. Show that
220 Chapter 7 — The Class Group for Quadratic Forms
numbers that are products of primes in S∆ are represented by at most one form of
discriminant ∆ , up to equivalence, and this form has mirror symmetry.
For example if g has order 6 then g 2 and g 4 have order 3 , g 3 has order 2 , and
g 5 has order 6 . Similarly, if g has order 12 then g 2 and g 10 have order 6 , g 3 and
g 9 have order 4 , g 4 and g 8 have order 3 , and g 5 , g 7 , and g 11 have order 12 .
A finite group G is called cyclic if there is an element g ∈ G such that every
element of G is a power of g , so the elements g, g 2 , g 3 , · · · cycle through all the
elements of G . The element g is then called a generator of G . Cyclic groups are
automatically abelian since g k g l and g l g k both equal g k+l . If a generator g of a
cyclic group G has order n , then this is also the order of G since all the powers
g, g 2 , g 3 , · · · , g n must be distinct, as noted earlier. Thus a group of order n is cyclic
exactly when it contains an element of order n . In a cyclic group there are generally
a number of different choices for a generator since if g is one generator of order n
then g k is a generator exactly when it has order n , which is equivalent to k being
coprime to n . The number of different generators is thus ϕ(n) where ϕ is the Euler
phi function.
Among the groups CG(∆) that we computed in the previous section, CG(∆) is
cyclic of order 4 for ∆ = −56 and cyclic of order 6 for ∆ = −104 , but for ∆ = −84
the group is not cyclic since it has order 4 but each element other than the identity
has order 2 .
Cyclic groups are easy to understand, and our next goal is to see that all finite
abelian groups are built from cyclic groups by a fairly simple procedure. Given two
groups G1 and G2 , the product group G1 × G2 is defined to be the set of all pairs
(g1 , g2 ) with g1 ∈ G1 and g2 ∈ G2 . The multiplication operation in G1 ×G2 is defined
by (g1 , g2 )·(g1′ , g2′ ) = (g1 g1′ , g2 g2′ ) , so the coordinates are multiplied separately. The
identity element of G1 × G2 is the pair (g1 , g2 ) with g1 the identity in G1 and g2 the
identity in G2 . The inverse of an element (g1 , g2 ) is (g1−1 , g2−1 ) . More generally one
can define products G1 × · · · × Gk of any collection of groups G1 , · · · , Gk , with the
elements of this product group being k - tuples (g1 , · · · , gk ) with gi ∈ Gi for each i .
One can also iterate the process of forming products of groups but this gives nothing
new since for example (G1 × G2 ) × G3 is really the same as G1 × G2 × G3 by rewriting
its elements (g1 , g2 ), g3 as (g1 , g2 , g3 ) .
If G1 and G2 are finite groups of orders n1 and n2 , then G1 × G2 has order n1 n2
since the two coordinates g1 and g2 of pairs (g1 , g2 ) in G1 × G2 vary independently
over G1 and G2 . For an element (g1 , g2 ) in G1 × G2 , if g1 has order n1 and g2 has
order n2 then the order of (g1 , g2 ) is the least common multiple of n1 and n2 since
a power (g1 , g2 )n = (g1n , g2n ) is the identity exactly when n is a multiple of both n1
and n2 , so the order of (g1 , g2 ) is the smallest such multiple. In particular, if n1 and
n2 are coprime then (g1 , g2 ) has order n1 n2 . This leads to the following interesting
fact:
Now we come to the main result in this section, the basic structure theorem for
finite abelian groups:
For the proof we will use the notation o(g) for the order of an element g ∈ G . The
identity element of G will be written simply as 1 . We need two preliminary lemmas.
Lemma 7.10. If two elements g1 and g2 of a finite abelian group have coprime
orders o(g1 ) and o(g2 ) then their product g1 g2 has order o(g1 )o(g2 ) .
This need not be true if o(g1 ) and o(g2 ) are not coprime. As an extreme example
take g2 to be g1−1 . Another example would be to take g1 to be an element of maximal
order in G and g2 any element with o(g2 ) > 1 .
Proof: Let n1 = o(g1 ) and n2 = o(g2 ) . Then (g1 g2 )n1 n2 = g1n1 n2 g2n1 n2 = 1 so it will
suffice to show that if (g1 g2 )n = 1 then n is a multiple of n1 n2 .
nn1 n
Suppose (g1 g2 )n = 1 and let g = g1n = g2−n . Then g n1 = g1 = (g1 1 )n = 1 so
−nn2 n
o(g) divides n1 . Similarly g n2 = g2 = (g2 2 )−n = 1 so o(g) divides n2 . Since
n1 and n2 are assumed to be coprime, this means o(g) = 1 and hence g = 1 . Thus
g1n = 1 and g2−n = 1 , which implies g2n = 1 . Since g1n = 1 it follows that n is a
multiple of n1 , and n is also a multiple of n2 since g2n = 1 . As n1 and n2 are
coprime, this implies that n is a multiple of n1 n2 . ⊓
⊔
Lemma 7.11. For a finite abelian group G let m be the maximal order of elements
of G . Then the order of each element of G is a divisor of m .
Proof: Suppose this is false, so there is an element g such that o(g) does not divide
the maximal order m . This means there is some prime power p k dividing o(g) such
that the highest power p l dividing m has l < k . Since p k divides o(g) there is a
power of g having order p k . Let g1 be this power of g and let g2 be an element
l
of G of order m/p l , for example hp where h is an element of order m . Then by
the preceding lemma the product g1 g2 has order p k (m/p l ) which is greater than m
since k > l . This contradicts the maximality of m , so we conclude that o(g) divides
m for all g ∈ G . ⊓
⊔
and this will be 1 if ki + xi nq+1 = 0 for each i . Solving ki + xi nq+1 = 0 for xi gives
xi = −ki /nq+1 with xi an integer since we have shown that nq+1 divides ki .
x xq
Having found an element gq+1 g1 1 · · · gq of order nq+1 , we replace gq+1 by this
element, so the new gq+1 has order nq+1 in G . It remains to check condition ( 2q+1 ).
k kq kq+1 k′ k′q k′q+1 kq+1 k′q+1
If g1 1 · · · gq gq+1 = g1 1 · · · gq gq+1 then in [G]q we have [gq+1 ]q = [gq+1 ]q .
Since the order of [gq+1 ]q in [G]q is nq+1 this implies that kq+1 ≡ mod nq+1 , k′q+1
kq+1 k′q+1 kq+1
hence gq+1 = gq+1 in G since gq+1 has order nq+1 . We can then cancel gq+1
k′q+1 k kq kq+1 k′ k′q k′q+1 k kq
and gq+1 from the equation g1 1 · · · gq gq+1 = g1 1 · · · gq gq+1 to get g1 1 · · · gq =
k′ k′q
g1 1 · · · gq . Since condition ( 2q ) holds by induction we have ki ≡ k′i mod ni for each
i ≤ q . Thus ( 2q+1 ) holds and we are done. ⊓
⊔
To illustrate how the preceding proof works suppose we start with the group
G = H1 × H2 where H1 is cyclic of order 4 generated by an element h1 and H2 is
cyclic of order 2 generated by an element h2 of order 2 . In this case we already know
that G is a product of cyclic groups, but suppose we forget this and just follow the
proof through. At the first step we choose an element g1 in G of maximal order,
so let us choose g1 = (h1 , 1) which has order 4 in G . There are then two congru-
ence classes of elements of G mod g1 , namely the class consisting of the elements
k k
(h11 , h22 ) with k2 = 0 and the class with k2 = 1 , so the group [G]1 of congruence
classes mod g1 has order 2 . Intuitively, taking congruence classes mod g1 amounts
k k
just to ignoring the first coordinates of pairs (h11 , h22 ) since we are free to change
k k l
this coordinate arbitrarily by multiplying (h11 , h22 ) by any element (h11 , 1) . Next we
k
choose an element g2 of maximal order in [G]1 . For this we can choose g2 = (h11 , h2 )
for any k1 . If we choose k1 to be 1 or 3 then g2 will have order 4 , which is larger
than the maximal order of elements of [G]1 which is 2 . The next-to-last paragraph of
the proof gives a procedure for rechoosing g2 to have order equal to 2 rather than 4 ,
Section 7.3 — Finite Abelian Groups 225
Corollary 7.12. Each element of a finite abelian group has order dividing the order
of the group.
conversely.
Z∗
n is as a product of cyclic groups. The first step in understanding this is to apply the
Chinese Remainder Theorem. As we saw in Section 2.3, if the prime factorization of
r r
n is p11 · · · pkk for distinct primes pi , then specifying the congruence class mod n
r
of an integer coprime to n is equivalent to specifying its congruence class mod pi i
r
for each i , with the latter classes being coprime to pi i (which is the same as being
coprime to pi ). This amounts to saying that Z∗ ∗ ∗
n is the product Zpr1 × · · · × Zprk .
1 k
r
This gives a reduction to the case of a prime power p . When p is an odd prime
the group Z∗ ∗
pr is cyclic, while Z2r is cyclic when r ≤ 2 but for larger r it is the
product of two cyclic groups, one of order 2r −2 and the other of order 2 . These facts
will not be needed in the rest of the book so we will not prove them but will instead
just look at a few examples. Some cases when Z∗
n is cyclic are shown in the following
figures where the elements of Z∗
n label the vertices of a polygon and multiplication
by a generator of Z∗
n rotates the polygon, taking each vertex to the next vertex.
Z∗
7 Z∗
9 Z∗
18 Z∗
11
Z∗
16 Z∗
21 Z∗
32
Each of these diagrams is known as a Cayley graph for the group. The graph has a
vertex for each element of the group, and two vertices are joined by an edge whenever
one group element is obtained from another by multiplication by one of a chosen set
of generators for the group. In the first four examples the group was cyclic so it had a
single generator, while in the last three examples the group had two generators, one
for each cyclic factor.
The preceding Corollary 7.12 implies that a finite abelian group G of prime order
p must be cyclic since any non-identity element of G must have order p . This holds
more generally if the order of G is a product of distinct primes since in a factorization
of G as a product of cyclic groups these groups must all have coprime orders so their
product will also be cyclic by repeated applications of Proposition 7.8.
By Proposition 7.8, every cyclic group whose order is not a power of a prime can
be expressed as a product of two cyclic groups of smaller order. Applying this fact
repeatedly, every cyclic group is a product of cyclic groups of prime power order.
Hence by the theorem every finite abelian group is a product of cyclic groups of prime
power order. A cyclic group of prime power order p k cannot be factored as a product
since the factors would have orders p l for l < k so the elements of the factors would
have orders dividing p k−1 , hence the same would be true for all elements of the
product, contradicting the fact that it is cyclic of order p k and so contains an element
of order p k .
For example, if we let Cn denote a cyclic group of order n , then the only two
abelian groups of order 4 are C4 and C2 ×C2 . For order 8 there are three possibilities:
C8 , C4 × C2 , and C2 × C2 × C2 . For order 16 there are five possibilities: C16 , C8 × C2 ,
C4 × C4 , C4 × C2 × C2 , and C2 × C2 × C2 × C2 . These examples illustrate the general fact
that the abelian groups of order a prime power p k correspond exactly to the different
partitions of k as a sum of numbers from 1 to k . In the case of 24 = 16 these were
the five partitions 4 , 3 + 1 , 2 + 2 , 2 + 1 + 1 , and 1 + 1 + 1 + 1 . (The order of the
terms does not matter, so 2 + 1 + 1 is regarded as the same partition as 1 + 2 + 1 and
1 + 1 + 2 .)
For groups whose order is a product of powers of different primes one just
combines the various groups of each prime power independently. Thus for order
144 = 9·16 there are ten possibilities, the products of the five groups of order 16
listed above with either of the two groups C9 and C3 × C3 of order 9 .
Thus we see that the only time that there is only one group of order n is when n
is a product of distinct primes, so the group is a product of cyclic groups of distinct
prime orders, making the whole group cyclic.
228 Chapter 7 — The Class Group for Quadratic Forms
Proof of Proposition 7.13: The idea will be to characterize the number of cyclic fac-
tors of each prime power order in an intrinsic way that does not depend on a particular
choice of factorization. For a prime p dividing the order of a finite abelian group G
let G(p) be the set of elements in G whose order is a power of p , including the iden-
tity element 1 of order p 0 . Note that an element g has order a power of p exactly
n
when g p = 1 for some n . Given a factorization of G as a product G1 × · · · × Gk of
cyclic groups of prime power order, an element g = (g1 , · · · , gk ) of G has order a
n
power of p exactly when each coordinate gi has order a power of p since if g p = 1
pn pni n
then gi = 1 for each i and conversely if gi = 1 for each i then g p = 1 for n
the largest ni . For the factors Gi whose order is a power of a prime different from p
pn
the only way to have gi = 1 is when gi = 1 . We can therefore regard G(p) as the
product of the factors Gi of order a power of p . This gives a characterization of the
product of these factors Gi that does not depend on the choice of the factorization
of G .
Thus the problem reduces to the case that G = G(p) , i.e., G has order p n for
some n , so we assume this from now on. It remains to give an intrinsic character-
ization of the number of cyclic factors of order p r for each r . We will do this by
counting the number of elements in the set G[q] of elements of G that are p q th
powers of elements of G . We have G = G[0] since all elements are p 0 th powers, and
q+1 q
G[q] contains G[q + 1] for each q since g p = (g p )p , so a p q+1 st power is also a
p q th power. The identity element 1 belongs to G[q] for all q .
A cyclic group of order p r generated by an element g contains exactly p ele-
r −1 pr −1 pr −1 pr −1
ments that are p r −1 st powers, namely g p , g 2 , g3 , · · · , gp =1
since these are distinct p r −1 st powers but after this there are just repetitions, with
pr −1 r −1 pr −1 pr −1
g p+1 = g p , g p+2 = g2 , and so on. Similarly there are p s elements
r −s pr −s pr −s s p r −s
that are p r −s th powers, the elements g p , g 2 , g3 , · · · , gp = 1.
For a product G1 × · · · × Gk an element (g1 , · · · , gk ) is a p q th power exactly when
each coordinate gi is a p q th power in Gi .
For a given factorization G = G1 × · · · × Gk as a product of cyclic groups of
order a power of p let µ(r ) be the number of cyclic factors Gi of order p r and
let p m be the maximal order of elements of G . Thus G[m] consists of just the
identity element of G since the p m th power of each element of G is the identity.
From the preceding paragraph we see that the number of elements in G[m − 1] is
p µ(m) since each of the µ(m) factors Gi of order p m has p elements that are p m−1 st
powers and in the other factors only the identity is a p m−1 st power. Since G[m − 1]
has p µ(m) elements it follows that G[m − 1] determines µ(m) . Next, G[m − 2]
contains (p 2 )µ(m) p µ(m−1) = p 2µ(m)+µ(m−1) elements, with p 2 elements coming from
each factor of order p m and p elements coming from each factor of order p m−1 . Thus
G[m − 2] determines µ(m − 1) since µ(m) has already been determined. Continuing
in the same way, we see that G[m − s] has p sµ(m)+(s−1)µ(m−1)+···+µ(m−s+1) elements,
Section 7.3 — Finite Abelian Groups 229
the last case being s = m with G[0] = G . It follows by induction on s that the
subsets G[m − s] determine all the numbers µ(r ) . Since the sets G[q] are defined
independently of how G is factored as a product of cyclic groups, this finishes the
proof. ⊓
⊔
In the rest of this section we will give two propositions about finite abelian groups
that will be applied to class groups in the next two sections. Both propositions have
to do with the operation of squaring elements of a group. For the first proposition
we consider elements of a finite abelian group G whose square is the identity. These
are the elements of order 1 or 2 . These elements form a subgroup of G , that is, a
subset which is a group in its own right. For a subset H of a group G to be a subgroup
amounts to H satisfying three properties:
For any abelian group G we can form another group denoted G/G2 whose ele-
ments are congruence classes of elements of G mod squares, so g1 ≡ g2 if g2 = g1 g 2
for some g ∈ G . This is analogous to taking congruence classes of integers mod 2
except now the group operation is multiplication rather than addition. The multipli-
cation in G/G2 comes from multiplication in G , so if we denote the congruence class
of g ∈ G by [g] then [g1 ][g2 ] is defined to be [g1 g2 ] . This is unambiguous since
if g1 ≡ g1′ and g2 ≡ g2′ , so g1′ = g1 h21 and g2′ = g2 h22 for some h1 , h2 ∈ G , then
g1 g2 ≡ g1′ g2′ since g1′ g2′ = g1 g2 (h1 h2 )2 . The identity element of G/G2 is [1] where
1 is the identity of G , and [g]−1 = [g −1 ] . Since associativity in G/G2 follows auto-
matically from associativity in G , we conclude that G/G2 is a group, which is abelian
since G is abelian.
Exercises
Proposition 7.16. (a) The symmetric class number hs∆ is equal to 2r where r is
the 2 -rank of CG(∆) , the number of cyclic factors of CG(∆) of order a power of 2
when CG(∆) is expressed as a product of cyclic groups of prime-power order.
(b) The ordinary class number h∆ is always a multiple of hs∆ , with h∆ = hs∆ exactly
when CG(∆) is a product of cyclic groups of order 2 , and hs∆ = 1 exactly when h∆
is odd. ⊓
⊔
Applying Theorem 5.9 which computed hs∆ in terms of the prime factorization
of ∆ we conclude:
Corollary 7.17. If the number of distinct prime divisors of ∆ is k then the 2 -rank
of CG(∆) is k − 1 except when ∆ = 4(4m + 1) when the 2 -rank is k − 2 , and when
∆ = 32m when the 2 -rank is k . In particular the 2 -rank is k − 1 when ∆ is a
fundamental discriminant. ⊓
⊔
We know that CG(∆) is cyclic if the class number is prime or a product of distinct
primes, but there are other cases when the structure of CG(∆) as a product of cyclic
groups is completely determined if one knows the class number as well as the prime
factorization of ∆ , using the fact that the latter determines the 2 - rank of CG(∆)
as in Corollary 7.17. For example if the class number is 4 then CG(∆) is either C4
or C2 × C2 and these two cases are distinguished by their 2 - ranks. We saw this
distinction between C4 and C2 × C2 for the fundamental discriminants −56 and −84
both of which have class number 4 , but −56 has two distinct prime divisors so its
class group is C4 while −84 has three distinct prime divisors so its class group is
C2 × C2 .
Section 7.4 — Symmetry and the Class Group 233
A similar thing works for class number 8 where the group is either C8 , C4 ×C2 , or
C2 × C2 × C2 , with different 2 - ranks. For class number 16 on the other hand there is
an ambiguity between C8 × C2 and C4 × C4 . The first negative discriminant with class
number 16 is ∆ = −399 = −3·7·19 , a fundamental discriminant. Since there are
three distinct prime factors of ∆ the 2 - rank of CG(∆) is 2 so the ambiguity between
C8 ×C2 and C4 ×C4 arises here. It is easy to compute that there are ten reduced forms
of discriminant −399 :
[1, 1, 100] [2, 1, 50] [4, 1, 25] [5, 1, 20] [10, 1, 10]
[3, 3, 34] [6, 3, 17] [7, 7, 16] [8, 7, 14] [10, 9, 12]
Labeling these as Q1 , · · · , Q5 in the first row and Q6 , · · · , Q10 in the second row,
we see that there are four forms with mirror symmetry, Q1 , Q5 , Q6 , Q8 , the forms
with two of their coefficients equal. This is in agreement with the 2 - rank being 2 .
The six without symmetry count double in the class number which is therefore 16 .
To determine whether the class group is C8 × C2 or C4 × C4 it suffices to look for
elements of order greater than 4 . This happens to be very easy in this case if we look
at which forms represent powers of 2 . In the list above we see that Q2 represents 2 ,
Q3 represents 4 , Q9 represents 8 , and Q8 represents 16 . Since powers of primes
not dividing the discriminant are always represented by unique equivalence classes of
forms, it follows that Q22 = Q3±1 , Q23 = Q9±1 , and Q24 = Q8 , with no sign ambiguity in
the last case since Q8 has mirror symmetry. In particular we see that Q2 must have
order greater than 4 , so CG(∆) is not C4 × C4 and hence it must be C8 × C2 .
The order of Q2 is 8 since there are no elements of order 16 in C8 × C2 . (This
also follows from the fact that Q24 has mirror symmetry hence must have order 2 .)
As in the proof of Theorem 7.9 we can choose Q2 as a generator of the C8 factor of
CG(∆) , and a generator of the C2 factor can be chosen to be either Q5 or Q6 , the two
forms with mirror symmetry that are not a power of Q2 . Additional work would be
needed to compute the remaining products Qi Qj such as whether Q22 is Q3 or Q3−1 .
However some products can be determined without calculation, for example the fact
that the product of any two of the symmetric forms Q5 , Q6 , Q8 equals the third since
the product of two elements of order 2 must have order 1 or 2 , but for example
Q5 Q6 cannot be the identity element Q1 nor can it be Q5 or Q6 so it must be Q8 .
Thus the elements Q1 , Q5 , Q6 , and Q8 form a subgroup C2 × C2 . This is just the
symmetric class group SCG(∆) .
A similar but even simpler sort of ambiguity occurs for class numbers p 2 with
p an odd prime, where the choice is between the groups Cp2 and Cp × Cp . The
first example of this sort among negative discriminants occurs when ∆ = −199 . The
reduced forms are Q1 = [1, 1, 50] , Q2 = [2, 1, 25] , Q3 = [5, 1, 10] , Q4 = [4, 3, 13] ,
and Q5 = [7, 5, 8] . Only Q1 has mirror symmetry so the other four forms count twice
in the class number which is therefore 9 . To decide whether CG(∆) is C9 or C3 × C3
234 Chapter 7 — The Class Group for Quadratic Forms
The order of the class group can be made arbitrarily large by taking ∆ to have a
large number of distinct prime factors, using a product of distinct odd primes if one
wants a fundamental discriminant. It is also possible for individual elements of the
class group to have large order:
Proposition 7.19. For arbitrary integers a > 1 and n > 1 the form [a, 1, an−1 ] has
order n in CG(∆) for ∆ = 1 − 4an .
Proof: The form [a, 1, an−1 ] is concordant to itself if n > 1 and we can use this fact
to compute its powers inductively as in the proof of Theorem 7.7, with the result that
[a, 1, an−1 ]k = [ak , 1, an−k ] . When k = n the latter form is [an , 1, 1] which repre-
sents 1 so it is the identity element in the class group. Thus the order of [a, 1, an−1 ]
is a divisor of n . The discriminant 1 − 4an is negative and the forms [ak , 1, an−k ]
are reduced if k ≤ n − k , or in other words if k ≤ n/2 . None of these reduced forms
is the principal form if a > 1 so none is the identity in CG(∆) . Thus the order of
[a, 1, an−1 ] is greater than n/2 so it must be n . ⊓
⊔
CG(∆) C1 C2 C3 C4 C2 × C2 C5 C6 C7
∆<0 −3 −15 −23 −39 −84 −47 −87 −71
∆>0 5 12 148 136 60 401 316 577
As one can see, for positive discriminants one usually needs to go farther than for
negative discriminants to realize a given group.
Section 7.4 — Symmetry and the Class Group 235
While positive discriminants are more difficult both computationally and theoret-
ically, they have an extra piece of structure that adds to their interest, the operation
that sends a form Q to its negative −Q . This gives a well-defined operation on CG(∆)
since if two forms Q1 and Q2 are properly equivalent then so are −Q1 and −Q2 be-
cause an orientation-preserving linear fractional transformation taking the topograph
of Q1 to the topograph of Q2 takes the topograph of −Q1 to the topograph of −Q2 .
Also, if Q is primitive then obviously so is −Q .
In CG(∆) the operation sending Q to −Q is generally different from the opera-
tion which sends Q to its mirror image form Q−1 in CG(∆) . For example when ∆ = 12
the group CG(∆) is cyclic of order 2 consisting of the principal form Q = x 2 − 3y 2
and its negative −Q = −x 2 + 3y 2 which is equivalent to 3x 2 − y 2 . Thus Q and −Q
are distinct elements of CG(∆) , but Q = Q−1 and −Q = −Q−1 since Q and −Q
have mirror symmetry. Note that there is never any ambiguity about whether −Q−1
is −(Q−1 ) , the negative of the mirror image of Q , or (−Q)−1 , the mirror image of the
negative of Q , since these are obviously the same.
Proposition 7.20. Inverses and negatives are related to symmetries and skew sym-
metries in the following ways:
(i) Q = Q−1 in CG(∆) if and only if the topograph of Q has a mirror symmetry.
(ii) Q = −Q in CG(∆) if and only if the topograph of Q has a 180 degree rotational
skew symmetry.
(iii) Q = −Q−1 in CG(∆) if and only if the topograph of Q has a glide reflection
skew symmetry.
Proof: We have already seen that (i) holds. Statements (ii) and (iii) apply only to
hyperbolic forms, in which case we can focus on what is happening along the separator
lines in their topographs. We take separator lines to be drawn in the usual way as
horizontal lines with positive values above and negative values below. We can assume
that the edges leading off the separator line occur at unit intervals.
For (ii), the separator line for the negative of a form Q is obtained by first changing
the sign of all the labels along the separator line for Q and then rotating the plane by
180 degrees about some point on the separator line to bring the positive labels back
above the separator line. If Q is properly equivalent to −Q this means that these
two operations of changing signs and rotating produce the same separator line we
started with, up to horizontal translation. Thus the composition of a rotation and a
translation gives a skew symmetry of the separator line of Q . The two ends of the
line are interchanged by this skew symmetry so it must fix some point on the line,
as we saw in the discussion of symmetries of hyperbolic forms in Section 5.4. Hence
the skew symmetry must be a rotation about this point of the separator line. Thus if
Q = −Q in CG(∆) the topograph of Q has a 180 degree rotational skew symmetry.
The converse is obviously true as well.
236 Chapter 7 — The Class Group for Quadratic Forms
For (iii), we can transform the separator line of a form Q to the separator line
of −Q−1 by first changing the signs of the labels and rotating by 180 degrees to
get the separator line for −Q , then reflecting across a vertical line to convert this to
the separator line for −Q−1 . The composition of the rotation and the reflection is a
glide reflection along the separator line. Thus the separator line for Q is transformed
into the separator line for −Q−1 by a glide reflection and changing the sign of the
labels. Hence if Q is properly equivalent to −Q−1 , the separator line for Q has
a skew symmetry obtained by combining a glide reflection with a translation. This
combination is just a glide reflection. ⊓
⊔
(1) If Q has mirror symmetry then so does −Q so the top two forms are equal in
CG(∆) and so are the bottom two. The first of the three rotational symmetries
of the tetrahedron realizes these equalities in CG(∆) .
(2) If Q has a rotational skew symmetry then so does Q−1 so the two forms on the
left are equal in CG(∆) and so are the two on the right. These equalities are
realized by the second rotation of the tetrahedron.
(3) If Q has a glide reflection skew symmetry then so does −Q so the two forms in
each diagonal pair are equal in CG(∆) , and the third rotation of the tetrahedron
gives these equalities.
When Q has two of the three types of symmetries and skew symmetries, it has the
third type as well, so all four forms are equal in CG(∆) . In this case we will say
that Q is fully symmetric. For example the principal form always has mirror sym-
metry and represents 1 so it is fully symmetric exactly when it represents −1 since
Proposition 6.16 says this is equivalent to its having a skew symmetry.
Now let us see how negation of forms relates to multiplication in CG(∆) . One
might guess that (−Q1 )Q2 = −(Q1 Q2 ) as with numbers, but this turns out to be not
quite right as the following lemma shows:
Lemma 7.21. In CG(∆) the formula (−Q1 )Q2 = −(Q1 Q2−1 ) holds for all Q1 and Q2 .
In particular, when Q1 = Q2 we have (−Q1 )Q1 = −Q0 where Q0 is the principal
form.
Section 7.4 — Symmetry and the Class Group 237
Proof: The forms Q1 and Q2 are properly equivalent to a pair of concordant forms
[a1 , b, a2 c] and [a2 , b, a1 c] . The form [−a1 , −b, −a2 c] is then concordant to the
form [a2 , −b, (−a1 )(−c)] = [a2 , −b, a1 c] . Taking the product of these two concor-
dant forms gives [−a1 , −b, −a2 c][a2 , −b, a1 c] = [−a1 a2 , −b, −c] . This says that
(−Q1 )(Q2−1 ) = −(Q1 Q2 ) . Replacing Q2 by Q2−1 then gives the claimed formula
(−Q1 )Q2 = −(Q1 Q2−1 ) . ⊓
⊔
Proposition 7.22. If one element of CG(∆) has a glide reflection skew symmetry
then so do all elements of CG(∆) . This occurs exactly for those discriminants for
which the principal form represents −1 .
Proof: Suppose that Q is some form with a glide reflection skew symmetry, so Q =
−Q−1 or equivalently −Q = Q−1 . Then if Q0 is the principal form we have Q0 =
Q−1 Q = (−Q)Q and this equals −Q0 by the previous lemma. Thus Q0 = −Q0 if
a single form has a glide reflection skew symmetry. Once one has Q0 = −Q0 , then
for arbitrary Q the formula (−Q)Q = −Q0 says that Q is the inverse of −Q , so
Q = −Q−1 which means that Q has a glide reflection skew symmetry. ⊓
⊔
Corollary 7.23. If the class number h∆ is odd then all forms in CG(∆) have a
glide reflection skew symmetry but only the principal form has a rotational skew
symmetry.
Proof: The principal form Q0 has mirror symmetry and therefore so does −Q0 . Thus
(−Q0 )2 = Q0 . If CG(∆) has odd order then it has no elements of order 2 so we must
have −Q0 = Q0 . Thus Q0 has a rotational skew symmetry so it must also have a glide
reflection skew symmetry. By the preceding proposition all forms in CG(∆) then have
a glide reflection skew symmetry. Any form which had a rotational skew symmetry
would therefore also have a mirror symmetry and hence be of order 1 or 2 in CG(∆) ,
so it would have to be Q0 . ⊓
⊔
One might ask whether the “one implies all” property in Proposition 7.22 also
holds for the other two types of symmetries and skew symmetries. For mirror sym-
metries the only time all elements of CG(∆) have mirror symmetry is when CG(∆) is
a product of cyclic groups of order 2 , a rather rare occurrence that we have discussed
before. For rotational skew symmetries it can happen that some forms have rotational
skew symmetry while others do not. We just saw that when CG(∆) has odd order only
the principal form has rotational skew symmetry. An example where another form has
rotational skew symmetry but the principal form does not is ∆ = 136 . Here it is not
hard to compute that there are three equivalence classes of forms: Q0 = [1, 0, −34] ,
−Q0 = [−1, 0, 34] , and Q1 = [3, 2, −11] . Here are the topographs of Q0 and Q1 :
238 Chapter 7 — The Class Group for Quadratic Forms
Since Q0 and −Q0 have mirror symmetry while Q1 does not, the class number is 4 .
The group CG(∆) must be C4 rather than C2 ×C2 since it contains a form Q1 without
mirror symmetry, so this form has order 4 rather than 2 . Thus Q12 has order 2 so
it must be the form −Q0 , as is confirmed by the fact that Q1 represents 3 and −Q0
represents 9 . The topographs show that only Q1 and Q1−1 have a rotational skew
symmetry.
When do all primitive forms of discriminant ∆ have a rotational skew symmetry?
When this happens then in particular the principal form has a rotational skew sym-
metry, as well as a mirror symmetry, so it also has a glide reflection skew symmetry.
The previous proposition then says that all primitive forms have a glide reflection
skew symmetry, in addition to the assumed rotational skew symmetry, so they have
mirror symmetry as well. Thus the class group is a product of cyclic groups of order
2 and the principal form represents −1 . Conversely, these two conditions imply that
all principal forms have mirror symmetry and glide reflection skew symmetry, hence
also rotational skew symmetry.
Another question one could ask is which discriminants have at least one primitive
form with rotational skew symmetry. This turns out to have a very pleasing answer.
As we observed near the end of Section 5.4, the pivot points of rotational skew sym-
metries lie at the midpoints of edges of the separator line where the labels of the
adjacent regions in the topograph are a and −a . If the edge itself is labeled b then
the associated form is [a, b, −a] , and all such forms occur this way at pivot points of
rotational skew symmetries. The discriminant of the form [a, b, −a] is b2 + 4a2 so
we are looking for solutions of x 2 + 4y 2 = ∆ . For [a, b, −a] to be primitive means
that the pair (a, b) is primitive, so the question reduces just to finding the numbers
represented by the form x 2 + 4y 2 , excluding squares since we want the resulting
forms [a, b, −a] to be hyperbolic. (Squares correspond to 0 - hyperbolic forms with
rotational skew symmetry.) Here is a portion of the topograph of x 2 + 4y 2 showing
x b
also the labels y = a which determine the associated forms [a, b, −a] :
Section 7.4 — Symmetry and the Class Group 239
The form x 2 + 4y 2 has discriminant −16 with class number 1 . From Theorems 6.11
and 7.7 we can deduce that the numbers represented by x 2 + 4y 2 are the numbers
2m p1 · · · pk where m is 0 , 2 , or 3 and each pi is a prime congruent to 1 mod 4 .
This tells us which discriminants have at least one primitive form with rotational skew
symmetry.
A more refined question is how many different elements of CG(∆) have rotational
skew symmetries. Solutions of b2 + 4a2 = ∆ come in groups of four obtained by
varying the signs of a and b . If we restrict attention just to the solutions with a
positive, the primitive solutions (a, b) correspond exactly to regions in the topograph
of x 2 + 4y 2 labeled ∆ , and these regions come in pairs, one in the upper half of the
topograph with b > 0 and one in the lower half with b < 0 . The sign of the label b
on an edge of a topograph with a pivot point can be specified by orienting all edges
of the separator line so that the regions on the left of the separator line have positive
labels. Taking the mirror image topograph then corresponds to changing the sign of b .
This might or might not give the same element of CG(∆) depending on whether the
topograph has mirror symmetry.
The topograph of a form with rotational skew symmetry has two pivot points on
the separator line in each period. Thus the number of proper equivalence classes of
primitive forms of discriminant ∆ with rotational skew symmetry is half the number
of regions labeled ∆ in the topograph of x 2 + 4y 2 , and is therefore equal to the
number of such regions in the upper half of the topograph. In other words the number
of elements of CG(∆) with rotational skew symmetry equals the number of times that
∆ appears in the upper half of the topograph of x 2 + 4y 2 . For example, a prime can
appear only once in the upper half of the topograph by Proposition 6.16 so prime
discriminants have only one element of CG(∆) with rotational skew symmetry, and
this element must have mirror symmetry.
In general the number of rotationally skew symmetric forms in CG(∆) can be
computed from the prime factorization of ∆ using methods from the next chapter.
e e
The result is that if ∆ = 2m p11 · · · pkk for distinct primes pi ≡ 1 mod 4 with each
ei > 0 then the number of forms in CG(∆) with rotational skew symmetry is 2k−1
240 Chapter 7 — The Class Group for Quadratic Forms
Exercises
1. For discriminant ∆ = −95 first compute the class number by finding all the reduced
forms, then determine the structure of the class group in two different ways, first by
applying Corollary 7.17 and then by seeing which forms represent powers of 2 up to
24 .
2. For discriminant ∆ = −164 determine the structure of the class group and find the
orders of all its elements.
4. For discriminant ∆ = 148 determine the class group and also the symmetries and
skew-symmetries of the forms of that discriminant.
6. (a) Show that the form [2, 1, m] has order at least n in its class group if 2m > 2n .
(b) Show that the discriminant 1 − 8m in part (a) can be chosen to be a fundamental
discriminant.
(c) Do the analogs of (a) and (b) using the form [3, 2, m] which has even discriminant.
We will give two proofs of this basic result. The first proof relies on Dirichlet’s
Theorem on primes in arithmetic progressions which we have not proved in this book,
and which we have previously used only at the end of Section 6.3 in the proofs of
Theorem 6.26 and Corollaries 6.27 and 6.28. The second proof will use only results
proved in this book, notably Legendre’s Theorem on solutions of ax 2 + by 2 = cz 2
from Section 2.3, but this proof has the disadvantage of applying only for fundamental
discriminants.
First proof: By the definition of genus, every genus contains at least one form, so Φ
is onto. Since a function between two finite sets with the same number of elements is
one-to-one if and only if it is onto, it will suffice to show that CG(∆)/CG(∆)2 and G(∆)
have the same number of elements. By Corollary 6.27 the number of genera is equal
to the number of elements of CG(∆) corresponding to forms with mirror symmetry,
or in other words the elements of CG(∆) of order 1 or 2 . By Propositions 7.14 and
7.15 this equals the number of elements of CG(∆)/CG(∆)2 . ⊓
⊔
For the second proof of Proposition 7.24 the main step will be the following:
Corollary 7.26. For fundamental discriminants each form in the genus of the prin-
cipal form is the square of another form.
Proof: If a form Q is in the genus of the principal form the proposition says it rep-
2r1 2rk
resents a nonzero square n2 . Let the prime factorization of n2 be p1 · · · pk for
distinct primes pi . Theorem 7.7 then says that Q has a corresponding factorization
2r 2rk r r
Q = Q1 1 · · · Qk in CG(∆) . Hence Q is the square of Q11 · · · Qkk . ⊓
⊔
This corollary could also be deduced from Proposition 7.24 without using the
hypothesis of fundamental discriminant. However the proof we gave for the corollary
cannot yield this more general statement since it is not always true that a primitive
form that represents a square must be the square of another form. For example for
∆ = −32 the form 3x 2 + 2xy + 3y 2 represents 4 when (x, y) = (1, −1) but this
form is not a square since the character χ8 is defined for ∆ = −32 and has the value
−1 on this form. The proof of the corollary does apply if the square represented is
coprime to the conductor.
lies in the genus of the principle form, so by the preceding corollary Q1 Q2−1 is a
square Q2 in CG(∆) . Thus Q1 = Q2 Q2 and so Q1 and Q2 give the same element of
CG(∆)/CG(∆)2 , which means that Φ is one-to-one. ⊓
⊔
Corollary 7.27. Each genus of forms of a given discriminant contains the same
number of proper equivalence classes of forms.
Proof: Let Q1 , · · · , Qk be the distinct elements of CG(∆) in the genus of the principal
form. By Proposition 7.24 these are exactly the elements of CG(∆) that are squares.
The genus of an arbitrary element Q of CG(∆) then consists of QQ1 , · · · , QQk since
these are all the elements of CG(∆) obtained by multiplying Q by squares. These
multiples of Q are all distinct since if QQi = QQj then after multiplying by Q−1 we
have Qi = Qj so i = j . Thus each genus consists of k elements of CG(∆) . ⊓
⊔
For a fixed discriminant ∆ the class number is the product of the number of
genera times the number of classes in each genus. There are two extreme situations
that can occur when one or the other of these two factors is 1 :
(A) Each genus consists of a single equivalence class of forms. There are several
equivalent ways of stating this condition:
— The number of genera equals the class number.
— Every form has mirror symmetry.
— Every element of CG(∆) has order 2 .
— CG(∆) is a product of cyclic groups of order 2 .
244 Chapter 7 — The Class Group for Quadratic Forms
(B) The primitive forms of discriminant ∆ all have the same genus, or in other words
the number of genera is 1 . Again there are equivalent statements:
— The only primitive forms with mirror symmetry are the forms equivalent to
the principal form.
— CG(∆) contains no elements of order 2 .
— CG(∆) contains no elements of even order.
— The class number is odd.
Discriminants where (A) or (B) occurs are rather rare. For (B), Corollary 5.10 says
exactly when this happens in terms of the prime factorization of ∆ . For (A) there is
no such simple characterization.
The relationships between the class group, genus, and symmetry can be expressed
concisely in a sequence of groups and functions between them:
Sq
SCG(∆) -----→ T S(∆) -----X----→ {±1}
--→ CG(∆) ---------→ CG(∆) ----Ch ∆
Here SCG(∆) is the symmetric class group, the subgroup of CG(∆) consisting of
symmetric forms, and the function SCG(∆) → CG(∆) is just the inclusion of this
subgroup into CG(∆) . The function Sq is squaring, sending a form Q to Q2 . The
group T S(∆) is the set of “total symbols” (±1, · · · , ±1) with one coordinate for each
character defined for discriminant ∆ . The group structure in T S(∆) is multiplication
in each coordinate separately. The function Ch is the “total character” sending each
form to the values of the various characters on this form. The last function X∆ is the
product of characters that measures whether a prime not dividing ∆ is represented
in discriminant ∆ , so for fundamental discriminants this is all the characters.
The compositions of successive functions in the five-term sequence above have
f g
a special property: For each pair of adjacent functions A --→ B --→ C an element b
in the middle group B is sent by g to the identity element of C exactly when b is
equal to the image f (a) of some element a in A . A sequence of functions with this
property is called an exact sequence. Let us see what this means for each of the three
middle groups in the five-term sequence above.
(1) Exactness at the first CG(∆) term is the fact that the square Q2 of a form Q is
the identity in CG(∆) exactly when Q is symmetric.
(2) Exactness at the second CG(∆) term means that a form Q belongs to the genus
of the principal form exactly when Q is the square of a form in CG(∆) .
(3) Exactness at Ch(∆) means that X∆ has the value +1 on a total symbol exactly
when this is the total symbol given by the character values of some form.
Section 7.5 — Genus and Rational Equivalence 245
Exactness in (1) is fairly easy. In (2) and (3) the easier half of exactness is the statement
that an element in the image of one function is sent by the next function to the identity
element of the next group. These are the statements obtained by omitting the word
“exactly”. The more difficult half of (2) is Corollary 7.26 which, as we noted above,
holds not just for fundamental discriminants. The more difficult half of (3) is what
we showed to prove Theorem 6.26.
Now let us consider the relationship between genus and the simultaneous repre-
sentation of numbers by forms of the same discriminant that are not equivalent.
Proposition 7.28. If two primitive forms of the same discriminant represent the
same number coprime to the conductor then the two forms are in the same genus.
Proof: According to Theorem 7.7 we obtain the various primitive forms representing
±e1 ±ek
a number n coprime to the conductor as products Q1 · · · Qk where the prime
e e
factorization of n is n = p11 · · · pkk and Qi represents pi . Changing the exponent
e −2ei
of Qi from +ei to −ei amounts to multiplying Qi i by a square Qi , and similarly
for changing the exponent from −ei to +ei . As we noted earlier, multiplying a form
by the square of another form does not change its genus. So any two primitive forms
representing n have the same genus. ⊓
⊔
Proposition 7.29. If two primitive forms are of the same genus then there exist
numbers that are represented by both forms, and in fact there are infinitely many
such numbers.
Proof: If the primitive forms Q1 and Q2 of discriminant ∆ have the same genus then
there is a form Q such that Q2 = Q1 Q2 in CG(∆) . Choose a number k represented
by Q1 . We can then choose a number m represented by Q and coprime to k , and
after this a number n represented by Q and coprime to km , so all three of k , m , and
n are coprime. Then kmn is represented by both Q1 Q2 = Q2 and Q1 QQ−1 = Q1 .
There are infinitely many choices possible for n since new choices can always be made
coprime to all previously chosen numbers. ⊓
⊔
Legendre’s Theorem shows that determining when quadratic curves contain ratio-
nal points is much easier than determining when they contain integer points. Pursuing
this idea, our goal in the rest of this section will be to see how the general theory of
quadratic forms becomes much simpler when rational numbers are used in place of
integers, and in fact reduces largely to genus theory.
246 Chapter 7 — The Class Group for Quadratic Forms
Proposition 7.30. (a) If a rational form takes on the nonzero value a then it is
properly Q-equivalent to a form [a, 0, c] . In particular every rational form is
properly Q-equivalent to a form [a, 0, c] .
(b) If two rational forms of the same discriminant take on the same nonzero value
then they are properly Q-equivalent.
sition they are both properly Q- equivalent to 15, 0, 14/15 and hence to each other.
As another example the principal form x 2 + xy + ky 2 of discriminant 1 − 4k takes
4k−1 2
the value 1 so it is properly Q- equivalent to x 2 + 4 y and this form is rationally
2 2
equivalent to x + (4k − 1)y , the principal form of discriminant 4(1 − 4k) .
Proof: Let Q be a rational form taking the nonzero value a when (x, y) = (p, q)
for rational numbers p and
q , not both zero. The numbers p and q form the first
p r
column of a matrix q s of determinant 1 since the equation ps − qr = 1 always
has a solution with rational numbers r and s . For example if p ≠ 0 we can choose
r = 0 and
s = 1/p and if q ≠ 0 we can choose s = 0 and r = ---1/q . We use the
pr
matrix q s to change variables to get a new form Q(px + r y, qx + sy) properly
Q- equivalent to Q whose value at (x, y) = (1, 0) is Q(p, q) = a . Thus Q is properly
Q- equivalent to a form [a, b, c] for some rational numbers b and c . This form can
be rewritten as
b 2 b2 2
2 2
ax + bxy + cy = a x + y + c− y
2a 4a
so if we change variables to X = x + b/2a y and Y = y the form [a, b, c] becomes
2
[a, 0, c ′ ] for c ′ = c − b /4a . The matrix for this change of variables has determinant
1 so the form [a, 0, c ′ ] is properly Q- equivalent to [a, b, c] and hence also to the
original form Q . This proves statement (a).
Statement (b) follows from (a) since the coefficient c in a form [a, 0, c] is deter-
mined by a and the discriminant when a ≠ 0 . ⊓
⊔
Proposition 7.31. Primitive forms of the same genus are properly Q-equivalent.
For fundamental discriminants the converse is also true: Properly Q-equivalent
forms have the same genus.
An example showing the necessity of the extra hypothesis in the converse is pro-
vided by the forms [1, 0, 8] and [3, 2, 3] of discriminant −32 which have different
genus but are properly Q- equivalent since they both represent 8 .
Proof: For the first statement, two primitive forms of the same genus represent the
same number by Proposition 7.29, and then the previous proposition says they are
properly Q- equivalent.
Conversely, suppose Q and Q′ are primitive forms of discriminant ∆ that are
properly Q- equivalent. Let k be a number represented by Q . If k is divisible by p 2
for some prime p , say k = p 2 m , then if ∆ is a fundamental discriminant Theorem 7.7
implies that Q is equivalent to the product of a form representing m and the square
of a form representing p . The form representing m is then in the same genus as Q
and thus also properly Q- equivalent to Q , so for proving the converse we can replace
Q by this form. After repetitions of this step we can then assume that the number k
represented by Q is squarefree.
248 Chapter 7 — The Class Group for Quadratic Forms
Since Q and Q′ are properly Q- equivalent they take on the same rational values
as the variables range over all rational numbers. Thus there exist integers x, y, z
such that Q′ x/z , y/z = k and hence Q′ (x, y) = kz 2 . We would like to say that
Q′ represents kz 2 , and this will be the case if x and y are coprime. Suppose on
the contrary that x and y are both divisible by some prime p . We can assume p
does not divide z , otherwise the fractions x/z and y/z could be reduced. Since p
divides x and y it follows that p 2 divides Q′ (x, y) = kz 2 and hence p 2 divides k .
This contradicts the fact that k is squarefree, so we deduce that Q′ represents kz 2 .
Using Theorem 7.7 again and the assumption that ∆ is a fundamental discriminant
we conclude that Q′ is the product of a form Q′′ representing k and the square of
some form representing z , so Q′ and Q′′ are in the same genus. Since Q and Q′′
both represent k they have the same genus by Proposition 7.28. Hence Q and Q′
have the same genus. ⊓
⊔
In the remainder of this section we will describe the classification of rational forms
up to rational equivalence. The first difference from the classification of integer forms
up to integer equivalence as in Chapter 5 involves the discriminant. As we have seen,
a change of variables by a matrix of nonzero rational determinant r multiplies the
discriminant by r 2 . For example the change of variables replacing (x, y) by (r x, y)
has this effect. This leads us to consider nonzero rational numbers modulo squares,
so two nonzero rational numbers are regarded as equivalent modulo squares if one is
obtained from the other by multiplying by the square of a nonzero rational number.
Every nonzero rational number is equivalent modulo squares to an integer since we
can multiply by the square of its denominator. Thus p/q becomes pq , turning division
into multiplication. After this, any square integer factor of the resulting integer can
be eliminated by multiplying by the reciprocal of this square factor. In this way every
equivalence class of nonzero rational numbers modulo rational squares contains a
squarefree nonzero integer, and this integer is obviously unique.
In particular every nonzero discriminant is equivalent modulo squares to a unique
nonzero squarefree integer discriminant which we call a reduced discriminant. When
we speak of the reduced discriminant of a form we will mean the unique squarefree in-
teger that is equivalent to its discriminant modulo squares. For example for a nonzero
squarefree integer d the forms x 2 − d/4 y 2 and 4x 2 − dy 2 both have reduced dis-
criminant d . Thus all squarefree nonzero integers occur as reduced discriminants.
A reduced discriminant is a fundamental discriminant if it is congruent to 1 mod 4 ,
and otherwise four times the reduced discriminant is a fundamental discriminant.
A form Q and a nonzero rational multiple r Q have the same reduced discrimi-
nant. However Q and r Q may not be rationally equivalent. An example is provided by
the forms x 2 + y 2 and 3x 2 + 3y 2 with reduced discriminant −1 , as we will soon see.
On the other hand Q and r 2 Q are rationally equivalent since r 2 Q(x, y) = Q(r x, r y) .
It follows that every rational form is rationally equivalent to an integer form, so it will
Section 7.5 — Genus and Rational Equivalence 249
Proposition 7.32. If two rational forms of the same reduced discriminant take on
the same nonzero value then they are rationally equivalent.
Proof: Let the two forms be Q and Q′ . Since they have the same reduced discrim-
inant there is a rational number r such that the discriminant of Q′ is r 2 times the
discriminant of Q . The form Q′′ (x, y) = Q(r x, y) has the same discriminant as
Q′ and is rationally equivalent to Q , hence has the same values as Q . Thus we may
assume from the start that Q and Q′ have the same discriminant. Proposition 7.30
then gives the result. ⊓
⊔
Proof: For each integer pair (x, y) and each rational number r we have r 2 Q(x, y) =
Q(r x, r y) so rational squares times values at integer pairs are values at rational pairs.
Conversely if (x, y) is a rational pair there is a nonzero integer d such that (dx, dy)
is an integer pair, and then Q(x, y) = d−2 Q(dx, dy) so every value at a rational pair
is a rational square times a value at an integer pair. ⊓
⊔
Multiplying a form by a nonzero square does not affect the signs of its values, so
the basic distinction between elliptic, hyperbolic, 0- hyperbolic, and parabolic forms
still holds for rational forms. We have seen that all 0- hyperbolic forms are rationally
equivalent. The classification of parabolic forms up to rational equivalence is easy
and will be left as an exercise. This leaves hyperbolic and elliptic forms. For elliptic
forms we can restrict attention to those taking positive values as we did for integer
forms.
As a first example let us work out the classification of forms of reduced dis-
criminant −1 up to rational equivalence. The associated fundamental discriminant
250 Chapter 7 — The Class Group for Quadratic Forms
is −4 , with class number one so all integer forms of discriminant −4 are equivalent
to x 2 + y 2 . The values of this form for integers x and y are all the positive num-
bers whose prime factorization contains primes p ≡ 3 mod 4 only to even powers.
The values for rational x and y are then all such products where negative as well as
positive exponents on primes are allowed.
Consider next the form 3x 2 + 3y 2 which also has reduced discriminant −1 . The
values this form takes on for rational x and y can be described in the same way as for
x 2 + y 2 except that now the exponent on the prime 3 must be odd rather than even.
Thus this form is not rationally equivalent to x 2 +y 2 . More generally, for any finite set
of primes p1 , · · · , pk congruent to 3 mod 4 the values of the form p1 · · · pk (x 2 +y 2 )
are the products in which each pi has odd exponent. Different sets of primes pi ≡ 3
mod 4 , including the empty set for the form x 2 + y 2 , give forms taking on disjoint
sets of values, so all these sets of primes give different rational equivalence classes
of forms. Every rational equivalence class is realized in this way since one can take
any form in this class and any nonzero value r this form takes on, then take the set
of primes pi ≡ 3 mod 4 that occur to an odd power in the prime factorization of r .
Thus we have determined all of the infinitely many rational equivalence classes of
forms of reduced discriminant −1 .
Other fundamental discriminants of class number one work in the same way.
For example for discriminant −3 we have the form x 2 + xy + y 2 whose values are
products of primes in which primes p ≡ 2 mod 3 occur only to even powers. The
rational equivalence classes then correspond to multiples of x 2 + xy + y 2 by finite
products of distinct primes p ≡ 2 mod 3 . Instead of x 2 + xy + y 2 we could use
x 2 + 3y 2 which has the same reduced discriminant and is rationally equivalent to
x 2 + xy + y 2 since both forms take the value 3 .
In the general case the rational classification of forms of a given reduced dis-
criminant δ involves the different genera of forms of the associated fundamental
discriminant ∆ . By Proposition 7.31 each of these genera corresponds to exactly one
rational equivalence class of forms. Choose one form Qi in each of these genera. The
values of integer forms of discriminant ∆ are the numbers whose prime factorization
contains certain primes only to even powers, namely the primes not represented in
discriminant ∆ , which are the primes in certain congruence classes mod ∆ . The ra-
tional equivalence classes for reduced discriminant δ then correspond exactly to the
forms p1 · · · pk Qi where p1 , · · · , pk are distinct primes not represented in discrim-
inant ∆ .
Exercises
1. Find all the instances in the large table in Section 6.2 where two primitive forms of
the same discriminant but different genus represent the same power of the conductor.
Section 7.5 — Genus and Rational Equivalence 251
2. For discriminant ∆ = −260 the equivalence classes of forms were worked out
in Section 5.2. Show that CG(∆) is C4 × C2 , partition the forms into genera, and
determine the order of each element of CG(∆) . Which elements are squares of other
elements?
3. For discriminant ∆ = −119 = −7·17 show that CG(∆) is cyclic, determine its
order, and find forms giving all the elements. Then partition these elements according
to their genus and determine the order of each element. (All this can be done without
actually computing any products using concordant pairs of forms.)
4. (a) Determine the values of n for which the curve 2x 2 + ny 2 = 1 contains rational
points, assuming n is odd and squarefree. For each of the first three positive values
of n for which the curve contains rational points find two of these rational points
that lie in the first quadrant.
(b) Show that the case that n is even and squarefree reduces to the previous case.
5. Determine the values of n for which the curve 3x 2 + ny 2 = 1 contains rational
points, assuming n is odd, squarefree, and coprime to 3 .
√
Similarly, the ring Z[ D] with D < 0 forms a grid of complex numbers forming
p
rectangles of height |D| obtained by stretching the previous figure vertically.
√
When D > 0 the numbers in Z[ D] are real numbers which would normally be
regarded as points along the x- axis. However, there is another point of view that will
make the case D > 0 look just like the case D < 0 , and this is to regard a number
√ √ √ √
x+y D in Z[ D] or more generally Q( D) as the point (x, y D) in the plane. Thus
√ √
for example Z[ 2] is exactly the same rectangular grid as Z[ −2] , with rectangles
√
of width 1 and height 2 . From this point of view the horizontal and vertical axes
of the plane, instead of being the real and imaginary axes, are now regarded as the
√
“rational and irrational axes”, with the two coordinates x and y D being the rational
√
and irrational parts of x + y D .
A useful operation with complex numbers is to pass from a number x + yi to
√
its complex conjugate x − yi obtained by reflecting across the x- axis. In Z[ D] or
√ √ √
Q( D) with D < 0 this amounts to replacing x + y D by its conjugate x − y D .
√
When D > 0 we can do exactly the same operation of reflecting x + y D across the
√ √
x- axis to the point x − y D , which we again call the conjugate of x + y D .
√ √ √
The ring Z[ D] is useful for factoring the form x 2 −Dy 2 as (x+y D)(x−y D) .
For this form the discriminant ∆ = 4D is 0 mod 4 , and it would be nice to treat also
the discriminants ∆ = 4d + 1 ≡ 1 mod 4 , when the principal form is x 2 + xy − dy 2 .
This factors in the following way:
√ √
2 2 1 + 1 + 4d 1 − 1 + 4d
x + xy − dy = x + y x+ y
2 2
254 Chapter 8 — Quadratic Fields
√ √
To simplify the notation we let ω = (1 + 1 + 4d)/2 and ω = 1 − 1 + 4d)/2 , the
conjugate of ω , so the factorization becomes x 2 + xy − dy 2 = (x + ωy)(x + ωy) .
The quadratic equation satisfied by ω is ω2 − ω − d = 0 . Thus ω2 = ω + d and this
allows the product of two numbers of the form m + nω to be written in the same
form. In other words, the set Z[ω] of all numbers x + yω with x and y integers
√
is a ring, just like Z[ D] . Note that ω is an element of Z[ω] since ω + ω = 1 , so
ω=1−ω
√
For example, when d = −1 we have ω = (1 + −3)/2 and the elements of Z[ω]
form a grid of equilateral triangles in the xy- plane:
The picture for larger negative values of d is similar but stretched in the vertical
direction, forming a grid of isosceles triangles. For positive values of d we can do
√
the same thing we did before with Z[ D] and regard Z[ω] as a grid in the plane.
√
For example, for d = 1 we have ω = (1 + 5)/2 and Z[ω] looks like the picture
√
for d = −1 stretched in the vertical direction so that the y- coordinate of ω is 5/2
√
rather than 3/2 .
√
Elements of Z[ω] can always be written in the form m + nω = (a + b 1 + 4d)/2
for suitable integers a and b . Here a and b must have the same parity since this
√
is true for ω = (1 + 1 + 4d)/2 and hence for any integer multiple nω , and then
adding an arbitrary integer m to nω preserves the equal parity condition since it
adds an even integer to a . Conversely, if two integers a and b have the same parity
√
then (a + b 1 + 4d)/2 lies in Z[ω] since by adding or subtracting a suitable even
integer from a we can reduce to the case a = b when one has a multiple of ω . Notice
√ √
that having both a and b even is equivalent to (a + b 1 + 4d)/2 lying in Z[ 1 + 4d] ,
√ √
so Z[ 1 + 4d] is a subset of Z[ω] . In the figure above we can see that Z[ 1 + 4d]
consists of the even rows, the numbers m + nω with n even.
√
To have a unified notation for both the cases Z[ D] and Z[ω] let us define R∆
√
to be Z[ D] when the discriminant ∆ is 4D and Z[ω] when ∆ is 4d + 1 . We will
√
often write elements of R∆ using lower case Greek letters, for example α = x + y D
√ √
in Z[ D] with conjugate α = x − y D , or α = x + yω in Z[ω] with conjugate
Section 8.1 — Prime Factorization 255
α = x + yω = x + y(1 − ω) = (x + y) − yω .
The main theme of this section and the next will be how elements of R∆ factor
into “primes” within R∆ . For example, if a prime p in Z happens to be representable
√
as p = x 2 − Dy 2 then this is saying that p is no longer prime in Z[ D] since it
√ √ √ √
factors as p = (x + y D)(x − y D) = αα for α = x + y D and α = x − y D . Of
√
course, we should say precisely what we mean by a “prime” in Z[ D] or Z[ω] . For an
ordinary integer p > 1 , being prime means that p is divisible only by itself and 1 . If
we allow negative numbers, we can “factor” a prime p as (−1)(−p) , but this should
not count as a genuine factorization, otherwise there would be no primes at all in Z .
In R∆ things can be a little more complicated because of the existence of units in R∆ ,
the nonzero elements ε in R∆ whose inverse ε−1 also lies in R∆ . For example, in
the Gaussian integers Z[i] there are four obvious units, ±1 and ±i , where for ±i we
have (i)(−i) = 1 so i−1 = −i and (−i)−1 = i . We will see in a little while that these
are the only units in Z[i] . Having four units in Z[i] instead of just ±1 complicates
the factorization issue slightly, but not excessively so.
For positive values of ∆ things are somewhat less tidy because there are always
√ √
infinitely many units in R∆ . For example, in Z[ 2] the number ε = 3 + 2 2 is a
√ √ √
unit because (3 + 2 2)(3 − 2 2) = 1 . All the powers of 3 + 2 2 are therefore
√
also units, and there are infinitely many of them since 3 + 2 2 > 1 so the powers
√
(3 + 2 2)n form an increasing infinite sequence approaching +∞ . Their inverses
√ √
(3 + 2 2)−n = (3 − 2 2)n are a decreasing infinite sequence approaching 0 .
Whenever ε is a unit in R∆ we can factor any number α in R∆ as α = (αε)(ε−1 ) .
If we allowed this as a genuine factorization there would be no primes in R∆ , so it
is best not to consider it as a genuine factorization. This leads us to the following
definition: An element α of R∆ is said to be prime in R∆ if it is neither 0 nor a unit,
and if whenever we have a factorization of α as α = βγ with both β and γ in R∆ ,
then it must be the case that either β or γ is a unit in R∆ . Not allowing units as
primes is analogous to the standard practice of not considering 1 to be a prime in Z .
If we replace R∆ by Z in the definition of primeness above, we get the condition
that an integer a in Z is prime if its only factorizations are the trivial ones a =
(a)(1) = (1)(a) and a = (−a)(−1) = (−1)(−a) , which is what we would expect.
This definition of primeness also means that we are allowing negative primes as the
negatives of the positive primes in Z .
A word of caution: An integer p in Z can be prime in Z but not prime in R∆ . For
example, in Z[i] we have the factorization 5 = (2 + i)(2 − i) , and as we will be able
to verify soon, neither 2 + i nor 2 − i is a unit in Z[i] . Hence by our definition 5 is
not a prime in Z[i] , even though it is prime in Z . Thus one always has to be careful
when speaking about primeness to distinguish “prime in Z ” from “prime in R∆ ”.
Having defined what we mean by primes in R∆ it is then natural to ask whether
every nonzero element of R∆ that is not a unit can be factored as a product of primes,
256 Chapter 8 — Quadratic Fields
and if so, whether this factorization is in any way unique. As we will see, the existence
of prime factorizations is fairly easy to prove, but the uniqueness question is much
more difficult and subtle. To clarify what the uniqueness question means, notice first
that if we have a unit ε in R∆ we can always modify a factorization α = βγ to give
another factorization α = (εβ)(ε−1 γ) . This is analogous to writing 6 = (2)(3) =
(−2)(−3) in Z . This sort of nonuniqueness is unavoidable, but it is also not too
serious a problem. So when we speak of factorization in R∆ being unique, we will
always mean unique up to multiplying the factors by units.
A fruitful way to study factorizations in R∆ is to relate them to factorizations in
Z by associating to each element α in R∆ the number N(α) = αα called the norm
√
of α . Thus in the two cases R∆ = Z[ D] and R∆ = Z[ω] we have
√ √ √
N(x + y D) = (x + y D)(x − y D) = x 2 − Dy 2
N(x + yω) = (x + yω)(x + yω) = x 2 + xy − dy 2
In both cases N(α) is an integer. Notice that when the discriminant is negative, so α
is a complex number which can be written as a + bi for real numbers a and b , the
norm of α is just αα = (a + bi)(a − bi) = a2 + b2 , the square of the distance from
α to the origin in the complex plane. When the discriminant is positive the norm can
be negative so it does not have a nice geometric interpretation in terms of distance,
but it will be quite useful in spite of this.
The reason the norm is useful for studying factorizations is that it satisfies the
following multiplicative property:
Proof: We will deduce multiplicativity of the norm from multiplicativity of the conju-
gation operation, the fact that αβ = α β . The argument will apply more generally to
√
all elements of Q( D) for any integer D that is not a square. To verify that αβ = α β ,
√ √ √
write α = x + y D and β = z + w D , so that αβ = (xz + ywD) + (xw + yz) D .
Then
√ √ √
αβ = (xz + ywD) − (xw + yz) D = (x − y D)(z − w D) = αβ
For the norm we then have N(αβ) = (αβ)(αβ) = αβαβ = ααββ = N(α)N(β) . ⊓
⊔
Using the multiplicative property of the norm we can derive a simple criterion for
recognizing units:
Proof: Suppose ε is a unit, so its inverse ε−1 also lies in R∆ . Then N(ε)N(ε−1 ) =
N(εε−1 ) = N(1) = 1 . Since N(ε) and N(ε−1 ) are integers this forces N(ε) to be
±1 . For the converse we use the fact that a nonzero element α in R∆ has inverse
α−1 = α/N(α) since α α/N(α) = 1 . Hence if N(ε) = ±1 we have ε−1 = ±ε which
is an element of R∆ if ε is, so ε is a unit. ⊓
⊔
Section 8.1 — Prime Factorization 257
√
When ∆ is negative there are very few units in R∆ . In the case of Z[ D] the
√
equation N(x + y D) = x 2 − Dy 2 = ±1 has very few integer solutions when D < 0 ,
namely, if D = −1 there are only the four solutions (x, y) = (±1, 0) and (0, ±1) while
if D < −1 there are only the two solutions (x, y) = (±1, 0) . Thus the only units in
√
Z[i] are ±1 and ±i , and the only units in Z[ D] for D < −1 are ±1 . Geometrically
√
this is saying that these are the only points in the grid Z[ D] of distance 1 from
the origin, which is obviously true. In the case of Z[ω] one can see from the earlier
figure of Z[ω] that there are just six points of Z[ω] of distance 1 from the origin
when d = −1 , and only the two points ±1 when d < −1 and the figure is stretched
vertically. When d = −1 the six units are ±1 , ±ω , and ±(ω−1) . These are the powers
ωn for n = 1, 2, 3, 4, 5, 6 since the general formula ω2 = ω + d gives ω2 = ω − 1
when d = −1 , and from this it follows that ω3 = −1 , ω4 = −ω , ω5 = 1 − ω , and
ω6 = 1 . When d < −1 the only units in Z[ω] are ±1 .
√
The situation for R∆ with ∆ positive is quite different. For Z[ D] we are looking
for solutions of x 2 − Dy 2 = ±1 with D > 0 , while for Z[ω] the corresponding
equation is x 2 + xy − dy 2 = ±1 with d > 0 . We know from our study of topographs
of hyperbolic forms that these equations have infinitely many integer solutions since
the value 1 occurs along the periodic separator line in the topograph of the principal
form when (x, y) = (1, 0) , so it appears infinitely often by periodicity. For some
values of D or d the number −1 also appears along the separator line, and then it
too appears infinitely often. Thus when ∆ > 0 the ring R∆ has infinitely many units
√
ε = x + y D or x + yω , with arbitrarily large values of x and y .
There is a nice interpretation of units in R∆ as symmetries of the topograph of
the principal form of discriminant ∆ . A unit ε in R∆ defines a transformation Tε of
√ √
R∆ by the formula Tε (α) = εα . In the case of Z[ D] , if ε = p + q D then
√ √ √ √
Tε (x + y D) = (p + q D)(x + y D) = (px + Dqy) + (qx + py) D
Proposition 8.3. When ∆ > 0 the units in R∆ are exactly the elements ±εn for
n ∈ Z , where ε is the fundamental unit.
Proof: The units appear along the separator line at the regions x/y where the norm
form takes the value ±1 . From our previous comments, these are the points Tεn 1/0
as n varies over Z . Since Tε is multiplication by ε , the power Tεn is multiplication
√
by εn . Thus the values ±1 occur at the regions labeled x/y for εn = x + y D or
εn = x + yω . The units are therefore the elements ±εn where the ± comes from the
fact that the topograph does not distinguish between (x, y) and (−x, −y) . ⊓
⊔
Proposition 8.4. All symmetries and skew symmetries of the topograph of the norm
form are obtainable as combinations of conjugation and the transformations Tε
associated to units ε in R∆ .
The converse of this proposition is not generally true. For example the num-
ber 3 has norm 9 , which is not prime in Z , and yet 3 is prime in Z[i] since if we
had a factorization 3 = αβ in Z[i] with neither α nor β a unit, then the equation
N(α)N(β) = N(3) = 9 would imply that N(α) = ±3 = N(β) , but there are no ele-
ments of Z[i] with norm ±3 since the equation x 2 +y 2 = ±3 has no integer solutions.
Proposition 8.6. Every nonzero element of R∆ that is not a unit can be factored as
a product of primes in R∆ .
Proof: We argue by induction on |N(α)| . Since we are excluding 0 and units, the
induction starts with the case |N(α)| = 2 . In this case α must itself be a prime by the
preceding proposition since 2 is prime in Z . For the induction step, if α is a prime
there is nothing to prove. If α is not prime, it factors as α = βγ with neither β nor
γ a unit, so |N(β)| > 1 and |N(γ)| > 1 . Since N(α) = N(β)N(γ) , it follows that
|N(β)| < |N(α)| and |N(γ)| < |N(α)| . By induction, both β and γ are products of
primes in R∆ , hence their product α is also a product of primes in R∆ . ⊓
⊔
To illustrate this with a simple example, let us see how 3 + i factors in Z[i] . We have
N(3 + i) = (3 + i)(3 − i) = 10 = 2·5 . These two numbers factor as 2 = (i + i)(1 − i)
and 5 = (2 + i)(2 − i) . These are prime factorizations in Z[i] since N(1 ± i) = 2 and
N(2 ± i) = 5 , both of which are primes in Z . Now we test whether for example 1 + i
260 Chapter 8 — Quadratic Fields
divides 3 + i by dividing:
3+i (3 + i)(1 − i) 4 − 2i
= = =2−i
1+i (1 + i)(1 − i) 2
Since the quotient 2−i is a Gaussian integer, we conclude that 1+i is a divisor of 3+i
and we have the factorization 3 + i = (1 + i)(2 − i) . This is the prime factorization of
3 + i since we have already noted that both 1 + i and 2 − i are primes in Z[i] .
For a more complicated example consider 244 + 158i . For a start, this factors
as 2(122 + 79i) . Since 122 and 79 have no common factors in Z we cannot go any
farther by factoring out ordinary integers. We know that 2 factors as (1 + i)(1 − i)
and these two factors are prime in Z[i] since their norm is 2 . It remains to factor
122 + 79i . This has norm 1222 + 792 = 21125 = 53 ·132 . Both 5 and 13 happen to
factor in Z[i] , namely 5 = (2 + i)(2 − i) and 13 = (3 + 2i)(3 − 2i) , and these are
prime factorizations since the norms of 2 ± i and 3 ± 2i are 5 and 13 , primes in Z .
Thus we have the prime factorization
Now we look at the factors on the right side of this equation to see which ones are
factors of 122 + 79i . Suppose for example we test whether 2 + i divides 122 + 79i :
122 + 79i (122 + 79i)(2 − i) 323 + 36i
= =
2+i (2 + i)(2 − i) 5
This is not a Gaussian integer, so 2 + i does not divide 122 + 79i . Let us try 2 − i
instead:
122 + 79i (122 + 79i)(2 + i) 165 + 280i
= = = 33 + 56i
2−i (2 − i)(2 + i) 5
So 2−i does divide 122+79i . In fact, we can expect that (2−i)3 will divide 122+79i ,
and it can be checked that it does. In a similar way one can check whether 3 + 2i or
3 − 2i divides 122 + 79i , and one finds that it is 3 − 2i that divides 122 + 79i , and
in fact (3 − 2i)2 divides 122 + 79i . After these calculations one might expect that
122 + 79i was the product (2 − i)3 (3 − 2i)2 , but upon multiplying this product out
one finds that it is the negative of 122 + 79i , so
The factor −1 is a unit, so it could be combined with one of the other factors, for
example changing one of the factors 2 − i to i − 2 . Alternatively, we could replace the
factor −1 by i2 and then multiply each 3−2i factor by i to get the prime factorization
The method in this example for computing prime factorizations in Z[i] depended
on unique factorization. When unique factorization fails, things are more compli-
√
cated. One of the simplest instances of this is in Z[ −5] where we have the factor-
izations
p p
6 = (2)(3) = (1 + −5)(1 − −5)
√
The only units in Z[ −5] are ±1 , so these two factorizations do not differ just by
√ √
units. We can see that 2 , 3 , and 1 ± −5 are prime in Z[ −5] by looking at norms.
√ √
Using the formula N(x+y −5) = x 2 +5y 2 we see that the norms of 2 , 3 , and 1± −5
√
are 4 , 9 , and 6 , so if one of 2 , 3 , or 1± −5 was not a prime, it would have a factor of
norm 2 or 3 since these are the only numbers that occur in nontrivial factorizations
of 4 , 9 , and 6 in Z . However, the equations x 2 +5y 2 = 2 and x 2 +5y 2 = 3 obviously
√
have no integer solutions so there are no elements of Z[ −5] of norm 2 or 3 . Thus
√
in Z[ −5] the number 6 has two prime factorizations that do not differ just by units.
This example can be explained by the fact that x 2 + 5y 2 is not the only quadratic
form of discriminant −20 , up to equivalence. Another form of the same discriminant
is 2x 2 + 2xy + 3y 2 , and this form takes on the values 2 and 3 that the form x 2 + 5y 2
omits, even though x 2 +5y 2 does take on the value 6 = 2·3 . Here are the topographs
of these two forms, with prime values circled.
√ √
The appearance of 6 in the topograph of x 2 + 5y 2 = (x + y −5)(x − y −5) when
√ √
x/ = 1/ gives the factorization 6 = (1 + −5)(1 − −5) .
y 1
The boxed nonprime numbers in the topograph of x 2 + 5y 2 give rise to other
√ √
nonunique prime factorizations. For example 14 = (2)(7) = (3 + −5)(3 − −5)
262 Chapter 8 — Quadratic Fields
where the second factorization comes from the appearance of 14 in the topograph of
x 2 + 5y 2 when x/y = 3/1 . As with the earlier factorizations of 6 , the nonappearance
√
of 2 and 7 in the topograph of x 2 + 5y 2 implies that 2 , 7 , and 3 ± −5 are prime in
√
Z[ −5] . Some numbers in the topograph of x 2 + 5y 2 occur in boxes twice, leading
√
to three different prime factorizations. Thus 21 factors into primes in Z[ −5] as
√ √ √ √
3·7 , as (1 + 2 −5)(1 − 2 −5) and as (4 + −5)(4 − −5) . Another example is
√ √ √ √
69 = 3·23 = (7 + 2 −5)(7 − 2 −5) = (8 + −5)(8 − −5) .
The numbers that appear in the topograph of the second form 2x 2 +2xy+3y 2 are
√
not the norms of elements of Z[ −5] but one might imagine that they are the norms
of “ideal numbers” of some sort. Thus 2 might be the norm of an ideal number P , so
2 = P P , and 3 might be the norm of an ideal number Q , so 3 = QQ . The product
P Q would then have norm (P Q)(P Q) = (P P )(QQ) = 2·3 = 6 , so it is possible that
√
P Q = 1 + −5 . If this is true, it would explain very nicely the two factorizations of 6
√ √
as 2·3 = (P P )(QQ) and as (1 + −5)(1 − −5) = (P Q)(P Q) .
One can also see how some numbers might have three different prime factoriza-
tions. For example for 21 = 3·7 if we have 3 = P P and 7 = QQ then there are three
ways to group these four ideal numbers into pairs, as (P P )(QQ) , as (P Q)(P Q) , and
as (P Q)(P Q) , and these three groupings could give the three factorizations of 21 .
The reason there are only two factorizations for 2·3 and 2·7 is that in the factoriza-
tion 2 = P P the two factors P and P happen to be equal, so there is no difference
between (P Q)(P Q) and (P Q)(P Q) .
Much of this chapter will be devoted to making sense of these “ideal numbers”.
They will be realized not by actual numbers but by certain sets of numbers in R∆
called simply “ideals”. These ideals behave like actual numbers in some respects.
Most importantly they can be multiplied and they have norms which are ordinary
integers, behaving much like norms of elements of R∆ . On the other hand there is
no method for adding ideals that behaves like addition of numbers, so ideals are not
entirely like numbers, but this will not matter for studying prime factorizations where
multiplication is what one is interested in.
There is a natural notion of what a prime ideal is, and the big theorem about
ideals in R∆ is that they have unique factorizations into prime ideals when ∆ is a
fundamental discriminant. This gives information about prime factorizations of ele-
ments of R∆ because each element of R∆ gives rise to a special kind of ideal called
a principal ideal. For some discriminants all ideals are principal ideals, and for these
discriminants the unique prime factorization of ideals translates into unique prime
factorization of elements of R∆ .
In the remainder of this section and continuing in the next section we will go
further into prime factorizations of elements of R∆ before beginning the study of
ideals in Section 8.3.
Section 8.1 — Prime Factorization 263
In statement (a) note that when ∆ < 0 the norm only takes positive values, so if a
positive prime p factors in R∆ it must factor as p = αα , never as −αα . However for
√
∆ > 0 this need not be the case. For example for Z[ 3] the topograph of x 2 − 3y 2
shown in Section 4.1 contains the value −2 but not 2 , so the prime 2 factors as
√ √ √
−(1 + 3)(1 − 3) in Z[ 3] but not as αα .
Proof: For part (a), if p = ±N(α) , then p factors in R∆ as p = ±αα = ±N(α) . The
two factors are prime since their norm is ±p which is prime in Z by assumption.
For (b), if p is not a prime in R∆ then it factors in R∆ as p = αβ with neither
α nor β a unit. Then N(p) = p 2 = N(α)N(β) with neither N(α) nor N(β) equal to
±1 , hence we must have N(α) = N(β) = ±p . The equation N(α) = ±p says that the
norm form represents ±p . Thus if the norm form represents neither p nor −p then
p must be prime in R∆ . ⊓
⊔
Proposition 8.8. If R∆ has unique factorization into primes then the only primes
in R∆ are the primes described in (a) or (b) of the preceding proposition, or units
times these primes.
This can be false without unique prime factorization since the primes in R∆ ob-
tained by factoring a prime integer p have norm dividing N(p) = p 2 , but we have
√ √
seen for example that 1 + −5 is prime in Z[ −5] and has norm 6 .
There are two qualitatively different ways in which a prime p in Z can factor as
the product of two primes in R∆ , depending on whether the two primes in R∆ differ
by just a unit, or equivalently, whether p is a unit times the square of an element of
R∆ . For example in Z[i] we have 2 = (1 + i)(1 − i) and the two factors 1 + i and 1 − i
differ only by a unit since −i(1 + i) = 1 − i . Thus 2 = ε(1 + i)2 for the unit ε = −i .
In fact 2 is the only prime that can be factored in Z[i] as p = ε(a + bi)2 for some
unit ε . The units in Z[i] are ±1 and ±i so the only possibilities are p = ±(a + bi)2
and p = ±i(a + bi)2 . In the first case p = ±(a + bi)2 = ±(a2 − b2 + 2abi) so 2ab = 0
hence either a or b is 0 , but that would say p = ±a2 or p = ±b2 which is impossible
since p is prime. The other case is p = ±i(a + bi)2 = ± (a2 − b2 )i − 2ab hence
p = ±2ab so a and b are ±1 and p = 2 .
Exercises
√
1. (a) Show that if α and β are elements of Z[ D] such that α is a unit times β , then
N(α) = ±N(β) .
(b) Either prove or give a counterexample to the following statement: If α and β are
Gaussian integers with N(α) = N(β) then α is a unit times β .
3. There are four different ways to write the number 1105 = 5·13·17 as a sum of two
squares. Find these four ways using the factorization of 1105 into primes in Z[i] .
[Here we are not counting 52 + 22 and 22 + 52 as different ways of expressing 29
as the sum of two squares. Note that an equation n = a2 + b2 is equivalent to an
equation n = (a + bi)(a − bi) . ]
√
4. (a) Find four different units in Z[ 3] that are positive real numbers, and find four
that are negative.
√
(b) Do the same for Z[ 11] .
8. (a) Determine how the number 2 factors into primes in R∆ for ∆ = −3, −4, −7, −8 ,
−11, −12, −15 , and −16 .
(b) Do the same for ∆ = 5, 8 , and 12 .
10. (a) Find a number n that has exactly two different factorizations into primes in
√
Z[ −6] , up to multiplication by units, and find another number that has exactly three
such factorizations.
√
(b) Do the same for Z[ 10] where things are slightly more complicated since there
are many more units.
11. Show that the factorization of a prime p in Z into primes in R∆ is always unique
up to units. (See Propositions 6.16 and 8.4.)
n = p1 p2 · · · pk = q1 q2 · · · ql
Since the property (∗) implies unique factorization, it will not hold in R∆ when
√
R∆ does not have unique factorization. For a concrete example consider Z[ −5] .
√ √
Here we had nonunique prime factorizations 6 = 2·3 = (1 + −5)(1 − −5) . The
√ √
prime 2 thus divides the product (1 + −5)(1 − −5) but it does not divide either
√ √ √
factor 1 ± −5 since (1 ± −5)/2 is not an element of Z[ −5] .
Our task now is to prove the property (∗) without using unique factorization.
As we saw in Chapter 2, an equation ax + by = 1 always has integer solutions (x, y)
whenever a and b are coprime integers. This fact can be used to show that property
(∗) holds in Z . To see how, suppose that a prime p divides a product ab . It will
suffice to show that if p does not divide a then it must divide b . If p does not
divide a , then since p is prime, p and a are coprime. This implies that the equation
px + ay = 1 is solvable with integers x and y . Now multiply this equation by b to
get an equation b = pbx +aby . The number p divides the right side of this equation
since it obviously divides pbx and it divides ab by assumption. Hence p divides b ,
which is what we wanted to show.
The fact that equations ax + by = 1 in Z are solvable whenever a and b are
coprime can be deduced from the Euclidean algorithm in the following way. What the
Euclidean algorithm gives is a method for starting with two positive integers α0 and
Section 8.2 — Unique Factorization via the Euclidean Algorithm 267
p
so we could measure the size of a Gaussian integer α by N(α) . However it is simpler
just to use N(α) without the square root, so this is what we will do.
Thus our goal is to find an equation α0 = β1 α1 + α2 with N(α2 ) < N(α1 ) ,
starting from two given nonzero Gaussian integers α0 and α1 . If we can always do
this, then by repeating the process we can construct a sequence of αi ’s and βi ’s where
the successive αi ’s have smaller and smaller norms. Since these norms are positive
integers, they cannot keep decreasing infinitely often, so eventually the process will
reach an αi of norm 0 , hence this αi will be 0 and the Euclidean algorithm will end
in a finite number of steps, as it should.
The equation α0 = β1 α1 +α2 is saying that when we divide α1 into α0 , we obtain
a quotient β1 and a remainder α2 . What we want is for the remainder α2 to have a
smaller norm than α1 . To get an idea how we can do this let us look instead at the
equivalent equation
α0 α
= β1 + 2
α1 α1
If we were working with ordinary integers, the quotient β1 would be the integer part
of the rational number α0 /α1 and α2 /α1 would be the remaining fractional part. For
Gaussian integers we do something similar, but instead of taking β1 to be the “integer
part” of α0 /α1 we take it to be the closest Gaussian integer to α0 /α1 .
Here is an example with α0 = 12 + 15i and α1 = 5 + 2i . Then
Here in the last step we choose 3 + 2i as β1 because 3 is the closest integer to 90/29
and 2 is the closest integer to 51/29 . Having found a likely candidate for β1 , we can
use the equation α0 = β1 α1 + α2 to find α2 . This equation is
hence α2 = 1−i . Notice that N(1−i) = 2 < N(5+2i) = 29 so we have N(α2 ) < N(α1 )
as we wanted.
In fact choosing β1 as the nearest Gaussian integer to the “Gaussian rational”
α0 /α1 will always lead to an α2 with N(α2 ) < N(α1 ) . This is because if we write the
quotient α2 /α1 in the form x + yi for rational numbers x and y (so in the example
above we have x = 3/29 and y = ---7/29 ) then for β1 to be the closest Gaussian integer
to α0 /α1 means that |x| ≤ 1/2 and |y| ≤ 1/2 , so
α
N 2
= x 2 + y 2 ≤ 1/4 + 1/4 < 1
α1
α α
2 2
and hence N(α2 ) = N · α1 = N N(α1 ) < N(α1 )
α1 α1
This shows that there is a general Euclidean algorithm in Z[i] , hence Z[i] has unique
factorization.
Section 8.2 — Unique Factorization via the Euclidean Algorithm 269
Just as an exercise let us finish carrying out the Euclidean algorithm for α0 =
12 + 15i and α1 = 5 + 2i . The next step is to divide α2 = 1 − i into α1 = 5 + 2i :
5 + 2i (5 + 2i)(1 + i) 3 + 7i 1+i
= = = (1 + 3i) +
1−i (1 − i)(1 + i) 2 2
Notice that the fractions 3/2 and 7/2 are exactly halfway between two consecutive
integers, so instead of choosing 1 + 3i for the closest integer to 3 + 7i/2 we could
equally well have chosen 2 + 3i or 1 + 4i or 2 + 4i . Let us stick with the choice 1 + 3i
and use this to calculate the next αi :
5 + 2i = (1 + 3i)(1 − i) + α3 = (4 + 2i) + α3
hence α3 = 1 . The final step would be simply to write 1 − i = (1 − i)1 + 0 . Thus the
full Euclidean algorithm gives the following equations:
12 + 15i = (3 + 2i)(5 + 2i) + (1 − i)
5 + 2i = (1 + 3i)(1 − i) + 1
1 − i = (1 − i)(1) + 0
In particular, since the last nonzero remainder is 1 , a unit in Z[i] , we deduce that this
is the greatest common divisor of 12 + 15i and 5 + 2i , where “greatest” means “of
greatest norm”. In other words 12 + 15i and 5 + 2i have no common divisors other
than units.
The equations that display the results of carrying out the Euclidean algorithm can
be used to express the last nonzero remainder in terms of the original two numbers:
1 = (5 + 2i) − (1 + 3i)(1 − i)
= (5 + 2i) − (1 + 3i)[(12 + 15i) − (3 + 2i)(5 + 2i)]
= −(1 + 3i)(12 + 15i) + (−2 + 11i)(5 + 2i)
If it had happened that the last nonzero remainder was a unit other than 1 , we could
have expressed this unit in terms of the original two Gaussian integers, and then
multiplied the equation by the inverse of the unit to get an expression for 1 in terms
of the original two Gaussian integers.
Having shown that prime factorizations in Z[i] are unique, let us see what this
implies about the representation problem for the norm form x 2 + y 2 . The equation
x 2 +y 2 = n can be written as (x+yi)(x−yi) = n . If the prime factorization of x+yi
in Z[i] is x + yi = α1 · · · αl and the prime factorization of n in Z is n = p1 · · · pm
then the equation x 2 + y 2 = n becomes α1 α1 · · · αl αl = p1 · · · pm . A prime p
in Z either splits as a product αα of two primes in Z[i] or remains prime in Z[i] .
Unique prime factorization means that, up to units, the factorization n = α1 · · · αl
is obtained from the factorization n = p1 · · · pm by replacing each pk that splits by
a product αj αj . Each prime pk that does not split will be equal to some αj or αj ,
but in this case both factors αj and αj are integers so they are equal. This means
270 Chapter 8 — Quadratic Fields
that the two factors αj and αj give two factors of the product p1 · · · pm that are
the same nonsplit prime. Thus nonsplit primes must occur to an even power in n .
Conversely if the nonsplit prime factors of n occur only to even powers then we
obtain a factorization n = α1 α1 · · · αl αl and hence a solution of x 2 + y 2 = n with
x + yi = α1 · · · αl .
Thus we see that the equation x 2 + y 2 = n has an integer solution (x, y) exactly
when each nonsplit prime factor p of n occurs with an even exponent in n . The split
primes are the primes represented by x 2 + y 2 , so these are 2 and primes p = 4k + 1
as we saw in Chapter 6. Hence the numbers expressible as the sum of two squares
are the numbers in which each prime factor p = 4k + 3 occurs to an even power. This
agrees with the answer we got in Chapter 6, but the only results from that chapter we
have used here are the fact that all primes p = 4k + 1 are represented by x 2 + y 2 and
the easy facts that 2 is represented but primes p = 4k + 3 are not represented.
Going further, we can also answer the more subtle question of when the equation
x + y 2 = n has a solution with x and y coprime. For x and y not to be coprime
2
means they are both divisible by some prime p , which is the same as saying that
x + yi is divisible by p in Z[i] , or we could equally well say x − yi instead of x + yi .
If a prime factor p of n in Z does not split in Z[i] then p will be prime in Z[i] so in
the factorization n = (x + yi)(x − yi) we will have p as a prime factor of x + yi or
x − yi in Z[i] , so x and y will not be coprime. Thus n must be a product of primes
that split in Z[i] . If one of these primes splits as p = αα then we cannot have both
α and α as two of the factors of x + yi , otherwise p would divide x + yi . Thus if
p appears to the k th power in n , we must have αk as a factor of x + yi and αk as a
factor of x − yi or vice versa, at least when α and α do not differ just by a unit. If α
and α differ just by a unit then we must have k = 1 , otherwise x + yi would have p
as a factor. We noted earlier that 2 is the only prime in Z that splits as a product of
two primes in Z[i] that differ just by a unit, so the final result is that x 2 + y 2 = n has
a solution with x and y coprime exactly when n = 2a p1 · · · pk with each pi a prime
congruent to 1 mod 4 and a ≤ 1 . This too agrees with what we showed in Chapter 6.
An advantage of using Gaussian integers to determine the numbers represented
by x 2 + y 2 is that this gives a way of computing explicitly all the representations of a
given number n . Computing the topograph does this, but the amount of work needed
increases rapidly as n gets larger since one is computing the representations of all
numbers smaller than n at the same time. To illustrate how Gaussian integers speed
things up for specific values of n let us see how to find all the primitive solutions of
x 2 + y 2 = 5k . For k = 1 we have the solution (x, y) = (2, 1) corresponding to the
factorization 5 = (2 + i)(2 − i) , so a primitive solution for arbitrary k is obtained by
expressing (2 + i)k as x + yi . One could use the binomial theorem for this, but this
would involve computing binomial coefficients, so let us instead proceed by induction
on k using the formula (x+yi)(2+i) = (2x−y)+(x+2y)i . This yields the following
Section 8.2 — Unique Factorization via the Euclidean Algorithm 271
(2, 1), (3, 4), (2, 11), (−7, 24), (−38, 41), (−117, 44), (−278, −29), (−527, −336)
The signs are irrelevant for solutions of x 2 +y 2 = 2k but they cannot be ignored when
computing with the inductive formula. For each k there are exactly eight primitive
solutions, corresponding to (2 + i)k and (2 − i)k along with multiples of these by
each of the four units ±1, ±i . In terms of x and y these are the groups (±x, ±y)
and (±y, ±x) . In the topograph of x 2 + y 2 the value 2k will appear just once in each
quadrant since each pair of solutions (x, y) and (−x, −y) determines the same frac-
tion x/y . This was guaranteed to happen by Proposition 6.16 which states that any
two occurrences of the same prime power in a topograph are related by a symmetry
of the topograph, for primes not dividing the conductor, and the conductor here is 1 .
For negative discriminants it is not difficult to figure out exactly when R∆ has a
Euclidean algorithm. Recall that this means that for each pair of nonzero elements
α0 and α1 in R∆ there should exist elements β and α2 such that α0 = βα1 + α2
and N(α2 ) < N(α1 ) . Since α2 is determined by α0 , α1 , and β , this is equivalent to
saying that there should exist an element β in R∆ such that N(α0 − βα1 ) < N(α1 ) .
The last inequality can be rewritten as N α 0 /α 1 − β < 1 . Geometrically this is saying
that every point α 0 /α 1 in the plane should be within a distance less than 1 of some
point β in the lattice R∆ . We can check this by seeing whether the interiors of all the
circles of radius 1 centered at points of R∆ completely cover the plane.
√
For Z[ D] with D < 0 the critical case D = −3 is shown in
the figure at the right, where the triangle is an equilateral trian-
gle of side length 1 . Here the four circles of radius 1 centered
√ √ √
at 0 , 1 , −3 , and 1 + −3 intersect at the point (1 + −3)/2
so this point is not within distance less than 1 of an element of
√ √
Z[ −3] and therefore the Euclidean algorithm fails in Z[ −3] .
√
For D < −3 the lattice Z[ D] is stretched vertically so the Eu-
clidean algorithm fails in these cases too. For D = −2 the lattice is compressed
√
vertically so Z[ −2] does have a Euclidean algorithm.
√
In the case of Z[ω] with ω = (1 + 1 + 4d)/2 and d < 0
p
the upper row of disks is at height |1 + 4d|/2 above the
lower row, so from the figure we see that the condition
√
we
3
need is that this height should be less than 1 + 2 . Thus we
p √
need |1 + 4d| < 2+ 3. Squaring both sides gives |1+4d| <
√
7 + 4 3 which is satisfied only in the cases d = −1, −2, −3 .
Proposition 8.9. The only negative discriminants ∆ for which R∆ has a Euclidean
algorithm are ∆ = −3, −4, −7, −8, −11 .
272 Chapter 8 — Quadratic Fields
√
This proposition says in particular that unique factorization fails in Z[ −3] ,
√ √
Z[ −7] , and Z[ −11] , but when we enlarge these three rings to Z[ω] for ω equal
√ √ √
to (1 + −3)/2 , (1 + −7)/2 , and (1 + −11)/2 we do have unique factorization.
√ √
A similar thing happens when we enlarge Z[ −8] to Z[ −2] . In all these cases the
enlargement replaces a nonfundamental discriminant by one which is fundamental.
√
One might wonder whether there are other ways to enlarge Z[ D] to make prime
√
factorization unique when it is not unique in Z[ D] itself. Without changing things
√
too drastically, suppose we just tried a different choice of ω besides (1+ 1 + 4d)/2 .
In order to do multiplication within the set Z[ω] of numbers x + yω with x and y
integers one must be able to express ω2 as mω + n , so ω must satisfy a quadratic
√
equation ω2 − mω − n = 0 . This has roots (m ± m2 + 4n)/2 , so we see that
larger denominators than 2 in the definition of ω will not work. If m is even, say
√
m = 2k , then ω becomes k ± k2 + n , with no denominators at all and we are
√
back in the situation of Z[ D] . If m is odd, say m = 2k + 1 , then ω becomes
√ √
2k+1± 4k2 + 4k + 1 + 4n /2 which equals k+(1± 1 + 4d)/2 for d = k2 +k+n so
√
the ring Z[ω] in this case would be the same as when we chose ω = (1 + 1 + 4d)/2 .
Section 8.2 — Unique Factorization via the Euclidean Algorithm 273
It is known that there are only nine negative discriminants for which R∆ has
unique factorization, the discriminants
These are exactly the nine negative discriminants for which all quadratic forms of
that discriminant are equivalent. This is not an accident since the usual way one
determines whether unique factorization holds is by proving that unique factorization
holds precisely when all forms of the given discriminant are equivalent, as we will see
later in the chapter. This is for negative discriminants. For positive discriminants the
condition is that all forms are equivalent to either the principal form or its negative.
For positive discriminants the norm form is hyperbolic so it takes on both pos-
itive and negative values. The Euclidean algorithm is then modified so that in the
equations αi−1 = βi αi + αi+1 it is required that |N(αi+1 )| < |N(αi )| . It is known that
there are exactly 16 positive fundamental discriminants for which there is a Euclidean
algorithm in R∆ :
∆ = 5, 8, 12, 13, 17, 21, 24, 28, 29, 33, 37, 41, 44, 57, 73, 76
The determination of this list is quite a bit more difficult than for negative discrimi-
nants since the norm no longer has the nice geometric meaning of the square of the
distance to the origin in the plane.
There are many positive fundamental discriminants for which R∆ has unique
factorization even though there is no Euclidean algorithm. The fundamental discrim-
inants less than 100 with this property are 53, 56, 61, 69, 77, 88, 89, 92, 93, 97 .
√
and are primitive, that is, not an integer multiple of another element of Z[ −7] unless
that integer is ±1 .
√ √
Consider first the case m = 0 . If ωk is an element a + b −7 of Z[ −7] then
the norm equation a2 + 7b2 = 2k implies that a and b have the same parity. If they
√
are both even then ωk would be divisible by 2 in Z[ −7] and hence also divisible
by 2 in Z[ω] , but this is impossible since 2 factors as ωω and ω is not one of the
prime factors of ωk since ω ≠ ±ω . If a and b are both odd then ωk is 2 times an
element of Z[ω] and we have the same contradiction. Thus we must have m > 0 ,
and similarly we must have l > 0 .
If m = 1 then we are considering the product ωk−1 ω which equals 2ωk−2 . This
√ √
is twice an element of Z[ω] so it lies in Z[ −7] and can be written as x + y −7 for
some integers x and y . If x and y are not coprime they are divisible by some prime
p , which must be 2 since odd primes do not divide 2ωk−2 in Z[ω] , as N(2ωk−2 ) = 2k .
This leaves the possibility that x and y are both even. If this is the case then we can
√
cancel a 2 from both sides of the equation 2ωk−2 = x + y −7 to get ωk−2 as an
√
element of Z[ −7] , which is impossible if k ≥ 3 as we saw in the preceding paragraph.
√
Thus we conclude that x +y −7 = 2ωk−2 gives a primitive solution of x 2 +7y 2 = 2k
√
when k ≥ 3 . Similarly if l = 1 we would obtain the conjugate solution x − y −7 ,
just changing the sign of y .
There remains the possibility that both l and m are greater than 1 . In these
√ √
cases ωl ωm would be divisible by 4 , giving an element x + y −7 of Z[ −7] with
x and y even, so we would not get a primitive solution of x 2 + 7y 2 = 2k .
Thus we have shown that there are exactly four primitive solutions of x 2 + 7y 2
for each k ≥ 3 , differing only in the signs of x and y so there is a unique primitive
solution with x and y positive. We can compute this solution by computing 2ωk−2
√
as an element x + y −7 . This can be done inductively using the formula
√ √
√ 1 + −7 (a − 7b) + (a + b) −7
(a + b −7 ) =
2 2
k 3 4 5 6 7 8 9 10
(a, b) (1, 1) (−3, 1) (−5, −1) (1, −3) (11, −1) (9, 5) (−13, 7) (−31, −3)
11 12 13 14 15
(−5, −17) (57, −11) (67, 23) (−47, 45) (−181, −1)
Omitting the minus signs give the positive solutions. However, if we tried to simplify
the calculations by omitting the minus signs at each step this does not work since
for example if we use the solution (3, 1) for k = 4 instead of (−3, 1) in the formula
√
(a − 7b) + (a + b) −7 /2 this produces the nonprimitive solution (−2, 2) for k = 5
instead of (−5, −1) .
Section 8.2 — Unique Factorization via the Euclidean Algorithm 275
This problem has some history. In the early 1900s the number theorist Ra-
manujan observed that the Diophantine equation x 2 + 7 = 2k has solutions for
k = 3, 4, 5, 7, 15 and he conjectured that there were no solutions for larger k . In
terms of the preceding example this is saying that the only solutions of x 2 + 7y 2 = 2k
with y = 1 occur in these five cases, so x = 1, 3, 5, 11, 181 as in the table above.
(Note that a solution with y = 1 must be primitive.) Ramanujan’s conjecture was
later proved in a paper by Skolem, Chowla, and Lewis published in 1959.
For the other application of unique factorization we consider the forms x 2 +18y 2
and 2x 2 + 9y 2 of discriminant −72 . The class number here is 2 and these forms are
in the two classes. The discriminant −72 is not fundamental since −72 = 32 (−8)
with −8 a fundamental discriminant, so the conductor is 3 . This leads us to ask
which powers of 3 are represented by the two forms. Neither form represents 3 and
only the second form represents 9 , but both forms represent 27 , coincidentally when
(x, y) = (3, 1) in both cases.
√
As in the preceding example we will enlarge the ring Z[ −18] , which is R∆ for
√
∆ = −72 , to the corresponding ring Z[ −2] which is R∆ for ∆ = −8 , in order to
√ √
take advantage of the fact that Z[ −2] has unique factorization while Z[ −18] does
√ √ √ √
not. Note that −18 = 3 −2 so Z[ −18] is contained in Z[ −2] as the numbers
√
a + 3b −2 .
√
First we consider the form x 2 + 18y 2 = N(x + 3y −2) so we are looking for
√ √
elements a + 3b −2 of Z −18] of norm 3k with a and b coprime. An element of
√ √ √ √
Z[ −2] of norm 3 is 1 + −2, so (1 + −2)k has norm 3k . However (1 + −2)k
√ √ √
does not lie in Z[ −18] , for suppose (1 + −2)k = a + 3b −2 for some integers a
and b . Taking norms, we would then have 3k = a2 + 18b2 . This implies 3 divides
√ √ √
a , hence 3 divides (1 + −2)k = a + 3b −2 in Z[ −2] , but this is impossible since
√ √ √ √
the prime factorization of 3 in Z[ −2] is (1 + −2)(1 − −2) and 1 − −2 is not a
√
prime factor of (1 + −2)k .
√ √
To get an element of Z[ −18] of norm 3k we now try 3(1 + −2)k−2 which has
√ √
this norm and lies in Z[ −18] since it is 3 times an element of Z[ −2] . Thus we
√ √
can write 3(1 + −2)k−2 = a + b −18 for some integers a and b . To check whether
a and b are coprime we note first that by taking norms we see that the only prime
that could divide a and b is 3 . If 3 does divide a and b we can divide the equation
√ √ √
3(1 + −2)k−2 = a + b −18 by 3 and deduce that (1 + −2)k−2 is an element of
√
Z[ −18] , but we saw in the preceding paragraph that this is not the case if k ≥ 3 .
Thus we have a solution of x 2 + 18y 2 = 3k with coprime integers x and y for each
k ≥ 3.
Now we turn to the form 2x 2 + 9y 2 . The starting point here is the observation
that if we restrict the form x 2 + 18y 2 to pairs (x, y) with x even, then we have
(2x)2 + 18y 2 which is just 2(2x 2 + 9y 2 ) , or twice the form 2x 2 + 9y 2 . Thus we are
√ √
looking for elements 2x + y −18 of Z[ −18] of norm 2·3k with x and y coprime.
276 Chapter 8 — Quadratic Fields
√ √
A reasonable guess might be −2 · 3(1 + −2)k−2 which has norm 2·3k . This lies in
√ √ √
Z[ −18] since it is 3 times an element of Z[ −2] so we can write it as a + b −18 . A
prime dividing a and b must divide the norm 2·3k so must be 2 or 3 . If 2 divided
a and b then 4 would divide the norm so this is impossible. If 3 divides a and
√ √
b then after canceling this 3 we would have −2(1 + −2)k−2 being an element of
√ √
Z[ −18] , but this is impossible by the same argument that showed (1 + −2)k was
√
not in Z[ −18] . Thus a and b are coprime and it remains only to check that a is
even, but this is immediate from the norm equation a2 + 18b2 = 2·3k .
These arguments show that all the powers 3k with k ≥ 3 are represented by both
x 2 + 18y 2 and 2x 2 + 9y 2 . This sort of behavior, with nonequivalent forms of the
same discriminant representing the same prime powers, can only happen for nonfun-
damental discriminants, and then only for powers of primes dividing the conductor,
as we know from Chapter 6.
The trick of realizing 2x 2 + 9y 2 as a multiple of the form obtained by restricting
√
the norm form x 2 + 18y 2 to certain values of x and y in Z[ −18] is in fact part of
a general pattern that will be explored in the next section.
Exercises
√
1. (a) According to Proposition 8.10, unique factorization fails in Z[ D] when D = −3
√
since the number D(D − 1) = 12 has two distinct prime factorizations in Z[ D] . On
√ √
the other hand, when we enlarge Z[ −3] to Z[ω] for ω = (1 + −3)/2 unique
√
factorization is restored. Explain how the two prime factorizations of 12 in Z[ −3]
give rise to the same prime factorization in Z[ω] (up to units).
(b) Do the same thing for the case D = −7 .
√
2. Show that the number 8 has two different prime factorizations in Z[ −7] , one
with three prime factors and the other with two prime factors.
3. In R∆ for ∆ = −3 show that the only primes α for which α is a unit times α are
√ √
−3 and units times −3 .
√ √ √
4. In this problem we consider Z[ −2] , so elements of Z[ −2] are sums x + y −2
√ √ √
for integers x and y , with N(x + y −2) = (x + y −2)(x − y −2) = x 2 + 2y 2 .
(a) Draw the topograph of x 2 + 2y 2 including all values less than 70 (by symmetry, it
suffices to draw just the upper half of the topograph). Circle the values that are prime
(prime in Z , that is). Also label each region with its x/y fraction.
√
(b) Which primes in Z factor in Z[ −2] ?
√
(c) Using the information in part (a), list all primes in Z[ −2] of norm less than 70 .
√ √
(d) Draw a diagram in the xy- plane showing all elements x + y −2 in Z[ −2] of
norm less than 70 as small dots, with larger dots or squares for the elements that are
Section 8.3 — The Correspondence Between Forms and Ideals 277
√
prime in Z[ −2] . (There is symmetry, so the primes in the first quadrant determine
the primes in the other quadrants.)
√ √ √
(e) Show that the only primes x + y −2 in Z[ −2] with x even are ± −2 . (Your
diagram in part (d) should give some evidence that this is true.)
√ √
(f) Factor 4 + −2 into primes in Z[ −2] .
√
(g) Use the unique factorization property in Z[ −2] to determine which numbers are
represented by the form x 2 + 2y 2 , as was done in the text for x 2 + y 2 .
5. Following the two examples at the end of this section, find primitive solutions of
x 2 + 18y 2 = 3k and of 2x 2 + 9y 2 = 3k for k = 3, 4, 5, 6, 7, 8 .
An equivalent equation that will be more convenient for our purposes is obtained by
multiplying both sides by the coefficient a to obtain
√ √
2 2 b + ∆ b− ∆
a(ax + bxy + cy ) = ax + y ax + y
2 2
Notice that now in each of the two linear factors on the right the coefficients of x and
y lie in the ring R∆ since b must have the same parity as ∆ , so if ∆ = 4D we can
√
eliminate the denominator 2 in the coefficient of y to obtain an element of Z[ D]
while if ∆ = 4d+1 the fraction lies in Z[ω] since b is odd. Another
√ thing to observe is
b+ ∆
that the right side of the equation is just the norm N ax + 2 y , so the √
displayed
b+ ∆
equation above can be written more concisely as aQ(x, y) = N ax + 2 √y .
b+ ∆
For a form Q(x, y) = ax 2 + bxy + cy 2 the set of numbers ax + 2 y as x
and y range over all integers forms a lattice contained in the larger lattice R∆ in the
plane. Here we use the term lattice to refer to a set of numbers of the form αx + βy
for fixed nonzero elements α and β of R∆ , with x and y varying over Z , and we
assume that α and β do not lie on the same line through the origin. We denote this
lattice by L(α, β) and call α and β a basis for the lattice.
278 Chapter 8 — Quadratic Fields
√
∆
In particular, associated to the √form Q we have the lattice LQ = L(a, b+2 ) con-
b+ ∆
sisting of all the
numbers
√ +
ax y for integers x and y . The earlier equation
2
b+ ∆
aQ(x, y) = N ax + 2 y then says that the form Q is obtained from the lattice
LQ by taking the norms of all its elements and multiplying by the constant factor 1/a ,
which can be regarded as a sort of normalization constant as we will see in more detail
later.
Let us look at some examples to see what LQ can look like √in the case ∆ = −4 so
b+ ∆
R∆ = Z[i] , the Gaussian integers. In this case we have ax + 2
y = ax + (b′ + i)y
where b′ = b/2 is an integer since b always has the same parity as ∆ . For the principal
form x 2 + y 2 we have a = 1 and b′ = 0 so LQ = L(1, i) = Z[i] . Four more cases are
shown in the figures below.
2x 2 + 2xy + y 2 ←
→ L(2, 1 + i) 5x 2 + 4xy + y 2 ←
→ L(5, 2 + i)
5x 2 + 6xy + 2y 2 ←
→ L(5, 3 + i) 13x 2 + 10xy + 2y 2 ←
→ L(13, 5 + i)
Section 8.3 — The Correspondence Between Forms and Ideals 279
In each case the lattice forms a grid of squares, rotated and expanded from the square
grid formed by Z[i] itself. Not all lattices in Z[i] form square grids since for example
one could have a lattice of long thin rectangles such as L(10, i) .
A 90 degree rotation of the plane about the origin takes a square lattice to itself.
Conversely, a lattice that is taken to itself by a 90 degree rotation about the origin
must be a square lattice. To see this, observe first that the 90 degree rotation takes
the closest lattice point to the origin to another closest lattice point, with the sum
of these two lattice points giving another lattice point that is the fourth vertex of a
square of lattice points. There can be no lattice points in the interior of this square
since such a point would be closer to a corner of the square than the length of the
side of the square, which is impossible since the minimum distance between any two
points in a lattice equals the minimum distance from the origin to a lattice point.
Since 90 degree rotation is the same as multiplication of complex numbers by i ,
we could also say that square lattices are those that are taken to themselves by mul-
tiplication by i . Once a lattice has this property it follows that multiplication by an
arbitrary element of Z[i] takes the lattice into itself. Namely, if we know that iα is
in a lattice L whenever α is in L , then for arbitrary integers m and n it follows that
mα and niα are in L and hence also (m + ni)α is in L .
√ √ √
eb+∆+(e+b) ∆ b+ ∆
which we can rewrite as 4 = ax + 2 y. From the coefficients of ∆ we
get y = e+b
2 which is an integer since e and b have the same parity. Then the equation
eb+∆ eb+b2
becomes 4 = ax + 4 which simplifies to ∆ = 4ax + b2 . Since ∆ = b2 − 4ac
we have the integer solution x = −c . ⊓
⊔
We saw in the case of Z[i] that all ideals are square lattices, so they are obtained
from Z[i] by rotation about the origin and expansion. There are a few other negative
discriminants where the same thing happens and all ideals differ only by rotation
and rescaling, either expansion or contraction. One example is when ∆ = −8 so we
√
have R∆ = Z[ −2] which forms a rectangular lattice with rectangles of side lengths 1
√ √
and 2. For an arbitrary ideal L in Z[ −2] let α be a nonzero point in L closest to the
√
origin. Since L is an ideal, the product −2 α must also be in L . Since multiplication
√
by −2 rotates the plane by 90 degrees and expands
√
it by a factor of 2, the set of all linear combinations
√
αx + −2 αy for integers x and y forms a rectangular
√
sublattice L′ of L obtained from Z[ −2] by rotation
and expansion. Since we chose α as the closest point
of L to the origin, say of distance A to the origin, there
can be no points of L within a distance less than A of
any point of L′ . In other words, if one takes the union of
the interiors of all disks of radius A centered at points
of L′ , this union intersects L just in L′ . However, this union is the whole plane
√
since the ratio of the side lengths of the rectangles of L′ is 2. Thus L equals the
rectangular lattice L′ .
√
This is essentially the same geometric argument we used to show that Z[ −2]
has a Euclidean algorithm. There were five negative discriminants ∆ for which R∆
has a Euclidean algorithm, ∆ = −3, −4, −7, −8, −11 . The argument in the preceding
paragraph shows that in each of these cases all ideals in R∆ are equivalent under
rotation and rescaling. In the case ∆ = −3 the Eisenstein integers Z[ω] form a grid
of equilateral triangles so all ideals are also grids of equilateral triangles that are
taken to themselves by multiplication by ω , rotating the plane by 60 degrees. Two
examples are shown below.
3x 2 + 3xy + y 2 ←
→ L(3, 1 + ω) 7x 2 + 5xy + y 2 ←
→ L(7, 2 + ω)
Section 8.3 — The Correspondence Between Forms and Ideals 281
For ∆ = −7 and −11 the lattice R∆ = Z[ω] for ∆ = −3 is stretched vertically to form
a grid of isosceles triangles and all ideals are also grids of isosceles triangles, rotated
and rescaled from the triangles in R∆ .
We have been using the fact that multiplication by a fixed nonzero complex
number α always has the effect of rotating and rescaling the plane, keeping the origin
fixed. Since multiplication by α sends 1 to α , the rescaling factor is the distance from
α to the origin and the angle of rotation is the angle between the positive x- axis and
the ray from the origin to α . Since α can be any nonzero complex number, every
rotation and rescaling is realizable as multiplication by a suitably chosen α .
Let us look at some examples of discriminants where not all forms are equivalent
to see whether there is more variety in the shapes of the lattices LQ , so they are
not all obtained from R∆ by rotation and rescaling. The examples will all be for
negative discriminants since this is the case that the norm of an element of R∆ has
the geometric interpretation as the square of the distance to the origin, but when we
make general statements about lattices these will apply to both positive and negative
discriminants.
√
For a first example consider the lattices LQ in Z[ −6] for the two non-equivalent
forms x 2 + 6y 2 and 2x 2 + 3y 2 of discriminant −24 .
√ √
x 2 + 6y 2 ←
→ L(1, −6) 2x 2 + 3y 2 ←
→ L(2, −6)
The two lattices do not appear to differ just by rotation and rescaling, and we can verify
this by computing the ratio of the distances from the origin to the closest lattice point
and to the next-closest lattice point on a different line through the origin. For the
√ √ √
lattice Z[ −6] this ratio is 1/ 6 while for the other lattice it is 2/ 6 . If the lattices
differed only by rotation and rescaling the ratios would be the same.
Instead of measuring the distances from the origin to a nearby lattice point we
could measure the square of the distance, which is the norm of the lattice point. For
the forms shown above we would then get the ratios 1/6 and 4/6 = 2/3 . It is no accident
that these are the ratios between the coefficients of x 2 and y 2 in the two forms since
these coefficients give the two smallest values of the forms, which occur on either side
of the source edge in their topographs. The norms of points in √the lattice are related
b+ ∆
to the values of the form by the formula aQ(x, y) = N(ax + 2 y) , so the smallest
norms correspond to the smallest values of the form, with the scaling factor a in the
282 Chapter 8 — Quadratic Fields
left side of the formula accounting for the fact that the fraction 4/6 reduces to 2/3 by
dividing numerator and denominator by a = 2 .
√
As another example, consider the lattices LQ in Z[ −5] for the non-equivalent
forms x 2 + 5y 2 and 2x 2 + 2xy + 3y 2 of discriminant −20 .
√ √
x 2 + 5y 2 ←
→ L(1, −5) 2x 2 + 2xy + 3y 2 ←
→ L(2, 1 + −5)
It is clear visually that the two lattices are not related just by rotation and rescaling
since the first lattice is rectangular while the second is not, and we can verify this by
computing the ratios of the norms of the two closest lattice points to the origin lying on
different lines through the origin. For the first lattice the ratio is 1/5 corresponding to
the topograph having a source edge with adjacent labels 1 and 5 , as in the preceding
√
example. For the second lattice the points closest to the origin are ±2 and ±1 ± −5
with norms 4 and 6 , giving a ratio 4/6 which reduces to 2/3 via the rescaling factor
a = 2 . The topograph of the second form has a source vertex surrounded by the
labels 2, 3, 3 for x/y = 1/0 , 0/1 , and ---1/1 . The two 3 ’s correspond to the two equal
sides of the isosceles triangles in the figure, of norm 6 which rescales to 3
√
A slightly more complicated example is Z[ −14] with ∆ = −56 where there are
four proper equivalence classes of forms:
√ √
x 2 + 14y 2 ←
→ L(1, −14) 2x 2 + 7y 2 ←
→ L(2, −14)
√ √
3x 2 + 2xy + 5y 2 ←
→ L(3, 1 + −14) 3x 2 − 2xy + 5y 2 ←
→ L(3, −1 + −14)
Section 8.3 — The Correspondence Between Forms and Ideals 283
For the first two forms the ratios of smallest norms are 1/14 and 4/14 = 2/7 . For the
second two forms the norms of the three sides of the triangles are 9 , 15 , and 18 so
the ratio for the smaller two norms is 9/15 = 3/5 . The second two forms are equivalent
but not properly equivalent since their topographs have a source vertex surrounded
by the three distinct numbers 3 , 5 , and 6 , the rescalings of the norms 9 , 15 , and 18 .
The topographs of these two forms are mirror images obtained by changing the sign
of x or y , thus changing the sign of the coefficient of the middle term xy in the
form. The corresponding lattices are also mirror images obtained by reflecting across
either the x- axis or the y- axis, which also amounts to changing the sign of x or y .
These two lattices are not equivalent under rotation and rescaling, so none of the four
lattices in this example are equivalent by rotation and rescaling.
Recall that the three values of an elliptic form surrounding a source vertex satisfy
the triangle inequalities, so each value is less than or equal to the sum of the other two.
This means that for the triangles in the lattices the square of each side length is less
than or equal to the sum of the squares of the other two side lengths. Comparing these
inequalities with the Pythagorean theorem, this is just saying that the triangles are
acute triangles, unless the square of one side is actually equal to the sum of the squares
of the other two sides in which case it is a right triangle. This only happens when there
is a source edge instead of a source vertex. In this case the grid is rectangular, with
each rectangle subdivided into two right triangles by either of its diagonals, but there
is no reason to choose one diagonal rather than the other so it seems best to ignore
the diagonals and just draw the rectangles.
√ √
As we noted above, the two lattices L(3, 1 + −14) and L(3, −1 + −14) in
√
Z[ −14] are mirror images of each other under reflection across either the x- axis
or the y- axis. Reflecting a lattice across the y- axis gives the same result as reflecting
across the x- axis since lattices always have 180 degree rotational symmetry about
the origin. Reflecting a lattice across the x- axis amounts to taking the conjugates
of all elements of the lattice, so the reflection of a lattice L = L(α, β) is the lattice
L = L(α, β) called the conjugate lattice. If L is an ideal it is easy to check that L is
also an ideal, so in this case L is
√
the conjugate
√
ideal of L . For lattices coming √from
b+ ∆ b− ∆ −b+ ∆
forms, the conjugate of L(a, 2 ) is L(a, 2 ) which is the same as L(a, 2 ).
A lattice is equal to its conjugate exactly when it is symmetric with respect to
√
reflection across the coordinate axes. In the example of lattices in Z[ −14] the first
two lattices have this symmetry property while the second two do not.
√
∆
Proposition 8.12. A lattice L(a, b+2 ) is equal to√its conjugate if and only if b ≡ 0
∆
mod a . These are the √rectangular lattices L(a, 2 ) with b = 0 and the isosceles
triangle lattices L(a, a+2 ∆ ) with b = a .
√
b+ ∆
Proof:√ Consider the points of a lattice L(a, 2 ) that are in the same horizontal row
b+ ∆
as 2 . These points are equally spaced along this row at distance |a| apart. The
284 Chapter 8 — Quadratic Fields
lattice equals its conjugate exactly when reflection across the y- axis takes this
√
set
∆
of points to itself,
√
so the only possibilities are that the set contains the point
√ 2 or
a+ ∆ ∆
it contains 2 . Hence the lattice
√
is either the rectangular lattice L(a, 2 √) or the
∆
isosceles triangle lattice L(a, a+2 ) . In both cases
√
these are lattices L(a, b+2 ∆ ) with
∆
lattice L(a, b+2
b ≡ 0 mod a , and conversely any √ ) with b ≡ 0 mod a is equal to one
b+ ∆
these two lattices since L(a,
of √ 2 ) is unchanged when multiples of a are added to
b+ ∆
2 , thus adding multiples of 2a to b . ⊓
⊔
√ √
∆ ∆
The two types of self-conjugate lattices L(a, 2 ) and L(a, a+2 ) correspond to
2 2 2 2
the forms ax + cy and ax + axy + cy whose topographs have mirror symme-
try. As we saw in Proposition 5.6, all forms with mirror symmetric topographs are
equivalent to forms of these two types.
√
b+ ∆
In general, most ideals L(a, 2 ) are not self-conjugate. For example in the
Gaussian integers Z[i] all ideals are square lattices rotated and expanded from the
full lattice Z[i] , but the only ones that are vertically and horizontally symmetric are
the ones where the angle of rotation is a multiple of 45 degrees, so these are the
lattices Z[i] and L(2, 1 + i) or rescalings of these.
The examples we have seen so far lead one to ask how exact a correspondence
there is between proper equivalence classes of forms of a given discriminant ∆ and
the shapes of lattices that are ideals in R∆ , where two lattices that differ only by
rotation and rescaling are regarded as having the same shape. The main theorem
in this section will be that this is an exact one-to-one correspondence for negative
discriminants, while for positive discriminants there is an analogous one-to-one cor-
respondence using a more algebraic analog of “shape” for lattices that works for both
positive and negative discriminants.
Before getting to the main theorem we will first explain a few general facts
√
about
√ 1+ ∆
lattices in R∆ . Let us write R∆ as Z[τ] for τ = D when ∆ = 4D and τ = 2 when
∆ = 4d + 1 . Let L be a lattice in Z[τ] . Since L is not entirely contained in the x- axis
there exist elements m + nτ in L with n > 0 . Choose such an element α = m + nτ
with minimum positive n , so α lies in the nth row of Z[τ] and there are no elements
of L in any row between the 0th and the nth rows. Since L is a lattice all elements of
L must then lie in rows numbered an integer multiple of n . In particular the element
kα lies in the knth row for each integer k . These elements kα lie on a line through
the origin, and L must also contain elements not on this line, so some knth row must
contain another element β of L besides kα . The difference β − kα then lies in the
x- axis and is a nonzero integer in L . Choosing a minimal positive integer p in L , the
lattice property of L implies that the integers in L are precisely the integer multiples
of p . It follows that L contains the lattice L(p, α) = L(p, m + nτ) , and in fact L is
equal to L(p, m + nτ) otherwise either p or n would not be minimal. We are free to
Section 8.3 — The Correspondence Between Forms and Ideals 285
(1) Replace one αi with αi + kαj , adding an integer k times the other basis el-
ement αj to αi . Geometrically this changes the parallelogram with vertices
0, α1 , α2 , α1 + α2 to a parallelogram with one side the same, the side from 0
to αj , but the opposite side with ends αi and αi + αj is translated along the line
containing it.
(2) Replace one αi by −αi .
(3) Interchange α1 and α2 .
translates of L , including L itself, that are needed to completely cover all points of
the larger lattice Z[τ] . For example if a, b + cτ is a reduced basis for L one can
first translate L horizontally by the numbers 0, 1, · · · , a − 1 to cover all of the x- axis
and all rows of Z[τ] containing points of L . Then c translates of these rows in the
direction of τ will cover Z[τ] for a total of ac translates of L to cover Z[τ] .
For a lattice L in Z[τ] the number of translates of L needed to cover all of Z[τ]
is called the norm of L and written N(L) . Any two translates of L are either disjoint
or coincide exactly, so there is a unique set of translates of L covering Z[τ] . Thus
there is no ambiguity in the value of N(L) . As the reader can see by looking at the
various lattices we have pictured earlier in this section, the norm of a lattice measures
how “large” or “spread out” the lattice is compared with Z[τ] .
Another way to interpret the norm is in terms of areas. For a basis α, β for a
lattice L consider the parallelogram Pα,β with vertices 0 , α , β , and α + β .
Proposition 8.13. For a lattice L in Z[τ] with basis α, β the area of the parallel-
ogram Pα,β is independent of the choice of the basis α, β . The ratio of this area
to the corresponding area for any basis parallelogram for the full lattice Z[τ] is
equal to the norm N(L) .
Proof: The operations (1)–(3) on bases do not change the area of basis parallelograms,
so every basis parallelogram for L has area equal to the area of Pa,b+cτ for the reduced
basis a, b + cτ for L . To prove the statement about the ratio of areas, note that the
area of Pa,b+cτ does not depend on b so we can assume that b = 0 . The parallelogram
Pa,cτ decomposes as ac nonoverlapping copies of the parallelogram P1,τ for Z[τ] ,
so the ratio of the areas is ac , which is the norm of the lattice L = L(a, b + cτ) . ⊓
⊔
The absolute value is needed when ∆ > 0 since norms of lattices are always
positive but N(γ) can be negative when ∆ > 0 . When ∆ < 0 the formula is just
N(γL) = N(γ)N(L) and can be seen geometrically since multiplication by γ rescales
p
by the distance from γ to the origin which is N(γ) so the areas of parallelograms
are multiplied by N(γ) , the square of the rescaling factor.
Proof: This is a calculation with determinants that will be easier if we regard Z[τ] as
√ √ √ √
a subset of Q( ∆) . Let γ = p + q ∆ and let α = a + b ∆ and β = c + d ∆ where
p, q, a, b, c, d are rational numbers. Multiplication by γ is a linear transformation of
√
Q( ∆) ,
√ √ √
(p + q ∆)(x + y ∆) = (px + q∆y) + (qx + py) ∆
p q∆
The matrix of this transformation
q p . Thus γα and γβ correspond to the
is
p q∆ a c
columns of the product q p b d . The absolute value of the determinant of this
product is therefore N(γL) . This equals the product of the absolute values of the
determinants of the two individual matrices, which is |N(γ)| N(L) since the determi-
nant of the first matrix in the product is p 2 − ∆q2 = N(γ) and the absolute value of
the determinant of the second matrix in the product is N(L) . ⊓
⊔
usual notation for this ideal is simply (γ) although this notation can sometimes be
a little confusing since parentheses are also used in formulas for multiplication of
elements. For example in the previous paragraph we had an equality β(γα) = γ(βα)
in which these were just elements of R∆ , not ideals. However, this equation remains
valid when (γα) and (βα) are regarded as ideals since it is always true for principal
ideals that δ(ε) = (δε) so the equation of ideals β(γα) = γ(βα) can be written as
(βγα) = (γβα) which holds since βγ = γβ .
Since N(R∆ ) = 1 the preceding proposition gives a simple relationship between
the norm of an element and the norm of the ideal it generates:
Corollary 8.15. N (α) = |N(α)| for each nonzero element α in R∆ . ⊓
⊔
For negative discriminants, principal ideals (α) = αR∆ have the same shape as
the full lattice R∆ . Conversely if an ideal L in R∆ has the same shape as R∆ this
means that L = αR∆ for some complex number α , and α has to lie in R∆ and in
fact in L since α is the element α·1 in αR∆ = L . As the examples earlier in this
section show, for some negative discriminants such as −3, −4, −7, −8 , and −11 all
ideals have the same shape and hence all ideals are principal ideals, while for other
negative discriminants there can exist nonprincipal ideals since not all ideals have the
same shape as the principal ideals.
√
∆
We have been focusing on the ideals LQ = L(a, b+2 ) associated to quadratic
2 2
forms Q(x, y) = ax + bxy + cy of discriminant ∆ , and it is natural to ask whether
every ideal in R∆ is equal to LQ for some form Q of discriminant
√
∆ . One way to see
b+ ∆
that this is not true is to observe that the √lattices LQ = L(a, 2 ) have the special
b+ ∆
property that they contain an element 2 lying in the first row of the lattice R∆
above the x- axis, but this is not the case for all ideals since we can expand an ideal
LQ by a positive integer factor n to get a new ideal nLQ which has no elements in
the first row of R∆ above the x- axis if n > 1 . However, nothing more complicated
than this can happen:
Proposition 8.16. Every ideal in R∆ is equal to nLQ for some positive integer n
and some form Q(x, y) = ax 2 + bxy + cy 2 of discriminant ∆ with a > 0 .
Since an ideal LQ has an element in the first row of R∆ above the x- axis it cannot
be a multiple nL of any other ideal L with n > 1 . We call an ideal with this property
a primitive ideal, in analogy with the definition of a primitive form. The proposition
says that all ideals are positive integer multiples of primitive ideals, and the primitive
ideals are just the ideals LQ coming from forms.
Since the norms of arbitrary ideals are just squares times the norms of primitive
ideals, it follows that the norms of all ideals are just the positive values of all forms
of the given discriminant.
√
Let us look at an example, the case ∆ = −24 with R∆ = Z[ −6] . Here the class
number is 2 corresponding to the forms x 2 + 6y 2 and 2x 2 + 3y 2 with topographs
shown below.
norm 35 . In the upper half of the second topograph the two regions labeled 35 give
√ √
the ideals L(35, 8 + −6) and L(35, 13 + −6) and in the lower half of the topograph
√ √
we have their conjugates L(35, 27 + −6) and L(35, 22 + −6) .
The ideals corresponding to regions in the first topograph are principal ideals
√
since the form here is the norm form N(x + y −6) = x 2 + 6y 2 . For example the
√
label 25 in the upper right is the norm of the ideal L(25, 13 + −6) , from the edge
labeled 26 , and similarly the label 25 in the lower right is the norm of the ideal
√
L(25, 12 + −6) . These two regions correspond to the fractions x/y = ±1/2 so 25 is
√ √ √
the norm of 1+2 −6 and 1−2 −6 , hence also of the principal ideals (1+2 −6) and
√
(1 + 2 −6) . The principal ideal (5) has norm 25 as well but is not a primitive ideal.
√ √
The ideal L(25, 13 + −6) , being primitive, must therefore be either (1 + 2 −6) or
√
(1 − 2 −6) . To decide which, we need to determine which of the two principal ideals
√ √ √
contains 25 and 13 + −6 . They both contain 25 since 25 = (1 + 2 −6)(1 − 2 −6)
√ √ √
so we need to determine whether 13 + −6 is a multiple of 1 + 2 −6 or of 1 − 2 −6
√
by an element of Z[ −6] . This is done by computing the relevant quotients:
√ √ √ √
13 + −6 13 + −6 1 − 2 −6 25 − 25 −6 p
√ = √ · √ = = 1 − −6
1 + 2 −6 1 + 2 −6 1 − 2 −6 25
√ √ √ √
13 + −6 13 + −6 1 + 2 −6 1 + 27 −6
√ = √ · √ =
1 − 2 −6 1 − 2 −6 1 + 2 −6 25
√ √
This last quotient is not in Z[ −6] so we conclude that L(25, 13+ −6) is the principal
√ √ √
ideal (1 + 2 −6) . Taking conjugates gives L(25, 12 + −6) = (1 − 2 −6) .
For most negative discriminants the same one-to-one correspondence holds be-
tween primitive ideals and regions in the topographs for that discriminant, where for
topographs without mirror symmetry we should take both the topograph itself and its
mirror image topograph. The only exceptional negative discriminants are ∆ = −3 and
∆ = −4 , the two cases when the topographs have orientation-preserving symmetries.
In these cases the regions that correspond to each other under orientation-preserving
symmetries correspond to a single primitive ideal. For positive discriminants the sit-
uation is very similar, the only differences being that one only considers regions in
the topographs with positive labels, and then the primitive ideals correspond to re-
gions within one period of the periodic topograph since the orientation-preserving
symmetries are just the translations along the periodic separator line.
Proposition 8.18. (a) The ideals in R∆ of prime norm p with p odd are:
√ √
— For ∆ = 4d , the ideal L(p, B + d) and its conjugate L(p, −B + d) , where d ≡ B 2
mod p . √ √
— For ∆ odd, the ideal L(p, B + 1+2 ∆ ) and its conjugate L(p, −B − 1 + 1+2 ∆ ) , where
∆ ≡ (2B + 1)2 mod p .
(b) The ideals in R∆ of norm 2 are:
√
— For ∆ = 4d with d even, the ideal L(2, d) .
√
— For ∆ = 4d with d odd, the ideal√ L(2, 1 + d) . √
— For ∆ = 8k + 1 , the ideal L(2, 1+2 ∆ ) and its conjugate L(2, 1 + 1+2 ∆ ) .
(c) An ideal of prime norm p equals its conjugate if and only if p divides ∆ .
Q(x, y) = N(αx + βy) = (αx + βy)(αx + βy) = ααx 2 + (αβ + αβ)xy + ββy 2
Section 8.3 — The Correspondence Between Forms and Ideals 293
Here the coefficients of x 2 , xy , and y 2 are integers since they are equal to their
conjugates. The form Q depends on the choice of the basis α, β for L . Another basis
α′ , β′ can be expressed as linear combinations α′ = pα + qβ , β′ = r α + sβ with
integer coefficients. Sincethe change
of basis can be reversed, going from α′ , β′ back
pq
to α, β , the 2 × 2 matrix r s has determinant ±1 , and conversely any such matrix
gives a valid change of basis for L . Changing the basis also produces a change of
variables in the form Q(x, y) since N(α′ x + β′ y) = N (pα + qβ)x + (r α + sβ)y =
N
α(px+r
y)+(β(qx+sy) = Q(px+r y, qx+sy) . Here the matrix is the transpose
p r
q s , with the same determinant ±1 . Thus changing the basis for L produces an
equivalent form, and every equivalent form can be realized by some change of basis
for L .
The form N(αx + βy) depends on the ordering for the two basis elements α
and β since reversing their order interchanges x and y , which gives a mirror image
topograph. We can eliminate this ambiguity by always using the positive ordering for
α and β . If we only use positively ordered bases, then the change of basis matri-
ces have determinant +1 since a change of basis transformation takes a positively
ordered basis to a positively ordered basis if and only if its matrix has positive
deter-
a c
minant. This is because changing a basis amounts to replacing its matrix b d by a
p q a c p q
product r s b d with r s the matrix of the change of basis. Thus if we always
use positively ordered bases, the lattice L gives rise to a proper equivalence class of
quadratic forms.
The norm form N(αx + βy) associated to a lattice L = L(α, β) in R∆ might not
have discriminant ∆ . For example, if we replace L by nL = L(nα, nβ) this multiplies
the norm form by n2 and so the discriminant is multiplied by n4 . We can always
rescale a form to have any discriminant we want just by multiplying it by a suitable
positive constant, but this may lead to forms with non-integer coefficients. To illus-
trate this potential difficulty, suppose we take ∆ = −4 so R∆ = Z[i] . The lattice
L(2, i) in Z[i] yields the form N(2x + iy) = 4x 2 + y 2 of discriminant −16 , but to
rescale this to have discriminant −4 we would have to take the form 2x 2 + 21 y 2 .
Fortunately this problem does not occur if we consider only lattices that are ideals.
√
∆
By Proposition 8.16 each ideal L in R∆ is equal to a multiple nLQ = L(na, n b+2 )
2 2
for some form Q(x, y) √= ax + bxy + cy of discriminant ∆ with
√
a > 0 . We have
b+ ∆ ∆
aQ(x, y) = N(ax + 2 y) , hence n
√
2
aQ(x, y) = N(nax + n b+2 y) which is the
b+ ∆
norm form for L in the basis na, n 2 . This basis is positively ordered since a > 0 .
2
By dividing this norm form for L by n a we get a form with integer coefficients
√
and
b+ ∆
discriminant ∆ , namely the form Q . If we change the basis na, n 2 for L to
1
some other positively ordered basis α, β it is still true that the form n2 a N(αx + βy)
has integer coefficients and discriminant ∆ since this just changes Q to a properly
equivalent form.
294 Chapter 8 — Quadratic Fields
√
b+ ∆
Note that the scaling factor n2 a is the norm N(L) of the ideal L = nL(a, 2 ).
Thus we have shown:
Proposition 8.19. For an ideal L in R∆ with positively ordered basis α, β the form
1
N(L) N(αx + βy) has integer coefficients and discriminant ∆ . ⊓
⊔
1
For an ideal L with positively ordered basis α, β the form N(L) N(αx + βy) will
be denoted by QL , although a more precise notation might include α and β since the
form depends on the choice of basis.
Different ideals L in R∆ can give properly equivalent forms QL . Obviously a
rescaling nL of L gives the same form QnL = QL . More generally, suppose we multi-
ply all elements of an ideal L = L(α, β) by a fixed nonzero element γ of R∆ to get a new
ideal γL = L(γα, γβ) . Taking norms, we have N(γαx + γβy) = N(γ)N(αx + βy) ,
so if N(γ) > 0 the new form N(γαx + γβy) is just a rescaling of N(αx + βy) , with
rescaling factor N(γ) . Thus after rescaling to get discriminant ∆ we have QγL = QL
when N(γ) > 0 . Specifically, if we use the formula N(γL) = |N(γ)| N(L) then when
N(γ) > 0 we have
Note that it suffices to consider only the fundamental unit since if this has norm
+1 then all units have norm +1 .
Proof: Suppose there is a unit ε in R∆ with N(ε) = −1 and suppose two ideals L
and M are equivalent via an equality αL = βM . We have αL = εαL so we can arrange
296 Chapter 8 — Quadratic Fields
that N(α) > 0 by replacing α with εα if necessary. Similarly we can arrange that
N(β) > 0 . Thus L and M are strictly equivalent.
For the converse, suppose equivalence is the same as strict equivalence. Since we
assume ∆ > 0 , there exist elements α in R∆ with N(α) < 0 . The ideals R∆ and αR∆
are equivalent so by hypothesis they are strictly equivalent. This means βR∆ = γαR∆
for some elements β and γ in R∆ of positive norm. Since β is in βR∆ = γαR∆ we
have β = γαδ for some δ in R∆ . Also γα is in γαR∆ = βR∆ so γα = βε for some
ε in R∆ . Thus β = γαδ = βεδ and hence 1 = εδ since β ≠ 0 . Thus δ and ε are
units. The equation γα = βε implies that N(ε) < 0 since N(γ) > 0 , N(α) < 0 , and
N(β) > 0 . Since ε is a unit, its norm is then −1 . ⊓
⊔
Theorem 8.21. There is a one-to-one correspondence between the set of strict equiv-
alence classes of ideals in R∆ and the set of proper equivalence classes of quadratic
forms of discriminant ∆ . Under this correspondence an ideal L with a positively
1
ordered basis α, β corresponds to the form QL (x, y) = N(L) N(αx +βy) , and a form
√
b+ ∆
Q(x, y) = ax 2 + bxy + cy 2 with a > 0 corresponds to the ideal LQ = L(a, 2 ).
(When ∆ < 0 we are restricting attention just to forms with positive values, as
usual.)
For example, when all forms of discriminant ∆ are equivalent and hence properly
equivalent the theorem says that all ideals are strictly equivalent. When ∆ < 0 this is
saying that all ideals have the same shape, or equivalently that all ideals are principal
ideals. The negative discriminants for which this happens are −3, −4, −7, −8, −11 ,
−19, −43, −67 , and −163 . For the first five of these we already saw that all ideals
have the same shape using a geometric argument, but that argument does not apply
in the last four cases.
The condition a > 0 in the theorem plays a role only when ∆ > 0 , but its role is
sometimes important.
√
For example the principal form x 2 + bxy + cy 2 corresponds
b+ ∆
to the ideal L(1, 2 ) which equals R∆ since it contains 1 , but without the√condition
∆
a > 0 the negative of the principal form would correspond to L(−1, −b+2 ) which
also equals R∆ since it contains −1 , and for some values of ∆ such as ∆ = 12 the
principal form is not equivalent to its negative.
Proof: Let Φ be the function from the set of strict equivalence classes of ideals to
the set of proper equivalence classes of forms induced by sending an ideal L with a
positively ordered basis α, β to the form Q(x, y) = N(αx + βy)/N(L) . The function
Φ is well defined since we have seen that changing one positively ordered basis for L
to another changes the associated form to a properly equivalent form, and replacing L
with basis α, β by γL with basis γα, γβ leaves the form unchanged when N(γ) > 0 .
To see that Φ is onto note first that in each proper equivalence class of forms
there are forms Q(x, y) = ax 2 + bxy + cy 2 with a > 0 since the topograph of an
Section 8.3 — The Correspondence Between Forms and Ideals 297
L = L(α, β) ≈ nL(α, β) = L(nα, nβ) = L(nα, nαγ) = αL(n, nγ) ≈ L(n, nγ)
To illustrate the theorem consider the case ∆ = 60 where there are four proper
equivalence classes of forms, given by x 2 −15y 2 , 15x 2 −y 2 , 3x 2 −5y 2 , and 5x 2 −3y 2 .
√ √ √ √
The corresponding ideals in R∆ = Z[ 15] are (1, 15) = (1) , (15, 15) = ( 15) ,
√ √
(3, 15) , and (5, 15) . According to the theorem no two of these ideals are strictly
298 Chapter 8 — Quadratic Fields
√ √
equivalent, although the first two are equivalent since ( 15) = 15(1) and the second
√ √ √
two are equivalent since 15(3, 15) = 3(5, 15) . This corresponds to the fact that
the two forms in each pair are negative mirror images of each other, although all four
forms have mirror symmetry so taking mirror images makes no difference.
For another example take ∆ = 136 with class number 4 realized by the forms
x −34y 2 , 34x 2 −y 2 , and 3x 2 ±2xy−11y 2 as we saw in an example in Section 7.4 that
2
The ideal for 2x 2 + 2xy + 2y 2 is a lattice of equilateral triangles, and this lattice has
the special property that it is taken to itself not just by multiplication by elements
√
of R∆ = Z[ −3] but also by the 60 degree rotation given by multiplication by the
√
element ω = (1 + −3)/2 in the larger ring Z[ω] which is R∆ for ∆ = −3 . Hence the
√
lattice L(2, 1 + −3) is taken to itself by all elements of Z[ω] and so this lattice is an
√
ideal in Z[ω] , not just in the original ring Z[ −3] .
More generally, suppose we start with a form Q = ax 2 + bxy + cy 2 of dis-
criminant ∆ and then consider the nonprimitive form kQ = kax 2 + kbxy + kcy 2
of discriminant
√
k2 ∆ for √some integer k > 1 . The associated ideal LkQ is then
kb+k ∆ b+ ∆
L(ka, 2 ) = kL(a, 2 ) = kLQ . This is an ideal not just in Rk2 ∆ but also in
the larger ring R∆ since it is k times an ideal in R∆ , namely k times LQ .
√
Let us say that an element α in Q( ∆) stabilizes an ideal L in R∆ if αL is
Section 8.3 — The Correspondence Between Forms and Ideals 299
contained in L , and let us call the set of all such elements α the stabilizer of L . The
√
stabilizer of L contains R∆ and is a ring itself since if two elements α and β in Q( ∆)
stabilize L then so do α ± β and αβ . If the stabilizer of L is exactly R∆ then we will
say that L is stable.
For example, principal ideals (γ) are stable since if α(γ) is contained in (γ) then
in particular αγ is in (γ) and so we have αγ = βγ for some β in R∆ . Canceling γ ,
we then have α = β so α is an element of R∆ .
For this to be in L(a, τ) means that sc and r + sb are integers. We already know that
r is an integer, so r + sb being an integer is equivalent to sb being an integer. Thus
m
we know that all three of sa , sb , and sc are integers. Let us write s as a fraction n
m
in lowest terms. Then sa = na is an integer, so n must divide a . Similarly sb and
sc being integers implies that n divides b and c . But 1 is the only common divisor
of a , b and c since the form ax 2 + bxy + cy 2 is primitive, so n = 1 . Thus s is an
integer and we are done. ⊓
⊔
Recall that we say two lattices have the same shape if one can be transformed
into the other by rotation and rescaling of the plane. With this definition of shape
one can ask whether it is possible to characterize exactly all the different shapes of
lattices. We will give such a characterization and then see how this relates to forms
of negative discriminant.
First let us get a global picture of all the possible shapes of lattices in the plane.
Given a lattice L , choose a point in L that is closest to the origin, other than the
origin itself. We can rotate L about the origin until this point lies on the positive
x- axis, and then we can rescale L until this point is at distance 1 from the origin,
so it is the point (1, 0) , or in other words the complex number 1 . Now choose a
point α in L closest to the origin among all points of
L above the x- axis. Thus α lies on or outside the unit
circle x 2 + y 2 = 1 . Also, α must lie in the vertical
strip consisting of points x + yi with − 1/2 ≤ x ≤ 1/2 ,
otherwise there would be another point of L inside
this strip that had the same y- coordinate as α and
was closer to the origin than α . This is because all
points of L lie in horizontal rows of points of distance
1 apart. The lattice L(1, α) is contained in L and in
fact must equal L by the way that we chose α . (There are no other points of L above
the x- axis and inside the circle x 2 + y 2 = r 2 passing through α .)
Let R be the region of the plane consisting of the points α as above, that is, all
α = x + yi with x 2 + y 2 ≥ 1 , − 1/2 ≤ x ≤ 1/2 , and y > 0 .
Proposition 8.23. The lattices L(1, α) with α in R realize all lattice shapes, and of
these lattices the only ones having the same shape are the pairs L(1, 1/2 + yi) and
L(1, − 1/2 + yi) and the pairs L(1, x + yi) and L(1, −x + yi) with x 2 + y 2 = 1 .
Note that these pairs all lie on the boundary of R , either on the vertical edges
or on the circular arc forming the lower edge of R . The two points of each pair are
mirror reflections of each other across the y- axis.
Proof: We have already seen that all lattices have the shape of a lattice L(1, α) for
some α in R , and it remains to see when two of these lattices L(1, α) have the same
shape. A more basic question is when two of the lattices L(1, α) and L(1, β) with
α and β in R are the same lattice. If this happens, the y- coordinates of α and β
must be the same since this is the coordinate of points in the first row of the lattice
above the x- axis. The x- coordinates of α and β must then differ by an integer if
L(1, α) = L(1, β) , so if α and β are both in R the only possibility is that α and β are
points 1/2 + yi and −1/2 + yi on the two vertical edges of R .
For L(1, α) and L(1, β) to have the same shape means that there is a rotation
and rescaling taking one to the other. However, there can be no rescaling since the
Section 8.3 — The Correspondence Between Forms and Ideals 301
smallest distance from nonzero points in these two lattices to the origin is 1 in both
cases. To see what sorts of rotations are possible consider the subsets Cα of L(1, α)
and Cβ of L(1, β) consisting of the lattice points at distance 1 from the origin. If
there is a rotation taking L(1, α) to L(1, β) then this rotation carries Cα onto Cβ . In
particular, Cα and Cβ must have the same number of points. The points 1 and −1
always belong to Cα and Cβ . If these are the only points in Cα and Cβ then the only
rotations taking Cα to Cβ are rotations by 0 and 180 degrees, but these do not affect
the lattices so we must have L(1, α) = L(1, β) in this case. If Cα and Cβ have more
than two points then Cα will include ±α and Cβ will include ±β . If Cα = {±1, ±α}
and Cβ = {±1, ±β} then the only way for Cα to be a rotation of Cβ is for the two
arcs in the upper half of the unit circle joining α to 1 and to −1 to have the same
lengths as the two arcs from β to 1 and −1 , after
possibly interchanging the two arcs for α or β as in
the figure. This implies that β is equal to either α or
the reflection of α across the y- axis. Thus L(1, α)
and L(1, β) are L(1, x + yi) and L(1, −x + yi) for
some x and y with x 2 + y 2 = 1 . The remaining possibility is that Cα and Cβ contain
more that four points, but this only happens when they are the vertices of regular
hexagons inscribed in the unit circle since the points of Cα must be of distance at
least 1 apart, and likewise for Cβ . In this hexagonal case we have L(1, α) = L(1, β) ,
finishing the proof. ⊓
⊔
√
b+ ∆
Let us see now how the lattices LQ = L(a, 2 ) associated to elliptic forms
2 2
Q = ax + bxy + cy fit into this picture. Here a and c are positive since we only
consider positive
√
elliptic
√
forms.
√
For the two basis elements of LQ we have N(a) = a2
∆ b+ ∆ b− ∆ b2 −∆
and N( b+2 ) = 2 · 2 = 4√ = ac . If we assume that Q is √reduced, so
b+ ∆ b+ ∆
0 ≤ b ≤ a ≤ c , then N(a) ≤ N( 2 ) . Also the x- coordinate of 2 , which is
b/ , is at most a/ . From these facts we can deduce that a is the closest point in
2 2
LQ to the origin. Then when√ we rescale LQ by shrinking by a factor of a we get the
b+ ∆
lattice L(1, α) with α = 2a , with α lying√ in the right half of the region R since
b 1 b+ ∆
N(α) ≤ 1 and 0 ≤ 2a ≤ 2 . Conversely, if 2a is in the right half of R then we have
0 ≤ b ≤ a ≤ c . Thus Q is reduced exactly when the rescaled LQ is L(1, α) with α in
the right half of R . √
nb+ n2 ∆
If we replace Q by nQ then LQ is replaced by L(na, 2
) = nLQ so this is
just a rescaling of LQ with the same shape and hence corresponding to the same point
α in R . Apart from rescaling Q in this way, different reduced forms give different
points α in R since the x- coordinate b/2a of α determines the ratio b/a and the
norm of α gives the ratio c/a .
Any point α in the right half of R with rational x- coordinate and rational norm
arises in this way from a reduced elliptic form Q . For example for an x- coordinate
of 1/3 and a norm of 5/4 we have b/2a = 1/3 and c/a = 5/4 so by rewriting these two
302 Chapter 8 — Quadratic Fields
fractions with a common denominator we get 4/12 and 15/12 , so after writing 4/12 as
8/ 2 2
24 we can choose a = 12 , b = 8 , and c = 15 , producing the form 12x +8xy +15y .
Points in the left half of the region R are realized by replacing b by −b , so
the form ax 2 + bxy + cy is replaced by its mirror image form ax 2 − bxy + cy 2
which is equivalent but not properly equivalent unless ax 2 + bxy + cy 2 has mirror
symmetry. The reduced forms with mirror symmetric topographs are those where one
of the inequalities 0 ≤ b ≤ a ≤ c becomes an √equality. When b = 0 we have the forms
∆
ax 2 +cy 2 corresponding to the lattices L(1, 2a ) along the y- axis in R . These are the
rectangular lattices, with mirror symmetry across the y- axis. √When b = a we
√
have
a+ ∆ 1 ∆
the forms ax 2 + axy + cy 2 whose associated lattices L(1, 2a ) = L(1, 2 + 2a ) lie
along the right-hand edge of R . These lattices also have mirror
√
symmetry across the
1 ∆
y- axis since they equal their mirror image lattices L(1, − 2 + 2a√) . Finally, if√a = c we
2 2 b+ ∆ b+ ∆
have forms ax + bxy + ay corresponding to lattices L(1, 2a ) with 2a having
norm c/a = 1 and hence lying on the arc of the unit circle forming the bottom border
of R . These lattices also have mirror symmetry since
√
they form grids of rhombuses,
b+ ∆
the distances from both basis elements 1 and 2a to the origin being equal.
Thus forms with mirror symmetric topographs give rise to mirror symmetric lat-
tices. The converse is also true since none of the lattices L(1, α) with α in the interior
of R but not on the y- axis have mirror symmetry. One can see this by noting that for
points α in the interior of R the only points in lattices L(1, α) of unit distance apart
lie on horizontal lines, so mirror symmetries of these lattices must take horizontal
lines to horizontal lines, which forces these symmetries to be reflections across either
horizontal or vertical lines. The only time such a reflection takes a lattice L(1, α) to
itself for some α in the interior of R is when α is on the y- axis, so the lattice is
rectangular.
It is interesting to compare the picture of the region R with a figure in Section 5.5
showing the location of reduced elliptic forms in a triangle inside the Farey diagram.
Here is the relevant part of this figure, first as it appeared in Chapter 5 and then
reflected across a 45 degree line:
The three sides of the triangle are specified by the equations a = c , a = b , and b = 0 ,
so we see that the triangle corresponds exactly to the right half of the region R , with
the edge a = b corresponding to the right edge of R , the edge a = c to an arc of the
unit circle, and the edge b = 0 to the central vertical axis of R .
Section 8.3 — The Correspondence Between Forms and Ideals 303
For some discriminants there are units γ with N(γ) = −1 in addition to those with
N(γ) = +1 . The transformation Tγ for the smallest γ > 1 of norm −1 is a com-
position of a hyperbola slide and reflection across the X- axis. The powers γ n then
lie alternately on x 2 − y 2 = +1 and x 2 − y 2 = −1 . This happens for example in
√ √ √
Z[ 2] with γ = 1 + 2 as shown in the second figure above, where γ 2 = 3 + 2 2 and
√
γ3 = 7 + 5 2 .
Section 8.3 — The Correspondence Between Forms and Ideals 305
Exercises
1. For discriminant ∆ = −23 draw the lattice LQ for one form in each proper equiv-
alence class of forms. Prove that no two of these lattices have the same shape by
computing ratios of distances from the origin to nearby points in the lattice, with an
extra argument to deal with mirror image lattices that do not have the same shape.
4. (a) For
√
a form ax 2 + bxy √
+ cy 2 of discriminant ∆ we have the associated ideal
∆ ∆
L(a, b+2 ) whose basis a, b+2 determines a parallelogram P . When ∆ < 0 show
that P is a rhombus if and only if a = c .
(b) Give an example of a form ax 2 + bxy + ay 2 with ∆ > 0 for which P is not a
rhombus.
5. Show that the norm N(L) of a lattice L in R∆ can be computed in the following
way. Choose a basis α, β for L and let Pα,β be the parallelogram with vertices 0 , α ,
β , and α + β . Then N(L) is the total number of points of R∆ in the interior of Pα,β
plus the number of points of R∆ in the interiors of two adjacent edges of Pα,β , plus
an additional 1 for the vertex of Pα,β between these two edges.
6. Show that if L and L′ are lattices in R∆ with L′ a subset of L then N(L) divides
N(L′ ) .
7. Show that the number of lattices in R∆ of norm n is equal to the divisor sum σ (n) ,
the sum of all the divisors of n including 1 and n itself.
√ √
8. Show that L(a, n ) is an ideal in Z[ n ] if and only if a divides n .
306 Chapter 8 — Quadratic Fields
11. (a) For ∆ = 105 determine all the equivalence and strict equivalence classes of
ideals in R∆ .
(b) Do the same for ∆ = 145 .
12. For discriminant ∆ = −64 determine the stabilizers for all the ideals LQ associ-
ated to reduced forms Q , whether primitive or not.
13. Show that for each ideal L in R∆ the stabilizer of L is the same as the stabilizer
of αL for each nonzero α in R∆ .
14. Show that all ideals in R∆ are stable if and only if ∆ is a fundamental discriminant.
Lemma 8.24. By applying some sequence of operations (1) – (3) to a set of genera-
tors αi for L(α1 , · · · , αn ) it is always possible to produce a new set of generators
β1 , · · · , βn which are all zero except for β1 and β2 . In particular L(α1 , · · · , αn ) is
a lattice.
other bj ’s either zero or positive integers less than bi . This process can be repeated
using columns with successively smaller second entries until only one nonzero bi
remains. Switching this column with the first column, we can then assume that bi = 0
for all i > 1 .
Now we do the same procedure for columns 2 through n using the entries ai
rather than bi . Since these columns have bi = 0 , nothing changes in the second
row. After this step is finished, only the first two columns will be nonzero. Note that
neither of these columns can have both entries zero, otherwise L(α1 , · · · , αn ) would
be entirely contained in a line through the origin. ⊓
⊔
Let us restrict attention now to lattices that are ideals. One way to generate
such a lattice is to start with elements α1 , · · · , αn in R∆ which we can assume are
P
nonzero and then consider the set of all elements i γi αi for arbitrary coefficients γi
in R∆ rather than just taking integer coefficients as we would be doing for the lattice
P
L(α1 , · · · , αn ) . The usual notation for this set of all sums i γi αi is (α1 , · · · , αn ) ,
generalizing the earlier notation (α) for a principal ideal. The ideal (α1 , · · · , αn )
is equal to the lattice L(α1 , α1 τ, α2 , α2 τ, · · · , αn , αn τ) where R∆ = Z[τ] since each
P
coefficient γi in a sum i γi αi can be written as xi + yi τ for integers xi and yi . To
be sure that (α1 , · · · , αn ) really is a lattice we should check that α1 , α1 τ, · · · , αn , αn τ
do not all lie on the same line through the origin, but this is true already for α1 and
α1 τ since (α1 ) is an ideal as we saw in the previous section.
Observe that if a lattice L(α1 , · · · , αn ) is an ideal, then L(α1 , · · · , αn ) is equal
to (α1 , · · · , αn ) since every product γαi with γ in R∆ can be rewritten as an integer
linear combination of α1 , · · · , αn if L(α1 , · · · , αn ) is an ideal. A consequence of this,
using Lemma 8.24, is that every ideal (α1 , · · · , αn ) with n > 2 can be rewritten as an
ideal (β1 , β2 ) .
In this ideal each generator is a multiple of 2 so we can pull out a factor of 2 to get
√ √
P 2 = 2(2, 1 + −5, 3) . The ideal (2, 1 + −5, 3) contains 3 and 2 so it contains their
Section 8.4 — The Ideal Class Group 309
For the last equality we are using the general identity LM = L M which follows easily
from the definitions.
other ways to view these norms in terms of areas and determinants. For the ideals we
will be most interested in, namely the stable ideals in Proposition 8.22, there is yet
another interpretation of the norm N(L) that is more like the definition of the norm
of an element α as N(α) = αα .
Proposition 8.25. If the ideal L in R∆ is stable then LL = (N(L)) , the principal ideal
generated by the norm N(L) .
In the preceding example the calculations of P P and QQ are consequences of
√
this general result since the norm of an ideal (a, 1 + −5) is a .
√
Proof: By Proposition 8.16 the ideal L is equal to nL(a, b+2 ∆ ) for some integer n ≥ 1
and some form ax 2 +bxy +cy 2 of discriminant ∆ with a > 0 . It will suffice to prove
the proposition in the case n = 1 since replacing an ideal L by nL does not affect the
stabilizer and it multiplies N(L) by n2 , so both sides
√
of the equation LL = (N(L)) are
b+ ∆
multiplied by n2 . Thus we may take L = L(a, 2 ) for the rest of the proof. Since
2 2
we assume L is√stable, the form ax + bxy + cy is primitive by Proposition 8.22.
b+ ∆
Let τ = 2 so τ is a root of the equation x 2 − bx + ac = 0 and ττ = ac . We
have L = (a, τ) and L = (a, τ) so
LL = (a2 , aτ, aτ, ττ) = (a2 , aτ, aτ, ac) = a(a, τ, τ, c)
The ideal (a, τ, τ, c) contains the ideal (a, τ + τ, c) = (a, b, c) . The latter ideal is all
of R∆ since it contains all integral linear combinations ma + nb + qc and there is
one such combination that equals 1 since the greatest common divisor of a , b , and c
is 1 because the form ax 2 + bxy + cy 2 is primitive. (We know from Chapter 2 that
the greatest common divisor d of a and b can be written as d = ma + nb , and then
the greatest common divisor of d and c , which is the greatest common divisor of a ,
b , and c , can be written as an integral linear combination of d and c and hence also
of a , b , and c .)
Thus the ideal (a, τ, τ, c) contains R∆ and so must equal it. Hence
√
we have
∆
LL = aR∆ = (a) and this equals (N(L)) since N(L) = a for L = L(a, b+2 ). ⊓
⊔
Proof: If L and M are stable then so is LM by Proposition 8.26 since the product of
two principal ideals is principal. Since L M = L M we have LMLM = LLMM which
Section 8.4 — The Ideal Class Group 311
L L2 = 2L (2)
From the figure we see that N(L) = 2 and hence N(2L) = 22 N(L) = 8 so N(L2 ) ≠
N(L)2 = 4 . This shows that N(LM) need not equal N(L)N(M) in general. Also we
see from the figure that LL ≠ (N(L)) since 2L ≠ (2) . In fact LL is not even a principal
ideal since 2L is a lattice of equilateral triangles while principal ideals have the same
√
shape as the rectangular lattice Z[ −3] .
Now at last we come to the construction of the ideal class group which we will
denote ICG(∆) until we show that it coincides with the class group CG(∆) defined
in Chapter 7 in terms of forms. Let [L] denote the strict equivalence class of a stable
ideal L in R∆ and let ICG(∆) be the set of such classes [L] . The multiplication
operation in ICG(∆) is defined by taking products of ideals, so we set [L][M] = [LM] ,
recalling the fact that the product of two stable ideals is stable by Proposition 8.26.
To check that this product in ICG(∆) is well defined we need to see that choosing
different ideals L′ and M ′ in the classes [L] and [M] does not affect [LM] . This
is true because [L] = [L′ ] means αL = α′ L′ for some α and α′ , and [M] = [M ′ ]
means βM = β′ M ′ for some β and β′ , hence αβLM = α′ β′ L′ M ′ , so [LM] = [L′ M ′ ] .
Here we are dealing with strict equivalence classes of ideals so we are assuming all of
α, β, α′ , β′ have positive norms, hence so do αβ and α′ β′ . (As always this condition
is automatic when ∆ is negative.)
312 Chapter 8 — Quadratic Fields
Proof: The commutativity property [L][M] = [M][L] is easy since this amounts to
saying [LM] = [ML] , which holds since multiplication of ideals is commutative, LM =
ML , because multiplication in R∆ is commutative.
To have a group there are three things to check. First, the multiplication should
be associative, so ([L][M])[N] = [L]([M][N]) . By the definition of the product
in ICG(∆) this is equivalent to saying [LM][N] = [L][MN] which in turn means
[(LM)N] = [L(MN)] , so it suffices to check that multiplication of ideals is associa-
tive, (LM)N = L(MN) . The claim is that each of these two products consists of all
P
the finite sums i αi βi γi with αi , βi , and γi elements of L , M , and N respectively.
Every such sum is in both (LM)N and L(MN) since each term αi βi γi is in both of
the ideals (LM)N and L(MN) . Conversely, each element of (LM)N is a sum of terms
P P
( j αj βj )γ so it can be written as a sum i αi βi γi , and similarly each element of
P
L(MN) can be written as a sum i αi βi γi . Thus we have (LM)N = L(MN) .
Next, a group must have an identity element, and the class [(1)] of the ideal (1) =
R∆ obviously serves this purpose since (1)L = L for all ideals L , hence [(1)][L] =
[L] . There is no need to check that [L][(1)] = [L] as one would have to do for a
noncommutative group since we have already observed that multiplication in ICG(∆)
is commutative.
The last thing to check is that each element of ICG(∆) has a multiplicative inverse,
and this is where we use the condition that we are considering only stable ideals in the
definition of ICG(∆) . As we showed in Proposition 8.25, each stable ideal L satisfies
LL = (n) where the integer n is the norm of L . Then we have [L][L] = [(n)] = [(1)]
where this last equality holds since the ideals (n) and (1) are strictly equivalent, the
norm of n being n2 , a positive integer. Thus the multiplicative inverse of [L] is [L] .
Again commutativity of the multiplication means that we do not have to check that
[L] is an inverse for [L] for multiplication both on the left and on the right. ⊓
⊔
There is a variant of the ideal class group in which the relation of strict equivalence
of ideals is modified by deleting the word “strict”, so an ideal L is considered equiv-
alent to αL for all nonzero elements α of R∆ without the condition that N(α) > 0 .
The preceding proof that ICG(∆) is a group applies equally well in this setting by
just omitting any mention of norms being positive. Sometimes the resulting group is
called the class group while ICG(∆) is called the strict class group or narrow class
group. However, for studying quadratic forms the more appropriate notion is strict
equivalence, which is why we are using this for the class group ICG(∆) .
[Q1 ] and [Q2 ] in CG(∆) we can realize them by concordant forms [a1 , b, a2 c] and
[a2 , b, a1 c] with a1 and a2 coprime and positive. The product [Q1 ][Q2 ] in CG(∆) is
then the
√
class of [a1 a2 , b,√c] . The ideals corresponding
√
to these three forms are L1 =
b+ ∆ b+ ∆ b+ ∆
a1 , 2 , L 2 = a2 , 2 , and L3 = a1 a2 , 2 . To show that multiplication
in CG(∆) corresponds under Φ to multiplication in ICG(∆) √
it will
√
suffice
√
to show
√
b+ ∆ b+ ∆ b+ ∆ b+ ∆
that L1 L2 = L3 . The product L1 L2 is the ideal a1 a2 , a1 2 , a2 2 , 2 · 2 .
This is certainly contained in L3 since√ the first generator a1 a2 is in L3 and the other
b+ ∆
three generators are multiples of 2 by elements of R∆ hence are in
√
L3 . On the
b+ ∆
other hand L3 is contained in L1 L2 since a√1 a2 is in L1√L2 and so is 2 which can
b+ ∆ b+ ∆
be written as a linear combination ma1 2 + na2 2 for some integers m and
n , using the fact that a1 and a2 are coprime so we have ma1 + na2 = 1 for some
integers m and n .
The identity element of CG(∆) is the class
√
of the principal form [1, b, c] and this
b+ ∆
is sent by Φ to the class of the ideal 1, 2 = (1) which is the identity element of
ICG(∆) . The inverse of an element of CG(∆) determined by a form [a, b, c] is the
class of the mirror
√
image form√
[a, −b, c] , so under Φ these forms correspond
√
to the
b+ ∆ −b+ ∆ b− ∆
ideals a, 2 and a,
√ 2 . The latter ideal is the same
√
as a, 2 which is
b+ ∆ b+ ∆
the conjugate of a, 2 so it gives the inverse of a, 2 in ICG(∆) .
Thus the group structures on CG(∆) and ICG(∆) are really the same, and we
can use the notation CG(∆) for both without any conflict.
√
To illustrate this let us consider CG(∆) for ∆ = −104 , so R∆ = Z[ −26] . We
looked at this example in Section 7.2 and found that CG(∆) is a cyclic group of order
6 generated by the form Q4 = [5, 4, 6] . From the topographs we could see that
Q42 was either Q3 = [3, 2, 9] or Q3−1 = [3, −2, 9] , but to determine which, we had
to find a pair of concordant forms equivalent to Q4 and multiply them together.
Now we can use ideals to do the same calculation. The ideal corresponding to Q4 =
√ √ √
[5, 4, 6] is (5, 2 + −26) so for Q42 the ideal is (5, 2 + −26)(5, 2 + −26) which
√ √
equals (25, 10+5 −26, −22+4 −26) . The next step is to find a reduced basis for this
ideal. As a lattice this ideal is generated by these three elementsand their products
√ 25 0 10 ---130 ---22 ---104
with −26 . Thus we have the matrix 0 25 5 10 which reduces to
√ 4 ---22
25 7
0 1
so the ideal is (25, 7 + −26) . The corresponding form is [25, 14, c] and
we can determine c from the discriminant equation b2 − 4ac = −104 which gives
c = 3 . The form is thus [25, 14, 3] . A small portion of the topograph of this form is
shown at the right. There is a source vertex surrounded by the three
values 3, 9, 10 in counterclockwise order. The form [3, −2, 9] has
exactly this same configuration at its source vertex, so we conclude
that Q42 = Q3−1 , the same answer we got in Section 7.2.
314 Chapter 8 — Quadratic Fields
Exercises
a ··· a
1. Corresponding to a lattice L(α1 , · · · , αn ) in Z[τ] there is a matrix 1 n
b 1 ··· b n
with αi = ai + bi τ as in Lemma 8.24. Show that the three operations of adding a
multiple of one column to another, changing the sign of a column, and permuting
columns do not change the greatest common divisor of the numbers in each row of
the matrix. Deduce from this that if a, b + cτ is the reduced basis for the lattice then
c is the greatest common divisor of the entries in the second row of the matrix.
√ √
2. In Z[ −6] compute the powers of the ideal (2, −6) and determine which powers
are principal ideals.
√
3. In Z[ −14] do the following:
√
(a) Compute the square of the ideal (2, −14) .
√
(b) For the ideal L = (3, 1 + −14) find a reduced basis for L2 and use this to draw a
picture of the lattice L2 .
√ √
(c) Find nonzero elements α and β in Z[ −14] such that αL2 = β(2, −14) .
√ √
4. In Z[ −5] compute Q2 for Q = (3, 1 + −5) as a principal ideal (α) after first
determining what N(α) must be.
5. Use the formula N(LM) = N(L)N(M) with L = (α) and M = (α) to give another
proof that N (α) = |N(α)| .
Proposition 8.29. If the norm N(P ) of an ideal P is prime then P is a prime ideal.
Section 8.5 — Unique Factorization of Ideals 315
Proof: Suppose P = LM . Then N(P ) = N(L)N(M) . If N(P ) is prime then since N(L)
and N(M) are positive integers, one of them must be 1 . The only ideal of norm 1 is
R∆ so this means L or M must be R∆ . Thus P is a prime ideal. ⊓
⊔
Proposition 8.30. For each prime p the principal ideal (p) in R∆ is either a prime
ideal or it factors as (p) = P P for prime ideals P and P of norm p .
As we will see later in Corollary 8.34, all prime ideals in R∆ are accounted for by
this proposition, so every prime ideal is either a principal ideal (p) with p prime or
a factor P or P when (p) = P P .
Proof: If (p) is not a prime ideal it factors as (p) = P Q for ideals P and Q not equal
to R∆ . Since the norm of (p) is p 2 we must have N(P ) = p and N(Q) = p . From
the general formula LL = N(L) we have P P = N(P ) = (p) . Since N(P ) = p we
must also have N(P ) = p so P and P are both prime ideals. (From the unique prime
factorization property of ideals it will follow that Q = P , but we do not need to know
this here.) ⊓
⊔
In the case that (p) = P P the prime p is said to split in R∆ . The primes that
split in R∆ are the primes that are norms of ideals in R∆ , and as we saw in Section 8.3
these are exactly the primes that are represented by forms of discriminant ∆ . For a
split prime p we saw in Proposition 8.18 how to find an ideal P of norm p so this
now tells us how to factor (p) as P P .
A further distinction for split primes is whether the two factors of (p) = P P are
equal or not. If P = P then p is said to be ramified in R∆ . According to part (c) of
Proposition 8.18 the ramified primes are exactly the primes that divide ∆ .
Now we turn to proving the unique factorization property for ideals in R∆ . It will
be helpful to have a criterion for when one ideal L in R∆ divides another ideal M ,
meaning that M = LK for some ideal K . For individual elements of R∆ it is easy to
tell when one element divides another since α divides β exactly when the quotient
β/ lies in R . For ideals, however, the criterion is rather different:
α ∆
One can remember this as “to divide is to contain”. At first glance the proposition
may seem a little puzzling since for ordinary numbers the divisors of a number n ,
apart from n itself, are smaller than n while for ideals the divisors are larger, where
“larger” for sets means that one set contains the other. The puzzle can be resolved
by interpreting “ m divides n ” as “the multiples of m contain the multiples of n ”.
The proposition gives some insight into the choice of the ideals P and Q in the
√
example preceding Proposition 8.25 where we factored the ideal (6) in Z[ −5] as
√ √
(2)(3) = P P ·QQ and as (1 + −5)(1 − −5) = P Q·P Q . Since we want P P = (2)
√ √
and P Q = (1 + −5) , this means that P should divide both (2) and (1 + −5) . By
the proposition above this is the same as saying that P should contain both (2) and
316 Chapter 8 — Quadratic Fields
√ √
(1 + −5) . An obvious ideal with this property is the ideal (2, 1 + −5) . Similarly
√
one would be led to try Q = (3, 1 + −5) . Then one could check that these choices
for P and Q actually work.
Before proving the proposition let us derive a fact which will be used in the proof,
a cancellation property of multiplication of ideals: If LM1 = LM2 then M1 = M2 . To
see this, first multiply the equation LM1 = LM2 by L to get LLM1 = LLM2 . Since
LL = (n) for n = N(L) , a positive integer, we then have (n)M1 = (n)M2 , which is
equivalent to saying nM1 = nM2 . Thus the rescalings nM1 and nM2 of M1 and M2
are equal, so after rescaling again by the factor 1/n we get M1 = M2 .
Now let us prove the proposition.
Proof: Suppose first that L divides M , so M = LK for some ideal K . A typical element
P
of LK is a sum i αi βi with αi ∈ L and βi ∈ K for all i . Since L is an ideal, each
term αi βi is then in L and hence so is their sum. This shows that L contains LK = M .
For the converse, suppose L contains M . Then LL contains ML . Since LL = (n)
for n = N(L) , this says that (n) contains ML , so every element of ML is a multiple
of n by some element of R∆ . This means that if we write ML = (α, β) then we can
define an ideal K by letting K = α/n , β/n .
Now we have (n)K = (n) α/n , β/n = (α, β) = ML . Multiplying by L we then
have (n)KL = MLL = M(n) . Canceling the factor (n) gives the equation KL = M ,
which says that L divides M , finishing the proof of the converse. ⊓
⊔
When we proved unique prime factorization for Z and those rings R∆ which have
a Euclidean algorithm, a key step was showing that if a prime p divides a product ab
then p must divide either a or b . Now we prove the corresponding fact for ideals:
Lemma 8.32. If a prime ideal P divides a product LM of two ideals, then P must
divide either L or M .
Proof: We will prove the equivalent statement that if P divides LM but not L , then P
divides M . Consider the set P +L of all sums α+β of elements α ∈ P and β ∈ L . This
set P +L is an ideal since if P = (α1 , α2 ) and L = (β1 , β2 ) then P +L = (α1 , α2 , β1 , β2 ) .
The ideal P + L is strictly larger than P since the assumption that P does not divide L
means that P does not contain L , so any element of L not in P is in P + L but not P .
Thus P + L contains P , hence divides P , but is not equal to P so since P is prime we
must have P + L = R∆ .
In particular P + L contains 1 so we can write 1 = α + β for some α ∈ P and
β ∈ L . For an arbitrary element γ ∈ M we then have γ = αγ + βγ . The term αγ is
in P since α is in P and P is an ideal. The term βγ is in LM since β is in L and γ
is in M . We assume P divides LM so P contains LM and it follows that βγ is in P .
Thus both terms on the right side of the equation γ = αγ + βγ are in P so γ is in P .
Since γ was an arbitrary element of M this shows that M is contained in P , or in
other words P divides M , which is what we wanted to prove. ⊓
⊔
Section 8.5 — Unique Factorization of Ideals 317
Theorem 8.33. Every ideal in R∆ other than R∆ itself is a product of prime ideals,
and this factorization is unique up to the order of the factors.
Proof: We first show the existence of a prime factorization for each ideal L ≠ R∆ . If
L is prime itself there is nothing to prove, so suppose L is not prime, hence there
is a factorization L = KM with neither factor equal to R∆ . Taking norms, we have
N(L) = N(K)N(M) . Both N(K) and N(M) are greater than 1 since R∆ is the only
ideal of norm 1 . Hence N(K) < N(L) and N(M) < N(L) . By induction on the norm,
both K and M have prime factorizations, hence so does L = KM . We can start the
induction with the case N(L) = 2 , a prime, hence L is prime. (The case N(L) = 1
does not arise since L ≠ R∆ .)
For the uniqueness, suppose an ideal L has prime factorizations P1 · · · Pk and
Q1 · · · Ql . We can assume k ≤ l by a notational change if necessary. The prime ideal
P1 divides the product Q1 (Q2 · · · Ql ) so by the preceding lemma it must divide either
Q1 or Q2 · · · Ql . In the latter case the same reasoning shows it must divide either
Q2 or Q3 · · · Ql . Repeating this argument enough times we eventually deduce that
P1 must divide some Qi , and after permuting the factors of Q1 · · · Ql we can assume
that P1 divides Q1 . When one prime ideal divides another prime ideal they must be
equal. (Proof: If P divides Q then Q = P M for some M , but Q being prime implies
either P = R∆ , which is impossible if P is prime, or M = R∆ , hence P = Q as claimed.)
Once we have P1 = Q1 we can cancel this common factor of P1 · · · Pk and
Q1 · · · Ql to get P2 · · · Pk = Q2 · · · Ql . Repeating this process often enough we even-
tually get, after suitably permuting the Qi ’s, that P1 = Q1 , P2 = Q2 , · · · , Pk−1 = Qk−1 ,
and Pk = Qk · · · Ql . Since Pk is prime, as are the Qi ’s, the equation Pk = Qk · · · Ql
can have only one term on the right side, so k = l and Pk = Qk . This finishes the
proof of the uniqueness of prime factorizations of ideals. ⊓
⊔
From unique factorization we can deduce that there are no other prime ideals
beyond those we saw in Proposition 8.30.
Corollary 8.34. All prime ideals P in R∆ are factors of ideals (p) for primes p ,
with either (p) = P or (p) = P P .
Let us consider how one can find the prime factorization of a given ideal. The
procedure will be analogous to how we factored Gaussian integers in Section 8.1. We
√
begin with an example in the case ∆ = −24 with R∆ = Z[ −6] . We looked at this case
in Section 8.3 when we considered how to find ideals of a given norm. For the norm
318 Chapter 8 — Quadratic Fields
√ √
35 we found the two ideals (35, 8 + −6) and (35, 13 + −6) and their conjugates.
The prime factors of these ideals will have norms dividing 35 , so either 5 or 7 , with
one factor of norm 5 and one of norm 7 . We found the ideals of norms 5 and 7 ,
√ √
which were (5, 2 ± −6) and (7, 1 ± −6) , and we need to see now which of these
√ √
ideals divide (35, 8 + −6) and which divide (35, 13 + −6) , or in other words, which
√ √
of these ideals contain (35, 8 + −6) and which contain (35, 13 + −6) . This will be
easy using the following general fact:
Lemma 8.35. A lattice L(a, b + cτ) in Z[τ] contains another lattice L(a′ , b′ + c ′ τ)
′
if and only if a divides a′ , c divides c ′ , and b′ ≡ b c/ c mod a .
Proof: For L(a, b + cτ) to contain L(a′ , b′ + c ′ τ) amounts to asking when a′ and
b′ + c ′ τ are in L(a, b + cτ) . For a′ , the only integers in L(a, b + cτ) are the multiples
of a , so the condition on a′ is that it must be a multiple of a . For b′ + c ′ τ to be
in L(a, b + cτ) means that the equation b′ + c ′ τ = ax + (b + cτ)y must have an
integer solution. Equating the coefficients of τ gives c ′ = cy which just says that c ′
′ ′
is a multiple of c , with y = c/c . Then the equation becomes b′ = ax + b c/c which
′
is equivalent to the congruence b′ ≡ b c/c mod a . ⊓
⊔
√ √
Applying this lemma to determine which of (5, 2 ± −6) contains (35, 8 + −6)
we see that the two divisibility conditions are satisfied and the congruence condition
√
is 8 ≡ ±2 mod 5 where the sign is the same as in (5, 2 ± −6) . The minus sign gives
√ √ √
a valid congruence so it is (5, 2 − −6) that divides (35, 8 + −6) . For (7, 1 ± −6) to
√
divide (35, 8 + −6) the divisibility conditions are again satisfied and the congruence
√
condition is now 8 ≡ ±1 mod 7 so this time the plus sign is correct so (7, 1 + −6)
√ √
divides (35, 8 + −6) . Thus we obtain the prime factorization of (35, 8 + −6) as
√ √ √
(5, 2 − −6)(7, 1 + −6) . In similar fashion one finds that (35, 13 + −6) factors as
√ √
(5, 2 − −6)(7, 1 − −6) . Taking the conjugates of these two factorizations gives the
factorizations of the other two ideals of norm 35 .
The general procedure for finding the prime factorization of an ideal L in R∆ can
be described as follows. As an easy first step one finds the largest positive integer n
dividing each generator for L , assuming L is given in terms of generators. This gives
a factorization L = nL′ = (n)L′ with L′ a primitive ideal. Factoring (n) into prime
ideals is done by first factoring n as a product of primes pi and then factoring the
corresponding principal ideals (pi ) as in Proposition 8.30. This reduces the problem
to the case that L is a primitive ideal. To do this case one computes N(L) , say by
r r
finding a reduced basis for L , then one factors N(L) as N(L) = p11 · · · pkk for distinct
primes pi . These must be split primes, otherwise L would not be primitive. After
factoring each principal ideal (pi ) as Pi P i , one can then determine which of Pi or P i
divides L by applying the preceding Lemma 8.35. Only one of Pi and P i can divide L
since L is primitive, so the prime factorization of L is then obtained from the product
r r
p11 · · · pkk by replacing each pi by the ideal Pi or P i that divides L .
Section 8.5 — Unique Factorization of Ideals 319
Unique prime factorization for ideals can be used to determine the number of
times each number n appears in a given topograph. Let us illustrate this by returning
to the case of discriminant −24 where there are the two forms x 2 +6y 2 and 2x 2 +3y 2 .
As we saw in Section 8.3, the number of appearances of n for both forms together
is the same as the number of primitive ideals of norm n . The norms of primitive
r r
ideals are the numbers n = 2a 3b p11 · · · pkk with a ≤ 1 , b ≤ 1 , and the pi ’s distinct
unramified split primes. The primitive ideals of norm n are then obtained by replacing
r r √ √
the factors 2 and 3 in 2a 3b p11 · · · pkk by the ideals (2, −6) and (3, −6) and each
r r ri
pi i by either Pi i or P i where (pi ) = Pi P i . Thus there are exactly 2k primitive ideals
of norm n , so this is the number of times that n appears in at least one of the two
topographs. We know from Chapter 6 that no number is represented by both forms,
and the form representing n is x 2 + 6y 2 or 2x 2 + 3y 2 according to whether the
character values χ3 (n) and χ8 (n) are both +1 or both −1 .
In some cases the unique factorization property for ideals implies unique factor-
ization for elements of R∆ . The relation between the two situations is obtained by
associating to each nonzero element α in R∆ the principal ideal (α) . Multiplication
of elements corresponds to multiplication of ideals since (αβ) = (α)(β) . A key ob-
servation is that (α) = (β) if and only if α and β differ only by multiplication by a
unit. For if β = εα for some unit ε then (ε) contains εε−1 = 1 so (ε) = R∆ hence
(β) = (εα) = (ε)(α) = (α) . Conversely, if (α) = (β) then β is in (α) so β = εα for
some ε ∈ R∆ , and similarly α = ηβ for some η ∈ R∆ . Thus α = ηβ = ηεα hence
ηε = 1 so ε and η are units, showing that α and β differ just by a unit.
Proposition 8.36. If all ideals in R∆ are principal ideals then all elements of R∆
other than units and 0 have unique factorizations as products of prime elements,
where the uniqueness is up to order and multiplication by units.
Proof: This follows immediately from Theorem 8.33 since principal ideals in R∆ cor-
respond exactly to nonzero elements of R∆ up to multiplication by units. ⊓
⊔
Proposition 8.37. When ∆ < 0 all ideals are principal if and only if all forms are
equivalent to the principal form. When ∆ > 0 all ideals are principal if and only if
all forms are equivalent to either the principal form or its negative.
Proof: All principal ideals in R∆ are equivalent since they are equivalent to R∆ itself.
In fact the principal ideals form a complete equivalence class of ideals since any ideal
that is equivalent to a principal ideal is also a principal ideal by the following argument.
Suppose an ideal L is equivalent to a principal ideal (α) , so βL = γ(α) for nonzero
elements β and γ of R∆ . Then γα is in βL , which means γα = βδ for some δ in L ,
and hence we have βL = γ(α) = (γα) = (βδ) = β(δ) . Thus βL = β(δ) , so after
320 Chapter 8 — Quadratic Fields
√
multiplying both sides of this equation by β−1 in Q( ∆) we have L = (δ) , a principal
ideal.
To prove the proposition we will use the one-to-one correspondence between
proper equivalence classes of forms and strict equivalence classes of ideals. The
principal form has mirror symmetry so forms equivalent to this form are properly
equivalent to it, and the same holds for the negative of the principal form, which only
enters the picture when ∆ > 0 .
We distinguish three cases:
Case 1: ∆ < 0 . Here equivalence of ideals is the same as strict equivalence. The prin-
cipal form has leading coefficient 1 so it corresponds to the principal ideal R∆ . Thus
all forms are equivalent to the principal form exactly when all ideals are equivalent to
R∆ , or in other words, all ideals are principal.
Case 2: ∆ > 0 and the principal form is equivalent to its negative. The principal form
then represents −1 so equivalence of ideals is again the same as strict equivalence.
Thus there is a single equivalence class of forms exactly when there is a single equiv-
alence class of ideals, the principal ideals.
Case 3: ∆ > 0 and the principal form is not equivalent to its negative. These forms then
give two different equivalence classes of forms, and we will show that they correspond
to two different strict equivalence classes of principal ideals (α) , those with N(α) > 0
and those with N(α) < 0 .
Any two ideals (α) and (β) with N(α) > 0 and N(β) > 0 are strictly equivalent
since they are both strictly equivalent to (1) . Likewise (α) and (β) are strictly equiv-
alent if N(α) < 0 and N(β) < 0 since if γ is any element with N(γ) < 0 , for example
α or β , then (α) and (β) are both strictly equivalent to (αβγ) since N(βγ) > 0 and
N(αγ) > 0 . Now suppose (α) and (β) are strictly equivalent with N(α) and N(β)
having opposite sign. Then (γα) = (δβ) for some γ and δ of positive norm. This
means we have elements α′ = γα and β′ = δβ with (α′ ) = (β′ ) and such that the
norms of α′ and β′ have opposite sign. Since (α′ ) = (β′ ) we have β′ = εα′ for some
unit ε . Since N(α′ ) and N(β′ ) have opposite sign we must have N(ε) < 0 . This
means that the principal form represents −1 so its topograph has a skew symmetry,
making it equivalent to its negative, contrary to hypothesis. Thus we have shown the
the equivalence class of principal ideals (α) splits into two strict equivalence classes
according to the sign of N(α) .
Now we show that the negative of the principal form corresponds to a principal
ideal (α) with N(α) < 0 . The principal form is x 2 −dy 2 if ∆ = 4d and x 2 +xy −dy 2
if ∆ = 4d + 1 . The negative of the principal form has leading coefficient −1 so to
find the corresponding ideal as in Theorem 8.21 we first have to choose a properly
equivalent form with positive leading coefficient. For this we can choose dx 2 − y 2 or
dx 2 + xy − y 2 , obtained from the negative of the principal form by replacing x, y
by −y, x , rotating the topograph by 180 degrees. For dx 2 − y 2 the associated ideal
Section 8.5 — Unique Factorization of Ideals 321
√ √ √ √
is L(d, d) which is the principal ideal ( d) since d = d ·√ d so d is an element
√
of
√ 2 2 1+ ∆ 1+ ∆
( d) . For
√
dx √+ xy − y the corresponding ideal is L(d, 2 ) which√
is 2 since
−1+ ∆ 1+ ∆
√ 1+ ∆
d= 2 · 2 . In both cases the norm of the element d or 2 generating the
ideal is −d so it is negative.
Thus in Case 3 the two strict equivalence classes of principal ideals correspond
to the equivalence classes of the principal form and its negative, so these are the only
two equivalence classes of forms exactly when all ideals are principal. ⊓
⊔
An example for the third case in this proof is ∆ = 12 where the class number
is 2 corresponding to the principal form x 2 − 3y 2 and its negative. The primes
represented
in discriminant
p 12 are 2 , 3 , and the odd primes p with Legendre symbol
12 3 ---1
p = p = p 3
= +1 so these are the primes p ≡ ±1 mod 12 . The two
forms are of different genus, with x 2 − 3y 2 representing primes p ≡ +1 mod 12
and −x 2 + 3y 2 representing primes p ≡ −1 mod 12 . By Proposition 8.7 the primes
√
p that factor in R∆ = Z[ 3] are the primes represented by either of the two forms,
√ √ √ √ √
for example 2 = ( 3 + 1)( 3 − 1) , 3 = ( 3)2 , 11 = (2 3 + 1)(2 3 − 1) , and 13 =
√ √
(4 + 3)(4 − 3) . Here the factorization of 11 comes from the value −11 in the ± 1/2
regions in the topograph of the principal form while the factorization of 13 comes
from the 13 in the ± 4/1 regions.
In this example prime factorizations are unique up to units, but there are infinitely
many units for positive discriminants so there can be many factorizations that look
rather different but are obtained just by inserting units. For example the topograph
√ √ √
also gives 13 = (5 + 2 3)(5 − 2 3) from the ± 5/2 regions so 5 + 2 3 must be a unit
√ √
times either 4 + 3 or 4 − 3. One can determine which by computing which of the
√ √ √ √ √
two quotients (5+2 3)/(4+ 3) and (5+2 3)/(4− 3) lies in Z[ 3] . One finds that
√ √ √ √
the latter quotient is the unit 2 + 3 so 5 + 2 3 = (2 + 3)(4 − 3) . In terms of the
√
topograph, multiplication by the fundamental unit 2+ 3 translates the topograph by
one period to the right, while conjugation is reflection across the vertical line through
the 1/0 and 0/1 regions, so to get from 4/1 to 5/2 we first reflect 4/1 to ---4/1 , then we
322 Chapter 8 — Quadratic Fields
Let us conclude this section with some comments on what happens when the
discriminant ∆ is not a fundamental discriminant. One might hope that the unique
factorization property for ideals still holds at least for stable ideals, the ideals corre-
sponding to primitive forms. However, this is not the case, and here is an example.
√
Take ∆ = −12 , so R∆ = Z[ −3] . The class number is 1 in this case so all stable
ideals are principal (and recall that principal ideals are always stable). Consider the
√ √ √
factorizations (4) = (2)(2) = (1 + −3)(1 − −3) . The ideals (2) and (1 ± −3) are
prime since their norms are 4 so any nontrivial factorization as (α)(β) would have
√
N(α) = N(β) = 2 but no elements of Z[ −3] have norm 2 since x 2 + 3y 2 = 2 has
√
no integer solutions. The three ideals (2) and (1 ± −3) are distinct since the only
√
units in Z[ −3] are ±1 . Thus we have two different factorizations of (4) into prime
ideals when we restrict attention just to stable ideals. If one drops this restriction
√
then unique prime factorization still fails since for the ideal L = (2, 1 + −3) we saw
in the discussion following Proposition 8.27 that L2 = 2L , but unique factorization
implies the cancellation property so we would then have L = (2) , which is false.
One might ask where the proof of unique factorization breaks down for stable
ideals in the case of a nonfundamental discriminant. The answer is in the key property
in Lemma 8.32 that if a prime ideal P divides a product LM then it must divide one of
the factors L or M . In the proof of this we considered the ideal P +L , but unfortunately
this need not be a stable ideal when P and L are stable. For example, in the preceding
√ √
paragraph if we take P = (2) , L = (1 + −3) , and M = (1 − −3) then P + L is the
√
ideal (2, 1 + −3) , but this is not stable as we saw after Proposition 8.27. And in fact
√ √
the ideal (2) does not divide either (1 + −3) or (1 − −3) .
Exercises
√
1. (a) Find the ideals of norm 39 in Z[ 10] and find the factorizations of these ideals
into prime ideals.
√
(b) Do the same for the ideals in Z[ 10] of norm 10 , 15 , and 30 .
There are a couple things that come up in the proof that we will explain in advance
to avoid complicating the later arguments. The first is the elementary fact that an
element α in R∆ belongs to an ideal L if and only if the ideal (α) factors as (α) = LM
for some ideal M . This is because α is an element of L exactly when the ideal (α) is
contained in L , or in other words, when L divides (α) , which means (α) = LM for
some ideal M .
Next is a reformulation of what it means for a form QL to represent a number n .
By definition, QL (α) = N(α)/N(L) for α in L . Thus if we choose a basis α1 , α2
for L regarded as a lattice and we let α = xα1 + yα2 for integers x and y , then
QL (x, y) = N(xα1 + yα2 )/N(L) . For this to give a representation of n means that
x and y are coprime. In terms of α this is saying that α is not a multiple mβ of
any element β of L with m > 1 . This last condition can be abbreviated to saying just
that α is primitive in L .
We have also defined what it means for an ideal L to be primitive, namely, L is not
a multiple mL′ of any other ideal L′ with m > 1 , or equivalently, L is not divisible
324 Chapter 8 — Quadratic Fields
by any principal ideal (m) with m > 1 . We could require m to be a prime without
affecting the definition since if L = mL′ with m = pq for p a prime then L is p
times the ideal qL′ . By Proposition 8.16 every ideal in R∆ is equal to nLQ for some
integer n ≥ 1 and some form Q of discriminant ∆ , so the primitive ideals are exactly
the ideals LQ .
An equivalent way of formulating the condition for L to be primitive is to say that
the factorization L = P1 · · · Pk as a product of prime ideals satisfies the following two
conditions:
(i) No Pi is a prime ideal (p) with p a prime integer. Thus each Pi has norm a prime
rather than the square of a prime.
As another application of unique factorization for ideals in the rings R∆ for funda-
mental discriminants ∆ let us consider again the problem of finding which primitive
forms represent powers of primes dividing the conductor in the case of nonfunda-
mental discriminants. In Section 7.2 we gave a table showing some of the subtleties
that can occur for small negative nonfundamental discriminants. Perhaps the most
interesting cases are when infinitely many different powers of these primes are rep-
resented. The first two cases ∆ = −28 and ∆ = −60 were treated in Chapter 6 and
the next case ∆ = −72 was covered earlier in the present chapter in Section 8.2. Let
us consider now the fourth case ∆ = −92 where there are some new subtleties.
For ∆ = −92 the class number is 3 with the three forms x 2 + 23y 2 and 3x 2 ±
2xy + 8y 2 . The associated fundamental discriminant is ∆ = −23 which also has
class number 3 , corresponding to the forms x 2 + xy + 6y 2 and 2x 2 ± xy + 3y 2 . The
conductor is 2 and this is represented in discriminant −23 by 2x 2 ± xy + 3y 2 , as are
all powers of 2 since 2 does not divide −23 , so by Proposition 6.13 all powers 2k for
k ≥ 3 are represented by at least one of the forms x 2 + 23y 2 and 3x 2 ± 2xy + 8y 2 .
Our aim is to determine which of these powers are represented by each form.
√ √
First consider the form x 2 + 23y 2 . For elements x + −23y in Z[ −23] we
√
have N(x + −23y) = x 2 + 23y 2 so we are looking for coprime integers x and y
√
such that x + −23y has norm a power of 2 . We will use the larger ring Z[ω] with
√
ω = (1 + −23)/2 since this has unique factorization of ideals, being the ring R∆
for the associated fundamental discriminant −23 . From Section 8.3 we know that the
principal ideal (2) in Z[ω] factors as (2) = P P for P = (2, ω) , with P ≠ P . Since
N(2) = 4 we have N(P ) = N(P ) = 2 , so N(P k ) = 2k . The ideal P is not principal
since there is no element of Z[ω] of norm 2 , for if α in Z[ω] had norm 2 then 2α
√
would be an element of Z[ −23] of norm 8 but the form x 2 + 23y 2 does not take
on the value 8 . Since the class number for discriminant −23 is 3 the class group is
cyclic of order 3 and P generates this group. Thus the powers of P that are principal
ideals are the powers P 3n .
√ √
Suppose the element α = x + −23y of Z[ −23] has norm 2k , so αα = 2k .
k s
Then for ideals we have (α)(α) = P k P and hence (α) = P r P for some r and s with
r + s = k . We have x 2 + 23y 2 = 2k so x and y have the same parity. We want them
to be coprime so this means they are both odd and hence α is divisible by 2 in Z[ω] .
This is saying that (α) is divisible by both P and P since (2) = P P . Thus r > 0 and
s > 0 . On the other hand if r > 1 and s > 1 this would say that (α) was divisible
by (4) and hence α was divisible by 4 in Z[ω] , so x and y would both be even, a
contradiction. Therefore one of r and s must be 1 , and so in the class group where
k−2
P is the inverse of P the ideal (α) must be either 2P k−2 if s = 1 , or 2P if r = 1 .
Since (α) is a principle ideal this implies that k − 2 is a multiple of 3 , say k − 2 = 3m ,
or k = 3m + 2 . Thus the only powers of 2 that could possibly be represented by
x 2 + 23y 2 are the powers 2k with k = 2, 5, 8, · · ·. Obviously 22 is not represented
Section 8.6 — Applications to Forms 327
n 1 2 3 4 5
(x, y) (3, 1) (−7, 3) (−45, 1) (−79, −21) (123, −71)
Bibliography
C. F. Gauss, Disquisitiones Arithmeticae, English trans. Springer-Verlag, 1986 (Latin orig. 1801).
— The first book about quadratic forms.
P. G. L. Dirichlet, Lectures on Number Theory, English trans. AMS, 1999 (German orig. 1863).
— With supplements by R. Dedekind.
A. Hurwitz, Über die Reduktion der binären quadratischen Formen, Math. Annalen 45 (1894),
85–117.
— This article (in German) is where the Farey diagram first appeared.
Other books with coverage of quadratic forms, in approximate order of increasing sophistication:
Quadratic Forms. These are usually divided into three types, but for our purposes it
is useful to split one of the three types into two for a total of four types as defined at
the beginning of Chapter 5. Here are the traditional names with our equivalents:
• definite = elliptic
• indefinite = hyperbolic or 0 - hyperbolic
• semi-definite = parabolic
Besides the convenience of having separate names for hyperbolic and 0 - hyperbolic
forms, the other motivation for the change is that the ordinary meanings of “definite”
and “indefinite” do not seem to convey very well their mathematical meanings.
What we call a symmetry of a quadratic form is more often called an automorph
or automorphism of the form, although the latter terms are sometimes reserved just
for orientation-preserving symmetries. We call a form having an orientation-reversing
symmetry a mirror symmetric form, or a form with mirror symmetry, whereas clas-
sically such forms are called ambiguous, a term that has suffered somewhat in the
translation from Gauss’s original Latin.
Primes. There is uniform agreement about what a prime number is when one is talking
about positive integers, namely a number greater than 1 that is divisible only by itself
and 1 , and for the sake of consistency we use the natural extension of this definition to
other sorts of “integers" considered in this book, namely integers in quadratic fields
√
Q( d) . Thus we call such integers prime if the only way they factor is with one
factor a unit (and they are not units themselves). Over the years it has become more
usual to call numbers with this property irreducible rather than prime, using the term
prime for numbers with the property that if they divide a product, then they must
√
divide one of the factors. For example in the ring Z[ −5] the number 2 is prime
Glossary 331
according to our definition but not according to the standard definition since 2 divides
√ √
6 = (1 + −5)(1 − −5) but does not divide either of these two factors.
We make a similar divergence from standard terminology when we define prime
ideals in Chapter 8.
5 [1, 1, −1]
8 [1, 0, −2]
12 [1, 0, −3]
[3, 0, −1]
13 [1, 1, −3]
17 [1, 1, −4]
20 [1, 0, −5]
21 [1, 1, −5]
[5, 1, −1]
24 [1, 0, −6]
[6, 0, −1]
338 Tables
∆ Q
28 [1, 0, −7]
[7, 0, −1]
29 [1, 1, −7]
32 [1, 0, −8]
[8, 0, −1]
33 [1, 1, −8]
[8, 1, −1]
37 [1, 1, −9]
40 [1, 0, −10]
[2, 0, −5]
Index 339
Index
nonunique prime factorization example 261 reduced basis for a lattice or ideal 285