]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground/relocation/fr2_plus.ma
update in delayed_updating
[helm.git] / matita / matita / contribs / lambdadelta / ground / relocation / fr2_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/fr2_map.ma".
17
18 (* ADDITION FOR FINITE RELOCATION MAPS WITH PAIRS ***************************)
19
20 (* Note: this is pushs *)
21 (*** pluss *)
22 rec definition fr2_plus (f:fr2_map) (n:nat) on f ≝ match f with
23 [ fr2_empty       ⇒ 𝐞
24 | fr2_lcons d h f ⇒ ❨d+n,h❩◗fr2_plus f n
25 ].
26
27 interpretation
28   "plus (finite relocation maps with pairs)"
29   'plus f n = (fr2_plus f n).
30
31 (* Basic constructions ******************************************************)
32
33 (*** pluss_SO2 *)
34 lemma fr2_plus_lcons_unit (d) (h) (f):
35       ((❨d,h❩◗f)+𝟏) = ❨↑d,h❩◗f+𝟏.
36 normalize // qed.
37
38 (* Basic inversions *********************************************************)
39
40 (*** pluss_inv_nil2 *)
41 lemma fr2_plus_inv_empty_dx (n) (f):
42       f+n = 𝐞 → f = 𝐞.
43 #n * // normalize
44 #d #h #f #H destruct
45 qed.
46
47 (*** pluss_inv_cons2 *)
48 lemma fr2_plus_inv_lcons_dx (n) (d) (h) (f2) (f):
49       f + n = ❨d,h❩◗f2 →
50       ∃∃f1. f1+n = f2 & f = ❨d-n,h❩◗f1.
51 #n #d #h #f2 *
52 [ normalize #H destruct
53 | #d1 #h1 #f1 whd in ⊢ (??%?→?); #H destruct
54   <nminus_plus_sn_refl_sn /2 width=3 by ex2_intro/
55 ]
56 qed-.