← All papers
First page of LeanDojo-v2: A Comprehensive Library for AI-Assisted Theorem Proving in Lean

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

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

cs.LG Nov 6, 2026 · v1
Provides a Lean 4 library unifying repository data extraction, LLM fine-tuning, proof search, and tactic suggestion, plus a Lean-native VSCodium-based IDE.
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.

Existing tools that combine machine learning with Lean (LeanDojo, ReProver, LeanCopilot, LeanAgent, REPLs) are separate research projects. They can be outdated and hard to maintain, and they require nontrivial setup, which makes AI-assisted theorem proving hard for mathematicians to adopt.

LeanDojo-v2 is an end-to-end library with a three-stage pipeline: data collection, training, and proving. Data collection traces user-specified Lean repositories to extract ASTs, dependencies, theorems, proofs, and premises. Training uses either LeanAgent-style progressive (curriculum) training of ReProver's retriever, ordered by proof-length difficulty, or HuggingFace fine-tuning on state-tactic pairs, with supervised, parameter-efficient, and reinforcement-learning options. Lean4Code is a VSCodium-based editor that bundles the Lean4 extension with LeanDojo tracing, LeanCopilot tactic suggestions, and Agent-TARS assistance.

Figure 1: Overview of the LeanDojo-v2 architecture
Figure 3: Overview of using LeanDojo in Lean4Code

The framework lets users fine-tune models on domain-specific Lean codebases and run LLM-assisted proving with a few lines of code or through a GUI. No quantitative proving benchmarks are reported in the provided text.

Figure 6: Prompting LeanCopilot for tactic suggestions
ExtensionPurpose
Lean4 (modified)Downloads and configures Lean4/LeanDojo-v2
LeanDojoSupports one-click LeanDojo tracing
LeanCopilotCalls models to complete theorems
Agent-TARSGeneral agentic AI assistance
Lean4Code extensions