Lecture 13: Quadratic Reciprocity II

William Stein

Math 124 Harvard University Fall 2001

In-class midterm this Wednesday, October 17!

Monday’s lecture will be a review lecture; Grigor’s review session is on Monday at 4pm; I will have an extra office hour in SC 515, Tuesday, 2:35–3:30.

1 Recall Gauss’s Lemma

We proved the following lemma in the previous lecture.

Lemma 1.1. Let p be an odd prime and a an integer with p ∤ a. Form the numbers a, 2a, 3a, …, \frac{p−1}{2}a and reduce them modulo p to lie in the interval (−\frac{p}{2}, \frac{p}{2}). Let ν be the

number of negative numbers in the resulting set. Then (\frac{a}{p}) = (−1)^{ν}.

2 Euler’s Conjecture

Lemma 2.1. Let a, b ∈ ℚ. Then for any n ∈ ℤ,

# ((a, b) ∩ ℤ) ≡ # ((a, b + 2n) ∩ ℤ) ≡ # ((a + 2n, b) ∩ ℤ) (mod 2).

Proof. If n > 0, then

(a, b + 2n) = (a, b) ∪ [b, b + 2n),

where the union is disjoint. Let [x] denote the least integer ≥ x. There are 2n integers,

[b], [b] + 1, …, [b] + 2n − 1,

in the interval [b, b + 2n), so the assertion of the lemma is true in this case. We also have

(a, b − 2n) = (a, b)\[b − 2n, b)

and [b−2n, b) also contains exactly 2n integers, so the lemma is also true when n is negative. The statement about # ((a + 2n, b) ∩ ℤ) is proved in a similar manner.

The following proposition was first conjectured by Euler, based on extensive numerical evidence. Once we’ve proved this proposition, it will be easy to deduce the quadratic reciprocity law.

Proposition 2.2 (Euler’s Conjecture). Let p be an odd prime and a ∈ ℕ a natural number with p ∤ a.

1. The symbol (\frac{a}{p}) depends only on p modulo 4a.

2. If q is a prime with q ≡ −p (mod 4a), then (\frac{a}{p}) = (\frac{a}{q}).

Proof. To apply Gauss’s lemma, we have to compute the parity of the intersection of

S = \{a, 2a, 3a, … \frac{p − 1}{2}a\}

and

I = (\frac{1}{2}p, p) ∪ (\frac{3}{2}p, 2p) ∪ ⋯ ∪ ((b − \frac{1}{2}) p, bp) ,

where b = \frac{1}{2}a or \frac{1}{2}(a − 1), whichever is an integer. (Why? We have to check that every element

of S that reduces to something in the interval (−\frac{p}{2}, 0) lies in I. This is clear if b = \frac{1}{2}a < \frac{p−1}{2}a. If b = \frac{1}{2}(a − 1), then bp + \frac{p}{2} > \frac{p−1}{2}a, so ((b − \frac{1}{2})p, bp) is the last interval that could contain an element of of S that reduces to (−\frac{p}{2}, 0).) Also note that the integer endpoints of I are not in S, since those endpoints are divisible by p, but no element of S is divisible by p.

Dividing I through by a, we see that

#(S ∩ I) = # (ℤ ∩ \frac{1}{a}I) ,

where

\frac{1}{a}I = ((\frac{p}{2a}, \frac{p}{a}) ∪ (\frac{3p}{2a}, \frac{2p}{a}) ∪ ⋯ ∪ (\frac{(2b − 1)p}{2a}, \frac{bp}{a})) .

Write p = 4ac + r, and let

J = ((\frac{r}{2a}, \frac{r}{a}) ∪ (\frac{3r}{2a}, \frac{2r}{a}) ∪ ⋯ ∪ (\frac{(2b − 1)r}{2a}, \frac{br}{a})) .

The only difference between I and J is that the endpoints of intervals are changed by addition of an even integer. By Lemma 2.1,

ν = # (ℤ ∩ \frac{1}{a}I) ≡ #(ℤ ∩ J) (mod 2).

Thus (\frac{a}{p}) = (−1)^{ν} depends only on r, i.e., only on p modulo 4a. WOW!

If q ≡ −p (mod 4a), then the only change in the above computation is that r is replaced by 4a − r. This changes \frac{1}{a}I into

K = ((2 − \frac{r}{2a}, 4 − \frac{r}{a}) ∪ (6 − \frac{3r}{2a}, 8 − \frac{2r}{a}) ∪ ⋯ ∪ (4b − 2 − \frac{(2b − 1)r}{2a}, 4b − \frac{br}{a})) .

Thus K is the same as −\frac{1}{a}I, except even integers have been added to the endpoints. By Lemma 2.1,

#(K ∩ ℤ) ≡ # ((\frac{1}{a}I) ∩ ℤ) (mod 2),

so (\frac{a}{p}) = (\frac{a}{q}), which completes the proof.

The following more careful analysis in the special case when a = 2 helps illustrate the proof of the above lemma, and is frequently useful in computations.

Proposition 2.3. Let p be an odd prime. Then

(\frac{2}{p}) = \begin{cases}1 & if p ≡ ±1 (mod 8) \\ −1 & if p ≡ ±3 (mod 8) \end{cases} .

Proof. When a = 2, the set S = \{a, 2a, …, 2 · \frac{p−1}{2}\} is

{2, 4, 6, …, p − 1}.

We must count the parity of the number of elements of S that lie in the interval I = (\frac{p}{2}, p). Writing p = 8c + r, we have

# (I ∩ S) = # (\frac{1}{2}I ∩ ℤ) = # ((\frac{p}{4}, \frac{p}{2}) ∩ ℤ)

= # ((2c + \frac{r}{4}, 4c + \frac{r}{2}) ∩ ℤ) ≡ # ((\frac{r}{4}, \frac{r}{2}) ∩ ℤ) (mod 2),

where the last equality comes from Lemma 2.1. The possibilities for r are 1, 3, 5, 7. When r = 1, the cardinality is 0, when r = 3, 5 it is 1, and when r = 7 it is 2.

3 The Quadratic Reciprocity Law

With the lemma in hand, it is straightforward to deduce the quadratic reciprocity law.

Theorem 3.1 (Gauss). Suppose that p and q are distinct odd primes. Then

(\frac{p}{q}) · (\frac{q}{p}) = (−1)^{\frac{p−1}{2} · \frac{q−1}{2}} .

Proof. First suppose that p ≡ q (mod 4). By swapping p and q if necessary, we may assume that p > q, and write p − q = 4a. Since p = 4a + q,

(\frac{p}{q}) = (\frac{4a + q}{q} ) = (\frac{4a}{q}) = (\frac{a}{q}) ,

and

(\frac{q}{p}) = (\frac{p − 4a}{p}) = (\frac{−4a}{p}) = (\frac{−1}{p}) · (\frac{a}{p}) .

Proposition 2.2 implies that (\frac{a}{q}) = (\frac{a}{p}), since p ≡ q (mod 4a). Thus

(\frac{p}{q}) · (\frac{q}{p}) = (\frac{−1}{p}) = (−1)^{\frac{p−1}{2}} = (−1)^{\frac{p−1}{2} · \frac{q−1}{2}} ,

where the last equality is because \frac{p−1}{2} is even if and only if \frac{q−1}{2} is even.

Next suppose that p ≢ q (mod 4), so p ≡ −q (mod 4). Write p + q = 4a. We have

(\frac{p}{q}) = (\frac{4a − q}{q} ) = (\frac{a}{q}) , and (\frac{q}{p}) = (\frac{4a − p}{p}) = (\frac{a}{p}) .

Since p ≡ −q (mod 4a), Proposition 2.2 implies that (\frac{p}{q}) = (\frac{q}{p}). Since (−1)^{\frac{p−1}{2} · \frac{q−1}{2}} = 1, the proof is complete.

3.1 Examples

Example 3.2. Is 6 a square modulo 389? We have

(\frac{6}{389}) = (\frac{2 · 3}{389}) = (\frac{2}{389}) · (\frac{3}{389}) = (−1) · (−1) = 1.

Here, we found that (\frac{2}{389}) = −1 using Proposition 2.3 and that 389 ≡ 3 (mod 8). We found (\frac{3}{389}) as follows:

(\frac{3}{389}) = (\frac{389}{3}) = (\frac{2}{3}) = −1.

Thus 6 is a square modulo 389.

Annoyingly, though we know that 6 is a square modulo 389, we still don’t know an x such that x^{2} ≡ 6 (mod 389)!

? for(a=1,388,if(Mod(a,389)^2==6,print1(a, " ")))
28 361

Example 3.3. Is 3 a square modulo p = 726377359? We proved that the answer is “no” in the previous lecture by computing 3^{p−1} (mod p). It’s easier to prove that the answer is no using Theorem 3.1:

(\frac{3}{726377359}) = (−1)^{1· \frac{726377358}{2}} · (\frac{726377359}{3}) = − (\frac{1}{3}) = −1.

4 Some Homework Hints

Spend time studying for the midterm in addition to doing the homework. To point you in the right direction on the homework problems, here are some hints.

(1) Use the quadratic reciprocity law, just like in the above examples.

(2) Use the quadratic reciprocity law.

(3) Relate the statement for n = 3 to the statement for n > 3.

(4) Write down an element of (ℤ/p^{2}ℤ)^{∗} that looks like it might have order p, and prove that it does. Recall that if a, b have orders n, m, with gcd(n, m) = 1, then ab has order nm.

(5) (6)

(7) Replace ∑ (\frac{a}{p}) by ∑ (\frac{ab}{p}) and use that (\frac{ab}{p}) = (\frac{a}{p}) · (\frac{b}{p}).

(8) Write a little program.