Zulip Chat Archive
Stream: new members
Topic: dsimp
Auguste Poiroux (Aug 18 2020 at 13:46):
Hello!
I took a lemma in mathlib with the attribute simp and the proof rfl. I modified the proof to begin exact(rfl), end and it "broke" the proof of a following theorem which uses dsimp. I've observed this on several files.
For example in this modified file linear_pmap.lean, if you change the proof of mk_apply to rfl, the proof of mk_span_singleton_apply works again.
Why does changing the proof of mk_apply change the way dsimp works?
Why begin exact(rfl), end is not equivalent to rfl?
Thanks in advance!
Reid Barton (Aug 18 2020 at 13:52):
You have just described exactly how it works. Lemmas whose proofs are exactly rfl get a special "refl lemma" attribute, and dsimp will only apply such lemmas.
Reid Barton (Aug 18 2020 at 13:52):
dsimp only wants to apply definitional equalities, and this is how that is ensured.
Auguste Poiroux (Aug 18 2020 at 13:54):
Ok, thanks!
Reid Barton (Aug 18 2020 at 13:54):
My guess as for the reason that the check is so specific:
Lemmas are checked in parallel and a later lemma might want to use this one as a dsimp lemma.
So the test for "is this a refl lemma" needs to be something cheap that can be done in serial and not, say, running a tactic block and seeing what happens.
Last updated: May 02 2025 at 03:31 UTC