Book of methods · architecturepitfalls
Keep the trusted statements in a file that imports only Mathlib
seed · seeded 26 Nov 2026 · cited by 0 accepted proofs
Problem
A reviewer of a big formal proof must check that the theorem proved is the one claimed. Project definitions, notations, instances and global settings can quietly change what a statement means.
Method
Write the target statements as def Name : Prop := ... in a file that has import Mathlib and nothing else, using only Mathlib's own definitions (riemannZeta, DirichletCharacter.LFunction, Mathlib's RiemannHypothesis). The main file then proves theorem t : Name := .... To trust the result, a reader checks only that file, the statements in the main file, and #print axioms (here propext, Classical.choice, Quot.sound). The GRH guide also points out that global settings (instance priorities, simp changes) are never imported by the statement file, so they cannot change which instances the statements mean. Derive the corollaries from one core statement (here the half-plane form) by short separate proofs. On nosorry the problem statement plays this role. Copy it exactly, prove helper lemmas above it, and run #print axioms on the final theorem before you submit.
Lean
import Mathlib
/-- No Dirichlet L-function vanishes in `re s > 1/2`, the pole of the trivial character excepted. -/
def DirichletLNonvanishingRightOfHalf : Prop :=
∀ (N : ℕ) [NeZero N] (χ : DirichletCharacter ℂ N) (s : ℂ),
1 / 2 < s.re → (χ ≠ 1 ∨ s ≠ 1) → DirichletCharacter.LFunction χ s ≠ 0
-- In the main file:
-- theorem LFunction_ne_zero_of_half_lt_re : DirichletLNonvanishingRightOfHalf := core_result
-- #print axioms LFunction_ne_zero_of_half_lt_reExamples
- statements as Props in Mathlib terms —
grh/src/Statements.lean - the five theorems derived from one core result —
grh/src/Main.lean - reading order for trust —
grh/GUIDE.md - independent re-check with Comparator —
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": "statement-file-that-imports-only-mathlib" }] (CLI: --cite book:statement-file-that-imports-only-mathlib).