]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/matita/contribs/lambdadelta/ground/arith/nat_pred.ma
propagating the arithmetics library, partial commit
[helm.git] / matita / matita / contribs / lambdadelta / ground / arith / nat_pred.ma
index 4fcab387d0bd8d5248fef6c98e41d0abc2a78f9e..d7f79d76b8084d89079406c281a86de8872545f8 100644 (file)
 (**************************************************************************)
 
 include "ground/notation/functions/downarrow_1.ma".
-include "ground/arith/pnat_dis.ma".
+include "ground/arith/pnat_split.ma".
 include "ground/arith/nat.ma".
 
 (* PREDECESSOR FOR NON-NEGATIVE INTEGERS ************************************)
 
+definition pnpred (p): nat ≝
+           psplit … (𝟎) ninj p.
+
+interpretation
+  "positive predecessor (non-negative integers)"
+  'DownArrow p = (pnpred p).
+
 (*** pred *)
 definition npred (m): nat ≝ match m with
 [ nzero  ⇒ 𝟎
-| ninj p ⇒ pdis … (𝟎) ninj p
+| ninj p ⇒ p
 ].
 
 interpretation
-  "predecessor (non-negative integers"
+  "predecessor (non-negative integers)"
   'DownArrow m = (npred m).
 
-(* Basic rewrites ***********************************************************)
+(* Basic constructions ******************************************************)
 
+(*** pred_O *)
 lemma npred_zero: 𝟎 = ↓𝟎.
 // qed.
+
+lemma npred_inj (p): ↓p = ↓(ninj p).
+// qed.
+
+lemma npred_one: 𝟎 = ↓𝟏.
+// qed.
+
+lemma npred_psucc (p): ninj p = ↓↑p.
+// qed.
+
+(* Basic inversions *********************************************************)
+
+lemma npred_pnat_inv_refl (p): ninj p = ↓p → ⊥.
+*
+[ <npred_one #H destruct
+| #p /3 width=2 by psucc_inv_refl, eq_inv_ninj_bi/
+]
+qed-.
+
+(*** pred_inv_fix_sn *)
+lemma npred_inv_refl (n): n = ↓n → 𝟎 = n.
+* // #p #H elim (npred_pnat_inv_refl … H)
+qed-.