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_1A/csubst0/defs.ma".
19 include "basic_1A/C/fwd.ma".
21 implied rec lemma csubst0_ind (P: (nat \to (T \to (C \to (C \to Prop))))) (f:
22 (\forall (k: K).(\forall (i: nat).(\forall (v: T).(\forall (u1: T).(\forall
23 (u2: T).((subst0 i v u1 u2) \to (\forall (c: C).(P (s k i) v (CHead c k u1)
24 (CHead c k u2)))))))))) (f0: (\forall (k: K).(\forall (i: nat).(\forall (c1:
25 C).(\forall (c2: C).(\forall (v: T).((csubst0 i v c1 c2) \to ((P i v c1 c2)
26 \to (\forall (u: T).(P (s k i) v (CHead c1 k u) (CHead c2 k u))))))))))) (f1:
27 (\forall (k: K).(\forall (i: nat).(\forall (v: T).(\forall (u1: T).(\forall
28 (u2: T).((subst0 i v u1 u2) \to (\forall (c1: C).(\forall (c2: C).((csubst0 i
29 v c1 c2) \to ((P i v c1 c2) \to (P (s k i) v (CHead c1 k u1) (CHead c2 k
30 u2))))))))))))) (n: nat) (t: T) (c: C) (c0: C) (c1: csubst0 n t c c0) on c1:
31 P n t c c0 \def match c1 with [(csubst0_snd k i v u1 u2 s0 c2) \Rightarrow (f
32 k i v u1 u2 s0 c2) | (csubst0_fst k i c2 c3 v c4 u) \Rightarrow (f0 k i c2 c3
33 v c4 ((csubst0_ind P f f0 f1) i v c2 c3 c4) u) | (csubst0_both k i v u1 u2 s0
34 c2 c3 c4) \Rightarrow (f1 k i v u1 u2 s0 c2 c3 c4 ((csubst0_ind P f f0 f1) i
37 lemma csubst0_gen_sort:
38 \forall (x: C).(\forall (v: T).(\forall (i: nat).(\forall (n: nat).((csubst0
39 i v (CSort n) x) \to (\forall (P: Prop).P)))))
41 \lambda (x: C).(\lambda (v: T).(\lambda (i: nat).(\lambda (n: nat).(\lambda
42 (H: (csubst0 i v (CSort n) x)).(\lambda (P: Prop).(insert_eq C (CSort n)
43 (\lambda (c: C).(csubst0 i v c x)) (\lambda (_: C).P) (\lambda (y:
44 C).(\lambda (H0: (csubst0 i v y x)).(csubst0_ind (\lambda (_: nat).(\lambda
45 (_: T).(\lambda (c: C).(\lambda (_: C).((eq C c (CSort n)) \to P)))))
46 (\lambda (k: K).(\lambda (i0: nat).(\lambda (v0: T).(\lambda (u1: T).(\lambda
47 (u2: T).(\lambda (_: (subst0 i0 v0 u1 u2)).(\lambda (c: C).(\lambda (H2: (eq
48 C (CHead c k u1) (CSort n))).(let H3 \def (eq_ind C (CHead c k u1) (\lambda
49 (ee: C).(match ee with [(CSort _) \Rightarrow False | (CHead _ _ _)
50 \Rightarrow True])) I (CSort n) H2) in (False_ind P H3)))))))))) (\lambda (k:
51 K).(\lambda (i0: nat).(\lambda (c1: C).(\lambda (c2: C).(\lambda (v0:
52 T).(\lambda (_: (csubst0 i0 v0 c1 c2)).(\lambda (_: (((eq C c1 (CSort n)) \to
53 P))).(\lambda (u: T).(\lambda (H3: (eq C (CHead c1 k u) (CSort n))).(let H4
54 \def (eq_ind C (CHead c1 k u) (\lambda (ee: C).(match ee with [(CSort _)
55 \Rightarrow False | (CHead _ _ _) \Rightarrow True])) I (CSort n) H3) in
56 (False_ind P H4))))))))))) (\lambda (k: K).(\lambda (i0: nat).(\lambda (v0:
57 T).(\lambda (u1: T).(\lambda (u2: T).(\lambda (_: (subst0 i0 v0 u1
58 u2)).(\lambda (c1: C).(\lambda (c2: C).(\lambda (_: (csubst0 i0 v0 c1
59 c2)).(\lambda (_: (((eq C c1 (CSort n)) \to P))).(\lambda (H4: (eq C (CHead
60 c1 k u1) (CSort n))).(let H5 \def (eq_ind C (CHead c1 k u1) (\lambda (ee:
61 C).(match ee with [(CSort _) \Rightarrow False | (CHead _ _ _) \Rightarrow
62 True])) I (CSort n) H4) in (False_ind P H5))))))))))))) i v y x H0))) H)))))).
64 lemma csubst0_gen_head:
65 \forall (k: K).(\forall (c1: C).(\forall (x: C).(\forall (u1: T).(\forall
66 (v: T).(\forall (i: nat).((csubst0 i v (CHead c1 k u1) x) \to (or3 (ex3_2 T
67 nat (\lambda (_: T).(\lambda (j: nat).(eq nat i (s k j)))) (\lambda (u2:
68 T).(\lambda (_: nat).(eq C x (CHead c1 k u2)))) (\lambda (u2: T).(\lambda (j:
69 nat).(subst0 j v u1 u2)))) (ex3_2 C nat (\lambda (_: C).(\lambda (j: nat).(eq
70 nat i (s k j)))) (\lambda (c2: C).(\lambda (_: nat).(eq C x (CHead c2 k
71 u1)))) (\lambda (c2: C).(\lambda (j: nat).(csubst0 j v c1 c2)))) (ex4_3 T C
72 nat (\lambda (_: T).(\lambda (_: C).(\lambda (j: nat).(eq nat i (s k j)))))
73 (\lambda (u2: T).(\lambda (c2: C).(\lambda (_: nat).(eq C x (CHead c2 k
74 u2))))) (\lambda (u2: T).(\lambda (_: C).(\lambda (j: nat).(subst0 j v u1
75 u2)))) (\lambda (_: T).(\lambda (c2: C).(\lambda (j: nat).(csubst0 j v c1
78 \lambda (k: K).(\lambda (c1: C).(\lambda (x: C).(\lambda (u1: T).(\lambda
79 (v: T).(\lambda (i: nat).(\lambda (H: (csubst0 i v (CHead c1 k u1)
80 x)).(insert_eq C (CHead c1 k u1) (\lambda (c: C).(csubst0 i v c x)) (\lambda
81 (_: C).(or3 (ex3_2 T nat (\lambda (_: T).(\lambda (j: nat).(eq nat i (s k
82 j)))) (\lambda (u2: T).(\lambda (_: nat).(eq C x (CHead c1 k u2)))) (\lambda
83 (u2: T).(\lambda (j: nat).(subst0 j v u1 u2)))) (ex3_2 C nat (\lambda (_:
84 C).(\lambda (j: nat).(eq nat i (s k j)))) (\lambda (c2: C).(\lambda (_:
85 nat).(eq C x (CHead c2 k u1)))) (\lambda (c2: C).(\lambda (j: nat).(csubst0 j
86 v c1 c2)))) (ex4_3 T C nat (\lambda (_: T).(\lambda (_: C).(\lambda (j:
87 nat).(eq nat i (s k j))))) (\lambda (u2: T).(\lambda (c2: C).(\lambda (_:
88 nat).(eq C x (CHead c2 k u2))))) (\lambda (u2: T).(\lambda (_: C).(\lambda
89 (j: nat).(subst0 j v u1 u2)))) (\lambda (_: T).(\lambda (c2: C).(\lambda (j:
90 nat).(csubst0 j v c1 c2))))))) (\lambda (y: C).(\lambda (H0: (csubst0 i v y
91 x)).(csubst0_ind (\lambda (n: nat).(\lambda (t: T).(\lambda (c: C).(\lambda
92 (c0: C).((eq C c (CHead c1 k u1)) \to (or3 (ex3_2 T nat (\lambda (_:
93 T).(\lambda (j: nat).(eq nat n (s k j)))) (\lambda (u2: T).(\lambda (_:
94 nat).(eq C c0 (CHead c1 k u2)))) (\lambda (u2: T).(\lambda (j: nat).(subst0 j
95 t u1 u2)))) (ex3_2 C nat (\lambda (_: C).(\lambda (j: nat).(eq nat n (s k
96 j)))) (\lambda (c2: C).(\lambda (_: nat).(eq C c0 (CHead c2 k u1)))) (\lambda
97 (c2: C).(\lambda (j: nat).(csubst0 j t c1 c2)))) (ex4_3 T C nat (\lambda (_:
98 T).(\lambda (_: C).(\lambda (j: nat).(eq nat n (s k j))))) (\lambda (u2:
99 T).(\lambda (c2: C).(\lambda (_: nat).(eq C c0 (CHead c2 k u2))))) (\lambda
100 (u2: T).(\lambda (_: C).(\lambda (j: nat).(subst0 j t u1 u2)))) (\lambda (_:
101 T).(\lambda (c2: C).(\lambda (j: nat).(csubst0 j t c1 c2))))))))))) (\lambda
102 (k0: K).(\lambda (i0: nat).(\lambda (v0: T).(\lambda (u0: T).(\lambda (u2:
103 T).(\lambda (H1: (subst0 i0 v0 u0 u2)).(\lambda (c: C).(\lambda (H2: (eq C
104 (CHead c k0 u0) (CHead c1 k u1))).(let H3 \def (f_equal C C (\lambda (e:
105 C).(match e with [(CSort _) \Rightarrow c | (CHead c0 _ _) \Rightarrow c0]))
106 (CHead c k0 u0) (CHead c1 k u1) H2) in ((let H4 \def (f_equal C K (\lambda
107 (e: C).(match e with [(CSort _) \Rightarrow k0 | (CHead _ k1 _) \Rightarrow
108 k1])) (CHead c k0 u0) (CHead c1 k u1) H2) in ((let H5 \def (f_equal C T
109 (\lambda (e: C).(match e with [(CSort _) \Rightarrow u0 | (CHead _ _ t)
110 \Rightarrow t])) (CHead c k0 u0) (CHead c1 k u1) H2) in (\lambda (H6: (eq K
111 k0 k)).(\lambda (H7: (eq C c c1)).(eq_ind_r C c1 (\lambda (c0: C).(or3 (ex3_2
112 T nat (\lambda (_: T).(\lambda (j: nat).(eq nat (s k0 i0) (s k j)))) (\lambda
113 (u3: T).(\lambda (_: nat).(eq C (CHead c0 k0 u2) (CHead c1 k u3)))) (\lambda
114 (u3: T).(\lambda (j: nat).(subst0 j v0 u1 u3)))) (ex3_2 C nat (\lambda (_:
115 C).(\lambda (j: nat).(eq nat (s k0 i0) (s k j)))) (\lambda (c2: C).(\lambda
116 (_: nat).(eq C (CHead c0 k0 u2) (CHead c2 k u1)))) (\lambda (c2: C).(\lambda
117 (j: nat).(csubst0 j v0 c1 c2)))) (ex4_3 T C nat (\lambda (_: T).(\lambda (_:
118 C).(\lambda (j: nat).(eq nat (s k0 i0) (s k j))))) (\lambda (u3: T).(\lambda
119 (c2: C).(\lambda (_: nat).(eq C (CHead c0 k0 u2) (CHead c2 k u3))))) (\lambda
120 (u3: T).(\lambda (_: C).(\lambda (j: nat).(subst0 j v0 u1 u3)))) (\lambda (_:
121 T).(\lambda (c2: C).(\lambda (j: nat).(csubst0 j v0 c1 c2))))))) (let H8 \def
122 (eq_ind T u0 (\lambda (t: T).(subst0 i0 v0 t u2)) H1 u1 H5) in (eq_ind_r K k
123 (\lambda (k1: K).(or3 (ex3_2 T nat (\lambda (_: T).(\lambda (j: nat).(eq nat
124 (s k1 i0) (s k j)))) (\lambda (u3: T).(\lambda (_: nat).(eq C (CHead c1 k1
125 u2) (CHead c1 k u3)))) (\lambda (u3: T).(\lambda (j: nat).(subst0 j v0 u1
126 u3)))) (ex3_2 C nat (\lambda (_: C).(\lambda (j: nat).(eq nat (s k1 i0) (s k
127 j)))) (\lambda (c2: C).(\lambda (_: nat).(eq C (CHead c1 k1 u2) (CHead c2 k
128 u1)))) (\lambda (c2: C).(\lambda (j: nat).(csubst0 j v0 c1 c2)))) (ex4_3 T C
129 nat (\lambda (_: T).(\lambda (_: C).(\lambda (j: nat).(eq nat (s k1 i0) (s k
130 j))))) (\lambda (u3: T).(\lambda (c2: C).(\lambda (_: nat).(eq C (CHead c1 k1
131 u2) (CHead c2 k u3))))) (\lambda (u3: T).(\lambda (_: C).(\lambda (j:
132 nat).(subst0 j v0 u1 u3)))) (\lambda (_: T).(\lambda (c2: C).(\lambda (j:
133 nat).(csubst0 j v0 c1 c2))))))) (or3_intro0 (ex3_2 T nat (\lambda (_:
134 T).(\lambda (j: nat).(eq nat (s k i0) (s k j)))) (\lambda (u3: T).(\lambda
135 (_: nat).(eq C (CHead c1 k u2) (CHead c1 k u3)))) (\lambda (u3: T).(\lambda
136 (j: nat).(subst0 j v0 u1 u3)))) (ex3_2 C nat (\lambda (_: C).(\lambda (j:
137 nat).(eq nat (s k i0) (s k j)))) (\lambda (c2: C).(\lambda (_: nat).(eq C
138 (CHead c1 k u2) (CHead c2 k u1)))) (\lambda (c2: C).(\lambda (j:
139 nat).(csubst0 j v0 c1 c2)))) (ex4_3 T C nat (\lambda (_: T).(\lambda (_:
140 C).(\lambda (j: nat).(eq nat (s k i0) (s k j))))) (\lambda (u3: T).(\lambda
141 (c2: C).(\lambda (_: nat).(eq C (CHead c1 k u2) (CHead c2 k u3))))) (\lambda
142 (u3: T).(\lambda (_: C).(\lambda (j: nat).(subst0 j v0 u1 u3)))) (\lambda (_:
143 T).(\lambda (c2: C).(\lambda (j: nat).(csubst0 j v0 c1 c2))))) (ex3_2_intro T
144 nat (\lambda (_: T).(\lambda (j: nat).(eq nat (s k i0) (s k j)))) (\lambda
145 (u3: T).(\lambda (_: nat).(eq C (CHead c1 k u2) (CHead c1 k u3)))) (\lambda
146 (u3: T).(\lambda (j: nat).(subst0 j v0 u1 u3))) u2 i0 (refl_equal nat (s k
147 i0)) (refl_equal C (CHead c1 k u2)) H8)) k0 H6)) c H7)))) H4)) H3))))))))))
148 (\lambda (k0: K).(\lambda (i0: nat).(\lambda (c0: C).(\lambda (c2:
149 C).(\lambda (v0: T).(\lambda (H1: (csubst0 i0 v0 c0 c2)).(\lambda (H2: (((eq
150 C c0 (CHead c1 k u1)) \to (or3 (ex3_2 T nat (\lambda (_: T).(\lambda (j:
151 nat).(eq nat i0 (s k j)))) (\lambda (u2: T).(\lambda (_: nat).(eq C c2 (CHead
152 c1 k u2)))) (\lambda (u2: T).(\lambda (j: nat).(subst0 j v0 u1 u2)))) (ex3_2
153 C nat (\lambda (_: C).(\lambda (j: nat).(eq nat i0 (s k j)))) (\lambda (c3:
154 C).(\lambda (_: nat).(eq C c2 (CHead c3 k u1)))) (\lambda (c3: C).(\lambda
155 (j: nat).(csubst0 j v0 c1 c3)))) (ex4_3 T C nat (\lambda (_: T).(\lambda (_:
156 C).(\lambda (j: nat).(eq nat i0 (s k j))))) (\lambda (u2: T).(\lambda (c3:
157 C).(\lambda (_: nat).(eq C c2 (CHead c3 k u2))))) (\lambda (u2: T).(\lambda
158 (_: C).(\lambda (j: nat).(subst0 j v0 u1 u2)))) (\lambda (_: T).(\lambda (c3:
159 C).(\lambda (j: nat).(csubst0 j v0 c1 c3))))))))).(\lambda (u: T).(\lambda
160 (H3: (eq C (CHead c0 k0 u) (CHead c1 k u1))).(let H4 \def (f_equal C C
161 (\lambda (e: C).(match e with [(CSort _) \Rightarrow c0 | (CHead c _ _)
162 \Rightarrow c])) (CHead c0 k0 u) (CHead c1 k u1) H3) in ((let H5 \def
163 (f_equal C K (\lambda (e: C).(match e with [(CSort _) \Rightarrow k0 | (CHead
164 _ k1 _) \Rightarrow k1])) (CHead c0 k0 u) (CHead c1 k u1) H3) in ((let H6
165 \def (f_equal C T (\lambda (e: C).(match e with [(CSort _) \Rightarrow u |
166 (CHead _ _ t) \Rightarrow t])) (CHead c0 k0 u) (CHead c1 k u1) H3) in
167 (\lambda (H7: (eq K k0 k)).(\lambda (H8: (eq C c0 c1)).(eq_ind_r T u1
168 (\lambda (t: T).(or3 (ex3_2 T nat (\lambda (_: T).(\lambda (j: nat).(eq nat
169 (s k0 i0) (s k j)))) (\lambda (u2: T).(\lambda (_: nat).(eq C (CHead c2 k0 t)
170 (CHead c1 k u2)))) (\lambda (u2: T).(\lambda (j: nat).(subst0 j v0 u1 u2))))
171 (ex3_2 C nat (\lambda (_: C).(\lambda (j: nat).(eq nat (s k0 i0) (s k j))))
172 (\lambda (c3: C).(\lambda (_: nat).(eq C (CHead c2 k0 t) (CHead c3 k u1))))
173 (\lambda (c3: C).(\lambda (j: nat).(csubst0 j v0 c1 c3)))) (ex4_3 T C nat
174 (\lambda (_: T).(\lambda (_: C).(\lambda (j: nat).(eq nat (s k0 i0) (s k
175 j))))) (\lambda (u2: T).(\lambda (c3: C).(\lambda (_: nat).(eq C (CHead c2 k0
176 t) (CHead c3 k u2))))) (\lambda (u2: T).(\lambda (_: C).(\lambda (j:
177 nat).(subst0 j v0 u1 u2)))) (\lambda (_: T).(\lambda (c3: C).(\lambda (j:
178 nat).(csubst0 j v0 c1 c3))))))) (let H9 \def (eq_ind C c0 (\lambda (c:
179 C).((eq C c (CHead c1 k u1)) \to (or3 (ex3_2 T nat (\lambda (_: T).(\lambda
180 (j: nat).(eq nat i0 (s k j)))) (\lambda (u2: T).(\lambda (_: nat).(eq C c2
181 (CHead c1 k u2)))) (\lambda (u2: T).(\lambda (j: nat).(subst0 j v0 u1 u2))))
182 (ex3_2 C nat (\lambda (_: C).(\lambda (j: nat).(eq nat i0 (s k j)))) (\lambda
183 (c3: C).(\lambda (_: nat).(eq C c2 (CHead c3 k u1)))) (\lambda (c3:
184 C).(\lambda (j: nat).(csubst0 j v0 c1 c3)))) (ex4_3 T C nat (\lambda (_:
185 T).(\lambda (_: C).(\lambda (j: nat).(eq nat i0 (s k j))))) (\lambda (u2:
186 T).(\lambda (c3: C).(\lambda (_: nat).(eq C c2 (CHead c3 k u2))))) (\lambda
187 (u2: T).(\lambda (_: C).(\lambda (j: nat).(subst0 j v0 u1 u2)))) (\lambda (_:
188 T).(\lambda (c3: C).(\lambda (j: nat).(csubst0 j v0 c1 c3)))))))) H2 c1 H8)
189 in (let H10 \def (eq_ind C c0 (\lambda (c: C).(csubst0 i0 v0 c c2)) H1 c1 H8)
190 in (eq_ind_r K k (\lambda (k1: K).(or3 (ex3_2 T nat (\lambda (_: T).(\lambda
191 (j: nat).(eq nat (s k1 i0) (s k j)))) (\lambda (u2: T).(\lambda (_: nat).(eq
192 C (CHead c2 k1 u1) (CHead c1 k u2)))) (\lambda (u2: T).(\lambda (j:
193 nat).(subst0 j v0 u1 u2)))) (ex3_2 C nat (\lambda (_: C).(\lambda (j:
194 nat).(eq nat (s k1 i0) (s k j)))) (\lambda (c3: C).(\lambda (_: nat).(eq C
195 (CHead c2 k1 u1) (CHead c3 k u1)))) (\lambda (c3: C).(\lambda (j:
196 nat).(csubst0 j v0 c1 c3)))) (ex4_3 T C nat (\lambda (_: T).(\lambda (_:
197 C).(\lambda (j: nat).(eq nat (s k1 i0) (s k j))))) (\lambda (u2: T).(\lambda
198 (c3: C).(\lambda (_: nat).(eq C (CHead c2 k1 u1) (CHead c3 k u2))))) (\lambda
199 (u2: T).(\lambda (_: C).(\lambda (j: nat).(subst0 j v0 u1 u2)))) (\lambda (_:
200 T).(\lambda (c3: C).(\lambda (j: nat).(csubst0 j v0 c1 c3))))))) (or3_intro1
201 (ex3_2 T nat (\lambda (_: T).(\lambda (j: nat).(eq nat (s k i0) (s k j))))
202 (\lambda (u2: T).(\lambda (_: nat).(eq C (CHead c2 k u1) (CHead c1 k u2))))
203 (\lambda (u2: T).(\lambda (j: nat).(subst0 j v0 u1 u2)))) (ex3_2 C nat
204 (\lambda (_: C).(\lambda (j: nat).(eq nat (s k i0) (s k j)))) (\lambda (c3:
205 C).(\lambda (_: nat).(eq C (CHead c2 k u1) (CHead c3 k u1)))) (\lambda (c3:
206 C).(\lambda (j: nat).(csubst0 j v0 c1 c3)))) (ex4_3 T C nat (\lambda (_:
207 T).(\lambda (_: C).(\lambda (j: nat).(eq nat (s k i0) (s k j))))) (\lambda
208 (u2: T).(\lambda (c3: C).(\lambda (_: nat).(eq C (CHead c2 k u1) (CHead c3 k
209 u2))))) (\lambda (u2: T).(\lambda (_: C).(\lambda (j: nat).(subst0 j v0 u1
210 u2)))) (\lambda (_: T).(\lambda (c3: C).(\lambda (j: nat).(csubst0 j v0 c1
211 c3))))) (ex3_2_intro C nat (\lambda (_: C).(\lambda (j: nat).(eq nat (s k i0)
212 (s k j)))) (\lambda (c3: C).(\lambda (_: nat).(eq C (CHead c2 k u1) (CHead c3
213 k u1)))) (\lambda (c3: C).(\lambda (j: nat).(csubst0 j v0 c1 c3))) c2 i0
214 (refl_equal nat (s k i0)) (refl_equal C (CHead c2 k u1)) H10)) k0 H7))) u
215 H6)))) H5)) H4))))))))))) (\lambda (k0: K).(\lambda (i0: nat).(\lambda (v0:
216 T).(\lambda (u0: T).(\lambda (u2: T).(\lambda (H1: (subst0 i0 v0 u0
217 u2)).(\lambda (c0: C).(\lambda (c2: C).(\lambda (H2: (csubst0 i0 v0 c0
218 c2)).(\lambda (H3: (((eq C c0 (CHead c1 k u1)) \to (or3 (ex3_2 T nat (\lambda
219 (_: T).(\lambda (j: nat).(eq nat i0 (s k j)))) (\lambda (u3: T).(\lambda (_:
220 nat).(eq C c2 (CHead c1 k u3)))) (\lambda (u3: T).(\lambda (j: nat).(subst0 j
221 v0 u1 u3)))) (ex3_2 C nat (\lambda (_: C).(\lambda (j: nat).(eq nat i0 (s k
222 j)))) (\lambda (c3: C).(\lambda (_: nat).(eq C c2 (CHead c3 k u1)))) (\lambda
223 (c3: C).(\lambda (j: nat).(csubst0 j v0 c1 c3)))) (ex4_3 T C nat (\lambda (_:
224 T).(\lambda (_: C).(\lambda (j: nat).(eq nat i0 (s k j))))) (\lambda (u3:
225 T).(\lambda (c3: C).(\lambda (_: nat).(eq C c2 (CHead c3 k u3))))) (\lambda
226 (u3: T).(\lambda (_: C).(\lambda (j: nat).(subst0 j v0 u1 u3)))) (\lambda (_:
227 T).(\lambda (c3: C).(\lambda (j: nat).(csubst0 j v0 c1 c3))))))))).(\lambda
228 (H4: (eq C (CHead c0 k0 u0) (CHead c1 k u1))).(let H5 \def (f_equal C C
229 (\lambda (e: C).(match e with [(CSort _) \Rightarrow c0 | (CHead c _ _)
230 \Rightarrow c])) (CHead c0 k0 u0) (CHead c1 k u1) H4) in ((let H6 \def
231 (f_equal C K (\lambda (e: C).(match e with [(CSort _) \Rightarrow k0 | (CHead
232 _ k1 _) \Rightarrow k1])) (CHead c0 k0 u0) (CHead c1 k u1) H4) in ((let H7
233 \def (f_equal C T (\lambda (e: C).(match e with [(CSort _) \Rightarrow u0 |
234 (CHead _ _ t) \Rightarrow t])) (CHead c0 k0 u0) (CHead c1 k u1) H4) in
235 (\lambda (H8: (eq K k0 k)).(\lambda (H9: (eq C c0 c1)).(let H10 \def (eq_ind
236 C c0 (\lambda (c: C).((eq C c (CHead c1 k u1)) \to (or3 (ex3_2 T nat (\lambda
237 (_: T).(\lambda (j: nat).(eq nat i0 (s k j)))) (\lambda (u3: T).(\lambda (_:
238 nat).(eq C c2 (CHead c1 k u3)))) (\lambda (u3: T).(\lambda (j: nat).(subst0 j
239 v0 u1 u3)))) (ex3_2 C nat (\lambda (_: C).(\lambda (j: nat).(eq nat i0 (s k
240 j)))) (\lambda (c3: C).(\lambda (_: nat).(eq C c2 (CHead c3 k u1)))) (\lambda
241 (c3: C).(\lambda (j: nat).(csubst0 j v0 c1 c3)))) (ex4_3 T C nat (\lambda (_:
242 T).(\lambda (_: C).(\lambda (j: nat).(eq nat i0 (s k j))))) (\lambda (u3:
243 T).(\lambda (c3: C).(\lambda (_: nat).(eq C c2 (CHead c3 k u3))))) (\lambda
244 (u3: T).(\lambda (_: C).(\lambda (j: nat).(subst0 j v0 u1 u3)))) (\lambda (_:
245 T).(\lambda (c3: C).(\lambda (j: nat).(csubst0 j v0 c1 c3)))))))) H3 c1 H9)
246 in (let H11 \def (eq_ind C c0 (\lambda (c: C).(csubst0 i0 v0 c c2)) H2 c1 H9)
247 in (let H12 \def (eq_ind T u0 (\lambda (t: T).(subst0 i0 v0 t u2)) H1 u1 H7)
248 in (eq_ind_r K k (\lambda (k1: K).(or3 (ex3_2 T nat (\lambda (_: T).(\lambda
249 (j: nat).(eq nat (s k1 i0) (s k j)))) (\lambda (u3: T).(\lambda (_: nat).(eq
250 C (CHead c2 k1 u2) (CHead c1 k u3)))) (\lambda (u3: T).(\lambda (j:
251 nat).(subst0 j v0 u1 u3)))) (ex3_2 C nat (\lambda (_: C).(\lambda (j:
252 nat).(eq nat (s k1 i0) (s k j)))) (\lambda (c3: C).(\lambda (_: nat).(eq C
253 (CHead c2 k1 u2) (CHead c3 k u1)))) (\lambda (c3: C).(\lambda (j:
254 nat).(csubst0 j v0 c1 c3)))) (ex4_3 T C nat (\lambda (_: T).(\lambda (_:
255 C).(\lambda (j: nat).(eq nat (s k1 i0) (s k j))))) (\lambda (u3: T).(\lambda
256 (c3: C).(\lambda (_: nat).(eq C (CHead c2 k1 u2) (CHead c3 k u3))))) (\lambda
257 (u3: T).(\lambda (_: C).(\lambda (j: nat).(subst0 j v0 u1 u3)))) (\lambda (_:
258 T).(\lambda (c3: C).(\lambda (j: nat).(csubst0 j v0 c1 c3))))))) (or3_intro2
259 (ex3_2 T nat (\lambda (_: T).(\lambda (j: nat).(eq nat (s k i0) (s k j))))
260 (\lambda (u3: T).(\lambda (_: nat).(eq C (CHead c2 k u2) (CHead c1 k u3))))
261 (\lambda (u3: T).(\lambda (j: nat).(subst0 j v0 u1 u3)))) (ex3_2 C nat
262 (\lambda (_: C).(\lambda (j: nat).(eq nat (s k i0) (s k j)))) (\lambda (c3:
263 C).(\lambda (_: nat).(eq C (CHead c2 k u2) (CHead c3 k u1)))) (\lambda (c3:
264 C).(\lambda (j: nat).(csubst0 j v0 c1 c3)))) (ex4_3 T C nat (\lambda (_:
265 T).(\lambda (_: C).(\lambda (j: nat).(eq nat (s k i0) (s k j))))) (\lambda
266 (u3: T).(\lambda (c3: C).(\lambda (_: nat).(eq C (CHead c2 k u2) (CHead c3 k
267 u3))))) (\lambda (u3: T).(\lambda (_: C).(\lambda (j: nat).(subst0 j v0 u1
268 u3)))) (\lambda (_: T).(\lambda (c3: C).(\lambda (j: nat).(csubst0 j v0 c1
269 c3))))) (ex4_3_intro T C nat (\lambda (_: T).(\lambda (_: C).(\lambda (j:
270 nat).(eq nat (s k i0) (s k j))))) (\lambda (u3: T).(\lambda (c3: C).(\lambda
271 (_: nat).(eq C (CHead c2 k u2) (CHead c3 k u3))))) (\lambda (u3: T).(\lambda
272 (_: C).(\lambda (j: nat).(subst0 j v0 u1 u3)))) (\lambda (_: T).(\lambda (c3:
273 C).(\lambda (j: nat).(csubst0 j v0 c1 c3)))) u2 c2 i0 (refl_equal nat (s k
274 i0)) (refl_equal C (CHead c2 k u2)) H12 H11)) k0 H8))))))) H6))
275 H5))))))))))))) i v y x H0))) H))))))).
277 lemma csubst0_gen_S_bind_2:
278 \forall (b: B).(\forall (x: C).(\forall (c2: C).(\forall (v: T).(\forall
279 (v2: T).(\forall (i: nat).((csubst0 (S i) v x (CHead c2 (Bind b) v2)) \to
280 (or3 (ex2 T (\lambda (v1: T).(subst0 i v v1 v2)) (\lambda (v1: T).(eq C x
281 (CHead c2 (Bind b) v1)))) (ex2 C (\lambda (c1: C).(csubst0 i v c1 c2))
282 (\lambda (c1: C).(eq C x (CHead c1 (Bind b) v2)))) (ex3_2 C T (\lambda (_:
283 C).(\lambda (v1: T).(subst0 i v v1 v2))) (\lambda (c1: C).(\lambda (_:
284 T).(csubst0 i v c1 c2))) (\lambda (c1: C).(\lambda (v1: T).(eq C x (CHead c1
285 (Bind b) v1))))))))))))
287 \lambda (b: B).(\lambda (x: C).(C_ind (\lambda (c: C).(\forall (c2:
288 C).(\forall (v: T).(\forall (v2: T).(\forall (i: nat).((csubst0 (S i) v c
289 (CHead c2 (Bind b) v2)) \to (or3 (ex2 T (\lambda (v1: T).(subst0 i v v1 v2))
290 (\lambda (v1: T).(eq C c (CHead c2 (Bind b) v1)))) (ex2 C (\lambda (c1:
291 C).(csubst0 i v c1 c2)) (\lambda (c1: C).(eq C c (CHead c1 (Bind b) v2))))
292 (ex3_2 C T (\lambda (_: C).(\lambda (v1: T).(subst0 i v v1 v2))) (\lambda
293 (c1: C).(\lambda (_: T).(csubst0 i v c1 c2))) (\lambda (c1: C).(\lambda (v1:
294 T).(eq C c (CHead c1 (Bind b) v1)))))))))))) (\lambda (n: nat).(\lambda (c2:
295 C).(\lambda (v: T).(\lambda (v2: T).(\lambda (i: nat).(\lambda (H: (csubst0
296 (S i) v (CSort n) (CHead c2 (Bind b) v2))).(csubst0_gen_sort (CHead c2 (Bind
297 b) v2) v (S i) n H (or3 (ex2 T (\lambda (v1: T).(subst0 i v v1 v2)) (\lambda
298 (v1: T).(eq C (CSort n) (CHead c2 (Bind b) v1)))) (ex2 C (\lambda (c1:
299 C).(csubst0 i v c1 c2)) (\lambda (c1: C).(eq C (CSort n) (CHead c1 (Bind b)
300 v2)))) (ex3_2 C T (\lambda (_: C).(\lambda (v1: T).(subst0 i v v1 v2)))
301 (\lambda (c1: C).(\lambda (_: T).(csubst0 i v c1 c2))) (\lambda (c1:
302 C).(\lambda (v1: T).(eq C (CSort n) (CHead c1 (Bind b) v1)))))))))))))
303 (\lambda (c: C).(\lambda (_: ((\forall (c2: C).(\forall (v: T).(\forall (v2:
304 T).(\forall (i: nat).((csubst0 (S i) v c (CHead c2 (Bind b) v2)) \to (or3
305 (ex2 T (\lambda (v1: T).(subst0 i v v1 v2)) (\lambda (v1: T).(eq C c (CHead
306 c2 (Bind b) v1)))) (ex2 C (\lambda (c1: C).(csubst0 i v c1 c2)) (\lambda (c1:
307 C).(eq C c (CHead c1 (Bind b) v2)))) (ex3_2 C T (\lambda (_: C).(\lambda (v1:
308 T).(subst0 i v v1 v2))) (\lambda (c1: C).(\lambda (_: T).(csubst0 i v c1
309 c2))) (\lambda (c1: C).(\lambda (v1: T).(eq C c (CHead c1 (Bind b)
310 v1))))))))))))).(\lambda (k: K).(\lambda (t: T).(\lambda (c2: C).(\lambda (v:
311 T).(\lambda (v2: T).(\lambda (i: nat).(\lambda (H0: (csubst0 (S i) v (CHead c
312 k t) (CHead c2 (Bind b) v2))).(let H1 \def (csubst0_gen_head k c (CHead c2
313 (Bind b) v2) t v (S i) H0) in (or3_ind (ex3_2 T nat (\lambda (_: T).(\lambda
314 (j: nat).(eq nat (S i) (s k j)))) (\lambda (u2: T).(\lambda (_: nat).(eq C
315 (CHead c2 (Bind b) v2) (CHead c k u2)))) (\lambda (u2: T).(\lambda (j:
316 nat).(subst0 j v t u2)))) (ex3_2 C nat (\lambda (_: C).(\lambda (j: nat).(eq
317 nat (S i) (s k j)))) (\lambda (c3: C).(\lambda (_: nat).(eq C (CHead c2 (Bind
318 b) v2) (CHead c3 k t)))) (\lambda (c3: C).(\lambda (j: nat).(csubst0 j v c
319 c3)))) (ex4_3 T C nat (\lambda (_: T).(\lambda (_: C).(\lambda (j: nat).(eq
320 nat (S i) (s k j))))) (\lambda (u2: T).(\lambda (c3: C).(\lambda (_: nat).(eq
321 C (CHead c2 (Bind b) v2) (CHead c3 k u2))))) (\lambda (u2: T).(\lambda (_:
322 C).(\lambda (j: nat).(subst0 j v t u2)))) (\lambda (_: T).(\lambda (c3:
323 C).(\lambda (j: nat).(csubst0 j v c c3))))) (or3 (ex2 T (\lambda (v1:
324 T).(subst0 i v v1 v2)) (\lambda (v1: T).(eq C (CHead c k t) (CHead c2 (Bind
325 b) v1)))) (ex2 C (\lambda (c1: C).(csubst0 i v c1 c2)) (\lambda (c1: C).(eq C
326 (CHead c k t) (CHead c1 (Bind b) v2)))) (ex3_2 C T (\lambda (_: C).(\lambda
327 (v1: T).(subst0 i v v1 v2))) (\lambda (c1: C).(\lambda (_: T).(csubst0 i v c1
328 c2))) (\lambda (c1: C).(\lambda (v1: T).(eq C (CHead c k t) (CHead c1 (Bind
329 b) v1)))))) (\lambda (H2: (ex3_2 T nat (\lambda (_: T).(\lambda (j: nat).(eq
330 nat (S i) (s k j)))) (\lambda (u2: T).(\lambda (_: nat).(eq C (CHead c2 (Bind
331 b) v2) (CHead c k u2)))) (\lambda (u2: T).(\lambda (j: nat).(subst0 j v t
332 u2))))).(ex3_2_ind T nat (\lambda (_: T).(\lambda (j: nat).(eq nat (S i) (s k
333 j)))) (\lambda (u2: T).(\lambda (_: nat).(eq C (CHead c2 (Bind b) v2) (CHead
334 c k u2)))) (\lambda (u2: T).(\lambda (j: nat).(subst0 j v t u2))) (or3 (ex2 T
335 (\lambda (v1: T).(subst0 i v v1 v2)) (\lambda (v1: T).(eq C (CHead c k t)
336 (CHead c2 (Bind b) v1)))) (ex2 C (\lambda (c1: C).(csubst0 i v c1 c2))
337 (\lambda (c1: C).(eq C (CHead c k t) (CHead c1 (Bind b) v2)))) (ex3_2 C T
338 (\lambda (_: C).(\lambda (v1: T).(subst0 i v v1 v2))) (\lambda (c1:
339 C).(\lambda (_: T).(csubst0 i v c1 c2))) (\lambda (c1: C).(\lambda (v1:
340 T).(eq C (CHead c k t) (CHead c1 (Bind b) v1)))))) (\lambda (x0: T).(\lambda
341 (x1: nat).(\lambda (H3: (eq nat (S i) (s k x1))).(\lambda (H4: (eq C (CHead
342 c2 (Bind b) v2) (CHead c k x0))).(\lambda (H5: (subst0 x1 v t x0)).(let H6
343 \def (f_equal C C (\lambda (e: C).(match e with [(CSort _) \Rightarrow c2 |
344 (CHead c0 _ _) \Rightarrow c0])) (CHead c2 (Bind b) v2) (CHead c k x0) H4) in
345 ((let H7 \def (f_equal C K (\lambda (e: C).(match e with [(CSort _)
346 \Rightarrow (Bind b) | (CHead _ k0 _) \Rightarrow k0])) (CHead c2 (Bind b)
347 v2) (CHead c k x0) H4) in ((let H8 \def (f_equal C T (\lambda (e: C).(match e
348 with [(CSort _) \Rightarrow v2 | (CHead _ _ t0) \Rightarrow t0])) (CHead c2
349 (Bind b) v2) (CHead c k x0) H4) in (\lambda (H9: (eq K (Bind b) k)).(\lambda
350 (H10: (eq C c2 c)).(let H11 \def (eq_ind_r T x0 (\lambda (t0: T).(subst0 x1 v
351 t t0)) H5 v2 H8) in (eq_ind_r C c (\lambda (c0: C).(or3 (ex2 T (\lambda (v1:
352 T).(subst0 i v v1 v2)) (\lambda (v1: T).(eq C (CHead c k t) (CHead c0 (Bind
353 b) v1)))) (ex2 C (\lambda (c1: C).(csubst0 i v c1 c0)) (\lambda (c1: C).(eq C
354 (CHead c k t) (CHead c1 (Bind b) v2)))) (ex3_2 C T (\lambda (_: C).(\lambda
355 (v1: T).(subst0 i v v1 v2))) (\lambda (c1: C).(\lambda (_: T).(csubst0 i v c1
356 c0))) (\lambda (c1: C).(\lambda (v1: T).(eq C (CHead c k t) (CHead c1 (Bind
357 b) v1))))))) (let H12 \def (eq_ind_r K k (\lambda (k0: K).(eq nat (S i) (s k0
358 x1))) H3 (Bind b) H9) in (eq_ind K (Bind b) (\lambda (k0: K).(or3 (ex2 T
359 (\lambda (v1: T).(subst0 i v v1 v2)) (\lambda (v1: T).(eq C (CHead c k0 t)
360 (CHead c (Bind b) v1)))) (ex2 C (\lambda (c1: C).(csubst0 i v c1 c)) (\lambda
361 (c1: C).(eq C (CHead c k0 t) (CHead c1 (Bind b) v2)))) (ex3_2 C T (\lambda
362 (_: C).(\lambda (v1: T).(subst0 i v v1 v2))) (\lambda (c1: C).(\lambda (_:
363 T).(csubst0 i v c1 c))) (\lambda (c1: C).(\lambda (v1: T).(eq C (CHead c k0
364 t) (CHead c1 (Bind b) v1))))))) (let H13 \def (f_equal nat nat (\lambda (e:
365 nat).(match e with [O \Rightarrow i | (S n) \Rightarrow n])) (S i) (S x1)
366 H12) in (let H14 \def (eq_ind_r nat x1 (\lambda (n: nat).(subst0 n v t v2))
367 H11 i H13) in (or3_intro0 (ex2 T (\lambda (v1: T).(subst0 i v v1 v2))
368 (\lambda (v1: T).(eq C (CHead c (Bind b) t) (CHead c (Bind b) v1)))) (ex2 C
369 (\lambda (c1: C).(csubst0 i v c1 c)) (\lambda (c1: C).(eq C (CHead c (Bind b)
370 t) (CHead c1 (Bind b) v2)))) (ex3_2 C T (\lambda (_: C).(\lambda (v1:
371 T).(subst0 i v v1 v2))) (\lambda (c1: C).(\lambda (_: T).(csubst0 i v c1 c)))
372 (\lambda (c1: C).(\lambda (v1: T).(eq C (CHead c (Bind b) t) (CHead c1 (Bind
373 b) v1))))) (ex_intro2 T (\lambda (v1: T).(subst0 i v v1 v2)) (\lambda (v1:
374 T).(eq C (CHead c (Bind b) t) (CHead c (Bind b) v1))) t H14 (refl_equal C
375 (CHead c (Bind b) t)))))) k H9)) c2 H10))))) H7)) H6))))))) H2)) (\lambda
376 (H2: (ex3_2 C nat (\lambda (_: C).(\lambda (j: nat).(eq nat (S i) (s k j))))
377 (\lambda (c3: C).(\lambda (_: nat).(eq C (CHead c2 (Bind b) v2) (CHead c3 k
378 t)))) (\lambda (c3: C).(\lambda (j: nat).(csubst0 j v c c3))))).(ex3_2_ind C
379 nat (\lambda (_: C).(\lambda (j: nat).(eq nat (S i) (s k j)))) (\lambda (c3:
380 C).(\lambda (_: nat).(eq C (CHead c2 (Bind b) v2) (CHead c3 k t)))) (\lambda
381 (c3: C).(\lambda (j: nat).(csubst0 j v c c3))) (or3 (ex2 T (\lambda (v1:
382 T).(subst0 i v v1 v2)) (\lambda (v1: T).(eq C (CHead c k t) (CHead c2 (Bind
383 b) v1)))) (ex2 C (\lambda (c1: C).(csubst0 i v c1 c2)) (\lambda (c1: C).(eq C
384 (CHead c k t) (CHead c1 (Bind b) v2)))) (ex3_2 C T (\lambda (_: C).(\lambda
385 (v1: T).(subst0 i v v1 v2))) (\lambda (c1: C).(\lambda (_: T).(csubst0 i v c1
386 c2))) (\lambda (c1: C).(\lambda (v1: T).(eq C (CHead c k t) (CHead c1 (Bind
387 b) v1)))))) (\lambda (x0: C).(\lambda (x1: nat).(\lambda (H3: (eq nat (S i)
388 (s k x1))).(\lambda (H4: (eq C (CHead c2 (Bind b) v2) (CHead x0 k
389 t))).(\lambda (H5: (csubst0 x1 v c x0)).(let H6 \def (f_equal C C (\lambda
390 (e: C).(match e with [(CSort _) \Rightarrow c2 | (CHead c0 _ _) \Rightarrow
391 c0])) (CHead c2 (Bind b) v2) (CHead x0 k t) H4) in ((let H7 \def (f_equal C K
392 (\lambda (e: C).(match e with [(CSort _) \Rightarrow (Bind b) | (CHead _ k0
393 _) \Rightarrow k0])) (CHead c2 (Bind b) v2) (CHead x0 k t) H4) in ((let H8
394 \def (f_equal C T (\lambda (e: C).(match e with [(CSort _) \Rightarrow v2 |
395 (CHead _ _ t0) \Rightarrow t0])) (CHead c2 (Bind b) v2) (CHead x0 k t) H4) in
396 (\lambda (H9: (eq K (Bind b) k)).(\lambda (H10: (eq C c2 x0)).(let H11 \def
397 (eq_ind_r C x0 (\lambda (c0: C).(csubst0 x1 v c c0)) H5 c2 H10) in (eq_ind_r
398 T t (\lambda (t0: T).(or3 (ex2 T (\lambda (v1: T).(subst0 i v v1 t0))
399 (\lambda (v1: T).(eq C (CHead c k t) (CHead c2 (Bind b) v1)))) (ex2 C
400 (\lambda (c1: C).(csubst0 i v c1 c2)) (\lambda (c1: C).(eq C (CHead c k t)
401 (CHead c1 (Bind b) t0)))) (ex3_2 C T (\lambda (_: C).(\lambda (v1: T).(subst0
402 i v v1 t0))) (\lambda (c1: C).(\lambda (_: T).(csubst0 i v c1 c2))) (\lambda
403 (c1: C).(\lambda (v1: T).(eq C (CHead c k t) (CHead c1 (Bind b) v1)))))))
404 (let H12 \def (eq_ind_r K k (\lambda (k0: K).(eq nat (S i) (s k0 x1))) H3
405 (Bind b) H9) in (eq_ind K (Bind b) (\lambda (k0: K).(or3 (ex2 T (\lambda (v1:
406 T).(subst0 i v v1 t)) (\lambda (v1: T).(eq C (CHead c k0 t) (CHead c2 (Bind
407 b) v1)))) (ex2 C (\lambda (c1: C).(csubst0 i v c1 c2)) (\lambda (c1: C).(eq C
408 (CHead c k0 t) (CHead c1 (Bind b) t)))) (ex3_2 C T (\lambda (_: C).(\lambda
409 (v1: T).(subst0 i v v1 t))) (\lambda (c1: C).(\lambda (_: T).(csubst0 i v c1
410 c2))) (\lambda (c1: C).(\lambda (v1: T).(eq C (CHead c k0 t) (CHead c1 (Bind
411 b) v1))))))) (let H13 \def (f_equal nat nat (\lambda (e: nat).(match e with
412 [O \Rightarrow i | (S n) \Rightarrow n])) (S i) (S x1) H12) in (let H14 \def
413 (eq_ind_r nat x1 (\lambda (n: nat).(csubst0 n v c c2)) H11 i H13) in
414 (or3_intro1 (ex2 T (\lambda (v1: T).(subst0 i v v1 t)) (\lambda (v1: T).(eq C
415 (CHead c (Bind b) t) (CHead c2 (Bind b) v1)))) (ex2 C (\lambda (c1:
416 C).(csubst0 i v c1 c2)) (\lambda (c1: C).(eq C (CHead c (Bind b) t) (CHead c1
417 (Bind b) t)))) (ex3_2 C T (\lambda (_: C).(\lambda (v1: T).(subst0 i v v1
418 t))) (\lambda (c1: C).(\lambda (_: T).(csubst0 i v c1 c2))) (\lambda (c1:
419 C).(\lambda (v1: T).(eq C (CHead c (Bind b) t) (CHead c1 (Bind b) v1)))))
420 (ex_intro2 C (\lambda (c1: C).(csubst0 i v c1 c2)) (\lambda (c1: C).(eq C
421 (CHead c (Bind b) t) (CHead c1 (Bind b) t))) c H14 (refl_equal C (CHead c
422 (Bind b) t)))))) k H9)) v2 H8))))) H7)) H6))))))) H2)) (\lambda (H2: (ex4_3 T
423 C nat (\lambda (_: T).(\lambda (_: C).(\lambda (j: nat).(eq nat (S i) (s k
424 j))))) (\lambda (u2: T).(\lambda (c3: C).(\lambda (_: nat).(eq C (CHead c2
425 (Bind b) v2) (CHead c3 k u2))))) (\lambda (u2: T).(\lambda (_: C).(\lambda
426 (j: nat).(subst0 j v t u2)))) (\lambda (_: T).(\lambda (c3: C).(\lambda (j:
427 nat).(csubst0 j v c c3)))))).(ex4_3_ind T C nat (\lambda (_: T).(\lambda (_:
428 C).(\lambda (j: nat).(eq nat (S i) (s k j))))) (\lambda (u2: T).(\lambda (c3:
429 C).(\lambda (_: nat).(eq C (CHead c2 (Bind b) v2) (CHead c3 k u2)))))
430 (\lambda (u2: T).(\lambda (_: C).(\lambda (j: nat).(subst0 j v t u2))))
431 (\lambda (_: T).(\lambda (c3: C).(\lambda (j: nat).(csubst0 j v c c3)))) (or3
432 (ex2 T (\lambda (v1: T).(subst0 i v v1 v2)) (\lambda (v1: T).(eq C (CHead c k
433 t) (CHead c2 (Bind b) v1)))) (ex2 C (\lambda (c1: C).(csubst0 i v c1 c2))
434 (\lambda (c1: C).(eq C (CHead c k t) (CHead c1 (Bind b) v2)))) (ex3_2 C T
435 (\lambda (_: C).(\lambda (v1: T).(subst0 i v v1 v2))) (\lambda (c1:
436 C).(\lambda (_: T).(csubst0 i v c1 c2))) (\lambda (c1: C).(\lambda (v1:
437 T).(eq C (CHead c k t) (CHead c1 (Bind b) v1)))))) (\lambda (x0: T).(\lambda
438 (x1: C).(\lambda (x2: nat).(\lambda (H3: (eq nat (S i) (s k x2))).(\lambda
439 (H4: (eq C (CHead c2 (Bind b) v2) (CHead x1 k x0))).(\lambda (H5: (subst0 x2
440 v t x0)).(\lambda (H6: (csubst0 x2 v c x1)).(let H7 \def (f_equal C C
441 (\lambda (e: C).(match e with [(CSort _) \Rightarrow c2 | (CHead c0 _ _)
442 \Rightarrow c0])) (CHead c2 (Bind b) v2) (CHead x1 k x0) H4) in ((let H8 \def
443 (f_equal C K (\lambda (e: C).(match e with [(CSort _) \Rightarrow (Bind b) |
444 (CHead _ k0 _) \Rightarrow k0])) (CHead c2 (Bind b) v2) (CHead x1 k x0) H4)
445 in ((let H9 \def (f_equal C T (\lambda (e: C).(match e with [(CSort _)
446 \Rightarrow v2 | (CHead _ _ t0) \Rightarrow t0])) (CHead c2 (Bind b) v2)
447 (CHead x1 k x0) H4) in (\lambda (H10: (eq K (Bind b) k)).(\lambda (H11: (eq C
448 c2 x1)).(let H12 \def (eq_ind_r C x1 (\lambda (c0: C).(csubst0 x2 v c c0)) H6
449 c2 H11) in (let H13 \def (eq_ind_r T x0 (\lambda (t0: T).(subst0 x2 v t t0))
450 H5 v2 H9) in (let H14 \def (eq_ind_r K k (\lambda (k0: K).(eq nat (S i) (s k0
451 x2))) H3 (Bind b) H10) in (eq_ind K (Bind b) (\lambda (k0: K).(or3 (ex2 T
452 (\lambda (v1: T).(subst0 i v v1 v2)) (\lambda (v1: T).(eq C (CHead c k0 t)
453 (CHead c2 (Bind b) v1)))) (ex2 C (\lambda (c1: C).(csubst0 i v c1 c2))
454 (\lambda (c1: C).(eq C (CHead c k0 t) (CHead c1 (Bind b) v2)))) (ex3_2 C T
455 (\lambda (_: C).(\lambda (v1: T).(subst0 i v v1 v2))) (\lambda (c1:
456 C).(\lambda (_: T).(csubst0 i v c1 c2))) (\lambda (c1: C).(\lambda (v1:
457 T).(eq C (CHead c k0 t) (CHead c1 (Bind b) v1))))))) (let H15 \def (f_equal
458 nat nat (\lambda (e: nat).(match e with [O \Rightarrow i | (S n) \Rightarrow
459 n])) (S i) (S x2) H14) in (let H16 \def (eq_ind_r nat x2 (\lambda (n:
460 nat).(csubst0 n v c c2)) H12 i H15) in (let H17 \def (eq_ind_r nat x2
461 (\lambda (n: nat).(subst0 n v t v2)) H13 i H15) in (or3_intro2 (ex2 T
462 (\lambda (v1: T).(subst0 i v v1 v2)) (\lambda (v1: T).(eq C (CHead c (Bind b)
463 t) (CHead c2 (Bind b) v1)))) (ex2 C (\lambda (c1: C).(csubst0 i v c1 c2))
464 (\lambda (c1: C).(eq C (CHead c (Bind b) t) (CHead c1 (Bind b) v2)))) (ex3_2
465 C T (\lambda (_: C).(\lambda (v1: T).(subst0 i v v1 v2))) (\lambda (c1:
466 C).(\lambda (_: T).(csubst0 i v c1 c2))) (\lambda (c1: C).(\lambda (v1:
467 T).(eq C (CHead c (Bind b) t) (CHead c1 (Bind b) v1))))) (ex3_2_intro C T
468 (\lambda (_: C).(\lambda (v1: T).(subst0 i v v1 v2))) (\lambda (c1:
469 C).(\lambda (_: T).(csubst0 i v c1 c2))) (\lambda (c1: C).(\lambda (v1:
470 T).(eq C (CHead c (Bind b) t) (CHead c1 (Bind b) v1)))) c t H17 H16
471 (refl_equal C (CHead c (Bind b) t))))))) k H10))))))) H8)) H7))))))))) H2))