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 "ground_2/xoa/ex_4_1.ma".
16 include "ground_2/xoa/ex_4_3.ma".
17 include "ground_2/xoa/ex_5_6.ma".
18 include "ground_2/xoa/ex_6_7.ma".
19 include "basic_2/notation/relations/pred_6.ma".
20 include "basic_2/notation/relations/pred_5.ma".
21 include "basic_2/rt_transition/cpg.ma".
23 (* T-BOUND CONTEXT-SENSITIVE PARALLEL RT-TRANSITION FOR TERMS ***************)
25 (* Basic_2A1: includes: cpr *)
26 definition cpm (h) (G) (L) (n): relation2 term term ≝
27 λT1,T2. ∃∃c. 𝐑𝐓❪n,c❫ & ❪G,L❫ ⊢ T1 ⬈[eq_t,c,h] T2.
30 "t-bound context-sensitive parallel rt-transition (term)"
31 'PRed n h G L T1 T2 = (cpm h G L n T1 T2).
34 "context-sensitive parallel r-transition (term)"
35 'PRed h G L T1 T2 = (cpm h G L O T1 T2).
37 (* Basic properties *********************************************************)
39 lemma cpm_ess: ∀h,G,L,s. ❪G,L❫ ⊢ ⋆s ➡[1,h] ⋆(⫯[h]s).
40 /2 width=3 by cpg_ess, ex2_intro/ qed.
42 lemma cpm_delta: ∀n,h,G,K,V1,V2,W2. ❪G,K❫ ⊢ V1 ➡[n,h] V2 →
43 ⇧*[1] V2 ≘ W2 → ❪G,K.ⓓV1❫ ⊢ #0 ➡[n,h] W2.
44 #n #h #G #K #V1 #V2 #W2 *
45 /3 width=5 by cpg_delta, ex2_intro/
48 lemma cpm_ell: ∀n,h,G,K,V1,V2,W2. ❪G,K❫ ⊢ V1 ➡[n,h] V2 →
49 ⇧*[1] V2 ≘ W2 → ❪G,K.ⓛV1❫ ⊢ #0 ➡[↑n,h] W2.
50 #n #h #G #K #V1 #V2 #W2 *
51 /3 width=5 by cpg_ell, ex2_intro, isrt_succ/
54 lemma cpm_lref: ∀n,h,I,G,K,T,U,i. ❪G,K❫ ⊢ #i ➡[n,h] T →
55 ⇧*[1] T ≘ U → ❪G,K.ⓘ[I]❫ ⊢ #↑i ➡[n,h] U.
56 #n #h #I #G #K #T #U #i *
57 /3 width=5 by cpg_lref, ex2_intro/
60 (* Basic_2A1: includes: cpr_bind *)
61 lemma cpm_bind: ∀n,h,p,I,G,L,V1,V2,T1,T2.
62 ❪G,L❫ ⊢ V1 ➡[h] V2 → ❪G,L.ⓑ[I]V1❫ ⊢ T1 ➡[n,h] T2 →
63 ❪G,L❫ ⊢ ⓑ[p,I]V1.T1 ➡[n,h] ⓑ[p,I]V2.T2.
64 #n #h #p #I #G #L #V1 #V2 #T1 #T2 * #cV #HcV #HV12 *
65 /5 width=5 by cpg_bind, isrt_max_O1, isr_shift, ex2_intro/
68 lemma cpm_appl: ∀n,h,G,L,V1,V2,T1,T2.
69 ❪G,L❫ ⊢ V1 ➡[h] V2 → ❪G,L❫ ⊢ T1 ➡[n,h] T2 →
70 ❪G,L❫ ⊢ ⓐV1.T1 ➡[n,h] ⓐV2.T2.
71 #n #h #G #L #V1 #V2 #T1 #T2 * #cV #HcV #HV12 *
72 /5 width=5 by isrt_max_O1, isr_shift, cpg_appl, ex2_intro/
75 lemma cpm_cast: ∀n,h,G,L,U1,U2,T1,T2.
76 ❪G,L❫ ⊢ U1 ➡[n,h] U2 → ❪G,L❫ ⊢ T1 ➡[n,h] T2 →
77 ❪G,L❫ ⊢ ⓝU1.T1 ➡[n,h] ⓝU2.T2.
78 #n #h #G #L #U1 #U2 #T1 #T2 * #cU #HcU #HU12 *
79 /4 width=6 by cpg_cast, isrt_max_idem1, isrt_mono, ex2_intro/
82 (* Basic_2A1: includes: cpr_zeta *)
83 lemma cpm_zeta (n) (h) (G) (L):
84 ∀T1,T. ⇧*[1] T ≘ T1 → ∀T2. ❪G,L❫ ⊢ T ➡[n,h] T2 →
85 ∀V. ❪G,L❫ ⊢ +ⓓV.T1 ➡[n,h] T2.
86 #n #h #G #L #T1 #T #HT1 #T2 *
87 /3 width=5 by cpg_zeta, isrt_plus_O2, ex2_intro/
90 (* Basic_2A1: includes: cpr_eps *)
91 lemma cpm_eps: ∀n,h,G,L,V,T1,T2. ❪G,L❫ ⊢ T1 ➡[n,h] T2 → ❪G,L❫ ⊢ ⓝV.T1 ➡[n,h] T2.
92 #n #h #G #L #V #T1 #T2 *
93 /3 width=3 by cpg_eps, isrt_plus_O2, ex2_intro/
96 lemma cpm_ee: ∀n,h,G,L,V1,V2,T. ❪G,L❫ ⊢ V1 ➡[n,h] V2 → ❪G,L❫ ⊢ ⓝV1.T ➡[↑n,h] V2.
97 #n #h #G #L #V1 #V2 #T *
98 /3 width=3 by cpg_ee, isrt_succ, ex2_intro/
101 (* Basic_2A1: includes: cpr_beta *)
102 lemma cpm_beta: ∀n,h,p,G,L,V1,V2,W1,W2,T1,T2.
103 ❪G,L❫ ⊢ V1 ➡[h] V2 → ❪G,L❫ ⊢ W1 ➡[h] W2 → ❪G,L.ⓛW1❫ ⊢ T1 ➡[n,h] T2 →
104 ❪G,L❫ ⊢ ⓐV1.ⓛ[p]W1.T1 ➡[n,h] ⓓ[p]ⓝW2.V2.T2.
105 #n #h #p #G #L #V1 #V2 #W1 #W2 #T1 #T2 * #riV #rhV #HV12 * #riW #rhW #HW12 *
106 /6 width=7 by cpg_beta, isrt_plus_O2, isrt_max, isr_shift, ex2_intro/
109 (* Basic_2A1: includes: cpr_theta *)
110 lemma cpm_theta: ∀n,h,p,G,L,V1,V,V2,W1,W2,T1,T2.
111 ❪G,L❫ ⊢ V1 ➡[h] V → ⇧*[1] V ≘ V2 → ❪G,L❫ ⊢ W1 ➡[h] W2 →
112 ❪G,L.ⓓW1❫ ⊢ T1 ➡[n,h] T2 →
113 ❪G,L❫ ⊢ ⓐV1.ⓓ[p]W1.T1 ➡[n,h] ⓓ[p]W2.ⓐV2.T2.
114 #n #h #p #G #L #V1 #V #V2 #W1 #W2 #T1 #T2 * #riV #rhV #HV1 #HV2 * #riW #rhW #HW12 *
115 /6 width=9 by cpg_theta, isrt_plus_O2, isrt_max, isr_shift, ex2_intro/
118 (* Basic properties with r-transition ***************************************)
120 (* Note: this is needed by cpms_ind_sn and cpms_ind_dx *)
121 (* Basic_1: includes by definition: pr0_refl *)
122 (* Basic_2A1: includes: cpr_atom *)
123 lemma cpr_refl: ∀h,G,L. reflexive … (cpm h G L 0).
124 /3 width=3 by cpg_refl, ex2_intro/ qed.
126 (* Advanced properties ******************************************************)
128 lemma cpm_sort (h) (G) (L):
129 ∀n. n ≤ 1 → ∀s. ❪G,L❫ ⊢ ⋆s ➡[n,h] ⋆((next h)^n s).
131 #n #H #s <(le_n_O_to_eq n) /2 width=1 by le_S_S_to_le/
134 (* Basic inversion lemmas ***************************************************)
136 lemma cpm_inv_atom1: ∀n,h,J,G,L,T2. ❪G,L❫ ⊢ ⓪[J] ➡[n,h] T2 →
138 | ∃∃s. T2 = ⋆(⫯[h]s) & J = Sort s & n = 1
139 | ∃∃K,V1,V2. ❪G,K❫ ⊢ V1 ➡[n,h] V2 & ⇧*[1] V2 ≘ T2 &
140 L = K.ⓓV1 & J = LRef 0
141 | ∃∃m,K,V1,V2. ❪G,K❫ ⊢ V1 ➡[m,h] V2 & ⇧*[1] V2 ≘ T2 &
142 L = K.ⓛV1 & J = LRef 0 & n = ↑m
143 | ∃∃I,K,T,i. ❪G,K❫ ⊢ #i ➡[n,h] T & ⇧*[1] T ≘ T2 &
144 L = K.ⓘ[I] & J = LRef (↑i).
145 #n #h #J #G #L #T2 * #c #Hc #H elim (cpg_inv_atom1 … H) -H *
146 [ #H1 #H2 destruct /4 width=1 by isrt_inv_00, or5_intro0, conj/
147 | #s #H1 #H2 #H3 destruct /4 width=3 by isrt_inv_01, or5_intro1, ex3_intro/
148 | #cV #K #V1 #V2 #HV12 #HVT2 #H1 #H2 #H3 destruct
149 /4 width=6 by or5_intro2, ex4_3_intro, ex2_intro/
150 | #cV #K #V1 #V2 #HV12 #HVT2 #H1 #H2 #H3 destruct
151 elim (isrt_inv_plus_SO_dx … Hc) -Hc // #m #Hc #H destruct
152 /4 width=9 by or5_intro3, ex5_4_intro, ex2_intro/
153 | #I #K #V2 #i #HV2 #HVT2 #H1 #H2 destruct
154 /4 width=8 by or5_intro4, ex4_4_intro, ex2_intro/
158 lemma cpm_inv_sort1: ∀n,h,G,L,T2,s. ❪G,L❫ ⊢ ⋆s ➡[n,h] T2 →
159 ∧∧ T2 = ⋆(((next h)^n) s) & n ≤ 1.
160 #n #h #G #L #T2 #s * #c #Hc #H
161 elim (cpg_inv_sort1 … H) -H * #H1 #H2 destruct
162 [ lapply (isrt_inv_00 … Hc) | lapply (isrt_inv_01 … Hc) ] -Hc
163 #H destruct /2 width=1 by conj/
166 lemma cpm_inv_zero1: ∀n,h,G,L,T2. ❪G,L❫ ⊢ #0 ➡[n,h] T2 →
168 | ∃∃K,V1,V2. ❪G,K❫ ⊢ V1 ➡[n,h] V2 & ⇧*[1] V2 ≘ T2 &
170 | ∃∃m,K,V1,V2. ❪G,K❫ ⊢ V1 ➡[m,h] V2 & ⇧*[1] V2 ≘ T2 &
172 #n #h #G #L #T2 * #c #Hc #H elim (cpg_inv_zero1 … H) -H *
173 [ #H1 #H2 destruct /4 width=1 by isrt_inv_00, or3_intro0, conj/
174 | #cV #K #V1 #V2 #HV12 #HVT2 #H1 #H2 destruct
175 /4 width=8 by or3_intro1, ex3_3_intro, ex2_intro/
176 | #cV #K #V1 #V2 #HV12 #HVT2 #H1 #H2 destruct
177 elim (isrt_inv_plus_SO_dx … Hc) -Hc // #m #Hc #H destruct
178 /4 width=8 by or3_intro2, ex4_4_intro, ex2_intro/
182 lemma cpm_inv_zero1_unit (n) (h) (I) (K) (G):
183 ∀X2. ❪G,K.ⓤ[I]❫ ⊢ #0 ➡[n,h] X2 → ∧∧ X2 = #0 & n = 0.
184 #n #h #I #G #K #X2 #H
185 elim (cpm_inv_zero1 … H) -H *
186 [ #H1 #H2 destruct /2 width=1 by conj/
187 | #Y #X1 #X2 #_ #_ #H destruct
188 | #m #Y #X1 #X2 #_ #_ #H destruct
192 lemma cpm_inv_lref1: ∀n,h,G,L,T2,i. ❪G,L❫ ⊢ #↑i ➡[n,h] T2 →
193 ∨∨ T2 = #(↑i) ∧ n = 0
194 | ∃∃I,K,T. ❪G,K❫ ⊢ #i ➡[n,h] T & ⇧*[1] T ≘ T2 & L = K.ⓘ[I].
195 #n #h #G #L #T2 #i * #c #Hc #H elim (cpg_inv_lref1 … H) -H *
196 [ #H1 #H2 destruct /4 width=1 by isrt_inv_00, or_introl, conj/
197 | #I #K #V2 #HV2 #HVT2 #H destruct
198 /4 width=6 by ex3_3_intro, ex2_intro, or_intror/
202 lemma cpm_inv_lref1_ctop (n) (h) (G):
203 ∀X2,i. ❪G,⋆❫ ⊢ #i ➡[n,h] X2 → ∧∧ X2 = #i & n = 0.
204 #n #h #G #X2 * [| #i ] #H
205 [ elim (cpm_inv_zero1 … H) -H *
206 [ #H1 #H2 destruct /2 width=1 by conj/
207 | #Y #X1 #X2 #_ #_ #H destruct
208 | #m #Y #X1 #X2 #_ #_ #H destruct
210 | elim (cpm_inv_lref1 … H) -H *
211 [ #H1 #H2 destruct /2 width=1 by conj/
212 | #Z #Y #X0 #_ #_ #H destruct
217 lemma cpm_inv_gref1: ∀n,h,G,L,T2,l. ❪G,L❫ ⊢ §l ➡[n,h] T2 → T2 = §l ∧ n = 0.
218 #n #h #G #L #T2 #l * #c #Hc #H elim (cpg_inv_gref1 … H) -H
219 #H1 #H2 destruct /3 width=1 by isrt_inv_00, conj/
222 (* Basic_2A1: includes: cpr_inv_bind1 *)
223 lemma cpm_inv_bind1: ∀n,h,p,I,G,L,V1,T1,U2. ❪G,L❫ ⊢ ⓑ[p,I]V1.T1 ➡[n,h] U2 →
224 ∨∨ ∃∃V2,T2. ❪G,L❫ ⊢ V1 ➡[h] V2 & ❪G,L.ⓑ[I]V1❫ ⊢ T1 ➡[n,h] T2 &
226 | ∃∃T. ⇧*[1] T ≘ T1 & ❪G,L❫ ⊢ T ➡[n,h] U2 &
228 #n #h #p #I #G #L #V1 #T1 #U2 * #c #Hc #H elim (cpg_inv_bind1 … H) -H *
229 [ #cV #cT #V2 #T2 #HV12 #HT12 #H1 #H2 destruct
230 elim (isrt_inv_max … Hc) -Hc #nV #nT #HcV #HcT #H destruct
231 elim (isrt_inv_shift … HcV) -HcV #HcV #H destruct
232 /4 width=5 by ex3_2_intro, ex2_intro, or_introl/
233 | #cT #T2 #HT21 #HTU2 #H1 #H2 #H3 destruct
234 /5 width=5 by isrt_inv_plus_O_dx, ex4_intro, ex2_intro, or_intror/
238 (* Basic_1: includes: pr0_gen_abbr pr2_gen_abbr *)
239 (* Basic_2A1: includes: cpr_inv_abbr1 *)
240 lemma cpm_inv_abbr1: ∀n,h,p,G,L,V1,T1,U2. ❪G,L❫ ⊢ ⓓ[p]V1.T1 ➡[n,h] U2 →
241 ∨∨ ∃∃V2,T2. ❪G,L❫ ⊢ V1 ➡[h] V2 & ❪G,L.ⓓV1❫ ⊢ T1 ➡[n,h] T2 &
243 | ∃∃T. ⇧*[1] T ≘ T1 & ❪G,L❫ ⊢ T ➡[n,h] U2 & p = true.
244 #n #h #p #G #L #V1 #T1 #U2 #H
245 elim (cpm_inv_bind1 … H) -H
246 [ /3 width=1 by or_introl/
247 | * /3 width=3 by ex3_intro, or_intror/
251 (* Basic_1: includes: pr0_gen_abst pr2_gen_abst *)
252 (* Basic_2A1: includes: cpr_inv_abst1 *)
253 lemma cpm_inv_abst1: ∀n,h,p,G,L,V1,T1,U2. ❪G,L❫ ⊢ ⓛ[p]V1.T1 ➡[n,h] U2 →
254 ∃∃V2,T2. ❪G,L❫ ⊢ V1 ➡[h] V2 & ❪G,L.ⓛV1❫ ⊢ T1 ➡[n,h] T2 &
256 #n #h #p #G #L #V1 #T1 #U2 #H
257 elim (cpm_inv_bind1 … H) -H
258 [ /3 width=1 by or_introl/
259 | * #T #_ #_ #_ #H destruct
263 lemma cpm_inv_abst_bi: ∀n,h,p1,p2,G,L,V1,V2,T1,T2. ❪G,L❫ ⊢ ⓛ[p1]V1.T1 ➡[n,h] ⓛ[p2]V2.T2 →
264 ∧∧ ❪G,L❫ ⊢ V1 ➡[h] V2 & ❪G,L.ⓛV1❫ ⊢ T1 ➡[n,h] T2 & p1 = p2.
265 #n #h #p1 #p2 #G #L #V1 #V2 #T1 #T2 #H
266 elim (cpm_inv_abst1 … H) -H #XV #XT #HV #HT #H destruct
267 /2 width=1 by and3_intro/
270 (* Basic_1: includes: pr0_gen_appl pr2_gen_appl *)
271 (* Basic_2A1: includes: cpr_inv_appl1 *)
272 lemma cpm_inv_appl1: ∀n,h,G,L,V1,U1,U2. ❪G,L❫ ⊢ ⓐ V1.U1 ➡[n,h] U2 →
273 ∨∨ ∃∃V2,T2. ❪G,L❫ ⊢ V1 ➡[h] V2 & ❪G,L❫ ⊢ U1 ➡[n,h] T2 &
275 | ∃∃p,V2,W1,W2,T1,T2. ❪G,L❫ ⊢ V1 ➡[h] V2 & ❪G,L❫ ⊢ W1 ➡[h] W2 &
276 ❪G,L.ⓛW1❫ ⊢ T1 ➡[n,h] T2 &
277 U1 = ⓛ[p]W1.T1 & U2 = ⓓ[p]ⓝW2.V2.T2
278 | ∃∃p,V,V2,W1,W2,T1,T2. ❪G,L❫ ⊢ V1 ➡[h] V & ⇧*[1] V ≘ V2 &
279 ❪G,L❫ ⊢ W1 ➡[h] W2 & ❪G,L.ⓓW1❫ ⊢ T1 ➡[n,h] T2 &
280 U1 = ⓓ[p]W1.T1 & U2 = ⓓ[p]W2.ⓐV2.T2.
281 #n #h #G #L #V1 #U1 #U2 * #c #Hc #H elim (cpg_inv_appl1 … H) -H *
282 [ #cV #cT #V2 #T2 #HV12 #HT12 #H1 #H2 destruct
283 elim (isrt_inv_max … Hc) -Hc #nV #nT #HcV #HcT #H destruct
284 elim (isrt_inv_shift … HcV) -HcV #HcV #H destruct
285 /4 width=5 by or3_intro0, ex3_2_intro, ex2_intro/
286 | #cV #cW #cT #p #V2 #W1 #W2 #T1 #T2 #HV12 #HW12 #HT12 #H1 #H2 #H3 destruct
287 lapply (isrt_inv_plus_O_dx … Hc ?) -Hc // #Hc
288 elim (isrt_inv_max … Hc) -Hc #n0 #nT #Hc #HcT #H destruct
289 elim (isrt_inv_max … Hc) -Hc #nV #nW #HcV #HcW #H destruct
290 elim (isrt_inv_shift … HcV) -HcV #HcV #H destruct
291 elim (isrt_inv_shift … HcW) -HcW #HcW #H destruct
292 /4 width=11 by or3_intro1, ex5_6_intro, ex2_intro/
293 | #cV #cW #cT #p #V #V2 #W1 #W2 #T1 #T2 #HV1 #HV2 #HW12 #HT12 #H1 #H2 #H3 destruct
294 lapply (isrt_inv_plus_O_dx … Hc ?) -Hc // #Hc
295 elim (isrt_inv_max … Hc) -Hc #n0 #nT #Hc #HcT #H destruct
296 elim (isrt_inv_max … Hc) -Hc #nV #nW #HcV #HcW #H destruct
297 elim (isrt_inv_shift … HcV) -HcV #HcV #H destruct
298 elim (isrt_inv_shift … HcW) -HcW #HcW #H destruct
299 /4 width=13 by or3_intro2, ex6_7_intro, ex2_intro/
303 lemma cpm_inv_cast1: ∀n,h,G,L,V1,U1,U2. ❪G,L❫ ⊢ ⓝV1.U1 ➡[n,h] U2 →
304 ∨∨ ∃∃V2,T2. ❪G,L❫ ⊢ V1 ➡[n,h] V2 & ❪G,L❫ ⊢ U1 ➡[n,h] T2 &
306 | ❪G,L❫ ⊢ U1 ➡[n,h] U2
307 | ∃∃m. ❪G,L❫ ⊢ V1 ➡[m,h] U2 & n = ↑m.
308 #n #h #G #L #V1 #U1 #U2 * #c #Hc #H elim (cpg_inv_cast1 … H) -H *
309 [ #cV #cT #V2 #T2 #HV12 #HT12 #HcVT #H1 #H2 destruct
310 elim (isrt_inv_max … Hc) -Hc #nV #nT #HcV #HcT #H destruct
311 lapply (isrt_eq_t_trans … HcV HcVT) -HcVT #H
312 lapply (isrt_inj … H HcT) -H #H destruct <idempotent_max
313 /4 width=5 by or3_intro0, ex3_2_intro, ex2_intro/
314 | #cU #U12 #H destruct
315 /4 width=3 by isrt_inv_plus_O_dx, or3_intro1, ex2_intro/
316 | #cU #H12 #H destruct
317 elim (isrt_inv_plus_SO_dx … Hc) -Hc // #m #Hc #H destruct
318 /4 width=3 by or3_intro2, ex2_intro/
322 (* Basic forward lemmas *****************************************************)
324 (* Basic_2A1: includes: cpr_fwd_bind1_minus *)
325 lemma cpm_fwd_bind1_minus: ∀n,h,I,G,L,V1,T1,T. ❪G,L❫ ⊢ -ⓑ[I]V1.T1 ➡[n,h] T → ∀p.
326 ∃∃V2,T2. ❪G,L❫ ⊢ ⓑ[p,I]V1.T1 ➡[n,h] ⓑ[p,I]V2.T2 &
328 #n #h #I #G #L #V1 #T1 #T * #c #Hc #H #p elim (cpg_fwd_bind1_minus … H p) -H
329 /3 width=4 by ex2_2_intro, ex2_intro/
332 (* Basic eliminators ********************************************************)
334 lemma cpm_ind (h): ∀Q:relation5 nat genv lenv term term.
335 (∀I,G,L. Q 0 G L (⓪[I]) (⓪[I])) →
336 (∀G,L,s. Q 1 G L (⋆s) (⋆(⫯[h]s))) →
337 (∀n,G,K,V1,V2,W2. ❪G,K❫ ⊢ V1 ➡[n,h] V2 → Q n G K V1 V2 →
338 ⇧*[1] V2 ≘ W2 → Q n G (K.ⓓV1) (#0) W2
339 ) → (∀n,G,K,V1,V2,W2. ❪G,K❫ ⊢ V1 ➡[n,h] V2 → Q n G K V1 V2 →
340 ⇧*[1] V2 ≘ W2 → Q (↑n) G (K.ⓛV1) (#0) W2
341 ) → (∀n,I,G,K,T,U,i. ❪G,K❫ ⊢ #i ➡[n,h] T → Q n G K (#i) T →
342 ⇧*[1] T ≘ U → Q n G (K.ⓘ[I]) (#↑i) (U)
343 ) → (∀n,p,I,G,L,V1,V2,T1,T2. ❪G,L❫ ⊢ V1 ➡[h] V2 → ❪G,L.ⓑ[I]V1❫ ⊢ T1 ➡[n,h] T2 →
344 Q 0 G L V1 V2 → Q n G (L.ⓑ[I]V1) T1 T2 → Q n G L (ⓑ[p,I]V1.T1) (ⓑ[p,I]V2.T2)
345 ) → (∀n,G,L,V1,V2,T1,T2. ❪G,L❫ ⊢ V1 ➡[h] V2 → ❪G,L❫ ⊢ T1 ➡[n,h] T2 →
346 Q 0 G L V1 V2 → Q n G L T1 T2 → Q n G L (ⓐV1.T1) (ⓐV2.T2)
347 ) → (∀n,G,L,V1,V2,T1,T2. ❪G,L❫ ⊢ V1 ➡[n,h] V2 → ❪G,L❫ ⊢ T1 ➡[n,h] T2 →
348 Q n G L V1 V2 → Q n G L T1 T2 → Q n G L (ⓝV1.T1) (ⓝV2.T2)
349 ) → (∀n,G,L,V,T1,T,T2. ⇧*[1] T ≘ T1 → ❪G,L❫ ⊢ T ➡[n,h] T2 →
350 Q n G L T T2 → Q n G L (+ⓓV.T1) T2
351 ) → (∀n,G,L,V,T1,T2. ❪G,L❫ ⊢ T1 ➡[n,h] T2 →
352 Q n G L T1 T2 → Q n G L (ⓝV.T1) T2
353 ) → (∀n,G,L,V1,V2,T. ❪G,L❫ ⊢ V1 ➡[n,h] V2 →
354 Q n G L V1 V2 → Q (↑n) G L (ⓝV1.T) V2
355 ) → (∀n,p,G,L,V1,V2,W1,W2,T1,T2. ❪G,L❫ ⊢ V1 ➡[h] V2 → ❪G,L❫ ⊢ W1 ➡[h] W2 → ❪G,L.ⓛW1❫ ⊢ T1 ➡[n,h] T2 →
356 Q 0 G L V1 V2 → Q 0 G L W1 W2 → Q n G (L.ⓛW1) T1 T2 →
357 Q n G L (ⓐV1.ⓛ[p]W1.T1) (ⓓ[p]ⓝW2.V2.T2)
358 ) → (∀n,p,G,L,V1,V,V2,W1,W2,T1,T2. ❪G,L❫ ⊢ V1 ➡[h] V → ❪G,L❫ ⊢ W1 ➡[h] W2 → ❪G,L.ⓓW1❫ ⊢ T1 ➡[n,h] T2 →
359 Q 0 G L V1 V → Q 0 G L W1 W2 → Q n G (L.ⓓW1) T1 T2 →
360 ⇧*[1] V ≘ V2 → Q n G L (ⓐV1.ⓓ[p]W1.T1) (ⓓ[p]W2.ⓐV2.T2)
362 ∀n,G,L,T1,T2. ❪G,L❫ ⊢ T1 ➡[n,h] T2 → Q n G L T1 T2.
363 #h #Q #IH1 #IH2 #IH3 #IH4 #IH5 #IH6 #IH7 #IH8 #IH9 #IH10 #IH11 #IH12 #IH13 #n #G #L #T1 #T2
364 * #c #HC #H generalize in match HC; -HC generalize in match n; -n
365 elim H -c -G -L -T1 -T2
366 [ #I #G #L #n #H <(isrt_inv_00 … H) -H //
367 | #G #L #s #n #H <(isrt_inv_01 … H) -H //
368 | /3 width=4 by ex2_intro/
369 | #c #G #L #V1 #V2 #W2 #HV12 #HVW2 #IH #x #H
370 elim (isrt_inv_plus_SO_dx … H) -H // #n #Hc #H destruct
371 /3 width=4 by ex2_intro/
372 | /3 width=4 by ex2_intro/
373 | #cV #cT #p #I #G #L #V1 #V2 #T1 #T2 #HV12 #HT12 #IHV #IHT #n #H
374 elim (isrt_inv_max_shift_sn … H) -H #HcV #HcT
375 /3 width=3 by ex2_intro/
376 | #cV #cT #G #L #V1 #V2 #T1 #T2 #HV12 #HT12 #IHV #IHT #n #H
377 elim (isrt_inv_max_shift_sn … H) -H #HcV #HcT
378 /3 width=3 by ex2_intro/
379 | #cU #cT #G #L #U1 #U2 #T1 #T2 #HUT #HU12 #HT12 #IHU #IHT #n #H
380 elim (isrt_inv_max_eq_t … H) -H // #HcV #HcT
381 /3 width=3 by ex2_intro/
382 | #c #G #L #V #T1 #T #T2 #HT1 #HT2 #IH #n #H
383 lapply (isrt_inv_plus_O_dx … H ?) -H // #Hc
384 /3 width=4 by ex2_intro/
385 | #c #G #L #U #T1 #T2 #HT12 #IH #n #H
386 lapply (isrt_inv_plus_O_dx … H ?) -H // #Hc
387 /3 width=3 by ex2_intro/
388 | #c #G #L #U1 #U2 #T #HU12 #IH #x #H
389 elim (isrt_inv_plus_SO_dx … H) -H // #n #Hc #H destruct
390 /3 width=3 by ex2_intro/
391 | #cV #cW #cT #p #G #L #V1 #V2 #W1 #W2 #T1 #T2 #HV12 #HW12 #HT12 #IHV #IHW #IHT #n #H
392 lapply (isrt_inv_plus_O_dx … H ?) -H // >max_shift #H
393 elim (isrt_inv_max_shift_sn … H) -H #H #HcT
394 elim (isrt_O_inv_max … H) -H #HcV #HcW
395 /3 width=3 by ex2_intro/
396 | #cV #cW #cT #p #G #L #V1 #V #V2 #W1 #W2 #T1 #T2 #HV1 #HV2 #HW12 #HT12 #IHV #IHW #IHT #n #H
397 lapply (isrt_inv_plus_O_dx … H ?) -H // >max_shift #H
398 elim (isrt_inv_max_shift_sn … H) -H #H #HcT
399 elim (isrt_O_inv_max … H) -H #HcV #HcW
400 /3 width=4 by ex2_intro/