You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
unlike simp, dsimp traverses subexpressions that are proofs, and simplifies them. This is very bad for performance, particularly in Category Theory, where aesop_cat uses simp, which uses dsimp, and this is run on the result of other aesop_cat tactic calls.
I propose that when encountering a proof, dsimp does one of two things:
leave the proofs as-is, without simplification
simplify the type of the proof and wrap the proof in a cast so that it gets the new type.
Minimal working example
@[simp]
theorem foo (i : Nonempty α) : Nonempty.intro (Classical.choice i) = i := rfl
set_option pp.proofs true
example : Classical.choice (Nonempty.intro (Classical.choice instNonemptyFloat)) = 0 := by
dsimp
Expected behaviour: dsimp fails
Actual behaviour: dsimp applies the simp lemma
Oh, dsimp rewrites proofs? I didn't know that! In calcify, I wrote my own little simplifier engine because simp wouldn't rewrite proofs; I maybe could have used dsimp. Thanks for the hint, will try one day.
Proposal
unlike
simp
,dsimp
traverses subexpressions that are proofs, and simplifies them. This is very bad for performance, particularly in Category Theory, whereaesop_cat
usessimp
, which usesdsimp
, and this is run on the result of otheraesop_cat
tactic calls.I propose that when encountering a proof,
dsimp
does one of two things:cast
so that it gets the new type.Minimal working example
Expected behaviour:
dsimp
failsActual behaviour:
dsimp
applies the simp lemmaCommunity Feedback
I first suggested this on Zulip.
Impact
Add 👍 to issues you consider important. If others benefit from the changes in this proposal being added, please ask them to add 👍 to it.
The text was updated successfully, but these errors were encountered: