Tech18 min read

Reproducing Parts of the 288-Core Lean Verification of Alpöge's Riemann Hypothesis on M1 Max

IkesanContents

On November 20, 2026 (US time), Anthropic mathematician Levent Alpöge posted a four-page announcement PDF on his website stating that he believes he and Claude found a proof of the Riemann Hypothesis. The note adds that the same method extends to the Generalized Riemann Hypothesis, and the proof was released purely as Lean proof-assistant source code rather than a human-readable paper. Alpöge explains in the announcement that releasing an unreadable massive document would be inappropriate, so he published the Lean code on its own.

According to Scientific American, MIT mathematician Andrew Sutherland independently compiled the Lean code the same day.
Separately, Simian Luo of Tsinghua University IIIS (Institute for Interdisciplinary Information Sciences, and author of the LCM image-generation speedup method) published a GitHub repository called luosiallen/riemann-hypothesis-lean-verify. The proof archive itself is hosted on alpo.ge, while Luo’s repository contains the verification steps, logs, and source code of the checking tools. Because it goes beyond checking whether the build passes and closes off ways to bypass Lean’s verification, I tested what I could reproduce locally on an M1 Max.

Background Terms

The Riemann Hypothesis is an open problem from 1859 about the Riemann zeta function ζ(s), which takes a complex number s. The function ζ(s) always equals 0 at negative even integers −2, −4, −6, …, which are called “trivial zeros” and excluded from the conjecture; the claim is that every other point where ζ(s) = 0 (“non-trivial zeros”) has real part 1/2. As explained by the Clay Mathematics Institute, the conjecture governs how closely prime numbers follow their average distribution. The Generalized Riemann Hypothesis extends the same claim to the broader family of Dirichlet L-functions.

Lean is a “proof assistant” where mathematical definitions and proofs are written as programs and checked by a computer: propositions to be proved are represented as “types,” and proofs are values that match those types. The small component that makes the final pass/fail decision on whether a proof matches its type is the “kernel.” To make proofs easier to write, Lean includes large automation layers such as “tactics” (which build proof steps) and the “elaborator” (which fills in omitted type details), but no matter what those layers produce, nothing is registered as a theorem unless it passes the kernel’s type check.

Mathlib is the community-maintained mathematical library for Lean, and the Riemann Hypothesis itself is already defined inside Mathlib under the name RiemannHypothesis.

Verification Target and Overall Flow

Here are the verification target and environment listed in the README of Luo’s verification repository.

ItemValue
Distribution14 split parts: https://alpo.ge/lean.tar.gz.part01 through part14
Archive239,275,554 bytes, full-archive SHA-256 hash recorded
Lean source175,187 .lean files (a compilation unit called a “module” in Lean), listed as 1.4GB in the verification repo
Lean versionleanprover/lean4:v4.33.1
MathlibCommit 0df444a360eaa60ab8c11dca51a86af692955474
MachinesRun 1: 128 cores, 503GB RAM; Run 2: 288 cores, 1TB RAM

A community mirror (Tomodovodoo/Riemann) that aggregated line counts from the original archive puts the codebase at roughly 17.37 million lines.
The verification pipeline runs in six stages from download to final replay, with the final kernel replay covering 183,877 modules including pre-cached dependencies such as Mathlib.

graph TD
  A["Download<br/>14 parts and SHA-256"] --> B["Static check<br/>grep for risky syntax"]
  B --> C["Full build<br/>All 175,187 modules"]
  C --> D["Axiom check<br/>Two methods"]
  C --> E["Statement check<br/>Verify definitions"]
  D --> F["Kernel replay<br/>183,877 modules"]
  E --> F

Pre-Build Static Check

Before building, the repo ran a 128-way parallel grep across all source files to count constructs that can weaken Lean’s guarantees. sorry is a placeholder that defers a proof and leaves a theorem unfinished. axiom declares a proposition as an assumed premise without proof, which lets you prove anything if you assert a false axiom. native_decide and implemented_by delegate part of a computation to compiled code outside the kernel, breaking the assumption that only the kernel needs to be trusted.

ConstructCount
sorry / admit0
axiom0
native_decide, ofReduceBool, trustCompiler0
implemented_by, extern, unsafe, opaque0
debug.skipKernelTC0
initialize, IO.0
macro87
run_tac32
run_cmd5
elab4
addDecl2

Because the bottom five constructs were non-zero, the verification repository inspected them manually. The five run_cmd entries configured lemma-search exclusions by removing specific namespaces. The custom tactics kexactB and kcopy (implemented with macro / run_tac / elab) bypass the elaborator’s definitional equality check to fill proof holes directly, yet still go through kernel type checking when registering a theorem. The two addDecl occurrences copy declarations under alternate names and also pass through the kernel.
Since text search alone cannot rule out shortcuts introduced through cached dependencies or separate build paths that skip kernel checking, the pipeline moves on to a full build, axiom inspection, and kernel replay.

Why the Build Stalled on 288 Cores

The build started with Lake, Lean’s standard build tool, but on the 288-core Run 2 machine it slowed down to 30–50 modules per minute compared to roughly 400 modules per minute with plain Lake on the 128-core Run 1 machine. Lake itself was consuming around 225 cores while only 7 to 47 lean processes were actually running. Profiling with perf showed roughly 270 Lake worker threads spending 85% of their time waiting on lock contention over shared build state (lean_st_ref_take), which got worse when adding more cores.

To fix that, Luo replaced only Lake’s scheduler with a custom Python script, sched.py. Parsing import headers across all 175,187 modules revealed 753,569 dependency edges, zero cycles, and a longest dependency chain of 203 modules. sched.py prioritizes that longest chain while keeping 288 lean processes busy, passing the exact same compiler options from Lake’s configuration file (lakefile) so the compiler and per-module kernel checks remain unchanged. Mathlib itself is excluded from this compilation step and loaded from pre-distributed cache files.

On the first attempt, however, 425 downstream modules failed with Unknown identifier. Checking on a small module showed that sched.py had omitted -R (the source root flag) when invoking lean. In a normal Lake build, -R resolves module names without a leading src. prefix, whereas omitting -R caused Lean to name every module src.<path>. Because Lean auto-generates identifiers such as typeclass instance names from module names, references written against Lake’s naming broke.
Luo discarded roughly 105,700 compiled modules (preserving the logs in verification-logs/discarded-run-2c/) and restarted with -R enabled.

On the restarted run, throughput climbed to roughly 1,350–1,700 modules per minute, finishing with the following numbers.

MetricResult
Built modules175,187 / 175,187
Failed / blocked on dependencies / unexecuted0 / 0 / 0
Elapsed time (sched.py phase)2h 0m 33s
Modules with warnings104,066
Warning lines mentioning sorry0

Most warnings came from linters (automated style/lint checks) and deprecated APIs, and the full warning log is published as warnings.log.xz so anyone can confirm there are zero warning lines mentioning sorry.

How #print axioms Can Be Bypassed

Even after a clean build, you still need to check which axioms each theorem depends on. In Lean, #print axioms <theorem> lists the axioms a theorem relies on, and if anything appears outside the three standard axioms—propext (propositional extensionality, treating logically equivalent propositions as equal), Classical.choice (the axiom of choice), and Quot.sound (equality on quotient types)—the proof is not unconditional.

Before relying on #print axioms, Luo tested whether it could miss anything. In a two-line module with debug.skipKernelTC disabling kernel checks, registering bogusFalse : False := True.intro via addDecl compiled without error, and running #print axioms on a theorem built from it printed “no axioms.” In Lean 4.33, #print axioms simply reads the axiom list pre-computed when each .olean (the compiled intermediate file for a .lean module) was written, and silently skips missing constants in the environment.

To close that gap, the repo pairs #print axioms with a custom script, AxiomWalk.lean, which loads the full environment and walks every constant reachable from a theorem, failing immediately if any constant is missing.
The initial version of AxiomWalk re-read the module name list of roughly 186,000 modules (the 175,187 archive modules plus Mathlib and dependencies) for every single constant visited, taking about 12 ms per read—around 130 constants per second, or roughly 3 hours estimated. Moving that lookup outside the loop cut the riemannHypothesis walk across 1.48 million constants down to roughly 5.5 minutes.
Both #print axioms and AxiomWalk confirmed that all five top-level theorems depend only on the three standard axioms, with zero missing constants.

TheoremConstants reached by AxiomWalk
riemannHypothesis1,478,219
riemannZeta_eq_zero_re1,478,221
LFunction_ne_zero_of_half_lt_re1,478,211
LFunction_eq_zero_re1,478,224
LFunction_eq_zero_re_of_isPrimitive1,478,214

Auditing That the Statements Were Not Swapped

Even with only the three standard axioms, the proof would not solve the Riemann Hypothesis if the proven statement itself had been altered. The five top-level theorems in src/Main.lean are shown below (in Lean, the type after : is the proposition and the term after := is its proof).

theorem riemannHypothesis : RiemannHypothesis := rhOfAll
theorem riemannZeta_eq_zero_re : RiemannZetaZerosOnLine := rhOfAll
theorem LFunction_ne_zero_of_half_lt_re : DirichletLNonvanishingRightOfHalf := allChi
theorem LFunction_eq_zero_re : DirichletLZerosOnLine := claimAll.2.1
theorem LFunction_eq_zero_re_of_isPrimitive : PrimitiveDirichletLZerosOnLine := critAll

The first theorem uses Mathlib’s RiemannHypothesis directly, while the other four are defined in Statements.lean inside the archive, which imports only Mathlib. Printing Mathlib’s RiemannHypothesis in Lean gives:

def RiemannHypothesis : Prop :=
∀ (s : ℂ), riemannZeta s = 0 → (¬∃ n, s = -2 * (↑n + 1)) → s ≠ 1 → s.re = 1 / 2

In plain terms (Prop is Lean’s type of propositions, ↑n casts a natural number n to complex, and s.re is the real part of s): for every complex number s, if ζ(s) = 0 and s is neither a trivial zero −2(n+1) nor s = 1, then the real part of s is 1/2. Because redefining something like riemannZeta locally inside the archive could disguise a different claim, Luo ran StatementAudit.lean to trace which module defines each constant in the statements.

CheckResult
Origin of RiemannHypothesis and riemannZetaMathlib’s Mathlib.NumberTheory.LSeries.RiemannZeta
Origin of DirichletCharacter.LFunctionMathlib’s Mathlib.NumberTheory.LSeries.DirichletContinuation
Origin of the 4 custom statementsArchive’s Statements (imports only Mathlib)
Types of all 5 theoremsMatch their declared statements
RiemannZetaZerosOnLine = RiemannHypothesisPasses type checking via rfl (definitional equality)
Mathlib checkout0df444a360ea, 0 modified files

The second theorem’s RiemannZetaZerosOnLine is definitionally identical to Mathlib’s RiemannHypothesis, while the remaining three theorems (the Generalized Riemann Hypothesis claims for Dirichlet L-functions) are defined in the archive. Scripts can confirm that their building blocks come from Mathlib, but verifying that those three custom formulas faithfully express GRH still requires human reading. The full definitions of all four custom statements are included in the repository.

Replaying Every Module Through the Kernel

The final stage replays compiled .olean files through Lean’s kernel. As the debug.skipKernelTC example showed, a successful build alone cannot catch constants that entered an .olean without kernel verification. Lean 4.33 ships with leanchecker (successor to lean4checker), which normally loads dependency .olean files as already trusted and re-checks only the constants defined in the target module itself—meaning you either have to replay all dependency modules down to the leaves or pass --fresh to rebuild from an empty environment.

Because the stock leanchecker CLI rescans every .olean on the search path for each command-line argument, it was too slow at this scale. Luo copied leanchecker’s core replay routine (replayFromImports) into ReplayExact.lean and changed only how the module list is supplied. It replays every module Main depends on, excluding only Lean’s built-in Init, Std, Lean, and Lake libraries, while including Mathlib and other dependencies that were loaded from cache during the build.

Before running the full replay, both the stock leanchecker and replayexact were tested against the dummy bogusFalse module: both rejected bogusFalse with (kernel) declaration type mismatch while accepting valid modules and Mathlib.
Running ReplayExact across the full project produced these results.

MetricResult
Modules replayed183,877 (175,187 archive, 8,312 Mathlib, plus other dependencies)
Passed / Failed183,877 / 0
Concurrency256 processes, 100 modules per batch
Wall-clock elapsed time3,557 seconds (approx. 59 minutes)
Sum of per-module times (total CPU-time sum)816,978 seconds (approx. 227 hours)
Slowest single moduleGroundTheory.PAdicHodge.BCrisGalois (391.2 seconds)

