X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fmatita%2Fcontribs%2Flambda-delta%2FBasic-2%2Fsubstitution%2Ftps_lift.ma;fp=matita%2Fmatita%2Fcontribs%2Flambda-delta%2FBasic-2%2Fsubstitution%2Ftps_lift.ma;h=1f8d7a88c0d6e8bb94289881cb4bcc71e54321c5;hb=e4f11cddf44dd9bba21f689d4f56e2d00d8d7bb5;hp=0000000000000000000000000000000000000000;hpb=fefe8d334012230f8e8b9d90976d9411a58d4ba8;p=helm.git diff --git a/matita/matita/contribs/lambda-delta/Basic-2/substitution/tps_lift.ma b/matita/matita/contribs/lambda-delta/Basic-2/substitution/tps_lift.ma new file mode 100644 index 000000000..1f8d7a88c --- /dev/null +++ b/matita/matita/contribs/lambda-delta/Basic-2/substitution/tps_lift.ma @@ -0,0 +1,173 @@ +(* + ||M|| This file is part of HELM, an Hypertextual, Electronic + ||A|| Library of Mathematics, developed at the Computer Science + ||T|| Department of the University of Bologna, Italy. + ||I|| + ||T|| + ||A|| This file is distributed under the terms of the + \ / GNU General Public License Version 2 + \ / + V_______________________________________________________________ *) + +include "lambda-delta/substitution/drop_drop.ma". +include "lambda-delta/substitution/tps.ma". + +(* PARTIAL SUBSTITUTION ON TERMS ********************************************) + +(* Relocation properties ****************************************************) + +lemma tps_lift_le: ∀K,T1,T2,dt,et. K ⊢ T1 [dt, et] ≫ T2 → + ∀L,U1,U2,d,e. ↓[d, e] L ≡ K → + ↑[d, e] T1 ≡ U1 → ↑[d, e] T2 ≡ U2 → + dt + et ≤ d → + L ⊢ U1 [dt, et] ≫ U2. +#K #T1 #T2 #dt #et #H elim H -H K T1 T2 dt et +[ #K #k #dt #et #L #U1 #U2 #d #e #_ #H1 #H2 #_ + lapply (lift_mono … H1 … H2) -H1 H2 #H destruct -U1 // +| #K #i #dt #et #L #U1 #U2 #d #e #_ #H1 #H2 #_ + lapply (lift_mono … H1 … H2) -H1 H2 #H destruct -U1 // +| #K #KV #V #V1 #V2 #i #dt #et #Hdti #Hidet #HKV #_ #HV12 #IHV12 #L #U1 #U2 #d #e #HLK #H #HVU2 #Hdetd + lapply (lt_to_le_to_lt … Hidet … Hdetd) #Hid + lapply (lift_inv_lref1_lt … H … Hid) -H #H destruct -U1; + elim (lift_trans_ge … HV12 … HVU2 ?) -HV12 HVU2 V2 // plus_plus_comm_23 #HV1U2 + lapply (drop_trans_ge_comm … HLK … HKV ?) -HLK HKV K // -Hid #HLKV + @tps_subst [4,5: /2/ |6,7,8: // |1,2,3: skip ] (**) (* /3 width=8/ is too slow *) +| #K #I #V1 #V2 #T1 #T2 #dt #et #_ #_ #IHV12 #IHT12 #L #U1 #U2 #d #e #HLK #H1 #H2 #Hddt + elim (lift_inv_bind1 … H1) -H1 #VV1 #TT1 #HVV1 #HTT1 #H1 + elim (lift_inv_bind1 … H2) -H2 #VV2 #TT2 #HVV2 #HTT2 #H2 destruct -U1 U2; + @tps_bind [ /2 width=5/ | /3 width=5/ ] (**) (* explicit constructor *) +| #K #I #V1 #V2 #T1 #T2 #dt #et #_ #_ #IHV12 #IHT12 #L #U1 #U2 #d #e #HLK #H1 #H2 #Hddt + elim (lift_inv_flat1 … H1) -H1 #VV1 #TT1 #HVV1 #HTT1 #H1 + elim (lift_inv_flat1 … H2) -H2 #VV2 #TT2 #HVV2 #HTT2 #H2 destruct -U1 U2; + /3 width=5/ +] +qed. + +lemma tps_inv_lift1_le: ∀L,U1,U2,dt,et. L ⊢ U1 [dt, et] ≫ U2 → + ∀K,d,e. ↓[d, e] L ≡ K → ∀T1. ↑[d, e] T1 ≡ U1 → + dt + et ≤ d → + ∃∃T2. K ⊢ T1 [dt, et] ≫ T2 & ↑[d, e] T2 ≡ U2. +#L #U1 #U2 #dt #et #H elim H -H L U1 U2 dt et +[ #L #k #dt #et #K #d #e #_ #T1 #H #_ + lapply (lift_inv_sort2 … H) -H #H destruct -T1 /2/ +| #L #i #dt #et #K #d #e #_ #T1 #H #_ + elim (lift_inv_lref2 … H) -H * #Hid #H destruct -T1 /3/ +| #L #KV #V #V1 #V2 #i #dt #et #Hdti #Hidet #HLKV #_ #HV12 #IHV12 #K #d #e #HLK #T1 #H #Hdetd + lapply (lt_to_le_to_lt … Hidet … Hdetd) #Hid + lapply (lift_inv_lref2_lt … H … Hid) -H #H destruct -T1; + elim (drop_conf_lt … HLK … HLKV ?) -HLK HLKV L // #L #W #HKL #HKVL #HWV + elim (IHV12 … HKVL … HWV ?) -HKVL HWV /2/ -Hdetd #W1 #HW1 #HWV1 + elim (lift_trans_le … HWV1 … HV12 ?) -HWV1 HV12 V1 // >arith_a2 /3 width=6/ +| #L #I #V1 #V2 #U1 #U2 #dt #et #_ #_ #IHV12 #IHU12 #K #d #e #HLK #X #H #Hdetd + elim (lift_inv_bind2 … H) -H #W1 #T1 #HWV1 #HTU1 #H destruct -X; + elim (IHV12 … HLK … HWV1 ?) -IHV12 // + elim (IHU12 … HTU1 ?) -IHU12 HTU1 [3: /2/ |4: @drop_skip // |2: skip ] -HLK HWV1 Hdetd /3 width=5/ (**) (* just /3 width=5/ is too slow *) +| #L #I #V1 #V2 #U1 #U2 #dt #et #_ #_ #IHV12 #IHU12 #K #d #e #HLK #X #H #Hdetd + elim (lift_inv_flat2 … H) -H #W1 #T1 #HWV1 #HTU1 #H destruct -X; + elim (IHV12 … HLK … HWV1 ?) -IHV12 HWV1 // + elim (IHU12 … HLK … HTU1 ?) -IHU12 HLK HTU1 // /3 width=5/ +] +qed. + +lemma tps_inv_lift1_ge: ∀L,U1,U2,dt,et. L ⊢ U1 [dt, et] ≫ U2 → + ∀K,d,e. ↓[d, e] L ≡ K → ∀T1. ↑[d, e] T1 ≡ U1 → + d + e ≤ dt → + ∃∃T2. K ⊢ T1 [dt - e, et] ≫ T2 & ↑[d, e] T2 ≡ U2. +#L #U1 #U2 #dt #et #H elim H -H L U1 U2 dt et +[ #L #k #dt #et #K #d #e #_ #T1 #H #_ + lapply (lift_inv_sort2 … H) -H #H destruct -T1 /2/ +| #L #i #dt #et #K #d #e #_ #T1 #H #_ + elim (lift_inv_lref2 … H) -H * #Hid #H destruct -T1 /3/ +| #L #KV #V #V1 #V2 #i #dt #et #Hdti #Hidet #HLKV #HV1 #HV12 #_ #K #d #e #HLK #T1 #H #Hdedt + lapply (transitive_le … Hdedt … Hdti) #Hdei + lapply (plus_le_weak … Hdedt) -Hdedt #Hedt + lapply (plus_le_weak … Hdei) #Hei + <(arith_h1 ? ? ? e ? ?) in HV1 // #HV1 + lapply (lift_inv_lref2_ge … H … Hdei) -H #H destruct -T1; + lapply (drop_conf_ge … HLK … HLKV ?) -HLK HLKV L // #HKV + elim (lift_split … HV12 d (i - e + 1) ? ? ?) -HV12; [2,3,4: normalize /2/ ] -Hdei >arith_e2 // #V0 #HV10 #HV02 + @ex2_1_intro + [2: @tps_subst [4: /2/ |6,7,8: // |1,2,3: skip |5: @arith5 // ] + |1: skip + | // + ] (**) (* explicitc constructors *) +| #L #I #V1 #V2 #U1 #U2 #dt #et #_ #_ #IHV12 #IHU12 #K #d #e #HLK #X #H #Hdetd + elim (lift_inv_bind2 … H) -H #W1 #T1 #HWV1 #HTU1 #H destruct -X; + lapply (plus_le_weak … Hdetd) #Hedt + elim (IHV12 … HLK … HWV1 ?) -IHV12 // #W2 #HW12 #HWV2 + elim (IHU12 … HTU1 ?) -IHU12 HTU1 [4: @drop_skip // |2: skip |3: /2/ ] + IHV12 // >IHT12 // +| #L #I #V1 #V2 #T1 #T2 #d #e #_ #_ #IHV12 #IHT12 #X #HX + elim (lift_inv_flat2 … HX) -HX #V #T #HV1 #HT1 #H destruct -X + >IHV12 // >IHT12 // +] +qed. +(* + Theorem subst0_gen_lift_ge : (u,t1,x:?; i,h,d:?) (subst0 i u (lift h d t1) x) -> + (le (plus d h) i) -> + (EX t2 | x = (lift h d t2) & (subst0 (minus i h) u t1 t2)). + + Theorem subst0_gen_lift_rev_ge: (t1,v,u2:?; i,h,d:?) + (subst0 i v t1 (lift h d u2)) -> + (le (plus d h) i) -> + (EX u1 | (subst0 (minus i h) v u1 u2) & + t1 = (lift h d u1) + ). + + + Theorem subst0_gen_lift_rev_lelt: (t1,v,u2:?; i,h,d:?) + (subst0 i v t1 (lift h d u2)) -> + (le d i) -> (lt i (plus d h)) -> + (EX u1 | t1 = (lift (minus (plus d h) (S i)) (S i) u1)). +*)