In August 2026, Lean encountered two consecutive kernel soundness issues. Shortly after a soundness bug was fixed on August 1 (issue 14576), another soundness audit across the kernel was initiated on August 24. Core code that had undergone countless rounds of manual review suddenly revealed flaws when pitted against automated vulnerability fuzzing.
In interactive theorem proving, the kernel is the Trusted Computing Base (TCB): it verifies every single deductive step. If it admits even one false proposition, the integrity of the entire proof tree collapses. For decades, academic systems relied on the “de Bruijn small kernel principle” to manage risk, keeping the codebase small enough for human experts to inspect line by line. With Lean 4.35, the team decided to stop merely patching holes and instead re-architected its defensive perimeter.
Manual Review Hits Its Limit: Two Complementary Paths
Automated vulnerability finding fundamentally altered the engineering calculus for small kernels. Automated tools can exhaustively explore boundary syntax combinations in minutes, meaning human vigilance alone can no longer serve as the bedrock of trust. Lean’s answer unfolds on two fronts: formally proving the checker itself, and deploying multiple independent implementations for continuous cross-verification.
The release introduces the lake check command, which exports the entire development artifact to an external checker, leanchecker, for verification. This process runs inside an isolated sandbox by default, requiring an explicit --inadvisably-no-sandbox flag to disable isolation. By detaching the checking process from the interactive development environment and isolating it in a sandbox, any risk of external environment tampering is cleanly mitigated.
图:Lean FRO(Lean 焦点研究组织)官方横幅。来源:lean-lang.org
con-leche: Proving Lean in Lean with 0.69x Official Instruction Count
At the core of this new architecture lies con-leche: the first Lean kernel written entirely in Lean whose consistency has been formally proven. The implementation and formal proof were developed with Claude (Fable and Opus), under rigorous supervision by Joachim Breitner from the Lean FRO.
Consistency here has a rigorous mathematical definition: every accepted environment has a model in set theory. Built on top of Mario Carneiro’s type-theoretic model of Lean, the proof itself is verified by the official kernel, assuming the underlying set theory remains consistent. This step effectively eliminates an entire class of “implementation-level programming bugs” without any performance penalty. When validating the entire Mathlib repository, con-leche executed only 0.69x the instructions of the official C++ kernel, checking the entire mathematical library in roughly 100 seconds across 8 threads.
图:Leonardo de Moura 个人照片。来源:作者博客
Kernel hardening continues post-release. Arthur Adjedj contributed several changes around issue 14977, with Joachim reviewing each patch to ensure con-leche mirrors the exact semantics and updates its proofs simultaneously, leaving no uncovered edge cases.
Rewriting in Rust for Cross-Verification: Bringing Compilers and Runtimes into Scope
An airtight algorithmic specification does not guarantee that downstream infrastructure is fault-free. Lean’s compiler, runtime environment, and underlying arbitrary-precision arithmetic libraries can harbor bugs that bypass the formal algorithm and corrupt verification outcomes.
Lean neutralizes this risk through software diversity, mitigating common-mode failures. Joachim translated con-leche into a Rust implementation named con-ron, and used Aeneas (a tool for verifying Rust using Lean) to formally verify that the Rust version refines the verification algorithm of con-leche. The probability of a shared bug lurking in both Lean and Rust compilers and runtimes is vanishingly low; running both checkers in tandem provides exceptional defensive strength.
图:Lean Kernel Arena 横幅,用于试用新旧内核。来源:arena.lean-lang.org
Lean 4.35 ships with four additional kernels: nanoda, lean4lean, con-leche, and con-ron. Running lake check --paranoid commands all kernels to independently verify the codebase, while additionally spinning up a hardened-allocator build of the official kernel where any memory corruption triggers a controlled abort rather than a silent miscalculation. Verification of lean4lean is slated for completion within a few months, bringing the count of verified kernels in the distribution to three; its role is critical because its implementation closely mirrors the official C++ kernel.
The team encourages the community to run paranoid mode and report any discrepancies between kernels. Multi-kernel validation delivers value only when distinct implementations run under real-world workloads. Every inconsistency discovered and reported by the community directly strengthens this validation pipeline.
Adoption requires minimal friction: drop lake check --paranoid into your CI pipeline, and the kernels will execute sequentially. Any divergence between two implementations will surface immediately in build logs, rather than lingering unnoticed until downstream mathematical proofs depend on it. Discrepancies can be submitted directly to [email protected].
Multi-Million Line Theorems Meet Monolithic Export: Incremental Verification Becomes the Bottleneck
The sheer scale of formalization projects is expanding dramatically. Anthropic’s formalization of Fermat’s Last Theorem spans over 13 million lines, Mathlib has reached 2.5 million lines, Tau Ceti exceeds 3 million lines and continues to grow, the Courtade–Kumar theorem repository tops 50 million lines, and community proposals have even contemplated 1-billion-line developments.
At this volume, exporting monolithic packages and re-checking them from scratch degrades developer velocity. Recomputing the entire codebase on every minor commit creates a severe CI bottleneck. Sustaining this ecosystem requires transitioning to binary export formats alongside external incremental verification—a priority already explicitly outlined on the Lean team’s immediate roadmap.
Mathematics Moves Beyond Individual Vigilance: Machine Cross-Checking Takes the Gavel
Technical discourse quickly turned to the broader paradigm of mathematical inquiry. While some compared formalization to “requiring computer science undergrads to program exclusively in assembly”—a comparison swiftly challenged by others—mathematics students noted that reading formalized proofs remains significantly harder than following natural-language arguments. Another recurring sentiment was clear: Lean does not supply the initial mathematical insight; its role is solely to audit and validate an idea that has already taken shape.
Formal proof assistants do not generate mathematical intuition; they act as an uncompromising gatekeeper for every deductive step. When faced with tens of thousands of lines of intertwined deductions, human reviewers naturally experience fatigue—an inescapable biological limit, not a lapse in diligence.
By bundling four distinct kernels directly into the release, Lean 4.35 marks an evolution in the foundations of computational trust. Soundness now rests upon machine-checked mathematical proofs and multi-implementation cross-verification, rather than the historical ideal of “code small enough for humans to inspect thoroughly.” With the proof checker itself formally proven, the question of whether a proof holds true has, for the first time, an answer completely independent of human attention spans.
参考链接:
- Leonardo de Moura 关于 Lean 验证内核的博客公告
- Lean 4.35.0 发行说明
- con-leche 仓库与性能报告
- Aeneas 项目与 Rust 形式化验证
- Hacker News discussion on the future of formal mathematics