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/xoa/ex_4_1.ma".
16 include "ground/xoa/ex_4_3.ma".
17 include "ground/xoa/ex_5_6.ma".
18 include "ground/xoa/ex_6_7.ma".
19 include "ground/steps/rtc_max_shift.ma".
20 include "ground/steps/rtc_isrt_plus.ma".
21 include "ground/steps/rtc_isrt_max_shift.ma".
22 include "basic_2/notation/relations/pred_6.ma".
23 include "basic_2/rt_transition/cpg.ma".
25 (* T-BOUND CONTEXT-SENSITIVE PARALLEL RT-TRANSITION FOR TERMS ***************)
27 (* Basic_2A1: includes: cpr *)
28 definition cpm (h) (G) (L) (n): relation2 term term ≝
29 λT1,T2. ∃∃c. 𝐑𝐓❪n,c❫ & ❪G,L❫ ⊢ T1 ⬈[eq_t,c,h] T2.
32 "t-bound context-sensitive parallel rt-transition (term)"
33 'PRed h n G L T1 T2 = (cpm h G L n T1 T2).
35 (* Basic properties *********************************************************)
37 lemma cpm_ess: ∀h,G,L,s. ❪G,L❫ ⊢ ⋆s ➡[h,1] ⋆(⫯[h]s).
38 /2 width=3 by cpg_ess, ex2_intro/ qed.
40 lemma cpm_delta: ∀h,n,G,K,V1,V2,W2. ❪G,K❫ ⊢ V1 ➡[h,n] V2 →
41 ⇧[1] V2 ≘ W2 → ❪G,K.ⓓV1❫ ⊢ #0 ➡[h,n] W2.
42 #h #n #G #K #V1 #V2 #W2 *
43 /3 width=5 by cpg_delta, ex2_intro/
46 lemma cpm_ell: ∀h,n,G,K,V1,V2,W2. ❪G,K❫ ⊢ V1 ➡[h,n] V2 →
47 ⇧[1] V2 ≘ W2 → ❪G,K.ⓛV1❫ ⊢ #0 ➡[h,↑n] W2.
48 #h #n #G #K #V1 #V2 #W2 *
49 /3 width=5 by cpg_ell, ex2_intro, isrt_succ/
52 lemma cpm_lref: ∀h,n,I,G,K,T,U,i. ❪G,K❫ ⊢ #i ➡[h,n] T →
53 ⇧[1] T ≘ U → ❪G,K.ⓘ[I]❫ ⊢ #↑i ➡[h,n] U.
54 #h #n #I #G #K #T #U #i *
55 /3 width=5 by cpg_lref, ex2_intro/
58 (* Basic_2A1: includes: cpr_bind *)
59 lemma cpm_bind: ∀h,n,p,I,G,L,V1,V2,T1,T2.
60 ❪G,L❫ ⊢ V1 ➡[h,0] V2 → ❪G,L.ⓑ[I]V1❫ ⊢ T1 ➡[h,n] T2 →
61 ❪G,L❫ ⊢ ⓑ[p,I]V1.T1 ➡[h,n] ⓑ[p,I]V2.T2.
62 #h #n #p #I #G #L #V1 #V2 #T1 #T2 * #cV #HcV #HV12 *
63 /5 width=5 by cpg_bind, isrt_max_O1, isr_shift, ex2_intro/
66 lemma cpm_appl: ∀h,n,G,L,V1,V2,T1,T2.
67 ❪G,L❫ ⊢ V1 ➡[h,0] V2 → ❪G,L❫ ⊢ T1 ➡[h,n] T2 →
68 ❪G,L❫ ⊢ ⓐV1.T1 ➡[h,n] ⓐV2.T2.
69 #h #n #G #L #V1 #V2 #T1 #T2 * #cV #HcV #HV12 *
70 /5 width=5 by isrt_max_O1, isr_shift, cpg_appl, ex2_intro/
73 lemma cpm_cast: ∀h,n,G,L,U1,U2,T1,T2.
74 ❪G,L❫ ⊢ U1 ➡[h,n] U2 → ❪G,L❫ ⊢ T1 ➡[h,n] T2 →
75 ❪G,L❫ ⊢ ⓝU1.T1 ➡[h,n] ⓝU2.T2.
76 #h #n #G #L #U1 #U2 #T1 #T2 * #cU #HcU #HU12 *
77 /4 width=6 by cpg_cast, isrt_max_idem1, isrt_mono, ex2_intro/
80 (* Basic_2A1: includes: cpr_zeta *)
81 lemma cpm_zeta (h) (n) (G) (L):
82 ∀T1,T. ⇧[1] T ≘ T1 → ∀T2. ❪G,L❫ ⊢ T ➡[h,n] T2 →
83 ∀V. ❪G,L❫ ⊢ +ⓓV.T1 ➡[h,n] T2.
84 #h #n #G #L #T1 #T #HT1 #T2 *
85 /3 width=5 by cpg_zeta, isrt_plus_O2, ex2_intro/
88 (* Basic_2A1: includes: cpr_eps *)
89 lemma cpm_eps: ∀h,n,G,L,V,T1,T2. ❪G,L❫ ⊢ T1 ➡[h,n] T2 → ❪G,L❫ ⊢ ⓝV.T1 ➡[h,n] T2.
90 #h #n #G #L #V #T1 #T2 *
91 /3 width=3 by cpg_eps, isrt_plus_O2, ex2_intro/
94 lemma cpm_ee: ∀h,n,G,L,V1,V2,T. ❪G,L❫ ⊢ V1 ➡[h,n] V2 → ❪G,L❫ ⊢ ⓝV1.T ➡[h,↑n] V2.
95 #h #n #G #L #V1 #V2 #T *
96 /3 width=3 by cpg_ee, isrt_succ, ex2_intro/
99 (* Basic_2A1: includes: cpr_beta *)
100 lemma cpm_beta: ∀h,n,p,G,L,V1,V2,W1,W2,T1,T2.
101 ❪G,L❫ ⊢ V1 ➡[h,0] V2 → ❪G,L❫ ⊢ W1 ➡[h,0] W2 → ❪G,L.ⓛW1❫ ⊢ T1 ➡[h,n] T2 →
102 ❪G,L❫ ⊢ ⓐV1.ⓛ[p]W1.T1 ➡[h,n] ⓓ[p]ⓝW2.V2.T2.
103 #h #n #p #G #L #V1 #V2 #W1 #W2 #T1 #T2 * #riV #rhV #HV12 * #riW #rhW #HW12 *
104 /6 width=7 by cpg_beta, isrt_plus_O2, isrt_max, isr_shift, ex2_intro/
107 (* Basic_2A1: includes: cpr_theta *)
108 lemma cpm_theta: ∀h,n,p,G,L,V1,V,V2,W1,W2,T1,T2.
109 ❪G,L❫ ⊢ V1 ➡[h,0] V → ⇧[1] V ≘ V2 → ❪G,L❫ ⊢ W1 ➡[h,0] W2 →
110 ❪G,L.ⓓW1❫ ⊢ T1 ➡[h,n] T2 →
111 ❪G,L❫ ⊢ ⓐV1.ⓓ[p]W1.T1 ➡[h,n] ⓓ[p]W2.ⓐV2.T2.
112 #h #n #p #G #L #V1 #V #V2 #W1 #W2 #T1 #T2 * #riV #rhV #HV1 #HV2 * #riW #rhW #HW12 *
113 /6 width=9 by cpg_theta, isrt_plus_O2, isrt_max, isr_shift, ex2_intro/
116 (* Basic properties with r-transition ***************************************)
118 (* Note: this is needed by cpms_ind_sn and cpms_ind_dx *)
119 (* Basic_1: includes by definition: pr0_refl *)
120 (* Basic_2A1: includes: cpr_atom *)
121 lemma cpr_refl: ∀h,G,L. reflexive … (cpm h G L 0).
122 /3 width=3 by cpg_refl, ex2_intro/ qed.
124 (* Advanced properties ******************************************************)
126 lemma cpm_sort (h) (G) (L):
127 ∀n. n ≤ 1 → ∀s. ❪G,L❫ ⊢ ⋆s ➡[h,n] ⋆((next h)^n s).
129 #n #H #s <(le_n_O_to_eq n) /2 width=1 by le_S_S_to_le/
132 (* Basic inversion lemmas ***************************************************)
134 lemma cpm_inv_atom1: ∀h,n,J,G,L,T2. ❪G,L❫ ⊢ ⓪[J] ➡[h,n] T2 →
136 | ∃∃s. T2 = ⋆(⫯[h]s) & J = Sort s & n = 1
137 | ∃∃K,V1,V2. ❪G,K❫ ⊢ V1 ➡[h,n] V2 & ⇧[1] V2 ≘ T2 &
138 L = K.ⓓV1 & J = LRef 0
139 | ∃∃m,K,V1,V2. ❪G,K❫ ⊢ V1 ➡[h,m] V2 & ⇧[1] V2 ≘ T2 &
140 L = K.ⓛV1 & J = LRef 0 & n = ↑m
141 | ∃∃I,K,T,i. ❪G,K❫ ⊢ #i ➡[h,n] T & ⇧[1] T ≘ T2 &
142 L = K.ⓘ[I] & J = LRef (↑i).
143 #h #n #J #G #L #T2 * #c #Hc #H elim (cpg_inv_atom1 … H) -H *
144 [ #H1 #H2 destruct /4 width=1 by isrt_inv_00, or5_intro0, conj/
145 | #s #H1 #H2 #H3 destruct /4 width=3 by isrt_inv_01, or5_intro1, ex3_intro/
146 | #cV #K #V1 #V2 #HV12 #HVT2 #H1 #H2 #H3 destruct
147 /4 width=6 by or5_intro2, ex4_3_intro, ex2_intro/
148 | #cV #K #V1 #V2 #HV12 #HVT2 #H1 #H2 #H3 destruct
149 elim (isrt_inv_plus_SO_dx … Hc) -Hc // #m #Hc #H destruct
150 /4 width=9 by or5_intro3, ex5_4_intro, ex2_intro/
151 | #I #K #V2 #i #HV2 #HVT2 #H1 #H2 destruct
152 /4 width=8 by or5_intro4, ex4_4_intro, ex2_intro/
156 lemma cpm_inv_sort1: ∀h,n,G,L,T2,s. ❪G,L❫ ⊢ ⋆s ➡[h,n] T2 →
157 ∧∧ T2 = ⋆(((next h)^n) s) & n ≤ 1.
158 #h #n #G #L #T2 #s * #c #Hc #H
159 elim (cpg_inv_sort1 … H) -H * #H1 #H2 destruct
160 [ lapply (isrt_inv_00 … Hc) | lapply (isrt_inv_01 … Hc) ] -Hc
161 #H destruct /2 width=1 by conj/
164 lemma cpm_inv_zero1: ∀h,n,G,L,T2. ❪G,L❫ ⊢ #0 ➡[h,n] T2 →
166 | ∃∃K,V1,V2. ❪G,K❫ ⊢ V1 ➡[h,n] V2 & ⇧[1] V2 ≘ T2 &
168 | ∃∃m,K,V1,V2. ❪G,K❫ ⊢ V1 ➡[h,m] V2 & ⇧[1] V2 ≘ T2 &
170 #h #n #G #L #T2 * #c #Hc #H elim (cpg_inv_zero1 … H) -H *
171 [ #H1 #H2 destruct /4 width=1 by isrt_inv_00, or3_intro0, conj/
172 | #cV #K #V1 #V2 #HV12 #HVT2 #H1 #H2 destruct
173 /4 width=8 by or3_intro1, ex3_3_intro, ex2_intro/
174 | #cV #K #V1 #V2 #HV12 #HVT2 #H1 #H2 destruct
175 elim (isrt_inv_plus_SO_dx … Hc) -Hc // #m #Hc #H destruct
176 /4 width=8 by or3_intro2, ex4_4_intro, ex2_intro/
180 lemma cpm_inv_zero1_unit (h) (n) (I) (K) (G):
181 ∀X2. ❪G,K.ⓤ[I]❫ ⊢ #0 ➡[h,n] X2 → ∧∧ X2 = #0 & n = 0.
182 #h #n #I #G #K #X2 #H
183 elim (cpm_inv_zero1 … H) -H *
184 [ #H1 #H2 destruct /2 width=1 by conj/
185 | #Y #X1 #X2 #_ #_ #H destruct
186 | #m #Y #X1 #X2 #_ #_ #H destruct
190 lemma cpm_inv_lref1: ∀h,n,G,L,T2,i. ❪G,L❫ ⊢ #↑i ➡[h,n] T2 →
191 ∨∨ T2 = #(↑i) ∧ n = 0
192 | ∃∃I,K,T. ❪G,K❫ ⊢ #i ➡[h,n] T & ⇧[1] T ≘ T2 & L = K.ⓘ[I].
193 #h #n #G #L #T2 #i * #c #Hc #H elim (cpg_inv_lref1 … H) -H *
194 [ #H1 #H2 destruct /4 width=1 by isrt_inv_00, or_introl, conj/
195 | #I #K #V2 #HV2 #HVT2 #H destruct
196 /4 width=6 by ex3_3_intro, ex2_intro, or_intror/
200 lemma cpm_inv_lref1_ctop (h) (n) (G):
201 ∀X2,i. ❪G,⋆❫ ⊢ #i ➡[h,n] X2 → ∧∧ X2 = #i & n = 0.
202 #h #n #G #X2 * [| #i ] #H
203 [ elim (cpm_inv_zero1 … H) -H *
204 [ #H1 #H2 destruct /2 width=1 by conj/
205 | #Y #X1 #X2 #_ #_ #H destruct
206 | #m #Y #X1 #X2 #_ #_ #H destruct
208 | elim (cpm_inv_lref1 … H) -H *
209 [ #H1 #H2 destruct /2 width=1 by conj/
210 | #Z #Y #X0 #_ #_ #H destruct
215 lemma cpm_inv_gref1: ∀h,n,G,L,T2,l. ❪G,L❫ ⊢ §l ➡[h,n] T2 → T2 = §l ∧ n = 0.
216 #h #n #G #L #T2 #l * #c #Hc #H elim (cpg_inv_gref1 … H) -H
217 #H1 #H2 destruct /3 width=1 by isrt_inv_00, conj/
220 (* Basic_2A1: includes: cpr_inv_bind1 *)
221 lemma cpm_inv_bind1: ∀h,n,p,I,G,L,V1,T1,U2. ❪G,L❫ ⊢ ⓑ[p,I]V1.T1 ➡[h,n] U2 →
222 ∨∨ ∃∃V2,T2. ❪G,L❫ ⊢ V1 ➡[h,0] V2 & ❪G,L.ⓑ[I]V1❫ ⊢ T1 ➡[h,n] T2 &
224 | ∃∃T. ⇧[1] T ≘ T1 & ❪G,L❫ ⊢ T ➡[h,n] U2 &
226 #h #n #p #I #G #L #V1 #T1 #U2 * #c #Hc #H elim (cpg_inv_bind1 … H) -H *
227 [ #cV #cT #V2 #T2 #HV12 #HT12 #H1 #H2 destruct
228 elim (isrt_inv_max … Hc) -Hc #nV #nT #HcV #HcT #H destruct
229 elim (isrt_inv_shift … HcV) -HcV #HcV #H destruct
230 /4 width=5 by ex3_2_intro, ex2_intro, or_introl/
231 | #cT #T2 #HT21 #HTU2 #H1 #H2 #H3 destruct
232 /5 width=5 by isrt_inv_plus_O_dx, ex4_intro, ex2_intro, or_intror/
236 (* Basic_1: includes: pr0_gen_abbr pr2_gen_abbr *)
237 (* Basic_2A1: includes: cpr_inv_abbr1 *)
238 lemma cpm_inv_abbr1: ∀h,n,p,G,L,V1,T1,U2. ❪G,L❫ ⊢ ⓓ[p]V1.T1 ➡[h,n] U2 →
239 ∨∨ ∃∃V2,T2. ❪G,L❫ ⊢ V1 ➡[h,0] V2 & ❪G,L.ⓓV1❫ ⊢ T1 ➡[h,n] T2 &
241 | ∃∃T. ⇧[1] T ≘ T1 & ❪G,L❫ ⊢ T ➡[h,n] U2 & p = true.
242 #h #n #p #G #L #V1 #T1 #U2 #H
243 elim (cpm_inv_bind1 … H) -H
244 [ /3 width=1 by or_introl/
245 | * /3 width=3 by ex3_intro, or_intror/
249 (* Basic_1: includes: pr0_gen_abst pr2_gen_abst *)
250 (* Basic_2A1: includes: cpr_inv_abst1 *)
251 lemma cpm_inv_abst1: ∀h,n,p,G,L,V1,T1,U2. ❪G,L❫ ⊢ ⓛ[p]V1.T1 ➡[h,n] U2 →
252 ∃∃V2,T2. ❪G,L❫ ⊢ V1 ➡[h,0] V2 & ❪G,L.ⓛV1❫ ⊢ T1 ➡[h,n] T2 &
254 #h #n #p #G #L #V1 #T1 #U2 #H
255 elim (cpm_inv_bind1 … H) -H
256 [ /3 width=1 by or_introl/
257 | * #T #_ #_ #_ #H destruct
261 lemma cpm_inv_abst_bi: ∀h,n,p1,p2,G,L,V1,V2,T1,T2. ❪G,L❫ ⊢ ⓛ[p1]V1.T1 ➡[h,n] ⓛ[p2]V2.T2 →
262 ∧∧ ❪G,L❫ ⊢ V1 ➡[h,0] V2 & ❪G,L.ⓛV1❫ ⊢ T1 ➡[h,n] T2 & p1 = p2.
263 #h #n #p1 #p2 #G #L #V1 #V2 #T1 #T2 #H
264 elim (cpm_inv_abst1 … H) -H #XV #XT #HV #HT #H destruct
265 /2 width=1 by and3_intro/
268 (* Basic_1: includes: pr0_gen_appl pr2_gen_appl *)
269 (* Basic_2A1: includes: cpr_inv_appl1 *)
270 lemma cpm_inv_appl1: ∀h,n,G,L,V1,U1,U2. ❪G,L❫ ⊢ ⓐ V1.U1 ➡[h,n] U2 →
271 ∨∨ ∃∃V2,T2. ❪G,L❫ ⊢ V1 ➡[h,0] V2 & ❪G,L❫ ⊢ U1 ➡[h,n] T2 &
273 | ∃∃p,V2,W1,W2,T1,T2. ❪G,L❫ ⊢ V1 ➡[h,0] V2 & ❪G,L❫ ⊢ W1 ➡[h,0] W2 &
274 ❪G,L.ⓛW1❫ ⊢ T1 ➡[h,n] T2 &
275 U1 = ⓛ[p]W1.T1 & U2 = ⓓ[p]ⓝW2.V2.T2
276 | ∃∃p,V,V2,W1,W2,T1,T2. ❪G,L❫ ⊢ V1 ➡[h,0] V & ⇧[1] V ≘ V2 &
277 ❪G,L❫ ⊢ W1 ➡[h,0] W2 & ❪G,L.ⓓW1❫ ⊢ T1 ➡[h,n] T2 &
278 U1 = ⓓ[p]W1.T1 & U2 = ⓓ[p]W2.ⓐV2.T2.
279 #h #n #G #L #V1 #U1 #U2 * #c #Hc #H elim (cpg_inv_appl1 … H) -H *
280 [ #cV #cT #V2 #T2 #HV12 #HT12 #H1 #H2 destruct
281 elim (isrt_inv_max … Hc) -Hc #nV #nT #HcV #HcT #H destruct
282 elim (isrt_inv_shift … HcV) -HcV #HcV #H destruct
283 /4 width=5 by or3_intro0, ex3_2_intro, ex2_intro/
284 | #cV #cW #cT #p #V2 #W1 #W2 #T1 #T2 #HV12 #HW12 #HT12 #H1 #H2 #H3 destruct
285 lapply (isrt_inv_plus_O_dx … Hc ?) -Hc // #Hc
286 elim (isrt_inv_max … Hc) -Hc #n0 #nT #Hc #HcT #H destruct
287 elim (isrt_inv_max … Hc) -Hc #nV #nW #HcV #HcW #H destruct
288 elim (isrt_inv_shift … HcV) -HcV #HcV #H destruct
289 elim (isrt_inv_shift … HcW) -HcW #HcW #H destruct
290 /4 width=11 by or3_intro1, ex5_6_intro, ex2_intro/
291 | #cV #cW #cT #p #V #V2 #W1 #W2 #T1 #T2 #HV1 #HV2 #HW12 #HT12 #H1 #H2 #H3 destruct
292 lapply (isrt_inv_plus_O_dx … Hc ?) -Hc // #Hc
293 elim (isrt_inv_max … Hc) -Hc #n0 #nT #Hc #HcT #H destruct
294 elim (isrt_inv_max … Hc) -Hc #nV #nW #HcV #HcW #H destruct
295 elim (isrt_inv_shift … HcV) -HcV #HcV #H destruct
296 elim (isrt_inv_shift … HcW) -HcW #HcW #H destruct
297 /4 width=13 by or3_intro2, ex6_7_intro, ex2_intro/
301 lemma cpm_inv_cast1: ∀h,n,G,L,V1,U1,U2. ❪G,L❫ ⊢ ⓝV1.U1 ➡[h,n] U2 →
302 ∨∨ ∃∃V2,T2. ❪G,L❫ ⊢ V1 ➡[h,n] V2 & ❪G,L❫ ⊢ U1 ➡[h,n] T2 &
304 | ❪G,L❫ ⊢ U1 ➡[h,n] U2
305 | ∃∃m. ❪G,L❫ ⊢ V1 ➡[h,m] U2 & n = ↑m.
306 #h #n #G #L #V1 #U1 #U2 * #c #Hc #H elim (cpg_inv_cast1 … H) -H *
307 [ #cV #cT #V2 #T2 #HV12 #HT12 #HcVT #H1 #H2 destruct
308 elim (isrt_inv_max … Hc) -Hc #nV #nT #HcV #HcT #H destruct
309 lapply (isrt_eq_t_trans … HcV HcVT) -HcVT #H
310 lapply (isrt_inj … H HcT) -H #H destruct <idempotent_max
311 /4 width=5 by or3_intro0, ex3_2_intro, ex2_intro/
312 | #cU #U12 #H destruct
313 /4 width=3 by isrt_inv_plus_O_dx, or3_intro1, ex2_intro/
314 | #cU #H12 #H destruct
315 elim (isrt_inv_plus_SO_dx … Hc) -Hc // #m #Hc #H destruct
316 /4 width=3 by or3_intro2, ex2_intro/
320 (* Basic forward lemmas *****************************************************)
322 (* Basic_2A1: includes: cpr_fwd_bind1_minus *)
323 lemma cpm_fwd_bind1_minus: ∀h,n,I,G,L,V1,T1,T. ❪G,L❫ ⊢ -ⓑ[I]V1.T1 ➡[h,n] T → ∀p.
324 ∃∃V2,T2. ❪G,L❫ ⊢ ⓑ[p,I]V1.T1 ➡[h,n] ⓑ[p,I]V2.T2 &
326 #h #n #I #G #L #V1 #T1 #T * #c #Hc #H #p elim (cpg_fwd_bind1_minus … H p) -H
327 /3 width=4 by ex2_2_intro, ex2_intro/
330 (* Basic eliminators ********************************************************)
332 lemma cpm_ind (h): ∀Q:relation5 nat genv lenv term term.
333 (∀I,G,L. Q 0 G L (⓪[I]) (⓪[I])) →
334 (∀G,L,s. Q 1 G L (⋆s) (⋆(⫯[h]s))) →
335 (∀n,G,K,V1,V2,W2. ❪G,K❫ ⊢ V1 ➡[h,n] V2 → Q n G K V1 V2 →
336 ⇧[1] V2 ≘ W2 → Q n G (K.ⓓV1) (#0) W2
337 ) → (∀n,G,K,V1,V2,W2. ❪G,K❫ ⊢ V1 ➡[h,n] V2 → Q n G K V1 V2 →
338 ⇧[1] V2 ≘ W2 → Q (↑n) G (K.ⓛV1) (#0) W2
339 ) → (∀n,I,G,K,T,U,i. ❪G,K❫ ⊢ #i ➡[h,n] T → Q n G K (#i) T →
340 ⇧[1] T ≘ U → Q n G (K.ⓘ[I]) (#↑i) (U)
341 ) → (∀n,p,I,G,L,V1,V2,T1,T2. ❪G,L❫ ⊢ V1 ➡[h,0] V2 → ❪G,L.ⓑ[I]V1❫ ⊢ T1 ➡[h,n] T2 →
342 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)
343 ) → (∀n,G,L,V1,V2,T1,T2. ❪G,L❫ ⊢ V1 ➡[h,0] V2 → ❪G,L❫ ⊢ T1 ➡[h,n] T2 →
344 Q 0 G L V1 V2 → Q n G L T1 T2 → Q n G L (ⓐV1.T1) (ⓐV2.T2)
345 ) → (∀n,G,L,V1,V2,T1,T2. ❪G,L❫ ⊢ V1 ➡[h,n] V2 → ❪G,L❫ ⊢ T1 ➡[h,n] T2 →
346 Q n G L V1 V2 → Q n G L T1 T2 → Q n G L (ⓝV1.T1) (ⓝV2.T2)
347 ) → (∀n,G,L,V,T1,T,T2. ⇧[1] T ≘ T1 → ❪G,L❫ ⊢ T ➡[h,n] T2 →
348 Q n G L T T2 → Q n G L (+ⓓV.T1) T2
349 ) → (∀n,G,L,V,T1,T2. ❪G,L❫ ⊢ T1 ➡[h,n] T2 →
350 Q n G L T1 T2 → Q n G L (ⓝV.T1) T2
351 ) → (∀n,G,L,V1,V2,T. ❪G,L❫ ⊢ V1 ➡[h,n] V2 →
352 Q n G L V1 V2 → Q (↑n) G L (ⓝV1.T) V2
353 ) → (∀n,p,G,L,V1,V2,W1,W2,T1,T2. ❪G,L❫ ⊢ V1 ➡[h,0] V2 → ❪G,L❫ ⊢ W1 ➡[h,0] W2 → ❪G,L.ⓛW1❫ ⊢ T1 ➡[h,n] T2 →
354 Q 0 G L V1 V2 → Q 0 G L W1 W2 → Q n G (L.ⓛW1) T1 T2 →
355 Q n G L (ⓐV1.ⓛ[p]W1.T1) (ⓓ[p]ⓝW2.V2.T2)
356 ) → (∀n,p,G,L,V1,V,V2,W1,W2,T1,T2. ❪G,L❫ ⊢ V1 ➡[h,0] V → ❪G,L❫ ⊢ W1 ➡[h,0] W2 → ❪G,L.ⓓW1❫ ⊢ T1 ➡[h,n] T2 →
357 Q 0 G L V1 V → Q 0 G L W1 W2 → Q n G (L.ⓓW1) T1 T2 →
358 ⇧[1] V ≘ V2 → Q n G L (ⓐV1.ⓓ[p]W1.T1) (ⓓ[p]W2.ⓐV2.T2)
360 ∀n,G,L,T1,T2. ❪G,L❫ ⊢ T1 ➡[h,n] T2 → Q n G L T1 T2.
361 #h #Q #IH1 #IH2 #IH3 #IH4 #IH5 #IH6 #IH7 #IH8 #IH9 #IH10 #IH11 #IH12 #IH13 #n #G #L #T1 #T2
362 * #c #HC #H generalize in match HC; -HC generalize in match n; -n
363 elim H -c -G -L -T1 -T2
364 [ #I #G #L #n #H <(isrt_inv_00 … H) -H //
365 | #G #L #s #n #H <(isrt_inv_01 … H) -H //
366 | /3 width=4 by ex2_intro/
367 | #c #G #L #V1 #V2 #W2 #HV12 #HVW2 #IH #x #H
368 elim (isrt_inv_plus_SO_dx … H) -H // #n #Hc #H destruct
369 /3 width=4 by ex2_intro/
370 | /3 width=4 by ex2_intro/
371 | #cV #cT #p #I #G #L #V1 #V2 #T1 #T2 #HV12 #HT12 #IHV #IHT #n #H
372 elim (isrt_inv_max_shift_sn … H) -H #HcV #HcT
373 /3 width=3 by ex2_intro/
374 | #cV #cT #G #L #V1 #V2 #T1 #T2 #HV12 #HT12 #IHV #IHT #n #H
375 elim (isrt_inv_max_shift_sn … H) -H #HcV #HcT
376 /3 width=3 by ex2_intro/
377 | #cU #cT #G #L #U1 #U2 #T1 #T2 #HUT #HU12 #HT12 #IHU #IHT #n #H
378 elim (isrt_inv_max_eq_t … H) -H // #HcV #HcT
379 /3 width=3 by ex2_intro/
380 | #c #G #L #V #T1 #T #T2 #HT1 #HT2 #IH #n #H
381 lapply (isrt_inv_plus_O_dx … H ?) -H // #Hc
382 /3 width=4 by ex2_intro/
383 | #c #G #L #U #T1 #T2 #HT12 #IH #n #H
384 lapply (isrt_inv_plus_O_dx … H ?) -H // #Hc
385 /3 width=3 by ex2_intro/
386 | #c #G #L #U1 #U2 #T #HU12 #IH #x #H
387 elim (isrt_inv_plus_SO_dx … H) -H // #n #Hc #H destruct
388 /3 width=3 by ex2_intro/
389 | #cV #cW #cT #p #G #L #V1 #V2 #W1 #W2 #T1 #T2 #HV12 #HW12 #HT12 #IHV #IHW #IHT #n #H
390 lapply (isrt_inv_plus_O_dx … H ?) -H // >max_shift #H
391 elim (isrt_inv_max_shift_sn … H) -H #H #HcT
392 elim (isrt_O_inv_max … H) -H #HcV #HcW
393 /3 width=3 by ex2_intro/
394 | #cV #cW #cT #p #G #L #V1 #V #V2 #W1 #W2 #T1 #T2 #HV1 #HV2 #HW12 #HT12 #IHV #IHW #IHT #n #H
395 lapply (isrt_inv_plus_O_dx … H ?) -H // >max_shift #H
396 elim (isrt_inv_max_shift_sn … H) -H #H #HcT
397 elim (isrt_O_inv_max … H) -H #HcV #HcW
398 /3 width=4 by ex2_intro/