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
inductiveC : Type where
| C1 (b : Bool) : C
| C2 (c1 c2 : C) : C
deriving Inhabited
open C
defid1 (b : Bool) : C := C1 b
defid2 (c : C) : C :=
match c with
| C1 b => id1 b
| C2 c1 c2 => C2 (id2 c1) (id2 c2)
theoremid2_is_idempotent : id2 (id2 c) ≠ id2 c :=
match c with
| C1 b => by
dsimp only [id2]
-- HERE , which implies that id2 (id1 b) --> id1 b happened at some pointsorry
| C2 _ _ => bysorry
At "HERE" the goal is id1 b ≠ id1 b so dsimp did a id2 (id1 b) --> id1 b rewrite at some
point (as confirmed by trace.Meta.Tactic.simp.rewrite), this happens despite dsimp only
being instructed to unfold id2, not id1.
Expected behavior:id2 (id1 b) should not be rewritten to id1, this breaks abstraction without the user intending so. Actual behavior:id2 (id1 b) get's rewritten to id1 b
This PR ensures that `simp` and `dsimp` do not unfold definitions that are
not intended to be unfolded by the user. See issue #5755 for an
example affected by this issue.
Closes#5755
This PR ensures that `simp` and `dsimp` do not unfold definitions that
are not intended to be unfolded by the user. See issue #5755 for an
example affected by this issue.
Closes#5755
---------
Co-authored-by: Kim Morrison <[email protected]>
Prerequisites
Please put an X between the brackets as you perform the following steps:
https://github.com/leanprover/lean4/issues
Avoid dependencies to Mathlib or Batteries.
https://live.lean-lang.org/#project=lean-nightly
(You can also use the settings there to switch to “Lean nightly”)
Description
Consider:
At "HERE" the goal is
id1 b ≠ id1 b
sodsimp
did aid2 (id1 b) --> id1 b
rewrite at somepoint (as confirmed by
trace.Meta.Tactic.simp.rewrite
), this happens despitedsimp
onlybeing instructed to unfold
id2
, notid1
.Expected behavior:
id2 (id1 b)
should not be rewritten toid1
, this breaks abstraction without the user intending so.Actual behavior:
id2 (id1 b)
get's rewritten toid1 b
Versions
"4.12.0-nightly-2024-10-17"
Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.
The text was updated successfully, but these errors were encountered: