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_2/ynat/ynat_minus.ma".
17 (* NATURAL NUMBERS WITH INFINITY ********************************************)
20 definition yplus: ynat → ynat → ynat ≝ λx,y. match y with
25 interpretation "ynat plus" 'plus x y = (yplus x y).
27 (* Properties on successor **************************************************)
29 lemma yplus_succ2: ∀m,n. m + ⫯n = ⫯(m + n).
33 lemma yplus_succ1: ∀m,n. ⫯m + n = ⫯(m + n).
37 lemma yplus_succ_swap: ∀m,n. m + ⫯n = ⫯m + n.
40 lemma yplus_SO2: ∀m. m + 1 = ⫯m.
44 (* Basic properties *********************************************************)
46 lemma yplus_inj: ∀n,m. yinj m + yinj n = yinj (m + n).
47 #n elim n -n [ normalize // ]
48 #n #IHn #m >(yplus_succ2 ? n) >IHn -IHn
52 lemma yplus_Y1: ∀m. ∞ + m = ∞.
56 lemma yplus_comm: commutative … yplus.
57 * [ #m ] * [1,3: #n ] //
58 normalize >ysucc_iter_Y //
61 lemma yplus_assoc: associative … yplus.
62 #x #y * // #z cases y -y
63 [ #y >yplus_inj whd in ⊢ (??%%); <iter_plus //
68 lemma yplus_O_sn: ∀n:ynat. 0 + n = n.
69 #n >yplus_comm // qed.
71 (* Basic inversion lemmas ***************************************************)
73 lemma yplus_inv_inj: ∀z,y,x. x + y = yinj z →
74 ∃∃m,n. m + n = z & x = yinj m & y = yinj n.
75 #z * [2: normalize #x #H destruct ]
76 #y * [2: >yplus_Y1 #H destruct ]
77 /3 width=5 by yinj_inj, ex3_2_intro/
80 (* Properties on order ******************************************************)
82 lemma yle_plus_dx2: ∀n,m. n ≤ m + n.
85 #n #IHn #m >(yplus_succ2 ? n) @(yle_succ n) // (**) (* full auto fails *)
88 lemma yle_plus_dx1: ∀n,m. m ≤ m + n.
91 (* Forward lemmas on order **************************************************)
93 lemma yle_fwd_plus_sn2: ∀x,y,z. x + y ≤ z → y ≤ z.
94 /2 width=3 by yle_trans/ qed-.
96 lemma yle_fwd_plus_sn1: ∀x,y,z. x + y ≤ z → x ≤ z.
97 /2 width=3 by yle_trans/ qed-.