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/static/ssta_ltpss_sn.ma".
16 include "basic_2/equivalence/lsubse_ssta.ma".
17 include "basic_2/equivalence/lfpcs_fpcs.ma".
18 include "basic_2/dynamic/snv_ssta.ma".
19 include "basic_2/dynamic/snv_cpcs.ma".
21 (* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************)
23 (* Properties on context-free parallel reduction for local environments *****)
25 fact ssta_ltpr_tpr_aux: ∀h,g,L0,T0.
26 (∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → IH_snv_ssta h g L1 T1) →
27 (∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → IH_snv_ltpr_tpr h g L1 T1) →
28 (∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → IH_ssta_ltpr_tpr h g L1 T1) →
29 ∀L1,T1. L0 = L1 → T0 = T1 → IH_ssta_ltpr_tpr h g L1 T1.
30 #h #g #L0 #T0 #IH3 #IH2 #IH1 #L1 * * [|||| *]
31 [ #k #_ #_ #_ #X2 #l #H2 #L2 #HL12 #X3 #H3 -IH3 -IH2 -IH1
32 elim (ssta_inv_sort1 … H2) -H2 #Hkl #H destruct
33 >(tpr_inv_atom1 … H3) -X3 /4 width=6/
34 | #i #HL0 #HT0 #H1 #X2 #l #H2 #L2 #HL12 #X3 #H3 destruct -IH3 -IH2
35 elim (snv_inv_lref … H1) -H1 #I0 #K0 #V0 #H #HV1
36 elim (ssta_inv_lref1 … H2) -H2 * #K1
37 >(tpr_inv_atom1 … H3) -X3
38 [ #V1 #W1 #HLK1 #HVW1 #HWU1
39 lapply (ldrop_mono … H … HLK1) -H #H destruct
40 lapply (ldrop_pair2_fwd_fw … HLK1 (#i)) #HKV1
41 elim (ltpr_ldrop_conf … HLK1 … HL12) #X #H #HLK2
42 elim (ltpr_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct
43 elim (IH1 … HVW1 … HK12 … HV12) -IH1 -HVW1 -HV12 // [2: /2 width=1/ ] -HV1 -HKV1 #W2 #HVW2 #HW12
44 lapply (ldrop_fwd_ldrop2 … HLK1) -V1 #H1
45 lapply (ldrop_fwd_ldrop2 … HLK2) #H2
46 elim (lift_total W2 0 (i+1)) #U2 #HWU2
47 lapply (fpcs_lift … HW12 … H1 H2 … HWU1 … HWU2) -H1 -H2 -W1 [ /3 width=1/ ] /3 width=6/
48 | #V1 #W1 #l0 #HLK1 #HVW1 #HVU1 #H destruct
49 lapply (ldrop_mono … H … HLK1) -H #H destruct
50 lapply (ldrop_pair2_fwd_fw … HLK1 (#i)) #HKV1
51 elim (ltpr_ldrop_conf … HLK1 … HL12) -HLK1 #X #H #HLK2
52 elim (ltpr_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct
53 elim (IH1 … HVW1 … HK12 … HV12) -IH1 -HVW1 -HK12 // [2: /2 width=1/ ] -HV1 -HKV1 #W2 #HVW2 #_ -W1
54 elim (lift_total V2 0 (i+1)) #U2 #HVU2
55 lapply (tpr_lift … HV12 … HVU1 … HVU2) -V1 /4 width=6/
57 | #p #_ #HT0 #H1 destruct -IH3 -IH2 -IH1
58 elim (snv_inv_gref … H1)
59 | #a #I #V1 #T1 #HL0 #HT0 #H1 #X2 #l #H2 #L2 #HL12 #X3 #H3 destruct -IH3 -IH2
60 elim (snv_inv_bind … H1) -H1 #_ #HT1
61 elim (ssta_inv_bind1 … H2) -H2 #U1 #HTU1 #H destruct
62 elim (tpr_inv_bind1 … H3) -H3 *
63 [ #V2 #T0 #T2 #HV12 #HT10 #HT02 #H destruct
64 lapply (tps_lsubs_trans … HT02 (L2.ⓑ{I}V2) ?) -HT02 [ /2 width=1/ ] #HT02
65 elim (ssta_ltpr_cpr_aux … HT1 … HTU1 (L2.ⓑ{I}V2) … T2) -HT1 -HTU1
66 [2: /3 width=5 by cpr_intro, tps_tpss/ |3: /2 width=1/ |4: /3 width=1/ ] -IH1 -T0 -HL12 -HV12 #U2 #HTU2 #HU12
67 lapply (fpcs_fwd_shift … HU12 a) -HU12 /3 width=3/
68 | #T2 #HT12 #HT2 #H1 #H2 destruct
69 elim (IH1 … HTU1 (L2.ⓓV1) … T2) -IH1 -HTU1 // [2,3: /2 width=1/ ] -T1 -HL12 #U2 #HTU2 #HU12
70 lapply (fpcs_fwd_shift … HU12 true) -HU12 #HU12
71 elim (ssta_inv_lift1 … HTU2 … HT2) -T2 [3: /2 width=1/ |2: skip ] #U #HXU #HU2
72 lapply (fpcs_fpr_strap1 … HU12 L2 U ?) -HU12 [ /3 width=3/ ] -U2 /2 width=3/
74 | #V1 #T1 #HL0 #HT0 #H1 #X2 #l #H2 #L2 #HL12 #X3 #H3 destruct
75 elim (snv_inv_appl … H1) -H1 #a #W1 #W10 #U10 #l0 #HV1 #HT1 #HVW1 #HW10 #HTU10
76 elim (ssta_inv_appl1 … H2) -H2 #U1 #HTU1 #H destruct
77 elim (tpr_inv_appl1 … H3) -H3 *
78 [ #V2 #T2 #HV12 #HT12 #H destruct -a -l0 -W1 -W10 -U10 -HV1 -IH3 -IH2
79 elim (IH1 … HTU1 … HL12 … HT12) -IH1 -HTU1 -HL12 // [2: /2 width=1/ ] -T1 /3 width=5/
80 | #b #V2 #W #T2 #T20 #HV12 #HT20 #H1 #H2 destruct
81 elim (snv_inv_bind … HT1) -HT1 #HW #HT2
82 elim (ssta_inv_bind1 … HTU1) -HTU1 #U2 #HTU2 #H destruct
83 elim (dxprs_inv_abst1 … HTU10) -HTU10 #W0 #U0 #HW0 #_ #H destruct
84 lapply (cprs_div … HW10 … HW0) -W0 #HW1W
85 elim (ssta_fwd_correct … HVW1) <minus_plus_m_m #X1 #HWX1
86 elim (snv_ssta … HW) #V #l1 #HWV
87 lapply (IH3 … HVW1) -IH3 // [ /2 width=1/ ] #HW1
88 elim (ssta_cpcs_aux … IH2 IH1 … HWX1 … HWV …) -IH2 -HWX1 //
89 [2: /2 width=1/ |3: /4 width=4 by fw_ygt, ysc_ssta, bi_step/ ] #H #_ destruct -X1
90 elim (IH1 … HVW1 … HL12 … HV12) -HVW1 // -HV1 [2: /2 width=1/ ] #W2 #HVW2 #HW12
91 elim (IH1 … HWV … HL12 W) -HWV // -HW [2: /2 width=1/ ] #V0 #HWV0 #_
92 elim (IH1 … HTU2 (L2.ⓛW) … HT20) -IH1 -HTU2 -HT20 // [2,3: /2 width=1/ ] -HT2 #U20 #HTU20 #HU20
93 lapply (lfpr_inv_fpr L1 L2 … W) [ /2 width=1/ ] -HL12 #HL12
94 elim (lsubse_ssta_trans … HTU20 (L2.ⓓV2) ?) -HTU20
95 [ #U #HTU20 #HU20 -HWV0 -HL12 -W1 -W2
96 @(ex2_intro … (ⓓ{b}V2.U)) [ /2 width=1/ ] -h -l -l1 -V -V0 -T2 -T20 -U0
97 @(fpcs_fprs_strap2 ? L1 … (ⓓ{b}V2.U2)) [ /4 width=1/ ] -V1
98 /4 width=4 by fpcs_fwd_shift, fpcs_canc_dx, cpcs_fpcs, fpcs_fwd_abst13/
99 | -b -l -V -V1 -T2 -T20 -U0 -U2 -U20
100 /6 width=6 by lsubse_abbr, fpcs_inv_cpcs, fpcs_canc_sn, fpcs_fprs_strap1, cpcs_fpcs, bi_inj/
102 | #b #V0 #V2 #W0 #W2 #T0 #T2 #HV10 #HW02 #HT02 #HV02 #H1 #H2 destruct -a -l0 -W1 -W10 -HV1 -IH3 -IH2
103 elim (ssta_inv_bind1 … HTU1) -HTU1 #U0 #HTU0 #H destruct
104 elim (snv_inv_bind … HT1) -HT1 #_ #HT0
105 elim (IH1 … HTU0 (L2.ⓓW2) … HT02) -IH1 -HTU0 // [2,3: /2 width=1/ ] -T0 -HL12 -HW02 #U2 #HTU2 #HU02
106 lapply (fpcs_fwd_shift … HU02 b) -HU02 #HU02
107 lapply (fpcs_flat_dx_tpr … HU02 … HV10 Appl) -HV10 -HU02 #HU02
108 lapply (fpcs_fpr_strap1 … HU02 L2 (ⓓ{b}W2.ⓐV2.U2) ?) -HU02 [ @ltpr_tpr_fpr // /2 width=3/ ] -V0 /4 width=3/
110 | #U0 #T1 #HL0 #HT0 #H1 #X2 #l #H2 #L2 #HL12 #X3 #H3 destruct -IH3 -IH2
111 elim (snv_inv_cast … H1) -H1 #T0 #l0 #_ #HT1 #HT10 #_
112 lapply (ssta_inv_cast1 … H2) -H2 #HTU1
113 elim (ssta_mono … HT10 … HTU1) -HT10 #H1 #H2 destruct
114 elim (tpr_inv_cast1 … H3) -H3
115 [ * #U2 #T2 #_ #HT12 #H destruct
116 elim (IH1 … HTU1 … HL12 … HT12) -IH1 -HTU1 -HL12 // [2: /2 width=1/ ] -T1 -U0 /3 width=3/
118 elim (IH1 … HTU1 … HL12 … HT1X3) -IH1 -HTU1 -HL12 // [2: /2 width=1/ ] -U0 -T1 /2 width=3/