Open timotree3 opened 2 months ago
Thanks for your report, it’s good to have this noted down.
I agree that the behavior you describe is not as intuitive as it could. But fixing it might be non-trivial (didn’t have a close look at the rw
implementation yet) and a work-around exists by specyfing the exact lemma, so I’d say this isn’t going to be of high priority.
Prerequisites
Please put an X between the brackets as you perform the following steps:
Description
When using
rw
to unfold a recursive definition using equation lemmas, it seems to find the first equation lemma whose LHS appears in the goal, and then find the leftmost occurrence of that LHS in the goal. I would've expected it to find the leftmost subexpression in the goal which matches any of the possible equation lemmas. Similarly, I would expectnth_rw n
(AKArw (config := {occs := .pos [n]})
) to find the nth subexpression which matches any of the equation lemmas, not just the first equation lemma.Context
I first noticed then when a new user was confused by it on Zulip. Then I opened a Zulip thread.
Steps to Reproduce
Versions
4.12.0-nightly-2024-08-13
live.lean-lang.org
Impact
Add :+1: to issues you consider important. If others are impacted by this issue, please ask them to add :+1: to it.