]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground/arith/pnat_plus.ma
arithmetics for λδ
[helm.git] / matita / matita / contribs / lambdadelta / ground / arith / pnat_plus.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/arith/pnat_iter.ma".
16
17 (* POSITIVE INTEGERS ********************************************************)
18
19 definition pplus: pnat → pnat → pnat ≝
20            λp,q. psucc^q p.
21
22 interpretation
23   "plus (positive integers"
24   'plus p q = (pplus p q).
25
26 (* Basic rewrites ***********************************************************)
27
28 lemma pplus_one_dx (p): ↑p = p + 𝟏.
29 // qed.
30
31 lemma pplus_succ_dx (p) (q): ↑(p+q) = p + ↑q.
32 // qed.
33
34 (* Semigroup properties *****************************************************)
35
36 lemma pplus_succ_sn (p) (q): ↑(p+q) = ↑p + q.
37 #p #q @(piter_appl … psucc)
38 qed.
39
40 lemma pplus_one_sn (p): ↑p = 𝟏 + p.
41 #p elim p -p //
42 qed.
43
44 lemma pplus_comm: commutative … pplus.
45 #p elim p -p //
46 qed.
47
48 lemma pplus_assoc: associative … pplus.
49 #p #q #r elim r -r //
50 #r #IH <pplus_succ_dx <pplus_succ_dx <IH -IH //
51 qed.