1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "ground/arith/pnat_iter.ma".
17 (* ADDITION FOR POSITIVE INTEGERS *******************************************)
19 definition pplus: pnat → pnat → pnat ≝
23 "plus (positive integers)"
24 'plus p q = (pplus p q).
26 (* Basic constructions ******************************************************)
28 lemma pplus_unit_dx (p): ↑p = p + 𝟏.
31 lemma pplus_succ_dx (p) (q): ↑(p+q) = p + ↑q.
34 (* Advanced constructions (semigroup properties) ****************************)
36 lemma pplus_succ_sn (p) (q): ↑(p+q) = ↑p + q.
37 #p #q @(piter_appl … psucc)
40 lemma pplus_unit_sn (p): ↑p = 𝟏 + p.
44 lemma pplus_comm: commutative … pplus.
46 qed-. (* * gets in the way with auto *)
48 lemma pplus_assoc: associative … pplus.
50 #r #IH <pplus_succ_dx <pplus_succ_dx <IH -IH //
53 (* Basic inversions *********************************************************)
55 lemma eq_inv_unit_pplus (p) (q): 𝟏 = p + q → ⊥.
57 [ <pplus_unit_dx #H destruct
58 | #q #_ <pplus_succ_dx #H destruct
62 lemma eq_inv_pplus_unit (p) (q):
64 /2 width=3 by eq_inv_unit_pplus/ qed-.
66 lemma eq_inv_pplus_bi_dx (r) (p) (q): p + r = q + r → p = q.
67 #r elim r -r /3 width=1 by eq_inv_psucc_bi/
70 lemma eq_inv_pplus_bi_sn (r) (p) (q): r + p = r + q → p = q.
71 #r #p #q <pplus_comm <pplus_comm in ⊢ (???%→?);
72 /2 width=2 by eq_inv_pplus_bi_dx/