From b2cdc4abd9ac87e39bc51b0d9c38daea179adbd5 Mon Sep 17 00:00:00 2001 From: Ferruccio Guidi Date: Tue, 21 Apr 2020 14:35:09 +0200 Subject: [PATCH] update in basic_2 + rpx_req: cpx_teqx_conf_rex replaced by cpx_teqx_repl_reqx --- .../basic_2/rt_computation/cpxs_feqx.ma | 11 +- .../basic_2/rt_computation/cpxs_reqx.ma | 17 +- .../basic_2/rt_computation/cpxs_teqx.ma | 29 ++- .../basic_2/rt_computation/csx_cpxs.ma | 28 ++- .../basic_2/rt_computation/csx_csx.ma | 3 +- .../basic_2/rt_computation/csx_reqx.ma | 4 +- .../basic_2/rt_computation/fsb_csx.ma | 2 +- .../basic_2/rt_transition/cnx_cnx.ma | 4 +- .../basic_2/rt_transition/cpx_feqx.ma | 9 +- .../basic_2/rt_transition/fpb_reqx.ma | 4 +- .../basic_2/rt_transition/lpx_reqx.ma | 7 +- .../basic_2/rt_transition/rpx_reqx.ma | 201 ++++++++---------- 12 files changed, 151 insertions(+), 168 deletions(-) diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_feqx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_feqx.ma index 882543af4..8017c74ce 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_feqx.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_feqx.ma @@ -19,14 +19,15 @@ include "basic_2/rt_computation/cpxs_reqx.ma". (* Properties with sort-irrelevant equivalence for closures *****************) +(* to be updated *) lemma feqx_cpxs_trans: ∀G1,G2,L1,L2,T1,T. ❪G1,L1,T1❫ ≛ ❪G2,L2,T❫ → ∀T2. ❪G2,L2❫ ⊢ T ⬈* T2 → ∃∃T0. ❪G1,L1❫ ⊢ T1 ⬈* T0 & ❪G1,L1,T0❫ ≛ ❪G2,L2,T2❫. -#G1 #G2 #L1 #L2 #T1 #T #H #T2 #HT2 +#G1 #G2 #L1 #L2 #T1 #T #H #T2 #H2T2 elim (feqx_inv_gen_dx … H) -H #H #HL12 #HT1 destruct -elim (reqx_cpxs_trans … HT2 … HL12) #T0 #HT0 #HT02 -lapply (cpxs_reqx_conf_dx … HT2 … HL12) -HL12 #HL12 -elim (teqx_cpxs_trans … HT1 … HT0) -T #T #HT1 #HT0 -/4 width=5 by feqx_intro_dx, teqx_trans, ex2_intro/ +lapply (reqx_cpxs_trans … H2T2 … HL12) #H1T2 +lapply (cpxs_reqx_conf_dx … H2T2 … HL12) -HL12 #HL12 +lapply (teqx_cpxs_trans … HT1 … H1T2) -T #HT12 +/3 width=3 by feqx_intro_dx, ex2_intro/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_reqx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_reqx.ma index b523f08b8..ee504e981 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_reqx.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_reqx.ma @@ -21,20 +21,17 @@ include "basic_2/rt_computation/cpxs_teqx.ma". (* Basic_2A1: was just: lleq_cpxs_trans *) lemma reqx_cpxs_trans (G): - ∀L0,T0,T1. ❪G,L0❫ ⊢ T0 ⬈* T1 → ∀L2. L2 ≛[T0] L0 → - ∃∃T. ❪G,L2❫ ⊢ T0 ⬈* T & T ≛ T1. -#G #L0 #T0 #T1 #H @(cpxs_ind_dx … H) -T0 /2 width=3 by ex2_intro/ -#T0 #T #HT0 #_ #IH #L2 #HL2 -elim (reqx_cpx_trans … HL2 … HT0) #U1 #H1 #H2 -elim (IH L2) -IH /2 width=5 by cpx_reqx_conf_dx/ -L0 #U2 #H3 #H4 -elim (teqx_cpxs_trans … H2 … H3) -T #U0 #H2 #H3 -/3 width=5 by cpxs_strap2, teqx_trans, ex2_intro/ + ∀L0,T0,T1. ❪G,L0❫ ⊢ T0 ⬈* T1 → ∀L2. L2 ≛[T0] L0 → ❪G,L2❫ ⊢ T0 ⬈* T1. +#G #L0 #T0 #T1 #H @(cpxs_ind_dx … H) -T0 // +#T0 #T #H0T0 #_ #IH #L2 #HL2 +lapply (reqx_cpx_trans … HL2 … H0T0) #H2T0 +lapply (IH L2 ?) -IH /2 width=5 by cpx_reqx_conf_dx/ -L0 #H2T1 +/2 width=3 by cpxs_strap2/ qed-. (* Basic_2A1: was just: cpxs_lleq_conf *) lemma cpxs_reqx_conf (G): - ∀L0,T0,T1. ❪G,L0❫ ⊢ T0 ⬈* T1 → ∀L2. L0 ≛[T0] L2 → - ∃∃T. ❪G,L2❫ ⊢ T0 ⬈* T & T ≛ T1. + ∀L0,T0,T1. ❪G,L0❫ ⊢ T0 ⬈* T1 → ∀L2. L0 ≛[T0] L2 → ❪G,L2❫ ⊢ T0 ⬈* T1. /3 width=3 by reqx_cpxs_trans, reqx_sym/ qed-. (* Basic_2A1: was just: cpxs_lleq_conf_dx *) diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_teqx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_teqx.ma index f3164e75e..0de7eb677 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_teqx.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_teqx.ma @@ -19,29 +19,28 @@ include "basic_2/rt_computation/cpxs.ma". (* Properties with sort-irrelevant equivalence for terms ********************) -lemma teqx_cpxs_trans (G) (L): - ∀U1,T1. U1 ≛ T1 → ∀T2. ❪G,L❫ ⊢ T1 ⬈* T2 → - ∃∃U2. ❪G,L❫ ⊢ U1 ⬈* U2 & U2 ≛ T2. -#G #L #U1 #T1 #HUT1 #T2 #HT12 @(cpxs_ind … HT12) -T2 /2 width=3 by ex2_intro/ -#T #T2 #_ #HT2 * #U #HU1 #HUT elim (teqx_cpx_trans … HUT … HT2) -T -T1 -/3 width=3 by ex2_intro, cpxs_strap1/ +lemma teqx_cpxs_trans (G) (L) (T): + ∀T1. T1 ≛ T → ∀T2. ❪G,L❫ ⊢ T ⬈* T2 → ❪G,L❫ ⊢ T1 ⬈* T2. +#G #L #T #T1 #HT1 #T2 #HT2 @(cpxs_ind … HT2) -T2 +[ /3 width=1 by teqx_cpx, cpx_cpxs/ +| /2 width=3 by cpxs_strap1/ +] qed-. (* Note: this requires teqx to be symmetric *) (* Nasic_2A1: uses: cpxs_neq_inv_step_sn *) lemma cpxs_tneqx_fwd_step_sn (G) (L): ∀T1,T2. ❪G,L❫ ⊢ T1 ⬈* T2 → (T1 ≛ T2 → ⊥) → - ∃∃T,T0. ❪G,L❫ ⊢ T1 ⬈ T & T1 ≛ T → ⊥ & ❪G,L❫ ⊢ T ⬈* T0 & T0 ≛ T2. + ∃∃T. ❪G,L❫ ⊢ T1 ⬈ T & T1 ≛ T → ⊥ & ❪G,L❫ ⊢ T ⬈* T2. #G #L #T1 #T2 #H @(cpxs_ind_dx … H) -T1 [ #H elim H -H // -| #T1 #T0 #HT10 #HT02 #IH #Hn12 - elim (teqx_dec T1 T0) [ -HT10 -HT02 #H10 | -IH #Hn10 ] - [ elim IH -IH /3 width=3 by teqx_trans/ -Hn12 - #T3 #T4 #HT03 #Hn03 #HT34 #H42 - elim (teqx_cpx_trans … H10 … HT03) -HT03 #T5 #HT15 #H53 - elim (teqx_cpxs_trans … H53 … HT34) -HT34 #T6 #HT56 #H64 - /5 width=8 by teqx_canc_sn, (* 2x *) teqx_trans, ex4_2_intro/ - | /3 width=6 by ex4_2_intro/ +| #T1 #T0 #HT10 #HT02 #IH #HnT12 + elim (teqx_dec T1 T0) [ -HT10 -HT02 #HT10 | -IH #HnT10 ] + [ elim IH -IH /3 width=3 by teqx_trans/ -HnT12 + #T #HT0 #HnT0 #HT2 + lapply (teqx_cpx_trans … HT10 … HT0) -HT0 #HT1 + /4 width=4 by teqx_canc_sn, ex3_intro/ + | /3 width=4 by ex3_intro/ ] ] qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_cpxs.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_cpxs.ma index baba7a131..6995ad656 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_cpxs.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_cpxs.ma @@ -36,27 +36,23 @@ qed-. (* Eliminators with extended context-sensitive rt-computation for terms *****) -lemma csx_ind_cpxs_teqx (G) (L): +fact csx_ind_cpxs_aux (G) (L): ∀Q:predicate term. (∀T1. ❪G,L❫ ⊢ ⬈*𝐒 T1 → (∀T2. ❪G,L❫ ⊢ T1 ⬈* T2 → (T1 ≛ T2 → ⊥) → Q T2) → Q T1 ) → ∀T1. ❪G,L❫ ⊢ ⬈*𝐒 T1 → - ∀T0. ❪G,L❫ ⊢ T1 ⬈* T0 → ∀T2. T0 ≛ T2 → Q T2. + ∀T2. ❪G,L❫ ⊢ T1 ⬈* T2 → Q T2. #G #L #Q #IH #T1 #H @(csx_ind … H) -T1 -#T1 #HT1 #IH1 #T0 #HT10 #T2 #HT02 -@IH -IH /3 width=3 by csx_cpxs_trans, csx_teqx_trans/ -HT1 #V2 #HTV2 #HnTV2 -lapply (teqx_tneqx_trans … HT02 … HnTV2) -HnTV2 #H -elim (teqx_cpxs_trans … HT02 … HTV2) -T2 #V0 #HTV0 #HV02 -lapply (tneqx_teqx_canc_dx … H … HV02) -H #HnTV0 -elim (teqx_dec T1 T0) #H -[ lapply (teqx_tneqx_trans … H … HnTV0) -H -HnTV0 #Hn10 - lapply (cpxs_trans … HT10 … HTV0) -T0 #H10 - elim (cpxs_tneqx_fwd_step_sn … H10 … Hn10) -H10 -Hn10 - /3 width=8 by teqx_trans/ -| elim (cpxs_tneqx_fwd_step_sn … HT10 … H) -HT10 -H #T #V #HT1 #HnT1 #HTV #HVT0 - elim (teqx_cpxs_trans … HVT0 … HTV0) -T0 - /3 width=8 by cpxs_trans, teqx_trans/ +#T1 #HT1 #IH1 #T2 #HT12 +@IH -IH /2 width=3 by csx_cpxs_trans/ -HT1 #V2 #HTV2 #HnTV2 +elim (teqx_dec T1 T2) #H +[ lapply (teqx_tneqx_trans … H … HnTV2) -H -HnTV2 #Hn12 + lapply (cpxs_trans … HT12 … HTV2) -T2 #H12 + elim (cpxs_tneqx_fwd_step_sn … H12 … Hn12) -H12 -Hn12 + /3 width=4 by/ +| elim (cpxs_tneqx_fwd_step_sn … HT12 … H) -HT12 -H + /3 width=6 by cpxs_trans/ ] qed-. @@ -67,5 +63,5 @@ lemma csx_ind_cpxs (G) (L) (Q:predicate …): ) → ∀T. ❪G,L❫ ⊢ ⬈*𝐒 T → Q T. #G #L #Q #IH #T #HT -@(csx_ind_cpxs_teqx … IH … HT) -IH -HT // (**) (* full auto fails *) +@(csx_ind_cpxs_aux … IH … HT) -IH -HT // (**) (* full auto fails *) qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_csx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_csx.ma index 86dc07b45..72d7a1f4b 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_csx.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_csx.ma @@ -23,7 +23,8 @@ lemma csx_teqx_trans (G) (L): ∀T1. ❪G,L❫ ⊢ ⬈*𝐒 T1 → ∀T2. T1 ≛ T2 → ❪G,L❫ ⊢ ⬈*𝐒 T2. #G #L #T1 #H @(csx_ind … H) -T1 #T #_ #IH #T2 #HT2 -@csx_intro #T1 #HT21 #HnT21 elim (teqx_cpx_trans … HT2 … HT21) -HT21 +@csx_intro #T1 #HT21 #HnT21 +lapply (teqx_cpx_trans … HT2 … HT21) -HT21 #HT1 /4 width=5 by teqx_repl/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_reqx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_reqx.ma index f6f8970e3..5d35690cc 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_reqx.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_reqx.ma @@ -26,8 +26,8 @@ lemma csx_reqx_conf (G) (L1): #G #L1 #T #H @(csx_ind … H) -T #T1 #_ #IH #L2 #HL12 @csx_intro #T2 #HT12 #HnT12 -elim (reqx_cpx_trans … HL12 … HT12) -HT12 -/5 width=5 by cpx_reqx_conf_sn, csx_teqx_trans, teqx_trans/ +lapply (reqx_cpx_trans … HL12 … HT12) -HT12 +/3 width=4 by cpx_reqx_conf_sn/ qed-. (* Basic_2A1: uses: csx_lleq_trans *) diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fsb_csx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fsb_csx.ma index 1839df0f8..9991033e1 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fsb_csx.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/fsb_csx.ma @@ -50,7 +50,7 @@ generalize in match IHu; -IHu generalize in match H10; -H10 elim (teqx_dec T0 T4) [ -IHc -HT04 #HT04 | -IHu #HnT04 ] [ elim (teqx_fqup_trans … H43 … HT04) -T4 #L2 #T4 #H04 #HT43 #HL24 /4 width=7 by fsb_fpbs_trans, teqx_reqx_lpx_fpbs, fpbs_fqup_trans/ - | elim (cpxs_tneqx_fwd_step_sn … HT04 HnT04) -HT04 -HnT04 #T2 #T5 #HT02 #HnT02 #HT25 #HT54 + | elim (cpxs_tneqx_fwd_step_sn … HT04 HnT04) -HT04 -HnT04 #T2 #HT02 #HnT02 #HT24 elim (fpbs_cpx_tneqx_trans … H10 … HT02 HnT02) -T0 #T0 #HT10 #HnT10 #H02 /3 width=14 by fpbs_cpxs_teqx_fqup_lpx_trans/ ] diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cnx_cnx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cnx_cnx.ma index 810fb85f3..ba56c516c 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cnx_cnx.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cnx_cnx.ma @@ -22,6 +22,6 @@ include "basic_2/rt_transition/cnx.ma". lemma cnx_teqx_trans (G) (L): ∀T1. ❪G,L❫ ⊢ ⬈𝐍 T1 → ∀T2. T1 ≛ T2 → ❪G,L❫ ⊢ ⬈𝐍 T2. #G #L #T1 #HT1 #T2 #HT12 #T #HT2 -elim (teqx_cpx_trans … HT12 … HT2) -HT2 #T0 #HT10 #HT0 -lapply (HT1 … HT10) -HT1 -HT10 /2 width=5 by teqx_repl/ (**) (* full auto fails *) +lapply (teqx_cpx_trans … HT12 … HT2) -HT2 #H +lapply (HT1 … H) -HT1 -H /2 width=5 by teqx_canc_sn/ (**) (* full auto fails *) qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpx_feqx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpx_feqx.ma index a0ec5d8f8..333a402d3 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpx_feqx.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpx_feqx.ma @@ -20,14 +20,15 @@ include "basic_2/rt_transition/rpx_reqx.ma". (* Properties with sort-irrelevant equivalence for closures *****************) +(**) (* to update *) lemma feqx_cpx_trans: ∀G1,G2,L1,L2,T1,T. ❪G1,L1,T1❫ ≛ ❪G2,L2,T❫ → ∀T2. ❪G2,L2❫ ⊢ T ⬈ T2 → ∃∃T0. ❪G1,L1❫ ⊢ T1 ⬈ T0 & ❪G1,L1,T0❫ ≛ ❪G2,L2,T2❫. #G1 #G2 #L1 #L2 #T1 #T #H #T2 #HT2 elim (feqx_inv_gen_dx … H) -H #H #HL12 #HT1 destruct -elim (reqx_cpx_trans … HL12 … HT2) #T0 #HT0 #HT02 -lapply (cpx_reqx_conf_dx … HT2 … HL12) -HL12 #HL12 -elim (teqx_cpx_trans … HT1 … HT0) -T #T #HT1 #HT0 -/4 width=5 by feqx_intro_dx, teqx_trans, ex2_intro/ +lapply (reqx_cpx_trans … HL12 … HT2) #H +lapply (cpx_reqx_conf_dx … HT2 … HL12) -HT2 -HL12 #HL12 +lapply (teqx_cpx_trans … HT1 … H) -T #HT12 +/3 width=3 by feqx_intro_dx, ex2_intro/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_transition/fpb_reqx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/fpb_reqx.ma index 9e75e8f96..19aeffac6 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_transition/fpb_reqx.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/fpb_reqx.ma @@ -30,7 +30,7 @@ lemma teqx_fpb_trans: elim (teqx_fqu_trans … H … HU21) -H /3 width=5 by fpb_fqu, ex3_2_intro/ | #T1 #HUT1 #HnUT1 - elim (teqx_cpx_trans … HU21 … HUT1) -HUT1 + lapply (teqx_cpx_trans … HU21 … HUT1) -HUT1 /6 width=5 by fpb_cpx, teqx_canc_sn, teqx_trans, ex3_2_intro/ | /6 width=5 by fpb_lpx, rpx_teqx_div, teqx_reqx_conf, ex3_2_intro/ ] @@ -44,7 +44,7 @@ lemma reqx_fpb_trans: #F #K1 #K2 #T #HT #G #L2 #U * -G -L2 -U [ #G #L2 #U #H2 elim (reqx_fqu_trans … H2 … HT) -K2 /3 width=5 by fpb_fqu, ex3_2_intro/ -| #U #HTU #HnTU elim (reqx_cpx_trans … HT … HTU) -HTU +| #U #HTU #HnTU lapply (reqx_cpx_trans … HT … HTU) -HTU /5 width=11 by fpb_cpx, cpx_reqx_conf_sn, teqx_trans, teqx_reqx_conf, ex3_2_intro/ (**) (* time: 36s on dev *) | #L2 #HKL2 #HnKL2 elim (reqx_lpx_trans … HKL2 … HT) -HKL2 /6 width=5 by fpb_lpx, (* 2x *) reqx_canc_sn, ex3_2_intro/ diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_transition/lpx_reqx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/lpx_reqx.ma index f75050ec6..73f134d10 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_transition/lpx_reqx.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/lpx_reqx.ma @@ -20,13 +20,14 @@ include "basic_2/rt_transition/rpx_lpx.ma". (* Properties with sort-irrelevant equivalence for local environments *******) +(**) (* to update as reqx_rpx_trans *) (* Basic_2A1: uses: lleq_lpx_trans *) lemma reqx_lpx_trans (G): ∀L2,K2. ❪G,L2❫ ⊢ ⬈ K2 → ∀L1. ∀T:term. L1 ≛[T] L2 → ∃∃K1. ❪G,L1❫ ⊢ ⬈ K1 & K1 ≛[T] K2. #G #L2 #K2 #HLK2 #L1 #T #HL12 lapply (lpx_rpx … T HLK2) -HLK2 #HLK2 -elim (reqx_rpx_trans … HLK2 … HL12) -L2 #K #H #HK2 -elim (rpx_inv_lpx_req … H) -H #K1 #HLK1 #HK1 -/3 width=5 by req_reqx_trans, ex2_intro/ +lapply (reqx_rpx_trans … HL12 … HLK2) -L2 #H +elim (rpx_inv_lpx_req … H) -H #K1 #HLK1 #HK12 +/3 width=3 by req_reqx, ex2_intro/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_transition/rpx_reqx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/rpx_reqx.ma index 19fc79235..29964b29c 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_transition/rpx_reqx.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/rpx_reqx.ma @@ -48,127 +48,114 @@ lemma rpx_teqx_div (G): ∀T1,T2. T1 ≛ T2 → ∀L1,L2. ❪G,L1❫ ⊢ ⬈[T2] L2 → ❪G,L1❫ ⊢ ⬈[T1] L2. /2 width=5 by teqx_rex_div/ qed-. -lemma cpx_teqx_conf_rex (G): R_confluent2_rex … (cpx G) cdeq (cpx G) cdeq. -#G #L0 #T0 #T1 #H @(cpx_ind … H) -G -L0 -T0 -T1 /2 width=3 by ex2_intro/ -[ #G #L0 #s0 #s1 #X0 #H0 #L1 #HL01 #L2 #HL02 - elim (teqx_inv_sort1 … H0) -H0 #s2 #H destruct - /3 width=3 by teqx_sort, ex2_intro/ -| #I #G #K0 #V0 #V1 #W1 #_ #IH #HVW1 #T2 #H0 #L1 #H1 #L2 #H2 - >(teqx_inv_lref1 … H0) -H0 - elim (rpx_inv_zero_pair_sn … H1) -H1 #K1 #X1 #HK01 #HX1 #H destruct - elim (reqx_inv_zero_pair_sn … H2) -H2 #K2 #X2 #HK02 #HX2 #H destruct - elim (IH X2 … HK01 … HK02) // -K0 -V0 #V #HV1 #HV2 - elim (teqx_lifts_sn … HV1 … HVW1) -V1 /3 width=5 by cpx_delta, ex2_intro/ -| #I0 #G #K0 #V1 #W1 #i #_ #IH #HVW1 #T2 #H0 #L1 #H1 #L2 #H2 - >(teqx_inv_lref1 … H0) -H0 - elim (rpx_inv_lref_bind_sn … H1) -H1 #I1 #K1 #HK01 #H destruct - elim (reqx_inv_lref_bind_sn … H2) -H2 #I2 #K2 #HK02 #H destruct - elim (IH … HK01 … HK02) [|*: //] -K0 #V #HV1 #HV2 - elim (teqx_lifts_sn … HV1 … HVW1) -V1 /3 width=5 by cpx_lref, ex2_intro/ -| #p #I #G #L0 #V0 #V1 #T0 #T1 #_ #_ #IHV #IHT #X0 #H0 #L1 #H1 #L2 #H2 - elim (teqx_inv_pair1 … H0) -H0 #V2 #T2 #HV02 #HT02 #H destruct - elim (rpx_inv_bind … H1) -H1 #HL01 #H1 - elim (reqx_inv_bind … H2) -H2 #HL02 #H2 - lapply (reqx_bind_repl_dx … H2 (BPair I V2) ?) -H2 /2 width=1 by ext2_pair/ #H2 - elim (IHV … HV02 … HL01 … HL02) -IHV -HV02 -HL01 -HL02 - elim (IHT … HT02 … H1 … H2) -L0 -T0 - /3 width=5 by cpx_bind, teqx_pair, ex2_intro/ -| #I #G #L0 #V0 #V1 #T0 #T1 #_ #_ #IHV #IHT #X0 #H0 #L1 #H1 #L2 #H2 - elim (teqx_inv_pair1 … H0) -H0 #V2 #T2 #HV02 #HT02 #H destruct - elim (rpx_inv_flat … H1) -H1 #HL01 #H1 - elim (reqx_inv_flat … H2) -H2 #HL02 #H2 - elim (IHV … HV02 … HL01 … HL02) -IHV -HV02 -HL01 -HL02 - elim (IHT … HT02 … H1 … H2) -L0 -V0 -T0 - /3 width=5 by cpx_flat, teqx_pair, ex2_intro/ -| #G #L0 #V0 #U0 #T0 #T1 #HTU0 #_ #IH #X0 #H0 #L1 #H1 #L2 #H2 - elim (teqx_inv_pair1 … H0) -H0 #V2 #U2 #HV02 #HU02 #H destruct - elim (rpx_inv_bind … H1) -H1 #HL01 #H1 - elim (reqx_inv_bind … H2) -H2 #HL02 #H2 - lapply (rpx_inv_lifts_bi … H1 (Ⓣ) … HTU0) -H1 [6:|*: /3 width=2 by drops_refl, drops_drop/ ] #H1 - lapply (reqx_inv_lifts_bi … H2 (Ⓣ) … HTU0) -H2 [6:|*: /3 width=2 by drops_refl, drops_drop/ ] #H2 +lemma cpx_teqx_repl_reqx (G) (L0) (T0): + ∀T1. ❪G,L0❫ ⊢ T0 ⬈ T1 → ∀T2. T0 ≛ T2 → ∀T3. T1 ≛ T3 → + ∀L2. L0 ≛[T0] L2 → ❪G,L2❫ ⊢ T2 ⬈ T3. +#G #L0 #T0 #T1 #H @(cpx_ind … H) -G -L0 -T0 -T1 +[ * #x0 #G #L0 #X2 #HX2 #X3 #HX3 #L2 #_ + [ elim (teqx_inv_sort1 … HX2) -HX2 #x2 #H destruct + elim (teqx_inv_sort1 … HX3) -HX3 #x3 #H destruct // + | lapply (teqx_inv_lref1 … HX2) -HX2 #H destruct + lapply (teqx_inv_lref1 … HX3) -HX3 #H destruct // + | lapply (teqx_inv_gref1 … HX2) -HX2 #H destruct + lapply (teqx_inv_gref1 … HX3) -HX3 #H destruct // + ] +| #G #L0 #s0 #s1 #X2 #HX2 #X3 #HX3 #L2 #HL02 + elim (teqx_inv_sort1 … HX2) -HX2 #s2 #H destruct + elim (teqx_inv_sort1 … HX3) -HX3 #s3 #H destruct // +| #I #G #K0 #V0 #V1 #W1 #_ #IH #HVW1 #X2 #HX2 #X3 #HX3 #L2 #HL2 + lapply (teqx_inv_lref1 … HX2) -HX2 #H destruct + elim (reqx_inv_zero_pair_sn … HL2) -HL2 #K2 #V2 #HK02 #HV02 #H destruct + elim (teqx_inv_lifts_sn … HX3 … HVW1) -W1 #V3 #HVX3 #HV13 + /3 width=3 by cpx_delta/ +| #I0 #G #K0 #V1 #W1 #i #_ #IH #HVW1 #X2 #HX2 #X3 #HX3 #L2 #HL2 + lapply (teqx_inv_lref1 … HX2) -HX2 #H destruct + elim (reqx_inv_lref_bind_sn … HL2) -HL2 #I2 #K2 #HK02 #H destruct + elim (teqx_inv_lifts_sn … HX3 … HVW1) -W1 #V3 #HVX3 #HV13 + /3 width=3 by cpx_lref/ +| #p #I #G #L0 #V0 #V1 #T0 #T1 #_ #_ #IHV #IHT #X2 #HX2 #X3 #HX3 #L2 #HL02 + elim (teqx_inv_pair1 … HX2) -HX2 #V2 #T2 #HV02 #HT02 #H destruct + elim (teqx_inv_pair1 … HX3) -HX3 #V3 #T3 #HV13 #HT13 #H destruct + elim (reqx_inv_bind … HL02) -HL02 #HV0 #HT0 + lapply (reqx_bind_repl_dx … HT0 (BPair I V2) ?) -HT0 + /2 width=1 by ext2_pair/ #HT0 + /3 width=1 by cpx_bind/ +| #I #G #L0 #V0 #V1 #T0 #T1 #_ #_ #IHV #IHT #X2 #HX2 #X3 #HX3 #L2 #HL02 + elim (teqx_inv_pair1 … HX2) -HX2 #V2 #T2 #HV02 #HT02 #H destruct + elim (teqx_inv_pair1 … HX3) -HX3 #V3 #T3 #HV13 #HT13 #H destruct + elim (reqx_inv_flat … HL02) -HL02 #HV0 #HT0 + /3 width=1 by cpx_flat/ +| #G #L0 #V0 #U0 #T0 #T1 #HTU0 #_ #IH #X2 #HX2 #X3 #HX3 #L2 #HL02 + elim (teqx_inv_pair1 … HX2) -HX2 #V2 #U2 #HV02 #HU02 #H destruct + elim (reqx_inv_bind … HL02) -HL02 #HV0 #HU0 + lapply (reqx_inv_lifts_bi … HU0 (Ⓣ) … HTU0) -HU0 + [6:|*: /3 width=2 by drops_refl, drops_drop/ ] #HT0 elim (teqx_inv_lifts_sn … HU02 … HTU0) -U0 #T2 #HTU2 #HT02 - elim (IH … HT02 … H1 … H2) -L0 -T0 #T #HT1 - /3 width=5 by cpx_zeta, ex2_intro/ -| #G #L0 #V0 #T0 #T1 #_ #IH #X0 #H0 #L1 #H1 #L2 #H2 - elim (teqx_inv_pair1 … H0) -H0 #V2 #T2 #_ #HT02 #H destruct - elim (rpx_inv_flat … H1) -H1 #HL01 #H1 - elim (reqx_inv_flat … H2) -H2 #HL02 #H2 - elim (IH … HT02 … H1 … H2) -L0 -V0 -T0 - /3 width=3 by cpx_eps, ex2_intro/ -| #G #L0 #V0 #T0 #T1 #_ #IH #X0 #H0 #L1 #H1 #L2 #H2 - elim (teqx_inv_pair1 … H0) -H0 #V2 #T2 #HV02 #_ #H destruct - elim (rpx_inv_flat … H1) -H1 #HL01 #H1 - elim (reqx_inv_flat … H2) -H2 #HL02 #H2 - elim (IH … HV02 … HL01 … HL02) -L0 -V0 -T1 - /3 width=3 by cpx_ee, ex2_intro/ -| #p #G #L0 #V0 #V1 #W0 #W1 #T0 #T1 #_ #_ #_ #IHV #IHW #IHT #X0 #H0 #L1 #H1 #L2 #H2 - elim (teqx_inv_pair1 … H0) -H0 #V2 #X #HV02 #H0 #H destruct - elim (teqx_inv_pair1 … H0) -H0 #W2 #T2 #HW02 #HT02 #H destruct - elim (rpx_inv_flat … H1) -H1 #H1LV0 #H1 - elim (rpx_inv_bind … H1) -H1 #H1LW0 #H1LT0 - elim (reqx_inv_flat … H2) -H2 #H2LV0 #H2 - elim (reqx_inv_bind … H2) -H2 #H2LW0 #H2LT0 - lapply (reqx_bind_repl_dx … H2LT0 (BPair Abst W2) ?) -H2LT0 /2 width=1 by ext2_pair/ #H2LT0 - elim (IHV … HV02 … H1LV0 … H2LV0) -IHV -HV02 -H1LV0 -H2LV0 - elim (IHW … HW02 … H1LW0 … H2LW0) -IHW -HW02 -H1LW0 -H2LW0 - elim (IHT … HT02 … H1LT0 … H2LT0) -L0 -V0 -T0 - /4 width=7 by cpx_beta, teqx_pair, ex2_intro/ (* note: 2 teqx_pair *) -| #p #G #L0 #V0 #V1 #U1 #W0 #W1 #T0 #T1 #_ #_ #_ #IHV #IHW #IHT #HVU1 #X0 #H0 #L1 #H1 #L2 #H2 - elim (teqx_inv_pair1 … H0) -H0 #V2 #X #HV02 #H0 #H destruct - elim (teqx_inv_pair1 … H0) -H0 #W2 #T2 #HW02 #HT02 #H destruct - elim (rpx_inv_flat … H1) -H1 #H1LV0 #H1 - elim (rpx_inv_bind … H1) -H1 #H1LW0 #H1LT0 - elim (reqx_inv_flat … H2) -H2 #H2LV0 #H2 - elim (reqx_inv_bind … H2) -H2 #H2LW0 #H2LT0 - lapply (reqx_bind_repl_dx … H2LT0 (BPair Abbr W2) ?) -H2LT0 /2 width=1 by ext2_pair/ #H2LT0 - elim (IHV … HV02 … H1LV0 … H2LV0) -IHV -HV02 -H1LV0 -H2LV0 #V #HV1 - elim (IHW … HW02 … H1LW0 … H2LW0) -IHW -HW02 -H1LW0 -H2LW0 - elim (IHT … HT02 … H1LT0 … H2LT0) -L0 -V0 -T0 - elim (teqx_lifts_sn … HV1 … HVU1) -V1 - /4 width=9 by cpx_theta, teqx_pair, ex2_intro/ (* note: 2 teqx_pair *) + /3 width=3 by cpx_zeta/ +| #G #L0 #V0 #T0 #T1 #_ #IH #X2 #HX2 #X3 #HX3 #L2 #HL02 + elim (teqx_inv_pair1 … HX2) -HX2 #V2 #T2 #_ #HT02 #H destruct + elim (reqx_inv_flat … HL02) -HL02 #HV0 #HT0 + /3 width=1 by cpx_eps/ +| #G #L0 #V0 #T0 #T1 #_ #IH #X2 #HX2 #X3 #HX3 #L2 #HL02 + elim (teqx_inv_pair1 … HX2) -HX2 #V2 #T2 #HV02 #_ #H destruct + elim (reqx_inv_flat … HL02) -HL02 #HV0 #HT1 + /3 width=1 by cpx_ee/ +| #p #G #L0 #V0 #V1 #W0 #W1 #T0 #T1 #_ #_ #_ #IHV #IHW #IHT #X2 #HX2 #X3 #HX3 #L2 #HL02 + elim (teqx_inv_pair1 … HX2) -HX2 #V2 #X #HV02 #HX #H destruct + elim (teqx_inv_pair1 … HX) -HX #W2 #T2 #HW02 #HT02 #H destruct + elim (teqx_inv_pair1 … HX3) -HX3 #X #T3 #HX #HT13 #H destruct + elim (teqx_inv_pair1 … HX) -HX #W3 #V3 #HW13 #HV13 #H destruct + elim (reqx_inv_flat … HL02) -HL02 #HV0 #HL02 + elim (reqx_inv_bind … HL02) -HL02 #HW0 #HT0 + lapply (reqx_bind_repl_dx … HT0 (BPair Abst W2) ?) -HT0 + /2 width=1 by ext2_pair/ #H2T0 + /3 width=1 by cpx_beta/ +| #p #G #L0 #V0 #V1 #U1 #W0 #W1 #T0 #T1 #_ #_ #_ #IHV #IHW #IHT #HVU1 #X2 #HX2 #X3 #HX3 #L2 #HL02 + elim (teqx_inv_pair1 … HX2) -HX2 #V2 #X #HV02 #HX #H destruct + elim (teqx_inv_pair1 … HX) -HX #W2 #T2 #HW02 #HT02 #H destruct + elim (teqx_inv_pair1 … HX3) -HX3 #W3 #X #HW13 #HX #H destruct + elim (teqx_inv_pair1 … HX) -HX #U3 #T3 #HU13 #HT13 #H destruct + elim (reqx_inv_flat … HL02) -HL02 #HV0 #HL02 + elim (reqx_inv_bind … HL02) -HL02 #HW0 #HT0 + lapply (reqx_bind_repl_dx … HT0 (BPair Abbr W2) ?) -HT0 + /2 width=1 by ext2_pair/ #HT0 + elim (teqx_inv_lifts_sn … HU13 … HVU1) -U1 #V3 #HVU3 #HV13 + /3 width=3 by cpx_theta/ ] qed-. lemma cpx_teqx_conf (G) (L): - ∀T0:term. ∀T1. ❪G,L❫ ⊢ T0 ⬈ T1 → ∀T2. T0 ≛ T2 → - ∃∃T. T1 ≛ T & ❪G,L❫ ⊢ T2 ⬈ T. -#G #L #T0 #T1 #HT01 #T2 #HT02 -elim (cpx_teqx_conf_rex … HT01 … HT02 L … L) -HT01 -HT02 -/2 width=3 by rex_refl, ex2_intro/ -qed-. + ∀T0:term. ∀T1. ❪G,L❫ ⊢ T0 ⬈ T1 → ∀T2. T0 ≛ T2 → ❪G,L❫ ⊢ T2 ⬈ T1. +/2 width=7 by cpx_teqx_repl_reqx/ qed-. lemma teqx_cpx_trans (G) (L): - ∀T2. ∀T0:term. T2 ≛ T0 → ∀T1. ❪G,L❫ ⊢ T0 ⬈ T1 → - ∃∃T. ❪G,L❫ ⊢ T2 ⬈ T & T ≛ T1. -#G #L #T2 #T0 #HT20 #T1 #HT01 -elim (cpx_teqx_conf … HT01 T2) -HT01 /3 width=3 by teqx_sym, ex2_intro/ + ∀T2. ∀T0:term. T2 ≛ T0 → ∀T1. ❪G,L❫ ⊢ T0 ⬈ T1 → ❪G,L❫ ⊢ T2 ⬈ T1. +/3 width=3 by cpx_teqx_conf, teqx_sym/ qed-. +lemma teqx_cpx (G) (L): + ∀T1,T2:term. T1 ≛ T2 → ❪G,L❫ ⊢ T1 ⬈ T2. +/2 width=3 by teqx_cpx_trans/ qed. + (* Basic_2A1: uses: cpx_lleq_conf *) lemma cpx_reqx_conf (G): - ∀L0,T0,T1. ❪G,L0❫ ⊢ T0 ⬈ T1 → ∀L2. L0 ≛[T0] L2 → - ∃∃T. ❪G,L2❫ ⊢ T0 ⬈ T & T1 ≛ T. -#G #L0 #T0 #T1 #HT01 #L2 #HL02 -elim (cpx_teqx_conf_rex … HT01 T0 … L0 … HL02) -HT01 -HL02 -/2 width=3 by rex_refl, ex2_intro/ -qed-. + ∀L0,T0,T1. ❪G,L0❫ ⊢ T0 ⬈ T1 → ∀L2. L0 ≛[T0] L2 → ❪G,L2❫ ⊢ T0 ⬈ T1. +/2 width=7 by cpx_teqx_repl_reqx/ qed-. (* Basic_2A1: uses: lleq_cpx_trans *) lemma reqx_cpx_trans (G): - ∀L2,L0,T0. L2 ≛[T0] L0 → ∀T1. ❪G,L0❫ ⊢ T0 ⬈ T1 → - ∃∃T. ❪G,L2❫ ⊢ T0 ⬈ T & T ≛ T1. -#G #L2 #L0 #T0 #HL20 #T1 #HT01 -elim (cpx_reqx_conf … HT01 L2) -HT01 -/3 width=3 by reqx_sym, teqx_sym, ex2_intro/ + ∀L2,L0,T0. L2 ≛[T0] L0 → ∀T1. ❪G,L0❫ ⊢ T0 ⬈ T1 → ❪G,L2❫ ⊢ T0 ⬈ T1. +/3 width=3 by cpx_reqx_conf, reqx_sym/ qed-. -lemma rpx_reqx_conf (G) (T): confluent2 … (rpx G T) (reqx T). -/3 width=6 by rpx_fsge_comp, reqx_fsge_comp, cpx_teqx_conf_rex, rex_conf/ qed-. +lemma rpx_reqx_conf (G) (T): + confluent1 … (rpx G T) (reqx T). +/3 width=7 by reqx_fsge_comp, cpx_teqx_repl_reqx, rex_conf1/ qed-. -lemma reqx_rpx_trans (G) (T): - ∀L2,K2. ❪G,L2❫ ⊢ ⬈[T] K2 → ∀L1. L1 ≛[T] L2 → - ∃∃K1. ❪G,L1❫ ⊢ ⬈[T] K1 & K1 ≛[T] K2. -#G #T #L2 #K2 #HLK2 #L1 #HL12 -elim (rpx_reqx_conf … HLK2 L1) -/3 width=3 by reqx_sym, ex2_intro/ -qed-. +lemma reqx_rpx_trans (G) (T) (L): + ∀L1. L1 ≛[T] L → ∀L2. ❪G,L❫ ⊢ ⬈[T] L2 → ❪G,L1❫ ⊢ ⬈[T] L2. +/3 width=3 by rpx_reqx_conf, reqx_sym/ qed-. + +lemma reqx_rpx (G) (T): + ∀L1,L2. L1 ≛[T] L2 → ❪G,L1❫ ⊢ ⬈[T] L2. +/2 width=3 by reqx_rpx_trans/ qed. -- 2.39.2