Zulip Chat Archive
Stream: general
Topic: refl
Andrew Ashworth (Feb 28 2018 at 00:49):
why does lean automatically tag certain theorems with @[_refl_lemma]
?
Simon Hudon (Feb 28 2018 at 00:50):
I want to know too!
Mario Carneiro (Feb 28 2018 at 01:03):
That attribute means that it's a refl lemma (it was proven by rfl
), and it is basically "@[simp]
for dsimp
"
Andrew Ashworth (Feb 28 2018 at 01:44):
someday i'd like to write a boilerplate macro that goes into definitions and creates lemmas for each branch
Andrew Ashworth (Feb 28 2018 at 01:45):
although even better is if we could suggest names while constructing a def
using the equation compiler
Simon Hudon (Feb 28 2018 at 01:48):
That attribute means that it's a refl lemma (it was proven by
rfl
), and it is basically "@[simp]
fordsimp
"
Is this necessary because definitional equality is not transitive?
Mario Carneiro (Feb 28 2018 at 01:52):
No, it's just a way to guide the operation of dsimp
. There are loads of things that are defeq, so how should it know you want a + succ b
to "unfold" to succ (a + b)
and not something else? Equation lemmas are used for this purpose, and the ones that are known to be definitional are legal for use by dsimp
Simon Hudon (Feb 28 2018 at 01:56):
Does dsimp
use anything else?
Mario Carneiro (Feb 28 2018 at 01:59):
It uses the bracket list of course, but most of its stuff comes from equation lemmas
Mario Carneiro (Feb 28 2018 at 02:00):
someday i'd like to write a boilerplate macro that goes into definitions and creates lemmas for each branch
def
does this currently...
Last updated: Dec 20 2023 at 11:08 UTC