Mathematics, the way it is currently written, can be difficult to read. Sometimes it helps to see how people think about a topic or theorem before (or after, or during) the reading of a proper treatment or rigorous proof. The purpose of this post is to provide such a view regarding the proof of the famous law of quadratic reciprocity. There are many details missing, on purpose, and the hope is that it reads like a good story that’s both interesting, believable and easily verifiable.

Basically this “law” provides a fantastic theoretical tool used to tell us which numbers have square roots mod p. We will not get into the full extent of its power. Rather, the goal here is to (eventually) state it and to shine light on remarkable features of the proof. We start with -1.

**When is -1 a square?**

As example, makes sense mod 5, since

.

More generally, it turns out that for any odd prime p,

has a solution if an only if

The reason boils down to Euler’s Criterion (below). Let’s first warm up with Fermat’s Little Theorem (FLT), which states:

FLT is true because are all *different* mod p, and so their product is

Canceling the factor on both sides gives . The upshot is that the equation:

has p-1 solutions (the maximum it could have, considering its degree).

Now, consider the similar equation:

.

Since there are different (nonzero) squares mod p (prove it) and since the equation has at most solutions (believe it for now–think degree again, working modulo a prime), the solutions of the equation are exactly the squares. This is called **Euler’s criterion **and often written as:

** is a (nonzero) square mod p if and only if **

(By the way, if then — why?)

We can now understand when -1 can be a perfect square mod p. In general, can only equal 1 if is even. Thus, if and only if is even; that is,

**When does exist?**

This is actually similar but certainly trickier. The answer, for an odd prime p is:

has a solution (mod p) if and only if .

To see why, we first consider something analogous to Fermat’s Little Theorem. Consider:

Not only are they all different mod p, but *much better*–there’s exactly one of these multiples of from each pair:

This is not too hard to prove and it’s fun. It will be crucial to remember later during the “reciprocity part” of the post. This next fact isn’t easy, and it’s amazing:

** is a square if and only if the “negative option” is chosen an even number of times.**

The number of times the negative option is chosen is important enough to give it a name, used for this purpose for the rest of this post. As an example, for p=11 we ask: is 9 a square? (of course it is, , but just play along!) The multiples of 9 are: 9, 18, 27, 36 and 45. Respectively, they reduce (mod 11) to:

With two negative options, , which is even, so 9 is a square mod 11.

The explanation is similar to that of FLT,

Working mod p, we cancel the from both sides to get:

Combine this with Euler’s Criterion and we can now determine which numbers are squares modulo our odd prime p:

**Key Fact: **

** is a square mod p if and only if is even.**

*If , then it is a fun, tractable exercise (class project to help students discover strong induction?) to determine which primes have even, namely, *

This is part of the law—for any odd prime , we know that 2 is a square mod p if and only if

**Context is everything**

One of the really cool things about quadratic reciprocity is that one needs to keep changing perspectives and contexts to understand it. This makes it a great introduction to modern mathematics. Take for example the notion of *parity*, which means evenness or oddness of an integer. On the surface, 5 and -5 have the same parity. In the above discussion, we considered sets {1,-1}, {2,-2}, … viewed mod p. If p is an odd prime, then -2 really means p-2 which has the opposite parity of 2. Perhaps these sets should have been written {1,p-1}, {2, p-2}, … This awareness of multiple perspectives helps with what follows.

**The reciprocity part**

The last part of the law of quadratic reciprocity concerns two odd primes p and q. It connects the answers to the two questions:

- Is q a square mod p?
- Is p a square mod q?

So, should we work mod p or mod q? We’ll lean towards mod p but really we’ll use neither!

Any positive integer can be decomposed as a “big part” plus a “remainder” with respect to division by p. That is:

where [x] denotes the floor of x and

So far we’ve been focusing on the “remainder” and ignoring the “big part.” We’ll do this decomposition for our usual set of numbers, namely

This time, we’ll add them, grouping the “big parts” together and “remainders” after.

As an illustrative example, we take

We’ll take out a common factor of 7 on the left hand side, and a factor of 11 from the “big parts” on the right hand side. Thus:

From this simple example equation, one can see the main point (keep reading to see how). Even though this is an equation of integers, we can draw on our experience working mod p and recognize in the sense that 3 of the remainders had the “negative option.” Indeed,* imagining mod 11, *we know that 7 is not a square and we *identify *

Yet, crucially, our example equation *isn’t* mod 11—it’s an equation of integers. Let’s reduce it mod 2, where multiplication by an odd number has no effect (so we ignore the factor of 7 on the left and the factor of 11 on part of the right). Thus, viewed mod 2:

Now focus on the remainder part: (**7**+3+**10**+**6**+2). Compare its parity with what we’d have if we never needed the negative option, ie. (**4**+3+**1**+**5**+2). The difference is evidently — one parity change for each negative option.

But the left hand side must be (a permuted version of) (4+3+1+5+2). Thus:

or, since we’re working mod 2:

In other words, the parity of the sum of the quotients is the same as the parity of , which (by what we called “Key Fact”) tells us if is a square! So, 7 is not a square mod 11, because which is odd—*but equivalently—because the sum of quotients*

*is also odd.*

This will always work provided p is an odd prime and is an odd positive integer.

*Therefore, a fundamental property about remainders has been wonderfully transformed into one regarding quotients*. This is extremely interesting in its own right, and is also the main point. Now to state the theorem and clarify what’s left to show.

**Theorem: For odd primes p and q, the two questions**

**Is q a square mod p?****Is p a square mod q?**

**have the same answer if and only if is even.**

We have seen how the answer to question 1 is controlled by the parity of:

Since both are odd primes, we can reverse the roles of p and q and the answer to question 2 is controlled by the parity of

All that remains is to show that the sum of these two expressions has the same parity as

But more is true: they are *exactly* equal. While remarkable, this equality is tractable and it may be possible (with hints!) to set this up as a class project, perhaps in a pre-calculus class after a discussion of inverse functions. But that’s a subject for another post.

We finish here by merely illustrating the equality on our example p=11, q=7. One sum of quotients we have already calculated as 0+1+1+2+3=7, the other is

Also for this example

Perfect.

added