1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 set "baseuri" "cic:/matita/test/injection/".
17 include "legacy/coq.ma".
19 alias id "nat" = "cic:/Coq/Init/Datatypes/nat.ind#xpointer(1/1)".
20 alias id "bool" = "cic:/Coq/Init/Datatypes/bool.ind#xpointer(1/1)".
21 alias id "S" = "cic:/Coq/Init/Datatypes/nat.ind#xpointer(1/1/2)".
23 inductive t0 : Type :=
25 | k0' : bool → bool → t0.
27 theorem injection_test0: ∀n,n',m,m'. k0 n m = k0 n' m' → m = m'.
33 inductive t : Type → Type :=
37 theorem injection_test1: ∀n,n'. k n = k n' → n = n'.
43 inductive tt (A:Type) : Type -> Type :=
44 k1: nat → nat → tt A nat
45 | k2: bool → bool → tt A bool.
47 theorem injection_test2: ∀n,n',m,m'. k1 bool n n' = k1 bool m m' → n' = m'.
53 inductive ttree : Type → Type :=
55 | tnode : ∀A. ttree A → ttree A → ttree A.
57 (* CSC: there is an undecidable unification problem here:
58 consider a constructor k : \forall x. f x -> i (g x)
59 The head of the outtype of the injection MutCase should be (f ?1)
60 such that (f ?1) unifies with (g d) [ where d is the Rel that binds
61 the corresponding right parameter in the outtype ]
62 Coq dodges the problem by generating an equality between sigma-types
63 (that state the existence of a ?1 such that ...)
64 theorem injection_test3:
65 ∀t,t'. tnode nat t tempty = tnode nat t' tempty → t = t'.
71 theorem injection_test3:
73 tnode nat (tnode nat t t') tempty = tnode nat (tnode nat t' tempty) tempty →
79 theorem injection_test4:
80 ∀n,n',m,m'. k1 bool (S n) (S (S m)) = k1 bool (S n') (S (S (S m'))) → m = S m'.