X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fmatita%2Flibrary%2FZ%2Forders.ma;h=c39f693085398eedf4a95a9f15898f05e6cee264;hb=97c2d258a5c524eb5c4b85208899d80751a2c82f;hp=756d02271a62705317140ec464f0c6591b316e75;hpb=c12d08acf947823bbfd5909618b042c65ff107de;p=helm.git diff --git a/helm/matita/library/Z/orders.ma b/helm/matita/library/Z/orders.ma index 756d02271..c39f69308 100644 --- a/helm/matita/library/Z/orders.ma +++ b/helm/matita/library/Z/orders.ma @@ -15,6 +15,7 @@ set "baseuri" "cic:/matita/Z/orders". include "Z/z.ma". +include "nat/orders.ma". definition Zle : Z \to Z \to Prop \def \lambda x,y:Z. @@ -37,6 +38,9 @@ definition Zle : Z \to Z \to Prop \def (*CSC: the URI must disappear: there is a bug now *) interpretation "integer 'less or equal to'" 'leq x y = (cic:/matita/Z/orders/Zle.con x y). +(*CSC: the URI must disappear: there is a bug now *) +interpretation "integer 'neither less nor equal to'" 'nleq x y = + (cic:/matita/logic/connectives/Not.con (cic:/matita/Z/orders/Zle.con x y)). definition Zlt : Z \to Z \to Prop \def \lambda x,y:Z. @@ -59,128 +63,68 @@ definition Zlt : Z \to Z \to Prop \def (*CSC: the URI must disappear: there is a bug now *) interpretation "integer 'less than'" 'lt x y = (cic:/matita/Z/orders/Zlt.con x y). +(*CSC: the URI must disappear: there is a bug now *) +interpretation "integer 'not less than'" 'nless x y = + (cic:/matita/logic/connectives/Not.con (cic:/matita/Z/orders/Zlt.con x y)). theorem irreflexive_Zlt: irreflexive Z Zlt. -change with \forall x:Z. x < x \to False. +change with (\forall x:Z. x < x \to False). intro.elim x.exact H. -cut neg n < neg n \to False. -apply Hcut.apply H.simplify.apply not_le_Sn_n. -cut pos n < pos n \to False. -apply Hcut.apply H.simplify.apply not_le_Sn_n. +cut (neg n < neg n \to False). +apply Hcut.apply H.simplify.unfold lt.apply not_le_Sn_n. +cut (pos n < pos n \to False). +apply Hcut.apply H.simplify.unfold lt.apply not_le_Sn_n. qed. theorem irrefl_Zlt: irreflexive Z Zlt \def irreflexive_Zlt. -definition Z_compare : Z \to Z \to compare \def -\lambda x,y:Z. - match x with - [ OZ \Rightarrow - match y with - [ OZ \Rightarrow EQ - | (pos m) \Rightarrow LT - | (neg m) \Rightarrow GT ] - | (pos n) \Rightarrow - match y with - [ OZ \Rightarrow GT - | (pos m) \Rightarrow (nat_compare n m) - | (neg m) \Rightarrow GT] - | (neg n) \Rightarrow - match y with - [ OZ \Rightarrow LT - | (pos m) \Rightarrow LT - | (neg m) \Rightarrow nat_compare m n ]]. - -(*CSC: qui uso lt perche' ho due istanze diverse di < *) theorem Zlt_neg_neg_to_lt: -\forall n,m:nat. neg n < neg m \to lt m n. +\forall n,m:nat. neg n < neg m \to m < n. intros.apply H. qed. -(*CSC: qui uso lt perche' ho due istanze diverse di < *) -theorem lt_to_Zlt_neg_neg: \forall n,m:nat.lt m n \to neg n < neg m. +theorem lt_to_Zlt_neg_neg: \forall n,m:nat.m < n \to neg n < neg m. intros. simplify.apply H. qed. -(*CSC: qui uso lt perche' ho due istanze diverse di < *) theorem Zlt_pos_pos_to_lt: -\forall n,m:nat. pos n < pos m \to lt n m. +\forall n,m:nat. pos n < pos m \to n < m. intros.apply H. qed. -(*CSC: qui uso lt perche' ho due istanze diverse di < *) -theorem lt_to_Zlt_pos_pos: \forall n,m:nat.lt n m \to pos n < pos m. +theorem lt_to_Zlt_pos_pos: \forall n,m:nat.n < m \to pos n < pos m. intros. simplify.apply H. qed. -theorem Z_compare_to_Prop : -\forall x,y:Z. match (Z_compare x y) with -[ LT \Rightarrow x < y -| EQ \Rightarrow x=y -| GT \Rightarrow y < x]. -intros. -elim x. elim y. -simplify.apply refl_eq. -simplify.exact I. -simplify.exact I. -elim y. simplify.exact I. -simplify. -(*CSC: qui uso le perche' altrimenti ci sono troppe scelte - per via delle coercions! *) -cut match (nat_compare n1 n) with -[ LT \Rightarrow n1