]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/substitution/lifts_lift.ma
definition of equivalence for local environments,
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / substitution / lifts_lift.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/relocation/lift_lift.ma".
16 include "basic_2/substitution/gr2_minus.ma".
17 include "basic_2/substitution/lifts.ma".
18
19 (* GENERIC TERM RELOCATION **************************************************)
20
21 (* Properties concerning basic term relocation ******************************)
22
23 (* Basic_1: was: lift1_xhg (right to left) *)
24 lemma lifts_lift_trans_le: ∀T1,T,des. ⇧*[des] T1 ≡ T → ∀T2. ⇧[0, 1] T ≡ T2 →
25                            ∃∃T0. ⇧[0, 1] T1 ≡ T0 & ⇧*[des + 1] T0 ≡ T2.
26 #T1 #T #des #H elim H -T1 -T -des
27 [ /2 width=3/
28 | #T1 #T3 #T #des #d #e #HT13 #_ #IHT13 #T2 #HT2
29   elim (IHT13 … HT2) -T #T #HT3 #HT2
30   elim (lift_trans_le … HT13 … HT3) -T3 // /3 width=5/
31 ]
32 qed-.
33
34 (* Basic_1: was: lift1_free (right to left) *)
35 lemma lifts_lift_trans: ∀des,i,i0. @⦃i, des⦄ ≡ i0 →
36                         ∀des0. des + 1 ▭ i + 1 ≡ des0 + 1 →
37                         ∀T1,T0. ⇧*[des0] T1 ≡ T0 →
38                         ∀T2. ⇧[O, i0 + 1] T0 ≡ T2 →
39                         ∃∃T. ⇧[0, i + 1] T1 ≡ T & ⇧*[des] T ≡ T2.
40 #des elim des -des normalize
41 [ #i #x #H1 #des0 #H2 #T1 #T0 #HT10 #T2
42   <(at_inv_nil … H1) -x #HT02
43   lapply (minuss_inv_nil1 … H2) -H2 #H
44   >(pluss_inv_nil2 … H) in HT10; -des0 #H
45   >(lifts_inv_nil … H) -T1 /2 width=3/
46 | #d #e #des #IHdes #i #i0 #H1 #des0 #H2 #T1 #T0 #HT10 #T2 #HT02
47   elim (at_inv_cons … H1) -H1 * #Hid #Hi0
48   [ elim (minuss_inv_cons1_lt … H2) -H2 [2: /2 width=1/ ] #des1 #Hdes1 <minus_le_minus_minus_comm // <minus_plus_m_m #H
49     elim (pluss_inv_cons2 … H) -H #des2 #H1 #H2 destruct
50     elim (lifts_inv_cons … HT10) -HT10 #T >minus_plus #HT1 #HT0
51     elim (IHdes … Hi0 … Hdes1 … HT0 … HT02) -IHdes -Hi0 -Hdes1 -T0 #T0 #HT0 #HT02
52     elim (lift_trans_le … HT1 … HT0) -T /2 width=1/ #T #HT1 <plus_minus_m_m /2 width=1/ /3 width=5/
53   | >commutative_plus in Hi0; #Hi0
54     lapply (minuss_inv_cons1_ge … H2 ?) -H2 [ /2 width=1/ ] <associative_plus #Hdes0
55     elim (IHdes … Hi0 … Hdes0 … HT10 … HT02) -IHdes -Hi0 -Hdes0 -T0 #T0 #HT0 #HT02
56     elim (lift_split … HT0 d (i+1)) -HT0 /2 width=1/ /3 width=5/
57   ]
58 ]
59 qed-.