Zulip Chat Archive

Stream: Is there code for X?

Topic: Exporting all the proof terms


Michal Buran (Nov 22 2022 at 13:35):

Is there a way to export/print all the proof terms in the current environment?

Floris van Doorn (Nov 22 2022 at 14:10):

Yes, using metaprogramming. Are you in Lean 3 or in Lean 4? With environment, do you mean the current file, or literally everything that is imported?

Jason Rute (Nov 22 2022 at 15:20):

I second Foris in asking for more details. But in general it is straightforward to loop through all the proof terms in the environment. See https://github.com/jesse-michael-han/lean-step-public as a repo which does exactly this.

Jason Rute (Nov 22 2022 at 15:25):

Also see the advice in #metaprogramming / tactics > automatic lemmas retrieval which is a different but similar question.


Last updated: Dec 20 2023 at 11:08 UTC