# Summary

In today's class we began by reviewing the criteria we saw for evaluating Legendre symbols last class period, particularly when the "numerator" was either -1 or 2. Afterwards we set to proving

(1)This required Gauss' Lemma, which lets us determine whether *a* is a square based on residues of products *ja*, where *j* ranges over the "first half" of residues mod *p*. After this, we stated the Quadratic Reciprocity Law.

# Review

Recall that for an arbitrary integer $n = \pm 2^e p_1^{e_1}\cdots p_k^{e_k}$ and an odd prime *p* not dividing *n*, we have

The idea, then, is for us to learn how to compute each of these individual Legendre symbols so that we can evaluate an "arbitrary" Legendre symbol. Last time we learned the rules for -1 and 2, so let's start by putting these skills to the test.

#### Example: Determining whether -2 is a square

Let's try to determine whether -2 is a square modulo 467, 569, 821 and 383 (all these numbers are prime). For the first one, we notice that

(3)Now to determine whether -1 is a square mod 467, we note that $467 \equiv 3 \mod{4}$. This means that -1 is not a square. On the other hand, to determine whether 2 is a square mod 467, we note that $467 \equiv 3 \mod{8}$. This means that 2 is also not a square mod 467. Hence we have

(4)and so we see that -2 is a square mod 467.

Similarly we have

(5)$\square$

# Gauss' Lemma

Having practiced the rules we learned last time, let's prove the result concerning the Legendre symbol $\left(\frac{2}{p}\right)$. To do so, we'll need the following

Gauss' Lemma: For

pan odd prime and $p \nmid a$, let$\displaystyle n=\#\left\{1 \leq j \leq \frac{p-1}{2}: \begin{array}{cc}\mbox{ the least non-neg residue of }\\ja \mbox{ is greater than}\frac{p}{2}\end{array}\right\}.$

Then $\left(\frac{a}{p}\right) = (-1)^n$.

Before we prove this result, let's see it in practice.

#### Example: Is 5 a square mod 11?

Let's try to compute $\left(\fra{5}{11}\right)$. For this, we're told we need to compute $5j$ for values of *j* between 1 and $\frac{11-1}{2} = 5$. So let's do it:

Notice that there are 2 residues on this list which are greater than $\frac{11}{2} = 5.5$, and so Gauss' Lemma says that

(7)$\square$

Proof of Gauss' Lemma: To start off, we'll split the least non-negative residues from the set

(8)into two groups: the set $r_1,\cdots, r_n$ will be the set of those residues that are greater than $\frac{p}{2}$, and the set $s_1,\cdots, s_m$ of residues which are less than $\frac{p}{2}$. Notice that none of these residues actually hit $\frac{p}{2}$ on the nose, since this number is not an integer. So really we have $\{r_1,\cdots, r_n\} \subseteq \{\frac{p+1}{2},\cdots,p-1\}$ and $\{s_1,\cdots, s_m\}\subseteq \{1,\cdots,\frac{p-1}{2}\}$.

Now we claim that the integers

(9)are the same modulo *p* as the integers

To see that this is true, notice that the integers from 9 are all between 1 and $\frac{p-1}{2}$ — the $s_j$ certainly live in this range, but since we have $\frac{p+1}{2}\leq r_i \leq p-1$ we also have $1 \leq p-r_i \leq \frac{p-1}{2}$. So to show that these collections are the same, we just need to show that the top collection has no repeats.

For this, we'll check three things:

- there are no repeats of the form $p-r_i \equiv p-r_j \mod{p}$
- there are no repeats of the form $s_i \equiv s_j \mod{p}$ and
- there are no repeats of the form $p-r_i \equiv s_j \mod{p}$.

To check the first, let $k_i,k_j$ be given so that $r_i \equiv k_i \cdot a$ and $r_j \equiv k_j \cdot a$. Then we get

(11)Hence if $r_i$ and $r_j$ arose by multiplying *a* by distinct (mod *p*) numbers $k_i$ and $k_j$, then $p-r_i \not\equiv p-r_j \mod{p}$. This means we solved condition 1 above.

The proof that condition 2 works is the same as that for condition 1. For condition 3, suppose that $p-r_i \equiv s_j \mod{p}$. Then let's let $k_1$ be an integer between 1 and $\frac{p-1}{2}$ so that $r_i \equiv k_i\cdot a\mod{p}$, and let's let $k_j$ be an integer between 1 and $\frac{p-1}{2}$ so that $s_j \equiv k_j \cdot a \mod{p}$. Then we have

