Kernel-checked Lean 4 proofs of the class number one theorem (two routes) and of the class number two list, without Heegner's method, and a verified comparison of tenth-discriminant bounds
Authors/Creators
Description
Lean 4 formalizations, certificate generators, numerical checks and four papers, for imaginary quadratic fields, all without Heegner's method. Two proofs, by different routes, of the class number one theorem: for squarefree m ≥ 1, Q(√−m) has class number one if and only if m ∈ {1, 2, 3, 7, 11, 19, 43, 67, 163}. They prove the same Lean statement with the same trust base, and share the statement, the foundational modules and the converse (the Minkowski-bound proof that the nine fields have class number one). And a third entry, which proves that Q(√−m) has class number at most two exactly for those nine and eighteen further radicands, and class number exactly two exactly for the eighteen. Written for T. Tao's tenth-discriminant AI-math challenge of 20 October 2026. Version 1.4.0 improves the fourth entry's analytic cutoff from q < 565 to q < 548, using modern explicit bounds for the Chebyshev function (Broadbent, Kadiri, Lumley, Ng and Wilk, arXiv:2002.11068; Büthe, Math. Comp. 87, 2018) read at source, transcribed twice independently by two AI sessions (no human check) and tested against exact prime sums to 10^9; it also corrects the v1.3.0 input for Mertens' constant E (every gap moves by about 10^-16; no conclusion changes). The fourth entry (directory comparison/) is NOT a Lean proof and is NOT kernel-checked; the first three entries are unchanged. Version 1.3.0 added the fourth entry: a survey of the tenth-discriminant bounds posted for the challenge, a reproduction of the determinant bound q < 570, and an analytic cutoff.
Fourth entry (tenth-discriminant bounds compared; NOT kernel-checked). Certified by interval arithmetic (Arb), and reproduced per band by a separately written AI implementation (high-precision floating point). In comparison/, every extraction posted in the comments of Tao's post by 25 October 2026 (the thread as read that day, 74 comments) is quoted at source with its author and labelled by what we could check (reproduced, kernel-checked formalisation, cited, not reproducible); every zero-free input goes through one Chowla–Selberg reduction, which, read backwards, puts every method on one scale, the zero-free abscissa it is worth on this problem (twinheterodox's light determinant bound q < 570 is worth 0.861, ahead of the 7/8 half-plane). The determinant bound of twinheterodox/tenth-discriminant v0.6.1 (commit 44c7d6fc; after B. Green, R. van Dijk, K. Pratt and B. Kerr) is rebuilt from our own derivation and agrees row by row in its own configuration. With an exact treatment of the Poisson modes in the norm series, Rosser–Schoenfeld's sharper constant, our own rows, γ and kernels, and a Taylor-model check of band uniformity, four certified bands exclude [565, 652]; with the first entry's kernel-checked d ≤ 652 this gives the analytic cutoff |D| < 565 with Rosser–Schoenfeld's 1962 estimates. With modern explicit bounds for θ(x) (Broadbent–Kadiri–Lumley–Ng–Wilk; Büthe 2018, which uses the zeros of ζ to height 10^11), five further bands exclude [548, 565]: if h(Q(√D)) = 1 for a fundamental discriminant D < 0, then |D| < 548, the range below being a direct count of reduced forms. The gain over 570 is about 3.9% and changes no candidate; the binding margin is 0.0013. Two printed statements in the arXiv versions of these sources fail against exact prime sums and are corrected or excluded. Inputs: Rosser–Schoenfeld 1962 (Table I; Theorems 4, 6, 9, 14; (2.11) and (3.21), cited) for [565, 652]; the explicit bounds for θ(x) of Broadbent, Kadiri, Lumley, Ng and Wilk and of Büthe 2018 for [548, 565]; and OpenAI's 7/8 theorem only through the first entry's d ≤ 652 for q ≥ 653. It is not kernel-checked because explicit prime estimates of that quality do not yet exist in Lean without trusted numerical inputs or sorry, and the modern ones rest on large computations.
First proof (the 7/8 route). Under class number one, the Dedekind zeta function is half an Epstein zeta function and equals ζ(s)L(s,χ). The Chowla–Selberg formula, with an explicit remainder proved in Lean, continues it to s = 7/8. OpenAI's zero-free region Re s > 7/8 for Dirichlet L-functions (openai/math, family 003, commit adc7f124) gives L(7/8,χ) ≥ 0 while ζ(7/8) < 0, forcing d ≤ 652, proved in Lean about Mathlib's riemannZeta and Gamma. Kernel-checked split-prime witnesses dispose of the 190 remaining fields, and the Minkowski bound proves the converse for the nine. The route was worked out in the comments of Tao's post.
Second proof (the determinant route). No L-function, no zeta function and no zero-free theorem is in its closure, and it needs nothing beyond Mathlib and its dependencies. Under class number one with q = |disc K| ≥ 2^15, every prime below q/4 is inert and every split prime is a value of the norm form; a lattice count makes split primes sparse and yields an inert prime R in (q^4, q^5]. Green's derivative determinant on a grid of algebraic integers is nonzero modulo R by van Dijk's finite-field argument, Frobenius makes it divisible by a large power of every inert prime p ≤ R, and its complex size is too small for that. Below 2^15, a residue sieve over 4,095 integers, checked by the kernel, and two lemmas at p = 2 leave only the nine fields. The argument is that of the companion note twinheterodox/tenth-discriminant, companions/elementary, commit 64694aae, building on contributions of L. Silberman, K. Pratt, B. Green and R. van Dijk; the credits are in the README and the paper. The closure still contains integration, the Minkowski convex-body theorem and Mathlib's Gamma function, so the proof is not called elementary.
Third entry (class number at most two). In hcn/, the first proof's route is extended from one ideal class to every class. For squarefree m ≥ 1, Q(√−m) has class number at most two if and only if m is one of the nine radicands above or one of the eighteen radicands 5, 6, 10, 13, 15, 22, 35, 37, 51, 58, 91, 115, 123, 187, 235, 267, 403, 427, and class number exactly two if and only if m is one of these eighteen. The Dedekind zeta function splits into one Epstein zeta function per ideal class, taken on a Hermite basis of an ideal in the inverse class, with leading coefficient between 1 and (2/3)√d. A Chowla–Selberg formula for every positive definite binary form, with an explicit remainder bound, continues each class sum to s = 7/8, and OpenAI's 7/8 theorem, whose Lean proof is inside the checked closure, not an assumption, then forces d ≤ 4777 when the class number is at most two. To close at 4777 with the enclosures proved for the first entry, the positive y = 0 term of the non-principal class has to be kept: without it the margin at d = 4778 is about 2·10−5, which the proved enclosure of Γ(3/8)/Γ(7/8) cannot resolve; with it the margin is about 0.069, and at least 0.0674 from the proved rational brackets alone. Below 4778, certificates built from the principal norm form alone show class number at least three for each of the 1,429 other fields, certificates built on a non-principal ramified prime show class number two for the eighteen, and the first proof's theorem gives class number one for the nine. The proof does not use Heegner's method (no j-invariant or singular moduli occur in the closure), linear forms in logarithms, or the Gross–Zagier formula; it does use modular objects, the Jacobi theta function and its modular transformation and, through OpenAI's proof, non-holomorphic Eisenstein series. The route is LemmaLab's extension of the Chowla–Selberg argument to all class numbers, posted in the comments of Tao's post (comment 698478), in the form that Mathlib and the first entry make provable; the credits, including the commenters' own statements of their AI use, are in hcn/README.md and the paper. The theorem itself is classical: Baker and Stark showed in 1971 that the class number two problem is effectively solvable, and the list of eighteen fields was completed by Montgomery and Weinberger (1974) and by Stark (1975).
Verification. The statement uses only Mathlib definitions. Each proof depends only on propext, Classical.choice and Quot.sound. Comparator (leanprover/comparator v4.34.0) accepts each under two independent kernels, nanoda and Lean's, and rejects tampered statements; the runs were local and not sandboxed. For the first proof, OpenAI's Lean proof of the 7/8 theorem is inside the checked dependency closure, not an assumption, and an independent replay by a separate AI review session (its own build of the project's modules and of nanoda, against the same verified dependency tree, with the same Comparator and lean4export binaries, on the same machine; local, not sandboxed) accepted the proof under both kernels, rejected two further tampers, and its closure audit agrees with ours. A clean copy of the formalization directory builds from the published instructions. For the determinant route, a closure audit of 69,295 constants found only the three standard axioms and no constant from Mathlib's L-series, Euler-product, zeta or modular-form modules, and nothing beyond Mathlib and its dependencies apart from the project's own code. A separate AI review session then re-ran Comparator and the closure audit with its own build of the project's modules and of nanoda (with the same Comparator and lean4export binaries, on the same machine; local, not sandboxed), and ran five controls of its own: both kernels accepted the theorem again, its closure audit agreed, and all five controls failed as required. For class number two, Comparator accepted both theorems under both kernels and rejected three tampered statements; a closure audit of 135,435 constants found only the three standard axioms, with OpenAI's 7/8 theorem walked as a theorem; the published sources compile to the same closure, byte for byte in its lean4export export, as the checked ones; and a separate AI review session re-ran Comparator and the closure audit with its own build of the project's modules and of nanoda, and ran five controls of its own (the dependencies were not rebuilt): both kernels accepted the theorems again.
Status. Not refereed. The fourth entry is not kernel-checked. OpenAI's manuscript and the companion note are unrefereed, although the Lean proofs are kernel-checked. The work was produced with extensive AI assistance (Claude, Anthropic), with independent AI review; see the README.
Licensing. Mathematics, Lean code, generators and scripts: Apache-2.0. Papers and documents: CC-BY-4.0. The vendored Telperion engine in telperion/ is under the Business Source License 1.1 (free for research, teaching and peer review). See LICENSING.md.