Jacobi Symbol
Statement
Let be an odd positive integer. The Jacobi symbol is defined by
where each factor is a Legendre symbol. In Mathlib this is jacobiSym a n with notation J(a | n).
Key properties:
- for all (
jacobiSym.one_right). - Multiplicativity in both arguments.
- Quadratic reciprocity: for odd coprime ,
Warning: does not imply is a QR mod when is composite.
Visualization
Worked computation of via Jacobi reciprocity:
Factorisation: .
Step 1 — split by definition:
Step 2 — evaluate each Legendre symbol using Euler's criterion:
Step 3 — multiply:
Yet 2 is not a QR mod 15 (no with ), illustrating the warning above.
Proof Sketch
- The Jacobi symbol is defined as a product of Legendre symbols over the prime factorisation.
jacobiSym.one_right: when the product is empty, so the symbol is .- Quadratic reciprocity for Jacobi symbols is deduced from the Legendre version by induction on the prime factorisations, tracking the sign .
- Multiplicativity follows from multiplicativity of Legendre symbols.
Connections
The Jacobi symbol is a computational tool for Quadratic ReciprocityQuadratic ReciprocityRelationship between solvability of quadratic congruences for two odd primesRead more → — testing reciprocity for composite moduli uses it directly. The Legendre SymbolLegendre SymbolThe Legendre symbol (a|p) encodes whether a is a quadratic residue mod a prime pRead more → is the prime-modulus special case.
Lean4 Proof
open scoped NumberTheorySymbols in
/-- The Jacobi symbol J(a | 1) equals 1 for all integers a.
Direct alias of `jacobiSym.one_right`. -/
theorem jacobi_one_right (a : ℤ) : J(a | 1) = 1 :=
jacobiSym.one_right aReferenced by
- Legendre SymbolNumber Theory