Module names reflect modern number theory areas such as p-adic Hodge theory, abelian varieties, and automorphic spectra, though you cannot tell from filenames alone which files correspond to the theta-lift and automorphic-form arguments mentioned in Alpöge’s PDF.

According to the verification logs, the 183,877-module ReplayExact run completed, though the README checklist was left marking replay as pending; meanwhile, the operators skipped two planned extra checks: cross-checking 59 modules with the stock leanchecker binary against replayexact, and running a single-threaded leanchecker --fresh Main from an empty environment. As the README itself notes at the end, passing the kernel check is strong evidence assuming Lean’s kernel and Mathlib’s definitions are sound, but it does not replace mathematical review of the statements and toolchain by specialists. Alpöge likewise notes in his announcement that the argument is currently very long and rewriting it for human comprehension still lies ahead.

Build logs, warnings, and replay logs are published with SHA-256 checksums in verification-logs/. Anyone with the matching Lean and Mathlib versions and the 14 archive parts can reproduce the checks from lake build, so I tested what could be run locally on an M1 Max.

What I Checked Locally on an M1 Max

Even on a 288-core machine the full build took two hours, so re-running everything locally is impractical. Instead, I chose small standalone experiments that do not need Mathlib alongside small slices that do use Mathlib, and walked through the verification repo’s steps on an M1 Max.

Test Environment

ItemValue
MachineM1 Max, 64GB RAM
Lean4.33.1 (commit 819816b2e0a3, matching the verification log)
Mathlib0df444a360ea (using the lake-manifest.json bundled in the archive)
ArchiveDownloaded from alpo.ge on November 21, 2026 (JST)

Archive Hashes and Static Check

Downloading the 14 parts totaled 239,275,554 bytes, and both the combined SHA-256 hash and all 14 per-part hashes matched the verification repo. Extracting the archive produced 175,187 .lean files, 17,374,215 lines, and 1,030,531,854 bytes; the file and line counts match the community mirror, while the byte size differs from the 1.4GB figure written in the verification repo (the public notes do not explain the discrepancy). lakefile.toml is purely declarative and contains no Lean code executed at build time.

I also re-ran the static syntax counts using ripgrep word-boundary matching.

ConstructLocalVerification Repo
sorry admit axiom native_decide ofReduceBool trustCompiler implemented_by extern unsafe opaque debug.skipKernelTC initializeAll 0All 0
macro / run_tac / run_cmd / elab / addDecl87 / 32 / 5 / 4 / 287 / 32 / 5 / 4 / 2
IO.1430

The 143 IO. matches were all linear-map identifiers prefixed with IO (such as IO.HfInt and IO.sqrt_d_pos) rather than I/O APIs. Actual I/O calls like IO.print, IO.FS, or IO.Process totaled 0, and the public repo notes do not detail how its count reached 0.
The five run_cmd entries were Lean.modifyEnv calls in BuildAid/D1–D5.lean, and the two addDecl entries were alias registrations in CutCptCopy.lean, matching the 288-core report.

Reproducing the #print axioms Bypass

In a small Lake project without Mathlib, I reproduced the bogusFalse bypass. Writing set_option debug.skipKernelTC true in theorem bogusFalse : False := True.intro as a normal theorem still fails at the elaborator with Type mismatch, because debug.skipKernelTC only disables the kernel check and leaves elaborator type checking active. Calling addDecl directly via metaprogramming succeeded without error; because anything follows from False (the principle of explosion), using it in theorem oneEqTwo : 1 = 2 := bogusFalse.elim compiled and #print axioms reported 'oneEqTwo' does not depend on any axioms. Removing debug.skipKernelTC caused the same addDecl call to fail with (kernel) declaration type mismatch.

Splitting this into three files—Demo.Bogus containing the fake declaration, Demo.UseBogus using it, and Demo.Good containing only valid theorems—passed lake build. Running stock leanchecker on individual modules, the whole Demo target, and with --fresh produced the following outputs.

TargetExit CodeOutput
Demo.Good0None
Demo.Bogus1(kernel) declaration type mismatch
Demo.UseBogus0None
Demo (whole target)1(kernel) declaration type mismatch
--fresh Demo.UseBogus1(kernel) declaration type mismatch
--fresh Demo.Good0None

