X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fmatita%2Flibrary%2Fnat%2Forders.ma;h=8255787f98988252369855dca4f5e075de451f2d;hb=HEAD;hp=8053d50de55bfe8afc7d434243b17ceca34b9536;hpb=a9f72dea3b74e3c0c33daf5be8f4d5d75611492c;p=helm.git diff --git a/helm/software/matita/library/nat/orders.ma b/helm/software/matita/library/nat/orders.ma index 8053d50de..8255787f9 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". @@ -22,32 +20,28 @@ inductive le (n:nat) : nat \to Prop \def | le_n : le n n | le_S : \forall m:nat. le n m \to le n (S m). -interpretation "natural 'less or equal to'" 'leq x y = (cic:/matita/nat/orders/le.ind#xpointer(1/1) x y). +interpretation "natural 'less or equal to'" 'leq x y = (le x y). -interpretation "natural 'neither less nor equal to'" 'nleq x y = - (cic:/matita/logic/connectives/Not.con - (cic:/matita/nat/orders/le.ind#xpointer(1/1) x y)). +interpretation "natural 'neither less nor equal to'" 'nleq x y = (Not (le x y)). definition lt: nat \to nat \to Prop \def \lambda n,m:nat.(S n) \leq m. -interpretation "natural 'less than'" 'lt x y = (cic:/matita/nat/orders/lt.con x y). +interpretation "natural 'less than'" 'lt x y = (lt x y). -interpretation "natural 'not less than'" 'nless x y = - (cic:/matita/logic/connectives/Not.con (cic:/matita/nat/orders/lt.con x y)). +interpretation "natural 'not less than'" 'nless x y = (Not (lt x y)). definition ge: nat \to nat \to Prop \def \lambda n,m:nat.m \leq n. -interpretation "natural 'greater or equal to'" 'geq x y = (cic:/matita/nat/orders/ge.con x y). +interpretation "natural 'greater or equal to'" 'geq x y = (ge x y). definition gt: nat \to nat \to Prop \def \lambda n,m:nat.m (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; + elim m in H1 ⊢ %; + [ 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 +167,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