Lecture 19 - Gauss' Lemma; Intro to Quadratic Reciprocity

# 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)
\begin{align} \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. \end{align}

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

(2)
\begin{align} \left(\frac{n}{p}\right) = \left(\frac{\pm 1}{p}\right)\left(\frac{2}{p}\right)^e\left(\frac{p_1}{p}\right)^{e_1}\cdots\left(\frac{p_k}{p}\right)^{e_k}. \end{align}

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)
\begin{align} \left(\frac{-2}{467}\right) = \left(\frac{-1}{467}\right)\left(\frac{2}{467}\right). \end{align}

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)
\begin{align} \left(\frac{-2}{467}\right) = \left(\frac{-1}{467}\right)\left(\frac{2}{467}\right) = (-1)(-1) = 1, \end{align}

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

Similarly we have

(5)
\begin{split} \left\{\begin{array}{cc}569 \equiv 1 \mod{4}\\569 \equiv 1 \mod{8}\end{array}\right\} &\Longrightarrow \left(\frac{-2}{569}\right) = \left(\frac{-1}{569}\right)\left(\frac{2}{569}\right) = (1)(1) = 1\\ \left\{\begin{array}{cc}821 \equiv 1 \mod{4}\\821 \equiv 5 \mod{8}\end{array}\right\} &\Longrightarrow \left(\frac{-2}{821}\right) = \left(\frac{-1}{821}\right)\left(\frac{2}{821}\right) = (1)(-1) = -1\\ \left\{\begin{array}{cc}383 \equiv 3 \mod{4}\\383 \equiv 7 \mod{8}\end{array}\right\} &\Longrightarrow \left(\frac{-2}{383}\right) = \left(\frac{-1}{383}\right)\left(\frac{2}{383}\right) = (-1)(1) = -1.\\ \end{split}

$\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 p an 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:

(6)
\begin{split} 5\cdot 1 &\equiv 5 \mod{11}\\ 5\cdot 2 &\equiv 10 \mod{11}\\ 5\cdot 3 &\equiv 15 \equiv 4 \mod{11}\\ 5\cdot 4 &\equiv 20 \equiv 9 \mod{11}\\ 5\cdot 5 &\equiv 25 \equiv 4 \mod{11}. \end{split}

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)
\begin{align} \left(\frac{5}{11}\right) = (-1)^2 = 1. \end{align}

$\square$

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

(8)
\begin{align} 1\cdot a, 2\cdot a, \cdots, \frac{p-1}{2} a \end{align}

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)
\begin{align} p-r_1,p-r_2,\cdots,p-r_n,s_1,s_2,\cdots,s_m \end{align}

are the same modulo p as the integers

(10)
\begin{align} 1,2,3,\cdots,\frac{p-1}{2}. \end{align}

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:

1. there are no repeats of the form $p-r_i \equiv p-r_j \mod{p}$
2. there are no repeats of the form $s_i \equiv s_j \mod{p}$ and
3. 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)
\begin{align} p-r_i \equiv p-r_j \Leftrightarrow -r_i \equiv -r_j \Leftrightarrow r_i \equiv r_j \Leftrightarrow k_i \cdot a \equiv k_j \cdot a \Leftrightarrow k_i \equiv k_j \mod{p}. \end{align}

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)
\begin{align} p-r_i \equiv s_j \Leftrightarrow -r_i \equiv s_j \Leftrightarrow -k_i \cdot a \equiv k_j \cdot a \Leftrightarrow -k_i \equiv k_j \mod{p}. \end{align}

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:

(13)
\begin{split} \left(\frac{p-1}{2}\right)! &\equiv 1\cdot 2 \cdot 3 \cdot \cdots \cdot \frac{p-1}{2}\\ &\equiv (p-r_1)\cdots(p-r_n)s_1\cdots s_m\\ &\equiv (-1)^n r_1\cdots r_n s_1 \cdots s_m\\ &\equiv (-1)^n \left(a \cdot (2a)\cdot (3a)\cdots \left((\frac{p-1}{2}) a\right)\\ &\equiv (-1)^n a^{\frac{p-1}{2}} \left(1\cdot 2\cdot 3 \cdots \frac{p-1}{2}\right)\\ &\equiv(-1)^n a^{\frac{p-1}{2}}\left(\frac{p-1}{2}\right)! \mod{p}. \end{split}

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

(14)
\begin{align} 1 \equiv (-1)^n a^{\frac{p-1}{2}} \mod{p}. \end{align}

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

(15)
\begin{align} (-1)^n \equiv a^{\frac{p-1}{2}} \equiv \left(\frac{a}{p}\right). \end{align}

$\square$

Corollary: For any odd prime p we 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

(16)
\begin{align} 2j > \frac{p}{2} \Leftrightarrow j > \frac{p}{4}. \end{align}

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

(17)
\begin{align} j\geq \left\lceil \frac{p}{4}\right\rceil \end{align}

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

(18)
\begin{align} \left(\frac{2}{p}\right) = (-1)^{\frac{p-1}{2}-\left\lceil \frac{p}{4}\right\rceil+1}. \end{align}

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

(19)
\begin{align} \frac{p-1}{2}-\left\lceil \frac{p}{4}\right\rceil+1 = \frac{8k+1-1}{2}-\left\lceil \frac{8k+1}{4}\right\rceil+1 = 4k - (2k+1) + 1 = 2k. \end{align}

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

(20)
\begin{align} \frac{p-1}{2}-\left\lceil \frac{p}{4}\right\rceil+1 = \frac{8k+3-1}{2}-\left\lceil \frac{8k+3}{4}\right\rceil+1 = 4k+1 - (2k+1) + 1 = 2k+1. \end{align}

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

(21)
\begin{align} \frac{p-1}{2}-\left\lceil \frac{p}{4}\right\rceil+1 = \frac{8k+5-1}{2}-\left\lceil \frac{8k+5}{4}\right\rceil+1 = 4k+2 - (2k+2) + 1 = 2k+1. \end{align}

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

(22)
\begin{align} \frac{p-1}{2}-\left\lceil \frac{p}{4}\right\rceil+1 = \frac{8k+7-1}{2}-\left\lceil \frac{8k+7}{4}\right\rceil+1 = 4k+3 - (2k+2) + 1 = 2k+2. \end{align}

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

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)
\begin{align} \left(\frac{p}{q}\right) \end{align}

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 p and q are 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!