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/tests/coercions/".
16 include "legacy/coq.ma".
18 inductive pos: Set \def
22 inductive nat:Set \def
26 inductive int: Set \def
27 | positive: nat \to int
28 | negative : nat \to int.
30 inductive empty : Set \def .
32 let rec pos2nat x \def
34 [ one \Rightarrow (S O)
35 | (next z) \Rightarrow S (pos2nat z)].
37 definition nat2int \def \lambda x. positive x.
39 coercion cic:/matita/tests/coercions/pos2nat.con.
41 coercion cic:/matita/tests/coercions/nat2int.con.
43 definition fst \def \lambda x,y:int.x.
45 theorem a: fst O one = fst (positive O) (next one).
50 \forall f:int \to int. pos \to int
52 \lambda f:int \to int. \lambda x : pos .f (nat2int x).
55 \forall f:int \to int. pos \to int
57 \lambda f:int \to int. \lambda x : pos .f (pos2nat x).
60 \forall f:int \to int. pos \to int
62 \lambda f:int \to int. \lambda x : pos .f (nat2int (pos2nat x)).