1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| A.Asperti, C.Sacerdoti Coen, *)
8 (* ||A|| E.Tassi, S.Zacchiroli *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU Lesser General Public License Version 2.1 *)
13 (**************************************************************************)
15 set "baseuri" "cic:/matita/library_auto/nat/nat".
17 include "higher_order_defs/functions.ma".
19 inductive nat : Set \def
23 definition pred: nat \to nat \def
24 \lambda n:nat. match n with
26 | (S p) \Rightarrow p ].
28 theorem pred_Sn : \forall n:nat.n=(pred (S n)).
30 (*intros. reflexivity.*)
33 theorem injective_S : injective nat nat S.
37 rewrite > (pred_Sn y).
43 theorem inj_S : \forall n,m:nat.(S n)=(S m) \to n=m \def
46 theorem not_eq_S : \forall n,m:nat.
47 \lnot n=m \to S n \neq S m.
57 definition not_zero : nat \to Prop \def
61 | (S p) \Rightarrow True ].
63 theorem not_eq_O_S : \forall n:nat. O \neq S n.
72 theorem not_eq_n_Sn : \forall n:nat. n \neq S n.
76 |apply not_eq_S.assumption]
80 \forall n:nat.\forall P:nat \to Prop.
81 P O \to (\forall m:nat. P (S m)) \to P n.
90 \forall n:nat.\forall P:nat \to Prop.
91 (n=O \to P O) \to (\forall m:nat. (n=(S m) \to P (S m))) \to P n.
103 \forall R:nat \to nat \to Prop.
104 (\forall n:nat. R O n)
105 \to (\forall n:nat. R (S n) O)
106 \to (\forall n,m:nat. R n m \to R (S n) (S m))
107 \to \forall n,m:nat. R n m.
121 theorem decidable_eq_nat : \forall n,m:nat.decidable (n=m).
122 intros.unfold decidable.
123 apply (nat_elim2 (\lambda n,m.(Or (n=m) ((n=m) \to False))))
134 apply (not_eq_O_S n1);