X-Git-Url: http://matita.cs.unibo.it/gitweb/?p=helm.git;a=blobdiff_plain;f=matita%2Ftests%2Finjection.ma;fp=matita%2Ftests%2Finjection.ma;h=b805df687a70ac8fa5e71eeb7bc3713269b2b372;hp=0000000000000000000000000000000000000000;hb=f61af501fb4608cc4fb062a0864c774e677f0d76;hpb=58ae1809c352e71e7b5530dc41e2bfc834e1aef1 diff --git a/matita/tests/injection.ma b/matita/tests/injection.ma new file mode 100644 index 000000000..b805df687 --- /dev/null +++ b/matita/tests/injection.ma @@ -0,0 +1,62 @@ +(**************************************************************************) +(* ___ *) +(* ||M|| *) +(* ||A|| A project by Andrea Asperti *) +(* ||T|| *) +(* ||I|| Developers: *) +(* ||T|| The HELM team. *) +(* ||A|| http://helm.cs.unibo.it *) +(* \ / *) +(* \ / This file is distributed under the terms of the *) +(* v GNU General Public License Version 2 *) +(* *) +(**************************************************************************) + + + +include "coq.ma". + +alias id "nat" = "cic:/Coq/Init/Datatypes/nat.ind#xpointer(1/1)". +alias id "bool" = "cic:/Coq/Init/Datatypes/bool.ind#xpointer(1/1)". +alias id "S" = "cic:/Coq/Init/Datatypes/nat.ind#xpointer(1/1/2)". + +inductive t0 : Type := + k0 : nat → nat → t0 + | k0' : bool → bool → t0. + +theorem injection_test0: ∀n,n',m,m'. k0 n m = k0 n' m' → m = m'. + intros; + destruct H; + reflexivity. +qed. + +inductive t : Type → Type := + k : nat → t nat + | k': bool → t bool. + +theorem injection_test1: ∀n,n'. k n = k n' → n = n'. + intros; + destruct H; + reflexivity. +qed. + +inductive tt (A:Type) : Type -> Type := + k1: nat → nat → tt A nat + | k2: bool → bool → tt A bool. + +theorem injection_test2: ∀n,n',m,m'. k1 bool n n' = k1 bool m m' → n' = m'. + intros; + destruct H; + reflexivity. +qed. + +inductive ttree : Type → Type := + tempty: ttree nat + | tnode : ∀A. ttree A → ttree A → ttree A. + +theorem injection_test4: + ∀n,n',m,m'. k1 bool (S n) (S (S m)) = k1 bool (S n') (S (S (S m'))) → m = S m'. + intros; + destruct H; + reflexivity. +qed.