The law of quadratic reciprocity
ProvedFamousTheorems.quadratic_reciprocityGauss's law of quadratic reciprocity.
For distinct odd primes ,
So the two questions "is a square mod ?" and "is a square mod ?" have the same answer unless both primes are , in which case the answers are opposite. There is no a priori reason these should be related at all, which is what makes the law startling.
Conjectured by Euler and Legendre; Gauss gave the first complete proof in 1796 at eighteen and returned to it repeatedly, eventually publishing eight proofs — he called it the aureum theorema, the golden theorem. Over two hundred proofs are now known.
It is the first case of class field theory: the generalisations to higher powers (Eisenstein, Kummer) and to Artin reciprocity are among the central achievements of algebraic number theory.
Formalization note. The exponent uses natural division, so for odd .
import Mathlib
namespace FamousTheorems
theorem quadratic_reciprocity : ∀ {p q : ℕ} [Fact (Nat.Prime p)] [Fact (Nat.Prime q)],
p ≠ 2 → q ≠ 2 → p ≠ q →
legendreSym q p * legendreSym p q = (-1) ^ (p / 2 * (q / 2)) := by sorry
end FamousTheorems