# Summary

Today we finished our discussion of quadratic reciprocity by providing a proof of the theorem which is based on Eisenstein's Lemma. Afterwards we began talking about the notion of order for a given integer *a* modulo *m*, as well as what it meant for *a* to be a primitive root modulo *m*. We calculated the order of a few integers, and we began talking about one of the basic divisibility properties of order.

# A Proof of Quadratic Reciprocity

Recall last time that we proved

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$

We'll use this result as the key to unlock 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

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

(2)Hence if we can prove Equation (1), then we'll know

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

Lemma: For distinct odd primes

pandq, Equation (1) is true.

Proof:

Our technique will be to use geometry to equate these two quantities. We'll start by drawing a grid that is p units long and q units tall, where we assume that $p>q$. Here's a picture of the grid:

Now we'll show both sides of Equation (1) are the same by showing that each side of the equation represents a distinct way of counting the lattice points inside the same region. In both cases, the region that we'll study is the rectangle in the lower-left portion of our graph shown below. We'll count the lattice points (i.e, those points where both the x- and y-coordinates are integers), except that we won't count lattice points that 0 in either the x- or y-coordinate.

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

(4)since these lattice points $(x,y)$ have integer x-coordinates that are between 1 and $\frac{p-1}{2}$ and integer y-coordinates that are between 1 and $\frac{q-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. The triangles are shown below.

#### Points in the red

We'll first count the lattice points in the red 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 red triangle. Notice that the diagonal for the rectangle has equation

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

(6)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{p}{q}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{py_0}{q}\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{q-1}{2}$. Hence the number of lattice points for the red triangle is

(8)#### Points in the blue

How many lattice points are in the blue 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 blue triangle. Then we'll add up all the lattice points from these various vertical lines.

Since the diagonal for the rectangle has equation

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

(10)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{q}{p}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{qx_0}{p}\right\rfloor$ such integers *y*, and hence this many lattice points along the line $x=x_0$ inside the blue triangle.

The total number of lattice points in the blue 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{p-1}{2}$. Hence the number of lattice points for the blue triangle is

(12)#### One last thing to check

It would seem that we have verified Equation (1), though if you carefully compare the images of the rectangle and the triangles you'll see that the blue triangle has a little extra "nub" which might capture additional lattice points — thus preventing the equality we're after. It's not too hard to see that this "nub" doesn't contain any lattice points.

To do this, we'll show that the "nub" doesn't contain any points with y-coordinate as large as $\frac{q+1}{2}$, which will show that any lattice points in the blue triangle must be lattice points within the rectangle we have already considered. To see that the "nub" doesn't have y-coordinates that are too large, notice that the tallest point in the number is

(13)But the y-coordinate of this point is precisely $\frac{q}{2}-\frac{1}{2}\frac{q}{p}$. But it's easy to see that

(14)$\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.

# Order Calculations

We're going to shift topics now, moving out of Chapter 4 and into Chapter 5. Recall from Chapter 2 that for any integer *m* and integer *a* satisfying $(a,m) = 1$, we have

The question we ask now is whether there exists some exponent smaller than $\phi(m)$ which does this same job.

Definition: For an integer

mand a numberawith $(a,m) = 1$, we define the order ofamodmas$\displaystyle \mbox{ord}_m(a) = \min_{n>0}\{a^n \equiv 1 \mod{m}\}$.

#### Example: The order of 4 mod 9

Let's compute $\mbox{ord}_9(4)$. Since $\phi(9) = 6$ we know that $\mbox{ord}_9(4) \leq 6$, but is this actually the order? The only way to know is to try out smaller exponents and see if we ever hit 1:

(16)Hence we see that $\mbox{ord}_9(4) = 3$. $\square$

#### Example: The order of 2 mod 9

Let's try to compute $\mbox{ord}_9(2)$. Again, we know that this order is at most 6 (since $a^{\phi(9)} \equiv 1 \mod{9}$ for any $(a,9) = 1$), but perhaps it's smaller. Let's try out smaller exponents and see if we hit 1 early.

(17)Hence we see that $\mbox{ord}_9(2) = 6$. $\square$

The two examples above lead us to distinguish those elements which have the "maximal order" of $\phi(m)$ from the other elements whose order is smaller than $\phi(m)$.

Definition: For an integer

mand $(a,m) = 1$, we say thatais a primitive root modulomif the order ofamodulomis $\phi(m)$.

Having stated this definition, there are some natural questions that we might ask:

- for which moduli
*m*does a primitive root*a*exist? - which numbers
*a*are primitive roots for infinitely many*m*?

We'll eventually answer the first question; the second is still open.

# Some Properties of Order

We finish our discussion today by pointing out one special property of the order of an integer. We'll see more properties related to this next class period.

Lemma: For integers

mandawith $(a,m) = 1$, an integernsatisfies $a^n \equiv 1\ mod{m}$ if and only if $\mbox{ord}_m(a) \mid n$.

Notice that we have already seen this lemma in our calculation of $\mbox{ord}_9(4)$. In that case we knew that $4^6 \equiv 1 \mod{9}$ since $\phi(9) = 6$, but we saw that $\mbox{ord}_9(4) = 3$.

Proof: First suppose that $\mbox{ord}_m(a) \mid n$; we'll show that $a^n \equiv 1 \mod{m}$. In this case we know there exists an integer *k* so that $k\cdot\mbox{ord}_m(a) = n$. Now we'll just compute $a^n$ directly:

Now we know that $a^{\mbox{ord}_m(a)} \equiv 1 \mod{m}$ by definition, and so the right hand side of the equation becomes

(19)Hence we have shown $\mbox{ord}_m(a) \mid n$ implies $a^n \equiv 1 \mod{m}$

Now suppose that $a^n \equiv 1 \mod{m}$. Write $n = k\cdot \mbox{ord}_m(a) + r$, where *r* is a remainder term in the range $0 \leq r < \mbox{ord}_m(a)$. Then we have

But then *r* is an exponent which is less than $\mbox{ord}_m(a)$ so that $a^r \equiv 1 \mod{m}$. By the minimality of order, this means that *r* cannot be positive, and so we must have $r=0$. This in turn tells us that $n = k\cdot \mbox{ord}_m(a)$, so that $\mbox{ord}_m(a) \mid n$.

$\square$