NTH

LeanDojo-v2: A Comprehensive Library for AI-Assisted Theorem Proving in Lean

AuthorsRyan Hsiang, William Adkisson, Robert Joseph George, Anima Anandkumar

AffiliationsNational Taiwan University · Washington University in St. Louis · California Institute of Technology

November 22, 2026 2 min read
Watch on YouTube
The one-line take

LeanDojo-v2 brings Lean-based AI theorem proving into one toolkit, making it easier to train models and explore proofs.

Key results

7B
DeepSeek-Prover-V2 fine-tuning model size

Example model used for supervised fine-tuning.

671B
DeepSeek-Prover-V2 hosted model size

Model offered through Hugging Face API inference.

10
Previous local build time

Build time was over 10 minutes before the API-based approach reduced it to a few seconds.

What the paper found

LeanDojo-v2 brings Lean theorem-proving tools into one extensible pipeline: it extracts theorems, proofs, premises, and proof states from Lean repositories, then supports supervised fine-tuning, LoRA, and reinforcement learning with GRPO or PPO. For proving, it combines step-by-step tactic generation with Pantograph’s depth-first or Monte Carlo tree search, and also supports whole-proof generation. Users can train models such as DeepSeek-Prover-V2-7B or call hosted models such as DeepSeek-Prover-V2-671B through the Hugging Face API; the API-based autocomplete avoids local inference setup and cuts build time from over 10 minutes to a few seconds. The companion Lean4Code editor packages these tools in a VSCodium-based interface, alongside extensions for LeanDojo, LeanCopilot, and ByteDance’s Agent TARS; its Agent TARS integration uses an OpenAI access token. Rather than reporting new theorem-proving benchmark scores, the work’s central contribution is a unified, modular workflow that makes data extraction, model training, proof search, and AI-assisted editing easier to run and extend.

Original abstract

Building on recent progress in machine learning for formal theorem proving in Lean, we introduce LeanDojo-v2: an end-to-end framework that unifies repository data extraction, LLM fine-tuning, proof search, AI autocompletion, and LLM-assisted theorem proving in a single software library. In addition, we provide Lean4Code, a lightweight IDE that integrates the various features of LeanDojo-v2 through a simple, mathematician-friendly UI. These tools will enable mathematicians and researchers to easily fine-tune language models on domain-specific Lean codebases and experiment with LLM-assisted theorem proving without a complex setup.

Read the original paper

More in AI Reasoning

Browse all 54 papers →
03Reasoning

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 Bayless

EasyProver tackles Lean proofs at scale and introduces harder verification challenges grounded in real Rust code.

Read analysis