Created
October 11, 2022 01:32
-
-
Save Blaisorblade/1334492d63020c064b4a247c8c9a1262 to your computer and use it in GitHub Desktop.
Demonstrate strange rewrite behavior
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Require Import List. | |
Import ListNotations. | |
Lemma test1 : | |
length ([1] ++ [2]) = 2 -> | |
2 = 4. | |
Proof. | |
intros HA. | |
evar (N : nat). | |
Unshelve. | |
admit. | |
Check HA. | |
Undo. | |
Undo. | |
(* FIX: *) | |
(* clear N. *) | |
rewrite -> app_length in HA. | |
Unshelve. | |
admit. | |
(* Now [HA] has disappeared from the context of the second goal, unless we run [clear N]. *) | |
Fail Check HA. | |
Abort. | |
Lemma test2 : | |
length ([1] ++ [2]) = 2 -> | |
exists n : nat, n + 4 = 2. | |
Proof. | |
intros HA. | |
eexists. | |
(* evar (N : nat). *) | |
Unshelve. | |
admit. | |
Check HA. | |
Undo. | |
Undo. | |
(* FIX: *) | |
(* clear N. *) | |
rewrite -> app_length in HA. | |
Unshelve. | |
admit. | |
(* Now [HA] has disappeared from the context of the second goal, and we can't [clear N] to fix that. *) | |
Fail Check HA. | |
Abort. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the following lines can be removed as they seem to be from a previous experment and dont seem to be relevant anymore