Toggle light / dark theme

Why mathematicians must rely on machines to check new results

This article from The Economist highlights a profound shift in modern mathematics: while large language models are brilliant at generating creative ideas and proposing complex proofs, they are inherently “fuzzy and statistical”—prone to occasional hallucinations or subtle leaps in logic.

To bridge this gap, mathematicians are increasingly pairing AI with Lean, an interactive theorem prover and programming language designed around formal logic. Why Lean and Formal Verification Matter.

* The Remorseless Kernel: At the heart of Lean is a tiny, rigorously audited program called the *kernel*. It accepts a mathematical proof only if every single step follows faultlessly from established axioms and rules of logic.

* The AI-Human-Machine Partnership: Modern AI systems can propose thousands of candidate proofs and synthesize ideas across massive libraries (like Lean’s ‘Mathlib‘, containing hundreds of thousands of pre-checked theorems). The AI generates, Lean judges with absolute literalness, and human mathematicians provide the taste, direction, and evaluation of what theorems actually matter.

* The Catch: While Lean can verify that a proof is logically airtight, verification is not the same as understanding. Mathematicians are increasingly facing a surreal new reality: having a machine-checked proof for monumental problems (such as recent strides on the Riemann Hypothesis or Navier-Stokes equations) that is undeniably correct, yet so complex that humans are still racing to decode what it actually teaches them.

Lean’s kernel verifies proofs by treating mathematical truth as a compiler type-checking problem. There is no probability, guessing, or neural network inside the kernel—only deterministic, mechanical rules.

This architecture rests on the Curry-Howard correspondence, which establishes an exact equivalence between logic and programming:

* A mathematical proposition is represented as a type (like ‘Integer‘ or ‘String‘ in standard programming).

* A mathematical proof is represented as a program (or term) that evaluates to that type.

When an AI—or a human—writes a proof in Lean, it is writing a program. The kernel’s sole job is to check whether that program compiles to the claimed type.

How the kernel checks a proof.

1. Stripping Away the “Syntactic Sugar”

Users and AI models rarely write raw, low-level logical terms directly. Instead, they use high-level automation, tactics (like ‘simp‘, ‘ring‘, or ‘linarith‘), and AI search agents to generate the proof. Before the kernel ever sees the proof, Lean’s elaborator translates all of those high-level shortcuts into a single, explicit, low-level proof term.

2. Isolated Inspection.

The elaborated proof term is handed over to the kernel—a small, standalone codebase (roughly 10,000 lines of C++) completely isolated from the AI, the tactics, and the user interface. Because the kernel is tiny and self-contained, computer scientists can audit every line of it by hand to ensure it has no bugs.

3. Axiom & Definition Verification.

The kernel checks the foundational building blocks referenced in the proof term. It verifies that every starting assumption is either a valid definition or one of Lean’s tiny set of foundational axioms (such as dependent type theory and the axiom of choice).

4. Bottom-Up Type Inference.

The kernel traverses the proof term tree from the innermost expressions outward, applying strict, deterministic inference rules: * If a step applies a function f of type A to B (meaning “if A is true, then B is true”) to an argument x of type A (a valid proof of A), the kernel mechanically deduces that the resulting expression f(x) has type B.

* If a single variable, boundary condition, or algebraic substitution does not match the exact expected type down to the bit, the kernel immediately rejects the entire proof with a type mismatch error.

5. Definitional Equality & Reduction.

When two expressions look superficially different (for example, 2 + 2 versus 4), the kernel applies deterministic computation rules—such as beta-reduction (plugging an argument into a function)—to simplify both sides down to their canonical normal forms. If the simplified forms are structurally identical, they pass; if not, they fail.

Why this solves the AI hallucination problem.

Because of this strict separation between proof search (the elaborator/AI) and proof checking (the kernel), an AI can hallucinate wildly during its search process without ever corrupting the final result.

Even if an AI uses a buggy tactic or invents a nonsensical shortcut, the elaborator must still produce a valid low-level proof term. If the logic is flawed, the kernel refuses to compile it—making it mathematically impossible for a false theorem to slip through unless there is a bug in the kernel itself or a flaw in how the human formalized the problem statement.

#leanprover #FormalVerification #ArtificialIntelligence #mathematics


Many AI-powered proofs are too big for humans to digest.

Leave a Comment

Lifeboat Foundation respects your privacy! Your email address will not be published.