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 -HTU2 /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) #l0 #U20 #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/
79 | #b #V0 #V2 #W0 #W2 #T0 #T2 #HV10 #HW02 #HT02 #HV02 #H1 #H2 destruct -IH4
80 elim (snv_inv_bind … HT1) -HT1 #HW0 #HT0
81 elim (dxprs_inv_abbr_abst … HTU1) -HTU1 #X #HTU0 #HX #H destruct
82 elim (lift_inv_bind1 … HX) -HX #W3 #U3 #HW13 #_ #H destruct
83 lapply (ltpr_cprs_conf … HL12 … HW10) -HW10 #HW10
84 elim (dxprs_ltpr_cprs_aux … IH2 IH1 IH3 … HTU0 (L2.ⓓW2) … T2 ?) // [2: /3 width=1/ |3,4: /2 width=1/ ] -IH2 -HTU0 #X #HTU2 #H
85 elim (cprs_inv_abst1 Abst W3 … H) -H #W #U2 #HW1 #_ #H destruct -U3
86 elim (IH3 … HVW1 … HL12 … HV10) // /2 width=1/ -IH3 -HVW1 #X #H1 #H2
87 lapply (cpcs_canc_sn … H2 HW10) -W10 #H2
88 elim (lift_total X 0 1) #W20 #H3
89 lapply (ssta_lift … H1 (L2.ⓓW2) … HV02 … H3) /2 width=1/ -H1 #HVW20
90 lapply (cpcs_lift (L2.ⓓW2) … H3 … HW13 H2) /2 width=1/ -HW13 -H3 -H2 #HW320
91 lapply (cpcs_cprs_strap1 … HW320 … HW1) -W3 #HW20
92 elim (cpcs_inv_cprs … HW20) -HW20 #W3 #HW203 #HW3
93 lapply (dxprs_cprs_trans … (ⓛ{a}W3.U2) HTU2 ?) [ /2 width=1/ ] -HW3 -HTU2 #HTU2
94 lapply (IH1 … HL12 … HW02) // [ /2 width=1/ ] -HW0 #HW2
95 lapply (IH1 … HL12 … HV10) // [ /2 width=1/ ] -HV1 -HV10 #HV0
96 lapply (IH1 … HT0 … (L2.ⓓW2) … HT02) [1,2: /2 width=1/ ] -L1 -HT02 -HW02 #HT2
97 lapply (snv_lift … HV0 (L2.ⓓW2) … HV02) /2 width=1/ -HV0 -HV02 /3 width=8/
99 | #W1 #T1 #HL0 #HT0 #H1 #L2 #HL12 #X #H2 destruct -IH4 -IH2
100 elim (snv_inv_cast … H1) -H1 #U1 #l #HW1 #HT1 #HTU1 #HUW1
101 elim (tpr_inv_cast1 … H2) -H2
102 [ * #W2 #T2 #HW12 #HT12 #H destruct
103 lapply (cpcs_cprs_strap1 … HUW1 W2 ?) [ /3 width=1/ ] -HUW1 #H1
104 lapply (IH1 … HL12 … HW12) // /2 width=1/ -HW1 -HW12 #HW2
105 lapply (IH1 … HL12 … HT12) // /2 width=1/ -IH1 #HT2
106 elim (IH3 … HTU1 … HL12 … HT12) // /2 width=1/ -IH3 -HT1 -HT12 -HTU1 #U2 #HTU2 #HU12
107 lapply (ltpr_cpcs_conf … HL12 … H1) -L1 #H1
108 lapply (cpcs_canc_sn … HU12 H1) -U1 /2 width=4/
109 | #H -IH3 -HW1 -HTU1 -HUW1
110 lapply (IH1 … HL12 … H) // /2 width=1/