 .  An integer
.  An integer  not divisible by
 not divisible by  is a
quadratic residue modulo
 is a
quadratic residue modulo  if
 if  is a square modulo
 is a square modulo  ;
otherwise,
;
otherwise,  is a quadratic nonresidue.
 is a quadratic nonresidue. are
 are 
 
so
 and
 and  are both quadratic residues and
 are both quadratic residues and  and
and  are quadratic nonresidues.
 are quadratic nonresidues. 
The quadratic reciprocity theorem is the deepest theorem that we
will prove in this book. It connects the question of whether or
not  is a quadratic residue modulo
 is a quadratic residue modulo  to the question of
whether
 to the question of
whether  is a quadratic residue modulo each of the prime divisors
of
 is a quadratic residue modulo each of the prime divisors
of  .  To express it precisely, we introduce some new notation.
.  To express it precisely, we introduce some new notation.
 be an odd prime and let
 be an odd prime and let  be an integer coprime to
 be an integer coprime to  .  
Set
.  
Set
 
We call this symbol the Legendre Symbol.
 
This notation is well entrenched in the literature even though it
is also the notation for `` divided by
 divided by  ''; be careful
not to confuse the two.
''; be careful
not to confuse the two.  
sage: legendre_symbol(2,3) -1 sage: legendre_symbol(1,3) 1 sage: legendre_symbol(3,5) -1 sage: legendre_symbol(Mod(3,5), 5) -1
Since 
 only depends on
 only depends on  , it makes sense
to define
, it makes sense
to define 
 for
 for 
 to be
 to be 
 for
any lift
 for
any lift  of
 of  to
 to 
 .
.
Recall (see Definition 3.3.6) that a group 
homomorphism 
 is a map such that for every
 is a map such that for every
 we have
 we have 
 .  
Moreover, we say that
.  
Moreover, we say that  is surjective if for every
 is surjective if for every
 there is an
 there is an  with
 with 
 . 
The next lemma explains how the quadratic
residue symbol defines a surjective group homomorphism.
. 
The next lemma explains how the quadratic
residue symbol defines a surjective group homomorphism.
 such that the elements of
 such that the elements of 
 are
 are
 
Since
 is even, the squares of elements of
 is even, the squares of elements of 
 are
 are
 
Note that the powers of
 starting with
 starting with 
 all appeared
earlier on the list.  Thus the perfect squares in
 all appeared
earlier on the list.  Thus the perfect squares in 
 are
exactly the powers
 are
exactly the powers  with
 with 
 , even, and the
nonsquares the powers
, even, and the
nonsquares the powers  with
 with 
 , odd.  It follows
that
, odd.  It follows
that  is a homomorphism since an odd plus an odd is even, the
sum of two evens is even, and and odd plus an even is odd. Moreover,
since
 is a homomorphism since an odd plus an odd is even, the
sum of two evens is even, and and odd plus an even is odd. Moreover,
since  is not a square,
 is not a square, 
 , so
, so  is surjective.
 is surjective. 
  
 of order
 of order  is a cyclic group.  Since
 is a cyclic group.  Since  is
  odd,
 is
  odd,  is even, so the subgroup
 is even, so the subgroup  of squares of elements of
 of squares of elements of
   has index
 has index  in
 in  .  (See Exercise 4.2
  for why
.  (See Exercise 4.2
  for why  is a subgroup.)  Since
 is a subgroup.)  Since 
 if and only if
 if and only if
   , we see that
, we see that  is the composition
 is the composition 
 , where we identify the nontrivial element of
, where we identify the nontrivial element of  with
 with  .
.
 is surjective without using
  that
 is surjective without using
  that 
 is cyclic, as follows.  If
 is cyclic, as follows.  If 
 is
  a square, say
 is
  a square, say 
 , then
, then 
 , so
, so  is a root of
 is a root of 
 .  By
  Proposition 2.5.3, the polynomial
.  By
  Proposition 2.5.3, the polynomial  has at most
 has at most
   roots.  Thus there must be an
 roots.  Thus there must be an 
 that is
  not a root of
 that is
  not a root of  , and for that
, and for that  , we have
, we have 
 ,
  and trivially
,
  and trivially  , so the map
, so the map  is surjective.  Note
  that this argument does not prove that
 is surjective.  Note
  that this argument does not prove that  is a homomorphism.
 is a homomorphism.
The symbol 
 only depends on the residue class of
 only depends on the residue class of  modulo
modulo  , so making a table of values
, so making a table of values 
 for many values
of
 for many values
of  would be easy.  Would it be easy to make a table of
 would be easy.  Would it be easy to make a table of 
 for many
for many  ?  Perhaps, since there appears to be a simple pattern in
Table 4.1.
?  Perhaps, since there appears to be a simple pattern in
Table 4.1.
 depends only on the congruence class
of
 depends only on the congruence class
of  modulo
 modulo  .  More precisely,
.  More precisely, 
 if and only if
 if and only if
 , i.e.,
, i.e., 
 if and only if
 if and only if  is a
square modulo
 is a
square modulo  .
.  
Based on similar observations, in the 18th century various mathematicians found a conjectural explanation for the mystery suggested by Table 4.1. Finally, on April 8, 1796, at the age of 19, Gauss proved the following theorem.
We will give two proofs of Gauss's formula relating
 to
 to 
 .  The first elementary proof is in
Section 4.3, and the second more algebraic proof is in
Section 4.4.
.  The first elementary proof is in
Section 4.3, and the second more algebraic proof is in
Section 4.4.
In our example Gauss's theorem implies that
 
As an application, the following example illustrates how to answer
questions like ``is  a square modulo
 a square modulo  '' using
Theorem 4.1.7.
'' using
Theorem 4.1.7.
 a square
  modulo the prime
 a square
  modulo the prime  ?  We have
?  We have
  
 
Here
 
and
|  |  | |
|  | 
 is a square modulo
 is a square modulo  .
.  
sage: legendre_symbol(69,389) 1
Though we know that  is a square modulo
 is a square modulo  , we don't know an
explicit
, we don't know an
explicit  such that
 such that 
 !  This is reminiscent
of how we could prove using Theorem 2.1.19 that
certain numbers are composite without knowing a factorization.
!  This is reminiscent
of how we could prove using Theorem 2.1.19 that
certain numbers are composite without knowing a factorization.
William 2007-06-01