]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground_2/ynat/ynat_plus.ma
addition for natural numbers with infinity
[helm.git] / matita / matita / contribs / lambdadelta / ground_2 / ynat / ynat_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_2/ynat/ynat_lt.ma".
16
17 (* NATURAL NUMBERS WITH INFINITY ********************************************)
18
19 (* addition *)
20 definition yplus: ynat → ynat → ynat ≝ λx,y. match x with
21 [ yinj m ⇒ ysucc^m y
22 | Y      ⇒ Y
23 ].
24
25 interpretation "ynat plus" 'plus x y = (yplus x y).
26
27 (* Properties on successor **************************************************)
28
29 lemma yplus_succ1: ∀m,n. (⫯m) + n = ⫯(m + n).
30 * //
31 qed.
32
33 lemma yplus_SO1: ∀m. 1 + m = ⫯m.
34 * //
35 qed. 
36
37 (* Basic properties *********************************************************)
38
39 lemma yplus_inj: ∀m,n. yinj m + yinj n = yinj (m + n).
40 #m elim m -m //
41 #m #IHm #n >(yplus_succ1 m) >IHm -IHm //
42 qed.
43
44 lemma yplus_Y2: ∀m. (m + ∞) = ∞.
45 * normalize //
46 qed.
47
48 lemma yplus_comm: commutative … yplus.
49 * [ #m ] * [1,3: #n ] //
50 normalize >ysucc_iter_Y //
51 qed.
52
53 lemma yplus_assoc: associative … yplus.
54 * // #x * //
55 #y #z >yplus_inj whd in ⊢ (??%%); >iter_plus //
56 qed.
57