This PR ensures `dsimp` does not "simplify" instances by default. The old behavior can be retrieved by using ``` set_option backward.dsimp.instances true ``` Applying `dsimp` to instances creates non-standard instances, and this creates all sorts of problems in Mathlib. This modification is similar to ``` set_option backward.dsimp.proofs true ``` --------- Co-authored-by: Kim Morrison <kim@tqft.net> Co-authored-by: Claude <noreply@anthropic.com>
33 lines
672 B
Text
33 lines
672 B
Text
set_option warn.sorry false
|
||
|
||
def f [Add α] (a : α) := a + a
|
||
abbrev id' (a : α) := a
|
||
abbrev addNat : Add Nat := ⟨Nat.add⟩
|
||
|
||
set_option pp.explicit true
|
||
|
||
/--
|
||
trace: a b : Nat
|
||
⊢ @Eq Nat (@f Nat (@id' (Add Nat) addNat) a) b
|
||
---
|
||
trace: a b : Nat
|
||
⊢ @Eq Nat (@f Nat addNat a) b
|
||
-/
|
||
#guard_msgs in
|
||
example : @f _ (id' addNat) a = id b := by
|
||
dsimp [id']
|
||
trace_state -- `id'` was not unfolded because it is part of an instance
|
||
dsimp +instances [id']
|
||
trace_state
|
||
sorry
|
||
|
||
/--
|
||
trace: a b : Nat
|
||
⊢ @Eq Nat (@f Nat addNat a) b
|
||
-/
|
||
#guard_msgs in
|
||
set_option backward.dsimp.instances true in
|
||
example : @f _ (id' addNat) a = id b := by
|
||
dsimp [id']
|
||
trace_state
|
||
sorry
|