All products

Find a Mathlib lemma with AI

Search Lean declarations by mathematical shape, inspect close matches and get the import and name needed to try the result in your project.

Find a Mathlib lemma with AI when the obvious search term comes back empty. An ordering fact you learnt for real numbers might live under a more general type. Start with what has to follow from which hypotheses. The lean-search skill follows those clues through declarations, module names and the code around promising hits.

A useful answer gives you something you can try. Ask for the full declaration name, its import and the assumptions under which it holds. If a close match needs an extra premise, you can decide whether you have that premise before building a proof around it.

What it does

  • Search by the shape of a statement as well as by its name.
  • Read the source around a likely result for related declarations.
  • Locate the module used by a working example.
  • Identify the precise change that would make a near match usable.
  • Record the search paths when the library appears to lack a result.

Install and use

  1. Give the agent access to the permitted Lean 4 project and the Mathlib version selected by that project.
  2. Ask, “Does the library already prove this implication? Compare the assumptions of the two nearest results and include their imports.”
  3. Try the suggested declaration in context. If nothing matches, retain the closest result and the proposed general statement for a follow-up search.

FAQ

Source

Made by Texra (texra-ai). Original skill: lean-search, published on GitHub under the MIT licence.

View on GitHub