]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/matita/library/nat/nat.ma
The library grows...
[helm.git] / helm / matita / library / nat / nat.ma
index 194cf1273b4eb5c7719be019376a02cab8016f3c..df045daa732e5310d93245c2164610c74d350ae8 100644 (file)
@@ -16,6 +16,7 @@ set "baseuri" "cic:/matita/nat/nat".
 
 include "logic/equality.ma".
 include "logic/connectives.ma".
+include "datatypes/bool.ma".
 include "higher_order_defs/functions.ma".
 
 inductive nat : Set \def
@@ -84,3 +85,17 @@ apply nat_case m.apply H1.
 intros.apply H2. apply H3.
 qed.
 
+theorem decidable_eq_nat : \forall n,m:nat.decidable (n=m).
+intros.simplify.
+apply nat_elim2 (\lambda n,m.(Or (n=m) ((n=m) \to False))).
+intro.elim n1.
+left.reflexivity.
+right.apply not_eq_O_S.
+intro.right.intro.
+apply not_eq_O_S n1 ?.
+apply sym_eq.assumption.
+intros.elim H.
+left.apply eq_f. assumption.
+right.intro.apply H1.apply inj_S.assumption.
+qed.
+