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 (**************************************************************************)
16 include "basic_2/reducibility/ltpr.ma".
17 include "basic_2/computation/xprs_lift.ma".
18 include "basic_2/equivalence/cpcs_cpcs.ma".
19 include "basic_2/equivalence/lsubse_ssta.ma".
20 include "basic_2/equivalence/fpcs_cpcs.ma".
21 include "basic_2/equivalence/fpcs_fpcs.ma".
22 include "basic_2/dynamic/snv_ssta.ma".
24 include "basic_2/static/ssta_ltpss_dx.ma".
25 include "basic_2/dynamic/snv_lift.ma".
27 (* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************)
29 (* Properties on context-free parallel reduction for local environments *****)
31 fact ssta_ltpr_tpr_aux: ∀h,g,n. (
33 ∀T1. L ⊢ T1 ⬌* T2 → ⦃h, L⦄ ⊩ T1 :[g] → ⦃h, L⦄ ⊩ T2 :[g] →
34 ∀U1,l1. ⦃h, L⦄ ⊢ T1 •[g, l1] U1 →
35 ∀U2,l2. ⦃h, L⦄ ⊢ T2 •[g, l2] U2 →
36 L ⊢ U1 ⬌* U2 ∧ l1 = l2
38 ∀L,T. ♯{L,T} < n → ⦃h, L⦄ ⊩ T :[g] →
39 ∀U,l. ⦃h, L⦄ ⊢ T •[g, l + 1] U → ⦃h, L⦄ ⊩ U :[g]
41 ∀L1,T1. ♯{L1,T1} < n →
42 ∀U1,l. ⦃h, L1⦄ ⊢ T1 •[g, l] U1 →
43 ∀L2. L1 ➡ L2 → ∀T2. T1 ➡ T2 → ⦃h, L1⦄ ⊩ T1 :[g] →
44 ∃∃U2. ⦃h, L2⦄ ⊢ T2 •[g, l] U2 & ⦃L1, U1⦄ ⬌* ⦃L2, U2⦄
46 ∀L1,T1. ♯{L1,T1} = n →
47 ∀U1,l. ⦃h, L1⦄ ⊢ T1 •[g, l] U1 →
48 ∀L2. L1 ➡ L2 → ∀T2. T1 ➡ T2 → ⦃h, L1⦄ ⊩ T1 :[g] →
49 ∃∃U2. ⦃h, L2⦄ ⊢ T2 •[g, l] U2 & ⦃L1, U1⦄ ⬌* ⦃L2, U2⦄.
50 #h #g #n #IH3 #IH2 #IH1 #L1 * * [|||| *]
55 | #V1 #T1 #Hn #Y #l #H1 #L2 #HL12 #X #H2 #H3 destruct
56 elim (ssta_inv_appl1 … H1) -H1 #U1 #HTU1 #H destruct
57 elim (snv_inv_appl … H3) -H3 #a #W1 #W10 #U10 #l0 #HV1 #HT1 #HVW1 #HW10 #HTU10
58 elim (tpr_inv_appl1 … H2) -H2 *
60 | #b #V2 #W #T2 #T20 #HV12 #HT20 #H1 #H2 destruct
61 elim (snv_inv_bind … HT1) -HT1 #HW #HT2
62 elim (ssta_inv_bind1 … HTU1) -HTU1 #U2 #HTU2 #H destruct
63 elim (xprs_fwd_abst1 … HTU10) -HTU10 #W0 #U0 #HW0 #H destruct
64 lapply (cprs_div … HW10 … HW0) -W0 #HW1
65 elim (ssta_fwd_correct … HVW1) <minus_plus_m_m #X1 #HWX1
66 elim (snv_ssta … HW) #V #l1 #HWV
67 elim (IH3 … HW1 … HW … HWX1 … HWV) -IH3 -HWX1 // [2: /2 width=5/ ] -IH2 #_ #H destruct -X1
68 elim (IH1 … HVW1 … HL12 … HV12) -HVW1 // -HV1 #W2 #HVW2 #HW12
69 elim (IH1 … HWV … HL12 W) -HWV // -HW #V0 #HWV0 #_
70 elim (IH1 … HTU2 (L2.ⓛW) … HT20 HT2) -IH1 -HTU2 -HT20 -HT2 // [2: /2 width=1/ ] #U20 #HTU20 #HU20
71 lapply (lfpr_inv_fpr L1 L2 … W) [ /2 width=1/ ] -HL12 #HL12
72 elim (lsubse_ssta_trans … HTU20 (L2.ⓓV2) ?) -HTU20
73 [ #U #HTU20 #HU20 -HWV0 -HL12 -W1 -W2
74 @(ex2_intro … (ⓓ{b}V2.U)) [ /2 width=1/ ] -h -l -l1 -V -V0 -T2 -T20 -U0
75 @(fpcs_fprs_strap2 ? L1 … (ⓓ{b}V2.U2)) [ /4 width=1/ ] -V1
77 @(fpcs_canc_dx ?? (L2.ⓓV2) … U20) [2: /2 width=1/ ] -U
78 | -b -l -V -V1 -T2 -T20 -U0 -U2 -U20
79 /6 width=6 by lsubse_abbr, fpcs_inv_cpcs, fpcs_canc_sn, fpcs_fprs_strap1, cpcs_fpcs, bi_inj/
85 fact ssta_ltpr_tpr_aux: ∀h,g,L,T. (
86 ∀L1,T1,U1,l. ⦃h, L1⦄ ⊢ T1 •[g, l] U1 →
87 ∀L2. L1 ⊢ ⬌* L2 → ∀T2. T1 ➡ T2 → ⦃h, L1⦄ ⊩ T1 :[g] →
89 ∃∃U2. ⦃h, L2⦄ ⊢ T2 •[g, l] U2 & U1 ➡ U2
91 ∀L1,T1,U1,l. ⦃h, L1⦄ ⊢ T1 •[g, l] U1 →
92 ∀L2. L1 ➡ L2 → ∀T2. T1 ➡ T2 → ⦃h, L1⦄ ⊩ T1 :[g] →
94 ∃∃U2. ⦃h, L2⦄ ⊢ T2 •[g, l] U2 & U1 ➡ U2.
95 #h #g #L #T #IH #L1 #T1 #U1 #l * -L1 -T1 -U1 -l
96 [ #L1 #k #l #Hkl #L2 #_ #X #H #_ #H1 #H2 destruct -IH
97 >(tpr_inv_atom1 … H) -X /3 width=3/
98 | #L1 #K1 #V1 #W1 #U1 #i #l #HLK1 #HVW1 #HWU1 #L2 #HL12 #X #H1 #H2 #H3 #H4 destruct
99 >(tpr_inv_atom1 … H1) -X
100 elim (snv_inv_lref … H2) -H2 #I0 #K0 #V0 #H #HV1
101 lapply (ldrop_mono … H … HLK1) -H #H destruct
102 lapply (ldrop_pair2_fwd_fw … HLK1 (#i)) #HKV1
103 elim (ltpr_ldrop_conf … HLK1 … HL12) -HLK1 -HL12 #X #H #HLK2
104 elim (ltpr_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct
105 elim (IH … HVW1 K2 … HV12 ? ?) -IH -HVW1 -HV12 // -L1 -V1 /2 width=1/ -K1 #W2 #HVW2 #HW12
106 elim (lift_total W2 0 (i+1)) #U2 #HWU2
107 lapply (tpr_lift … HW12 … HWU1 … HWU2) -W1 /3 width=6/
108 | #L1 #K1 #V1 #W1 #U1 #i #l #HLK1 #HVW1 #HVU1 #L2 #HL12 #X #H1 #H2 #H3 #H4 destruct
109 >(tpr_inv_atom1 … H1) -X
110 elim (snv_inv_lref … H2) -H2 #I0 #K0 #V0 #H #HV1
111 lapply (ldrop_mono … H … HLK1) -H #H destruct
112 lapply (ldrop_pair2_fwd_fw … HLK1 (#i)) #HKV1
113 elim (ltpr_ldrop_conf … HLK1 … HL12) -HLK1 -HL12 #X #H #HLK2
114 elim (ltpr_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct
115 elim (IH … HVW1 K2 … HV12 ? ?) -IH -HVW1 // -L1 -HV1 /2 width=1/ -K1 #W2 #HVW2 #_ -W1
116 elim (lift_total V2 0 (i+1)) #U2 #HVU2
117 lapply (tpr_lift … HV12 … HVU1 … HVU2) -V1 /3 width=6/
118 | #a #I #L1 #V1 #T1 #U1 #l #HTU1 #L2 #HL12 #X #H1 #H2 #H3 #H4 destruct
119 elim (snv_inv_bind … H2) -H2 #_ #HT1
120 elim (tpr_inv_bind1 … H1) -H1 *
121 [ #V2 #T0 #T2 #HV12 #HT10 #HT02 #H destruct
122 elim (IH … HTU1 (L2.ⓑ{I}V2) … HT10 ? ?) -IH -HTU1 -HT10 // -T1 /3 width=1/ -L1 #U0 #HTU0 #HU10
123 lapply (tps_lsubs_trans … HT02 (L2.ⓑ{I}V2) ?) -HT02 [ /2 width=1/ ] #HT02
124 elim (ssta_tps_conf … HTU0 … HT02) -T0 #U2 #HTU2 #HU02
125 lapply (tpss_inv_SO2 … HU02) -HU02 #HU02
126 lapply (tps_lsubs_trans … HU02 (⋆.ⓑ{I}V2) ?) -HU02
127 [ /2 width=1/ | /3 width=7/ ]
128 | #T2 #HT12 #HT2 #H1 #H2 destruct
129 elim (IH ? ? ? ? HTU1 (L2.ⓓV1) … HT12 ? ?) -IH -HTU1 -HT12 // -T1 [2: /3 width=1/ ] -L1 #U2 #HTU2 #HU12
130 elim (ssta_inv_lift1 … HTU2 … HT2) -T2 /3 width=5/
132 | #L1 #V1 #T1 #U1 #l #HTU1 #L2 #HL12 #X #H1 #H2 #H3 #H4 destruct
133 elim (snv_inv_appl … H2) -H2 #a #W1 #W10 #U10 #l0 #HV1 #HT1 #HVW1 #HW10 #HTU10
134 elim (tpr_inv_appl1 … H1) -H1 *
135 [ #V2 #T2 #HV12 #HT12 #H destruct -HV1 -HVW1 -HW10 -HTU10
136 elim (IH … HTU1 L2 … HT12 HT1 ?) -IH -HTU1 -HT12 -HT1 // [2: /2 width=1/ ] -HL12 /3 width=5/
137 | #b #V2 #W #T2 #T20 #HV12 #HT20 #H1 #H2 destruct
138 elim (snv_inv_bind … HT1) -HT1 #HW #HT2
139 elim (xprs_fwd_abst1 … HTU10) -HTU10 #W11 #U11 #HW11 #H destruct
140 elim (ssta_inv_bind1 … HTU1) -HTU1 #U2 #HTU2 #H destruct
141 elim (IH … HVW1 L2 … HV12 HV1 ?) -HVW1 -HV1 // [2: /2 width=1/ ] #W2 #HVW2 #HW12
142 lapply (cprs_div … HW11 … HW10) -W11 #HW1
143 lapply (cpcs_cpr_strap1 … HW1 W2 ?) [ /2 width=1/ ] -W1 #HW2
144 elim (IH … HTU2 (L2.ⓛW2) … HT20 HT2 ?) -IH -HT2 -HT20 //
145 [ /5 width=7/ | /3 width=1/ ]
146 | #b #V2 #V0 #W0 #W2 #T0 #T2 #HV12 #W02 #HT02 #HV20 #H1 #H2 destruct
147 elim (snv_inv_bind … HT1) -HT1 #HW0 #HT0
148 elim (ssta_inv_bind1 … HTU1) -HTU1 #U0 #HTU0 #H destruct
151 elim (xprs_fwd_abst1 … HTU10) -HTU10 #W11 #U11 #HW11 #H destruct
153 fact snv_ltpr_tpr_aux: ∀h,g,L,T. (
154 ∀L1,T1,U1,l. ⦃h, L1⦄ ⊢ T1 •[g, l] U1 →
155 ∀L2. L1 ➡ L2 → ∀T2. T1 ➡ T2 → ⦃h, L1⦄ ⊩ T1 :[g] →
156 h ⊢ ⦃L, T⦄ •⭃*[g] ⦃L1 ,T1⦄ →
157 ∃∃U2. ⦃h, L2⦄ ⊢ T2 •[g, l] U2 & ⦃L1, U1⦄ ⬌* ⦃L2, U2⦄
159 ∀L1,T1. ⦃h, L1⦄ ⊩ T1 :[g] →
160 ∀L2. L1 ➡ L2 → ∀T2. ⦃h, L2⦄ ⊢ T1 •➡*[g] T2 →
161 h ⊢ ⦃L, T⦄ •⭃*[g] ⦃L1 ,T1⦄ → ⦃h, L2⦄ ⊩ T2 :[g]
163 ∀L1,T1. ⦃h, L1⦄ ⊩ T1 :[g] →
164 ∀L2. L1 ➡ L2 → ∀T2. T1 ➡ T2 →
165 L = L1 → T = T1 → ⦃h, L2⦄ ⊩ T2 :[g].
166 #h #g #L #T #IH2 #IH1 #L1 #T1 * -L1 -T1
167 [ #L1 #k #L2 #_ #X #H #H1 #H2 destruct -IH2 -IH1 -L1
168 >(tpr_inv_atom1 … H) -X //
169 | #I #L1 #K1 #V1 #i #HLK1 #HV1 #L2 #HL12 #X #H #H1 #H2 destruct -IH2
170 >(tpr_inv_atom1 … H) -X
171 elim (ltpr_ldrop_conf … HLK1 … HL12) -HL12 #X #H #HLK2
172 elim (ltpr_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct
173 lapply (IH1 … HV1 … HK12 V2 ? ?) -IH1 -HV1 -HK12 /4 width=1/ -HV12 /3 width=4/ -HLK1 /3 width=5/
174 | #a #I #L1 #V1 #T1 #HV1 #HT1 #L2 #HL12 #X #H #H1 #H2 destruct -IH2
175 elim (tpr_inv_bind1 … H) -H *
176 [ #V2 #T0 #T2 #HV12 #HT10 #HT02 #H destruct
177 lapply (tps_lsubs_trans … HT02 (L2.ⓑ{I}V2) ?) -HT02 /2 width=1/ #HT02
178 lapply (cpr_intro (L2.ⓑ{I}V2) … T2 0 1 HT10 ?) -HT10 /2 width=1/ -HT02 #HT12
179 lapply (IH1 … HV1 … HL12 V2 ? ?) -HV1 /4 width=1/ #HV2
180 lapply (IH1 … HT1 (L2.ⓑ{I}V2) … T2 ? ?) -IH1 -HT1 /3 width=1/
181 | #T2 #HT12 #HXT2 #H1 #H2 destruct
182 lapply (IH1 … HT1 (L2.ⓓV1) ? T2 ? ?) -IH1 -HT1 /4 width=1/ -HT12 -HL12 #HT2
183 lapply (snv_inv_lift … HT2 L2 … HXT2) -T2 // /2 width=1/
185 | #a #L1 #V1 #W1 #W10 #T1 #U1 #l #HV1 #HT1 #HVW1 #HW10 #HTU1 #L2 #HL12 #X #H #H1 #H2 destruct
186 elim (tpr_inv_appl1 … H) -H *
187 [ #V2 #T2 #HV12 #HT12 #H destruct
188 lapply (IH1 … HV1 … HL12 V2 ? ?) /4 width=1/ #HV2
189 lapply (IH1 … HT1 … HL12 T2 ? ?) /4 width=1/ #HT2
190 lapply (IH1 … HT1 … HTU1 ?) -IH1 -HT1 // /2 width=1/ #H
191 elim (snv_inv_bind … H) -H #HW10 #HU1
192 elim (IH2 … HVW1 … HL12 … HV12 HV1 ?) -IH2 -HVW1 -HL12 -HV12 -HV1 /2 width=1/ #W2 #HVW2 #HW12
193 lapply (fpcs_canc_sn L1 L1 … W10 … HW12) -HW12 /3 width=1/ -W1 #HW102
194 @(snv_appl … HV2 HT2 HVW2)