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 (* This file was automatically generated: do not edit *********************)
17 include "basic_1/ty3/fwd.ma".
19 include "basic_1/pc3/fwd.ma".
22 \forall (g: G).(\forall (e: C).(\forall (t1: T).(\forall (t2: T).((ty3 g e
23 t1 t2) \to (\forall (c: C).(\forall (d: nat).(\forall (h: nat).((drop h d c
24 e) \to (ty3 g c (lift h d t1) (lift h d t2))))))))))
26 \lambda (g: G).(\lambda (e: C).(\lambda (t1: T).(\lambda (t2: T).(\lambda
27 (H: (ty3 g e t1 t2)).(ty3_ind g (\lambda (c: C).(\lambda (t: T).(\lambda (t0:
28 T).(\forall (c0: C).(\forall (d: nat).(\forall (h: nat).((drop h d c0 c) \to
29 (ty3 g c0 (lift h d t) (lift h d t0))))))))) (\lambda (c: C).(\lambda (t0:
30 T).(\lambda (t: T).(\lambda (_: (ty3 g c t0 t)).(\lambda (H1: ((\forall (c0:
31 C).(\forall (d: nat).(\forall (h: nat).((drop h d c0 c) \to (ty3 g c0 (lift h
32 d t0) (lift h d t)))))))).(\lambda (u: T).(\lambda (t3: T).(\lambda (_: (ty3
33 g c u t3)).(\lambda (H3: ((\forall (c0: C).(\forall (d: nat).(\forall (h:
34 nat).((drop h d c0 c) \to (ty3 g c0 (lift h d u) (lift h d
35 t3)))))))).(\lambda (H4: (pc3 c t3 t0)).(\lambda (c0: C).(\lambda (d:
36 nat).(\lambda (h: nat).(\lambda (H5: (drop h d c0 c)).(ty3_conv g c0 (lift h
37 d t0) (lift h d t) (H1 c0 d h H5) (lift h d u) (lift h d t3) (H3 c0 d h H5)
38 (pc3_lift c0 c h d H5 t3 t0 H4)))))))))))))))) (\lambda (c: C).(\lambda (m:
39 nat).(\lambda (c0: C).(\lambda (d: nat).(\lambda (h: nat).(\lambda (_: (drop
40 h d c0 c)).(eq_ind_r T (TSort m) (\lambda (t: T).(ty3 g c0 t (lift h d (TSort
41 (next g m))))) (eq_ind_r T (TSort (next g m)) (\lambda (t: T).(ty3 g c0
42 (TSort m) t)) (ty3_sort g c0 m) (lift h d (TSort (next g m))) (lift_sort
43 (next g m) h d)) (lift h d (TSort m)) (lift_sort m h d)))))))) (\lambda (n:
44 nat).(\lambda (c: C).(\lambda (d: C).(\lambda (u: T).(\lambda (H0: (getl n c
45 (CHead d (Bind Abbr) u))).(\lambda (t: T).(\lambda (H1: (ty3 g d u
46 t)).(\lambda (H2: ((\forall (c0: C).(\forall (d0: nat).(\forall (h:
47 nat).((drop h d0 c0 d) \to (ty3 g c0 (lift h d0 u) (lift h d0
48 t)))))))).(\lambda (c0: C).(\lambda (d0: nat).(\lambda (h: nat).(\lambda (H3:
49 (drop h d0 c0 c)).(lt_le_e n d0 (ty3 g c0 (lift h d0 (TLRef n)) (lift h d0
50 (lift (S n) O t))) (\lambda (H4: (lt n d0)).(let H5 \def (drop_getl_trans_le
51 n d0 (le_S_n n d0 (le_S_n (S n) (S d0) (le_S (S (S n)) (S d0) (le_n_S (S n)
52 d0 H4)))) c0 c h H3 (CHead d (Bind Abbr) u) H0) in (ex3_2_ind C C (\lambda
53 (e0: C).(\lambda (_: C).(drop n O c0 e0))) (\lambda (e0: C).(\lambda (e1:
54 C).(drop h (minus d0 n) e0 e1))) (\lambda (_: C).(\lambda (e1: C).(clear e1
55 (CHead d (Bind Abbr) u)))) (ty3 g c0 (lift h d0 (TLRef n)) (lift h d0 (lift
56 (S n) O t))) (\lambda (x0: C).(\lambda (x1: C).(\lambda (H6: (drop n O c0
57 x0)).(\lambda (H7: (drop h (minus d0 n) x0 x1)).(\lambda (H8: (clear x1
58 (CHead d (Bind Abbr) u))).(let H9 \def (eq_ind nat (minus d0 n) (\lambda (n0:
59 nat).(drop h n0 x0 x1)) H7 (S (minus d0 (S n))) (minus_x_Sy d0 n H4)) in (let
60 H10 \def (drop_clear_S x1 x0 h (minus d0 (S n)) H9 Abbr d u H8) in (ex2_ind C
61 (\lambda (c1: C).(clear x0 (CHead c1 (Bind Abbr) (lift h (minus d0 (S n))
62 u)))) (\lambda (c1: C).(drop h (minus d0 (S n)) c1 d)) (ty3 g c0 (lift h d0
63 (TLRef n)) (lift h d0 (lift (S n) O t))) (\lambda (x: C).(\lambda (H11:
64 (clear x0 (CHead x (Bind Abbr) (lift h (minus d0 (S n)) u)))).(\lambda (H12:
65 (drop h (minus d0 (S n)) x d)).(eq_ind_r T (TLRef n) (\lambda (t0: T).(ty3 g
66 c0 t0 (lift h d0 (lift (S n) O t)))) (eq_ind nat (plus (S n) (minus d0 (S
67 n))) (\lambda (n0: nat).(ty3 g c0 (TLRef n) (lift h n0 (lift (S n) O t))))
68 (eq_ind_r T (lift (S n) O (lift h (minus d0 (S n)) t)) (\lambda (t0: T).(ty3
69 g c0 (TLRef n) t0)) (eq_ind nat d0 (\lambda (_: nat).(ty3 g c0 (TLRef n)
70 (lift (S n) O (lift h (minus d0 (S n)) t)))) (ty3_abbr g n c0 x (lift h
71 (minus d0 (S n)) u) (getl_intro n c0 (CHead x (Bind Abbr) (lift h (minus d0
72 (S n)) u)) x0 H6 H11) (lift h (minus d0 (S n)) t) (H2 x (minus d0 (S n)) h
73 H12)) (plus (S n) (minus d0 (S n))) (le_plus_minus (S n) d0 H4)) (lift h
74 (plus (S n) (minus d0 (S n))) (lift (S n) O t)) (lift_d t h (S n) (minus d0
75 (S n)) O (le_O_n (minus d0 (S n))))) d0 (le_plus_minus_r (S n) d0 H4)) (lift
76 h d0 (TLRef n)) (lift_lref_lt n h d0 H4))))) H10)))))))) H5))) (\lambda (H4:
77 (le d0 n)).(eq_ind_r T (TLRef (plus n h)) (\lambda (t0: T).(ty3 g c0 t0 (lift
78 h d0 (lift (S n) O t)))) (eq_ind nat (S n) (\lambda (_: nat).(ty3 g c0 (TLRef
79 (plus n h)) (lift h d0 (lift (S n) O t)))) (eq_ind_r T (lift (plus h (S n)) O
80 t) (\lambda (t0: T).(ty3 g c0 (TLRef (plus n h)) t0)) (eq_ind_r nat (plus (S
81 n) h) (\lambda (n0: nat).(ty3 g c0 (TLRef (plus n h)) (lift n0 O t)))
82 (ty3_abbr g (plus n h) c0 d u (drop_getl_trans_ge n c0 c d0 h H3 (CHead d
83 (Bind Abbr) u) H0 H4) t H1) (plus h (S n)) (plus_sym h (S n))) (lift h d0
84 (lift (S n) O t)) (lift_free t (S n) h O d0 (le_S_n d0 (S n) (le_S (S d0) (S
85 n) (le_n_S d0 n H4))) (le_O_n d0))) (plus n (S O)) (eq_ind_r nat (plus (S O)
86 n) (\lambda (n0: nat).(eq nat (S n) n0)) (le_antisym (S n) (plus (S O) n)
87 (le_n (plus (S O) n)) (le_n (S n))) (plus n (S O)) (plus_sym n (S O)))) (lift
88 h d0 (TLRef n)) (lift_lref_ge n h d0 H4)))))))))))))))) (\lambda (n:
89 nat).(\lambda (c: C).(\lambda (d: C).(\lambda (u: T).(\lambda (H0: (getl n c
90 (CHead d (Bind Abst) u))).(\lambda (t: T).(\lambda (H1: (ty3 g d u
91 t)).(\lambda (H2: ((\forall (c0: C).(\forall (d0: nat).(\forall (h:
92 nat).((drop h d0 c0 d) \to (ty3 g c0 (lift h d0 u) (lift h d0
93 t)))))))).(\lambda (c0: C).(\lambda (d0: nat).(\lambda (h: nat).(\lambda (H3:
94 (drop h d0 c0 c)).(lt_le_e n d0 (ty3 g c0 (lift h d0 (TLRef n)) (lift h d0
95 (lift (S n) O u))) (\lambda (H4: (lt n d0)).(let H5 \def (drop_getl_trans_le
96 n d0 (le_S_n n d0 (le_S_n (S n) (S d0) (le_S (S (S n)) (S d0) (le_n_S (S n)
97 d0 H4)))) c0 c h H3 (CHead d (Bind Abst) u) H0) in (ex3_2_ind C C (\lambda
98 (e0: C).(\lambda (_: C).(drop n O c0 e0))) (\lambda (e0: C).(\lambda (e1:
99 C).(drop h (minus d0 n) e0 e1))) (\lambda (_: C).(\lambda (e1: C).(clear e1
100 (CHead d (Bind Abst) u)))) (ty3 g c0 (lift h d0 (TLRef n)) (lift h d0 (lift
101 (S n) O u))) (\lambda (x0: C).(\lambda (x1: C).(\lambda (H6: (drop n O c0
102 x0)).(\lambda (H7: (drop h (minus d0 n) x0 x1)).(\lambda (H8: (clear x1
103 (CHead d (Bind Abst) u))).(let H9 \def (eq_ind nat (minus d0 n) (\lambda (n0:
104 nat).(drop h n0 x0 x1)) H7 (S (minus d0 (S n))) (minus_x_Sy d0 n H4)) in (let
105 H10 \def (drop_clear_S x1 x0 h (minus d0 (S n)) H9 Abst d u H8) in (ex2_ind C
106 (\lambda (c1: C).(clear x0 (CHead c1 (Bind Abst) (lift h (minus d0 (S n))
107 u)))) (\lambda (c1: C).(drop h (minus d0 (S n)) c1 d)) (ty3 g c0 (lift h d0
108 (TLRef n)) (lift h d0 (lift (S n) O u))) (\lambda (x: C).(\lambda (H11:
109 (clear x0 (CHead x (Bind Abst) (lift h (minus d0 (S n)) u)))).(\lambda (H12:
110 (drop h (minus d0 (S n)) x d)).(eq_ind_r T (TLRef n) (\lambda (t0: T).(ty3 g
111 c0 t0 (lift h d0 (lift (S n) O u)))) (eq_ind nat (plus (S n) (minus d0 (S
112 n))) (\lambda (n0: nat).(ty3 g c0 (TLRef n) (lift h n0 (lift (S n) O u))))
113 (eq_ind_r T (lift (S n) O (lift h (minus d0 (S n)) u)) (\lambda (t0: T).(ty3
114 g c0 (TLRef n) t0)) (eq_ind nat d0 (\lambda (_: nat).(ty3 g c0 (TLRef n)
115 (lift (S n) O (lift h (minus d0 (S n)) u)))) (ty3_abst g n c0 x (lift h
116 (minus d0 (S n)) u) (getl_intro n c0 (CHead x (Bind Abst) (lift h (minus d0
117 (S n)) u)) x0 H6 H11) (lift h (minus d0 (S n)) t) (H2 x (minus d0 (S n)) h
118 H12)) (plus (S n) (minus d0 (S n))) (le_plus_minus (S n) d0 H4)) (lift h
119 (plus (S n) (minus d0 (S n))) (lift (S n) O u)) (lift_d u h (S n) (minus d0
120 (S n)) O (le_O_n (minus d0 (S n))))) d0 (le_plus_minus_r (S n) d0 H4)) (lift
121 h d0 (TLRef n)) (lift_lref_lt n h d0 H4))))) H10)))))))) H5))) (\lambda (H4:
122 (le d0 n)).(eq_ind_r T (TLRef (plus n h)) (\lambda (t0: T).(ty3 g c0 t0 (lift
123 h d0 (lift (S n) O u)))) (eq_ind nat (S n) (\lambda (_: nat).(ty3 g c0 (TLRef
124 (plus n h)) (lift h d0 (lift (S n) O u)))) (eq_ind_r T (lift (plus h (S n)) O
125 u) (\lambda (t0: T).(ty3 g c0 (TLRef (plus n h)) t0)) (eq_ind_r nat (plus (S
126 n) h) (\lambda (n0: nat).(ty3 g c0 (TLRef (plus n h)) (lift n0 O u)))
127 (ty3_abst g (plus n h) c0 d u (drop_getl_trans_ge n c0 c d0 h H3 (CHead d
128 (Bind Abst) u) H0 H4) t H1) (plus h (S n)) (plus_sym h (S n))) (lift h d0
129 (lift (S n) O u)) (lift_free u (S n) h O d0 (le_S_n d0 (S n) (le_S (S d0) (S
130 n) (le_n_S d0 n H4))) (le_O_n d0))) (plus n (S O)) (eq_ind_r nat (plus (S O)
131 n) (\lambda (n0: nat).(eq nat (S n) n0)) (le_antisym (S n) (plus (S O) n)
132 (le_n (plus (S O) n)) (le_n (S n))) (plus n (S O)) (plus_sym n (S O)))) (lift
133 h d0 (TLRef n)) (lift_lref_ge n h d0 H4)))))))))))))))) (\lambda (c:
134 C).(\lambda (u: T).(\lambda (t: T).(\lambda (_: (ty3 g c u t)).(\lambda (H1:
135 ((\forall (c0: C).(\forall (d: nat).(\forall (h: nat).((drop h d c0 c) \to
136 (ty3 g c0 (lift h d u) (lift h d t)))))))).(\lambda (b: B).(\lambda (t0:
137 T).(\lambda (t3: T).(\lambda (_: (ty3 g (CHead c (Bind b) u) t0 t3)).(\lambda
138 (H3: ((\forall (c0: C).(\forall (d: nat).(\forall (h: nat).((drop h d c0
139 (CHead c (Bind b) u)) \to (ty3 g c0 (lift h d t0) (lift h d
140 t3)))))))).(\lambda (c0: C).(\lambda (d: nat).(\lambda (h: nat).(\lambda (H4:
141 (drop h d c0 c)).(eq_ind_r T (THead (Bind b) (lift h d u) (lift h (s (Bind b)
142 d) t0)) (\lambda (t4: T).(ty3 g c0 t4 (lift h d (THead (Bind b) u t3))))
143 (eq_ind_r T (THead (Bind b) (lift h d u) (lift h (s (Bind b) d) t3)) (\lambda
144 (t4: T).(ty3 g c0 (THead (Bind b) (lift h d u) (lift h (s (Bind b) d) t0))
145 t4)) (ty3_bind g c0 (lift h d u) (lift h d t) (H1 c0 d h H4) b (lift h (S d)
146 t0) (lift h (S d) t3) (H3 (CHead c0 (Bind b) (lift h d u)) (S d) h
147 (drop_skip_bind h d c0 c H4 b u))) (lift h d (THead (Bind b) u t3))
148 (lift_head (Bind b) u t3 h d)) (lift h d (THead (Bind b) u t0)) (lift_head
149 (Bind b) u t0 h d)))))))))))))))) (\lambda (c: C).(\lambda (w: T).(\lambda
150 (u: T).(\lambda (_: (ty3 g c w u)).(\lambda (H1: ((\forall (c0: C).(\forall
151 (d: nat).(\forall (h: nat).((drop h d c0 c) \to (ty3 g c0 (lift h d w) (lift
152 h d u)))))))).(\lambda (v: T).(\lambda (t: T).(\lambda (_: (ty3 g c v (THead
153 (Bind Abst) u t))).(\lambda (H3: ((\forall (c0: C).(\forall (d: nat).(\forall
154 (h: nat).((drop h d c0 c) \to (ty3 g c0 (lift h d v) (lift h d (THead (Bind
155 Abst) u t))))))))).(\lambda (c0: C).(\lambda (d: nat).(\lambda (h:
156 nat).(\lambda (H4: (drop h d c0 c)).(eq_ind_r T (THead (Flat Appl) (lift h d
157 w) (lift h (s (Flat Appl) d) v)) (\lambda (t0: T).(ty3 g c0 t0 (lift h d
158 (THead (Flat Appl) w (THead (Bind Abst) u t))))) (eq_ind_r T (THead (Flat
159 Appl) (lift h d w) (lift h (s (Flat Appl) d) (THead (Bind Abst) u t)))
160 (\lambda (t0: T).(ty3 g c0 (THead (Flat Appl) (lift h d w) (lift h (s (Flat
161 Appl) d) v)) t0)) (eq_ind_r T (THead (Bind Abst) (lift h (s (Flat Appl) d) u)
162 (lift h (s (Bind Abst) (s (Flat Appl) d)) t)) (\lambda (t0: T).(ty3 g c0
163 (THead (Flat Appl) (lift h d w) (lift h (s (Flat Appl) d) v)) (THead (Flat
164 Appl) (lift h d w) t0))) (ty3_appl g c0 (lift h d w) (lift h d u) (H1 c0 d h
165 H4) (lift h d v) (lift h (S d) t) (eq_ind T (lift h d (THead (Bind Abst) u
166 t)) (\lambda (t0: T).(ty3 g c0 (lift h d v) t0)) (H3 c0 d h H4) (THead (Bind
167 Abst) (lift h d u) (lift h (S d) t)) (lift_bind Abst u t h d))) (lift h (s
168 (Flat Appl) d) (THead (Bind Abst) u t)) (lift_head (Bind Abst) u t h (s (Flat
169 Appl) d))) (lift h d (THead (Flat Appl) w (THead (Bind Abst) u t)))
170 (lift_head (Flat Appl) w (THead (Bind Abst) u t) h d)) (lift h d (THead (Flat
171 Appl) w v)) (lift_head (Flat Appl) w v h d))))))))))))))) (\lambda (c:
172 C).(\lambda (t0: T).(\lambda (t3: T).(\lambda (_: (ty3 g c t0 t3)).(\lambda
173 (H1: ((\forall (c0: C).(\forall (d: nat).(\forall (h: nat).((drop h d c0 c)
174 \to (ty3 g c0 (lift h d t0) (lift h d t3)))))))).(\lambda (t4: T).(\lambda
175 (_: (ty3 g c t3 t4)).(\lambda (H3: ((\forall (c0: C).(\forall (d:
176 nat).(\forall (h: nat).((drop h d c0 c) \to (ty3 g c0 (lift h d t3) (lift h d
177 t4)))))))).(\lambda (c0: C).(\lambda (d: nat).(\lambda (h: nat).(\lambda (H4:
178 (drop h d c0 c)).(eq_ind_r T (THead (Flat Cast) (lift h d t3) (lift h (s
179 (Flat Cast) d) t0)) (\lambda (t: T).(ty3 g c0 t (lift h d (THead (Flat Cast)
180 t4 t3)))) (eq_ind_r T (THead (Flat Cast) (lift h d t4) (lift h (s (Flat Cast)
181 d) t3)) (\lambda (t: T).(ty3 g c0 (THead (Flat Cast) (lift h d t3) (lift h (s
182 (Flat Cast) d) t0)) t)) (ty3_cast g c0 (lift h (s (Flat Cast) d) t0) (lift h
183 (s (Flat Cast) d) t3) (H1 c0 (s (Flat Cast) d) h H4) (lift h d t4) (H3 c0 d h
184 H4)) (lift h d (THead (Flat Cast) t4 t3)) (lift_head (Flat Cast) t4 t3 h d))
185 (lift h d (THead (Flat Cast) t3 t0)) (lift_head (Flat Cast) t3 t0 h
186 d)))))))))))))) e t1 t2 H))))).
189 \forall (g: G).(\forall (c: C).(\forall (t1: T).(\forall (t2: T).((ty3 g c
190 t1 t2) \to (ex T (\lambda (t: T).(ty3 g c t2 t)))))))
192 \lambda (g: G).(\lambda (c: C).(\lambda (t1: T).(\lambda (t2: T).(\lambda
193 (H: (ty3 g c t1 t2)).(ty3_ind g (\lambda (c0: C).(\lambda (_: T).(\lambda
194 (t0: T).(ex T (\lambda (t3: T).(ty3 g c0 t0 t3)))))) (\lambda (c0:
195 C).(\lambda (t0: T).(\lambda (t: T).(\lambda (H0: (ty3 g c0 t0 t)).(\lambda
196 (_: (ex T (\lambda (t3: T).(ty3 g c0 t t3)))).(\lambda (u: T).(\lambda (t3:
197 T).(\lambda (_: (ty3 g c0 u t3)).(\lambda (_: (ex T (\lambda (t4: T).(ty3 g
198 c0 t3 t4)))).(\lambda (_: (pc3 c0 t3 t0)).(ex_intro T (\lambda (t4: T).(ty3 g
199 c0 t0 t4)) t H0))))))))))) (\lambda (c0: C).(\lambda (m: nat).(ex_intro T
200 (\lambda (t: T).(ty3 g c0 (TSort (next g m)) t)) (TSort (next g (next g m)))
201 (ty3_sort g c0 (next g m))))) (\lambda (n: nat).(\lambda (c0: C).(\lambda (d:
202 C).(\lambda (u: T).(\lambda (H0: (getl n c0 (CHead d (Bind Abbr)
203 u))).(\lambda (t: T).(\lambda (_: (ty3 g d u t)).(\lambda (H2: (ex T (\lambda
204 (t0: T).(ty3 g d t t0)))).(let H3 \def H2 in (ex_ind T (\lambda (t0: T).(ty3
205 g d t t0)) (ex T (\lambda (t0: T).(ty3 g c0 (lift (S n) O t) t0))) (\lambda
206 (x: T).(\lambda (H4: (ty3 g d t x)).(ex_intro T (\lambda (t0: T).(ty3 g c0
207 (lift (S n) O t) t0)) (lift (S n) O x) (ty3_lift g d t x H4 c0 O (S n)
208 (getl_drop Abbr c0 d u n H0))))) H3)))))))))) (\lambda (n: nat).(\lambda (c0:
209 C).(\lambda (d: C).(\lambda (u: T).(\lambda (H0: (getl n c0 (CHead d (Bind
210 Abst) u))).(\lambda (t: T).(\lambda (H1: (ty3 g d u t)).(\lambda (_: (ex T
211 (\lambda (t0: T).(ty3 g d t t0)))).(ex_intro T (\lambda (t0: T).(ty3 g c0
212 (lift (S n) O u) t0)) (lift (S n) O t) (ty3_lift g d u t H1 c0 O (S n)
213 (getl_drop Abst c0 d u n H0))))))))))) (\lambda (c0: C).(\lambda (u:
214 T).(\lambda (t: T).(\lambda (H0: (ty3 g c0 u t)).(\lambda (_: (ex T (\lambda
215 (t0: T).(ty3 g c0 t t0)))).(\lambda (b: B).(\lambda (t0: T).(\lambda (t3:
216 T).(\lambda (_: (ty3 g (CHead c0 (Bind b) u) t0 t3)).(\lambda (H3: (ex T
217 (\lambda (t4: T).(ty3 g (CHead c0 (Bind b) u) t3 t4)))).(let H4 \def H3 in
218 (ex_ind T (\lambda (t4: T).(ty3 g (CHead c0 (Bind b) u) t3 t4)) (ex T
219 (\lambda (t4: T).(ty3 g c0 (THead (Bind b) u t3) t4))) (\lambda (x:
220 T).(\lambda (H5: (ty3 g (CHead c0 (Bind b) u) t3 x)).(ex_intro T (\lambda
221 (t4: T).(ty3 g c0 (THead (Bind b) u t3) t4)) (THead (Bind b) u x) (ty3_bind g
222 c0 u t H0 b t3 x H5)))) H4)))))))))))) (\lambda (c0: C).(\lambda (w:
223 T).(\lambda (u: T).(\lambda (H0: (ty3 g c0 w u)).(\lambda (H1: (ex T (\lambda
224 (t: T).(ty3 g c0 u t)))).(\lambda (v: T).(\lambda (t: T).(\lambda (_: (ty3 g
225 c0 v (THead (Bind Abst) u t))).(\lambda (H3: (ex T (\lambda (t0: T).(ty3 g c0
226 (THead (Bind Abst) u t) t0)))).(let H4 \def H1 in (ex_ind T (\lambda (t0:
227 T).(ty3 g c0 u t0)) (ex T (\lambda (t0: T).(ty3 g c0 (THead (Flat Appl) w
228 (THead (Bind Abst) u t)) t0))) (\lambda (x: T).(\lambda (_: (ty3 g c0 u
229 x)).(let H6 \def H3 in (ex_ind T (\lambda (t0: T).(ty3 g c0 (THead (Bind
230 Abst) u t) t0)) (ex T (\lambda (t0: T).(ty3 g c0 (THead (Flat Appl) w (THead
231 (Bind Abst) u t)) t0))) (\lambda (x0: T).(\lambda (H7: (ty3 g c0 (THead (Bind
232 Abst) u t) x0)).(ex3_2_ind T T (\lambda (t3: T).(\lambda (_: T).(pc3 c0
233 (THead (Bind Abst) u t3) x0))) (\lambda (_: T).(\lambda (t0: T).(ty3 g c0 u
234 t0))) (\lambda (t3: T).(\lambda (_: T).(ty3 g (CHead c0 (Bind Abst) u) t
235 t3))) (ex T (\lambda (t0: T).(ty3 g c0 (THead (Flat Appl) w (THead (Bind
236 Abst) u t)) t0))) (\lambda (x1: T).(\lambda (x2: T).(\lambda (_: (pc3 c0
237 (THead (Bind Abst) u x1) x0)).(\lambda (H9: (ty3 g c0 u x2)).(\lambda (H10:
238 (ty3 g (CHead c0 (Bind Abst) u) t x1)).(ex_intro T (\lambda (t0: T).(ty3 g c0
239 (THead (Flat Appl) w (THead (Bind Abst) u t)) t0)) (THead (Flat Appl) w
240 (THead (Bind Abst) u x1)) (ty3_appl g c0 w u H0 (THead (Bind Abst) u t) x1
241 (ty3_bind g c0 u x2 H9 Abst t x1 H10)))))))) (ty3_gen_bind g Abst c0 u t x0
242 H7)))) H6)))) H4))))))))))) (\lambda (c0: C).(\lambda (t0: T).(\lambda (t3:
243 T).(\lambda (_: (ty3 g c0 t0 t3)).(\lambda (_: (ex T (\lambda (t: T).(ty3 g
244 c0 t3 t)))).(\lambda (t4: T).(\lambda (H2: (ty3 g c0 t3 t4)).(\lambda (H3:
245 (ex T (\lambda (t: T).(ty3 g c0 t4 t)))).(let H4 \def H3 in (ex_ind T
246 (\lambda (t: T).(ty3 g c0 t4 t)) (ex T (\lambda (t: T).(ty3 g c0 (THead (Flat
247 Cast) t4 t3) t))) (\lambda (x: T).(\lambda (H5: (ty3 g c0 t4 x)).(ex_intro T
248 (\lambda (t: T).(ty3 g c0 (THead (Flat Cast) t4 t3) t)) (THead (Flat Cast) x
249 t4) (ty3_cast g c0 t3 t4 H2 x H5)))) H4)))))))))) c t1 t2 H))))).
252 \forall (g: G).(\forall (c: C).(\forall (u: T).(\forall (t1: T).((ty3 g c u
253 t1) \to (\forall (t2: T).((ty3 g c u t2) \to (pc3 c t1 t2)))))))
255 \lambda (g: G).(\lambda (c: C).(\lambda (u: T).(\lambda (t1: T).(\lambda (H:
256 (ty3 g c u t1)).(ty3_ind g (\lambda (c0: C).(\lambda (t: T).(\lambda (t0:
257 T).(\forall (t2: T).((ty3 g c0 t t2) \to (pc3 c0 t0 t2)))))) (\lambda (c0:
258 C).(\lambda (t2: T).(\lambda (t: T).(\lambda (_: (ty3 g c0 t2 t)).(\lambda
259 (_: ((\forall (t3: T).((ty3 g c0 t2 t3) \to (pc3 c0 t t3))))).(\lambda (u0:
260 T).(\lambda (t0: T).(\lambda (_: (ty3 g c0 u0 t0)).(\lambda (H3: ((\forall
261 (t3: T).((ty3 g c0 u0 t3) \to (pc3 c0 t0 t3))))).(\lambda (H4: (pc3 c0 t0
262 t2)).(\lambda (t3: T).(\lambda (H5: (ty3 g c0 u0 t3)).(pc3_t t0 c0 t2 (pc3_s
263 c0 t2 t0 H4) t3 (H3 t3 H5)))))))))))))) (\lambda (c0: C).(\lambda (m:
264 nat).(\lambda (t2: T).(\lambda (H0: (ty3 g c0 (TSort m) t2)).(ty3_gen_sort g
265 c0 t2 m H0))))) (\lambda (n: nat).(\lambda (c0: C).(\lambda (d: C).(\lambda
266 (u0: T).(\lambda (H0: (getl n c0 (CHead d (Bind Abbr) u0))).(\lambda (t:
267 T).(\lambda (_: (ty3 g d u0 t)).(\lambda (H2: ((\forall (t2: T).((ty3 g d u0
268 t2) \to (pc3 d t t2))))).(\lambda (t2: T).(\lambda (H3: (ty3 g c0 (TLRef n)
269 t2)).(or_ind (ex3_3 C T T (\lambda (_: C).(\lambda (_: T).(\lambda (t0:
270 T).(pc3 c0 (lift (S n) O t0) t2)))) (\lambda (e: C).(\lambda (u1: T).(\lambda
271 (_: T).(getl n c0 (CHead e (Bind Abbr) u1))))) (\lambda (e: C).(\lambda (u1:
272 T).(\lambda (t0: T).(ty3 g e u1 t0))))) (ex3_3 C T T (\lambda (_: C).(\lambda
273 (u1: T).(\lambda (_: T).(pc3 c0 (lift (S n) O u1) t2)))) (\lambda (e:
274 C).(\lambda (u1: T).(\lambda (_: T).(getl n c0 (CHead e (Bind Abst) u1)))))
275 (\lambda (e: C).(\lambda (u1: T).(\lambda (t0: T).(ty3 g e u1 t0))))) (pc3 c0
276 (lift (S n) O t) t2) (\lambda (H4: (ex3_3 C T T (\lambda (_: C).(\lambda (_:
277 T).(\lambda (t0: T).(pc3 c0 (lift (S n) O t0) t2)))) (\lambda (e: C).(\lambda
278 (u1: T).(\lambda (_: T).(getl n c0 (CHead e (Bind Abbr) u1))))) (\lambda (e:
279 C).(\lambda (u1: T).(\lambda (t0: T).(ty3 g e u1 t0)))))).(ex3_3_ind C T T
280 (\lambda (_: C).(\lambda (_: T).(\lambda (t0: T).(pc3 c0 (lift (S n) O t0)
281 t2)))) (\lambda (e: C).(\lambda (u1: T).(\lambda (_: T).(getl n c0 (CHead e
282 (Bind Abbr) u1))))) (\lambda (e: C).(\lambda (u1: T).(\lambda (t0: T).(ty3 g
283 e u1 t0)))) (pc3 c0 (lift (S n) O t) t2) (\lambda (x0: C).(\lambda (x1:
284 T).(\lambda (x2: T).(\lambda (H5: (pc3 c0 (lift (S n) O x2) t2)).(\lambda
285 (H6: (getl n c0 (CHead x0 (Bind Abbr) x1))).(\lambda (H7: (ty3 g x0 x1
286 x2)).(let H8 \def (eq_ind C (CHead d (Bind Abbr) u0) (\lambda (c1: C).(getl n
287 c0 c1)) H0 (CHead x0 (Bind Abbr) x1) (getl_mono c0 (CHead d (Bind Abbr) u0) n
288 H0 (CHead x0 (Bind Abbr) x1) H6)) in (let H9 \def (f_equal C C (\lambda (e:
289 C).(match e with [(CSort _) \Rightarrow d | (CHead c1 _ _) \Rightarrow c1]))
290 (CHead d (Bind Abbr) u0) (CHead x0 (Bind Abbr) x1) (getl_mono c0 (CHead d
291 (Bind Abbr) u0) n H0 (CHead x0 (Bind Abbr) x1) H6)) in ((let H10 \def
292 (f_equal C T (\lambda (e: C).(match e with [(CSort _) \Rightarrow u0 | (CHead
293 _ _ t0) \Rightarrow t0])) (CHead d (Bind Abbr) u0) (CHead x0 (Bind Abbr) x1)
294 (getl_mono c0 (CHead d (Bind Abbr) u0) n H0 (CHead x0 (Bind Abbr) x1) H6)) in
295 (\lambda (H11: (eq C d x0)).(let H12 \def (eq_ind_r T x1 (\lambda (t0:
296 T).(getl n c0 (CHead x0 (Bind Abbr) t0))) H8 u0 H10) in (let H13 \def
297 (eq_ind_r T x1 (\lambda (t0: T).(ty3 g x0 t0 x2)) H7 u0 H10) in (let H14 \def
298 (eq_ind_r C x0 (\lambda (c1: C).(getl n c0 (CHead c1 (Bind Abbr) u0))) H12 d
299 H11) in (let H15 \def (eq_ind_r C x0 (\lambda (c1: C).(ty3 g c1 u0 x2)) H13 d
300 H11) in (pc3_t (lift (S n) O x2) c0 (lift (S n) O t) (pc3_lift c0 d (S n) O
301 (getl_drop Abbr c0 d u0 n H14) t x2 (H2 x2 H15)) t2 H5))))))) H9)))))))))
302 H4)) (\lambda (H4: (ex3_3 C T T (\lambda (_: C).(\lambda (u1: T).(\lambda (_:
303 T).(pc3 c0 (lift (S n) O u1) t2)))) (\lambda (e: C).(\lambda (u1: T).(\lambda
304 (_: T).(getl n c0 (CHead e (Bind Abst) u1))))) (\lambda (e: C).(\lambda (u1:
305 T).(\lambda (t0: T).(ty3 g e u1 t0)))))).(ex3_3_ind C T T (\lambda (_:
306 C).(\lambda (u1: T).(\lambda (_: T).(pc3 c0 (lift (S n) O u1) t2)))) (\lambda
307 (e: C).(\lambda (u1: T).(\lambda (_: T).(getl n c0 (CHead e (Bind Abst)
308 u1))))) (\lambda (e: C).(\lambda (u1: T).(\lambda (t0: T).(ty3 g e u1 t0))))
309 (pc3 c0 (lift (S n) O t) t2) (\lambda (x0: C).(\lambda (x1: T).(\lambda (x2:
310 T).(\lambda (_: (pc3 c0 (lift (S n) O x1) t2)).(\lambda (H6: (getl n c0
311 (CHead x0 (Bind Abst) x1))).(\lambda (_: (ty3 g x0 x1 x2)).(let H8 \def
312 (eq_ind C (CHead d (Bind Abbr) u0) (\lambda (c1: C).(getl n c0 c1)) H0 (CHead
313 x0 (Bind Abst) x1) (getl_mono c0 (CHead d (Bind Abbr) u0) n H0 (CHead x0
314 (Bind Abst) x1) H6)) in (let H9 \def (eq_ind C (CHead d (Bind Abbr) u0)
315 (\lambda (ee: C).(match ee with [(CSort _) \Rightarrow False | (CHead _ k _)
316 \Rightarrow (match k with [(Bind b) \Rightarrow (match b with [Abbr
317 \Rightarrow True | Abst \Rightarrow False | Void \Rightarrow False]) | (Flat
318 _) \Rightarrow False])])) I (CHead x0 (Bind Abst) x1) (getl_mono c0 (CHead d
319 (Bind Abbr) u0) n H0 (CHead x0 (Bind Abst) x1) H6)) in (False_ind (pc3 c0
320 (lift (S n) O t) t2) H9))))))))) H4)) (ty3_gen_lref g c0 t2 n H3))))))))))))
321 (\lambda (n: nat).(\lambda (c0: C).(\lambda (d: C).(\lambda (u0: T).(\lambda
322 (H0: (getl n c0 (CHead d (Bind Abst) u0))).(\lambda (t: T).(\lambda (_: (ty3
323 g d u0 t)).(\lambda (_: ((\forall (t2: T).((ty3 g d u0 t2) \to (pc3 d t
324 t2))))).(\lambda (t2: T).(\lambda (H3: (ty3 g c0 (TLRef n) t2)).(or_ind
325 (ex3_3 C T T (\lambda (_: C).(\lambda (_: T).(\lambda (t0: T).(pc3 c0 (lift
326 (S n) O t0) t2)))) (\lambda (e: C).(\lambda (u1: T).(\lambda (_: T).(getl n
327 c0 (CHead e (Bind Abbr) u1))))) (\lambda (e: C).(\lambda (u1: T).(\lambda
328 (t0: T).(ty3 g e u1 t0))))) (ex3_3 C T T (\lambda (_: C).(\lambda (u1:
329 T).(\lambda (_: T).(pc3 c0 (lift (S n) O u1) t2)))) (\lambda (e: C).(\lambda
330 (u1: T).(\lambda (_: T).(getl n c0 (CHead e (Bind Abst) u1))))) (\lambda (e:
331 C).(\lambda (u1: T).(\lambda (t0: T).(ty3 g e u1 t0))))) (pc3 c0 (lift (S n)
332 O u0) t2) (\lambda (H4: (ex3_3 C T T (\lambda (_: C).(\lambda (_: T).(\lambda
333 (t0: T).(pc3 c0 (lift (S n) O t0) t2)))) (\lambda (e: C).(\lambda (u1:
334 T).(\lambda (_: T).(getl n c0 (CHead e (Bind Abbr) u1))))) (\lambda (e:
335 C).(\lambda (u1: T).(\lambda (t0: T).(ty3 g e u1 t0)))))).(ex3_3_ind C T T
336 (\lambda (_: C).(\lambda (_: T).(\lambda (t0: T).(pc3 c0 (lift (S n) O t0)
337 t2)))) (\lambda (e: C).(\lambda (u1: T).(\lambda (_: T).(getl n c0 (CHead e
338 (Bind Abbr) u1))))) (\lambda (e: C).(\lambda (u1: T).(\lambda (t0: T).(ty3 g
339 e u1 t0)))) (pc3 c0 (lift (S n) O u0) t2) (\lambda (x0: C).(\lambda (x1:
340 T).(\lambda (x2: T).(\lambda (_: (pc3 c0 (lift (S n) O x2) t2)).(\lambda (H6:
341 (getl n c0 (CHead x0 (Bind Abbr) x1))).(\lambda (_: (ty3 g x0 x1 x2)).(let H8
342 \def (eq_ind C (CHead d (Bind Abst) u0) (\lambda (c1: C).(getl n c0 c1)) H0
343 (CHead x0 (Bind Abbr) x1) (getl_mono c0 (CHead d (Bind Abst) u0) n H0 (CHead
344 x0 (Bind Abbr) x1) H6)) in (let H9 \def (eq_ind C (CHead d (Bind Abst) u0)
345 (\lambda (ee: C).(match ee with [(CSort _) \Rightarrow False | (CHead _ k _)
346 \Rightarrow (match k with [(Bind b) \Rightarrow (match b with [Abbr
347 \Rightarrow False | Abst \Rightarrow True | Void \Rightarrow False]) | (Flat
348 _) \Rightarrow False])])) I (CHead x0 (Bind Abbr) x1) (getl_mono c0 (CHead d
349 (Bind Abst) u0) n H0 (CHead x0 (Bind Abbr) x1) H6)) in (False_ind (pc3 c0
350 (lift (S n) O u0) t2) H9))))))))) H4)) (\lambda (H4: (ex3_3 C T T (\lambda
351 (_: C).(\lambda (u1: T).(\lambda (_: T).(pc3 c0 (lift (S n) O u1) t2))))
352 (\lambda (e: C).(\lambda (u1: T).(\lambda (_: T).(getl n c0 (CHead e (Bind
353 Abst) u1))))) (\lambda (e: C).(\lambda (u1: T).(\lambda (t0: T).(ty3 g e u1
354 t0)))))).(ex3_3_ind C T T (\lambda (_: C).(\lambda (u1: T).(\lambda (_:
355 T).(pc3 c0 (lift (S n) O u1) t2)))) (\lambda (e: C).(\lambda (u1: T).(\lambda
356 (_: T).(getl n c0 (CHead e (Bind Abst) u1))))) (\lambda (e: C).(\lambda (u1:
357 T).(\lambda (t0: T).(ty3 g e u1 t0)))) (pc3 c0 (lift (S n) O u0) t2) (\lambda
358 (x0: C).(\lambda (x1: T).(\lambda (x2: T).(\lambda (H5: (pc3 c0 (lift (S n) O
359 x1) t2)).(\lambda (H6: (getl n c0 (CHead x0 (Bind Abst) x1))).(\lambda (H7:
360 (ty3 g x0 x1 x2)).(let H8 \def (eq_ind C (CHead d (Bind Abst) u0) (\lambda
361 (c1: C).(getl n c0 c1)) H0 (CHead x0 (Bind Abst) x1) (getl_mono c0 (CHead d
362 (Bind Abst) u0) n H0 (CHead x0 (Bind Abst) x1) H6)) in (let H9 \def (f_equal
363 C C (\lambda (e: C).(match e with [(CSort _) \Rightarrow d | (CHead c1 _ _)
364 \Rightarrow c1])) (CHead d (Bind Abst) u0) (CHead x0 (Bind Abst) x1)
365 (getl_mono c0 (CHead d (Bind Abst) u0) n H0 (CHead x0 (Bind Abst) x1) H6)) in
366 ((let H10 \def (f_equal C T (\lambda (e: C).(match e with [(CSort _)
367 \Rightarrow u0 | (CHead _ _ t0) \Rightarrow t0])) (CHead d (Bind Abst) u0)
368 (CHead x0 (Bind Abst) x1) (getl_mono c0 (CHead d (Bind Abst) u0) n H0 (CHead
369 x0 (Bind Abst) x1) H6)) in (\lambda (H11: (eq C d x0)).(let H12 \def
370 (eq_ind_r T x1 (\lambda (t0: T).(getl n c0 (CHead x0 (Bind Abst) t0))) H8 u0
371 H10) in (let H13 \def (eq_ind_r T x1 (\lambda (t0: T).(ty3 g x0 t0 x2)) H7 u0
372 H10) in (let H14 \def (eq_ind_r T x1 (\lambda (t0: T).(pc3 c0 (lift (S n) O
373 t0) t2)) H5 u0 H10) in (let H15 \def (eq_ind_r C x0 (\lambda (c1: C).(getl n
374 c0 (CHead c1 (Bind Abst) u0))) H12 d H11) in (let H16 \def (eq_ind_r C x0
375 (\lambda (c1: C).(ty3 g c1 u0 x2)) H13 d H11) in H14))))))) H9))))))))) H4))
376 (ty3_gen_lref g c0 t2 n H3)))))))))))) (\lambda (c0: C).(\lambda (u0:
377 T).(\lambda (t: T).(\lambda (_: (ty3 g c0 u0 t)).(\lambda (_: ((\forall (t2:
378 T).((ty3 g c0 u0 t2) \to (pc3 c0 t t2))))).(\lambda (b: B).(\lambda (t0:
379 T).(\lambda (t2: T).(\lambda (_: (ty3 g (CHead c0 (Bind b) u0) t0
380 t2)).(\lambda (H3: ((\forall (t3: T).((ty3 g (CHead c0 (Bind b) u0) t0 t3)
381 \to (pc3 (CHead c0 (Bind b) u0) t2 t3))))).(\lambda (t3: T).(\lambda (H4:
382 (ty3 g c0 (THead (Bind b) u0 t0) t3)).(ex3_2_ind T T (\lambda (t4:
383 T).(\lambda (_: T).(pc3 c0 (THead (Bind b) u0 t4) t3))) (\lambda (_:
384 T).(\lambda (t5: T).(ty3 g c0 u0 t5))) (\lambda (t4: T).(\lambda (_: T).(ty3
385 g (CHead c0 (Bind b) u0) t0 t4))) (pc3 c0 (THead (Bind b) u0 t2) t3) (\lambda
386 (x0: T).(\lambda (x1: T).(\lambda (H5: (pc3 c0 (THead (Bind b) u0 x0)
387 t3)).(\lambda (_: (ty3 g c0 u0 x1)).(\lambda (H7: (ty3 g (CHead c0 (Bind b)
388 u0) t0 x0)).(pc3_t (THead (Bind b) u0 x0) c0 (THead (Bind b) u0 t2)
389 (pc3_head_2 c0 u0 t2 x0 (Bind b) (H3 x0 H7)) t3 H5)))))) (ty3_gen_bind g b c0
390 u0 t0 t3 H4)))))))))))))) (\lambda (c0: C).(\lambda (w: T).(\lambda (u0:
391 T).(\lambda (_: (ty3 g c0 w u0)).(\lambda (_: ((\forall (t2: T).((ty3 g c0 w
392 t2) \to (pc3 c0 u0 t2))))).(\lambda (v: T).(\lambda (t: T).(\lambda (_: (ty3
393 g c0 v (THead (Bind Abst) u0 t))).(\lambda (H3: ((\forall (t2: T).((ty3 g c0
394 v t2) \to (pc3 c0 (THead (Bind Abst) u0 t) t2))))).(\lambda (t2: T).(\lambda
395 (H4: (ty3 g c0 (THead (Flat Appl) w v) t2)).(ex3_2_ind T T (\lambda (u1:
396 T).(\lambda (t0: T).(pc3 c0 (THead (Flat Appl) w (THead (Bind Abst) u1 t0))
397 t2))) (\lambda (u1: T).(\lambda (t0: T).(ty3 g c0 v (THead (Bind Abst) u1
398 t0)))) (\lambda (u1: T).(\lambda (_: T).(ty3 g c0 w u1))) (pc3 c0 (THead
399 (Flat Appl) w (THead (Bind Abst) u0 t)) t2) (\lambda (x0: T).(\lambda (x1:
400 T).(\lambda (H5: (pc3 c0 (THead (Flat Appl) w (THead (Bind Abst) x0 x1))
401 t2)).(\lambda (H6: (ty3 g c0 v (THead (Bind Abst) x0 x1))).(\lambda (_: (ty3
402 g c0 w x0)).(pc3_t (THead (Flat Appl) w (THead (Bind Abst) x0 x1)) c0 (THead
403 (Flat Appl) w (THead (Bind Abst) u0 t)) (pc3_thin_dx c0 (THead (Bind Abst) u0
404 t) (THead (Bind Abst) x0 x1) (H3 (THead (Bind Abst) x0 x1) H6) w Appl) t2
405 H5)))))) (ty3_gen_appl g c0 w v t2 H4))))))))))))) (\lambda (c0: C).(\lambda
406 (t0: T).(\lambda (t2: T).(\lambda (_: (ty3 g c0 t0 t2)).(\lambda (_:
407 ((\forall (t3: T).((ty3 g c0 t0 t3) \to (pc3 c0 t2 t3))))).(\lambda (t3:
408 T).(\lambda (_: (ty3 g c0 t2 t3)).(\lambda (H3: ((\forall (t4: T).((ty3 g c0
409 t2 t4) \to (pc3 c0 t3 t4))))).(\lambda (t4: T).(\lambda (H4: (ty3 g c0 (THead
410 (Flat Cast) t2 t0) t4)).(ex3_ind T (\lambda (t5: T).(pc3 c0 (THead (Flat
411 Cast) t5 t2) t4)) (\lambda (_: T).(ty3 g c0 t0 t2)) (\lambda (t5: T).(ty3 g
412 c0 t2 t5)) (pc3 c0 (THead (Flat Cast) t3 t2) t4) (\lambda (x0: T).(\lambda
413 (H5: (pc3 c0 (THead (Flat Cast) x0 t2) t4)).(\lambda (_: (ty3 g c0 t0
414 t2)).(\lambda (H7: (ty3 g c0 t2 x0)).(pc3_t (THead (Flat Cast) x0 t2) c0
415 (THead (Flat Cast) t3 t2) (pc3_head_1 c0 t3 x0 (H3 x0 H7) (Flat Cast) t2) t4
416 H5))))) (ty3_gen_cast g c0 t0 t2 t4 H4)))))))))))) c u t1 H))))).
418 lemma ty3_gen_abst_abst:
419 \forall (g: G).(\forall (c: C).(\forall (u: T).(\forall (t1: T).(\forall
420 (t2: T).((ty3 g c (THead (Bind Abst) u t1) (THead (Bind Abst) u t2)) \to (ex2
421 T (\lambda (w: T).(ty3 g c u w)) (\lambda (_: T).(ty3 g (CHead c (Bind Abst)
424 \lambda (g: G).(\lambda (c: C).(\lambda (u: T).(\lambda (t1: T).(\lambda
425 (t2: T).(\lambda (H: (ty3 g c (THead (Bind Abst) u t1) (THead (Bind Abst) u
426 t2))).(ex_ind T (\lambda (t: T).(ty3 g c (THead (Bind Abst) u t2) t)) (ex2 T
427 (\lambda (w: T).(ty3 g c u w)) (\lambda (_: T).(ty3 g (CHead c (Bind Abst) u)
428 t1 t2))) (\lambda (x: T).(\lambda (H0: (ty3 g c (THead (Bind Abst) u t2)
429 x)).(ex3_2_ind T T (\lambda (t3: T).(\lambda (_: T).(pc3 c (THead (Bind Abst)
430 u t3) x))) (\lambda (_: T).(\lambda (t: T).(ty3 g c u t))) (\lambda (t3:
431 T).(\lambda (_: T).(ty3 g (CHead c (Bind Abst) u) t2 t3))) (ex2 T (\lambda
432 (w: T).(ty3 g c u w)) (\lambda (_: T).(ty3 g (CHead c (Bind Abst) u) t1 t2)))
433 (\lambda (x0: T).(\lambda (x1: T).(\lambda (_: (pc3 c (THead (Bind Abst) u
434 x0) x)).(\lambda (_: (ty3 g c u x1)).(\lambda (H3: (ty3 g (CHead c (Bind
435 Abst) u) t2 x0)).(ex3_2_ind T T (\lambda (t3: T).(\lambda (_: T).(pc3 c
436 (THead (Bind Abst) u t3) (THead (Bind Abst) u t2)))) (\lambda (_: T).(\lambda
437 (t: T).(ty3 g c u t))) (\lambda (t3: T).(\lambda (_: T).(ty3 g (CHead c (Bind
438 Abst) u) t1 t3))) (ex2 T (\lambda (w: T).(ty3 g c u w)) (\lambda (_: T).(ty3
439 g (CHead c (Bind Abst) u) t1 t2))) (\lambda (x2: T).(\lambda (x3: T).(\lambda
440 (H4: (pc3 c (THead (Bind Abst) u x2) (THead (Bind Abst) u t2))).(\lambda (H5:
441 (ty3 g c u x3)).(\lambda (H6: (ty3 g (CHead c (Bind Abst) u) t1 x2)).(let H_y
442 \def (pc3_gen_abst_shift c u x2 t2 H4) in (ex_intro2 T (\lambda (w: T).(ty3 g
443 c u w)) (\lambda (_: T).(ty3 g (CHead c (Bind Abst) u) t1 t2)) x3 H5
444 (ty3_conv g (CHead c (Bind Abst) u) t2 x0 H3 t1 x2 H6 H_y))))))))
445 (ty3_gen_bind g Abst c u t1 (THead (Bind Abst) u t2) H))))))) (ty3_gen_bind g
446 Abst c u t2 x H0)))) (ty3_correct g c (THead (Bind Abst) u t1) (THead (Bind
447 Abst) u t2) H))))))).
450 \forall (g: G).(\forall (c: C).(\forall (t: T).(\forall (v: T).((ty3 g c t
451 v) \to (ex T (\lambda (u: T).(ty3 g c (THead (Flat Cast) v t) u)))))))
453 \lambda (g: G).(\lambda (c: C).(\lambda (t: T).(\lambda (v: T).(\lambda (H:
454 (ty3 g c t v)).(ex_ind T (\lambda (t0: T).(ty3 g c v t0)) (ex T (\lambda (u:
455 T).(ty3 g c (THead (Flat Cast) v t) u))) (\lambda (x: T).(\lambda (H0: (ty3 g
456 c v x)).(ex_intro T (\lambda (u: T).(ty3 g c (THead (Flat Cast) v t) u))
457 (THead (Flat Cast) x v) (ty3_cast g c t v H x H0)))) (ty3_correct g c t v
460 lemma ty3_getl_subst0:
461 \forall (g: G).(\forall (c: C).(\forall (t: T).(\forall (u: T).((ty3 g c t
462 u) \to (\forall (v0: T).(\forall (t0: T).(\forall (i: nat).((subst0 i v0 t
463 t0) \to (\forall (b: B).(\forall (d: C).(\forall (v: T).((getl i c (CHead d
464 (Bind b) v)) \to (ex T (\lambda (w: T).(ty3 g d v w)))))))))))))))
466 \lambda (g: G).(\lambda (c: C).(\lambda (t: T).(\lambda (u: T).(\lambda (H:
467 (ty3 g c t u)).(ty3_ind g (\lambda (c0: C).(\lambda (t0: T).(\lambda (_:
468 T).(\forall (v0: T).(\forall (t2: T).(\forall (i: nat).((subst0 i v0 t0 t2)
469 \to (\forall (b: B).(\forall (d: C).(\forall (v: T).((getl i c0 (CHead d
470 (Bind b) v)) \to (ex T (\lambda (w: T).(ty3 g d v w)))))))))))))) (\lambda
471 (c0: C).(\lambda (t2: T).(\lambda (t0: T).(\lambda (_: (ty3 g c0 t2
472 t0)).(\lambda (_: ((\forall (v0: T).(\forall (t1: T).(\forall (i:
473 nat).((subst0 i v0 t2 t1) \to (\forall (b: B).(\forall (d: C).(\forall (v:
474 T).((getl i c0 (CHead d (Bind b) v)) \to (ex T (\lambda (w: T).(ty3 g d v
475 w))))))))))))).(\lambda (u0: T).(\lambda (t1: T).(\lambda (_: (ty3 g c0 u0
476 t1)).(\lambda (H3: ((\forall (v0: T).(\forall (t3: T).(\forall (i:
477 nat).((subst0 i v0 u0 t3) \to (\forall (b: B).(\forall (d: C).(\forall (v:
478 T).((getl i c0 (CHead d (Bind b) v)) \to (ex T (\lambda (w: T).(ty3 g d v
479 w))))))))))))).(\lambda (_: (pc3 c0 t1 t2)).(\lambda (v0: T).(\lambda (t3:
480 T).(\lambda (i: nat).(\lambda (H5: (subst0 i v0 u0 t3)).(\lambda (b:
481 B).(\lambda (d: C).(\lambda (v: T).(\lambda (H6: (getl i c0 (CHead d (Bind b)
482 v))).(H3 v0 t3 i H5 b d v H6))))))))))))))))))) (\lambda (c0: C).(\lambda (m:
483 nat).(\lambda (v0: T).(\lambda (t0: T).(\lambda (i: nat).(\lambda (H0:
484 (subst0 i v0 (TSort m) t0)).(\lambda (b: B).(\lambda (d: C).(\lambda (v:
485 T).(\lambda (_: (getl i c0 (CHead d (Bind b) v))).(subst0_gen_sort v0 t0 i m
486 H0 (ex T (\lambda (w: T).(ty3 g d v w)))))))))))))) (\lambda (n:
487 nat).(\lambda (c0: C).(\lambda (d: C).(\lambda (u0: T).(\lambda (H0: (getl n
488 c0 (CHead d (Bind Abbr) u0))).(\lambda (t0: T).(\lambda (H1: (ty3 g d u0
489 t0)).(\lambda (_: ((\forall (v0: T).(\forall (t1: T).(\forall (i:
490 nat).((subst0 i v0 u0 t1) \to (\forall (b: B).(\forall (d0: C).(\forall (v:
491 T).((getl i d (CHead d0 (Bind b) v)) \to (ex T (\lambda (w: T).(ty3 g d0 v
492 w))))))))))))).(\lambda (v0: T).(\lambda (t1: T).(\lambda (i: nat).(\lambda
493 (H3: (subst0 i v0 (TLRef n) t1)).(\lambda (b: B).(\lambda (d0: C).(\lambda
494 (v: T).(\lambda (H4: (getl i c0 (CHead d0 (Bind b) v))).(land_ind (eq nat n
495 i) (eq T t1 (lift (S n) O v0)) (ex T (\lambda (w: T).(ty3 g d0 v w)))
496 (\lambda (H5: (eq nat n i)).(\lambda (_: (eq T t1 (lift (S n) O v0))).(let H7
497 \def (eq_ind_r nat i (\lambda (n0: nat).(getl n0 c0 (CHead d0 (Bind b) v)))
498 H4 n H5) in (let H8 \def (eq_ind C (CHead d (Bind Abbr) u0) (\lambda (c1:
499 C).(getl n c0 c1)) H0 (CHead d0 (Bind b) v) (getl_mono c0 (CHead d (Bind
500 Abbr) u0) n H0 (CHead d0 (Bind b) v) H7)) in (let H9 \def (f_equal C C
501 (\lambda (e: C).(match e with [(CSort _) \Rightarrow d | (CHead c1 _ _)
502 \Rightarrow c1])) (CHead d (Bind Abbr) u0) (CHead d0 (Bind b) v) (getl_mono
503 c0 (CHead d (Bind Abbr) u0) n H0 (CHead d0 (Bind b) v) H7)) in ((let H10 \def
504 (f_equal C B (\lambda (e: C).(match e with [(CSort _) \Rightarrow Abbr |
505 (CHead _ k _) \Rightarrow (match k with [(Bind b0) \Rightarrow b0 | (Flat _)
506 \Rightarrow Abbr])])) (CHead d (Bind Abbr) u0) (CHead d0 (Bind b) v)
507 (getl_mono c0 (CHead d (Bind Abbr) u0) n H0 (CHead d0 (Bind b) v) H7)) in
508 ((let H11 \def (f_equal C T (\lambda (e: C).(match e with [(CSort _)
509 \Rightarrow u0 | (CHead _ _ t2) \Rightarrow t2])) (CHead d (Bind Abbr) u0)
510 (CHead d0 (Bind b) v) (getl_mono c0 (CHead d (Bind Abbr) u0) n H0 (CHead d0
511 (Bind b) v) H7)) in (\lambda (H12: (eq B Abbr b)).(\lambda (H13: (eq C d
512 d0)).(let H14 \def (eq_ind_r T v (\lambda (t2: T).(getl n c0 (CHead d0 (Bind
513 b) t2))) H8 u0 H11) in (eq_ind T u0 (\lambda (t2: T).(ex T (\lambda (w:
514 T).(ty3 g d0 t2 w)))) (let H15 \def (eq_ind_r C d0 (\lambda (c1: C).(getl n
515 c0 (CHead c1 (Bind b) u0))) H14 d H13) in (eq_ind C d (\lambda (c1: C).(ex T
516 (\lambda (w: T).(ty3 g c1 u0 w)))) (let H16 \def (eq_ind_r B b (\lambda (b0:
517 B).(getl n c0 (CHead d (Bind b0) u0))) H15 Abbr H12) in (ex_intro T (\lambda
518 (w: T).(ty3 g d u0 w)) t0 H1)) d0 H13)) v H11))))) H10)) H9))))))
519 (subst0_gen_lref v0 t1 i n H3)))))))))))))))))) (\lambda (n: nat).(\lambda
520 (c0: C).(\lambda (d: C).(\lambda (u0: T).(\lambda (H0: (getl n c0 (CHead d
521 (Bind Abst) u0))).(\lambda (t0: T).(\lambda (H1: (ty3 g d u0 t0)).(\lambda
522 (_: ((\forall (v0: T).(\forall (t1: T).(\forall (i: nat).((subst0 i v0 u0 t1)
523 \to (\forall (b: B).(\forall (d0: C).(\forall (v: T).((getl i d (CHead d0
524 (Bind b) v)) \to (ex T (\lambda (w: T).(ty3 g d0 v w))))))))))))).(\lambda
525 (v0: T).(\lambda (t1: T).(\lambda (i: nat).(\lambda (H3: (subst0 i v0 (TLRef
526 n) t1)).(\lambda (b: B).(\lambda (d0: C).(\lambda (v: T).(\lambda (H4: (getl
527 i c0 (CHead d0 (Bind b) v))).(land_ind (eq nat n i) (eq T t1 (lift (S n) O
528 v0)) (ex T (\lambda (w: T).(ty3 g d0 v w))) (\lambda (H5: (eq nat n
529 i)).(\lambda (_: (eq T t1 (lift (S n) O v0))).(let H7 \def (eq_ind_r nat i
530 (\lambda (n0: nat).(getl n0 c0 (CHead d0 (Bind b) v))) H4 n H5) in (let H8
531 \def (eq_ind C (CHead d (Bind Abst) u0) (\lambda (c1: C).(getl n c0 c1)) H0
532 (CHead d0 (Bind b) v) (getl_mono c0 (CHead d (Bind Abst) u0) n H0 (CHead d0
533 (Bind b) v) H7)) in (let H9 \def (f_equal C C (\lambda (e: C).(match e with
534 [(CSort _) \Rightarrow d | (CHead c1 _ _) \Rightarrow c1])) (CHead d (Bind
535 Abst) u0) (CHead d0 (Bind b) v) (getl_mono c0 (CHead d (Bind Abst) u0) n H0
536 (CHead d0 (Bind b) v) H7)) in ((let H10 \def (f_equal C B (\lambda (e:
537 C).(match e with [(CSort _) \Rightarrow Abst | (CHead _ k _) \Rightarrow
538 (match k with [(Bind b0) \Rightarrow b0 | (Flat _) \Rightarrow Abst])]))
539 (CHead d (Bind Abst) u0) (CHead d0 (Bind b) v) (getl_mono c0 (CHead d (Bind
540 Abst) u0) n H0 (CHead d0 (Bind b) v) H7)) in ((let H11 \def (f_equal C T
541 (\lambda (e: C).(match e with [(CSort _) \Rightarrow u0 | (CHead _ _ t2)
542 \Rightarrow t2])) (CHead d (Bind Abst) u0) (CHead d0 (Bind b) v) (getl_mono
543 c0 (CHead d (Bind Abst) u0) n H0 (CHead d0 (Bind b) v) H7)) in (\lambda (H12:
544 (eq B Abst b)).(\lambda (H13: (eq C d d0)).(let H14 \def (eq_ind_r T v
545 (\lambda (t2: T).(getl n c0 (CHead d0 (Bind b) t2))) H8 u0 H11) in (eq_ind T
546 u0 (\lambda (t2: T).(ex T (\lambda (w: T).(ty3 g d0 t2 w)))) (let H15 \def
547 (eq_ind_r C d0 (\lambda (c1: C).(getl n c0 (CHead c1 (Bind b) u0))) H14 d
548 H13) in (eq_ind C d (\lambda (c1: C).(ex T (\lambda (w: T).(ty3 g c1 u0 w))))
549 (let H16 \def (eq_ind_r B b (\lambda (b0: B).(getl n c0 (CHead d (Bind b0)
550 u0))) H15 Abst H12) in (ex_intro T (\lambda (w: T).(ty3 g d u0 w)) t0 H1)) d0
551 H13)) v H11))))) H10)) H9)))))) (subst0_gen_lref v0 t1 i n
552 H3)))))))))))))))))) (\lambda (c0: C).(\lambda (u0: T).(\lambda (t0:
553 T).(\lambda (_: (ty3 g c0 u0 t0)).(\lambda (H1: ((\forall (v0: T).(\forall
554 (t1: T).(\forall (i: nat).((subst0 i v0 u0 t1) \to (\forall (b: B).(\forall
555 (d: C).(\forall (v: T).((getl i c0 (CHead d (Bind b) v)) \to (ex T (\lambda
556 (w: T).(ty3 g d v w))))))))))))).(\lambda (b: B).(\lambda (t1: T).(\lambda
557 (t2: T).(\lambda (_: (ty3 g (CHead c0 (Bind b) u0) t1 t2)).(\lambda (H3:
558 ((\forall (v0: T).(\forall (t3: T).(\forall (i: nat).((subst0 i v0 t1 t3) \to
559 (\forall (b0: B).(\forall (d: C).(\forall (v: T).((getl i (CHead c0 (Bind b)
560 u0) (CHead d (Bind b0) v)) \to (ex T (\lambda (w: T).(ty3 g d v
561 w))))))))))))).(\lambda (v0: T).(\lambda (t3: T).(\lambda (i: nat).(\lambda
562 (H4: (subst0 i v0 (THead (Bind b) u0 t1) t3)).(\lambda (b0: B).(\lambda (d:
563 C).(\lambda (v: T).(\lambda (H5: (getl i c0 (CHead d (Bind b0) v))).(or3_ind
564 (ex2 T (\lambda (u2: T).(eq T t3 (THead (Bind b) u2 t1))) (\lambda (u2:
565 T).(subst0 i v0 u0 u2))) (ex2 T (\lambda (t4: T).(eq T t3 (THead (Bind b) u0
566 t4))) (\lambda (t4: T).(subst0 (s (Bind b) i) v0 t1 t4))) (ex3_2 T T (\lambda
567 (u2: T).(\lambda (t4: T).(eq T t3 (THead (Bind b) u2 t4)))) (\lambda (u2:
568 T).(\lambda (_: T).(subst0 i v0 u0 u2))) (\lambda (_: T).(\lambda (t4:
569 T).(subst0 (s (Bind b) i) v0 t1 t4)))) (ex T (\lambda (w: T).(ty3 g d v w)))
570 (\lambda (H6: (ex2 T (\lambda (u2: T).(eq T t3 (THead (Bind b) u2 t1)))
571 (\lambda (u2: T).(subst0 i v0 u0 u2)))).(ex2_ind T (\lambda (u2: T).(eq T t3
572 (THead (Bind b) u2 t1))) (\lambda (u2: T).(subst0 i v0 u0 u2)) (ex T (\lambda
573 (w: T).(ty3 g d v w))) (\lambda (x: T).(\lambda (_: (eq T t3 (THead (Bind b)
574 x t1))).(\lambda (H8: (subst0 i v0 u0 x)).(H1 v0 x i H8 b0 d v H5)))) H6))
575 (\lambda (H6: (ex2 T (\lambda (t4: T).(eq T t3 (THead (Bind b) u0 t4)))
576 (\lambda (t4: T).(subst0 (s (Bind b) i) v0 t1 t4)))).(ex2_ind T (\lambda (t4:
577 T).(eq T t3 (THead (Bind b) u0 t4))) (\lambda (t4: T).(subst0 (s (Bind b) i)
578 v0 t1 t4)) (ex T (\lambda (w: T).(ty3 g d v w))) (\lambda (x: T).(\lambda (_:
579 (eq T t3 (THead (Bind b) u0 x))).(\lambda (H8: (subst0 (s (Bind b) i) v0 t1
580 x)).(H3 v0 x (S i) H8 b0 d v (getl_head (Bind b) i c0 (CHead d (Bind b0) v)
581 H5 u0))))) H6)) (\lambda (H6: (ex3_2 T T (\lambda (u2: T).(\lambda (t4:
582 T).(eq T t3 (THead (Bind b) u2 t4)))) (\lambda (u2: T).(\lambda (_:
583 T).(subst0 i v0 u0 u2))) (\lambda (_: T).(\lambda (t4: T).(subst0 (s (Bind b)
584 i) v0 t1 t4))))).(ex3_2_ind T T (\lambda (u2: T).(\lambda (t4: T).(eq T t3
585 (THead (Bind b) u2 t4)))) (\lambda (u2: T).(\lambda (_: T).(subst0 i v0 u0
586 u2))) (\lambda (_: T).(\lambda (t4: T).(subst0 (s (Bind b) i) v0 t1 t4))) (ex
587 T (\lambda (w: T).(ty3 g d v w))) (\lambda (x0: T).(\lambda (x1: T).(\lambda
588 (_: (eq T t3 (THead (Bind b) x0 x1))).(\lambda (H8: (subst0 i v0 u0
589 x0)).(\lambda (_: (subst0 (s (Bind b) i) v0 t1 x1)).(H1 v0 x0 i H8 b0 d v
590 H5)))))) H6)) (subst0_gen_head (Bind b) v0 u0 t1 t3 i H4))))))))))))))))))))
591 (\lambda (c0: C).(\lambda (w: T).(\lambda (u0: T).(\lambda (_: (ty3 g c0 w
592 u0)).(\lambda (H1: ((\forall (v0: T).(\forall (t0: T).(\forall (i:
593 nat).((subst0 i v0 w t0) \to (\forall (b: B).(\forall (d: C).(\forall (v:
594 T).((getl i c0 (CHead d (Bind b) v)) \to (ex T (\lambda (w0: T).(ty3 g d v
595 w0))))))))))))).(\lambda (v: T).(\lambda (t0: T).(\lambda (_: (ty3 g c0 v
596 (THead (Bind Abst) u0 t0))).(\lambda (H3: ((\forall (v0: T).(\forall (t1:
597 T).(\forall (i: nat).((subst0 i v0 v t1) \to (\forall (b: B).(\forall (d:
598 C).(\forall (v1: T).((getl i c0 (CHead d (Bind b) v1)) \to (ex T (\lambda
599 (w0: T).(ty3 g d v1 w0))))))))))))).(\lambda (v0: T).(\lambda (t1:
600 T).(\lambda (i: nat).(\lambda (H4: (subst0 i v0 (THead (Flat Appl) w v)
601 t1)).(\lambda (b: B).(\lambda (d: C).(\lambda (v1: T).(\lambda (H5: (getl i
602 c0 (CHead d (Bind b) v1))).(or3_ind (ex2 T (\lambda (u2: T).(eq T t1 (THead
603 (Flat Appl) u2 v))) (\lambda (u2: T).(subst0 i v0 w u2))) (ex2 T (\lambda
604 (t2: T).(eq T t1 (THead (Flat Appl) w t2))) (\lambda (t2: T).(subst0 (s (Flat
605 Appl) i) v0 v t2))) (ex3_2 T T (\lambda (u2: T).(\lambda (t2: T).(eq T t1
606 (THead (Flat Appl) u2 t2)))) (\lambda (u2: T).(\lambda (_: T).(subst0 i v0 w
607 u2))) (\lambda (_: T).(\lambda (t2: T).(subst0 (s (Flat Appl) i) v0 v t2))))
608 (ex T (\lambda (w0: T).(ty3 g d v1 w0))) (\lambda (H6: (ex2 T (\lambda (u2:
609 T).(eq T t1 (THead (Flat Appl) u2 v))) (\lambda (u2: T).(subst0 i v0 w
610 u2)))).(ex2_ind T (\lambda (u2: T).(eq T t1 (THead (Flat Appl) u2 v)))
611 (\lambda (u2: T).(subst0 i v0 w u2)) (ex T (\lambda (w0: T).(ty3 g d v1 w0)))
612 (\lambda (x: T).(\lambda (_: (eq T t1 (THead (Flat Appl) x v))).(\lambda (H8:
613 (subst0 i v0 w x)).(H1 v0 x i H8 b d v1 H5)))) H6)) (\lambda (H6: (ex2 T
614 (\lambda (t2: T).(eq T t1 (THead (Flat Appl) w t2))) (\lambda (t2: T).(subst0
615 (s (Flat Appl) i) v0 v t2)))).(ex2_ind T (\lambda (t2: T).(eq T t1 (THead
616 (Flat Appl) w t2))) (\lambda (t2: T).(subst0 (s (Flat Appl) i) v0 v t2)) (ex
617 T (\lambda (w0: T).(ty3 g d v1 w0))) (\lambda (x: T).(\lambda (_: (eq T t1
618 (THead (Flat Appl) w x))).(\lambda (H8: (subst0 (s (Flat Appl) i) v0 v
619 x)).(H3 v0 x (s (Flat Appl) i) H8 b d v1 H5)))) H6)) (\lambda (H6: (ex3_2 T T
620 (\lambda (u2: T).(\lambda (t2: T).(eq T t1 (THead (Flat Appl) u2 t2))))
621 (\lambda (u2: T).(\lambda (_: T).(subst0 i v0 w u2))) (\lambda (_:
622 T).(\lambda (t2: T).(subst0 (s (Flat Appl) i) v0 v t2))))).(ex3_2_ind T T
623 (\lambda (u2: T).(\lambda (t2: T).(eq T t1 (THead (Flat Appl) u2 t2))))
624 (\lambda (u2: T).(\lambda (_: T).(subst0 i v0 w u2))) (\lambda (_:
625 T).(\lambda (t2: T).(subst0 (s (Flat Appl) i) v0 v t2))) (ex T (\lambda (w0:
626 T).(ty3 g d v1 w0))) (\lambda (x0: T).(\lambda (x1: T).(\lambda (_: (eq T t1
627 (THead (Flat Appl) x0 x1))).(\lambda (_: (subst0 i v0 w x0)).(\lambda (H9:
628 (subst0 (s (Flat Appl) i) v0 v x1)).(H3 v0 x1 (s (Flat Appl) i) H9 b d v1
629 H5)))))) H6)) (subst0_gen_head (Flat Appl) v0 w v t1 i H4)))))))))))))))))))
630 (\lambda (c0: C).(\lambda (t1: T).(\lambda (t2: T).(\lambda (_: (ty3 g c0 t1
631 t2)).(\lambda (H1: ((\forall (v0: T).(\forall (t0: T).(\forall (i:
632 nat).((subst0 i v0 t1 t0) \to (\forall (b: B).(\forall (d: C).(\forall (v:
633 T).((getl i c0 (CHead d (Bind b) v)) \to (ex T (\lambda (w: T).(ty3 g d v
634 w))))))))))))).(\lambda (t0: T).(\lambda (_: (ty3 g c0 t2 t0)).(\lambda (H3:
635 ((\forall (v0: T).(\forall (t3: T).(\forall (i: nat).((subst0 i v0 t2 t3) \to
636 (\forall (b: B).(\forall (d: C).(\forall (v: T).((getl i c0 (CHead d (Bind b)
637 v)) \to (ex T (\lambda (w: T).(ty3 g d v w))))))))))))).(\lambda (v0:
638 T).(\lambda (t3: T).(\lambda (i: nat).(\lambda (H4: (subst0 i v0 (THead (Flat
639 Cast) t2 t1) t3)).(\lambda (b: B).(\lambda (d: C).(\lambda (v: T).(\lambda
640 (H5: (getl i c0 (CHead d (Bind b) v))).(or3_ind (ex2 T (\lambda (u2: T).(eq T
641 t3 (THead (Flat Cast) u2 t1))) (\lambda (u2: T).(subst0 i v0 t2 u2))) (ex2 T
642 (\lambda (t4: T).(eq T t3 (THead (Flat Cast) t2 t4))) (\lambda (t4:
643 T).(subst0 (s (Flat Cast) i) v0 t1 t4))) (ex3_2 T T (\lambda (u2: T).(\lambda
644 (t4: T).(eq T t3 (THead (Flat Cast) u2 t4)))) (\lambda (u2: T).(\lambda (_:
645 T).(subst0 i v0 t2 u2))) (\lambda (_: T).(\lambda (t4: T).(subst0 (s (Flat
646 Cast) i) v0 t1 t4)))) (ex T (\lambda (w: T).(ty3 g d v w))) (\lambda (H6:
647 (ex2 T (\lambda (u2: T).(eq T t3 (THead (Flat Cast) u2 t1))) (\lambda (u2:
648 T).(subst0 i v0 t2 u2)))).(ex2_ind T (\lambda (u2: T).(eq T t3 (THead (Flat
649 Cast) u2 t1))) (\lambda (u2: T).(subst0 i v0 t2 u2)) (ex T (\lambda (w:
650 T).(ty3 g d v w))) (\lambda (x: T).(\lambda (_: (eq T t3 (THead (Flat Cast) x
651 t1))).(\lambda (H8: (subst0 i v0 t2 x)).(H3 v0 x i H8 b d v H5)))) H6))
652 (\lambda (H6: (ex2 T (\lambda (t4: T).(eq T t3 (THead (Flat Cast) t2 t4)))
653 (\lambda (t4: T).(subst0 (s (Flat Cast) i) v0 t1 t4)))).(ex2_ind T (\lambda
654 (t4: T).(eq T t3 (THead (Flat Cast) t2 t4))) (\lambda (t4: T).(subst0 (s
655 (Flat Cast) i) v0 t1 t4)) (ex T (\lambda (w: T).(ty3 g d v w))) (\lambda (x:
656 T).(\lambda (_: (eq T t3 (THead (Flat Cast) t2 x))).(\lambda (H8: (subst0 (s
657 (Flat Cast) i) v0 t1 x)).(H1 v0 x (s (Flat Cast) i) H8 b d v H5)))) H6))
658 (\lambda (H6: (ex3_2 T T (\lambda (u2: T).(\lambda (t4: T).(eq T t3 (THead
659 (Flat Cast) u2 t4)))) (\lambda (u2: T).(\lambda (_: T).(subst0 i v0 t2 u2)))
660 (\lambda (_: T).(\lambda (t4: T).(subst0 (s (Flat Cast) i) v0 t1
661 t4))))).(ex3_2_ind T T (\lambda (u2: T).(\lambda (t4: T).(eq T t3 (THead
662 (Flat Cast) u2 t4)))) (\lambda (u2: T).(\lambda (_: T).(subst0 i v0 t2 u2)))
663 (\lambda (_: T).(\lambda (t4: T).(subst0 (s (Flat Cast) i) v0 t1 t4))) (ex T
664 (\lambda (w: T).(ty3 g d v w))) (\lambda (x0: T).(\lambda (x1: T).(\lambda
665 (_: (eq T t3 (THead (Flat Cast) x0 x1))).(\lambda (H8: (subst0 i v0 t2
666 x0)).(\lambda (_: (subst0 (s (Flat Cast) i) v0 t1 x1)).(H3 v0 x0 i H8 b d v
667 H5)))))) H6)) (subst0_gen_head (Flat Cast) v0 t2 t1 t3 i H4))))))))))))))))))