1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "basic_2/computation/dxprs_dxprs.ma".
16 include "basic_2/dynamic/snv_cpcs.ma".
18 (* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************)
20 (* Properties on context-free parallel reduction for local environments *****)
22 fact snv_ltpr_tpr_aux: ∀h,g,L0,T0.
23 (∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → IH_snv_lsubsv h g L1 T1) →
24 (∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → IH_ssta_ltpr_tpr h g L1 T1) →
25 (∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → IH_snv_ssta h g L1 T1) →
26 (∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → IH_snv_ltpr_tpr h g L1 T1) →
27 ∀L1,T1. L0 = L1 → T0 = T1 → IH_snv_ltpr_tpr h g L1 T1.
28 #h #g #L0 #T0 #IH4 #IH3 #IH2 #IH1 #L1 * * [||||*]
29 [ #k #HL0 #HT0 #H1 #L2 #_ #X #H2 destruct -IH4 -IH3 -IH2 -IH1 -L1
30 >(tpr_inv_atom1 … H2) -X //
31 | #i #HL0 #HT0 #H1 #L2 #HL12 #X #H2 destruct -IH4 -IH3 -IH2
32 elim (snv_inv_lref … H1) -H1 #I #K1 #V1 #HLK1 #HV1
33 >(tpr_inv_atom1 … H2) -X
34 elim (ltpr_ldrop_conf … HLK1 … HL12) -HL12 #X #H #HLK2
35 elim (ltpr_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct
36 lapply (ldrop_pair2_fwd_fw … HLK1 (#i)) -HLK1 #HLK1
37 lapply (IH1 … HK12 … HV12) -IH1 -HV12 -HK12 // -HV1 [ /2 width=1/ ] -HLK1 /2 width=5/
38 | #p #HL0 #HT0 #H1 #L2 #HL12 #X #H2 destruct -IH4 -IH3 -IH2 -IH1
39 elim (snv_inv_gref … H1)
40 | #a #I #V1 #T1 #HL0 #HT0 #H1 #L2 #HL12 #X #H2 destruct -IH4 -IH3 -IH2
41 elim (snv_inv_bind … H1) -H1 #HV1 #HT1
42 elim (tpr_inv_bind1 … H2) -H2 *
43 [ #V2 #T0 #T2 #HV12 #HT10 #HT02 #H destruct
44 lapply (tps_lsubs_trans … HT02 (L2.ⓑ{I}V2) ?) -HT02 /2 width=1/ #HT02
45 lapply (IH1 … HL12 … HV12) // [ /2 width=1/ ] #HV2
46 lapply (snv_ltpr_cpr_aux … HT1 (L2.ⓑ{I}V2) … T2 ?) -HT1
47 [ /3 width=5 by cpr_intro, tps_tpss/ | /2 width=1/ | /3 width=1/ ] -IH1 -T0 /2 width=1/
48 | #T2 #HT12 #HXT2 #H1 #H2 destruct
49 lapply (IH1 … HT1 (L2.ⓓV1) … HT12) -IH1 -HT1 -HT12 [1,2: /2 width=1/ ] -HL12 #HT2
50 lapply (snv_inv_lift … HT2 L2 … HXT2) -T2 // /2 width=1/
52 | #V1 #T1 #HL0 #HT0 #H1 #L2 #HL12 #X #H2 destruct
53 elim (snv_inv_appl … H1) -H1 #a #W10 #W1 #U1 #l #HV1 #HT1 #HVW1 #HW10 #HTU1
54 elim (tpr_inv_appl1 … H2) -H2 *
55 [ #V2 #T2 #HV12 #HT12 #H destruct -IH4
56 lapply (IH1 … HV1 … HL12 … HV12) [ /2 width=1/ ] #HV2
57 lapply (IH1 … HT1 … HL12 … HT12) [ /2 width=1/ ] #HT2
58 elim (IH3 … HVW1 … HL12 … HV12) -HVW1 -HV12 // -HV1 [2: /2 width=1/ ] #W2 #HVW2 #HW12
59 elim (dxprs_ltpr_cprs_aux … IH2 IH1 IH3 … HTU1 … HL12 T2) // [2: /3 width=1/ |3: /2 width=1/ ] -IH2 -IH1 -IH3 -HT1 -HT12 -HTU1 #X #HTU2 #H
60 elim (cprs_inv_abst1 Abst W1 … H) -H #W20 #U2 #HW120 #_ #H destruct
61 lapply (ltpr_cprs_conf … HL12 … HW10) -L1 #HW10
62 lapply (cpcs_cprs_strap1 … HW10 … HW120) -W1 #HW120
63 lapply (cpcs_canc_sn … HW12 HW120) -W10 #HW20
64 elim (cpcs_inv_cprs … HW20) -HW20 #W0 #HW20 #HW200
65 lapply (dxprs_cprs_trans … (ⓛ{a}W0.U2) HTU2 ?) [ /2 width=1/ ] -HW200 /2 width=8/
66 | #b #V2 #W20 #T20 #T2 #HV12 #HT202 #H1 #H2 destruct
67 elim (snv_inv_bind … HT1) -HT1 #HW20 #HT20
68 elim (dxprs_inv_abst1 … HTU1) -HTU1 #W30 #T30 #HW230 #_ #H destruct -T30
69 lapply (cprs_div … HW10 … HW230) -W30 #HW120
70 elim (snv_fwd_ssta … HW20) #U20 #l0 #HWU20
71 elim (ssta_fwd_correct … HVW1) <minus_plus_m_m #U10 #HWU10
72 elim (ssta_ltpr_cpcs_aux … IH1 IH3 … HW20 … HWU10 … HWU20) // -IH3 -HWU10
73 [2: /3 width=5/ |3: /2 width=1/
74 |4: /4 width=4 by ygt_yprs_trans, ypr_yprs, ypr_ssta, fw_ygt/
75 ] #H #_ -IH2 -U10 destruct
76 lapply (IH4 … HT20 (L1.ⓓV1) ?) [ /2 width=6/ | /2 width=1/ ] -U20 -W10 -l0 -IH4 -HT20 -HW20 #HT20
77 lapply (IH1 … HL12 … HV12) // [ /2 width=1/ ] #HV2
78 lapply (IH1 … HT20 … (L2.ⓓV2) … HT202) [1,2: /2 width=1/ ] -L1 -V1 -W20 -T20 /2 width=1/