1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "basic_2/substitution/drop_drop.ma".
16 include "basic_2/static/da.ma".
18 (* DEGREE ASSIGNMENT FOR TERMS **********************************************)
20 (* Properties on relocation *************************************************)
22 lemma da_lift: ∀h,o,G,L1,T1,d. ⦃G, L1⦄ ⊢ T1 ▪[h, o] d →
23 ∀L2,c,l,k. ⬇[c, l, k] L2 ≡ L1 → ∀T2. ⬆[l, k] T1 ≡ T2 →
24 ⦃G, L2⦄ ⊢ T2 ▪[h, o] d.
25 #h #o #G #L1 #T1 #d #H elim H -G -L1 -T1 -d
26 [ #G #L1 #s #d #Hkd #L2 #c #l #k #_ #X #H
27 >(lift_inv_sort1 … H) -X /2 width=1 by da_sort/
28 | #G #L1 #K1 #V1 #i #d #HLK1 #_ #IHV1 #L2 #c #l #k #HL21 #X #H
29 elim (lift_inv_lref1 … H) * #Hil #H destruct
30 [ elim (drop_trans_le … HL21 … HLK1) -L1 /2 width=2 by ylt_fwd_le/ #X #HLK2 #H
31 elim (drop_inv_skip2 … H) -H /2 width=1 by ylt_to_minus/ -Hil #K2 #V2 #HK21 #HV12 #H destruct
32 /3 width=9 by da_ldef/
33 | lapply (drop_trans_ge … HL21 … HLK1 ?) -L1
34 /3 width=8 by da_ldef, drop_inv_gen/
36 | #G #L1 #K1 #W1 #i #d #HLK1 #_ #IHW1 #L2 #c #l #k #HL21 #X #H
37 elim (lift_inv_lref1 … H) * #Hil #H destruct
38 [ elim (drop_trans_le … HL21 … HLK1) -L1 /2 width=2 by ylt_fwd_le/ #X #HLK2 #H
39 elim (drop_inv_skip2 … H) -H /2 width=1 by ylt_to_minus/ -Hil #K2 #W2 #HK21 #HW12 #H destruct
40 /3 width=8 by da_ldec/
41 | lapply (drop_trans_ge … HL21 … HLK1 ?) -L1
42 /3 width=8 by da_ldec, drop_inv_gen/
44 | #a #I #G #L1 #V1 #T1 #d #_ #IHT1 #L2 #c #l #k #HL21 #X #H
45 elim (lift_inv_bind1 … H) -H #V2 #T2 #HV12 #HU12 #H destruct
46 /4 width=5 by da_bind, drop_skip/
47 | #I #G #L1 #V1 #T1 #d #_ #IHT1 #L2 #c #l #k #HL21 #X #H
48 elim (lift_inv_flat1 … H) -H #V2 #T2 #HV12 #HU12 #H destruct
49 /3 width=5 by da_flat/
53 (* Inversion lemmas on relocation *******************************************)
55 lemma da_inv_lift: ∀h,o,G,L2,T2,d. ⦃G, L2⦄ ⊢ T2 ▪[h, o] d →
56 ∀L1,c,l,k. ⬇[c, l, k] L2 ≡ L1 → ∀T1. ⬆[l, k] T1 ≡ T2 →
57 ⦃G, L1⦄ ⊢ T1 ▪[h, o] d.
58 #h #o #G #L2 #T2 #d #H elim H -G -L2 -T2 -d
59 [ #G #L2 #s #d #Hkd #L1 #c #l #k #_ #X #H
60 >(lift_inv_sort2 … H) -X /2 width=1 by da_sort/
61 | #G #L2 #K2 #V2 #i #d #HLK2 #HV2 #IHV2 #L1 #c #l #k #HL21 #X #H
62 elim (lift_inv_lref2 … H) * #Hil #H destruct [ -HV2 | -IHV2 ]
63 [ elim (drop_conf_lt … HL21 … HLK2) -L2 /3 width=8 by da_ldef/
64 | lapply (drop_conf_ge … HL21 … HLK2 ?) -L2 /2 width=4 by da_ldef/
66 | #G #L2 #K2 #W2 #i #d #HLK2 #HW2 #IHW2 #L1 #c #l #k #HL21 #X #H
67 elim (lift_inv_lref2 … H) * #Hil #H destruct [ -HW2 | -IHW2 ]
68 [ elim (drop_conf_lt … HL21 … HLK2) -L2 /3 width=8 by da_ldec/
69 | lapply (drop_conf_ge … HL21 … HLK2 ?) -L2 /2 width=4 by da_ldec/
71 | #a #I #G #L2 #V2 #T2 #d #_ #IHT2 #L1 #c #l #k #HL21 #X #H
72 elim (lift_inv_bind2 … H) -H #V1 #T1 #HV12 #HT12 #H destruct
73 /4 width=5 by da_bind, drop_skip/
74 | #I #G #L2 #V2 #T2 #d #_ #IHT2 #L1 #c #l #k #HL21 #X #H
75 elim (lift_inv_flat2 … H) -H #V1 #T1 #HV12 #HT12 #H destruct
76 /3 width=5 by da_flat/