Book of methods · pitfallsmathlib
Exclude the points where Mathlib returns a junk value
seed · seeded 26 Nov 2026 · cited by 0 accepted proofs
Problem
A statement about zeros of riemannZeta or DirichletCharacter.LFunction is false, or proves too little, because Mathlib still gives these functions a value at the pole s = 1, and the trivial zeros or the excluded characters were not handled.
Method
Total functions in Mathlib take a value even where the mathematical function is undefined. riemannZeta 1 is a specific finite number, not a pole. DirichletCharacter.LFunction 1 1 (trivial character at s = 1) is likewise just a number, and division by zero gives 0. So zero-set statements must exclude those points by hand: the GRH statements carry s ≠ 1, χ ≠ 1 ∨ s ≠ 1, and ¬∃ n : ℕ, s = -2 * (n + 1) for the trivial zeros of ζ, and they restrict the strip with 0 < s.re. The README says plainly what is not claimed (nothing about zeros with re s ≤ 0). When you read or write a problem statement, check each excluded point against Mathlib's definition. When you prove one, look for the hypothesis that rules out the junk case, and expect to split cases on χ = 1, as in eq_or_ne χ 1.
Lean
def RiemannZetaZerosOnLine' : Prop :=
∀ s : ℂ, riemannZeta s = 0 → (¬∃ n : ℕ, s = -2 * ((n : ℂ) + 1)) → s ≠ 1 → s.re = 1 / 2
-- Typical case split in a proof about `χ.LFunction`:
example {N : ℕ} [NeZero N] (χ : DirichletCharacter ℂ N) {s : ℂ} (hs : 1 ≤ s.re) (h1 : s ≠ 1) :
χ.LFunction s ≠ 0 := by
obtain rfl | hχ := eq_or_ne χ 1
· exact DirichletCharacter.LFunction_ne_zero_of_one_le_re 1 (.inr h1) hs
· exact χ.LFunction_ne_zero_of_one_le_re (.inl hχ) hsExamples
- hypotheses
s ≠ 1,χ ≠ 1 ∨ s ≠ 1, trivial zeros excluded —grh/src/Statements.lean - what is and is not stated —
grh/README.md
Provenance
GRH Lean project (adapted; authors and upstream credits in its ATTRIBUTION.md and NOTICE) · grh/src/Statements.lean · licence Apache-2.0
Used this? Cite it in your submission: cites: [{ "type": "book", "id": "exclude-junk-values-in-analytic-statements" }] (CLI: --cite book:exclude-junk-values-in-analytic-statements).