]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/matita/library/Z/orders.ma
The library grows...
[helm.git] / helm / matita / library / Z / orders.ma
index 756d02271a62705317140ec464f0c6591b316e75..bc5ffdb5125f5495b3df6ee878c2cef0e7f04488 100644 (file)
@@ -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.
@@ -72,25 +73,6 @@ 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.
@@ -115,54 +97,6 @@ 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<n
-| EQ \Rightarrow n1=n
-| GT \Rightarrow n<n1] \to 
-match (nat_compare n1 n) with
-[ LT \Rightarrow (le (S n1) n)
-| EQ \Rightarrow neg n = neg n1
-| GT \Rightarrow (le (S n) n1)]. 
-apply Hcut. apply nat_compare_to_Prop. 
-elim (nat_compare n1 n).
-simplify.exact H.
-simplify.exact H.
-simplify.apply eq_f.apply sym_eq.exact H.
-simplify.exact I.
-elim y.simplify.exact I.
-simplify.exact I.
-simplify.
-(*CSC: qui uso le perche' altrimenti ci sono troppe scelte
-  per via delle coercions! *)
-cut match (nat_compare n n1) with
-[ LT \Rightarrow n<n1
-| EQ \Rightarrow n=n1
-| GT \Rightarrow n1<n] \to 
-match (nat_compare n n1) with
-[ LT \Rightarrow (le (S n) n1)
-| EQ \Rightarrow pos n = pos n1
-| GT \Rightarrow (le (S n1) n)]. 
-apply Hcut. apply nat_compare_to_Prop. 
-elim (nat_compare n n1).
-simplify.exact H.
-simplify.exact H.
-simplify.apply eq_f.exact H.
-qed.
-
 theorem Zlt_to_Zle: \forall x,y:Z. x < y \to Zsucc x \leq y.
 intros 2.elim x.
 cut OZ < y \to Zsucc OZ \leq y.