LeanAide: AI for Lean & Mathematics

LeanAide or LeanAIde (accidental pun) is work (in progress) to build AI based tools to work with the Lean Theorem Prover. Our goal is to build tools for:

The core technique we use is Autoformalization which is translating informal mathematical statements to formal statements in a proof assistant (Lean Prover in our case). This is used both directly to provide tools and indirectly to generate proofs by translation from natural language proofs generated by Large Language models.

I spoke about LeanAide in a Lecture at Lean Together 2025:

In the 3-4 weeks after the lecture, we have managed to finish two significant steps:

The rest of this blog is an introduction to LeanAide. It was drafted (almost single-shot) from my lecture linked above by Gemini Flash 2.0-experimental-thinking with apps. I had to fix some errors, but most of the writing was done for me.

LeanAide: Bridging the Gap Between Natural Language and Formal Mathematics with AI

LeanAide is a system I’ve developed (with collaborators) to explore how AI can make formalizing mathematics in Lean more accessible and efficient. My goal isn’t just full automation of formalization, but to create a practical and interactive environment where AI can assist mathematicians at every stage. This assistance ranges from helping beginners learn Lean syntax to supporting experts in tackling complex mathematical formalization.

What is LeanAide?

LeanAide is an AI-powered system that aims to make formalizing mathematics in Lean more approachable and more productive. It’s built around the idea of pragmatic autoformalization. This means we focus on the practical usefulness of AI in translating natural language mathematics into Lean code. Rather than solely aiming for perfect automated translation accuracy, we prioritize creating tools that are genuinely helpful and interactive for users throughout the formalization process.

How Does LeanAide Work?

LeanAide uses AI, specifically GPT 4o, to connect the way mathematicians naturally express themselves with the rigorous formal language of Lean. The user can use a different model in place of GPT-4o. Here are the core functionalities of our system:

How LeanAide Helps with Lean and Mathematics:

LeanAide offers several advantages for Lean users and the broader field of mathematics:

Future Directions:

The development of LeanAide is ongoing. Our future work will focus on:

As mentioned at the beginning of this post, the second of this is I believe done and there has been some progress on the third, including a key step.

LeanAide is a step towards integrating AI more deeply into mathematical workflows. By concentrating on practical tools and interactive assistance, we hope to make Lean more accessible and efficient, and ultimately, a more powerful tool for mathematical work. As both Lean and AI continue to evolve, systems like LeanAide may help to create a future where mathematicians can more easily combine informal and formal methods to advance mathematical understanding.