Zulip Chat Archive

Stream: lean4

Topic: List all definitions/theorems/etc. of a library


Rick de Wolf (Jan 22 2024 at 13:20):

Hi folks, I'm trying to build a tool that reads out the definitions, theorems, and other objects defined in a Lean library. I'm not sure how to list those from Lean, so I could use some pointers. Thanks!

(If someone knows how to do this using the reverse foreign function interface that'd be great to hear about too. I'm planning on using this functionality in a Julia package.)

Kim Morrison (Jan 23 2024 at 03:55):

Don't have time for a detailed answer, but try the Lean Metaprogramming book, and many examples of variations of this in the repos. e.g. lean-training-data has several extraction tools.

Damiano Testa (Jan 23 2024 at 08:11):

I could only find this link, but it has been asked other times as well.

Rick de Wolf (Jan 23 2024 at 15:09):

Thanks for your answers, that looks like it'll be enough for me to find my way :)

I'm honestly surprised there's already a library written for this. It would be nice to have a kind of list for Lean and Mathlib related projects to make it easier for people to find, or does this exist somewhere already?

Jannis Limperg (Jan 23 2024 at 15:32):

Reservoir aims to track all(?) Lean 4 projects.

Henrik Böving (Jan 23 2024 at 15:41):

All Lean projects that it can find and do not explicitly opt out yes.

Damiano Testa (Jan 23 2024 at 16:04):

This is another thread with a related function.


Last updated: May 02 2025 at 03:31 UTC