Interactive · 5 questions
Let's try to solve the simplest case. Let's try to determine when is a quadratic residue modulo , where is an odd prime. Again, we say is odd for simplicity. If it were , then everything is a quadratic residue.
For the remainder of this explanation, I will abbreviate quadratic residue as QR and quadratic non-residue as QNR.
Let's make some definitions in order to make our lives easier
Legendre symbol
Let's define a function
Also,
These two definitions are equivalent. We will not be proving it, but it is a nice exercise. It is known as Euler's Criterion.
This is called the Legendre symbol, and other ways to express it are and .
In general we will be looking at nonzero elements modulo , so we will rarely use the case.
Let's find out some interesting properties about .
What happens when we multiply two QRs? (If and , then what is ?)
We get a QR. This is because if and , then and for some . Then, , so .
What happens when we multiply two QNRs? (If and , then what is ?)
We get a QR. This is because if and , then .
This motivates the property that .
This is true because .
What does this tell us?
Quadratic Reciprocity
How are quadratic residues related? Well, let's try to solve the congruence It would be a huge surprise if this was somehow related to the following congruence:
Why is it so surprising?
Right, the congruences are under different moduli, and it would be quite challenging to get to modulo if you were working on an equation in modulo .
Well, quadratic reciprocity states something that does just that! Specifically, it states
That's quite confusing, so here's an equivalent statement:
Suppose that are odd primes. Then, if both of and are congruent to , then either has a solution or has a solution.
Otherwise, at least one of are congruent to . Then, has a solution if and only if has a solution.
The proof is fairly long. Here's a sketch:
Lemma 1: Given integers there exists such that , where and . More specifically, .
Sketch of Proof: Use the division algorithm and perform casework based on which hald of the interval is in between and . Then, since we have both an upper and lower bound on the remainder from the division algorithm, we can find the floor of .
Lemma 2: , where .
Sketch of Proof: Take Lemma 1 for for from to and take the product of the results. All the remainders are a permutation of , so many things cancel to yield the result.
Lemma 3: .
Sketch of Proof: Apply the second definition of the Legendre symbol. Note that this is modulo . Show that it is an equality.
Lemma 4: Given an odd with , .
Sketch of Proof: Just some algebraic manipulation. Use the definition of the Legendre Symbol.
Lemma 5:
Sketch of Proof: Use Lemma 4.
Lemma 6:
Sketch of Proof: Consider the lattice points with even coordinates under the line inside the rectangle.

Consider the total number of lattice points on the right side, and then note the number of lattice points with even coordinate above the diagonal on the right side is the same number of lattice points with odd coordinates under the diagonal on the left side.

Lemma 7:
Sketch of Proof: Considert the number of lattice points in the bottom right rectangle . Count it in two different ways.
Now it's time to actually prove quadratic reciprocity!
PROOF: By Lemma 2 and the definition of the Legendre symbol, By Lemma 6, Similarly, Multiplying, we have By Lemma 7,
Whew!