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
Reduced the issue to a self-contained, reproducible test case.
Description
When working with equation lemmas, simp only [←my_add] behaves as if it were simp only [my_add]: the ← is ignored.
Steps to Reproduce
defmy_add (a b : nat) := a + b
example (a b : nat) : my_add a b - (a + b) = 0 :=
begin
success_if_fail { simp only }, -- ok, nothing to simplify
exact nat.sub_self _,
endexample (a b : nat) : my_add a b - (a + b) = 0 :=
begin
simp only [my_add],
guard_target a + b - (a + b) = 0, -- ok
exact nat.sub_self _,
endexample (a b : nat) : my_add a b - (a + b) = 0 :=
begin
simp only [←my_add],
guard_target my_add a b - my_add a b, -- fail, goal is as if the `←` isn't there
exac nat.sub_self _,
end
Expected behavior: [What you expect to happen]
The above code should produce no diagostics
Actual behavior: [What actually happens]
The final guard_target fails, as the goal is a + b - (a + b) = 0. Despite being told not to, simp unfolded my_add.
The text was updated successfully, but these errors were encountered:
eric-wieser
changed the title
simp ignores directly of equation lemmas
simp ignores direction of equation lemmas
Sep 21, 2021
Prerequisites
or feature requests.
Description
When working with equation lemmas,
simp only [←my_add]
behaves as if it weresimp only [my_add]
: the←
is ignored.Steps to Reproduce
Expected behavior: [What you expect to happen]
The above code should produce no diagostics
Actual behavior: [What actually happens]
The final
guard_target
fails, as the goal isa + b - (a + b) = 0
. Despite being told not to,simp
unfoldedmy_add
.The text was updated successfully, but these errors were encountered: