Skip to content

Naming of unfolding lemmas #1252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
gallais opened this issue Jul 6, 2020 · 1 comment
Open

Naming of unfolding lemmas #1252

gallais opened this issue Jul 6, 2020 · 1 comment

Comments

@gallais
Copy link
Member

gallais commented Jul 6, 2020

In Data.List.Properties we have:

unfold-reverse :  (x : A) xs  reverse (x ∷ xs) ≡ reverse xs ∷ʳ x

ʳ++-defn :  (xs : List A) {ys}  xs ʳ++ ys ≡ reverse xs ++ ys

Both lemmas are filling the same essential role: explain a complex
function (for efficiency reasons) in terms of more basic building
blocks. I think they should follow the same naming scheme & am in
favour of the unfold-X pattern.

@MatthewDaggitt
Copy link
Contributor

Okay so I agree unfold is nicer than defn 👍

But I think that definition of unfold-reverse shouldn't be called either variant, as it's not really unfolding reverse, it's instead talking about the interaction of reverse and and therefore should be called reverse-∷ according to our existing conventions.

In contrast ʳ++-defn really is just unfolding the definition of ʳ++ and so I'm happy with calling it unfold-ʳ++. Depending on how many existing lemmas there are, I might be tempted to argue for switching the order so calling those lemmas ʳ++-unfold instead to make it more searchable...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants