Suppose . Then is a unit modulo n for modulus , and Fermat's little theorem implies
Since is an odd prime number, and are distinct residue classes. Therefore is even, and .
Conversely, put . Pair each integer with in the factorial. Wilson theorem yields
When , is even, so satisfies . This proves the first supplementary law for quadratic reciprocity without assuming a primitive root. Hence
The two solutions are and modulo : their difference is nonzero, and factoring shows that a degree-two polynomial over the field of residues modulo has no further roots.
Gauss lemma states that if and of the least positive residues of
exceed , then .
To prove it, replace each residue exceeding by its negative, obtaining numbers in . No two of them are equal modulo : such an equality would give , hence in the allowed range. They therefore permute , and multiplication gives
Cancel the nonzero factorial and apply Euler's criterion to obtain the lemma.
For , all least positive residues exceed . Hence the first supplementary law for quadratic reciprocity is
For an odd prime , the Legendre symbol is
Euler criterion states that
If , both sides vanish. Otherwise choose a primitive root and write . Since ,
The power is a square exactly when is even, proving the criterion. Taking gives the first supplementary law for quadratic reciprocity
Write . When , the first supplementary law for quadratic reciprocity gives , so . Pairing with gives
The sum of the nontrivial character over all nonzero residue classes is zero. Because its two half-sums are equal when ,
Hence