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 the tactic rw is used to change the type of a hypothesis h, it generally does this by replacing h with the new (rewritten) version. It should only keep both versions of the hypothesis (new and old) if the old version was referred to somewhere in the context.
In the following example, the keep-both behaviour occurs, but the old version of h doesn't seem to appear anywhere in the context. This only happens when a certain type argument is implicit.
Steps to Reproduce
theoremexplicit (α) [OfNat α 0] (a b : α) : (a = b) = (a = 0) := sorrytheoremimplicit {α} [OfNat α 0] (a b : α) : (a = b) = (a = 0) := sorryvariable (a b : Nat) (h : a = b)
-- desirable behaviour: replaces hexample : False := by
rw [explicit] at h
sorry-- undesirable behaviour: does not replace hexample : False := by
rw [implicit] at h
sorry
Expected behavior:
The two examples should generate the same goal state,
a b : Nat
h : a = 0
⊢ False
Actual behavior:
In the second example the old version of h has not been overwritten:
There must be something hidden in the context which is referring to the old h .... probably the thing that is referring to the old h is a metavariable which is not yet solved (e.g. the variable α in foo)
The text was updated successfully, but these errors were encountered:
Prerequisites
Description
When the tactic
rw
is used to change the type of a hypothesish
, it generally does this by replacingh
with the new (rewritten) version. It should only keep both versions of the hypothesis (new and old) if the old version was referred to somewhere in the context.In the following example, the keep-both behaviour occurs, but the old version of
h
doesn't seem to appear anywhere in the context. This only happens when a certain type argument is implicit.Steps to Reproduce
Expected behavior:
The two examples should generate the same goal state,
Actual behavior:
In the second example the old version of
h
has not been overwritten:Reproduces how often: 100%
Versions
nightly-2023-03-15
Additional Information
Zulip
Per @digama0
The text was updated successfully, but these errors were encountered: