NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Lean-Auto: An Interface Between Lean 4 and Automated Theorem Provers

Yicheng Qian, Joshua Clune, Clark W. Barrett, Jeremy Avigad

Introduction

Interactive Theorem Provers (ITPs) like Lean 4 have become essential tools for mathematicians and computer scientists to create machine-verified proofs. However, the high level of rigor required often makes the proving process tedious, as users must manually handle many "obvious" logical steps. To alleviate this, researchers develop "hammers"—tools that automatically export proof goals to Automated Theorem Provers (ATPs) like Z3, Vampire, or Duper.

The primary obstacle in building a hammer for Lean 4 is the "logic gap." Lean 4 is based on Dependent Type Theory ($\lambda C$), a highly expressive system where types can depend on values. In contrast, most ATPs operate on simpler First-Order Logic (FOL) or Higher-Order Logic (HOL). Previous bridging attempts relied on complex "encoding" strategies that translated types into extra predicates, often resulting in bloated formulas that overwhelmed the solvers.

Methodology: The Lean-Auto Pipeline

Lean-Auto introduces a novel translation strategy centered on monomorphization rather than traditional encoding. Instead of attempting to represent the full complexity of polymorphism within the ATP, monomorphization identifies the specific "shapes" of functions used in a given proof and generates specialized, non-polymorphic versions of them.

The Lean-Auto Translation Pipeline

The four-stage translation process from Lean 4's dependent type theory to Higher-Order Logic (HOL). Lean-Auto: An Interface Between Lean 4 and Automated Theorem Provers, page 3

The four-stage translation process from Lean 4's dependent type theory to Higher-Order Logic (HOL).

The translation process consists of four distinct stages as illustrated above:

  1. Preprocessing: This stage handles Lean-specific features such as inductive types and "definitional equality"—the principle that terms like $2+2$ and $4$ are logically identical.
  2. Quantifier Instantiation: A saturation loop matches polymorphic functions in the goal with those in the premises to determine the correct types for instantiation.
  3. $\lambda^*_\to$ Abstraction: This step translates the remaining dependent type structures into a format compatible with Higher-Order Logic.
  4. Universe Lifting: Finally, complex "universe level" information is erased to produce a clean output that the ATP can process.

For the "Duper" backend, Lean-Auto supports proof reconstruction. This ensures that the tool does not merely provide a "True/False" result but generates a native Lean proof term that can be independently verified by the Lean kernel.

Experimental Evaluation

The researchers evaluated Lean-Auto using Mathlib4, the extensive mathematical library for Lean 4, comprising 149,142 user-declared theorems. To isolate the effectiveness of the translation algorithm, the evaluation used "ideal" premise selection, providing the tool with the exact theorems used in the original human-written proofs.

Key Results

  • State-of-the-Art Performance: The combination of Lean-Auto and the Duper solver successfully automated 36.6% of the benchmark (54,570 problems). This represents a 5.0% improvement over Aesop, the previous leading automation tool for Lean 4.
  • Complementary Strength: Lean-Auto solved 22,020 problems that were failed by all other existing Lean tactics, including rfl, simp, and Aesop.
  • Virtual Best Solver (VBS): When integrated with existing tools, the collective "Virtual Best Solver" was able to solve 53.2% of Mathlib4 automatically.

Discussion and Future Work

A critical insight from this work is that monomorphization is significantly more efficient than encoding for Lean-based problems, as it produces smaller and more structured outputs. Furthermore, the handling of definitional equality is vital; Lean-Auto utilizes "fingerprinting" to efficiently check for equality without the overhead of expensive internal Lean functions.

Despite its success, Lean-Auto faces several challenges. It is currently slower than simpler tactics on easy problems due to translation overhead. Future work will focus on integrating automated premise selection tools (such as machine-learning-based selectors) to handle the vast library of Mathlib theorems. Additionally, while Lean-Auto can utilize SMT solvers like Z3 to find answers, full proof reconstruction for SMT results remains an ongoing goal for the project.

Summary updated

BibTeX
@inproceedings{qian2025lean,
  author = {Yicheng Qian and Joshua Clune and Clark W. Barrett and Jeremy Avigad},
  title = {{Lean-Auto: An Interface Between Lean 4 and Automated Theorem Provers}},
  booktitle = {CAV},
  year = {2025},
  doi = {10.1007/978-3-031-98682-6\_10},
}
Figure