From: Ferruccio Guidi Date: Sat, 9 Dec 2006 16:21:32 +0000 (+0000) Subject: we exported some inversors from coq X-Git-Tag: 0.4.95@7852~739 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=4216d3e6b09d1be8784ee9394f6c7f5aed4300a7;p=helm.git we exported some inversors from coq --- diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/csubt/fwd.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/csubt/fwd.ma index 14a5c05ec..9d5e136cf 100644 --- a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/csubt/fwd.ma +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/csubt/fwd.ma @@ -18,25 +18,372 @@ set "baseuri" "cic:/matita/LAMBDA-TYPES/Level-1/LambdaDelta/csubt/fwd". include "csubt/defs.ma". -axiom csubt_gen_abbr: +theorem csubt_inv_coq: + \forall (g: G).(\forall (c1: C).(\forall (c2: C).(\forall (P: ((G \to (C \to +(C \to Prop))))).((((csubt g c1 c2) \to (\forall (n: nat).((eq C (CSort n) +c1) \to ((eq C (CSort n) c2) \to (P g c1 c2)))))) \to ((((csubt g c1 c2) \to +(\forall (c0: C).(\forall (c3: C).(\forall (k: K).(\forall (u: T).((eq C +(CHead c0 k u) c1) \to ((eq C (CHead c3 k u) c2) \to ((csubt g c0 c3) \to (P +g c1 c2)))))))))) \to ((((csubt g c1 c2) \to (\forall (c0: C).(\forall (c3: +C).(\forall (b: B).(\forall (u1: T).(\forall (u2: T).((eq C (CHead c0 (Bind +Void) u1) c1) \to ((eq C (CHead c3 (Bind b) u2) c2) \to ((csubt g c0 c3) \to +((not (eq B b Void)) \to (P g c1 c2)))))))))))) \to ((((csubt g c1 c2) \to +(\forall (c0: C).(\forall (c3: C).(\forall (u: T).(\forall (t: T).((eq C +(CHead c0 (Bind Abst) t) c1) \to ((eq C (CHead c3 (Bind Abbr) u) c2) \to +((csubt g c0 c3) \to ((ty3 g c3 u t) \to (P g c1 c2))))))))))) \to ((csubt g +c1 c2) \to (P g c1 c2))))))))) +\def + \lambda (g: G).(\lambda (c1: C).(\lambda (c2: C).(\lambda (P: ((G \to (C \to +(C \to Prop))))).(\lambda (H: (((csubt g c1 c2) \to (\forall (n: nat).((eq C +(CSort n) c1) \to ((eq C (CSort n) c2) \to (P g c1 c2))))))).(\lambda (H0: +(((csubt g c1 c2) \to (\forall (c0: C).(\forall (c3: C).(\forall (k: +K).(\forall (u: T).((eq C (CHead c0 k u) c1) \to ((eq C (CHead c3 k u) c2) +\to ((csubt g c0 c3) \to (P g c1 c2))))))))))).(\lambda (H1: (((csubt g c1 +c2) \to (\forall (c0: C).(\forall (c3: C).(\forall (b: B).(\forall (u1: +T).(\forall (u2: T).((eq C (CHead c0 (Bind Void) u1) c1) \to ((eq C (CHead c3 +(Bind b) u2) c2) \to ((csubt g c0 c3) \to ((not (eq B b Void)) \to (P g c1 +c2))))))))))))).(\lambda (H2: (((csubt g c1 c2) \to (\forall (c0: C).(\forall +(c3: C).(\forall (u: T).(\forall (t: T).((eq C (CHead c0 (Bind Abst) t) c1) +\to ((eq C (CHead c3 (Bind Abbr) u) c2) \to ((csubt g c0 c3) \to ((ty3 g c3 u +t) \to (P g c1 c2)))))))))))).(\lambda (H3: (csubt g c1 c2)).(let H4 \def +(match H3 in csubt return (\lambda (c: C).(\lambda (c0: C).(\lambda (_: +(csubt ? c c0)).((eq C c c1) \to ((eq C c0 c2) \to (P g c1 c2)))))) with +[(csubt_sort n) \Rightarrow (\lambda (H4: (eq C (CSort n) c1)).(\lambda (H5: +(eq C (CSort n) c2)).(H H3 n H4 H5))) | (csubt_head c0 c3 H4 k u) \Rightarrow +(\lambda (H5: (eq C (CHead c0 k u) c1)).(\lambda (H6: (eq C (CHead c3 k u) +c2)).(H0 H3 c0 c3 k u H5 H6 H4))) | (csubt_void c0 c3 H4 b H5 u1 u2) +\Rightarrow (\lambda (H6: (eq C (CHead c0 (Bind Void) u1) c1)).(\lambda (H7: +(eq C (CHead c3 (Bind b) u2) c2)).(H1 H3 c0 c3 b u1 u2 H6 H7 H4 H5))) | +(csubt_abst c0 c3 H4 u t H5) \Rightarrow (\lambda (H6: (eq C (CHead c0 (Bind +Abst) t) c1)).(\lambda (H7: (eq C (CHead c3 (Bind Abbr) u) c2)).(H2 H3 c0 c3 +u t H6 H7 H4 H5)))]) in (H4 (refl_equal C c1) (refl_equal C c2))))))))))). + +theorem csubt_gen_abbr: \forall (g: G).(\forall (e1: C).(\forall (c2: C).(\forall (v: T).((csubt g (CHead e1 (Bind Abbr) v) c2) \to (ex2 C (\lambda (e2: C).(eq C c2 (CHead e2 (Bind Abbr) v))) (\lambda (e2: C).(csubt g e1 e2))))))) -. +\def + \lambda (g: G).(\lambda (e1: C).(\lambda (c2: C).(\lambda (v: T).(\lambda +(H: (csubt g (CHead e1 (Bind Abbr) v) c2)).(csubt_inv_coq g (CHead e1 (Bind +Abbr) v) c2 (\lambda (g0: G).(\lambda (_: C).(\lambda (c0: C).(ex2 C (\lambda +(e2: C).(eq C c0 (CHead e2 (Bind Abbr) v))) (\lambda (e2: C).(csubt g0 e1 +e2)))))) (\lambda (H0: (csubt g (CHead e1 (Bind Abbr) v) c2)).(\lambda (n: +nat).(\lambda (H1: (eq C (CSort n) (CHead e1 (Bind Abbr) v))).(\lambda (H2: +(eq C (CSort n) c2)).(let H3 \def (eq_ind_r C c2 (\lambda (c: C).(csubt g +(CHead e1 (Bind Abbr) v) c)) H0 (CSort n) H2) in (let H4 \def (eq_ind_r C c2 +(\lambda (c: C).(csubt g (CHead e1 (Bind Abbr) v) c)) H (CSort n) H2) in +(eq_ind C (CSort n) (\lambda (c: C).(ex2 C (\lambda (e2: C).(eq C c (CHead e2 +(Bind Abbr) v))) (\lambda (e2: C).(csubt g e1 e2)))) (let H5 \def (eq_ind C +(CSort n) (\lambda (ee: C).(match ee in C return (\lambda (_: C).Prop) with +[(CSort _) \Rightarrow True | (CHead _ _ _) \Rightarrow False])) I (CHead e1 +(Bind Abbr) v) H1) in (False_ind (ex2 C (\lambda (e2: C).(eq C (CSort n) +(CHead e2 (Bind Abbr) v))) (\lambda (e2: C).(csubt g e1 e2))) H5)) c2 +H2))))))) (\lambda (H0: (csubt g (CHead e1 (Bind Abbr) v) c2)).(\lambda (c0: +C).(\lambda (c3: C).(\lambda (k: K).(\lambda (u: T).(\lambda (H1: (eq C +(CHead c0 k u) (CHead e1 (Bind Abbr) v))).(\lambda (H2: (eq C (CHead c3 k u) +c2)).(\lambda (H3: (csubt g c0 c3)).(let H4 \def (eq_ind_r C c2 (\lambda (c: +C).(csubt g (CHead e1 (Bind Abbr) v) c)) H0 (CHead c3 k u) H2) in (let H5 +\def (eq_ind_r C c2 (\lambda (c: C).(csubt g (CHead e1 (Bind Abbr) v) c)) H +(CHead c3 k u) H2) in (eq_ind C (CHead c3 k u) (\lambda (c: C).(ex2 C +(\lambda (e2: C).(eq C c (CHead e2 (Bind Abbr) v))) (\lambda (e2: C).(csubt g +e1 e2)))) (let H6 \def (f_equal C C (\lambda (e: C).(match e in C return +(\lambda (_: C).C) with [(CSort _) \Rightarrow c0 | (CHead c _ _) \Rightarrow +c])) (CHead c0 k u) (CHead e1 (Bind Abbr) v) H1) in ((let H7 \def (f_equal C +K (\lambda (e: C).(match e in C return (\lambda (_: C).K) with [(CSort _) +\Rightarrow k | (CHead _ k0 _) \Rightarrow k0])) (CHead c0 k u) (CHead e1 +(Bind Abbr) v) H1) in ((let H8 \def (f_equal C T (\lambda (e: C).(match e in +C return (\lambda (_: C).T) with [(CSort _) \Rightarrow u | (CHead _ _ t) +\Rightarrow t])) (CHead c0 k u) (CHead e1 (Bind Abbr) v) H1) in (\lambda (H9: +(eq K k (Bind Abbr))).(\lambda (H10: (eq C c0 e1)).(let H11 \def (eq_ind T u +(\lambda (t: T).(csubt g (CHead e1 (Bind Abbr) v) (CHead c3 k t))) H5 v H8) +in (let H12 \def (eq_ind T u (\lambda (t: T).(csubt g (CHead e1 (Bind Abbr) +v) (CHead c3 k t))) H4 v H8) in (eq_ind_r T v (\lambda (t: T).(ex2 C (\lambda +(e2: C).(eq C (CHead c3 k t) (CHead e2 (Bind Abbr) v))) (\lambda (e2: +C).(csubt g e1 e2)))) (let H13 \def (eq_ind K k (\lambda (k0: K).(csubt g +(CHead e1 (Bind Abbr) v) (CHead c3 k0 v))) H11 (Bind Abbr) H9) in (let H14 +\def (eq_ind K k (\lambda (k0: K).(csubt g (CHead e1 (Bind Abbr) v) (CHead c3 +k0 v))) H12 (Bind Abbr) H9) in (eq_ind_r K (Bind Abbr) (\lambda (k0: K).(ex2 +C (\lambda (e2: C).(eq C (CHead c3 k0 v) (CHead e2 (Bind Abbr) v))) (\lambda +(e2: C).(csubt g e1 e2)))) (let H15 \def (eq_ind C c0 (\lambda (c: C).(csubt +g c c3)) H3 e1 H10) in (ex_intro2 C (\lambda (e2: C).(eq C (CHead c3 (Bind +Abbr) v) (CHead e2 (Bind Abbr) v))) (\lambda (e2: C).(csubt g e1 e2)) c3 +(refl_equal C (CHead c3 (Bind Abbr) v)) H15)) k H9))) u H8)))))) H7)) H6)) c2 +H2))))))))))) (\lambda (H0: (csubt g (CHead e1 (Bind Abbr) v) c2)).(\lambda +(c0: C).(\lambda (c3: C).(\lambda (b: B).(\lambda (u1: T).(\lambda (u2: +T).(\lambda (H2: (eq C (CHead c0 (Bind Void) u1) (CHead e1 (Bind Abbr) +v))).(\lambda (H3: (eq C (CHead c3 (Bind b) u2) c2)).(\lambda (_: (csubt g c0 +c3)).(\lambda (_: (not (eq B b Void))).(let H5 \def (eq_ind_r C c2 (\lambda +(c: C).(csubt g (CHead e1 (Bind Abbr) v) c)) H0 (CHead c3 (Bind b) u2) H3) in +(let H6 \def (eq_ind_r C c2 (\lambda (c: C).(csubt g (CHead e1 (Bind Abbr) v) +c)) H (CHead c3 (Bind b) u2) H3) in (eq_ind C (CHead c3 (Bind b) u2) (\lambda +(c: C).(ex2 C (\lambda (e2: C).(eq C c (CHead e2 (Bind Abbr) v))) (\lambda +(e2: C).(csubt g e1 e2)))) (let H7 \def (eq_ind C (CHead c0 (Bind Void) u1) +(\lambda (ee: C).(match ee in C return (\lambda (_: C).Prop) with [(CSort _) +\Rightarrow False | (CHead _ k _) \Rightarrow (match k in K return (\lambda +(_: K).Prop) with [(Bind b0) \Rightarrow (match b0 in B return (\lambda (_: +B).Prop) with [Abbr \Rightarrow False | Abst \Rightarrow False | Void +\Rightarrow True]) | (Flat _) \Rightarrow False])])) I (CHead e1 (Bind Abbr) +v) H2) in (False_ind (ex2 C (\lambda (e2: C).(eq C (CHead c3 (Bind b) u2) +(CHead e2 (Bind Abbr) v))) (\lambda (e2: C).(csubt g e1 e2))) H7)) c2 +H3))))))))))))) (\lambda (H0: (csubt g (CHead e1 (Bind Abbr) v) c2)).(\lambda +(c0: C).(\lambda (c3: C).(\lambda (u: T).(\lambda (t: T).(\lambda (H2: (eq C +(CHead c0 (Bind Abst) t) (CHead e1 (Bind Abbr) v))).(\lambda (H3: (eq C +(CHead c3 (Bind Abbr) u) c2)).(\lambda (_: (csubt g c0 c3)).(\lambda (_: (ty3 +g c3 u t)).(let H5 \def (eq_ind_r C c2 (\lambda (c: C).(csubt g (CHead e1 +(Bind Abbr) v) c)) H0 (CHead c3 (Bind Abbr) u) H3) in (let H6 \def (eq_ind_r +C c2 (\lambda (c: C).(csubt g (CHead e1 (Bind Abbr) v) c)) H (CHead c3 (Bind +Abbr) u) H3) in (eq_ind C (CHead c3 (Bind Abbr) u) (\lambda (c: C).(ex2 C +(\lambda (e2: C).(eq C c (CHead e2 (Bind Abbr) v))) (\lambda (e2: C).(csubt g +e1 e2)))) (let H7 \def (eq_ind C (CHead c0 (Bind Abst) t) (\lambda (ee: +C).(match ee in C return (\lambda (_: C).Prop) with [(CSort _) \Rightarrow +False | (CHead _ k _) \Rightarrow (match k in K return (\lambda (_: K).Prop) +with [(Bind b) \Rightarrow (match b in B return (\lambda (_: B).Prop) with +[Abbr \Rightarrow False | Abst \Rightarrow True | Void \Rightarrow False]) | +(Flat _) \Rightarrow False])])) I (CHead e1 (Bind Abbr) v) H2) in (False_ind +(ex2 C (\lambda (e2: C).(eq C (CHead c3 (Bind Abbr) u) (CHead e2 (Bind Abbr) +v))) (\lambda (e2: C).(csubt g e1 e2))) H7)) c2 H3)))))))))))) H))))). -axiom csubt_gen_abst: +theorem csubt_gen_abst: \forall (g: G).(\forall (e1: C).(\forall (c2: C).(\forall (v1: T).((csubt g (CHead e1 (Bind Abst) v1) c2) \to (or (ex2 C (\lambda (e2: C).(eq C c2 (CHead e2 (Bind Abst) v1))) (\lambda (e2: C).(csubt g e1 e2))) (ex3_2 C T (\lambda (e2: C).(\lambda (v2: T).(eq C c2 (CHead e2 (Bind Abbr) v2)))) (\lambda (e2: C).(\lambda (_: T).(csubt g e1 e2))) (\lambda (e2: C).(\lambda (v2: T).(ty3 g e2 v2 v1))))))))) -. +\def + \lambda (g: G).(\lambda (e1: C).(\lambda (c2: C).(\lambda (v1: T).(\lambda +(H: (csubt g (CHead e1 (Bind Abst) v1) c2)).(csubt_inv_coq g (CHead e1 (Bind +Abst) v1) c2 (\lambda (g0: G).(\lambda (_: C).(\lambda (c0: C).(or (ex2 C +(\lambda (e2: C).(eq C c0 (CHead e2 (Bind Abst) v1))) (\lambda (e2: C).(csubt +g0 e1 e2))) (ex3_2 C T (\lambda (e2: C).(\lambda (v2: T).(eq C c0 (CHead e2 +(Bind Abbr) v2)))) (\lambda (e2: C).(\lambda (_: T).(csubt g0 e1 e2))) +(\lambda (e2: C).(\lambda (v2: T).(ty3 g0 e2 v2 v1)))))))) (\lambda (H0: +(csubt g (CHead e1 (Bind Abst) v1) c2)).(\lambda (n: nat).(\lambda (H1: (eq C +(CSort n) (CHead e1 (Bind Abst) v1))).(\lambda (H2: (eq C (CSort n) c2)).(let +H3 \def (eq_ind_r C c2 (\lambda (c: C).(csubt g (CHead e1 (Bind Abst) v1) c)) +H0 (CSort n) H2) in (let H4 \def (eq_ind_r C c2 (\lambda (c: C).(csubt g +(CHead e1 (Bind Abst) v1) c)) H (CSort n) H2) in (eq_ind C (CSort n) (\lambda +(c: C).(or (ex2 C (\lambda (e2: C).(eq C c (CHead e2 (Bind Abst) v1))) +(\lambda (e2: C).(csubt g e1 e2))) (ex3_2 C T (\lambda (e2: C).(\lambda (v2: +T).(eq C c (CHead e2 (Bind Abbr) v2)))) (\lambda (e2: C).(\lambda (_: +T).(csubt g e1 e2))) (\lambda (e2: C).(\lambda (v2: T).(ty3 g e2 v2 v1)))))) +(let H5 \def (eq_ind C (CSort n) (\lambda (ee: C).(match ee in C return +(\lambda (_: C).Prop) with [(CSort _) \Rightarrow True | (CHead _ _ _) +\Rightarrow False])) I (CHead e1 (Bind Abst) v1) H1) in (False_ind (or (ex2 C +(\lambda (e2: C).(eq C (CSort n) (CHead e2 (Bind Abst) v1))) (\lambda (e2: +C).(csubt g e1 e2))) (ex3_2 C T (\lambda (e2: C).(\lambda (v2: T).(eq C +(CSort n) (CHead e2 (Bind Abbr) v2)))) (\lambda (e2: C).(\lambda (_: +T).(csubt g e1 e2))) (\lambda (e2: C).(\lambda (v2: T).(ty3 g e2 v2 v1))))) +H5)) c2 H2))))))) (\lambda (H0: (csubt g (CHead e1 (Bind Abst) v1) +c2)).(\lambda (c0: C).(\lambda (c3: C).(\lambda (k: K).(\lambda (u: +T).(\lambda (H1: (eq C (CHead c0 k u) (CHead e1 (Bind Abst) v1))).(\lambda +(H2: (eq C (CHead c3 k u) c2)).(\lambda (H3: (csubt g c0 c3)).(let H4 \def +(eq_ind_r C c2 (\lambda (c: C).(csubt g (CHead e1 (Bind Abst) v1) c)) H0 +(CHead c3 k u) H2) in (let H5 \def (eq_ind_r C c2 (\lambda (c: C).(csubt g +(CHead e1 (Bind Abst) v1) c)) H (CHead c3 k u) H2) in (eq_ind C (CHead c3 k +u) (\lambda (c: C).(or (ex2 C (\lambda (e2: C).(eq C c (CHead e2 (Bind Abst) +v1))) (\lambda (e2: C).(csubt g e1 e2))) (ex3_2 C T (\lambda (e2: C).(\lambda +(v2: T).(eq C c (CHead e2 (Bind Abbr) v2)))) (\lambda (e2: C).(\lambda (_: +T).(csubt g e1 e2))) (\lambda (e2: C).(\lambda (v2: T).(ty3 g e2 v2 v1)))))) +(let H6 \def (f_equal C C (\lambda (e: C).(match e in C return (\lambda (_: +C).C) with [(CSort _) \Rightarrow c0 | (CHead c _ _) \Rightarrow c])) (CHead +c0 k u) (CHead e1 (Bind Abst) v1) H1) in ((let H7 \def (f_equal C K (\lambda +(e: C).(match e in C return (\lambda (_: C).K) with [(CSort _) \Rightarrow k +| (CHead _ k0 _) \Rightarrow k0])) (CHead c0 k u) (CHead e1 (Bind Abst) v1) +H1) in ((let H8 \def (f_equal C T (\lambda (e: C).(match e in C return +(\lambda (_: C).T) with [(CSort _) \Rightarrow u | (CHead _ _ t) \Rightarrow +t])) (CHead c0 k u) (CHead e1 (Bind Abst) v1) H1) in (\lambda (H9: (eq K k +(Bind Abst))).(\lambda (H10: (eq C c0 e1)).(let H11 \def (eq_ind T u (\lambda +(t: T).(csubt g (CHead e1 (Bind Abst) v1) (CHead c3 k t))) H5 v1 H8) in (let +H12 \def (eq_ind T u (\lambda (t: T).(csubt g (CHead e1 (Bind Abst) v1) +(CHead c3 k t))) H4 v1 H8) in (eq_ind_r T v1 (\lambda (t: T).(or (ex2 C +(\lambda (e2: C).(eq C (CHead c3 k t) (CHead e2 (Bind Abst) v1))) (\lambda +(e2: C).(csubt g e1 e2))) (ex3_2 C T (\lambda (e2: C).(\lambda (v2: T).(eq C +(CHead c3 k t) (CHead e2 (Bind Abbr) v2)))) (\lambda (e2: C).(\lambda (_: +T).(csubt g e1 e2))) (\lambda (e2: C).(\lambda (v2: T).(ty3 g e2 v2 v1)))))) +(let H13 \def (eq_ind K k (\lambda (k0: K).(csubt g (CHead e1 (Bind Abst) v1) +(CHead c3 k0 v1))) H11 (Bind Abst) H9) in (let H14 \def (eq_ind K k (\lambda +(k0: K).(csubt g (CHead e1 (Bind Abst) v1) (CHead c3 k0 v1))) H12 (Bind Abst) +H9) in (eq_ind_r K (Bind Abst) (\lambda (k0: K).(or (ex2 C (\lambda (e2: +C).(eq C (CHead c3 k0 v1) (CHead e2 (Bind Abst) v1))) (\lambda (e2: C).(csubt +g e1 e2))) (ex3_2 C T (\lambda (e2: C).(\lambda (v2: T).(eq C (CHead c3 k0 +v1) (CHead e2 (Bind Abbr) v2)))) (\lambda (e2: C).(\lambda (_: T).(csubt g e1 +e2))) (\lambda (e2: C).(\lambda (v2: T).(ty3 g e2 v2 v1)))))) (let H15 \def +(eq_ind C c0 (\lambda (c: C).(csubt g c c3)) H3 e1 H10) in (or_introl (ex2 C +(\lambda (e2: C).(eq C (CHead c3 (Bind Abst) v1) (CHead e2 (Bind Abst) v1))) +(\lambda (e2: C).(csubt g e1 e2))) (ex3_2 C T (\lambda (e2: C).(\lambda (v2: +T).(eq C (CHead c3 (Bind Abst) v1) (CHead e2 (Bind Abbr) v2)))) (\lambda (e2: +C).(\lambda (_: T).(csubt g e1 e2))) (\lambda (e2: C).(\lambda (v2: T).(ty3 g +e2 v2 v1)))) (ex_intro2 C (\lambda (e2: C).(eq C (CHead c3 (Bind Abst) v1) +(CHead e2 (Bind Abst) v1))) (\lambda (e2: C).(csubt g e1 e2)) c3 (refl_equal +C (CHead c3 (Bind Abst) v1)) H15))) k H9))) u H8)))))) H7)) H6)) c2 +H2))))))))))) (\lambda (H0: (csubt g (CHead e1 (Bind Abst) v1) c2)).(\lambda +(c0: C).(\lambda (c3: C).(\lambda (b: B).(\lambda (u1: T).(\lambda (u2: +T).(\lambda (H2: (eq C (CHead c0 (Bind Void) u1) (CHead e1 (Bind Abst) +v1))).(\lambda (H3: (eq C (CHead c3 (Bind b) u2) c2)).(\lambda (_: (csubt g +c0 c3)).(\lambda (_: (not (eq B b Void))).(let H5 \def (eq_ind_r C c2 +(\lambda (c: C).(csubt g (CHead e1 (Bind Abst) v1) c)) H0 (CHead c3 (Bind b) +u2) H3) in (let H6 \def (eq_ind_r C c2 (\lambda (c: C).(csubt g (CHead e1 +(Bind Abst) v1) c)) H (CHead c3 (Bind b) u2) H3) in (eq_ind C (CHead c3 (Bind +b) u2) (\lambda (c: C).(or (ex2 C (\lambda (e2: C).(eq C c (CHead e2 (Bind +Abst) v1))) (\lambda (e2: C).(csubt g e1 e2))) (ex3_2 C T (\lambda (e2: +C).(\lambda (v2: T).(eq C c (CHead e2 (Bind Abbr) v2)))) (\lambda (e2: +C).(\lambda (_: T).(csubt g e1 e2))) (\lambda (e2: C).(\lambda (v2: T).(ty3 g +e2 v2 v1)))))) (let H7 \def (eq_ind C (CHead c0 (Bind Void) u1) (\lambda (ee: +C).(match ee in C return (\lambda (_: C).Prop) with [(CSort _) \Rightarrow +False | (CHead _ k _) \Rightarrow (match k in K return (\lambda (_: K).Prop) +with [(Bind b0) \Rightarrow (match b0 in B return (\lambda (_: B).Prop) with +[Abbr \Rightarrow False | Abst \Rightarrow False | Void \Rightarrow True]) | +(Flat _) \Rightarrow False])])) I (CHead e1 (Bind Abst) v1) H2) in (False_ind +(or (ex2 C (\lambda (e2: C).(eq C (CHead c3 (Bind b) u2) (CHead e2 (Bind +Abst) v1))) (\lambda (e2: C).(csubt g e1 e2))) (ex3_2 C T (\lambda (e2: +C).(\lambda (v2: T).(eq C (CHead c3 (Bind b) u2) (CHead e2 (Bind Abbr) v2)))) +(\lambda (e2: C).(\lambda (_: T).(csubt g e1 e2))) (\lambda (e2: C).(\lambda +(v2: T).(ty3 g e2 v2 v1))))) H7)) c2 H3))))))))))))) (\lambda (H0: (csubt g +(CHead e1 (Bind Abst) v1) c2)).(\lambda (c0: C).(\lambda (c3: C).(\lambda (u: +T).(\lambda (t: T).(\lambda (H2: (eq C (CHead c0 (Bind Abst) t) (CHead e1 +(Bind Abst) v1))).(\lambda (H3: (eq C (CHead c3 (Bind Abbr) u) c2)).(\lambda +(H1: (csubt g c0 c3)).(\lambda (H4: (ty3 g c3 u t)).(let H5 \def (eq_ind_r C +c2 (\lambda (c: C).(csubt g (CHead e1 (Bind Abst) v1) c)) H0 (CHead c3 (Bind +Abbr) u) H3) in (let H6 \def (eq_ind_r C c2 (\lambda (c: C).(csubt g (CHead +e1 (Bind Abst) v1) c)) H (CHead c3 (Bind Abbr) u) H3) in (eq_ind C (CHead c3 +(Bind Abbr) u) (\lambda (c: C).(or (ex2 C (\lambda (e2: C).(eq C c (CHead e2 +(Bind Abst) v1))) (\lambda (e2: C).(csubt g e1 e2))) (ex3_2 C T (\lambda (e2: +C).(\lambda (v2: T).(eq C c (CHead e2 (Bind Abbr) v2)))) (\lambda (e2: +C).(\lambda (_: T).(csubt g e1 e2))) (\lambda (e2: C).(\lambda (v2: T).(ty3 g +e2 v2 v1)))))) (let H7 \def (f_equal C C (\lambda (e: C).(match e in C return +(\lambda (_: C).C) with [(CSort _) \Rightarrow c0 | (CHead c _ _) \Rightarrow +c])) (CHead c0 (Bind Abst) t) (CHead e1 (Bind Abst) v1) H2) in ((let H8 \def +(f_equal C T (\lambda (e: C).(match e in C return (\lambda (_: C).T) with +[(CSort _) \Rightarrow t | (CHead _ _ t0) \Rightarrow t0])) (CHead c0 (Bind +Abst) t) (CHead e1 (Bind Abst) v1) H2) in (\lambda (H9: (eq C c0 e1)).(let +H10 \def (eq_ind T t (\lambda (t0: T).(ty3 g c3 u t0)) H4 v1 H8) in (let H11 +\def (eq_ind C c0 (\lambda (c: C).(csubt g c c3)) H1 e1 H9) in (or_intror +(ex2 C (\lambda (e2: C).(eq C (CHead c3 (Bind Abbr) u) (CHead e2 (Bind Abst) +v1))) (\lambda (e2: C).(csubt g e1 e2))) (ex3_2 C T (\lambda (e2: C).(\lambda +(v2: T).(eq C (CHead c3 (Bind Abbr) u) (CHead e2 (Bind Abbr) v2)))) (\lambda +(e2: C).(\lambda (_: T).(csubt g e1 e2))) (\lambda (e2: C).(\lambda (v2: +T).(ty3 g e2 v2 v1)))) (ex3_2_intro C T (\lambda (e2: C).(\lambda (v2: T).(eq +C (CHead c3 (Bind Abbr) u) (CHead e2 (Bind Abbr) v2)))) (\lambda (e2: +C).(\lambda (_: T).(csubt g e1 e2))) (\lambda (e2: C).(\lambda (v2: T).(ty3 g +e2 v2 v1))) c3 u (refl_equal C (CHead c3 (Bind Abbr) u)) H11 H10)))))) H7)) +c2 H3)))))))))))) H))))). -axiom csubt_gen_bind: +theorem csubt_gen_bind: \forall (g: G).(\forall (b1: B).(\forall (e1: C).(\forall (c2: C).(\forall (v1: T).((csubt g (CHead e1 (Bind b1) v1) c2) \to (ex2_3 B C T (\lambda (b2: B).(\lambda (e2: C).(\lambda (v2: T).(eq C c2 (CHead e2 (Bind b2) v2))))) (\lambda (_: B).(\lambda (e2: C).(\lambda (_: T).(csubt g e1 e2)))))))))) -. +\def + \lambda (g: G).(\lambda (b1: B).(\lambda (e1: C).(\lambda (c2: C).(\lambda +(v1: T).(\lambda (H: (csubt g (CHead e1 (Bind b1) v1) c2)).(csubt_inv_coq g +(CHead e1 (Bind b1) v1) c2 (\lambda (g0: G).(\lambda (_: C).(\lambda (c0: +C).(ex2_3 B C T (\lambda (b2: B).(\lambda (e2: C).(\lambda (v2: T).(eq C c0 +(CHead e2 (Bind b2) v2))))) (\lambda (_: B).(\lambda (e2: C).(\lambda (_: +T).(csubt g0 e1 e2)))))))) (\lambda (H0: (csubt g (CHead e1 (Bind b1) v1) +c2)).(\lambda (n: nat).(\lambda (H1: (eq C (CSort n) (CHead e1 (Bind b1) +v1))).(\lambda (H2: (eq C (CSort n) c2)).(let H3 \def (eq_ind_r C c2 (\lambda +(c: C).(csubt g (CHead e1 (Bind b1) v1) c)) H0 (CSort n) H2) in (let H4 \def +(eq_ind_r C c2 (\lambda (c: C).(csubt g (CHead e1 (Bind b1) v1) c)) H (CSort +n) H2) in (eq_ind C (CSort n) (\lambda (c: C).(ex2_3 B C T (\lambda (b2: +B).(\lambda (e2: C).(\lambda (v2: T).(eq C c (CHead e2 (Bind b2) v2))))) +(\lambda (_: B).(\lambda (e2: C).(\lambda (_: T).(csubt g e1 e2)))))) (let H5 +\def (eq_ind C (CSort n) (\lambda (ee: C).(match ee in C return (\lambda (_: +C).Prop) with [(CSort _) \Rightarrow True | (CHead _ _ _) \Rightarrow +False])) I (CHead e1 (Bind b1) v1) H1) in (False_ind (ex2_3 B C T (\lambda +(b2: B).(\lambda (e2: C).(\lambda (v2: T).(eq C (CSort n) (CHead e2 (Bind b2) +v2))))) (\lambda (_: B).(\lambda (e2: C).(\lambda (_: T).(csubt g e1 e2))))) +H5)) c2 H2))))))) (\lambda (H0: (csubt g (CHead e1 (Bind b1) v1) +c2)).(\lambda (c0: C).(\lambda (c3: C).(\lambda (k: K).(\lambda (u: +T).(\lambda (H1: (eq C (CHead c0 k u) (CHead e1 (Bind b1) v1))).(\lambda (H2: +(eq C (CHead c3 k u) c2)).(\lambda (H3: (csubt g c0 c3)).(let H4 \def +(eq_ind_r C c2 (\lambda (c: C).(csubt g (CHead e1 (Bind b1) v1) c)) H0 (CHead +c3 k u) H2) in (let H5 \def (eq_ind_r C c2 (\lambda (c: C).(csubt g (CHead e1 +(Bind b1) v1) c)) H (CHead c3 k u) H2) in (eq_ind C (CHead c3 k u) (\lambda +(c: C).(ex2_3 B C T (\lambda (b2: B).(\lambda (e2: C).(\lambda (v2: T).(eq C +c (CHead e2 (Bind b2) v2))))) (\lambda (_: B).(\lambda (e2: C).(\lambda (_: +T).(csubt g e1 e2)))))) (let H6 \def (f_equal C C (\lambda (e: C).(match e in +C return (\lambda (_: C).C) with [(CSort _) \Rightarrow c0 | (CHead c _ _) +\Rightarrow c])) (CHead c0 k u) (CHead e1 (Bind b1) v1) H1) in ((let H7 \def +(f_equal C K (\lambda (e: C).(match e in C return (\lambda (_: C).K) with +[(CSort _) \Rightarrow k | (CHead _ k0 _) \Rightarrow k0])) (CHead c0 k u) +(CHead e1 (Bind b1) v1) H1) in ((let H8 \def (f_equal C T (\lambda (e: +C).(match e in C return (\lambda (_: C).T) with [(CSort _) \Rightarrow u | +(CHead _ _ t) \Rightarrow t])) (CHead c0 k u) (CHead e1 (Bind b1) v1) H1) in +(\lambda (H9: (eq K k (Bind b1))).(\lambda (H10: (eq C c0 e1)).(let H11 \def +(eq_ind T u (\lambda (t: T).(csubt g (CHead e1 (Bind b1) v1) (CHead c3 k t))) +H5 v1 H8) in (let H12 \def (eq_ind T u (\lambda (t: T).(csubt g (CHead e1 +(Bind b1) v1) (CHead c3 k t))) H4 v1 H8) in (eq_ind_r T v1 (\lambda (t: +T).(ex2_3 B C T (\lambda (b2: B).(\lambda (e2: C).(\lambda (v2: T).(eq C +(CHead c3 k t) (CHead e2 (Bind b2) v2))))) (\lambda (_: B).(\lambda (e2: +C).(\lambda (_: T).(csubt g e1 e2)))))) (let H13 \def (eq_ind K k (\lambda +(k0: K).(csubt g (CHead e1 (Bind b1) v1) (CHead c3 k0 v1))) H11 (Bind b1) H9) +in (let H14 \def (eq_ind K k (\lambda (k0: K).(csubt g (CHead e1 (Bind b1) +v1) (CHead c3 k0 v1))) H12 (Bind b1) H9) in (eq_ind_r K (Bind b1) (\lambda +(k0: K).(ex2_3 B C T (\lambda (b2: B).(\lambda (e2: C).(\lambda (v2: T).(eq C +(CHead c3 k0 v1) (CHead e2 (Bind b2) v2))))) (\lambda (_: B).(\lambda (e2: +C).(\lambda (_: T).(csubt g e1 e2)))))) (let H15 \def (eq_ind C c0 (\lambda +(c: C).(csubt g c c3)) H3 e1 H10) in (ex2_3_intro B C T (\lambda (b2: +B).(\lambda (e2: C).(\lambda (v2: T).(eq C (CHead c3 (Bind b1) v1) (CHead e2 +(Bind b2) v2))))) (\lambda (_: B).(\lambda (e2: C).(\lambda (_: T).(csubt g +e1 e2)))) b1 c3 v1 (refl_equal C (CHead c3 (Bind b1) v1)) H15)) k H9))) u +H8)))))) H7)) H6)) c2 H2))))))))))) (\lambda (H0: (csubt g (CHead e1 (Bind +b1) v1) c2)).(\lambda (c0: C).(\lambda (c3: C).(\lambda (b: B).(\lambda (u1: +T).(\lambda (u2: T).(\lambda (H2: (eq C (CHead c0 (Bind Void) u1) (CHead e1 +(Bind b1) v1))).(\lambda (H3: (eq C (CHead c3 (Bind b) u2) c2)).(\lambda (H1: +(csubt g c0 c3)).(\lambda (_: (not (eq B b Void))).(let H5 \def (eq_ind_r C +c2 (\lambda (c: C).(csubt g (CHead e1 (Bind b1) v1) c)) H0 (CHead c3 (Bind b) +u2) H3) in (let H6 \def (eq_ind_r C c2 (\lambda (c: C).(csubt g (CHead e1 +(Bind b1) v1) c)) H (CHead c3 (Bind b) u2) H3) in (eq_ind C (CHead c3 (Bind +b) u2) (\lambda (c: C).(ex2_3 B C T (\lambda (b2: B).(\lambda (e2: +C).(\lambda (v2: T).(eq C c (CHead e2 (Bind b2) v2))))) (\lambda (_: +B).(\lambda (e2: C).(\lambda (_: T).(csubt g e1 e2)))))) (let H7 \def +(f_equal C C (\lambda (e: C).(match e in C return (\lambda (_: C).C) with +[(CSort _) \Rightarrow c0 | (CHead c _ _) \Rightarrow c])) (CHead c0 (Bind +Void) u1) (CHead e1 (Bind b1) v1) H2) in ((let H8 \def (f_equal C B (\lambda +(e: C).(match e in C return (\lambda (_: C).B) with [(CSort _) \Rightarrow +Void | (CHead _ k _) \Rightarrow (match k in K return (\lambda (_: K).B) with +[(Bind b0) \Rightarrow b0 | (Flat _) \Rightarrow Void])])) (CHead c0 (Bind +Void) u1) (CHead e1 (Bind b1) v1) H2) in ((let H9 \def (f_equal C T (\lambda +(e: C).(match e in C return (\lambda (_: C).T) with [(CSort _) \Rightarrow u1 +| (CHead _ _ t) \Rightarrow t])) (CHead c0 (Bind Void) u1) (CHead e1 (Bind +b1) v1) H2) in (\lambda (H10: (eq B Void b1)).(\lambda (H11: (eq C c0 +e1)).(let H12 \def (eq_ind C c0 (\lambda (c: C).(csubt g c c3)) H1 e1 H11) in +(let H13 \def (eq_ind_r B b1 (\lambda (b0: B).(csubt g (CHead e1 (Bind b0) +v1) (CHead c3 (Bind b) u2))) H6 Void H10) in (let H14 \def (eq_ind_r B b1 +(\lambda (b0: B).(csubt g (CHead e1 (Bind b0) v1) (CHead c3 (Bind b) u2))) H5 +Void H10) in (ex2_3_intro B C T (\lambda (b2: B).(\lambda (e2: C).(\lambda +(v2: T).(eq C (CHead c3 (Bind b) u2) (CHead e2 (Bind b2) v2))))) (\lambda (_: +B).(\lambda (e2: C).(\lambda (_: T).(csubt g e1 e2)))) b c3 u2 (refl_equal C +(CHead c3 (Bind b) u2)) H12))))))) H8)) H7)) c2 H3))))))))))))) (\lambda (H0: +(csubt g (CHead e1 (Bind b1) v1) c2)).(\lambda (c0: C).(\lambda (c3: +C).(\lambda (u: T).(\lambda (t: T).(\lambda (H2: (eq C (CHead c0 (Bind Abst) +t) (CHead e1 (Bind b1) v1))).(\lambda (H3: (eq C (CHead c3 (Bind Abbr) u) +c2)).(\lambda (H1: (csubt g c0 c3)).(\lambda (H4: (ty3 g c3 u t)).(let H5 +\def (eq_ind_r C c2 (\lambda (c: C).(csubt g (CHead e1 (Bind b1) v1) c)) H0 +(CHead c3 (Bind Abbr) u) H3) in (let H6 \def (eq_ind_r C c2 (\lambda (c: +C).(csubt g (CHead e1 (Bind b1) v1) c)) H (CHead c3 (Bind Abbr) u) H3) in +(eq_ind C (CHead c3 (Bind Abbr) u) (\lambda (c: C).(ex2_3 B C T (\lambda (b2: +B).(\lambda (e2: C).(\lambda (v2: T).(eq C c (CHead e2 (Bind b2) v2))))) +(\lambda (_: B).(\lambda (e2: C).(\lambda (_: T).(csubt g e1 e2)))))) (let H7 +\def (f_equal C C (\lambda (e: C).(match e in C return (\lambda (_: C).C) +with [(CSort _) \Rightarrow c0 | (CHead c _ _) \Rightarrow c])) (CHead c0 +(Bind Abst) t) (CHead e1 (Bind b1) v1) H2) in ((let H8 \def (f_equal C B +(\lambda (e: C).(match e in C return (\lambda (_: C).B) with [(CSort _) +\Rightarrow Abst | (CHead _ k _) \Rightarrow (match k in K return (\lambda +(_: K).B) with [(Bind b) \Rightarrow b | (Flat _) \Rightarrow Abst])])) +(CHead c0 (Bind Abst) t) (CHead e1 (Bind b1) v1) H2) in ((let H9 \def +(f_equal C T (\lambda (e: C).(match e in C return (\lambda (_: C).T) with +[(CSort _) \Rightarrow t | (CHead _ _ t0) \Rightarrow t0])) (CHead c0 (Bind +Abst) t) (CHead e1 (Bind b1) v1) H2) in (\lambda (H10: (eq B Abst +b1)).(\lambda (H11: (eq C c0 e1)).(let H12 \def (eq_ind T t (\lambda (t0: +T).(ty3 g c3 u t0)) H4 v1 H9) in (let H13 \def (eq_ind C c0 (\lambda (c: +C).(csubt g c c3)) H1 e1 H11) in (let H14 \def (eq_ind_r B b1 (\lambda (b: +B).(csubt g (CHead e1 (Bind b) v1) (CHead c3 (Bind Abbr) u))) H6 Abst H10) in +(let H15 \def (eq_ind_r B b1 (\lambda (b: B).(csubt g (CHead e1 (Bind b) v1) +(CHead c3 (Bind Abbr) u))) H5 Abst H10) in (ex2_3_intro B C T (\lambda (b2: +B).(\lambda (e2: C).(\lambda (v2: T).(eq C (CHead c3 (Bind Abbr) u) (CHead e2 +(Bind b2) v2))))) (\lambda (_: B).(\lambda (e2: C).(\lambda (_: T).(csubt g +e1 e2)))) Abbr c3 u (refl_equal C (CHead c3 (Bind Abbr) u)) H13)))))))) H8)) +H7)) c2 H3)))))))))))) H)))))). diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/pr0/fwd.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/pr0/fwd.ma index d24ae097e..f0cde41e0 100644 --- a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/pr0/fwd.ma +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/pr0/fwd.ma @@ -18,22 +18,401 @@ set "baseuri" "cic:/matita/LAMBDA-TYPES/Level-1/LambdaDelta/pr0/fwd". include "pr0/props.ma". -axiom pr0_gen_sort: +theorem pr0_inv_coq: + \forall (t1: T).(\forall (t2: T).(\forall (P: ((T \to (T \to +Prop)))).((((pr0 t1 t2) \to (\forall (t: T).((eq T t t1) \to ((eq T t t2) \to +(P t1 t2)))))) \to ((((pr0 t1 t2) \to (\forall (u1: T).(\forall (u2: +T).(\forall (t0: T).(\forall (t3: T).(\forall (k: K).((eq T (THead k u1 t0) +t1) \to ((eq T (THead k u2 t3) t2) \to ((pr0 u1 u2) \to ((pr0 t0 t3) \to (P +t1 t2)))))))))))) \to ((((pr0 t1 t2) \to (\forall (u: T).(\forall (v1: +T).(\forall (v2: T).(\forall (t0: T).(\forall (t3: T).((eq T (THead (Flat +Appl) v1 (THead (Bind Abst) u t0)) t1) \to ((eq T (THead (Bind Abbr) v2 t3) +t2) \to ((pr0 v1 v2) \to ((pr0 t0 t3) \to (P t1 t2)))))))))))) \to ((((pr0 t1 +t2) \to (\forall (b: B).(\forall (v1: T).(\forall (v2: T).(\forall (u1: +T).(\forall (u2: T).(\forall (t0: T).(\forall (t3: T).((eq T (THead (Flat +Appl) v1 (THead (Bind b) u1 t0)) t1) \to ((eq T (THead (Bind b) u2 (THead +(Flat Appl) (lift (S O) O v2) t3)) t2) \to ((not (eq B b Abst)) \to ((pr0 v1 +v2) \to ((pr0 u1 u2) \to ((pr0 t0 t3) \to (P t1 t2)))))))))))))))) \to +((((pr0 t1 t2) \to (\forall (u1: T).(\forall (u2: T).(\forall (t0: +T).(\forall (t3: T).(\forall (w: T).((eq T (THead (Bind Abbr) u1 t0) t1) \to +((eq T (THead (Bind Abbr) u2 w) t2) \to ((pr0 u1 u2) \to ((pr0 t0 t3) \to +((subst0 O u2 t3 w) \to (P t1 t2))))))))))))) \to ((((pr0 t1 t2) \to (\forall +(b: B).(\forall (t0: T).(\forall (t3: T).(\forall (u: T).((eq T (THead (Bind +b) u (lift (S O) O t0)) t1) \to ((eq T t3 t2) \to ((not (eq B b Abst)) \to +((pr0 t0 t3) \to (P t1 t2))))))))))) \to ((((pr0 t1 t2) \to (\forall (t0: +T).(\forall (t3: T).(\forall (u: T).((eq T (THead (Flat Cast) u t0) t1) \to +((eq T t3 t2) \to ((pr0 t0 t3) \to (P t1 t2))))))))) \to ((pr0 t1 t2) \to (P +t1 t2))))))))))) +\def + \lambda (t1: T).(\lambda (t2: T).(\lambda (P: ((T \to (T \to +Prop)))).(\lambda (H: (((pr0 t1 t2) \to (\forall (t: T).((eq T t t1) \to ((eq +T t t2) \to (P t1 t2))))))).(\lambda (H0: (((pr0 t1 t2) \to (\forall (u1: +T).(\forall (u2: T).(\forall (t0: T).(\forall (t3: T).(\forall (k: K).((eq T +(THead k u1 t0) t1) \to ((eq T (THead k u2 t3) t2) \to ((pr0 u1 u2) \to ((pr0 +t0 t3) \to (P t1 t2))))))))))))).(\lambda (H1: (((pr0 t1 t2) \to (\forall (u: +T).(\forall (v1: T).(\forall (v2: T).(\forall (t0: T).(\forall (t3: T).((eq T +(THead (Flat Appl) v1 (THead (Bind Abst) u t0)) t1) \to ((eq T (THead (Bind +Abbr) v2 t3) t2) \to ((pr0 v1 v2) \to ((pr0 t0 t3) \to (P t1 +t2))))))))))))).(\lambda (H2: (((pr0 t1 t2) \to (\forall (b: B).(\forall (v1: +T).(\forall (v2: T).(\forall (u1: T).(\forall (u2: T).(\forall (t0: +T).(\forall (t3: T).((eq T (THead (Flat Appl) v1 (THead (Bind b) u1 t0)) t1) +\to ((eq T (THead (Bind b) u2 (THead (Flat Appl) (lift (S O) O v2) t3)) t2) +\to ((not (eq B b Abst)) \to ((pr0 v1 v2) \to ((pr0 u1 u2) \to ((pr0 t0 t3) +\to (P t1 t2))))))))))))))))).(\lambda (H3: (((pr0 t1 t2) \to (\forall (u1: +T).(\forall (u2: T).(\forall (t0: T).(\forall (t3: T).(\forall (w: T).((eq T +(THead (Bind Abbr) u1 t0) t1) \to ((eq T (THead (Bind Abbr) u2 w) t2) \to +((pr0 u1 u2) \to ((pr0 t0 t3) \to ((subst0 O u2 t3 w) \to (P t1 +t2)))))))))))))).(\lambda (H4: (((pr0 t1 t2) \to (\forall (b: B).(\forall +(t0: T).(\forall (t3: T).(\forall (u: T).((eq T (THead (Bind b) u (lift (S O) +O t0)) t1) \to ((eq T t3 t2) \to ((not (eq B b Abst)) \to ((pr0 t0 t3) \to (P +t1 t2)))))))))))).(\lambda (H5: (((pr0 t1 t2) \to (\forall (t0: T).(\forall +(t3: T).(\forall (u: T).((eq T (THead (Flat Cast) u t0) t1) \to ((eq T t3 t2) +\to ((pr0 t0 t3) \to (P t1 t2)))))))))).(\lambda (H6: (pr0 t1 t2)).(let H7 +\def (match H6 in pr0 return (\lambda (t: T).(\lambda (t0: T).(\lambda (_: +(pr0 t t0)).((eq T t t1) \to ((eq T t0 t2) \to (P t1 t2)))))) with [(pr0_refl +t) \Rightarrow (\lambda (H7: (eq T t t1)).(\lambda (H8: (eq T t t2)).(H H6 t +H7 H8))) | (pr0_comp u1 u2 H7 t0 t3 H8 k) \Rightarrow (\lambda (H9: (eq T +(THead k u1 t0) t1)).(\lambda (H10: (eq T (THead k u2 t3) t2)).(H0 H6 u1 u2 +t0 t3 k H9 H10 H7 H8))) | (pr0_beta u v1 v2 H7 t0 t3 H8) \Rightarrow (\lambda +(H9: (eq T (THead (Flat Appl) v1 (THead (Bind Abst) u t0)) t1)).(\lambda +(H10: (eq T (THead (Bind Abbr) v2 t3) t2)).(H1 H6 u v1 v2 t0 t3 H9 H10 H7 +H8))) | (pr0_upsilon b H7 v1 v2 H8 u1 u2 H9 t0 t3 H10) \Rightarrow (\lambda +(H11: (eq T (THead (Flat Appl) v1 (THead (Bind b) u1 t0)) t1)).(\lambda (H12: +(eq T (THead (Bind b) u2 (THead (Flat Appl) (lift (S O) O v2) t3)) t2)).(H2 +H6 b v1 v2 u1 u2 t0 t3 H11 H12 H7 H8 H9 H10))) | (pr0_delta u1 u2 H7 t0 t3 H8 +w H9) \Rightarrow (\lambda (H10: (eq T (THead (Bind Abbr) u1 t0) +t1)).(\lambda (H11: (eq T (THead (Bind Abbr) u2 w) t2)).(H3 H6 u1 u2 t0 t3 w +H10 H11 H7 H8 H9))) | (pr0_zeta b H7 t0 t3 H8 u) \Rightarrow (\lambda (H9: +(eq T (THead (Bind b) u (lift (S O) O t0)) t1)).(\lambda (H10: (eq T t3 +t2)).(H4 H6 b t0 t3 u H9 H10 H7 H8))) | (pr0_epsilon t0 t3 H7 u) \Rightarrow +(\lambda (H8: (eq T (THead (Flat Cast) u t0) t1)).(\lambda (H9: (eq T t3 +t2)).(H5 H6 t0 t3 u H8 H9 H7)))]) in (H7 (refl_equal T t1) (refl_equal T +t2))))))))))))). + +theorem pr0_gen_sort: \forall (x: T).(\forall (n: nat).((pr0 (TSort n) x) \to (eq T x (TSort n)))) -. +\def + \lambda (x: T).(\lambda (n: nat).(\lambda (H: (pr0 (TSort n) +x)).(pr0_inv_coq (TSort n) x (\lambda (t: T).(\lambda (t0: T).(eq T t0 t))) +(\lambda (H0: (pr0 (TSort n) x)).(\lambda (t: T).(\lambda (H1: (eq T t (TSort +n))).(\lambda (H2: (eq T t x)).(let H3 \def (eq_ind T t (\lambda (t0: T).(eq +T t0 (TSort n))) H1 x H2) in (let H4 \def (eq_ind T x (\lambda (t0: T).(pr0 +(TSort n) t0)) H0 (TSort n) H3) in (let H5 \def (eq_ind T x (\lambda (t0: +T).(pr0 (TSort n) t0)) H (TSort n) H3) in (eq_ind_r T (TSort n) (\lambda (t0: +T).(eq T t0 (TSort n))) (refl_equal T (TSort n)) x H3)))))))) (\lambda (H0: +(pr0 (TSort n) x)).(\lambda (u1: T).(\lambda (u2: T).(\lambda (t0: +T).(\lambda (t3: T).(\lambda (k: K).(\lambda (H2: (eq T (THead k u1 t0) +(TSort n))).(\lambda (H3: (eq T (THead k u2 t3) x)).(\lambda (_: (pr0 u1 +u2)).(\lambda (_: (pr0 t0 t3)).(let H5 \def (eq_ind_r T x (\lambda (t: +T).(pr0 (TSort n) t)) H0 (THead k u2 t3) H3) in (let H6 \def (eq_ind_r T x +(\lambda (t: T).(pr0 (TSort n) t)) H (THead k u2 t3) H3) in (eq_ind T (THead +k u2 t3) (\lambda (t: T).(eq T t (TSort n))) (let H7 \def (eq_ind T (THead k +u1 t0) (\lambda (ee: T).(match ee in T return (\lambda (_: T).Prop) with +[(TSort _) \Rightarrow False | (TLRef _) \Rightarrow False | (THead _ _ _) +\Rightarrow True])) I (TSort n) H2) in (False_ind (eq T (THead k u2 t3) +(TSort n)) H7)) x H3))))))))))))) (\lambda (H0: (pr0 (TSort n) x)).(\lambda +(u: T).(\lambda (v1: T).(\lambda (v2: T).(\lambda (t0: T).(\lambda (t3: +T).(\lambda (H2: (eq T (THead (Flat Appl) v1 (THead (Bind Abst) u t0)) (TSort +n))).(\lambda (H3: (eq T (THead (Bind Abbr) v2 t3) x)).(\lambda (_: (pr0 v1 +v2)).(\lambda (_: (pr0 t0 t3)).(let H5 \def (eq_ind_r T x (\lambda (t: +T).(pr0 (TSort n) t)) H0 (THead (Bind Abbr) v2 t3) H3) in (let H6 \def +(eq_ind_r T x (\lambda (t: T).(pr0 (TSort n) t)) H (THead (Bind Abbr) v2 t3) +H3) in (eq_ind T (THead (Bind Abbr) v2 t3) (\lambda (t: T).(eq T t (TSort +n))) (let H7 \def (eq_ind T (THead (Flat Appl) v1 (THead (Bind Abst) u t0)) +(\lambda (ee: T).(match ee in T return (\lambda (_: T).Prop) with [(TSort _) +\Rightarrow False | (TLRef _) \Rightarrow False | (THead _ _ _) \Rightarrow +True])) I (TSort n) H2) in (False_ind (eq T (THead (Bind Abbr) v2 t3) (TSort +n)) H7)) x H3))))))))))))) (\lambda (H0: (pr0 (TSort n) x)).(\lambda (b: +B).(\lambda (v1: T).(\lambda (v2: T).(\lambda (u1: T).(\lambda (u2: +T).(\lambda (t0: T).(\lambda (t3: T).(\lambda (H4: (eq T (THead (Flat Appl) +v1 (THead (Bind b) u1 t0)) (TSort n))).(\lambda (H5: (eq T (THead (Bind b) u2 +(THead (Flat Appl) (lift (S O) O v2) t3)) x)).(\lambda (_: (not (eq B b +Abst))).(\lambda (_: (pr0 v1 v2)).(\lambda (_: (pr0 u1 u2)).(\lambda (_: (pr0 +t0 t3)).(let H7 \def (eq_ind_r T x (\lambda (t: T).(pr0 (TSort n) t)) H0 +(THead (Bind b) u2 (THead (Flat Appl) (lift (S O) O v2) t3)) H5) in (let H8 +\def (eq_ind_r T x (\lambda (t: T).(pr0 (TSort n) t)) H (THead (Bind b) u2 +(THead (Flat Appl) (lift (S O) O v2) t3)) H5) in (eq_ind T (THead (Bind b) u2 +(THead (Flat Appl) (lift (S O) O v2) t3)) (\lambda (t: T).(eq T t (TSort n))) +(let H9 \def (eq_ind T (THead (Flat Appl) v1 (THead (Bind b) u1 t0)) (\lambda +(ee: T).(match ee in T return (\lambda (_: T).Prop) with [(TSort _) +\Rightarrow False | (TLRef _) \Rightarrow False | (THead _ _ _) \Rightarrow +True])) I (TSort n) H4) in (False_ind (eq T (THead (Bind b) u2 (THead (Flat +Appl) (lift (S O) O v2) t3)) (TSort n)) H9)) x H5))))))))))))))))) (\lambda +(H0: (pr0 (TSort n) x)).(\lambda (u1: T).(\lambda (u2: T).(\lambda (t0: +T).(\lambda (t3: T).(\lambda (w: T).(\lambda (H3: (eq T (THead (Bind Abbr) u1 +t0) (TSort n))).(\lambda (H4: (eq T (THead (Bind Abbr) u2 w) x)).(\lambda (_: +(pr0 u1 u2)).(\lambda (_: (pr0 t0 t3)).(\lambda (_: (subst0 O u2 t3 w)).(let +H6 \def (eq_ind_r T x (\lambda (t: T).(pr0 (TSort n) t)) H0 (THead (Bind +Abbr) u2 w) H4) in (let H7 \def (eq_ind_r T x (\lambda (t: T).(pr0 (TSort n) +t)) H (THead (Bind Abbr) u2 w) H4) in (eq_ind T (THead (Bind Abbr) u2 w) +(\lambda (t: T).(eq T t (TSort n))) (let H8 \def (eq_ind T (THead (Bind Abbr) +u1 t0) (\lambda (ee: T).(match ee in T return (\lambda (_: T).Prop) with +[(TSort _) \Rightarrow False | (TLRef _) \Rightarrow False | (THead _ _ _) +\Rightarrow True])) I (TSort n) H3) in (False_ind (eq T (THead (Bind Abbr) u2 +w) (TSort n)) H8)) x H4)))))))))))))) (\lambda (_: (pr0 (TSort n) +x)).(\lambda (b: B).(\lambda (t0: T).(\lambda (t3: T).(\lambda (u: +T).(\lambda (H2: (eq T (THead (Bind b) u (lift (S O) O t0)) (TSort +n))).(\lambda (H3: (eq T t3 x)).(\lambda (_: (not (eq B b Abst))).(\lambda +(H4: (pr0 t0 t3)).(let H5 \def (eq_ind T t3 (\lambda (t: T).(pr0 t0 t)) H4 x +H3) in (let H6 \def (eq_ind T (THead (Bind b) u (lift (S O) O t0)) (\lambda +(ee: T).(match ee in T return (\lambda (_: T).Prop) with [(TSort _) +\Rightarrow False | (TLRef _) \Rightarrow False | (THead _ _ _) \Rightarrow +True])) I (TSort n) H2) in (False_ind (eq T x (TSort n)) H6)))))))))))) +(\lambda (_: (pr0 (TSort n) x)).(\lambda (t0: T).(\lambda (t3: T).(\lambda +(u: T).(\lambda (H1: (eq T (THead (Flat Cast) u t0) (TSort n))).(\lambda (H2: +(eq T t3 x)).(\lambda (H3: (pr0 t0 t3)).(let H4 \def (eq_ind T t3 (\lambda +(t: T).(pr0 t0 t)) H3 x H2) in (let H5 \def (eq_ind T (THead (Flat Cast) u +t0) (\lambda (ee: T).(match ee in T return (\lambda (_: T).Prop) with [(TSort +_) \Rightarrow False | (TLRef _) \Rightarrow False | (THead _ _ _) +\Rightarrow True])) I (TSort n) H1) in (False_ind (eq T x (TSort n)) +H5)))))))))) H))). -axiom pr0_gen_lref: +theorem pr0_gen_lref: \forall (x: T).(\forall (n: nat).((pr0 (TLRef n) x) \to (eq T x (TLRef n)))) -. +\def + \lambda (x: T).(\lambda (n: nat).(\lambda (H: (pr0 (TLRef n) +x)).(pr0_inv_coq (TLRef n) x (\lambda (t: T).(\lambda (t0: T).(eq T t0 t))) +(\lambda (H0: (pr0 (TLRef n) x)).(\lambda (t: T).(\lambda (H1: (eq T t (TLRef +n))).(\lambda (H2: (eq T t x)).(let H3 \def (eq_ind T t (\lambda (t0: T).(eq +T t0 (TLRef n))) H1 x H2) in (let H4 \def (eq_ind T x (\lambda (t0: T).(pr0 +(TLRef n) t0)) H0 (TLRef n) H3) in (let H5 \def (eq_ind T x (\lambda (t0: +T).(pr0 (TLRef n) t0)) H (TLRef n) H3) in (eq_ind_r T (TLRef n) (\lambda (t0: +T).(eq T t0 (TLRef n))) (refl_equal T (TLRef n)) x H3)))))))) (\lambda (H0: +(pr0 (TLRef n) x)).(\lambda (u1: T).(\lambda (u2: T).(\lambda (t0: +T).(\lambda (t3: T).(\lambda (k: K).(\lambda (H2: (eq T (THead k u1 t0) +(TLRef n))).(\lambda (H3: (eq T (THead k u2 t3) x)).(\lambda (_: (pr0 u1 +u2)).(\lambda (_: (pr0 t0 t3)).(let H5 \def (eq_ind_r T x (\lambda (t: +T).(pr0 (TLRef n) t)) H0 (THead k u2 t3) H3) in (let H6 \def (eq_ind_r T x +(\lambda (t: T).(pr0 (TLRef n) t)) H (THead k u2 t3) H3) in (eq_ind T (THead +k u2 t3) (\lambda (t: T).(eq T t (TLRef n))) (let H7 \def (eq_ind T (THead k +u1 t0) (\lambda (ee: T).(match ee in T return (\lambda (_: T).Prop) with +[(TSort _) \Rightarrow False | (TLRef _) \Rightarrow False | (THead _ _ _) +\Rightarrow True])) I (TLRef n) H2) in (False_ind (eq T (THead k u2 t3) +(TLRef n)) H7)) x H3))))))))))))) (\lambda (H0: (pr0 (TLRef n) x)).(\lambda +(u: T).(\lambda (v1: T).(\lambda (v2: T).(\lambda (t0: T).(\lambda (t3: +T).(\lambda (H2: (eq T (THead (Flat Appl) v1 (THead (Bind Abst) u t0)) (TLRef +n))).(\lambda (H3: (eq T (THead (Bind Abbr) v2 t3) x)).(\lambda (_: (pr0 v1 +v2)).(\lambda (_: (pr0 t0 t3)).(let H5 \def (eq_ind_r T x (\lambda (t: +T).(pr0 (TLRef n) t)) H0 (THead (Bind Abbr) v2 t3) H3) in (let H6 \def +(eq_ind_r T x (\lambda (t: T).(pr0 (TLRef n) t)) H (THead (Bind Abbr) v2 t3) +H3) in (eq_ind T (THead (Bind Abbr) v2 t3) (\lambda (t: T).(eq T t (TLRef +n))) (let H7 \def (eq_ind T (THead (Flat Appl) v1 (THead (Bind Abst) u t0)) +(\lambda (ee: T).(match ee in T return (\lambda (_: T).Prop) with [(TSort _) +\Rightarrow False | (TLRef _) \Rightarrow False | (THead _ _ _) \Rightarrow +True])) I (TLRef n) H2) in (False_ind (eq T (THead (Bind Abbr) v2 t3) (TLRef +n)) H7)) x H3))))))))))))) (\lambda (H0: (pr0 (TLRef n) x)).(\lambda (b: +B).(\lambda (v1: T).(\lambda (v2: T).(\lambda (u1: T).(\lambda (u2: +T).(\lambda (t0: T).(\lambda (t3: T).(\lambda (H4: (eq T (THead (Flat Appl) +v1 (THead (Bind b) u1 t0)) (TLRef n))).(\lambda (H5: (eq T (THead (Bind b) u2 +(THead (Flat Appl) (lift (S O) O v2) t3)) x)).(\lambda (_: (not (eq B b +Abst))).(\lambda (_: (pr0 v1 v2)).(\lambda (_: (pr0 u1 u2)).(\lambda (_: (pr0 +t0 t3)).(let H7 \def (eq_ind_r T x (\lambda (t: T).(pr0 (TLRef n) t)) H0 +(THead (Bind b) u2 (THead (Flat Appl) (lift (S O) O v2) t3)) H5) in (let H8 +\def (eq_ind_r T x (\lambda (t: T).(pr0 (TLRef n) t)) H (THead (Bind b) u2 +(THead (Flat Appl) (lift (S O) O v2) t3)) H5) in (eq_ind T (THead (Bind b) u2 +(THead (Flat Appl) (lift (S O) O v2) t3)) (\lambda (t: T).(eq T t (TLRef n))) +(let H9 \def (eq_ind T (THead (Flat Appl) v1 (THead (Bind b) u1 t0)) (\lambda +(ee: T).(match ee in T return (\lambda (_: T).Prop) with [(TSort _) +\Rightarrow False | (TLRef _) \Rightarrow False | (THead _ _ _) \Rightarrow +True])) I (TLRef n) H4) in (False_ind (eq T (THead (Bind b) u2 (THead (Flat +Appl) (lift (S O) O v2) t3)) (TLRef n)) H9)) x H5))))))))))))))))) (\lambda +(H0: (pr0 (TLRef n) x)).(\lambda (u1: T).(\lambda (u2: T).(\lambda (t0: +T).(\lambda (t3: T).(\lambda (w: T).(\lambda (H3: (eq T (THead (Bind Abbr) u1 +t0) (TLRef n))).(\lambda (H4: (eq T (THead (Bind Abbr) u2 w) x)).(\lambda (_: +(pr0 u1 u2)).(\lambda (_: (pr0 t0 t3)).(\lambda (_: (subst0 O u2 t3 w)).(let +H6 \def (eq_ind_r T x (\lambda (t: T).(pr0 (TLRef n) t)) H0 (THead (Bind +Abbr) u2 w) H4) in (let H7 \def (eq_ind_r T x (\lambda (t: T).(pr0 (TLRef n) +t)) H (THead (Bind Abbr) u2 w) H4) in (eq_ind T (THead (Bind Abbr) u2 w) +(\lambda (t: T).(eq T t (TLRef n))) (let H8 \def (eq_ind T (THead (Bind Abbr) +u1 t0) (\lambda (ee: T).(match ee in T return (\lambda (_: T).Prop) with +[(TSort _) \Rightarrow False | (TLRef _) \Rightarrow False | (THead _ _ _) +\Rightarrow True])) I (TLRef n) H3) in (False_ind (eq T (THead (Bind Abbr) u2 +w) (TLRef n)) H8)) x H4)))))))))))))) (\lambda (_: (pr0 (TLRef n) +x)).(\lambda (b: B).(\lambda (t0: T).(\lambda (t3: T).(\lambda (u: +T).(\lambda (H2: (eq T (THead (Bind b) u (lift (S O) O t0)) (TLRef +n))).(\lambda (H3: (eq T t3 x)).(\lambda (_: (not (eq B b Abst))).(\lambda +(H4: (pr0 t0 t3)).(let H5 \def (eq_ind T t3 (\lambda (t: T).(pr0 t0 t)) H4 x +H3) in (let H6 \def (eq_ind T (THead (Bind b) u (lift (S O) O t0)) (\lambda +(ee: T).(match ee in T return (\lambda (_: T).Prop) with [(TSort _) +\Rightarrow False | (TLRef _) \Rightarrow False | (THead _ _ _) \Rightarrow +True])) I (TLRef n) H2) in (False_ind (eq T x (TLRef n)) H6)))))))))))) +(\lambda (_: (pr0 (TLRef n) x)).(\lambda (t0: T).(\lambda (t3: T).(\lambda +(u: T).(\lambda (H1: (eq T (THead (Flat Cast) u t0) (TLRef n))).(\lambda (H2: +(eq T t3 x)).(\lambda (H3: (pr0 t0 t3)).(let H4 \def (eq_ind T t3 (\lambda +(t: T).(pr0 t0 t)) H3 x H2) in (let H5 \def (eq_ind T (THead (Flat Cast) u +t0) (\lambda (ee: T).(match ee in T return (\lambda (_: T).Prop) with [(TSort +_) \Rightarrow False | (TLRef _) \Rightarrow False | (THead _ _ _) +\Rightarrow True])) I (TLRef n) H1) in (False_ind (eq T x (TLRef n)) +H5)))))))))) H))). -axiom pr0_gen_abst: +theorem pr0_gen_abst: \forall (u1: T).(\forall (t1: T).(\forall (x: T).((pr0 (THead (Bind Abst) u1 t1) x) \to (ex3_2 T T (\lambda (u2: T).(\lambda (t2: T).(eq T x (THead (Bind Abst) u2 t2)))) (\lambda (u2: T).(\lambda (_: T).(pr0 u1 u2))) (\lambda (_: T).(\lambda (t2: T).(pr0 t1 t2))))))) -. +\def + \lambda (u1: T).(\lambda (t1: T).(\lambda (x: T).(\lambda (H: (pr0 (THead +(Bind Abst) u1 t1) x)).(pr0_inv_coq (THead (Bind Abst) u1 t1) x (\lambda (_: +T).(\lambda (t0: T).(ex3_2 T T (\lambda (u2: T).(\lambda (t2: T).(eq T t0 +(THead (Bind Abst) u2 t2)))) (\lambda (u2: T).(\lambda (_: T).(pr0 u1 u2))) +(\lambda (_: T).(\lambda (t2: T).(pr0 t1 t2)))))) (\lambda (H0: (pr0 (THead +(Bind Abst) u1 t1) x)).(\lambda (t: T).(\lambda (H1: (eq T t (THead (Bind +Abst) u1 t1))).(\lambda (H2: (eq T t x)).(let H3 \def (eq_ind T t (\lambda +(t0: T).(eq T t0 (THead (Bind Abst) u1 t1))) H1 x H2) in (let H4 \def (eq_ind +T x (\lambda (t0: T).(pr0 (THead (Bind Abst) u1 t1) t0)) H0 (THead (Bind +Abst) u1 t1) H3) in (let H5 \def (eq_ind T x (\lambda (t0: T).(pr0 (THead +(Bind Abst) u1 t1) t0)) H (THead (Bind Abst) u1 t1) H3) in (eq_ind_r T (THead +(Bind Abst) u1 t1) (\lambda (t0: T).(ex3_2 T T (\lambda (u2: T).(\lambda (t2: +T).(eq T t0 (THead (Bind Abst) u2 t2)))) (\lambda (u2: T).(\lambda (_: +T).(pr0 u1 u2))) (\lambda (_: T).(\lambda (t2: T).(pr0 t1 t2))))) +(ex3_2_intro T T (\lambda (u2: T).(\lambda (t2: T).(eq T (THead (Bind Abst) +u1 t1) (THead (Bind Abst) u2 t2)))) (\lambda (u2: T).(\lambda (_: T).(pr0 u1 +u2))) (\lambda (_: T).(\lambda (t2: T).(pr0 t1 t2))) u1 t1 (refl_equal T +(THead (Bind Abst) u1 t1)) (pr0_refl u1) (pr0_refl t1)) x H3)))))))) (\lambda +(H0: (pr0 (THead (Bind Abst) u1 t1) x)).(\lambda (u0: T).(\lambda (u2: +T).(\lambda (t0: T).(\lambda (t3: T).(\lambda (k: K).(\lambda (H2: (eq T +(THead k u0 t0) (THead (Bind Abst) u1 t1))).(\lambda (H3: (eq T (THead k u2 +t3) x)).(\lambda (H1: (pr0 u0 u2)).(\lambda (H4: (pr0 t0 t3)).(let H5 \def +(eq_ind_r T x (\lambda (t: T).(pr0 (THead (Bind Abst) u1 t1) t)) H0 (THead k +u2 t3) H3) in (let H6 \def (eq_ind_r T x (\lambda (t: T).(pr0 (THead (Bind +Abst) u1 t1) t)) H (THead k u2 t3) H3) in (eq_ind T (THead k u2 t3) (\lambda +(t: T).(ex3_2 T T (\lambda (u3: T).(\lambda (t2: T).(eq T t (THead (Bind +Abst) u3 t2)))) (\lambda (u3: T).(\lambda (_: T).(pr0 u1 u3))) (\lambda (_: +T).(\lambda (t2: T).(pr0 t1 t2))))) (let H7 \def (f_equal T K (\lambda (e: +T).(match e in T return (\lambda (_: T).K) with [(TSort _) \Rightarrow k | +(TLRef _) \Rightarrow k | (THead k0 _ _) \Rightarrow k0])) (THead k u0 t0) +(THead (Bind Abst) u1 t1) H2) in ((let H8 \def (f_equal T T (\lambda (e: +T).(match e in T return (\lambda (_: T).T) with [(TSort _) \Rightarrow u0 | +(TLRef _) \Rightarrow u0 | (THead _ t _) \Rightarrow t])) (THead k u0 t0) +(THead (Bind Abst) u1 t1) H2) in ((let H9 \def (f_equal T T (\lambda (e: +T).(match e in T return (\lambda (_: T).T) with [(TSort _) \Rightarrow t0 | +(TLRef _) \Rightarrow t0 | (THead _ _ t) \Rightarrow t])) (THead k u0 t0) +(THead (Bind Abst) u1 t1) H2) in (\lambda (H10: (eq T u0 u1)).(\lambda (H11: +(eq K k (Bind Abst))).(let H12 \def (eq_ind K k (\lambda (k0: K).(pr0 (THead +(Bind Abst) u1 t1) (THead k0 u2 t3))) H6 (Bind Abst) H11) in (let H13 \def +(eq_ind K k (\lambda (k0: K).(pr0 (THead (Bind Abst) u1 t1) (THead k0 u2 +t3))) H5 (Bind Abst) H11) in (eq_ind_r K (Bind Abst) (\lambda (k0: K).(ex3_2 +T T (\lambda (u3: T).(\lambda (t2: T).(eq T (THead k0 u2 t3) (THead (Bind +Abst) u3 t2)))) (\lambda (u3: T).(\lambda (_: T).(pr0 u1 u3))) (\lambda (_: +T).(\lambda (t2: T).(pr0 t1 t2))))) (let H14 \def (eq_ind T t0 (\lambda (t: +T).(pr0 t t3)) H4 t1 H9) in (let H15 \def (eq_ind T u0 (\lambda (t: T).(pr0 t +u2)) H1 u1 H10) in (ex3_2_intro T T (\lambda (u3: T).(\lambda (t2: T).(eq T +(THead (Bind Abst) u2 t3) (THead (Bind Abst) u3 t2)))) (\lambda (u3: +T).(\lambda (_: T).(pr0 u1 u3))) (\lambda (_: T).(\lambda (t2: T).(pr0 t1 +t2))) u2 t3 (refl_equal T (THead (Bind Abst) u2 t3)) H15 H14))) k H11)))))) +H8)) H7)) x H3))))))))))))) (\lambda (H0: (pr0 (THead (Bind Abst) u1 t1) +x)).(\lambda (u: T).(\lambda (v1: T).(\lambda (v2: T).(\lambda (t0: +T).(\lambda (t3: T).(\lambda (H2: (eq T (THead (Flat Appl) v1 (THead (Bind +Abst) u t0)) (THead (Bind Abst) u1 t1))).(\lambda (H3: (eq T (THead (Bind +Abbr) v2 t3) x)).(\lambda (_: (pr0 v1 v2)).(\lambda (_: (pr0 t0 t3)).(let H5 +\def (eq_ind_r T x (\lambda (t: T).(pr0 (THead (Bind Abst) u1 t1) t)) H0 +(THead (Bind Abbr) v2 t3) H3) in (let H6 \def (eq_ind_r T x (\lambda (t: +T).(pr0 (THead (Bind Abst) u1 t1) t)) H (THead (Bind Abbr) v2 t3) H3) in +(eq_ind T (THead (Bind Abbr) v2 t3) (\lambda (t: T).(ex3_2 T T (\lambda (u2: +T).(\lambda (t2: T).(eq T t (THead (Bind Abst) u2 t2)))) (\lambda (u2: +T).(\lambda (_: T).(pr0 u1 u2))) (\lambda (_: T).(\lambda (t2: T).(pr0 t1 +t2))))) (let H7 \def (eq_ind T (THead (Flat Appl) v1 (THead (Bind Abst) u +t0)) (\lambda (ee: T).(match ee in T return (\lambda (_: T).Prop) with +[(TSort _) \Rightarrow False | (TLRef _) \Rightarrow False | (THead k _ _) +\Rightarrow (match k in K return (\lambda (_: K).Prop) with [(Bind _) +\Rightarrow False | (Flat _) \Rightarrow True])])) I (THead (Bind Abst) u1 +t1) H2) in (False_ind (ex3_2 T T (\lambda (u2: T).(\lambda (t2: T).(eq T +(THead (Bind Abbr) v2 t3) (THead (Bind Abst) u2 t2)))) (\lambda (u2: +T).(\lambda (_: T).(pr0 u1 u2))) (\lambda (_: T).(\lambda (t2: T).(pr0 t1 +t2)))) H7)) x H3))))))))))))) (\lambda (H0: (pr0 (THead (Bind Abst) u1 t1) +x)).(\lambda (b: B).(\lambda (v1: T).(\lambda (v2: T).(\lambda (u0: +T).(\lambda (u2: T).(\lambda (t0: T).(\lambda (t3: T).(\lambda (H4: (eq T +(THead (Flat Appl) v1 (THead (Bind b) u0 t0)) (THead (Bind Abst) u1 +t1))).(\lambda (H5: (eq T (THead (Bind b) u2 (THead (Flat Appl) (lift (S O) O +v2) t3)) x)).(\lambda (_: (not (eq B b Abst))).(\lambda (_: (pr0 v1 +v2)).(\lambda (_: (pr0 u0 u2)).(\lambda (_: (pr0 t0 t3)).(let H7 \def +(eq_ind_r T x (\lambda (t: T).(pr0 (THead (Bind Abst) u1 t1) t)) H0 (THead +(Bind b) u2 (THead (Flat Appl) (lift (S O) O v2) t3)) H5) in (let H8 \def +(eq_ind_r T x (\lambda (t: T).(pr0 (THead (Bind Abst) u1 t1) t)) H (THead +(Bind b) u2 (THead (Flat Appl) (lift (S O) O v2) t3)) H5) in (eq_ind T (THead +(Bind b) u2 (THead (Flat Appl) (lift (S O) O v2) t3)) (\lambda (t: T).(ex3_2 +T T (\lambda (u3: T).(\lambda (t2: T).(eq T t (THead (Bind Abst) u3 t2)))) +(\lambda (u3: T).(\lambda (_: T).(pr0 u1 u3))) (\lambda (_: T).(\lambda (t2: +T).(pr0 t1 t2))))) (let H9 \def (eq_ind T (THead (Flat Appl) v1 (THead (Bind +b) u0 t0)) (\lambda (ee: T).(match ee in T return (\lambda (_: T).Prop) with +[(TSort _) \Rightarrow False | (TLRef _) \Rightarrow False | (THead k _ _) +\Rightarrow (match k in K return (\lambda (_: K).Prop) with [(Bind _) +\Rightarrow False | (Flat _) \Rightarrow True])])) I (THead (Bind Abst) u1 +t1) H4) in (False_ind (ex3_2 T T (\lambda (u3: T).(\lambda (t2: T).(eq T +(THead (Bind b) u2 (THead (Flat Appl) (lift (S O) O v2) t3)) (THead (Bind +Abst) u3 t2)))) (\lambda (u3: T).(\lambda (_: T).(pr0 u1 u3))) (\lambda (_: +T).(\lambda (t2: T).(pr0 t1 t2)))) H9)) x H5))))))))))))))))) (\lambda (H0: +(pr0 (THead (Bind Abst) u1 t1) x)).(\lambda (u0: T).(\lambda (u2: T).(\lambda +(t0: T).(\lambda (t3: T).(\lambda (w: T).(\lambda (H3: (eq T (THead (Bind +Abbr) u0 t0) (THead (Bind Abst) u1 t1))).(\lambda (H4: (eq T (THead (Bind +Abbr) u2 w) x)).(\lambda (_: (pr0 u0 u2)).(\lambda (_: (pr0 t0 t3)).(\lambda +(_: (subst0 O u2 t3 w)).(let H6 \def (eq_ind_r T x (\lambda (t: T).(pr0 +(THead (Bind Abst) u1 t1) t)) H0 (THead (Bind Abbr) u2 w) H4) in (let H7 \def +(eq_ind_r T x (\lambda (t: T).(pr0 (THead (Bind Abst) u1 t1) t)) H (THead +(Bind Abbr) u2 w) H4) in (eq_ind T (THead (Bind Abbr) u2 w) (\lambda (t: +T).(ex3_2 T T (\lambda (u3: T).(\lambda (t2: T).(eq T t (THead (Bind Abst) u3 +t2)))) (\lambda (u3: T).(\lambda (_: T).(pr0 u1 u3))) (\lambda (_: +T).(\lambda (t2: T).(pr0 t1 t2))))) (let H8 \def (eq_ind T (THead (Bind Abbr) +u0 t0) (\lambda (ee: T).(match ee in T return (\lambda (_: T).Prop) with +[(TSort _) \Rightarrow False | (TLRef _) \Rightarrow False | (THead k _ _) +\Rightarrow (match k in K return (\lambda (_: K).Prop) with [(Bind b) +\Rightarrow (match b in B return (\lambda (_: B).Prop) with [Abbr \Rightarrow +True | Abst \Rightarrow False | Void \Rightarrow False]) | (Flat _) +\Rightarrow False])])) I (THead (Bind Abst) u1 t1) H3) in (False_ind (ex3_2 T +T (\lambda (u3: T).(\lambda (t2: T).(eq T (THead (Bind Abbr) u2 w) (THead +(Bind Abst) u3 t2)))) (\lambda (u3: T).(\lambda (_: T).(pr0 u1 u3))) (\lambda +(_: T).(\lambda (t2: T).(pr0 t1 t2)))) H8)) x H4)))))))))))))) (\lambda (H0: +(pr0 (THead (Bind Abst) u1 t1) x)).(\lambda (b: B).(\lambda (t0: T).(\lambda +(t3: T).(\lambda (u: T).(\lambda (H2: (eq T (THead (Bind b) u (lift (S O) O +t0)) (THead (Bind Abst) u1 t1))).(\lambda (H3: (eq T t3 x)).(\lambda (H1: +(not (eq B b Abst))).(\lambda (H4: (pr0 t0 t3)).(let H5 \def (eq_ind T t3 +(\lambda (t: T).(pr0 t0 t)) H4 x H3) in (let H6 \def (f_equal T B (\lambda +(e: T).(match e in T return (\lambda (_: T).B) with [(TSort _) \Rightarrow b +| (TLRef _) \Rightarrow b | (THead k _ _) \Rightarrow (match k in K return +(\lambda (_: K).B) with [(Bind b0) \Rightarrow b0 | (Flat _) \Rightarrow +b])])) (THead (Bind b) u (lift (S O) O t0)) (THead (Bind Abst) u1 t1) H2) in +((let H7 \def (f_equal T T (\lambda (e: T).(match e in T return (\lambda (_: +T).T) with [(TSort _) \Rightarrow u | (TLRef _) \Rightarrow u | (THead _ t _) +\Rightarrow t])) (THead (Bind b) u (lift (S O) O t0)) (THead (Bind Abst) u1 +t1) H2) in ((let H8 \def (f_equal T T (\lambda (e: T).(match e in T return +(\lambda (_: T).T) with [(TSort _) \Rightarrow ((let rec lref_map (f: ((nat +\to nat))) (d: nat) (t: T) on t: T \def (match t with [(TSort n) \Rightarrow +(TSort n) | (TLRef i) \Rightarrow (TLRef (match (blt i d) with [true +\Rightarrow i | false \Rightarrow (f i)])) | (THead k u0 t2) \Rightarrow +(THead k (lref_map f d u0) (lref_map f (s k d) t2))]) in lref_map) (\lambda +(x0: nat).(plus x0 (S O))) O t0) | (TLRef _) \Rightarrow ((let rec lref_map +(f: ((nat \to nat))) (d: nat) (t: T) on t: T \def (match t with [(TSort n) +\Rightarrow (TSort n) | (TLRef i) \Rightarrow (TLRef (match (blt i d) with +[true \Rightarrow i | false \Rightarrow (f i)])) | (THead k u0 t2) +\Rightarrow (THead k (lref_map f d u0) (lref_map f (s k d) t2))]) in +lref_map) (\lambda (x0: nat).(plus x0 (S O))) O t0) | (THead _ _ t) +\Rightarrow t])) (THead (Bind b) u (lift (S O) O t0)) (THead (Bind Abst) u1 +t1) H2) in (\lambda (_: (eq T u u1)).(\lambda (H10: (eq B b Abst)).(let H11 +\def (eq_ind B b (\lambda (b0: B).(not (eq B b0 Abst))) H1 Abst H10) in (let +H12 \def (eq_ind_r T t1 (\lambda (t: T).(pr0 (THead (Bind Abst) u1 t) x)) H0 +(lift (S O) O t0) H8) in (let H13 \def (eq_ind_r T t1 (\lambda (t: T).(pr0 +(THead (Bind Abst) u1 t) x)) H (lift (S O) O t0) H8) in (eq_ind T (lift (S O) +O t0) (\lambda (t: T).(ex3_2 T T (\lambda (u2: T).(\lambda (t2: T).(eq T x +(THead (Bind Abst) u2 t2)))) (\lambda (u2: T).(\lambda (_: T).(pr0 u1 u2))) +(\lambda (_: T).(\lambda (t2: T).(pr0 t t2))))) (let H14 \def (match (H11 +(refl_equal B Abst)) in False return (\lambda (_: False).(ex3_2 T T (\lambda +(u2: T).(\lambda (t2: T).(eq T x (THead (Bind Abst) u2 t2)))) (\lambda (u2: +T).(\lambda (_: T).(pr0 u1 u2))) (\lambda (_: T).(\lambda (t2: T).(pr0 (lift +(S O) O t0) t2))))) with []) in H14) t1 H8))))))) H7)) H6)))))))))))) +(\lambda (_: (pr0 (THead (Bind Abst) u1 t1) x)).(\lambda (t0: T).(\lambda +(t3: T).(\lambda (u: T).(\lambda (H1: (eq T (THead (Flat Cast) u t0) (THead +(Bind Abst) u1 t1))).(\lambda (H2: (eq T t3 x)).(\lambda (H3: (pr0 t0 +t3)).(let H4 \def (eq_ind T t3 (\lambda (t: T).(pr0 t0 t)) H3 x H2) in (let +H5 \def (eq_ind T (THead (Flat Cast) u t0) (\lambda (ee: T).(match ee in T +return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) +\Rightarrow False | (THead k _ _) \Rightarrow (match k in K return (\lambda +(_: K).Prop) with [(Bind _) \Rightarrow False | (Flat _) \Rightarrow +True])])) I (THead (Bind Abst) u1 t1) H1) in (False_ind (ex3_2 T T (\lambda +(u2: T).(\lambda (t2: T).(eq T x (THead (Bind Abst) u2 t2)))) (\lambda (u2: +T).(\lambda (_: T).(pr0 u1 u2))) (\lambda (_: T).(\lambda (t2: T).(pr0 t1 +t2)))) H5)))))))))) H)))). -axiom pr0_gen_appl: +theorem pr0_gen_appl: \forall (u1: T).(\forall (t1: T).(\forall (x: T).((pr0 (THead (Flat Appl) u1 t1) x) \to (or3 (ex3_2 T T (\lambda (u2: T).(\lambda (t2: T).(eq T x (THead (Flat Appl) u2 t2)))) (\lambda (u2: T).(\lambda (_: T).(pr0 u1 u2))) (\lambda @@ -54,33 +433,1304 @@ u1 u2))))))) (\lambda (_: B).(\lambda (y1: T).(\lambda (_: T).(\lambda (_: T).(\lambda (v2: T).(\lambda (_: T).(pr0 y1 v2))))))) (\lambda (_: B).(\lambda (_: T).(\lambda (z1: T).(\lambda (_: T).(\lambda (_: T).(\lambda (t2: T).(pr0 z1 t2)))))))))))) -. +\def + \lambda (u1: T).(\lambda (t1: T).(\lambda (x: T).(\lambda (H: (pr0 (THead +(Flat Appl) u1 t1) x)).(pr0_inv_coq (THead (Flat Appl) u1 t1) x (\lambda (_: +T).(\lambda (t0: T).(or3 (ex3_2 T T (\lambda (u2: T).(\lambda (t2: T).(eq T +t0 (THead (Flat Appl) u2 t2)))) (\lambda (u2: T).(\lambda (_: T).(pr0 u1 +u2))) (\lambda (_: T).(\lambda (t2: T).(pr0 t1 t2)))) (ex4_4 T T T T (\lambda +(y1: T).(\lambda (z1: T).(\lambda (_: T).(\lambda (_: T).(eq T t1 (THead +(Bind Abst) y1 z1)))))) (\lambda (_: T).(\lambda (_: T).(\lambda (u2: +T).(\lambda (t2: T).(eq T t0 (THead (Bind Abbr) u2 t2)))))) (\lambda (_: +T).(\lambda (_: T).(\lambda (u2: T).(\lambda (_: T).(pr0 u1 u2))))) (\lambda +(_: T).(\lambda (z1: T).(\lambda (_: T).(\lambda (t2: T).(pr0 z1 t2)))))) +(ex6_6 B T T T T T (\lambda (b: B).(\lambda (_: T).(\lambda (_: T).(\lambda +(_: T).(\lambda (_: T).(\lambda (_: T).(not (eq B b Abst)))))))) (\lambda (b: +B).(\lambda (y1: T).(\lambda (z1: T).(\lambda (_: T).(\lambda (_: T).(\lambda +(_: T).(eq T t1 (THead (Bind b) y1 z1)))))))) (\lambda (b: B).(\lambda (_: +T).(\lambda (_: T).(\lambda (u2: T).(\lambda (v2: T).(\lambda (t2: T).(eq T +t0 (THead (Bind b) v2 (THead (Flat Appl) (lift (S O) O u2) t2))))))))) +(\lambda (_: B).(\lambda (_: T).(\lambda (_: T).(\lambda (u2: T).(\lambda (_: +T).(\lambda (_: T).(pr0 u1 u2))))))) (\lambda (_: B).(\lambda (y1: +T).(\lambda (_: T).(\lambda (_: T).(\lambda (v2: T).(\lambda (_: T).(pr0 y1 +v2))))))) (\lambda (_: B).(\lambda (_: T).(\lambda (z1: T).(\lambda (_: +T).(\lambda (_: T).(\lambda (t2: T).(pr0 z1 t2))))))))))) (\lambda (H0: (pr0 +(THead (Flat Appl) u1 t1) x)).(\lambda (t: T).(\lambda (H1: (eq T t (THead +(Flat Appl) u1 t1))).(\lambda (H2: (eq T t x)).(let H3 \def (eq_ind T t +(\lambda (t0: T).(eq T t0 (THead (Flat Appl) u1 t1))) H1 x H2) in (let H4 +\def (eq_ind T x (\lambda (t0: T).(pr0 (THead (Flat Appl) u1 t1) t0)) H0 +(THead (Flat Appl) u1 t1) H3) in (let H5 \def (eq_ind T x (\lambda (t0: +T).(pr0 (THead (Flat Appl) u1 t1) t0)) H (THead (Flat Appl) u1 t1) H3) in +(eq_ind_r T (THead (Flat Appl) u1 t1) (\lambda (t0: T).(or3 (ex3_2 T T +(\lambda (u2: T).(\lambda (t2: T).(eq T t0 (THead (Flat Appl) u2 t2)))) +(\lambda (u2: T).(\lambda (_: T).(pr0 u1 u2))) (\lambda (_: T).(\lambda (t2: +T).(pr0 t1 t2)))) (ex4_4 T T T T (\lambda (y1: T).(\lambda (z1: T).(\lambda +(_: T).(\lambda (_: T).(eq T t1 (THead (Bind Abst) y1 z1)))))) (\lambda (_: +T).(\lambda (_: T).(\lambda (u2: T).(\lambda (t2: T).(eq T t0 (THead (Bind +Abbr) u2 t2)))))) (\lambda (_: T).(\lambda (_: T).(\lambda (u2: T).(\lambda +(_: T).(pr0 u1 u2))))) (\lambda (_: T).(\lambda (z1: T).(\lambda (_: +T).(\lambda (t2: T).(pr0 z1 t2)))))) (ex6_6 B T T T T T (\lambda (b: +B).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(\lambda +(_: T).(not (eq B b Abst)))))))) (\lambda (b: B).(\lambda (y1: T).(\lambda +(z1: T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(eq T t1 (THead (Bind +b) y1 z1)))))))) (\lambda (b: B).(\lambda (_: T).(\lambda (_: T).(\lambda +(u2: T).(\lambda (v2: T).(\lambda (t2: T).(eq T t0 (THead (Bind b) v2 (THead +(Flat Appl) (lift (S O) O u2) t2))))))))) (\lambda (_: B).(\lambda (_: +T).(\lambda (_: T).(\lambda (u2: T).(\lambda (_: T).(\lambda (_: T).(pr0 u1 +u2))))))) (\lambda (_: B).(\lambda (y1: T).(\lambda (_: T).(\lambda (_: +T).(\lambda (v2: T).(\lambda (_: T).(pr0 y1 v2))))))) (\lambda (_: +B).(\lambda (_: T).(\lambda (z1: T).(\lambda (_: T).(\lambda (_: T).(\lambda +(t2: T).(pr0 z1 t2)))))))))) (or3_intro0 (ex3_2 T T (\lambda (u2: T).(\lambda +(t2: T).(eq T (THead (Flat Appl) u1 t1) (THead (Flat Appl) u2 t2)))) (\lambda +(u2: T).(\lambda (_: T).(pr0 u1 u2))) (\lambda (_: T).(\lambda (t2: T).(pr0 +t1 t2)))) (ex4_4 T T T T (\lambda (y1: T).(\lambda (z1: T).(\lambda (_: +T).(\lambda (_: T).(eq T t1 (THead (Bind Abst) y1 z1)))))) (\lambda (_: +T).(\lambda (_: T).(\lambda (u2: T).(\lambda (t2: T).(eq T (THead (Flat Appl) +u1 t1) (THead (Bind Abbr) u2 t2)))))) (\lambda (_: T).(\lambda (_: +T).(\lambda (u2: T).(\lambda (_: T).(pr0 u1 u2))))) (\lambda (_: T).(\lambda +(z1: T).(\lambda (_: T).(\lambda (t2: T).(pr0 z1 t2)))))) (ex6_6 B T T T T T +(\lambda (b: B).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: +T).(\lambda (_: T).(not (eq B b Abst)))))))) (\lambda (b: B).(\lambda (y1: +T).(\lambda (z1: T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(eq T t1 +(THead (Bind b) y1 z1)))))))) (\lambda (b: B).(\lambda (_: T).(\lambda (_: +T).(\lambda (u2: T).(\lambda (v2: T).(\lambda (t2: T).(eq T (THead (Flat +Appl) u1 t1) (THead (Bind b) v2 (THead (Flat Appl) (lift (S O) O u2) +t2))))))))) (\lambda (_: B).(\lambda (_: T).(\lambda (_: T).(\lambda (u2: +T).(\lambda (_: T).(\lambda (_: T).(pr0 u1 u2))))))) (\lambda (_: B).(\lambda +(y1: T).(\lambda (_: T).(\lambda (_: T).(\lambda (v2: T).(\lambda (_: T).(pr0 +y1 v2))))))) (\lambda (_: B).(\lambda (_: T).(\lambda (z1: T).(\lambda (_: +T).(\lambda (_: T).(\lambda (t2: T).(pr0 z1 t2)))))))) (ex3_2_intro T T +(\lambda (u2: T).(\lambda (t2: T).(eq T (THead (Flat Appl) u1 t1) (THead +(Flat Appl) u2 t2)))) (\lambda (u2: T).(\lambda (_: T).(pr0 u1 u2))) (\lambda +(_: T).(\lambda (t2: T).(pr0 t1 t2))) u1 t1 (refl_equal T (THead (Flat Appl) +u1 t1)) (pr0_refl u1) (pr0_refl t1))) x H3)))))))) (\lambda (H0: (pr0 (THead +(Flat Appl) u1 t1) x)).(\lambda (u0: T).(\lambda (u2: T).(\lambda (t0: +T).(\lambda (t3: T).(\lambda (k: K).(\lambda (H2: (eq T (THead k u0 t0) +(THead (Flat Appl) u1 t1))).(\lambda (H3: (eq T (THead k u2 t3) x)).(\lambda +(H1: (pr0 u0 u2)).(\lambda (H4: (pr0 t0 t3)).(let H5 \def (eq_ind_r T x +(\lambda (t: T).(pr0 (THead (Flat Appl) u1 t1) t)) H0 (THead k u2 t3) H3) in +(let H6 \def (eq_ind_r T x (\lambda (t: T).(pr0 (THead (Flat Appl) u1 t1) t)) +H (THead k u2 t3) H3) in (eq_ind T (THead k u2 t3) (\lambda (t: T).(or3 +(ex3_2 T T (\lambda (u3: T).(\lambda (t2: T).(eq T t (THead (Flat Appl) u3 +t2)))) (\lambda (u3: T).(\lambda (_: T).(pr0 u1 u3))) (\lambda (_: +T).(\lambda (t2: T).(pr0 t1 t2)))) (ex4_4 T T T T (\lambda (y1: T).(\lambda +(z1: T).(\lambda (_: T).(\lambda (_: T).(eq T t1 (THead (Bind Abst) y1 +z1)))))) (\lambda (_: T).(\lambda (_: T).(\lambda (u3: T).(\lambda (t2: +T).(eq T t (THead (Bind Abbr) u3 t2)))))) (\lambda (_: T).(\lambda (_: +T).(\lambda (u3: T).(\lambda (_: T).(pr0 u1 u3))))) (\lambda (_: T).(\lambda +(z1: T).(\lambda (_: T).(\lambda (t2: T).(pr0 z1 t2)))))) (ex6_6 B T T T T T +(\lambda (b: B).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: +T).(\lambda (_: T).(not (eq B b Abst)))))))) (\lambda (b: B).(\lambda (y1: +T).(\lambda (z1: T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(eq T t1 +(THead (Bind b) y1 z1)))))))) (\lambda (b: B).(\lambda (_: T).(\lambda (_: +T).(\lambda (u3: T).(\lambda (v2: T).(\lambda (t2: T).(eq T t (THead (Bind b) +v2 (THead (Flat Appl) (lift (S O) O u3) t2))))))))) (\lambda (_: B).(\lambda +(_: T).(\lambda (_: T).(\lambda (u3: T).(\lambda (_: T).(\lambda (_: T).(pr0 +u1 u3))))))) (\lambda (_: B).(\lambda (y1: T).(\lambda (_: T).(\lambda (_: +T).(\lambda (v2: T).(\lambda (_: T).(pr0 y1 v2))))))) (\lambda (_: +B).(\lambda (_: T).(\lambda (z1: T).(\lambda (_: T).(\lambda (_: T).(\lambda +(t2: T).(pr0 z1 t2)))))))))) (let H7 \def (f_equal T K (\lambda (e: T).(match +e in T return (\lambda (_: T).K) with [(TSort _) \Rightarrow k | (TLRef _) +\Rightarrow k | (THead k0 _ _) \Rightarrow k0])) (THead k u0 t0) (THead (Flat +Appl) u1 t1) H2) in ((let H8 \def (f_equal T T (\lambda (e: T).(match e in T +return (\lambda (_: T).T) with [(TSort _) \Rightarrow u0 | (TLRef _) +\Rightarrow u0 | (THead _ t _) \Rightarrow t])) (THead k u0 t0) (THead (Flat +Appl) u1 t1) H2) in ((let H9 \def (f_equal T T (\lambda (e: T).(match e in T +return (\lambda (_: T).T) with [(TSort _) \Rightarrow t0 | (TLRef _) +\Rightarrow t0 | (THead _ _ t) \Rightarrow t])) (THead k u0 t0) (THead (Flat +Appl) u1 t1) H2) in (\lambda (H10: (eq T u0 u1)).(\lambda (H11: (eq K k (Flat +Appl))).(let H12 \def (eq_ind K k (\lambda (k0: K).(pr0 (THead (Flat Appl) u1 +t1) (THead k0 u2 t3))) H6 (Flat Appl) H11) in (let H13 \def (eq_ind K k +(\lambda (k0: K).(pr0 (THead (Flat Appl) u1 t1) (THead k0 u2 t3))) H5 (Flat +Appl) H11) in (eq_ind_r K (Flat Appl) (\lambda (k0: K).(or3 (ex3_2 T T +(\lambda (u3: T).(\lambda (t2: T).(eq T (THead k0 u2 t3) (THead (Flat Appl) +u3 t2)))) (\lambda (u3: T).(\lambda (_: T).(pr0 u1 u3))) (\lambda (_: +T).(\lambda (t2: T).(pr0 t1 t2)))) (ex4_4 T T T T (\lambda (y1: T).(\lambda +(z1: T).(\lambda (_: T).(\lambda (_: T).(eq T t1 (THead (Bind Abst) y1 +z1)))))) (\lambda (_: T).(\lambda (_: T).(\lambda (u3: T).(\lambda (t2: +T).(eq T (THead k0 u2 t3) (THead (Bind Abbr) u3 t2)))))) (\lambda (_: +T).(\lambda (_: T).(\lambda (u3: T).(\lambda (_: T).(pr0 u1 u3))))) (\lambda +(_: T).(\lambda (z1: T).(\lambda (_: T).(\lambda (t2: T).(pr0 z1 t2)))))) +(ex6_6 B T T T T T (\lambda (b: B).(\lambda (_: T).(\lambda (_: T).(\lambda +(_: T).(\lambda (_: T).(\lambda (_: T).(not (eq B b Abst)))))))) (\lambda (b: +B).(\lambda (y1: T).(\lambda (z1: T).(\lambda (_: T).(\lambda (_: T).(\lambda +(_: T).(eq T t1 (THead (Bind b) y1 z1)))))))) (\lambda (b: B).(\lambda (_: +T).(\lambda (_: T).(\lambda (u3: T).(\lambda (v2: T).(\lambda (t2: T).(eq T +(THead k0 u2 t3) (THead (Bind b) v2 (THead (Flat Appl) (lift (S O) O u3) +t2))))))))) (\lambda (_: B).(\lambda (_: T).(\lambda (_: T).(\lambda (u3: +T).(\lambda (_: T).(\lambda (_: T).(pr0 u1 u3))))))) (\lambda (_: B).(\lambda +(y1: T).(\lambda (_: T).(\lambda (_: T).(\lambda (v2: T).(\lambda (_: T).(pr0 +y1 v2))))))) (\lambda (_: B).(\lambda (_: T).(\lambda (z1: T).(\lambda (_: +T).(\lambda (_: T).(\lambda (t2: T).(pr0 z1 t2)))))))))) (let H14 \def +(eq_ind T t0 (\lambda (t: T).(pr0 t t3)) H4 t1 H9) in (let H15 \def (eq_ind T +u0 (\lambda (t: T).(pr0 t u2)) H1 u1 H10) in (or3_intro0 (ex3_2 T T (\lambda +(u3: T).(\lambda (t2: T).(eq T (THead (Flat Appl) u2 t3) (THead (Flat Appl) +u3 t2)))) (\lambda (u3: T).(\lambda (_: T).(pr0 u1 u3))) (\lambda (_: +T).(\lambda (t2: T).(pr0 t1 t2)))) (ex4_4 T T T T (\lambda (y1: T).(\lambda +(z1: T).(\lambda (_: T).(\lambda (_: T).(eq T t1 (THead (Bind Abst) y1 +z1)))))) (\lambda (_: T).(\lambda (_: T).(\lambda (u3: T).(\lambda (t2: +T).(eq T (THead (Flat Appl) u2 t3) (THead (Bind Abbr) u3 t2)))))) (\lambda +(_: T).(\lambda (_: T).(\lambda (u3: T).(\lambda (_: T).(pr0 u1 u3))))) +(\lambda (_: T).(\lambda (z1: T).(\lambda (_: T).(\lambda (t2: T).(pr0 z1 +t2)))))) (ex6_6 B T T T T T (\lambda (b: B).(\lambda (_: T).(\lambda (_: +T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(not (eq B b Abst)))))))) +(\lambda (b: B).(\lambda (y1: T).(\lambda (z1: T).(\lambda (_: T).(\lambda +(_: T).(\lambda (_: T).(eq T t1 (THead (Bind b) y1 z1)))))))) (\lambda (b: +B).(\lambda (_: T).(\lambda (_: T).(\lambda (u3: T).(\lambda (v2: T).(\lambda +(t2: T).(eq T (THead (Flat Appl) u2 t3) (THead (Bind b) v2 (THead (Flat Appl) +(lift (S O) O u3) t2))))))))) (\lambda (_: B).(\lambda (_: T).(\lambda (_: +T).(\lambda (u3: T).(\lambda (_: T).(\lambda (_: T).(pr0 u1 u3))))))) +(\lambda (_: B).(\lambda (y1: T).(\lambda (_: T).(\lambda (_: T).(\lambda +(v2: T).(\lambda (_: T).(pr0 y1 v2))))))) (\lambda (_: B).(\lambda (_: +T).(\lambda (z1: T).(\lambda (_: T).(\lambda (_: T).(\lambda (t2: T).(pr0 z1 +t2)))))))) (ex3_2_intro T T (\lambda (u3: T).(\lambda (t2: T).(eq T (THead +(Flat Appl) u2 t3) (THead (Flat Appl) u3 t2)))) (\lambda (u3: T).(\lambda (_: +T).(pr0 u1 u3))) (\lambda (_: T).(\lambda (t2: T).(pr0 t1 t2))) u2 t3 +(refl_equal T (THead (Flat Appl) u2 t3)) H15 H14)))) k H11)))))) H8)) H7)) x +H3))))))))))))) (\lambda (H0: (pr0 (THead (Flat Appl) u1 t1) x)).(\lambda (u: +T).(\lambda (v1: T).(\lambda (v2: T).(\lambda (t0: T).(\lambda (t3: +T).(\lambda (H2: (eq T (THead (Flat Appl) v1 (THead (Bind Abst) u t0)) (THead +(Flat Appl) u1 t1))).(\lambda (H3: (eq T (THead (Bind Abbr) v2 t3) +x)).(\lambda (H1: (pr0 v1 v2)).(\lambda (H4: (pr0 t0 t3)).(let H5 \def +(eq_ind_r T x (\lambda (t: T).(pr0 (THead (Flat Appl) u1 t1) t)) H0 (THead +(Bind Abbr) v2 t3) H3) in (let H6 \def (eq_ind_r T x (\lambda (t: T).(pr0 +(THead (Flat Appl) u1 t1) t)) H (THead (Bind Abbr) v2 t3) H3) in (eq_ind T +(THead (Bind Abbr) v2 t3) (\lambda (t: T).(or3 (ex3_2 T T (\lambda (u2: +T).(\lambda (t2: T).(eq T t (THead (Flat Appl) u2 t2)))) (\lambda (u2: +T).(\lambda (_: T).(pr0 u1 u2))) (\lambda (_: T).(\lambda (t2: T).(pr0 t1 +t2)))) (ex4_4 T T T T (\lambda (y1: T).(\lambda (z1: T).(\lambda (_: +T).(\lambda (_: T).(eq T t1 (THead (Bind Abst) y1 z1)))))) (\lambda (_: +T).(\lambda (_: T).(\lambda (u2: T).(\lambda (t2: T).(eq T t (THead (Bind +Abbr) u2 t2)))))) (\lambda (_: T).(\lambda (_: T).(\lambda (u2: T).(\lambda +(_: T).(pr0 u1 u2))))) (\lambda (_: T).(\lambda (z1: T).(\lambda (_: +T).(\lambda (t2: T).(pr0 z1 t2)))))) (ex6_6 B T T T T T (\lambda (b: +B).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(\lambda +(_: T).(not (eq B b Abst)))))))) (\lambda (b: B).(\lambda (y1: T).(\lambda +(z1: T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(eq T t1 (THead (Bind +b) y1 z1)))))))) (\lambda (b: B).(\lambda (_: T).(\lambda (_: T).(\lambda +(u2: T).(\lambda (v3: T).(\lambda (t2: T).(eq T t (THead (Bind b) v3 (THead +(Flat Appl) (lift (S O) O u2) t2))))))))) (\lambda (_: B).(\lambda (_: +T).(\lambda (_: T).(\lambda (u2: T).(\lambda (_: T).(\lambda (_: T).(pr0 u1 +u2))))))) (\lambda (_: B).(\lambda (y1: T).(\lambda (_: T).(\lambda (_: +T).(\lambda (v3: T).(\lambda (_: T).(pr0 y1 v3))))))) (\lambda (_: +B).(\lambda (_: T).(\lambda (z1: T).(\lambda (_: T).(\lambda (_: T).(\lambda +(t2: T).(pr0 z1 t2)))))))))) (let H7 \def (f_equal T T (\lambda (e: T).(match +e in T return (\lambda (_: T).T) with [(TSort _) \Rightarrow v1 | (TLRef _) +\Rightarrow v1 | (THead _ t _) \Rightarrow t])) (THead (Flat Appl) v1 (THead +(Bind Abst) u t0)) (THead (Flat Appl) u1 t1) H2) in ((let H8 \def (f_equal T +T (\lambda (e: T).(match e in T return (\lambda (_: T).T) with [(TSort _) +\Rightarrow (THead (Bind Abst) u t0) | (TLRef _) \Rightarrow (THead (Bind +Abst) u t0) | (THead _ _ t) \Rightarrow t])) (THead (Flat Appl) v1 (THead +(Bind Abst) u t0)) (THead (Flat Appl) u1 t1) H2) in (\lambda (H9: (eq T v1 +u1)).(let H10 \def (eq_ind T v1 (\lambda (t: T).(pr0 t v2)) H1 u1 H9) in (let +H11 \def (eq_ind_r T t1 (\lambda (t: T).(pr0 (THead (Flat Appl) u1 t) (THead +(Bind Abbr) v2 t3))) H6 (THead (Bind Abst) u t0) H8) in (let H12 \def +(eq_ind_r T t1 (\lambda (t: T).(pr0 (THead (Flat Appl) u1 t) (THead (Bind +Abbr) v2 t3))) H5 (THead (Bind Abst) u t0) H8) in (eq_ind T (THead (Bind +Abst) u t0) (\lambda (t: T).(or3 (ex3_2 T T (\lambda (u2: T).(\lambda (t2: +T).(eq T (THead (Bind Abbr) v2 t3) (THead (Flat Appl) u2 t2)))) (\lambda (u2: +T).(\lambda (_: T).(pr0 u1 u2))) (\lambda (_: T).(\lambda (t2: T).(pr0 t +t2)))) (ex4_4 T T T T (\lambda (y1: T).(\lambda (z1: T).(\lambda (_: +T).(\lambda (_: T).(eq T t (THead (Bind Abst) y1 z1)))))) (\lambda (_: +T).(\lambda (_: T).(\lambda (u2: T).(\lambda (t2: T).(eq T (THead (Bind Abbr) +v2 t3) (THead (Bind Abbr) u2 t2)))))) (\lambda (_: T).(\lambda (_: +T).(\lambda (u2: T).(\lambda (_: T).(pr0 u1 u2))))) (\lambda (_: T).(\lambda +(z1: T).(\lambda (_: T).(\lambda (t2: T).(pr0 z1 t2)))))) (ex6_6 B T T T T T +(\lambda (b: B).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: +T).(\lambda (_: T).(not (eq B b Abst)))))))) (\lambda (b: B).(\lambda (y1: +T).(\lambda (z1: T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(eq T t +(THead (Bind b) y1 z1)))))))) (\lambda (b: B).(\lambda (_: T).(\lambda (_: +T).(\lambda (u2: T).(\lambda (v3: T).(\lambda (t2: T).(eq T (THead (Bind +Abbr) v2 t3) (THead (Bind b) v3 (THead (Flat Appl) (lift (S O) O u2) +t2))))))))) (\lambda (_: B).(\lambda (_: T).(\lambda (_: T).(\lambda (u2: +T).(\lambda (_: T).(\lambda (_: T).(pr0 u1 u2))))))) (\lambda (_: B).(\lambda +(y1: T).(\lambda (_: T).(\lambda (_: T).(\lambda (v3: T).(\lambda (_: T).(pr0 +y1 v3))))))) (\lambda (_: B).(\lambda (_: T).(\lambda (z1: T).(\lambda (_: +T).(\lambda (_: T).(\lambda (t2: T).(pr0 z1 t2)))))))))) (or3_intro1 (ex3_2 T +T (\lambda (u2: T).(\lambda (t2: T).(eq T (THead (Bind Abbr) v2 t3) (THead +(Flat Appl) u2 t2)))) (\lambda (u2: T).(\lambda (_: T).(pr0 u1 u2))) (\lambda +(_: T).(\lambda (t2: T).(pr0 (THead (Bind Abst) u t0) t2)))) (ex4_4 T T T T +(\lambda (y1: T).(\lambda (z1: T).(\lambda (_: T).(\lambda (_: T).(eq T +(THead (Bind Abst) u t0) (THead (Bind Abst) y1 z1)))))) (\lambda (_: +T).(\lambda (_: T).(\lambda (u2: T).(\lambda (t2: T).(eq T (THead (Bind Abbr) +v2 t3) (THead (Bind Abbr) u2 t2)))))) (\lambda (_: T).(\lambda (_: +T).(\lambda (u2: T).(\lambda (_: T).(pr0 u1 u2))))) (\lambda (_: T).(\lambda +(z1: T).(\lambda (_: T).(\lambda (t2: T).(pr0 z1 t2)))))) (ex6_6 B T T T T T +(\lambda (b: B).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: +T).(\lambda (_: T).(not (eq B b Abst)))))))) (\lambda (b: B).(\lambda (y1: +T).(\lambda (z1: T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(eq T +(THead (Bind Abst) u t0) (THead (Bind b) y1 z1)))))))) (\lambda (b: +B).(\lambda (_: T).(\lambda (_: T).(\lambda (u2: T).(\lambda (v3: T).(\lambda +(t2: T).(eq T (THead (Bind Abbr) v2 t3) (THead (Bind b) v3 (THead (Flat Appl) +(lift (S O) O u2) t2))))))))) (\lambda (_: B).(\lambda (_: T).(\lambda (_: +T).(\lambda (u2: T).(\lambda (_: T).(\lambda (_: T).(pr0 u1 u2))))))) +(\lambda (_: B).(\lambda (y1: T).(\lambda (_: T).(\lambda (_: T).(\lambda +(v3: T).(\lambda (_: T).(pr0 y1 v3))))))) (\lambda (_: B).(\lambda (_: +T).(\lambda (z1: T).(\lambda (_: T).(\lambda (_: T).(\lambda (t2: T).(pr0 z1 +t2)))))))) (ex4_4_intro T T T T (\lambda (y1: T).(\lambda (z1: T).(\lambda +(_: T).(\lambda (_: T).(eq T (THead (Bind Abst) u t0) (THead (Bind Abst) y1 +z1)))))) (\lambda (_: T).(\lambda (_: T).(\lambda (u2: T).(\lambda (t2: +T).(eq T (THead (Bind Abbr) v2 t3) (THead (Bind Abbr) u2 t2)))))) (\lambda +(_: T).(\lambda (_: T).(\lambda (u2: T).(\lambda (_: T).(pr0 u1 u2))))) +(\lambda (_: T).(\lambda (z1: T).(\lambda (_: T).(\lambda (t2: T).(pr0 z1 +t2))))) u t0 v2 t3 (refl_equal T (THead (Bind Abst) u t0)) (refl_equal T +(THead (Bind Abbr) v2 t3)) H10 H4)) t1 H8)))))) H7)) x H3))))))))))))) +(\lambda (H0: (pr0 (THead (Flat Appl) u1 t1) x)).(\lambda (b: B).(\lambda +(v1: T).(\lambda (v2: T).(\lambda (u0: T).(\lambda (u2: T).(\lambda (t0: +T).(\lambda (t3: T).(\lambda (H4: (eq T (THead (Flat Appl) v1 (THead (Bind b) +u0 t0)) (THead (Flat Appl) u1 t1))).(\lambda (H5: (eq T (THead (Bind b) u2 +(THead (Flat Appl) (lift (S O) O v2) t3)) x)).(\lambda (H1: (not (eq B b +Abst))).(\lambda (H2: (pr0 v1 v2)).(\lambda (H3: (pr0 u0 u2)).(\lambda (H6: +(pr0 t0 t3)).(let H7 \def (eq_ind_r T x (\lambda (t: T).(pr0 (THead (Flat +Appl) u1 t1) t)) H0 (THead (Bind b) u2 (THead (Flat Appl) (lift (S O) O v2) +t3)) H5) in (let H8 \def (eq_ind_r T x (\lambda (t: T).(pr0 (THead (Flat +Appl) u1 t1) t)) H (THead (Bind b) u2 (THead (Flat Appl) (lift (S O) O v2) +t3)) H5) in (eq_ind T (THead (Bind b) u2 (THead (Flat Appl) (lift (S O) O v2) +t3)) (\lambda (t: T).(or3 (ex3_2 T T (\lambda (u3: T).(\lambda (t2: T).(eq T +t (THead (Flat Appl) u3 t2)))) (\lambda (u3: T).(\lambda (_: T).(pr0 u1 u3))) +(\lambda (_: T).(\lambda (t2: T).(pr0 t1 t2)))) (ex4_4 T T T T (\lambda (y1: +T).(\lambda (z1: T).(\lambda (_: T).(\lambda (_: T).(eq T t1 (THead (Bind +Abst) y1 z1)))))) (\lambda (_: T).(\lambda (_: T).(\lambda (u3: T).(\lambda +(t2: T).(eq T t (THead (Bind Abbr) u3 t2)))))) (\lambda (_: T).(\lambda (_: +T).(\lambda (u3: T).(\lambda (_: T).(pr0 u1 u3))))) (\lambda (_: T).(\lambda +(z1: T).(\lambda (_: T).(\lambda (t2: T).(pr0 z1 t2)))))) (ex6_6 B T T T T T +(\lambda (b0: B).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: +T).(\lambda (_: T).(not (eq B b0 Abst)))))))) (\lambda (b0: B).(\lambda (y1: +T).(\lambda (z1: T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(eq T t1 +(THead (Bind b0) y1 z1)))))))) (\lambda (b0: B).(\lambda (_: T).(\lambda (_: +T).(\lambda (u3: T).(\lambda (v3: T).(\lambda (t2: T).(eq T t (THead (Bind +b0) v3 (THead (Flat Appl) (lift (S O) O u3) t2))))))))) (\lambda (_: +B).(\lambda (_: T).(\lambda (_: T).(\lambda (u3: T).(\lambda (_: T).(\lambda +(_: T).(pr0 u1 u3))))))) (\lambda (_: B).(\lambda (y1: T).(\lambda (_: +T).(\lambda (_: T).(\lambda (v3: T).(\lambda (_: T).(pr0 y1 v3))))))) +(\lambda (_: B).(\lambda (_: T).(\lambda (z1: T).(\lambda (_: T).(\lambda (_: +T).(\lambda (t2: T).(pr0 z1 t2)))))))))) (let H9 \def (f_equal T T (\lambda +(e: T).(match e in T return (\lambda (_: T).T) with [(TSort _) \Rightarrow v1 +| (TLRef _) \Rightarrow v1 | (THead _ t _) \Rightarrow t])) (THead (Flat +Appl) v1 (THead (Bind b) u0 t0)) (THead (Flat Appl) u1 t1) H4) in ((let H10 +\def (f_equal T T (\lambda (e: T).(match e in T return (\lambda (_: T).T) +with [(TSort _) \Rightarrow (THead (Bind b) u0 t0) | (TLRef _) \Rightarrow +(THead (Bind b) u0 t0) | (THead _ _ t) \Rightarrow t])) (THead (Flat Appl) v1 +(THead (Bind b) u0 t0)) (THead (Flat Appl) u1 t1) H4) in (\lambda (H11: (eq T +v1 u1)).(let H12 \def (eq_ind T v1 (\lambda (t: T).(pr0 t v2)) H2 u1 H11) in +(let H13 \def (eq_ind_r T t1 (\lambda (t: T).(pr0 (THead (Flat Appl) u1 t) +(THead (Bind b) u2 (THead (Flat Appl) (lift (S O) O v2) t3)))) H8 (THead +(Bind b) u0 t0) H10) in (let H14 \def (eq_ind_r T t1 (\lambda (t: T).(pr0 +(THead (Flat Appl) u1 t) (THead (Bind b) u2 (THead (Flat Appl) (lift (S O) O +v2) t3)))) H7 (THead (Bind b) u0 t0) H10) in (eq_ind T (THead (Bind b) u0 t0) +(\lambda (t: T).(or3 (ex3_2 T T (\lambda (u3: T).(\lambda (t2: T).(eq T +(THead (Bind b) u2 (THead (Flat Appl) (lift (S O) O v2) t3)) (THead (Flat +Appl) u3 t2)))) (\lambda (u3: T).(\lambda (_: T).(pr0 u1 u3))) (\lambda (_: +T).(\lambda (t2: T).(pr0 t t2)))) (ex4_4 T T T T (\lambda (y1: T).(\lambda +(z1: T).(\lambda (_: T).(\lambda (_: T).(eq T t (THead (Bind Abst) y1 +z1)))))) (\lambda (_: T).(\lambda (_: T).(\lambda (u3: T).(\lambda (t2: +T).(eq T (THead (Bind b) u2 (THead (Flat Appl) (lift (S O) O v2) t3)) (THead +(Bind Abbr) u3 t2)))))) (\lambda (_: T).(\lambda (_: T).(\lambda (u3: +T).(\lambda (_: T).(pr0 u1 u3))))) (\lambda (_: T).(\lambda (z1: T).(\lambda +(_: T).(\lambda (t2: T).(pr0 z1 t2)))))) (ex6_6 B T T T T T (\lambda (b0: +B).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(\lambda +(_: T).(not (eq B b0 Abst)))))))) (\lambda (b0: B).(\lambda (y1: T).(\lambda +(z1: T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(eq T t (THead (Bind +b0) y1 z1)))))))) (\lambda (b0: B).(\lambda (_: T).(\lambda (_: T).(\lambda +(u3: T).(\lambda (v3: T).(\lambda (t2: T).(eq T (THead (Bind b) u2 (THead +(Flat Appl) (lift (S O) O v2) t3)) (THead (Bind b0) v3 (THead (Flat Appl) +(lift (S O) O u3) t2))))))))) (\lambda (_: B).(\lambda (_: T).(\lambda (_: +T).(\lambda (u3: T).(\lambda (_: T).(\lambda (_: T).(pr0 u1 u3))))))) +(\lambda (_: B).(\lambda (y1: T).(\lambda (_: T).(\lambda (_: T).(\lambda +(v3: T).(\lambda (_: T).(pr0 y1 v3))))))) (\lambda (_: B).(\lambda (_: +T).(\lambda (z1: T).(\lambda (_: T).(\lambda (_: T).(\lambda (t2: T).(pr0 z1 +t2)))))))))) (or3_intro2 (ex3_2 T T (\lambda (u3: T).(\lambda (t2: T).(eq T +(THead (Bind b) u2 (THead (Flat Appl) (lift (S O) O v2) t3)) (THead (Flat +Appl) u3 t2)))) (\lambda (u3: T).(\lambda (_: T).(pr0 u1 u3))) (\lambda (_: +T).(\lambda (t2: T).(pr0 (THead (Bind b) u0 t0) t2)))) (ex4_4 T T T T +(\lambda (y1: T).(\lambda (z1: T).(\lambda (_: T).(\lambda (_: T).(eq T +(THead (Bind b) u0 t0) (THead (Bind Abst) y1 z1)))))) (\lambda (_: +T).(\lambda (_: T).(\lambda (u3: T).(\lambda (t2: T).(eq T (THead (Bind b) u2 +(THead (Flat Appl) (lift (S O) O v2) t3)) (THead (Bind Abbr) u3 t2)))))) +(\lambda (_: T).(\lambda (_: T).(\lambda (u3: T).(\lambda (_: T).(pr0 u1 +u3))))) (\lambda (_: T).(\lambda (z1: T).(\lambda (_: T).(\lambda (t2: +T).(pr0 z1 t2)))))) (ex6_6 B T T T T T (\lambda (b0: B).(\lambda (_: +T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(not (eq B +b0 Abst)))))))) (\lambda (b0: B).(\lambda (y1: T).(\lambda (z1: T).(\lambda +(_: T).(\lambda (_: T).(\lambda (_: T).(eq T (THead (Bind b) u0 t0) (THead +(Bind b0) y1 z1)))))))) (\lambda (b0: B).(\lambda (_: T).(\lambda (_: +T).(\lambda (u3: T).(\lambda (v3: T).(\lambda (t2: T).(eq T (THead (Bind b) +u2 (THead (Flat Appl) (lift (S O) O v2) t3)) (THead (Bind b0) v3 (THead (Flat +Appl) (lift (S O) O u3) t2))))))))) (\lambda (_: B).(\lambda (_: T).(\lambda +(_: T).(\lambda (u3: T).(\lambda (_: T).(\lambda (_: T).(pr0 u1 u3))))))) +(\lambda (_: B).(\lambda (y1: T).(\lambda (_: T).(\lambda (_: T).(\lambda +(v3: T).(\lambda (_: T).(pr0 y1 v3))))))) (\lambda (_: B).(\lambda (_: +T).(\lambda (z1: T).(\lambda (_: T).(\lambda (_: T).(\lambda (t2: T).(pr0 z1 +t2)))))))) (ex6_6_intro B T T T T T (\lambda (b0: B).(\lambda (_: T).(\lambda +(_: T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(not (eq B b0 +Abst)))))))) (\lambda (b0: B).(\lambda (y1: T).(\lambda (z1: T).(\lambda (_: +T).(\lambda (_: T).(\lambda (_: T).(eq T (THead (Bind b) u0 t0) (THead (Bind +b0) y1 z1)))))))) (\lambda (b0: B).(\lambda (_: T).(\lambda (_: T).(\lambda +(u3: T).(\lambda (v3: T).(\lambda (t2: T).(eq T (THead (Bind b) u2 (THead +(Flat Appl) (lift (S O) O v2) t3)) (THead (Bind b0) v3 (THead (Flat Appl) +(lift (S O) O u3) t2))))))))) (\lambda (_: B).(\lambda (_: T).(\lambda (_: +T).(\lambda (u3: T).(\lambda (_: T).(\lambda (_: T).(pr0 u1 u3))))))) +(\lambda (_: B).(\lambda (y1: T).(\lambda (_: T).(\lambda (_: T).(\lambda +(v3: T).(\lambda (_: T).(pr0 y1 v3))))))) (\lambda (_: B).(\lambda (_: +T).(\lambda (z1: T).(\lambda (_: T).(\lambda (_: T).(\lambda (t2: T).(pr0 z1 +t2))))))) b u0 t0 v2 u2 t3 H1 (refl_equal T (THead (Bind b) u0 t0)) +(refl_equal T (THead (Bind b) u2 (THead (Flat Appl) (lift (S O) O v2) t3))) +H12 H3 H6)) t1 H10)))))) H9)) x H5))))))))))))))))) (\lambda (H0: (pr0 (THead +(Flat Appl) u1 t1) x)).(\lambda (u0: T).(\lambda (u2: T).(\lambda (t0: +T).(\lambda (t3: T).(\lambda (w: T).(\lambda (H3: (eq T (THead (Bind Abbr) u0 +t0) (THead (Flat Appl) u1 t1))).(\lambda (H4: (eq T (THead (Bind Abbr) u2 w) +x)).(\lambda (_: (pr0 u0 u2)).(\lambda (_: (pr0 t0 t3)).(\lambda (_: (subst0 +O u2 t3 w)).(let H6 \def (eq_ind_r T x (\lambda (t: T).(pr0 (THead (Flat +Appl) u1 t1) t)) H0 (THead (Bind Abbr) u2 w) H4) in (let H7 \def (eq_ind_r T +x (\lambda (t: T).(pr0 (THead (Flat Appl) u1 t1) t)) H (THead (Bind Abbr) u2 +w) H4) in (eq_ind T (THead (Bind Abbr) u2 w) (\lambda (t: T).(or3 (ex3_2 T T +(\lambda (u3: T).(\lambda (t2: T).(eq T t (THead (Flat Appl) u3 t2)))) +(\lambda (u3: T).(\lambda (_: T).(pr0 u1 u3))) (\lambda (_: T).(\lambda (t2: +T).(pr0 t1 t2)))) (ex4_4 T T T T (\lambda (y1: T).(\lambda (z1: T).(\lambda +(_: T).(\lambda (_: T).(eq T t1 (THead (Bind Abst) y1 z1)))))) (\lambda (_: +T).(\lambda (_: T).(\lambda (u3: T).(\lambda (t2: T).(eq T t (THead (Bind +Abbr) u3 t2)))))) (\lambda (_: T).(\lambda (_: T).(\lambda (u3: T).(\lambda +(_: T).(pr0 u1 u3))))) (\lambda (_: T).(\lambda (z1: T).(\lambda (_: +T).(\lambda (t2: T).(pr0 z1 t2)))))) (ex6_6 B T T T T T (\lambda (b: +B).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(\lambda +(_: T).(not (eq B b Abst)))))))) (\lambda (b: B).(\lambda (y1: T).(\lambda +(z1: T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(eq T t1 (THead (Bind +b) y1 z1)))))))) (\lambda (b: B).(\lambda (_: T).(\lambda (_: T).(\lambda +(u3: T).(\lambda (v2: T).(\lambda (t2: T).(eq T t (THead (Bind b) v2 (THead +(Flat Appl) (lift (S O) O u3) t2))))))))) (\lambda (_: B).(\lambda (_: +T).(\lambda (_: T).(\lambda (u3: T).(\lambda (_: T).(\lambda (_: T).(pr0 u1 +u3))))))) (\lambda (_: B).(\lambda (y1: T).(\lambda (_: T).(\lambda (_: +T).(\lambda (v2: T).(\lambda (_: T).(pr0 y1 v2))))))) (\lambda (_: +B).(\lambda (_: T).(\lambda (z1: T).(\lambda (_: T).(\lambda (_: T).(\lambda +(t2: T).(pr0 z1 t2)))))))))) (let H8 \def (eq_ind T (THead (Bind Abbr) u0 t0) +(\lambda (ee: T).(match ee in T return (\lambda (_: T).Prop) with [(TSort _) +\Rightarrow False | (TLRef _) \Rightarrow False | (THead k _ _) \Rightarrow +(match k in K return (\lambda (_: K).Prop) with [(Bind _) \Rightarrow True | +(Flat _) \Rightarrow False])])) I (THead (Flat Appl) u1 t1) H3) in (False_ind +(or3 (ex3_2 T T (\lambda (u3: T).(\lambda (t2: T).(eq T (THead (Bind Abbr) u2 +w) (THead (Flat Appl) u3 t2)))) (\lambda (u3: T).(\lambda (_: T).(pr0 u1 +u3))) (\lambda (_: T).(\lambda (t2: T).(pr0 t1 t2)))) (ex4_4 T T T T (\lambda +(y1: T).(\lambda (z1: T).(\lambda (_: T).(\lambda (_: T).(eq T t1 (THead +(Bind Abst) y1 z1)))))) (\lambda (_: T).(\lambda (_: T).(\lambda (u3: +T).(\lambda (t2: T).(eq T (THead (Bind Abbr) u2 w) (THead (Bind Abbr) u3 +t2)))))) (\lambda (_: T).(\lambda (_: T).(\lambda (u3: T).(\lambda (_: +T).(pr0 u1 u3))))) (\lambda (_: T).(\lambda (z1: T).(\lambda (_: T).(\lambda +(t2: T).(pr0 z1 t2)))))) (ex6_6 B T T T T T (\lambda (b: B).(\lambda (_: +T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(not (eq B +b Abst)))))))) (\lambda (b: B).(\lambda (y1: T).(\lambda (z1: T).(\lambda (_: +T).(\lambda (_: T).(\lambda (_: T).(eq T t1 (THead (Bind b) y1 z1)))))))) +(\lambda (b: B).(\lambda (_: T).(\lambda (_: T).(\lambda (u3: T).(\lambda +(v2: T).(\lambda (t2: T).(eq T (THead (Bind Abbr) u2 w) (THead (Bind b) v2 +(THead (Flat Appl) (lift (S O) O u3) t2))))))))) (\lambda (_: B).(\lambda (_: +T).(\lambda (_: T).(\lambda (u3: T).(\lambda (_: T).(\lambda (_: T).(pr0 u1 +u3))))))) (\lambda (_: B).(\lambda (y1: T).(\lambda (_: T).(\lambda (_: +T).(\lambda (v2: T).(\lambda (_: T).(pr0 y1 v2))))))) (\lambda (_: +B).(\lambda (_: T).(\lambda (z1: T).(\lambda (_: T).(\lambda (_: T).(\lambda +(t2: T).(pr0 z1 t2))))))))) H8)) x H4)))))))))))))) (\lambda (_: (pr0 (THead +(Flat Appl) u1 t1) x)).(\lambda (b: B).(\lambda (t0: T).(\lambda (t3: +T).(\lambda (u: T).(\lambda (H2: (eq T (THead (Bind b) u (lift (S O) O t0)) +(THead (Flat Appl) u1 t1))).(\lambda (H3: (eq T t3 x)).(\lambda (_: (not (eq +B b Abst))).(\lambda (H4: (pr0 t0 t3)).(let H5 \def (eq_ind T t3 (\lambda (t: +T).(pr0 t0 t)) H4 x H3) in (let H6 \def (eq_ind T (THead (Bind b) u (lift (S +O) O t0)) (\lambda (ee: T).(match ee in T return (\lambda (_: T).Prop) with +[(TSort _) \Rightarrow False | (TLRef _) \Rightarrow False | (THead k _ _) +\Rightarrow (match k in K return (\lambda (_: K).Prop) with [(Bind _) +\Rightarrow True | (Flat _) \Rightarrow False])])) I (THead (Flat Appl) u1 +t1) H2) in (False_ind (or3 (ex3_2 T T (\lambda (u2: T).(\lambda (t2: T).(eq T +x (THead (Flat Appl) u2 t2)))) (\lambda (u2: T).(\lambda (_: T).(pr0 u1 u2))) +(\lambda (_: T).(\lambda (t2: T).(pr0 t1 t2)))) (ex4_4 T T T T (\lambda (y1: +T).(\lambda (z1: T).(\lambda (_: T).(\lambda (_: T).(eq T t1 (THead (Bind +Abst) y1 z1)))))) (\lambda (_: T).(\lambda (_: T).(\lambda (u2: T).(\lambda +(t2: T).(eq T x (THead (Bind Abbr) u2 t2)))))) (\lambda (_: T).(\lambda (_: +T).(\lambda (u2: T).(\lambda (_: T).(pr0 u1 u2))))) (\lambda (_: T).(\lambda +(z1: T).(\lambda (_: T).(\lambda (t2: T).(pr0 z1 t2)))))) (ex6_6 B T T T T T +(\lambda (b0: B).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: +T).(\lambda (_: T).(not (eq B b0 Abst)))))))) (\lambda (b0: B).(\lambda (y1: +T).(\lambda (z1: T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(eq T t1 +(THead (Bind b0) y1 z1)))))))) (\lambda (b0: B).(\lambda (_: T).(\lambda (_: +T).(\lambda (u2: T).(\lambda (v2: T).(\lambda (t2: T).(eq T x (THead (Bind +b0) v2 (THead (Flat Appl) (lift (S O) O u2) t2))))))))) (\lambda (_: +B).(\lambda (_: T).(\lambda (_: T).(\lambda (u2: T).(\lambda (_: T).(\lambda +(_: T).(pr0 u1 u2))))))) (\lambda (_: B).(\lambda (y1: T).(\lambda (_: +T).(\lambda (_: T).(\lambda (v2: T).(\lambda (_: T).(pr0 y1 v2))))))) +(\lambda (_: B).(\lambda (_: T).(\lambda (z1: T).(\lambda (_: T).(\lambda (_: +T).(\lambda (t2: T).(pr0 z1 t2))))))))) H6)))))))))))) (\lambda (_: (pr0 +(THead (Flat Appl) u1 t1) x)).(\lambda (t0: T).(\lambda (t3: T).(\lambda (u: +T).(\lambda (H1: (eq T (THead (Flat Cast) u t0) (THead (Flat Appl) u1 +t1))).(\lambda (H2: (eq T t3 x)).(\lambda (H3: (pr0 t0 t3)).(let H4 \def +(eq_ind T t3 (\lambda (t: T).(pr0 t0 t)) H3 x H2) in (let H5 \def (eq_ind T +(THead (Flat Cast) u t0) (\lambda (ee: T).(match ee in T return (\lambda (_: +T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) \Rightarrow False | +(THead k _ _) \Rightarrow (match k in K return (\lambda (_: K).Prop) with +[(Bind _) \Rightarrow False | (Flat f) \Rightarrow (match f in F return +(\lambda (_: F).Prop) with [Appl \Rightarrow False | Cast \Rightarrow +True])])])) I (THead (Flat Appl) u1 t1) H1) in (False_ind (or3 (ex3_2 T T +(\lambda (u2: T).(\lambda (t2: T).(eq T x (THead (Flat Appl) u2 t2)))) +(\lambda (u2: T).(\lambda (_: T).(pr0 u1 u2))) (\lambda (_: T).(\lambda (t2: +T).(pr0 t1 t2)))) (ex4_4 T T T T (\lambda (y1: T).(\lambda (z1: T).(\lambda +(_: T).(\lambda (_: T).(eq T t1 (THead (Bind Abst) y1 z1)))))) (\lambda (_: +T).(\lambda (_: T).(\lambda (u2: T).(\lambda (t2: T).(eq T x (THead (Bind +Abbr) u2 t2)))))) (\lambda (_: T).(\lambda (_: T).(\lambda (u2: T).(\lambda +(_: T).(pr0 u1 u2))))) (\lambda (_: T).(\lambda (z1: T).(\lambda (_: +T).(\lambda (t2: T).(pr0 z1 t2)))))) (ex6_6 B T T T T T (\lambda (b: +B).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(\lambda +(_: T).(not (eq B b Abst)))))))) (\lambda (b: B).(\lambda (y1: T).(\lambda +(z1: T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(eq T t1 (THead (Bind +b) y1 z1)))))))) (\lambda (b: B).(\lambda (_: T).(\lambda (_: T).(\lambda +(u2: T).(\lambda (v2: T).(\lambda (t2: T).(eq T x (THead (Bind b) v2 (THead +(Flat Appl) (lift (S O) O u2) t2))))))))) (\lambda (_: B).(\lambda (_: +T).(\lambda (_: T).(\lambda (u2: T).(\lambda (_: T).(\lambda (_: T).(pr0 u1 +u2))))))) (\lambda (_: B).(\lambda (y1: T).(\lambda (_: T).(\lambda (_: +T).(\lambda (v2: T).(\lambda (_: T).(pr0 y1 v2))))))) (\lambda (_: +B).(\lambda (_: T).(\lambda (z1: T).(\lambda (_: T).(\lambda (_: T).(\lambda +(t2: T).(pr0 z1 t2))))))))) H5)))))))))) H)))). -axiom pr0_gen_cast: +theorem pr0_gen_cast: \forall (u1: T).(\forall (t1: T).(\forall (x: T).((pr0 (THead (Flat Cast) u1 t1) x) \to (or (ex3_2 T T (\lambda (u2: T).(\lambda (t2: T).(eq T x (THead (Flat Cast) u2 t2)))) (\lambda (u2: T).(\lambda (_: T).(pr0 u1 u2))) (\lambda (_: T).(\lambda (t2: T).(pr0 t1 t2)))) (pr0 t1 x))))) -. +\def + \lambda (u1: T).(\lambda (t1: T).(\lambda (x: T).(\lambda (H: (pr0 (THead +(Flat Cast) u1 t1) x)).(pr0_inv_coq (THead (Flat Cast) u1 t1) x (\lambda (_: +T).(\lambda (t0: T).(or (ex3_2 T T (\lambda (u2: T).(\lambda (t2: T).(eq T t0 +(THead (Flat Cast) u2 t2)))) (\lambda (u2: T).(\lambda (_: T).(pr0 u1 u2))) +(\lambda (_: T).(\lambda (t2: T).(pr0 t1 t2)))) (pr0 t1 t0)))) (\lambda (H0: +(pr0 (THead (Flat Cast) u1 t1) x)).(\lambda (t: T).(\lambda (H1: (eq T t +(THead (Flat Cast) u1 t1))).(\lambda (H2: (eq T t x)).(let H3 \def (eq_ind T +t (\lambda (t0: T).(eq T t0 (THead (Flat Cast) u1 t1))) H1 x H2) in (let H4 +\def (eq_ind T x (\lambda (t0: T).(pr0 (THead (Flat Cast) u1 t1) t0)) H0 +(THead (Flat Cast) u1 t1) H3) in (let H5 \def (eq_ind T x (\lambda (t0: +T).(pr0 (THead (Flat Cast) u1 t1) t0)) H (THead (Flat Cast) u1 t1) H3) in +(eq_ind_r T (THead (Flat Cast) u1 t1) (\lambda (t0: T).(or (ex3_2 T T +(\lambda (u2: T).(\lambda (t2: T).(eq T t0 (THead (Flat Cast) u2 t2)))) +(\lambda (u2: T).(\lambda (_: T).(pr0 u1 u2))) (\lambda (_: T).(\lambda (t2: +T).(pr0 t1 t2)))) (pr0 t1 t0))) (or_introl (ex3_2 T T (\lambda (u2: +T).(\lambda (t2: T).(eq T (THead (Flat Cast) u1 t1) (THead (Flat Cast) u2 +t2)))) (\lambda (u2: T).(\lambda (_: T).(pr0 u1 u2))) (\lambda (_: +T).(\lambda (t2: T).(pr0 t1 t2)))) (pr0 t1 (THead (Flat Cast) u1 t1)) +(ex3_2_intro T T (\lambda (u2: T).(\lambda (t2: T).(eq T (THead (Flat Cast) +u1 t1) (THead (Flat Cast) u2 t2)))) (\lambda (u2: T).(\lambda (_: T).(pr0 u1 +u2))) (\lambda (_: T).(\lambda (t2: T).(pr0 t1 t2))) u1 t1 (refl_equal T +(THead (Flat Cast) u1 t1)) (pr0_refl u1) (pr0_refl t1))) x H3)))))))) +(\lambda (H0: (pr0 (THead (Flat Cast) u1 t1) x)).(\lambda (u0: T).(\lambda +(u2: T).(\lambda (t0: T).(\lambda (t3: T).(\lambda (k: K).(\lambda (H2: (eq T +(THead k u0 t0) (THead (Flat Cast) u1 t1))).(\lambda (H3: (eq T (THead k u2 +t3) x)).(\lambda (H1: (pr0 u0 u2)).(\lambda (H4: (pr0 t0 t3)).(let H5 \def +(eq_ind_r T x (\lambda (t: T).(pr0 (THead (Flat Cast) u1 t1) t)) H0 (THead k +u2 t3) H3) in (let H6 \def (eq_ind_r T x (\lambda (t: T).(pr0 (THead (Flat +Cast) u1 t1) t)) H (THead k u2 t3) H3) in (eq_ind T (THead k u2 t3) (\lambda +(t: T).(or (ex3_2 T T (\lambda (u3: T).(\lambda (t2: T).(eq T t (THead (Flat +Cast) u3 t2)))) (\lambda (u3: T).(\lambda (_: T).(pr0 u1 u3))) (\lambda (_: +T).(\lambda (t2: T).(pr0 t1 t2)))) (pr0 t1 t))) (let H7 \def (f_equal T K +(\lambda (e: T).(match e in T return (\lambda (_: T).K) with [(TSort _) +\Rightarrow k | (TLRef _) \Rightarrow k | (THead k0 _ _) \Rightarrow k0])) +(THead k u0 t0) (THead (Flat Cast) u1 t1) H2) in ((let H8 \def (f_equal T T +(\lambda (e: T).(match e in T return (\lambda (_: T).T) with [(TSort _) +\Rightarrow u0 | (TLRef _) \Rightarrow u0 | (THead _ t _) \Rightarrow t])) +(THead k u0 t0) (THead (Flat Cast) u1 t1) H2) in ((let H9 \def (f_equal T T +(\lambda (e: T).(match e in T return (\lambda (_: T).T) with [(TSort _) +\Rightarrow t0 | (TLRef _) \Rightarrow t0 | (THead _ _ t) \Rightarrow t])) +(THead k u0 t0) (THead (Flat Cast) u1 t1) H2) in (\lambda (H10: (eq T u0 +u1)).(\lambda (H11: (eq K k (Flat Cast))).(let H12 \def (eq_ind K k (\lambda +(k0: K).(pr0 (THead (Flat Cast) u1 t1) (THead k0 u2 t3))) H6 (Flat Cast) H11) +in (let H13 \def (eq_ind K k (\lambda (k0: K).(pr0 (THead (Flat Cast) u1 t1) +(THead k0 u2 t3))) H5 (Flat Cast) H11) in (eq_ind_r K (Flat Cast) (\lambda +(k0: K).(or (ex3_2 T T (\lambda (u3: T).(\lambda (t2: T).(eq T (THead k0 u2 +t3) (THead (Flat Cast) u3 t2)))) (\lambda (u3: T).(\lambda (_: T).(pr0 u1 +u3))) (\lambda (_: T).(\lambda (t2: T).(pr0 t1 t2)))) (pr0 t1 (THead k0 u2 +t3)))) (let H14 \def (eq_ind T t0 (\lambda (t: T).(pr0 t t3)) H4 t1 H9) in +(let H15 \def (eq_ind T u0 (\lambda (t: T).(pr0 t u2)) H1 u1 H10) in +(or_introl (ex3_2 T T (\lambda (u3: T).(\lambda (t2: T).(eq T (THead (Flat +Cast) u2 t3) (THead (Flat Cast) u3 t2)))) (\lambda (u3: T).(\lambda (_: +T).(pr0 u1 u3))) (\lambda (_: T).(\lambda (t2: T).(pr0 t1 t2)))) (pr0 t1 +(THead (Flat Cast) u2 t3)) (ex3_2_intro T T (\lambda (u3: T).(\lambda (t2: +T).(eq T (THead (Flat Cast) u2 t3) (THead (Flat Cast) u3 t2)))) (\lambda (u3: +T).(\lambda (_: T).(pr0 u1 u3))) (\lambda (_: T).(\lambda (t2: T).(pr0 t1 +t2))) u2 t3 (refl_equal T (THead (Flat Cast) u2 t3)) H15 H14)))) k H11)))))) +H8)) H7)) x H3))))))))))))) (\lambda (H0: (pr0 (THead (Flat Cast) u1 t1) +x)).(\lambda (u: T).(\lambda (v1: T).(\lambda (v2: T).(\lambda (t0: +T).(\lambda (t3: T).(\lambda (H2: (eq T (THead (Flat Appl) v1 (THead (Bind +Abst) u t0)) (THead (Flat Cast) u1 t1))).(\lambda (H3: (eq T (THead (Bind +Abbr) v2 t3) x)).(\lambda (_: (pr0 v1 v2)).(\lambda (_: (pr0 t0 t3)).(let H5 +\def (eq_ind_r T x (\lambda (t: T).(pr0 (THead (Flat Cast) u1 t1) t)) H0 +(THead (Bind Abbr) v2 t3) H3) in (let H6 \def (eq_ind_r T x (\lambda (t: +T).(pr0 (THead (Flat Cast) u1 t1) t)) H (THead (Bind Abbr) v2 t3) H3) in +(eq_ind T (THead (Bind Abbr) v2 t3) (\lambda (t: T).(or (ex3_2 T T (\lambda +(u2: T).(\lambda (t2: T).(eq T t (THead (Flat Cast) u2 t2)))) (\lambda (u2: +T).(\lambda (_: T).(pr0 u1 u2))) (\lambda (_: T).(\lambda (t2: T).(pr0 t1 +t2)))) (pr0 t1 t))) (let H7 \def (eq_ind T (THead (Flat Appl) v1 (THead (Bind +Abst) u t0)) (\lambda (ee: T).(match ee in T return (\lambda (_: T).Prop) +with [(TSort _) \Rightarrow False | (TLRef _) \Rightarrow False | (THead k _ +_) \Rightarrow (match k in K return (\lambda (_: K).Prop) with [(Bind _) +\Rightarrow False | (Flat f) \Rightarrow (match f in F return (\lambda (_: +F).Prop) with [Appl \Rightarrow True | Cast \Rightarrow False])])])) I (THead +(Flat Cast) u1 t1) H2) in (False_ind (or (ex3_2 T T (\lambda (u2: T).(\lambda +(t2: T).(eq T (THead (Bind Abbr) v2 t3) (THead (Flat Cast) u2 t2)))) (\lambda +(u2: T).(\lambda (_: T).(pr0 u1 u2))) (\lambda (_: T).(\lambda (t2: T).(pr0 +t1 t2)))) (pr0 t1 (THead (Bind Abbr) v2 t3))) H7)) x H3))))))))))))) (\lambda +(H0: (pr0 (THead (Flat Cast) u1 t1) x)).(\lambda (b: B).(\lambda (v1: +T).(\lambda (v2: T).(\lambda (u0: T).(\lambda (u2: T).(\lambda (t0: +T).(\lambda (t3: T).(\lambda (H4: (eq T (THead (Flat Appl) v1 (THead (Bind b) +u0 t0)) (THead (Flat Cast) u1 t1))).(\lambda (H5: (eq T (THead (Bind b) u2 +(THead (Flat Appl) (lift (S O) O v2) t3)) x)).(\lambda (_: (not (eq B b +Abst))).(\lambda (_: (pr0 v1 v2)).(\lambda (_: (pr0 u0 u2)).(\lambda (_: (pr0 +t0 t3)).(let H7 \def (eq_ind_r T x (\lambda (t: T).(pr0 (THead (Flat Cast) u1 +t1) t)) H0 (THead (Bind b) u2 (THead (Flat Appl) (lift (S O) O v2) t3)) H5) +in (let H8 \def (eq_ind_r T x (\lambda (t: T).(pr0 (THead (Flat Cast) u1 t1) +t)) H (THead (Bind b) u2 (THead (Flat Appl) (lift (S O) O v2) t3)) H5) in +(eq_ind T (THead (Bind b) u2 (THead (Flat Appl) (lift (S O) O v2) t3)) +(\lambda (t: T).(or (ex3_2 T T (\lambda (u3: T).(\lambda (t2: T).(eq T t +(THead (Flat Cast) u3 t2)))) (\lambda (u3: T).(\lambda (_: T).(pr0 u1 u3))) +(\lambda (_: T).(\lambda (t2: T).(pr0 t1 t2)))) (pr0 t1 t))) (let H9 \def +(eq_ind T (THead (Flat Appl) v1 (THead (Bind b) u0 t0)) (\lambda (ee: +T).(match ee in T return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow +False | (TLRef _) \Rightarrow False | (THead k _ _) \Rightarrow (match k in K +return (\lambda (_: K).Prop) with [(Bind _) \Rightarrow False | (Flat f) +\Rightarrow (match f in F return (\lambda (_: F).Prop) with [Appl \Rightarrow +True | Cast \Rightarrow False])])])) I (THead (Flat Cast) u1 t1) H4) in +(False_ind (or (ex3_2 T T (\lambda (u3: T).(\lambda (t2: T).(eq T (THead +(Bind b) u2 (THead (Flat Appl) (lift (S O) O v2) t3)) (THead (Flat Cast) u3 +t2)))) (\lambda (u3: T).(\lambda (_: T).(pr0 u1 u3))) (\lambda (_: +T).(\lambda (t2: T).(pr0 t1 t2)))) (pr0 t1 (THead (Bind b) u2 (THead (Flat +Appl) (lift (S O) O v2) t3)))) H9)) x H5))))))))))))))))) (\lambda (H0: (pr0 +(THead (Flat Cast) u1 t1) x)).(\lambda (u0: T).(\lambda (u2: T).(\lambda (t0: +T).(\lambda (t3: T).(\lambda (w: T).(\lambda (H3: (eq T (THead (Bind Abbr) u0 +t0) (THead (Flat Cast) u1 t1))).(\lambda (H4: (eq T (THead (Bind Abbr) u2 w) +x)).(\lambda (_: (pr0 u0 u2)).(\lambda (_: (pr0 t0 t3)).(\lambda (_: (subst0 +O u2 t3 w)).(let H6 \def (eq_ind_r T x (\lambda (t: T).(pr0 (THead (Flat +Cast) u1 t1) t)) H0 (THead (Bind Abbr) u2 w) H4) in (let H7 \def (eq_ind_r T +x (\lambda (t: T).(pr0 (THead (Flat Cast) u1 t1) t)) H (THead (Bind Abbr) u2 +w) H4) in (eq_ind T (THead (Bind Abbr) u2 w) (\lambda (t: T).(or (ex3_2 T T +(\lambda (u3: T).(\lambda (t2: T).(eq T t (THead (Flat Cast) u3 t2)))) +(\lambda (u3: T).(\lambda (_: T).(pr0 u1 u3))) (\lambda (_: T).(\lambda (t2: +T).(pr0 t1 t2)))) (pr0 t1 t))) (let H8 \def (eq_ind T (THead (Bind Abbr) u0 +t0) (\lambda (ee: T).(match ee in T return (\lambda (_: T).Prop) with [(TSort +_) \Rightarrow False | (TLRef _) \Rightarrow False | (THead k _ _) +\Rightarrow (match k in K return (\lambda (_: K).Prop) with [(Bind _) +\Rightarrow True | (Flat _) \Rightarrow False])])) I (THead (Flat Cast) u1 +t1) H3) in (False_ind (or (ex3_2 T T (\lambda (u3: T).(\lambda (t2: T).(eq T +(THead (Bind Abbr) u2 w) (THead (Flat Cast) u3 t2)))) (\lambda (u3: +T).(\lambda (_: T).(pr0 u1 u3))) (\lambda (_: T).(\lambda (t2: T).(pr0 t1 +t2)))) (pr0 t1 (THead (Bind Abbr) u2 w))) H8)) x H4)))))))))))))) (\lambda +(_: (pr0 (THead (Flat Cast) u1 t1) x)).(\lambda (b: B).(\lambda (t0: +T).(\lambda (t3: T).(\lambda (u: T).(\lambda (H2: (eq T (THead (Bind b) u +(lift (S O) O t0)) (THead (Flat Cast) u1 t1))).(\lambda (H3: (eq T t3 +x)).(\lambda (_: (not (eq B b Abst))).(\lambda (H4: (pr0 t0 t3)).(let H5 \def +(eq_ind T t3 (\lambda (t: T).(pr0 t0 t)) H4 x H3) in (let H6 \def (eq_ind T +(THead (Bind b) u (lift (S O) O t0)) (\lambda (ee: T).(match ee in T return +(\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) +\Rightarrow False | (THead k _ _) \Rightarrow (match k in K return (\lambda +(_: K).Prop) with [(Bind _) \Rightarrow True | (Flat _) \Rightarrow +False])])) I (THead (Flat Cast) u1 t1) H2) in (False_ind (or (ex3_2 T T +(\lambda (u2: T).(\lambda (t2: T).(eq T x (THead (Flat Cast) u2 t2)))) +(\lambda (u2: T).(\lambda (_: T).(pr0 u1 u2))) (\lambda (_: T).(\lambda (t2: +T).(pr0 t1 t2)))) (pr0 t1 x)) H6)))))))))))) (\lambda (_: (pr0 (THead (Flat +Cast) u1 t1) x)).(\lambda (t0: T).(\lambda (t3: T).(\lambda (u: T).(\lambda +(H1: (eq T (THead (Flat Cast) u t0) (THead (Flat Cast) u1 t1))).(\lambda (H2: +(eq T t3 x)).(\lambda (H3: (pr0 t0 t3)).(let H4 \def (eq_ind T t3 (\lambda +(t: T).(pr0 t0 t)) H3 x H2) in (let H5 \def (f_equal T T (\lambda (e: +T).(match e in T return (\lambda (_: T).T) with [(TSort _) \Rightarrow u | +(TLRef _) \Rightarrow u | (THead _ t _) \Rightarrow t])) (THead (Flat Cast) u +t0) (THead (Flat Cast) u1 t1) H1) in ((let H6 \def (f_equal T T (\lambda (e: +T).(match e in T return (\lambda (_: T).T) with [(TSort _) \Rightarrow t0 | +(TLRef _) \Rightarrow t0 | (THead _ _ t) \Rightarrow t])) (THead (Flat Cast) +u t0) (THead (Flat Cast) u1 t1) H1) in (\lambda (_: (eq T u u1)).(let H8 \def +(eq_ind T t0 (\lambda (t: T).(pr0 t x)) H4 t1 H6) in (or_intror (ex3_2 T T +(\lambda (u2: T).(\lambda (t2: T).(eq T x (THead (Flat Cast) u2 t2)))) +(\lambda (u2: T).(\lambda (_: T).(pr0 u1 u2))) (\lambda (_: T).(\lambda (t2: +T).(pr0 t1 t2)))) (pr0 t1 x) H8)))) H5)))))))))) H)))). -axiom pr0_gen_abbr: +theorem pr0_gen_abbr: \forall (u1: T).(\forall (t1: T).(\forall (x: T).((pr0 (THead (Bind Abbr) u1 t1) x) \to (or (ex3_2 T T (\lambda (u2: T).(\lambda (t2: T).(eq T x (THead (Bind Abbr) u2 t2)))) (\lambda (u2: T).(\lambda (_: T).(pr0 u1 u2))) (\lambda (u2: T).(\lambda (t2: T).(or (pr0 t1 t2) (ex2 T (\lambda (y: T).(pr0 t1 y)) (\lambda (y: T).(subst0 O u2 y t2))))))) (pr0 t1 (lift (S O) O x)))))) -. +\def + \lambda (u1: T).(\lambda (t1: T).(\lambda (x: T).(\lambda (H: (pr0 (THead +(Bind Abbr) u1 t1) x)).(let H0 \def (match H in pr0 return (\lambda (t: +T).(\lambda (t0: T).(\lambda (_: (pr0 t t0)).((eq T t (THead (Bind Abbr) u1 +t1)) \to ((eq T t0 x) \to (or (ex3_2 T T (\lambda (u2: T).(\lambda (t2: +T).(eq T x (THead (Bind Abbr) u2 t2)))) (\lambda (u2: T).(\lambda (_: T).(pr0 +u1 u2))) (\lambda (u2: T).(\lambda (t2: T).(or (pr0 t1 t2) (ex2 T (\lambda +(y: T).(pr0 t1 y)) (\lambda (y: T).(subst0 O u2 y t2))))))) (pr0 t1 (lift (S +O) O x)))))))) with [(pr0_refl t) \Rightarrow (\lambda (H0: (eq T t (THead +(Bind Abbr) u1 t1))).(\lambda (H1: (eq T t x)).(eq_ind T (THead (Bind Abbr) +u1 t1) (\lambda (t0: T).((eq T t0 x) \to (or (ex3_2 T T (\lambda (u2: +T).(\lambda (t2: T).(eq T x (THead (Bind Abbr) u2 t2)))) (\lambda (u2: +T).(\lambda (_: T).(pr0 u1 u2))) (\lambda (u2: T).(\lambda (t2: T).(or (pr0 +t1 t2) (ex2 T (\lambda (y: T).(pr0 t1 y)) (\lambda (y: T).(subst0 O u2 y +t2))))))) (pr0 t1 (lift (S O) O x))))) (\lambda (H2: (eq T (THead (Bind Abbr) +u1 t1) x)).(eq_ind T (THead (Bind Abbr) u1 t1) (\lambda (t0: T).(or (ex3_2 T +T (\lambda (u2: T).(\lambda (t2: T).(eq T t0 (THead (Bind Abbr) u2 t2)))) +(\lambda (u2: T).(\lambda (_: T).(pr0 u1 u2))) (\lambda (u2: T).(\lambda (t2: +T).(or (pr0 t1 t2) (ex2 T (\lambda (y: T).(pr0 t1 y)) (\lambda (y: T).(subst0 +O u2 y t2))))))) (pr0 t1 (lift (S O) O t0)))) (or_introl (ex3_2 T T (\lambda +(u2: T).(\lambda (t2: T).(eq T (THead (Bind Abbr) u1 t1) (THead (Bind Abbr) +u2 t2)))) (\lambda (u2: T).(\lambda (_: T).(pr0 u1 u2))) (\lambda (u2: +T).(\lambda (t2: T).(or (pr0 t1 t2) (ex2 T (\lambda (y: T).(pr0 t1 y)) +(\lambda (y: T).(subst0 O u2 y t2))))))) (pr0 t1 (lift (S O) O (THead (Bind +Abbr) u1 t1))) (ex3_2_intro T T (\lambda (u2: T).(\lambda (t2: T).(eq T +(THead (Bind Abbr) u1 t1) (THead (Bind Abbr) u2 t2)))) (\lambda (u2: +T).(\lambda (_: T).(pr0 u1 u2))) (\lambda (u2: T).(\lambda (t2: T).(or (pr0 +t1 t2) (ex2 T (\lambda (y: T).(pr0 t1 y)) (\lambda (y: T).(subst0 O u2 y +t2)))))) u1 t1 (refl_equal T (THead (Bind Abbr) u1 t1)) (pr0_refl u1) +(or_introl (pr0 t1 t1) (ex2 T (\lambda (y: T).(pr0 t1 y)) (\lambda (y: +T).(subst0 O u1 y t1))) (pr0_refl t1)))) x H2)) t (sym_eq T t (THead (Bind +Abbr) u1 t1) H0) H1))) | (pr0_comp u0 u2 H0 t0 t2 H1 k) \Rightarrow (\lambda +(H2: (eq T (THead k u0 t0) (THead (Bind Abbr) u1 t1))).(\lambda (H3: (eq T +(THead k u2 t2) x)).((let H4 \def (f_equal T T (\lambda (e: T).(match e in T +return (\lambda (_: T).T) with [(TSort _) \Rightarrow t0 | (TLRef _) +\Rightarrow t0 | (THead _ _ t) \Rightarrow t])) (THead k u0 t0) (THead (Bind +Abbr) u1 t1) H2) in ((let H5 \def (f_equal T T (\lambda (e: T).(match e in T +return (\lambda (_: T).T) with [(TSort _) \Rightarrow u0 | (TLRef _) +\Rightarrow u0 | (THead _ t _) \Rightarrow t])) (THead k u0 t0) (THead (Bind +Abbr) u1 t1) H2) in ((let H6 \def (f_equal T K (\lambda (e: T).(match e in T +return (\lambda (_: T).K) with [(TSort _) \Rightarrow k | (TLRef _) +\Rightarrow k | (THead k0 _ _) \Rightarrow k0])) (THead k u0 t0) (THead (Bind +Abbr) u1 t1) H2) in (eq_ind K (Bind Abbr) (\lambda (k0: K).((eq T u0 u1) \to +((eq T t0 t1) \to ((eq T (THead k0 u2 t2) x) \to ((pr0 u0 u2) \to ((pr0 t0 +t2) \to (or (ex3_2 T T (\lambda (u3: T).(\lambda (t3: T).(eq T x (THead (Bind +Abbr) u3 t3)))) (\lambda (u3: T).(\lambda (_: T).(pr0 u1 u3))) (\lambda (u3: +T).(\lambda (t3: T).(or (pr0 t1 t3) (ex2 T (\lambda (y: T).(pr0 t1 y)) +(\lambda (y: T).(subst0 O u3 y t3))))))) (pr0 t1 (lift (S O) O x))))))))) +(\lambda (H7: (eq T u0 u1)).(eq_ind T u1 (\lambda (t: T).((eq T t0 t1) \to +((eq T (THead (Bind Abbr) u2 t2) x) \to ((pr0 t u2) \to ((pr0 t0 t2) \to (or +(ex3_2 T T (\lambda (u3: T).(\lambda (t3: T).(eq T x (THead (Bind Abbr) u3 +t3)))) (\lambda (u3: T).(\lambda (_: T).(pr0 u1 u3))) (\lambda (u3: +T).(\lambda (t3: T).(or (pr0 t1 t3) (ex2 T (\lambda (y: T).(pr0 t1 y)) +(\lambda (y: T).(subst0 O u3 y t3))))))) (pr0 t1 (lift (S O) O x)))))))) +(\lambda (H8: (eq T t0 t1)).(eq_ind T t1 (\lambda (t: T).((eq T (THead (Bind +Abbr) u2 t2) x) \to ((pr0 u1 u2) \to ((pr0 t t2) \to (or (ex3_2 T T (\lambda +(u3: T).(\lambda (t3: T).(eq T x (THead (Bind Abbr) u3 t3)))) (\lambda (u3: +T).(\lambda (_: T).(pr0 u1 u3))) (\lambda (u3: T).(\lambda (t3: T).(or (pr0 +t1 t3) (ex2 T (\lambda (y: T).(pr0 t1 y)) (\lambda (y: T).(subst0 O u3 y +t3))))))) (pr0 t1 (lift (S O) O x))))))) (\lambda (H9: (eq T (THead (Bind +Abbr) u2 t2) x)).(eq_ind T (THead (Bind Abbr) u2 t2) (\lambda (t: T).((pr0 u1 +u2) \to ((pr0 t1 t2) \to (or (ex3_2 T T (\lambda (u3: T).(\lambda (t3: T).(eq +T t (THead (Bind Abbr) u3 t3)))) (\lambda (u3: T).(\lambda (_: T).(pr0 u1 +u3))) (\lambda (u3: T).(\lambda (t3: T).(or (pr0 t1 t3) (ex2 T (\lambda (y: +T).(pr0 t1 y)) (\lambda (y: T).(subst0 O u3 y t3))))))) (pr0 t1 (lift (S O) O +t)))))) (\lambda (H10: (pr0 u1 u2)).(\lambda (H11: (pr0 t1 t2)).(or_introl +(ex3_2 T T (\lambda (u3: T).(\lambda (t3: T).(eq T (THead (Bind Abbr) u2 t2) +(THead (Bind Abbr) u3 t3)))) (\lambda (u3: T).(\lambda (_: T).(pr0 u1 u3))) +(\lambda (u3: T).(\lambda (t3: T).(or (pr0 t1 t3) (ex2 T (\lambda (y: T).(pr0 +t1 y)) (\lambda (y: T).(subst0 O u3 y t3))))))) (pr0 t1 (lift (S O) O (THead +(Bind Abbr) u2 t2))) (ex3_2_intro T T (\lambda (u3: T).(\lambda (t3: T).(eq T +(THead (Bind Abbr) u2 t2) (THead (Bind Abbr) u3 t3)))) (\lambda (u3: +T).(\lambda (_: T).(pr0 u1 u3))) (\lambda (u3: T).(\lambda (t3: T).(or (pr0 +t1 t3) (ex2 T (\lambda (y: T).(pr0 t1 y)) (\lambda (y: T).(subst0 O u3 y +t3)))))) u2 t2 (refl_equal T (THead (Bind Abbr) u2 t2)) H10 (or_introl (pr0 +t1 t2) (ex2 T (\lambda (y: T).(pr0 t1 y)) (\lambda (y: T).(subst0 O u2 y +t2))) H11))))) x H9)) t0 (sym_eq T t0 t1 H8))) u0 (sym_eq T u0 u1 H7))) k +(sym_eq K k (Bind Abbr) H6))) H5)) H4)) H3 H0 H1))) | (pr0_beta u v1 v2 H0 t0 +t2 H1) \Rightarrow (\lambda (H2: (eq T (THead (Flat Appl) v1 (THead (Bind +Abst) u t0)) (THead (Bind Abbr) u1 t1))).(\lambda (H3: (eq T (THead (Bind +Abbr) v2 t2) x)).((let H4 \def (eq_ind T (THead (Flat Appl) v1 (THead (Bind +Abst) u t0)) (\lambda (e: T).(match e in T return (\lambda (_: T).Prop) with +[(TSort _) \Rightarrow False | (TLRef _) \Rightarrow False | (THead k _ _) +\Rightarrow (match k in K return (\lambda (_: K).Prop) with [(Bind _) +\Rightarrow False | (Flat _) \Rightarrow True])])) I (THead (Bind Abbr) u1 +t1) H2) in (False_ind ((eq T (THead (Bind Abbr) v2 t2) x) \to ((pr0 v1 v2) +\to ((pr0 t0 t2) \to (or (ex3_2 T T (\lambda (u2: T).(\lambda (t3: T).(eq T x +(THead (Bind Abbr) u2 t3)))) (\lambda (u2: T).(\lambda (_: T).(pr0 u1 u2))) +(\lambda (u2: T).(\lambda (t3: T).(or (pr0 t1 t3) (ex2 T (\lambda (y: T).(pr0 +t1 y)) (\lambda (y: T).(subst0 O u2 y t3))))))) (pr0 t1 (lift (S O) O x)))))) +H4)) H3 H0 H1))) | (pr0_upsilon b H0 v1 v2 H1 u0 u2 H2 t0 t2 H3) \Rightarrow +(\lambda (H4: (eq T (THead (Flat Appl) v1 (THead (Bind b) u0 t0)) (THead +(Bind Abbr) u1 t1))).(\lambda (H5: (eq T (THead (Bind b) u2 (THead (Flat +Appl) (lift (S O) O v2) t2)) x)).((let H6 \def (eq_ind T (THead (Flat Appl) +v1 (THead (Bind b) u0 t0)) (\lambda (e: T).(match e in T return (\lambda (_: +T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) \Rightarrow False | +(THead k _ _) \Rightarrow (match k in K return (\lambda (_: K).Prop) with +[(Bind _) \Rightarrow False | (Flat _) \Rightarrow True])])) I (THead (Bind +Abbr) u1 t1) H4) in (False_ind ((eq T (THead (Bind b) u2 (THead (Flat Appl) +(lift (S O) O v2) t2)) x) \to ((not (eq B b Abst)) \to ((pr0 v1 v2) \to ((pr0 +u0 u2) \to ((pr0 t0 t2) \to (or (ex3_2 T T (\lambda (u3: T).(\lambda (t3: +T).(eq T x (THead (Bind Abbr) u3 t3)))) (\lambda (u3: T).(\lambda (_: T).(pr0 +u1 u3))) (\lambda (u3: T).(\lambda (t3: T).(or (pr0 t1 t3) (ex2 T (\lambda +(y: T).(pr0 t1 y)) (\lambda (y: T).(subst0 O u3 y t3))))))) (pr0 t1 (lift (S +O) O x)))))))) H6)) H5 H0 H1 H2 H3))) | (pr0_delta u0 u2 H0 t0 t2 H1 w H2) +\Rightarrow (\lambda (H3: (eq T (THead (Bind Abbr) u0 t0) (THead (Bind Abbr) +u1 t1))).(\lambda (H4: (eq T (THead (Bind Abbr) u2 w) x)).((let H5 \def +(f_equal T T (\lambda (e: T).(match e in T return (\lambda (_: T).T) with +[(TSort _) \Rightarrow t0 | (TLRef _) \Rightarrow t0 | (THead _ _ t) +\Rightarrow t])) (THead (Bind Abbr) u0 t0) (THead (Bind Abbr) u1 t1) H3) in +((let H6 \def (f_equal T T (\lambda (e: T).(match e in T return (\lambda (_: +T).T) with [(TSort _) \Rightarrow u0 | (TLRef _) \Rightarrow u0 | (THead _ t +_) \Rightarrow t])) (THead (Bind Abbr) u0 t0) (THead (Bind Abbr) u1 t1) H3) +in (eq_ind T u1 (\lambda (t: T).((eq T t0 t1) \to ((eq T (THead (Bind Abbr) +u2 w) x) \to ((pr0 t u2) \to ((pr0 t0 t2) \to ((subst0 O u2 t2 w) \to (or +(ex3_2 T T (\lambda (u3: T).(\lambda (t3: T).(eq T x (THead (Bind Abbr) u3 +t3)))) (\lambda (u3: T).(\lambda (_: T).(pr0 u1 u3))) (\lambda (u3: +T).(\lambda (t3: T).(or (pr0 t1 t3) (ex2 T (\lambda (y: T).(pr0 t1 y)) +(\lambda (y: T).(subst0 O u3 y t3))))))) (pr0 t1 (lift (S O) O x))))))))) +(\lambda (H7: (eq T t0 t1)).(eq_ind T t1 (\lambda (t: T).((eq T (THead (Bind +Abbr) u2 w) x) \to ((pr0 u1 u2) \to ((pr0 t t2) \to ((subst0 O u2 t2 w) \to +(or (ex3_2 T T (\lambda (u3: T).(\lambda (t3: T).(eq T x (THead (Bind Abbr) +u3 t3)))) (\lambda (u3: T).(\lambda (_: T).(pr0 u1 u3))) (\lambda (u3: +T).(\lambda (t3: T).(or (pr0 t1 t3) (ex2 T (\lambda (y: T).(pr0 t1 y)) +(\lambda (y: T).(subst0 O u3 y t3))))))) (pr0 t1 (lift (S O) O x)))))))) +(\lambda (H8: (eq T (THead (Bind Abbr) u2 w) x)).(eq_ind T (THead (Bind Abbr) +u2 w) (\lambda (t: T).((pr0 u1 u2) \to ((pr0 t1 t2) \to ((subst0 O u2 t2 w) +\to (or (ex3_2 T T (\lambda (u3: T).(\lambda (t3: T).(eq T t (THead (Bind +Abbr) u3 t3)))) (\lambda (u3: T).(\lambda (_: T).(pr0 u1 u3))) (\lambda (u3: +T).(\lambda (t3: T).(or (pr0 t1 t3) (ex2 T (\lambda (y: T).(pr0 t1 y)) +(\lambda (y: T).(subst0 O u3 y t3))))))) (pr0 t1 (lift (S O) O t))))))) +(\lambda (H9: (pr0 u1 u2)).(\lambda (H10: (pr0 t1 t2)).(\lambda (H11: (subst0 +O u2 t2 w)).(or_introl (ex3_2 T T (\lambda (u3: T).(\lambda (t3: T).(eq T +(THead (Bind Abbr) u2 w) (THead (Bind Abbr) u3 t3)))) (\lambda (u3: +T).(\lambda (_: T).(pr0 u1 u3))) (\lambda (u3: T).(\lambda (t3: T).(or (pr0 +t1 t3) (ex2 T (\lambda (y: T).(pr0 t1 y)) (\lambda (y: T).(subst0 O u3 y +t3))))))) (pr0 t1 (lift (S O) O (THead (Bind Abbr) u2 w))) (ex3_2_intro T T +(\lambda (u3: T).(\lambda (t3: T).(eq T (THead (Bind Abbr) u2 w) (THead (Bind +Abbr) u3 t3)))) (\lambda (u3: T).(\lambda (_: T).(pr0 u1 u3))) (\lambda (u3: +T).(\lambda (t3: T).(or (pr0 t1 t3) (ex2 T (\lambda (y: T).(pr0 t1 y)) +(\lambda (y: T).(subst0 O u3 y t3)))))) u2 w (refl_equal T (THead (Bind Abbr) +u2 w)) H9 (or_intror (pr0 t1 w) (ex2 T (\lambda (y: T).(pr0 t1 y)) (\lambda +(y: T).(subst0 O u2 y w))) (ex_intro2 T (\lambda (y: T).(pr0 t1 y)) (\lambda +(y: T).(subst0 O u2 y w)) t2 H10 H11))))))) x H8)) t0 (sym_eq T t0 t1 H7))) +u0 (sym_eq T u0 u1 H6))) H5)) H4 H0 H1 H2))) | (pr0_zeta b H0 t0 t2 H1 u) +\Rightarrow (\lambda (H2: (eq T (THead (Bind b) u (lift (S O) O t0)) (THead +(Bind Abbr) u1 t1))).(\lambda (H3: (eq T t2 x)).((let H4 \def (f_equal T T +(\lambda (e: T).(match e in T return (\lambda (_: T).T) with [(TSort _) +\Rightarrow ((let rec lref_map (f: ((nat \to nat))) (d: nat) (t: T) on t: T +\def (match t with [(TSort n) \Rightarrow (TSort n) | (TLRef i) \Rightarrow +(TLRef (match (blt i d) with [true \Rightarrow i | false \Rightarrow (f i)])) +| (THead k u0 t3) \Rightarrow (THead k (lref_map f d u0) (lref_map f (s k d) +t3))]) in lref_map) (\lambda (x0: nat).(plus x0 (S O))) O t0) | (TLRef _) +\Rightarrow ((let rec lref_map (f: ((nat \to nat))) (d: nat) (t: T) on t: T +\def (match t with [(TSort n) \Rightarrow (TSort n) | (TLRef i) \Rightarrow +(TLRef (match (blt i d) with [true \Rightarrow i | false \Rightarrow (f i)])) +| (THead k u0 t3) \Rightarrow (THead k (lref_map f d u0) (lref_map f (s k d) +t3))]) in lref_map) (\lambda (x0: nat).(plus x0 (S O))) O t0) | (THead _ _ t) +\Rightarrow t])) (THead (Bind b) u (lift (S O) O t0)) (THead (Bind Abbr) u1 +t1) H2) in ((let H5 \def (f_equal T T (\lambda (e: T).(match e in T return +(\lambda (_: T).T) with [(TSort _) \Rightarrow u | (TLRef _) \Rightarrow u | +(THead _ t _) \Rightarrow t])) (THead (Bind b) u (lift (S O) O t0)) (THead +(Bind Abbr) u1 t1) H2) in ((let H6 \def (f_equal T B (\lambda (e: T).(match e +in T return (\lambda (_: T).B) with [(TSort _) \Rightarrow b | (TLRef _) +\Rightarrow b | (THead k _ _) \Rightarrow (match k in K return (\lambda (_: +K).B) with [(Bind b0) \Rightarrow b0 | (Flat _) \Rightarrow b])])) (THead +(Bind b) u (lift (S O) O t0)) (THead (Bind Abbr) u1 t1) H2) in (eq_ind B Abbr +(\lambda (b0: B).((eq T u u1) \to ((eq T (lift (S O) O t0) t1) \to ((eq T t2 +x) \to ((not (eq B b0 Abst)) \to ((pr0 t0 t2) \to (or (ex3_2 T T (\lambda +(u2: T).(\lambda (t3: T).(eq T x (THead (Bind Abbr) u2 t3)))) (\lambda (u2: +T).(\lambda (_: T).(pr0 u1 u2))) (\lambda (u2: T).(\lambda (t3: T).(or (pr0 +t1 t3) (ex2 T (\lambda (y: T).(pr0 t1 y)) (\lambda (y: T).(subst0 O u2 y +t3))))))) (pr0 t1 (lift (S O) O x))))))))) (\lambda (H7: (eq T u u1)).(eq_ind +T u1 (\lambda (_: T).((eq T (lift (S O) O t0) t1) \to ((eq T t2 x) \to ((not +(eq B Abbr Abst)) \to ((pr0 t0 t2) \to (or (ex3_2 T T (\lambda (u2: +T).(\lambda (t3: T).(eq T x (THead (Bind Abbr) u2 t3)))) (\lambda (u2: +T).(\lambda (_: T).(pr0 u1 u2))) (\lambda (u2: T).(\lambda (t3: T).(or (pr0 +t1 t3) (ex2 T (\lambda (y: T).(pr0 t1 y)) (\lambda (y: T).(subst0 O u2 y +t3))))))) (pr0 t1 (lift (S O) O x)))))))) (\lambda (H8: (eq T (lift (S O) O +t0) t1)).(eq_ind T (lift (S O) O t0) (\lambda (t: T).((eq T t2 x) \to ((not +(eq B Abbr Abst)) \to ((pr0 t0 t2) \to (or (ex3_2 T T (\lambda (u2: +T).(\lambda (t3: T).(eq T x (THead (Bind Abbr) u2 t3)))) (\lambda (u2: +T).(\lambda (_: T).(pr0 u1 u2))) (\lambda (u2: T).(\lambda (t3: T).(or (pr0 t +t3) (ex2 T (\lambda (y: T).(pr0 t y)) (\lambda (y: T).(subst0 O u2 y +t3))))))) (pr0 t (lift (S O) O x))))))) (\lambda (H9: (eq T t2 x)).(eq_ind T +x (\lambda (t: T).((not (eq B Abbr Abst)) \to ((pr0 t0 t) \to (or (ex3_2 T T +(\lambda (u2: T).(\lambda (t3: T).(eq T x (THead (Bind Abbr) u2 t3)))) +(\lambda (u2: T).(\lambda (_: T).(pr0 u1 u2))) (\lambda (u2: T).(\lambda (t3: +T).(or (pr0 (lift (S O) O t0) t3) (ex2 T (\lambda (y: T).(pr0 (lift (S O) O +t0) y)) (\lambda (y: T).(subst0 O u2 y t3))))))) (pr0 (lift (S O) O t0) (lift +(S O) O x)))))) (\lambda (_: (not (eq B Abbr Abst))).(\lambda (H11: (pr0 t0 +x)).(or_intror (ex3_2 T T (\lambda (u2: T).(\lambda (t3: T).(eq T x (THead +(Bind Abbr) u2 t3)))) (\lambda (u2: T).(\lambda (_: T).(pr0 u1 u2))) (\lambda +(u2: T).(\lambda (t3: T).(or (pr0 (lift (S O) O t0) t3) (ex2 T (\lambda (y: +T).(pr0 (lift (S O) O t0) y)) (\lambda (y: T).(subst0 O u2 y t3))))))) (pr0 +(lift (S O) O t0) (lift (S O) O x)) (pr0_lift t0 x H11 (S O) O)))) t2 (sym_eq +T t2 x H9))) t1 H8)) u (sym_eq T u u1 H7))) b (sym_eq B b Abbr H6))) H5)) +H4)) H3 H0 H1))) | (pr0_epsilon t0 t2 H0 u) \Rightarrow (\lambda (H1: (eq T +(THead (Flat Cast) u t0) (THead (Bind Abbr) u1 t1))).(\lambda (H2: (eq T t2 +x)).((let H3 \def (eq_ind T (THead (Flat Cast) u t0) (\lambda (e: T).(match e +in T return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | (TLRef +_) \Rightarrow False | (THead k _ _) \Rightarrow (match k in K return +(\lambda (_: K).Prop) with [(Bind _) \Rightarrow False | (Flat _) \Rightarrow +True])])) I (THead (Bind Abbr) u1 t1) H1) in (False_ind ((eq T t2 x) \to +((pr0 t0 t2) \to (or (ex3_2 T T (\lambda (u2: T).(\lambda (t3: T).(eq T x +(THead (Bind Abbr) u2 t3)))) (\lambda (u2: T).(\lambda (_: T).(pr0 u1 u2))) +(\lambda (u2: T).(\lambda (t3: T).(or (pr0 t1 t3) (ex2 T (\lambda (y: T).(pr0 +t1 y)) (\lambda (y: T).(subst0 O u2 y t3))))))) (pr0 t1 (lift (S O) O x))))) +H3)) H2 H0)))]) in (H0 (refl_equal T (THead (Bind Abbr) u1 t1)) (refl_equal T +x)))))). -axiom pr0_gen_void: +theorem pr0_gen_void: \forall (u1: T).(\forall (t1: T).(\forall (x: T).((pr0 (THead (Bind Void) u1 t1) x) \to (or (ex3_2 T T (\lambda (u2: T).(\lambda (t2: T).(eq T x (THead (Bind Void) u2 t2)))) (\lambda (u2: T).(\lambda (_: T).(pr0 u1 u2))) (\lambda (_: T).(\lambda (t2: T).(pr0 t1 t2)))) (pr0 t1 (lift (S O) O x)))))) -. +\def + \lambda (u1: T).(\lambda (t1: T).(\lambda (x: T).(\lambda (H: (pr0 (THead +(Bind Void) u1 t1) x)).(let H0 \def (match H in pr0 return (\lambda (t: +T).(\lambda (t0: T).(\lambda (_: (pr0 t t0)).((eq T t (THead (Bind Void) u1 +t1)) \to ((eq T t0 x) \to (or (ex3_2 T T (\lambda (u2: T).(\lambda (t2: +T).(eq T x (THead (Bind Void) u2 t2)))) (\lambda (u2: T).(\lambda (_: T).(pr0 +u1 u2))) (\lambda (_: T).(\lambda (t2: T).(pr0 t1 t2)))) (pr0 t1 (lift (S O) +O x)))))))) with [(pr0_refl t) \Rightarrow (\lambda (H0: (eq T t (THead (Bind +Void) u1 t1))).(\lambda (H1: (eq T t x)).(eq_ind T (THead (Bind Void) u1 t1) +(\lambda (t0: T).((eq T t0 x) \to (or (ex3_2 T T (\lambda (u2: T).(\lambda +(t2: T).(eq T x (THead (Bind Void) u2 t2)))) (\lambda (u2: T).(\lambda (_: +T).(pr0 u1 u2))) (\lambda (_: T).(\lambda (t2: T).(pr0 t1 t2)))) (pr0 t1 +(lift (S O) O x))))) (\lambda (H2: (eq T (THead (Bind Void) u1 t1) +x)).(eq_ind T (THead (Bind Void) u1 t1) (\lambda (t0: T).(or (ex3_2 T T +(\lambda (u2: T).(\lambda (t2: T).(eq T t0 (THead (Bind Void) u2 t2)))) +(\lambda (u2: T).(\lambda (_: T).(pr0 u1 u2))) (\lambda (_: T).(\lambda (t2: +T).(pr0 t1 t2)))) (pr0 t1 (lift (S O) O t0)))) (or_introl (ex3_2 T T (\lambda +(u2: T).(\lambda (t2: T).(eq T (THead (Bind Void) u1 t1) (THead (Bind Void) +u2 t2)))) (\lambda (u2: T).(\lambda (_: T).(pr0 u1 u2))) (\lambda (_: +T).(\lambda (t2: T).(pr0 t1 t2)))) (pr0 t1 (lift (S O) O (THead (Bind Void) +u1 t1))) (ex3_2_intro T T (\lambda (u2: T).(\lambda (t2: T).(eq T (THead +(Bind Void) u1 t1) (THead (Bind Void) u2 t2)))) (\lambda (u2: T).(\lambda (_: +T).(pr0 u1 u2))) (\lambda (_: T).(\lambda (t2: T).(pr0 t1 t2))) u1 t1 +(refl_equal T (THead (Bind Void) u1 t1)) (pr0_refl u1) (pr0_refl t1))) x H2)) +t (sym_eq T t (THead (Bind Void) u1 t1) H0) H1))) | (pr0_comp u0 u2 H0 t0 t2 +H1 k) \Rightarrow (\lambda (H2: (eq T (THead k u0 t0) (THead (Bind Void) u1 +t1))).(\lambda (H3: (eq T (THead k u2 t2) x)).((let H4 \def (f_equal T T +(\lambda (e: T).(match e in T return (\lambda (_: T).T) with [(TSort _) +\Rightarrow t0 | (TLRef _) \Rightarrow t0 | (THead _ _ t) \Rightarrow t])) +(THead k u0 t0) (THead (Bind Void) u1 t1) H2) in ((let H5 \def (f_equal T T +(\lambda (e: T).(match e in T return (\lambda (_: T).T) with [(TSort _) +\Rightarrow u0 | (TLRef _) \Rightarrow u0 | (THead _ t _) \Rightarrow t])) +(THead k u0 t0) (THead (Bind Void) u1 t1) H2) in ((let H6 \def (f_equal T K +(\lambda (e: T).(match e in T return (\lambda (_: T).K) with [(TSort _) +\Rightarrow k | (TLRef _) \Rightarrow k | (THead k0 _ _) \Rightarrow k0])) +(THead k u0 t0) (THead (Bind Void) u1 t1) H2) in (eq_ind K (Bind Void) +(\lambda (k0: K).((eq T u0 u1) \to ((eq T t0 t1) \to ((eq T (THead k0 u2 t2) +x) \to ((pr0 u0 u2) \to ((pr0 t0 t2) \to (or (ex3_2 T T (\lambda (u3: +T).(\lambda (t3: T).(eq T x (THead (Bind Void) u3 t3)))) (\lambda (u3: +T).(\lambda (_: T).(pr0 u1 u3))) (\lambda (_: T).(\lambda (t3: T).(pr0 t1 +t3)))) (pr0 t1 (lift (S O) O x))))))))) (\lambda (H7: (eq T u0 u1)).(eq_ind T +u1 (\lambda (t: T).((eq T t0 t1) \to ((eq T (THead (Bind Void) u2 t2) x) \to +((pr0 t u2) \to ((pr0 t0 t2) \to (or (ex3_2 T T (\lambda (u3: T).(\lambda +(t3: T).(eq T x (THead (Bind Void) u3 t3)))) (\lambda (u3: T).(\lambda (_: +T).(pr0 u1 u3))) (\lambda (_: T).(\lambda (t3: T).(pr0 t1 t3)))) (pr0 t1 +(lift (S O) O x)))))))) (\lambda (H8: (eq T t0 t1)).(eq_ind T t1 (\lambda (t: +T).((eq T (THead (Bind Void) u2 t2) x) \to ((pr0 u1 u2) \to ((pr0 t t2) \to +(or (ex3_2 T T (\lambda (u3: T).(\lambda (t3: T).(eq T x (THead (Bind Void) +u3 t3)))) (\lambda (u3: T).(\lambda (_: T).(pr0 u1 u3))) (\lambda (_: +T).(\lambda (t3: T).(pr0 t1 t3)))) (pr0 t1 (lift (S O) O x))))))) (\lambda +(H9: (eq T (THead (Bind Void) u2 t2) x)).(eq_ind T (THead (Bind Void) u2 t2) +(\lambda (t: T).((pr0 u1 u2) \to ((pr0 t1 t2) \to (or (ex3_2 T T (\lambda +(u3: T).(\lambda (t3: T).(eq T t (THead (Bind Void) u3 t3)))) (\lambda (u3: +T).(\lambda (_: T).(pr0 u1 u3))) (\lambda (_: T).(\lambda (t3: T).(pr0 t1 +t3)))) (pr0 t1 (lift (S O) O t)))))) (\lambda (H10: (pr0 u1 u2)).(\lambda +(H11: (pr0 t1 t2)).(or_introl (ex3_2 T T (\lambda (u3: T).(\lambda (t3: +T).(eq T (THead (Bind Void) u2 t2) (THead (Bind Void) u3 t3)))) (\lambda (u3: +T).(\lambda (_: T).(pr0 u1 u3))) (\lambda (_: T).(\lambda (t3: T).(pr0 t1 +t3)))) (pr0 t1 (lift (S O) O (THead (Bind Void) u2 t2))) (ex3_2_intro T T +(\lambda (u3: T).(\lambda (t3: T).(eq T (THead (Bind Void) u2 t2) (THead +(Bind Void) u3 t3)))) (\lambda (u3: T).(\lambda (_: T).(pr0 u1 u3))) (\lambda +(_: T).(\lambda (t3: T).(pr0 t1 t3))) u2 t2 (refl_equal T (THead (Bind Void) +u2 t2)) H10 H11)))) x H9)) t0 (sym_eq T t0 t1 H8))) u0 (sym_eq T u0 u1 H7))) +k (sym_eq K k (Bind Void) H6))) H5)) H4)) H3 H0 H1))) | (pr0_beta u v1 v2 H0 +t0 t2 H1) \Rightarrow (\lambda (H2: (eq T (THead (Flat Appl) v1 (THead (Bind +Abst) u t0)) (THead (Bind Void) u1 t1))).(\lambda (H3: (eq T (THead (Bind +Abbr) v2 t2) x)).((let H4 \def (eq_ind T (THead (Flat Appl) v1 (THead (Bind +Abst) u t0)) (\lambda (e: T).(match e in T return (\lambda (_: T).Prop) with +[(TSort _) \Rightarrow False | (TLRef _) \Rightarrow False | (THead k _ _) +\Rightarrow (match k in K return (\lambda (_: K).Prop) with [(Bind _) +\Rightarrow False | (Flat _) \Rightarrow True])])) I (THead (Bind Void) u1 +t1) H2) in (False_ind ((eq T (THead (Bind Abbr) v2 t2) x) \to ((pr0 v1 v2) +\to ((pr0 t0 t2) \to (or (ex3_2 T T (\lambda (u2: T).(\lambda (t3: T).(eq T x +(THead (Bind Void) u2 t3)))) (\lambda (u2: T).(\lambda (_: T).(pr0 u1 u2))) +(\lambda (_: T).(\lambda (t3: T).(pr0 t1 t3)))) (pr0 t1 (lift (S O) O x)))))) +H4)) H3 H0 H1))) | (pr0_upsilon b H0 v1 v2 H1 u0 u2 H2 t0 t2 H3) \Rightarrow +(\lambda (H4: (eq T (THead (Flat Appl) v1 (THead (Bind b) u0 t0)) (THead +(Bind Void) u1 t1))).(\lambda (H5: (eq T (THead (Bind b) u2 (THead (Flat +Appl) (lift (S O) O v2) t2)) x)).((let H6 \def (eq_ind T (THead (Flat Appl) +v1 (THead (Bind b) u0 t0)) (\lambda (e: T).(match e in T return (\lambda (_: +T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) \Rightarrow False | +(THead k _ _) \Rightarrow (match k in K return (\lambda (_: K).Prop) with +[(Bind _) \Rightarrow False | (Flat _) \Rightarrow True])])) I (THead (Bind +Void) u1 t1) H4) in (False_ind ((eq T (THead (Bind b) u2 (THead (Flat Appl) +(lift (S O) O v2) t2)) x) \to ((not (eq B b Abst)) \to ((pr0 v1 v2) \to ((pr0 +u0 u2) \to ((pr0 t0 t2) \to (or (ex3_2 T T (\lambda (u3: T).(\lambda (t3: +T).(eq T x (THead (Bind Void) u3 t3)))) (\lambda (u3: T).(\lambda (_: T).(pr0 +u1 u3))) (\lambda (_: T).(\lambda (t3: T).(pr0 t1 t3)))) (pr0 t1 (lift (S O) +O x)))))))) H6)) H5 H0 H1 H2 H3))) | (pr0_delta u0 u2 H0 t0 t2 H1 w H2) +\Rightarrow (\lambda (H3: (eq T (THead (Bind Abbr) u0 t0) (THead (Bind Void) +u1 t1))).(\lambda (H4: (eq T (THead (Bind Abbr) u2 w) x)).((let H5 \def +(eq_ind T (THead (Bind Abbr) u0 t0) (\lambda (e: T).(match e in T return +(\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) +\Rightarrow False | (THead k _ _) \Rightarrow (match k in K return (\lambda +(_: K).Prop) with [(Bind b) \Rightarrow (match b in B return (\lambda (_: +B).Prop) with [Abbr \Rightarrow True | Abst \Rightarrow False | Void +\Rightarrow False]) | (Flat _) \Rightarrow False])])) I (THead (Bind Void) u1 +t1) H3) in (False_ind ((eq T (THead (Bind Abbr) u2 w) x) \to ((pr0 u0 u2) \to +((pr0 t0 t2) \to ((subst0 O u2 t2 w) \to (or (ex3_2 T T (\lambda (u3: +T).(\lambda (t3: T).(eq T x (THead (Bind Void) u3 t3)))) (\lambda (u3: +T).(\lambda (_: T).(pr0 u1 u3))) (\lambda (_: T).(\lambda (t3: T).(pr0 t1 +t3)))) (pr0 t1 (lift (S O) O x))))))) H5)) H4 H0 H1 H2))) | (pr0_zeta b H0 t0 +t2 H1 u) \Rightarrow (\lambda (H2: (eq T (THead (Bind b) u (lift (S O) O t0)) +(THead (Bind Void) u1 t1))).(\lambda (H3: (eq T t2 x)).((let H4 \def (f_equal +T T (\lambda (e: T).(match e in T return (\lambda (_: T).T) with [(TSort _) +\Rightarrow ((let rec lref_map (f: ((nat \to nat))) (d: nat) (t: T) on t: T +\def (match t with [(TSort n) \Rightarrow (TSort n) | (TLRef i) \Rightarrow +(TLRef (match (blt i d) with [true \Rightarrow i | false \Rightarrow (f i)])) +| (THead k u0 t3) \Rightarrow (THead k (lref_map f d u0) (lref_map f (s k d) +t3))]) in lref_map) (\lambda (x0: nat).(plus x0 (S O))) O t0) | (TLRef _) +\Rightarrow ((let rec lref_map (f: ((nat \to nat))) (d: nat) (t: T) on t: T +\def (match t with [(TSort n) \Rightarrow (TSort n) | (TLRef i) \Rightarrow +(TLRef (match (blt i d) with [true \Rightarrow i | false \Rightarrow (f i)])) +| (THead k u0 t3) \Rightarrow (THead k (lref_map f d u0) (lref_map f (s k d) +t3))]) in lref_map) (\lambda (x0: nat).(plus x0 (S O))) O t0) | (THead _ _ t) +\Rightarrow t])) (THead (Bind b) u (lift (S O) O t0)) (THead (Bind Void) u1 +t1) H2) in ((let H5 \def (f_equal T T (\lambda (e: T).(match e in T return +(\lambda (_: T).T) with [(TSort _) \Rightarrow u | (TLRef _) \Rightarrow u | +(THead _ t _) \Rightarrow t])) (THead (Bind b) u (lift (S O) O t0)) (THead +(Bind Void) u1 t1) H2) in ((let H6 \def (f_equal T B (\lambda (e: T).(match e +in T return (\lambda (_: T).B) with [(TSort _) \Rightarrow b | (TLRef _) +\Rightarrow b | (THead k _ _) \Rightarrow (match k in K return (\lambda (_: +K).B) with [(Bind b0) \Rightarrow b0 | (Flat _) \Rightarrow b])])) (THead +(Bind b) u (lift (S O) O t0)) (THead (Bind Void) u1 t1) H2) in (eq_ind B Void +(\lambda (b0: B).((eq T u u1) \to ((eq T (lift (S O) O t0) t1) \to ((eq T t2 +x) \to ((not (eq B b0 Abst)) \to ((pr0 t0 t2) \to (or (ex3_2 T T (\lambda +(u2: T).(\lambda (t3: T).(eq T x (THead (Bind Void) u2 t3)))) (\lambda (u2: +T).(\lambda (_: T).(pr0 u1 u2))) (\lambda (_: T).(\lambda (t3: T).(pr0 t1 +t3)))) (pr0 t1 (lift (S O) O x))))))))) (\lambda (H7: (eq T u u1)).(eq_ind T +u1 (\lambda (_: T).((eq T (lift (S O) O t0) t1) \to ((eq T t2 x) \to ((not +(eq B Void Abst)) \to ((pr0 t0 t2) \to (or (ex3_2 T T (\lambda (u2: +T).(\lambda (t3: T).(eq T x (THead (Bind Void) u2 t3)))) (\lambda (u2: +T).(\lambda (_: T).(pr0 u1 u2))) (\lambda (_: T).(\lambda (t3: T).(pr0 t1 +t3)))) (pr0 t1 (lift (S O) O x)))))))) (\lambda (H8: (eq T (lift (S O) O t0) +t1)).(eq_ind T (lift (S O) O t0) (\lambda (t: T).((eq T t2 x) \to ((not (eq B +Void Abst)) \to ((pr0 t0 t2) \to (or (ex3_2 T T (\lambda (u2: T).(\lambda +(t3: T).(eq T x (THead (Bind Void) u2 t3)))) (\lambda (u2: T).(\lambda (_: +T).(pr0 u1 u2))) (\lambda (_: T).(\lambda (t3: T).(pr0 t t3)))) (pr0 t (lift +(S O) O x))))))) (\lambda (H9: (eq T t2 x)).(eq_ind T x (\lambda (t: T).((not +(eq B Void Abst)) \to ((pr0 t0 t) \to (or (ex3_2 T T (\lambda (u2: +T).(\lambda (t3: T).(eq T x (THead (Bind Void) u2 t3)))) (\lambda (u2: +T).(\lambda (_: T).(pr0 u1 u2))) (\lambda (_: T).(\lambda (t3: T).(pr0 (lift +(S O) O t0) t3)))) (pr0 (lift (S O) O t0) (lift (S O) O x)))))) (\lambda (_: +(not (eq B Void Abst))).(\lambda (H11: (pr0 t0 x)).(or_intror (ex3_2 T T +(\lambda (u2: T).(\lambda (t3: T).(eq T x (THead (Bind Void) u2 t3)))) +(\lambda (u2: T).(\lambda (_: T).(pr0 u1 u2))) (\lambda (_: T).(\lambda (t3: +T).(pr0 (lift (S O) O t0) t3)))) (pr0 (lift (S O) O t0) (lift (S O) O x)) +(pr0_lift t0 x H11 (S O) O)))) t2 (sym_eq T t2 x H9))) t1 H8)) u (sym_eq T u +u1 H7))) b (sym_eq B b Void H6))) H5)) H4)) H3 H0 H1))) | (pr0_epsilon t0 t2 +H0 u) \Rightarrow (\lambda (H1: (eq T (THead (Flat Cast) u t0) (THead (Bind +Void) u1 t1))).(\lambda (H2: (eq T t2 x)).((let H3 \def (eq_ind T (THead +(Flat Cast) u t0) (\lambda (e: T).(match e in T return (\lambda (_: T).Prop) +with [(TSort _) \Rightarrow False | (TLRef _) \Rightarrow False | (THead k _ +_) \Rightarrow (match k in K return (\lambda (_: K).Prop) with [(Bind _) +\Rightarrow False | (Flat _) \Rightarrow True])])) I (THead (Bind Void) u1 +t1) H1) in (False_ind ((eq T t2 x) \to ((pr0 t0 t2) \to (or (ex3_2 T T +(\lambda (u2: T).(\lambda (t3: T).(eq T x (THead (Bind Void) u2 t3)))) +(\lambda (u2: T).(\lambda (_: T).(pr0 u1 u2))) (\lambda (_: T).(\lambda (t3: +T).(pr0 t1 t3)))) (pr0 t1 (lift (S O) O x))))) H3)) H2 H0)))]) in (H0 +(refl_equal T (THead (Bind Void) u1 t1)) (refl_equal T x)))))). -axiom pr0_gen_lift: +theorem pr0_gen_lift: \forall (t1: T).(\forall (x: T).(\forall (h: nat).(\forall (d: nat).((pr0 (lift h d t1) x) \to (ex2 T (\lambda (t2: T).(eq T x (lift h d t2))) (\lambda (t2: T).(pr0 t1 t2))))))) -. +\def + \lambda (t1: T).(\lambda (x: T).(\lambda (h: nat).(\lambda (d: nat).(\lambda +(H: (pr0 (lift h d t1) x)).(insert_eq T (lift h d t1) (\lambda (t: T).(pr0 t +x)) (ex2 T (\lambda (t2: T).(eq T x (lift h d t2))) (\lambda (t2: T).(pr0 t1 +t2))) (\lambda (y: T).(\lambda (H0: (pr0 y x)).(unintro nat d (\lambda (n: +nat).((eq T y (lift h n t1)) \to (ex2 T (\lambda (t2: T).(eq T x (lift h n +t2))) (\lambda (t2: T).(pr0 t1 t2))))) (unintro T t1 (\lambda (t: T).(\forall +(x0: nat).((eq T y (lift h x0 t)) \to (ex2 T (\lambda (t2: T).(eq T x (lift h +x0 t2))) (\lambda (t2: T).(pr0 t t2)))))) (pr0_ind (\lambda (t: T).(\lambda +(t0: T).(\forall (x0: T).(\forall (x1: nat).((eq T t (lift h x1 x0)) \to (ex2 +T (\lambda (t2: T).(eq T t0 (lift h x1 t2))) (\lambda (t2: T).(pr0 x0 +t2)))))))) (\lambda (t: T).(\lambda (x0: T).(\lambda (x1: nat).(\lambda (H1: +(eq T t (lift h x1 x0))).(ex_intro2 T (\lambda (t2: T).(eq T t (lift h x1 +t2))) (\lambda (t2: T).(pr0 x0 t2)) x0 H1 (pr0_refl x0)))))) (\lambda (u1: +T).(\lambda (u2: T).(\lambda (_: (pr0 u1 u2)).(\lambda (H2: ((\forall (x0: +T).(\forall (x1: nat).((eq T u1 (lift h x1 x0)) \to (ex2 T (\lambda (t2: +T).(eq T u2 (lift h x1 t2))) (\lambda (t2: T).(pr0 x0 t2)))))))).(\lambda +(t2: T).(\lambda (t3: T).(\lambda (_: (pr0 t2 t3)).(\lambda (H4: ((\forall +(x0: T).(\forall (x1: nat).((eq T t2 (lift h x1 x0)) \to (ex2 T (\lambda (t4: +T).(eq T t3 (lift h x1 t4))) (\lambda (t4: T).(pr0 x0 t4)))))))).(\lambda (k: +K).(\lambda (x0: T).(\lambda (x1: nat).(\lambda (H5: (eq T (THead k u1 t2) +(lift h x1 x0))).(K_ind (\lambda (k0: K).((eq T (THead k0 u1 t2) (lift h x1 +x0)) \to (ex2 T (\lambda (t4: T).(eq T (THead k0 u2 t3) (lift h x1 t4))) +(\lambda (t4: T).(pr0 x0 t4))))) (\lambda (b: B).(\lambda (H6: (eq T (THead +(Bind b) u1 t2) (lift h x1 x0))).(ex3_2_ind T T (\lambda (y0: T).(\lambda (z: +T).(eq T x0 (THead (Bind b) y0 z)))) (\lambda (y0: T).(\lambda (_: T).(eq T +u1 (lift h x1 y0)))) (\lambda (_: T).(\lambda (z: T).(eq T t2 (lift h (S x1) +z)))) (ex2 T (\lambda (t4: T).(eq T (THead (Bind b) u2 t3) (lift h x1 t4))) +(\lambda (t4: T).(pr0 x0 t4))) (\lambda (x2: T).(\lambda (x3: T).(\lambda +(H7: (eq T x0 (THead (Bind b) x2 x3))).(\lambda (H8: (eq T u1 (lift h x1 +x2))).(\lambda (H9: (eq T t2 (lift h (S x1) x3))).(eq_ind_r T (THead (Bind b) +x2 x3) (\lambda (t: T).(ex2 T (\lambda (t4: T).(eq T (THead (Bind b) u2 t3) +(lift h x1 t4))) (\lambda (t4: T).(pr0 t t4)))) (ex2_ind T (\lambda (t4: +T).(eq T t3 (lift h (S x1) t4))) (\lambda (t4: T).(pr0 x3 t4)) (ex2 T +(\lambda (t4: T).(eq T (THead (Bind b) u2 t3) (lift h x1 t4))) (\lambda (t4: +T).(pr0 (THead (Bind b) x2 x3) t4))) (\lambda (x4: T).(\lambda (H_x: (eq T t3 +(lift h (S x1) x4))).(\lambda (H10: (pr0 x3 x4)).(eq_ind_r T (lift h (S x1) +x4) (\lambda (t: T).(ex2 T (\lambda (t4: T).(eq T (THead (Bind b) u2 t) (lift +h x1 t4))) (\lambda (t4: T).(pr0 (THead (Bind b) x2 x3) t4)))) (ex2_ind T +(\lambda (t4: T).(eq T u2 (lift h x1 t4))) (\lambda (t4: T).(pr0 x2 t4)) (ex2 +T (\lambda (t4: T).(eq T (THead (Bind b) u2 (lift h (S x1) x4)) (lift h x1 +t4))) (\lambda (t4: T).(pr0 (THead (Bind b) x2 x3) t4))) (\lambda (x5: +T).(\lambda (H_x0: (eq T u2 (lift h x1 x5))).(\lambda (H11: (pr0 x2 +x5)).(eq_ind_r T (lift h x1 x5) (\lambda (t: T).(ex2 T (\lambda (t4: T).(eq T +(THead (Bind b) t (lift h (S x1) x4)) (lift h x1 t4))) (\lambda (t4: T).(pr0 +(THead (Bind b) x2 x3) t4)))) (ex_intro2 T (\lambda (t4: T).(eq T (THead +(Bind b) (lift h x1 x5) (lift h (S x1) x4)) (lift h x1 t4))) (\lambda (t4: +T).(pr0 (THead (Bind b) x2 x3) t4)) (THead (Bind b) x5 x4) (sym_eq T (lift h +x1 (THead (Bind b) x5 x4)) (THead (Bind b) (lift h x1 x5) (lift h (S x1) x4)) +(lift_bind b x5 x4 h x1)) (pr0_comp x2 x5 H11 x3 x4 H10 (Bind b))) u2 +H_x0)))) (H2 x2 x1 H8)) t3 H_x)))) (H4 x3 (S x1) H9)) x0 H7)))))) +(lift_gen_bind b u1 t2 x0 h x1 H6)))) (\lambda (f: F).(\lambda (H6: (eq T +(THead (Flat f) u1 t2) (lift h x1 x0))).(ex3_2_ind T T (\lambda (y0: +T).(\lambda (z: T).(eq T x0 (THead (Flat f) y0 z)))) (\lambda (y0: +T).(\lambda (_: T).(eq T u1 (lift h x1 y0)))) (\lambda (_: T).(\lambda (z: +T).(eq T t2 (lift h x1 z)))) (ex2 T (\lambda (t4: T).(eq T (THead (Flat f) u2 +t3) (lift h x1 t4))) (\lambda (t4: T).(pr0 x0 t4))) (\lambda (x2: T).(\lambda +(x3: T).(\lambda (H7: (eq T x0 (THead (Flat f) x2 x3))).(\lambda (H8: (eq T +u1 (lift h x1 x2))).(\lambda (H9: (eq T t2 (lift h x1 x3))).(eq_ind_r T +(THead (Flat f) x2 x3) (\lambda (t: T).(ex2 T (\lambda (t4: T).(eq T (THead +(Flat f) u2 t3) (lift h x1 t4))) (\lambda (t4: T).(pr0 t t4)))) (ex2_ind T +(\lambda (t4: T).(eq T t3 (lift h x1 t4))) (\lambda (t4: T).(pr0 x3 t4)) (ex2 +T (\lambda (t4: T).(eq T (THead (Flat f) u2 t3) (lift h x1 t4))) (\lambda +(t4: T).(pr0 (THead (Flat f) x2 x3) t4))) (\lambda (x4: T).(\lambda (H_x: (eq +T t3 (lift h x1 x4))).(\lambda (H10: (pr0 x3 x4)).(eq_ind_r T (lift h x1 x4) +(\lambda (t: T).(ex2 T (\lambda (t4: T).(eq T (THead (Flat f) u2 t) (lift h +x1 t4))) (\lambda (t4: T).(pr0 (THead (Flat f) x2 x3) t4)))) (ex2_ind T +(\lambda (t4: T).(eq T u2 (lift h x1 t4))) (\lambda (t4: T).(pr0 x2 t4)) (ex2 +T (\lambda (t4: T).(eq T (THead (Flat f) u2 (lift h x1 x4)) (lift h x1 t4))) +(\lambda (t4: T).(pr0 (THead (Flat f) x2 x3) t4))) (\lambda (x5: T).(\lambda +(H_x0: (eq T u2 (lift h x1 x5))).(\lambda (H11: (pr0 x2 x5)).(eq_ind_r T +(lift h x1 x5) (\lambda (t: T).(ex2 T (\lambda (t4: T).(eq T (THead (Flat f) +t (lift h x1 x4)) (lift h x1 t4))) (\lambda (t4: T).(pr0 (THead (Flat f) x2 +x3) t4)))) (ex_intro2 T (\lambda (t4: T).(eq T (THead (Flat f) (lift h x1 x5) +(lift h x1 x4)) (lift h x1 t4))) (\lambda (t4: T).(pr0 (THead (Flat f) x2 x3) +t4)) (THead (Flat f) x5 x4) (sym_eq T (lift h x1 (THead (Flat f) x5 x4)) +(THead (Flat f) (lift h x1 x5) (lift h x1 x4)) (lift_flat f x5 x4 h x1)) +(pr0_comp x2 x5 H11 x3 x4 H10 (Flat f))) u2 H_x0)))) (H2 x2 x1 H8)) t3 +H_x)))) (H4 x3 x1 H9)) x0 H7)))))) (lift_gen_flat f u1 t2 x0 h x1 H6)))) k +H5))))))))))))) (\lambda (u: T).(\lambda (v1: T).(\lambda (v2: T).(\lambda +(_: (pr0 v1 v2)).(\lambda (H2: ((\forall (x0: T).(\forall (x1: nat).((eq T v1 +(lift h x1 x0)) \to (ex2 T (\lambda (t2: T).(eq T v2 (lift h x1 t2))) +(\lambda (t2: T).(pr0 x0 t2)))))))).(\lambda (t2: T).(\lambda (t3: +T).(\lambda (_: (pr0 t2 t3)).(\lambda (H4: ((\forall (x0: T).(\forall (x1: +nat).((eq T t2 (lift h x1 x0)) \to (ex2 T (\lambda (t4: T).(eq T t3 (lift h +x1 t4))) (\lambda (t4: T).(pr0 x0 t4)))))))).(\lambda (x0: T).(\lambda (x1: +nat).(\lambda (H5: (eq T (THead (Flat Appl) v1 (THead (Bind Abst) u t2)) +(lift h x1 x0))).(ex3_2_ind T T (\lambda (y0: T).(\lambda (z: T).(eq T x0 +(THead (Flat Appl) y0 z)))) (\lambda (y0: T).(\lambda (_: T).(eq T v1 (lift h +x1 y0)))) (\lambda (_: T).(\lambda (z: T).(eq T (THead (Bind Abst) u t2) +(lift h x1 z)))) (ex2 T (\lambda (t4: T).(eq T (THead (Bind Abbr) v2 t3) +(lift h x1 t4))) (\lambda (t4: T).(pr0 x0 t4))) (\lambda (x2: T).(\lambda +(x3: T).(\lambda (H6: (eq T x0 (THead (Flat Appl) x2 x3))).(\lambda (H7: (eq +T v1 (lift h x1 x2))).(\lambda (H8: (eq T (THead (Bind Abst) u t2) (lift h x1 +x3))).(eq_ind_r T (THead (Flat Appl) x2 x3) (\lambda (t: T).(ex2 T (\lambda +(t4: T).(eq T (THead (Bind Abbr) v2 t3) (lift h x1 t4))) (\lambda (t4: +T).(pr0 t t4)))) (ex3_2_ind T T (\lambda (y0: T).(\lambda (z: T).(eq T x3 +(THead (Bind Abst) y0 z)))) (\lambda (y0: T).(\lambda (_: T).(eq T u (lift h +x1 y0)))) (\lambda (_: T).(\lambda (z: T).(eq T t2 (lift h (S x1) z)))) (ex2 +T (\lambda (t4: T).(eq T (THead (Bind Abbr) v2 t3) (lift h x1 t4))) (\lambda +(t4: T).(pr0 (THead (Flat Appl) x2 x3) t4))) (\lambda (x4: T).(\lambda (x5: +T).(\lambda (H9: (eq T x3 (THead (Bind Abst) x4 x5))).(\lambda (_: (eq T u +(lift h x1 x4))).(\lambda (H11: (eq T t2 (lift h (S x1) x5))).(eq_ind_r T +(THead (Bind Abst) x4 x5) (\lambda (t: T).(ex2 T (\lambda (t4: T).(eq T +(THead (Bind Abbr) v2 t3) (lift h x1 t4))) (\lambda (t4: T).(pr0 (THead (Flat +Appl) x2 t) t4)))) (ex2_ind T (\lambda (t4: T).(eq T t3 (lift h (S x1) t4))) +(\lambda (t4: T).(pr0 x5 t4)) (ex2 T (\lambda (t4: T).(eq T (THead (Bind +Abbr) v2 t3) (lift h x1 t4))) (\lambda (t4: T).(pr0 (THead (Flat Appl) x2 +(THead (Bind Abst) x4 x5)) t4))) (\lambda (x6: T).(\lambda (H_x: (eq T t3 +(lift h (S x1) x6))).(\lambda (H12: (pr0 x5 x6)).(eq_ind_r T (lift h (S x1) +x6) (\lambda (t: T).(ex2 T (\lambda (t4: T).(eq T (THead (Bind Abbr) v2 t) +(lift h x1 t4))) (\lambda (t4: T).(pr0 (THead (Flat Appl) x2 (THead (Bind +Abst) x4 x5)) t4)))) (ex2_ind T (\lambda (t4: T).(eq T v2 (lift h x1 t4))) +(\lambda (t4: T).(pr0 x2 t4)) (ex2 T (\lambda (t4: T).(eq T (THead (Bind +Abbr) v2 (lift h (S x1) x6)) (lift h x1 t4))) (\lambda (t4: T).(pr0 (THead +(Flat Appl) x2 (THead (Bind Abst) x4 x5)) t4))) (\lambda (x7: T).(\lambda +(H_x0: (eq T v2 (lift h x1 x7))).(\lambda (H13: (pr0 x2 x7)).(eq_ind_r T +(lift h x1 x7) (\lambda (t: T).(ex2 T (\lambda (t4: T).(eq T (THead (Bind +Abbr) t (lift h (S x1) x6)) (lift h x1 t4))) (\lambda (t4: T).(pr0 (THead +(Flat Appl) x2 (THead (Bind Abst) x4 x5)) t4)))) (ex_intro2 T (\lambda (t4: +T).(eq T (THead (Bind Abbr) (lift h x1 x7) (lift h (S x1) x6)) (lift h x1 +t4))) (\lambda (t4: T).(pr0 (THead (Flat Appl) x2 (THead (Bind Abst) x4 x5)) +t4)) (THead (Bind Abbr) x7 x6) (sym_eq T (lift h x1 (THead (Bind Abbr) x7 +x6)) (THead (Bind Abbr) (lift h x1 x7) (lift h (S x1) x6)) (lift_bind Abbr x7 +x6 h x1)) (pr0_beta x4 x2 x7 H13 x5 x6 H12)) v2 H_x0)))) (H2 x2 x1 H7)) t3 +H_x)))) (H4 x5 (S x1) H11)) x3 H9)))))) (lift_gen_bind Abst u t2 x3 h x1 H8)) +x0 H6)))))) (lift_gen_flat Appl v1 (THead (Bind Abst) u t2) x0 h x1 +H5)))))))))))))) (\lambda (b: B).(\lambda (H1: (not (eq B b Abst))).(\lambda +(v1: T).(\lambda (v2: T).(\lambda (_: (pr0 v1 v2)).(\lambda (H3: ((\forall +(x0: T).(\forall (x1: nat).((eq T v1 (lift h x1 x0)) \to (ex2 T (\lambda (t2: +T).(eq T v2 (lift h x1 t2))) (\lambda (t2: T).(pr0 x0 t2)))))))).(\lambda +(u1: T).(\lambda (u2: T).(\lambda (_: (pr0 u1 u2)).(\lambda (H5: ((\forall +(x0: T).(\forall (x1: nat).((eq T u1 (lift h x1 x0)) \to (ex2 T (\lambda (t2: +T).(eq T u2 (lift h x1 t2))) (\lambda (t2: T).(pr0 x0 t2)))))))).(\lambda +(t2: T).(\lambda (t3: T).(\lambda (_: (pr0 t2 t3)).(\lambda (H7: ((\forall +(x0: T).(\forall (x1: nat).((eq T t2 (lift h x1 x0)) \to (ex2 T (\lambda (t4: +T).(eq T t3 (lift h x1 t4))) (\lambda (t4: T).(pr0 x0 t4)))))))).(\lambda +(x0: T).(\lambda (x1: nat).(\lambda (H8: (eq T (THead (Flat Appl) v1 (THead +(Bind b) u1 t2)) (lift h x1 x0))).(ex3_2_ind T T (\lambda (y0: T).(\lambda +(z: T).(eq T x0 (THead (Flat Appl) y0 z)))) (\lambda (y0: T).(\lambda (_: +T).(eq T v1 (lift h x1 y0)))) (\lambda (_: T).(\lambda (z: T).(eq T (THead +(Bind b) u1 t2) (lift h x1 z)))) (ex2 T (\lambda (t4: T).(eq T (THead (Bind +b) u2 (THead (Flat Appl) (lift (S O) O v2) t3)) (lift h x1 t4))) (\lambda +(t4: T).(pr0 x0 t4))) (\lambda (x2: T).(\lambda (x3: T).(\lambda (H9: (eq T +x0 (THead (Flat Appl) x2 x3))).(\lambda (H10: (eq T v1 (lift h x1 +x2))).(\lambda (H11: (eq T (THead (Bind b) u1 t2) (lift h x1 x3))).(eq_ind_r +T (THead (Flat Appl) x2 x3) (\lambda (t: T).(ex2 T (\lambda (t4: T).(eq T +(THead (Bind b) u2 (THead (Flat Appl) (lift (S O) O v2) t3)) (lift h x1 t4))) +(\lambda (t4: T).(pr0 t t4)))) (ex3_2_ind T T (\lambda (y0: T).(\lambda (z: +T).(eq T x3 (THead (Bind b) y0 z)))) (\lambda (y0: T).(\lambda (_: T).(eq T +u1 (lift h x1 y0)))) (\lambda (_: T).(\lambda (z: T).(eq T t2 (lift h (S x1) +z)))) (ex2 T (\lambda (t4: T).(eq T (THead (Bind b) u2 (THead (Flat Appl) +(lift (S O) O v2) t3)) (lift h x1 t4))) (\lambda (t4: T).(pr0 (THead (Flat +Appl) x2 x3) t4))) (\lambda (x4: T).(\lambda (x5: T).(\lambda (H12: (eq T x3 +(THead (Bind b) x4 x5))).(\lambda (H13: (eq T u1 (lift h x1 x4))).(\lambda +(H14: (eq T t2 (lift h (S x1) x5))).(eq_ind_r T (THead (Bind b) x4 x5) +(\lambda (t: T).(ex2 T (\lambda (t4: T).(eq T (THead (Bind b) u2 (THead (Flat +Appl) (lift (S O) O v2) t3)) (lift h x1 t4))) (\lambda (t4: T).(pr0 (THead +(Flat Appl) x2 t) t4)))) (ex2_ind T (\lambda (t4: T).(eq T t3 (lift h (S x1) +t4))) (\lambda (t4: T).(pr0 x5 t4)) (ex2 T (\lambda (t4: T).(eq T (THead +(Bind b) u2 (THead (Flat Appl) (lift (S O) O v2) t3)) (lift h x1 t4))) +(\lambda (t4: T).(pr0 (THead (Flat Appl) x2 (THead (Bind b) x4 x5)) t4))) +(\lambda (x6: T).(\lambda (H_x: (eq T t3 (lift h (S x1) x6))).(\lambda (H15: +(pr0 x5 x6)).(eq_ind_r T (lift h (S x1) x6) (\lambda (t: T).(ex2 T (\lambda +(t4: T).(eq T (THead (Bind b) u2 (THead (Flat Appl) (lift (S O) O v2) t)) +(lift h x1 t4))) (\lambda (t4: T).(pr0 (THead (Flat Appl) x2 (THead (Bind b) +x4 x5)) t4)))) (ex2_ind T (\lambda (t4: T).(eq T u2 (lift h x1 t4))) (\lambda +(t4: T).(pr0 x4 t4)) (ex2 T (\lambda (t4: T).(eq T (THead (Bind b) u2 (THead +(Flat Appl) (lift (S O) O v2) (lift h (S x1) x6))) (lift h x1 t4))) (\lambda +(t4: T).(pr0 (THead (Flat Appl) x2 (THead (Bind b) x4 x5)) t4))) (\lambda +(x7: T).(\lambda (H_x0: (eq T u2 (lift h x1 x7))).(\lambda (H16: (pr0 x4 +x7)).(eq_ind_r T (lift h x1 x7) (\lambda (t: T).(ex2 T (\lambda (t4: T).(eq T +(THead (Bind b) t (THead (Flat Appl) (lift (S O) O v2) (lift h (S x1) x6))) +(lift h x1 t4))) (\lambda (t4: T).(pr0 (THead (Flat Appl) x2 (THead (Bind b) +x4 x5)) t4)))) (ex2_ind T (\lambda (t4: T).(eq T v2 (lift h x1 t4))) (\lambda +(t4: T).(pr0 x2 t4)) (ex2 T (\lambda (t4: T).(eq T (THead (Bind b) (lift h x1 +x7) (THead (Flat Appl) (lift (S O) O v2) (lift h (S x1) x6))) (lift h x1 +t4))) (\lambda (t4: T).(pr0 (THead (Flat Appl) x2 (THead (Bind b) x4 x5)) +t4))) (\lambda (x8: T).(\lambda (H_x1: (eq T v2 (lift h x1 x8))).(\lambda +(H17: (pr0 x2 x8)).(eq_ind_r T (lift h x1 x8) (\lambda (t: T).(ex2 T (\lambda +(t4: T).(eq T (THead (Bind b) (lift h x1 x7) (THead (Flat Appl) (lift (S O) O +t) (lift h (S x1) x6))) (lift h x1 t4))) (\lambda (t4: T).(pr0 (THead (Flat +Appl) x2 (THead (Bind b) x4 x5)) t4)))) (eq_ind T (lift h (plus (S O) x1) +(lift (S O) O x8)) (\lambda (t: T).(ex2 T (\lambda (t4: T).(eq T (THead (Bind +b) (lift h x1 x7) (THead (Flat Appl) t (lift h (S x1) x6))) (lift h x1 t4))) +(\lambda (t4: T).(pr0 (THead (Flat Appl) x2 (THead (Bind b) x4 x5)) t4)))) +(eq_ind T (lift h (S x1) (THead (Flat Appl) (lift (S O) O x8) x6)) (\lambda +(t: T).(ex2 T (\lambda (t4: T).(eq T (THead (Bind b) (lift h x1 x7) t) (lift +h x1 t4))) (\lambda (t4: T).(pr0 (THead (Flat Appl) x2 (THead (Bind b) x4 +x5)) t4)))) (ex_intro2 T (\lambda (t4: T).(eq T (THead (Bind b) (lift h x1 +x7) (lift h (S x1) (THead (Flat Appl) (lift (S O) O x8) x6))) (lift h x1 +t4))) (\lambda (t4: T).(pr0 (THead (Flat Appl) x2 (THead (Bind b) x4 x5)) +t4)) (THead (Bind b) x7 (THead (Flat Appl) (lift (S O) O x8) x6)) (sym_eq T +(lift h x1 (THead (Bind b) x7 (THead (Flat Appl) (lift (S O) O x8) x6))) +(THead (Bind b) (lift h x1 x7) (lift h (S x1) (THead (Flat Appl) (lift (S O) +O x8) x6))) (lift_bind b x7 (THead (Flat Appl) (lift (S O) O x8) x6) h x1)) +(pr0_upsilon b H1 x2 x8 H17 x4 x7 H16 x5 x6 H15)) (THead (Flat Appl) (lift h +(S x1) (lift (S O) O x8)) (lift h (S x1) x6)) (lift_flat Appl (lift (S O) O +x8) x6 h (S x1))) (lift (S O) O (lift h x1 x8)) (lift_d x8 h (S O) x1 O +(le_O_n x1))) v2 H_x1)))) (H3 x2 x1 H10)) u2 H_x0)))) (H5 x4 x1 H13)) t3 +H_x)))) (H7 x5 (S x1) H14)) x3 H12)))))) (lift_gen_bind b u1 t2 x3 h x1 H11)) +x0 H9)))))) (lift_gen_flat Appl v1 (THead (Bind b) u1 t2) x0 h x1 +H8))))))))))))))))))) (\lambda (u1: T).(\lambda (u2: T).(\lambda (_: (pr0 u1 +u2)).(\lambda (H2: ((\forall (x0: T).(\forall (x1: nat).((eq T u1 (lift h x1 +x0)) \to (ex2 T (\lambda (t2: T).(eq T u2 (lift h x1 t2))) (\lambda (t2: +T).(pr0 x0 t2)))))))).(\lambda (t2: T).(\lambda (t3: T).(\lambda (_: (pr0 t2 +t3)).(\lambda (H4: ((\forall (x0: T).(\forall (x1: nat).((eq T t2 (lift h x1 +x0)) \to (ex2 T (\lambda (t4: T).(eq T t3 (lift h x1 t4))) (\lambda (t4: +T).(pr0 x0 t4)))))))).(\lambda (w: T).(\lambda (H5: (subst0 O u2 t3 +w)).(\lambda (x0: T).(\lambda (x1: nat).(\lambda (H6: (eq T (THead (Bind +Abbr) u1 t2) (lift h x1 x0))).(ex3_2_ind T T (\lambda (y0: T).(\lambda (z: +T).(eq T x0 (THead (Bind Abbr) y0 z)))) (\lambda (y0: T).(\lambda (_: T).(eq +T u1 (lift h x1 y0)))) (\lambda (_: T).(\lambda (z: T).(eq T t2 (lift h (S +x1) z)))) (ex2 T (\lambda (t4: T).(eq T (THead (Bind Abbr) u2 w) (lift h x1 +t4))) (\lambda (t4: T).(pr0 x0 t4))) (\lambda (x2: T).(\lambda (x3: +T).(\lambda (H7: (eq T x0 (THead (Bind Abbr) x2 x3))).(\lambda (H8: (eq T u1 +(lift h x1 x2))).(\lambda (H9: (eq T t2 (lift h (S x1) x3))).(eq_ind_r T +(THead (Bind Abbr) x2 x3) (\lambda (t: T).(ex2 T (\lambda (t4: T).(eq T +(THead (Bind Abbr) u2 w) (lift h x1 t4))) (\lambda (t4: T).(pr0 t t4)))) +(ex2_ind T (\lambda (t4: T).(eq T t3 (lift h (S x1) t4))) (\lambda (t4: +T).(pr0 x3 t4)) (ex2 T (\lambda (t4: T).(eq T (THead (Bind Abbr) u2 w) (lift +h x1 t4))) (\lambda (t4: T).(pr0 (THead (Bind Abbr) x2 x3) t4))) (\lambda +(x4: T).(\lambda (H_x: (eq T t3 (lift h (S x1) x4))).(\lambda (H10: (pr0 x3 +x4)).(let H11 \def (eq_ind T t3 (\lambda (t: T).(subst0 O u2 t w)) H5 (lift h +(S x1) x4) H_x) in (ex2_ind T (\lambda (t4: T).(eq T u2 (lift h x1 t4))) +(\lambda (t4: T).(pr0 x2 t4)) (ex2 T (\lambda (t4: T).(eq T (THead (Bind +Abbr) u2 w) (lift h x1 t4))) (\lambda (t4: T).(pr0 (THead (Bind Abbr) x2 x3) +t4))) (\lambda (x5: T).(\lambda (H_x0: (eq T u2 (lift h x1 x5))).(\lambda +(H12: (pr0 x2 x5)).(eq_ind_r T (lift h x1 x5) (\lambda (t: T).(ex2 T (\lambda +(t4: T).(eq T (THead (Bind Abbr) t w) (lift h x1 t4))) (\lambda (t4: T).(pr0 +(THead (Bind Abbr) x2 x3) t4)))) (let H13 \def (eq_ind T u2 (\lambda (t: +T).(subst0 O t (lift h (S x1) x4) w)) H11 (lift h x1 x5) H_x0) in (let H14 +\def (refl_equal nat (S (plus O x1))) in (let H15 \def (eq_ind nat (S x1) +(\lambda (n: nat).(subst0 O (lift h x1 x5) (lift h n x4) w)) H13 (S (plus O +x1)) H14) in (ex2_ind T (\lambda (t4: T).(eq T w (lift h (S (plus O x1)) +t4))) (\lambda (t4: T).(subst0 O x5 x4 t4)) (ex2 T (\lambda (t4: T).(eq T +(THead (Bind Abbr) (lift h x1 x5) w) (lift h x1 t4))) (\lambda (t4: T).(pr0 +(THead (Bind Abbr) x2 x3) t4))) (\lambda (x6: T).(\lambda (H16: (eq T w (lift +h (S (plus O x1)) x6))).(\lambda (H17: (subst0 O x5 x4 x6)).(eq_ind_r T (lift +h (S (plus O x1)) x6) (\lambda (t: T).(ex2 T (\lambda (t4: T).(eq T (THead +(Bind Abbr) (lift h x1 x5) t) (lift h x1 t4))) (\lambda (t4: T).(pr0 (THead +(Bind Abbr) x2 x3) t4)))) (ex_intro2 T (\lambda (t4: T).(eq T (THead (Bind +Abbr) (lift h x1 x5) (lift h (S (plus O x1)) x6)) (lift h x1 t4))) (\lambda +(t4: T).(pr0 (THead (Bind Abbr) x2 x3) t4)) (THead (Bind Abbr) x5 x6) (sym_eq +T (lift h x1 (THead (Bind Abbr) x5 x6)) (THead (Bind Abbr) (lift h x1 x5) +(lift h (S (plus O x1)) x6)) (lift_bind Abbr x5 x6 h (plus O x1))) (pr0_delta +x2 x5 H12 x3 x4 H10 x6 H17)) w H16)))) (subst0_gen_lift_lt x5 x4 w O h x1 +H15))))) u2 H_x0)))) (H2 x2 x1 H8)))))) (H4 x3 (S x1) H9)) x0 H7)))))) +(lift_gen_bind Abbr u1 t2 x0 h x1 H6))))))))))))))) (\lambda (b: B).(\lambda +(H1: (not (eq B b Abst))).(\lambda (t2: T).(\lambda (t3: T).(\lambda (_: (pr0 +t2 t3)).(\lambda (H3: ((\forall (x0: T).(\forall (x1: nat).((eq T t2 (lift h +x1 x0)) \to (ex2 T (\lambda (t4: T).(eq T t3 (lift h x1 t4))) (\lambda (t4: +T).(pr0 x0 t4)))))))).(\lambda (u: T).(\lambda (x0: T).(\lambda (x1: +nat).(\lambda (H4: (eq T (THead (Bind b) u (lift (S O) O t2)) (lift h x1 +x0))).(ex3_2_ind T T (\lambda (y0: T).(\lambda (z: T).(eq T x0 (THead (Bind +b) y0 z)))) (\lambda (y0: T).(\lambda (_: T).(eq T u (lift h x1 y0)))) +(\lambda (_: T).(\lambda (z: T).(eq T (lift (S O) O t2) (lift h (S x1) z)))) +(ex2 T (\lambda (t4: T).(eq T t3 (lift h x1 t4))) (\lambda (t4: T).(pr0 x0 +t4))) (\lambda (x2: T).(\lambda (x3: T).(\lambda (H5: (eq T x0 (THead (Bind +b) x2 x3))).(\lambda (_: (eq T u (lift h x1 x2))).(\lambda (H7: (eq T (lift +(S O) O t2) (lift h (S x1) x3))).(eq_ind_r T (THead (Bind b) x2 x3) (\lambda +(t: T).(ex2 T (\lambda (t4: T).(eq T t3 (lift h x1 t4))) (\lambda (t4: +T).(pr0 t t4)))) (let H8 \def (eq_ind_r nat (plus (S O) x1) (\lambda (n: +nat).(eq nat (S x1) n)) (refl_equal nat (plus (S O) x1)) (plus x1 (S O)) +(plus_comm x1 (S O))) in (let H9 \def (eq_ind nat (S x1) (\lambda (n: +nat).(eq T (lift (S O) O t2) (lift h n x3))) H7 (plus x1 (S O)) H8) in +(ex2_ind T (\lambda (t4: T).(eq T x3 (lift (S O) O t4))) (\lambda (t4: T).(eq +T t2 (lift h x1 t4))) (ex2 T (\lambda (t4: T).(eq T t3 (lift h x1 t4))) +(\lambda (t4: T).(pr0 (THead (Bind b) x2 x3) t4))) (\lambda (x4: T).(\lambda +(H10: (eq T x3 (lift (S O) O x4))).(\lambda (H11: (eq T t2 (lift h x1 +x4))).(eq_ind_r T (lift (S O) O x4) (\lambda (t: T).(ex2 T (\lambda (t4: +T).(eq T t3 (lift h x1 t4))) (\lambda (t4: T).(pr0 (THead (Bind b) x2 t) +t4)))) (ex2_ind T (\lambda (t4: T).(eq T t3 (lift h x1 t4))) (\lambda (t4: +T).(pr0 x4 t4)) (ex2 T (\lambda (t4: T).(eq T t3 (lift h x1 t4))) (\lambda +(t4: T).(pr0 (THead (Bind b) x2 (lift (S O) O x4)) t4))) (\lambda (x5: +T).(\lambda (H_x: (eq T t3 (lift h x1 x5))).(\lambda (H12: (pr0 x4 +x5)).(eq_ind_r T (lift h x1 x5) (\lambda (t: T).(ex2 T (\lambda (t4: T).(eq T +t (lift h x1 t4))) (\lambda (t4: T).(pr0 (THead (Bind b) x2 (lift (S O) O +x4)) t4)))) (ex_intro2 T (\lambda (t4: T).(eq T (lift h x1 x5) (lift h x1 +t4))) (\lambda (t4: T).(pr0 (THead (Bind b) x2 (lift (S O) O x4)) t4)) x5 +(refl_equal T (lift h x1 x5)) (pr0_zeta b H1 x4 x5 H12 x2)) t3 H_x)))) (H3 x4 +x1 H11)) x3 H10)))) (lift_gen_lift t2 x3 (S O) h O x1 (le_O_n x1) H9)))) x0 +H5)))))) (lift_gen_bind b u (lift (S O) O t2) x0 h x1 H4)))))))))))) (\lambda +(t2: T).(\lambda (t3: T).(\lambda (_: (pr0 t2 t3)).(\lambda (H2: ((\forall +(x0: T).(\forall (x1: nat).((eq T t2 (lift h x1 x0)) \to (ex2 T (\lambda (t4: +T).(eq T t3 (lift h x1 t4))) (\lambda (t4: T).(pr0 x0 t4)))))))).(\lambda (u: +T).(\lambda (x0: T).(\lambda (x1: nat).(\lambda (H3: (eq T (THead (Flat Cast) +u t2) (lift h x1 x0))).(ex3_2_ind T T (\lambda (y0: T).(\lambda (z: T).(eq T +x0 (THead (Flat Cast) y0 z)))) (\lambda (y0: T).(\lambda (_: T).(eq T u (lift +h x1 y0)))) (\lambda (_: T).(\lambda (z: T).(eq T t2 (lift h x1 z)))) (ex2 T +(\lambda (t4: T).(eq T t3 (lift h x1 t4))) (\lambda (t4: T).(pr0 x0 t4))) +(\lambda (x2: T).(\lambda (x3: T).(\lambda (H4: (eq T x0 (THead (Flat Cast) +x2 x3))).(\lambda (_: (eq T u (lift h x1 x2))).(\lambda (H6: (eq T t2 (lift h +x1 x3))).(eq_ind_r T (THead (Flat Cast) x2 x3) (\lambda (t: T).(ex2 T +(\lambda (t4: T).(eq T t3 (lift h x1 t4))) (\lambda (t4: T).(pr0 t t4)))) +(ex2_ind T (\lambda (t4: T).(eq T t3 (lift h x1 t4))) (\lambda (t4: T).(pr0 +x3 t4)) (ex2 T (\lambda (t4: T).(eq T t3 (lift h x1 t4))) (\lambda (t4: +T).(pr0 (THead (Flat Cast) x2 x3) t4))) (\lambda (x4: T).(\lambda (H_x: (eq T +t3 (lift h x1 x4))).(\lambda (H7: (pr0 x3 x4)).(eq_ind_r T (lift h x1 x4) +(\lambda (t: T).(ex2 T (\lambda (t4: T).(eq T t (lift h x1 t4))) (\lambda +(t4: T).(pr0 (THead (Flat Cast) x2 x3) t4)))) (ex_intro2 T (\lambda (t4: +T).(eq T (lift h x1 x4) (lift h x1 t4))) (\lambda (t4: T).(pr0 (THead (Flat +Cast) x2 x3) t4)) x4 (refl_equal T (lift h x1 x4)) (pr0_epsilon x3 x4 H7 x2)) +t3 H_x)))) (H2 x3 x1 H6)) x0 H4)))))) (lift_gen_flat Cast u t2 x0 h x1 +H3)))))))))) y x H0))))) H))))). diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/subst0/fwd.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/subst0/fwd.ma index ccaad15d2..622fbc20d 100644 --- a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/subst0/fwd.ma +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/subst0/fwd.ma @@ -20,17 +20,196 @@ include "subst0/defs.ma". include "lift/props.ma". -axiom subst0_gen_sort: +theorem subst0_inv_coq: + \forall (i: nat).(\forall (v: T).(\forall (t1: T).(\forall (t2: T).(\forall +(P: ((nat \to (T \to (T \to (T \to Prop)))))).((((subst0 i v t1 t2) \to +(\forall (v0: T).(\forall (i0: nat).((eq nat i0 i) \to ((eq T v0 v) \to ((eq +T (TLRef i0) t1) \to ((eq T (lift (S i0) O v0) t2) \to (P i v t1 t2))))))))) +\to ((((subst0 i v t1 t2) \to (\forall (v0: T).(\forall (u2: T).(\forall (u1: +T).(\forall (i0: nat).(\forall (t: T).(\forall (k: K).((eq nat i0 i) \to ((eq +T v0 v) \to ((eq T (THead k u1 t) t1) \to ((eq T (THead k u2 t) t2) \to +((subst0 i0 v0 u1 u2) \to (P i v t1 t2)))))))))))))) \to ((((subst0 i v t1 +t2) \to (\forall (k: K).(\forall (v0: T).(\forall (t0: T).(\forall (t3: +T).(\forall (i0: nat).(\forall (u: T).((eq nat i0 i) \to ((eq T v0 v) \to +((eq T (THead k u t3) t1) \to ((eq T (THead k u t0) t2) \to ((subst0 (s k i0) +v0 t3 t0) \to (P i v t1 t2)))))))))))))) \to ((((subst0 i v t1 t2) \to +(\forall (v0: T).(\forall (u1: T).(\forall (u2: T).(\forall (i0: +nat).(\forall (k: K).(\forall (t0: T).(\forall (t3: T).((eq nat i0 i) \to +((eq T v0 v) \to ((eq T (THead k u1 t0) t1) \to ((eq T (THead k u2 t3) t2) +\to ((subst0 i0 v0 u1 u2) \to ((subst0 (s k i0) v0 t0 t3) \to (P i v t1 +t2)))))))))))))))) \to ((subst0 i v t1 t2) \to (P i v t1 t2)))))))))) +\def + \lambda (i: nat).(\lambda (v: T).(\lambda (t1: T).(\lambda (t2: T).(\lambda +(P: ((nat \to (T \to (T \to (T \to Prop)))))).(\lambda (H: (((subst0 i v t1 +t2) \to (\forall (v0: T).(\forall (i0: nat).((eq nat i0 i) \to ((eq T v0 v) +\to ((eq T (TLRef i0) t1) \to ((eq T (lift (S i0) O v0) t2) \to (P i v t1 +t2)))))))))).(\lambda (H0: (((subst0 i v t1 t2) \to (\forall (v0: T).(\forall +(u2: T).(\forall (u1: T).(\forall (i0: nat).(\forall (t: T).(\forall (k: +K).((eq nat i0 i) \to ((eq T v0 v) \to ((eq T (THead k u1 t) t1) \to ((eq T +(THead k u2 t) t2) \to ((subst0 i0 v0 u1 u2) \to (P i v t1 +t2))))))))))))))).(\lambda (H1: (((subst0 i v t1 t2) \to (\forall (k: +K).(\forall (v0: T).(\forall (t0: T).(\forall (t3: T).(\forall (i0: +nat).(\forall (u: T).((eq nat i0 i) \to ((eq T v0 v) \to ((eq T (THead k u +t3) t1) \to ((eq T (THead k u t0) t2) \to ((subst0 (s k i0) v0 t3 t0) \to (P +i v t1 t2))))))))))))))).(\lambda (H2: (((subst0 i v t1 t2) \to (\forall (v0: +T).(\forall (u1: T).(\forall (u2: T).(\forall (i0: nat).(\forall (k: +K).(\forall (t0: T).(\forall (t3: T).((eq nat i0 i) \to ((eq T v0 v) \to ((eq +T (THead k u1 t0) t1) \to ((eq T (THead k u2 t3) t2) \to ((subst0 i0 v0 u1 +u2) \to ((subst0 (s k i0) v0 t0 t3) \to (P i v t1 +t2))))))))))))))))).(\lambda (H3: (subst0 i v t1 t2)).(let H4 \def (match H3 +in subst0 return (\lambda (n: nat).(\lambda (t: T).(\lambda (t0: T).(\lambda +(t3: T).(\lambda (_: (subst0 n t t0 t3)).((eq nat n i) \to ((eq T t v) \to +((eq T t0 t1) \to ((eq T t3 t2) \to (P i v t1 t2)))))))))) with [(subst0_lref +v0 i0) \Rightarrow (\lambda (H4: (eq nat i0 i)).(\lambda (H5: (eq T v0 +v)).(\lambda (H6: (eq T (TLRef i0) t1)).(\lambda (H7: (eq T (lift (S i0) O +v0) t2)).(H H3 v0 i0 H4 H5 H6 H7))))) | (subst0_fst v0 u2 u1 i0 H4 t k) +\Rightarrow (\lambda (H5: (eq nat i0 i)).(\lambda (H6: (eq T v0 v)).(\lambda +(H7: (eq T (THead k u1 t) t1)).(\lambda (H8: (eq T (THead k u2 t) t2)).(H0 H3 +v0 u2 u1 i0 t k H5 H6 H7 H8 H4))))) | (subst0_snd k v0 t0 t3 i0 H4 u) +\Rightarrow (\lambda (H5: (eq nat i0 i)).(\lambda (H6: (eq T v0 v)).(\lambda +(H7: (eq T (THead k u t3) t1)).(\lambda (H8: (eq T (THead k u t0) t2)).(H1 H3 +k v0 t0 t3 i0 u H5 H6 H7 H8 H4))))) | (subst0_both v0 u1 u2 i0 H4 k t0 t3 H5) +\Rightarrow (\lambda (H6: (eq nat i0 i)).(\lambda (H7: (eq T v0 v)).(\lambda +(H8: (eq T (THead k u1 t0) t1)).(\lambda (H9: (eq T (THead k u2 t3) t2)).(H2 +H3 v0 u1 u2 i0 k t0 t3 H6 H7 H8 H9 H4 H5)))))]) in (H4 (refl_equal nat i) +(refl_equal T v) (refl_equal T t1) (refl_equal T t2)))))))))))). + +theorem subst0_gen_sort: \forall (v: T).(\forall (x: T).(\forall (i: nat).(\forall (n: nat).((subst0 i v (TSort n) x) \to (\forall (P: Prop).P))))) -. +\def + \lambda (v: T).(\lambda (x: T).(\lambda (i: nat).(\lambda (n: nat).(\lambda +(H: (subst0 i v (TSort n) x)).(\lambda (P: Prop).(subst0_inv_coq i v (TSort +n) x (\lambda (_: nat).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).P)))) +(\lambda (H0: (subst0 i v (TSort n) x)).(\lambda (v0: T).(\lambda (i0: +nat).(\lambda (H1: (eq nat i0 i)).(\lambda (H2: (eq T v0 v)).(\lambda (H3: +(eq T (TLRef i0) (TSort n))).(\lambda (H4: (eq T (lift (S i0) O v0) x)).(let +H5 \def (eq_ind nat i0 (\lambda (n0: nat).(eq T (lift (S n0) O v0) x)) H4 i +H1) in (let H6 \def (eq_ind nat i0 (\lambda (n0: nat).(eq T (TLRef n0) (TSort +n))) H3 i H1) in (let H7 \def (eq_ind T v0 (\lambda (t: T).(eq T (lift (S i) +O t) x)) H5 v H2) in (let H8 \def (eq_ind_r T x (\lambda (t: T).(subst0 i v +(TSort n) t)) H0 (lift (S i) O v) H7) in (let H9 \def (eq_ind_r T x (\lambda +(t: T).(subst0 i v (TSort n) t)) H (lift (S i) O v) H7) in (let H10 \def +(eq_ind T (TLRef i) (\lambda (ee: T).(match ee in T return (\lambda (_: +T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) \Rightarrow True | +(THead _ _ _) \Rightarrow False])) I (TSort n) H6) in (False_ind P +H10)))))))))))))) (\lambda (H0: (subst0 i v (TSort n) x)).(\lambda (v0: +T).(\lambda (u2: T).(\lambda (u1: T).(\lambda (i0: nat).(\lambda (t: +T).(\lambda (k: K).(\lambda (H1: (eq nat i0 i)).(\lambda (H2: (eq T v0 +v)).(\lambda (H3: (eq T (THead k u1 t) (TSort n))).(\lambda (H4: (eq T (THead +k u2 t) x)).(\lambda (H5: (subst0 i0 v0 u1 u2)).(let H6 \def (eq_ind nat i0 +(\lambda (n0: nat).(subst0 n0 v0 u1 u2)) H5 i H1) in (let H7 \def (eq_ind T +v0 (\lambda (t0: T).(subst0 i t0 u1 u2)) H6 v H2) in (let H8 \def (eq_ind_r T +x (\lambda (t0: T).(subst0 i v (TSort n) t0)) H0 (THead k u2 t) H4) in (let +H9 \def (eq_ind_r T x (\lambda (t0: T).(subst0 i v (TSort n) t0)) H (THead k +u2 t) H4) in (let H10 \def (eq_ind T (THead k u1 t) (\lambda (ee: T).(match +ee in T return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | +(TLRef _) \Rightarrow False | (THead _ _ _) \Rightarrow True])) I (TSort n) +H3) in (False_ind P H10)))))))))))))))))) (\lambda (H0: (subst0 i v (TSort n) +x)).(\lambda (k: K).(\lambda (v0: T).(\lambda (t0: T).(\lambda (t3: +T).(\lambda (i0: nat).(\lambda (u: T).(\lambda (H1: (eq nat i0 i)).(\lambda +(H2: (eq T v0 v)).(\lambda (H3: (eq T (THead k u t3) (TSort n))).(\lambda +(H4: (eq T (THead k u t0) x)).(\lambda (H5: (subst0 (s k i0) v0 t3 t0)).(let +H6 \def (eq_ind nat i0 (\lambda (n0: nat).(subst0 (s k n0) v0 t3 t0)) H5 i +H1) in (let H7 \def (eq_ind T v0 (\lambda (t: T).(subst0 (s k i) t t3 t0)) H6 +v H2) in (let H8 \def (eq_ind_r T x (\lambda (t: T).(subst0 i v (TSort n) t)) +H0 (THead k u t0) H4) in (let H9 \def (eq_ind_r T x (\lambda (t: T).(subst0 i +v (TSort n) t)) H (THead k u t0) H4) in (let H10 \def (eq_ind T (THead k u +t3) (\lambda (ee: T).(match ee in T return (\lambda (_: T).Prop) with [(TSort +_) \Rightarrow False | (TLRef _) \Rightarrow False | (THead _ _ _) +\Rightarrow True])) I (TSort n) H3) in (False_ind P H10)))))))))))))))))) +(\lambda (H0: (subst0 i v (TSort n) x)).(\lambda (v0: T).(\lambda (u1: +T).(\lambda (u2: T).(\lambda (i0: nat).(\lambda (k: K).(\lambda (t0: +T).(\lambda (t3: T).(\lambda (H2: (eq nat i0 i)).(\lambda (H3: (eq T v0 +v)).(\lambda (H4: (eq T (THead k u1 t0) (TSort n))).(\lambda (H5: (eq T +(THead k u2 t3) x)).(\lambda (H1: (subst0 i0 v0 u1 u2)).(\lambda (H6: (subst0 +(s k i0) v0 t0 t3)).(let H7 \def (eq_ind nat i0 (\lambda (n0: nat).(subst0 (s +k n0) v0 t0 t3)) H6 i H2) in (let H8 \def (eq_ind nat i0 (\lambda (n0: +nat).(subst0 n0 v0 u1 u2)) H1 i H2) in (let H9 \def (eq_ind T v0 (\lambda (t: +T).(subst0 (s k i) t t0 t3)) H7 v H3) in (let H10 \def (eq_ind T v0 (\lambda +(t: T).(subst0 i t u1 u2)) H8 v H3) in (let H11 \def (eq_ind_r T x (\lambda +(t: T).(subst0 i v (TSort n) t)) H0 (THead k u2 t3) H5) in (let H12 \def +(eq_ind_r T x (\lambda (t: T).(subst0 i v (TSort n) t)) H (THead k u2 t3) H5) +in (let H13 \def (eq_ind T (THead k u1 t0) (\lambda (ee: T).(match ee in T +return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) +\Rightarrow False | (THead _ _ _) \Rightarrow True])) I (TSort n) H4) in +(False_ind P H13)))))))))))))))))))))) H)))))). -axiom subst0_gen_lref: +theorem subst0_gen_lref: \forall (v: T).(\forall (x: T).(\forall (i: nat).(\forall (n: nat).((subst0 i v (TLRef n) x) \to (land (eq nat n i) (eq T x (lift (S n) O v))))))) -. +\def + \lambda (v: T).(\lambda (x: T).(\lambda (i: nat).(\lambda (n: nat).(\lambda +(H: (subst0 i v (TLRef n) x)).(subst0_inv_coq i v (TLRef n) x (\lambda (n0: +nat).(\lambda (t: T).(\lambda (_: T).(\lambda (t1: T).(land (eq nat n n0) (eq +T t1 (lift (S n) O t))))))) (\lambda (H0: (subst0 i v (TLRef n) x)).(\lambda +(v0: T).(\lambda (i0: nat).(\lambda (H1: (eq nat i0 i)).(\lambda (H2: (eq T +v0 v)).(\lambda (H3: (eq T (TLRef i0) (TLRef n))).(\lambda (H4: (eq T (lift +(S i0) O v0) x)).(let H5 \def (eq_ind nat i0 (\lambda (n0: nat).(eq T (lift +(S n0) O v0) x)) H4 i H1) in (let H6 \def (eq_ind nat i0 (\lambda (n0: +nat).(eq T (TLRef n0) (TLRef n))) H3 i H1) in (let H7 \def (eq_ind T v0 +(\lambda (t: T).(eq T (lift (S i) O t) x)) H5 v H2) in (let H8 \def (eq_ind_r +T x (\lambda (t: T).(subst0 i v (TLRef n) t)) H0 (lift (S i) O v) H7) in (let +H9 \def (eq_ind_r T x (\lambda (t: T).(subst0 i v (TLRef n) t)) H (lift (S i) +O v) H7) in (eq_ind T (lift (S i) O v) (\lambda (t: T).(land (eq nat n i) (eq +T t (lift (S n) O v)))) (let H10 \def (f_equal T nat (\lambda (e: T).(match e +in T return (\lambda (_: T).nat) with [(TSort _) \Rightarrow i | (TLRef n0) +\Rightarrow n0 | (THead _ _ _) \Rightarrow i])) (TLRef i) (TLRef n) H6) in +(let H11 \def (eq_ind_r nat n (\lambda (n0: nat).(subst0 i v (TLRef n0) (lift +(S i) O v))) H8 i H10) in (let H12 \def (eq_ind_r nat n (\lambda (n0: +nat).(subst0 i v (TLRef n0) (lift (S i) O v))) H9 i H10) in (eq_ind nat i +(\lambda (n0: nat).(land (eq nat n0 i) (eq T (lift (S i) O v) (lift (S n0) O +v)))) (conj (eq nat i i) (eq T (lift (S i) O v) (lift (S i) O v)) (refl_equal +nat i) (refl_equal T (lift (S i) O v))) n H10)))) x H7))))))))))))) (\lambda +(H0: (subst0 i v (TLRef n) x)).(\lambda (v0: T).(\lambda (u2: T).(\lambda +(u1: T).(\lambda (i0: nat).(\lambda (t: T).(\lambda (k: K).(\lambda (H1: (eq +nat i0 i)).(\lambda (H2: (eq T v0 v)).(\lambda (H3: (eq T (THead k u1 t) +(TLRef n))).(\lambda (H4: (eq T (THead k u2 t) x)).(\lambda (H5: (subst0 i0 +v0 u1 u2)).(let H6 \def (eq_ind nat i0 (\lambda (n0: nat).(subst0 n0 v0 u1 +u2)) H5 i H1) in (let H7 \def (eq_ind T v0 (\lambda (t0: T).(subst0 i t0 u1 +u2)) H6 v H2) in (let H8 \def (eq_ind_r T x (\lambda (t0: T).(subst0 i v +(TLRef n) t0)) H0 (THead k u2 t) H4) in (let H9 \def (eq_ind_r T x (\lambda +(t0: T).(subst0 i v (TLRef n) t0)) H (THead k u2 t) H4) in (eq_ind T (THead k +u2 t) (\lambda (t0: T).(land (eq nat n i) (eq T t0 (lift (S n) O v)))) (let +H10 \def (eq_ind T (THead k u1 t) (\lambda (ee: T).(match ee in T return +(\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) +\Rightarrow False | (THead _ _ _) \Rightarrow True])) I (TLRef n) H3) in +(False_ind (land (eq nat n i) (eq T (THead k u2 t) (lift (S n) O v))) H10)) x +H4))))))))))))))))) (\lambda (H0: (subst0 i v (TLRef n) x)).(\lambda (k: +K).(\lambda (v0: T).(\lambda (t0: T).(\lambda (t3: T).(\lambda (i0: +nat).(\lambda (u: T).(\lambda (H1: (eq nat i0 i)).(\lambda (H2: (eq T v0 +v)).(\lambda (H3: (eq T (THead k u t3) (TLRef n))).(\lambda (H4: (eq T (THead +k u t0) x)).(\lambda (H5: (subst0 (s k i0) v0 t3 t0)).(let H6 \def (eq_ind +nat i0 (\lambda (n0: nat).(subst0 (s k n0) v0 t3 t0)) H5 i H1) in (let H7 +\def (eq_ind T v0 (\lambda (t: T).(subst0 (s k i) t t3 t0)) H6 v H2) in (let +H8 \def (eq_ind_r T x (\lambda (t: T).(subst0 i v (TLRef n) t)) H0 (THead k u +t0) H4) in (let H9 \def (eq_ind_r T x (\lambda (t: T).(subst0 i v (TLRef n) +t)) H (THead k u t0) H4) in (eq_ind T (THead k u t0) (\lambda (t: T).(land +(eq nat n i) (eq T t (lift (S n) O v)))) (let H10 \def (eq_ind T (THead k u +t3) (\lambda (ee: T).(match ee in T return (\lambda (_: T).Prop) with [(TSort +_) \Rightarrow False | (TLRef _) \Rightarrow False | (THead _ _ _) +\Rightarrow True])) I (TLRef n) H3) in (False_ind (land (eq nat n i) (eq T +(THead k u t0) (lift (S n) O v))) H10)) x H4))))))))))))))))) (\lambda (H0: +(subst0 i v (TLRef n) x)).(\lambda (v0: T).(\lambda (u1: T).(\lambda (u2: +T).(\lambda (i0: nat).(\lambda (k: K).(\lambda (t0: T).(\lambda (t3: +T).(\lambda (H2: (eq nat i0 i)).(\lambda (H3: (eq T v0 v)).(\lambda (H4: (eq +T (THead k u1 t0) (TLRef n))).(\lambda (H5: (eq T (THead k u2 t3) +x)).(\lambda (H1: (subst0 i0 v0 u1 u2)).(\lambda (H6: (subst0 (s k i0) v0 t0 +t3)).(let H7 \def (eq_ind nat i0 (\lambda (n0: nat).(subst0 (s k n0) v0 t0 +t3)) H6 i H2) in (let H8 \def (eq_ind nat i0 (\lambda (n0: nat).(subst0 n0 v0 +u1 u2)) H1 i H2) in (let H9 \def (eq_ind T v0 (\lambda (t: T).(subst0 (s k i) +t t0 t3)) H7 v H3) in (let H10 \def (eq_ind T v0 (\lambda (t: T).(subst0 i t +u1 u2)) H8 v H3) in (let H11 \def (eq_ind_r T x (\lambda (t: T).(subst0 i v +(TLRef n) t)) H0 (THead k u2 t3) H5) in (let H12 \def (eq_ind_r T x (\lambda +(t: T).(subst0 i v (TLRef n) t)) H (THead k u2 t3) H5) in (eq_ind T (THead k +u2 t3) (\lambda (t: T).(land (eq nat n i) (eq T t (lift (S n) O v)))) (let +H13 \def (eq_ind T (THead k u1 t0) (\lambda (ee: T).(match ee in T return +(\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) +\Rightarrow False | (THead _ _ _) \Rightarrow True])) I (TLRef n) H4) in +(False_ind (land (eq nat n i) (eq T (THead k u2 t3) (lift (S n) O v))) H13)) +x H5))))))))))))))))))))) H))))). -axiom subst0_gen_head: +theorem subst0_gen_head: \forall (k: K).(\forall (v: T).(\forall (u1: T).(\forall (t1: T).(\forall (x: T).(\forall (i: nat).((subst0 i v (THead k u1 t1) x) \to (or3 (ex2 T (\lambda (u2: T).(eq T x (THead k u2 t1))) (\lambda (u2: T).(subst0 i v u1 @@ -38,25 +217,601 @@ u2))) (ex2 T (\lambda (t2: T).(eq T x (THead k u1 t2))) (\lambda (t2: T).(subst0 (s k i) v t1 t2))) (ex3_2 T T (\lambda (u2: T).(\lambda (t2: T).(eq T x (THead k u2 t2)))) (\lambda (u2: T).(\lambda (_: T).(subst0 i v u1 u2))) (\lambda (_: T).(\lambda (t2: T).(subst0 (s k i) v t1 t2))))))))))) -. +\def + \lambda (k: K).(\lambda (v: T).(\lambda (u1: T).(\lambda (t1: T).(\lambda +(x: T).(\lambda (i: nat).(\lambda (H: (subst0 i v (THead k u1 t1) +x)).(subst0_inv_coq i v (THead k u1 t1) x (\lambda (n: nat).(\lambda (t: +T).(\lambda (_: T).(\lambda (t2: T).(or3 (ex2 T (\lambda (u2: T).(eq T t2 +(THead k u2 t1))) (\lambda (u2: T).(subst0 n t u1 u2))) (ex2 T (\lambda (t3: +T).(eq T t2 (THead k u1 t3))) (\lambda (t3: T).(subst0 (s k n) t t1 t3))) +(ex3_2 T T (\lambda (u2: T).(\lambda (t3: T).(eq T t2 (THead k u2 t3)))) +(\lambda (u2: T).(\lambda (_: T).(subst0 n t u1 u2))) (\lambda (_: +T).(\lambda (t3: T).(subst0 (s k n) t t1 t3))))))))) (\lambda (H0: (subst0 i +v (THead k u1 t1) x)).(\lambda (v0: T).(\lambda (i0: nat).(\lambda (H1: (eq +nat i0 i)).(\lambda (H2: (eq T v0 v)).(\lambda (H3: (eq T (TLRef i0) (THead k +u1 t1))).(\lambda (H4: (eq T (lift (S i0) O v0) x)).(let H5 \def (eq_ind nat +i0 (\lambda (n: nat).(eq T (lift (S n) O v0) x)) H4 i H1) in (let H6 \def +(eq_ind nat i0 (\lambda (n: nat).(eq T (TLRef n) (THead k u1 t1))) H3 i H1) +in (let H7 \def (eq_ind T v0 (\lambda (t: T).(eq T (lift (S i) O t) x)) H5 v +H2) in (let H8 \def (eq_ind_r T x (\lambda (t: T).(subst0 i v (THead k u1 t1) +t)) H0 (lift (S i) O v) H7) in (let H9 \def (eq_ind_r T x (\lambda (t: +T).(subst0 i v (THead k u1 t1) t)) H (lift (S i) O v) H7) in (eq_ind T (lift +(S i) O v) (\lambda (t: T).(or3 (ex2 T (\lambda (u2: T).(eq T t (THead k u2 +t1))) (\lambda (u2: T).(subst0 i v u1 u2))) (ex2 T (\lambda (t2: T).(eq T t +(THead k u1 t2))) (\lambda (t2: T).(subst0 (s k i) v t1 t2))) (ex3_2 T T +(\lambda (u2: T).(\lambda (t2: T).(eq T t (THead k u2 t2)))) (\lambda (u2: +T).(\lambda (_: T).(subst0 i v u1 u2))) (\lambda (_: T).(\lambda (t2: +T).(subst0 (s k i) v t1 t2)))))) (let H10 \def (eq_ind T (TLRef i) (\lambda +(ee: T).(match ee in T return (\lambda (_: T).Prop) with [(TSort _) +\Rightarrow False | (TLRef _) \Rightarrow True | (THead _ _ _) \Rightarrow +False])) I (THead k u1 t1) H6) in (False_ind (or3 (ex2 T (\lambda (u2: T).(eq +T (lift (S i) O v) (THead k u2 t1))) (\lambda (u2: T).(subst0 i v u1 u2))) +(ex2 T (\lambda (t2: T).(eq T (lift (S i) O v) (THead k u1 t2))) (\lambda +(t2: T).(subst0 (s k i) v t1 t2))) (ex3_2 T T (\lambda (u2: T).(\lambda (t2: +T).(eq T (lift (S i) O v) (THead k u2 t2)))) (\lambda (u2: T).(\lambda (_: +T).(subst0 i v u1 u2))) (\lambda (_: T).(\lambda (t2: T).(subst0 (s k i) v t1 +t2))))) H10)) x H7))))))))))))) (\lambda (H0: (subst0 i v (THead k u1 t1) +x)).(\lambda (v0: T).(\lambda (u2: T).(\lambda (u0: T).(\lambda (i0: +nat).(\lambda (t: T).(\lambda (k0: K).(\lambda (H1: (eq nat i0 i)).(\lambda +(H2: (eq T v0 v)).(\lambda (H3: (eq T (THead k0 u0 t) (THead k u1 +t1))).(\lambda (H4: (eq T (THead k0 u2 t) x)).(\lambda (H5: (subst0 i0 v0 u0 +u2)).(let H6 \def (eq_ind nat i0 (\lambda (n: nat).(subst0 n v0 u0 u2)) H5 i +H1) in (let H7 \def (eq_ind T v0 (\lambda (t0: T).(subst0 i t0 u0 u2)) H6 v +H2) in (let H8 \def (eq_ind_r T x (\lambda (t0: T).(subst0 i v (THead k u1 +t1) t0)) H0 (THead k0 u2 t) H4) in (let H9 \def (eq_ind_r T x (\lambda (t0: +T).(subst0 i v (THead k u1 t1) t0)) H (THead k0 u2 t) H4) in (eq_ind T (THead +k0 u2 t) (\lambda (t0: T).(or3 (ex2 T (\lambda (u3: T).(eq T t0 (THead k u3 +t1))) (\lambda (u3: T).(subst0 i v u1 u3))) (ex2 T (\lambda (t2: T).(eq T t0 +(THead k u1 t2))) (\lambda (t2: T).(subst0 (s k i) v t1 t2))) (ex3_2 T T +(\lambda (u3: T).(\lambda (t2: T).(eq T t0 (THead k u3 t2)))) (\lambda (u3: +T).(\lambda (_: T).(subst0 i v u1 u3))) (\lambda (_: T).(\lambda (t2: +T).(subst0 (s k i) v t1 t2)))))) (let H10 \def (f_equal T K (\lambda (e: +T).(match e in T return (\lambda (_: T).K) with [(TSort _) \Rightarrow k0 | +(TLRef _) \Rightarrow k0 | (THead k1 _ _) \Rightarrow k1])) (THead k0 u0 t) +(THead k u1 t1) H3) in ((let H11 \def (f_equal T T (\lambda (e: T).(match e +in T return (\lambda (_: T).T) with [(TSort _) \Rightarrow u0 | (TLRef _) +\Rightarrow u0 | (THead _ t0 _) \Rightarrow t0])) (THead k0 u0 t) (THead k u1 +t1) H3) in ((let H12 \def (f_equal T T (\lambda (e: T).(match e in T return +(\lambda (_: T).T) with [(TSort _) \Rightarrow t | (TLRef _) \Rightarrow t | +(THead _ _ t0) \Rightarrow t0])) (THead k0 u0 t) (THead k u1 t1) H3) in +(\lambda (H13: (eq T u0 u1)).(\lambda (H14: (eq K k0 k)).(let H15 \def +(eq_ind K k0 (\lambda (k1: K).(subst0 i v (THead k u1 t1) (THead k1 u2 t))) +H9 k H14) in (let H16 \def (eq_ind K k0 (\lambda (k1: K).(subst0 i v (THead k +u1 t1) (THead k1 u2 t))) H8 k H14) in (eq_ind_r K k (\lambda (k1: K).(or3 +(ex2 T (\lambda (u3: T).(eq T (THead k1 u2 t) (THead k u3 t1))) (\lambda (u3: +T).(subst0 i v u1 u3))) (ex2 T (\lambda (t2: T).(eq T (THead k1 u2 t) (THead +k u1 t2))) (\lambda (t2: T).(subst0 (s k i) v t1 t2))) (ex3_2 T T (\lambda +(u3: T).(\lambda (t2: T).(eq T (THead k1 u2 t) (THead k u3 t2)))) (\lambda +(u3: T).(\lambda (_: T).(subst0 i v u1 u3))) (\lambda (_: T).(\lambda (t2: +T).(subst0 (s k i) v t1 t2)))))) (let H17 \def (eq_ind T t (\lambda (t0: +T).(subst0 i v (THead k u1 t1) (THead k u2 t0))) H15 t1 H12) in (let H18 \def +(eq_ind T t (\lambda (t0: T).(subst0 i v (THead k u1 t1) (THead k u2 t0))) +H16 t1 H12) in (eq_ind_r T t1 (\lambda (t0: T).(or3 (ex2 T (\lambda (u3: +T).(eq T (THead k u2 t0) (THead k u3 t1))) (\lambda (u3: T).(subst0 i v u1 +u3))) (ex2 T (\lambda (t2: T).(eq T (THead k u2 t0) (THead k u1 t2))) +(\lambda (t2: T).(subst0 (s k i) v t1 t2))) (ex3_2 T T (\lambda (u3: +T).(\lambda (t2: T).(eq T (THead k u2 t0) (THead k u3 t2)))) (\lambda (u3: +T).(\lambda (_: T).(subst0 i v u1 u3))) (\lambda (_: T).(\lambda (t2: +T).(subst0 (s k i) v t1 t2)))))) (let H19 \def (eq_ind T u0 (\lambda (t0: +T).(subst0 i v t0 u2)) H7 u1 H13) in (or3_intro0 (ex2 T (\lambda (u3: T).(eq +T (THead k u2 t1) (THead k u3 t1))) (\lambda (u3: T).(subst0 i v u1 u3))) +(ex2 T (\lambda (t2: T).(eq T (THead k u2 t1) (THead k u1 t2))) (\lambda (t2: +T).(subst0 (s k i) v t1 t2))) (ex3_2 T T (\lambda (u3: T).(\lambda (t2: +T).(eq T (THead k u2 t1) (THead k u3 t2)))) (\lambda (u3: T).(\lambda (_: +T).(subst0 i v u1 u3))) (\lambda (_: T).(\lambda (t2: T).(subst0 (s k i) v t1 +t2)))) (ex_intro2 T (\lambda (u3: T).(eq T (THead k u2 t1) (THead k u3 t1))) +(\lambda (u3: T).(subst0 i v u1 u3)) u2 (refl_equal T (THead k u2 t1)) H19))) +t H12))) k0 H14)))))) H11)) H10)) x H4))))))))))))))))) (\lambda (H0: (subst0 +i v (THead k u1 t1) x)).(\lambda (k0: K).(\lambda (v0: T).(\lambda (t0: +T).(\lambda (t3: T).(\lambda (i0: nat).(\lambda (u: T).(\lambda (H1: (eq nat +i0 i)).(\lambda (H2: (eq T v0 v)).(\lambda (H3: (eq T (THead k0 u t3) (THead +k u1 t1))).(\lambda (H4: (eq T (THead k0 u t0) x)).(\lambda (H5: (subst0 (s +k0 i0) v0 t3 t0)).(let H6 \def (eq_ind nat i0 (\lambda (n: nat).(subst0 (s k0 +n) v0 t3 t0)) H5 i H1) in (let H7 \def (eq_ind T v0 (\lambda (t: T).(subst0 +(s k0 i) t t3 t0)) H6 v H2) in (let H8 \def (eq_ind_r T x (\lambda (t: +T).(subst0 i v (THead k u1 t1) t)) H0 (THead k0 u t0) H4) in (let H9 \def +(eq_ind_r T x (\lambda (t: T).(subst0 i v (THead k u1 t1) t)) H (THead k0 u +t0) H4) in (eq_ind T (THead k0 u t0) (\lambda (t: T).(or3 (ex2 T (\lambda +(u2: T).(eq T t (THead k u2 t1))) (\lambda (u2: T).(subst0 i v u1 u2))) (ex2 +T (\lambda (t2: T).(eq T t (THead k u1 t2))) (\lambda (t2: T).(subst0 (s k i) +v t1 t2))) (ex3_2 T T (\lambda (u2: T).(\lambda (t2: T).(eq T t (THead k u2 +t2)))) (\lambda (u2: T).(\lambda (_: T).(subst0 i v u1 u2))) (\lambda (_: +T).(\lambda (t2: T).(subst0 (s k i) v t1 t2)))))) (let H10 \def (f_equal T K +(\lambda (e: T).(match e in T return (\lambda (_: T).K) with [(TSort _) +\Rightarrow k0 | (TLRef _) \Rightarrow k0 | (THead k1 _ _) \Rightarrow k1])) +(THead k0 u t3) (THead k u1 t1) H3) in ((let H11 \def (f_equal T T (\lambda +(e: T).(match e in T return (\lambda (_: T).T) with [(TSort _) \Rightarrow u +| (TLRef _) \Rightarrow u | (THead _ t _) \Rightarrow t])) (THead k0 u t3) +(THead k u1 t1) H3) in ((let H12 \def (f_equal T T (\lambda (e: T).(match e +in T return (\lambda (_: T).T) with [(TSort _) \Rightarrow t3 | (TLRef _) +\Rightarrow t3 | (THead _ _ t) \Rightarrow t])) (THead k0 u t3) (THead k u1 +t1) H3) in (\lambda (H13: (eq T u u1)).(\lambda (H14: (eq K k0 k)).(let H15 +\def (eq_ind T u (\lambda (t: T).(subst0 i v (THead k u1 t1) (THead k0 t +t0))) H9 u1 H13) in (let H16 \def (eq_ind T u (\lambda (t: T).(subst0 i v +(THead k u1 t1) (THead k0 t t0))) H8 u1 H13) in (eq_ind_r T u1 (\lambda (t: +T).(or3 (ex2 T (\lambda (u2: T).(eq T (THead k0 t t0) (THead k u2 t1))) +(\lambda (u2: T).(subst0 i v u1 u2))) (ex2 T (\lambda (t2: T).(eq T (THead k0 +t t0) (THead k u1 t2))) (\lambda (t2: T).(subst0 (s k i) v t1 t2))) (ex3_2 T +T (\lambda (u2: T).(\lambda (t2: T).(eq T (THead k0 t t0) (THead k u2 t2)))) +(\lambda (u2: T).(\lambda (_: T).(subst0 i v u1 u2))) (\lambda (_: +T).(\lambda (t2: T).(subst0 (s k i) v t1 t2)))))) (let H17 \def (eq_ind T t3 +(\lambda (t: T).(subst0 (s k0 i) v t t0)) H7 t1 H12) in (let H18 \def (eq_ind +K k0 (\lambda (k1: K).(subst0 i v (THead k u1 t1) (THead k1 u1 t0))) H15 k +H14) in (let H19 \def (eq_ind K k0 (\lambda (k1: K).(subst0 i v (THead k u1 +t1) (THead k1 u1 t0))) H16 k H14) in (let H20 \def (eq_ind K k0 (\lambda (k1: +K).(subst0 (s k1 i) v t1 t0)) H17 k H14) in (eq_ind_r K k (\lambda (k1: +K).(or3 (ex2 T (\lambda (u2: T).(eq T (THead k1 u1 t0) (THead k u2 t1))) +(\lambda (u2: T).(subst0 i v u1 u2))) (ex2 T (\lambda (t2: T).(eq T (THead k1 +u1 t0) (THead k u1 t2))) (\lambda (t2: T).(subst0 (s k i) v t1 t2))) (ex3_2 T +T (\lambda (u2: T).(\lambda (t2: T).(eq T (THead k1 u1 t0) (THead k u2 t2)))) +(\lambda (u2: T).(\lambda (_: T).(subst0 i v u1 u2))) (\lambda (_: +T).(\lambda (t2: T).(subst0 (s k i) v t1 t2)))))) (or3_intro1 (ex2 T (\lambda +(u2: T).(eq T (THead k u1 t0) (THead k u2 t1))) (\lambda (u2: T).(subst0 i v +u1 u2))) (ex2 T (\lambda (t2: T).(eq T (THead k u1 t0) (THead k u1 t2))) +(\lambda (t2: T).(subst0 (s k i) v t1 t2))) (ex3_2 T T (\lambda (u2: +T).(\lambda (t2: T).(eq T (THead k u1 t0) (THead k u2 t2)))) (\lambda (u2: +T).(\lambda (_: T).(subst0 i v u1 u2))) (\lambda (_: T).(\lambda (t2: +T).(subst0 (s k i) v t1 t2)))) (ex_intro2 T (\lambda (t2: T).(eq T (THead k +u1 t0) (THead k u1 t2))) (\lambda (t2: T).(subst0 (s k i) v t1 t2)) t0 +(refl_equal T (THead k u1 t0)) H20)) k0 H14))))) u H13)))))) H11)) H10)) x +H4))))))))))))))))) (\lambda (H0: (subst0 i v (THead k u1 t1) x)).(\lambda +(v0: T).(\lambda (u0: T).(\lambda (u2: T).(\lambda (i0: nat).(\lambda (k0: +K).(\lambda (t0: T).(\lambda (t3: T).(\lambda (H2: (eq nat i0 i)).(\lambda +(H3: (eq T v0 v)).(\lambda (H4: (eq T (THead k0 u0 t0) (THead k u1 +t1))).(\lambda (H5: (eq T (THead k0 u2 t3) x)).(\lambda (H1: (subst0 i0 v0 u0 +u2)).(\lambda (H6: (subst0 (s k0 i0) v0 t0 t3)).(let H7 \def (eq_ind nat i0 +(\lambda (n: nat).(subst0 (s k0 n) v0 t0 t3)) H6 i H2) in (let H8 \def +(eq_ind nat i0 (\lambda (n: nat).(subst0 n v0 u0 u2)) H1 i H2) in (let H9 +\def (eq_ind T v0 (\lambda (t: T).(subst0 (s k0 i) t t0 t3)) H7 v H3) in (let +H10 \def (eq_ind T v0 (\lambda (t: T).(subst0 i t u0 u2)) H8 v H3) in (let +H11 \def (eq_ind_r T x (\lambda (t: T).(subst0 i v (THead k u1 t1) t)) H0 +(THead k0 u2 t3) H5) in (let H12 \def (eq_ind_r T x (\lambda (t: T).(subst0 i +v (THead k u1 t1) t)) H (THead k0 u2 t3) H5) in (eq_ind T (THead k0 u2 t3) +(\lambda (t: T).(or3 (ex2 T (\lambda (u3: T).(eq T t (THead k u3 t1))) +(\lambda (u3: T).(subst0 i v u1 u3))) (ex2 T (\lambda (t2: T).(eq T t (THead +k u1 t2))) (\lambda (t2: T).(subst0 (s k i) v t1 t2))) (ex3_2 T T (\lambda +(u3: T).(\lambda (t2: T).(eq T t (THead k u3 t2)))) (\lambda (u3: T).(\lambda +(_: T).(subst0 i v u1 u3))) (\lambda (_: T).(\lambda (t2: T).(subst0 (s k i) +v t1 t2)))))) (let H13 \def (f_equal T K (\lambda (e: T).(match e in T return +(\lambda (_: T).K) with [(TSort _) \Rightarrow k0 | (TLRef _) \Rightarrow k0 +| (THead k1 _ _) \Rightarrow k1])) (THead k0 u0 t0) (THead k u1 t1) H4) in +((let H14 \def (f_equal T T (\lambda (e: T).(match e in T return (\lambda (_: +T).T) with [(TSort _) \Rightarrow u0 | (TLRef _) \Rightarrow u0 | (THead _ t +_) \Rightarrow t])) (THead k0 u0 t0) (THead k u1 t1) H4) in ((let H15 \def +(f_equal T T (\lambda (e: T).(match e in T return (\lambda (_: T).T) with +[(TSort _) \Rightarrow t0 | (TLRef _) \Rightarrow t0 | (THead _ _ t) +\Rightarrow t])) (THead k0 u0 t0) (THead k u1 t1) H4) in (\lambda (H16: (eq T +u0 u1)).(\lambda (H17: (eq K k0 k)).(let H18 \def (eq_ind T t0 (\lambda (t: +T).(subst0 (s k0 i) v t t3)) H9 t1 H15) in (let H19 \def (eq_ind K k0 +(\lambda (k1: K).(subst0 i v (THead k u1 t1) (THead k1 u2 t3))) H12 k H17) in +(let H20 \def (eq_ind K k0 (\lambda (k1: K).(subst0 i v (THead k u1 t1) +(THead k1 u2 t3))) H11 k H17) in (let H21 \def (eq_ind K k0 (\lambda (k1: +K).(subst0 (s k1 i) v t1 t3)) H18 k H17) in (eq_ind_r K k (\lambda (k1: +K).(or3 (ex2 T (\lambda (u3: T).(eq T (THead k1 u2 t3) (THead k u3 t1))) +(\lambda (u3: T).(subst0 i v u1 u3))) (ex2 T (\lambda (t2: T).(eq T (THead k1 +u2 t3) (THead k u1 t2))) (\lambda (t2: T).(subst0 (s k i) v t1 t2))) (ex3_2 T +T (\lambda (u3: T).(\lambda (t2: T).(eq T (THead k1 u2 t3) (THead k u3 t2)))) +(\lambda (u3: T).(\lambda (_: T).(subst0 i v u1 u3))) (\lambda (_: +T).(\lambda (t2: T).(subst0 (s k i) v t1 t2)))))) (let H22 \def (eq_ind T u0 +(\lambda (t: T).(subst0 i v t u2)) H10 u1 H16) in (or3_intro2 (ex2 T (\lambda +(u3: T).(eq T (THead k u2 t3) (THead k u3 t1))) (\lambda (u3: T).(subst0 i v +u1 u3))) (ex2 T (\lambda (t2: T).(eq T (THead k u2 t3) (THead k u1 t2))) +(\lambda (t2: T).(subst0 (s k i) v t1 t2))) (ex3_2 T T (\lambda (u3: +T).(\lambda (t2: T).(eq T (THead k u2 t3) (THead k u3 t2)))) (\lambda (u3: +T).(\lambda (_: T).(subst0 i v u1 u3))) (\lambda (_: T).(\lambda (t2: +T).(subst0 (s k i) v t1 t2)))) (ex3_2_intro T T (\lambda (u3: T).(\lambda +(t2: T).(eq T (THead k u2 t3) (THead k u3 t2)))) (\lambda (u3: T).(\lambda +(_: T).(subst0 i v u1 u3))) (\lambda (_: T).(\lambda (t2: T).(subst0 (s k i) +v t1 t2))) u2 t3 (refl_equal T (THead k u2 t3)) H22 H21))) k0 H17)))))))) +H14)) H13)) x H5))))))))))))))))))))) H))))))). -axiom subst0_gen_lift_lt: +theorem subst0_gen_lift_lt: \forall (u: T).(\forall (t1: T).(\forall (x: T).(\forall (i: nat).(\forall (h: nat).(\forall (d: nat).((subst0 i (lift h d u) (lift h (S (plus i d)) t1) x) \to (ex2 T (\lambda (t2: T).(eq T x (lift h (S (plus i d)) t2))) (\lambda (t2: T).(subst0 i u t1 t2))))))))) -. +\def + \lambda (u: T).(\lambda (t1: T).(T_ind (\lambda (t: T).(\forall (x: +T).(\forall (i: nat).(\forall (h: nat).(\forall (d: nat).((subst0 i (lift h d +u) (lift h (S (plus i d)) t) x) \to (ex2 T (\lambda (t2: T).(eq T x (lift h +(S (plus i d)) t2))) (\lambda (t2: T).(subst0 i u t t2))))))))) (\lambda (n: +nat).(\lambda (x: T).(\lambda (i: nat).(\lambda (h: nat).(\lambda (d: +nat).(\lambda (H: (subst0 i (lift h d u) (lift h (S (plus i d)) (TSort n)) +x)).(let H0 \def (eq_ind T (lift h (S (plus i d)) (TSort n)) (\lambda (t: +T).(subst0 i (lift h d u) t x)) H (TSort n) (lift_sort n h (S (plus i d)))) +in (subst0_gen_sort (lift h d u) x i n H0 (ex2 T (\lambda (t2: T).(eq T x +(lift h (S (plus i d)) t2))) (\lambda (t2: T).(subst0 i u (TSort n) +t2))))))))))) (\lambda (n: nat).(\lambda (x: T).(\lambda (i: nat).(\lambda +(h: nat).(\lambda (d: nat).(\lambda (H: (subst0 i (lift h d u) (lift h (S +(plus i d)) (TLRef n)) x)).(lt_le_e n (S (plus i d)) (ex2 T (\lambda (t2: +T).(eq T x (lift h (S (plus i d)) t2))) (\lambda (t2: T).(subst0 i u (TLRef +n) t2))) (\lambda (H0: (lt n (S (plus i d)))).(let H1 \def (eq_ind T (lift h +(S (plus i d)) (TLRef n)) (\lambda (t: T).(subst0 i (lift h d u) t x)) H +(TLRef n) (lift_lref_lt n h (S (plus i d)) H0)) in (and_ind (eq nat n i) (eq +T x (lift (S n) O (lift h d u))) (ex2 T (\lambda (t2: T).(eq T x (lift h (S +(plus i d)) t2))) (\lambda (t2: T).(subst0 i u (TLRef n) t2))) (\lambda (H2: +(eq nat n i)).(\lambda (H3: (eq T x (lift (S n) O (lift h d u)))).(eq_ind_r T +(lift (S n) O (lift h d u)) (\lambda (t: T).(ex2 T (\lambda (t2: T).(eq T t +(lift h (S (plus i d)) t2))) (\lambda (t2: T).(subst0 i u (TLRef n) t2)))) +(eq_ind_r nat i (\lambda (n0: nat).(ex2 T (\lambda (t2: T).(eq T (lift (S n0) +O (lift h d u)) (lift h (S (plus i d)) t2))) (\lambda (t2: T).(subst0 i u +(TLRef n0) t2)))) (eq_ind T (lift h (plus (S i) d) (lift (S i) O u)) (\lambda +(t: T).(ex2 T (\lambda (t2: T).(eq T t (lift h (S (plus i d)) t2))) (\lambda +(t2: T).(subst0 i u (TLRef i) t2)))) (ex_intro2 T (\lambda (t2: T).(eq T +(lift h (S (plus i d)) (lift (S i) O u)) (lift h (S (plus i d)) t2))) +(\lambda (t2: T).(subst0 i u (TLRef i) t2)) (lift (S i) O u) (refl_equal T +(lift h (S (plus i d)) (lift (S i) O u))) (subst0_lref u i)) (lift (S i) O +(lift h d u)) (lift_d u h (S i) d O (le_O_n d))) n H2) x H3))) +(subst0_gen_lref (lift h d u) x i n H1)))) (\lambda (H0: (le (S (plus i d)) +n)).(let H1 \def (eq_ind T (lift h (S (plus i d)) (TLRef n)) (\lambda (t: +T).(subst0 i (lift h d u) t x)) H (TLRef (plus n h)) (lift_lref_ge n h (S +(plus i d)) H0)) in (and_ind (eq nat (plus n h) i) (eq T x (lift (S (plus n +h)) O (lift h d u))) (ex2 T (\lambda (t2: T).(eq T x (lift h (S (plus i d)) +t2))) (\lambda (t2: T).(subst0 i u (TLRef n) t2))) (\lambda (H2: (eq nat +(plus n h) i)).(\lambda (_: (eq T x (lift (S (plus n h)) O (lift h d +u)))).(let H4 \def (eq_ind_r nat i (\lambda (n0: nat).(le (S (plus n0 d)) n)) +H0 (plus n h) H2) in (le_false n (plus (plus n h) d) (ex2 T (\lambda (t2: +T).(eq T x (lift h (S (plus i d)) t2))) (\lambda (t2: T).(subst0 i u (TLRef +n) t2))) (le_plus_trans n (plus n h) d (le_plus_l n h)) H4)))) +(subst0_gen_lref (lift h d u) x i (plus n h) H1))))))))))) (\lambda (k: +K).(\lambda (t: T).(\lambda (H: ((\forall (x: T).(\forall (i: nat).(\forall +(h: nat).(\forall (d: nat).((subst0 i (lift h d u) (lift h (S (plus i d)) t) +x) \to (ex2 T (\lambda (t2: T).(eq T x (lift h (S (plus i d)) t2))) (\lambda +(t2: T).(subst0 i u t t2)))))))))).(\lambda (t0: T).(\lambda (H0: ((\forall +(x: T).(\forall (i: nat).(\forall (h: nat).(\forall (d: nat).((subst0 i (lift +h d u) (lift h (S (plus i d)) t0) x) \to (ex2 T (\lambda (t2: T).(eq T x +(lift h (S (plus i d)) t2))) (\lambda (t2: T).(subst0 i u t0 +t2)))))))))).(\lambda (x: T).(\lambda (i: nat).(\lambda (h: nat).(\lambda (d: +nat).(\lambda (H1: (subst0 i (lift h d u) (lift h (S (plus i d)) (THead k t +t0)) x)).(let H2 \def (eq_ind T (lift h (S (plus i d)) (THead k t t0)) +(\lambda (t2: T).(subst0 i (lift h d u) t2 x)) H1 (THead k (lift h (S (plus i +d)) t) (lift h (s k (S (plus i d))) t0)) (lift_head k t t0 h (S (plus i d)))) +in (or3_ind (ex2 T (\lambda (u2: T).(eq T x (THead k u2 (lift h (s k (S (plus +i d))) t0)))) (\lambda (u2: T).(subst0 i (lift h d u) (lift h (S (plus i d)) +t) u2))) (ex2 T (\lambda (t2: T).(eq T x (THead k (lift h (S (plus i d)) t) +t2))) (\lambda (t2: T).(subst0 (s k i) (lift h d u) (lift h (s k (S (plus i +d))) t0) t2))) (ex3_2 T T (\lambda (u2: T).(\lambda (t2: T).(eq T x (THead k +u2 t2)))) (\lambda (u2: T).(\lambda (_: T).(subst0 i (lift h d u) (lift h (S +(plus i d)) t) u2))) (\lambda (_: T).(\lambda (t2: T).(subst0 (s k i) (lift h +d u) (lift h (s k (S (plus i d))) t0) t2)))) (ex2 T (\lambda (t2: T).(eq T x +(lift h (S (plus i d)) t2))) (\lambda (t2: T).(subst0 i u (THead k t t0) +t2))) (\lambda (H3: (ex2 T (\lambda (u2: T).(eq T x (THead k u2 (lift h (s k +(S (plus i d))) t0)))) (\lambda (u2: T).(subst0 i (lift h d u) (lift h (S +(plus i d)) t) u2)))).(ex2_ind T (\lambda (u2: T).(eq T x (THead k u2 (lift h +(s k (S (plus i d))) t0)))) (\lambda (u2: T).(subst0 i (lift h d u) (lift h +(S (plus i d)) t) u2)) (ex2 T (\lambda (t2: T).(eq T x (lift h (S (plus i d)) +t2))) (\lambda (t2: T).(subst0 i u (THead k t t0) t2))) (\lambda (x0: +T).(\lambda (H4: (eq T x (THead k x0 (lift h (s k (S (plus i d))) +t0)))).(\lambda (H5: (subst0 i (lift h d u) (lift h (S (plus i d)) t) +x0)).(eq_ind_r T (THead k x0 (lift h (s k (S (plus i d))) t0)) (\lambda (t2: +T).(ex2 T (\lambda (t3: T).(eq T t2 (lift h (S (plus i d)) t3))) (\lambda +(t3: T).(subst0 i u (THead k t t0) t3)))) (ex2_ind T (\lambda (t2: T).(eq T +x0 (lift h (S (plus i d)) t2))) (\lambda (t2: T).(subst0 i u t t2)) (ex2 T +(\lambda (t2: T).(eq T (THead k x0 (lift h (s k (S (plus i d))) t0)) (lift h +(S (plus i d)) t2))) (\lambda (t2: T).(subst0 i u (THead k t t0) t2))) +(\lambda (x1: T).(\lambda (H6: (eq T x0 (lift h (S (plus i d)) x1))).(\lambda +(H7: (subst0 i u t x1)).(eq_ind_r T (lift h (S (plus i d)) x1) (\lambda (t2: +T).(ex2 T (\lambda (t3: T).(eq T (THead k t2 (lift h (s k (S (plus i d))) +t0)) (lift h (S (plus i d)) t3))) (\lambda (t3: T).(subst0 i u (THead k t t0) +t3)))) (eq_ind T (lift h (S (plus i d)) (THead k x1 t0)) (\lambda (t2: +T).(ex2 T (\lambda (t3: T).(eq T t2 (lift h (S (plus i d)) t3))) (\lambda +(t3: T).(subst0 i u (THead k t t0) t3)))) (ex_intro2 T (\lambda (t2: T).(eq T +(lift h (S (plus i d)) (THead k x1 t0)) (lift h (S (plus i d)) t2))) (\lambda +(t2: T).(subst0 i u (THead k t t0) t2)) (THead k x1 t0) (refl_equal T (lift h +(S (plus i d)) (THead k x1 t0))) (subst0_fst u x1 t i H7 t0 k)) (THead k +(lift h (S (plus i d)) x1) (lift h (s k (S (plus i d))) t0)) (lift_head k x1 +t0 h (S (plus i d)))) x0 H6)))) (H x0 i h d H5)) x H4)))) H3)) (\lambda (H3: +(ex2 T (\lambda (t2: T).(eq T x (THead k (lift h (S (plus i d)) t) t2))) +(\lambda (t2: T).(subst0 (s k i) (lift h d u) (lift h (s k (S (plus i d))) +t0) t2)))).(ex2_ind T (\lambda (t2: T).(eq T x (THead k (lift h (S (plus i +d)) t) t2))) (\lambda (t2: T).(subst0 (s k i) (lift h d u) (lift h (s k (S +(plus i d))) t0) t2)) (ex2 T (\lambda (t2: T).(eq T x (lift h (S (plus i d)) +t2))) (\lambda (t2: T).(subst0 i u (THead k t t0) t2))) (\lambda (x0: +T).(\lambda (H4: (eq T x (THead k (lift h (S (plus i d)) t) x0))).(\lambda +(H5: (subst0 (s k i) (lift h d u) (lift h (s k (S (plus i d))) t0) +x0)).(eq_ind_r T (THead k (lift h (S (plus i d)) t) x0) (\lambda (t2: T).(ex2 +T (\lambda (t3: T).(eq T t2 (lift h (S (plus i d)) t3))) (\lambda (t3: +T).(subst0 i u (THead k t t0) t3)))) (let H6 \def (eq_ind nat (s k (S (plus i +d))) (\lambda (n: nat).(subst0 (s k i) (lift h d u) (lift h n t0) x0)) H5 (S +(s k (plus i d))) (s_S k (plus i d))) in (let H7 \def (eq_ind nat (s k (plus +i d)) (\lambda (n: nat).(subst0 (s k i) (lift h d u) (lift h (S n) t0) x0)) +H6 (plus (s k i) d) (s_plus k i d)) in (ex2_ind T (\lambda (t2: T).(eq T x0 +(lift h (S (plus (s k i) d)) t2))) (\lambda (t2: T).(subst0 (s k i) u t0 t2)) +(ex2 T (\lambda (t2: T).(eq T (THead k (lift h (S (plus i d)) t) x0) (lift h +(S (plus i d)) t2))) (\lambda (t2: T).(subst0 i u (THead k t t0) t2))) +(\lambda (x1: T).(\lambda (H8: (eq T x0 (lift h (S (plus (s k i) d)) +x1))).(\lambda (H9: (subst0 (s k i) u t0 x1)).(eq_ind_r T (lift h (S (plus (s +k i) d)) x1) (\lambda (t2: T).(ex2 T (\lambda (t3: T).(eq T (THead k (lift h +(S (plus i d)) t) t2) (lift h (S (plus i d)) t3))) (\lambda (t3: T).(subst0 i +u (THead k t t0) t3)))) (eq_ind nat (s k (plus i d)) (\lambda (n: nat).(ex2 T +(\lambda (t2: T).(eq T (THead k (lift h (S (plus i d)) t) (lift h (S n) x1)) +(lift h (S (plus i d)) t2))) (\lambda (t2: T).(subst0 i u (THead k t t0) +t2)))) (eq_ind nat (s k (S (plus i d))) (\lambda (n: nat).(ex2 T (\lambda +(t2: T).(eq T (THead k (lift h (S (plus i d)) t) (lift h n x1)) (lift h (S +(plus i d)) t2))) (\lambda (t2: T).(subst0 i u (THead k t t0) t2)))) (eq_ind +T (lift h (S (plus i d)) (THead k t x1)) (\lambda (t2: T).(ex2 T (\lambda +(t3: T).(eq T t2 (lift h (S (plus i d)) t3))) (\lambda (t3: T).(subst0 i u +(THead k t t0) t3)))) (ex_intro2 T (\lambda (t2: T).(eq T (lift h (S (plus i +d)) (THead k t x1)) (lift h (S (plus i d)) t2))) (\lambda (t2: T).(subst0 i u +(THead k t t0) t2)) (THead k t x1) (refl_equal T (lift h (S (plus i d)) +(THead k t x1))) (subst0_snd k u x1 t0 i H9 t)) (THead k (lift h (S (plus i +d)) t) (lift h (s k (S (plus i d))) x1)) (lift_head k t x1 h (S (plus i d)))) +(S (s k (plus i d))) (s_S k (plus i d))) (plus (s k i) d) (s_plus k i d)) x0 +H8)))) (H0 x0 (s k i) h d H7)))) x H4)))) H3)) (\lambda (H3: (ex3_2 T T +(\lambda (u2: T).(\lambda (t2: T).(eq T x (THead k u2 t2)))) (\lambda (u2: +T).(\lambda (_: T).(subst0 i (lift h d u) (lift h (S (plus i d)) t) u2))) +(\lambda (_: T).(\lambda (t2: T).(subst0 (s k i) (lift h d u) (lift h (s k (S +(plus i d))) t0) t2))))).(ex3_2_ind T T (\lambda (u2: T).(\lambda (t2: T).(eq +T x (THead k u2 t2)))) (\lambda (u2: T).(\lambda (_: T).(subst0 i (lift h d +u) (lift h (S (plus i d)) t) u2))) (\lambda (_: T).(\lambda (t2: T).(subst0 +(s k i) (lift h d u) (lift h (s k (S (plus i d))) t0) t2))) (ex2 T (\lambda +(t2: T).(eq T x (lift h (S (plus i d)) t2))) (\lambda (t2: T).(subst0 i u +(THead k t t0) t2))) (\lambda (x0: T).(\lambda (x1: T).(\lambda (H4: (eq T x +(THead k x0 x1))).(\lambda (H5: (subst0 i (lift h d u) (lift h (S (plus i d)) +t) x0)).(\lambda (H6: (subst0 (s k i) (lift h d u) (lift h (s k (S (plus i +d))) t0) x1)).(eq_ind_r T (THead k x0 x1) (\lambda (t2: T).(ex2 T (\lambda +(t3: T).(eq T t2 (lift h (S (plus i d)) t3))) (\lambda (t3: T).(subst0 i u +(THead k t t0) t3)))) (let H7 \def (eq_ind nat (s k (S (plus i d))) (\lambda +(n: nat).(subst0 (s k i) (lift h d u) (lift h n t0) x1)) H6 (S (s k (plus i +d))) (s_S k (plus i d))) in (let H8 \def (eq_ind nat (s k (plus i d)) +(\lambda (n: nat).(subst0 (s k i) (lift h d u) (lift h (S n) t0) x1)) H7 +(plus (s k i) d) (s_plus k i d)) in (ex2_ind T (\lambda (t2: T).(eq T x1 +(lift h (S (plus (s k i) d)) t2))) (\lambda (t2: T).(subst0 (s k i) u t0 t2)) +(ex2 T (\lambda (t2: T).(eq T (THead k x0 x1) (lift h (S (plus i d)) t2))) +(\lambda (t2: T).(subst0 i u (THead k t t0) t2))) (\lambda (x2: T).(\lambda +(H9: (eq T x1 (lift h (S (plus (s k i) d)) x2))).(\lambda (H10: (subst0 (s k +i) u t0 x2)).(ex2_ind T (\lambda (t2: T).(eq T x0 (lift h (S (plus i d)) +t2))) (\lambda (t2: T).(subst0 i u t t2)) (ex2 T (\lambda (t2: T).(eq T +(THead k x0 x1) (lift h (S (plus i d)) t2))) (\lambda (t2: T).(subst0 i u +(THead k t t0) t2))) (\lambda (x3: T).(\lambda (H11: (eq T x0 (lift h (S +(plus i d)) x3))).(\lambda (H12: (subst0 i u t x3)).(eq_ind_r T (lift h (S +(plus i d)) x3) (\lambda (t2: T).(ex2 T (\lambda (t3: T).(eq T (THead k t2 +x1) (lift h (S (plus i d)) t3))) (\lambda (t3: T).(subst0 i u (THead k t t0) +t3)))) (eq_ind_r T (lift h (S (plus (s k i) d)) x2) (\lambda (t2: T).(ex2 T +(\lambda (t3: T).(eq T (THead k (lift h (S (plus i d)) x3) t2) (lift h (S +(plus i d)) t3))) (\lambda (t3: T).(subst0 i u (THead k t t0) t3)))) (eq_ind +nat (s k (plus i d)) (\lambda (n: nat).(ex2 T (\lambda (t2: T).(eq T (THead k +(lift h (S (plus i d)) x3) (lift h (S n) x2)) (lift h (S (plus i d)) t2))) +(\lambda (t2: T).(subst0 i u (THead k t t0) t2)))) (eq_ind nat (s k (S (plus +i d))) (\lambda (n: nat).(ex2 T (\lambda (t2: T).(eq T (THead k (lift h (S +(plus i d)) x3) (lift h n x2)) (lift h (S (plus i d)) t2))) (\lambda (t2: +T).(subst0 i u (THead k t t0) t2)))) (eq_ind T (lift h (S (plus i d)) (THead +k x3 x2)) (\lambda (t2: T).(ex2 T (\lambda (t3: T).(eq T t2 (lift h (S (plus +i d)) t3))) (\lambda (t3: T).(subst0 i u (THead k t t0) t3)))) (ex_intro2 T +(\lambda (t2: T).(eq T (lift h (S (plus i d)) (THead k x3 x2)) (lift h (S +(plus i d)) t2))) (\lambda (t2: T).(subst0 i u (THead k t t0) t2)) (THead k +x3 x2) (refl_equal T (lift h (S (plus i d)) (THead k x3 x2))) (subst0_both u +t x3 i H12 k t0 x2 H10)) (THead k (lift h (S (plus i d)) x3) (lift h (s k (S +(plus i d))) x2)) (lift_head k x3 x2 h (S (plus i d)))) (S (s k (plus i d))) +(s_S k (plus i d))) (plus (s k i) d) (s_plus k i d)) x1 H9) x0 H11)))) (H x0 +i h d H5))))) (H0 x1 (s k i) h d H8)))) x H4)))))) H3)) (subst0_gen_head k +(lift h d u) (lift h (S (plus i d)) t) (lift h (s k (S (plus i d))) t0) x i +H2))))))))))))) t1)). -axiom subst0_gen_lift_false: +theorem subst0_gen_lift_false: \forall (t: T).(\forall (u: T).(\forall (x: T).(\forall (h: nat).(\forall (d: nat).(\forall (i: nat).((le d i) \to ((lt i (plus d h)) \to ((subst0 i u (lift h d t) x) \to (\forall (P: Prop).P))))))))) -. +\def + \lambda (t: T).(T_ind (\lambda (t0: T).(\forall (u: T).(\forall (x: +T).(\forall (h: nat).(\forall (d: nat).(\forall (i: nat).((le d i) \to ((lt i +(plus d h)) \to ((subst0 i u (lift h d t0) x) \to (\forall (P: +Prop).P)))))))))) (\lambda (n: nat).(\lambda (u: T).(\lambda (x: T).(\lambda +(h: nat).(\lambda (d: nat).(\lambda (i: nat).(\lambda (_: (le d i)).(\lambda +(_: (lt i (plus d h))).(\lambda (H1: (subst0 i u (lift h d (TSort n)) +x)).(\lambda (P: Prop).(let H2 \def (eq_ind T (lift h d (TSort n)) (\lambda +(t0: T).(subst0 i u t0 x)) H1 (TSort n) (lift_sort n h d)) in +(subst0_gen_sort u x i n H2 P)))))))))))) (\lambda (n: nat).(\lambda (u: +T).(\lambda (x: T).(\lambda (h: nat).(\lambda (d: nat).(\lambda (i: +nat).(\lambda (H: (le d i)).(\lambda (H0: (lt i (plus d h))).(\lambda (H1: +(subst0 i u (lift h d (TLRef n)) x)).(\lambda (P: Prop).(lt_le_e n d P +(\lambda (H2: (lt n d)).(let H3 \def (eq_ind T (lift h d (TLRef n)) (\lambda +(t0: T).(subst0 i u t0 x)) H1 (TLRef n) (lift_lref_lt n h d H2)) in (and_ind +(eq nat n i) (eq T x (lift (S n) O u)) P (\lambda (H4: (eq nat n i)).(\lambda +(_: (eq T x (lift (S n) O u))).(let H6 \def (eq_ind nat n (\lambda (n0: +nat).(lt n0 d)) H2 i H4) in (le_false d i P H H6)))) (subst0_gen_lref u x i n +H3)))) (\lambda (H2: (le d n)).(let H3 \def (eq_ind T (lift h d (TLRef n)) +(\lambda (t0: T).(subst0 i u t0 x)) H1 (TLRef (plus n h)) (lift_lref_ge n h d +H2)) in (and_ind (eq nat (plus n h) i) (eq T x (lift (S (plus n h)) O u)) P +(\lambda (H4: (eq nat (plus n h) i)).(\lambda (_: (eq T x (lift (S (plus n +h)) O u))).(let H6 \def (eq_ind_r nat i (\lambda (n0: nat).(lt n0 (plus d +h))) H0 (plus n h) H4) in (le_false d n P H2 (lt_le_S n d (simpl_lt_plus_r h +n d H6)))))) (subst0_gen_lref u x i (plus n h) H3))))))))))))))) (\lambda (k: +K).(\lambda (t0: T).(\lambda (H: ((\forall (u: T).(\forall (x: T).(\forall +(h: nat).(\forall (d: nat).(\forall (i: nat).((le d i) \to ((lt i (plus d h)) +\to ((subst0 i u (lift h d t0) x) \to (\forall (P: +Prop).P))))))))))).(\lambda (t1: T).(\lambda (H0: ((\forall (u: T).(\forall +(x: T).(\forall (h: nat).(\forall (d: nat).(\forall (i: nat).((le d i) \to +((lt i (plus d h)) \to ((subst0 i u (lift h d t1) x) \to (\forall (P: +Prop).P))))))))))).(\lambda (u: T).(\lambda (x: T).(\lambda (h: nat).(\lambda +(d: nat).(\lambda (i: nat).(\lambda (H1: (le d i)).(\lambda (H2: (lt i (plus +d h))).(\lambda (H3: (subst0 i u (lift h d (THead k t0 t1)) x)).(\lambda (P: +Prop).(let H4 \def (eq_ind T (lift h d (THead k t0 t1)) (\lambda (t2: +T).(subst0 i u t2 x)) H3 (THead k (lift h d t0) (lift h (s k d) t1)) +(lift_head k t0 t1 h d)) in (or3_ind (ex2 T (\lambda (u2: T).(eq T x (THead k +u2 (lift h (s k d) t1)))) (\lambda (u2: T).(subst0 i u (lift h d t0) u2))) +(ex2 T (\lambda (t2: T).(eq T x (THead k (lift h d t0) t2))) (\lambda (t2: +T).(subst0 (s k i) u (lift h (s k d) t1) t2))) (ex3_2 T T (\lambda (u2: +T).(\lambda (t2: T).(eq T x (THead k u2 t2)))) (\lambda (u2: T).(\lambda (_: +T).(subst0 i u (lift h d t0) u2))) (\lambda (_: T).(\lambda (t2: T).(subst0 +(s k i) u (lift h (s k d) t1) t2)))) P (\lambda (H5: (ex2 T (\lambda (u2: +T).(eq T x (THead k u2 (lift h (s k d) t1)))) (\lambda (u2: T).(subst0 i u +(lift h d t0) u2)))).(ex2_ind T (\lambda (u2: T).(eq T x (THead k u2 (lift h +(s k d) t1)))) (\lambda (u2: T).(subst0 i u (lift h d t0) u2)) P (\lambda +(x0: T).(\lambda (_: (eq T x (THead k x0 (lift h (s k d) t1)))).(\lambda (H7: +(subst0 i u (lift h d t0) x0)).(H u x0 h d i H1 H2 H7 P)))) H5)) (\lambda +(H5: (ex2 T (\lambda (t2: T).(eq T x (THead k (lift h d t0) t2))) (\lambda +(t2: T).(subst0 (s k i) u (lift h (s k d) t1) t2)))).(ex2_ind T (\lambda (t2: +T).(eq T x (THead k (lift h d t0) t2))) (\lambda (t2: T).(subst0 (s k i) u +(lift h (s k d) t1) t2)) P (\lambda (x0: T).(\lambda (_: (eq T x (THead k +(lift h d t0) x0))).(\lambda (H7: (subst0 (s k i) u (lift h (s k d) t1) +x0)).(H0 u x0 h (s k d) (s k i) (s_le k d i H1) (eq_ind nat (s k (plus d h)) +(\lambda (n: nat).(lt (s k i) n)) (lt_le_S (s k i) (s k (plus d h)) (s_lt k i +(plus d h) H2)) (plus (s k d) h) (s_plus k d h)) H7 P)))) H5)) (\lambda (H5: +(ex3_2 T T (\lambda (u2: T).(\lambda (t2: T).(eq T x (THead k u2 t2)))) +(\lambda (u2: T).(\lambda (_: T).(subst0 i u (lift h d t0) u2))) (\lambda (_: +T).(\lambda (t2: T).(subst0 (s k i) u (lift h (s k d) t1) t2))))).(ex3_2_ind +T T (\lambda (u2: T).(\lambda (t2: T).(eq T x (THead k u2 t2)))) (\lambda +(u2: T).(\lambda (_: T).(subst0 i u (lift h d t0) u2))) (\lambda (_: +T).(\lambda (t2: T).(subst0 (s k i) u (lift h (s k d) t1) t2))) P (\lambda +(x0: T).(\lambda (x1: T).(\lambda (_: (eq T x (THead k x0 x1))).(\lambda (H7: +(subst0 i u (lift h d t0) x0)).(\lambda (_: (subst0 (s k i) u (lift h (s k d) +t1) x1)).(H u x0 h d i H1 H2 H7 P)))))) H5)) (subst0_gen_head k u (lift h d +t0) (lift h (s k d) t1) x i H4))))))))))))))))) t). -axiom subst0_gen_lift_ge: +theorem subst0_gen_lift_ge: \forall (u: T).(\forall (t1: T).(\forall (x: T).(\forall (i: nat).(\forall (h: nat).(\forall (d: nat).((subst0 i u (lift h d t1) x) \to ((le (plus d h) i) \to (ex2 T (\lambda (t2: T).(eq T x (lift h d t2))) (\lambda (t2: T).(subst0 (minus i h) u t1 t2)))))))))) -. +\def + \lambda (u: T).(\lambda (t1: T).(T_ind (\lambda (t: T).(\forall (x: +T).(\forall (i: nat).(\forall (h: nat).(\forall (d: nat).((subst0 i u (lift h +d t) x) \to ((le (plus d h) i) \to (ex2 T (\lambda (t2: T).(eq T x (lift h d +t2))) (\lambda (t2: T).(subst0 (minus i h) u t t2)))))))))) (\lambda (n: +nat).(\lambda (x: T).(\lambda (i: nat).(\lambda (h: nat).(\lambda (d: +nat).(\lambda (H: (subst0 i u (lift h d (TSort n)) x)).(\lambda (_: (le (plus +d h) i)).(let H1 \def (eq_ind T (lift h d (TSort n)) (\lambda (t: T).(subst0 +i u t x)) H (TSort n) (lift_sort n h d)) in (subst0_gen_sort u x i n H1 (ex2 +T (\lambda (t2: T).(eq T x (lift h d t2))) (\lambda (t2: T).(subst0 (minus i +h) u (TSort n) t2)))))))))))) (\lambda (n: nat).(\lambda (x: T).(\lambda (i: +nat).(\lambda (h: nat).(\lambda (d: nat).(\lambda (H: (subst0 i u (lift h d +(TLRef n)) x)).(\lambda (H0: (le (plus d h) i)).(lt_le_e n d (ex2 T (\lambda +(t2: T).(eq T x (lift h d t2))) (\lambda (t2: T).(subst0 (minus i h) u (TLRef +n) t2))) (\lambda (H1: (lt n d)).(let H2 \def (eq_ind T (lift h d (TLRef n)) +(\lambda (t: T).(subst0 i u t x)) H (TLRef n) (lift_lref_lt n h d H1)) in +(and_ind (eq nat n i) (eq T x (lift (S n) O u)) (ex2 T (\lambda (t2: T).(eq T +x (lift h d t2))) (\lambda (t2: T).(subst0 (minus i h) u (TLRef n) t2))) +(\lambda (H3: (eq nat n i)).(\lambda (_: (eq T x (lift (S n) O u))).(let H5 +\def (eq_ind nat n (\lambda (n0: nat).(lt n0 d)) H1 i H3) in (le_false (plus +d h) i (ex2 T (\lambda (t2: T).(eq T x (lift h d t2))) (\lambda (t2: +T).(subst0 (minus i h) u (TLRef n) t2))) H0 (le_plus_trans (S i) d h H5))))) +(subst0_gen_lref u x i n H2)))) (\lambda (H1: (le d n)).(let H2 \def (eq_ind +T (lift h d (TLRef n)) (\lambda (t: T).(subst0 i u t x)) H (TLRef (plus n h)) +(lift_lref_ge n h d H1)) in (and_ind (eq nat (plus n h) i) (eq T x (lift (S +(plus n h)) O u)) (ex2 T (\lambda (t2: T).(eq T x (lift h d t2))) (\lambda +(t2: T).(subst0 (minus i h) u (TLRef n) t2))) (\lambda (H3: (eq nat (plus n +h) i)).(\lambda (H4: (eq T x (lift (S (plus n h)) O u))).(eq_ind nat (plus n +h) (\lambda (n0: nat).(ex2 T (\lambda (t2: T).(eq T x (lift h d t2))) +(\lambda (t2: T).(subst0 (minus n0 h) u (TLRef n) t2)))) (eq_ind_r T (lift (S +(plus n h)) O u) (\lambda (t: T).(ex2 T (\lambda (t2: T).(eq T t (lift h d +t2))) (\lambda (t2: T).(subst0 (minus (plus n h) h) u (TLRef n) t2)))) +(eq_ind_r nat n (\lambda (n0: nat).(ex2 T (\lambda (t2: T).(eq T (lift (S +(plus n h)) O u) (lift h d t2))) (\lambda (t2: T).(subst0 n0 u (TLRef n) +t2)))) (ex_intro2 T (\lambda (t2: T).(eq T (lift (S (plus n h)) O u) (lift h +d t2))) (\lambda (t2: T).(subst0 n u (TLRef n) t2)) (lift (S n) O u) +(eq_ind_r T (lift (plus h (S n)) O u) (\lambda (t: T).(eq T (lift (S (plus n +h)) O u) t)) (eq_ind_r nat (plus h n) (\lambda (n0: nat).(eq T (lift (S n0) O +u) (lift (plus h (S n)) O u))) (eq_ind_r nat (plus h (S n)) (\lambda (n0: +nat).(eq T (lift n0 O u) (lift (plus h (S n)) O u))) (refl_equal T (lift +(plus h (S n)) O u)) (S (plus h n)) (plus_n_Sm h n)) (plus n h) (plus_comm n +h)) (lift h d (lift (S n) O u)) (lift_free u (S n) h O d (le_trans d (S n) +(plus O (S n)) (le_S d n H1) (le_n (plus O (S n)))) (le_O_n d))) (subst0_lref +u n)) (minus (plus n h) h) (minus_plus_r n h)) x H4) i H3))) (subst0_gen_lref +u x i (plus n h) H2)))))))))))) (\lambda (k: K).(\lambda (t: T).(\lambda (H: +((\forall (x: T).(\forall (i: nat).(\forall (h: nat).(\forall (d: +nat).((subst0 i u (lift h d t) x) \to ((le (plus d h) i) \to (ex2 T (\lambda +(t2: T).(eq T x (lift h d t2))) (\lambda (t2: T).(subst0 (minus i h) u t +t2))))))))))).(\lambda (t0: T).(\lambda (H0: ((\forall (x: T).(\forall (i: +nat).(\forall (h: nat).(\forall (d: nat).((subst0 i u (lift h d t0) x) \to +((le (plus d h) i) \to (ex2 T (\lambda (t2: T).(eq T x (lift h d t2))) +(\lambda (t2: T).(subst0 (minus i h) u t0 t2))))))))))).(\lambda (x: +T).(\lambda (i: nat).(\lambda (h: nat).(\lambda (d: nat).(\lambda (H1: +(subst0 i u (lift h d (THead k t t0)) x)).(\lambda (H2: (le (plus d h) +i)).(let H3 \def (eq_ind T (lift h d (THead k t t0)) (\lambda (t2: T).(subst0 +i u t2 x)) H1 (THead k (lift h d t) (lift h (s k d) t0)) (lift_head k t t0 h +d)) in (or3_ind (ex2 T (\lambda (u2: T).(eq T x (THead k u2 (lift h (s k d) +t0)))) (\lambda (u2: T).(subst0 i u (lift h d t) u2))) (ex2 T (\lambda (t2: +T).(eq T x (THead k (lift h d t) t2))) (\lambda (t2: T).(subst0 (s k i) u +(lift h (s k d) t0) t2))) (ex3_2 T T (\lambda (u2: T).(\lambda (t2: T).(eq T +x (THead k u2 t2)))) (\lambda (u2: T).(\lambda (_: T).(subst0 i u (lift h d +t) u2))) (\lambda (_: T).(\lambda (t2: T).(subst0 (s k i) u (lift h (s k d) +t0) t2)))) (ex2 T (\lambda (t2: T).(eq T x (lift h d t2))) (\lambda (t2: +T).(subst0 (minus i h) u (THead k t t0) t2))) (\lambda (H4: (ex2 T (\lambda +(u2: T).(eq T x (THead k u2 (lift h (s k d) t0)))) (\lambda (u2: T).(subst0 i +u (lift h d t) u2)))).(ex2_ind T (\lambda (u2: T).(eq T x (THead k u2 (lift h +(s k d) t0)))) (\lambda (u2: T).(subst0 i u (lift h d t) u2)) (ex2 T (\lambda +(t2: T).(eq T x (lift h d t2))) (\lambda (t2: T).(subst0 (minus i h) u (THead +k t t0) t2))) (\lambda (x0: T).(\lambda (H5: (eq T x (THead k x0 (lift h (s k +d) t0)))).(\lambda (H6: (subst0 i u (lift h d t) x0)).(eq_ind_r T (THead k x0 +(lift h (s k d) t0)) (\lambda (t2: T).(ex2 T (\lambda (t3: T).(eq T t2 (lift +h d t3))) (\lambda (t3: T).(subst0 (minus i h) u (THead k t t0) t3)))) +(ex2_ind T (\lambda (t2: T).(eq T x0 (lift h d t2))) (\lambda (t2: T).(subst0 +(minus i h) u t t2)) (ex2 T (\lambda (t2: T).(eq T (THead k x0 (lift h (s k +d) t0)) (lift h d t2))) (\lambda (t2: T).(subst0 (minus i h) u (THead k t t0) +t2))) (\lambda (x1: T).(\lambda (H7: (eq T x0 (lift h d x1))).(\lambda (H8: +(subst0 (minus i h) u t x1)).(eq_ind_r T (lift h d x1) (\lambda (t2: T).(ex2 +T (\lambda (t3: T).(eq T (THead k t2 (lift h (s k d) t0)) (lift h d t3))) +(\lambda (t3: T).(subst0 (minus i h) u (THead k t t0) t3)))) (eq_ind T (lift +h d (THead k x1 t0)) (\lambda (t2: T).(ex2 T (\lambda (t3: T).(eq T t2 (lift +h d t3))) (\lambda (t3: T).(subst0 (minus i h) u (THead k t t0) t3)))) +(ex_intro2 T (\lambda (t2: T).(eq T (lift h d (THead k x1 t0)) (lift h d +t2))) (\lambda (t2: T).(subst0 (minus i h) u (THead k t t0) t2)) (THead k x1 +t0) (refl_equal T (lift h d (THead k x1 t0))) (subst0_fst u x1 t (minus i h) +H8 t0 k)) (THead k (lift h d x1) (lift h (s k d) t0)) (lift_head k x1 t0 h +d)) x0 H7)))) (H x0 i h d H6 H2)) x H5)))) H4)) (\lambda (H4: (ex2 T (\lambda +(t2: T).(eq T x (THead k (lift h d t) t2))) (\lambda (t2: T).(subst0 (s k i) +u (lift h (s k d) t0) t2)))).(ex2_ind T (\lambda (t2: T).(eq T x (THead k +(lift h d t) t2))) (\lambda (t2: T).(subst0 (s k i) u (lift h (s k d) t0) +t2)) (ex2 T (\lambda (t2: T).(eq T x (lift h d t2))) (\lambda (t2: T).(subst0 +(minus i h) u (THead k t t0) t2))) (\lambda (x0: T).(\lambda (H5: (eq T x +(THead k (lift h d t) x0))).(\lambda (H6: (subst0 (s k i) u (lift h (s k d) +t0) x0)).(eq_ind_r T (THead k (lift h d t) x0) (\lambda (t2: T).(ex2 T +(\lambda (t3: T).(eq T t2 (lift h d t3))) (\lambda (t3: T).(subst0 (minus i +h) u (THead k t t0) t3)))) (ex2_ind T (\lambda (t2: T).(eq T x0 (lift h (s k +d) t2))) (\lambda (t2: T).(subst0 (minus (s k i) h) u t0 t2)) (ex2 T (\lambda +(t2: T).(eq T (THead k (lift h d t) x0) (lift h d t2))) (\lambda (t2: +T).(subst0 (minus i h) u (THead k t t0) t2))) (\lambda (x1: T).(\lambda (H7: +(eq T x0 (lift h (s k d) x1))).(\lambda (H8: (subst0 (minus (s k i) h) u t0 +x1)).(eq_ind_r T (lift h (s k d) x1) (\lambda (t2: T).(ex2 T (\lambda (t3: +T).(eq T (THead k (lift h d t) t2) (lift h d t3))) (\lambda (t3: T).(subst0 +(minus i h) u (THead k t t0) t3)))) (eq_ind T (lift h d (THead k t x1)) +(\lambda (t2: T).(ex2 T (\lambda (t3: T).(eq T t2 (lift h d t3))) (\lambda +(t3: T).(subst0 (minus i h) u (THead k t t0) t3)))) (let H9 \def (eq_ind_r +nat (minus (s k i) h) (\lambda (n: nat).(subst0 n u t0 x1)) H8 (s k (minus i +h)) (s_minus k i h (le_trans_plus_r d h i H2))) in (ex_intro2 T (\lambda (t2: +T).(eq T (lift h d (THead k t x1)) (lift h d t2))) (\lambda (t2: T).(subst0 +(minus i h) u (THead k t t0) t2)) (THead k t x1) (refl_equal T (lift h d +(THead k t x1))) (subst0_snd k u x1 t0 (minus i h) H9 t))) (THead k (lift h d +t) (lift h (s k d) x1)) (lift_head k t x1 h d)) x0 H7)))) (H0 x0 (s k i) h (s +k d) H6 (eq_ind nat (s k (plus d h)) (\lambda (n: nat).(le n (s k i))) (s_le +k (plus d h) i H2) (plus (s k d) h) (s_plus k d h)))) x H5)))) H4)) (\lambda +(H4: (ex3_2 T T (\lambda (u2: T).(\lambda (t2: T).(eq T x (THead k u2 t2)))) +(\lambda (u2: T).(\lambda (_: T).(subst0 i u (lift h d t) u2))) (\lambda (_: +T).(\lambda (t2: T).(subst0 (s k i) u (lift h (s k d) t0) t2))))).(ex3_2_ind +T T (\lambda (u2: T).(\lambda (t2: T).(eq T x (THead k u2 t2)))) (\lambda +(u2: T).(\lambda (_: T).(subst0 i u (lift h d t) u2))) (\lambda (_: +T).(\lambda (t2: T).(subst0 (s k i) u (lift h (s k d) t0) t2))) (ex2 T +(\lambda (t2: T).(eq T x (lift h d t2))) (\lambda (t2: T).(subst0 (minus i h) +u (THead k t t0) t2))) (\lambda (x0: T).(\lambda (x1: T).(\lambda (H5: (eq T +x (THead k x0 x1))).(\lambda (H6: (subst0 i u (lift h d t) x0)).(\lambda (H7: +(subst0 (s k i) u (lift h (s k d) t0) x1)).(eq_ind_r T (THead k x0 x1) +(\lambda (t2: T).(ex2 T (\lambda (t3: T).(eq T t2 (lift h d t3))) (\lambda +(t3: T).(subst0 (minus i h) u (THead k t t0) t3)))) (ex2_ind T (\lambda (t2: +T).(eq T x1 (lift h (s k d) t2))) (\lambda (t2: T).(subst0 (minus (s k i) h) +u t0 t2)) (ex2 T (\lambda (t2: T).(eq T (THead k x0 x1) (lift h d t2))) +(\lambda (t2: T).(subst0 (minus i h) u (THead k t t0) t2))) (\lambda (x2: +T).(\lambda (H8: (eq T x1 (lift h (s k d) x2))).(\lambda (H9: (subst0 (minus +(s k i) h) u t0 x2)).(ex2_ind T (\lambda (t2: T).(eq T x0 (lift h d t2))) +(\lambda (t2: T).(subst0 (minus i h) u t t2)) (ex2 T (\lambda (t2: T).(eq T +(THead k x0 x1) (lift h d t2))) (\lambda (t2: T).(subst0 (minus i h) u (THead +k t t0) t2))) (\lambda (x3: T).(\lambda (H10: (eq T x0 (lift h d +x3))).(\lambda (H11: (subst0 (minus i h) u t x3)).(eq_ind_r T (lift h d x3) +(\lambda (t2: T).(ex2 T (\lambda (t3: T).(eq T (THead k t2 x1) (lift h d +t3))) (\lambda (t3: T).(subst0 (minus i h) u (THead k t t0) t3)))) (eq_ind_r +T (lift h (s k d) x2) (\lambda (t2: T).(ex2 T (\lambda (t3: T).(eq T (THead k +(lift h d x3) t2) (lift h d t3))) (\lambda (t3: T).(subst0 (minus i h) u +(THead k t t0) t3)))) (eq_ind T (lift h d (THead k x3 x2)) (\lambda (t2: +T).(ex2 T (\lambda (t3: T).(eq T t2 (lift h d t3))) (\lambda (t3: T).(subst0 +(minus i h) u (THead k t t0) t3)))) (let H12 \def (eq_ind_r nat (minus (s k +i) h) (\lambda (n: nat).(subst0 n u t0 x2)) H9 (s k (minus i h)) (s_minus k i +h (le_trans_plus_r d h i H2))) in (ex_intro2 T (\lambda (t2: T).(eq T (lift h +d (THead k x3 x2)) (lift h d t2))) (\lambda (t2: T).(subst0 (minus i h) u +(THead k t t0) t2)) (THead k x3 x2) (refl_equal T (lift h d (THead k x3 x2))) +(subst0_both u t x3 (minus i h) H11 k t0 x2 H12))) (THead k (lift h d x3) +(lift h (s k d) x2)) (lift_head k x3 x2 h d)) x1 H8) x0 H10)))) (H x0 i h d +H6 H2))))) (H0 x1 (s k i) h (s k d) H7 (eq_ind nat (s k (plus d h)) (\lambda +(n: nat).(le n (s k i))) (s_le k (plus d h) i H2) (plus (s k d) h) (s_plus k +d h)))) x H5)))))) H4)) (subst0_gen_head k u (lift h d t) (lift h (s k d) t0) +x i H3)))))))))))))) t1)).