X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fmatita%2Flibrary%2Fnat%2Forders.ma;h=6336a5e9bf12bec1e9ddca458d5d98b36d1e548a;hb=063523ae5f8da7e6458232f4afb6744ec86dc8bd;hp=8be62ae0b54b09267990bea8798358b746c3cebc;hpb=6423f1b6e3056883016598e454c55cab1004dfd2;p=helm.git diff --git a/helm/software/matita/library/nat/orders.ma b/helm/software/matita/library/nat/orders.ma index 8be62ae0b..6336a5e9b 100644 --- a/helm/software/matita/library/nat/orders.ma +++ b/helm/software/matita/library/nat/orders.ma @@ -12,8 +12,6 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/nat/orders". - include "nat/nat.ma". include "higher_order_defs/ordering.ma". @@ -100,6 +98,12 @@ theorem lt_S_S_to_lt: \forall n,m. intros. apply le_S_S_to_le. assumption. qed. +theorem lt_to_lt_S_S: ∀n,m. n < m → S n < S m. +intros; +unfold lt in H; +apply (le_S_S ? ? H). +qed. + theorem leS_to_not_zero : \forall n,m:nat. S n \leq m \to not_zero m. intros.elim H.exact I.exact I. qed. @@ -124,6 +128,43 @@ apply nat_elim2 ] qed. +theorem S_pred: \forall n:nat.lt O n \to eq nat n (S (pred n)). +intro.elim n.apply False_ind.exact (not_le_Sn_O O H). +apply eq_f.apply pred_Sn. +qed. + +theorem le_pred_to_le: + ∀n,m. O < m → pred n ≤ pred m → n ≤ m. +intros 2; +elim n; +[ apply le_O_n +| simplify in H2; + rewrite > (S_pred m); + [ apply le_S_S; + assumption + | assumption + ] +]. +qed. + +theorem le_to_le_pred: + ∀n,m. n ≤ m → pred n ≤ pred m. +intros 2; +elim n; +[ simplify; + apply le_O_n +| simplify; + generalize in match H1; + clear H1; + elim m; + [ elim (not_le_Sn_O ? H1) + | simplify; + apply le_S_S_to_le; + assumption + ] +]. +qed. + (* le to lt or eq *) theorem le_to_or_lt_eq : \forall n,m:nat. n \leq m \to n < m \lor n = m. @@ -132,6 +173,14 @@ right.reflexivity. left.unfold lt.apply le_S_S.assumption. qed. +theorem Not_lt_n_n: ∀n. n ≮ n. +intro; +unfold Not; +intro; +unfold lt in H; +apply (not_le_Sn_n ? H). +qed. + (* not eq *) theorem lt_to_not_eq : \forall n,m:nat. n H in H1. +apply (lt_to_not_eq b b) +[ assumption +| reflexivity +] +qed. + +theorem lt_n_m_to_not_lt_m_Sn: ∀n,m. n < m → m ≮ S n. +intros; +unfold Not; +intro; +unfold lt in H; +unfold lt in H1; +generalize in match (le_S_S ? ? H); +intro; +generalize in match (transitive_le ? ? ? H2 H1); +intro; +apply (not_le_Sn_n ? H3). +qed. + (* le vs. lt *) theorem lt_to_le : \forall n,m:nat. n