From 00e35c087bc0279fdcee450ea874a46077c778aa Mon Sep 17 00:00:00 2001 From: Ferruccio Guidi Date: Mon, 2 Dec 2013 15:25:44 +0000 Subject: [PATCH] initial commit of the "rduction" component --- .../lambdadelta/basic_2/reduction/cpx.ma | 89 ++++++++++--------- .../reduction/{cpx_cpx.ma => cpx_lleq.ma} | 14 +-- .../lambdadelta/basic_2/reduction/lpx.ma | 8 +- .../reduction/{lpx_lpx.ma => lpx_lleq.ma} | 22 ++--- 4 files changed, 73 insertions(+), 60 deletions(-) rename matita/matita/contribs/lambdadelta/basic_2/reduction/{cpx_cpx.ma => cpx_lleq.ma} (85%) rename matita/matita/contribs/lambdadelta/basic_2/reduction/{lpx_lpx.ma => lpx_lleq.ma} (84%) diff --git a/matita/matita/contribs/lambdadelta/basic_2/reduction/cpx.ma b/matita/matita/contribs/lambdadelta/basic_2/reduction/cpx.ma index 194871b50..bc5044b6d 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/reduction/cpx.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/reduction/cpx.ma @@ -53,51 +53,54 @@ interpretation lemma lsubr_cpx_trans: ∀h,g,G. lsub_trans … (cpx h g G) lsubr. #h #g #G #L1 #T1 #T2 #H elim H -G -L1 -T1 -T2 [ // -| /2 width=2/ +| /2 width=2 by cpx_sort/ | #I #G #L1 #K1 #V1 #V2 #W2 #i #HLK1 #_ #HVW2 #IHV12 #L2 #HL12 elim (lsubr_fwd_ldrop2_bind … HL12 … HLK1) -HL12 -HLK1 * - [ /3 width=7/ | /4 width=7/ ] -|4,9: /4 width=1/ -|5,7,8: /3 width=1/ -|6,10: /4 width=3/ + /4 width=7 by cpx_delta, cpx_ti/ +|4,9: /4 width=1 by cpx_bind, cpx_beta, lsubr_bind/ +|5,7,8: /3 width=1 by cpx_flat, cpx_tau, cpx_ti/ +|6,10: /4 width=3 by cpx_zeta, cpx_theta, lsubr_bind/ ] qed-. (* Note: this is "∀h,g,L. reflexive … (cpx h g L)" *) lemma cpx_refl: ∀h,g,G,T,L. ⦃G, L⦄ ⊢ T ➡[h, g] T. -#h #g #G #T elim T -T // * /2 width=1/ +#h #g #G #T elim T -T // * /2 width=1 by cpx_bind, cpx_flat/ qed. lemma cpr_cpx: ∀h,g,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ➡ T2 → ⦃G, L⦄ ⊢ T1 ➡[h, g] T2. -#h #g #G #L #T1 #T2 #H elim H -L -T1 -T2 // /2 width=1/ /2 width=3/ /2 width=7/ +#h #g #G #L #T1 #T2 #H elim H -L -T1 -T2 +/2 width=7 by cpx_delta, cpx_bind, cpx_flat, cpx_zeta, cpx_tau, cpx_beta, cpx_theta/ qed. lemma cpx_pair_sn: ∀h,g,I,G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ➡[h, g] V2 → ∀T. ⦃G, L⦄ ⊢ ②{I}V1.T ➡[h, g] ②{I}V2.T. -#h #g * /2 width=1/ qed. +#h #g * /2 width=1 by cpx_bind, cpx_flat/ +qed. lemma cpx_delift: ∀h,g,I,G,K,V,T1,L,d. ⇩[0, d] L ≡ (K.ⓑ{I}V) → ∃∃T2,T. ⦃G, L⦄ ⊢ T1 ➡[h, g] T2 & ⇧[d, 1] T ≡ T2. #h #g #I #G #K #V #T1 elim T1 -T1 -[ * #i #L #d #HLK /2 width=4/ - elim (lt_or_eq_or_gt i d) #Hid [1,3: /3 width=4/ ] +[ * #i #L #d /2 width=4 by cpx_atom, lift_sort, lift_gref, ex2_2_intro/ + elim (lt_or_eq_or_gt i d) #Hid [1,3: /3 width=4 by cpx_atom, lift_lref_ge_minus, lift_lref_lt, ex2_2_intro/ ] destruct elim (lift_total V 0 (i+1)) #W #HVW - elim (lift_split … HVW i i) // /3 width=7/ + elim (lift_split … HVW i i) /3 width=7 by cpx_delta, ex2_2_intro/ | * [ #a ] #I #W1 #U1 #IHW1 #IHU1 #L #d #HLK elim (IHW1 … HLK) -IHW1 #W2 #W #HW12 #HW2 - [ elim (IHU1 (L. ⓑ{I} W1) (d+1)) -IHU1 /2 width=1/ -HLK /3 width=9/ - | elim (IHU1 … HLK) -IHU1 -HLK /3 width=8/ + [ elim (IHU1 (L. ⓑ{I} W1) (d+1)) -IHU1 /3 width=9 by cpx_bind, ldrop_ldrop, lift_bind, ex2_2_intro/ + | elim (IHU1 … HLK) -IHU1 -HLK /3 width=8 by cpx_flat, lift_flat, ex2_2_intro/ ] ] qed-. lemma cpx_append: ∀h,g,G. l_appendable_sn … (cpx h g G). -#h #g #G #K #T1 #T2 #H elim H -G -K -T1 -T2 // /2 width=1/ /2 width=3/ +#h #g #G #K #T1 #T2 #H elim H -G -K -T1 -T2 +/2 width=3 by cpx_sort, cpx_bind, cpx_flat, cpx_zeta, cpx_tau, cpx_ti, cpx_beta, cpx_theta/ #I #G #K #K0 #V1 #V2 #W2 #i #HK0 #_ #HVW2 #IHV12 #L lapply (ldrop_fwd_length_lt2 … HK0) #H -@(cpx_delta … I … (L@@K0) V1 … HVW2) // -@(ldrop_O1_append_sn_le … HK0) /2 width=2/ (**) (* /3/ does not work *) +@(cpx_delta … I … (L@@K0) V1 … HVW2) // +@(ldrop_O1_append_sn_le … HK0) /2 width=2 by lt_to_le/ (**) (* /3/ does not work *) qed. (* Basic inversion lemmas ***************************************************) @@ -108,9 +111,9 @@ fact cpx_inv_atom1_aux: ∀h,g,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ➡[h, g] T2 → ∀ | ∃∃I,K,V,V2,i. ⇩[O, i] L ≡ K.ⓑ{I}V & ⦃G, K⦄ ⊢ V ➡[h, g] V2 & ⇧[O, i + 1] V2 ≡ T2 & J = LRef i. #G #h #g #L #T1 #T2 * -L -T1 -T2 -[ #I #G #L #J #H destruct /2 width=1/ -| #G #L #k #l #Hkl #J #H destruct /3 width=5/ -| #I #G #L #K #V #V2 #T2 #i #HLK #HV2 #HVT2 #J #H destruct /3 width=9/ +[ #I #G #L #J #H destruct /2 width=1 by or3_intro0/ +| #G #L #k #l #Hkl #J #H destruct /3 width=5 by or3_intro1, ex3_2_intro/ +| #I #G #L #K #V #V2 #T2 #i #HLK #HV2 #HVT2 #J #H destruct /3 width=9 by or3_intro2, ex4_5_intro/ | #a #I #G #L #V1 #V2 #T1 #T2 #_ #_ #J #H destruct | #I #G #L #V1 #V2 #T1 #T2 #_ #_ #J #H destruct | #G #L #V #T1 #T #T2 #_ #_ #J #H destruct @@ -131,8 +134,8 @@ lemma cpx_inv_atom1: ∀h,g,J,G,L,T2. ⦃G, L⦄ ⊢ ⓪{J} ➡[h, g] T2 → lemma cpx_inv_sort1: ∀h,g,G,L,T2,k. ⦃G, L⦄ ⊢ ⋆k ➡[h, g] T2 → T2 = ⋆k ∨ ∃∃l. deg h g k (l+1) & T2 = ⋆(next h k). #h #g #G #L #T2 #k #H -elim (cpx_inv_atom1 … H) -H /2 width=1/ * -[ #k0 #l0 #Hkl0 #H1 #H2 destruct /3 width=4/ +elim (cpx_inv_atom1 … H) -H /2 width=1 by or_introl/ * +[ #k0 #l0 #Hkl0 #H1 #H2 destruct /3 width=4 by ex2_intro, or_intror/ | #I #K #V #V2 #i #_ #_ #_ #H destruct ] qed-. @@ -142,12 +145,18 @@ lemma cpx_inv_lref1: ∀h,g,G,L,T2,i. ⦃G, L⦄ ⊢ #i ➡[h, g] T2 → ∃∃I,K,V,V2. ⇩[O, i] L ≡ K. ⓑ{I}V & ⦃G, K⦄ ⊢ V ➡[h, g] V2 & ⇧[O, i + 1] V2 ≡ T2. #h #g #G #L #T2 #i #H -elim (cpx_inv_atom1 … H) -H /2 width=1/ * +elim (cpx_inv_atom1 … H) -H /2 width=1 by or_introl/ * [ #k #l #_ #_ #H destruct -| #I #K #V #V2 #j #HLK #HV2 #HVT2 #H destruct /3 width=7/ +| #I #K #V #V2 #j #HLK #HV2 #HVT2 #H destruct /3 width=7 by ex3_4_intro, or_intror/ ] qed-. +lemma cpx_inv_lref1_ge: ∀h,g,G,L,T2,i. ⦃G, L⦄ ⊢ #i ➡[h, g] T2 → |L| ≤ i → T2 = #i. +#h #g #G #L #T2 #i #H elim (cpx_inv_lref1 … H) -H // * +#I #K #V1 #V2 #HLK #_ #_ #HL -h -G -V2 lapply (ldrop_fwd_length_lt2 … HLK) -K -I -V1 +#H elim (lt_refl_false i) /2 width=3 by lt_to_le_to_lt/ +qed-. + lemma cpx_inv_gref1: ∀h,g,G,L,T2,p. ⦃G, L⦄ ⊢ §p ➡[h, g] T2 → T2 = §p. #h #g #G #L #T2 #p #H elim (cpx_inv_atom1 … H) -H // * @@ -167,9 +176,9 @@ fact cpx_inv_bind1_aux: ∀h,g,G,L,U1,U2. ⦃G, L⦄ ⊢ U1 ➡[h, g] U2 → [ #I #G #L #b #J #W #U1 #H destruct | #G #L #k #l #_ #b #J #W #U1 #H destruct | #I #G #L #K #V #V2 #W2 #i #_ #_ #_ #b #J #W #U1 #H destruct -| #a #I #G #L #V1 #V2 #T1 #T2 #HV12 #HT12 #b #J #W #U1 #H destruct /3 width=5/ +| #a #I #G #L #V1 #V2 #T1 #T2 #HV12 #HT12 #b #J #W #U1 #H destruct /3 width=5 by ex3_2_intro, or_introl/ | #I #G #L #V1 #V2 #T1 #T2 #_ #_ #b #J #W #U1 #H destruct -| #G #L #V #T1 #T #T2 #HT1 #HT2 #b #J #W #U1 #H destruct /3 width=3/ +| #G #L #V #T1 #T #T2 #HT1 #HT2 #b #J #W #U1 #H destruct /3 width=3 by ex4_intro, or_intror/ | #G #L #V #T1 #T2 #_ #b #J #W #U1 #H destruct | #G #L #V1 #V2 #T #_ #b #J #W #U1 #H destruct | #a #G #L #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #b #J #W #U1 #H destruct @@ -191,7 +200,7 @@ lemma cpx_inv_abbr1: ∀h,g,a,G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓓ{a}V1.T1 ➡[h, g] ) ∨ ∃∃T. ⦃G, L.ⓓV1⦄ ⊢ T1 ➡[h, g] T & ⇧[0, 1] U2 ≡ T & a = true. #h #g #a #G #L #V1 #T1 #U2 #H -elim (cpx_inv_bind1 … H) -H * /3 width=3/ /3 width=5/ +elim (cpx_inv_bind1 … H) -H * /3 width=5 by ex3_2_intro, ex3_intro, or_introl, or_intror/ qed-. lemma cpx_inv_abst1: ∀h,g,a,G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓛ{a}V1.T1 ➡[h, g] U2 → @@ -199,7 +208,7 @@ lemma cpx_inv_abst1: ∀h,g,a,G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓛ{a}V1.T1 ➡[h, g U2 = ⓛ{a} V2. T2. #h #g #a #G #L #V1 #T1 #U2 #H elim (cpx_inv_bind1 … H) -H * -[ /3 width=5/ +[ /3 width=5 by ex3_2_intro/ | #T #_ #_ #_ #H destruct ] qed-. @@ -223,12 +232,12 @@ fact cpx_inv_flat1_aux: ∀h,g,G,L,U,U2. ⦃G, L⦄ ⊢ U ➡[h, g] U2 → | #G #L #k #l #_ #J #W #U1 #H destruct | #I #G #L #K #V #V2 #W2 #i #_ #_ #_ #J #W #U1 #H destruct | #a #I #G #L #V1 #V2 #T1 #T2 #_ #_ #J #W #U1 #H destruct -| #I #G #L #V1 #V2 #T1 #T2 #HV12 #HT12 #J #W #U1 #H destruct /3 width=5/ +| #I #G #L #V1 #V2 #T1 #T2 #HV12 #HT12 #J #W #U1 #H destruct /3 width=5 by or5_intro0, ex3_2_intro/ | #G #L #V #T1 #T #T2 #_ #_ #J #W #U1 #H destruct -| #G #L #V #T1 #T2 #HT12 #J #W #U1 #H destruct /3 width=1/ -| #G #L #V1 #V2 #T #HV12 #J #W #U1 #H destruct /3 width=1/ -| #a #G #L #V1 #V2 #W1 #W2 #T1 #T2 #HV12 #HW12 #HT12 #J #W #U1 #H destruct /3 width=11/ -| #a #G #L #V1 #V #V2 #W1 #W2 #T1 #T2 #HV1 #HV2 #HW12 #HT12 #J #W #U1 #H destruct /3 width=13/ +| #G #L #V #T1 #T2 #HT12 #J #W #U1 #H destruct /3 width=1 by or5_intro1, conj/ +| #G #L #V1 #V2 #T #HV12 #J #W #U1 #H destruct /3 width=1 by or5_intro2, conj/ +| #a #G #L #V1 #V2 #W1 #W2 #T1 #T2 #HV12 #HW12 #HT12 #J #W #U1 #H destruct /3 width=11 by or5_intro3, ex6_6_intro/ +| #a #G #L #V1 #V #V2 #W1 #W2 #T1 #T2 #HV1 #HV2 #HW12 #HT12 #J #W #U1 #H destruct /3 width=13 by or5_intro4, ex7_7_intro/ ] qed-. @@ -257,10 +266,10 @@ lemma cpx_inv_appl1: ∀h,g,G,L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓐ V1.U1 ➡[h, g] U2 ⦃G, L⦄ ⊢ W1 ➡[h, g] W2 & ⦃G, L.ⓓW1⦄ ⊢ T1 ➡[h, g] T2 & U1 = ⓓ{a}W1.T1 & U2 = ⓓ{a}W2. ⓐV2. T2. #h #g #G #L #V1 #U1 #U2 #H elim (cpx_inv_flat1 … H) -H * -[ /3 width=5/ +[ /3 width=5 by or3_intro0, ex3_2_intro/ |2,3: #_ #H destruct -| /3 width=11/ -| /3 width=13/ +| /3 width=11 by or3_intro1, ex5_6_intro/ +| /3 width=13 by or3_intro2, ex6_7_intro/ ] qed-. @@ -270,7 +279,7 @@ lemma cpx_inv_appl1_simple: ∀h,g,G,L,V1,T1,U. ⦃G, L⦄ ⊢ ⓐV1.T1 ➡[h, g U = ⓐV2.T2. #h #g #G #L #V1 #T1 #U #H #HT1 elim (cpx_inv_appl1 … H) -H * -[ /2 width=5/ +[ /2 width=5 by ex3_2_intro/ | #a #V2 #W1 #W2 #U1 #U2 #_ #_ #_ #H #_ destruct elim (simple_inv_bind … HT1) | #a #V #V2 #W1 #W2 #U1 #U2 #_ #_ #_ #_ #H #_ destruct @@ -284,8 +293,8 @@ lemma cpx_inv_cast1: ∀h,g,G,L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓝV1.U1 ➡[h, g] U2 | ⦃G, L⦄ ⊢ U1 ➡[h, g] U2 | ⦃G, L⦄ ⊢ V1 ➡[h, g] U2. #h #g #G #L #V1 #U1 #U2 #H elim (cpx_inv_flat1 … H) -H * -[ /3 width=5/ -|2,3: /2 width=1/ +[ /3 width=5 by or3_intro0, ex3_2_intro/ +|2,3: /2 width=1 by or3_intro1, or3_intro2/ | #a #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #_ #_ #H destruct | #a #V #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #_ #_ #_ #H destruct ] @@ -298,7 +307,7 @@ lemma cpx_fwd_bind1_minus: ∀h,g,I,G,L,V1,T1,T. ⦃G, L⦄ ⊢ -ⓑ{I}V1.T1 ➡ T = -ⓑ{I}V2.T2. #h #g #I #G #L #V1 #T1 #T #H #b elim (cpx_inv_bind1 … H) -H * -[ #V2 #T2 #HV12 #HT12 #H destruct /3 width=4/ +[ #V2 #T2 #HV12 #HT12 #H destruct /3 width=4 by cpx_bind, ex2_2_intro/ | #T2 #_ #_ #H destruct ] qed-. @@ -314,7 +323,7 @@ lemma cpx_fwd_shift1: ∀h,g,G,L1,L,T1,T. ⦃G, L⦄ ⊢ L1 @@ T1 ➡[h, g] T [ #V0 #T0 #_ #HT10 #H destruct elim (IH … HT10) -IH -HT10 #L2 #T2 #HL12 #H destruct >append_length >HL12 -HL12 - @(ex2_2_intro … (⋆.ⓑ{I}V0@@L2) T2) [ >append_length ] // /2 width=3/ (**) (* explicit constructor *) + @(ex2_2_intro … (⋆.ⓑ{I}V0@@L2) T2) [ >append_length ] /2 width=3 by refl, trans_eq/ (**) (* explicit constructor *) | #T #_ #_ #H destruct ] ] diff --git a/matita/matita/contribs/lambdadelta/basic_2/reduction/cpx_cpx.ma b/matita/matita/contribs/lambdadelta/basic_2/reduction/cpx_lleq.ma similarity index 85% rename from matita/matita/contribs/lambdadelta/basic_2/reduction/cpx_cpx.ma rename to matita/matita/contribs/lambdadelta/basic_2/reduction/cpx_lleq.ma index 7cbd2520e..4b0257e6f 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/reduction/cpx_cpx.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/reduction/cpx_lleq.ma @@ -17,26 +17,26 @@ include "basic_2/reduction/cpx.ma". (* CONTEXT-SENSITIVE EXTENDED PARALLEL REDUCTION FOR TERMS ******************) -(* Advanced properties ******************************************************) +(* Properties on lazy equivalence for local environments ********************) lemma lleq_cpx_trans: ∀h,g,G,L2,T1,T2. ⦃G, L2⦄ ⊢ T1 ➡[h, g] T2 → - ∀L1. L1 ⋕[T1] L2 → ⦃G, L1⦄ ⊢ T1 ➡[h, g] T2. + ∀L1. L1 ⋕[0, T1] L2 → ⦃G, L1⦄ ⊢ T1 ➡[h, g] T2. #h #g #G #L2 #T1 #T2 #H elim H -G -L2 -T1 -T2 /2 width=2 by cpx_sort/ -[ #I #G #L2 #K2 #V1 #V2 #W2 #i #HLK2 #_ #HVW2 #IHV12 #L1 #H elim (lleq_inv_lref_dx … H … HLK2) -L2 +[ #I #G #L2 #K2 #V1 #V2 #W2 #i #HLK2 #_ #HVW2 #IHV12 #L1 #H elim (lleq_inv_lref_ge_dx … H … HLK2) -L2 /3 width=7 by cpx_delta/ -| #a #I #G #L2 #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L1 #H elim (lleq_inv_bind … H) -H +| #a #I #G #L2 #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L1 #H elim (lleq_inv_bind_O … H) -H /3 width=1 by cpx_bind/ | #I #G #L2 #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L1 #H elim (lleq_inv_flat … H) -H /3 width=1 by cpx_flat/ -| #G #L2 #V2 #T1 #T #T2 #_ #HT2 #IHT1 #L1 #H elim (lleq_inv_bind … H) -H +| #G #L2 #V2 #T1 #T #T2 #_ #HT2 #IHT1 #L1 #H elim (lleq_inv_bind_O … H) -H /3 width=3 by cpx_zeta/ | #G #L2 #W1 #T1 #T2 #_ #IHT12 #L1 #H elim (lleq_inv_flat … H) -H /3 width=1 by cpx_tau/ | #G #L2 #W1 #W2 #T1 #_ #IHW12 #L1 #H elim (lleq_inv_flat … H) -H /3 width=1 by cpx_ti/ | #a #G #L1 #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #IHV12 #IHW12 #IHT12 #L1 #H elim (lleq_inv_flat … H) -H - #HV1 #H elim (lleq_inv_bind … H) -H /3 width=1 by cpx_beta/ + #HV1 #H elim (lleq_inv_bind_O … H) -H /3 width=1 by cpx_beta/ | #a #G #L1 #V1 #V #V2 #W1 #W2 #T1 #T2 #_ #HV2 #_ #_ #IHV1 #IHW12 #IHT12 #L1 #H elim (lleq_inv_flat … H) -H - #HV1 #H elim (lleq_inv_bind … H) -H /3 width=3 by cpx_theta/ + #HV1 #H elim (lleq_inv_bind_O … H) -H /3 width=3 by cpx_theta/ ] qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/reduction/lpx.ma b/matita/matita/contribs/lambdadelta/basic_2/reduction/lpx.ma index d1ded82e5..9631b2ab2 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/reduction/lpx.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/reduction/lpx.ma @@ -42,6 +42,10 @@ lemma lpx_inv_pair2: ∀h,g,I,G,L1,K2,V2. ⦃G, L1⦄ ⊢ ➡[h, g] K2.ⓑ{I}V2 L1 = K1. ⓑ{I} V1. /2 width=3 by lpx_sn_inv_pair2_aux/ qed-. +lemma lpx_inv_pair: ∀h,g,I1,I2,G,L1,L2,V1,V2. ⦃G, L1.ⓑ{I1}V1⦄ ⊢ ➡[h, g] L2.ⓑ{I2}V2 → + ∧∧ ⦃G, L1⦄ ⊢ ➡[h, g] L2 & ⦃G, L1⦄ ⊢ V1 ➡[h, g] V2 & I1 = I2. +/2 width=1 by lpx_sn_inv_pair/ qed-. + (* Basic properties *********************************************************) lemma lpx_refl: ∀h,g,G,L. ⦃G, L⦄ ⊢ ➡[h, g] L. @@ -49,14 +53,14 @@ lemma lpx_refl: ∀h,g,G,L. ⦃G, L⦄ ⊢ ➡[h, g] L. lemma lpx_pair: ∀h,g,I,G,K1,K2,V1,V2. ⦃G, K1⦄ ⊢ ➡[h, g] K2 → ⦃G, K1⦄ ⊢ V1 ➡[h, g] V2 → ⦃G, K1.ⓑ{I}V1⦄ ⊢ ➡[h, g] K2.ⓑ{I}V2. -/2 width=1/ qed. +/2 width=1 by lpx_sn_pair/ qed. lemma lpx_append: ∀h,g,G,K1,K2. ⦃G, K1⦄ ⊢ ➡[h, g] K2 → ∀L1,L2. ⦃G, L1⦄ ⊢ ➡[h, g] L2 → ⦃G, L1 @@ K1⦄ ⊢ ➡[h, g] L2 @@ K2. /3 width=1 by lpx_sn_append, cpx_append/ qed. lemma lpr_lpx: ∀h,g,G,L1,L2. ⦃G, L1⦄ ⊢ ➡ L2 → ⦃G, L1⦄ ⊢ ➡[h, g] L2. -#h #g #G #L1 #L2 #H elim H -L1 -L2 // /3 width=1/ +#h #g #G #L1 #L2 #H elim H -L1 -L2 /3 width=1 by lpx_pair, cpr_cpx/ qed. (* Basic forward lemmas *****************************************************) diff --git a/matita/matita/contribs/lambdadelta/basic_2/reduction/lpx_lpx.ma b/matita/matita/contribs/lambdadelta/basic_2/reduction/lpx_lleq.ma similarity index 84% rename from matita/matita/contribs/lambdadelta/basic_2/reduction/lpx_lpx.ma rename to matita/matita/contribs/lambdadelta/basic_2/reduction/lpx_lleq.ma index a2ffaccee..a70e151be 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/reduction/lpx_lpx.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/reduction/lpx_lleq.ma @@ -3,22 +3,22 @@ include "basic_2/reduction/lpx_ldrop.ma". (* SN EXTENDED PARALLEL REDUCTION FOR LOCAL ENVIRONMENTS ********************) -(* Advanced properties ******************************************************) +(* Properties on lazy equivalence for local environments ********************) lemma lpx_lleq_fqu_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃ ⦃G2, L2, T2⦄ → - ∀K1. ⦃G1, K1⦄ ⊢ ➡[h, g] L1 → K1 ⋕[T1] L1 → - ∃∃K2. ⦃G1, K1, T1⦄ ⊃ ⦃G2, K2, T2⦄ & ⦃G2, K2⦄ ⊢ ➡[h, g] L2 & K2 ⋕[T2] L2. + ∀K1. ⦃G1, K1⦄ ⊢ ➡[h, g] L1 → K1 ⋕[0, T1] L1 → + ∃∃K2. ⦃G1, K1, T1⦄ ⊃ ⦃G2, K2, T2⦄ & ⦃G2, K2⦄ ⊢ ➡[h, g] L2 & K2 ⋕[0, T2] L2. #h #g #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2 [ #I #G1 #L1 #V1 #X #H1 #H2 elim (lpx_inv_pair2 … H1) -H1 #K0 #V0 #H1KL1 #_ #H destruct - elim (lleq_inv_lref_dx … H2 I L1 V1) -H2 // + elim (lleq_inv_lref_dx … H2 ? I L1 V1) -H2 // #K1 #H #H2KL1 lapply (ldrop_inv_O2 … H) -H #H destruct /2 width=4 by fqu_lref_O, ex3_intro/ | * [ #a ] #I #G1 #L1 #V1 #T1 #K1 #HLK1 #H [ elim (lleq_inv_bind … H) | elim (lleq_inv_flat … H) ] -H /2 width=4 by fqu_pair_sn, ex3_intro/ -| #a #I #G1 #L1 #V1 #T1 #K1 #HLK1 #H elim (lleq_inv_bind … H) -H +| #a #I #G1 #L1 #V1 #T1 #K1 #HLK1 #H elim (lleq_inv_bind_O … H) -H /3 width=4 by lpx_pair, fqu_bind_dx, ex3_intro/ | #I #G1 #L1 #V1 #T1 #K1 #HLK1 #H elim (lleq_inv_flat … H) -H /2 width=4 by fqu_flat_dx, ex3_intro/ @@ -35,8 +35,8 @@ lemma lpx_lleq_fqu_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃ ⦃G2, qed-. lemma lpx_lleq_fquq_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃⸮ ⦃G2, L2, T2⦄ → - ∀K1. ⦃G1, K1⦄ ⊢ ➡[h, g] L1 → K1 ⋕[T1] L1 → - ∃∃K2. ⦃G1, K1, T1⦄ ⊃⸮ ⦃G2, K2, T2⦄ & ⦃G2, K2⦄ ⊢ ➡[h, g] L2 & K2 ⋕[T2] L2. + ∀K1. ⦃G1, K1⦄ ⊢ ➡[h, g] L1 → K1 ⋕[0, T1] L1 → + ∃∃K2. ⦃G1, K1, T1⦄ ⊃⸮ ⦃G2, K2, T2⦄ & ⦃G2, K2⦄ ⊢ ➡[h, g] L2 & K2 ⋕[0, T2] L2. #h #g #G1 #G2 #L1 #L2 #T1 #T2 #H #K1 #H1KL1 #H2KL1 elim (fquq_inv_gen … H) -H [ #H elim (lpx_lleq_fqu_trans … H … H1KL1 H2KL1) -L1 @@ -46,8 +46,8 @@ elim (fquq_inv_gen … H) -H qed-. lemma lpx_lleq_fqup_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃+ ⦃G2, L2, T2⦄ → - ∀K1. ⦃G1, K1⦄ ⊢ ➡[h, g] L1 → K1 ⋕[T1] L1 → - ∃∃K2. ⦃G1, K1, T1⦄ ⊃+ ⦃G2, K2, T2⦄ & ⦃G2, K2⦄ ⊢ ➡[h, g] L2 & K2 ⋕[T2] L2. + ∀K1. ⦃G1, K1⦄ ⊢ ➡[h, g] L1 → K1 ⋕[0, T1] L1 → + ∃∃K2. ⦃G1, K1, T1⦄ ⊃+ ⦃G2, K2, T2⦄ & ⦃G2, K2⦄ ⊢ ➡[h, g] L2 & K2 ⋕[0, T2] L2. #h #g #G1 #G2 #L1 #L2 #T1 #T2 #H @(fqup_ind … H) -G2 -L2 -T2 [ #G2 #L2 #T2 #H #K1 #H1KL1 #H2KL1 elim (lpx_lleq_fqu_trans … H … H1KL1 H2KL1) -L1 /3 width=4 by fqu_fqup, ex3_intro/ @@ -58,8 +58,8 @@ lemma lpx_lleq_fqup_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃+ ⦃G2 qed-. lemma lpx_lleq_fqus_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃* ⦃G2, L2, T2⦄ → - ∀K1. ⦃G1, K1⦄ ⊢ ➡[h, g] L1 → K1 ⋕[T1] L1 → - ∃∃K2. ⦃G1, K1, T1⦄ ⊃* ⦃G2, K2, T2⦄ & ⦃G2, K2⦄ ⊢ ➡[h, g] L2 & K2 ⋕[T2] L2. + ∀K1. ⦃G1, K1⦄ ⊢ ➡[h, g] L1 → K1 ⋕[0, T1] L1 → + ∃∃K2. ⦃G1, K1, T1⦄ ⊃* ⦃G2, K2, T2⦄ & ⦃G2, K2⦄ ⊢ ➡[h, g] L2 & K2 ⋕[0, T2] L2. #h #g #G1 #G2 #L1 #L2 #T1 #T2 #H #K1 #H1KL1 #H2KL1 elim (fqus_inv_gen … H) -H [ #H elim (lpx_lleq_fqup_trans … H … H1KL1 H2KL1) -L1 -- 2.39.2