(* CONTEXT-SENSITIVE PARALLEL COMPUTATION ON TERMS **************************)
-(* Basic_1: includes: pr3_pr2 *)
definition cprs: lenv → relation term ≝
λL. TC … (cpr L).
(* Basic properties *********************************************************)
+(* Basic_1: was: pr3_pr2 *)
+lemma cpr_cprs: ∀L,T1,T2. L ⊢ T1 ➡ T2 → L ⊢ T1 ➡* T2.
+/2 width=1/ qed.
+
(* Basic_1: was: pr3_refl *)
lemma cprs_refl: ∀L,T. L ⊢ T ➡* T.
/2 width=1/ qed.
(* Basic properties *********************************************************)
+lemma fpr_fprs: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ➡ ⦃L2, T2⦄ → ⦃L1, T1⦄ ➡* ⦃L2, T2⦄.
+/2 width=1/ qed.
+
lemma fprs_refl: bi_reflexive … fprs.
/2 width=1/ qed.
(* Basic properties *********************************************************)
+lemma lfpr_lfprs: ∀L1,L2. ⦃L1⦄ ➡ ⦃L2⦄ → ⦃L1⦄ ➡* ⦃L2⦄.
+/2 width=1/ qed.
+
lemma lfprs_refl: ∀L. ⦃L⦄ ➡* ⦃L⦄.
/2 width=1/ qed.
lemma ltprs_refl: reflexive … ltprs.
/2 width=1/ qed.
+lemma ltpr_ltprs: ∀L1,L2. L1 ➡ L2 → L1 ➡* L2.
+/2 width=1/ qed.
+
lemma ltprs_strap1: ∀L1,L,L2. L1 ➡* L → L ➡ L2 → L1 ➡* L2.
/2 width=3/ qed.
lemma tprs_refl: reflexive … tprs.
/2 width=1/ qed.
+lemma tpr_tprs: ∀T1,T2. T1 ➡ T2 → T2 ➡* T2.
+/2 width=1/ qed.
+
lemma tprs_strap1: ∀T1,T,T2. T1 ➡* T → T ➡ T2 → T1 ➡* T2.
/2 width=3/ qed.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||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/static/ssta_ssta.ma".
+include "basic_2/computation/ygt.ma".
+include "basic_2/equivalence/fpcs_cpcs.ma".
+include "basic_2/dynamic/snv_ltpss_dx.ma".
+
+(* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************)
+
+(* Inductive premises for the preservation results **************************)
+(*
+definition IH_ssta_cprs: ∀h:sh. sd h → relation2 lenv term ≝
+ λh,g,L1,T1. ⦃h, L1⦄ ⊩ T1 :[g] →
+ ∀U1,l. ⦃h, L1⦄ ⊢ T1 •[g, l] U1 →
+ ∀L2. L1 ➡ L2 → ∀T2. L2 ⊢ T1 ➡* T2 →
+ ∃∃U2. ⦃h, L2⦄ ⊢ T2 •[g, l] U2 & ⦃L1, U1⦄ ⬌* ⦃L2, U2⦄.
+
+definition IH_snv_dxprs: ∀h:sh. sd h → relation2 lenv term ≝
+ λh,g,L1,T1. ⦃h, L1⦄ ⊩ T1 :[g] →
+ ∀L2. L1 ➡ L2 → ∀T2. ⦃h, L2⦄ ⊢ T1 •*➡*[g] T2 → ⦃h, L2⦄ ⊩ T2 :[g].
+
+fact ssta_cpcs_aux: ∀h,g,L,T1,T2. IH_ssta_cprs h g L T1 → IH_ssta_cprs h g L T2 →
+ ⦃h, L⦄ ⊩ T1 :[g] → ⦃h, L⦄ ⊩ T2 :[g] →
+ ∀U1,l1. ⦃h, L⦄ ⊢ T1 •[g, l1] U1 →
+ ∀U2,l2. ⦃h, L⦄ ⊢ T2 •[g, l2] U2 →
+ L ⊢ T1 ⬌* T2 →
+ l1 = l2 ∧ L ⊢ U1 ⬌* U2.
+#h #g #L #T1 #T2 #IH1 #IH2 #HT1 #HT2 #U1 #l1 #HTU1 #U2 #l2 #HTU2 #H
+elim (cpcs_inv_cprs … H) -H #T #H1 #H2
+elim (IH1 … HT1 … HTU1 … H1) -T1 // #W1 #H1 #HUW1
+elim (IH2 … HT2 … HTU2 … H2) -T2 // #W2 #H2 #HUW2
+elim (ssta_mono … H1 … H2) -T #H1 #H2 destruct
+lapply (fpcs_canc_dx … HUW1 … HUW2) -W2 #HU12
+lapply (fpcs_inv_cpcs … HU12) -HU12 /2 width=1/
+qed-.
+*)
+definition IH_ssta_ltpr_tpr: ∀h:sh. sd h → relation2 lenv term ≝
+ λh,g,L1,T1. ⦃h, L1⦄ ⊩ T1 :[g] →
+ ∀U1,l. ⦃h, L1⦄ ⊢ T1 •[g, l] U1 →
+ ∀L2. L1 ➡ L2 → ∀T2. T1 ➡ T2 →
+ ∃∃U2. ⦃h, L2⦄ ⊢ T2 •[g, l] U2 & ⦃L1, U1⦄ ⬌* ⦃L2, U2⦄.
+
+definition IH_snv_ltpr_tpr: ∀h:sh. sd h → relation2 lenv term ≝
+ λh,g,L1,T1. ⦃h, L1⦄ ⊩ T1 :[g] →
+ ∀L2. L1 ➡ L2 → ∀T2. T1 ➡ T2 → ⦃h, L2⦄ ⊩ T2 :[g].
+
+definition IH_snv_ssta: ∀h:sh. sd h → relation2 lenv term ≝
+ λh,g,L1,T1. ⦃h, L1⦄ ⊩ T1 :[g] →
+ ∀U1,l. ⦃h, L1⦄ ⊢ T1 •[g, l + 1] U1 → ⦃h, L1⦄ ⊩ U1 :[g].
+
+fact ssta_ltpr_cpr_aux: ∀h,g,L1,T1. IH_ssta_ltpr_tpr h g L1 T1 →
+ ⦃h, L1⦄ ⊩ T1 :[g] →
+ ∀U1,l. ⦃h, L1⦄ ⊢ T1 •[g, l] U1 →
+ ∀L2. L1 ➡ L2 → ∀T2. L2 ⊢ T1 ➡ T2 →
+ ∃∃U2. ⦃h, L2⦄ ⊢ T2 •[g, l] U2 & ⦃L1, U1⦄ ⬌* ⦃L2, U2⦄.
+#h #g #L1 #T1 #IH #HT1 #U1 #l #HTU1 #L2 #HL12 #T2 * #T #HT1T #HTT2
+elim (IH … HTU1 … HL12 … HT1T) // -HL12 -T1 #U #HTU #HU1
+elim (ssta_tpss_conf … HTU … HTT2) -T #U2 #HTU2 #HU2
+lapply (fpcs_fpr_strap1 … HU1 L2 U2 ?) -HU1 /2 width=3/ /3 width=3/
+qed-.
+
+fact snv_ltpr_cpr_aux: ∀h,g,L1,T1. IH_snv_ltpr_tpr h g L1 T1 →
+ ⦃h, L1⦄ ⊩ T1 :[g] →
+ ∀L2. L1 ➡ L2 → ∀T2. L2 ⊢ T1 ➡ T2 → ⦃h, L2⦄ ⊩ T2 :[g].
+#h #g #L1 #T1 #IH #HT1 #L2 #HL12 #T2 * #T #HT1T #HTT2
+lapply (IH … HL12 … HT1T) -HL12 // -T1 #HT0
+lapply (snv_tpss_conf … HT0 … HTT2) -T //
+qed-.
+
+fact snv_cprs_aux: ∀h,g,L0,T0.
+ (∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → IH_snv_ltpr_tpr h g L1 T1) →
+ ∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → ⦃h, L1⦄ ⊩ T1 :[g] →
+ ∀T2. L1 ⊢ T1 ➡* T2 → ⦃h, L1⦄ ⊩ T2 :[g].
+#h #g #L0 #T0 #IH #L1 #T1 #HLT0 #HT1 #T2 #H
+@(cprs_ind … H) -T2 // -HT1
+/4 width=6 by snv_ltpr_cpr_aux, ygt_cprs_trans/
+qed-.
+
+fact ssta_cprs_aux: ∀h,g,L0,T0.
+ (∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → IH_snv_ltpr_tpr h g L1 T1) →
+ (∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → IH_ssta_ltpr_tpr h g L1 T1) →
+ ∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → ⦃h, L1⦄ ⊩ T1 :[g] →
+ ∀U1,l. ⦃h, L1⦄ ⊢ T1 •[g, l] U1 → ∀T2. L1 ⊢ T1 ➡* T2 →
+ ∃∃U2. ⦃h, L1⦄ ⊢ T2 •[g, l] U2 & L1 ⊢ U1 ⬌* U2.
+#h #g #L0 #T0 #IH2 #IH1 #L1 #T1 #H01 #HT1 #U1 #l #HTU1 #T2 #H
+@(cprs_ind … H) -T2 [ /2 width=3/ ]
+#T #T2 #HT1T #HTT2 * #U #HTU #HU1
+elim (ssta_ltpr_cpr_aux … HTU … HTT2) //
+[2: /3 width=7 by snv_cprs_aux, ygt_cprs_trans/
+|3: /3 width=3 by ygt_cprs_trans/
+] -L0 -T0 -T1 -T #U2 #HTU2 #HU2
+lapply (fpcs_inv_cpcs … HU2) -HU2 #HU2
+lapply (cpcs_trans … HU1 … HU2) -U /2 width=3/
+qed-.
+
+fact ssta_cpcs_aux: ∀h,g,L0,T0.
+ (∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → IH_snv_ltpr_tpr h g L1 T1) →
+ (∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → IH_ssta_ltpr_tpr h g L1 T1) →
+ ∀L,T1,T2. h ⊢ ⦃L0, T0⦄ >[g] ⦃L, T1⦄ → h ⊢ ⦃L0, T0⦄ >[g] ⦃L, T2⦄ →
+ ⦃h, L⦄ ⊩ T1 :[g] → ⦃h, L⦄ ⊩ T2 :[g] →
+ ∀U1,l1. ⦃h, L⦄ ⊢ T1 •[g, l1] U1 →
+ ∀U2,l2. ⦃h, L⦄ ⊢ T2 •[g, l2] U2 →
+ L ⊢ T1 ⬌* T2 →
+ l1 = l2 ∧ L ⊢ U1 ⬌* U2.
+#h #g #L0 #T0 #IH2 #IH1 #L #T1 #T2 #HLT01 #HLT02 #HT1 #HT2 #U1 #l1 #HTU1 #U2 #l2 #HTU2 #H
+elim (cpcs_inv_cprs … H) -H #T #H1 #H2
+elim (ssta_cprs_aux … HLT01 HT1 … HTU1 … H1) -T1 /2 width=1/ #W1 #H1 #HUW1
+elim (ssta_cprs_aux … HLT02 HT2 … HTU2 … H2) -T2 /2 width=1/ #W2 #H2 #HUW2 -L0 -T0
+elim (ssta_mono … H1 … H2) -h -T #H1 #H2 destruct
+lapply (cpcs_canc_dx … HUW1 … HUW2) -W2 /2 width=1/
+qed-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/dynamic/snv_ltpss_sn.ma".
-include "basic_2/dynamic/snv_cpr_ssta.ma".
-
-(* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************)
-
-(* Properties on context-free parallel reduction for closures ***************)
-
-axiom snv_ltpr_tpr_aux: ∀h,g,n. (
- ∀L1,T1. ♯{L1, T1} < n →
- ∀U1,l. ⦃h, L1⦄ ⊢ T1 •[g, l] U1 →
- ∀L2. L1 ➡ L2 → ∀T2. T1 ➡ T2 → ⦃h, L1⦄ ⊩ T1 :[g] →
- ∃∃U2. ⦃h, L2⦄ ⊢ T2 •[g, l] U2 & ⦃L1, U1⦄ ⬌* ⦃L2, U2⦄
- ) → (
- ∀L1,T1. ♯{L1, T1} < n → ⦃h, L1⦄ ⊩ T1 :[g] →
- ∀L2. L1 ➡ L2 → ∀T2. ⦃h, L2⦄ ⊢ T1 •*➡*[g] T2 → ⦃h, L2⦄ ⊩ T2 :[g]
- ) →
- ∀L1,T1. ♯{L1, T1} = n → ⦃h, L1⦄ ⊩ T1 :[g] →
- ∀L2. L1 ➡ L2 → ∀T2. T1 ➡ T2 → ⦃h, L2⦄ ⊩ T2 :[g].
-(*
-#h #g #n #IH2 #IH1 #L1 * * [||||*]
-[ #k #Hn #H1 #L2 #_ #X #H2 destruct -IH2 -IH1 -L1
- >(tpr_inv_atom1 … H2) -X //
-| #i #Hn #H1 #L2 #HL12 #X #H2 destruct -IH2
- elim (snv_inv_lref … H1) -H1 #I #K1 #V1 #HLK1 #HV1
- >(tpr_inv_atom1 … H2) -X
- elim (ltpr_ldrop_conf … HLK1 … HL12) -HL12 #X #H #HLK2
- elim (ltpr_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct
- lapply (ldrop_pair2_fwd_fw … HLK1 (#i)) -HLK1 #HLK1
- lapply (IH1 … HV1 … HK12 V2 ?) -IH1 -HV1 -HK12 //
- [ @cprs_dxprs /3 width=1/ (**) (* auto: /4 width=1/ fails *)
- ] -HV12 /2 width=5/
-| #p #Hn #H1 #L2 #HL12 #X #H2 destruct -IH2
- elim (snv_inv_gref … H1)
-| #a #I #V1 #T1 #Hn #H1 #L2 #HL12 #X #H2 destruct -IH2
- elim (snv_inv_bind … H1) -H1 #HV1 #HT1
- elim (tpr_inv_bind1 … H2) -H2 *
- [ #V2 #T0 #T2 #HV12 #HT10 #HT02 #H destruct
- lapply (tps_lsubs_trans … HT02 (L2.ⓑ{I}V2) ?) -HT02 /2 width=1/ #HT02
- lapply (cpr_intro (L2.ⓑ{I}V2) … T2 0 1 HT10 ?) -HT10 /2 width=1/ -HT02 #HT12
- lapply (IH1 … HV1 … HL12 V2 ?) -HV1 //
- [ @cprs_dxprs /3 width=1/ (**) (* auto: /4 width=1/ fails *)
- ] #HV2
- lapply (IH1 … HT1 (L2.ⓑ{I}V2) … T2 ?) -IH1 -HT1 /3 width=1/
- | #T2 #HT12 #HXT2 #H1 #H2 destruct
- lapply (IH1 … HT1 (L2.ⓓV1) … T2 ?) -IH1 -HT1 // /2 width=2/
- [ @cprs_dxprs /3 width=1/ (**) (* auto: /4 width=1/ fails *)
- ] -HT12 -HL12 #HT2
- lapply (snv_inv_lift … HT2 L2 … HXT2) -T2 // /2 width=1/
- ]
-| #V1 #T1 #Hn #H1 #L2 #HL12 #X #H2 destruct
- elim (snv_inv_appl … H1) -H1 #a #W10 #W1 #U1 #l #HV1 #HT1 #HVW1 #HW10 #HTU1
- elim (tpr_inv_appl1 … H2) -H2 *
- [ #V2 #T2 #HV12 #HT12 #H destruct
- lapply (IH1 … HV1 … HL12 V2 ?)
- [ @cprs_dxprs /3 width=1/ (**) (* auto: /4 width=1/ fails *)
- | //
- ] #HV2
- lapply (IH1 … HT1 … HL12 T2 ?)
- [ @cprs_dxprs /3 width=1/ (**) (* auto: /4 width=1/ fails *)
- | //
- ] #HT2
- lapply (IH1 … HT1 … HTU1) -IH1 // #H
- elim (snv_inv_bind … H) -H #HW1 #HU1
- elim (IH2 … HVW1 … HL12 … HV12 HV1) -IH2 -HVW1 -HV12 -HV1 // #W2 #HVW2 #HW12
- lapply (fpcs_canc_sn L1 L1 … W10 W1 … HW12) -HW12 /3 width=1/ -W10 #HW12
- @(snv_appl … HV2 HT2 HVW2)
-*)
-
-fact snv_cpr_aux: ∀h,g,n. (
- ∀L1,T1. ♯{L1, T1} < n →
- ∀U1,l. ⦃h, L1⦄ ⊢ T1 •[g, l] U1 →
- ∀L2. ⦃L1⦄ ➡ ⦃L2⦄ → ∀T2. L2 ⊢ T1 ➡ T2 → ⦃h, L1⦄ ⊩ T1 :[g] →
- ∃∃U2. ⦃h, L2⦄ ⊢ T2 •[g, l] U2 & ⦃L1, U1⦄ ⬌* ⦃L2, U2⦄
- ) → (
- ∀L1,T1. ♯{L1, T1} < n → ⦃h, L1⦄ ⊩ T1 :[g] →
- ∀L2. ⦃L1⦄ ➡ ⦃L2⦄ → ∀T2. ⦃h, L2⦄ ⊢ T1 •*➡*[g] T2 → ⦃h, L2⦄ ⊩ T2 :[g]
- ) →
- ∀L1,T1. ♯{L1, T1} = n → ⦃h, L1⦄ ⊩ T1 :[g] →
- ∀T2. L1 ⊢ T1 ➡ T2 → ⦃h, L1⦄ ⊩ T2 :[g].
-#h #g #n #IH2 #IH1 #L1 #T1 #Hn #HT1 #T2 * #T0 #HT10 #HT02
-lapply (snv_ltpr_tpr_aux … Hn HT1 … HT10) -Hn -HT1 -HT10 [ // | skip | /3 width=6/ | /3 width=5/ ] -n -T1 #HT0
-lapply (snv_tpss_conf … HT0 … HT02) -T0 //
-qed-.
-
-fact snv_lfpr_aux: ∀h,g,n. (
- ∀L1,T1. ♯{L1, T1} < n →
- ∀U1,l. ⦃h, L1⦄ ⊢ T1 •[g, l] U1 →
- ∀L2. ⦃L1⦄ ➡ ⦃L2⦄ → ∀T2. L2 ⊢ T1 ➡ T2 → ⦃h, L1⦄ ⊩ T1 :[g] →
- ∃∃U2. ⦃h, L2⦄ ⊢ T2 •[g, l] U2 & ⦃L1, U1⦄ ⬌* ⦃L2, U2⦄
- ) → (
- ∀L1,T1. ♯{L1, T1} < n → ⦃h, L1⦄ ⊩ T1 :[g] →
- ∀L2. ⦃L1⦄ ➡ ⦃L2⦄ → ∀T2. ⦃h, L2⦄ ⊢ T1 •*➡*[g] T2 → ⦃h, L2⦄ ⊩ T2 :[g]
- ) →
- ∀L1,T1. ♯{L1, T1} = n → ⦃h, L1⦄ ⊩ T1 :[g] →
- ∀L2. ⦃L1⦄ ➡ ⦃L2⦄ → ⦃h, L2⦄ ⊩ T1 :[g].
-#h #g #n #IH2 #IH1 #L1 #T1 #Hn #HT1 #L2 * #L #HL1 #HL2
-lapply (snv_ltpr_tpr_aux … Hn HT1 … HL1 ??) -Hn -HT1 -HL1 [ // | skip | /3 width=6/ | /3 width=5/ ] -n -L1 #HT1
-lapply (snv_ltpss_sn_conf … HL2 … HT1) -L //
-qed-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/static/ssta_ltpss_sn.ma".
-include "basic_2/computation/dxprs_lift.ma".
-include "basic_2/equivalence/lsubse_ssta.ma".
-include "basic_2/equivalence/fpcs_cpcs.ma".
-include "basic_2/equivalence/lfpcs_fpcs.ma".
-include "basic_2/dynamic/snv_ssta.ma".
-
-(* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************)
-
-(* Properties on context-sensitive parallel reduction for terms *************)
-
-fact ssta_ltpr_tpr_aux: ∀h,g,n. (
- ∀L,T2. ♯{L,T2} < n →
- ∀T1. L ⊢ T1 ⬌* T2 → ⦃h, L⦄ ⊩ T1 :[g] → ⦃h, L⦄ ⊩ T2 :[g] →
- ∀U1,l1. ⦃h, L⦄ ⊢ T1 •[g, l1] U1 →
- ∀U2,l2. ⦃h, L⦄ ⊢ T2 •[g, l2] U2 →
- L ⊢ U1 ⬌* U2 ∧ l1 = l2
- ) → (
- ∀L,T. ♯{L,T} < n → ⦃h, L⦄ ⊩ T :[g] →
- ∀U,l. ⦃h, L⦄ ⊢ T •[g, l + 1] U → ⦃h, L⦄ ⊩ U :[g]
- ) → (
- ∀L1,T1. ♯{L1,T1} < n →
- ∀U1,l. ⦃h, L1⦄ ⊢ T1 •[g, l] U1 →
- ∀L2. L1 ➡ L2 → ∀T2. T1 ➡ T2 → ⦃h, L1⦄ ⊩ T1 :[g] →
- ∃∃U2. ⦃h, L2⦄ ⊢ T2 •[g, l] U2 & ⦃L1, U1⦄ ⬌* ⦃L2, U2⦄
- ) →
- ∀L1,T1. ♯{L1,T1} = n →
- ∀U1,l. ⦃h, L1⦄ ⊢ T1 •[g, l] U1 →
- ∀L2. L1 ➡ L2 → ∀T2. T1 ➡ T2 → ⦃h, L1⦄ ⊩ T1 :[g] →
- ∃∃U2. ⦃h, L2⦄ ⊢ T2 •[g, l] U2 & ⦃L1, U1⦄ ⬌* ⦃L2, U2⦄.
-#h #g #n #IH3 #IH2 #IH1 #L1 * * [|||| *]
-[ #k #_ #Y #l #H1 #L2 #HL12 #X #H2 #_ -IH3 -IH2 -IH1
- elim (ssta_inv_sort1 … H1) -H1 #Hkl #H destruct
- >(tpr_inv_atom1 … H2) -X /4 width=6/
-| #i #Hn #U1 #l #H1 #L2 #HL12 #X #H2 #H3 destruct -IH3 -IH2
- elim (ssta_inv_lref1 … H1) -H1 * #K1
- >(tpr_inv_atom1 … H2) -X
- elim (snv_inv_lref … H3) -H3 #I0 #K0 #V0 #H #HV1
- [ #V1 #W1 #HLK1 #HVW1 #HWU1
- lapply (ldrop_mono … H … HLK1) -H #H destruct
- lapply (ldrop_pair2_fwd_fw … HLK1 (#i)) #HKV1
- elim (ltpr_ldrop_conf … HLK1 … HL12) #X #H #HLK2
- elim (ltpr_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct
- elim (IH1 … HVW1 K2 … HV12) -IH1 -HVW1 -HV12 // -HV1 -HKV1 #W2 #HVW2 #HW12
- lapply (ldrop_fwd_ldrop2 … HLK1) -V1 #H1
- lapply (ldrop_fwd_ldrop2 … HLK2) #H2
- elim (lift_total W2 0 (i+1)) #U2 #HWU2
- lapply (fpcs_lift … HW12 … H1 H2 … HWU1 … HWU2) -H1 -H2 -W1 [ /3 width=1/ ] /3 width=6/
- | #V1 #W1 #l0 #HLK1 #HVW1 #HVU1 #H destruct
- lapply (ldrop_mono … H … HLK1) -H #H destruct
- lapply (ldrop_pair2_fwd_fw … HLK1 (#i)) #HKV1
- elim (ltpr_ldrop_conf … HLK1 … HL12) -HLK1 #X #H #HLK2
- elim (ltpr_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct
- elim (IH1 … HVW1 K2 … HV12) -IH1 -HVW1 // -HV1 -HK12 -HKV1 #W2 #HVW2 #_ -W1
- elim (lift_total V2 0 (i+1)) #U2 #HVU2
- lapply (tpr_lift … HV12 … HVU1 … HVU2) -V1 /4 width=6/
- ]
-| #p #Hn #U1 #l #H1 -IH3 -IH1
- elim (ssta_inv_gref1 … H1)
-| #a #I #V1 #T1 #Hn #Y #l #H1 #L2 #HL12 #X #H2 #H3 destruct -IH3 -IH2
- elim (ssta_inv_bind1 … H1) -H1 #U1 #HTU1 #H destruct
- elim (snv_inv_bind … H3) -H3 #_ #HT1
- elim (tpr_inv_bind1 … H2) -H2 *
- [ #V2 #T0 #T2 #HV12 #HT10 #HT02 #H destruct
- elim (IH1 … HTU1 (L2.ⓑ{I}V2) … HT10) -IH1 -HTU1 -HT10 // -T1 /3 width=1/ -HL12 #U0 #HTU0 #HU10
- lapply (tps_lsubs_trans … HT02 (L2.ⓑ{I}V2) ?) -HT02 [ /2 width=1/ ] #HT02
- elim (ssta_tps_conf … HTU0 … HT02) -T0 #U2 #HTU2 #HU02
- lapply (cpr_intro … U0 … HU02) -HU02 // #HU02
- lapply (fpcs_fpr_strap1 … HU10 (L2.ⓑ{I}V2) U2 ?) [ /2 width=1/ ] -U0 #HU12
- lapply (fpcs_fwd_shift … HU12 a) -HU12 /3 width=3/
- | #T2 #HT12 #HT2 #H1 #H2 destruct
- elim (IH1 … HTU1 (L2.ⓓV1) … HT12) -IH1 -HTU1 -HT12 // -T1 [2: /3 width=1/ ] -HL12 #U2 #HTU2 #HU12
- lapply (fpcs_fwd_shift … HU12 true) -HU12 #HU12
- elim (ssta_inv_lift1 … HTU2 … HT2) -T2 [3: /2 width=1/ |2: skip ] #U #HXU #HU2
- lapply (fpcs_fpr_strap1 … HU12 L2 U ?) -HU12 [ /3 width=3/ ] -U2 /2 width=3/
- ]
-| #V1 #T1 #Hn #Y #l #H1 #L2 #HL12 #X #H2 #H3 destruct
- elim (ssta_inv_appl1 … H1) -H1 #U1 #HTU1 #H destruct
- elim (snv_inv_appl … H3) -H3 #a #W1 #W10 #U10 #l0 #HV1 #HT1 #HVW1 #HW10 #HTU10
- elim (tpr_inv_appl1 … H2) -H2 *
- [ #V2 #T2 #HV12 #HT12 #H destruct -a -l0 -W1 -W10 -U10 -HV1 -IH3 -IH2
- elim (IH1 … HTU1 … HL12 … HT12 HT1) -IH1 -HTU1 -HL12 -HT12 -HT1 // /3 width=5/
- | #b #V2 #W #T2 #T20 #HV12 #HT20 #H1 #H2 destruct
- elim (snv_inv_bind … HT1) -HT1 #HW #HT2
- elim (ssta_inv_bind1 … HTU1) -HTU1 #U2 #HTU2 #H destruct
- elim (dxprs_inv_abst1 … HTU10) -HTU10 #W0 #U0 #HW0 #_ #H destruct
- lapply (cprs_div … HW10 … HW0) -W0 #HW1
- elim (ssta_fwd_correct … HVW1) <minus_plus_m_m #X1 #HWX1
- elim (snv_ssta … HW) #V #l1 #HWV
- elim (IH3 … HW1 … HW … HWX1 … HWV) -IH3 -HWX1 // [2: /2 width=5/ ] -IH2 #_ #H destruct -X1
- elim (IH1 … HVW1 … HL12 … HV12) -HVW1 // -HV1 #W2 #HVW2 #HW12
- elim (IH1 … HWV … HL12 W) -HWV // -HW #V0 #HWV0 #_
- elim (IH1 … HTU2 (L2.ⓛW) … HT20 HT2) -IH1 -HTU2 -HT20 -HT2 // [2: /2 width=1/ ] #U20 #HTU20 #HU20
- lapply (lfpr_inv_fpr L1 L2 … W) [ /2 width=1/ ] -HL12 #HL12
- elim (lsubse_ssta_trans … HTU20 (L2.ⓓV2) ?) -HTU20
- [ #U #HTU20 #HU20 -HWV0 -HL12 -W1 -W2
- @(ex2_intro … (ⓓ{b}V2.U)) [ /2 width=1/ ] -h -l -l1 -V -V0 -T2 -T20 -U0
- @(fpcs_fprs_strap2 ? L1 … (ⓓ{b}V2.U2)) [ /4 width=1/ ] -V1
- /4 width=4 by fpcs_fwd_shift, fpcs_canc_dx, cpcs_fpcs, fpcs_fwd_abst13/
- | -b -l -V -V1 -T2 -T20 -U0 -U2 -U20
- /6 width=6 by lsubse_abbr, fpcs_inv_cpcs, fpcs_canc_sn, fpcs_fprs_strap1, cpcs_fpcs, bi_inj/
- ]
- | #b #V0 #V2 #W0 #W2 #T0 #T2 #HV10 #HW02 #HT02 #HV02 #H1 #H2 destruct -a -l0 -W1 -W10 -HV1 -IH3 -IH2
- elim (ssta_inv_bind1 … HTU1) -HTU1 #U0 #HTU0 #H destruct
- elim (snv_inv_bind … HT1) -HT1 #_ #HT0
- elim (IH1 … HTU0 (L2.ⓓW2) … HT02 HT0) -IH1 -HTU0 -HT02 -HT0 // -T0 [2: /2 width=1/ ] -HL12 -HW02 #U2 #HTU2 #HU02
- lapply (fpcs_fwd_shift … HU02 b) -HU02 #HU02
- lapply (fpcs_flat_dx_tpr … HU02 … HV10 Appl) -HV10 -HU02 #HU02
- lapply (fpcs_fpr_strap1 … HU02 L2 (ⓓ{b}W2.ⓐV2.U2) ?) -HU02 [ @ltpr_tpr_fpr // /2 width=3/ ] -V0 /4 width=3/
- ]
-| #U0 #T1 #Hn #U1 #l #H1 #L2 #HL12 #X #H2 #H3 destruct -IH3 -IH2
- lapply (ssta_inv_cast1 … H1) -H1 #HTU1
- elim (snv_inv_cast … H3) -H3 #T0 #l0 #_ #HT1 #HT10 #_
- elim (ssta_mono … HT10 … HTU1) -HT10 #H1 #H2 destruct
- elim (tpr_inv_cast1 … H2) -H2
- [ * #U2 #T2 #_ #HT12 #H destruct
- elim (IH1 … HTU1 … HL12 … HT12 HT1) -IH1 -HTU1 -HL12 -HT12 -HT1 // -T1 -U0 /3 width=3/
- | #HT1X
- elim (IH1 … HTU1 … HL12 … HT1X HT1) -IH1 -HTU1 -HL12 -HT1X -HT1 // -U0 -T1 /2 width=3/
- ]
-]
-qed-.
-
-fact ssta_cpr_aux: ∀h,g,n. (
- ∀L,T2. ♯{L,T2} < n →
- ∀T1. L ⊢ T1 ⬌* T2 → ⦃h, L⦄ ⊩ T1 :[g] → ⦃h, L⦄ ⊩ T2 :[g] →
- ∀U1,l1. ⦃h, L⦄ ⊢ T1 •[g, l1] U1 →
- ∀U2,l2. ⦃h, L⦄ ⊢ T2 •[g, l2] U2 →
- L ⊢ U1 ⬌* U2 ∧ l1 = l2
- ) → (
- ∀L,T. ♯{L,T} < n → ⦃h, L⦄ ⊩ T :[g] →
- ∀U,l. ⦃h, L⦄ ⊢ T •[g, l + 1] U → ⦃h, L⦄ ⊩ U :[g]
- ) → (
- ∀L1,T1. ♯{L1,T1} < n →
- ∀U1,l. ⦃h, L1⦄ ⊢ T1 •[g, l] U1 →
- ∀L2. ⦃L1⦄ ➡ ⦃L2⦄ → ∀T2. L2 ⊢ T1 ➡ T2 → ⦃h, L1⦄ ⊩ T1 :[g] →
- ∃∃U2. ⦃h, L2⦄ ⊢ T2 •[g, l] U2 & ⦃L1, U1⦄ ⬌* ⦃L2, U2⦄
- ) →
- ∀L1,T1. ♯{L1,T1} = n →
- ∀U1,l. ⦃h, L1⦄ ⊢ T1 •[g, l] U1 →
- ∀T2. L1 ⊢ T1 ➡ T2 → ⦃h, L1⦄ ⊩ T1 :[g] →
- ∃∃U2. ⦃h, L1⦄ ⊢ T2 •[g, l] U2 & L1 ⊢ U1 ⬌* U2.
-#h #g #n #IH3 #IH2 #IH1 #L1 #T1 #Hn #U1 #l #HTU1 #T2 * #T0 #HT10 #HT02 #HT1
-elim (ssta_ltpr_tpr_aux … IH3 IH2 … Hn … HTU1 … HT10 HT1)
--T1 -IH3 -IH2 [3: // |2: skip |4: /3 width=5/ ] -n #U0 #HTU0 #HU10
-lapply (fpcs_inv_cpcs … HU10) -HU10 #HU10
-elim (ssta_tpss_conf … HTU0 … HT02) -T0 #U2 #HTU2 #HU02
-lapply (cpcs_cpr_strap1 … HU10 U2 ?) -HU10 /2 width=3/
-qed-.
-
-fact ssta_lfpr_aux: ∀h,g,n. (
- ∀L,T2. ♯{L,T2} < n →
- ∀T1. L ⊢ T1 ⬌* T2 → ⦃h, L⦄ ⊩ T1 :[g] → ⦃h, L⦄ ⊩ T2 :[g] →
- ∀U1,l1. ⦃h, L⦄ ⊢ T1 •[g, l1] U1 →
- ∀U2,l2. ⦃h, L⦄ ⊢ T2 •[g, l2] U2 →
- L ⊢ U1 ⬌* U2 ∧ l1 = l2
- ) → (
- ∀L,T. ♯{L,T} < n → ⦃h, L⦄ ⊩ T :[g] →
- ∀U,l. ⦃h, L⦄ ⊢ T •[g, l + 1] U → ⦃h, L⦄ ⊩ U :[g]
- ) → (
- ∀L1,T1. ♯{L1,T1} < n →
- ∀U1,l. ⦃h, L1⦄ ⊢ T1 •[g, l] U1 →
- ∀L2. ⦃L1⦄ ➡ ⦃L2⦄ → ∀T2. L2 ⊢ T1 ➡ T2 → ⦃h, L1⦄ ⊩ T1 :[g] →
- ∃∃U2. ⦃h, L2⦄ ⊢ T2 •[g, l] U2 & ⦃L1, U1⦄ ⬌* ⦃L2, U2⦄
- ) →
- ∀L1,T1. ♯{L1,T1} = n →
- ∀U1,l. ⦃h, L1⦄ ⊢ T1 •[g, l] U1 →
- ∀L2. ⦃L1⦄ ➡ ⦃L2⦄ → ⦃h, L1⦄ ⊩ T1 :[g] →
- ∃∃U2. ⦃h, L2⦄ ⊢ T1 •[g, l] U2 & ⦃L1, U1⦄ ⬌* ⦃L2, U2⦄.
-#h #g #n #IH3 #IH2 #IH1 #L1 #T1 #Hn #U1 #l #HTU1 #L2 * #L #HL1 #HL2 #HT1
-elim (ssta_ltpr_tpr_aux … IH3 IH2 … Hn … HTU1 … HL1 … HT1) -HTU1 -HL1 -HT1
--IH3 -IH2 [3: // |2: skip |4: /3 width=5/ ] -n #U0 #HTU0 #HU10
-elim (ssta_ltpss_sn_conf … HTU0 … HL2) -HTU0 #U2 #HTU2 #HU02
-lapply (fpcs_fpr_strap1 … HU10 L U2 ?) -HU10 /3 width=3/ -HU02 #HU12
-lapply (fpcs_fpr_strap1 … HU12 L2 U2 ?) /2 width=3/ -h -L1 -T1 -U1 -U0 -l /3 width=4/
-qed-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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/computation/ygt.ma".
-include "basic_2/dynamic/snv_cpr.ma".
-
-(* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************)
-
-(* Properties on context-free parallel computation for closures *************)
-
-fact ssta_cprs_aux: ∀h,g,L0,T0. (
- ∀L,T2. h ⊢ ⦃L0, T0⦄ >[g] ⦃L, T2⦄ →
- ∀T1. L ⊢ T1 ⬌* T2 → ⦃h, L⦄ ⊩ T1 :[g] → ⦃h, L⦄ ⊩ T2 :[g] →
- ∀U1,l1. ⦃h, L⦄ ⊢ T1 •[g, l1] U1 →
- ∀U2,l2. ⦃h, L⦄ ⊢ T2 •[g, l2] U2 →
- L ⊢ U1 ⬌* U2 ∧ l1 = l2
- ) → (
- ∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → ⦃h, L1⦄ ⊩ T1 :[g] →
- ∀L2. ⦃L1⦄ ➡ ⦃L2⦄ → ∀T2. ⦃h, L2⦄ ⊢ T1 •*➡*[g] T2 → ⦃h, L2⦄ ⊩ T2 :[g]
- ) → (
- ∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ →
- ∀U1,l. ⦃h, L1⦄ ⊢ T1 •[g, l] U1 → ⦃h, L1⦄ ⊩ T1 :[g] →
- ∀L2. ⦃L1⦄ ➡ ⦃L2⦄ → ∀T2. L2 ⊢ T1 ➡* T2 →
- ∃∃U2. ⦃h, L2⦄ ⊢ T2 •[g, l] U2 & ⦃L1, U1⦄ ⬌* ⦃L2, U2⦄
- ) →
- ∀L1,T1,T2. L1 ⊢ T1 ➡* T2 → L0 = L1 → T0 = T1 →
- ∀U1,l. ⦃h, L1⦄ ⊢ T1 •[g, l] U1 → ⦃h, L1⦄ ⊩ T1 :[g] →
- ∃∃U2. ⦃h, L1⦄ ⊢ T2 •[g, l] U2 & L1 ⊢ U1 ⬌* U2.
-#h #g #L0 #T0 #IH3 #IH2 #IH1 #L1 #T1 #T2 #H
-@(cprs_ind_dx … H) -T1 [ /2 width=3/ ]
-#T1 #T #HT1T #HTT2 #IH #H1 #H2 #U1 #l #HTU1 #HT1 destruct
-elim (term_eq_dec T1 T) #H destruct [ /2 width=1/ ] -IH
-elim (ssta_cpr_aux … HTU1 … HT1T HT1) -HTU1
-[2: // |3: skip |4,5,6: /3 width=9 by inj, dxprs_strap2, fw_ygt/ ] -IH3 #U #HTU #HU1
-lapply (snv_cpr_aux … HT1 … HT1T) -HT1
-[ // | skip |3,4: /3 width=6 by inj, fw_ygt/ ] -IH2 #HT
-elim (IH1 … HTU HT … HTT2) -IH1 -HTU -HT -HTT2 // [2: /3 width=1/ ] -T #U2 #HTU2 #HU2
-lapply (fpcs_inv_cpcs … HU2) -HU2 #HU2
-lapply (cpcs_trans … HU1 … HU2) -U /2 width=3/
-qed-.
-
-fact snv_cprs_aux: ∀h,g,L0,T0. (
- ∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ →
- ∀U1,l. ⦃h, L1⦄ ⊢ T1 •[g, l] U1 →
- ∀L2. ⦃L1⦄ ➡ ⦃L2⦄ → ∀T2. L2 ⊢ T1 ➡* T2 → ⦃h, L1⦄ ⊩ T1 :[g] →
- ∃∃U2. ⦃h, L2⦄ ⊢ T2 •[g, l] U2 & ⦃L1, U1⦄ ⬌* ⦃L2, U2⦄
- ) → (
- ∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → ⦃h, L1⦄ ⊩ T1 :[g] →
- ∀L2. ⦃L1⦄ ➡ ⦃L2⦄ → ∀T2. ⦃h, L2⦄ ⊢ T1 •*➡*[g] T2 → ⦃h, L2⦄ ⊩ T2 :[g]
- ) →
- ∀L1,T1. L0 = L1 → T0 = T1 → ⦃h, L1⦄ ⊩ T1 :[g] →
- ∀T2. L1 ⊢ T1 ➡* T2 → ⦃h, L1⦄ ⊩ T2 :[g].
-#h #g #L0 #T0 #IH2 #IH1 #L1 #T1 #H1 #H2 #HT1 #T2 #H
-@(cprs_ind … H) -T2 // -HT1
-#T #T2 #HT1T #HTT2 #HT destruct
-lapply (snv_cpr_aux … HT … HTT2) -HT -HTT2 [1,5: // |2: skip ]
-/4 width=6 by cprs_ygt_trans, inj, fw_ygt/
-qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||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/dynamic/snv_ltpr_ssta.ma".
+
+(* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************)
+
+(* Properties on context-free parallel reduction for local environments *****)
+
+fact snv_ltpr_tpr_aux: ∀h,g,L0,T0.
+ (∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → IH_ssta_ltpr_tpr h g L1 T1) →
+ (∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → IH_snv_ltpr_tpr h g L1 T1) →
+ ∀L1,T1. L0 = L1 → T0 = T1 → IH_snv_ltpr_tpr h g L1 T1.
+#h #g #L0 #T0 #IH2 #IH1 #L1 * * [||||*]
+[ #k #HL0 #HT0 #H1 #L2 #_ #X #H2 destruct -IH2 -IH1 -L1
+ >(tpr_inv_atom1 … H2) -X //
+| #i #HL0 #HT0 #H1 #L2 #HL12 #X #H2 destruct -IH2
+ elim (snv_inv_lref … H1) -H1 #I #K1 #V1 #HLK1 #HV1
+ >(tpr_inv_atom1 … H2) -X
+ elim (ltpr_ldrop_conf … HLK1 … HL12) -HL12 #X #H #HLK2
+ elim (ltpr_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct
+ lapply (ldrop_pair2_fwd_fw … HLK1 (#i)) -HLK1 #HLK1
+ lapply (IH1 … HK12 … HV12) -IH1 -HV12 -HK12 // -HV1 [ /2 width=1/ ] -HLK1 /2 width=5/
+| #p #HL0 #HT0 #H1 #L2 #HL12 #X #H2 destruct -IH2 -IH1
+ elim (snv_inv_gref … H1)
+| #a #I #V1 #T1 #HL0 #HT0 #H1 #L2 #HL12 #X #H2 destruct -IH2
+ elim (snv_inv_bind … H1) -H1 #HV1 #HT1
+ elim (tpr_inv_bind1 … H2) -H2 *
+ [ #V2 #T0 #T2 #HV12 #HT10 #HT02 #H destruct
+ lapply (tps_lsubs_trans … HT02 (L2.ⓑ{I}V2) ?) -HT02 /2 width=1/ #HT02
+ lapply (IH1 … HL12 … HV12) // [ /2 width=1/ ] #HV2
+ lapply (snv_ltpr_cpr_aux … HT1 (L2.ⓑ{I}V2) … T2 ?) -HT1
+ [ /3 width=5 by cpr_intro, tps_tpss/ | /2 width=1/ | /3 width=1/ ] -IH1 -T0 /2 width=1/
+ | #T2 #HT12 #HXT2 #H1 #H2 destruct
+ lapply (IH1 … HT1 (L2.ⓓV1) … HT12) -IH1 -HT1 -HT12 [1,2: /2 width=1/ ] -HL12 #HT2
+ lapply (snv_inv_lift … HT2 L2 … HXT2) -T2 // /2 width=1/
+ ]
+| #V1 #T1 #HL0 #HT0 #H1 #L2 #HL12 #X #H2 destruct
+ elim (snv_inv_appl … H1) -H1 #a #W10 #W1 #U1 #l #HV1 #HT1 #HVW1 #HW10 #HTU1
+ elim (tpr_inv_appl1 … H2) -H2 *
+ [ #V2 #T2 #HV12 #HT12 #H destruct
+ lapply (IH1 … HV1 … HL12 … HV12) [ /2 width=1/ ] #HV2
+ lapply (IH1 … HT1 … HL12 … HT12) [ /2 width=1/ ] #HT2
+ elim (IH2 … HVW1 … HL12 … HV12) -IH2 -HVW1 -HV12 // -HV1 [2: /2 width=1/ ] #W2 #HVW2 #HW12
+ lapply (fpcs_canc_sn L1 L1 … W10 W1 … HW12) -HW12 /3 width=1/ -W10 #HW12
+ @(snv_appl … HV2 HT2 HVW2)
+(*
+ lapply (IH1 … HT1 … HTU1) -IH1 // #H
+ elim (snv_inv_bind … H) -H #HW1 #HU1
+ elim (IH2 … HVW1 … HL12 … HV12 HV1) -IH2 -HVW1 -HV12 -HV1 // #W2 #HVW2 #HW12
+*)
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||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/static/ssta_ltpss_sn.ma".
+include "basic_2/equivalence/lsubse_ssta.ma".
+include "basic_2/equivalence/lfpcs_fpcs.ma".
+include "basic_2/dynamic/snv_ssta.ma".
+include "basic_2/dynamic/snv_cpcs.ma".
+
+(* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************)
+
+(* Properties on context-free parallel reduction for local environments *****)
+
+fact ssta_ltpr_tpr_aux: ∀h,g,L0,T0.
+ (∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → IH_snv_ssta h g L1 T1) →
+ (∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → IH_snv_ltpr_tpr h g L1 T1) →
+ (∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → IH_ssta_ltpr_tpr h g L1 T1) →
+ ∀L1,T1. L0 = L1 → T0 = T1 → IH_ssta_ltpr_tpr h g L1 T1.
+#h #g #L0 #T0 #IH3 #IH2 #IH1 #L1 * * [|||| *]
+[ #k #_ #_ #_ #X2 #l #H2 #L2 #HL12 #X3 #H3 -IH3 -IH2 -IH1
+ elim (ssta_inv_sort1 … H2) -H2 #Hkl #H destruct
+ >(tpr_inv_atom1 … H3) -X3 /4 width=6/
+| #i #HL0 #HT0 #H1 #X2 #l #H2 #L2 #HL12 #X3 #H3 destruct -IH3 -IH2
+ elim (snv_inv_lref … H1) -H1 #I0 #K0 #V0 #H #HV1
+ elim (ssta_inv_lref1 … H2) -H2 * #K1
+ >(tpr_inv_atom1 … H3) -X3
+ [ #V1 #W1 #HLK1 #HVW1 #HWU1
+ lapply (ldrop_mono … H … HLK1) -H #H destruct
+ lapply (ldrop_pair2_fwd_fw … HLK1 (#i)) #HKV1
+ elim (ltpr_ldrop_conf … HLK1 … HL12) #X #H #HLK2
+ elim (ltpr_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct
+ elim (IH1 … HVW1 … HK12 … HV12) -IH1 -HVW1 -HV12 // [2: /2 width=1/ ] -HV1 -HKV1 #W2 #HVW2 #HW12
+ lapply (ldrop_fwd_ldrop2 … HLK1) -V1 #H1
+ lapply (ldrop_fwd_ldrop2 … HLK2) #H2
+ elim (lift_total W2 0 (i+1)) #U2 #HWU2
+ lapply (fpcs_lift … HW12 … H1 H2 … HWU1 … HWU2) -H1 -H2 -W1 [ /3 width=1/ ] /3 width=6/
+ | #V1 #W1 #l0 #HLK1 #HVW1 #HVU1 #H destruct
+ lapply (ldrop_mono … H … HLK1) -H #H destruct
+ lapply (ldrop_pair2_fwd_fw … HLK1 (#i)) #HKV1
+ elim (ltpr_ldrop_conf … HLK1 … HL12) -HLK1 #X #H #HLK2
+ elim (ltpr_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct
+ elim (IH1 … HVW1 … HK12 … HV12) -IH1 -HVW1 -HK12 // [2: /2 width=1/ ] -HV1 -HKV1 #W2 #HVW2 #_ -W1
+ elim (lift_total V2 0 (i+1)) #U2 #HVU2
+ lapply (tpr_lift … HV12 … HVU1 … HVU2) -V1 /4 width=6/
+ ]
+| #p #_ #HT0 #H1 destruct -IH3 -IH2 -IH1
+ elim (snv_inv_gref … H1)
+| #a #I #V1 #T1 #HL0 #HT0 #H1 #X2 #l #H2 #L2 #HL12 #X3 #H3 destruct -IH3 -IH2
+ elim (snv_inv_bind … H1) -H1 #_ #HT1
+ elim (ssta_inv_bind1 … H2) -H2 #U1 #HTU1 #H destruct
+ elim (tpr_inv_bind1 … H3) -H3 *
+ [ #V2 #T0 #T2 #HV12 #HT10 #HT02 #H destruct
+ lapply (tps_lsubs_trans … HT02 (L2.ⓑ{I}V2) ?) -HT02 [ /2 width=1/ ] #HT02
+ elim (ssta_ltpr_cpr_aux … HT1 … HTU1 (L2.ⓑ{I}V2) … T2) -HT1 -HTU1
+ [2: /3 width=5 by cpr_intro, tps_tpss/ |3: /2 width=1/ |4: /3 width=1/ ] -IH1 -T0 -HL12 -HV12 #U2 #HTU2 #HU12
+ lapply (fpcs_fwd_shift … HU12 a) -HU12 /3 width=3/
+ | #T2 #HT12 #HT2 #H1 #H2 destruct
+ elim (IH1 … HTU1 (L2.ⓓV1) … T2) -IH1 -HTU1 // [2,3: /2 width=1/ ] -T1 -HL12 #U2 #HTU2 #HU12
+ lapply (fpcs_fwd_shift … HU12 true) -HU12 #HU12
+ elim (ssta_inv_lift1 … HTU2 … HT2) -T2 [3: /2 width=1/ |2: skip ] #U #HXU #HU2
+ lapply (fpcs_fpr_strap1 … HU12 L2 U ?) -HU12 [ /3 width=3/ ] -U2 /2 width=3/
+ ]
+| #V1 #T1 #HL0 #HT0 #H1 #X2 #l #H2 #L2 #HL12 #X3 #H3 destruct
+ elim (snv_inv_appl … H1) -H1 #a #W1 #W10 #U10 #l0 #HV1 #HT1 #HVW1 #HW10 #HTU10
+ elim (ssta_inv_appl1 … H2) -H2 #U1 #HTU1 #H destruct
+ elim (tpr_inv_appl1 … H3) -H3 *
+ [ #V2 #T2 #HV12 #HT12 #H destruct -a -l0 -W1 -W10 -U10 -HV1 -IH3 -IH2
+ elim (IH1 … HTU1 … HL12 … HT12) -IH1 -HTU1 -HL12 // [2: /2 width=1/ ] -T1 /3 width=5/
+ | #b #V2 #W #T2 #T20 #HV12 #HT20 #H1 #H2 destruct
+ elim (snv_inv_bind … HT1) -HT1 #HW #HT2
+ elim (ssta_inv_bind1 … HTU1) -HTU1 #U2 #HTU2 #H destruct
+ elim (dxprs_inv_abst1 … HTU10) -HTU10 #W0 #U0 #HW0 #_ #H destruct
+ lapply (cprs_div … HW10 … HW0) -W0 #HW1W
+ elim (ssta_fwd_correct … HVW1) <minus_plus_m_m #X1 #HWX1
+ elim (snv_ssta … HW) #V #l1 #HWV
+ lapply (IH3 … HVW1) -IH3 // [ /2 width=1/ ] #HW1
+ elim (ssta_cpcs_aux … IH2 IH1 … HWX1 … HWV …) -IH2 -HWX1 //
+ [2: /2 width=1/ |3: /4 width=4 by fw_ygt, ysc_ssta, bi_step/ ] #H #_ destruct -X1
+ elim (IH1 … HVW1 … HL12 … HV12) -HVW1 // -HV1 [2: /2 width=1/ ] #W2 #HVW2 #HW12
+ elim (IH1 … HWV … HL12 W) -HWV // -HW [2: /2 width=1/ ] #V0 #HWV0 #_
+ elim (IH1 … HTU2 (L2.ⓛW) … HT20) -IH1 -HTU2 -HT20 // [2,3: /2 width=1/ ] -HT2 #U20 #HTU20 #HU20
+ lapply (lfpr_inv_fpr L1 L2 … W) [ /2 width=1/ ] -HL12 #HL12
+ elim (lsubse_ssta_trans … HTU20 (L2.ⓓV2) ?) -HTU20
+ [ #U #HTU20 #HU20 -HWV0 -HL12 -W1 -W2
+ @(ex2_intro … (ⓓ{b}V2.U)) [ /2 width=1/ ] -h -l -l1 -V -V0 -T2 -T20 -U0
+ @(fpcs_fprs_strap2 ? L1 … (ⓓ{b}V2.U2)) [ /4 width=1/ ] -V1
+ /4 width=4 by fpcs_fwd_shift, fpcs_canc_dx, cpcs_fpcs, fpcs_fwd_abst13/
+ | -b -l -V -V1 -T2 -T20 -U0 -U2 -U20
+ /6 width=6 by lsubse_abbr, fpcs_inv_cpcs, fpcs_canc_sn, fpcs_fprs_strap1, cpcs_fpcs, bi_inj/
+ ]
+ | #b #V0 #V2 #W0 #W2 #T0 #T2 #HV10 #HW02 #HT02 #HV02 #H1 #H2 destruct -a -l0 -W1 -W10 -HV1 -IH3 -IH2
+ elim (ssta_inv_bind1 … HTU1) -HTU1 #U0 #HTU0 #H destruct
+ elim (snv_inv_bind … HT1) -HT1 #_ #HT0
+ elim (IH1 … HTU0 (L2.ⓓW2) … HT02) -IH1 -HTU0 // [2,3: /2 width=1/ ] -T0 -HL12 -HW02 #U2 #HTU2 #HU02
+ lapply (fpcs_fwd_shift … HU02 b) -HU02 #HU02
+ lapply (fpcs_flat_dx_tpr … HU02 … HV10 Appl) -HV10 -HU02 #HU02
+ lapply (fpcs_fpr_strap1 … HU02 L2 (ⓓ{b}W2.ⓐV2.U2) ?) -HU02 [ @ltpr_tpr_fpr // /2 width=3/ ] -V0 /4 width=3/
+ ]
+| #U0 #T1 #HL0 #HT0 #H1 #X2 #l #H2 #L2 #HL12 #X3 #H3 destruct -IH3 -IH2
+ elim (snv_inv_cast … H1) -H1 #T0 #l0 #_ #HT1 #HT10 #_
+ lapply (ssta_inv_cast1 … H2) -H2 #HTU1
+ elim (ssta_mono … HT10 … HTU1) -HT10 #H1 #H2 destruct
+ elim (tpr_inv_cast1 … H3) -H3
+ [ * #U2 #T2 #_ #HT12 #H destruct
+ elim (IH1 … HTU1 … HL12 … HT12) -IH1 -HTU1 -HL12 // [2: /2 width=1/ ] -T1 -U0 /3 width=3/
+ | #HT1X3
+ elim (IH1 … HTU1 … HL12 … HT1X3) -IH1 -HTU1 -HL12 // [2: /2 width=1/ ] -U0 -T1 /2 width=3/
+ ]
+]
+qed-.
lemma cpcs_sym: ∀L. symmetric … (cpcs L).
/3 width=1/ qed.
+lemma cpc_cpcs: ∀L,T1,T2. L ⊢ T1 ⬌ T2 → L ⊢ T2 ⬌* T2.
+/2 width=1/ qed.
+
lemma cpcs_strap1: ∀L,T1,T,T2. L ⊢ T1 ⬌* T → L ⊢ T ⬌ T2 → L ⊢ T1 ⬌* T2.
/2 width=3/ qed.
lemma fpcs_sym: bi_symmetric … fpcs.
/3 width=1/ qed.
+lemma fpc_fpcs: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⬌ ⦃L2, T2⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄.
+/2 width=1/ qed.
+
lemma fpcs_strap1: ∀L1,L,L2,T1,T,T2. ⦃L1, T1⦄ ⬌* ⦃L, T⦄ → ⦃L, T⦄ ⬌ ⦃L2, T2⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄.
/2 width=4/ qed.
lemma lfpcs_refl: reflexive … lfpcs.
/2 width=1/ qed.
-lemma lfprs_sym: symmetric … lfpcs.
+lemma lfpcs_sym: symmetric … lfpcs.
/3 width=1/ qed.
+lemma lfpc_lfpcs: ∀L1,L2. ⦃L1⦄ ⬌ ⦃L2⦄ → ⦃L1⦄ ⬌* ⦃L2⦄.
+/2 width=1/ qed.
+
lemma lfpcs_strap1: ∀L1,L,L2. ⦃L1⦄ ⬌* ⦃L⦄ → ⦃L⦄ ⬌ ⦃L2⦄ → ⦃L1⦄ ⬌* ⦃L2⦄.
/2 width=3/ qed.
/2 width=3/ qed.
theorem lfpcs_canc_sn: ∀L,L1,L2. ⦃L⦄ ⬌* ⦃L1⦄ → ⦃L⦄ ⬌* ⦃L2⦄ → ⦃L1⦄ ⬌* ⦃L2⦄.
-/3 width=3 by lfpcs_trans, lfprs_sym/ qed.
+/3 width=3 by lfpcs_trans, lfpcs_sym/ qed.
theorem lfpcs_canc_dx: ∀L,L1,L2. ⦃L1⦄ ⬌* ⦃L⦄ → ⦃L2⦄ ⬌* ⦃L⦄ → ⦃L1⦄ ⬌* ⦃L2⦄.
-/3 width=3 by lfpcs_trans, lfprs_sym/ qed.
+/3 width=3 by lfpcs_trans, lfpcs_sym/ qed.
].
qed.
-(* Basic_1: removed theorems 1: drop1_getl_trans
-*)
+(* Basic_1: removed theorems 1: drop1_getl_trans *)
(* Basic properties *********************************************************)
+lemma tps_tpss: ∀L,T1,T2,d,e. L ⊢ T1 ▶ [d, e] T2 → L ⊢ T1 ▶* [d, e] T2.
+/2 width=1/ qed.
+
lemma tpss_strap1: ∀L,T1,T,T2,d,e.
L ⊢ T1 ▶* [d, e] T → L ⊢ T ▶ [d, e] T2 → L ⊢ T1 ▶* [d, e] T2.
/2 width=3/ qed.
include "basics/lists/lstar.ma".
include "arithmetics/exp.ma".
-include "background/xoa_notation.ma".
-include "background/xoa.ma".
-include "background/notation.ma".
+include "lambda/background/xoa_notation.ma".
+include "lambda/background/xoa.ma".
+include "lambda/background/notation.ma".
(* logic *)
(* *)
(**************************************************************************)
-include "paths/standard_precedence.ma".
+include "lambda/paths/standard_precedence.ma".
(* ALTERNATIVE STANDARD ORDER ***********************************************)
(* *)
(**************************************************************************)
-include "paths/trace.ma".
+include "lambda/paths/trace.ma".
(* DECOMPOSED TRACE *********************************************************)
(* *)
(**************************************************************************)
-include "paths/standard_trace.ma".
-include "paths/labeled_sequential_computation.ma".
+include "lambda/paths/standard_trace.ma".
+include "lambda/paths/labeled_sequential_computation.ma".
(* DECOMPOSED STANDARD COMPUTATION ***********************************************)
(* *)
(**************************************************************************)
-include "terms/labeled_sequential_computation.ma".
-include "paths/trace.ma".
-include "paths/labeled_sequential_reduction.ma".
+include "lambda/terms/labeled_sequential_computation.ma".
+include "lambda/paths/trace.ma".
+include "lambda/paths/labeled_sequential_reduction.ma".
(* PATH-LABELED SEQUENTIAL COMPUTATION (MULTISTEP) *******************************)
(* *)
(**************************************************************************)
-include "paths/path.ma".
-include "terms/sequential_reduction.ma".
+include "lambda/paths/path.ma".
+include "lambda/terms/sequential_reduction.ma".
(* PATH-LABELED SEQUENTIAL REDUCTION (SINGLE STEP) **************************)
(* *)
(**************************************************************************)
-include "paths/standard_trace.ma".
-include "paths/labeled_sequential_computation.ma".
-include "paths/labeled_st_reduction.ma".
+include "lambda/paths/standard_trace.ma".
+include "lambda/paths/labeled_sequential_computation.ma".
+include "lambda/paths/labeled_st_reduction.ma".
(* PATH-LABELED STANDARD COMPUTATION (MULTISTEP) ****************************)
(* *)
(**************************************************************************)
-include "subterms/booleanized.ma".
-include "paths/labeled_sequential_reduction.ma".
-include "paths/standard_order.ma".
+include "lambda/subterms/booleanized.ma".
+include "lambda/paths/labeled_sequential_reduction.ma".
+include "lambda/paths/standard_order.ma".
(* PATH-LABELED STANDARD REDUCTION ON SUBTERMS (SINGLE STEP) ****************)
(* *)
(**************************************************************************)
-include "terms/term.ma".
+include "lambda/terms/term.ma".
(* PATH *********************************************************************)
(* *)
(**************************************************************************)
-include "paths/standard_precedence.ma".
+include "lambda/paths/standard_precedence.ma".
(* STANDARD ORDER ************************************************************)
(* *)
(**************************************************************************)
-include "paths/path.ma".
+include "lambda/paths/path.ma".
(* STANDARD PRECEDENCE ******************************************************)
(* *)
(**************************************************************************)
-include "paths/trace.ma".
-include "paths/standard_order.ma".
+include "lambda/paths/trace.ma".
+include "lambda/paths/standard_order.ma".
(* STANDARD TRACE ***********************************************************)
(* *)
(**************************************************************************)
-include "paths/path.ma".
+include "lambda/paths/path.ma".
(* TRACE ********************************************************************)
(* *)
(**************************************************************************)
-include "subterms/carrier.ma".
+include "lambda/subterms/carrier.ma".
(* BOOLEAN (EMPTY OR FULL) SUBSET *******************************************)
(* *)
(**************************************************************************)
-include "subterms/boolean.ma".
+include "lambda/subterms/boolean.ma".
(* BOOLEANIZED SUBSET (EMPTY OR FULL) ***************************************)
(* *)
(**************************************************************************)
-include "terms/relocating_substitution.ma".
-include "subterms/relocating_substitution.ma".
+include "lambda/terms/relocating_substitution.ma".
+include "lambda/subterms/relocating_substitution.ma".
(* CARRIER (UNDERLYING TERM) ************************************************)
(* *)
(**************************************************************************)
-include "subterms/relocation.ma".
+include "lambda/subterms/relocation.ma".
(* RELOCATING SUBSTITUTION **************************************************)
(* *)
(**************************************************************************)
-include "subterms/subterms.ma".
+include "lambda/subterms/subterms.ma".
(* RELOCATION FOR SUBTERMS **************************************************)
(* *)
(**************************************************************************)
-include "background/preamble.ma".
+include "lambda/background/preamble.ma".
(* SUBSETS OF SUBTERMS ******************************************************)
(* *)
(**************************************************************************)
-include "terms/sequential_computation.ma".
+include "lambda/terms/sequential_computation.ma".
(* ABSTRACT LABELED SEQUENTIAL COMPUTATION (MULTISTEP) **********************)
(* *)
(**************************************************************************)
-include "terms/relocating_substitution.ma".
+include "lambda/terms/relocating_substitution.ma".
(* MULTIPLICITY *************************************************************)
(* *)
(**************************************************************************)
-include "terms/parallel_reduction.ma".
+include "lambda/terms/parallel_reduction.ma".
(* PARALLEL COMPUTATION (MULTISTEP) *****************************************)
(* *)
(**************************************************************************)
-include "terms/size.ma".
-include "terms/sequential_reduction.ma".
+include "lambda/terms/size.ma".
+include "lambda/terms/sequential_reduction.ma".
(* PARALLEL REDUCTION (SINGLE STEP) *****************************************)
(* *)
(**************************************************************************)
-include "terms/relocation.ma".
+include "lambda/terms/relocation.ma".
(* RELOCATING SUBSTITUTION **************************************************)
(* *)
(**************************************************************************)
-include "terms/term.ma".
+include "lambda/terms/term.ma".
(* RELOCATION ***************************************************************)
(* *)
(**************************************************************************)
-include "terms/parallel_computation.ma".
+include "lambda/terms/parallel_computation.ma".
(* SEQUENTIAL COMPUTATION (MULTISTEP) ***************************************)
(* *)
(**************************************************************************)
-include "terms/multiplicity.ma".
+include "lambda/terms/multiplicity.ma".
(* SEQUENTIAL REDUCTION (SINGLE STEP) ***************************************)
(* *)
(**************************************************************************)
-include "terms/relocation.ma".
+include "lambda/terms/relocation.ma".
(* SIZE *********************************************************************)
(* Initial invocation: - Patience on us to gain peace and perfection! - *)
-include "background/preamble.ma".
+include "lambda/background/preamble.ma".
(* TERM STRUCTURE ***********************************************************)
<keyword>inductive</keyword>
<keyword>coinductive</keyword>
<keyword>let</keyword>
- <keyword>lemma</keyword>
+ <keyword>fact</keyword>
+ <keyword>lemma</keyword>
<keyword>remark</keyword>
<keyword>axiom</keyword>