-
Notifications
You must be signed in to change notification settings - Fork 217
rw at * using hypothesis #1813
Comments
We can change the behavior of lemma test {A B : Type} (f : A -> B) a b c (h1 : f a = b) (h2 : f a = c) : false :=
begin
rw [id h1] at *,
admit
end This is just an example, we can create much more convoluted examples that produce the undesirable behavior. |
I was using it in a context addressed by this PR. So the fix mentioned would address that. For what it's worth, Coq doesn't do the rewrite in the case you mentioned, but I have no insight into how that is achieved. Perhaps no rewrites in any hypothesis that is used to construct the term to rewrite by? This is likely a good idea using the current implementation, as otherwise the result of the rewrite might depend on the order of hypotheses in the goal, which doesn't seem desirable. |
We can also do this. I don't see an example where this would be undesired.
This is not an issue. The rewrite tactic actually creates a new hypothesis with the same name, and (tries to) clear the old one. |
What I mean is that if the rewrite proceeds on a hypothesis that is being rewritten by, the remaining rewrites will use the rewritten term. As an example, change the order of |
Prerequisites
or feature requests.
Description
rw H at *
tactic where H is a hypothesis also rewrites in that hypothesis, making it useless, sometimes in the middle of tactic executionSteps to Reproduce
Observe the rewrite in the following proof
Expected behavior: [What you expect to happen]
Behavior equivalent to
rw h1 at h2
at worst rewriting both of them, but it's preferable to leave
h1
alone for possible future useActual behavior: [What actually happens]
rewrite occurs in
h1
, making it trivial beforeh2
can be rewrittenReproduces how often: [What percentage of the time does it reproduce?]
always
Versions
You can get this information from copy and pasting the output of
lean --version
,please include the OS and what version of the OS you're running.
Additional Information
Lean (version 3.2.1, commit f1ec117, RelWithDebInfo)
Any additional information, configuration or data that might be necessary to reproduce the issue.
The text was updated successfully, but these errors were encountered: