 , let
, let
 
be the set of integers between
 and
 and  .  The following 
lemma will help us to keep track of how many integers lie in 
certain intervals.
.  The following 
lemma will help us to keep track of how many integers lie in 
certain intervals.
 .  Then for any integer
.  Then for any integer  ,
,
 
and
 
provided that each interval involved in the congruence is nonempty.
 and
 and  then
 then 
 but
 
but 
 .
.
 denotes 
the least integer
 denotes 
the least integer  . 
Since
. 
Since  ,
,
 
where the union is disjoint. There are
 integers,
 integers,
 
in the interval
 , so the first congruence of the lemma 
is true in this case.  We also have
, so the first congruence of the lemma 
is true in this case.  We also have
 minus
 minus  
and
 contains exactly
 contains exactly  integers, so the lemma is 
also true when
 integers, so the lemma is 
also true when  is negative.  The statement about
 is negative.  The statement about 
 is proved in a similar manner.
 is proved in a similar manner.
  
Once we have proved the following proposition, it will be easy to deduce the quadratic reciprocity law.
 be an odd prime and let
 be an odd prime and let  be a positive integer with
 be a positive integer with  .
If
.
If  is a prime with
 is a prime with 
 , then
, then 
 .
. .  Let
.  Let
 
and
 
where
 or
 or 
 , whichever is an integer.
, whichever is an integer.
We check that every element of  that is equivalent modulo
 that is equivalent modulo  to something in the
interval
 to something in the
interval 
 lies in
 lies in  .  
First suppose that
.  
First suppose that 
 .  Then
.  Then 
 
so each element of
 that is equivalent modulo
 that is equivalent modulo  to an
element of
 to an
element of 
 lies in
 lies in  .  
Next suppose that
.  
Next suppose that 
 .  Then
.  Then
 
so
 is the
last interval that could contain an element of
 is the
last interval that could contain an element of  that reduces to
 that reduces to
 .  Note that the integer endpoints of
.  Note that the integer endpoints of  are not
in
 are not
in  , since those endpoints are divisible by
, since those endpoints are divisible by  , but no element
of
, but no element
of  is divisible by
 is divisible by  .  Thus, by Lemma 4.3.1,
.  Thus, by Lemma 4.3.1,
 
To compute 
 , first rescale by
, first rescale by  to see that
 to see that
 
where
 
 , and
the second equality is because
, and
the second equality is because 
![$ \frac{1}{a} I \subset (0,(p-1)/2 + 1/2]$](img1326.png) ,
since
,
since 
 
Write  , and let
, and let
 
The only difference between
 and
 and  is that the endpoints of
intervals are changed by addition of an even integer,
since
 is that the endpoints of
intervals are changed by addition of an even integer,
since 
 
By Lemma 4.3.3,
 
Thus
 depends only on
 depends only on  and
 and  , i.e., only
on
, i.e., only
on  modulo
 modulo  .  Thus if
.  Thus if 
 , then
, then
 .
.
If 
 , then the only change in the above computation
is that
, then the only change in the above computation
is that  is replaced by
 is replaced by  .  This changes
.  This changes  into
 into
|  |  | |
|  | 
 is the same as
 is the same as  , except even integers have
been added to the endpoints.  By Lemma 4.3.3,
, except even integers have
been added to the endpoints.  By Lemma 4.3.3,
 
so
 again, which completes the proof.
 again, which completes the proof.
  
The following more careful analysis in the special case when  helps illustrate the proof of the above lemma, and the result is
frequently useful in computations.  For an alternative proof
of the proposition, see Exercise 4.6.
helps illustrate the proof of the above lemma, and the result is
frequently useful in computations.  For an alternative proof
of the proposition, see Exercise 4.6.
 , the set
, the set 
 is
 is
 
We must count the parity of the number of elements of
 that lie
in the interval
 that lie
in the interval 
 .  Writing
.  Writing  , we have
, we have
|  |  | |
|  | 
 are
 are  .  When
.  When  , the cardinality is 0
, when
, the cardinality is 0
, when  it is
 it is  , and when
, and when  it is
 it is  .
.
  
William 2007-06-01