]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/multiple/mr2_plus.ma
455b669bef01513895a68259af88405cec4e98b4
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / multiple / mr2_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_plus.ma".
16 include "basic_2/multiple/mr2.ma".
17
18 (* MULTIPLE RELOCATION WITH PAIRS *******************************************)
19
20 let rec pluss (cs:list2 ynat nat) (i:nat) on cs ≝ match cs with
21 [ nil2          ⇒ ◊
22 | cons2 l m cs ⇒ {l + i, m} @ pluss cs i
23 ].
24
25 interpretation "plus (multiple relocation with pairs)"
26    'plus x y = (pluss x y).
27
28 (* Basic properties *********************************************************)
29
30 lemma pluss_SO2: ∀l,m,cs. ({l, m} @ cs) + 1 = {⫯l, m} @ cs + 1.
31 // qed.
32
33 (* Basic inversion lemmas ***************************************************)
34
35 lemma pluss_inv_nil2: ∀i,cs. cs + i = ◊ → cs = ◊.
36 #i * // normalize
37 #l #m #cs #H destruct
38 qed.
39
40 lemma pluss_inv_cons2: ∀i,l,m,cs2,cs. cs + i = {l, m} @ cs2 →
41                        ∃∃cs1. cs1 + i = cs2 & cs = {l - i, m} @ cs1.
42 #i #l #m #cs2 *
43 [ normalize #H destruct
44 | #l1 #m1 #cs1 whd in ⊢ (??%?→?); #H destruct
45   >yplus_minus_inj /2 width=3 by ex2_intro/
46 ]
47 qed-.