Zulip Chat Archive

Stream: lean4

Topic: Syntax to define mut rec functions with termination proof


Son Ho (May 25 2023 at 15:36):

I would like to define mutually recursive functions which use termination_by and decreasing_by but I don't manage to get the syntax right. Is there an example somewhere that I can use as a reference?
(tagging @Jonathan Protzenko to keep him in the loop)

Chris Bailey (May 25 2023 at 18:07):

There are some examples in Lean's test suite, specifically this directory; check the files that start with mutwf.

Chris Bailey (May 25 2023 at 18:08):

There's also ack.lean for a classic example, but the ackermann function one is pretty simple so it might not address your use case.

Jonathan Protzenko (May 25 2023 at 20:46):

thanks Chris!

Son Ho (May 26 2023 at 07:26):

Thanks!


Last updated: Dec 20 2023 at 11:08 UTC