]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/matita/library/nat.ma
version 0.7.1
[helm.git] / helm / matita / library / nat.ma
index 114f8d1c16fe32a2a03442af6ebe0c3aa9227060..c125e6775b7a2f48604f5912dad0f7c2c5defde6 100644 (file)
 
 set "baseuri" "cic:/matita/nat/".
 
-alias id "eq" = "cic:/matita/equality/eq.ind#xpointer(1/1)".
-alias id "refl_equal" = "cic:/matita/equality/eq.ind#xpointer(1/1/1)".
-alias id "sym_eq" = "cic:/matita/equality/sym_eq.con".
-alias id "f_equal" = "cic:/matita/equality/f_equal.con".
-alias id "Not" = "cic:/matita/logic/Not.con".
-alias id "False" = "cic:/matita/logic/False.ind#xpointer(1/1)".
-alias id "True" = "cic:/matita/logic/True.ind#xpointer(1/1)".
-alias id "trans_eq" = "cic:/matita/equality/trans_eq.con".
-alias id "I" = "cic:/matita/logic/True.ind#xpointer(1/1/1)".
-alias id "f_equal2" = "cic:/matita/equality/f_equal2.con".
-alias id "False_ind" = "cic:/matita/logic/False_ind.con".
-alias id "false" = "cic:/matita/bool/bool.ind#xpointer(1/1/2)".
-alias id "true" = "cic:/matita/bool/bool.ind#xpointer(1/1/1)".
-alias id "if_then_else" = "cic:/matita/bool/if_then_else.con".
-alias id "EQ" = "cic:/matita/compare/compare.ind#xpointer(1/1/2)".
-alias id "GT" = "cic:/matita/compare/compare.ind#xpointer(1/1/3)".
-alias id "LT" = "cic:/matita/compare/compare.ind#xpointer(1/1/1)".
-alias id "compare" = "cic:/matita/compare/compare.ind#xpointer(1/1)".
-alias id "compare_invert" = "cic:/matita/compare/compare_invert.con".
+include "equality.ma".
+include "logic.ma".
+include "bool.ma".
+include "compare.ma".
 
 inductive nat : Set \def
   | O : nat
@@ -45,21 +30,21 @@ definition pred: nat \to nat \def
 
 theorem pred_Sn : \forall n:nat.
 (eq nat n (pred (S n))).
-intros.reflexivity.
+introsreflexivity.
 qed.
 
 theorem injective_S : \forall n,m:nat. 
 (eq nat (S n) (S m)) \to (eq nat n m).
-intros.
-rewrite > pred_Sn n.
+intros;
+rewrite > pred_Sn;
 rewrite > pred_Sn m.
-apply f_equal. assumption.
+apply f_equal; assumption.
 qed.
 
 theorem not_eq_S  : \forall n,m:nat. 
 Not (eq nat n m) \to Not (eq nat (S n) (S m)).
-intros. simplify.intros.
-apply H.apply injective_S.assumption.
+intros; simplify; intros;
+apply H; apply injective_S; assumption.
 qed.
 
 definition not_zero : nat \to Prop \def
@@ -69,9 +54,8 @@ definition not_zero : nat \to Prop \def
   | (S p) \Rightarrow True ].
 
 theorem O_S : \forall n:nat. Not (eq nat O (S n)).
-intros.simplify.intros.
-cut (not_zero O).exact Hcut.rewrite > H.
-exact I.
+intros; simplify; intros;
+cut (not_zero O); [ exact Hcut | rewrite > H; exact I ].
 qed.
 
 theorem n_Sn : \forall n:nat. Not (eq nat n (S n)).
@@ -84,8 +68,9 @@ let rec plus n m \def
  | (S p) \Rightarrow S (plus p m) ].
 
 theorem plus_n_O: \forall n:nat. eq nat n (plus n O).
-intros.elim n.simplify.reflexivity.
-simplify.apply f_equal.assumption.
+intros;elim n;
+ [ simplify;reflexivity
+ | simplify;apply f_equal;assumption ].
 qed.
 
 theorem plus_n_Sm : \forall n,m:nat. eq nat (S (plus n  m)) (plus n (S m)).
@@ -118,8 +103,8 @@ theorem times_n_Sm :
 \forall n,m:nat. eq nat (plus n (times n  m)) (times n (S m)).
 intros.elim n.simplify.reflexivity.
 simplify.apply f_equal.rewrite < H.
-transitivity (plus (plus e m) (times e m)).symmetry.
-apply assoc_plus.transitivity (plus (plus m e) (times e m)).
+transitivity (plus (plus e1 m) (times e1 m)).symmetry.
+apply assoc_plus.transitivity (plus (plus m e1) (times e1 m)).
 apply f_equal2.
 apply sym_plus.reflexivity.apply assoc_plus.
 qed.
@@ -127,7 +112,7 @@ qed.
 theorem sym_times : 
 \forall n,m:nat. eq nat (times n m) (times m n).
 intros.elim n.simplify.apply times_n_O.
-simplify.rewrite < sym_eq ? ? ? H.apply times_n_Sm.
+simplify.rewrite > H.apply times_n_Sm.
 qed.
 
 let rec minus n m \def 
@@ -203,7 +188,7 @@ qed.
 
 theorem le_Sn_n : \forall n:nat. Not (le (S n) n).
 intros.elim n.apply le_Sn_O.simplify.intros.
-cut le (S e) e.apply H.assumption.apply le_S_n.assumption.
+cut le (S e1) e1.apply H.assumption.apply le_S_n.assumption.
 qed.
 
 theorem le_antisym : \forall n,m:nat. (le n m) \to (le m n) \to (eq nat n m).