X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fmatita%2Fcontribs%2Flambda-delta%2FBasic-2%2Fsubstitution%2Ftps_lift.ma;h=c5fca2ca3ce404a45c1f6e2f17fce5fd1d30684b;hb=64306edf6d64730ab9aa6648ad11d9dfa68775d9;hp=06d1029459a04da70c1a5243a10d55a4582031f8;hpb=b24e4faf4501e54da29dc70940101eeb160e9c9f;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 index 06d102945..c5fca2ca3 100644 --- a/matita/matita/contribs/lambda-delta/Basic-2/substitution/tps_lift.ma +++ b/matita/matita/contribs/lambda-delta/Basic-2/substitution/tps_lift.ma @@ -1,38 +1,60 @@ -(* - ||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_______________________________________________________________ *) +(**************************************************************************) +(* ___ *) +(* ||M|| *) +(* ||A|| A project by Andrea Asperti *) +(* ||T|| *) +(* ||I|| Developers: *) +(* ||T|| The HELM team. *) +(* ||A|| http://helm.cs.unibo.it *) +(* \ / *) +(* \ / This file is distributed under the terms of the *) +(* v GNU General Public License Version 2 *) +(* *) +(**************************************************************************) include "Basic-2/substitution/drop_drop.ma". include "Basic-2/substitution/tps.ma". (* PARTIAL SUBSTITUTION ON TERMS ********************************************) +(* Advanced inversion lemmas ************************************************) + +fact tps_inv_refl_SO2_aux: ∀L,T1,T2,d,e. L ⊢ T1 [d, e] ≫ T2 → e = 1 → + ∀K,V. ↓[0, d] L ≡ K. 𝕓{Abst} V → T1 = T2. +#L #T1 #T2 #d #e #H elim H -H L T1 T2 d e +[ // +| #L #K0 #V0 #W #i #d #e #Hdi #Hide #HLK0 #_ #H destruct -e; + >(le_to_le_to_eq … Hdi ?) /2/ -d #K #V #HLK + lapply (drop_mono … HLK0 … HLK) #H destruct +| #L #I #V1 #V2 #T1 #T2 #d #e #_ #_ #IHV12 #IHT12 #H1 #K #V #HLK + >(IHV12 H1 … HLK) -IHV12 >(IHT12 H1 K V) -IHT12 /2/ +| #L #I #V1 #V2 #T1 #T2 #d #e #_ #_ #IHV12 #IHT12 #H1 #K #V #HLK + >(IHV12 H1 … HLK) -IHV12 >(IHT12 H1 … HLK) -IHT12 // +] +qed. + +lemma tps_inv_refl_SO2: ∀L,T1,T2,d. L ⊢ T1 [d, 1] ≫ T2 → + ∀K,V. ↓[0, d] L ≡ K. 𝕓{Abst} V → T1 = T2. +/2 width=8/ qed. + (* Relocation properties ****************************************************) +(* Basic-1: was: subst1_lift_lt *) 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 +[ #K #I #dt #et #L #U1 #U2 #d #e #_ #H1 #H2 #_ + >(lift_mono … H1 … H2) -H1 H2 // +| #K #KV #V #W #i #dt #et #Hdti #Hidet #HKV #HVW #L #U1 #U2 #d #e #HLK #H #HVU2 #Hdetd + lapply (lt_to_le_to_lt … Hidet … Hdetd) -Hdetd #Hid lapply (lift_inv_lref1_lt … H … Hid) -H #H destruct -U1; - elim (lift_trans_ge … HV12 … HVU2 ?) -HV12 HVU2 V2 // (lift_mono … HVY … HVW) -HVY HVW Y #H destruct -X /2/ | #K #I #V1 #V2 #T1 #T2 #dt #et #_ #_ #IHV12 #IHT12 #L #U1 #U2 #d #e #HLK #H1 #H2 #Hdetd 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; @@ -44,23 +66,20 @@ lemma tps_lift_le: ∀K,T1,T2,dt,et. K ⊢ T1 [dt, et] ≫ T2 → ] qed. +(* Basic-1: was: subst1_lift_ge *) lemma tps_lift_ge: ∀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 → d ≤ dt → L ⊢ U1 [dt + e, 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 #HV1 #HV12 #_ #L #U1 #U2 #d #e #HLK #H #HVU2 #Hddt - <(arith_c1x ? ? ? e) in HV1 #HV1 (**) (* explicit athmetical rewrite and ?'s *) +[ #K #I #dt #et #L #U1 #U2 #d #e #_ #H1 #H2 #_ + >(lift_mono … H1 … H2) -H1 H2 // +| #K #KV #V #W #i #dt #et #Hdti #Hidet #HKV #HVW #L #U1 #U2 #d #e #HLK #H #HWU2 #Hddt lapply (transitive_le … Hddt … Hdti) -Hddt #Hid lapply (lift_inv_lref1_ge … H … Hid) -H #H destruct -U1; - lapply (lift_trans_be … HV12 … HVU2 ? ?) -HV12 HVU2 V2 /2/ >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 *) + lapply (lift_trans_be … HVW … HWU2 ? ?) -HVW HWU2 W // [ /2/ ] >plus_plus_comm_23 #HVU2 + lapply (drop_trans_ge_comm … HLK … HKV ?) -HLK HKV K // -Hid /3/ | #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; @@ -72,25 +91,26 @@ lemma tps_lift_ge: ∀K,T1,T2,dt,et. K ⊢ T1 [dt, et] ≫ T2 → ] qed. +(* Basic-1: was: subst1_gen_lift_lt *) 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 +[ #L * #i #dt #et #K #d #e #_ #T1 #H #_ + [ lapply (lift_inv_sort2 … H) -H #H destruct -T1 /2/ + | elim (lift_inv_lref2 … H) -H * #Hid #H destruct -T1 /3/ + ] +| #L #KV #V #W #i #dt #et #Hdti #Hidet #HLKV #HVW #K #d #e #HLK #T1 #H #Hdetd + lapply (lt_to_le_to_lt … Hidet … Hdetd) -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/ + elim (drop_conf_lt … HLK … HLKV ?) -HLK HLKV L // #L #U #HKL #_ #HUV + elim (lift_trans_le … HUV … HVW ?) -HUV HVW V // >arith_a2 // -Hid /3/ | #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 *) + elim (IHV12 … HLK … HWV1 ?) -IHV12 HWV1 // #W2 #HW12 #HWV2 + elim (IHU12 … HTU1 ?) -IHU12 HTU1 [3: /2/ |4: @drop_skip // |2: skip ] -HLK Hdetd (**) (* /3 width=5/ is too slow *) + /3 width=5/ | #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 // @@ -98,32 +118,32 @@ lemma tps_inv_lift1_le: ∀L,U1,U2,dt,et. L ⊢ U1 [dt, et] ≫ U2 → ] qed. +(* Basic-1: was: subst1_gen_lift_ge *) 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 +[ #L * #i #dt #et #K #d #e #_ #T1 #H #_ + [ lapply (lift_inv_sort2 … H) -H #H destruct -T1 /2/ + | elim (lift_inv_lref2 … H) -H * #Hid #H destruct -T1 /3/ + ] +| #L #KV #V #W #i #dt #et #Hdti #Hidet #HLKV #HVW #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 (plus_le_weak … Hdei) #Hei 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 + elim (lift_split … HVW d (i - e + 1) ? ? ?) -HVW; [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 // ] + [2: @tps_subst [3: /2/ |5,6: // |1,2: skip |4: @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 (IHV12 … HLK … HWV1 ?) -IHV12 HWV1 // #W2 #HW12 #HWV2 elim (IHU12 … HTU1 ?) -IHU12 HTU1 [4: @drop_skip // |2: skip |3: /2/ ] - (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) -> @@ -171,3 +187,14 @@ qed. (le d i) -> (lt i (plus d h)) -> (EX u1 | t1 = (lift (minus (plus d h) (S i)) (S i) u1)). *) + +lemma tps_inv_lift1_up: ∀L,U1,U2,dt,et. L ⊢ U1 [dt, et] ≫ U2 → + ∀K,d,e. ↓[d, e] L ≡ K → ∀T1. ↑[d, e] T1 ≡ U1 → + d ≤ dt → dt ≤ d + e → d + e ≤ dt + et → + ∃∃T2. K ⊢ T1 [d, dt + et - (d + e)] ≫ T2 & ↑[d, e] T2 ≡ U2. +#L #U1 #U2 #dt #et #HU12 #K #d #e #HLK #T1 #HTU1 #Hddt #Hdtde #Hdedet +elim (tps_split_up … HU12 (d + e) ? ?) -HU12 // -Hdedet #U #HU1 #HU2 +lapply (tps_weak … HU1 d e ? ?) -HU1 //