X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fmatita%2Flibrary%2Fnat%2Forders.ma;h=799f8bf7c47b74c65575431e78d2f0b8f9662b9e;hb=10f29fdd78ee089a9a94446207b543d33d6c851c;hp=6ec0c9992a68b18e15976e96e74ef853c2fc04eb;hpb=55b82bd235d82ff7f0a40d980effe1efde1f5073;p=helm.git diff --git a/helm/software/matita/library/nat/orders.ma b/helm/software/matita/library/nat/orders.ma index 6ec0c9992..799f8bf7c 100644 --- a/helm/software/matita/library/nat/orders.ma +++ b/helm/software/matita/library/nat/orders.ma @@ -22,9 +22,8 @@ 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). -(*CSC: the URI must disappear: there is a bug now *) interpretation "natural 'less or equal to'" 'leq x y = (cic:/matita/nat/orders/le.ind#xpointer(1/1) x y). -(*CSC: the URI must disappear: there is a bug now *) + 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)). @@ -32,24 +31,21 @@ interpretation "natural 'neither less nor equal to'" 'nleq x y = definition lt: nat \to nat \to Prop \def \lambda n,m:nat.(S n) \leq m. -(*CSC: the URI must disappear: there is a bug now *) interpretation "natural 'less than'" 'lt x y = (cic:/matita/nat/orders/lt.con x y). -(*CSC: the URI must disappear: there is a bug now *) + interpretation "natural 'not less than'" 'nless x y = (cic:/matita/logic/connectives/Not.con (cic:/matita/nat/orders/lt.con x y)). definition ge: nat \to nat \to Prop \def \lambda n,m:nat.m \leq n. -(*CSC: the URI must disappear: there is a bug now *) interpretation "natural 'greater or equal to'" 'geq x y = (cic:/matita/nat/orders/ge.con 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; + 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. @@ -122,6 +175,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