News › ai-infrastructure

Lean Kernel Soundness Bug #14576 Fixed with New Patch Releases

By Zayden R., August 2, 2026

A critical soundness bug in the Lean kernel, #14576, has been identified and fixed. This bug, affecting nested inductive types, was patched swiftly, with new releases now available for users.

A significant soundness bug in the Lean kernel, identified as #14576, was promptly addressed and fixed during the last week of July. The issue came to light when Ramana Kumar published a repository on July 25, containing a 'disproof' of the Collatz conjecture. This disproof was generated with AI assistance and was invalid, as it exploited a flaw in the kernel's handling of nested inductive types.

On July 28, Kiran Gopinathan distilled the problem further into a smaller proof of False and formally opened issue #14576. The Lean team responded quickly; a fix was pushed within an hour, marked as #14577. Joachim Breitner reviewed the fix, proposed improvements, and the patch was merged. New patch releases are now available, addressing the bug that allowed ill-typed arguments to bypass type checking, which could lead to the acceptance of false proofs.

The bug was particularly elusive as it only manifested through metaprogramming by directly interacting with the kernel's inductive declarations. The frontend, fortunately, checks arguments and would catch any ill-typed terms. Thus, the bug is an implementation oversight rather than a fundamental flaw in Lean's meta-theory.

Interestingly, the bug evaded detection by nanoda, an external checker implemented in Rust by Chris Bailey. While nanoda did check the problematic area, it failed to verify the type name in a projection node, a separate bug fixed a week prior. The confluence of these two unrelated bugs allowed the invalid proof to pass undetected in the older nanoda version. This emphasizes the importance of using updated versions of both the official kernel and independent checkers.

For engineers and developers relying on Lean, this incident underscores the necessity of maintaining current versions of all tools and libraries. The lean4lean project, led by Mario Carneiro, aims to formalize Lean's type theory and verify kernel implementations, which remains a critical ongoing effort.

Sources

Practice this on a real machine

The Linux Camp teaches these topics as hands-on labs on real virtual machines, verified as you type.