X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fmatita%2Fcontribs%2Flambdadelta%2Fbasic_2%2Frt_transition%2Fcpr.ma;h=978c42b7cb91d2920a50002bb23b9941f32a75a6;hb=bd53c4e895203eb049e75434f638f26b5a161a2b;hp=d5374513aa6a6d8aff14b368ba9fe7cd1e9c17a2;hpb=e9f96fa56226dfd74de214c89d827de0c5018ac7;p=helm.git diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpr.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpr.ma index d5374513a..978c42b7c 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpr.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpr.ma @@ -12,297 +12,135 @@ (* *) (**************************************************************************) -include "basic_2/notation/relations/pred_4.ma". -include "basic_2/static/lsubr.ma". -include "basic_2/unfold/lstas.ma". +include "ground_2/xoa/ex_6_6.ma". +include "ground_2/xoa/ex_7_7.ma". +include "ground_2/xoa/or_4.ma". +include "ground_2/insert_eq/insert_eq_0.ma". +include "basic_2/rt_transition/cpm.ma". -(* CONTEXT-SENSITIVE PARALLEL REDUCTION FOR TERMS ***************************) - -(* activate genv *) -(* Basic_1: includes: pr0_delta1 pr2_delta1 pr2_thin_dx *) -(* Note: cpr_flat: does not hold in basic_1 *) -inductive cpr: relation4 genv lenv term term ≝ -| cpr_atom : ∀I,G,L. cpr G L (⓪{I}) (⓪{I}) -| cpr_delta: ∀G,L,K,V,V2,W2,i. - ⬇[i] L ≡ K. ⓓV → cpr G K V V2 → - ⬆[0, i + 1] V2 ≡ W2 → cpr G L (#i) W2 -| cpr_bind : ∀a,I,G,L,V1,V2,T1,T2. - cpr G L V1 V2 → cpr G (L.ⓑ{I}V1) T1 T2 → - cpr G L (ⓑ{a,I}V1.T1) (ⓑ{a,I}V2.T2) -| cpr_flat : ∀I,G,L,V1,V2,T1,T2. - cpr G L V1 V2 → cpr G L T1 T2 → - cpr G L (ⓕ{I}V1.T1) (ⓕ{I}V2.T2) -| cpr_zeta : ∀G,L,V,T1,T,T2. cpr G (L.ⓓV) T1 T → - ⬆[0, 1] T2 ≡ T → cpr G L (+ⓓV.T1) T2 -| cpr_eps : ∀G,L,V,T1,T2. cpr G L T1 T2 → cpr G L (ⓝV.T1) T2 -| cpr_beta : ∀a,G,L,V1,V2,W1,W2,T1,T2. - cpr G L V1 V2 → cpr G L W1 W2 → cpr G (L.ⓛW1) T1 T2 → - cpr G L (ⓐV1.ⓛ{a}W1.T1) (ⓓ{a}ⓝW2.V2.T2) -| cpr_theta: ∀a,G,L,V1,V,V2,W1,W2,T1,T2. - cpr G L V1 V → ⬆[0, 1] V ≡ V2 → cpr G L W1 W2 → cpr G (L.ⓓW1) T1 T2 → - cpr G L (ⓐV1.ⓓ{a}W1.T1) (ⓓ{a}W2.ⓐV2.T2) -. - -interpretation "context-sensitive parallel reduction (term)" - 'PRed G L T1 T2 = (cpr G L T1 T2). +(* CONTEXT-SENSITIVE PARALLEL R-TRANSITION FOR TERMS ************************) (* Basic properties *********************************************************) -lemma lsubr_cpr_trans: ∀G. lsub_trans … (cpr G) lsubr. -#G #L1 #T1 #T2 #H elim H -G -L1 -T1 -T2 -[ // -| #G #L1 #K1 #V1 #V2 #W2 #i #HLK1 #_ #HVW2 #IHV12 #L2 #HL12 - elim (lsubr_fwd_drop2_abbr … HL12 … HLK1) -L1 * - /3 width=6 by cpr_delta/ -|3,7: /4 width=1 by lsubr_pair, cpr_bind, cpr_beta/ -|4,6: /3 width=1 by cpr_flat, cpr_eps/ -|5,8: /4 width=3 by lsubr_pair, cpr_zeta, cpr_theta/ -] -qed-. - -(* Basic_1: was by definition: pr2_free *) -lemma tpr_cpr: ∀G,T1,T2. ⦃G, ⋆⦄ ⊢ T1 ➡ T2 → ∀L. ⦃G, L⦄ ⊢ T1 ➡ T2. -#G #T1 #T2 #HT12 #L -lapply (lsubr_cpr_trans … HT12 L ?) // -qed. - -(* Basic_1: includes by definition: pr0_refl *) -lemma cpr_refl: ∀G,T,L. ⦃G, L⦄ ⊢ T ➡ T. -#G #T elim T -T // * /2 width=1 by cpr_bind, cpr_flat/ +(* Note: cpr_flat: does not hold in basic_1 *) +(* Basic_1: includes: pr2_thin_dx *) +lemma cpr_flat: ∀h,I,G,L,V1,V2,T1,T2. + ❪G,L❫ ⊢ V1 ➡[h] V2 → ❪G,L❫ ⊢ T1 ➡[h] T2 → + ❪G,L❫ ⊢ ⓕ[I]V1.T1 ➡[h] ⓕ[I]V2.T2. +#h * /2 width=1 by cpm_cast, cpm_appl/ qed. (* Basic_1: was: pr2_head_1 *) -lemma cpr_pair_sn: ∀I,G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ➡ V2 → - ∀T. ⦃G, L⦄ ⊢ ②{I}V1.T ➡ ②{I}V2.T. -* /2 width=1 by cpr_bind, cpr_flat/ qed. - -lemma cpr_delift: ∀G,K,V,T1,L,l. ⬇[l] L ≡ (K.ⓓV) → - ∃∃T2,T. ⦃G, L⦄ ⊢ T1 ➡ T2 & ⬆[l, 1] T ≡ T2. -#G #K #V #T1 elim T1 -T1 -[ * /2 width=4 by cpr_atom, lift_sort, lift_gref, ex2_2_intro/ - #i #L #l #HLK elim (lt_or_eq_or_gt i l) - #Hil [1,3: /4 width=4 by lift_lref_ge_minus, lift_lref_lt, ylt_inj, yle_inj, ex2_2_intro/ ] - destruct - elim (lift_total V 0 (i+1)) #W #HVW - elim (lift_split … HVW i i) /3 width=6 by cpr_delta, ex2_2_intro/ -| * [ #a ] #I #W1 #U1 #IHW1 #IHU1 #L #l #HLK - elim (IHW1 … HLK) -IHW1 #W2 #W #HW12 #HW2 - [ elim (IHU1 (L. ⓑ{I}W1) (l+1)) -IHU1 /3 width=9 by drop_drop, cpr_bind, lift_bind, ex2_2_intro/ - | elim (IHU1 … HLK) -IHU1 -HLK /3 width=8 by cpr_flat, lift_flat, ex2_2_intro/ - ] -] -qed-. - -fact lstas_cpr_aux: ∀h,G,L,T1,T2,d. ⦃G, L⦄ ⊢ T1 •*[h, d] T2 → - d = 0 → ⦃G, L⦄ ⊢ T1 ➡ T2. -#h #G #L #T1 #T2 #d #H elim H -G -L -T1 -T2 -d -/3 width=1 by cpr_eps, cpr_flat, cpr_bind/ -[ #G #L #K #V1 #V2 #W2 #i #d #HLK #_ #HVW2 #IHV12 #H destruct - /3 width=6 by cpr_delta/ -| #G #L #K #V1 #V2 #W2 #i #d #_ #_ #_ #_