From 636c25914e83819c2f529edc891a7eb899499a97 Mon Sep 17 00:00:00 2001 From: Ferruccio Guidi Date: Thu, 10 May 2012 10:58:45 +0000 Subject: [PATCH] - lib: some additions - lambda_delta: more properties on native type assignment change of notation for consand append --- .../apps_2/functional/rtm_step.ma | 4 +- .../contribs/lambda_delta/basic_2/basic_1.txt | 4 - .../basic_2/computation/acp_aaa.ma | 4 +- .../basic_2/computation/acp_cr.ma | 10 +- .../basic_2/computation/cprs_delift.ma | 30 +++ .../basic_2/computation/csn_tstc_vector.ma | 2 +- .../basic_2/computation/csn_vector.ma | 2 +- .../lambda_delta/basic_2/dynamic/nta_alt.ma | 190 ++++++++++++++++++ .../basic_2/dynamic/nta_delift.ma | 84 ++++++++ .../lambda_delta/basic_2/dynamic/nta_lift.ma | 124 ++++-------- .../lambda_delta/basic_2/dynamic/nta_nta.ma | 59 ++++++ .../lambda_delta/basic_2/equivalence/cpcs.ma | 3 + .../basic_2/equivalence/cpcs_delift.ma | 32 +++ .../lambda_delta/basic_2/grammar/cl_weight.ma | 2 +- .../contribs/lambda_delta/basic_2/notation.ma | 4 + .../basic_2/reducibility/cpr_cpr.ma | 2 +- .../basic_2/reducibility/cpr_delift.ma | 37 ++++ .../basic_2/reducibility/tpr_delift.ma | 27 +++ .../basic_2/reducibility/tpr_tpss.ma | 5 + .../basic_2/substitution/lift_vector.ma | 10 +- .../basic_2/substitution/tps_lift.ma | 19 +- .../lambda_delta/basic_2/unfold/delift.ma | 4 +- .../lambda_delta/basic_2/unfold/delift_alt.ma | 6 +- .../basic_2/unfold/delift_delift.ma | 2 +- .../basic_2/unfold/delift_lift.ma | 6 +- .../basic_2/unfold/delift_ltpss.ma | 2 +- .../basic_2/unfold/delift_tpss.ma | 38 +++- .../lambda_delta/basic_2/unfold/gr2.ma | 12 +- .../lambda_delta/basic_2/unfold/gr2_minus.ma | 18 +- .../lambda_delta/basic_2/unfold/gr2_plus.ma | 6 +- .../lambda_delta/basic_2/unfold/ldrops.ma | 6 +- .../basic_2/unfold/ldrops_ldrops.ma | 2 +- .../lambda_delta/basic_2/unfold/lifts.ma | 6 +- .../basic_2/unfold/lifts_lifts.ma | 2 +- .../basic_2/unfold/lifts_vector.ma | 2 +- .../lambda_delta/basic_2/unfold/thin.ma | 4 +- .../basic_2/unfold/thin_delift.ma | 58 +++++- .../lambda_delta/basic_2/unfold/thin_ldrop.ma | 2 +- .../lambda_delta/basic_2/unfold/tpss_lift.ma | 25 ++- .../contribs/lambda_delta/ground_2/list.ma | 2 +- .../lambda_delta/ground_2/notation.ma | 6 +- matita/matita/lib/arithmetics/nat.ma | 4 + matita/matita/lib/basics/star.ma | 26 ++- 43 files changed, 721 insertions(+), 172 deletions(-) create mode 100644 matita/matita/contribs/lambda_delta/basic_2/computation/cprs_delift.ma create mode 100644 matita/matita/contribs/lambda_delta/basic_2/dynamic/nta_alt.ma create mode 100644 matita/matita/contribs/lambda_delta/basic_2/dynamic/nta_delift.ma create mode 100644 matita/matita/contribs/lambda_delta/basic_2/dynamic/nta_nta.ma create mode 100644 matita/matita/contribs/lambda_delta/basic_2/equivalence/cpcs_delift.ma create mode 100644 matita/matita/contribs/lambda_delta/basic_2/reducibility/cpr_delift.ma create mode 100644 matita/matita/contribs/lambda_delta/basic_2/reducibility/tpr_delift.ma diff --git a/matita/matita/contribs/lambda_delta/apps_2/functional/rtm_step.ma b/matita/matita/contribs/lambda_delta/apps_2/functional/rtm_step.ma index f67d9dc1f..9a04c8070 100644 --- a/matita/matita/contribs/lambda_delta/apps_2/functional/rtm_step.ma +++ b/matita/matita/contribs/lambda_delta/apps_2/functional/rtm_step.ma @@ -41,9 +41,9 @@ inductive rtm_step: relation rtm ≝ (mk_rtm G u E S T) | rtm_appl : ∀G,u,E,S,V,T. rtm_step (mk_rtm G u E S (ⓐV. T)) - (mk_rtm G u E ({E, V} :: S) T) + (mk_rtm G u E ({E, V} @ S) T) | rtm_beta : ∀G,u,E,F,V,S,W,T. - rtm_step (mk_rtm G u E ({F, V} :: S) (ⓛW. T)) + rtm_step (mk_rtm G u E ({F, V} @ S) (ⓛW. T)) (mk_rtm G u (E. ④{Abbr} {u, F, V}) S T) | rtm_push : ∀G,u,E,W,T. rtm_step (mk_rtm G u E ⟠ (ⓛW. T)) diff --git a/matita/matita/contribs/lambda_delta/basic_2/basic_1.txt b/matita/matita/contribs/lambda_delta/basic_2/basic_1.txt index 1b6aaa13f..0c6fcb34a 100644 --- a/matita/matita/contribs/lambda_delta/basic_2/basic_1.txt +++ b/matita/matita/contribs/lambda_delta/basic_2/basic_1.txt @@ -180,7 +180,6 @@ pc3/props pc3_pr2_pr2_t pc3/props pc3_pr2_pr3_t pc3/props pc3_pr3_pc3_t pc3/props pc3_eta -pc3/subst1 pc3_gen_cabbr pc3/wcpr0 pc3_wcpr0__pc3_wcpr0_t_aux pc3/wcpr0 pc3_wcpr0_t pc3/wcpr0 pc3_wcpr0 @@ -198,11 +197,9 @@ pr1/props pr1_head_2 pr1/props pr1_comp pr1/props pr1_eta pr2/fwd pr2_gen_void -pr2/subst1 pr2_gen_cabbr pr3/fwd pr3_gen_void pr3/pr1 pr3_pr1 pr3/props pr3_eta -pr3/subst1 pr3_gen_cabbr sn3/props sns3_lifts sty1/cnt sty1_cnt sty1/props sty1_trans @@ -260,7 +257,6 @@ ty3/pr3_props ty3_tred ty3/pr3_props ty3_sconv_pc3 ty3/pr3_props ty3_sred_back ty3/pr3_props ty3_sconv -ty3/props ty3_unique ty3/props ty3_gen_abst_abst ty3/sty0 ty3_sty0 ty3/subst1 ty3_gen_cabbr diff --git a/matita/matita/contribs/lambda_delta/basic_2/computation/acp_aaa.ma b/matita/matita/contribs/lambda_delta/basic_2/computation/acp_aaa.ma index 190a595cf..788c39902 100644 --- a/matita/matita/contribs/lambda_delta/basic_2/computation/acp_aaa.ma +++ b/matita/matita/contribs/lambda_delta/basic_2/computation/acp_aaa.ma @@ -73,8 +73,8 @@ theorem aacr_aaa_csubc_lifts: ∀RR,RS,RP. #L3 #V3 #T3 #des3 #HL32 #HT03 #HB elim (lifts_total des3 W0) #W2 #HW02 elim (ldrops_lsubc_trans … H1RP H2RP … HL32 … HL02) -L2 #L2 #HL32 #HL20 - lapply (aaa_lifts … L2 W2 … (des @ des3) … HLWB) -HLWB /2 width=3/ #HLW2B - @(IHA (L2. ⓛW2) … (des + 1 @ des3 + 1)) -IHA + lapply (aaa_lifts … L2 W2 … (des @@ des3) … HLWB) -HLWB /2 width=3/ #HLW2B + @(IHA (L2. ⓛW2) … (des + 1 @@ des3 + 1)) -IHA /2 width=3/ /3 width=5/ ] | #L #V #T #B #A #_ #_ #IHB #IHA #L0 #des #HL0 #X #H #L2 #HL20 diff --git a/matita/matita/contribs/lambda_delta/basic_2/computation/acp_cr.ma b/matita/matita/contribs/lambda_delta/basic_2/computation/acp_cr.ma index c300d19de..222f00da8 100644 --- a/matita/matita/contribs/lambda_delta/basic_2/computation/acp_cr.ma +++ b/matita/matita/contribs/lambda_delta/basic_2/computation/acp_cr.ma @@ -119,12 +119,12 @@ lemma aacr_acr: ∀RR,RS,RP. acp RR RS RP → acr RR RS RP (λL,T. RP L T) → | #L #Vs #HVs #T #H1T #H2T #L0 #V0 #X #des #HB #HL0 #H elim (lifts_inv_applv1 … H) -H #V0s #T0 #HV0s #HT0 #H destruct lapply (s1 … IHB … HB) #HV0 - @(s2 … IHA … (V0 :: V0s)) /2 width=4 by lifts_simple_dx/ /3 width=6/ + @(s2 … IHA … (V0 @ V0s)) /2 width=4 by lifts_simple_dx/ /3 width=6/ | #L #Vs #U #T #W #HA #HW #L0 #V0 #X #des #HB #HL0 #H elim (lifts_inv_applv1 … H) -H #V0s #Y #HV0s #HY #H destruct elim (lifts_inv_flat1 … HY) -HY #U0 #X #HU0 #HX #H destruct elim (lifts_inv_bind1 … HX) -HX #W0 #T0 #HW0 #HT0 #H destruct - @(s3 … IHA … (V0 :: V0s)) /2 width=6 by rp_lifts/ /4 width=5/ + @(s3 … IHA … (V0 @ V0s)) /2 width=6 by rp_lifts/ /4 width=5/ | #L #K #Vs #V1 #V2 #i #HA #HV12 #HLK #L0 #V0 #X #des #HB #HL0 #H elim (lifts_inv_applv1 … H) -H #V0s #Y #HV0s #HY #H destruct elim (lifts_inv_lref1 … HY) -HY #i0 #Hi0 #H destruct @@ -134,13 +134,13 @@ lemma aacr_acr: ∀RR,RS,RP. acp RR RS RP → acr RR RS RP (λL,T. RP L T) → elim (lift_total W1 0 (i0 + 1)) #W2 #HW12 elim (lifts_lift_trans … Hdes0 … HVW1 … HW12) // -Hdes0 -Hi0 #V3 #HV13 #HVW2 >(lift_mono … HV13 … HV12) in HVW2; -V3 #HVW2 - @(s4 … IHA … (V0 :: V0s) … HW12 HL02) /3 width=4/ + @(s4 … IHA … (V0 @ V0s) … HW12 HL02) /3 width=4/ | #L #V1s #V2s #HV12s #V #T #HA #HV #L0 #V10 #X #des #HB #HL0 #H elim (lifts_inv_applv1 … H) -H #V10s #Y #HV10s #HY #H destruct elim (lifts_inv_bind1 … HY) -HY #V0 #T0 #HV0 #HT0 #H destruct elim (lift_total V10 0 1) #V20 #HV120 elim (liftv_total 0 1 V10s) #V20s #HV120s - @(s5 … IHA … (V10 :: V10s) (V20 :: V20s)) /2 width=1/ /2 width=6 by rp_lifts/ + @(s5 … IHA … (V10 @ V10s) (V20 @ V20s)) /2 width=1/ /2 width=6 by rp_lifts/ @(HA … (des + 1)) /2 width=1/ [ @(s7 … IHB … HB … HV120) /2 width=1/ | @lifts_applv // @@ -150,7 +150,7 @@ lemma aacr_acr: ∀RR,RS,RP. acp RR RS RP → acr RR RS RP (λL,T. RP L T) → | #L #Vs #T #W #HA #HW #L0 #V0 #X #des #HB #HL0 #H elim (lifts_inv_applv1 … H) -H #V0s #Y #HV0s #HY #H destruct elim (lifts_inv_flat1 … HY) -HY #W0 #T0 #HW0 #HT0 #H destruct - @(s6 … IHA … (V0 :: V0s)) /2 width=6 by rp_lifts/ /3 width=4/ + @(s6 … IHA … (V0 @ V0s)) /2 width=6 by rp_lifts/ /3 width=4/ | /3 width=7/ ] qed. diff --git a/matita/matita/contribs/lambda_delta/basic_2/computation/cprs_delift.ma b/matita/matita/contribs/lambda_delta/basic_2/computation/cprs_delift.ma new file mode 100644 index 000000000..65488a734 --- /dev/null +++ b/matita/matita/contribs/lambda_delta/basic_2/computation/cprs_delift.ma @@ -0,0 +1,30 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reducibility/cpr_delift.ma". +include "basic_2/computation/cprs.ma". + +(* CONTEXT-SENSITIVE PARALLEL COMPUTATION ON TERMS **************************) + +(* Properties on inverse basic term relocation ******************************) + +(* Basic_1: was only: pr3_gen_cabbr *) +lemma thin_cprs_delift_conf: ∀L,U1,U2. L ⊢ U1 ➡* U2 → + ∀K,d,e. L [d, e] ≡ K → ∀T1. L ⊢ U1 [d, e] ≡ T1 → + ∃∃T2. K ⊢ T1 ➡* T2 & L ⊢ U2 [d, e] ≡ T2. +#L #U1 #U2 #H @(cprs_ind … H) -U2 /2 width=3/ +#U #U2 #_ #HU2 #IHU1 #K #d #e #HLK #T1 #HTU1 +elim (IHU1 … HLK … HTU1) -U1 #T #HT1 #HUT +elim (thin_cpr_delift_conf … HU2 … HLK … HUT) -U -HLK /3 width=3/ +qed. diff --git a/matita/matita/contribs/lambda_delta/basic_2/computation/csn_tstc_vector.ma b/matita/matita/contribs/lambda_delta/basic_2/computation/csn_tstc_vector.ma index 3aa7170f5..e1a641505 100644 --- a/matita/matita/contribs/lambda_delta/basic_2/computation/csn_tstc_vector.ma +++ b/matita/matita/contribs/lambda_delta/basic_2/computation/csn_tstc_vector.ma @@ -81,7 +81,7 @@ lapply (csn_appl_theta … HW12 … H) -H -HW12 #H lapply (csn_fwd_pair_sn … H) #HW1 lapply (csn_fwd_flat_dx … H) #H1 @csn_appl_simple_tstc // -HW1 /2 width=3/ -IHV12s -HV -H1 #X #H1 #H2 -elim (cprs_fwd_theta_vector … (V2::V2s) … H1) -H1 /2 width=1/ -HV12s -HV12 +elim (cprs_fwd_theta_vector … (V2@V2s) … H1) -H1 /2 width=1/ -HV12s -HV12 [ -H #H elim (H2 ?) -H2 // | -H2 #H1 @(csn_cprs_trans … H) -H /2 width=1/ ] diff --git a/matita/matita/contribs/lambda_delta/basic_2/computation/csn_vector.ma b/matita/matita/contribs/lambda_delta/basic_2/computation/csn_vector.ma index a8663d8ba..92aae5465 100644 --- a/matita/matita/contribs/lambda_delta/basic_2/computation/csn_vector.ma +++ b/matita/matita/contribs/lambda_delta/basic_2/computation/csn_vector.ma @@ -26,5 +26,5 @@ interpretation (* Basic inversion lemmas ***************************************************) -lemma csnv_inv_cons: ∀L,T,Ts. L ⊢ ⬇* T :: Ts → L ⊢ ⬇* T ∧ L ⊢ ⬇* Ts. +lemma csnv_inv_cons: ∀L,T,Ts. L ⊢ ⬇* T @ Ts → L ⊢ ⬇* T ∧ L ⊢ ⬇* Ts. normalize // qed-. diff --git a/matita/matita/contribs/lambda_delta/basic_2/dynamic/nta_alt.ma b/matita/matita/contribs/lambda_delta/basic_2/dynamic/nta_alt.ma new file mode 100644 index 000000000..9c1567460 --- /dev/null +++ b/matita/matita/contribs/lambda_delta/basic_2/dynamic/nta_alt.ma @@ -0,0 +1,190 @@ +(**************************************************************************) +(* ___ *) +(* ||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/equivalence/cpcs_cpcs.ma". +include "basic_2/dynamic/nta.ma". + +(* NATIVE TYPE ASSIGNMENT ON TERMS ******************************************) + +(* alternative definition of nta *) +inductive ntaa (h:sh): lenv → relation term ≝ +| ntaa_sort: ∀L,k. ntaa h L (⋆k) (⋆(next h k)) +| ntaa_ldef: ∀L,K,V,W,U,i. ⇩[0, i] L ≡ K. ⓓV → ntaa h K V W → + ⇧[0, i + 1] W ≡ U → ntaa h L (#i) U +| ntaa_ldec: ∀L,K,W,V,U,i. ⇩[0, i] L ≡ K. ⓛW → ntaa h K W V → + ⇧[0, i + 1] W ≡ U → ntaa h L (#i) U +| ntaa_bind: ∀I,L,V,W,T,U. ntaa h L V W → ntaa h (L. ⓑ{I} V) T U → + ntaa h L (ⓑ{I}V.T) (ⓑ{I}V.U) +| ntaa_appl: ∀L,V,W,T,U. ntaa h L V W → ntaa h L (ⓛW.T) (ⓛW.U) → + ntaa h L (ⓐV.ⓛW.T) (ⓐV.ⓛW.U) +| ntaa_pure: ∀L,V,W,T,U. ntaa h L T U → ntaa h L (ⓐV.U) W → + ntaa h L (ⓐV.T) (ⓐV.U) +| ntaa_cast: ∀L,T,U,W. ntaa h L T U → ntaa h L U W → ntaa h L (ⓣU. T) U +| ntaa_conv: ∀L,T,U1,U2,V2. ntaa h L T U1 → L ⊢ U1 ⬌* U2 → ntaa h L U2 V2 → + ntaa h L T U2 +. + +interpretation "native type assignment (term) alternative" + 'NativeTypeAlt h L T U = (ntaa h L T U). + +(* Advanced inversion lemmas ************************************************) + +fact ntaa_inv_bind1_aux: ∀h,L,T,U. ⦃h, L⦄ ⊢ T :: U → ∀J,X,Y. T = ⓑ{J}Y.X → + ∃∃Z1,Z2. ⦃h, L⦄ ⊢ Y :: Z1 & ⦃h, L.ⓑ{J}Y⦄ ⊢ X :: Z2 & + L ⊢ ⓑ{J}Y.Z2 ⬌* U. +#h #L #T #U #H elim H -L -T -U +[ #L #k #J #X #Y #H destruct +| #L #K #V #W #U #i #_ #_ #_ #_ #J #X #Y #H destruct +| #L #K #W #V #U #i #_ #_ #_ #_ #J #X #Y #H destruct +| #I #L #V #W #T #U #HVW #HTU #_ #_ #J #X #Y #H destruct /2 width=3/ +| #L #V #W #T #U #_ #_ #_ #_ #J #X #Y #H destruct +| #L #V #W #T #U #_ #_ #_ #_ #J #X #Y #H destruct +| #L #T #U #W #_ #_ #_ #_ #J #X #Y #H destruct +| #L #T #U1 #U2 #V2 #_ #HU12 #_ #IHTU1 #_ #J #X #Y #H destruct + elim (IHTU1 ????) -IHTU1 [5: // |2,3,4: skip ] #Z1 #Z2 #HZ1 #HZ2 #HU1 + lapply (cpcs_trans … HU1 … HU12) -U1 /2 width=3/ +] +qed. + +lemma ntaa_inv_bind1: ∀h,J,L,Y,X,U. ⦃h, L⦄ ⊢ ⓑ{J}Y.X :: U → + ∃∃Z1,Z2. ⦃h, L⦄ ⊢ Y :: Z1 & ⦃h, L.ⓑ{J}Y⦄ ⊢ X :: Z2 & + L ⊢ ⓑ{J}Y.Z2 ⬌* U. +/2 width=3/ qed-. + +lemma ntaa_nta: ∀h,L,T,U. ⦃h, L⦄ ⊢ T :: U → ⦃h, L⦄ ⊢ T : U. +#h #L #T #U #H elim H -L -T -U +// /2 width=1/ /2 width=2/ /2 width=3/ /2 width=6/ +qed-. + +(* Properties on relocation *************************************************) + +lemma ntaa_lift: ∀h,L1,T1,U1. ⦃h, L1⦄ ⊢ T1 :: U1 → ∀L2,d,e. ⇩[d, e] L2 ≡ L1 → + ∀T2. ⇧[d, e] T1 ≡ T2 → ∀U2. ⇧[d, e] U1 ≡ U2 → ⦃h, L2⦄ ⊢ T2 :: U2. +#h #L1 #T1 #U1 #H elim H -L1 -T1 -U1 +[ #L1 #k #L2 #d #e #HL21 #X1 #H1 #X2 #H2 + >(lift_inv_sort1 … H1) -X1 + >(lift_inv_sort1 … H2) -X2 // +| #L1 #K1 #V1 #W1 #W #i #HLK1 #_ #HW1 #IHVW1 #L2 #d #e #HL21 #X #H #U2 #HWU2 + elim (lift_inv_lref1 … H) * #Hid #H destruct + [ elim (lift_trans_ge … HW1 … HWU2 ?) -W // #W2 #HW12 #HWU2 + elim (ldrop_trans_le … HL21 … HLK1 ?) -L1 /2 width=2/ #X #HLK2 #H + elim (ldrop_inv_skip2 … H ?) -H /2 width=1/ -Hid #K2 #V2 #HK21 #HV12 #H destruct + /3 width=8/ + | lapply (lift_trans_be … HW1 … HWU2 ? ?) -W // /2 width=1/ #HW1U2 + lapply (ldrop_trans_ge … HL21 … HLK1 ?) -L1 // -Hid /3 width=8/ + ] +| #L1 #K1 #W1 #V1 #W #i #HLK1 #_ #HW1 #IHWV1 #L2 #d #e #HL21 #X #H #U2 #HWU2 + elim (lift_inv_lref1 … H) * #Hid #H destruct + [ elim (lift_trans_ge … HW1 … HWU2 ?) -W // (delift_inv_sort1 … H) -X /2 width=5/ +| #L1 #K1 #V1 #W1 #U1 #i #HLK1 #_ #HWU1 #IHVW1 #L2 #d #e #HL12 #X #H +(* + elim (delift_inv_lref1 … H) -H * + [ #Hid #H destruct + elim (thin_ldrop_conf_le … HL12 … HLK1 ?) -HL12 /2 width=2/ #X #H #HLK2 + lapply (ldrop_fwd_ldrop2 … HLK1) -HLK1 #HLK1 + elim (thin_inv_delift1 … H ?) -H /2 width=1/ #K2 #V2 #HK12 #HV12 #H destruct + elim (IHVW1 … HK12 … HV12) -IHVW1 -HK12 -HV12 #W2 #HVW2 #HW12 + elim (lift_total W2 0 (i+1)) #U2 #HWU2 + @(ex2_1_intro … U2) + [ /2 width=6/ + | -HVW2 -HLK2 + ] + | + | + ] +*) +| +| +| +| #L1 #V1 #W1 #T1 #U1 #_ #_ #IHTU1 #IHVW1 #L2 #d #e #HL12 #X #H + elim (delift_inv_flat1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct +(* + elim (IHTU1 … HL12 … HT12) -T1 #U2 #HTU2 #HU12 + elim (IHVW1 … HL12 (ⓐV2.U2) ?) -IHVW1 -HL12 + [ /3 width=5/ | /2 width=1/ ] +*) +| #L1 #T1 #X1 #Y1 #_ #_ #IHTX1 #IHXY1 #L2 #d #e #HL12 #X #H + elim (delift_inv_flat1 … H) -H #X2 #T2 #HX12 #HT12 #H destruct + elim (IHTX1 … HL12 … HT12) -T1 #U1 #U2 #HTU2 #HU12 #HUX1 + elim (IHXY1 … HL12 … HX12) -IHXY1 #W1 #W2 #HXW2 #_ #_ -Y1 -W1 + lapply (thin_cpcs_delift_mono … HUX1 … HL12 … HU12 … HX12) -HL12 -HX12 /4 width=5/ +| #L1 #T1 #X11 #X12 #V1 #_ #HX112 #_ #IHT1 #_ #L2 #d #e #HL12 #T2 #HT12 + elim (IHT1 … HL12 … HT12) -T1 -HL12 #U21 #U22 #HTU22 #HU212 #HUX211 + lapply (cpcs_trans … HUX211 … HX112) -X11 /2 width=5/ +] +*) +lemma nta_inv_lift1_delift: ∀h,L1,T1,X. ⦃h, L1⦄ ⊢ T1 : X → + ∀L2,d,e. ⇩[d, e] L1 ≡ L2 → ∀T2. ⇧[d, e] T2 ≡ T1 → + ∃∃U1,U2. ⦃h, L2⦄ ⊢ T2 : U2 & L1 ⊢ U1 [d, e] ≡ U2 & + L1 ⊢ U1 ⬌* X. +/3 width=3/ qed-. + +lemma nta_inv_lift1: ∀h,L1,T1,X. ⦃h, L1⦄ ⊢ T1 : X → + ∀L2,d,e. ⇩[d, e] L1 ≡ L2 → ∀T2. ⇧[d, e] T2 ≡ T1 → + ∃∃U1,U2. ⦃h, L2⦄ ⊢ T2 : U2 & ⇧[d, e] U2 ≡ U1 & + L1 ⊢ U1 ⬌* X. +#h #L1 #T1 #X #H #L2 #d #e #HL12 #T2 #HT21 +elim (nta_inv_lift1_delift … H … HL12 … HT21) -T1 -HL12 #U1 #U2 #HTU2 * #U #HU1 #HU2 #HU1X +lapply (cpcs_cpr_conf … U … HU1X) -HU1X /2 width=3/ -U1 /2 width=5/ +qed-. diff --git a/matita/matita/contribs/lambda_delta/basic_2/dynamic/nta_lift.ma b/matita/matita/contribs/lambda_delta/basic_2/dynamic/nta_lift.ma index 1bdb9b1ac..294c1710e 100644 --- a/matita/matita/contribs/lambda_delta/basic_2/dynamic/nta_lift.ma +++ b/matita/matita/contribs/lambda_delta/basic_2/dynamic/nta_lift.ma @@ -12,8 +12,7 @@ (* *) (**************************************************************************) -include "basic_2/equivalence/cpcs_cpcs.ma". -include "basic_2/dynamic/nta.ma". +include "basic_2/dynamic/nta_alt.ma". (* NATIVE TYPE ASSIGNMENT ON TERMS ******************************************) @@ -70,28 +69,13 @@ lemma nta_inv_lref1: ∀h,L,U,i. ⦃h, L⦄ ⊢ #i : U → ). /2 width=3/ qed-. -fact nta_inv_bind1_aux: ∀h,L,T,U. ⦃h, L⦄ ⊢ T : U → ∀J,X,Y. T = ⓑ{J}Y.X → - ∃∃Z1,Z2. ⦃h, L⦄ ⊢ Y : Z1 & ⦃h, L.ⓑ{J}Y⦄ ⊢ X : Z2 & - L ⊢ ⓑ{J}Y.Z2 ⬌* U. -#h #L #T #U #H elim H -L -T -U -[ #L #k #J #X #Y #H destruct -| #L #K #V #W #U #i #_ #_ #_ #_ #J #X #Y #H destruct -| #L #K #W #V #U #i #_ #_ #_ #_ #J #X #Y #H destruct -| #I #L #V #W #T #U #HVW #HTU #_ #_ #J #X #Y #H destruct /2 width=3/ -| #L #V #W #T #U #_ #_ #_ #_ #J #X #Y #H destruct -| #L #V #W #T #U #_ #_ #_ #_ #J #X #Y #H destruct -| #L #T #U #_ #_ #J #X #Y #H destruct -| #L #T #U1 #U2 #V2 #_ #HU12 #_ #IHTU1 #_ #J #X #Y #H destruct - elim (IHTU1 ????) -IHTU1 [5: // |2,3,4: skip ] #Z1 #Z2 #HZ1 #HZ2 #HU1 - lapply (cpcs_trans … HU1 … HU12) -U1 /2 width=3/ -] -qed. - (* Basic_1: was: ty3_gen_bind *) -lemma nta_inv_bind1: ∀h,J,L,Y,X,U. ⦃h, L⦄ ⊢ ⓑ{J}Y.X : U → - ∃∃Z1,Z2. ⦃h, L⦄ ⊢ Y : Z1 & ⦃h, L.ⓑ{J}Y⦄ ⊢ X : Z2 & - L ⊢ ⓑ{J}Y.Z2 ⬌* U. -/2 width=3/ qed-. +lemma nta_inv_bind1: ∀h,I,L,Y,X,U. ⦃h, L⦄ ⊢ ⓑ{I}Y.X : U → + ∃∃Z1,Z2. ⦃h, L⦄ ⊢ Y : Z1 & ⦃h, L.ⓑ{I}Y⦄ ⊢ X : Z2 & + L ⊢ ⓑ{I}Y.Z2 ⬌* U. +#h #I #L #Y #X #U #H +elim (ntaa_inv_bind1 … (nta_ntaa … H)) -H /3 width=3 by ntaa_nta, ex3_2_intro/ +qed-. fact nta_inv_cast1_aux: ∀h,L,T,U. ⦃h, L⦄ ⊢ T : U → ∀X,Y. T = ⓣY.X → ⦃h, L⦄ ⊢ X : Y ∧ L ⊢ Y ⬌* U. @@ -113,80 +97,33 @@ qed. lemma nta_inv_cast1: ∀h,L,X,Y,U. ⦃h, L⦄ ⊢ ⓣY.X : U → ⦃h, L⦄ ⊢ X : Y ∧ L ⊢ Y ⬌* U. /2 width=3/ qed-. -(* Properties on relocation *************************************************) +(* Advanced forvard lemmas **************************************************) -(* Basic_1: was: ty3_lift *) -lemma nta_lift: ∀h,L1,T1,U1. ⦃h, L1⦄ ⊢ T1 : U1 → ∀L2,d,e. ⇩[d, e] L2 ≡ L1 → - ∀T2. ⇧[d, e] T1 ≡ T2 → ∀U2. ⇧[d, e] U1 ≡ U2 → ⦃h, L2⦄ ⊢ T2 : U2. -#h #L1 #T1 #U1 #H elim H -L1 -T1 -U1 -[ #L1 #k #L2 #d #e #HL21 #X1 #H1 #X2 #H2 - >(lift_inv_sort1 … H1) -X1 - >(lift_inv_sort1 … H2) -X2 // -| #L1 #K1 #V1 #W1 #W #i #HLK1 #_ #HW1 #IHVW1 #L2 #d #e #HL21 #X #H #U2 #HWU2 - elim (lift_inv_lref1 … H) * #Hid #H destruct - [ elim (lift_trans_ge … HW1 … HWU2 ?) -W // #W2 #HW12 #HWU2 - elim (ldrop_trans_le … HL21 … HLK1 ?) -L1 /2 width=2/ #X #HLK2 #H - elim (ldrop_inv_skip2 … H ?) -H /2 width=1/ -Hid #K2 #V2 #HK21 #HV12 #H destruct - /3 width=8/ - | lapply (lift_trans_be … HW1 … HWU2 ? ?) -W // /2 width=1/ #HW1U2 - lapply (ldrop_trans_ge … HL21 … HLK1 ?) -L1 // -Hid /3 width=8/ - ] -| #L1 #K1 #W1 #V1 #W #i #HLK1 #_ #HW1 #IHWV1 #L2 #d #e #HL21 #X #H #U2 #HWU2 - elim (lift_inv_lref1 … H) * #Hid #H destruct - [ elim (lift_trans_ge … HW1 … HWU2 ?) -W // (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. +lemma tps_inv_lift1_ge_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 // [ >commutative_plus /2 width=1/ ] -Hddt -Hdtde #HU1 @@ -281,3 +281,14 @@ lemma tps_inv_lift1_be_up: ∀L,U1,U2,dt,et. L ⊢ U1 [dt, et] ▶ U2 → lapply (tps_weak … HU12 dt (d + e - dt) ? ?) -HU12 // /2 width=3/ -Hdetde #HU12 elim (tps_inv_lift1_be … HU12 … HLK … HTU1 ? ?) -U1 -L // /2 width=3/ qed. + +lemma tps_inv_lift1_le_up: ∀L,U1,U2,dt,et. L ⊢ U1 [dt, et] ▶ U2 → + ∀K,d,e. ⇩[d, e] L ≡ K → ∀T1. ⇧[d, e] T1 ≡ U1 → + dt ≤ d → d ≤ dt + et → dt + et ≤ d + e → + ∃∃T2. K ⊢ T1 [dt, d - dt] ▶ T2 & ⇧[d, e] T2 ≡ U2. +#L #U1 #U2 #dt #et #HU12 #K #d #e #HLK #T1 #HTU1 #Hdtd #Hddet #Hdetde +elim (tps_split_up … HU12 d ? ?) -HU12 // #U #HU1 #HU2 +elim (tps_inv_lift1_le … HU1 … HLK … HTU1 ?) -U1 [2: >commutative_plus /2 width=1/ ] -Hdtd #T #HT1 #HTU +lapply (tps_weak … HU2 d e ? ?) -HU2 // [ >commutative_plus minus_plus