Scaling Lean Theorem Proving for Real-World Code Verification

Debargha Ganguly, Divya Raghunathan, Dejan Jovanović, Vikash Singh, Soonho Kong, Aaron Tomb, Aman Goel, Ferhat Erata, Sam BaylessarXiv 2026

While large language models (LLMs) have become surprisingly adept at solving competition-level math problems, real-world software verification remains a daunting frontier. Proving that a piece of code is "correct" requires reasoning about messy implementation details like fixed-width integers, memory mutation, and complex loops—details that clean mathematical theorems often ignore.

A new paper from researchers at Amazon Web Services and Case Western Reserve University introduces EasyProver, a system that nearly saturates existing benchmarks, and Aegis, a pipeline that generates a massive new dataset of verification tasks to keep the next generation of AI provers challenged.

TL;DR

The researchers developed EasyProver, an agentic system that uses off-the-shelf LLMs to achieve state-of-the-art results in Lean theorem proving. To address the fact that current benchmarks are becoming too easy, they also created Aegis, a pipeline that automatically turns competitive programming problems into thousands of "hard-mode" code verification tasks.

What Problem Does This Paper Address?

The field of neural theorem proving is hitting a "saturation" problem. Existing benchmarks like PutnamBench (college-level math) and miniF2F are seeing solve rates near 100%. Furthermore, these benchmarks are static, meaning models might inadvertently memorize them during training (data contamination).

More importantly, there is a gap between "math proving" and "code verification." Proving a math theorem is about abstract logic; verifying code is about proving that a specific implementation—with all its bit-level casts and recursive structures—actually does what it's supposed to do. The authors argue we need benchmarks that reflect this "real-world" complexity.

Methods

The authors' contribution is two-fold: a new prover and a new way to generate data.

EasyProver: The Proving System

EasyProver doesn't require any special training or fine-tuning. Instead, it wraps an off-the-shelf frontier model (like Anthropic’s Claude 3.5 Sonnet) in a sophisticated agentic harness. Key features include:

  • Recursive Agents: A "Parent Agent" can spawn "Child Agents" to tackle specific sub-lemmas.
  • Context Isolation: Children work in their own isolated "worktrees." This prevents the parent's context window from being cluttered with the "noise" of failed attempts and error messages.
  • Parallel Tactic Probing: The system tries multiple Lean tactics simultaneously to find a "winner" that advances the proof.
  • InfiniLean: To handle the massive computational load of checking thousands of proof steps, they built a stateless, elastic service on Kubernetes that can scale Lean elaboration across a cloud cluster.
Figure 1: EASYPROVER architecture. Left: An asynchronous agent loop alternates model responses with coding and Lean tool calls. Right: Agents recursively delegate work to children with separate contexts and workspaces. Completed results return to the parent without waiting for unfinished siblings, which keep running; the search ends when the first candidate proof is accepted.

Aegis: The Benchmark Generator

To create harder tasks, the Aegis pipeline takes LeetCode-style problems and:

  1. Synthesizes a solution in safe Rust.
  2. Translates that Rust code into Lean using a tool called Aeneas.
  3. Automatically generates formal specifications (properties the code should have).
  4. Uses "differential validation" to ensure the translated Lean code behaves exactly like the original Rust source.

Datasets

The study evaluates EasyProver on several established benchmarks:

  • Math: PutnamBench and the International Mathematical Olympiad (IMO) 2026.
  • Code: NTP4VC (industrial verification) and VERINA.

The researchers then introduce the Aegis dataset, which contains 2,045 validated Rust–Lean program pairs and 11,533 candidate specifications. This is significantly larger and more complex than previous code verification sets.

Key Insights and Ideas

  • Isolation Beats Brute Force: By isolating child agents, EasyProver can explore hundreds of potential proof paths without hitting the LLM's context limit. This mimics how human mathematicians might delegate a sub-problem without needing to see every scratchpad note from their assistant.
  • The "Implementation Gap": The paper highlights that code verification is inherently harder than math because of "implementation-level obligations." For example, a math proof might assume numbers are infinite, but a code proof must account for the possibility of a 32-bit integer overflowing.
  • Verifiable Rewards (RLVR): Because every result in Aegis is "kernel-checked" by Lean, these tasks can serve as perfect training data for Reinforcement Learning. You don't need a human to grade the model; the Lean compiler provides an objective, un-hackable "ground truth."
Figure 2: Parallel tactic probing. Candidate tactics are evaluated concurrently, and a successful tactic is returned to the agent. In this example, the returned tactic is about 30 tokens, while the probe traces total about 30,000 to- kens.

Key Results

EasyProver demonstrated remarkable efficiency across the board:

  • PutnamBench: Solved 669/672 problems (99.6%), a significant jump over previous bests.
  • IMO 2026: Solved all six formalizations.
  • NTP4VC: Resolved 597/600 verification conditions.

However, the Aegis benchmark proved much tougher. On a sample of 2,000 statements, EasyProver only solved 52.7%. This confirms that while we are "solving" competition math, real-world code verification remains a wide-open challenge for AI.

Limitations and Future Work

The authors note that they did not perform "ablation studies" (turning off parts of the system to see what matters most) because running the full benchmark suite is extremely expensive. They also didn't compare EasyProver directly against a "vanilla" LLM using Lean as a simple tool.

Future work involves using the Aegis dataset to train new models via Reinforcement Learning from Verifiable Rewards (RLVR), potentially creating a "self-improving" loop where the model generates its own hard problems and learns from the proofs it manages to find.

Summary updated

Abstract

We present EasyProver, a Lean proving system built from recursive agents with isolated contexts, asynchronous search, parallel tactic probing, and an elastic elaboration service. Using an off-the-shelf frontier model with no additional training, it proves 669/672 PutnamBench problems and all six IMO 2026 formalizations and resolves 597/600 NTP4VC verification conditions and all 189 VERINA tasks by proof or refutation. Because these benchmarks are close to saturation, we also introduce Aegis, which converts competitive programming problems into much harder verification tasks over real implementations. The pipeline writes safe Rust solutions, translates them into Lean with Aeneas, generates specifications, and labels each frozen statement with a kernel-checked proof or refutation. It produces 2,045 differentially validated Rust-Lean program pairs and 11,533 candidate specifications. Unlike hand-written benchmarks, these tasks carry implementation-level obligations from fixed-width arithmetic, explicit failure, generated loops, casts, and functionalized mutation. On a stratified sample of 2,000 statements, EasyProver proves 1,054 (52.7%) within a 30-minute budget per statement. The same tasks can also be used to benchmark other provers and as rewards for reinforcement learning.
BibTeX
@misc{ganguly2026scaling,
  author = {Debargha Ganguly and Divya Raghunathan and Dejan Jovanović and Vikash Singh and Soonho Kong and Aaron Tomb and Aman Goel and Ferhat Erata and Sam Bayless},
  title = {{Scaling Lean Theorem Proving for Real-World Code Verification}},
  year = {2026},
  eprint = {2610.38174},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2610.38174},
}
Figure