]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/static/da_lift.ma
c0f13ceb7915242096dce554a6e5aaac0af76fd3
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / static / da_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/ldrop_ldrop.ma".
16 include "basic_2/static/da.ma".
17
18 (* DEGREE ASSIGNMENT FOR TERMS **********************************************)
19
20 (* Properties on relocation *************************************************)
21
22 lemma da_lift: ∀h,g,G,L1,T1,l. ⦃G, L1⦄ ⊢ T1 ▪[h, g] l →
23                ∀L2,d,e. ⇩[d, e] L2 ≡ L1 → ∀T2. ⇧[d, e] T1 ≡ T2 →
24                ⦃G, L2⦄ ⊢ T2 ▪[h, g] l.
25 #h #g #G #L1 #T1 #l #H elim H -G -L1 -T1 -l
26 [ #G #L1 #k #l #Hkl #L2 #d #e #_ #X #H
27   >(lift_inv_sort1 … H) -X /2 width=1/
28 | #G #L1 #K1 #V1 #i #l #HLK1 #_ #IHV1 #L2 #d #e #HL21 #X #H
29   elim (lift_inv_lref1 … H) * #Hid #H destruct
30   [ elim (ldrop_trans_le … HL21 … HLK1) -L1 /2 width=2/ #X #HLK2 #H
31     elim (ldrop_inv_skip2 … H) -H /2 width=1/ -Hid #K2 #V2 #HK21 #HV12 #H destruct
32     /3 width=7/
33   | lapply (ldrop_trans_ge … HL21 … HLK1 ?) -L1 // -Hid /3 width=7/
34   ]
35 | #G #L1 #K1 #W1 #i #l #HLK1 #_ #IHW1 #L2 #d #e #HL21 #X #H
36   elim (lift_inv_lref1 … H) * #Hid #H destruct
37   [ elim (ldrop_trans_le … HL21 … HLK1) -L1 /2 width=2/ #X #HLK2 #H
38     elim (ldrop_inv_skip2 … H) -H /2 width=1/ -Hid #K2 #W2 #HK21 #HW12 #H destruct
39     /3 width=7/
40   | lapply (ldrop_trans_ge … HL21 … HLK1 ?) -L1 // -Hid /3 width=7/
41   ]
42 | #a #I #G #L1 #V1 #T1 #l #_ #IHT1 #L2 #d #e #HL21 #X #H
43   elim (lift_inv_bind1 … H) -H #V2 #T2 #HV12 #HU12 #H destruct /4 width=4/
44 | #I #G #L1 #V1 #T1 #l #_ #IHT1 #L2 #d #e #HL21 #X #H
45   elim (lift_inv_flat1 … H) -H #V2 #T2 #HV12 #HU12 #H destruct /3 width=4/
46 ]
47 qed.
48
49 (* Inversion lemmas on relocation *******************************************)
50
51 lemma da_inv_lift: ∀h,g,G,L2,T2,l. ⦃G, L2⦄ ⊢ T2 ▪[h, g] l →
52                    ∀L1,d,e. ⇩[d, e] L2 ≡ L1 → ∀T1. ⇧[d, e] T1 ≡ T2 →
53                    ⦃G, L1⦄ ⊢ T1 ▪[h, g] l.
54 #h #g #G #L2 #T2 #l #H elim H -G -L2 -T2 -l
55 [ #G #L2 #k #l #Hkl #L1 #d #e #_ #X #H
56   >(lift_inv_sort2 … H) -X /2 width=1/
57 | #G #L2 #K2 #V2 #i #l #HLK2 #HV2 #IHV2 #L1 #d #e #HL21 #X #H
58   elim (lift_inv_lref2 … H) * #Hid #H destruct [ -HV2 | -IHV2 ]
59   [ elim (ldrop_conf_lt … HL21 … HLK2) -L2 // /3 width=7/
60   | lapply (ldrop_conf_ge … HL21 … HLK2 ?) -L2 // /2 width=4/
61   ]
62 | #G #L2 #K2 #W2 #i #l #HLK2 #HW2 #IHW2 #L1 #d #e #HL21 #X #H
63   elim (lift_inv_lref2 … H) * #Hid #H destruct [ -HW2 | -IHW2 ]
64   [ elim (ldrop_conf_lt … HL21 … HLK2) -L2 // /3 width=7/
65   | lapply (ldrop_conf_ge … HL21 … HLK2 ?) -L2 // /2 width=4/
66   ]
67 | #a #I #G #L2 #V2 #T2 #l #_ #IHT2 #L1 #d #e #HL21 #X #H
68   elim (lift_inv_bind2 … H) -H #V1 #T1 #HV12 #HT12 #H destruct /4 width=4/
69 | #I #G #L2 #V2 #T2 #l #_ #IHT2 #L1 #d #e #HL21 #X #H
70   elim (lift_inv_flat2 … H) -H #V1 #T1 #HV12 #HT12 #H destruct /3 width=4/
71 ]
72 qed-.