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.


Last updated: Dec 20 2023 at 11:08 UTC