| 1 |
From elpi.apps Require Import eltac.injection. |
| 2 |
|
| 3 |
Set Implicit Arguments. |
| 4 |
|
| 5 |
Elpi derive.projK nat. |
| 6 |
|
| 7 |
Lemma test_nat (a b :nat) : S a = S b -> a = b. |
| 8 |
Proof. |
| 9 |
intro H. |
| 10 |
eltac.injection (H). |
| 11 |
intro E. |
| 12 |
assumption. |
| 13 |
Qed. |
| 14 |
|
| 15 |
From Stdlib Require Vector. |
| 16 |
From Corelib Require Import ssreflect. |
| 17 |
From Stdlib Require Import Arith. |
| 18 |
|
| 19 |
Elpi derive.projK Vector.t. |
| 20 |
|
| 21 |
|
| 22 |
Lemma test_vect A a b n (v1 v2 : Vector.t A n) : |
| 23 |
Vector.cons A a n v1 = Vector.cons A b n v2 -> a = b /\ v1 = v2. |
| 24 |
Proof. |
| 25 |
intro H. |
| 26 |
eltac.injection (H). |
| 27 |
move=> /= Eab _ Esigv12. |
| 28 |
split. |
| 29 |
exact Eab. |
| 30 |
rewrite -[v2](projT2_eq Esigv12) /=. |
| 31 |
by rewrite (UIP_nat _ _ (projT1_eq Esigv12) (eq_refl n)). |
| 32 |
Qed. |
| 33 |
|
| 34 |
Set Universe Polymorphism. |
| 35 |
Unset Universe Minimization ToSet. |
| 36 |
Module UnivPoly. |
| 37 |
Inductive List (A : Type) := Nil | Cons (a : A) (ls : List). |
| 38 |
Elpi derive.projK List. |
| 39 |
Goal forall (u1 u2 : unit), (Cons u1 (Nil _) = Cons u2 (Nil _)) -> u1 = u2. |
| 40 |
intros u1 u2 e. |
| 41 |
eltac.injection (e). |
| 42 |
Abort. |
| 43 |
|
| 44 |
End UnivPoly. |
| 45 |
Unset Universe Polymorphism. |