(12)This latter congruence, though, is impossible, since $-k_i$ has least non-negative residue between $\frac{p+1}{2}$ and $p-1$. So this means condition 3 is satisfied as well.

Now that we've established our claim that 9 and 10 are the same sets mod *p*, we'll compute $\left(\frac{p-1}{2}\right)!$. Now we know that this factorial is given by multiplying all the elements in together, which means that it's the same as multiplying all the elements in 9 together. Hence:

Now we can cancel the factorial on both sides of this equation (since this factorial is relatively prime to *p*, as it is the product of numbers all relatively prime to *p*). This leaves us with

Moving the minus ones to the other side of the equation, and recalling Euler's Criterion, tells us that

(15)$\square$

Corollary: For any odd prime

pwe have$\displaystyle \left(\frac{2}{p}\right) = \left\{\begin{array}{rl}1,&\mbox{ if }p \equiv 1,7 \mod{8}\\-1, & \mbox{ if } p \equiv 3,5 \mod{8}.\end{array}\right.$

Proof: Gauss' Lemma tells us that to compute $\left(\frac{2}{p}\right)$, we need to count the *j* between 1 and $\frac{p-1}{2}$ for which $2j$ has least non-negative residue greater than $\frac{p}{2}$. But since our *j* lie in the range between 1 and $\frac{p-1}{2}$, this means that $2j$ lies in the range between 1 and $p-1$. In other words, we don't need to worry about "modding out" by any multiple of *p* to compute the least non-negative residue for $2j$: the product $2j$ is already the least non-negative residue mod *p*. Hence we can say that the least non-negative residue of $2j$ mod *p* is greater than $\frac{p}{2}$ precisely when

Since *j* is an integer and $\frac{p}{4}$ is not, we can rewrite this last inequality as

The number of *j* between 1 and $\frac{p-1}{2}$ which satisfy this criteria is $\frac{p-1}{2}-\left\lceil \frac{p}{4}\right\rceil+1$. Hence we have

All we need to do now is determine conditions on *p* that tells us when $\frac{p-1}{2}-\left\lceil \frac{p}{4}\right\rceil+1$ is even or odd. For this, we'll do some investigating mod 8.

Case I: Suppose that $p \equiv 1 \mod{8}$. This tells us that $p = 8k+1$ for some integer *k*. In this case we get

Since this number is even, that means we have $\left(\frac{2}{p}\right) = (-1)^{2k} = 1$.

Case II: Suppose that $p \equiv 3 \mod{8}$. This tells us that $p = 8k+3$ for some integer *k*. In this case we get

Since this number is even, that means we have $\left(\frac{2}{p}\right) = (-1)^{2k+1} = -1$.

Case III: Suppose that $p \equiv 5 \mod{8}$. This tells us that $p = 8k+5$ for some integer *k*. In this case we get

Since this number is even, that means we have $\left(\frac{2}{p}\right) = (-1)^{2k+1} = -1$.

Case IV: Suppose that $p \equiv 7 \mod{8}$. This tells us that $p = 8k+7$ for some integer *k*. In this case we get

Since this number is even, that means we have $\left(\frac{2}{p}\right) = (-1)^{2k+2} = -1$.

$\square$

# Quadratic Reciprocity

Now that we know how to evaluate Legendre symbols with -1 or 2 in the "numerator," we need to know how to evaluate Legendre symbols of the form

(23)where *p* and *q* are distinct, odd primes. Given that it's taken a lot of work to resolve the -1 and 2 cases, it might seem overly optimistic to think that there is a uniform rule that let's us evaluate Legendre symbols of this type. In fact, there is a beautiful theorem that tells us that this case is just as easily resolved.

Theorem (Quadratic Reciprocity): Suppose that

pandqare distinct odd prime numbers. Then we have$\displaystyle \left(\frac{p}{q}\right)\left(\frac{q}{p}\right) = (-1)^{\left(\frac{p-1}{2}\right)\left(\frac{q-1}{2}\right)} = \left\{\begin{array}{rl}1,&\mbox{ if }p \equiv 1 \mod{4} \mbox{ or } q \equiv 1 \mod{4}\\-1,&\mbox{ if }p \equiv q \equiv 3 \mod{4}.\end{array}\right.$

We'll discuss this amazing theorem for the next several class periods, so get ready for fun!