]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground/relocation/mr2_plus.ma
propagating the arithmetics library, partial commit
[helm.git] / matita / matita / contribs / lambdadelta / ground / relocation / 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/arith/nat_minus_plus.ma".
16 include "ground/relocation/mr2.ma".
17
18 (* MULTIPLE RELOCATION WITH PAIRS *******************************************)
19
20 rec definition pluss (cs:mr2) (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) + 𝟏) = ❨↑l,m❩;cs + 𝟏.
31 normalize // 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   <nminus_plus_sn_refl_sn /2 width=3 by ex2_intro/
46 ]
47 qed-.