Squares and Quadratic Reciprocity

Number Theory (part 5): Squares and Quadratic Reciprocity
(by Evan Dummit, 2014, v. 1.00)
Contents
5
Squares and Quadratic Reciprocity
1
5.1
Polynomial Congruences and Hensel's Lemma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1
5.2
Quadratic Residues and the Legendre Symbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4
5.3
Motivation for Quadratic Reciprocity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6
5.4
Proof of Quadratic Reciprocity
8
5.5
Applications of Quadratic Reciprocity
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11
5.5.1
Computing Legendre Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11
5.5.2
For Which
. . . . . . . . . . . . . . . . . . . . . . . . .
12
5.5.3
Primes Dividing Values of a Quadratic Polynomial . . . . . . . . . . . . . . . . . . . . . . . .
13
5.6
The Jacobi Symbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
14
5.7
Some Generalizations of Quadratic Reciprocity
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
17
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
18
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
19
5
p
is
a
a Quadratic Residue Modulo
5.7.1
Quadratic Reciprocity in
5.7.2
Quartic Reciprocity in
5.7.3
Quadratic Reciprocity in
Z[i]
Z[i]
Fp [x]
p?
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
20
Squares and Quadratic Reciprocity
In this chapter, we discuss a number of results relating to the squares modulo
m.
We begin with some general tools
for solving polynomial congruences modulo prime powers. Then we study in detail the structure of squares modulo
p
a
and modulo
modulo
p
m,
and construct and analyze properties of the Legendre symbol, determining when a residue class
is a square.
Our main goal is to prove Gauss's celebrated law of quadratic reciprocity, which describes an unexpected and
stunning relation between when
p
is a square modulo
q
and when
q
is a square modulo
p.
We provide a detailed
motivation, in order to build up to the statement of the theorem, and then discuss a number of applications to
related number-theoretic questions. We then discuss a few dierent ways of generalizing quadratic reciprocity: we
construct the Jacobi symbol and discuss squares modulo
in
Z[i]
5.1
•
and
m for non-prime m, and then examine quadratic reciprocity
Fp [x].
Polynomial Congruences and Hensel's Lemma
We discussed briey the problem of solving higher-degree congruences in an earlier chapter:
Remainder Theorem reduces the problem of solving any polynomial congruence
the individual congruences
•
q(x) ≡ 0
(mod
pd ),
To solve a polynomial congruence of the form
p
d
descends to a solution modulo
◦
p
where the
q(x) ≡ 0
pd ),
pd
and so forth.
1
to solving
m.
p).
is to start by nding all solutions modulo
p2 ,
the Chinese
m)
we rst observe that any solution modulo
(namely, by considering it modulo
Thus, one way to nd the solutions modulo
(mod
are the prime-power divisors of
(mod
of these solutions to get all of the solutions modulo
p3 ,
pd
q(x) ≡ 0
p, then lift
each
then lift these to obtain all solutions modulo
•
Example: Solve the congruence
◦
x3 + 4x ≡ 4
(mod
73 ).
We rst solve the congruence modulo 7.
∗
By trying all the residue classes, we see that
x3 + 4x ≡ 4 (mod 7) has the single solution x ≡ 3 (mod
7).
◦
Next we lift to nd the solutions modulo
72 :
any solution must be of the form
3
∗
2
Plugging in yields (3 + 7k) + 4(3 + 7k) ≡ 4 (mod 7
27 + 9 · 7k + 12 + 28k ≡ 4 (mod 72 ).
∗ Rearranging yields 21k ≡ 14 (mod 72 ).
∗ Cancelling the factor of 7 yields 3k ≡ 2 (mod 7), which
∗ Hence we obtain x ≡ 24 (mod 49).
◦
Now we lift to nd the solutions modulo
∗
∗
∗
∗
◦
•
Plugging in yields
Hence we obtain
has the single solution
3
7
k≡3
(mod 7).
x = 24 + 49k
for some
k.
).
147k ≡ 147 (mod 73 ).
single solution k ≡ 1 (mod 7).
x ≡ 73
3k ≡ 3
73 ).
yields
(mod
x ≡ 73
x3 + 4x ≡ 12
(mod 7), which has the
(mod
73 ).
73 ).
(mod
We rst solve the congruence modulo 7.
x3 + 4x ≡ 5
By trying all the residue classes, we see that
x≡5
∗
∗
∗
∗
∗
∗
x≡1
(mod 7)
72 :
any solution must be of the form
x = 1 + 7k
or
k.
for some
(1 + 7k)3 + 4(1 + 7k) ≡ 12 (mod 72 ), which, after expanding, is
2
equivalent to 1 + 3 · 7k + 4 + 28k ≡ 12 (mod 7 ).
2
2
Rearranging yields 49k ≡ 7 (mod 7 ), which is equivalent to 0 ≡ 7 (mod 7 ). This has no solutions.
3
2
In the second case, plugging in yields (5 + 7k) + 4(5 + 7k) ≡ 12 (mod 7 ), which, after expanding,
2
is equivalent to 125 + 15 · 7k + 20 + 28k ≡ 12 (mod 7 ).
2
Rearranging yields 14k ≡ 14 (mod 7 ).
Cancelling the factor of 7 yields 2k ≡ 2 (mod 7), which has the single solution k ≡ 1 (mod 7).
Hence we obtain x ≡ 12 (mod 49).
In the rst case, plugging in yields
Now we lift to nd the solutions modulo
∗
∗
∗
∗
∗
(mod 7) has two solutions,
(mod 7).
Next we try to lift to nd the solutions modulo
x = 5 + 7k
◦
72
Cancelling the factor of
and
◦
(mod
k.
), which, after expanding, is equivalent to
any solution must be of the form
2
(24 + 7 k) + 4(24 + 7 k) ≡ 4
Hence there is a unique solution:
∗
◦
3
for some
After expanding, reducing, and rearranging, we obtain the congruence
Example: Solve the congruence
◦
•
2
73 :
x = 3 + 7k
2
3
any solution must be of the form
2
Some arithmetic and rearranging eventually gives the congruence
72 yields 2k ≡ 3
x ≡ 257 (mod 73 ).
Cancelling the factor of
Hence we obtain
x = 12 + 49k
for some
k.
3
(12 + 7 k) + 4(12 + 7 k) ≡ 4 (mod 7 ).
123 + 3 · 12 · 72 k + 4 · 12 + 4 · 72 k ≡ 4 (mod 73 ).
Plugging in yields
Expanding gives
73 :
Hence there is a unique solution:
x ≡ 257
98k ≡ 294
(mod 7), which has the single solution
(mod
73 ).
k ≡ 5 (mod
(mod
7).
73 ).
72 , which in turn lifted
2
solutions modulo 7 . We
In the examples above, two of the solutions modulo 7 lifted to a single solution modulo
to a single solution modulo
7
3
. However, one solution modulo 7 failed to yield any
would like to know what causes the lifting process to fail.
◦
To motivate our proof of the general answer, consider the polynomial
have a solution
◦
◦
x≡a
Then we substitute
(mod
p)
x = a + pk
3
to
q(x) ≡ c
(mod
p)
q(x) = x3 + 4x
into the equation, and look for solutions to
This is equal to (a + pk) + 4(a + pk),
a3 + 3a2 pk + 4a + 4pk modulo p2 .
and suppose we
that we would like to lift to a solution modulo
q(a + pk) ≡ 0
(mod
p2 .
p2 ).
which we can expand out using the binomial theorem to obtain
2
◦
Rearranging this shows that we need to solve the equation
(a3 + 4a) + (3a2 + 4)pk ≡ c
(mod
p2 ).
a3 +4a ≡ c (mod p), we can rearrange the above congruence and then divide through
a3 + 4a − c
+ (3a2 + 4)k ≡ 0 (mod p).
by p to obtain the congruence
p
◦ We see that this congruence will have a unique solution for k as long as 3a2 + 4 6≡ 0 (mod p).
◦
Since by hypothesis,
◦
We recognize the expression
3a2 + 4
should expect that our ability to lift a solution
the value of the derivative
•
q 0 (a).
q 0 (a). So the above computations suggest that we
x ≡ a (mod p) to a solution modulo pd will depend on
as the derivative
Indeed, this is precisely what happens in general:
q(x) is a polynomial with integer coecients. If q(a) ≡ 0 (mod pd ) and
q (a) 6≡ 0 (mod p), then there is a unique k (modulo p) such that q(a + kpd ) ≡ 0 (mod q d+1 ). Explicitly, if u
q(a)
0
.
is the inverse of q (a) modulo p, then k = −u ·
pd
Theorem (Hensel's Lemma): Suppose
0
◦
The idea of the proof is the same as in all of the examples we discussed above: to determine when we can
pd+1 , we substitute x = a + pd k into the equation, and look for solutions
q(a + p k) ≡ 0 (mod pd+1 ). The only diculty is expanding out q(a + pd k) modulo
lift to nd a solution modulo
k to the
pd+1 .
d
congruence
x ≡ a (mod pd ) is a solution to the congruence q(x) ≡ 0 (mod pd ), where q(x) has degree
q(a)
r. (By denition, note that this means d is an integer.)
p
r
r
X
X
cn · nxn−1 .
cn xn , and observe that q 0 (x) =
◦ Set q(x) =
◦
Proof: Suppose
n=0
n=0
∗
∗
But since all of the binomial coecients are
simply
◦
(a+pd k)n = an +n·pd k·an−1 +p2d ·[other terms].
d+1
d n
integers, the reduction modulo p
of (a + p k) is
First observe that by the binomial theorem, we have
an + (n · an−1 )pd k .
We then compute
q(a + pd k) ≡
≡
≡
r
X
n=0
r
X
n=0
r
X
cn (a + pd k)n
cn an + pd k
Hence, solving
◦
Dividing through by
◦
This congruence has
r
X
pd+1 )
(mod
cn · n an−1
(mod
pd+1 )
n=0
d
0
q(a) + p k · q (a)
(mod
pd+1 ).
q(a) + pd k · q 0 (a) ≡ 0 (mod pd+1 ).
q(a)
pd yields the equivalent congruence k · q 0 (a) ≡ − d (mod p).
p
0
exactly one solution for k , by the assumption that q (a) 6≡ 0 (mod p), and its value
q(a + pd k) ≡ 0
◦
pd+1 )
cn an + (n · an−1 )pd k
n=0
=
(mod
(mod
pd+1 )
is equivalent to solving
is as claimed.
◦
Hence: the solution
x≡a
(mod
pd )
lifts to a unique solution
x ≡ a + pd k
(mod
pd+1 ),
whose value is as
claimed.
◦
Remark: The presence of the derivative
q 0 (a)
is not accidental. Instead of using the binomial theorem,
we could have instead written out the Taylor expansion of
q(x + b) = q(x) + b q 0 (x) + b2
Since the higher derivatives of
reducing modulo
d+1
p
q(x)
q(x + b):
q 00 (x)
q 000 (x)
q (r) (x)
+ b3
+ · · · + br
+ ··· .
2!
3!
r!
are all zero, this is actually a nite sum. If we then set
b = pd k ,
eliminates everything except the rst two terms. (This is not completely obvious
because there are factorials in the denominators, but it can be shown that
3
q (r) (a)/r! is always an integer.)
•
Using the explicit description of the parameter
p),
any solution
◦
to
q(x) ≡ 0
(mod
p)
•
will lift to a unique solution
x ≡ aj
aj+1 = aj − u · q(aj ),
(mod
(mod
where
is the inverse of
q 0 (a)
j
p
u
) for
p.
Observe that this is precisely the same procedure as in Newton's method for nding a sequence converging
to a root of a dierentiable function
5.2
q 0 (a) 6≡ 0
any j .
from Hensel's lemma, we see that as long as
This sequence of residues is explicitly given by
modulo
◦
x=a
k
f (x).
Quadratic Residues and the Legendre Symbol
We now turn our attention to studying the zeroes of quadratic polynomials modulo
◦
m.
By the Chinese Remainder Theorem, this is equivalent to studying the zeroes of quadratic polynomials
modulo prime powers.
◦
Furthermore, Hensel's lemma allows us (essentially) to reduce to the case of nding the zeroes of quadratic
polynomials modulo
p.
In this case, since we are now working over a eld, we have the added advantage
of knowing that there will be at most 2 zeroes.
◦
So let
f (x) = ax2 + bx + c,
and consider the general quadratic congruence
then this congruence is easy to solve, so also assume
◦
If
a ≡ 0 (mod p), then the congruence f (x) ≡ 0
p), then a is invertible modulo p.
◦
Now we can complete the square and write
(mod
◦
p)
is equivalent to
Solving for
p
(mod
f (x) ≡ 0
(mod
p).
If
p=2
a 6≡ 0
(mod
is odd.
p)
reduces to a linear congruence. If
4af (x) = (2ax+b)2 +(4ac−b2 ): then the congruence f (x) ≡ 0
(2ax + b) ≡ (b − 4ac) (mod p), since 4a is invertible modulo p.
2
2
x then amounts to nding all solutions to y 2 ≡ D (mod p), where y = 2ax+b and D = b2 −4ac.
In other words, aside from some minor issues that could arise in the application of Hensel's lemma, solving
a general quadratic equation is equivalent to computing square roots.
•
An obvious rst question is: how can we determine whether the congruence
y2 ≡ D
(mod
p)
has a solution
at all?
•
a is a unit modulo m, we say a is a quadratic residue modulo m if there is
m). If there is no such b, then we say a is a quadratic nonresidue modulo m.
Denition: If
b2 ≡ a
◦
(mod
some
b
such that
It is a matter of taste whether to include nonunits in the denition of quadratic residues/nonresidues.
For the moment, we will only consider units.
•
It is straightforward to list the quadratic residues modulo
◦
◦
m
by squaring all of the invertible residue classes.
Example: Modulo 5, the quadratic residues are 1 and 4, while the nonresidues are 2 and 3.
Example: Modulo 13, the quadratic residues are 1, 4, 9, 3, 12, and 10, while the nonresidues are 2, 5, 6,
7, 8, and 11.
◦
Example: Modulo 21, the quadratic residues are 1, 4, and 16, while the nonresidues are 2, 5, 8, 10, 11,
13, 17, 19, and 20.
◦
Example: Modulo 25, the quadratic residues are 1, 6, 11, 16, 21, 4, 9, 14, 19, and 24, while the nonresidues
are 2, 7, 12, 17, 22, 3, 8, 13, 18, and 23.
•
We note that if
m
if and only if
m is composite, then (by the Chinese Remainder
a is a quadratic residue modulo each of the prime
Theorem)
a
is a quadratic residue modulo
powers dividing
m.
Using Hensel's lemma,
we can reduce things further:
•
Proposition: If
p
is an odd prime, then a unit
a quadratic residue modulo
◦
a
is a quadratic residue modulo
pd
for
d≥1
if and only if
a
is
p.
Proof: Clearly, if there exists a
b such that a ≡ b2
is trivial.
4
(mod
pd ) then a ≡ b2
(mod
p), so the forward direction
◦
◦
For the other direction, suppose
For
a
is a unit and there exists some
2
q(x) = x − a, we then want to apply Hensel's lemma
q(x) ≡ 0 (mod p) to a solution modulo pd .
b
a ≡ b2
with
p).
(mod
to lift the solution
x ≡ b
(mod
p)
of the
congruence
◦
We can do this as long as
and because
•
p
q 0 (b) 6= 0
(mod
p):
q 0 (b) = 2b,
but
and this is nonzero because
b 6≡ 0
(mod
p)
is odd.
Thus, we are essentially reduced to considering quadratic residues modulo
p.
A rst observation is that exactly
half of the invertible residue classes are quadratic residues:
•
Proposition: If
p
is an odd prime, the quadratic residues modulo
the invertible residue classes modulo
◦
Proof: If
a ≡ ±b
p
•
◦
Furthermore, the other
if
a
◦
p
implies
p|(a − b)
or
p|(a + b);
thus,
2
p−1
are distinct modulo p.
2
2
p+1
2
squares
, ... , (p − 1) are equivalent
2
12 , 22 ,
We conclude that
Denition: If
12 , 22 ,
... ,
p−1
2
2
. Hence, half of
a2 ≡ b2
(mod
p)
is equivalent to
p).
◦
k 2 ≡ (p − k)2
are
are quadratic residues, and the other half are nonresidues.
p|(a2 − b2 )
is prime, then
(mod
p
p
(mod
... ,
to these in reverse order, since
p).
a
p
is an odd prime, the Legendre symbol
is a quadratic nonresidue, and 0 if
is dened to be 1 if
a
is a quadratic residue,
−1
p|a.
The notation for the Legendre symbol is somewhat unfortunate, since it is the same as that for a standard
fraction.
a
to emphasize that we are referring to a Legendre symbol
When appropriate, we may write
p L
rather than a fraction.
◦
Example: We have
2
3
= +1,
= −1,
7
7
and
0
= 0,
7
since 2 is a quadratic residue and 3 is a
nonresidue modulo 7.
◦
Example: We have
3
13
=
−3
13
= +1, and
2
15
= 1, since 3 and −3 are quadratic residues modulo
13, while 2 is not.
◦
•
Note that the quadratic equation
Theorem (Euler's criterion): If
(mod
◦
◦
has exactly
1+
a
p
is an odd prime, then for any residue class
solutions modulo
a,
it is true that
p.
a
= a(p−1)/2
p
We will start with a useful proposition, whose proof we present separately.
Proposition: If
∗
∗
logu (a)
p
is an odd prime and
is a primitive root modulo
p,
then
a
is a quadratic residue if and
logu (a) = 2k is even, then clearly a = u2k = (uk )2 is a quadratic residue.
2
k
Conversely, suppose a ≡ b (mod p). Then since u is a primitive root, we can write b = u
k : then a = u2k , so logu (a) is even.
Proof: If
p|a
p.
Proof (of Theorem): If
First suppose
∗
u
is even.
primitive root modulo
◦
p)
(mod
p).
only if
◦
p
x2 ≡ a
a
then the result is trivial, so assume
is a quadratic residue, so that
a
is a unit modulo
a
= +1.
p
Then by the proposition above, we know that
5
a = u2k
for some integer
k.
p
for some
and let
u
be a
(p−1)/2
∗ We compute a
≡ (u2k )(p−1)/2 = (up−1 )k ≡ 1k = 1
a
.
p
a
◦ Now suppose a is a quadratic nonresidue, so that
= −1.
p
(mod
p),
which agrees with the value of
a = u2k+1 for some integer k .
We compute a
≡ (u
)
= (up−1 )k · u(p−1)/2 ≡ u(p−1)/2 .
(p−1)/2
2
Now observe that x = u
has the property that x ≡ 1 (mod p).
The two solutions to this quadratic are x ≡ ±1 (mod p), but x 6≡ 1 (mod p)
∗
∗
∗
∗
Then by the proposition above, we know
(p−1)/2
2k+1 (p−1)/2
since otherwise
u
would
not be a primitive root.
∗
u(p−1)/2
≡
−1
a
value of
.
p
Hence
the
•
p),
a(p−1)/2 ≡ −1
meaning that
(mod
p)
as well, and this agrees with
Euler's criterion provides us with a fairly ecient way to calculate Legendre symbols, since it is easy to nd
a(p−1)/2
•
(mod
mod
p
with successive squaring.
Example: Determine whether 5 is a quadratic residue or nonresidue modulo 29.
5
29
= 514
◦
By Euler's criterion,
◦
With successive squaring, we see that
(mod 29).
52 ≡ −4, 54 ≡ −13, 58 ≡ −5,
so
514 ≡ (−4) · (−13) · (−5) ≡ 1
(mod 29).
◦
•
+1,
Thus, since the Legendre symbol is
we see that 5 is a quadratic residue mod 29.
Euler's criterion also yields an extremely useful corollary about the product of Legendre symbols:
•
Corollary: If
◦
p
is a prime, then for any
a
and
b,
ab
p
a
b
=
·
.
p
p
In particular: the product of two quadratic residues is a quadratic residue, the product of a residue and
nonresidue is a nonresidue, and (much more unexpectedly) the product of two nonresidues is a residue.
ab
p
(p−1)/2
= a(p−1)/2 b(p−1)/2 =
a
b
·
.
p
p
◦
Proof: Simply use Euler's criterion to write
◦
Remark (for those who like group theory): This corollary is saying that the Legendre symbol is a group
homomorphism from the group
(Z/pZ)×
= (ab)
of units modulo
p
{±1}.
−1 under
this map is the coset
p
is a quadratic residue
to the group
under this map is the coset of quadratic residues, while the preimage of
The preimage of
+1
of quadratic nonresidues.
5.3
•
Motivation for Quadratic Reciprocity
Euler's criterion provides us with a way to compute whether a residue class
a
modulo
or nonresidue.
•
We will now examine the reverse question: given a particular value of
residue? For one value of
•
Proposition:
−1
a,
a,
for which primes
p
is
a
a quadratic
we can answer this question immediately:
is a quadratic residue modulo
p
if and only if
p=2
or
p≡1
(mod 4).
◦
Proof: Clearly
(−1)(p−1)/2 ,
•
For most
a,
−1
is a quadratic residue mod 2. If
and notice that this is
+1
when
p
is odd, apply Euler's criterion to write
(p − 1)/2
is even and
−1
when
(p − 1)/2
−1
p
=
is odd.
however, the answer is far from obvious. Let us examine a few particular values of
a,
modulo
primes less than 50, to see whether there are any patterns. (We can do the computations with Euler's criterion,
or by making a list of all the squares modulo
p.)
6
◦
Consider
47, while
◦
a = 2. Some short calculations show that a is
a is a nonresidue modulo 3, 5, 11, 13, 19, 29,
residue modulo 11, 13, 23, 37, and
a = 5. Some short calculations show that a is a quadratic
a is a nonresidue modulo 3, 7, 13, 17, 23, 37, 43, and 47.
residue modulo 11, 19, 29, 31, and
a = 7. Some short calculations show that a is a quadratic
a is a nonresidue modulo 5, 11, 13, 17, 23, and 41.
residue modulo 3, 23, 31, 37, and
47, while
Consider
a = 13.
Consider
41, while
◦
◦
Consider
while
•
37, and 43.
a = 3. Some short calculations show that a is a quadratic
a is a nonresidue modulo 5, 7, 17, 19, 29, 31, 41, and 43.
Consider
47, while
◦
a quadratic residue modulo 7, 17, 23, 31, 41, and
a
Some short calculations show that
a
is a quadratic residue modulo 3, 17, 23, and 29,
is a nonresidue modulo 5, 7, 11, 19, 31, 37, 41, and 47.
We can see a few patterns in these results.
◦
For
a=5
there is an obvious pattern: the primes where 5 is a quadratic residue all end in 1 or 9, while
the primes where 5 is a nonresidue all end in 3 or 7.
◦
We see that the primes where 5 is a quadratic residue are 1 or 4 modulo 5, while the primes where 5 is a
nonresidue are 2 or 3 modulo 5. We also notice the rather suspicious fact that 1 and 4 are the quadratic
residues modulo 5, while 2 and 3 are the nonresidues.
◦
This suggests searching for a similar pattern with a small modulus in the other examples. Doing this
eventually uncovers the fact that all of the primes where 2 is a quadratic residue are either 1 or 7 modulo
8, while the primes where 2 is a nonresidue are all 3 or 5 modulo 8.
◦
Similarly, we can see that all of the primes where 3 is a quadratic residue are either 1 or 11 modulo 12,
while the primes where 3 is a nonresidue are all 5 or 7 modulo 12. However, there is nothing obvious
about how these residues are related, unlike in the case
a = 5.
◦
A similar pattern does not seem to be as forthcoming for when 7 is a quadratic residue.
◦
We can see that the primes where 13 is a quadratic residue are 3, 4, or 10 modulo 13, and the primes
where 13 is a nonresidue are 2, 5, 6, 7, 8, or 11 modulo 13. Notice that 3, 4, and 10 are all quadratic
residues modulo 13, while 2, 5, 6, 7, 8, and 11 are nonresidues.
◦ It
that we have found natural patterns for a = 5 and a = 13: for these two
seems
p
5
= 1, and similarly for 13.
= 1 if and only if
p
5
◦ However, we have not found such a reciprocity relation for a = 3 and a = 7.
•
primes, it appears that
Let us try looking at negative integers, to see if results are more obvious there:
◦
For
a = −3, some short calculations show that a is a quadratic residue modulo 7, 13, 19, 31, and 37,
a is a nonresidue
a much more natural pattern:
modulo 5, 11, 17, 23, 29, 41, and 47. This shows
a
a
= 1 are all 1 modulo 3, while the values where
= −1 are all 2 modulo 3.
primes with
p
p
while
the
◦
Notice that 1 is a quadratic residue modulo 3, and 2 is a nonresidue.
◦
For a = −7, some short calculations show that a is a quadratic residue modulo 11, 23, 29, and 37, while
a
isa nonresidue modulo 3, 5, 13, 17, 19, 31, 41, and 47. Again,
we see a pattern: the primes where
a
a
= 1 are all 1, 2, or 4 modulo 7, while the values where
= −1 are all 3, 5, or 6 modulo 7.
p
p
◦
Notice that the quadratic residues modulo 7 are 1, 2, and 4, while the nonresidues are 3, 5, and 6.
◦
Based on this evidence, it seems that
only if
•
p
7
−3
p
=1
if and only if
p
3
= 1,
and similarly
−7
p
=1
if and
= 1.
We notice that the reciprocity relation appears to be dierent for the primes 5 and 13 versus the primes 3
and 7.
◦
Based on our previous ideas of looking for simple congruence relations, we observe that 3 and 7 are both
3 modulo 4, while 5 and 13 are both 1 modulo 4.
7
p
q
·
= 1, if q 6= p is any odd prime. Note that this is symmetric
q
p
in p and q , so this should actually hold if p or q is 1 modulo 4.
−p
q
−p
−1
◦ If p, q ≡ 3 (mod 4), it appears that
·
= 1, if q 6= p is any odd prime. Since
=
·
q
p
q
q −1
p
q
p
, and we know that
= −1 from earlier, we can rewrite this relation as
·
= −1.
q
q
q
p
p
q
• Thus: it appears that
·
= 1 if p or q is 1 mod 4, and is −1 if both p and q are 3 mod 4.
q
p
◦
If
p≡1
◦
◦
◦
This result is called the law of quadratic reciprocity.
(mod 4), it appears that
It was stated (without proof ) by Euler in 1783, and the rst correct proof was given by Gauss in 1796.
This theorem was one of Gauss's favorites: given Gauss's prodigious mathematical output, this is a very
strong statement!
(He actually published six dierent proofs during his lifetime, and two more were
found among his notes. There are now over 200 dierent proofs that have been collected.)
5.4
•
Proof of Quadratic Reciprocity
The proof of quadratic reciprocity we will give is due to Eisenstein, and is a simplication of one of Gauss's
original proofs. The rst ingredient is the following lemma:
•
Lemma (Gauss's Lemma): If
of integers among
◦
a, 2a,
... ,
p
is an odd prime and
p−1
a
2
∗
then
a
= (−1)k ,
p
p
whose least positive residue modulo
r1 , ... , rk be the
p−1
k+l =
.
2
◦ Observe that 0 < p − ri < p/2,
all distinct from the sj :
Proof:
p - a,
Let
residues bigger than
p
2
s1 ,
and
...
where
k
is equal to the number
is bigger than
,
sl
p
.
2
be the other residues, where
and that each of these is distinct. Furthermore, these values
p − ri
are
p − ri = sj , then if ri ≡ c1 a (mod p) and sj ≡ c2 a (mod p), then we would have a(c1 + c2 ) ≡ 0
p).
∗ So since a is a unit, this implies c1 + c2 ≡ 0 (mod p). But this cannot happen, because c1 and c2 are
p−1
.
both between 1 and
2
p−1
◦ Therefore, the
values among the p − ri and sj are all distinct and between 1 and p/2. Thus, they
2
p−1
must simply be 1, 2, ... ,
in some order.
2
◦ Thus, we may write
If
(mod
1 · 2 · ··· ·
p−1
2
k
Y
≡
(p − ri ) ·
i=1
l
Y
sj
(mod
p)
j=1
≡ (−1)k
k
Y
l
Y
ri ·
i=1
sj
(mod
p)
j=1
(p−1)/2
≡ (−1)k
Y
(na)
(mod
p)
n=1
p−1
(mod p)
2
a
≡ a(p−1)/2 ≡ (−1)k
p
≡ (−1)k a(p−1)/2 · 1 · 2 · · · · ·
and then cancelling the common
p−1
!
2
from both sides yields
claimed.
8
(mod
p),
as
•
•
We can use Gauss's lemma to compute the Legendre symbol
Corollary:
If
p
2
= −1
p
if
p ≡ 3, 5
◦
is an odd prime,
a.
for small values of
2
= 1
p
Equivalently,
if
p ≡ 1, 7
(mod 8), and
(mod 8).
Proof: By Gauss's lemma, we need only compute whether the number of residues among 2, 4, ... ,
p−1
◦
2
2
= (−1)(p −1)/8 .
p
a
p
If
that lie between
p/2
p
and
is even or odd. (Conveniently, they already all lie between 0 and
p − 3,
p.)
p ≡ 1 (mod 4), the smallest such residue is (p + 3)/2 and the largest is p − 1, so the number is (p − 5)/4.
p ≡ 5 (mod 8) and even if p ≡ 1 (mod 8).
This is odd if
◦
p ≡ 3 (mod 4), the smallest such residue is (p + 1)/2 and the largest is p − 1, so the number is (p − 3)/4.
p ≡ 3 (mod 8) and even if p ≡ 7 (mod 8).
5
3
,
, and so forth. The only obstacle is the rather
could make a similar analysis to compute
p
p
If
This is odd if
•
We
involved roundo analysis required to make an accurate accounting of how many residue classes reduce to
lie in the interval
[p/2, p].
Rather than doing this case-by-case, we will instead write down a formula for the
general result:
•
Lemma (Eisenstein's Lemma):
(p−1)/2 s=
X
j=1
◦
ja
p
p
is an odd prime and
a
is odd with
p - a,
then
a
= (−1)s
p
where
.
Remark: The notation
n ≤ x.
If
bxc
denotes the greatest integer function, dened as the largest integer
n
with
(In fact, this function was rst introduced by Gauss in the course of one of his proofs of quadratic
reciprocity!)
◦
Proof: By Gauss's lemma,
p−1
a
2
a
= (−1)k
p
whose least positive residue modulo
where
p
(p−1)/2 ◦
Thus, all we need to do is show that
X
j=1
◦
residues, where
... ,
◦
k+l =
p−1
.
2
Thus, we have
kp −
k
X
p−1
,
2
rj +
i=1
◦
r1 ,
As in our earlier proof, we let
Also, observe that the
ri
,
rk
sj =
j=1
is bigger than
ja
p
sj
k
X
◦
Thus, we also have
◦
Subtracting the rst
p
a, 2a,
...
p
.
2
is equivalent to
(p − rj ) +
i=1
k
mod 2.
p
and s1 , ... , sl be the other
2
p − ri and sj are a rearrangement of 1, 2,
l
X
(p−1)/2
sj =
j=1
X
j=1
j=
p2 − 1
.
8
are the remainders obtained when we divide
bja/pc.
ja
by
p,
for
1≤j≤
p−1
.
2
(p−1)/2
X
ja
p2 − 1
+
rj +
sj =
ja = a
.
p
8
j=1
i=1
j=1
j=1


(p−1)/2 k
X
X
ja
p2 − 1
sum from the second sum yields p 
− k + 2
rj = (a − 1)
.
p
8
j=1
i=1
X
k
X
,
be the residues bigger than
The quotient when we do the division is clearly
(p−1)/2 is equal to the number of the residues
and we note that the elements
l
X
and
...
k
l
X
9
◦
Since we only care about
a−1
and
2
k
X
k
modulo 2, we can reduce everything mod 2: since
(p−1)/2 rj
is even, while
p
X
is odd, we obtain
i=1
•
j=1
ja
≡k
p
p2 − 1
8
is an integer and
(mod 2), as desired.
The above computation gives a seemingly useless expression for the Legendre symbol in terms of a sum involving the oor function, but it turns out that we can use it to prove quadratic reciprocity almost immediately:
•
Theorem (Quadratic Reciprocity): If
Equivalently,
◦
◦
p
q
·
=1
q
p
if
p
or
Proof: By Eisenstein's lemma,
p
q
and
q
are distinct odd primes, then
is 1 (mod 4), and
p
q
·
= (−1)n ,
q
p
The rst sum is the number of lattice points
(x, y)
The following gure illustrates this in the case
if
(p−1)/2 where
n=
X
j=1
lying below the line
p
and
q
are both 3 (mod 4).
(q−1)/2
X kp jq
+
.
p
q
k=1
q
y= x
p
, with
1≤x≤
y=
q
x
p
with
1≤x≤
p−1
.
2
p
x.
q
q
y= x,
p
The second sum can be interpreted in a similar way as the number of lattice points below the line
More fruitfully, we can view it as the number of lattice points
with
1≤y≤
q−1
.
2
p−1
.
2
p = 13, q = 11:
Figure 1: The lattice points underneath
◦
p
q
·
= −1
q
p
p
q
(p−1)(q−1)/4
·
= (−1)
.
q
p
(x, y)
The following gure illustrates this in the case
10
lying to the left of the line
p = 13, q = 11:
y=
Figure 2: The lattice points to the left of
◦
∗
1≤x≤
q−1
p−1
, 1 ≤ y ≤
.
2
2
if
Hence, we conclude that
X
j=1
5.5.1
•
q−1
.
2
1≤y≤
(x, y)
lying on
py = qx
y=
q
x
p
must have
p−1 q−1
·
2
2
such lattice points.
inside this rectangle: since
q|y
and
p|x,
p
and
q
and this is not possible
p−1
1≤x≤
.
2
(p−1)/2 •
with
Clearly, there are
Note that there are no lattice points lying on the line
are prime, any lattice point
5.5
q
x
p
As suggested by the picture, the union of these two sets of points yields all of the lattice points in the
rectangle bounded by
◦
y=
(q−1)/2
X kp p − 1 q − 1
jq
+
=
·
,
p
q
2
2
yielding the result.
k=1
Applications of Quadratic Reciprocity
In this section, we discuss several ways we can use quadratic reciprocity.
Computing Legendre Symbols
The most immediate application of quadratic reciprocity is to give another method for computing Legendre
symbols.
•
Example: Determine whether 31 is a quadratic residue modulo 47.
31
47
◦
We want to nd
◦
By quadratic reciprocity, since both 47 and 31 are primes congruent to 3 (mod 4), we have
.
−
◦
•
47
31
=−
16
31
= −1,
since 16 is clearly a quadratic residue.
Thus, 31 is not a quadratic residue modulo 47.
Example: Determine whether 357 is a quadratic residue modulo 661.
◦
Since
357 = 3 · 7 · 17,
we want to nd
357
661
=
11
3
661
7
17
·
·
661
661
.
31
47
=
◦
By quadratic reciprocity, since 661 is a prime congruent to 1 (mod 4), we then have
3
=
661
7
=
661
17
=
661
◦
•
Thus,
357
661
661
1
=
= +1
3
3
661
3
7
1
=
=−
=−
= −1
7
7
3
3
661
−2
−1
2
=
=
·
= (+1) · (+1) = +1
17
17
17
17
= −1,
so 357 is not a quadratic residue modulo 661.
One drawback of using quadratic reciprocity in this way is that we need to factor the top number every time
we ip and reduce, since quadratic reciprocity only makes sense when both terms are primes. (We also need
to remove factors of 2 and
◦
5.5.2
−1,
although this is much more trivial.)
We will x this problem when we dene the Jacobi symbol.
For Which
p
is
a
a Quadratic Residue Modulo
p?
•
Another application is determining, given a particular value of
•
Example: Characterize the primes for which
3
◦
We want to compute
◦
By quadratic reciprocity, we know that if
◦
∗
Therefore, in this case, we see that
Also, if
3
p≡1
p≡3
is
+1
if
for which primes
p
is
a
a quadratic residue.
is a quadratic residue.
p 6= 3.
Note that
p≡1
p≡1
(mod 4), then
p
3
=
.
p
3
−1 if p ≡ 2 (mod 3).
3
= +1 only when p ≡ 1
p
(mod 3), and
(mod 4) and
p≡1
(mod 3) i.e.,
(mod 4) and
p≡2
(mod 3) i.e.,
(mod 12).
(mod 4), then
p
p
3
=−
.
p
3
∗
As above,
∗
Therefore, in this case, we see that
when
◦
p
for
∗
when
•
3
,
p
a,
3
p ≡ 11
is
+1
if
p≡1
−1 if p ≡ 2 (mod 3).
3
= +1 only when p ≡ 3
p
(mod 3), and
(mod 12).
We conclude that 3 is a quadratic residue modulo
p
precisely when
p≡1
6 is a quadratic residue.
6
2
3
We want to compute
=
·
, for p 6= 2, 3.
p
p
p
3
From the above computations, we know that
= +1 when p ≡ 1 or
p
when p ≡ 5 or 7 (mod 12).
2
2
We also know that
= +1 when p ≡ 1 or 7 (mod 8), and
= −1
p
p
6
Thus,
= +1 in the following cases:
p
or 11 (mod 12).
Example: Characterize the primes for which
◦
◦
◦
◦
12
11 (mod 12), and
when
p≡3
3
= −1
p
or 5 (mod 8).
3
2
=
= +1:
p
p
p ≡ 1, 23 (mod 24).
3
2
∗
=
= −1:
p
p
p ≡ 5, 19 (mod 24).
∗
◦
5.5.3
•
then
p ≡ 1, 11
then
p ≡ 5, 7
(mod 12) and
(mod 12) and
Therefore, 6 is a quadratic residue modulo
p
p ≡ 1, 7
(mod 8). Solving these modulo 24 yields
p ≡ 3, 5
(mod 8). Solving these modulo 24 yields
precisely when
p ≡ 1, 5, 19, 23
(mod 24).
Primes Dividing Values of a Quadratic Polynomial
Another more surprising result of quadratic reciprocity is that we can characterize the primes dividing the
values taken by a quadratic polynomial.
◦
This should be unexpected, because polynomials can combine addition and multiplication in arbitrary
ways.
◦
There is no especially compelling reason, a priori, to think that the primes dividing the values of, say,
the polynomial
q(x) = x2 + x + 7,
should have any identiable structure at all: for all we know, the set
of primes dividing an integer of the form
•
n2 + n + 7
could be totally arbitrary.
Exanple: Characterize the primes dividing an integer of the form
◦
It is not hard to see that
◦
Now suppose that
p
n2 + n + 7
n2 + n + 7 ,
for
n
an integer.
is always odd, so 2 is never a divisor.
is an odd prime and that
n2 + n + 7 ≡ 0
(mod
p).
2
◦
We multiply by 4 and complete the square to obtain
◦
If p = 3, this clearly
p ≥ 5.
3 −27
−1
3
−1
3
We compute
=
·
=
·
.
p
p
p
p
p
−1
is +1 if p ≡ 1 (mod 4) and is −1 if p ≡ 3 (mod 4).
From earlier, we know that
p
3
3
We also showed that
= +1 when p ≡ 1 or 11 (mod 12), and
= −1 when p ≡ 5 or 7 (mod 12).
p
p
−3
Hence,
= +1 precisely when p ≡ 1 (mod 6).
p
Since
p is odd,
there will be a solution for
(2n + 1) ≡ −27
(mod
p).
n if and only if −27 is a square modulo p.
holds, so now assume
◦
◦
◦
◦
◦
Thus, by the above, we conclude that a prime
p=3
or when
p≡1
p
divides an integer of the form
n2 + n + 7,
Using the characterization of the prime divisors of
•
Proposition: There are innitely many primes congruent to 1 modulo 6.
we can deduce the following interesting result:
Proof: By the argument above, any prime divisor (other than 3) of an integer of the form
must be congruent to 1 modulo 6. Let
◦
either when
(mod 6).
•
◦
n2 + n + 7
n2 + n + 7
2
q(x) = x + x + 7.
We construct primes congruent to 1 modulo 6 using this polynomial: let
p0 = 3,
and take
p1 ,
... ,
pk
to
be arbitrary primes congruent to 1 modulo 6, none of which is equal to 7.
◦
◦
q(p0 p1 · · · pk ), which is clearly an integer greater than 1: it
0 ≤ i ≤ k , because none of the pi divides the constant term 7.
Now consider
the
pi
for
Hence, by the above result, any prime divisor of
q(p0 p1 · · · pk )
is relatively prime to each of
must be a prime congruent to 1 modulo 6
that was not on our list.
◦
•
Thus, there are innitely many primes congruent to 1 modulo 6.
Remark: It is a (not easy) Theorem of Dirichlet that if
many primes congruent to
a
modulo
m.
a
and
m
are relatively prime, there exist innitely
The above result is a special case.
13
5.6
The Jacobi Symbol
•
We would like to generalize the denition of the Legendre symbol to composite moduli.
•
Denition: Let
b
distinct) primes
b = p1 p2 · · · pk for some (not necessarily
k Y
a
a
=
, where
denotes the Legendre
pk
pk
j=1
be a positive odd integer with prime factorization
pk .
The Jacobi symbol
a
b
is dened as
a
b
symbol.
2
2
=
·
= (−1) · (−1) = +1.
3
5
2 11
11
11
=
·
= (−1)2 · (+1) = −1.
45
3
5
77
77
77
=
·
= (−1) · 0 = 0.
33
3
11
2
15
◦
Example:
◦
Example:
◦
Example:
◦
Observe that, by properties of the Legendre symbol, that
be 0 if and only if
•
a
b
gcd(a, b) > 1.
will always be
+1, −1,
or 0, and it will
The Jacobi symbol shares a number of properties with the Legendre symbol, the most important of which
is that it is multiplicative on both the top and bottom: for any
a a0 ·
b
b
◦
and
a, a
0
and any odd positive
0
b, b ,
aa0
b
=
a a a =
· 0 .
bb0
b
b
This follows immediately from the denition and the fact that the Legendre symbol is multiplicative on
the top.
• The Jacobi
a
= +1.
b
◦
•
symbol can also detect squares: if
This follows by observing that if
a≡r
2
◦
not
b),
then
a
b
=
(!) the case that
b.
◦
is a quadratic residue modulo
(mod
However, the converse is no longer true: it is
residue modulo
a
For example,
2
15
b
(and
gcd(a, b) = 1),
r 2
r2
=
= +1.
b
b
a
= 1 implies that a
b
then
is a quadratic
= +1
as computed above, but 2 is not a quadratic residue modulo 15.
Indeed, as we showed earlier, if
b = p1 p2 · · · pk ,
pi .
then
a
is a quadratic residue modulo
b
if and only if
a
is
a quadratic residue modulo each
◦
We will note, though, that if
b
is an odd prime, then the Jacobi symbol and Legendre symbol are the
same, and have the same value, and so in this case,
residue modulo
•
a
b.
We might ask: why not instead dene the Jacobi symbol
a
is a nonresidue?
◦
b
= +1 is equivalent to saying that a is a quadratic
a
b
to be
+1
if
a
is a quadratic residue and
−1
if
The reason we do not take this as the denition is that this new symbol is not multiplicative: with a
composite modulus, the product of two nonresidues can still be a nonresidue.
◦
For example, the quadratic residues modulo 15 are 1 and 4, while the nonresidues are 2, 7, 8, 11, 13, 14.
Now observe that
◦
2 · 7 = 14
(mod 15), but all three of 2, 7, and 14 are quadratic nonresidues.
Ultimately, the problem is that a composite modulus has are dierent kinds of quadratic nonresidues.
14
◦
To illustrate, an element
a
can be a nonresidue modulo 15 in three ways: (i) it could be a nonresidue
a = 11, 14],
mod 3 and a residue mod 5 [namely,
a = 7, 13],
◦
(ii) a residue mod 3 and a nonresidue mod 5 [namely,
or (iii) a nonresidue mod 3 and a nonresidue mod 5 [namely,
a = 2, 8].
The product of two nonresidues each in the same class above will be a quadratic residue modulo 15 (since
it will be a residue mod 3 and mod 5), but the product of nonresidues from dierent classes will still be
a nonresidue mod 15 (since it will be a nonresidue modulo 3 or modulo 5).
•
The Jacobi symbol also obeys the law of quadratic reciprocity. We rst collect a few basic evaluations:
•
Proposition: If
◦
b
is odd and positive,
−1
b
(b−1)/2
and
= (−1)
−1
b
2
(b2 −1)/8
= (−1)
.
b
is +1 if b ≡ 1 (mod 4) and
2
4), and
is +1 if b ≡ 1, 7 (mod 8) and is −1 if b ≡ 3, 5 (mod 8).
b
◦ Proof: Let b = p1 p2 · · · pk be a product of primes.
−1
(p −1)/2
◦ For the rst statement, we know that
= (−1) k
.
pk
Y
Y
k k
P
−1
−1
=
=
(−1)(pk −1)/2 = (−1) (pk −1)/2 .
∗ Then, by denition,
b
pk
j=1
j=1
These statements are equivalent to the following:
∗
Now we just need to verify that
k
X
pk − 1
2
j=1
∗
k
Y
pk − 1
2
j=1
This follows from the observation that if
n−1
(m − 1)(n − 1)
=
is even.
2
2
mn − 1
m−1
n−1
∗ Thus,
≡
+
2
2
2
≡
m
and
n
is
−1
if
b≡3
(mod
(mod 2).
are any odd numbers, that
(mod 2). Applying this repeatedly shows
m−1
mn − 1
−
−
2
2
k
X
pk − 1
j=1
2
≡
Q pk − 1
2
(mod 2).
◦
For the other statement, we know
∗
Like above,
2
pk
Y
Y
k k
P 2
2
2
2
=
=
(−1)(pk −1)/8 = (−1) (pk −1)/8 .
b
pk
j=1
j=1
k
k
X
Y
p2k − 1
p2k − 1
≡
8
8
j=1
j=1
∗
Now we just need to verify that
∗
This follows from the observation that if
n2 − 1
(m2 − 1)(n2 − 1)
=
is even.
8
8
m2 n2 − 1
m2 − 1
n2 − 1
∗ Thus,
≡
+
8
8
8
k
Y
p2k − 1
8
j=1
•
•
2
= (−1)(pk −1)/8 .
m
and
n
(mod 2).
(mod 2).
are any odd numbers, that
m2 n2 − 1 m2 − 1
−
−
8
8
Applying this repeatedly shows
k
X
p2k − 1
≡
8
j=1
(mod 2).
Now we prove quadratic reciprocity for the Jacobi symbol.
Theorem: If
a
and
b
are odd, relatively prime positive integers, then
15
a b ·
= (−1)(a−1)(b−1)/4 .
b
a
◦
The proof is essentially bookkeeping: we simply factor
a
and
b
and then use quadratic reciprocity on all
of the prime factors. All of the actual work has already been done in proving quadratic reciprocity for
the Legendre symbol.
◦
◦
a = q1 · · · ql
Proof: Write
and
b = p1 · · · pk
as products of primes.
Then, by denition, we have
a
b
=
=
k Y
a
pj
j=1
k Y
l Y
qi
pj
j=1 i=1
=
k Y
l Y
pj
qi
j=1 i=1
=
l Y
k Y
pj
qi
i=1 j=1
=
◦
· (−1)
(pj −1)(qi −1)/4
· (−1)
P
i,j (pj −1)(qi −1)/4
P
b
(p −1)(qi −1)/4
.
· (−1) i,j j
a
But now observe that
l X
k
X
(pi − 1)(qj − 1)
4
i=1 j=1
l
X
pi − 1
=
i=1
2

!  k
X qj − 1

·
2
j=1
a−1 b−1
·
(mod 2)
2
2
≡
using the same argument as in the previous proposition.
◦
•
Therefore,
a
=
b
b
· (−1)(a−1)(b−1)/4 ,
a
which is equivalent to the desired result.
We can use the Jacobi symbol to compute Legendre symbols using the ip and invert technique discussed
earlier. The advantage of the Jacobi symbol is that we no longer need to factor the top number: we only need
to remove factors of
•
−1
and
2.
Example: Determine whether 247 is a quadratic residue modulo the prime 1009.
◦
We have
247
1009
=
1009
247
=
21
247
=−
247
21
=−
16
21
= −1,
where at each stage we either
used quadratic reciprocity (to ip) or reduced the top number modulo the bottom.
◦
Since the result is
−1,
this says the Jacobi symbol
247
1009
is
−1,
so 247 is a quadratic nonresidue
modulo 1009.
•
Example: Determine whether 1593 is a quadratic residue modulo the prime 2017.
◦
We have
◦
1593
2017
424
1593
3 2
53
53
=
·
=
1593
1593
1593
1593
3
=
=
53
53
53
2
= −
=−
= +1.
3
3
=
2017
1593
=
Therefore, since 2017 is prime, 1593 is a quadratic residue modulo 2017.
16
5.7
•
Some Generalizations of Quadratic Reciprocity
A natural question is whether there is a way to generalize quadratic reciprocity to other Euclidean domains,
such as
◦
Z[i]
and
Fp [x].
It turns out that the answer is yes!
One natural avenue for generalization is to seek a version of the Legendre symbol that detects when a
given element is a square modulo a prime, in more general rings.
◦
Another avenue is to try to generalize to higher degree: to seek a version of the Legendre symbol that
detects when a given element is equal to a cube, fourth power, etc., modulo a prime.
◦
There are generalizations in each of these directions, and although we do not have the tools to discuss
many of them, the program of nding and classifying these various reciprocity laws was a central idea
that motivated much of the development of one branch of modern number theory through the 1930s.
•
Our goal is primarily to outline the ideas involved, so we will only sketch the basic ideas, leaving some of the
details as an exercise.
◦
A proper development that ties together all of these generalized reciprocity laws is left for a course in
algebraic number theory, since the modern language of number theory (using ideals) is necessary to
understand the broader picture.
•
We will rst describe how the notion of quadratic residue extends to a general Euclidean domain.
•
Denition: Let
R be an arbitrary Euclidean domain, and π be a prime (equivalently, irreducible) element of
R. We say that an element a ∈ R is a quadratic residue modulo π if π - a and there is some b ∈ R such that
b2 ≡ a (mod π ). If there is no such b, we say a is a quadratic nonresidue.
◦
Example: With
1 + 2i.
◦
R = Z[i]
and
π = 2 + i, the nonzero residue classes are represented by i, 2i, 1 + i, and
2i ≡ (1 + i)2 and 1 + i ≡ i2 , and the nonresidues are 1 + i and 1 + 2i.
The quadratic residues are
R = F3 [x] and π = x2 + 1, the nonzero residue classes are represented by 1, 2, x, x + 1,
x + 2, 2x, 2x + 1, and 2x + 2. The quadratic residues are 1, 2 ≡ x2 , x ≡ (x + 2)2 , and 2x ≡ (x + 1)2 ,
while the nonresidues are x + 1, x + 2, 2x + 1, and 2x + 2.
Example: With
•
If
•
Denition: Let
R/πR
is a nite eld, we can formulate a generalized quadratic residue symbol:
p
R
be a prime element in the Euclidean domain
quadratic residue symbol
hai
π
is dened to be 0 if
π|a, +1
a
if
such that
R/πR
is a nite eld. Then the
is a quadratic residue modulo
p,
and
−1
if
a
2
is a quadratic nonresidue.
◦
Since
R/πR
is a nite eld, it has a primitive root
u.
a
An element
is then a quadratic residue if and
only if it is an even power of the primitive root.
◦
If
R/πR
has even size, then there are an odd number of units. Then the order of a primitive root
odd, so (it is easy to see) every unit is congruent to an even power of
◦
◦
◦
Thus, the only interesting case occurs when
In this case, by Euler's theorem in
•
(a
π).
We can factor this as
a(N −1)/2 ≡ ±1
◦
(N −1)/2
(mod
R/πR,
− 1)(a
a
+ 1) ≡ 0
≡1
(mod
π ),
(mod
π)
for every unit
so since
R/πR
a.
is a eld, we see that
This suggests a natural generalization of Euler's criterion:
R/πR
◦
N −1
is
N.
has odd size
we see that
(N −1)/2
Proposition (Generalized Euler's criterion): Let
◦
R/πR
u
u.
is a nite eld with
N
elements, where
N
π
is odd. Then
The proof is almost identical to the one over
Proof: Let
u
be a primitive root in
R/πR.
R such
any a.
be a prime element in the Euclidean domain
hai
π
(N −1)/2
≡a
(mod
π)
for
that
2
Z.
As remarked above, an element
and only if it is an even power of the primitive root.
17
a
is a quadratic residue if
∗
It is straightforward to see that
u(N −1)/2 ≡ −1
(mod
π ),
since by Euler's theorem this element has
square 1 but does not equal 1.
∗
∗
Then if
a ≡ u2k
Furthermore, if
π ), we see that a(N −1)/2 ≡ (uN −1 )k ≡ 1 (mod π ).
2k+1
(N −1)/2
u
(mod π ), we have a
≡ (uN −1 )k u(N −1)/2
(mod
u≡
≡ u(N −1)/2 ≡ −1
(mod
π ).
◦ Using
criterion,
Euler's
hai b ab
·
=
.
π 2
π 2 π 2
•
we immediately see that the quadratic residue symbol is multiplicative on top:
In general, we would like to nd a relation between the value of
The precise statement will depend on the ring
•
hπi
λ
and
2
R.
λ
π 2
if
λ
π
and
are primes in
R.
Remark: We can also extend the denition of the quadratic residue symbol to cover cases where the bottom
element is not a prime, in much the same way as we dened the Jacobi symbol as a product of Legendre
symbols. (We will not concern ourselves with the details here.)
5.7.1
•
Quadratic Reciprocity in
Let
◦
•
•
π
Z[i]
be a prime of odd norm in
Z[i]
(i.e., any prime not associate to
For brevity, we will call a prime of odd norm an odd prime.
The quadratic residue symbol in
Z[i]
is (as we might expect) closely related to the Legendre symbol in
p is a prime congruent to 1 mod
a
=
, where the second symbol is the
π 2
p h i
p
π
=
.
integer, then
l 2
l
Proposition: If
hai
◦
Proof: If
◦
By Euler's criterion in
Z[i],
◦
By Euler's criterion in
◦
Since
Z, we also
a
≡ a(p−1)/2
p
◦
π|a
π|p,
π|l
or
•
◦
Z
factoring as
ππ
Legendre symbol in
in
Z.
Z[i],
and
a∈Z
Furthermore, if
is any integer, then
l
is any odd prime
Since each of these is either 1 or
π|2,
hai
≡ a(p−1)/2 (mod π ).
π 2
a
≡ a(p−1)/2 (mod p).
have
p
we have
−1,
π),
(mod
so by the above, we see
h i
a
a
≡
p
π 2
the only way they could be unequal is if
−1 ≡ 1
(mod
(mod
π).
π):
but this
which is clearly not the case.
The second statement follows in exactly the same way.
Theorem (Quadratic Reciprocity in
2 in
4 in
Z.
then the results are obvious.
this implies
would mean that
◦
1 + i).
Z[i],
then
hπi
λ
2
The statement that
where
a
and
c
Z[i]):
If
π
and
λ
are distinct odd prime elements congruent to 1 modulo
λ
=
.
π 2
π
and
λ
are congruent to 1 modulo 2 merely says that
π = a + bi
and
λ = c + di,
are positive odd integers. (Any odd prime can be put into this form, so the statement is
not much of a restriction.)
◦
Proof: If both
in
◦
λ
and
π
are integers in
Z,
then the result follows immediately from quadratic reciprocity
Z.
λ is an integer l (i.e., an
integer
prime congruent
to 3modulo 4), and π is not, then by the above propohπi
N (π)
l
l
sitions we have
=
and
=
, and these are equal by quadratic reciprocity in
l 2
l
π 2
N (π)
Z. By symmetry, the result also holds if π is an integer, and λ is not.
If
18
◦
Now assume that both
π = a + bi
and
λ = c + di
are nonintegers, with
ππ = p
and
λλ = l
two integral
primes congruent to 1 modulo 4.
2
2
l
c + d2
d
= +1.
=
=
l
c
c
c
∗ Also notice that pl = (a2 + b2 )(c2 + d2 ) = (ac + bd)2 + (ad − bc)2 ≡ (ad − bc)2 (mod ac + bd).
l
p
∗ Thus, pl is a square modulo ac + bd, so
=
.
ac + bd
ac + bd
ac + bd
ac + bd
∗ By quadratic reciprocity, this says
=
.
l
p
∗
◦
By quadratic reciprocity in
Z,
rst observe that
=
=
=
=
By the same argument, we have
we conclude
•
=
Now we can write
λ
π 2
◦
c
hπi
λ
=
2
h a i2 c + di ·
π 2
π
2
h a i ac + adi ·
π 2
π
2
a
ac + adi − diπ
·
p
π
2
ac + bd
ac + bd
=
.
π
p
2
ac + bd
l
, so, since this is equal to
ac + bd
p
as noted above,
hπi
λ
=
.
π 2
λ 2
For completeness, we also remark that the argument above can be used to give simple formulas for the other
remaining values of the quadratic residue symbol:
i
= (−1)(N (π)−1)/4 = (−1)b/2 .
π 2
1+i
a+b
p
◦ Furthermore, by the argument above and quadratic reciprocity, we have
=
=
.
λ 2
p
a+b
2p
p
2
2
2
◦ Now observe that 2p = (a + b) + (a − b) , so
= 1. Hence
=
, meaning that
a+b
a+b
a+b
1+i
2
=
.
λ 2
a+b
◦
5.7.2
•
If
π = a+bi where a is odd and b is even, by Euler's criterion, we have
Quartic Reciprocity in
We can also write down a degree-4 variant of the quadratic residue symbol in
Z[i].
αN (π)−1 − 1 ≡ 0
◦
If
◦
But now notice that N (π) − 1 is actually divisible by 4: so we can factor the expression
(α(N (π)−1)/4 − 1) · (α(N (π)−1)/4 + 1) · (α(N (π)−1)/4 + i) · (α(N (π)−1)/4 − i) ≡ 0.
◦
Therefore, by unique factorization, we conclude that
π is a prime element of odd norm in Z[i] and π - α, we factored
Z[i]/π as (α(N (π)−1)/2 − 1) · (α(N (π)−1)/2 + 1) ≡ 0 (mod π ).
modulo
•
Z[i]
Denition: If
be 0 if
◦
π|α,
α(N (π)−1)/4
the expression
in
even further, as
is equivalent to one of
1, −1, i, −i
π.
π
is a prime element of odd norm, we dene the quartic residue symbol
and otherwise to be the unique value among
{±1, ±i}
satisfying
hαi
π
≡α
hαi
π
∈ {0, ±1, ±i}
4
(N (π)−1)/4
(mod
to
π ).
4
This residue symbol detects fourth powers, in a similar way to how the quadratic residue symbol detects
squares.
19
◦
If
u
is a primitive root modulo
equivalent to
•
α
π,
then
= +1
π
precisely when
α
is a power of
u4 ,
which is clearly
4
being a fourth power modulo π .
Example: Find the quartic residues modulo
◦
hαi
2 + 3i.
π = 2 + 3i are represented by the elements 1, 2, 3, ... , 12.
3 ≡ (2 + i)4 , and 9 ≡ (1 + i)4 . The other 9 classes are quartic nonresidues.
7
2
3
≡ 2 ≡ i (mod π ), and
≡ 73 ≡ −i (mod π ).
example,
2 + 3i 4
2 + 3i 4
The nonzero residue classes modulo
The
quartic residues are 1,
◦
•
•
We can compute, for
This quartic residue symbol turns out to satisfy a reciprocity law much like the Legendre symbol in
Theorem (Quartic Reciprocity in
hπi
λ
4
◦
Z[i]):
N (π)−1 N (λ)−1
λ
·
4
=
· (−1) 4
.
π 4
If
π
and
λ
are both primes in
Z[i]
congruent to 1 modulo
Z:
2 + 2i,
then
The proof, which we will not give here, involves more advanced machinery. (The result was known to
Gauss, and a proof essentially appears in some of his unpublished papers.)
5.7.3
•
Quadratic Reciprocity in
Fp [x]
As remarked earlier, all polynomials are quadratic residues modulo an irreducible polynomial
degree in
F2 [x],
since
F2 [x]/f
has an even number of elements for any such
•
So we will restrict to the case of
•
Theorem (Quadratic Reciprocity in
of positive degree in
Fp [x].
Then
Fp [x],
where
p
f
of positive
f.
is odd.
Fp [x]): Let p be an odd prime and f, g
p−1
f
g
(deg f )(deg g)
·
= (−1) 2
.
g 2 f 2
be monic irreducible polynomials
◦
This result was originally stated by Dedekind in 1857, but a proof was not published until 1924.
◦
Most known proofs of this result (while fairly short) require more advanced results from algebraic number
theory. To this author's knowledge, an elementary proof of this theorem was not published until 1989.
◦
There is an elementary proof of this result, published in 2008, that relies only on the Chinese Remainder
Theorem and the results we proved above, but it is fairly technical. (Perhaps the reader can devise a
better one!)
Well, you're at the end of my handout. Hope it was helpful.
Copyright notice: This material is copyright Evan Dummit, 2014. You may not reproduce or distribute this material
without my express permission.
20