# Summary

Today we proved Quadratic Reciprocity. We started by developing a cousin to Gauss' Lemma that's called Eisenstein's Lemma, and then used this lemma — together with a geometric argument — to verify the quadratic reciprocity law.

# A Helpful Lemma

To prove quadratic reciprocity, we need a preliminary lemma.

Lemma (Eisenstein): Suppose that

pis an odd prime and that $p \nmid a$, whereais an odd number. Then for$\displaystyle N = \sum_{i=1}^{\frac{p-1}{2}}\left\lfloor \frac{ia}{p}\right\rfloor$

we have

$\displaystyle \left(\frac{a}{p}\right) = (-1)^N$

#### Example: Using Eisenstein's Lemma

Before we prove Eisenstein's Lemma, let's see an example in action. Suppose want to compute $\left(\frac{7}{11}\right)$. Eisenstein says that with

(1)we have

(2)So let's compute *N*:

Hence we conclude

(4)$\square$

Now that we've seen this lemma used, let's see a proof of how it works. Our strategy will be to show that in fact we have $n \equiv N \mod{2}$, where *n* is the same same number we had in Gauss' Lemma (go back to remind yourself what this number is!). Once we have this, we know from Gauss' lemma that

and since $n \equiv N \mod{2}$, we can conclude that

(6)Proof: The proof of this result will be very similar to the proof of Gauss' Lemma. To start, we notice that for any $1 \leq i \leq \frac{p-1}{2}$ the division algorithm says

(7)where $t_i$ is some remainder between 0 and $p-1$. Now we'll label the remainder for each *ia* as we did in our proof of Gauss' Lemma: if the remainder is greater than $\frac{p}{2}$ we'll denote it as $r_j$, and if the remainder is smaller than $\frac{p}{2}$ we'll label it as $s_j$. In either case, the integer *k* in the equation above is $\lfloor \frac{ia}{p}.$ From all of this, we get that

Now recall from the proof of Gauss' Lemma that the set

(9)is the same as the set

(10)So this means that

(11)Now that we have Equations (8) and (11), we're going to subtract them from each other. On the left hand side, this gives

(12)On the right hand side of the equation, we get

(13)Now let's reduce both sides mod 2. On the left hand side, since *a* is odd by assumption, we get that *a-1* is even, and so the left hand side is 0 mod 2. On the right hand side, since *p* is odd we get that $p \equiv 1 \mod{2}$. The last sum drops out (since it's multiplied by 2), and so we get

Therefore we have *n* and $N = \sum_{i=1}^{\frac{p-1}{2}}\left\lfloor \frac{ia}{p}\right\rfloor$ are the same mod 2, and so

$\square$

# Proving Quadratic Reciprocity

Recall that quadratic reciprocity says

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.$

Our proof technique will be a little unusual. Basically, we'll use geometry to prove that the quantity

(16)Why is this important? Well, Eisenstein's Lemma says that

(17)Hence if we can prove Equation (16), then we'll know

(18)which is exactly what we want to prove.

Proposition: For distinct odd primes

pandq, Equation (16) is true.

Proof:

Our technique will be to use geometry to equate these two quantities. We'll start by drawing a grid that is $\frac{p}{2}$ units long and $\frac{q}{2}$ units tall. Here's a picture of the grid:

Now we'll show both sides of Equation (16) are the same by showing that each side of the equation represents a distinct way of counting the lattice points inside the same region. The lattice points are those points where both the x- and y-coordinates are integers, except that we won't count lattice points that are 0 in either the x- or y-coordinate.

Now on the one hand, the number of lattice points in this rectangle is clearly

(19)since these lattice points $(x,y)$ have integer x-coordinates that are between 1 and $\frac{q-1}{2}$ and integer y-coordinates that are between 1 and $\frac{p-1}{2}$. Since the choice of x- and y-coordinate can be made independently, this means that we have $\frac{p-1}{2}\frac{q-1}{2}$ in this rectangle.

Now we'll count these points another way, by splitting the rectangle up into two triangles and counting the number of lattice points in each triangle individually.

In this case, the total number of lattice points will be the total number of lattice points in the top triangle plus the total number of lattice points in the bottom triangle. Notice that we don't have to worry about any lattice points being in both triangles, since such a point would have to lie on the boundary between the triangles, which is the line $y = \frac{p}{q}x$. Of course there are no solutions to this equation where $1 \leq x \leq \frac{q-1}{2}$ since *q* is a prime number (and we'd need *x* to be a multiple of *q* in order to get the cancellation we need for *y* to be an integer.

So, let's proceed to count the lattice points in the triangles below.

#### Points in the top triangle

We'll first count the lattice points in the top triangle. For this, let's choose an integer y-coordinate $y_0$ and find all lattice points that have $y_0$ as their y-coordinate and which sit inside the top triangle. Notice that the diagonal for the rectangle has equation

(20)Hence the line $y=y_0$ intersects this diagonal at the point

(21)Hence we know that the possible x-coordinates for lattice points on the line $y=y_0$ must be integers *x* that satisfy $1 \leq x \leq \frac{q}{p}y_0$. Indeed, since *p* and *q* are distinct primes, we can in fact say that the possible x-coordinates are integers *x* that satisfy

There are $\left\lfloor \frac{qy_0}{p}\right\rfloor$ such integers *x*, and hence this many lattice points along the line $y=y_0$ inside the red triangle.

The total number of lattice points in the red triangle, then, is the number of lattice points across each such line, where the lines range over integers $y_0$ between 1 and $\frac{p-1}{2}$. Hence the number of lattice points for the red triangle is

(23)#### Points in bottom triangle

How many lattice points are in the bottom triangle? The same style of argument as above will work. For each integer x-coordinate $x_0$, we'll find all the lattice points that have $x_0$ as their x-coordinate and which sit inside the bottom triangle. Then we'll add up all the lattice points from these various vertical lines.

Since the diagonal for the rectangle has equation

(24)the line $x=x_0$ intersects this diagonal at the point

(25)Hence we know that the possible y-coordinates for lattice points on the line $x=x_0$ must be integers *y* that satisfy $1 \leq y \leq \frac{p}{q}x_0$. Indeed, since *p* and *q* are distinct primes, we can in fact say that the possible y-coordinates are integers *y* that satisfy

There are $\left\lfloor \frac{px_0}{q}\right\rfloor$ such integers *y*, and hence this many lattice points along the line $x=x_0$ inside the bottom triangle.

The total number of lattice points in the bottom triangle, then, is the number of lattice points across each such vertical line, where the lines range over integers $x_0$ between 1 and $\frac{q-1}{2}$. Hence the number of lattice points for the bottom triangle is

(27)$\square$

This proof requires some careful thinking to fully understand, and it's not the kind of thing I'd be expecting you to repeat on a test or come up with by yourself. However, you should spend some time trying to digest how this proof works. You should also spend time reviewing the power of the theorem that it proves; quadratic reciprocity is one of the most beautiful theorems we'll get a chance to talk about in this class, and it can be used to solve a whole host of problems which would otherwise be impossible to approach.