]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground/arith/nat_pred.ma
update in delayed_updating
[helm.git] / matita / matita / contribs / lambdadelta / ground / arith / nat_pred.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "ground/notation/functions/downarrow_1.ma".
16 include "ground/arith/pnat_split.ma".
17 include "ground/arith/nat.ma".
18
19 (* PREDECESSOR FOR NON-NEGATIVE INTEGERS ************************************)
20
21 definition pnpred (p): nat ≝
22            psplit … (𝟎) ninj p.
23
24 interpretation
25   "positive predecessor (non-negative integers)"
26   'DownArrow p = (pnpred p).
27
28 (*** pred *)
29 definition npred (m): nat ≝ match m with
30 [ nzero  ⇒ 𝟎
31 | ninj p ⇒ ↓p
32 ].
33
34 interpretation
35   "predecessor (non-negative integers)"
36   'DownArrow m = (npred m).
37
38 (* Basic constructions ******************************************************)
39
40 (*** pred_O *)
41 lemma npred_zero: 𝟎 = ↓𝟎.
42 // qed.
43
44 lemma npred_inj (p): ↓p = ↓(ninj p).
45 // qed.
46
47 lemma npred_unit: 𝟎 = ↓𝟏.
48 // qed.
49
50 lemma npred_psucc (p): ninj p = ↓↑p.
51 // qed.
52
53 (* Basic inversions *********************************************************)
54
55 lemma npred_pnat_inv_refl (p): ninj p = ↓p → ⊥.
56 *
57 [ <npred_unit #H destruct
58 | #p /3 width=2 by psucc_inv_refl, eq_inv_ninj_bi/
59 ]
60 qed-.
61
62 (*** pred_inv_fix_sn *)
63 lemma npred_inv_refl (n): n = ↓n → 𝟎 = n.
64 * // #p #H elim (npred_pnat_inv_refl … H)
65 qed-.