Passing Demo.UseBogus alone exited with 0 even though it relies on a false theorem, because stock leanchecker trusts already-compiled dependency .olean files like Demo.Bogus and re-checks only constants in Demo.UseBogus itself—which explains why the verification repo replayed all dependencies of Main. Adding --fresh replays from an empty environment and caught Demo.UseBogus on its own, though even Demo.Good with zero imports took roughly 40 seconds and up to ~500MB of RAM per run.

Checking Statements.lean Definitions

In a separate directory pinned to the same Mathlib commit, I copied Statements.lean from the archive (16 lines, importing only Mathlib) and built it. All nine dependency package commits matched the archive’s manifest, downloading the 8,690 prebuilt Mathlib cache files recorded in the verification log (which includes dependencies beyond the archive’s direct module set) took about 99 seconds, and building Statements itself took 27 seconds.

A small Lean command printing the origin module of each constant matched the verification repo’s table.

ConstantOrigin Module
RiemannHypothesis, riemannZetaMathlib.NumberTheory.LSeries.RiemannZeta
DirichletCharacter.LFunctionMathlib.NumberTheory.LSeries.DirichletContinuation
DirichletCharacter.IsPrimitiveMathlib.NumberTheory.DirichletCharacter.Basic
RiemannZetaZerosOnLine, DirichletLZerosOnLineStatements (in the archive)

example : RiemannZetaZerosOnLine = RiemannHypothesis := rfl compiled without error, and mutating the proposition in three single-spot tests confirmed that rfl rejects changes.

Mutationrfl Result
Drop the s ≠ 1 conditionRejected with Type mismatch
Change real part from 1 / 2 to 1 / 3Rejected with Type mismatch
Exclude −2n (including 0) instead of −2(n+1)Rejected with Type mismatch

Dependency Graph Counts

Parsing the leading import lines of every file took about 19 seconds and matched the verification log’s dependency graph metrics.

MetricValue
Internal import dependency edges in archive753,569 (0 cycles)
Longest dependency chain203 modules
Modules depended on by Main175,187 (0 unused files)
Files writing import Mathlib (full Mathlib)155,753
Distinct Mathlib modules imported individually344
Files with 0 internal archive imports5,927
Most-imported moduleCTSmallCone (3,088 files)
Module with most imports in a single fileHeisenbergConjugationMeasurePreserving (370 imports)

Mapping the per-module build times from the verification repo’s build log (1,954,959 seconds total, roughly 543 hours) onto this dependency graph gave a heaviest critical path to Main of 54 modules taking 3,893.8 seconds (roughly 65 minutes). Because modules along that chain must run sequentially, 65 minutes is the theoretical lower bound on cores of similar speed, compared to the ~2 hours Run 2 took on 288 cores.

Partial Build of 153 Modules

I picked Development.AutomorphicSpectrum.Proofs.MetricProofs.LogSineMongeAmpereIntegralStatement, whose dependency closure spans 153 modules, copied only those dependencies into a clean directory, and built it with the archive’s lakefile.toml flags (maxHeartbeats = 4000000, --tstack=400000, etc.). The prebuilt Mathlib cache failed to trigger, however, so Lake rebuilt all 8,312 Mathlib modules along with dependencies like Batteries and Aesop from source, pushing total wall time to 3,394 seconds (roughly 57 minutes).

Isolating just the 153 archive modules—all of which built with zero errors—and comparing them against the 288-core build log gave the following numbers.

MetricM1 Max288-Core Machine
Total time across 153 modules1,669 seconds1,314 seconds
Median per-module time9.8 seconds7.8 seconds
M1 Max / 288-core ratio (per module)Median 1.20x, 10th–90th percentile 0.67x–1.64x-
Peak memory per processApprox. 6.1GB-

ProjTwist (40.0s vs. 13.9s on 288 cores) and FubiniStudyIntegral (38.0s vs. 12.1s) were noticeably slower on M1 Max, though CPU contention with the simultaneous Mathlib rebuild was also a factor.
Applying the 1.2x ratio and the observed average parallelism (~9.2 effective cores) from this run to the 543-hour total gives roughly 71 hours—about 3 days—with kernel replay (~227 hours total on the 288-core machine) required separately on top of that. Because this extrapolates from 153 out of 175,187 modules, it does not account for whether heavier modules like GroundTheory.PAdicHodge scale at the same ratio or how ~6.1GB peak memory per process would cap concurrency. Incidentally, the working directory holding the extracted archive and Mathlib had reached roughly 24GB by this point.