Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Kronecker symbol (dm)\left(\frac{d}{m}\right)(md​) and fundamental discriminants

Definition
ClassNumberFormula_Kronecker

by Lucas · Oct 12, 2026 · Mathlib 0df444a (Lean v4.33.1)

class-number-formulanumber-theory

This file defines the two arithmetic notions used to state Dirichlet's class number formula.

  1. Fundamental discriminant. An integer ddd is a fundamental discriminant if d≠1d \neq 1d=1 and either d≡1(mod4)d \equiv 1 \pmod 4d≡1(mod4) and ddd is squarefree, or d=4md = 4md=4m with m≡2m \equiv 2m≡2 or 3(mod4)3 \pmod 43(mod4) and mmm squarefree. These are exactly the discriminants of quadratic number fields.

  2. Kronecker symbol. For an integer ddd and a natural number m≥1m \ge 1m≥1, write m=2km′m = 2^k m'm=2km′ with m′m'm′ odd. The Kronecker symbol is

(dm)=(d2)k(dm′),\left(\frac{d}{m}\right) = \left(\frac{d}{2}\right)^{k}\left(\frac{d}{m'}\right),(md​)=(2d​)k(m′d​),

where (dm′)\left(\frac{d}{m'}\right)(m′d​) is the Jacobi symbol and (d2)\left(\frac{d}{2}\right)(2d​) equals 000 if ddd is even, 111 if d≡±1(mod8)d \equiv \pm 1 \pmod 8d≡±1(mod8) and −1-1−1 if d≡±3(mod8)d \equiv \pm 3 \pmod 8d≡±3(mod8). For m=0m = 0m=0 the value is 111 if d=±1d = \pm 1d=±1 and 000 otherwise.

For a fundamental discriminant ddd, the map m↦(dm)m \mapsto \left(\frac{d}{m}\right)m↦(md​) is the real Dirichlet character χ\chiχ modulo ∣d∣|d|∣d∣ appearing in Dirichlet's class number formula.

Formalization Note kroneckerTwo d is Mathlib's character ZMod.χ₈ evaluated at d mod 8d \bmod 8dmod8; the odd part uses Mathlib's jacobiSym. The value at m=0m = 0m=0 never enters an LLL-series.

Definition code
import Mathlib

namespace ClassNumberFormula

/-- The Kronecker symbol `(d/2)`: `0` if `d` is even, `1` if `d ≡ ±1 (mod 8)`,
`-1` if `d ≡ ±3 (mod 8)`. -/
def kroneckerTwo (d : ℤ) : ℤ := ZMod.χ₈ (d : ZMod 8)

/-- The Kronecker symbol `(d/m)` for an integer `d` and a natural number `m`.
For `m ≥ 1`, writing `m = 2^k * m'` with `m'` odd, it is `(d/2)^k * (d/m')`, where `(d/m')`
is the Jacobi symbol. For `m = 0` it is `1` if `d = ±1` and `0` otherwise. -/
def kroneckerSymbol (d : ℤ) (m : ℕ) : ℤ :=
  if m = 0 then (if d = 1 ∨ d = -1 then 1 else 0)
  else kroneckerTwo d ^ (m.factorization 2) * jacobiSym d (m / 2 ^ (m.factorization 2))

/-- `d` is a fundamental discriminant: `d ≠ 1` and either `d ≡ 1 (mod 4)` is squarefree, or
`d = 4m` with `m ≡ 2, 3 (mod 4)` squarefree. -/
def IsFundamentalDiscriminant (d : ℤ) : Prop :=
  d ≠ 1 ∧ ((d % 4 = 1 ∧ Squarefree d) ∨
    (∃ m : ℤ, d = 4 * m ∧ (m % 4 = 2 ∨ m % 4 = 3) ∧ Squarefree m))

end ClassNumberFormula
Source
Wikipedia, "Class number formula" (revision oldid=1366411311), https://en.wikipedia.org/w/index.php?title=Class_number_formula&oldid=1366411311, section "Dirichlet class number formula" (definitions of ddd and χ\chiχ); H. Davenport, Multiplicative Number Theory, 3rd ed., GTM 74, Springer 2000, Ch. 6 (pp. 43–53)
Human review
  • Endorsed by Shuze Chen · Oct 13, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Lucas · Oct 13, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me