You know the theorem you need. You can describe it, and you suspect someone has already proved it in Lean. But what did they call it? Which library contains it? Before you can use the proof, you have to find it.

That's the problem behind LeanExplore, the open-source search engine Justin Asher built for Lean 4. Lean is a proof assistant: it lets you write mathematical statements and proofs that a computer can check. Its libraries contain results you can reuse, provided you can find the right ones.

I'll be working with Justin on LeanExplore at Project Numina. The project has received support from Renaissance Philanthropy, with funding from XTX Markets. Numina will host the grant.

From a question to a library result

LeanExplore lets you search for a result by name or describe the mathematics in plain English. It uses semantic search to look for related meaning in the indexed libraries. The results are existing Lean declarations, with their source code and library location, alongside documentation and informal explanations.

The query in the example above is deliberately broad: 'Does the order of addition matter?' One returned result is VAddCommClass, a class describing when two additive actions on the same space commute. Its name is hardly something you would guess from that question alone.

You still need to inspect the result. This particular declaration concerns additive actions, so whether it's useful depends on the objects in your proof. The source and documentation let you check that. A search result gives you a candidate to investigate; it doesn't establish that the candidate fits your goal.

That's what interests me about this work. Natural-language search gives you a way into a library before you know its naming conventions. Both a mathematician and an AI agent attempting a proof can use that help.

What the grant will support

Justin and I will expand LeanExplore's coverage across the Lean ecosystem and work on the infrastructure needed to serve a growing collection of formal mathematics. More coverage means more opportunities to find useful results, and more work to make those results searchable.

We also plan to expand the search to handle other types of queries, beyond the natural-language and name searches available today.

We'll also build benchmarks for formal-math search and fine-tune models for the kinds of queries the service receives. The benchmarks will give us a way to evaluate search quality. The example above shows why this needs care: a declaration can be related to the words in a query while addressing a more specific mathematical situation.

The code, models and benchmarks will be open source. Others will be able to inspect the work and use it in their own tools.

I'm grateful to Justin for bringing me onto the project, and to Renaissance Philanthropy, XTX Markets and Numina for supporting it. What I want to help build is straightforward to describe: a tool that gets you from the mathematics you have in mind to a result you can actually use.

You can already try LeanExplore with a question from your own work. Open a result and look at its assumptions and source. That is where you can judge whether the search helped.