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.
Accepted Atlas resultNot recorded for the preferred artifact
These states distinguish upstream identity, local reproduction, review, and Atlas acceptance. This page is part of the public, read-only Mathlib landmark collection.
Formal orientation
Statement map
This deterministic map orients the reader from the mathematical summary to the pinned declaration and exact checked form. The HTML statement below is authoritative.
The theorem at a glance
Quadratic Reciprocity at a glance
A source-bound editorial overview of the exact Mathlib formulation. The image is explanatory; the statement map, formal type, and pinned source remain authoritative.
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. Generated explanation only; the exact HTML statement and pinned source are authoritative.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.
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. Generated explanation only; the exact HTML statement and pinned source are authoritative.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.
Complementary intuition
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.
The low-text schematic gives the theorem a visual identity; it does not replace the source-bound poster or exact statement.
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 quadratic-character reciprocity
Invoke quadratic-character reciprocity
Loading full-resolution image…
Mathlib's finite-field quadratic-character reciprocity lemma supplies the central cross-field relation.Open original image in a new tab ↗
Mathlib's finite-field quadratic-character reciprocity lemma supplies the central cross-field relation.
h := quadraticChar_odd_prime ...
The proof applies quadraticChar_odd_prime to ZMod p and the odd prime q, using p ≠ q to keep the transported element nonzero. After rewriting the cardinality of ZMod p, this becomes the relation that the remaining rewrites normalize.
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.
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.