For two distinct odd primes p and q, whether q is a square modulo p and whether p is a square modulo q are linked. Their Legendre symbols multiply to a sign determined by the parities encoded by p divided by 2 and q divided by 2.
A visual guide to the theorem's hypotheses, structure, and conclusion; the exact statement gives the formal detail.
Quadratic Reciprocity at a glance
Loading full-resolution image…
The reciprocal Legendre-symbol product has one exact parity-controlled sign, with p divided by 2 and q divided by 2 interpreted by natural-number floor division.Open original image in a new tab
The reciprocal Legendre-symbol product has one exact parity-controlled sign, with p divided by 2 and q divided by 2 interpreted by natural-number floor division. Explanatory diagram.Detailed visual description
Green and blue prime medallions face each other across reciprocal arcs. A central formula gives the Legendre-symbol product and its sign exponent. Below it, the poster explicitly says natural division rounds down and separates the both-3-mod-4 minus case from the otherwise-plus case.
This map summarizes the statement's structure; the exact Mathlib declaration remains authoritative.
Quadratic residue reciprocity schematic
Loading full-resolution image…
Quadratic residue information in two odd distinct primes is linked in both directions, with a parity-controlled sign.Open original image in a new tab
Quadratic residue information in two odd distinct primes is linked in both directions, with a parity-controlled sign. Explanatory scientific diagram.Detailed visual description
Two large symmetric residue circles face each other across reciprocal gold arrows. Smaller paired circles below show one aligned exchange and one restrained red reversal cue, suggesting the parity-dependent sign without rendering notation.
Why it matters
A mathematical landmark
Quadratic reciprocity is a central symmetry law of elementary number theory. It turns one quadratic-residue question into another, with an exact sign correction.
Proof architecture
How quadratic characters yield reciprocity
4 curated stages
Mathlib's checked route prepares odd-prime field inputs, invokes its finite-field quadratic-character reciprocity identity, cancels the squared nonzero character factor, and evaluates the remaining parity signs.
These source-anchored stages explain the retained Mathlib proof route. They are generated explanations, not proof evidence or an extracted Lean proof-term dependency graph.
01
Prepare the odd-prime inputs
Prepare the odd-prime inputs
Loading full-resolution image…
The non-two hypotheses supply the oddness and characteristic facts required by the quadratic-character identity.Open original image in a new tab
The non-two hypotheses supply the oddness and characteristic facts required by the quadratic-character identity.
Odd p ∧ Odd q ∧ ringChar (ZMod q) ≠ 2
Primality together with p ≠ 2 and q ≠ 2 supplies oddness for both primes, while the ZMod characteristic calculation supplies the non-characteristic-two input used later. The distinctness hypothesis is retained for the cross-field nonzero argument.
02
Invoke the cross-field quadratic-character identity
Invoke the cross-field quadratic-character identity
Loading full-resolution image…
Mathlib’s quadraticChar_odd_prime identifies the quadratic character of q in ZMod p with the quadratic character of χ₄(p) · p in ZMod q.Open original image in a new tab
Mathlib’s quadraticChar_odd_prime identifies the quadratic character of q in ZMod p with the quadratic character of χ₄(p) · p in ZMod q.
h := quadraticChar_odd_prime ...
At stage 2, the proof obtains h : quadraticChar (ZMod p) q = quadraticChar (ZMod q) (χ₄ p * p) after rewriting the cardinality of ZMod p as p. A cobalt cross-field bead enters the forest-green field wheel; on the other side, a forest-green bead pairs with the antique-gold χ₄ motif before entering the cobalt field wheel. Matching gold result strands meet at a central balance. No Legendre-symbol product, square cancellation, parity evaluation, or final reciprocity conclusion is present.
03
Normalize and cancel the square
Normalize and cancel the square
Loading full-resolution image…
Unfolding the Legendre symbols exposes multiplicative quadratic characters, and the squared nonzero character factor collapses to one.Open original image in a new tab
Unfolding the Legendre symbols exposes multiplicative quadratic characters, and the squared nonzero character factor collapses to one.
quadraticChar (ZMod q) p ^ 2 = 1
The final rewrite chain expands both Legendre symbols, aligns the natural and integer casts, substitutes the reciprocity relation, rotates the product, and uses quadraticChar_sq_one with prime_ne_zero. This algebraic cancellation leaves only parity-controlled sign factors.
04
Evaluate the reciprocity sign
Evaluate the reciprocity sign
Loading full-resolution image…
Oddness evaluates the two character signs and leaves exactly the parity-controlled sign in quadratic reciprocity.Open original image in a new tab
Oddness evaluates the two character signs and leaves exactly the parity-controlled sign in quadratic reciprocity.
legendreSym q p * legendreSym p q = (-1) ^ (p / 2 * (q / 2))
The proof uses χ₄'s odd-input evaluation for p and q together with quadraticChar_neg_one in ZMod q. The exponent rewrites combine the two parity contributions and close the exact Legendre-symbol product stated by quadratic_reciprocity.
Accepted Atlas resultNot recorded for the preferred artifact
Mathlib is the source of the theorem; the local Lean replay and page review are separate.
Claim boundary
No new theorem is claimed
This page states Mathlib's Legendre-symbol formulation for primes supplied through Fact instances, with explicit exclusions p ≠ 2, q ≠ 2, and p ≠ q. It does not present the Jacobi-symbol variants or remove those hypotheses.
Proof Atlas did not originate quadratic reciprocity or Mathlib's declaration.
The displayed sign uses Mathlib's exact p / 2 * (q / 2) exponent form.
The page does not claim a new proof or a stronger reciprocity law.