Lean Copilot: An AI Tool that Allows Large Language Models (LLMs) to be used in Lean for Proof Automation


Theorem proving is a crucial aspect of formal mathematics and computer science. However, it is often a challenging and time-consuming process. Mathematicians and researchers spend significant time and effort constructing proofs, which can be tedious and error-prone. The complexity of proof construction necessitates the development of tools that can aid in automating parts of this process to save time and reduce errors.

Currently, there are some tools available that assist with theorem proving. Traditional proof assistants provide environments where users can write and check proofs. These tools typically require users to manually outline the steps and tactics required for constructing proof. While helpful, they rely heavily on user input and do not fully automate the proof construction process. This means that users still need to have a deep understanding of the tactics and steps involved.

Introducing Lean Copilot: a new AI tool designed to address these limitations by integrating large language models (LLMs) with Lean. It aims to automate parts of the proof construction process by suggesting tactics, searching for proofs, and selecting relevant premises. Users can use built-in models or bring their own models to run either locally or on the cloud. Lean Copilot can generate tactic suggestions, combine tactics to find proofs and select premises from a fixed database. This makes the proof construction process more efficient and less reliant on manual input.

Lean Copilot’s capabilities are demonstrated through its various features. The `suggest_tactics` function generates tactic suggestions that users can click on to use in their proofs. The `search_proof` function combines LLM-generated tactics with the aesop framework to find multi-tactic proofs, which can then be inserted into the editor. The `select_premises` function retrieves potentially useful premises from a database. These features help automate the proof construction process, making it faster and more efficient. Additionally, users can run inference on any LLMs in Lean to build customized proof automation or other applications.

Despite its powerful features, Lean Copilot has some caveats. Lean may occasionally crash when restarting or editing a file, requiring a simple restart to resolve. The `select_premises` function retrieves the original form of a premise, which might not always align with the user’s expectations. Temporary workarounds, such as renaming theorems, can help mitigate some of these challenges.

In conclusion, Lean Copilot offers a promising solution to the challenges of theorem proving by integrating large language models with Lean. Its features automate parts of the proof construction process, making it more efficient and less reliant on manual input. While there are some caveats, Lean Copilot’s capabilities demonstrate its potential to significantly enhance the workflow of mathematicians and researchers in formal mathematics and computer science.


Niharika is a Technical consulting intern at Marktechpost. She is a third year undergraduate, currently pursuing her B.Tech from Indian Institute of Technology(IIT), Kharagpur. She is a highly enthusiastic individual with a keen interest in Machine learning, Data science and AI and an avid reader of the latest developments in these fields.

🐝 Join the Fastest Growing AI Research Newsletter Read by Researchers from Google + NVIDIA + Meta + Stanford + MIT + Microsoft and many others…

Recent Articles

Related Stories

Leave A Reply

Please enter your comment!
Please enter your name here