| 1 |
Require Import Ltac2.Ltac2. |
| 2 |
|
| 3 |
Ltac2 congruence_dev () := congruence. |
| 4 |
Ltac2 simpl_congruence_dev () := simple congruence. |
| 5 |
|
| 6 |
Lemma congruence_test_1 : (forall x:bool, x = true) -> False. |
| 7 |
Proof. |
| 8 |
intros. |
| 9 |
Fail congruence. |
| 10 |
Fail congruence 0 with false. |
| 11 |
Fail congruence 1 with true. |
| 12 |
congruence 1 with false. |
| 13 |
Qed. |
| 14 |
|
| 15 |
Lemma congruence_test_2 : (forall x:bool, x = true) -> False. |
| 16 |
Proof. |
| 17 |
intros. |
| 18 |
Fail congruence. |
| 19 |
congruence with false. |
| 20 |
Qed. |
| 21 |
|
| 22 |
Lemma congruence_test_3 {A B} (f: A->B->A) (a:A) (b:B): f a b = a -> f (f a b) b = a. |
| 23 |
Proof. |
| 24 |
congruence. |
| 25 |
Qed. |
| 26 |
|
| 27 |
Lemma congruence_test_4 {A} (f: A->A) (a:A): f (f (f a)) = a -> f (f (f (f (f a)))) = a -> f a = a. |
| 28 |
Proof. |
| 29 |
congruence. |
| 30 |
Qed. |
| 31 |
|
| 32 |
Lemma simple_congruence_test_1 : (forall x:bool, x = true) -> False. |
| 33 |
Proof. |
| 34 |
intros. |
| 35 |
Fail simple congruence. |
| 36 |
Fail simple congruence 0 with false. |
| 37 |
Fail simple congruence 1 with true. |
| 38 |
simple congruence 1 with false. |
| 39 |
Qed. |
| 40 |
|
| 41 |
Lemma simple_congruence_test_2 : (forall x:bool, x = true) -> False. |
| 42 |
Proof. |
| 43 |
intros. |
| 44 |
Fail simple congruence. |
| 45 |
simple congruence with false. |
| 46 |
Qed. |
| 47 |
|
| 48 |
Lemma simple_congruence_test_3 {A B} (f: A->B->A) (a:A) (b:B): f a b = a -> f (f a b) b = a. |
| 49 |
Proof. |
| 50 |
simple congruence. |
| 51 |
Qed. |
| 52 |
|
| 53 |
Lemma simple_congruence_test_4 {A} (f: A->A) (a:A): f (f (f a)) = a -> f (f (f (f (f a)))) = a -> f a = a. |
| 54 |
Proof. |
| 55 |
simple congruence. |
| 56 |
Qed. |