]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/grammar/cl_shift.ma
theory of cpy is complete!
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / grammar / cl_shift.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 "basic_2/grammar/lenv_append.ma".
16
17 (* SHIFT OF A CLOSURE *******************************************************)
18
19 let rec shift L T on L ≝ match L with
20 [ LAtom       ⇒ T
21 | LPair L I V ⇒ shift L (-ⓑ{I} V. T)
22 ].
23
24 interpretation "shift (closure)" 'Append L T = (shift L T).
25
26 (* Basic properties *********************************************************)
27
28 lemma shift_append_assoc: ∀L,K. ∀T:term. (L @@ K) @@ T = L @@ K @@ T.
29 #L #K elim K -K // normalize //
30 qed.
31
32 (* Basic inversion lemmas ***************************************************)
33
34 lemma shift_inj: ∀L1,L2. ∀T1,T2:term. L1 @@ T1 = L2 @@ T2 → |L1| = |L2| →
35                  L1 = L2 ∧ T1 = T2.
36 #L1 elim L1 -L1
37 [ * normalize /2 width=1/
38   #L2 #I2 #V2 #T1 #T2 #_ <plus_n_Sm #H destruct
39 | #L1 #H1 #V1 #IH * normalize
40   [ #T1 #T2 #_ <plus_n_Sm #H destruct
41   | #L2 #I2 #V2 #T1 #T2 #H1 #H2
42     elim (IH … H1) -IH -H1 /2 width=1/ -H2 #H1 #H2 destruct /2 width=1/
43   ]
44 ]
45 qed-.