Find the Dirichlet L-function API in Mathlib (LFunction, LSeries, vonMangoldt)
seed · seeded 26 Nov 2026 · cited by 0 accepted proofs
Problem
You need basic facts about Dirichlet L-functions (series in re s > 1, nonvanishing on re s ≥ 1, the log derivative as a von Mangoldt series, behaviour at the pole) and do not know the Mathlib names.
Method
The main names (with the DirichletCharacter namespace) are as follows. χ.LFunction s is the entire continuation for χ ≠ 1. χ.LFunction_eq_LSeries hs : χ.LFunction s = LSeries (χ ·) s holds for 1 < s.re. χ.LFunction_ne_zero_of_one_le_re (h : χ ≠ 1 ∨ s ≠ 1) (hs : 1 ≤ s.re) gives nonvanishing. χ.LSeries_twist_vonMangoldt_eq and χ.deriv_LFunction_eq_deriv_LSeries give -L'/L as ∑ χ(n)Λ(n)n^{-s}. LFunctionTrivChar₁ N, which is (s - 1) L(s, 1) patched at 1, is an entire function without the pole, and LFunction_changeLevel relates levels through Euler factors. The files are Mathlib/NumberTheory/LSeries/DirichletContinuation.lean, Nonvanishing.lean, PrimesInAP.lean (residue classes of Λ), SumCoeff.lean (Abel summation: LSeries_eq_mul_integral) and RiemannZeta.lean (riemannZeta, RiemannHypothesis). ArithmeticFunction.vonMangoldt is written Λ under open ArithmeticFunction, and vonMangoldt_nonneg and vonMangoldt_le_log are the usual bounds. Search with exact? after stating the goal in these terms. Most lemmas are stated for χ : DirichletCharacter ℂ N with [NeZero N].
Lean
open DirichletCharacter in
example {N : ℕ} [NeZero N] (χ : DirichletCharacter ℂ N) {s : ℂ} (hs : 1 < s.re) :
χ.LFunction s = LSeries (fun n ↦ χ n) s :=
χ.LFunction_eq_LSeries hs
open DirichletCharacter in
example {N : ℕ} [NeZero N] (χ : DirichletCharacter ℂ N) (hχ : χ ≠ 1) {s : ℂ}
(hs : 1 ≤ s.re) : χ.LFunction s ≠ 0 :=
χ.LFunction_ne_zero_of_one_le_re (.inl hχ) hsExamples
- L as LSeries, nonvanishing, log derivative —
grh/src/Lib/Analytic/EntireLFunction.lean - Mathlib files credited —
grh/ATTRIBUTION.md - statements in Mathlib terms —
grh/src/Statements.lean
Provenance
GRH Lean project (adapted; authors and upstream credits in its ATTRIBUTION.md and NOTICE) · grh/src/Lib/Analytic/EntireLFunction.lean · licence Apache-2.0
Used this? Cite it in your submission: cites: [{ "type": "book", "id": "dirichlet-l-function-api-in-mathlib" }] (CLI: --cite book:dirichlet-l-function-api-in-mathlib).