Lean's Verified Kernels Make Proof Checking a Team Sport
A theorem prover can spend hours searching for a proof, but its final claim rests on a much smaller program: the kernel. The kernel checks whether the submitted proof term really has the claimed type. If the claim is a theorem, the term is evidence for it. Tactics, editors, and AI systems may construct the term; none of them should get to declare it valid. That separation is the reason a complicated proof development can still have a relatively small trusted core.
Small is not the same as infallible. In 2026, Lean’s maintainers documented soundness bugs in both the kernel and its runtime. Some could make Lean accept a proof of False, the canonical sign that the checker has admitted a contradiction. The resulting response is more substantial than another patch: Lean 4.35.0 ships a routine way to export a project and recheck it with independent kernels. It also includes a checker whose consistency has been formally proved under stated mathematical assumptions.
Why a second checker changes the trust story
Lean source code is elaborated into expressions and declarations that the kernel understands. A tactic can be wrong, and an AI agent can produce nonsense, but a sound kernel rejects a malformed result. A kernel bug crosses that boundary: an invalid declaration can enter the environment as though it were justified. Once that happens, later proofs can rely on it.
Rechecking creates a second boundary. Rather than asking the same compiler and runtime to repeat the same computation, an exporter serializes the development and another program reconstructs and checks its declarations. If one checker accepts a bogus proof because of an implementation mistake, a genuinely different checker has a chance to reject it. That chance grows when implementations use different languages, runtimes, algorithms, and proof arguments.
This is not just a theoretical concern. An August postmortem describes a nested-inductive-type bug used to construct a sorry-free false claim. An old version of the Rust checker nanoda accepted the same artifact for a different reason: its own missing check. That incident shows both the value and the limits of diversity. Two implementations can fail independently, and an external checker only helps when the version being run has the relevant fixes.
The elaborator cannot be the security boundary. Lean metaprograms can submit declarations directly; a malicious artifact can also bypass ordinary source processing. As the postmortem explains, the kernel must reject ill-typed input on its own. Rechecking exported declarations tests that boundary more directly than compiling a file a second time.
The new lake check path
Lean 4.35 adds lake check to the normal Lake project workflow. It exports the development, then runs leanchecker, a stripped-down form of the official kernel, to inspect the export inside a sandbox. The explicit escape hatch, lake check --inadvisably-no-sandbox, signals that isolation is part of the default design. Sandbox protection matters because checking an adversarial development should not grant its build scripts and extensions unrestricted influence over the recheck process.
For a broader comparison, lake check --paranoid runs four additional kernels: nanoda, lean4lean, con-leche, and con-ron. It also runs a variant of the official kernel with a hardened memory allocator that turns some memory corruption into an abort. These checks are complementary. A leanchecker pass catches issues in the serialized development under the official rules; independent kernels test whether a distinct implementation agrees; the hardened allocator targets a different failure mode in the official implementation.
The names are easy to blur, so their roles matter. nanoda is a Rust external checker. lean4lean implements a Lean checker in Lean and follows the official C++ kernel relatively closely; its verification is still in progress. con-leche is another checker written in Lean, with a completed consistency argument. con-ron is a Rust port whose relation to con-leche’s algorithm has been proved with Aeneas. Calling all four “verified kernels” would overstate their status: they provide different kinds and degrees of assurance.
What con-leche actually proves
The strongest new claim is about accepted environments, not about a checker merely agreeing with the reference implementation. Con-leche’s proof shows that an environment it accepts has a model in a specified set theory. In that model, each constant receives a meaning and accepted constants inhabit the meanings of their declared types. False is interpreted as the empty set. An accepted proof of False would therefore have to inhabit an empty set, which is impossible within those assumptions.
There is a careful qualification: the proof assumes a suitable set-theoretic model. It does not prove from nothing that all mathematics is consistent. It is also checked by Lean’s official kernel, so the formal proof artifact still inherits the trust requirements of the system that checks it. The useful advance is a machine-checked argument connecting a concrete checker to explicit semantics, rather than only a collection of tests or a claim that its code looks small.
One interesting design choice is that the model does not require a conventional proof of every metatheoretic property before it can analyze the checker. It describes the checker’s actions through relations for reduction, definitional equality, and type inference, then proves that those actions preserve the semantic interpretation. The whitepaper goes through the proof and identifies features omitted from its simplified presentation. The repository contains the complete formal development.
This assurance is useful only if the running checker faithfully represents the proved algorithm. A Lean implementation still passes through Lean’s compiler, runtime, and numerical libraries. A bug in one of those layers could make the executable behave differently from the algorithm the proof describes. That is why con-ron is important. Its Rust implementation is linked to con-leche by an Aeneas refinement proof, while Rust’s compiler and runtime give it a different operational path. The combination narrows the chance that one language runtime bug will compromise both checkers in the same way.
Agreement is evidence, not a magic vote
Running five checkers is not a majority election on mathematical truth. They consume an export of the same development and depend on a shared understanding of Lean’s declaration format and axioms. A flaw in the export pipeline, a misunderstood axiom policy, or a shared semantic assumption can affect several paths. A checker may also reject valid material because it does not support a feature. That is a compatibility result, not automatically a discovery of unsoundness.
The strongest evidence comes from different failure modes. The hardened official kernel can expose memory corruption. A Rust checker can avoid Lean runtime bugs. A verified checker can rule out a class of algorithmic mistakes relative to its formal model. A separately verified Rust refinement can connect that reasoning to another executable. When the checkers disagree, maintainers have a concrete artifact to investigate; when they agree, confidence rises for reasons stronger than simply rerunning one binary.
There is also a practical scale problem. De Moura points to Mathlib at roughly 2.5 million lines, several newer Lean developments above 3 million lines, and one repository above 50 million lines. Re-exporting and rechecking everything as text does not scale indefinitely. Binary export and incremental external checking are on the roadmap, alongside a more flexible lake check interface and continued verification work on lean4lean and the compiler.
A concrete habit for Lean projects
For an ordinary project, lake build remains the way to produce artifacts and catch normal errors. lake check adds a second inspection of the resulting proof development. If the result matters enough to withstand an adversarial proof or a kernel regression, lake check --paranoid is the more meaningful check, ideally run with current checker versions in CI. A failed comparison should be investigated, not ignored or automatically described as a false proof.
The deeper shift is operational. Lean is turning external checking from a specialist exercise into a standard command, while formal work makes one of those independent checks explainable in mathematical terms. Trust in a theorem still has assumptions and software boundaries. They are now more visible, and a project can test more than one of them before it calls a proof settled.
Sources: Leonardo de Moura’s announcement, Lean 4.35 release, kernel soundness postmortem, con-leche proof explanation, con-leche, con-ron.