]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/matita/library/nat/compare.ma
minus in nat.ma
[helm.git] / helm / software / matita / library / nat / compare.ma
index dd9589e7bfab7d75cf8b33d60c0c60d22e34d259..4c44c74e0b61e8e84faea821e7b771b8dab56759 100644 (file)
@@ -317,3 +317,14 @@ apply ((H H3)).
 apply ((H1 H3)).
 apply ((H2 H3)).
 qed.
+
+inductive cmp_cases (n,m:nat) : CProp ≝
+  | cmp_le : n ≤ m → cmp_cases n m
+  | cmp_gt : m < n → cmp_cases n m.
+
+lemma cmp_nat: ∀n,m.cmp_cases n m.
+intros; generalize in match (nat_compare_to_Prop n m);
+cases (nat_compare n m); intros;
+[constructor 1;apply lt_to_le|constructor 1;rewrite > H|constructor 2]
+try assumption; apply le_n;
+qed.