| 1 |
|
| 2 |
Lemma test1 : |
| 3 |
forall (v : nat) (f g : nat -> nat), |
| 4 |
f v = g v. |
| 5 |
intros. f_equal. |
| 6 |
(* |
| 7 |
Goal in v8.5: f v = g v |
| 8 |
Goal in v8.4: v = v -> f v = g v |
| 9 |
Expected: f = g |
| 10 |
*) |
| 11 |
Admitted. |
| 12 |
|
| 13 |
Lemma test2 : |
| 14 |
forall (v u : nat) (f g : nat -> nat), |
| 15 |
f v = g u. |
| 16 |
intros. f_equal. |
| 17 |
(* |
| 18 |
In both v8.4 And v8.5 |
| 19 |
Goal 1: v = u -> f v = g u |
| 20 |
Goal 2: v = u |
| 21 |
|
| 22 |
Expected Goal 1: f = g |
| 23 |
Expected Goal 2: v = u |
| 24 |
*) |
| 25 |
Admitted. |
| 26 |
|
| 27 |
Lemma test3 : |
| 28 |
forall (v : nat) (u : list nat) (f : nat -> nat) (g : list nat -> nat), |
| 29 |
f v = g u. |
| 30 |
intros. f_equal. |
| 31 |
(* |
| 32 |
In both v8.4 And v8.5, the goal is unchanged. |
| 33 |
*) |
| 34 |
Admitted. |
| 35 |
|
| 36 |
Require Import TestSuite.list. |
| 37 |
Lemma foo n (l k : list nat) : app k (skipn n l) = skipn n l. |
| 38 |
Proof. f_equal. |
| 39 |
(* |
| 40 |
8.4: leaves the goal unchanged, i.e. k ++ skipn n l = skipn n l |
| 41 |
8.5: 2 goals, skipn n l = l -> k ++ skipn n l = skipn n l |
| 42 |
and skipn n l = l |
| 43 |
*) |
| 44 |
Abort. |
| 45 |
|
| 46 |
Fixpoint replicate {A} (n : nat) (x : A) : list A := |
| 47 |
match n with 0 => nil | S n => x :: replicate n x end. |
| 48 |
Lemma bar {A} n m (x : A) : |
| 49 |
skipn n (replicate m x) = replicate (m - n) x -> |
| 50 |
skipn n (replicate m x) = replicate (m - n) x. |
| 51 |
Proof. intros. f_equal. |
| 52 |
(* 8.5: one goal, n = m - n *) |
| 53 |
Abort. |
| 54 |
|
| 55 |
Parameter F : nat -> Set. |
| 56 |
Parameter X : forall n, F (n + 1). |
| 57 |
|
| 58 |
Definition sequator{X Y: Set}{eq:X=Y}(x:X) : Y := eq_rec _ _ x _ eq. |
| 59 |
Definition tequator{X Y}{eq:X=Y}(x:X) : Y := eq_rect _ _ x _ eq. |
| 60 |
Polymorphic Definition pequator{X Y}{eq:X=Y}(x:X) : Y := eq_rect _ _ x _ eq. |
| 61 |
|
| 62 |
Goal {n:nat & F (S n)}. |
| 63 |
eexists. |
| 64 |
unshelve eapply (sequator (X _)). |
| 65 |
f_equal. (*behaves*) |
| 66 |
Undo 2. |
| 67 |
unshelve eapply (pequator (X _)). |
| 68 |
f_equal. (*behaves*) |
| 69 |
Undo 2. |
| 70 |
unshelve eapply (tequator (X _)). |
| 71 |
f_equal. (*behaves now *) |
| 72 |
Focus 2. exact 0. |
| 73 |
simpl. |
| 74 |
reflexivity. |
| 75 |
Defined. |
| 76 |
|
| 77 |
(* Part 2: modulo casts introduced by refine due to reductions in goals *) |
| 78 |
|
| 79 |
Goal {n:nat & F (S n)}. |
| 80 |
eexists. |
| 81 |
(*misbehaves, although same goal as above*) |
| 82 |
Set Printing All. |
| 83 |
unshelve refine (sequator (X _)); revgoals. |
| 84 |
2:exact 0. reflexivity. |
| 85 |
Undo 3. |
| 86 |
unshelve refine (pequator (X _)); revgoals. |
| 87 |
f_equal. |
| 88 |
Undo 2. |
| 89 |
unshelve refine (tequator (X _)); revgoals. |
| 90 |
f_equal. |
| 91 |
Admitted. |
| 92 |
|
| 93 |
Goal @eq Set nat nat. |
| 94 |
congruence. |
| 95 |
Qed. |
| 96 |
|
| 97 |
Goal @eq Type nat nat. |
| 98 |
congruence. |
| 99 |
Qed. |
| 100 |
|
| 101 |
Parameter T : Type. |
| 102 |
|
| 103 |
Goal @eq Type T T. |
| 104 |
congruence. |
| 105 |
Qed. |