Zulip Chat Archive

Stream: lean4

Topic: generate defining equations of recursors


Alexander Bentkamp (Feb 10 2023 at 15:47):

Is there any (meta)code to generate the defining equations of recursors? So for example, for the Nat type, I'd like to generate the equations

Nat.rec a b Nat.zero = a
Nat.rec a b (Nat.succ c) = b c (Nat.rec a b c)

Of course, all of these are provable by rfl, but the tactic I am working on cannot deal with definitional equality.

Jannis Limperg (Feb 10 2023 at 16:02):

Not that I know of. Should be fairly easy to write though. (There may be problems with nested and mutual types; I don't even know whether we generate proper recursors for these.) I can give it a shot if you want.

Alexander Bentkamp (Feb 10 2023 at 16:38):

Ok, thanks, I'll try to implement it myself.

Marcus Rossel (Jan 08 2024 at 09:36):

(deleted)

Mario Carneiro (Jan 09 2024 at 05:45):

@Alexander Bentkamp The defining equations of recursors are actually stored in the RecursorVal for consumption by the kernel, see src#Lean.RecursorRule


Last updated: May 02 2025 at 03:31 UTC