]> matita.cs.unibo.it Git - helm.git/blob - matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/T/dec.ma
we removed about 100 match-with costruction turning them into applications
[helm.git] / matita / contribs / LAMBDA-TYPES / Level-1 / LambdaDelta / T / dec.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 (* This file was automatically generated: do not edit *********************)
16
17 set "baseuri" "cic:/matita/LAMBDA-TYPES/Level-1/LambdaDelta/T/dec".
18
19 include "T/defs.ma".
20
21 theorem terms_props__bind_dec:
22  \forall (b1: B).(\forall (b2: B).(or (eq B b1 b2) ((eq B b1 b2) \to (\forall 
23 (P: Prop).P))))
24 \def
25  \lambda (b1: B).(B_ind (\lambda (b: B).(\forall (b2: B).(or (eq B b b2) ((eq 
26 B b b2) \to (\forall (P: Prop).P))))) (\lambda (b2: B).(B_ind (\lambda (b: 
27 B).(or (eq B Abbr b) ((eq B Abbr b) \to (\forall (P: Prop).P)))) (or_introl 
28 (eq B Abbr Abbr) ((eq B Abbr Abbr) \to (\forall (P: Prop).P)) (refl_equal B 
29 Abbr)) (or_intror (eq B Abbr Abst) ((eq B Abbr Abst) \to (\forall (P: 
30 Prop).P)) (\lambda (H: (eq B Abbr Abst)).(\lambda (P: Prop).(let H0 \def 
31 (eq_ind B Abbr (\lambda (ee: B).(match ee in B return (\lambda (_: B).Prop) 
32 with [Abbr \Rightarrow True | Abst \Rightarrow False | Void \Rightarrow 
33 False])) I Abst H) in (False_ind P H0))))) (or_intror (eq B Abbr Void) ((eq B 
34 Abbr Void) \to (\forall (P: Prop).P)) (\lambda (H: (eq B Abbr Void)).(\lambda 
35 (P: Prop).(let H0 \def (eq_ind B Abbr (\lambda (ee: B).(match ee in B return 
36 (\lambda (_: B).Prop) with [Abbr \Rightarrow True | Abst \Rightarrow False | 
37 Void \Rightarrow False])) I Void H) in (False_ind P H0))))) b2)) (\lambda 
38 (b2: B).(B_ind (\lambda (b: B).(or (eq B Abst b) ((eq B Abst b) \to (\forall 
39 (P: Prop).P)))) (or_intror (eq B Abst Abbr) ((eq B Abst Abbr) \to (\forall 
40 (P: Prop).P)) (\lambda (H: (eq B Abst Abbr)).(\lambda (P: Prop).(let H0 \def 
41 (eq_ind B Abst (\lambda (ee: B).(match ee in B return (\lambda (_: B).Prop) 
42 with [Abbr \Rightarrow False | Abst \Rightarrow True | Void \Rightarrow 
43 False])) I Abbr H) in (False_ind P H0))))) (or_introl (eq B Abst Abst) ((eq B 
44 Abst Abst) \to (\forall (P: Prop).P)) (refl_equal B Abst)) (or_intror (eq B 
45 Abst Void) ((eq B Abst Void) \to (\forall (P: Prop).P)) (\lambda (H: (eq B 
46 Abst Void)).(\lambda (P: Prop).(let H0 \def (eq_ind B Abst (\lambda (ee: 
47 B).(match ee in B return (\lambda (_: B).Prop) with [Abbr \Rightarrow False | 
48 Abst \Rightarrow True | Void \Rightarrow False])) I Void H) in (False_ind P 
49 H0))))) b2)) (\lambda (b2: B).(B_ind (\lambda (b: B).(or (eq B Void b) ((eq B 
50 Void b) \to (\forall (P: Prop).P)))) (or_intror (eq B Void Abbr) ((eq B Void 
51 Abbr) \to (\forall (P: Prop).P)) (\lambda (H: (eq B Void Abbr)).(\lambda (P: 
52 Prop).(let H0 \def (eq_ind B Void (\lambda (ee: B).(match ee in B return 
53 (\lambda (_: B).Prop) with [Abbr \Rightarrow False | Abst \Rightarrow False | 
54 Void \Rightarrow True])) I Abbr H) in (False_ind P H0))))) (or_intror (eq B 
55 Void Abst) ((eq B Void Abst) \to (\forall (P: Prop).P)) (\lambda (H: (eq B 
56 Void Abst)).(\lambda (P: Prop).(let H0 \def (eq_ind B Void (\lambda (ee: 
57 B).(match ee in B return (\lambda (_: B).Prop) with [Abbr \Rightarrow False | 
58 Abst \Rightarrow False | Void \Rightarrow True])) I Abst H) in (False_ind P 
59 H0))))) (or_introl (eq B Void Void) ((eq B Void Void) \to (\forall (P: 
60 Prop).P)) (refl_equal B Void)) b2)) b1).
61
62 theorem terms_props__flat_dec:
63  \forall (f1: F).(\forall (f2: F).(or (eq F f1 f2) ((eq F f1 f2) \to (\forall 
64 (P: Prop).P))))
65 \def
66  \lambda (f1: F).(F_ind (\lambda (f: F).(\forall (f2: F).(or (eq F f f2) ((eq 
67 F f f2) \to (\forall (P: Prop).P))))) (\lambda (f2: F).(F_ind (\lambda (f: 
68 F).(or (eq F Appl f) ((eq F Appl f) \to (\forall (P: Prop).P)))) (or_introl 
69 (eq F Appl Appl) ((eq F Appl Appl) \to (\forall (P: Prop).P)) (refl_equal F 
70 Appl)) (or_intror (eq F Appl Cast) ((eq F Appl Cast) \to (\forall (P: 
71 Prop).P)) (\lambda (H: (eq F Appl Cast)).(\lambda (P: Prop).(let H0 \def 
72 (eq_ind F Appl (\lambda (ee: F).(match ee in F return (\lambda (_: F).Prop) 
73 with [Appl \Rightarrow True | Cast \Rightarrow False])) I Cast H) in 
74 (False_ind P H0))))) f2)) (\lambda (f2: F).(F_ind (\lambda (f: F).(or (eq F 
75 Cast f) ((eq F Cast f) \to (\forall (P: Prop).P)))) (or_intror (eq F Cast 
76 Appl) ((eq F Cast Appl) \to (\forall (P: Prop).P)) (\lambda (H: (eq F Cast 
77 Appl)).(\lambda (P: Prop).(let H0 \def (eq_ind F Cast (\lambda (ee: F).(match 
78 ee in F return (\lambda (_: F).Prop) with [Appl \Rightarrow False | Cast 
79 \Rightarrow True])) I Appl H) in (False_ind P H0))))) (or_introl (eq F Cast 
80 Cast) ((eq F Cast Cast) \to (\forall (P: Prop).P)) (refl_equal F Cast)) f2)) 
81 f1).
82
83 theorem terms_props__kind_dec:
84  \forall (k1: K).(\forall (k2: K).(or (eq K k1 k2) ((eq K k1 k2) \to (\forall 
85 (P: Prop).P))))
86 \def
87  \lambda (k1: K).(K_ind (\lambda (k: K).(\forall (k2: K).(or (eq K k k2) ((eq 
88 K k k2) \to (\forall (P: Prop).P))))) (\lambda (b: B).(\lambda (k2: K).(K_ind 
89 (\lambda (k: K).(or (eq K (Bind b) k) ((eq K (Bind b) k) \to (\forall (P: 
90 Prop).P)))) (\lambda (b0: B).(let H_x \def (terms_props__bind_dec b b0) in 
91 (let H \def H_x in (or_ind (eq B b b0) ((eq B b b0) \to (\forall (P: 
92 Prop).P)) (or (eq K (Bind b) (Bind b0)) ((eq K (Bind b) (Bind b0)) \to 
93 (\forall (P: Prop).P))) (\lambda (H0: (eq B b b0)).(eq_ind B b (\lambda (b1: 
94 B).(or (eq K (Bind b) (Bind b1)) ((eq K (Bind b) (Bind b1)) \to (\forall (P: 
95 Prop).P)))) (or_introl (eq K (Bind b) (Bind b)) ((eq K (Bind b) (Bind b)) \to 
96 (\forall (P: Prop).P)) (refl_equal K (Bind b))) b0 H0)) (\lambda (H0: (((eq B 
97 b b0) \to (\forall (P: Prop).P)))).(or_intror (eq K (Bind b) (Bind b0)) ((eq 
98 K (Bind b) (Bind b0)) \to (\forall (P: Prop).P)) (\lambda (H1: (eq K (Bind b) 
99 (Bind b0))).(\lambda (P: Prop).(let H2 \def (f_equal K B (\lambda (e: 
100 K).(match e in K return (\lambda (_: K).B) with [(Bind b1) \Rightarrow b1 | 
101 (Flat _) \Rightarrow b])) (Bind b) (Bind b0) H1) in (let H3 \def (eq_ind_r B 
102 b0 (\lambda (b1: B).((eq B b b1) \to (\forall (P0: Prop).P0))) H0 b H2) in 
103 (H3 (refl_equal B b) P))))))) H)))) (\lambda (f: F).(or_intror (eq K (Bind b) 
104 (Flat f)) ((eq K (Bind b) (Flat f)) \to (\forall (P: Prop).P)) (\lambda (H: 
105 (eq K (Bind b) (Flat f))).(\lambda (P: Prop).(let H0 \def (eq_ind K (Bind b) 
106 (\lambda (ee: K).(match ee in K return (\lambda (_: K).Prop) with [(Bind _) 
107 \Rightarrow True | (Flat _) \Rightarrow False])) I (Flat f) H) in (False_ind 
108 P H0)))))) k2))) (\lambda (f: F).(\lambda (k2: K).(K_ind (\lambda (k: K).(or 
109 (eq K (Flat f) k) ((eq K (Flat f) k) \to (\forall (P: Prop).P)))) (\lambda 
110 (b: B).(or_intror (eq K (Flat f) (Bind b)) ((eq K (Flat f) (Bind b)) \to 
111 (\forall (P: Prop).P)) (\lambda (H: (eq K (Flat f) (Bind b))).(\lambda (P: 
112 Prop).(let H0 \def (eq_ind K (Flat f) (\lambda (ee: K).(match ee in K return 
113 (\lambda (_: K).Prop) with [(Bind _) \Rightarrow False | (Flat _) \Rightarrow 
114 True])) I (Bind b) H) in (False_ind P H0)))))) (\lambda (f0: F).(let H_x \def 
115 (terms_props__flat_dec f f0) in (let H \def H_x in (or_ind (eq F f f0) ((eq F 
116 f f0) \to (\forall (P: Prop).P)) (or (eq K (Flat f) (Flat f0)) ((eq K (Flat 
117 f) (Flat f0)) \to (\forall (P: Prop).P))) (\lambda (H0: (eq F f f0)).(eq_ind 
118 F f (\lambda (f1: F).(or (eq K (Flat f) (Flat f1)) ((eq K (Flat f) (Flat f1)) 
119 \to (\forall (P: Prop).P)))) (or_introl (eq K (Flat f) (Flat f)) ((eq K (Flat 
120 f) (Flat f)) \to (\forall (P: Prop).P)) (refl_equal K (Flat f))) f0 H0)) 
121 (\lambda (H0: (((eq F f f0) \to (\forall (P: Prop).P)))).(or_intror (eq K 
122 (Flat f) (Flat f0)) ((eq K (Flat f) (Flat f0)) \to (\forall (P: Prop).P)) 
123 (\lambda (H1: (eq K (Flat f) (Flat f0))).(\lambda (P: Prop).(let H2 \def 
124 (f_equal K F (\lambda (e: K).(match e in K return (\lambda (_: K).F) with 
125 [(Bind _) \Rightarrow f | (Flat f1) \Rightarrow f1])) (Flat f) (Flat f0) H1) 
126 in (let H3 \def (eq_ind_r F f0 (\lambda (f1: F).((eq F f f1) \to (\forall 
127 (P0: Prop).P0))) H0 f H2) in (H3 (refl_equal F f) P))))))) H)))) k2))) k1).
128
129 theorem term_dec:
130  \forall (t1: T).(\forall (t2: T).(or (eq T t1 t2) ((eq T t1 t2) \to (\forall 
131 (P: Prop).P))))
132 \def
133  \lambda (t1: T).(T_ind (\lambda (t: T).(\forall (t2: T).(or (eq T t t2) ((eq 
134 T t t2) \to (\forall (P: Prop).P))))) (\lambda (n: nat).(\lambda (t2: 
135 T).(T_ind (\lambda (t: T).(or (eq T (TSort n) t) ((eq T (TSort n) t) \to 
136 (\forall (P: Prop).P)))) (\lambda (n0: nat).(let H_x \def (nat_dec n n0) in 
137 (let H \def H_x in (or_ind (eq nat n n0) ((eq nat n n0) \to (\forall (P: 
138 Prop).P)) (or (eq T (TSort n) (TSort n0)) ((eq T (TSort n) (TSort n0)) \to 
139 (\forall (P: Prop).P))) (\lambda (H0: (eq nat n n0)).(eq_ind nat n (\lambda 
140 (n1: nat).(or (eq T (TSort n) (TSort n1)) ((eq T (TSort n) (TSort n1)) \to 
141 (\forall (P: Prop).P)))) (or_introl (eq T (TSort n) (TSort n)) ((eq T (TSort 
142 n) (TSort n)) \to (\forall (P: Prop).P)) (refl_equal T (TSort n))) n0 H0)) 
143 (\lambda (H0: (((eq nat n n0) \to (\forall (P: Prop).P)))).(or_intror (eq T 
144 (TSort n) (TSort n0)) ((eq T (TSort n) (TSort n0)) \to (\forall (P: Prop).P)) 
145 (\lambda (H1: (eq T (TSort n) (TSort n0))).(\lambda (P: Prop).(let H2 \def 
146 (f_equal T nat (\lambda (e: T).(match e in T return (\lambda (_: T).nat) with 
147 [(TSort n1) \Rightarrow n1 | (TLRef _) \Rightarrow n | (THead _ _ _) 
148 \Rightarrow n])) (TSort n) (TSort n0) H1) in (let H3 \def (eq_ind_r nat n0 
149 (\lambda (n1: nat).((eq nat n n1) \to (\forall (P0: Prop).P0))) H0 n H2) in 
150 (H3 (refl_equal nat n) P))))))) H)))) (\lambda (n0: nat).(or_intror (eq T 
151 (TSort n) (TLRef n0)) ((eq T (TSort n) (TLRef n0)) \to (\forall (P: Prop).P)) 
152 (\lambda (H: (eq T (TSort n) (TLRef n0))).(\lambda (P: Prop).(let H0 \def 
153 (eq_ind T (TSort n) (\lambda (ee: T).(match ee in T return (\lambda (_: 
154 T).Prop) with [(TSort _) \Rightarrow True | (TLRef _) \Rightarrow False | 
155 (THead _ _ _) \Rightarrow False])) I (TLRef n0) H) in (False_ind P H0)))))) 
156 (\lambda (k: K).(\lambda (t: T).(\lambda (_: (or (eq T (TSort n) t) ((eq T 
157 (TSort n) t) \to (\forall (P: Prop).P)))).(\lambda (t0: T).(\lambda (_: (or 
158 (eq T (TSort n) t0) ((eq T (TSort n) t0) \to (\forall (P: 
159 Prop).P)))).(or_intror (eq T (TSort n) (THead k t t0)) ((eq T (TSort n) 
160 (THead k t t0)) \to (\forall (P: Prop).P)) (\lambda (H1: (eq T (TSort n) 
161 (THead k t t0))).(\lambda (P: Prop).(let H2 \def (eq_ind T (TSort n) (\lambda 
162 (ee: T).(match ee in T return (\lambda (_: T).Prop) with [(TSort _) 
163 \Rightarrow True | (TLRef _) \Rightarrow False | (THead _ _ _) \Rightarrow 
164 False])) I (THead k t t0) H1) in (False_ind P H2)))))))))) t2))) (\lambda (n: 
165 nat).(\lambda (t2: T).(T_ind (\lambda (t: T).(or (eq T (TLRef n) t) ((eq T 
166 (TLRef n) t) \to (\forall (P: Prop).P)))) (\lambda (n0: nat).(or_intror (eq T 
167 (TLRef n) (TSort n0)) ((eq T (TLRef n) (TSort n0)) \to (\forall (P: Prop).P)) 
168 (\lambda (H: (eq T (TLRef n) (TSort n0))).(\lambda (P: Prop).(let H0 \def 
169 (eq_ind T (TLRef n) (\lambda (ee: T).(match ee in T return (\lambda (_: 
170 T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) \Rightarrow True | 
171 (THead _ _ _) \Rightarrow False])) I (TSort n0) H) in (False_ind P H0)))))) 
172 (\lambda (n0: nat).(let H_x \def (nat_dec n n0) in (let H \def H_x in (or_ind 
173 (eq nat n n0) ((eq nat n n0) \to (\forall (P: Prop).P)) (or (eq T (TLRef n) 
174 (TLRef n0)) ((eq T (TLRef n) (TLRef n0)) \to (\forall (P: Prop).P))) (\lambda 
175 (H0: (eq nat n n0)).(eq_ind nat n (\lambda (n1: nat).(or (eq T (TLRef n) 
176 (TLRef n1)) ((eq T (TLRef n) (TLRef n1)) \to (\forall (P: Prop).P)))) 
177 (or_introl (eq T (TLRef n) (TLRef n)) ((eq T (TLRef n) (TLRef n)) \to 
178 (\forall (P: Prop).P)) (refl_equal T (TLRef n))) n0 H0)) (\lambda (H0: (((eq 
179 nat n n0) \to (\forall (P: Prop).P)))).(or_intror (eq T (TLRef n) (TLRef n0)) 
180 ((eq T (TLRef n) (TLRef n0)) \to (\forall (P: Prop).P)) (\lambda (H1: (eq T 
181 (TLRef n) (TLRef n0))).(\lambda (P: Prop).(let H2 \def (f_equal T nat 
182 (\lambda (e: T).(match e in T return (\lambda (_: T).nat) with [(TSort _) 
183 \Rightarrow n | (TLRef n1) \Rightarrow n1 | (THead _ _ _) \Rightarrow n])) 
184 (TLRef n) (TLRef n0) H1) in (let H3 \def (eq_ind_r nat n0 (\lambda (n1: 
185 nat).((eq nat n n1) \to (\forall (P0: Prop).P0))) H0 n H2) in (H3 (refl_equal 
186 nat n) P))))))) H)))) (\lambda (k: K).(\lambda (t: T).(\lambda (_: (or (eq T 
187 (TLRef n) t) ((eq T (TLRef n) t) \to (\forall (P: Prop).P)))).(\lambda (t0: 
188 T).(\lambda (_: (or (eq T (TLRef n) t0) ((eq T (TLRef n) t0) \to (\forall (P: 
189 Prop).P)))).(or_intror (eq T (TLRef n) (THead k t t0)) ((eq T (TLRef n) 
190 (THead k t t0)) \to (\forall (P: Prop).P)) (\lambda (H1: (eq T (TLRef n) 
191 (THead k t t0))).(\lambda (P: Prop).(let H2 \def (eq_ind T (TLRef n) (\lambda 
192 (ee: T).(match ee in T return (\lambda (_: T).Prop) with [(TSort _) 
193 \Rightarrow False | (TLRef _) \Rightarrow True | (THead _ _ _) \Rightarrow 
194 False])) I (THead k t t0) H1) in (False_ind P H2)))))))))) t2))) (\lambda (k: 
195 K).(\lambda (t: T).(\lambda (H: ((\forall (t2: T).(or (eq T t t2) ((eq T t 
196 t2) \to (\forall (P: Prop).P)))))).(\lambda (t0: T).(\lambda (H0: ((\forall 
197 (t2: T).(or (eq T t0 t2) ((eq T t0 t2) \to (\forall (P: 
198 Prop).P)))))).(\lambda (t2: T).(T_ind (\lambda (t3: T).(or (eq T (THead k t 
199 t0) t3) ((eq T (THead k t t0) t3) \to (\forall (P: Prop).P)))) (\lambda (n: 
200 nat).(or_intror (eq T (THead k t t0) (TSort n)) ((eq T (THead k t t0) (TSort 
201 n)) \to (\forall (P: Prop).P)) (\lambda (H1: (eq T (THead k t t0) (TSort 
202 n))).(\lambda (P: Prop).(let H2 \def (eq_ind T (THead k t t0) (\lambda (ee: 
203 T).(match ee in T return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow 
204 False | (TLRef _) \Rightarrow False | (THead _ _ _) \Rightarrow True])) I 
205 (TSort n) H1) in (False_ind P H2)))))) (\lambda (n: nat).(or_intror (eq T 
206 (THead k t t0) (TLRef n)) ((eq T (THead k t t0) (TLRef n)) \to (\forall (P: 
207 Prop).P)) (\lambda (H1: (eq T (THead k t t0) (TLRef n))).(\lambda (P: 
208 Prop).(let H2 \def (eq_ind T (THead k t t0) (\lambda (ee: T).(match ee in T 
209 return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) 
210 \Rightarrow False | (THead _ _ _) \Rightarrow True])) I (TLRef n) H1) in 
211 (False_ind P H2)))))) (\lambda (k0: K).(\lambda (t3: T).(\lambda (H1: (or (eq 
212 T (THead k t t0) t3) ((eq T (THead k t t0) t3) \to (\forall (P: 
213 Prop).P)))).(\lambda (t4: T).(\lambda (H2: (or (eq T (THead k t t0) t4) ((eq 
214 T (THead k t t0) t4) \to (\forall (P: Prop).P)))).(let H_x \def (H t3) in 
215 (let H3 \def H_x in (or_ind (eq T t t3) ((eq T t t3) \to (\forall (P: 
216 Prop).P)) (or (eq T (THead k t t0) (THead k0 t3 t4)) ((eq T (THead k t t0) 
217 (THead k0 t3 t4)) \to (\forall (P: Prop).P))) (\lambda (H4: (eq T t t3)).(let 
218 H5 \def (eq_ind_r T t3 (\lambda (t5: T).(or (eq T (THead k t t0) t5) ((eq T 
219 (THead k t t0) t5) \to (\forall (P: Prop).P)))) H1 t H4) in (eq_ind T t 
220 (\lambda (t5: T).(or (eq T (THead k t t0) (THead k0 t5 t4)) ((eq T (THead k t 
221 t0) (THead k0 t5 t4)) \to (\forall (P: Prop).P)))) (let H_x0 \def (H0 t4) in 
222 (let H6 \def H_x0 in (or_ind (eq T t0 t4) ((eq T t0 t4) \to (\forall (P: 
223 Prop).P)) (or (eq T (THead k t t0) (THead k0 t t4)) ((eq T (THead k t t0) 
224 (THead k0 t t4)) \to (\forall (P: Prop).P))) (\lambda (H7: (eq T t0 t4)).(let 
225 H8 \def (eq_ind_r T t4 (\lambda (t5: T).(or (eq T (THead k t t0) t5) ((eq T 
226 (THead k t t0) t5) \to (\forall (P: Prop).P)))) H2 t0 H7) in (eq_ind T t0 
227 (\lambda (t5: T).(or (eq T (THead k t t0) (THead k0 t t5)) ((eq T (THead k t 
228 t0) (THead k0 t t5)) \to (\forall (P: Prop).P)))) (let H_x1 \def 
229 (terms_props__kind_dec k k0) in (let H9 \def H_x1 in (or_ind (eq K k k0) ((eq 
230 K k k0) \to (\forall (P: Prop).P)) (or (eq T (THead k t t0) (THead k0 t t0)) 
231 ((eq T (THead k t t0) (THead k0 t t0)) \to (\forall (P: Prop).P))) (\lambda 
232 (H10: (eq K k k0)).(eq_ind K k (\lambda (k1: K).(or (eq T (THead k t t0) 
233 (THead k1 t t0)) ((eq T (THead k t t0) (THead k1 t t0)) \to (\forall (P: 
234 Prop).P)))) (or_introl (eq T (THead k t t0) (THead k t t0)) ((eq T (THead k t 
235 t0) (THead k t t0)) \to (\forall (P: Prop).P)) (refl_equal T (THead k t t0))) 
236 k0 H10)) (\lambda (H10: (((eq K k k0) \to (\forall (P: Prop).P)))).(or_intror 
237 (eq T (THead k t t0) (THead k0 t t0)) ((eq T (THead k t t0) (THead k0 t t0)) 
238 \to (\forall (P: Prop).P)) (\lambda (H11: (eq T (THead k t t0) (THead k0 t 
239 t0))).(\lambda (P: Prop).(let H12 \def (f_equal T K (\lambda (e: T).(match e 
240 in T return (\lambda (_: T).K) with [(TSort _) \Rightarrow k | (TLRef _) 
241 \Rightarrow k | (THead k1 _ _) \Rightarrow k1])) (THead k t t0) (THead k0 t 
242 t0) H11) in (let H13 \def (eq_ind_r K k0 (\lambda (k1: K).((eq K k k1) \to 
243 (\forall (P0: Prop).P0))) H10 k H12) in (H13 (refl_equal K k) P))))))) H9))) 
244 t4 H7))) (\lambda (H7: (((eq T t0 t4) \to (\forall (P: Prop).P)))).(or_intror 
245 (eq T (THead k t t0) (THead k0 t t4)) ((eq T (THead k t t0) (THead k0 t t4)) 
246 \to (\forall (P: Prop).P)) (\lambda (H8: (eq T (THead k t t0) (THead k0 t 
247 t4))).(\lambda (P: Prop).(let H9 \def (f_equal T K (\lambda (e: T).(match e 
248 in T return (\lambda (_: T).K) with [(TSort _) \Rightarrow k | (TLRef _) 
249 \Rightarrow k | (THead k1 _ _) \Rightarrow k1])) (THead k t t0) (THead k0 t 
250 t4) H8) in ((let H10 \def (f_equal T T (\lambda (e: T).(match e in T return 
251 (\lambda (_: T).T) with [(TSort _) \Rightarrow t0 | (TLRef _) \Rightarrow t0 
252 | (THead _ _ t5) \Rightarrow t5])) (THead k t t0) (THead k0 t t4) H8) in 
253 (\lambda (_: (eq K k k0)).(let H12 \def (eq_ind_r T t4 (\lambda (t5: T).((eq 
254 T t0 t5) \to (\forall (P0: Prop).P0))) H7 t0 H10) in (let H13 \def (eq_ind_r 
255 T t4 (\lambda (t5: T).(or (eq T (THead k t t0) t5) ((eq T (THead k t t0) t5) 
256 \to (\forall (P0: Prop).P0)))) H2 t0 H10) in (H12 (refl_equal T t0) P))))) 
257 H9)))))) H6))) t3 H4))) (\lambda (H4: (((eq T t t3) \to (\forall (P: 
258 Prop).P)))).(or_intror (eq T (THead k t t0) (THead k0 t3 t4)) ((eq T (THead k 
259 t t0) (THead k0 t3 t4)) \to (\forall (P: Prop).P)) (\lambda (H5: (eq T (THead 
260 k t t0) (THead k0 t3 t4))).(\lambda (P: Prop).(let H6 \def (f_equal T K 
261 (\lambda (e: T).(match e in T return (\lambda (_: T).K) with [(TSort _) 
262 \Rightarrow k | (TLRef _) \Rightarrow k | (THead k1 _ _) \Rightarrow k1])) 
263 (THead k t t0) (THead k0 t3 t4) H5) in ((let H7 \def (f_equal T T (\lambda 
264 (e: T).(match e in T return (\lambda (_: T).T) with [(TSort _) \Rightarrow t 
265 | (TLRef _) \Rightarrow t | (THead _ t5 _) \Rightarrow t5])) (THead k t t0) 
266 (THead k0 t3 t4) H5) in ((let H8 \def (f_equal T T (\lambda (e: T).(match e 
267 in T return (\lambda (_: T).T) with [(TSort _) \Rightarrow t0 | (TLRef _) 
268 \Rightarrow t0 | (THead _ _ t5) \Rightarrow t5])) (THead k t t0) (THead k0 t3 
269 t4) H5) in (\lambda (H9: (eq T t t3)).(\lambda (_: (eq K k k0)).(let H11 \def 
270 (eq_ind_r T t4 (\lambda (t5: T).(or (eq T (THead k t t0) t5) ((eq T (THead k 
271 t t0) t5) \to (\forall (P0: Prop).P0)))) H2 t0 H8) in (let H12 \def (eq_ind_r 
272 T t3 (\lambda (t5: T).((eq T t t5) \to (\forall (P0: Prop).P0))) H4 t H9) in 
273 (let H13 \def (eq_ind_r T t3 (\lambda (t5: T).(or (eq T (THead k t t0) t5) 
274 ((eq T (THead k t t0) t5) \to (\forall (P0: Prop).P0)))) H1 t H9) in (H12 
275 (refl_equal T t) P))))))) H7)) H6)))))) H3)))))))) t2))))))) t1).
276
277 theorem binder_dec:
278  \forall (t: T).(or (ex_3 B T T (\lambda (b: B).(\lambda (w: T).(\lambda (u: 
279 T).(eq T t (THead (Bind b) w u)))))) (\forall (b: B).(\forall (w: T).(\forall 
280 (u: T).((eq T t (THead (Bind b) w u)) \to (\forall (P: Prop).P))))))
281 \def
282  \lambda (t: T).(T_ind (\lambda (t0: T).(or (ex_3 B T T (\lambda (b: 
283 B).(\lambda (w: T).(\lambda (u: T).(eq T t0 (THead (Bind b) w u)))))) 
284 (\forall (b: B).(\forall (w: T).(\forall (u: T).((eq T t0 (THead (Bind b) w 
285 u)) \to (\forall (P: Prop).P))))))) (\lambda (n: nat).(or_intror (ex_3 B T T 
286 (\lambda (b: B).(\lambda (w: T).(\lambda (u: T).(eq T (TSort n) (THead (Bind 
287 b) w u)))))) (\forall (b: B).(\forall (w: T).(\forall (u: T).((eq T (TSort n) 
288 (THead (Bind b) w u)) \to (\forall (P: Prop).P))))) (\lambda (b: B).(\lambda 
289 (w: T).(\lambda (u: T).(\lambda (H: (eq T (TSort n) (THead (Bind b) w 
290 u))).(\lambda (P: Prop).(let H0 \def (eq_ind T (TSort n) (\lambda (ee: 
291 T).(match ee in T return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow 
292 True | (TLRef _) \Rightarrow False | (THead _ _ _) \Rightarrow False])) I 
293 (THead (Bind b) w u) H) in (False_ind P H0))))))))) (\lambda (n: 
294 nat).(or_intror (ex_3 B T T (\lambda (b: B).(\lambda (w: T).(\lambda (u: 
295 T).(eq T (TLRef n) (THead (Bind b) w u)))))) (\forall (b: B).(\forall (w: 
296 T).(\forall (u: T).((eq T (TLRef n) (THead (Bind b) w u)) \to (\forall (P: 
297 Prop).P))))) (\lambda (b: B).(\lambda (w: T).(\lambda (u: T).(\lambda (H: (eq 
298 T (TLRef n) (THead (Bind b) w u))).(\lambda (P: Prop).(let H0 \def (eq_ind T 
299 (TLRef n) (\lambda (ee: T).(match ee in T return (\lambda (_: T).Prop) with 
300 [(TSort _) \Rightarrow False | (TLRef _) \Rightarrow True | (THead _ _ _) 
301 \Rightarrow False])) I (THead (Bind b) w u) H) in (False_ind P H0))))))))) 
302 (\lambda (k: K).(K_ind (\lambda (k0: K).(\forall (t0: T).((or (ex_3 B T T 
303 (\lambda (b: B).(\lambda (w: T).(\lambda (u: T).(eq T t0 (THead (Bind b) w 
304 u)))))) (\forall (b: B).(\forall (w: T).(\forall (u: T).((eq T t0 (THead 
305 (Bind b) w u)) \to (\forall (P: Prop).P)))))) \to (\forall (t1: T).((or (ex_3 
306 B T T (\lambda (b: B).(\lambda (w: T).(\lambda (u: T).(eq T t1 (THead (Bind 
307 b) w u)))))) (\forall (b: B).(\forall (w: T).(\forall (u: T).((eq T t1 (THead 
308 (Bind b) w u)) \to (\forall (P: Prop).P)))))) \to (or (ex_3 B T T (\lambda 
309 (b: B).(\lambda (w: T).(\lambda (u: T).(eq T (THead k0 t0 t1) (THead (Bind b) 
310 w u)))))) (\forall (b: B).(\forall (w: T).(\forall (u: T).((eq T (THead k0 t0 
311 t1) (THead (Bind b) w u)) \to (\forall (P: Prop).P))))))))))) (\lambda (b: 
312 B).(\lambda (t0: T).(\lambda (_: (or (ex_3 B T T (\lambda (b0: B).(\lambda 
313 (w: T).(\lambda (u: T).(eq T t0 (THead (Bind b0) w u)))))) (\forall (b0: 
314 B).(\forall (w: T).(\forall (u: T).((eq T t0 (THead (Bind b0) w u)) \to 
315 (\forall (P: Prop).P))))))).(\lambda (t1: T).(\lambda (_: (or (ex_3 B T T 
316 (\lambda (b0: B).(\lambda (w: T).(\lambda (u: T).(eq T t1 (THead (Bind b0) w 
317 u)))))) (\forall (b0: B).(\forall (w: T).(\forall (u: T).((eq T t1 (THead 
318 (Bind b0) w u)) \to (\forall (P: Prop).P))))))).(or_introl (ex_3 B T T 
319 (\lambda (b0: B).(\lambda (w: T).(\lambda (u: T).(eq T (THead (Bind b) t0 t1) 
320 (THead (Bind b0) w u)))))) (\forall (b0: B).(\forall (w: T).(\forall (u: 
321 T).((eq T (THead (Bind b) t0 t1) (THead (Bind b0) w u)) \to (\forall (P: 
322 Prop).P))))) (ex_3_intro B T T (\lambda (b0: B).(\lambda (w: T).(\lambda (u: 
323 T).(eq T (THead (Bind b) t0 t1) (THead (Bind b0) w u))))) b t0 t1 (refl_equal 
324 T (THead (Bind b) t0 t1))))))))) (\lambda (f: F).(\lambda (t0: T).(\lambda 
325 (_: (or (ex_3 B T T (\lambda (b: B).(\lambda (w: T).(\lambda (u: T).(eq T t0 
326 (THead (Bind b) w u)))))) (\forall (b: B).(\forall (w: T).(\forall (u: 
327 T).((eq T t0 (THead (Bind b) w u)) \to (\forall (P: Prop).P))))))).(\lambda 
328 (t1: T).(\lambda (_: (or (ex_3 B T T (\lambda (b: B).(\lambda (w: T).(\lambda 
329 (u: T).(eq T t1 (THead (Bind b) w u)))))) (\forall (b: B).(\forall (w: 
330 T).(\forall (u: T).((eq T t1 (THead (Bind b) w u)) \to (\forall (P: 
331 Prop).P))))))).(or_intror (ex_3 B T T (\lambda (b: B).(\lambda (w: 
332 T).(\lambda (u: T).(eq T (THead (Flat f) t0 t1) (THead (Bind b) w u)))))) 
333 (\forall (b: B).(\forall (w: T).(\forall (u: T).((eq T (THead (Flat f) t0 t1) 
334 (THead (Bind b) w u)) \to (\forall (P: Prop).P))))) (\lambda (b: B).(\lambda 
335 (w: T).(\lambda (u: T).(\lambda (H1: (eq T (THead (Flat f) t0 t1) (THead 
336 (Bind b) w u))).(\lambda (P: Prop).(let H2 \def (eq_ind T (THead (Flat f) t0 
337 t1) (\lambda (ee: T).(match ee in T return (\lambda (_: T).Prop) with [(TSort 
338 _) \Rightarrow False | (TLRef _) \Rightarrow False | (THead k0 _ _) 
339 \Rightarrow (match k0 in K return (\lambda (_: K).Prop) with [(Bind _) 
340 \Rightarrow False | (Flat _) \Rightarrow True])])) I (THead (Bind b) w u) H1) 
341 in (False_ind P H2))))))))))))) k)) t).
342
343 theorem abst_dec:
344  \forall (u: T).(\forall (v: T).(or (ex T (\lambda (t: T).(eq T u (THead 
345 (Bind Abst) v t)))) (\forall (t: T).((eq T u (THead (Bind Abst) v t)) \to 
346 (\forall (P: Prop).P)))))
347 \def
348  \lambda (u: T).(T_ind (\lambda (t: T).(\forall (v: T).(or (ex T (\lambda 
349 (t0: T).(eq T t (THead (Bind Abst) v t0)))) (\forall (t0: T).((eq T t (THead 
350 (Bind Abst) v t0)) \to (\forall (P: Prop).P)))))) (\lambda (n: nat).(\lambda 
351 (v: T).(or_intror (ex T (\lambda (t: T).(eq T (TSort n) (THead (Bind Abst) v 
352 t)))) (\forall (t: T).((eq T (TSort n) (THead (Bind Abst) v t)) \to (\forall 
353 (P: Prop).P))) (\lambda (t: T).(\lambda (H: (eq T (TSort n) (THead (Bind 
354 Abst) v t))).(\lambda (P: Prop).(let H0 \def (eq_ind T (TSort n) (\lambda 
355 (ee: T).(match ee in T return (\lambda (_: T).Prop) with [(TSort _) 
356 \Rightarrow True | (TLRef _) \Rightarrow False | (THead _ _ _) \Rightarrow 
357 False])) I (THead (Bind Abst) v t) H) in (False_ind P H0)))))))) (\lambda (n: 
358 nat).(\lambda (v: T).(or_intror (ex T (\lambda (t: T).(eq T (TLRef n) (THead 
359 (Bind Abst) v t)))) (\forall (t: T).((eq T (TLRef n) (THead (Bind Abst) v t)) 
360 \to (\forall (P: Prop).P))) (\lambda (t: T).(\lambda (H: (eq T (TLRef n) 
361 (THead (Bind Abst) v t))).(\lambda (P: Prop).(let H0 \def (eq_ind T (TLRef n) 
362 (\lambda (ee: T).(match ee in T return (\lambda (_: T).Prop) with [(TSort _) 
363 \Rightarrow False | (TLRef _) \Rightarrow True | (THead _ _ _) \Rightarrow 
364 False])) I (THead (Bind Abst) v t) H) in (False_ind P H0)))))))) (\lambda (k: 
365 K).(\lambda (t: T).(\lambda (_: ((\forall (v: T).(or (ex T (\lambda (t0: 
366 T).(eq T t (THead (Bind Abst) v t0)))) (\forall (t0: T).((eq T t (THead (Bind 
367 Abst) v t0)) \to (\forall (P: Prop).P))))))).(\lambda (t0: T).(\lambda (_: 
368 ((\forall (v: T).(or (ex T (\lambda (t1: T).(eq T t0 (THead (Bind Abst) v 
369 t1)))) (\forall (t1: T).((eq T t0 (THead (Bind Abst) v t1)) \to (\forall (P: 
370 Prop).P))))))).(\lambda (v: T).(let H_x \def (terms_props__kind_dec k (Bind 
371 Abst)) in (let H1 \def H_x in (or_ind (eq K k (Bind Abst)) ((eq K k (Bind 
372 Abst)) \to (\forall (P: Prop).P)) (or (ex T (\lambda (t1: T).(eq T (THead k t 
373 t0) (THead (Bind Abst) v t1)))) (\forall (t1: T).((eq T (THead k t t0) (THead 
374 (Bind Abst) v t1)) \to (\forall (P: Prop).P)))) (\lambda (H2: (eq K k (Bind 
375 Abst))).(eq_ind_r K (Bind Abst) (\lambda (k0: K).(or (ex T (\lambda (t1: 
376 T).(eq T (THead k0 t t0) (THead (Bind Abst) v t1)))) (\forall (t1: T).((eq T 
377 (THead k0 t t0) (THead (Bind Abst) v t1)) \to (\forall (P: Prop).P))))) (let 
378 H_x0 \def (term_dec t v) in (let H3 \def H_x0 in (or_ind (eq T t v) ((eq T t 
379 v) \to (\forall (P: Prop).P)) (or (ex T (\lambda (t1: T).(eq T (THead (Bind 
380 Abst) t t0) (THead (Bind Abst) v t1)))) (\forall (t1: T).((eq T (THead (Bind 
381 Abst) t t0) (THead (Bind Abst) v t1)) \to (\forall (P: Prop).P)))) (\lambda 
382 (H4: (eq T t v)).(eq_ind T t (\lambda (t1: T).(or (ex T (\lambda (t2: T).(eq 
383 T (THead (Bind Abst) t t0) (THead (Bind Abst) t1 t2)))) (\forall (t2: T).((eq 
384 T (THead (Bind Abst) t t0) (THead (Bind Abst) t1 t2)) \to (\forall (P: 
385 Prop).P))))) (or_introl (ex T (\lambda (t1: T).(eq T (THead (Bind Abst) t t0) 
386 (THead (Bind Abst) t t1)))) (\forall (t1: T).((eq T (THead (Bind Abst) t t0) 
387 (THead (Bind Abst) t t1)) \to (\forall (P: Prop).P))) (ex_intro T (\lambda 
388 (t1: T).(eq T (THead (Bind Abst) t t0) (THead (Bind Abst) t t1))) t0 
389 (refl_equal T (THead (Bind Abst) t t0)))) v H4)) (\lambda (H4: (((eq T t v) 
390 \to (\forall (P: Prop).P)))).(or_intror (ex T (\lambda (t1: T).(eq T (THead 
391 (Bind Abst) t t0) (THead (Bind Abst) v t1)))) (\forall (t1: T).((eq T (THead 
392 (Bind Abst) t t0) (THead (Bind Abst) v t1)) \to (\forall (P: Prop).P))) 
393 (\lambda (t1: T).(\lambda (H5: (eq T (THead (Bind Abst) t t0) (THead (Bind 
394 Abst) v t1))).(\lambda (P: Prop).(let H6 \def (f_equal T T (\lambda (e: 
395 T).(match e in T return (\lambda (_: T).T) with [(TSort _) \Rightarrow t | 
396 (TLRef _) \Rightarrow t | (THead _ t2 _) \Rightarrow t2])) (THead (Bind Abst) 
397 t t0) (THead (Bind Abst) v t1) H5) in ((let H7 \def (f_equal T T (\lambda (e: 
398 T).(match e in T return (\lambda (_: T).T) with [(TSort _) \Rightarrow t0 | 
399 (TLRef _) \Rightarrow t0 | (THead _ _ t2) \Rightarrow t2])) (THead (Bind 
400 Abst) t t0) (THead (Bind Abst) v t1) H5) in (\lambda (H8: (eq T t v)).(H4 H8 
401 P))) H6))))))) H3))) k H2)) (\lambda (H2: (((eq K k (Bind Abst)) \to (\forall 
402 (P: Prop).P)))).(or_intror (ex T (\lambda (t1: T).(eq T (THead k t t0) (THead 
403 (Bind Abst) v t1)))) (\forall (t1: T).((eq T (THead k t t0) (THead (Bind 
404 Abst) v t1)) \to (\forall (P: Prop).P))) (\lambda (t1: T).(\lambda (H3: (eq T 
405 (THead k t t0) (THead (Bind Abst) v t1))).(\lambda (P: Prop).(let H4 \def 
406 (f_equal T K (\lambda (e: T).(match e in T return (\lambda (_: T).K) with 
407 [(TSort _) \Rightarrow k | (TLRef _) \Rightarrow k | (THead k0 _ _) 
408 \Rightarrow k0])) (THead k t t0) (THead (Bind Abst) v t1) H3) in ((let H5 
409 \def (f_equal T T (\lambda (e: T).(match e in T return (\lambda (_: T).T) 
410 with [(TSort _) \Rightarrow t | (TLRef _) \Rightarrow t | (THead _ t2 _) 
411 \Rightarrow t2])) (THead k t t0) (THead (Bind Abst) v t1) H3) in ((let H6 
412 \def (f_equal T T (\lambda (e: T).(match e in T return (\lambda (_: T).T) 
413 with [(TSort _) \Rightarrow t0 | (TLRef _) \Rightarrow t0 | (THead _ _ t2) 
414 \Rightarrow t2])) (THead k t t0) (THead (Bind Abst) v t1) H3) in (\lambda (_: 
415 (eq T t v)).(\lambda (H8: (eq K k (Bind Abst))).(H2 H8 P)))) H5)) H4))))))) 
416 H1))))))))) u).
417