From: Ferruccio Guidi Date: Thu, 7 Sep 2006 12:31:09 +0000 (+0000) Subject: subst0 completed X-Git-Tag: 0.4.95@7852~1069 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=25e7d64be05ee3fdde98f59ca097ab4490afc8ae;p=helm.git subst0 completed --- diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/Base/ext/preamble.ma b/matita/contribs/LAMBDA-TYPES/Level-1/Base/ext/preamble.ma index 98d1c163b..30d611349 100644 --- a/matita/contribs/LAMBDA-TYPES/Level-1/Base/ext/preamble.ma +++ b/matita/contribs/LAMBDA-TYPES/Level-1/Base/ext/preamble.ma @@ -137,6 +137,9 @@ alias id "lt_le_trans" = "cic:/Coq/Arith/Lt/lt_le_trans.con". alias id "lt_wf_ind" = "cic:/Coq/Arith/Wf_nat/lt_wf_ind.con". alias id "bool_ind" = "cic:/Coq/Init/Datatypes/bool_ind.con". alias id "ex_ind" = "cic:/Coq/Init/Logic/ex_ind.con". +alias id "plus_Snm_nSm" = "cic:/Coq/Arith/Plus/plus_Snm_nSm.con". +alias id "plus_lt_le_compat" = "cic:/Coq/Arith/Plus/plus_lt_le_compat.con". +alias id "plus_lt_compat" = "cic:/Coq/Arith/Plus/plus_lt_compat.con". theorem f_equal: \forall A,B:Type. \forall f:A \to B. \forall x,y:A. x = y \to f x = f y. diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/cimp/props.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/cimp/props.ma new file mode 100644 index 000000000..f48629b14 --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/cimp/props.ma @@ -0,0 +1,124 @@ +(**************************************************************************) +(* ___ *) +(* ||M|| *) +(* ||A|| A project by Andrea Asperti *) +(* ||T|| *) +(* ||I|| Developers: *) +(* ||T|| The HELM team. *) +(* ||A|| http://helm.cs.unibo.it *) +(* \ / *) +(* \ / This file is distributed under the terms of the *) +(* v GNU General Public License Version 2 *) +(* *) +(**************************************************************************) + +(* This file was automatically generated: do not edit *********************) + +set "baseuri" "cic:/matita/LAMBDA-TYPES/Level-1/LambdaDelta/cimp/props". + +include "cimp/defs.ma". + +include "getl/getl.ma". + +theorem cimp_flat_sx: + \forall (f: F).(\forall (c: C).(\forall (v: T).(cimp (CHead c (Flat f) v) +c))) +\def + \lambda (f: F).(\lambda (c: C).(\lambda (v: T).(\lambda (b: B).(\lambda (d1: +C).(\lambda (w: T).(\lambda (h: nat).(\lambda (H: (getl h (CHead c (Flat f) +v) (CHead d1 (Bind b) w))).((match h in nat return (\lambda (n: nat).((getl n +(CHead c (Flat f) v) (CHead d1 (Bind b) w)) \to (ex C (\lambda (d2: C).(getl +n c (CHead d2 (Bind b) w)))))) with [O \Rightarrow (\lambda (H0: (getl O +(CHead c (Flat f) v) (CHead d1 (Bind b) w))).(ex_intro C (\lambda (d2: +C).(getl O c (CHead d2 (Bind b) w))) d1 (getl_intro O c (CHead d1 (Bind b) w) +c (drop_refl c) (clear_gen_flat f c (CHead d1 (Bind b) w) v (getl_gen_O +(CHead c (Flat f) v) (CHead d1 (Bind b) w) H0))))) | (S n) \Rightarrow +(\lambda (H0: (getl (S n) (CHead c (Flat f) v) (CHead d1 (Bind b) +w))).(ex_intro C (\lambda (d2: C).(getl (S n) c (CHead d2 (Bind b) w))) d1 +(getl_gen_S (Flat f) c (CHead d1 (Bind b) w) v n H0)))]) H)))))))). + +theorem cimp_flat_dx: + \forall (f: F).(\forall (c: C).(\forall (v: T).(cimp c (CHead c (Flat f) +v)))) +\def + \lambda (f: F).(\lambda (c: C).(\lambda (v: T).(\lambda (b: B).(\lambda (d1: +C).(\lambda (w: T).(\lambda (h: nat).(\lambda (H: (getl h c (CHead d1 (Bind +b) w))).(ex_intro C (\lambda (d2: C).(getl h (CHead c (Flat f) v) (CHead d2 +(Bind b) w))) d1 (getl_flat c (CHead d1 (Bind b) w) h H f v))))))))). + +theorem cimp_bind: + \forall (c1: C).(\forall (c2: C).((cimp c1 c2) \to (\forall (b: B).(\forall +(v: T).(cimp (CHead c1 (Bind b) v) (CHead c2 (Bind b) v)))))) +\def + \lambda (c1: C).(\lambda (c2: C).(\lambda (H: ((\forall (b: B).(\forall (d1: +C).(\forall (w: T).(\forall (h: nat).((getl h c1 (CHead d1 (Bind b) w)) \to +(ex C (\lambda (d2: C).(getl h c2 (CHead d2 (Bind b) w))))))))))).(\lambda +(b: B).(\lambda (v: T).(\lambda (b0: B).(\lambda (d1: C).(\lambda (w: +T).(\lambda (h: nat).(\lambda (H0: (getl h (CHead c1 (Bind b) v) (CHead d1 +(Bind b0) w))).((match h in nat return (\lambda (n: nat).((getl n (CHead c1 +(Bind b) v) (CHead d1 (Bind b0) w)) \to (ex C (\lambda (d2: C).(getl n (CHead +c2 (Bind b) v) (CHead d2 (Bind b0) w)))))) with [O \Rightarrow (\lambda (H1: +(getl O (CHead c1 (Bind b) v) (CHead d1 (Bind b0) w))).(let H2 \def (f_equal +C C (\lambda (e: C).(match e in C return (\lambda (_: C).C) with [(CSort _) +\Rightarrow d1 | (CHead c _ _) \Rightarrow c])) (CHead d1 (Bind b0) w) (CHead +c1 (Bind b) v) (clear_gen_bind b c1 (CHead d1 (Bind b0) w) v (getl_gen_O +(CHead c1 (Bind b) v) (CHead d1 (Bind b0) w) H1))) in ((let H3 \def (f_equal +C B (\lambda (e: C).(match e in C return (\lambda (_: C).B) with [(CSort _) +\Rightarrow b0 | (CHead _ k _) \Rightarrow (match k in K return (\lambda (_: +K).B) with [(Bind b) \Rightarrow b | (Flat _) \Rightarrow b0])])) (CHead d1 +(Bind b0) w) (CHead c1 (Bind b) v) (clear_gen_bind b c1 (CHead d1 (Bind b0) +w) v (getl_gen_O (CHead c1 (Bind b) v) (CHead d1 (Bind b0) w) H1))) in ((let +H4 \def (f_equal C T (\lambda (e: C).(match e in C return (\lambda (_: C).T) +with [(CSort _) \Rightarrow w | (CHead _ _ t) \Rightarrow t])) (CHead d1 +(Bind b0) w) (CHead c1 (Bind b) v) (clear_gen_bind b c1 (CHead d1 (Bind b0) +w) v (getl_gen_O (CHead c1 (Bind b) v) (CHead d1 (Bind b0) w) H1))) in +(\lambda (H5: (eq B b0 b)).(\lambda (_: (eq C d1 c1)).(eq_ind_r T v (\lambda +(t: T).(ex C (\lambda (d2: C).(getl O (CHead c2 (Bind b) v) (CHead d2 (Bind +b0) t))))) (eq_ind_r B b (\lambda (b1: B).(ex C (\lambda (d2: C).(getl O +(CHead c2 (Bind b) v) (CHead d2 (Bind b1) v))))) (ex_intro C (\lambda (d2: +C).(getl O (CHead c2 (Bind b) v) (CHead d2 (Bind b) v))) c2 (getl_refl b c2 +v)) b0 H5) w H4)))) H3)) H2))) | (S n) \Rightarrow (\lambda (H1: (getl (S n) +(CHead c1 (Bind b) v) (CHead d1 (Bind b0) w))).(let H_x \def (H b0 d1 w (r +(Bind b) n) (getl_gen_S (Bind b) c1 (CHead d1 (Bind b0) w) v n H1)) in (let +H2 \def H_x in (ex_ind C (\lambda (d2: C).(getl (r (Bind b) n) c2 (CHead d2 +(Bind b0) w))) (ex C (\lambda (d2: C).(getl (S n) (CHead c2 (Bind b) v) +(CHead d2 (Bind b0) w)))) (\lambda (x: C).(\lambda (H3: (getl (r (Bind b) n) +c2 (CHead x (Bind b0) w))).(ex_intro C (\lambda (d2: C).(getl (S n) (CHead c2 +(Bind b) v) (CHead d2 (Bind b0) w))) x (getl_head (Bind b) n c2 (CHead x +(Bind b0) w) H3 v)))) H2))))]) H0)))))))))). + +theorem cimp_getl_conf: + \forall (c1: C).(\forall (c2: C).((cimp c1 c2) \to (\forall (b: B).(\forall +(d1: C).(\forall (w: T).(\forall (i: nat).((getl i c1 (CHead d1 (Bind b) w)) +\to (ex2 C (\lambda (d2: C).(cimp d1 d2)) (\lambda (d2: C).(getl i c2 (CHead +d2 (Bind b) w))))))))))) +\def + \lambda (c1: C).(\lambda (c2: C).(\lambda (H: ((\forall (b: B).(\forall (d1: +C).(\forall (w: T).(\forall (h: nat).((getl h c1 (CHead d1 (Bind b) w)) \to +(ex C (\lambda (d2: C).(getl h c2 (CHead d2 (Bind b) w))))))))))).(\lambda +(b: B).(\lambda (d1: C).(\lambda (w: T).(\lambda (i: nat).(\lambda (H0: (getl +i c1 (CHead d1 (Bind b) w))).(let H_x \def (H b d1 w i H0) in (let H1 \def +H_x in (ex_ind C (\lambda (d2: C).(getl i c2 (CHead d2 (Bind b) w))) (ex2 C +(\lambda (d2: C).(\forall (b0: B).(\forall (d3: C).(\forall (w0: T).(\forall +(h: nat).((getl h d1 (CHead d3 (Bind b0) w0)) \to (ex C (\lambda (d4: +C).(getl h d2 (CHead d4 (Bind b0) w0)))))))))) (\lambda (d2: C).(getl i c2 +(CHead d2 (Bind b) w)))) (\lambda (x: C).(\lambda (H2: (getl i c2 (CHead x +(Bind b) w))).(ex_intro2 C (\lambda (d2: C).(\forall (b0: B).(\forall (d3: +C).(\forall (w0: T).(\forall (h: nat).((getl h d1 (CHead d3 (Bind b0) w0)) +\to (ex C (\lambda (d4: C).(getl h d2 (CHead d4 (Bind b0) w0)))))))))) +(\lambda (d2: C).(getl i c2 (CHead d2 (Bind b) w))) x (\lambda (b0: +B).(\lambda (d0: C).(\lambda (w0: T).(\lambda (h: nat).(\lambda (H3: (getl h +d1 (CHead d0 (Bind b0) w0))).(let H_y \def (getl_trans (S h) c1 (CHead d1 +(Bind b) w) i H0) in (let H_x0 \def (H b0 d0 w0 (plus (S h) i) (H_y (CHead d0 +(Bind b0) w0) (getl_head (Bind b) h d1 (CHead d0 (Bind b0) w0) H3 w))) in +(let H4 \def H_x0 in (ex_ind C (\lambda (d2: C).(getl (plus (S h) i) c2 +(CHead d2 (Bind b0) w0))) (ex C (\lambda (d2: C).(getl h x (CHead d2 (Bind +b0) w0)))) (\lambda (x0: C).(\lambda (H5: (getl (plus (S h) i) c2 (CHead x0 +(Bind b0) w0))).(let H_y0 \def (getl_conf_le (plus (S h) i) (CHead x0 (Bind +b0) w0) c2 H5 (CHead x (Bind b) w) i H2) in (let H6 \def (eq_ind nat (minus +(plus (S h) i) i) (\lambda (n: nat).(getl n (CHead x (Bind b) w) (CHead x0 +(Bind b0) w0))) (H_y0 (le_plus_r (S h) i)) (S h) (minus_plus_r (S h) i)) in +(ex_intro C (\lambda (d2: C).(getl h x (CHead d2 (Bind b0) w0))) x0 +(getl_gen_S (Bind b) x (CHead x0 (Bind b0) w0) w h H6)))))) H4))))))))) H2))) +H1)))))))))). + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/drop1/getl.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/drop1/getl.ma new file mode 100644 index 000000000..879483c42 --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/drop1/getl.ma @@ -0,0 +1,29 @@ +(**************************************************************************) +(* ___ *) +(* ||M|| *) +(* ||A|| A project by Andrea Asperti *) +(* ||T|| *) +(* ||I|| Developers: *) +(* ||T|| The HELM team. *) +(* ||A|| http://helm.cs.unibo.it *) +(* \ / *) +(* \ / This file is distributed under the terms of the *) +(* v GNU General Public License Version 2 *) +(* *) +(**************************************************************************) + +(* This file was automatically generated: do not edit *********************) + +set "baseuri" "cic:/matita/LAMBDA-TYPES/Level-1/LambdaDelta/drop1/getl". + +include "drop1/defs.ma". + +include "getl/defs.ma". + +axiom drop1_getl_trans: + \forall (hds: PList).(\forall (c1: C).(\forall (c2: C).((drop1 hds c2 c1) +\to (\forall (b: B).(\forall (e1: C).(\forall (v: T).(\forall (i: nat).((getl +i c1 (CHead e1 (Bind b) v)) \to (ex C (\lambda (e2: C).(getl (trans hds i) c2 +(CHead e2 (Bind b) (ctrans hds i v))))))))))))) +. + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/drop1/props.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/drop1/props.ma index 2e1f964ed..359869780 100644 --- a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/drop1/props.ma +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/drop1/props.ma @@ -20,6 +20,8 @@ include "drop1/defs.ma". include "drop/props.ma". +include "getl/defs.ma". + theorem drop1_skip_bind: \forall (b: B).(\forall (e: C).(\forall (hds: PList).(\forall (c: C).(\forall (u: T).((drop1 hds c e) \to (drop1 (Ss hds) (CHead c (Bind b) diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/getl/clear.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/getl/clear.ma index 2329dd98e..4ea8569d7 100644 --- a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/getl/clear.ma +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/getl/clear.ma @@ -107,3 +107,39 @@ in (eq_ind B b (\lambda (b1: B).(getl (S n) (CHead c0 (Bind b1) t) e2)) v))).(getl_flat c0 e2 (S n) (H e1 v (clear_gen_flat f c0 (CHead e1 (Bind b) v) t H2) e2 n H1) f t))]) H0))))))))))) c)). +theorem getl_clear_conf: + \forall (i: nat).(\forall (c1: C).(\forall (c3: C).((getl i c1 c3) \to +(\forall (c2: C).((clear c1 c2) \to (getl i c2 c3)))))) +\def + \lambda (i: nat).(nat_ind (\lambda (n: nat).(\forall (c1: C).(\forall (c3: +C).((getl n c1 c3) \to (\forall (c2: C).((clear c1 c2) \to (getl n c2 +c3))))))) (\lambda (c1: C).(\lambda (c3: C).(\lambda (H: (getl O c1 +c3)).(\lambda (c2: C).(\lambda (H0: (clear c1 c2)).(eq_ind C c3 (\lambda (c: +C).(getl O c c3)) (let H1 \def (clear_gen_all c1 c3 (getl_gen_O c1 c3 H)) in +(ex_3_ind B C T (\lambda (b: B).(\lambda (e: C).(\lambda (u: T).(eq C c3 +(CHead e (Bind b) u))))) (getl O c3 c3) (\lambda (x0: B).(\lambda (x1: +C).(\lambda (x2: T).(\lambda (H2: (eq C c3 (CHead x1 (Bind x0) x2))).(let H3 +\def (eq_ind C c3 (\lambda (c: C).(clear c1 c)) (getl_gen_O c1 c3 H) (CHead +x1 (Bind x0) x2) H2) in (eq_ind_r C (CHead x1 (Bind x0) x2) (\lambda (c: +C).(getl O c c)) (getl_refl x0 x1 x2) c3 H2)))))) H1)) c2 (clear_mono c1 c3 +(getl_gen_O c1 c3 H) c2 H0))))))) (\lambda (n: nat).(\lambda (_: ((\forall +(c1: C).(\forall (c3: C).((getl n c1 c3) \to (\forall (c2: C).((clear c1 c2) +\to (getl n c2 c3)))))))).(\lambda (c1: C).(C_ind (\lambda (c: C).(\forall +(c3: C).((getl (S n) c c3) \to (\forall (c2: C).((clear c c2) \to (getl (S n) +c2 c3)))))) (\lambda (n0: nat).(\lambda (c3: C).(\lambda (H0: (getl (S n) +(CSort n0) c3)).(\lambda (c2: C).(\lambda (_: (clear (CSort n0) +c2)).(getl_gen_sort n0 (S n) c3 H0 (getl (S n) c2 c3))))))) (\lambda (c: +C).(\lambda (H0: ((\forall (c3: C).((getl (S n) c c3) \to (\forall (c2: +C).((clear c c2) \to (getl (S n) c2 c3))))))).(\lambda (k: K).(\lambda (t: +T).(\lambda (c3: C).(\lambda (H1: (getl (S n) (CHead c k t) c3)).(\lambda +(c2: C).(\lambda (H2: (clear (CHead c k t) c2)).((match k in K return +(\lambda (k0: K).((getl (S n) (CHead c k0 t) c3) \to ((clear (CHead c k0 t) +c2) \to (getl (S n) c2 c3)))) with [(Bind b) \Rightarrow (\lambda (H3: (getl +(S n) (CHead c (Bind b) t) c3)).(\lambda (H4: (clear (CHead c (Bind b) t) +c2)).(eq_ind_r C (CHead c (Bind b) t) (\lambda (c0: C).(getl (S n) c0 c3)) +(getl_head (Bind b) n c c3 (getl_gen_S (Bind b) c c3 t n H3) t) c2 +(clear_gen_bind b c c2 t H4)))) | (Flat f) \Rightarrow (\lambda (H3: (getl (S +n) (CHead c (Flat f) t) c3)).(\lambda (H4: (clear (CHead c (Flat f) t) +c2)).(H0 c3 (getl_gen_S (Flat f) c c3 t n H3) c2 (clear_gen_flat f c c2 t +H4))))]) H1 H2))))))))) c1)))) i). + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/getl/drop.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/getl/drop.ma index 593ed87bb..bfd400420 100644 --- a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/getl/drop.ma +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/getl/drop.ma @@ -16,7 +16,7 @@ set "baseuri" "cic:/matita/LAMBDA-TYPES/Level-1/LambdaDelta/getl/drop". -include "getl/fwd.ma". +include "getl/props.ma". include "clear/drop.ma". @@ -64,3 +64,341 @@ n) O (CHead c0 k t) e)))).(\lambda (H1: (getl (S n) (CHead c0 k t) (CHead e nat).(drop n0 O c0 e)) (H e u (r k n) (getl_gen_S k c0 (CHead e (Bind b) u) t n H1)) (r k (S n)) (r_S k n)) t)))) h)))))))) c)). +theorem getl_drop_conf_lt: + \forall (b: B).(\forall (c: C).(\forall (c0: C).(\forall (u: T).(\forall (i: +nat).((getl i c (CHead c0 (Bind b) u)) \to (\forall (e: C).(\forall (h: +nat).(\forall (d: nat).((drop h (S (plus i d)) c e) \to (ex3_2 T C (\lambda +(v: T).(\lambda (_: C).(eq T u (lift h d v)))) (\lambda (v: T).(\lambda (e0: +C).(getl i e (CHead e0 (Bind b) v)))) (\lambda (_: T).(\lambda (e0: C).(drop +h d c0 e0))))))))))))) +\def + \lambda (b: B).(\lambda (c: C).(C_ind (\lambda (c0: C).(\forall (c1: +C).(\forall (u: T).(\forall (i: nat).((getl i c0 (CHead c1 (Bind b) u)) \to +(\forall (e: C).(\forall (h: nat).(\forall (d: nat).((drop h (S (plus i d)) +c0 e) \to (ex3_2 T C (\lambda (v: T).(\lambda (_: C).(eq T u (lift h d v)))) +(\lambda (v: T).(\lambda (e0: C).(getl i e (CHead e0 (Bind b) v)))) (\lambda +(_: T).(\lambda (e0: C).(drop h d c1 e0))))))))))))) (\lambda (n: +nat).(\lambda (c0: C).(\lambda (u: T).(\lambda (i: nat).(\lambda (H: (getl i +(CSort n) (CHead c0 (Bind b) u))).(\lambda (e: C).(\lambda (h: nat).(\lambda +(d: nat).(\lambda (_: (drop h (S (plus i d)) (CSort n) e)).(getl_gen_sort n i +(CHead c0 (Bind b) u) H (ex3_2 T C (\lambda (v: T).(\lambda (_: C).(eq T u +(lift h d v)))) (\lambda (v: T).(\lambda (e0: C).(getl i e (CHead e0 (Bind b) +v)))) (\lambda (_: T).(\lambda (e0: C).(drop h d c0 e0)))))))))))))) (\lambda +(c0: C).(\lambda (H: ((\forall (c1: C).(\forall (u: T).(\forall (i: +nat).((getl i c0 (CHead c1 (Bind b) u)) \to (\forall (e: C).(\forall (h: +nat).(\forall (d: nat).((drop h (S (plus i d)) c0 e) \to (ex3_2 T C (\lambda +(v: T).(\lambda (_: C).(eq T u (lift h d v)))) (\lambda (v: T).(\lambda (e0: +C).(getl i e (CHead e0 (Bind b) v)))) (\lambda (_: T).(\lambda (e0: C).(drop +h d c1 e0)))))))))))))).(\lambda (k: K).(\lambda (t: T).(\lambda (c1: +C).(\lambda (u: T).(\lambda (i: nat).(\lambda (H0: (getl i (CHead c0 k t) +(CHead c1 (Bind b) u))).(\lambda (e: C).(\lambda (h: nat).(\lambda (d: +nat).(\lambda (H1: (drop h (S (plus i d)) (CHead c0 k t) e)).(let H2 \def +(getl_gen_all (CHead c0 k t) (CHead c1 (Bind b) u) i H0) in (ex2_ind C +(\lambda (e0: C).(drop i O (CHead c0 k t) e0)) (\lambda (e0: C).(clear e0 +(CHead c1 (Bind b) u))) (ex3_2 T C (\lambda (v: T).(\lambda (_: C).(eq T u +(lift h d v)))) (\lambda (v: T).(\lambda (e0: C).(getl i e (CHead e0 (Bind b) +v)))) (\lambda (_: T).(\lambda (e0: C).(drop h d c1 e0)))) (\lambda (x: +C).(\lambda (H3: (drop i O (CHead c0 k t) x)).(\lambda (H4: (clear x (CHead +c1 (Bind b) u))).((match x in C return (\lambda (c2: C).((drop i O (CHead c0 +k t) c2) \to ((clear c2 (CHead c1 (Bind b) u)) \to (ex3_2 T C (\lambda (v: +T).(\lambda (_: C).(eq T u (lift h d v)))) (\lambda (v: T).(\lambda (e0: +C).(getl i e (CHead e0 (Bind b) v)))) (\lambda (_: T).(\lambda (e0: C).(drop +h d c1 e0))))))) with [(CSort n) \Rightarrow (\lambda (_: (drop i O (CHead c0 +k t) (CSort n))).(\lambda (H6: (clear (CSort n) (CHead c1 (Bind b) +u))).(clear_gen_sort (CHead c1 (Bind b) u) n H6 (ex3_2 T C (\lambda (v: +T).(\lambda (_: C).(eq T u (lift h d v)))) (\lambda (v: T).(\lambda (e0: +C).(getl i e (CHead e0 (Bind b) v)))) (\lambda (_: T).(\lambda (e0: C).(drop +h d c1 e0))))))) | (CHead c2 k0 t0) \Rightarrow (\lambda (H5: (drop i O +(CHead c0 k t) (CHead c2 k0 t0))).(\lambda (H6: (clear (CHead c2 k0 t0) +(CHead c1 (Bind b) u))).((match k0 in K return (\lambda (k1: K).((drop i O +(CHead c0 k t) (CHead c2 k1 t0)) \to ((clear (CHead c2 k1 t0) (CHead c1 (Bind +b) u)) \to (ex3_2 T C (\lambda (v: T).(\lambda (_: C).(eq T u (lift h d v)))) +(\lambda (v: T).(\lambda (e0: C).(getl i e (CHead e0 (Bind b) v)))) (\lambda +(_: T).(\lambda (e0: C).(drop h d c1 e0))))))) with [(Bind b0) \Rightarrow +(\lambda (H7: (drop i O (CHead c0 k t) (CHead c2 (Bind b0) t0))).(\lambda +(H8: (clear (CHead c2 (Bind b0) t0) (CHead c1 (Bind b) u))).(let H9 \def +(f_equal C C (\lambda (e0: C).(match e0 in C return (\lambda (_: C).C) with +[(CSort _) \Rightarrow c1 | (CHead c _ _) \Rightarrow c])) (CHead c1 (Bind b) +u) (CHead c2 (Bind b0) t0) (clear_gen_bind b0 c2 (CHead c1 (Bind b) u) t0 +H8)) in ((let H10 \def (f_equal C B (\lambda (e0: C).(match e0 in C return +(\lambda (_: C).B) with [(CSort _) \Rightarrow b | (CHead _ k _) \Rightarrow +(match k in K return (\lambda (_: K).B) with [(Bind b) \Rightarrow b | (Flat +_) \Rightarrow b])])) (CHead c1 (Bind b) u) (CHead c2 (Bind b0) t0) +(clear_gen_bind b0 c2 (CHead c1 (Bind b) u) t0 H8)) in ((let H11 \def +(f_equal C T (\lambda (e0: C).(match e0 in C return (\lambda (_: C).T) with +[(CSort _) \Rightarrow u | (CHead _ _ t) \Rightarrow t])) (CHead c1 (Bind b) +u) (CHead c2 (Bind b0) t0) (clear_gen_bind b0 c2 (CHead c1 (Bind b) u) t0 +H8)) in (\lambda (H12: (eq B b b0)).(\lambda (H13: (eq C c1 c2)).(let H14 +\def (eq_ind_r T t0 (\lambda (t0: T).(drop i O (CHead c0 k t) (CHead c2 (Bind +b0) t0))) H7 u H11) in (let H15 \def (eq_ind_r B b0 (\lambda (b: B).(drop i O +(CHead c0 k t) (CHead c2 (Bind b) u))) H14 b H12) in (let H16 \def (eq_ind_r +C c2 (\lambda (c: C).(drop i O (CHead c0 k t) (CHead c (Bind b) u))) H15 c1 +H13) in (ex3_2_ind T C (\lambda (v: T).(\lambda (_: C).(eq T u (lift h (r +(Bind b) d) v)))) (\lambda (v: T).(\lambda (e0: C).(drop i O e (CHead e0 +(Bind b) v)))) (\lambda (_: T).(\lambda (e0: C).(drop h (r (Bind b) d) c1 +e0))) (ex3_2 T C (\lambda (v: T).(\lambda (_: C).(eq T u (lift h d v)))) +(\lambda (v: T).(\lambda (e0: C).(getl i e (CHead e0 (Bind b) v)))) (\lambda +(_: T).(\lambda (e0: C).(drop h d c1 e0)))) (\lambda (x0: T).(\lambda (x1: +C).(\lambda (H17: (eq T u (lift h (r (Bind b) d) x0))).(\lambda (H18: (drop i +O e (CHead x1 (Bind b) x0))).(\lambda (H19: (drop h (r (Bind b) d) c1 +x1)).(eq_ind_r T (lift h (r (Bind b) d) x0) (\lambda (t1: T).(ex3_2 T C +(\lambda (v: T).(\lambda (_: C).(eq T t1 (lift h d v)))) (\lambda (v: +T).(\lambda (e0: C).(getl i e (CHead e0 (Bind b) v)))) (\lambda (_: +T).(\lambda (e0: C).(drop h d c1 e0))))) (ex3_2_intro T C (\lambda (v: +T).(\lambda (_: C).(eq T (lift h (r (Bind b) d) x0) (lift h d v)))) (\lambda +(v: T).(\lambda (e0: C).(getl i e (CHead e0 (Bind b) v)))) (\lambda (_: +T).(\lambda (e0: C).(drop h d c1 e0))) x0 x1 (refl_equal T (lift h d x0)) +(getl_intro i e (CHead x1 (Bind b) x0) (CHead x1 (Bind b) x0) H18 (clear_bind +b x1 x0)) H19) u H17)))))) (drop_conf_lt (Bind b) i u c1 (CHead c0 k t) H16 e +h d H1)))))))) H10)) H9)))) | (Flat f) \Rightarrow (\lambda (H7: (drop i O +(CHead c0 k t) (CHead c2 (Flat f) t0))).(\lambda (H8: (clear (CHead c2 (Flat +f) t0) (CHead c1 (Bind b) u))).((match i in nat return (\lambda (n: +nat).((drop h (S (plus n d)) (CHead c0 k t) e) \to ((drop n O (CHead c0 k t) +(CHead c2 (Flat f) t0)) \to (ex3_2 T C (\lambda (v: T).(\lambda (_: C).(eq T +u (lift h d v)))) (\lambda (v: T).(\lambda (e0: C).(getl n e (CHead e0 (Bind +b) v)))) (\lambda (_: T).(\lambda (e0: C).(drop h d c1 e0))))))) with [O +\Rightarrow (\lambda (H9: (drop h (S (plus O d)) (CHead c0 k t) e)).(\lambda +(H10: (drop O O (CHead c0 k t) (CHead c2 (Flat f) t0))).(let H11 \def +(f_equal C C (\lambda (e0: C).(match e0 in C return (\lambda (_: C).C) with +[(CSort _) \Rightarrow c0 | (CHead c _ _) \Rightarrow c])) (CHead c0 k t) +(CHead c2 (Flat f) t0) (drop_gen_refl (CHead c0 k t) (CHead c2 (Flat f) t0) +H10)) in ((let H12 \def (f_equal C K (\lambda (e0: C).(match e0 in C return +(\lambda (_: C).K) with [(CSort _) \Rightarrow k | (CHead _ k _) \Rightarrow +k])) (CHead c0 k t) (CHead c2 (Flat f) t0) (drop_gen_refl (CHead c0 k t) +(CHead c2 (Flat f) t0) H10)) in ((let H13 \def (f_equal C T (\lambda (e0: +C).(match e0 in C return (\lambda (_: C).T) with [(CSort _) \Rightarrow t | +(CHead _ _ t) \Rightarrow t])) (CHead c0 k t) (CHead c2 (Flat f) t0) +(drop_gen_refl (CHead c0 k t) (CHead c2 (Flat f) t0) H10)) in (\lambda (H14: +(eq K k (Flat f))).(\lambda (H15: (eq C c0 c2)).(let H16 \def (eq_ind_r C c2 +(\lambda (c: C).(clear c (CHead c1 (Bind b) u))) (clear_gen_flat f c2 (CHead +c1 (Bind b) u) t0 H8) c0 H15) in (let H17 \def (eq_ind K k (\lambda (k: +K).(drop h (S (plus O d)) (CHead c0 k t) e)) H9 (Flat f) H14) in (ex3_2_ind C +T (\lambda (e0: C).(\lambda (v: T).(eq C e (CHead e0 (Flat f) v)))) (\lambda +(_: C).(\lambda (v: T).(eq T t (lift h (r (Flat f) (plus O d)) v)))) (\lambda +(e0: C).(\lambda (_: T).(drop h (r (Flat f) (plus O d)) c0 e0))) (ex3_2 T C +(\lambda (v: T).(\lambda (_: C).(eq T u (lift h d v)))) (\lambda (v: +T).(\lambda (e0: C).(getl O e (CHead e0 (Bind b) v)))) (\lambda (_: +T).(\lambda (e0: C).(drop h d c1 e0)))) (\lambda (x0: C).(\lambda (x1: +T).(\lambda (H18: (eq C e (CHead x0 (Flat f) x1))).(\lambda (H19: (eq T t +(lift h (r (Flat f) (plus O d)) x1))).(\lambda (H20: (drop h (r (Flat f) +(plus O d)) c0 x0)).(let H21 \def (f_equal T T (\lambda (e0: T).e0) t (lift h +(r (Flat f) (plus O d)) x1) H19) in (eq_ind_r C (CHead x0 (Flat f) x1) +(\lambda (c3: C).(ex3_2 T C (\lambda (v: T).(\lambda (_: C).(eq T u (lift h d +v)))) (\lambda (v: T).(\lambda (e0: C).(getl O c3 (CHead e0 (Bind b) v)))) +(\lambda (_: T).(\lambda (e0: C).(drop h d c1 e0))))) (let H22 \def (H c1 u O +(getl_intro O c0 (CHead c1 (Bind b) u) c0 (drop_refl c0) H16) x0 h d H20) in +(ex3_2_ind T C (\lambda (v: T).(\lambda (_: C).(eq T u (lift h d v)))) +(\lambda (v: T).(\lambda (e0: C).(getl O x0 (CHead e0 (Bind b) v)))) (\lambda +(_: T).(\lambda (e0: C).(drop h d c1 e0))) (ex3_2 T C (\lambda (v: +T).(\lambda (_: C).(eq T u (lift h d v)))) (\lambda (v: T).(\lambda (e0: +C).(getl O (CHead x0 (Flat f) x1) (CHead e0 (Bind b) v)))) (\lambda (_: +T).(\lambda (e0: C).(drop h d c1 e0)))) (\lambda (x2: T).(\lambda (x3: +C).(\lambda (H23: (eq T u (lift h d x2))).(\lambda (H24: (getl O x0 (CHead x3 +(Bind b) x2))).(\lambda (H25: (drop h d c1 x3)).(let H26 \def (eq_ind T u +(\lambda (t: T).(clear c0 (CHead c1 (Bind b) t))) H16 (lift h d x2) H23) in +(eq_ind_r T (lift h d x2) (\lambda (t1: T).(ex3_2 T C (\lambda (v: +T).(\lambda (_: C).(eq T t1 (lift h d v)))) (\lambda (v: T).(\lambda (e0: +C).(getl O (CHead x0 (Flat f) x1) (CHead e0 (Bind b) v)))) (\lambda (_: +T).(\lambda (e0: C).(drop h d c1 e0))))) (ex3_2_intro T C (\lambda (v: +T).(\lambda (_: C).(eq T (lift h d x2) (lift h d v)))) (\lambda (v: +T).(\lambda (e0: C).(getl O (CHead x0 (Flat f) x1) (CHead e0 (Bind b) v)))) +(\lambda (_: T).(\lambda (e0: C).(drop h d c1 e0))) x2 x3 (refl_equal T (lift +h d x2)) (getl_flat x0 (CHead x3 (Bind b) x2) O H24 f x1) H25) u H23))))))) +H22)) e H18))))))) (drop_gen_skip_l c0 e t h (plus O d) (Flat f) H17))))))) +H12)) H11)))) | (S n) \Rightarrow (\lambda (H9: (drop h (S (plus (S n) d)) +(CHead c0 k t) e)).(\lambda (H10: (drop (S n) O (CHead c0 k t) (CHead c2 +(Flat f) t0))).(ex3_2_ind C T (\lambda (e0: C).(\lambda (v: T).(eq C e (CHead +e0 k v)))) (\lambda (_: C).(\lambda (v: T).(eq T t (lift h (r k (plus (S n) +d)) v)))) (\lambda (e0: C).(\lambda (_: T).(drop h (r k (plus (S n) d)) c0 +e0))) (ex3_2 T C (\lambda (v: T).(\lambda (_: C).(eq T u (lift h d v)))) +(\lambda (v: T).(\lambda (e0: C).(getl (S n) e (CHead e0 (Bind b) v)))) +(\lambda (_: T).(\lambda (e0: C).(drop h d c1 e0)))) (\lambda (x0: +C).(\lambda (x1: T).(\lambda (H11: (eq C e (CHead x0 k x1))).(\lambda (H12: +(eq T t (lift h (r k (plus (S n) d)) x1))).(\lambda (H13: (drop h (r k (plus +(S n) d)) c0 x0)).(let H14 \def (f_equal T T (\lambda (e0: T).e0) t (lift h +(r k (plus (S n) d)) x1) H12) in (eq_ind_r C (CHead x0 k x1) (\lambda (c3: +C).(ex3_2 T C (\lambda (v: T).(\lambda (_: C).(eq T u (lift h d v)))) +(\lambda (v: T).(\lambda (e0: C).(getl (S n) c3 (CHead e0 (Bind b) v)))) +(\lambda (_: T).(\lambda (e0: C).(drop h d c1 e0))))) (let H15 \def (eq_ind +nat (r k (plus (S n) d)) (\lambda (n: nat).(drop h n c0 x0)) H13 (plus (r k +(S n)) d) (r_plus k (S n) d)) in (let H16 \def (eq_ind nat (r k (S n)) +(\lambda (n: nat).(drop h (plus n d) c0 x0)) H15 (S (r k n)) (r_S k n)) in +(let H17 \def (H c1 u (r k n) (getl_intro (r k n) c0 (CHead c1 (Bind b) u) +(CHead c2 (Flat f) t0) (drop_gen_drop k c0 (CHead c2 (Flat f) t0) t n H10) +(clear_flat c2 (CHead c1 (Bind b) u) (clear_gen_flat f c2 (CHead c1 (Bind b) +u) t0 H8) f t0)) x0 h d H16) in (ex3_2_ind T C (\lambda (v: T).(\lambda (_: +C).(eq T u (lift h d v)))) (\lambda (v: T).(\lambda (e0: C).(getl (r k n) x0 +(CHead e0 (Bind b) v)))) (\lambda (_: T).(\lambda (e0: C).(drop h d c1 e0))) +(ex3_2 T C (\lambda (v: T).(\lambda (_: C).(eq T u (lift h d v)))) (\lambda +(v: T).(\lambda (e0: C).(getl (S n) (CHead x0 k x1) (CHead e0 (Bind b) v)))) +(\lambda (_: T).(\lambda (e0: C).(drop h d c1 e0)))) (\lambda (x2: +T).(\lambda (x3: C).(\lambda (H18: (eq T u (lift h d x2))).(\lambda (H19: +(getl (r k n) x0 (CHead x3 (Bind b) x2))).(\lambda (H20: (drop h d c1 +x3)).(let H21 \def (eq_ind T u (\lambda (t: T).(clear c2 (CHead c1 (Bind b) +t))) (clear_gen_flat f c2 (CHead c1 (Bind b) u) t0 H8) (lift h d x2) H18) in +(eq_ind_r T (lift h d x2) (\lambda (t1: T).(ex3_2 T C (\lambda (v: +T).(\lambda (_: C).(eq T t1 (lift h d v)))) (\lambda (v: T).(\lambda (e0: +C).(getl (S n) (CHead x0 k x1) (CHead e0 (Bind b) v)))) (\lambda (_: +T).(\lambda (e0: C).(drop h d c1 e0))))) (ex3_2_intro T C (\lambda (v: +T).(\lambda (_: C).(eq T (lift h d x2) (lift h d v)))) (\lambda (v: +T).(\lambda (e0: C).(getl (S n) (CHead x0 k x1) (CHead e0 (Bind b) v)))) +(\lambda (_: T).(\lambda (e0: C).(drop h d c1 e0))) x2 x3 (refl_equal T (lift +h d x2)) (getl_head k n x0 (CHead x3 (Bind b) x2) H19 x1) H20) u H18))))))) +H17)))) e H11))))))) (drop_gen_skip_l c0 e t h (plus (S n) d) k H9))))]) H1 +H7)))]) H5 H6)))]) H3 H4)))) H2)))))))))))))) c)). + +theorem getl_drop_conf_ge: + \forall (i: nat).(\forall (a: C).(\forall (c: C).((getl i c a) \to (\forall +(e: C).(\forall (h: nat).(\forall (d: nat).((drop h d c e) \to ((le (plus d +h) i) \to (getl (minus i h) e a))))))))) +\def + \lambda (i: nat).(\lambda (a: C).(\lambda (c: C).(\lambda (H: (getl i c +a)).(\lambda (e: C).(\lambda (h: nat).(\lambda (d: nat).(\lambda (H0: (drop h +d c e)).(\lambda (H1: (le (plus d h) i)).(let H2 \def (getl_gen_all c a i H) +in (ex2_ind C (\lambda (e0: C).(drop i O c e0)) (\lambda (e0: C).(clear e0 +a)) (getl (minus i h) e a) (\lambda (x: C).(\lambda (H3: (drop i O c +x)).(\lambda (H4: (clear x a)).(getl_intro (minus i h) e a x (drop_conf_ge i +x c H3 e h d H0 H1) H4)))) H2)))))))))). + +theorem getl_conf_ge_drop: + \forall (b: B).(\forall (c1: C).(\forall (e: C).(\forall (u: T).(\forall (i: +nat).((getl i c1 (CHead e (Bind b) u)) \to (\forall (c2: C).((drop (S O) i c1 +c2) \to (drop i O c2 e)))))))) +\def + \lambda (b: B).(\lambda (c1: C).(\lambda (e: C).(\lambda (u: T).(\lambda (i: +nat).(\lambda (H: (getl i c1 (CHead e (Bind b) u))).(\lambda (c2: C).(\lambda +(H0: (drop (S O) i c1 c2)).(let H3 \def (eq_ind nat (minus (S i) (S O)) +(\lambda (n: nat).(drop n O c2 e)) (drop_conf_ge (S i) e c1 (getl_drop b c1 e +u i H) c2 (S O) i H0 (eq_ind_r nat (plus (S O) i) (\lambda (n: nat).(le n (S +i))) (le_n (S i)) (plus i (S O)) (plus_comm i (S O)))) i (minus_Sx_SO i)) in +H3)))))))). + +theorem getl_drop_conf_rev: + \forall (j: nat).(\forall (e1: C).(\forall (e2: C).((drop j O e1 e2) \to +(\forall (b: B).(\forall (c2: C).(\forall (v2: T).(\forall (i: nat).((getl i +c2 (CHead e2 (Bind b) v2)) \to (ex2 C (\lambda (c1: C).(drop j O c1 c2)) +(\lambda (c1: C).(drop (S i) j c1 e1))))))))))) +\def + \lambda (j: nat).(\lambda (e1: C).(\lambda (e2: C).(\lambda (H: (drop j O e1 +e2)).(\lambda (b: B).(\lambda (c2: C).(\lambda (v2: T).(\lambda (i: +nat).(\lambda (H0: (getl i c2 (CHead e2 (Bind b) v2))).(drop_conf_rev j e1 e2 +H c2 (S i) (getl_drop b c2 e2 v2 i H0)))))))))). + +theorem drop_getl_trans_lt: + \forall (i: nat).(\forall (d: nat).((lt i d) \to (\forall (c1: C).(\forall +(c2: C).(\forall (h: nat).((drop h d c1 c2) \to (\forall (b: B).(\forall (e2: +C).(\forall (v: T).((getl i c2 (CHead e2 (Bind b) v)) \to (ex2 C (\lambda +(e1: C).(getl i c1 (CHead e1 (Bind b) (lift h (minus d (S i)) v)))) (\lambda +(e1: C).(drop h (minus d (S i)) e1 e2))))))))))))) +\def + \lambda (i: nat).(\lambda (d: nat).(\lambda (H: (lt i d)).(\lambda (c1: +C).(\lambda (c2: C).(\lambda (h: nat).(\lambda (H0: (drop h d c1 +c2)).(\lambda (b: B).(\lambda (e2: C).(\lambda (v: T).(\lambda (H1: (getl i +c2 (CHead e2 (Bind b) v))).(let H2 \def (getl_gen_all c2 (CHead e2 (Bind b) +v) i H1) in (ex2_ind C (\lambda (e: C).(drop i O c2 e)) (\lambda (e: +C).(clear e (CHead e2 (Bind b) v))) (ex2 C (\lambda (e1: C).(getl i c1 (CHead +e1 (Bind b) (lift h (minus d (S i)) v)))) (\lambda (e1: C).(drop h (minus d +(S i)) e1 e2))) (\lambda (x: C).(\lambda (H3: (drop i O c2 x)).(\lambda (H4: +(clear x (CHead e2 (Bind b) v))).(ex2_ind C (\lambda (e1: C).(drop i O c1 +e1)) (\lambda (e1: C).(drop h (minus d i) e1 x)) (ex2 C (\lambda (e1: +C).(getl i c1 (CHead e1 (Bind b) (lift h (minus d (S i)) v)))) (\lambda (e1: +C).(drop h (minus d (S i)) e1 e2))) (\lambda (x0: C).(\lambda (H5: (drop i O +c1 x0)).(\lambda (H6: (drop h (minus d i) x0 x)).(let H7 \def (eq_ind nat +(minus d i) (\lambda (n: nat).(drop h n x0 x)) H6 (S (minus d (S i))) +(minus_x_Sy d i H)) in (let H8 \def (drop_clear_S x x0 h (minus d (S i)) H7 b +e2 v H4) in (ex2_ind C (\lambda (c3: C).(clear x0 (CHead c3 (Bind b) (lift h +(minus d (S i)) v)))) (\lambda (c3: C).(drop h (minus d (S i)) c3 e2)) (ex2 C +(\lambda (e1: C).(getl i c1 (CHead e1 (Bind b) (lift h (minus d (S i)) v)))) +(\lambda (e1: C).(drop h (minus d (S i)) e1 e2))) (\lambda (x1: C).(\lambda +(H9: (clear x0 (CHead x1 (Bind b) (lift h (minus d (S i)) v)))).(\lambda +(H10: (drop h (minus d (S i)) x1 e2)).(ex_intro2 C (\lambda (e1: C).(getl i +c1 (CHead e1 (Bind b) (lift h (minus d (S i)) v)))) (\lambda (e1: C).(drop h +(minus d (S i)) e1 e2)) x1 (getl_intro i c1 (CHead x1 (Bind b) (lift h (minus +d (S i)) v)) x0 H5 H9) H10)))) H8)))))) (drop_trans_le i d (le_S_n i d (le_S +(S i) d H)) c1 c2 h H0 x H3))))) H2)))))))))))). + +theorem drop_getl_trans_le: + \forall (i: nat).(\forall (d: nat).((le i d) \to (\forall (c1: C).(\forall +(c2: C).(\forall (h: nat).((drop h d c1 c2) \to (\forall (e2: C).((getl i c2 +e2) \to (ex3_2 C C (\lambda (e0: C).(\lambda (_: C).(drop i O c1 e0))) +(\lambda (e0: C).(\lambda (e1: C).(drop h (minus d i) e0 e1))) (\lambda (_: +C).(\lambda (e1: C).(clear e1 e2)))))))))))) +\def + \lambda (i: nat).(\lambda (d: nat).(\lambda (H: (le i d)).(\lambda (c1: +C).(\lambda (c2: C).(\lambda (h: nat).(\lambda (H0: (drop h d c1 +c2)).(\lambda (e2: C).(\lambda (H1: (getl i c2 e2)).(let H2 \def +(getl_gen_all c2 e2 i H1) in (ex2_ind C (\lambda (e: C).(drop i O c2 e)) +(\lambda (e: C).(clear e e2)) (ex3_2 C C (\lambda (e0: C).(\lambda (_: +C).(drop i O c1 e0))) (\lambda (e0: C).(\lambda (e1: C).(drop h (minus d i) +e0 e1))) (\lambda (_: C).(\lambda (e1: C).(clear e1 e2)))) (\lambda (x: +C).(\lambda (H3: (drop i O c2 x)).(\lambda (H4: (clear x e2)).(let H5 \def +(drop_trans_le i d H c1 c2 h H0 x H3) in (ex2_ind C (\lambda (e1: C).(drop i +O c1 e1)) (\lambda (e1: C).(drop h (minus d i) e1 x)) (ex3_2 C C (\lambda +(e0: C).(\lambda (_: C).(drop i O c1 e0))) (\lambda (e0: C).(\lambda (e1: +C).(drop h (minus d i) e0 e1))) (\lambda (_: C).(\lambda (e1: C).(clear e1 +e2)))) (\lambda (x0: C).(\lambda (H6: (drop i O c1 x0)).(\lambda (H7: (drop h +(minus d i) x0 x)).(ex3_2_intro C C (\lambda (e0: C).(\lambda (_: C).(drop i +O c1 e0))) (\lambda (e0: C).(\lambda (e1: C).(drop h (minus d i) e0 e1))) +(\lambda (_: C).(\lambda (e1: C).(clear e1 e2))) x0 x H6 H7 H4)))) H5))))) +H2)))))))))). + +theorem drop_getl_trans_ge: + \forall (i: nat).(\forall (c1: C).(\forall (c2: C).(\forall (d: +nat).(\forall (h: nat).((drop h d c1 c2) \to (\forall (e2: C).((getl i c2 e2) +\to ((le d i) \to (getl (plus i h) c1 e2))))))))) +\def + \lambda (i: nat).(\lambda (c1: C).(\lambda (c2: C).(\lambda (d: +nat).(\lambda (h: nat).(\lambda (H: (drop h d c1 c2)).(\lambda (e2: +C).(\lambda (H0: (getl i c2 e2)).(\lambda (H1: (le d i)).(let H2 \def +(getl_gen_all c2 e2 i H0) in (ex2_ind C (\lambda (e: C).(drop i O c2 e)) +(\lambda (e: C).(clear e e2)) (getl (plus i h) c1 e2) (\lambda (x: +C).(\lambda (H3: (drop i O c2 x)).(\lambda (H4: (clear x e2)).(getl_intro +(plus i h) c1 e2 x (drop_trans_ge i c1 c2 d h H x H3 H1) H4)))) H2)))))))))). + +theorem getl_drop_trans: + \forall (c1: C).(\forall (c2: C).(\forall (h: nat).((getl h c1 c2) \to +(\forall (e2: C).(\forall (i: nat).((drop (S i) O c2 e2) \to (drop (S (plus i +h)) O c1 e2))))))) +\def + \lambda (c1: C).(C_ind (\lambda (c: C).(\forall (c2: C).(\forall (h: +nat).((getl h c c2) \to (\forall (e2: C).(\forall (i: nat).((drop (S i) O c2 +e2) \to (drop (S (plus i h)) O c e2)))))))) (\lambda (n: nat).(\lambda (c2: +C).(\lambda (h: nat).(\lambda (H: (getl h (CSort n) c2)).(\lambda (e2: +C).(\lambda (i: nat).(\lambda (_: (drop (S i) O c2 e2)).(getl_gen_sort n h c2 +H (drop (S (plus i h)) O (CSort n) e2))))))))) (\lambda (c2: C).(\lambda +(IHc: ((\forall (c3: C).(\forall (h: nat).((getl h c2 c3) \to (\forall (e2: +C).(\forall (i: nat).((drop (S i) O c3 e2) \to (drop (S (plus i h)) O c2 +e2))))))))).(\lambda (k: K).(K_ind (\lambda (k0: K).(\forall (t: T).(\forall +(c3: C).(\forall (h: nat).((getl h (CHead c2 k0 t) c3) \to (\forall (e2: +C).(\forall (i: nat).((drop (S i) O c3 e2) \to (drop (S (plus i h)) O (CHead +c2 k0 t) e2))))))))) (\lambda (b: B).(\lambda (t: T).(\lambda (c3: +C).(\lambda (h: nat).(nat_ind (\lambda (n: nat).((getl n (CHead c2 (Bind b) +t) c3) \to (\forall (e2: C).(\forall (i: nat).((drop (S i) O c3 e2) \to (drop +(S (plus i n)) O (CHead c2 (Bind b) t) e2)))))) (\lambda (H: (getl O (CHead +c2 (Bind b) t) c3)).(\lambda (e2: C).(\lambda (i: nat).(\lambda (H0: (drop (S +i) O c3 e2)).(let H1 \def (eq_ind C c3 (\lambda (c: C).(drop (S i) O c e2)) +H0 (CHead c2 (Bind b) t) (clear_gen_bind b c2 c3 t (getl_gen_O (CHead c2 +(Bind b) t) c3 H))) in (eq_ind nat i (\lambda (n: nat).(drop (S n) O (CHead +c2 (Bind b) t) e2)) (drop_drop (Bind b) i c2 e2 (drop_gen_drop (Bind b) c2 e2 +t i H1) t) (plus i O) (plus_n_O i))))))) (\lambda (n: nat).(\lambda (_: +(((getl n (CHead c2 (Bind b) t) c3) \to (\forall (e2: C).(\forall (i: +nat).((drop (S i) O c3 e2) \to (drop (S (plus i n)) O (CHead c2 (Bind b) t) +e2))))))).(\lambda (H0: (getl (S n) (CHead c2 (Bind b) t) c3)).(\lambda (e2: +C).(\lambda (i: nat).(\lambda (H1: (drop (S i) O c3 e2)).(eq_ind nat (plus (S +i) n) (\lambda (n0: nat).(drop (S n0) O (CHead c2 (Bind b) t) e2)) (drop_drop +(Bind b) (plus (S i) n) c2 e2 (IHc c3 n (getl_gen_S (Bind b) c2 c3 t n H0) e2 +i H1) t) (plus i (S n)) (plus_Snm_nSm i n)))))))) h))))) (\lambda (f: +F).(\lambda (t: T).(\lambda (c3: C).(\lambda (h: nat).(nat_ind (\lambda (n: +nat).((getl n (CHead c2 (Flat f) t) c3) \to (\forall (e2: C).(\forall (i: +nat).((drop (S i) O c3 e2) \to (drop (S (plus i n)) O (CHead c2 (Flat f) t) +e2)))))) (\lambda (H: (getl O (CHead c2 (Flat f) t) c3)).(\lambda (e2: +C).(\lambda (i: nat).(\lambda (H0: (drop (S i) O c3 e2)).(drop_drop (Flat f) +(plus i O) c2 e2 (IHc c3 O (getl_intro O c2 c3 c2 (drop_refl c2) +(clear_gen_flat f c2 c3 t (getl_gen_O (CHead c2 (Flat f) t) c3 H))) e2 i H0) +t))))) (\lambda (n: nat).(\lambda (_: (((getl n (CHead c2 (Flat f) t) c3) \to +(\forall (e2: C).(\forall (i: nat).((drop (S i) O c3 e2) \to (drop (S (plus i +n)) O (CHead c2 (Flat f) t) e2))))))).(\lambda (H0: (getl (S n) (CHead c2 +(Flat f) t) c3)).(\lambda (e2: C).(\lambda (i: nat).(\lambda (H1: (drop (S i) +O c3 e2)).(drop_drop (Flat f) (plus i (S n)) c2 e2 (IHc c3 (S n) (getl_gen_S +(Flat f) c2 c3 t n H0) e2 i H1) t))))))) h))))) k)))) c1). + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/getl/getl.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/getl/getl.ma new file mode 100644 index 000000000..05749f811 --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/getl/getl.ma @@ -0,0 +1,52 @@ +(**************************************************************************) +(* ___ *) +(* ||M|| *) +(* ||A|| A project by Andrea Asperti *) +(* ||T|| *) +(* ||I|| Developers: *) +(* ||T|| The HELM team. *) +(* ||A|| http://helm.cs.unibo.it *) +(* \ / *) +(* \ / This file is distributed under the terms of the *) +(* v GNU General Public License Version 2 *) +(* *) +(**************************************************************************) + +(* This file was automatically generated: do not edit *********************) + +set "baseuri" "cic:/matita/LAMBDA-TYPES/Level-1/LambdaDelta/getl/getl". + +include "getl/drop.ma". + +include "getl/clear.ma". + +theorem getl_conf_le: + \forall (i: nat).(\forall (a: C).(\forall (c: C).((getl i c a) \to (\forall +(e: C).(\forall (h: nat).((getl h c e) \to ((le h i) \to (getl (minus i h) e +a)))))))) +\def + \lambda (i: nat).(\lambda (a: C).(\lambda (c: C).(\lambda (H: (getl i c +a)).(\lambda (e: C).(\lambda (h: nat).(\lambda (H0: (getl h c e)).(\lambda +(H1: (le h i)).(let H2 \def (getl_gen_all c e h H0) in (ex2_ind C (\lambda +(e0: C).(drop h O c e0)) (\lambda (e0: C).(clear e0 e)) (getl (minus i h) e +a) (\lambda (x: C).(\lambda (H3: (drop h O c x)).(\lambda (H4: (clear x +e)).(getl_clear_conf (minus i h) x a (getl_drop_conf_ge i a c H x h O H3 H1) +e H4)))) H2))))))))). + +theorem getl_trans: + \forall (i: nat).(\forall (c1: C).(\forall (c2: C).(\forall (h: nat).((getl +h c1 c2) \to (\forall (e2: C).((getl i c2 e2) \to (getl (plus i h) c1 +e2))))))) +\def + \lambda (i: nat).(\lambda (c1: C).(\lambda (c2: C).(\lambda (h: +nat).(\lambda (H: (getl h c1 c2)).(\lambda (e2: C).(\lambda (H0: (getl i c2 +e2)).(let H1 \def (getl_gen_all c2 e2 i H0) in (ex2_ind C (\lambda (e: +C).(drop i O c2 e)) (\lambda (e: C).(clear e e2)) (getl (plus i h) c1 e2) +(\lambda (x: C).(\lambda (H2: (drop i O c2 x)).(\lambda (H3: (clear x +e2)).((match i in nat return (\lambda (n: nat).((drop n O c2 x) \to (getl +(plus n h) c1 e2))) with [O \Rightarrow (\lambda (H4: (drop O O c2 x)).(let +H5 \def (eq_ind_r C x (\lambda (c: C).(clear c e2)) H3 c2 (drop_gen_refl c2 x +H4)) in (getl_clear_trans (plus O h) c1 c2 H e2 H5))) | (S n) \Rightarrow +(\lambda (H4: (drop (S n) O c2 x)).(let H_y \def (getl_drop_trans c1 c2 h H x +n H4) in (getl_intro (plus (S n) h) c1 e2 x H_y H3)))]) H2)))) H1)))))))). + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/getl/props.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/getl/props.ma index eb20484df..b93ced16d 100644 --- a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/getl/props.ma +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/getl/props.ma @@ -72,3 +72,20 @@ C).(\lambda (H1: (drop i O c x)).(\lambda (H2: (clear x (CHead d (Bind b) u))).(getl_intro i (CTail k v c) (CHead (CTail k v d) (Bind b) u) (CTail k v x) (drop_ctail c x O i H1 k v) (clear_ctail b x d u H2 k v))))) H0))))))))). +theorem getl_mono: + \forall (c: C).(\forall (x1: C).(\forall (h: nat).((getl h c x1) \to +(\forall (x2: C).((getl h c x2) \to (eq C x1 x2)))))) +\def + \lambda (c: C).(\lambda (x1: C).(\lambda (h: nat).(\lambda (H: (getl h c +x1)).(\lambda (x2: C).(\lambda (H0: (getl h c x2)).(let H1 \def (getl_gen_all +c x2 h H0) in (ex2_ind C (\lambda (e: C).(drop h O c e)) (\lambda (e: +C).(clear e x2)) (eq C x1 x2) (\lambda (x: C).(\lambda (H2: (drop h O c +x)).(\lambda (H3: (clear x x2)).(let H4 \def (getl_gen_all c x1 h H) in +(ex2_ind C (\lambda (e: C).(drop h O c e)) (\lambda (e: C).(clear e x1)) (eq +C x1 x2) (\lambda (x0: C).(\lambda (H5: (drop h O c x0)).(\lambda (H6: (clear +x0 x1)).(let H7 \def (eq_ind C x (\lambda (c0: C).(drop h O c c0)) H2 x0 +(drop_mono c x O h H2 x0 H5)) in (let H8 \def (eq_ind_r C x0 (\lambda (c0: +C).(drop h O c c0)) H7 x (drop_mono c x O h H2 x0 H5)) in (let H9 \def +(eq_ind_r C x0 (\lambda (c: C).(clear c x1)) H6 x (drop_mono c x O h H2 x0 +H5)) in (clear_mono x x1 H9 x2 H3))))))) H4))))) H1))))))). + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/subst0/dec.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/subst0/dec.ma new file mode 100644 index 000000000..9c8d7b237 --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/subst0/dec.ma @@ -0,0 +1,132 @@ +(**************************************************************************) +(* ___ *) +(* ||M|| *) +(* ||A|| A project by Andrea Asperti *) +(* ||T|| *) +(* ||I|| Developers: *) +(* ||T|| The HELM team. *) +(* ||A|| http://helm.cs.unibo.it *) +(* \ / *) +(* \ / This file is distributed under the terms of the *) +(* v GNU General Public License Version 2 *) +(* *) +(**************************************************************************) + +(* This file was automatically generated: do not edit *********************) + +set "baseuri" "cic:/matita/LAMBDA-TYPES/Level-1/LambdaDelta/subst0/dec". + +include "subst0/defs.ma". + +include "lift/props.ma". + +theorem dnf_dec: + \forall (w: T).(\forall (t: T).(\forall (d: nat).(ex T (\lambda (v: T).(or +(subst0 d w t (lift (S O) d v)) (eq T t (lift (S O) d v))))))) +\def + \lambda (w: T).(\lambda (t: T).(T_ind (\lambda (t0: T).(\forall (d: nat).(ex +T (\lambda (v: T).(or (subst0 d w t0 (lift (S O) d v)) (eq T t0 (lift (S O) d +v))))))) (\lambda (n: nat).(\lambda (d: nat).(ex_intro T (\lambda (v: T).(or +(subst0 d w (TSort n) (lift (S O) d v)) (eq T (TSort n) (lift (S O) d v)))) +(TSort n) (eq_ind_r T (TSort n) (\lambda (t0: T).(or (subst0 d w (TSort n) +t0) (eq T (TSort n) t0))) (or_intror (subst0 d w (TSort n) (TSort n)) (eq T +(TSort n) (TSort n)) (refl_equal T (TSort n))) (lift (S O) d (TSort n)) +(lift_sort n (S O) d))))) (\lambda (n: nat).(\lambda (d: nat).(lt_eq_gt_e n d +(ex T (\lambda (v: T).(or (subst0 d w (TLRef n) (lift (S O) d v)) (eq T +(TLRef n) (lift (S O) d v))))) (\lambda (H: (lt n d)).(ex_intro T (\lambda +(v: T).(or (subst0 d w (TLRef n) (lift (S O) d v)) (eq T (TLRef n) (lift (S +O) d v)))) (TLRef n) (eq_ind_r T (TLRef n) (\lambda (t0: T).(or (subst0 d w +(TLRef n) t0) (eq T (TLRef n) t0))) (or_intror (subst0 d w (TLRef n) (TLRef +n)) (eq T (TLRef n) (TLRef n)) (refl_equal T (TLRef n))) (lift (S O) d (TLRef +n)) (lift_lref_lt n (S O) d H)))) (\lambda (H: (eq nat n d)).(eq_ind nat n +(\lambda (n0: nat).(ex T (\lambda (v: T).(or (subst0 n0 w (TLRef n) (lift (S +O) n0 v)) (eq T (TLRef n) (lift (S O) n0 v)))))) (ex_intro T (\lambda (v: +T).(or (subst0 n w (TLRef n) (lift (S O) n v)) (eq T (TLRef n) (lift (S O) n +v)))) (lift n O w) (eq_ind_r T (lift (plus (S O) n) O w) (\lambda (t0: T).(or +(subst0 n w (TLRef n) t0) (eq T (TLRef n) t0))) (or_introl (subst0 n w (TLRef +n) (lift (S n) O w)) (eq T (TLRef n) (lift (S n) O w)) (subst0_lref w n)) +(lift (S O) n (lift n O w)) (lift_free w n (S O) O n (le_n (plus O n)) +(le_O_n n)))) d H)) (\lambda (H: (lt d n)).(ex_intro T (\lambda (v: T).(or +(subst0 d w (TLRef n) (lift (S O) d v)) (eq T (TLRef n) (lift (S O) d v)))) +(TLRef (pred n)) (eq_ind_r T (TLRef n) (\lambda (t0: T).(or (subst0 d w +(TLRef n) t0) (eq T (TLRef n) t0))) (or_intror (subst0 d w (TLRef n) (TLRef +n)) (eq T (TLRef n) (TLRef n)) (refl_equal T (TLRef n))) (lift (S O) d (TLRef +(pred n))) (lift_lref_gt d n H))))))) (\lambda (k: K).(\lambda (t0: +T).(\lambda (H: ((\forall (d: nat).(ex T (\lambda (v: T).(or (subst0 d w t0 +(lift (S O) d v)) (eq T t0 (lift (S O) d v)))))))).(\lambda (t1: T).(\lambda +(H0: ((\forall (d: nat).(ex T (\lambda (v: T).(or (subst0 d w t1 (lift (S O) +d v)) (eq T t1 (lift (S O) d v)))))))).(\lambda (d: nat).(let H_x \def (H d) +in (let H1 \def H_x in (ex_ind T (\lambda (v: T).(or (subst0 d w t0 (lift (S +O) d v)) (eq T t0 (lift (S O) d v)))) (ex T (\lambda (v: T).(or (subst0 d w +(THead k t0 t1) (lift (S O) d v)) (eq T (THead k t0 t1) (lift (S O) d v))))) +(\lambda (x: T).(\lambda (H2: (or (subst0 d w t0 (lift (S O) d x)) (eq T t0 +(lift (S O) d x)))).(or_ind (subst0 d w t0 (lift (S O) d x)) (eq T t0 (lift +(S O) d x)) (ex T (\lambda (v: T).(or (subst0 d w (THead k t0 t1) (lift (S O) +d v)) (eq T (THead k t0 t1) (lift (S O) d v))))) (\lambda (H3: (subst0 d w t0 +(lift (S O) d x))).(let H_x0 \def (H0 (s k d)) in (let H4 \def H_x0 in +(ex_ind T (\lambda (v: T).(or (subst0 (s k d) w t1 (lift (S O) (s k d) v)) +(eq T t1 (lift (S O) (s k d) v)))) (ex T (\lambda (v: T).(or (subst0 d w +(THead k t0 t1) (lift (S O) d v)) (eq T (THead k t0 t1) (lift (S O) d v))))) +(\lambda (x0: T).(\lambda (H5: (or (subst0 (s k d) w t1 (lift (S O) (s k d) +x0)) (eq T t1 (lift (S O) (s k d) x0)))).(or_ind (subst0 (s k d) w t1 (lift +(S O) (s k d) x0)) (eq T t1 (lift (S O) (s k d) x0)) (ex T (\lambda (v: +T).(or (subst0 d w (THead k t0 t1) (lift (S O) d v)) (eq T (THead k t0 t1) +(lift (S O) d v))))) (\lambda (H6: (subst0 (s k d) w t1 (lift (S O) (s k d) +x0))).(ex_intro T (\lambda (v: T).(or (subst0 d w (THead k t0 t1) (lift (S O) +d v)) (eq T (THead k t0 t1) (lift (S O) d v)))) (THead k x x0) (eq_ind_r T +(THead k (lift (S O) d x) (lift (S O) (s k d) x0)) (\lambda (t2: T).(or +(subst0 d w (THead k t0 t1) t2) (eq T (THead k t0 t1) t2))) (or_introl +(subst0 d w (THead k t0 t1) (THead k (lift (S O) d x) (lift (S O) (s k d) +x0))) (eq T (THead k t0 t1) (THead k (lift (S O) d x) (lift (S O) (s k d) +x0))) (subst0_both w t0 (lift (S O) d x) d H3 k t1 (lift (S O) (s k d) x0) +H6)) (lift (S O) d (THead k x x0)) (lift_head k x x0 (S O) d)))) (\lambda +(H6: (eq T t1 (lift (S O) (s k d) x0))).(eq_ind_r T (lift (S O) (s k d) x0) +(\lambda (t2: T).(ex T (\lambda (v: T).(or (subst0 d w (THead k t0 t2) (lift +(S O) d v)) (eq T (THead k t0 t2) (lift (S O) d v)))))) (ex_intro T (\lambda +(v: T).(or (subst0 d w (THead k t0 (lift (S O) (s k d) x0)) (lift (S O) d v)) +(eq T (THead k t0 (lift (S O) (s k d) x0)) (lift (S O) d v)))) (THead k x x0) +(eq_ind_r T (THead k (lift (S O) d x) (lift (S O) (s k d) x0)) (\lambda (t2: +T).(or (subst0 d w (THead k t0 (lift (S O) (s k d) x0)) t2) (eq T (THead k t0 +(lift (S O) (s k d) x0)) t2))) (or_introl (subst0 d w (THead k t0 (lift (S O) +(s k d) x0)) (THead k (lift (S O) d x) (lift (S O) (s k d) x0))) (eq T (THead +k t0 (lift (S O) (s k d) x0)) (THead k (lift (S O) d x) (lift (S O) (s k d) +x0))) (subst0_fst w (lift (S O) d x) t0 d H3 (lift (S O) (s k d) x0) k)) +(lift (S O) d (THead k x x0)) (lift_head k x x0 (S O) d))) t1 H6)) H5))) +H4)))) (\lambda (H3: (eq T t0 (lift (S O) d x))).(let H_x0 \def (H0 (s k d)) +in (let H4 \def H_x0 in (ex_ind T (\lambda (v: T).(or (subst0 (s k d) w t1 +(lift (S O) (s k d) v)) (eq T t1 (lift (S O) (s k d) v)))) (ex T (\lambda (v: +T).(or (subst0 d w (THead k t0 t1) (lift (S O) d v)) (eq T (THead k t0 t1) +(lift (S O) d v))))) (\lambda (x0: T).(\lambda (H5: (or (subst0 (s k d) w t1 +(lift (S O) (s k d) x0)) (eq T t1 (lift (S O) (s k d) x0)))).(or_ind (subst0 +(s k d) w t1 (lift (S O) (s k d) x0)) (eq T t1 (lift (S O) (s k d) x0)) (ex T +(\lambda (v: T).(or (subst0 d w (THead k t0 t1) (lift (S O) d v)) (eq T +(THead k t0 t1) (lift (S O) d v))))) (\lambda (H6: (subst0 (s k d) w t1 (lift +(S O) (s k d) x0))).(eq_ind_r T (lift (S O) d x) (\lambda (t2: T).(ex T +(\lambda (v: T).(or (subst0 d w (THead k t2 t1) (lift (S O) d v)) (eq T +(THead k t2 t1) (lift (S O) d v)))))) (ex_intro T (\lambda (v: T).(or (subst0 +d w (THead k (lift (S O) d x) t1) (lift (S O) d v)) (eq T (THead k (lift (S +O) d x) t1) (lift (S O) d v)))) (THead k x x0) (eq_ind_r T (THead k (lift (S +O) d x) (lift (S O) (s k d) x0)) (\lambda (t2: T).(or (subst0 d w (THead k +(lift (S O) d x) t1) t2) (eq T (THead k (lift (S O) d x) t1) t2))) (or_introl +(subst0 d w (THead k (lift (S O) d x) t1) (THead k (lift (S O) d x) (lift (S +O) (s k d) x0))) (eq T (THead k (lift (S O) d x) t1) (THead k (lift (S O) d +x) (lift (S O) (s k d) x0))) (subst0_snd k w (lift (S O) (s k d) x0) t1 d H6 +(lift (S O) d x))) (lift (S O) d (THead k x x0)) (lift_head k x x0 (S O) d))) +t0 H3)) (\lambda (H6: (eq T t1 (lift (S O) (s k d) x0))).(eq_ind_r T (lift (S +O) (s k d) x0) (\lambda (t2: T).(ex T (\lambda (v: T).(or (subst0 d w (THead +k t0 t2) (lift (S O) d v)) (eq T (THead k t0 t2) (lift (S O) d v)))))) +(eq_ind_r T (lift (S O) d x) (\lambda (t2: T).(ex T (\lambda (v: T).(or +(subst0 d w (THead k t2 (lift (S O) (s k d) x0)) (lift (S O) d v)) (eq T +(THead k t2 (lift (S O) (s k d) x0)) (lift (S O) d v)))))) (ex_intro T +(\lambda (v: T).(or (subst0 d w (THead k (lift (S O) d x) (lift (S O) (s k d) +x0)) (lift (S O) d v)) (eq T (THead k (lift (S O) d x) (lift (S O) (s k d) +x0)) (lift (S O) d v)))) (THead k x x0) (eq_ind_r T (THead k (lift (S O) d x) +(lift (S O) (s k d) x0)) (\lambda (t2: T).(or (subst0 d w (THead k (lift (S +O) d x) (lift (S O) (s k d) x0)) t2) (eq T (THead k (lift (S O) d x) (lift (S +O) (s k d) x0)) t2))) (or_intror (subst0 d w (THead k (lift (S O) d x) (lift +(S O) (s k d) x0)) (THead k (lift (S O) d x) (lift (S O) (s k d) x0))) (eq T +(THead k (lift (S O) d x) (lift (S O) (s k d) x0)) (THead k (lift (S O) d x) +(lift (S O) (s k d) x0))) (refl_equal T (THead k (lift (S O) d x) (lift (S O) +(s k d) x0)))) (lift (S O) d (THead k x x0)) (lift_head k x x0 (S O) d))) t0 +H3) t1 H6)) H5))) H4)))) H2))) H1))))))))) t)). + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/subst0/defs.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/subst0/defs.ma new file mode 100644 index 000000000..c16d69744 --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/subst0/defs.ma @@ -0,0 +1,34 @@ +(**************************************************************************) +(* ___ *) +(* ||M|| *) +(* ||A|| A project by Andrea Asperti *) +(* ||T|| *) +(* ||I|| Developers: *) +(* ||T|| The HELM team. *) +(* ||A|| http://helm.cs.unibo.it *) +(* \ / *) +(* \ / This file is distributed under the terms of the *) +(* v GNU General Public License Version 2 *) +(* *) +(**************************************************************************) + +(* This file was automatically generated: do not edit *********************) + +set "baseuri" "cic:/matita/LAMBDA-TYPES/Level-1/LambdaDelta/subst0/defs". + +include "lift/defs.ma". + +inductive subst0: nat \to (T \to (T \to (T \to Prop))) \def +| subst0_lref: \forall (v: T).(\forall (i: nat).(subst0 i v (TLRef i) (lift +(S i) O v))) +| subst0_fst: \forall (v: T).(\forall (u2: T).(\forall (u1: T).(\forall (i: +nat).((subst0 i v u1 u2) \to (\forall (t: T).(\forall (k: K).(subst0 i v +(THead k u1 t) (THead k u2 t)))))))) +| subst0_snd: \forall (k: K).(\forall (v: T).(\forall (t2: T).(\forall (t1: +T).(\forall (i: nat).((subst0 (s k i) v t1 t2) \to (\forall (u: T).(subst0 i +v (THead k u t1) (THead k u t2)))))))) +| subst0_both: \forall (v: T).(\forall (u1: T).(\forall (u2: T).(\forall (i: +nat).((subst0 i v u1 u2) \to (\forall (k: K).(\forall (t1: T).(\forall (t2: +T).((subst0 (s k i) v t1 t2) \to (subst0 i v (THead k u1 t1) (THead k u2 +t2)))))))))). + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/subst0/fwd.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/subst0/fwd.ma new file mode 100644 index 000000000..b592b261e --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/subst0/fwd.ma @@ -0,0 +1,802 @@ +(**************************************************************************) +(* ___ *) +(* ||M|| *) +(* ||A|| A project by Andrea Asperti *) +(* ||T|| *) +(* ||I|| Developers: *) +(* ||T|| The HELM team. *) +(* ||A|| http://helm.cs.unibo.it *) +(* \ / *) +(* \ / This file is distributed under the terms of the *) +(* v GNU General Public License Version 2 *) +(* *) +(**************************************************************************) + +(* This file was automatically generated: do not edit *********************) + +set "baseuri" "cic:/matita/LAMBDA-TYPES/Level-1/LambdaDelta/subst0/fwd". + +include "subst0/defs.ma". + +include "lift/props.ma". + +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).(let H0 \def (match H in +subst0 return (\lambda (n0: nat).(\lambda (t: T).(\lambda (t0: T).(\lambda +(t1: T).(\lambda (_: (subst0 n0 t t0 t1)).((eq nat n0 i) \to ((eq T t v) \to +((eq T t0 (TSort n)) \to ((eq T t1 x) \to P))))))))) with [(subst0_lref v0 +i0) \Rightarrow (\lambda (H0: (eq nat i0 i)).(\lambda (H1: (eq T v0 +v)).(\lambda (H2: (eq T (TLRef i0) (TSort n))).(\lambda (H3: (eq T (lift (S +i0) O v0) x)).(eq_ind nat i (\lambda (n0: nat).((eq T v0 v) \to ((eq T (TLRef +n0) (TSort n)) \to ((eq T (lift (S n0) O v0) x) \to P)))) (\lambda (H4: (eq T +v0 v)).(eq_ind T v (\lambda (t: T).((eq T (TLRef i) (TSort n)) \to ((eq T +(lift (S i) O t) x) \to P))) (\lambda (H5: (eq T (TLRef i) (TSort n))).(let +H6 \def (eq_ind T (TLRef i) (\lambda (e: T).(match e in T return (\lambda (_: +T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) \Rightarrow True | +(THead _ _ _) \Rightarrow False])) I (TSort n) H5) in (False_ind ((eq T (lift +(S i) O v) x) \to P) H6))) v0 (sym_eq T v0 v H4))) i0 (sym_eq nat i0 i H0) H1 +H2 H3))))) | (subst0_fst v0 u2 u1 i0 H0 t k) \Rightarrow (\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)).(eq_ind nat i (\lambda +(n0: nat).((eq T v0 v) \to ((eq T (THead k u1 t) (TSort n)) \to ((eq T (THead +k u2 t) x) \to ((subst0 n0 v0 u1 u2) \to P))))) (\lambda (H5: (eq T v0 +v)).(eq_ind T v (\lambda (t0: T).((eq T (THead k u1 t) (TSort n)) \to ((eq T +(THead k u2 t) x) \to ((subst0 i t0 u1 u2) \to P)))) (\lambda (H6: (eq T +(THead k u1 t) (TSort n))).(let H7 \def (eq_ind T (THead k u1 t) (\lambda (e: +T).(match e in T return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow +False | (TLRef _) \Rightarrow False | (THead _ _ _) \Rightarrow True])) I +(TSort n) H6) in (False_ind ((eq T (THead k u2 t) x) \to ((subst0 i v u1 u2) +\to P)) H7))) v0 (sym_eq T v0 v H5))) i0 (sym_eq nat i0 i H1) H2 H3 H4 +H0))))) | (subst0_snd k v0 t2 t1 i0 H0 u) \Rightarrow (\lambda (H1: (eq nat +i0 i)).(\lambda (H2: (eq T v0 v)).(\lambda (H3: (eq T (THead k u t1) (TSort +n))).(\lambda (H4: (eq T (THead k u t2) x)).(eq_ind nat i (\lambda (n0: +nat).((eq T v0 v) \to ((eq T (THead k u t1) (TSort n)) \to ((eq T (THead k u +t2) x) \to ((subst0 (s k n0) v0 t1 t2) \to P))))) (\lambda (H5: (eq T v0 +v)).(eq_ind T v (\lambda (t: T).((eq T (THead k u t1) (TSort n)) \to ((eq T +(THead k u t2) x) \to ((subst0 (s k i) t t1 t2) \to P)))) (\lambda (H6: (eq T +(THead k u t1) (TSort n))).(let H7 \def (eq_ind T (THead k u t1) (\lambda (e: +T).(match e in T return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow +False | (TLRef _) \Rightarrow False | (THead _ _ _) \Rightarrow True])) I +(TSort n) H6) in (False_ind ((eq T (THead k u t2) x) \to ((subst0 (s k i) v +t1 t2) \to P)) H7))) v0 (sym_eq T v0 v H5))) i0 (sym_eq nat i0 i H1) H2 H3 H4 +H0))))) | (subst0_both v0 u1 u2 i0 H0 k t1 t2 H1) \Rightarrow (\lambda (H2: +(eq nat i0 i)).(\lambda (H3: (eq T v0 v)).(\lambda (H4: (eq T (THead k u1 t1) +(TSort n))).(\lambda (H5: (eq T (THead k u2 t2) x)).(eq_ind nat i (\lambda +(n0: nat).((eq T v0 v) \to ((eq T (THead k u1 t1) (TSort n)) \to ((eq T +(THead k u2 t2) x) \to ((subst0 n0 v0 u1 u2) \to ((subst0 (s k n0) v0 t1 t2) +\to P)))))) (\lambda (H6: (eq T v0 v)).(eq_ind T v (\lambda (t: T).((eq T +(THead k u1 t1) (TSort n)) \to ((eq T (THead k u2 t2) x) \to ((subst0 i t u1 +u2) \to ((subst0 (s k i) t t1 t2) \to P))))) (\lambda (H7: (eq T (THead k u1 +t1) (TSort n))).(let H8 \def (eq_ind T (THead k u1 t1) (\lambda (e: T).(match +e in T return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | +(TLRef _) \Rightarrow False | (THead _ _ _) \Rightarrow True])) I (TSort n) +H7) in (False_ind ((eq T (THead k u2 t2) x) \to ((subst0 i v u1 u2) \to +((subst0 (s k i) v t1 t2) \to P))) H8))) v0 (sym_eq T v0 v H6))) i0 (sym_eq +nat i0 i H2) H3 H4 H5 H0 H1)))))]) in (H0 (refl_equal nat i) (refl_equal T v) +(refl_equal T (TSort n)) (refl_equal T x)))))))). + +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)).(let H0 \def (match H in subst0 return (\lambda +(n0: nat).(\lambda (t: T).(\lambda (t0: T).(\lambda (t1: T).(\lambda (_: +(subst0 n0 t t0 t1)).((eq nat n0 i) \to ((eq T t v) \to ((eq T t0 (TLRef n)) +\to ((eq T t1 x) \to (land (eq nat n i) (eq T x (lift (S n) O v)))))))))))) +with [(subst0_lref v0 i0) \Rightarrow (\lambda (H0: (eq nat i0 i)).(\lambda +(H1: (eq T v0 v)).(\lambda (H2: (eq T (TLRef i0) (TLRef n))).(\lambda (H3: +(eq T (lift (S i0) O v0) x)).(eq_ind nat i (\lambda (n0: nat).((eq T v0 v) +\to ((eq T (TLRef n0) (TLRef n)) \to ((eq T (lift (S n0) O v0) x) \to (land +(eq nat n i) (eq T x (lift (S n) O v))))))) (\lambda (H4: (eq T v0 +v)).(eq_ind T v (\lambda (t: T).((eq T (TLRef i) (TLRef n)) \to ((eq T (lift +(S i) O t) x) \to (land (eq nat n i) (eq T x (lift (S n) O v)))))) (\lambda +(H5: (eq T (TLRef i) (TLRef n))).(let H6 \def (f_equal T nat (\lambda (e: +T).(match e in T return (\lambda (_: T).nat) with [(TSort _) \Rightarrow i | +(TLRef n) \Rightarrow n | (THead _ _ _) \Rightarrow i])) (TLRef i) (TLRef n) +H5) in (eq_ind nat n (\lambda (n0: nat).((eq T (lift (S n0) O v) x) \to (land +(eq nat n n0) (eq T x (lift (S n) O v))))) (\lambda (H7: (eq T (lift (S n) O +v) x)).(eq_ind T (lift (S n) O v) (\lambda (t: T).(land (eq nat n n) (eq T t +(lift (S n) O v)))) (conj (eq nat n n) (eq T (lift (S n) O v) (lift (S n) O +v)) (refl_equal nat n) (refl_equal T (lift (S n) O v))) x H7)) i (sym_eq nat +i n H6)))) v0 (sym_eq T v0 v H4))) i0 (sym_eq nat i0 i H0) H1 H2 H3))))) | +(subst0_fst v0 u2 u1 i0 H0 t k) \Rightarrow (\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)).(eq_ind nat i (\lambda (n0: +nat).((eq T v0 v) \to ((eq T (THead k u1 t) (TLRef n)) \to ((eq T (THead k u2 +t) x) \to ((subst0 n0 v0 u1 u2) \to (land (eq nat n i) (eq T x (lift (S n) O +v)))))))) (\lambda (H5: (eq T v0 v)).(eq_ind T v (\lambda (t0: T).((eq T +(THead k u1 t) (TLRef n)) \to ((eq T (THead k u2 t) x) \to ((subst0 i t0 u1 +u2) \to (land (eq nat n i) (eq T x (lift (S n) O v))))))) (\lambda (H6: (eq T +(THead k u1 t) (TLRef n))).(let H7 \def (eq_ind T (THead k u1 t) (\lambda (e: +T).(match e in T return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow +False | (TLRef _) \Rightarrow False | (THead _ _ _) \Rightarrow True])) I +(TLRef n) H6) in (False_ind ((eq T (THead k u2 t) x) \to ((subst0 i v u1 u2) +\to (land (eq nat n i) (eq T x (lift (S n) O v))))) H7))) v0 (sym_eq T v0 v +H5))) i0 (sym_eq nat i0 i H1) H2 H3 H4 H0))))) | (subst0_snd k v0 t2 t1 i0 H0 +u) \Rightarrow (\lambda (H1: (eq nat i0 i)).(\lambda (H2: (eq T v0 +v)).(\lambda (H3: (eq T (THead k u t1) (TLRef n))).(\lambda (H4: (eq T (THead +k u t2) x)).(eq_ind nat i (\lambda (n0: nat).((eq T v0 v) \to ((eq T (THead k +u t1) (TLRef n)) \to ((eq T (THead k u t2) x) \to ((subst0 (s k n0) v0 t1 t2) +\to (land (eq nat n i) (eq T x (lift (S n) O v)))))))) (\lambda (H5: (eq T v0 +v)).(eq_ind T v (\lambda (t: T).((eq T (THead k u t1) (TLRef n)) \to ((eq T +(THead k u t2) x) \to ((subst0 (s k i) t t1 t2) \to (land (eq nat n i) (eq T +x (lift (S n) O v))))))) (\lambda (H6: (eq T (THead k u t1) (TLRef n))).(let +H7 \def (eq_ind T (THead k u t1) (\lambda (e: T).(match e in T return +(\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) +\Rightarrow False | (THead _ _ _) \Rightarrow True])) I (TLRef n) H6) in +(False_ind ((eq T (THead k u t2) x) \to ((subst0 (s k i) v t1 t2) \to (land +(eq nat n i) (eq T x (lift (S n) O v))))) H7))) v0 (sym_eq T v0 v H5))) i0 +(sym_eq nat i0 i H1) H2 H3 H4 H0))))) | (subst0_both v0 u1 u2 i0 H0 k t1 t2 +H1) \Rightarrow (\lambda (H2: (eq nat i0 i)).(\lambda (H3: (eq T v0 +v)).(\lambda (H4: (eq T (THead k u1 t1) (TLRef n))).(\lambda (H5: (eq T +(THead k u2 t2) x)).(eq_ind nat i (\lambda (n0: nat).((eq T v0 v) \to ((eq T +(THead k u1 t1) (TLRef n)) \to ((eq T (THead k u2 t2) x) \to ((subst0 n0 v0 +u1 u2) \to ((subst0 (s k n0) v0 t1 t2) \to (land (eq nat n i) (eq T x (lift +(S n) O v))))))))) (\lambda (H6: (eq T v0 v)).(eq_ind T v (\lambda (t: +T).((eq T (THead k u1 t1) (TLRef n)) \to ((eq T (THead k u2 t2) x) \to +((subst0 i t u1 u2) \to ((subst0 (s k i) t t1 t2) \to (land (eq nat n i) (eq +T x (lift (S n) O v)))))))) (\lambda (H7: (eq T (THead k u1 t1) (TLRef +n))).(let H8 \def (eq_ind T (THead k u1 t1) (\lambda (e: T).(match e in T +return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) +\Rightarrow False | (THead _ _ _) \Rightarrow True])) I (TLRef n) H7) in +(False_ind ((eq T (THead k u2 t2) x) \to ((subst0 i v u1 u2) \to ((subst0 (s +k i) v t1 t2) \to (land (eq nat n i) (eq T x (lift (S n) O v)))))) H8))) v0 +(sym_eq T v0 v H6))) i0 (sym_eq nat i0 i H2) H3 H4 H5 H0 H1)))))]) in (H0 +(refl_equal nat i) (refl_equal T v) (refl_equal T (TLRef n)) (refl_equal T +x))))))). + +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 +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)).(let H0 +\def (match H in subst0 return (\lambda (n: nat).(\lambda (t: T).(\lambda +(t0: T).(\lambda (t2: T).(\lambda (_: (subst0 n t t0 t2)).((eq nat n i) \to +((eq T t v) \to ((eq T t0 (THead k u1 t1)) \to ((eq T t2 x) \to (or3 (ex2 T +(\lambda (u2: T).(eq T x (THead k u2 t1))) (\lambda (u2: T).(subst0 i v u1 +u2))) (ex2 T (\lambda (t3: T).(eq T x (THead k u1 t3))) (\lambda (t3: +T).(subst0 (s k i) v t1 t3))) (ex3_2 T T (\lambda (u2: T).(\lambda (t3: +T).(eq T x (THead k u2 t3)))) (\lambda (u2: T).(\lambda (_: T).(subst0 i v u1 +u2))) (\lambda (_: T).(\lambda (t3: T).(subst0 (s k i) v t1 t3)))))))))))))) +with [(subst0_lref v0 i0) \Rightarrow (\lambda (H0: (eq nat i0 i)).(\lambda +(H1: (eq T v0 v)).(\lambda (H2: (eq T (TLRef i0) (THead k u1 t1))).(\lambda +(H3: (eq T (lift (S i0) O v0) x)).(eq_ind nat i (\lambda (n: nat).((eq T v0 +v) \to ((eq T (TLRef n) (THead k u1 t1)) \to ((eq T (lift (S n) O v0) x) \to +(or3 (ex2 T (\lambda (u2: T).(eq T x (THead k u2 t1))) (\lambda (u2: +T).(subst0 i v u1 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))))))))) (\lambda (H4: (eq T v0 v)).(eq_ind T v (\lambda (t: T).((eq T +(TLRef i) (THead k u1 t1)) \to ((eq T (lift (S i) O t) x) \to (or3 (ex2 T +(\lambda (u2: T).(eq T x (THead k u2 t1))) (\lambda (u2: T).(subst0 i v u1 +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)))))))) +(\lambda (H5: (eq T (TLRef i) (THead k u1 t1))).(let H6 \def (eq_ind T (TLRef +i) (\lambda (e: T).(match e in T return (\lambda (_: T).Prop) with [(TSort _) +\Rightarrow False | (TLRef _) \Rightarrow True | (THead _ _ _) \Rightarrow +False])) I (THead k u1 t1) H5) in (False_ind ((eq T (lift (S i) O v) x) \to +(or3 (ex2 T (\lambda (u2: T).(eq T x (THead k u2 t1))) (\lambda (u2: +T).(subst0 i v u1 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)))))) H6))) v0 (sym_eq T v0 v H4))) i0 (sym_eq nat i0 i H0) H1 H2 H3))))) +| (subst0_fst v0 u2 u0 i0 H0 t k0) \Rightarrow (\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)).(eq_ind nat i (\lambda (n: +nat).((eq T v0 v) \to ((eq T (THead k0 u0 t) (THead k u1 t1)) \to ((eq T +(THead k0 u2 t) x) \to ((subst0 n v0 u0 u2) \to (or3 (ex2 T (\lambda (u3: +T).(eq T x (THead k u3 t1))) (\lambda (u3: T).(subst0 i v u1 u3))) (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 (u3: T).(\lambda (t2: T).(eq T x (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)))))))))) (\lambda (H5: (eq T v0 +v)).(eq_ind T v (\lambda (t0: T).((eq T (THead k0 u0 t) (THead k u1 t1)) \to +((eq T (THead k0 u2 t) x) \to ((subst0 i t0 u0 u2) \to (or3 (ex2 T (\lambda +(u3: T).(eq T x (THead k u3 t1))) (\lambda (u3: T).(subst0 i v u1 u3))) (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 (u3: T).(\lambda (t2: T).(eq T x (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))))))))) (\lambda (H6: (eq T +(THead k0 u0 t) (THead k u1 t1))).(let H7 \def (f_equal T T (\lambda (e: +T).(match e in T return (\lambda (_: T).T) with [(TSort _) \Rightarrow t | +(TLRef _) \Rightarrow t | (THead _ _ t) \Rightarrow t])) (THead k0 u0 t) +(THead k u1 t1) H6) 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 k0 u0 t) (THead k u1 +t1) H6) in ((let H9 \def (f_equal T K (\lambda (e: T).(match e in T return +(\lambda (_: T).K) with [(TSort _) \Rightarrow k0 | (TLRef _) \Rightarrow k0 +| (THead k _ _) \Rightarrow k])) (THead k0 u0 t) (THead k u1 t1) H6) in +(eq_ind K k (\lambda (k1: K).((eq T u0 u1) \to ((eq T t t1) \to ((eq T (THead +k1 u2 t) x) \to ((subst0 i v u0 u2) \to (or3 (ex2 T (\lambda (u3: T).(eq T x +(THead k u3 t1))) (\lambda (u3: T).(subst0 i v u1 u3))) (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 (u3: T).(\lambda (t2: T).(eq T x (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)))))))))) (\lambda (H10: (eq T u0 +u1)).(eq_ind T u1 (\lambda (t0: T).((eq T t t1) \to ((eq T (THead k u2 t) x) +\to ((subst0 i v t0 u2) \to (or3 (ex2 T (\lambda (u3: T).(eq T x (THead k u3 +t1))) (\lambda (u3: T).(subst0 i v u1 u3))) (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 (u3: T).(\lambda (t2: T).(eq T x (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))))))))) (\lambda (H11: (eq T t t1)).(eq_ind T t1 +(\lambda (t0: T).((eq T (THead k u2 t0) x) \to ((subst0 i v u1 u2) \to (or3 +(ex2 T (\lambda (u3: T).(eq T x (THead k u3 t1))) (\lambda (u3: T).(subst0 i +v u1 u3))) (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 (u3: T).(\lambda (t2: +T).(eq T x (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)))))))) +(\lambda (H12: (eq T (THead k u2 t1) x)).(eq_ind T (THead k u2 t1) (\lambda +(t0: T).((subst0 i v u1 u2) \to (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))))))) (\lambda (H13: (subst0 i v u1 +u2)).(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)) H13))) x H12)) t (sym_eq T t t1 H11))) +u0 (sym_eq T u0 u1 H10))) k0 (sym_eq K k0 k H9))) H8)) H7))) v0 (sym_eq T v0 +v H5))) i0 (sym_eq nat i0 i H1) H2 H3 H4 H0))))) | (subst0_snd k0 v0 t2 t0 i0 +H0 u) \Rightarrow (\lambda (H1: (eq nat i0 i)).(\lambda (H2: (eq T v0 +v)).(\lambda (H3: (eq T (THead k0 u t0) (THead k u1 t1))).(\lambda (H4: (eq T +(THead k0 u t2) x)).(eq_ind nat i (\lambda (n: nat).((eq T v0 v) \to ((eq T +(THead k0 u t0) (THead k u1 t1)) \to ((eq T (THead k0 u t2) x) \to ((subst0 +(s k0 n) v0 t0 t2) \to (or3 (ex2 T (\lambda (u2: T).(eq T x (THead k u2 t1))) +(\lambda (u2: T).(subst0 i v u1 u2))) (ex2 T (\lambda (t3: T).(eq T x (THead +k u1 t3))) (\lambda (t3: T).(subst0 (s k i) v t1 t3))) (ex3_2 T T (\lambda +(u2: T).(\lambda (t3: T).(eq T x (THead k u2 t3)))) (\lambda (u2: T).(\lambda +(_: T).(subst0 i v u1 u2))) (\lambda (_: T).(\lambda (t3: T).(subst0 (s k i) +v t1 t3)))))))))) (\lambda (H5: (eq T v0 v)).(eq_ind T v (\lambda (t: T).((eq +T (THead k0 u t0) (THead k u1 t1)) \to ((eq T (THead k0 u t2) x) \to ((subst0 +(s k0 i) t t0 t2) \to (or3 (ex2 T (\lambda (u2: T).(eq T x (THead k u2 t1))) +(\lambda (u2: T).(subst0 i v u1 u2))) (ex2 T (\lambda (t3: T).(eq T x (THead +k u1 t3))) (\lambda (t3: T).(subst0 (s k i) v t1 t3))) (ex3_2 T T (\lambda +(u2: T).(\lambda (t3: T).(eq T x (THead k u2 t3)))) (\lambda (u2: T).(\lambda +(_: T).(subst0 i v u1 u2))) (\lambda (_: T).(\lambda (t3: T).(subst0 (s k i) +v t1 t3))))))))) (\lambda (H6: (eq T (THead k0 u t0) (THead k u1 t1))).(let +H7 \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 u t0) (THead k u1 t1) H6) in ((let H8 \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 t0) (THead k u1 t1) H6) in ((let H9 \def +(f_equal T K (\lambda (e: T).(match e in T return (\lambda (_: T).K) with +[(TSort _) \Rightarrow k0 | (TLRef _) \Rightarrow k0 | (THead k _ _) +\Rightarrow k])) (THead k0 u t0) (THead k u1 t1) H6) in (eq_ind K k (\lambda +(k1: K).((eq T u u1) \to ((eq T t0 t1) \to ((eq T (THead k1 u t2) x) \to +((subst0 (s k1 i) v t0 t2) \to (or3 (ex2 T (\lambda (u2: T).(eq T x (THead k +u2 t1))) (\lambda (u2: T).(subst0 i v u1 u2))) (ex2 T (\lambda (t3: T).(eq T +x (THead k u1 t3))) (\lambda (t3: T).(subst0 (s k i) v t1 t3))) (ex3_2 T T +(\lambda (u2: T).(\lambda (t3: T).(eq T x (THead k u2 t3)))) (\lambda (u2: +T).(\lambda (_: T).(subst0 i v u1 u2))) (\lambda (_: T).(\lambda (t3: +T).(subst0 (s k i) v t1 t3)))))))))) (\lambda (H10: (eq T u u1)).(eq_ind T u1 +(\lambda (t: T).((eq T t0 t1) \to ((eq T (THead k t t2) x) \to ((subst0 (s k +i) v t0 t2) \to (or3 (ex2 T (\lambda (u2: T).(eq T x (THead k u2 t1))) +(\lambda (u2: T).(subst0 i v u1 u2))) (ex2 T (\lambda (t3: T).(eq T x (THead +k u1 t3))) (\lambda (t3: T).(subst0 (s k i) v t1 t3))) (ex3_2 T T (\lambda +(u2: T).(\lambda (t3: T).(eq T x (THead k u2 t3)))) (\lambda (u2: T).(\lambda +(_: T).(subst0 i v u1 u2))) (\lambda (_: T).(\lambda (t3: T).(subst0 (s k i) +v t1 t3))))))))) (\lambda (H11: (eq T t0 t1)).(eq_ind T t1 (\lambda (t: +T).((eq T (THead k u1 t2) x) \to ((subst0 (s k i) v t t2) \to (or3 (ex2 T +(\lambda (u2: T).(eq T x (THead k u2 t1))) (\lambda (u2: T).(subst0 i v u1 +u2))) (ex2 T (\lambda (t3: T).(eq T x (THead k u1 t3))) (\lambda (t3: +T).(subst0 (s k i) v t1 t3))) (ex3_2 T T (\lambda (u2: T).(\lambda (t3: +T).(eq T x (THead k u2 t3)))) (\lambda (u2: T).(\lambda (_: T).(subst0 i v u1 +u2))) (\lambda (_: T).(\lambda (t3: T).(subst0 (s k i) v t1 t3)))))))) +(\lambda (H12: (eq T (THead k u1 t2) x)).(eq_ind T (THead k u1 t2) (\lambda +(t: T).((subst0 (s k i) v t1 t2) \to (or3 (ex2 T (\lambda (u2: T).(eq T t +(THead k u2 t1))) (\lambda (u2: T).(subst0 i v u1 u2))) (ex2 T (\lambda (t3: +T).(eq T t (THead k u1 t3))) (\lambda (t3: T).(subst0 (s k i) v t1 t3))) +(ex3_2 T T (\lambda (u2: T).(\lambda (t3: T).(eq T t (THead k u2 t3)))) +(\lambda (u2: T).(\lambda (_: T).(subst0 i v u1 u2))) (\lambda (_: +T).(\lambda (t3: T).(subst0 (s k i) v t1 t3))))))) (\lambda (H13: (subst0 (s +k i) v t1 t2)).(or3_intro1 (ex2 T (\lambda (u2: T).(eq T (THead k u1 t2) +(THead k u2 t1))) (\lambda (u2: T).(subst0 i v u1 u2))) (ex2 T (\lambda (t3: +T).(eq T (THead k u1 t2) (THead k u1 t3))) (\lambda (t3: T).(subst0 (s k i) v +t1 t3))) (ex3_2 T T (\lambda (u2: T).(\lambda (t3: T).(eq T (THead k u1 t2) +(THead k u2 t3)))) (\lambda (u2: T).(\lambda (_: T).(subst0 i v u1 u2))) +(\lambda (_: T).(\lambda (t3: T).(subst0 (s k i) v t1 t3)))) (ex_intro2 T +(\lambda (t3: T).(eq T (THead k u1 t2) (THead k u1 t3))) (\lambda (t3: +T).(subst0 (s k i) v t1 t3)) t2 (refl_equal T (THead k u1 t2)) H13))) x H12)) +t0 (sym_eq T t0 t1 H11))) u (sym_eq T u u1 H10))) k0 (sym_eq K k0 k H9))) +H8)) H7))) v0 (sym_eq T v0 v H5))) i0 (sym_eq nat i0 i H1) H2 H3 H4 H0))))) | +(subst0_both v0 u0 u2 i0 H0 k0 t0 t2 H1) \Rightarrow (\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 t2) x)).(eq_ind nat i (\lambda (n: +nat).((eq T v0 v) \to ((eq T (THead k0 u0 t0) (THead k u1 t1)) \to ((eq T +(THead k0 u2 t2) x) \to ((subst0 n v0 u0 u2) \to ((subst0 (s k0 n) v0 t0 t2) +\to (or3 (ex2 T (\lambda (u3: T).(eq T x (THead k u3 t1))) (\lambda (u3: +T).(subst0 i v u1 u3))) (ex2 T (\lambda (t3: T).(eq T x (THead k u1 t3))) +(\lambda (t3: T).(subst0 (s k i) v t1 t3))) (ex3_2 T T (\lambda (u3: +T).(\lambda (t3: T).(eq T x (THead k u3 t3)))) (\lambda (u3: T).(\lambda (_: +T).(subst0 i v u1 u3))) (\lambda (_: T).(\lambda (t3: T).(subst0 (s k i) v t1 +t3))))))))))) (\lambda (H6: (eq T v0 v)).(eq_ind T v (\lambda (t: T).((eq T +(THead k0 u0 t0) (THead k u1 t1)) \to ((eq T (THead k0 u2 t2) x) \to ((subst0 +i t u0 u2) \to ((subst0 (s k0 i) t t0 t2) \to (or3 (ex2 T (\lambda (u3: +T).(eq T x (THead k u3 t1))) (\lambda (u3: T).(subst0 i v u1 u3))) (ex2 T +(\lambda (t3: T).(eq T x (THead k u1 t3))) (\lambda (t3: T).(subst0 (s k i) v +t1 t3))) (ex3_2 T T (\lambda (u3: T).(\lambda (t3: T).(eq T x (THead k u3 +t3)))) (\lambda (u3: T).(\lambda (_: T).(subst0 i v u1 u3))) (\lambda (_: +T).(\lambda (t3: T).(subst0 (s k i) v t1 t3)))))))))) (\lambda (H7: (eq T +(THead k0 u0 t0) (THead k u1 t1))).(let H8 \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) H7) in ((let H9 \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) H7) in ((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 k _ _) \Rightarrow k])) (THead k0 u0 t0) (THead k u1 t1) H7) in +(eq_ind K k (\lambda (k1: K).((eq T u0 u1) \to ((eq T t0 t1) \to ((eq T +(THead k1 u2 t2) x) \to ((subst0 i v u0 u2) \to ((subst0 (s k1 i) v t0 t2) +\to (or3 (ex2 T (\lambda (u3: T).(eq T x (THead k u3 t1))) (\lambda (u3: +T).(subst0 i v u1 u3))) (ex2 T (\lambda (t3: T).(eq T x (THead k u1 t3))) +(\lambda (t3: T).(subst0 (s k i) v t1 t3))) (ex3_2 T T (\lambda (u3: +T).(\lambda (t3: T).(eq T x (THead k u3 t3)))) (\lambda (u3: T).(\lambda (_: +T).(subst0 i v u1 u3))) (\lambda (_: T).(\lambda (t3: T).(subst0 (s k i) v t1 +t3))))))))))) (\lambda (H11: (eq T u0 u1)).(eq_ind T u1 (\lambda (t: T).((eq +T t0 t1) \to ((eq T (THead k u2 t2) x) \to ((subst0 i v t u2) \to ((subst0 (s +k i) v t0 t2) \to (or3 (ex2 T (\lambda (u3: T).(eq T x (THead k u3 t1))) +(\lambda (u3: T).(subst0 i v u1 u3))) (ex2 T (\lambda (t3: T).(eq T x (THead +k u1 t3))) (\lambda (t3: T).(subst0 (s k i) v t1 t3))) (ex3_2 T T (\lambda +(u3: T).(\lambda (t3: T).(eq T x (THead k u3 t3)))) (\lambda (u3: T).(\lambda +(_: T).(subst0 i v u1 u3))) (\lambda (_: T).(\lambda (t3: T).(subst0 (s k i) +v t1 t3)))))))))) (\lambda (H12: (eq T t0 t1)).(eq_ind T t1 (\lambda (t: +T).((eq T (THead k u2 t2) x) \to ((subst0 i v u1 u2) \to ((subst0 (s k i) v t +t2) \to (or3 (ex2 T (\lambda (u3: T).(eq T x (THead k u3 t1))) (\lambda (u3: +T).(subst0 i v u1 u3))) (ex2 T (\lambda (t3: T).(eq T x (THead k u1 t3))) +(\lambda (t3: T).(subst0 (s k i) v t1 t3))) (ex3_2 T T (\lambda (u3: +T).(\lambda (t3: T).(eq T x (THead k u3 t3)))) (\lambda (u3: T).(\lambda (_: +T).(subst0 i v u1 u3))) (\lambda (_: T).(\lambda (t3: T).(subst0 (s k i) v t1 +t3))))))))) (\lambda (H13: (eq T (THead k u2 t2) x)).(eq_ind T (THead k u2 +t2) (\lambda (t: T).((subst0 i v u1 u2) \to ((subst0 (s k i) v t1 t2) \to +(or3 (ex2 T (\lambda (u3: T).(eq T t (THead k u3 t1))) (\lambda (u3: +T).(subst0 i v u1 u3))) (ex2 T (\lambda (t3: T).(eq T t (THead k u1 t3))) +(\lambda (t3: T).(subst0 (s k i) v t1 t3))) (ex3_2 T T (\lambda (u3: +T).(\lambda (t3: T).(eq T t (THead k u3 t3)))) (\lambda (u3: T).(\lambda (_: +T).(subst0 i v u1 u3))) (\lambda (_: T).(\lambda (t3: T).(subst0 (s k i) v t1 +t3)))))))) (\lambda (H14: (subst0 i v u1 u2)).(\lambda (H15: (subst0 (s k i) +v t1 t2)).(or3_intro2 (ex2 T (\lambda (u3: T).(eq T (THead k u2 t2) (THead k +u3 t1))) (\lambda (u3: T).(subst0 i v u1 u3))) (ex2 T (\lambda (t3: T).(eq T +(THead k u2 t2) (THead k u1 t3))) (\lambda (t3: T).(subst0 (s k i) v t1 t3))) +(ex3_2 T T (\lambda (u3: T).(\lambda (t3: T).(eq T (THead k u2 t2) (THead k +u3 t3)))) (\lambda (u3: T).(\lambda (_: T).(subst0 i v u1 u3))) (\lambda (_: +T).(\lambda (t3: T).(subst0 (s k i) v t1 t3)))) (ex3_2_intro T T (\lambda +(u3: T).(\lambda (t3: T).(eq T (THead k u2 t2) (THead k u3 t3)))) (\lambda +(u3: T).(\lambda (_: T).(subst0 i v u1 u3))) (\lambda (_: T).(\lambda (t3: +T).(subst0 (s k i) v t1 t3))) u2 t2 (refl_equal T (THead k u2 t2)) H14 +H15)))) x H13)) t0 (sym_eq T t0 t1 H12))) u0 (sym_eq T u0 u1 H11))) k0 +(sym_eq K k0 k H10))) H9)) H8))) v0 (sym_eq T v0 v H6))) i0 (sym_eq nat i0 i +H2) H3 H4 H5 H0 H1)))))]) in (H0 (refl_equal nat i) (refl_equal T v) +(refl_equal T (THead k u1 t1)) (refl_equal T x))))))))). + +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 (t: T).(subst0 i (lift h d u) t 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)). + +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 +(t: T).(subst0 i u t 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 (t: T).(subst0 i u t 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 (n: nat).(lt n 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 (t: T).(subst0 i u t +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 (n: nat).(lt n (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 (t: T).(subst0 i u t 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). + +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 (n: nat).(lt n 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 (t: T).(subst0 +i u t 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)). + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/subst0/props.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/subst0/props.ma new file mode 100644 index 000000000..614d3ab35 --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/subst0/props.ma @@ -0,0 +1,230 @@ +(**************************************************************************) +(* ___ *) +(* ||M|| *) +(* ||A|| A project by Andrea Asperti *) +(* ||T|| *) +(* ||I|| Developers: *) +(* ||T|| The HELM team. *) +(* ||A|| http://helm.cs.unibo.it *) +(* \ / *) +(* \ / This file is distributed under the terms of the *) +(* v GNU General Public License Version 2 *) +(* *) +(**************************************************************************) + +(* This file was automatically generated: do not edit *********************) + +set "baseuri" "cic:/matita/LAMBDA-TYPES/Level-1/LambdaDelta/subst0/props". + +include "subst0/fwd.ma". + +include "lift/props.ma". + +theorem subst0_refl: + \forall (u: T).(\forall (t: T).(\forall (d: nat).((subst0 d u t t) \to +(\forall (P: Prop).P)))) +\def + \lambda (u: T).(\lambda (t: T).(T_ind (\lambda (t0: T).(\forall (d: +nat).((subst0 d u t0 t0) \to (\forall (P: Prop).P)))) (\lambda (n: +nat).(\lambda (d: nat).(\lambda (H: (subst0 d u (TSort n) (TSort +n))).(\lambda (P: Prop).(subst0_gen_sort u (TSort n) d n H P))))) (\lambda +(n: nat).(\lambda (d: nat).(\lambda (H: (subst0 d u (TLRef n) (TLRef +n))).(\lambda (P: Prop).(and_ind (eq nat n d) (eq T (TLRef n) (lift (S n) O +u)) P (\lambda (_: (eq nat n d)).(\lambda (H1: (eq T (TLRef n) (lift (S n) O +u))).(lift_gen_lref_false (S n) O n (le_O_n n) (le_n (plus O (S n))) u H1 +P))) (subst0_gen_lref u (TLRef n) d n H)))))) (\lambda (k: K).(\lambda (t0: +T).(\lambda (H: ((\forall (d: nat).((subst0 d u t0 t0) \to (\forall (P: +Prop).P))))).(\lambda (t1: T).(\lambda (H0: ((\forall (d: nat).((subst0 d u +t1 t1) \to (\forall (P: Prop).P))))).(\lambda (d: nat).(\lambda (H1: (subst0 +d u (THead k t0 t1) (THead k t0 t1))).(\lambda (P: Prop).(or3_ind (ex2 T +(\lambda (u2: T).(eq T (THead k t0 t1) (THead k u2 t1))) (\lambda (u2: +T).(subst0 d u t0 u2))) (ex2 T (\lambda (t2: T).(eq T (THead k t0 t1) (THead +k t0 t2))) (\lambda (t2: T).(subst0 (s k d) u t1 t2))) (ex3_2 T T (\lambda +(u2: T).(\lambda (t2: T).(eq T (THead k t0 t1) (THead k u2 t2)))) (\lambda +(u2: T).(\lambda (_: T).(subst0 d u t0 u2))) (\lambda (_: T).(\lambda (t2: +T).(subst0 (s k d) u t1 t2)))) P (\lambda (H2: (ex2 T (\lambda (u2: T).(eq T +(THead k t0 t1) (THead k u2 t1))) (\lambda (u2: T).(subst0 d u t0 +u2)))).(ex2_ind T (\lambda (u2: T).(eq T (THead k t0 t1) (THead k u2 t1))) +(\lambda (u2: T).(subst0 d u t0 u2)) P (\lambda (x: T).(\lambda (H3: (eq T +(THead k t0 t1) (THead k x t1))).(\lambda (H4: (subst0 d u t0 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 k t0 t1) (THead k x t1) H3) in (let H6 \def (eq_ind_r +T x (\lambda (t: T).(subst0 d u t0 t)) H4 t0 H5) in (H d H6 P)))))) H2)) +(\lambda (H2: (ex2 T (\lambda (t2: T).(eq T (THead k t0 t1) (THead k t0 t2))) +(\lambda (t2: T).(subst0 (s k d) u t1 t2)))).(ex2_ind T (\lambda (t2: T).(eq +T (THead k t0 t1) (THead k t0 t2))) (\lambda (t2: T).(subst0 (s k d) u t1 +t2)) P (\lambda (x: T).(\lambda (H3: (eq T (THead k t0 t1) (THead k t0 +x))).(\lambda (H4: (subst0 (s k d) u t1 x)).(let H5 \def (f_equal T T +(\lambda (e: T).(match e in T return (\lambda (_: T).T) with [(TSort _) +\Rightarrow t1 | (TLRef _) \Rightarrow t1 | (THead _ _ t) \Rightarrow t])) +(THead k t0 t1) (THead k t0 x) H3) in (let H6 \def (eq_ind_r T x (\lambda (t: +T).(subst0 (s k d) u t1 t)) H4 t1 H5) in (H0 (s k d) H6 P)))))) H2)) (\lambda +(H2: (ex3_2 T T (\lambda (u2: T).(\lambda (t2: T).(eq T (THead k t0 t1) +(THead k u2 t2)))) (\lambda (u2: T).(\lambda (_: T).(subst0 d u t0 u2))) +(\lambda (_: T).(\lambda (t2: T).(subst0 (s k d) u t1 t2))))).(ex3_2_ind T T +(\lambda (u2: T).(\lambda (t2: T).(eq T (THead k t0 t1) (THead k u2 t2)))) +(\lambda (u2: T).(\lambda (_: T).(subst0 d u t0 u2))) (\lambda (_: +T).(\lambda (t2: T).(subst0 (s k d) u t1 t2))) P (\lambda (x0: T).(\lambda +(x1: T).(\lambda (H3: (eq T (THead k t0 t1) (THead k x0 x1))).(\lambda (H4: +(subst0 d u t0 x0)).(\lambda (H5: (subst0 (s k d) u t1 x1)).(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 k t0 t1) (THead k x0 x1) H3) in ((let H7 \def +(f_equal T T (\lambda (e: T).(match e in T return (\lambda (_: T).T) with +[(TSort _) \Rightarrow t1 | (TLRef _) \Rightarrow t1 | (THead _ _ t) +\Rightarrow t])) (THead k t0 t1) (THead k x0 x1) H3) in (\lambda (H8: (eq T +t0 x0)).(let H9 \def (eq_ind_r T x1 (\lambda (t: T).(subst0 (s k d) u t1 t)) +H5 t1 H7) in (let H10 \def (eq_ind_r T x0 (\lambda (t: T).(subst0 d u t0 t)) +H4 t0 H8) in (H d H10 P))))) H6))))))) H2)) (subst0_gen_head k u t0 t1 (THead +k t0 t1) d H1)))))))))) t)). + +theorem subst0_lift_lt: + \forall (t1: T).(\forall (t2: T).(\forall (u: T).(\forall (i: nat).((subst0 +i u t1 t2) \to (\forall (d: nat).((lt i d) \to (\forall (h: nat).(subst0 i +(lift h (minus d (S i)) u) (lift h d t1) (lift h d t2))))))))) +\def + \lambda (t1: T).(\lambda (t2: T).(\lambda (u: T).(\lambda (i: nat).(\lambda +(H: (subst0 i u t1 t2)).(subst0_ind (\lambda (n: nat).(\lambda (t: +T).(\lambda (t0: T).(\lambda (t3: T).(\forall (d: nat).((lt n d) \to (\forall +(h: nat).(subst0 n (lift h (minus d (S n)) t) (lift h d t0) (lift h d +t3))))))))) (\lambda (v: T).(\lambda (i0: nat).(\lambda (d: nat).(\lambda +(H0: (lt i0 d)).(\lambda (h: nat).(eq_ind_r T (TLRef i0) (\lambda (t: +T).(subst0 i0 (lift h (minus d (S i0)) v) t (lift h d (lift (S i0) O v)))) +(let w \def (minus d (S i0)) in (eq_ind nat (plus (S i0) (minus d (S i0))) +(\lambda (n: nat).(subst0 i0 (lift h w v) (TLRef i0) (lift h n (lift (S i0) O +v)))) (eq_ind_r T (lift (S i0) O (lift h (minus d (S i0)) v)) (\lambda (t: +T).(subst0 i0 (lift h w v) (TLRef i0) t)) (subst0_lref (lift h (minus d (S +i0)) v) i0) (lift h (plus (S i0) (minus d (S i0))) (lift (S i0) O v)) (lift_d +v h (S i0) (minus d (S i0)) O (le_O_n (minus d (S i0))))) d (le_plus_minus_r +(S i0) d H0))) (lift h d (TLRef i0)) (lift_lref_lt i0 h d H0))))))) (\lambda +(v: T).(\lambda (u2: T).(\lambda (u1: T).(\lambda (i0: nat).(\lambda (_: +(subst0 i0 v u1 u2)).(\lambda (H1: ((\forall (d: nat).((lt i0 d) \to (\forall +(h: nat).(subst0 i0 (lift h (minus d (S i0)) v) (lift h d u1) (lift h d +u2))))))).(\lambda (t: T).(\lambda (k: K).(\lambda (d: nat).(\lambda (H2: (lt +i0 d)).(\lambda (h: nat).(eq_ind_r T (THead k (lift h d u1) (lift h (s k d) +t)) (\lambda (t0: T).(subst0 i0 (lift h (minus d (S i0)) v) t0 (lift h d +(THead k u2 t)))) (eq_ind_r T (THead k (lift h d u2) (lift h (s k d) t)) +(\lambda (t0: T).(subst0 i0 (lift h (minus d (S i0)) v) (THead k (lift h d +u1) (lift h (s k d) t)) t0)) (subst0_fst (lift h (minus d (S i0)) v) (lift h +d u2) (lift h d u1) i0 (H1 d H2 h) (lift h (s k d) t) k) (lift h d (THead k +u2 t)) (lift_head k u2 t h d)) (lift h d (THead k u1 t)) (lift_head k u1 t h +d))))))))))))) (\lambda (k: K).(\lambda (v: T).(\lambda (t0: T).(\lambda (t3: +T).(\lambda (i0: nat).(\lambda (_: (subst0 (s k i0) v t3 t0)).(\lambda (H1: +((\forall (d: nat).((lt (s k i0) d) \to (\forall (h: nat).(subst0 (s k i0) +(lift h (minus d (S (s k i0))) v) (lift h d t3) (lift h d t0))))))).(\lambda +(u0: T).(\lambda (d: nat).(\lambda (H2: (lt i0 d)).(\lambda (h: nat).(let H3 +\def (eq_ind_r nat (S (s k i0)) (\lambda (n: nat).(\forall (d: nat).((lt (s k +i0) d) \to (\forall (h: nat).(subst0 (s k i0) (lift h (minus d n) v) (lift h +d t3) (lift h d t0)))))) H1 (s k (S i0)) (s_S k i0)) in (eq_ind_r T (THead k +(lift h d u0) (lift h (s k d) t3)) (\lambda (t: T).(subst0 i0 (lift h (minus +d (S i0)) v) t (lift h d (THead k u0 t0)))) (eq_ind_r T (THead k (lift h d +u0) (lift h (s k d) t0)) (\lambda (t: T).(subst0 i0 (lift h (minus d (S i0)) +v) (THead k (lift h d u0) (lift h (s k d) t3)) t)) (eq_ind nat (minus (s k d) +(s k (S i0))) (\lambda (n: nat).(subst0 i0 (lift h n v) (THead k (lift h d +u0) (lift h (s k d) t3)) (THead k (lift h d u0) (lift h (s k d) t0)))) +(subst0_snd k (lift h (minus (s k d) (s k (S i0))) v) (lift h (s k d) t0) +(lift h (s k d) t3) i0 (H3 (s k d) (s_lt k i0 d H2) h) (lift h d u0)) (minus +d (S i0)) (minus_s_s k d (S i0))) (lift h d (THead k u0 t0)) (lift_head k u0 +t0 h d)) (lift h d (THead k u0 t3)) (lift_head k u0 t3 h d)))))))))))))) +(\lambda (v: T).(\lambda (u1: T).(\lambda (u2: T).(\lambda (i0: nat).(\lambda +(_: (subst0 i0 v u1 u2)).(\lambda (H1: ((\forall (d: nat).((lt i0 d) \to +(\forall (h: nat).(subst0 i0 (lift h (minus d (S i0)) v) (lift h d u1) (lift +h d u2))))))).(\lambda (k: K).(\lambda (t0: T).(\lambda (t3: T).(\lambda (_: +(subst0 (s k i0) v t0 t3)).(\lambda (H3: ((\forall (d: nat).((lt (s k i0) d) +\to (\forall (h: nat).(subst0 (s k i0) (lift h (minus d (S (s k i0))) v) +(lift h d t0) (lift h d t3))))))).(\lambda (d: nat).(\lambda (H4: (lt i0 +d)).(\lambda (h: nat).(let H5 \def (eq_ind_r nat (S (s k i0)) (\lambda (n: +nat).(\forall (d: nat).((lt (s k i0) d) \to (\forall (h: nat).(subst0 (s k +i0) (lift h (minus d n) v) (lift h d t0) (lift h d t3)))))) H3 (s k (S i0)) +(s_S k i0)) in (eq_ind_r T (THead k (lift h d u1) (lift h (s k d) t0)) +(\lambda (t: T).(subst0 i0 (lift h (minus d (S i0)) v) t (lift h d (THead k +u2 t3)))) (eq_ind_r T (THead k (lift h d u2) (lift h (s k d) t3)) (\lambda +(t: T).(subst0 i0 (lift h (minus d (S i0)) v) (THead k (lift h d u1) (lift h +(s k d) t0)) t)) (subst0_both (lift h (minus d (S i0)) v) (lift h d u1) (lift +h d u2) i0 (H1 d H4 h) k (lift h (s k d) t0) (lift h (s k d) t3) (eq_ind nat +(minus (s k d) (s k (S i0))) (\lambda (n: nat).(subst0 (s k i0) (lift h n v) +(lift h (s k d) t0) (lift h (s k d) t3))) (H5 (s k d) (lt_le_S (s k i0) (s k +d) (s_lt k i0 d H4)) h) (minus d (S i0)) (minus_s_s k d (S i0)))) (lift h d +(THead k u2 t3)) (lift_head k u2 t3 h d)) (lift h d (THead k u1 t0)) +(lift_head k u1 t0 h d))))))))))))))))) i u t1 t2 H))))). + +theorem subst0_lift_ge: + \forall (t1: T).(\forall (t2: T).(\forall (u: T).(\forall (i: nat).(\forall +(h: nat).((subst0 i u t1 t2) \to (\forall (d: nat).((le d i) \to (subst0 +(plus i h) u (lift h d t1) (lift h d t2))))))))) +\def + \lambda (t1: T).(\lambda (t2: T).(\lambda (u: T).(\lambda (i: nat).(\lambda +(h: nat).(\lambda (H: (subst0 i u t1 t2)).(subst0_ind (\lambda (n: +nat).(\lambda (t: T).(\lambda (t0: T).(\lambda (t3: T).(\forall (d: nat).((le +d n) \to (subst0 (plus n h) t (lift h d t0) (lift h d t3)))))))) (\lambda (v: +T).(\lambda (i0: nat).(\lambda (d: nat).(\lambda (H0: (le d i0)).(eq_ind_r T +(TLRef (plus i0 h)) (\lambda (t: T).(subst0 (plus i0 h) v t (lift h d (lift +(S i0) O v)))) (eq_ind_r T (lift (plus h (S i0)) O v) (\lambda (t: T).(subst0 +(plus i0 h) v (TLRef (plus i0 h)) t)) (eq_ind nat (S (plus h i0)) (\lambda +(n: nat).(subst0 (plus i0 h) v (TLRef (plus i0 h)) (lift n O v))) (eq_ind_r +nat (plus h i0) (\lambda (n: nat).(subst0 n v (TLRef n) (lift (S (plus h i0)) +O v))) (subst0_lref v (plus h i0)) (plus i0 h) (plus_comm i0 h)) (plus h (S +i0)) (plus_n_Sm h i0)) (lift h d (lift (S i0) O v)) (lift_free v (S i0) h O d +(le_S d i0 H0) (le_O_n d))) (lift h d (TLRef i0)) (lift_lref_ge i0 h d +H0)))))) (\lambda (v: T).(\lambda (u2: T).(\lambda (u1: T).(\lambda (i0: +nat).(\lambda (_: (subst0 i0 v u1 u2)).(\lambda (H1: ((\forall (d: nat).((le +d i0) \to (subst0 (plus i0 h) v (lift h d u1) (lift h d u2)))))).(\lambda (t: +T).(\lambda (k: K).(\lambda (d: nat).(\lambda (H2: (le d i0)).(eq_ind_r T +(THead k (lift h d u1) (lift h (s k d) t)) (\lambda (t0: T).(subst0 (plus i0 +h) v t0 (lift h d (THead k u2 t)))) (eq_ind_r T (THead k (lift h d u2) (lift +h (s k d) t)) (\lambda (t0: T).(subst0 (plus i0 h) v (THead k (lift h d u1) +(lift h (s k d) t)) t0)) (subst0_fst v (lift h d u2) (lift h d u1) (plus i0 +h) (H1 d H2) (lift h (s k d) t) k) (lift h d (THead k u2 t)) (lift_head k u2 +t h d)) (lift h d (THead k u1 t)) (lift_head k u1 t h d)))))))))))) (\lambda +(k: K).(\lambda (v: T).(\lambda (t0: T).(\lambda (t3: T).(\lambda (i0: +nat).(\lambda (_: (subst0 (s k i0) v t3 t0)).(\lambda (H1: ((\forall (d: +nat).((le d (s k i0)) \to (subst0 (plus (s k i0) h) v (lift h d t3) (lift h d +t0)))))).(\lambda (u0: T).(\lambda (d: nat).(\lambda (H2: (le d i0)).(let H3 +\def (eq_ind_r nat (plus (s k i0) h) (\lambda (n: nat).(\forall (d: nat).((le +d (s k i0)) \to (subst0 n v (lift h d t3) (lift h d t0))))) H1 (s k (plus i0 +h)) (s_plus k i0 h)) in (eq_ind_r T (THead k (lift h d u0) (lift h (s k d) +t3)) (\lambda (t: T).(subst0 (plus i0 h) v t (lift h d (THead k u0 t0)))) +(eq_ind_r T (THead k (lift h d u0) (lift h (s k d) t0)) (\lambda (t: +T).(subst0 (plus i0 h) v (THead k (lift h d u0) (lift h (s k d) t3)) t)) +(subst0_snd k v (lift h (s k d) t0) (lift h (s k d) t3) (plus i0 h) (H3 (s k +d) (s_le k d i0 H2)) (lift h d u0)) (lift h d (THead k u0 t0)) (lift_head k +u0 t0 h d)) (lift h d (THead k u0 t3)) (lift_head k u0 t3 h d))))))))))))) +(\lambda (v: T).(\lambda (u1: T).(\lambda (u2: T).(\lambda (i0: nat).(\lambda +(_: (subst0 i0 v u1 u2)).(\lambda (H1: ((\forall (d: nat).((le d i0) \to +(subst0 (plus i0 h) v (lift h d u1) (lift h d u2)))))).(\lambda (k: +K).(\lambda (t0: T).(\lambda (t3: T).(\lambda (_: (subst0 (s k i0) v t0 +t3)).(\lambda (H3: ((\forall (d: nat).((le d (s k i0)) \to (subst0 (plus (s k +i0) h) v (lift h d t0) (lift h d t3)))))).(\lambda (d: nat).(\lambda (H4: (le +d i0)).(let H5 \def (eq_ind_r nat (plus (s k i0) h) (\lambda (n: +nat).(\forall (d: nat).((le d (s k i0)) \to (subst0 n v (lift h d t0) (lift h +d t3))))) H3 (s k (plus i0 h)) (s_plus k i0 h)) in (eq_ind_r T (THead k (lift +h d u1) (lift h (s k d) t0)) (\lambda (t: T).(subst0 (plus i0 h) v t (lift h +d (THead k u2 t3)))) (eq_ind_r T (THead k (lift h d u2) (lift h (s k d) t3)) +(\lambda (t: T).(subst0 (plus i0 h) v (THead k (lift h d u1) (lift h (s k d) +t0)) t)) (subst0_both v (lift h d u1) (lift h d u2) (plus i0 h) (H1 d H4) k +(lift h (s k d) t0) (lift h (s k d) t3) (H5 (s k d) (s_le k d i0 H4))) (lift +h d (THead k u2 t3)) (lift_head k u2 t3 h d)) (lift h d (THead k u1 t0)) +(lift_head k u1 t0 h d)))))))))))))))) i u t1 t2 H)))))). + +theorem subst0_lift_ge_S: + \forall (t1: T).(\forall (t2: T).(\forall (u: T).(\forall (i: nat).((subst0 +i u t1 t2) \to (\forall (d: nat).((le d i) \to (subst0 (S i) u (lift (S O) d +t1) (lift (S O) d t2)))))))) +\def + \lambda (t1: T).(\lambda (t2: T).(\lambda (u: T).(\lambda (i: nat).(\lambda +(H: (subst0 i u t1 t2)).(\lambda (d: nat).(\lambda (H0: (le d i)).(eq_ind nat +(plus i (S O)) (\lambda (n: nat).(subst0 n u (lift (S O) d t1) (lift (S O) d +t2))) (subst0_lift_ge t1 t2 u i (S O) H d H0) (S i) (eq_ind_r nat (plus (S O) +i) (\lambda (n: nat).(eq nat n (S i))) (refl_equal nat (S i)) (plus i (S O)) +(plus_comm i (S O)))))))))). + +theorem subst0_lift_ge_s: + \forall (t1: T).(\forall (t2: T).(\forall (u: T).(\forall (i: nat).((subst0 +i u t1 t2) \to (\forall (d: nat).((le d i) \to (\forall (b: B).(subst0 (s +(Bind b) i) u (lift (S O) d t1) (lift (S O) d t2))))))))) +\def + \lambda (t1: T).(\lambda (t2: T).(\lambda (u: T).(\lambda (i: nat).(\lambda +(H: (subst0 i u t1 t2)).(\lambda (d: nat).(\lambda (H0: (le d i)).(\lambda +(_: B).(subst0_lift_ge_S t1 t2 u i H d H0)))))))). + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/subst0/subst0.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/subst0/subst0.ma new file mode 100644 index 000000000..c09ce6c95 --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/subst0/subst0.ma @@ -0,0 +1,1373 @@ +(**************************************************************************) +(* ___ *) +(* ||M|| *) +(* ||A|| A project by Andrea Asperti *) +(* ||T|| *) +(* ||I|| Developers: *) +(* ||T|| The HELM team. *) +(* ||A|| http://helm.cs.unibo.it *) +(* \ / *) +(* \ / This file is distributed under the terms of the *) +(* v GNU General Public License Version 2 *) +(* *) +(**************************************************************************) + +(* This file was automatically generated: do not edit *********************) + +set "baseuri" "cic:/matita/LAMBDA-TYPES/Level-1/LambdaDelta/subst0/subst0". + +include "subst0/props.ma". + +theorem subst0_subst0: + \forall (t1: T).(\forall (t2: T).(\forall (u2: T).(\forall (j: nat).((subst0 +j u2 t1 t2) \to (\forall (u1: T).(\forall (u: T).(\forall (i: nat).((subst0 i +u u1 u2) \to (ex2 T (\lambda (t: T).(subst0 j u1 t1 t)) (\lambda (t: +T).(subst0 (S (plus i j)) u t t2))))))))))) +\def + \lambda (t1: T).(\lambda (t2: T).(\lambda (u2: T).(\lambda (j: nat).(\lambda +(H: (subst0 j u2 t1 t2)).(subst0_ind (\lambda (n: nat).(\lambda (t: +T).(\lambda (t0: T).(\lambda (t3: T).(\forall (u1: T).(\forall (u: +T).(\forall (i: nat).((subst0 i u u1 t) \to (ex2 T (\lambda (t4: T).(subst0 n +u1 t0 t4)) (\lambda (t4: T).(subst0 (S (plus i n)) u t4 t3))))))))))) +(\lambda (v: T).(\lambda (i: nat).(\lambda (u1: T).(\lambda (u: T).(\lambda +(i0: nat).(\lambda (H0: (subst0 i0 u u1 v)).(eq_ind nat (plus i0 (S i)) +(\lambda (n: nat).(ex2 T (\lambda (t: T).(subst0 i u1 (TLRef i) t)) (\lambda +(t: T).(subst0 n u t (lift (S i) O v))))) (ex_intro2 T (\lambda (t: +T).(subst0 i u1 (TLRef i) t)) (\lambda (t: T).(subst0 (plus i0 (S i)) u t +(lift (S i) O v))) (lift (S i) O u1) (subst0_lref u1 i) (subst0_lift_ge u1 v +u i0 (S i) H0 O (le_O_n i0))) (S (plus i0 i)) (sym_eq nat (S (plus i0 i)) +(plus i0 (S i)) (plus_n_Sm i0 i))))))))) (\lambda (v: T).(\lambda (u0: +T).(\lambda (u1: T).(\lambda (i: nat).(\lambda (_: (subst0 i v u1 +u0)).(\lambda (H1: ((\forall (u2: T).(\forall (u: T).(\forall (i0: +nat).((subst0 i0 u u2 v) \to (ex2 T (\lambda (t: T).(subst0 i u2 u1 t)) +(\lambda (t: T).(subst0 (S (plus i0 i)) u t u0))))))))).(\lambda (t: +T).(\lambda (k: K).(\lambda (u3: T).(\lambda (u: T).(\lambda (i0: +nat).(\lambda (H2: (subst0 i0 u u3 v)).(ex2_ind T (\lambda (t0: T).(subst0 i +u3 u1 t0)) (\lambda (t0: T).(subst0 (S (plus i0 i)) u t0 u0)) (ex2 T (\lambda +(t0: T).(subst0 i u3 (THead k u1 t) t0)) (\lambda (t0: T).(subst0 (S (plus i0 +i)) u t0 (THead k u0 t)))) (\lambda (x: T).(\lambda (H3: (subst0 i u3 u1 +x)).(\lambda (H4: (subst0 (S (plus i0 i)) u x u0)).(ex_intro2 T (\lambda (t0: +T).(subst0 i u3 (THead k u1 t) t0)) (\lambda (t0: T).(subst0 (S (plus i0 i)) +u t0 (THead k u0 t))) (THead k x t) (subst0_fst u3 x u1 i H3 t k) (subst0_fst +u u0 x (S (plus i0 i)) H4 t k))))) (H1 u3 u i0 H2)))))))))))))) (\lambda (k: +K).(\lambda (v: T).(\lambda (t0: T).(\lambda (t3: T).(\lambda (i: +nat).(\lambda (_: (subst0 (s k i) v t3 t0)).(\lambda (H1: ((\forall (u1: +T).(\forall (u: T).(\forall (i0: nat).((subst0 i0 u u1 v) \to (ex2 T (\lambda +(t: T).(subst0 (s k i) u1 t3 t)) (\lambda (t: T).(subst0 (S (plus i0 (s k +i))) u t t0))))))))).(\lambda (u: T).(\lambda (u1: T).(\lambda (u0: +T).(\lambda (i0: nat).(\lambda (H2: (subst0 i0 u0 u1 v)).(ex2_ind T (\lambda +(t: T).(subst0 (s k i) u1 t3 t)) (\lambda (t: T).(subst0 (S (plus i0 (s k +i))) u0 t t0)) (ex2 T (\lambda (t: T).(subst0 i u1 (THead k u t3) t)) +(\lambda (t: T).(subst0 (S (plus i0 i)) u0 t (THead k u t0)))) (\lambda (x: +T).(\lambda (H3: (subst0 (s k i) u1 t3 x)).(\lambda (H4: (subst0 (S (plus i0 +(s k i))) u0 x t0)).(let H5 \def (eq_ind_r nat (plus i0 (s k i)) (\lambda (n: +nat).(subst0 (S n) u0 x t0)) H4 (s k (plus i0 i)) (s_plus_sym k i0 i)) in +(let H6 \def (eq_ind_r nat (S (s k (plus i0 i))) (\lambda (n: nat).(subst0 n +u0 x t0)) H5 (s k (S (plus i0 i))) (s_S k (plus i0 i))) in (ex_intro2 T +(\lambda (t: T).(subst0 i u1 (THead k u t3) t)) (\lambda (t: T).(subst0 (S +(plus i0 i)) u0 t (THead k u t0))) (THead k u x) (subst0_snd k u1 x t3 i H3 +u) (subst0_snd k u0 t0 x (S (plus i0 i)) H6 u))))))) (H1 u1 u0 i0 +H2)))))))))))))) (\lambda (v: T).(\lambda (u1: T).(\lambda (u0: T).(\lambda +(i: nat).(\lambda (_: (subst0 i v u1 u0)).(\lambda (H1: ((\forall (u2: +T).(\forall (u: T).(\forall (i0: nat).((subst0 i0 u u2 v) \to (ex2 T (\lambda +(t: T).(subst0 i u2 u1 t)) (\lambda (t: T).(subst0 (S (plus i0 i)) u t +u0))))))))).(\lambda (k: K).(\lambda (t0: T).(\lambda (t3: T).(\lambda (_: +(subst0 (s k i) v t0 t3)).(\lambda (H3: ((\forall (u1: T).(\forall (u: +T).(\forall (i0: nat).((subst0 i0 u u1 v) \to (ex2 T (\lambda (t: T).(subst0 +(s k i) u1 t0 t)) (\lambda (t: T).(subst0 (S (plus i0 (s k i))) u t +t3))))))))).(\lambda (u3: T).(\lambda (u: T).(\lambda (i0: nat).(\lambda (H4: +(subst0 i0 u u3 v)).(ex2_ind T (\lambda (t: T).(subst0 (s k i) u3 t0 t)) +(\lambda (t: T).(subst0 (S (plus i0 (s k i))) u t t3)) (ex2 T (\lambda (t: +T).(subst0 i u3 (THead k u1 t0) t)) (\lambda (t: T).(subst0 (S (plus i0 i)) u +t (THead k u0 t3)))) (\lambda (x: T).(\lambda (H5: (subst0 (s k i) u3 t0 +x)).(\lambda (H6: (subst0 (S (plus i0 (s k i))) u x t3)).(ex2_ind T (\lambda +(t: T).(subst0 i u3 u1 t)) (\lambda (t: T).(subst0 (S (plus i0 i)) u t u0)) +(ex2 T (\lambda (t: T).(subst0 i u3 (THead k u1 t0) t)) (\lambda (t: +T).(subst0 (S (plus i0 i)) u t (THead k u0 t3)))) (\lambda (x0: T).(\lambda +(H7: (subst0 i u3 u1 x0)).(\lambda (H8: (subst0 (S (plus i0 i)) u x0 +u0)).(let H9 \def (eq_ind_r nat (plus i0 (s k i)) (\lambda (n: nat).(subst0 +(S n) u x t3)) H6 (s k (plus i0 i)) (s_plus_sym k i0 i)) in (let H10 \def +(eq_ind_r nat (S (s k (plus i0 i))) (\lambda (n: nat).(subst0 n u x t3)) H9 +(s k (S (plus i0 i))) (s_S k (plus i0 i))) in (ex_intro2 T (\lambda (t: +T).(subst0 i u3 (THead k u1 t0) t)) (\lambda (t: T).(subst0 (S (plus i0 i)) u +t (THead k u0 t3))) (THead k x0 x) (subst0_both u3 u1 x0 i H7 k t0 x H5) +(subst0_both u x0 u0 (S (plus i0 i)) H8 k x t3 H10))))))) (H1 u3 u i0 H4))))) +(H3 u3 u i0 H4))))))))))))))))) j u2 t1 t2 H))))). + +theorem subst0_subst0_back: + \forall (t1: T).(\forall (t2: T).(\forall (u2: T).(\forall (j: nat).((subst0 +j u2 t1 t2) \to (\forall (u1: T).(\forall (u: T).(\forall (i: nat).((subst0 i +u u2 u1) \to (ex2 T (\lambda (t: T).(subst0 j u1 t1 t)) (\lambda (t: +T).(subst0 (S (plus i j)) u t2 t))))))))))) +\def + \lambda (t1: T).(\lambda (t2: T).(\lambda (u2: T).(\lambda (j: nat).(\lambda +(H: (subst0 j u2 t1 t2)).(subst0_ind (\lambda (n: nat).(\lambda (t: +T).(\lambda (t0: T).(\lambda (t3: T).(\forall (u1: T).(\forall (u: +T).(\forall (i: nat).((subst0 i u t u1) \to (ex2 T (\lambda (t4: T).(subst0 n +u1 t0 t4)) (\lambda (t4: T).(subst0 (S (plus i n)) u t3 t4))))))))))) +(\lambda (v: T).(\lambda (i: nat).(\lambda (u1: T).(\lambda (u: T).(\lambda +(i0: nat).(\lambda (H0: (subst0 i0 u v u1)).(eq_ind nat (plus i0 (S i)) +(\lambda (n: nat).(ex2 T (\lambda (t: T).(subst0 i u1 (TLRef i) t)) (\lambda +(t: T).(subst0 n u (lift (S i) O v) t)))) (ex_intro2 T (\lambda (t: +T).(subst0 i u1 (TLRef i) t)) (\lambda (t: T).(subst0 (plus i0 (S i)) u (lift +(S i) O v) t)) (lift (S i) O u1) (subst0_lref u1 i) (subst0_lift_ge v u1 u i0 +(S i) H0 O (le_O_n i0))) (S (plus i0 i)) (sym_eq nat (S (plus i0 i)) (plus i0 +(S i)) (plus_n_Sm i0 i))))))))) (\lambda (v: T).(\lambda (u0: T).(\lambda +(u1: T).(\lambda (i: nat).(\lambda (_: (subst0 i v u1 u0)).(\lambda (H1: +((\forall (u2: T).(\forall (u: T).(\forall (i0: nat).((subst0 i0 u v u2) \to +(ex2 T (\lambda (t: T).(subst0 i u2 u1 t)) (\lambda (t: T).(subst0 (S (plus +i0 i)) u u0 t))))))))).(\lambda (t: T).(\lambda (k: K).(\lambda (u3: +T).(\lambda (u: T).(\lambda (i0: nat).(\lambda (H2: (subst0 i0 u v +u3)).(ex2_ind T (\lambda (t0: T).(subst0 i u3 u1 t0)) (\lambda (t0: +T).(subst0 (S (plus i0 i)) u u0 t0)) (ex2 T (\lambda (t0: T).(subst0 i u3 +(THead k u1 t) t0)) (\lambda (t0: T).(subst0 (S (plus i0 i)) u (THead k u0 t) +t0))) (\lambda (x: T).(\lambda (H3: (subst0 i u3 u1 x)).(\lambda (H4: (subst0 +(S (plus i0 i)) u u0 x)).(ex_intro2 T (\lambda (t0: T).(subst0 i u3 (THead k +u1 t) t0)) (\lambda (t0: T).(subst0 (S (plus i0 i)) u (THead k u0 t) t0)) +(THead k x t) (subst0_fst u3 x u1 i H3 t k) (subst0_fst u x u0 (S (plus i0 +i)) H4 t k))))) (H1 u3 u i0 H2)))))))))))))) (\lambda (k: K).(\lambda (v: +T).(\lambda (t0: T).(\lambda (t3: T).(\lambda (i: nat).(\lambda (_: (subst0 +(s k i) v t3 t0)).(\lambda (H1: ((\forall (u1: T).(\forall (u: T).(\forall +(i0: nat).((subst0 i0 u v u1) \to (ex2 T (\lambda (t: T).(subst0 (s k i) u1 +t3 t)) (\lambda (t: T).(subst0 (S (plus i0 (s k i))) u t0 t))))))))).(\lambda +(u: T).(\lambda (u1: T).(\lambda (u0: T).(\lambda (i0: nat).(\lambda (H2: +(subst0 i0 u0 v u1)).(ex2_ind T (\lambda (t: T).(subst0 (s k i) u1 t3 t)) +(\lambda (t: T).(subst0 (S (plus i0 (s k i))) u0 t0 t)) (ex2 T (\lambda (t: +T).(subst0 i u1 (THead k u t3) t)) (\lambda (t: T).(subst0 (S (plus i0 i)) u0 +(THead k u t0) t))) (\lambda (x: T).(\lambda (H3: (subst0 (s k i) u1 t3 +x)).(\lambda (H4: (subst0 (S (plus i0 (s k i))) u0 t0 x)).(let H5 \def +(eq_ind_r nat (plus i0 (s k i)) (\lambda (n: nat).(subst0 (S n) u0 t0 x)) H4 +(s k (plus i0 i)) (s_plus_sym k i0 i)) in (let H6 \def (eq_ind_r nat (S (s k +(plus i0 i))) (\lambda (n: nat).(subst0 n u0 t0 x)) H5 (s k (S (plus i0 i))) +(s_S k (plus i0 i))) in (ex_intro2 T (\lambda (t: T).(subst0 i u1 (THead k u +t3) t)) (\lambda (t: T).(subst0 (S (plus i0 i)) u0 (THead k u t0) t)) (THead +k u x) (subst0_snd k u1 x t3 i H3 u) (subst0_snd k u0 x t0 (S (plus i0 i)) H6 +u))))))) (H1 u1 u0 i0 H2)))))))))))))) (\lambda (v: T).(\lambda (u1: +T).(\lambda (u0: T).(\lambda (i: nat).(\lambda (_: (subst0 i v u1 +u0)).(\lambda (H1: ((\forall (u2: T).(\forall (u: T).(\forall (i0: +nat).((subst0 i0 u v u2) \to (ex2 T (\lambda (t: T).(subst0 i u2 u1 t)) +(\lambda (t: T).(subst0 (S (plus i0 i)) u u0 t))))))))).(\lambda (k: +K).(\lambda (t0: T).(\lambda (t3: T).(\lambda (_: (subst0 (s k i) v t0 +t3)).(\lambda (H3: ((\forall (u1: T).(\forall (u: T).(\forall (i0: +nat).((subst0 i0 u v u1) \to (ex2 T (\lambda (t: T).(subst0 (s k i) u1 t0 t)) +(\lambda (t: T).(subst0 (S (plus i0 (s k i))) u t3 t))))))))).(\lambda (u3: +T).(\lambda (u: T).(\lambda (i0: nat).(\lambda (H4: (subst0 i0 u v +u3)).(ex2_ind T (\lambda (t: T).(subst0 (s k i) u3 t0 t)) (\lambda (t: +T).(subst0 (S (plus i0 (s k i))) u t3 t)) (ex2 T (\lambda (t: T).(subst0 i u3 +(THead k u1 t0) t)) (\lambda (t: T).(subst0 (S (plus i0 i)) u (THead k u0 t3) +t))) (\lambda (x: T).(\lambda (H5: (subst0 (s k i) u3 t0 x)).(\lambda (H6: +(subst0 (S (plus i0 (s k i))) u t3 x)).(ex2_ind T (\lambda (t: T).(subst0 i +u3 u1 t)) (\lambda (t: T).(subst0 (S (plus i0 i)) u u0 t)) (ex2 T (\lambda +(t: T).(subst0 i u3 (THead k u1 t0) t)) (\lambda (t: T).(subst0 (S (plus i0 +i)) u (THead k u0 t3) t))) (\lambda (x0: T).(\lambda (H7: (subst0 i u3 u1 +x0)).(\lambda (H8: (subst0 (S (plus i0 i)) u u0 x0)).(let H9 \def (eq_ind_r +nat (plus i0 (s k i)) (\lambda (n: nat).(subst0 (S n) u t3 x)) H6 (s k (plus +i0 i)) (s_plus_sym k i0 i)) in (let H10 \def (eq_ind_r nat (S (s k (plus i0 +i))) (\lambda (n: nat).(subst0 n u t3 x)) H9 (s k (S (plus i0 i))) (s_S k +(plus i0 i))) in (ex_intro2 T (\lambda (t: T).(subst0 i u3 (THead k u1 t0) +t)) (\lambda (t: T).(subst0 (S (plus i0 i)) u (THead k u0 t3) t)) (THead k x0 +x) (subst0_both u3 u1 x0 i H7 k t0 x H5) (subst0_both u u0 x0 (S (plus i0 i)) +H8 k t3 x H10))))))) (H1 u3 u i0 H4))))) (H3 u3 u i0 H4))))))))))))))))) j u2 +t1 t2 H))))). + +theorem subst0_trans: + \forall (t2: T).(\forall (t1: T).(\forall (v: T).(\forall (i: nat).((subst0 +i v t1 t2) \to (\forall (t3: T).((subst0 i v t2 t3) \to (subst0 i v t1 +t3))))))) +\def + \lambda (t2: T).(\lambda (t1: T).(\lambda (v: T).(\lambda (i: nat).(\lambda +(H: (subst0 i v t1 t2)).(subst0_ind (\lambda (n: nat).(\lambda (t: +T).(\lambda (t0: T).(\lambda (t3: T).(\forall (t4: T).((subst0 n t t3 t4) \to +(subst0 n t t0 t4))))))) (\lambda (v0: T).(\lambda (i0: nat).(\lambda (t3: +T).(\lambda (H0: (subst0 i0 v0 (lift (S i0) O v0) t3)).(subst0_gen_lift_false +v0 v0 t3 (S i0) O i0 (le_O_n i0) (le_n (plus O (S i0))) H0 (subst0 i0 v0 +(TLRef i0) t3)))))) (\lambda (v0: T).(\lambda (u2: T).(\lambda (u1: +T).(\lambda (i0: nat).(\lambda (H0: (subst0 i0 v0 u1 u2)).(\lambda (H1: +((\forall (t3: T).((subst0 i0 v0 u2 t3) \to (subst0 i0 v0 u1 t3))))).(\lambda +(t: T).(\lambda (k: K).(\lambda (t3: T).(\lambda (H2: (subst0 i0 v0 (THead k +u2 t) t3)).(or3_ind (ex2 T (\lambda (u3: T).(eq T t3 (THead k u3 t))) +(\lambda (u3: T).(subst0 i0 v0 u2 u3))) (ex2 T (\lambda (t4: T).(eq T t3 +(THead k u2 t4))) (\lambda (t4: T).(subst0 (s k i0) v0 t t4))) (ex3_2 T T +(\lambda (u3: T).(\lambda (t4: T).(eq T t3 (THead k u3 t4)))) (\lambda (u3: +T).(\lambda (_: T).(subst0 i0 v0 u2 u3))) (\lambda (_: T).(\lambda (t4: +T).(subst0 (s k i0) v0 t t4)))) (subst0 i0 v0 (THead k u1 t) t3) (\lambda +(H3: (ex2 T (\lambda (u2: T).(eq T t3 (THead k u2 t))) (\lambda (u3: +T).(subst0 i0 v0 u2 u3)))).(ex2_ind T (\lambda (u3: T).(eq T t3 (THead k u3 +t))) (\lambda (u3: T).(subst0 i0 v0 u2 u3)) (subst0 i0 v0 (THead k u1 t) t3) +(\lambda (x: T).(\lambda (H4: (eq T t3 (THead k x t))).(\lambda (H5: (subst0 +i0 v0 u2 x)).(eq_ind_r T (THead k x t) (\lambda (t0: T).(subst0 i0 v0 (THead +k u1 t) t0)) (subst0_fst v0 x u1 i0 (H1 x H5) t k) t3 H4)))) H3)) (\lambda +(H3: (ex2 T (\lambda (t2: T).(eq T t3 (THead k u2 t2))) (\lambda (t2: +T).(subst0 (s k i0) v0 t t2)))).(ex2_ind T (\lambda (t4: T).(eq T t3 (THead k +u2 t4))) (\lambda (t4: T).(subst0 (s k i0) v0 t t4)) (subst0 i0 v0 (THead k +u1 t) t3) (\lambda (x: T).(\lambda (H4: (eq T t3 (THead k u2 x))).(\lambda +(H5: (subst0 (s k i0) v0 t x)).(eq_ind_r T (THead k u2 x) (\lambda (t0: +T).(subst0 i0 v0 (THead k u1 t) t0)) (subst0_both v0 u1 u2 i0 H0 k t x H5) t3 +H4)))) H3)) (\lambda (H3: (ex3_2 T T (\lambda (u2: T).(\lambda (t2: T).(eq T +t3 (THead k u2 t2)))) (\lambda (u3: T).(\lambda (_: T).(subst0 i0 v0 u2 u3))) +(\lambda (_: T).(\lambda (t2: T).(subst0 (s k i0) v0 t t2))))).(ex3_2_ind T T +(\lambda (u3: T).(\lambda (t4: T).(eq T t3 (THead k u3 t4)))) (\lambda (u3: +T).(\lambda (_: T).(subst0 i0 v0 u2 u3))) (\lambda (_: T).(\lambda (t4: +T).(subst0 (s k i0) v0 t t4))) (subst0 i0 v0 (THead k u1 t) t3) (\lambda (x0: +T).(\lambda (x1: T).(\lambda (H4: (eq T t3 (THead k x0 x1))).(\lambda (H5: +(subst0 i0 v0 u2 x0)).(\lambda (H6: (subst0 (s k i0) v0 t x1)).(eq_ind_r T +(THead k x0 x1) (\lambda (t0: T).(subst0 i0 v0 (THead k u1 t) t0)) +(subst0_both v0 u1 x0 i0 (H1 x0 H5) k t x1 H6) t3 H4)))))) H3)) +(subst0_gen_head k v0 u2 t t3 i0 H2)))))))))))) (\lambda (k: K).(\lambda (v0: +T).(\lambda (t0: T).(\lambda (t3: T).(\lambda (i0: nat).(\lambda (H0: (subst0 +(s k i0) v0 t3 t0)).(\lambda (H1: ((\forall (t4: T).((subst0 (s k i0) v0 t0 +t4) \to (subst0 (s k i0) v0 t3 t4))))).(\lambda (u: T).(\lambda (t4: +T).(\lambda (H2: (subst0 i0 v0 (THead k u t0) t4)).(or3_ind (ex2 T (\lambda +(u2: T).(eq T t4 (THead k u2 t0))) (\lambda (u2: T).(subst0 i0 v0 u u2))) +(ex2 T (\lambda (t5: T).(eq T t4 (THead k u t5))) (\lambda (t5: T).(subst0 (s +k i0) v0 t0 t5))) (ex3_2 T T (\lambda (u2: T).(\lambda (t5: T).(eq T t4 +(THead k u2 t5)))) (\lambda (u2: T).(\lambda (_: T).(subst0 i0 v0 u u2))) +(\lambda (_: T).(\lambda (t5: T).(subst0 (s k i0) v0 t0 t5)))) (subst0 i0 v0 +(THead k u t3) t4) (\lambda (H3: (ex2 T (\lambda (u2: T).(eq T t4 (THead k u2 +t0))) (\lambda (u2: T).(subst0 i0 v0 u u2)))).(ex2_ind T (\lambda (u2: T).(eq +T t4 (THead k u2 t0))) (\lambda (u2: T).(subst0 i0 v0 u u2)) (subst0 i0 v0 +(THead k u t3) t4) (\lambda (x: T).(\lambda (H4: (eq T t4 (THead k x +t0))).(\lambda (H5: (subst0 i0 v0 u x)).(eq_ind_r T (THead k x t0) (\lambda +(t: T).(subst0 i0 v0 (THead k u t3) t)) (subst0_both v0 u x i0 H5 k t3 t0 H0) +t4 H4)))) H3)) (\lambda (H3: (ex2 T (\lambda (t2: T).(eq T t4 (THead k u +t2))) (\lambda (t2: T).(subst0 (s k i0) v0 t0 t2)))).(ex2_ind T (\lambda (t5: +T).(eq T t4 (THead k u t5))) (\lambda (t5: T).(subst0 (s k i0) v0 t0 t5)) +(subst0 i0 v0 (THead k u t3) t4) (\lambda (x: T).(\lambda (H4: (eq T t4 +(THead k u x))).(\lambda (H5: (subst0 (s k i0) v0 t0 x)).(eq_ind_r T (THead k +u x) (\lambda (t: T).(subst0 i0 v0 (THead k u t3) t)) (subst0_snd k v0 x t3 +i0 (H1 x H5) u) t4 H4)))) H3)) (\lambda (H3: (ex3_2 T T (\lambda (u2: +T).(\lambda (t2: T).(eq T t4 (THead k u2 t2)))) (\lambda (u2: T).(\lambda (_: +T).(subst0 i0 v0 u u2))) (\lambda (_: T).(\lambda (t2: T).(subst0 (s k i0) v0 +t0 t2))))).(ex3_2_ind T T (\lambda (u2: T).(\lambda (t5: T).(eq T t4 (THead k +u2 t5)))) (\lambda (u2: T).(\lambda (_: T).(subst0 i0 v0 u u2))) (\lambda (_: +T).(\lambda (t5: T).(subst0 (s k i0) v0 t0 t5))) (subst0 i0 v0 (THead k u t3) +t4) (\lambda (x0: T).(\lambda (x1: T).(\lambda (H4: (eq T t4 (THead k x0 +x1))).(\lambda (H5: (subst0 i0 v0 u x0)).(\lambda (H6: (subst0 (s k i0) v0 t0 +x1)).(eq_ind_r T (THead k x0 x1) (\lambda (t: T).(subst0 i0 v0 (THead k u t3) +t)) (subst0_both v0 u x0 i0 H5 k t3 x1 (H1 x1 H6)) t4 H4)))))) H3)) +(subst0_gen_head k v0 u t0 t4 i0 H2)))))))))))) (\lambda (v0: T).(\lambda +(u1: T).(\lambda (u2: T).(\lambda (i0: nat).(\lambda (H0: (subst0 i0 v0 u1 +u2)).(\lambda (H1: ((\forall (t3: T).((subst0 i0 v0 u2 t3) \to (subst0 i0 v0 +u1 t3))))).(\lambda (k: K).(\lambda (t0: T).(\lambda (t3: T).(\lambda (H2: +(subst0 (s k i0) v0 t0 t3)).(\lambda (H3: ((\forall (t4: T).((subst0 (s k i0) +v0 t3 t4) \to (subst0 (s k i0) v0 t0 t4))))).(\lambda (t4: T).(\lambda (H4: +(subst0 i0 v0 (THead k u2 t3) t4)).(or3_ind (ex2 T (\lambda (u3: T).(eq T t4 +(THead k u3 t3))) (\lambda (u3: T).(subst0 i0 v0 u2 u3))) (ex2 T (\lambda +(t5: T).(eq T t4 (THead k u2 t5))) (\lambda (t5: T).(subst0 (s k i0) v0 t3 +t5))) (ex3_2 T T (\lambda (u3: T).(\lambda (t5: T).(eq T t4 (THead k u3 +t5)))) (\lambda (u3: T).(\lambda (_: T).(subst0 i0 v0 u2 u3))) (\lambda (_: +T).(\lambda (t5: T).(subst0 (s k i0) v0 t3 t5)))) (subst0 i0 v0 (THead k u1 +t0) t4) (\lambda (H5: (ex2 T (\lambda (u2: T).(eq T t4 (THead k u2 t3))) +(\lambda (u3: T).(subst0 i0 v0 u2 u3)))).(ex2_ind T (\lambda (u3: T).(eq T t4 +(THead k u3 t3))) (\lambda (u3: T).(subst0 i0 v0 u2 u3)) (subst0 i0 v0 (THead +k u1 t0) t4) (\lambda (x: T).(\lambda (H6: (eq T t4 (THead k x t3))).(\lambda +(H7: (subst0 i0 v0 u2 x)).(eq_ind_r T (THead k x t3) (\lambda (t: T).(subst0 +i0 v0 (THead k u1 t0) t)) (subst0_both v0 u1 x i0 (H1 x H7) k t0 t3 H2) t4 +H6)))) H5)) (\lambda (H5: (ex2 T (\lambda (t2: T).(eq T t4 (THead k u2 t2))) +(\lambda (t2: T).(subst0 (s k i0) v0 t3 t2)))).(ex2_ind T (\lambda (t5: +T).(eq T t4 (THead k u2 t5))) (\lambda (t5: T).(subst0 (s k i0) v0 t3 t5)) +(subst0 i0 v0 (THead k u1 t0) t4) (\lambda (x: T).(\lambda (H6: (eq T t4 +(THead k u2 x))).(\lambda (H7: (subst0 (s k i0) v0 t3 x)).(eq_ind_r T (THead +k u2 x) (\lambda (t: T).(subst0 i0 v0 (THead k u1 t0) t)) (subst0_both v0 u1 +u2 i0 H0 k t0 x (H3 x H7)) t4 H6)))) H5)) (\lambda (H5: (ex3_2 T T (\lambda +(u2: T).(\lambda (t2: T).(eq T t4 (THead k u2 t2)))) (\lambda (u3: +T).(\lambda (_: T).(subst0 i0 v0 u2 u3))) (\lambda (_: T).(\lambda (t2: +T).(subst0 (s k i0) v0 t3 t2))))).(ex3_2_ind T T (\lambda (u3: T).(\lambda +(t5: T).(eq T t4 (THead k u3 t5)))) (\lambda (u3: T).(\lambda (_: T).(subst0 +i0 v0 u2 u3))) (\lambda (_: T).(\lambda (t5: T).(subst0 (s k i0) v0 t3 t5))) +(subst0 i0 v0 (THead k u1 t0) t4) (\lambda (x0: T).(\lambda (x1: T).(\lambda +(H6: (eq T t4 (THead k x0 x1))).(\lambda (H7: (subst0 i0 v0 u2 x0)).(\lambda +(H8: (subst0 (s k i0) v0 t3 x1)).(eq_ind_r T (THead k x0 x1) (\lambda (t: +T).(subst0 i0 v0 (THead k u1 t0) t)) (subst0_both v0 u1 x0 i0 (H1 x0 H7) k t0 +x1 (H3 x1 H8)) t4 H6)))))) H5)) (subst0_gen_head k v0 u2 t3 t4 i0 +H4))))))))))))))) i v t1 t2 H))))). + +theorem subst0_confluence_neq: + \forall (t0: T).(\forall (t1: T).(\forall (u1: T).(\forall (i1: +nat).((subst0 i1 u1 t0 t1) \to (\forall (t2: T).(\forall (u2: T).(\forall +(i2: nat).((subst0 i2 u2 t0 t2) \to ((not (eq nat i1 i2)) \to (ex2 T (\lambda +(t: T).(subst0 i2 u2 t1 t)) (\lambda (t: T).(subst0 i1 u1 t2 t)))))))))))) +\def + \lambda (t0: T).(\lambda (t1: T).(\lambda (u1: T).(\lambda (i1: +nat).(\lambda (H: (subst0 i1 u1 t0 t1)).(subst0_ind (\lambda (n: +nat).(\lambda (t: T).(\lambda (t2: T).(\lambda (t3: T).(\forall (t4: +T).(\forall (u2: T).(\forall (i2: nat).((subst0 i2 u2 t2 t4) \to ((not (eq +nat n i2)) \to (ex2 T (\lambda (t5: T).(subst0 i2 u2 t3 t5)) (\lambda (t5: +T).(subst0 n t t4 t5)))))))))))) (\lambda (v: T).(\lambda (i: nat).(\lambda +(t2: T).(\lambda (u2: T).(\lambda (i2: nat).(\lambda (H0: (subst0 i2 u2 +(TLRef i) t2)).(\lambda (H1: (not (eq nat i i2))).(and_ind (eq nat i i2) (eq +T t2 (lift (S i) O u2)) (ex2 T (\lambda (t: T).(subst0 i2 u2 (lift (S i) O v) +t)) (\lambda (t: T).(subst0 i v t2 t))) (\lambda (H2: (eq nat i i2)).(\lambda +(H3: (eq T t2 (lift (S i) O u2))).(let H4 \def (eq_ind nat i (\lambda (n: +nat).(not (eq nat n i2))) H1 i2 H2) in (eq_ind_r T (lift (S i) O u2) (\lambda +(t: T).(ex2 T (\lambda (t3: T).(subst0 i2 u2 (lift (S i) O v) t3)) (\lambda +(t3: T).(subst0 i v t t3)))) (let H5 \def (match (H4 (refl_equal nat i2)) in +False return (\lambda (_: False).(ex2 T (\lambda (t: T).(subst0 i2 u2 (lift +(S i) O v) t)) (\lambda (t: T).(subst0 i v (lift (S i) O u2) t)))) with []) +in H5) t2 H3)))) (subst0_gen_lref u2 t2 i2 i H0))))))))) (\lambda (v: +T).(\lambda (u2: T).(\lambda (u0: T).(\lambda (i: nat).(\lambda (H0: (subst0 +i v u0 u2)).(\lambda (H1: ((\forall (t2: T).(\forall (u3: T).(\forall (i2: +nat).((subst0 i2 u3 u0 t2) \to ((not (eq nat i i2)) \to (ex2 T (\lambda (t: +T).(subst0 i2 u3 u2 t)) (\lambda (t: T).(subst0 i v t2 t)))))))))).(\lambda +(t: T).(\lambda (k: K).(\lambda (t2: T).(\lambda (u3: T).(\lambda (i2: +nat).(\lambda (H2: (subst0 i2 u3 (THead k u0 t) t2)).(\lambda (H3: (not (eq +nat i i2))).(or3_ind (ex2 T (\lambda (u4: T).(eq T t2 (THead k u4 t))) +(\lambda (u4: T).(subst0 i2 u3 u0 u4))) (ex2 T (\lambda (t3: T).(eq T t2 +(THead k u0 t3))) (\lambda (t3: T).(subst0 (s k i2) u3 t t3))) (ex3_2 T T +(\lambda (u4: T).(\lambda (t3: T).(eq T t2 (THead k u4 t3)))) (\lambda (u4: +T).(\lambda (_: T).(subst0 i2 u3 u0 u4))) (\lambda (_: T).(\lambda (t3: +T).(subst0 (s k i2) u3 t t3)))) (ex2 T (\lambda (t3: T).(subst0 i2 u3 (THead +k u2 t) t3)) (\lambda (t3: T).(subst0 i v t2 t3))) (\lambda (H4: (ex2 T +(\lambda (u2: T).(eq T t2 (THead k u2 t))) (\lambda (u2: T).(subst0 i2 u3 u0 +u2)))).(ex2_ind T (\lambda (u4: T).(eq T t2 (THead k u4 t))) (\lambda (u4: +T).(subst0 i2 u3 u0 u4)) (ex2 T (\lambda (t3: T).(subst0 i2 u3 (THead k u2 t) +t3)) (\lambda (t3: T).(subst0 i v t2 t3))) (\lambda (x: T).(\lambda (H5: (eq +T t2 (THead k x t))).(\lambda (H6: (subst0 i2 u3 u0 x)).(eq_ind_r T (THead k +x t) (\lambda (t3: T).(ex2 T (\lambda (t4: T).(subst0 i2 u3 (THead k u2 t) +t4)) (\lambda (t4: T).(subst0 i v t3 t4)))) (ex2_ind T (\lambda (t3: +T).(subst0 i2 u3 u2 t3)) (\lambda (t3: T).(subst0 i v x t3)) (ex2 T (\lambda +(t3: T).(subst0 i2 u3 (THead k u2 t) t3)) (\lambda (t3: T).(subst0 i v (THead +k x t) t3))) (\lambda (x0: T).(\lambda (H7: (subst0 i2 u3 u2 x0)).(\lambda +(H8: (subst0 i v x x0)).(ex_intro2 T (\lambda (t3: T).(subst0 i2 u3 (THead k +u2 t) t3)) (\lambda (t3: T).(subst0 i v (THead k x t) t3)) (THead k x0 t) +(subst0_fst u3 x0 u2 i2 H7 t k) (subst0_fst v x0 x i H8 t k))))) (H1 x u3 i2 +H6 H3)) t2 H5)))) H4)) (\lambda (H4: (ex2 T (\lambda (t3: T).(eq T t2 (THead +k u0 t3))) (\lambda (t2: T).(subst0 (s k i2) u3 t t2)))).(ex2_ind T (\lambda +(t3: T).(eq T t2 (THead k u0 t3))) (\lambda (t3: T).(subst0 (s k i2) u3 t +t3)) (ex2 T (\lambda (t3: T).(subst0 i2 u3 (THead k u2 t) t3)) (\lambda (t3: +T).(subst0 i v t2 t3))) (\lambda (x: T).(\lambda (H5: (eq T t2 (THead k u0 +x))).(\lambda (H6: (subst0 (s k i2) u3 t x)).(eq_ind_r T (THead k u0 x) +(\lambda (t3: T).(ex2 T (\lambda (t4: T).(subst0 i2 u3 (THead k u2 t) t4)) +(\lambda (t4: T).(subst0 i v t3 t4)))) (ex_intro2 T (\lambda (t3: T).(subst0 +i2 u3 (THead k u2 t) t3)) (\lambda (t3: T).(subst0 i v (THead k u0 x) t3)) +(THead k u2 x) (subst0_snd k u3 x t i2 H6 u2) (subst0_fst v u2 u0 i H0 x k)) +t2 H5)))) H4)) (\lambda (H4: (ex3_2 T T (\lambda (u2: T).(\lambda (t3: T).(eq +T t2 (THead k u2 t3)))) (\lambda (u2: T).(\lambda (_: T).(subst0 i2 u3 u0 +u2))) (\lambda (_: T).(\lambda (t2: T).(subst0 (s k i2) u3 t +t2))))).(ex3_2_ind T T (\lambda (u4: T).(\lambda (t3: T).(eq T t2 (THead k u4 +t3)))) (\lambda (u4: T).(\lambda (_: T).(subst0 i2 u3 u0 u4))) (\lambda (_: +T).(\lambda (t3: T).(subst0 (s k i2) u3 t t3))) (ex2 T (\lambda (t3: +T).(subst0 i2 u3 (THead k u2 t) t3)) (\lambda (t3: T).(subst0 i v t2 t3))) +(\lambda (x0: T).(\lambda (x1: T).(\lambda (H5: (eq T t2 (THead k x0 +x1))).(\lambda (H6: (subst0 i2 u3 u0 x0)).(\lambda (H7: (subst0 (s k i2) u3 t +x1)).(eq_ind_r T (THead k x0 x1) (\lambda (t3: T).(ex2 T (\lambda (t4: +T).(subst0 i2 u3 (THead k u2 t) t4)) (\lambda (t4: T).(subst0 i v t3 t4)))) +(ex2_ind T (\lambda (t3: T).(subst0 i2 u3 u2 t3)) (\lambda (t3: T).(subst0 i +v x0 t3)) (ex2 T (\lambda (t3: T).(subst0 i2 u3 (THead k u2 t) t3)) (\lambda +(t3: T).(subst0 i v (THead k x0 x1) t3))) (\lambda (x: T).(\lambda (H8: +(subst0 i2 u3 u2 x)).(\lambda (H9: (subst0 i v x0 x)).(ex_intro2 T (\lambda +(t3: T).(subst0 i2 u3 (THead k u2 t) t3)) (\lambda (t3: T).(subst0 i v (THead +k x0 x1) t3)) (THead k x x1) (subst0_both u3 u2 x i2 H8 k t x1 H7) +(subst0_fst v x x0 i H9 x1 k))))) (H1 x0 u3 i2 H6 H3)) t2 H5)))))) H4)) +(subst0_gen_head k u3 u0 t t2 i2 H2))))))))))))))) (\lambda (k: K).(\lambda +(v: T).(\lambda (t2: T).(\lambda (t3: T).(\lambda (i: nat).(\lambda (H0: +(subst0 (s k i) v t3 t2)).(\lambda (H1: ((\forall (t4: T).(\forall (u2: +T).(\forall (i2: nat).((subst0 i2 u2 t3 t4) \to ((not (eq nat (s k i) i2)) +\to (ex2 T (\lambda (t: T).(subst0 i2 u2 t2 t)) (\lambda (t: T).(subst0 (s k +i) v t4 t)))))))))).(\lambda (u: T).(\lambda (t4: T).(\lambda (u2: +T).(\lambda (i2: nat).(\lambda (H2: (subst0 i2 u2 (THead k u t3) +t4)).(\lambda (H3: (not (eq nat i i2))).(or3_ind (ex2 T (\lambda (u3: T).(eq +T t4 (THead k u3 t3))) (\lambda (u3: T).(subst0 i2 u2 u u3))) (ex2 T (\lambda +(t5: T).(eq T t4 (THead k u t5))) (\lambda (t5: T).(subst0 (s k i2) u2 t3 +t5))) (ex3_2 T T (\lambda (u3: T).(\lambda (t5: T).(eq T t4 (THead k u3 +t5)))) (\lambda (u3: T).(\lambda (_: T).(subst0 i2 u2 u u3))) (\lambda (_: +T).(\lambda (t5: T).(subst0 (s k i2) u2 t3 t5)))) (ex2 T (\lambda (t: +T).(subst0 i2 u2 (THead k u t2) t)) (\lambda (t: T).(subst0 i v t4 t))) +(\lambda (H4: (ex2 T (\lambda (u2: T).(eq T t4 (THead k u2 t3))) (\lambda +(u3: T).(subst0 i2 u2 u u3)))).(ex2_ind T (\lambda (u3: T).(eq T t4 (THead k +u3 t3))) (\lambda (u3: T).(subst0 i2 u2 u u3)) (ex2 T (\lambda (t: T).(subst0 +i2 u2 (THead k u t2) t)) (\lambda (t: T).(subst0 i v t4 t))) (\lambda (x: +T).(\lambda (H5: (eq T t4 (THead k x t3))).(\lambda (H6: (subst0 i2 u2 u +x)).(eq_ind_r T (THead k x t3) (\lambda (t: T).(ex2 T (\lambda (t5: +T).(subst0 i2 u2 (THead k u t2) t5)) (\lambda (t5: T).(subst0 i v t t5)))) +(ex_intro2 T (\lambda (t: T).(subst0 i2 u2 (THead k u t2) t)) (\lambda (t: +T).(subst0 i v (THead k x t3) t)) (THead k x t2) (subst0_fst u2 x u i2 H6 t2 +k) (subst0_snd k v t2 t3 i H0 x)) t4 H5)))) H4)) (\lambda (H4: (ex2 T +(\lambda (t2: T).(eq T t4 (THead k u t2))) (\lambda (t2: T).(subst0 (s k i2) +u2 t3 t2)))).(ex2_ind T (\lambda (t5: T).(eq T t4 (THead k u t5))) (\lambda +(t5: T).(subst0 (s k i2) u2 t3 t5)) (ex2 T (\lambda (t: T).(subst0 i2 u2 +(THead k u t2) t)) (\lambda (t: T).(subst0 i v t4 t))) (\lambda (x: +T).(\lambda (H5: (eq T t4 (THead k u x))).(\lambda (H6: (subst0 (s k i2) u2 +t3 x)).(eq_ind_r T (THead k u x) (\lambda (t: T).(ex2 T (\lambda (t5: +T).(subst0 i2 u2 (THead k u t2) t5)) (\lambda (t5: T).(subst0 i v t t5)))) +(ex2_ind T (\lambda (t: T).(subst0 (s k i2) u2 t2 t)) (\lambda (t: T).(subst0 +(s k i) v x t)) (ex2 T (\lambda (t: T).(subst0 i2 u2 (THead k u t2) t)) +(\lambda (t: T).(subst0 i v (THead k u x) t))) (\lambda (x0: T).(\lambda (H7: +(subst0 (s k i2) u2 t2 x0)).(\lambda (H8: (subst0 (s k i) v x x0)).(ex_intro2 +T (\lambda (t: T).(subst0 i2 u2 (THead k u t2) t)) (\lambda (t: T).(subst0 i +v (THead k u x) t)) (THead k u x0) (subst0_snd k u2 x0 t2 i2 H7 u) +(subst0_snd k v x0 x i H8 u))))) (H1 x u2 (s k i2) H6 (\lambda (H7: (eq nat +(s k i) (s k i2))).(H3 (s_inj k i i2 H7))))) t4 H5)))) H4)) (\lambda (H4: +(ex3_2 T T (\lambda (u2: T).(\lambda (t2: T).(eq T t4 (THead k u2 t2)))) +(\lambda (u3: T).(\lambda (_: T).(subst0 i2 u2 u u3))) (\lambda (_: +T).(\lambda (t2: T).(subst0 (s k i2) u2 t3 t2))))).(ex3_2_ind T T (\lambda +(u3: T).(\lambda (t5: T).(eq T t4 (THead k u3 t5)))) (\lambda (u3: +T).(\lambda (_: T).(subst0 i2 u2 u u3))) (\lambda (_: T).(\lambda (t5: +T).(subst0 (s k i2) u2 t3 t5))) (ex2 T (\lambda (t: T).(subst0 i2 u2 (THead k +u t2) t)) (\lambda (t: T).(subst0 i v t4 t))) (\lambda (x0: T).(\lambda (x1: +T).(\lambda (H5: (eq T t4 (THead k x0 x1))).(\lambda (H6: (subst0 i2 u2 u +x0)).(\lambda (H7: (subst0 (s k i2) u2 t3 x1)).(eq_ind_r T (THead k x0 x1) +(\lambda (t: T).(ex2 T (\lambda (t5: T).(subst0 i2 u2 (THead k u t2) t5)) +(\lambda (t5: T).(subst0 i v t t5)))) (ex2_ind T (\lambda (t: T).(subst0 (s k +i2) u2 t2 t)) (\lambda (t: T).(subst0 (s k i) v x1 t)) (ex2 T (\lambda (t: +T).(subst0 i2 u2 (THead k u t2) t)) (\lambda (t: T).(subst0 i v (THead k x0 +x1) t))) (\lambda (x: T).(\lambda (H8: (subst0 (s k i2) u2 t2 x)).(\lambda +(H9: (subst0 (s k i) v x1 x)).(ex_intro2 T (\lambda (t: T).(subst0 i2 u2 +(THead k u t2) t)) (\lambda (t: T).(subst0 i v (THead k x0 x1) t)) (THead k +x0 x) (subst0_both u2 u x0 i2 H6 k t2 x H8) (subst0_snd k v x x1 i H9 x0))))) +(H1 x1 u2 (s k i2) H7 (\lambda (H8: (eq nat (s k i) (s k i2))).(H3 (s_inj k i +i2 H8))))) t4 H5)))))) H4)) (subst0_gen_head k u2 u t3 t4 i2 +H2))))))))))))))) (\lambda (v: T).(\lambda (u0: T).(\lambda (u2: T).(\lambda +(i: nat).(\lambda (H0: (subst0 i v u0 u2)).(\lambda (H1: ((\forall (t2: +T).(\forall (u3: T).(\forall (i2: nat).((subst0 i2 u3 u0 t2) \to ((not (eq +nat i i2)) \to (ex2 T (\lambda (t: T).(subst0 i2 u3 u2 t)) (\lambda (t: +T).(subst0 i v t2 t)))))))))).(\lambda (k: K).(\lambda (t2: T).(\lambda (t3: +T).(\lambda (H2: (subst0 (s k i) v t2 t3)).(\lambda (H3: ((\forall (t4: +T).(\forall (u2: T).(\forall (i2: nat).((subst0 i2 u2 t2 t4) \to ((not (eq +nat (s k i) i2)) \to (ex2 T (\lambda (t: T).(subst0 i2 u2 t3 t)) (\lambda (t: +T).(subst0 (s k i) v t4 t)))))))))).(\lambda (t4: T).(\lambda (u3: +T).(\lambda (i2: nat).(\lambda (H4: (subst0 i2 u3 (THead k u0 t2) +t4)).(\lambda (H5: (not (eq nat i i2))).(or3_ind (ex2 T (\lambda (u4: T).(eq +T t4 (THead k u4 t2))) (\lambda (u4: T).(subst0 i2 u3 u0 u4))) (ex2 T +(\lambda (t5: T).(eq T t4 (THead k u0 t5))) (\lambda (t5: T).(subst0 (s k i2) +u3 t2 t5))) (ex3_2 T T (\lambda (u4: T).(\lambda (t5: T).(eq T t4 (THead k u4 +t5)))) (\lambda (u4: T).(\lambda (_: T).(subst0 i2 u3 u0 u4))) (\lambda (_: +T).(\lambda (t5: T).(subst0 (s k i2) u3 t2 t5)))) (ex2 T (\lambda (t: +T).(subst0 i2 u3 (THead k u2 t3) t)) (\lambda (t: T).(subst0 i v t4 t))) +(\lambda (H6: (ex2 T (\lambda (u2: T).(eq T t4 (THead k u2 t2))) (\lambda +(u2: T).(subst0 i2 u3 u0 u2)))).(ex2_ind T (\lambda (u4: T).(eq T t4 (THead k +u4 t2))) (\lambda (u4: T).(subst0 i2 u3 u0 u4)) (ex2 T (\lambda (t: +T).(subst0 i2 u3 (THead k u2 t3) t)) (\lambda (t: T).(subst0 i v t4 t))) +(\lambda (x: T).(\lambda (H7: (eq T t4 (THead k x t2))).(\lambda (H8: (subst0 +i2 u3 u0 x)).(eq_ind_r T (THead k x t2) (\lambda (t: T).(ex2 T (\lambda (t5: +T).(subst0 i2 u3 (THead k u2 t3) t5)) (\lambda (t5: T).(subst0 i v t t5)))) +(ex2_ind T (\lambda (t: T).(subst0 i2 u3 u2 t)) (\lambda (t: T).(subst0 i v x +t)) (ex2 T (\lambda (t: T).(subst0 i2 u3 (THead k u2 t3) t)) (\lambda (t: +T).(subst0 i v (THead k x t2) t))) (\lambda (x0: T).(\lambda (H9: (subst0 i2 +u3 u2 x0)).(\lambda (H10: (subst0 i v x x0)).(ex_intro2 T (\lambda (t: +T).(subst0 i2 u3 (THead k u2 t3) t)) (\lambda (t: T).(subst0 i v (THead k x +t2) t)) (THead k x0 t3) (subst0_fst u3 x0 u2 i2 H9 t3 k) (subst0_both v x x0 +i H10 k t2 t3 H2))))) (H1 x u3 i2 H8 H5)) t4 H7)))) H6)) (\lambda (H6: (ex2 T +(\lambda (t2: T).(eq T t4 (THead k u0 t2))) (\lambda (t3: T).(subst0 (s k i2) +u3 t2 t3)))).(ex2_ind T (\lambda (t5: T).(eq T t4 (THead k u0 t5))) (\lambda +(t5: T).(subst0 (s k i2) u3 t2 t5)) (ex2 T (\lambda (t: T).(subst0 i2 u3 +(THead k u2 t3) t)) (\lambda (t: T).(subst0 i v t4 t))) (\lambda (x: +T).(\lambda (H7: (eq T t4 (THead k u0 x))).(\lambda (H8: (subst0 (s k i2) u3 +t2 x)).(eq_ind_r T (THead k u0 x) (\lambda (t: T).(ex2 T (\lambda (t5: +T).(subst0 i2 u3 (THead k u2 t3) t5)) (\lambda (t5: T).(subst0 i v t t5)))) +(ex2_ind T (\lambda (t: T).(subst0 (s k i2) u3 t3 t)) (\lambda (t: T).(subst0 +(s k i) v x t)) (ex2 T (\lambda (t: T).(subst0 i2 u3 (THead k u2 t3) t)) +(\lambda (t: T).(subst0 i v (THead k u0 x) t))) (\lambda (x0: T).(\lambda +(H9: (subst0 (s k i2) u3 t3 x0)).(\lambda (H10: (subst0 (s k i) v x +x0)).(ex_intro2 T (\lambda (t: T).(subst0 i2 u3 (THead k u2 t3) t)) (\lambda +(t: T).(subst0 i v (THead k u0 x) t)) (THead k u2 x0) (subst0_snd k u3 x0 t3 +i2 H9 u2) (subst0_both v u0 u2 i H0 k x x0 H10))))) (H3 x u3 (s k i2) H8 +(\lambda (H9: (eq nat (s k i) (s k i2))).(H5 (s_inj k i i2 H9))))) t4 H7)))) +H6)) (\lambda (H6: (ex3_2 T T (\lambda (u2: T).(\lambda (t2: T).(eq T t4 +(THead k u2 t2)))) (\lambda (u2: T).(\lambda (_: T).(subst0 i2 u3 u0 u2))) +(\lambda (_: T).(\lambda (t3: T).(subst0 (s k i2) u3 t2 t3))))).(ex3_2_ind T +T (\lambda (u4: T).(\lambda (t5: T).(eq T t4 (THead k u4 t5)))) (\lambda (u4: +T).(\lambda (_: T).(subst0 i2 u3 u0 u4))) (\lambda (_: T).(\lambda (t5: +T).(subst0 (s k i2) u3 t2 t5))) (ex2 T (\lambda (t: T).(subst0 i2 u3 (THead k +u2 t3) t)) (\lambda (t: T).(subst0 i v t4 t))) (\lambda (x0: T).(\lambda (x1: +T).(\lambda (H7: (eq T t4 (THead k x0 x1))).(\lambda (H8: (subst0 i2 u3 u0 +x0)).(\lambda (H9: (subst0 (s k i2) u3 t2 x1)).(eq_ind_r T (THead k x0 x1) +(\lambda (t: T).(ex2 T (\lambda (t5: T).(subst0 i2 u3 (THead k u2 t3) t5)) +(\lambda (t5: T).(subst0 i v t t5)))) (ex2_ind T (\lambda (t: T).(subst0 i2 +u3 u2 t)) (\lambda (t: T).(subst0 i v x0 t)) (ex2 T (\lambda (t: T).(subst0 +i2 u3 (THead k u2 t3) t)) (\lambda (t: T).(subst0 i v (THead k x0 x1) t))) +(\lambda (x: T).(\lambda (H10: (subst0 i2 u3 u2 x)).(\lambda (H11: (subst0 i +v x0 x)).(ex2_ind T (\lambda (t: T).(subst0 (s k i2) u3 t3 t)) (\lambda (t: +T).(subst0 (s k i) v x1 t)) (ex2 T (\lambda (t: T).(subst0 i2 u3 (THead k u2 +t3) t)) (\lambda (t: T).(subst0 i v (THead k x0 x1) t))) (\lambda (x2: +T).(\lambda (H12: (subst0 (s k i2) u3 t3 x2)).(\lambda (H13: (subst0 (s k i) +v x1 x2)).(ex_intro2 T (\lambda (t: T).(subst0 i2 u3 (THead k u2 t3) t)) +(\lambda (t: T).(subst0 i v (THead k x0 x1) t)) (THead k x x2) (subst0_both +u3 u2 x i2 H10 k t3 x2 H12) (subst0_both v x0 x i H11 k x1 x2 H13))))) (H3 x1 +u3 (s k i2) H9 (\lambda (H12: (eq nat (s k i) (s k i2))).(H5 (s_inj k i i2 +H12)))))))) (H1 x0 u3 i2 H8 H5)) t4 H7)))))) H6)) (subst0_gen_head k u3 u0 t2 +t4 i2 H4)))))))))))))))))) i1 u1 t0 t1 H))))). + +theorem subst0_confluence_eq: + \forall (t0: T).(\forall (t1: T).(\forall (u: T).(\forall (i: nat).((subst0 +i u t0 t1) \to (\forall (t2: T).((subst0 i u t0 t2) \to (or4 (eq T t1 t2) +(ex2 T (\lambda (t: T).(subst0 i u t1 t)) (\lambda (t: T).(subst0 i u t2 t))) +(subst0 i u t1 t2) (subst0 i u t2 t1)))))))) +\def + \lambda (t0: T).(\lambda (t1: T).(\lambda (u: T).(\lambda (i: nat).(\lambda +(H: (subst0 i u t0 t1)).(subst0_ind (\lambda (n: nat).(\lambda (t: +T).(\lambda (t2: T).(\lambda (t3: T).(\forall (t4: T).((subst0 n t t2 t4) \to +(or4 (eq T t3 t4) (ex2 T (\lambda (t5: T).(subst0 n t t3 t5)) (\lambda (t5: +T).(subst0 n t t4 t5))) (subst0 n t t3 t4) (subst0 n t t4 t3)))))))) (\lambda +(v: T).(\lambda (i0: nat).(\lambda (t2: T).(\lambda (H0: (subst0 i0 v (TLRef +i0) t2)).(and_ind (eq nat i0 i0) (eq T t2 (lift (S i0) O v)) (or4 (eq T (lift +(S i0) O v) t2) (ex2 T (\lambda (t: T).(subst0 i0 v (lift (S i0) O v) t)) +(\lambda (t: T).(subst0 i0 v t2 t))) (subst0 i0 v (lift (S i0) O v) t2) +(subst0 i0 v t2 (lift (S i0) O v))) (\lambda (_: (eq nat i0 i0)).(\lambda +(H2: (eq T t2 (lift (S i0) O v))).(or4_intro0 (eq T (lift (S i0) O v) t2) +(ex2 T (\lambda (t: T).(subst0 i0 v (lift (S i0) O v) t)) (\lambda (t: +T).(subst0 i0 v t2 t))) (subst0 i0 v (lift (S i0) O v) t2) (subst0 i0 v t2 +(lift (S i0) O v)) (sym_eq T t2 (lift (S i0) O v) H2)))) (subst0_gen_lref v +t2 i0 i0 H0)))))) (\lambda (v: T).(\lambda (u2: T).(\lambda (u1: T).(\lambda +(i0: nat).(\lambda (H0: (subst0 i0 v u1 u2)).(\lambda (H1: ((\forall (t2: +T).((subst0 i0 v u1 t2) \to (or4 (eq T u2 t2) (ex2 T (\lambda (t: T).(subst0 +i0 v u2 t)) (\lambda (t: T).(subst0 i0 v t2 t))) (subst0 i0 v u2 t2) (subst0 +i0 v t2 u2)))))).(\lambda (t: T).(\lambda (k: K).(\lambda (t2: T).(\lambda +(H2: (subst0 i0 v (THead k u1 t) t2)).(or3_ind (ex2 T (\lambda (u3: T).(eq T +t2 (THead k u3 t))) (\lambda (u3: T).(subst0 i0 v u1 u3))) (ex2 T (\lambda +(t3: T).(eq T t2 (THead k u1 t3))) (\lambda (t3: T).(subst0 (s k i0) v t +t3))) (ex3_2 T T (\lambda (u3: T).(\lambda (t3: T).(eq T t2 (THead k u3 +t3)))) (\lambda (u3: T).(\lambda (_: T).(subst0 i0 v u1 u3))) (\lambda (_: +T).(\lambda (t3: T).(subst0 (s k i0) v t t3)))) (or4 (eq T (THead k u2 t) t2) +(ex2 T (\lambda (t3: T).(subst0 i0 v (THead k u2 t) t3)) (\lambda (t3: +T).(subst0 i0 v t2 t3))) (subst0 i0 v (THead k u2 t) t2) (subst0 i0 v t2 +(THead k u2 t))) (\lambda (H3: (ex2 T (\lambda (u2: T).(eq T t2 (THead k u2 +t))) (\lambda (u2: T).(subst0 i0 v u1 u2)))).(ex2_ind T (\lambda (u3: T).(eq +T t2 (THead k u3 t))) (\lambda (u3: T).(subst0 i0 v u1 u3)) (or4 (eq T (THead +k u2 t) t2) (ex2 T (\lambda (t3: T).(subst0 i0 v (THead k u2 t) t3)) (\lambda +(t3: T).(subst0 i0 v t2 t3))) (subst0 i0 v (THead k u2 t) t2) (subst0 i0 v t2 +(THead k u2 t))) (\lambda (x: T).(\lambda (H4: (eq T t2 (THead k x +t))).(\lambda (H5: (subst0 i0 v u1 x)).(eq_ind_r T (THead k x t) (\lambda +(t3: T).(or4 (eq T (THead k u2 t) t3) (ex2 T (\lambda (t4: T).(subst0 i0 v +(THead k u2 t) t4)) (\lambda (t4: T).(subst0 i0 v t3 t4))) (subst0 i0 v +(THead k u2 t) t3) (subst0 i0 v t3 (THead k u2 t)))) (or4_ind (eq T u2 x) +(ex2 T (\lambda (t3: T).(subst0 i0 v u2 t3)) (\lambda (t3: T).(subst0 i0 v x +t3))) (subst0 i0 v u2 x) (subst0 i0 v x u2) (or4 (eq T (THead k u2 t) (THead +k x t)) (ex2 T (\lambda (t3: T).(subst0 i0 v (THead k u2 t) t3)) (\lambda +(t3: T).(subst0 i0 v (THead k x t) t3))) (subst0 i0 v (THead k u2 t) (THead k +x t)) (subst0 i0 v (THead k x t) (THead k u2 t))) (\lambda (H6: (eq T u2 +x)).(eq_ind_r T x (\lambda (t3: T).(or4 (eq T (THead k t3 t) (THead k x t)) +(ex2 T (\lambda (t4: T).(subst0 i0 v (THead k t3 t) t4)) (\lambda (t4: +T).(subst0 i0 v (THead k x t) t4))) (subst0 i0 v (THead k t3 t) (THead k x +t)) (subst0 i0 v (THead k x t) (THead k t3 t)))) (or4_intro0 (eq T (THead k x +t) (THead k x t)) (ex2 T (\lambda (t3: T).(subst0 i0 v (THead k x t) t3)) +(\lambda (t3: T).(subst0 i0 v (THead k x t) t3))) (subst0 i0 v (THead k x t) +(THead k x t)) (subst0 i0 v (THead k x t) (THead k x t)) (refl_equal T (THead +k x t))) u2 H6)) (\lambda (H6: (ex2 T (\lambda (t: T).(subst0 i0 v u2 t)) +(\lambda (t: T).(subst0 i0 v x t)))).(ex2_ind T (\lambda (t3: T).(subst0 i0 v +u2 t3)) (\lambda (t3: T).(subst0 i0 v x t3)) (or4 (eq T (THead k u2 t) (THead +k x t)) (ex2 T (\lambda (t3: T).(subst0 i0 v (THead k u2 t) t3)) (\lambda +(t3: T).(subst0 i0 v (THead k x t) t3))) (subst0 i0 v (THead k u2 t) (THead k +x t)) (subst0 i0 v (THead k x t) (THead k u2 t))) (\lambda (x0: T).(\lambda +(H7: (subst0 i0 v u2 x0)).(\lambda (H8: (subst0 i0 v x x0)).(or4_intro1 (eq T +(THead k u2 t) (THead k x t)) (ex2 T (\lambda (t3: T).(subst0 i0 v (THead k +u2 t) t3)) (\lambda (t3: T).(subst0 i0 v (THead k x t) t3))) (subst0 i0 v +(THead k u2 t) (THead k x t)) (subst0 i0 v (THead k x t) (THead k u2 t)) +(ex_intro2 T (\lambda (t3: T).(subst0 i0 v (THead k u2 t) t3)) (\lambda (t3: +T).(subst0 i0 v (THead k x t) t3)) (THead k x0 t) (subst0_fst v x0 u2 i0 H7 t +k) (subst0_fst v x0 x i0 H8 t k)))))) H6)) (\lambda (H6: (subst0 i0 v u2 +x)).(or4_intro2 (eq T (THead k u2 t) (THead k x t)) (ex2 T (\lambda (t3: +T).(subst0 i0 v (THead k u2 t) t3)) (\lambda (t3: T).(subst0 i0 v (THead k x +t) t3))) (subst0 i0 v (THead k u2 t) (THead k x t)) (subst0 i0 v (THead k x +t) (THead k u2 t)) (subst0_fst v x u2 i0 H6 t k))) (\lambda (H6: (subst0 i0 v +x u2)).(or4_intro3 (eq T (THead k u2 t) (THead k x t)) (ex2 T (\lambda (t3: +T).(subst0 i0 v (THead k u2 t) t3)) (\lambda (t3: T).(subst0 i0 v (THead k x +t) t3))) (subst0 i0 v (THead k u2 t) (THead k x t)) (subst0 i0 v (THead k x +t) (THead k u2 t)) (subst0_fst v u2 x i0 H6 t k))) (H1 x H5)) t2 H4)))) H3)) +(\lambda (H3: (ex2 T (\lambda (t3: T).(eq T t2 (THead k u1 t3))) (\lambda +(t2: T).(subst0 (s k i0) v t t2)))).(ex2_ind T (\lambda (t3: T).(eq T t2 +(THead k u1 t3))) (\lambda (t3: T).(subst0 (s k i0) v t t3)) (or4 (eq T +(THead k u2 t) t2) (ex2 T (\lambda (t3: T).(subst0 i0 v (THead k u2 t) t3)) +(\lambda (t3: T).(subst0 i0 v t2 t3))) (subst0 i0 v (THead k u2 t) t2) +(subst0 i0 v t2 (THead k u2 t))) (\lambda (x: T).(\lambda (H4: (eq T t2 +(THead k u1 x))).(\lambda (H5: (subst0 (s k i0) v t x)).(eq_ind_r T (THead k +u1 x) (\lambda (t3: T).(or4 (eq T (THead k u2 t) t3) (ex2 T (\lambda (t4: +T).(subst0 i0 v (THead k u2 t) t4)) (\lambda (t4: T).(subst0 i0 v t3 t4))) +(subst0 i0 v (THead k u2 t) t3) (subst0 i0 v t3 (THead k u2 t)))) (or4_ind +(eq T u2 u2) (ex2 T (\lambda (t3: T).(subst0 i0 v u2 t3)) (\lambda (t3: +T).(subst0 i0 v u2 t3))) (subst0 i0 v u2 u2) (subst0 i0 v u2 u2) (or4 (eq T +(THead k u2 t) (THead k u1 x)) (ex2 T (\lambda (t3: T).(subst0 i0 v (THead k +u2 t) t3)) (\lambda (t3: T).(subst0 i0 v (THead k u1 x) t3))) (subst0 i0 v +(THead k u2 t) (THead k u1 x)) (subst0 i0 v (THead k u1 x) (THead k u2 t))) +(\lambda (_: (eq T u2 u2)).(or4_intro1 (eq T (THead k u2 t) (THead k u1 x)) +(ex2 T (\lambda (t3: T).(subst0 i0 v (THead k u2 t) t3)) (\lambda (t3: +T).(subst0 i0 v (THead k u1 x) t3))) (subst0 i0 v (THead k u2 t) (THead k u1 +x)) (subst0 i0 v (THead k u1 x) (THead k u2 t)) (ex_intro2 T (\lambda (t3: +T).(subst0 i0 v (THead k u2 t) t3)) (\lambda (t3: T).(subst0 i0 v (THead k u1 +x) t3)) (THead k u2 x) (subst0_snd k v x t i0 H5 u2) (subst0_fst v u2 u1 i0 +H0 x k)))) (\lambda (H6: (ex2 T (\lambda (t: T).(subst0 i0 v u2 t)) (\lambda +(t: T).(subst0 i0 v u2 t)))).(ex2_ind T (\lambda (t3: T).(subst0 i0 v u2 t3)) +(\lambda (t3: T).(subst0 i0 v u2 t3)) (or4 (eq T (THead k u2 t) (THead k u1 +x)) (ex2 T (\lambda (t3: T).(subst0 i0 v (THead k u2 t) t3)) (\lambda (t3: +T).(subst0 i0 v (THead k u1 x) t3))) (subst0 i0 v (THead k u2 t) (THead k u1 +x)) (subst0 i0 v (THead k u1 x) (THead k u2 t))) (\lambda (x0: T).(\lambda +(_: (subst0 i0 v u2 x0)).(\lambda (_: (subst0 i0 v u2 x0)).(or4_intro1 (eq T +(THead k u2 t) (THead k u1 x)) (ex2 T (\lambda (t3: T).(subst0 i0 v (THead k +u2 t) t3)) (\lambda (t3: T).(subst0 i0 v (THead k u1 x) t3))) (subst0 i0 v +(THead k u2 t) (THead k u1 x)) (subst0 i0 v (THead k u1 x) (THead k u2 t)) +(ex_intro2 T (\lambda (t3: T).(subst0 i0 v (THead k u2 t) t3)) (\lambda (t3: +T).(subst0 i0 v (THead k u1 x) t3)) (THead k u2 x) (subst0_snd k v x t i0 H5 +u2) (subst0_fst v u2 u1 i0 H0 x k)))))) H6)) (\lambda (_: (subst0 i0 v u2 +u2)).(or4_intro1 (eq T (THead k u2 t) (THead k u1 x)) (ex2 T (\lambda (t3: +T).(subst0 i0 v (THead k u2 t) t3)) (\lambda (t3: T).(subst0 i0 v (THead k u1 +x) t3))) (subst0 i0 v (THead k u2 t) (THead k u1 x)) (subst0 i0 v (THead k u1 +x) (THead k u2 t)) (ex_intro2 T (\lambda (t3: T).(subst0 i0 v (THead k u2 t) +t3)) (\lambda (t3: T).(subst0 i0 v (THead k u1 x) t3)) (THead k u2 x) +(subst0_snd k v x t i0 H5 u2) (subst0_fst v u2 u1 i0 H0 x k)))) (\lambda (_: +(subst0 i0 v u2 u2)).(or4_intro1 (eq T (THead k u2 t) (THead k u1 x)) (ex2 T +(\lambda (t3: T).(subst0 i0 v (THead k u2 t) t3)) (\lambda (t3: T).(subst0 i0 +v (THead k u1 x) t3))) (subst0 i0 v (THead k u2 t) (THead k u1 x)) (subst0 i0 +v (THead k u1 x) (THead k u2 t)) (ex_intro2 T (\lambda (t3: T).(subst0 i0 v +(THead k u2 t) t3)) (\lambda (t3: T).(subst0 i0 v (THead k u1 x) t3)) (THead +k u2 x) (subst0_snd k v x t i0 H5 u2) (subst0_fst v u2 u1 i0 H0 x k)))) (H1 +u2 H0)) t2 H4)))) H3)) (\lambda (H3: (ex3_2 T T (\lambda (u2: T).(\lambda +(t3: T).(eq T t2 (THead k u2 t3)))) (\lambda (u2: T).(\lambda (_: T).(subst0 +i0 v u1 u2))) (\lambda (_: T).(\lambda (t2: T).(subst0 (s k i0) v t +t2))))).(ex3_2_ind T T (\lambda (u3: T).(\lambda (t3: T).(eq T t2 (THead k u3 +t3)))) (\lambda (u3: T).(\lambda (_: T).(subst0 i0 v u1 u3))) (\lambda (_: +T).(\lambda (t3: T).(subst0 (s k i0) v t t3))) (or4 (eq T (THead k u2 t) t2) +(ex2 T (\lambda (t3: T).(subst0 i0 v (THead k u2 t) t3)) (\lambda (t3: +T).(subst0 i0 v t2 t3))) (subst0 i0 v (THead k u2 t) t2) (subst0 i0 v t2 +(THead k u2 t))) (\lambda (x0: T).(\lambda (x1: T).(\lambda (H4: (eq T t2 +(THead k x0 x1))).(\lambda (H5: (subst0 i0 v u1 x0)).(\lambda (H6: (subst0 (s +k i0) v t x1)).(eq_ind_r T (THead k x0 x1) (\lambda (t3: T).(or4 (eq T (THead +k u2 t) t3) (ex2 T (\lambda (t4: T).(subst0 i0 v (THead k u2 t) t4)) (\lambda +(t4: T).(subst0 i0 v t3 t4))) (subst0 i0 v (THead k u2 t) t3) (subst0 i0 v t3 +(THead k u2 t)))) (or4_ind (eq T u2 x0) (ex2 T (\lambda (t3: T).(subst0 i0 v +u2 t3)) (\lambda (t3: T).(subst0 i0 v x0 t3))) (subst0 i0 v u2 x0) (subst0 i0 +v x0 u2) (or4 (eq T (THead k u2 t) (THead k x0 x1)) (ex2 T (\lambda (t3: +T).(subst0 i0 v (THead k u2 t) t3)) (\lambda (t3: T).(subst0 i0 v (THead k x0 +x1) t3))) (subst0 i0 v (THead k u2 t) (THead k x0 x1)) (subst0 i0 v (THead k +x0 x1) (THead k u2 t))) (\lambda (H7: (eq T u2 x0)).(eq_ind_r T x0 (\lambda +(t3: T).(or4 (eq T (THead k t3 t) (THead k x0 x1)) (ex2 T (\lambda (t4: +T).(subst0 i0 v (THead k t3 t) t4)) (\lambda (t4: T).(subst0 i0 v (THead k x0 +x1) t4))) (subst0 i0 v (THead k t3 t) (THead k x0 x1)) (subst0 i0 v (THead k +x0 x1) (THead k t3 t)))) (or4_intro2 (eq T (THead k x0 t) (THead k x0 x1)) +(ex2 T (\lambda (t3: T).(subst0 i0 v (THead k x0 t) t3)) (\lambda (t3: +T).(subst0 i0 v (THead k x0 x1) t3))) (subst0 i0 v (THead k x0 t) (THead k x0 +x1)) (subst0 i0 v (THead k x0 x1) (THead k x0 t)) (subst0_snd k v x1 t i0 H6 +x0)) u2 H7)) (\lambda (H7: (ex2 T (\lambda (t: T).(subst0 i0 v u2 t)) +(\lambda (t: T).(subst0 i0 v x0 t)))).(ex2_ind T (\lambda (t3: T).(subst0 i0 +v u2 t3)) (\lambda (t3: T).(subst0 i0 v x0 t3)) (or4 (eq T (THead k u2 t) +(THead k x0 x1)) (ex2 T (\lambda (t3: T).(subst0 i0 v (THead k u2 t) t3)) +(\lambda (t3: T).(subst0 i0 v (THead k x0 x1) t3))) (subst0 i0 v (THead k u2 +t) (THead k x0 x1)) (subst0 i0 v (THead k x0 x1) (THead k u2 t))) (\lambda +(x: T).(\lambda (H8: (subst0 i0 v u2 x)).(\lambda (H9: (subst0 i0 v x0 +x)).(or4_intro1 (eq T (THead k u2 t) (THead k x0 x1)) (ex2 T (\lambda (t3: +T).(subst0 i0 v (THead k u2 t) t3)) (\lambda (t3: T).(subst0 i0 v (THead k x0 +x1) t3))) (subst0 i0 v (THead k u2 t) (THead k x0 x1)) (subst0 i0 v (THead k +x0 x1) (THead k u2 t)) (ex_intro2 T (\lambda (t3: T).(subst0 i0 v (THead k u2 +t) t3)) (\lambda (t3: T).(subst0 i0 v (THead k x0 x1) t3)) (THead k x x1) +(subst0_both v u2 x i0 H8 k t x1 H6) (subst0_fst v x x0 i0 H9 x1 k)))))) H7)) +(\lambda (H7: (subst0 i0 v u2 x0)).(or4_intro2 (eq T (THead k u2 t) (THead k +x0 x1)) (ex2 T (\lambda (t3: T).(subst0 i0 v (THead k u2 t) t3)) (\lambda +(t3: T).(subst0 i0 v (THead k x0 x1) t3))) (subst0 i0 v (THead k u2 t) (THead +k x0 x1)) (subst0 i0 v (THead k x0 x1) (THead k u2 t)) (subst0_both v u2 x0 +i0 H7 k t x1 H6))) (\lambda (H7: (subst0 i0 v x0 u2)).(or4_intro1 (eq T +(THead k u2 t) (THead k x0 x1)) (ex2 T (\lambda (t3: T).(subst0 i0 v (THead k +u2 t) t3)) (\lambda (t3: T).(subst0 i0 v (THead k x0 x1) t3))) (subst0 i0 v +(THead k u2 t) (THead k x0 x1)) (subst0 i0 v (THead k x0 x1) (THead k u2 t)) +(ex_intro2 T (\lambda (t3: T).(subst0 i0 v (THead k u2 t) t3)) (\lambda (t3: +T).(subst0 i0 v (THead k x0 x1) t3)) (THead k u2 x1) (subst0_snd k v x1 t i0 +H6 u2) (subst0_fst v u2 x0 i0 H7 x1 k)))) (H1 x0 H5)) t2 H4)))))) H3)) +(subst0_gen_head k v u1 t t2 i0 H2)))))))))))) (\lambda (k: K).(\lambda (v: +T).(\lambda (t2: T).(\lambda (t3: T).(\lambda (i0: nat).(\lambda (H0: (subst0 +(s k i0) v t3 t2)).(\lambda (H1: ((\forall (t4: T).((subst0 (s k i0) v t3 t4) +\to (or4 (eq T t2 t4) (ex2 T (\lambda (t: T).(subst0 (s k i0) v t2 t)) +(\lambda (t: T).(subst0 (s k i0) v t4 t))) (subst0 (s k i0) v t2 t4) (subst0 +(s k i0) v t4 t2)))))).(\lambda (u0: T).(\lambda (t4: T).(\lambda (H2: +(subst0 i0 v (THead k u0 t3) t4)).(or3_ind (ex2 T (\lambda (u2: T).(eq T t4 +(THead k u2 t3))) (\lambda (u2: T).(subst0 i0 v u0 u2))) (ex2 T (\lambda (t5: +T).(eq T t4 (THead k u0 t5))) (\lambda (t5: T).(subst0 (s k i0) v t3 t5))) +(ex3_2 T T (\lambda (u2: T).(\lambda (t5: T).(eq T t4 (THead k u2 t5)))) +(\lambda (u2: T).(\lambda (_: T).(subst0 i0 v u0 u2))) (\lambda (_: +T).(\lambda (t5: T).(subst0 (s k i0) v t3 t5)))) (or4 (eq T (THead k u0 t2) +t4) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k u0 t2) t)) (\lambda (t: +T).(subst0 i0 v t4 t))) (subst0 i0 v (THead k u0 t2) t4) (subst0 i0 v t4 +(THead k u0 t2))) (\lambda (H3: (ex2 T (\lambda (u2: T).(eq T t4 (THead k u2 +t3))) (\lambda (u2: T).(subst0 i0 v u0 u2)))).(ex2_ind T (\lambda (u2: T).(eq +T t4 (THead k u2 t3))) (\lambda (u2: T).(subst0 i0 v u0 u2)) (or4 (eq T +(THead k u0 t2) t4) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k u0 t2) t)) +(\lambda (t: T).(subst0 i0 v t4 t))) (subst0 i0 v (THead k u0 t2) t4) (subst0 +i0 v t4 (THead k u0 t2))) (\lambda (x: T).(\lambda (H4: (eq T t4 (THead k x +t3))).(\lambda (H5: (subst0 i0 v u0 x)).(eq_ind_r T (THead k x t3) (\lambda +(t: T).(or4 (eq T (THead k u0 t2) t) (ex2 T (\lambda (t5: T).(subst0 i0 v +(THead k u0 t2) t5)) (\lambda (t5: T).(subst0 i0 v t t5))) (subst0 i0 v +(THead k u0 t2) t) (subst0 i0 v t (THead k u0 t2)))) (or4_ind (eq T t2 t2) +(ex2 T (\lambda (t: T).(subst0 (s k i0) v t2 t)) (\lambda (t: T).(subst0 (s k +i0) v t2 t))) (subst0 (s k i0) v t2 t2) (subst0 (s k i0) v t2 t2) (or4 (eq T +(THead k u0 t2) (THead k x t3)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k +u0 t2) t)) (\lambda (t: T).(subst0 i0 v (THead k x t3) t))) (subst0 i0 v +(THead k u0 t2) (THead k x t3)) (subst0 i0 v (THead k x t3) (THead k u0 t2))) +(\lambda (_: (eq T t2 t2)).(or4_intro1 (eq T (THead k u0 t2) (THead k x t3)) +(ex2 T (\lambda (t: T).(subst0 i0 v (THead k u0 t2) t)) (\lambda (t: +T).(subst0 i0 v (THead k x t3) t))) (subst0 i0 v (THead k u0 t2) (THead k x +t3)) (subst0 i0 v (THead k x t3) (THead k u0 t2)) (ex_intro2 T (\lambda (t: +T).(subst0 i0 v (THead k u0 t2) t)) (\lambda (t: T).(subst0 i0 v (THead k x +t3) t)) (THead k x t2) (subst0_fst v x u0 i0 H5 t2 k) (subst0_snd k v t2 t3 +i0 H0 x)))) (\lambda (H6: (ex2 T (\lambda (t: T).(subst0 (s k i0) v t2 t)) +(\lambda (t: T).(subst0 (s k i0) v t2 t)))).(ex2_ind T (\lambda (t: +T).(subst0 (s k i0) v t2 t)) (\lambda (t: T).(subst0 (s k i0) v t2 t)) (or4 +(eq T (THead k u0 t2) (THead k x t3)) (ex2 T (\lambda (t: T).(subst0 i0 v +(THead k u0 t2) t)) (\lambda (t: T).(subst0 i0 v (THead k x t3) t))) (subst0 +i0 v (THead k u0 t2) (THead k x t3)) (subst0 i0 v (THead k x t3) (THead k u0 +t2))) (\lambda (x0: T).(\lambda (_: (subst0 (s k i0) v t2 x0)).(\lambda (_: +(subst0 (s k i0) v t2 x0)).(or4_intro1 (eq T (THead k u0 t2) (THead k x t3)) +(ex2 T (\lambda (t: T).(subst0 i0 v (THead k u0 t2) t)) (\lambda (t: +T).(subst0 i0 v (THead k x t3) t))) (subst0 i0 v (THead k u0 t2) (THead k x +t3)) (subst0 i0 v (THead k x t3) (THead k u0 t2)) (ex_intro2 T (\lambda (t: +T).(subst0 i0 v (THead k u0 t2) t)) (\lambda (t: T).(subst0 i0 v (THead k x +t3) t)) (THead k x t2) (subst0_fst v x u0 i0 H5 t2 k) (subst0_snd k v t2 t3 +i0 H0 x)))))) H6)) (\lambda (_: (subst0 (s k i0) v t2 t2)).(or4_intro1 (eq T +(THead k u0 t2) (THead k x t3)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k +u0 t2) t)) (\lambda (t: T).(subst0 i0 v (THead k x t3) t))) (subst0 i0 v +(THead k u0 t2) (THead k x t3)) (subst0 i0 v (THead k x t3) (THead k u0 t2)) +(ex_intro2 T (\lambda (t: T).(subst0 i0 v (THead k u0 t2) t)) (\lambda (t: +T).(subst0 i0 v (THead k x t3) t)) (THead k x t2) (subst0_fst v x u0 i0 H5 t2 +k) (subst0_snd k v t2 t3 i0 H0 x)))) (\lambda (_: (subst0 (s k i0) v t2 +t2)).(or4_intro1 (eq T (THead k u0 t2) (THead k x t3)) (ex2 T (\lambda (t: +T).(subst0 i0 v (THead k u0 t2) t)) (\lambda (t: T).(subst0 i0 v (THead k x +t3) t))) (subst0 i0 v (THead k u0 t2) (THead k x t3)) (subst0 i0 v (THead k x +t3) (THead k u0 t2)) (ex_intro2 T (\lambda (t: T).(subst0 i0 v (THead k u0 +t2) t)) (\lambda (t: T).(subst0 i0 v (THead k x t3) t)) (THead k x t2) +(subst0_fst v x u0 i0 H5 t2 k) (subst0_snd k v t2 t3 i0 H0 x)))) (H1 t2 H0)) +t4 H4)))) H3)) (\lambda (H3: (ex2 T (\lambda (t2: T).(eq T t4 (THead k u0 +t2))) (\lambda (t2: T).(subst0 (s k i0) v t3 t2)))).(ex2_ind T (\lambda (t5: +T).(eq T t4 (THead k u0 t5))) (\lambda (t5: T).(subst0 (s k i0) v t3 t5)) +(or4 (eq T (THead k u0 t2) t4) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k +u0 t2) t)) (\lambda (t: T).(subst0 i0 v t4 t))) (subst0 i0 v (THead k u0 t2) +t4) (subst0 i0 v t4 (THead k u0 t2))) (\lambda (x: T).(\lambda (H4: (eq T t4 +(THead k u0 x))).(\lambda (H5: (subst0 (s k i0) v t3 x)).(eq_ind_r T (THead k +u0 x) (\lambda (t: T).(or4 (eq T (THead k u0 t2) t) (ex2 T (\lambda (t5: +T).(subst0 i0 v (THead k u0 t2) t5)) (\lambda (t5: T).(subst0 i0 v t t5))) +(subst0 i0 v (THead k u0 t2) t) (subst0 i0 v t (THead k u0 t2)))) (or4_ind +(eq T t2 x) (ex2 T (\lambda (t: T).(subst0 (s k i0) v t2 t)) (\lambda (t: +T).(subst0 (s k i0) v x t))) (subst0 (s k i0) v t2 x) (subst0 (s k i0) v x +t2) (or4 (eq T (THead k u0 t2) (THead k u0 x)) (ex2 T (\lambda (t: T).(subst0 +i0 v (THead k u0 t2) t)) (\lambda (t: T).(subst0 i0 v (THead k u0 x) t))) +(subst0 i0 v (THead k u0 t2) (THead k u0 x)) (subst0 i0 v (THead k u0 x) +(THead k u0 t2))) (\lambda (H6: (eq T t2 x)).(eq_ind_r T x (\lambda (t: +T).(or4 (eq T (THead k u0 t) (THead k u0 x)) (ex2 T (\lambda (t5: T).(subst0 +i0 v (THead k u0 t) t5)) (\lambda (t5: T).(subst0 i0 v (THead k u0 x) t5))) +(subst0 i0 v (THead k u0 t) (THead k u0 x)) (subst0 i0 v (THead k u0 x) +(THead k u0 t)))) (or4_intro0 (eq T (THead k u0 x) (THead k u0 x)) (ex2 T +(\lambda (t: T).(subst0 i0 v (THead k u0 x) t)) (\lambda (t: T).(subst0 i0 v +(THead k u0 x) t))) (subst0 i0 v (THead k u0 x) (THead k u0 x)) (subst0 i0 v +(THead k u0 x) (THead k u0 x)) (refl_equal T (THead k u0 x))) t2 H6)) +(\lambda (H6: (ex2 T (\lambda (t: T).(subst0 (s k i0) v t2 t)) (\lambda (t: +T).(subst0 (s k i0) v x t)))).(ex2_ind T (\lambda (t: T).(subst0 (s k i0) v +t2 t)) (\lambda (t: T).(subst0 (s k i0) v x t)) (or4 (eq T (THead k u0 t2) +(THead k u0 x)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k u0 t2) t)) +(\lambda (t: T).(subst0 i0 v (THead k u0 x) t))) (subst0 i0 v (THead k u0 t2) +(THead k u0 x)) (subst0 i0 v (THead k u0 x) (THead k u0 t2))) (\lambda (x0: +T).(\lambda (H7: (subst0 (s k i0) v t2 x0)).(\lambda (H8: (subst0 (s k i0) v +x x0)).(or4_intro1 (eq T (THead k u0 t2) (THead k u0 x)) (ex2 T (\lambda (t: +T).(subst0 i0 v (THead k u0 t2) t)) (\lambda (t: T).(subst0 i0 v (THead k u0 +x) t))) (subst0 i0 v (THead k u0 t2) (THead k u0 x)) (subst0 i0 v (THead k u0 +x) (THead k u0 t2)) (ex_intro2 T (\lambda (t: T).(subst0 i0 v (THead k u0 t2) +t)) (\lambda (t: T).(subst0 i0 v (THead k u0 x) t)) (THead k u0 x0) +(subst0_snd k v x0 t2 i0 H7 u0) (subst0_snd k v x0 x i0 H8 u0)))))) H6)) +(\lambda (H6: (subst0 (s k i0) v t2 x)).(or4_intro2 (eq T (THead k u0 t2) +(THead k u0 x)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k u0 t2) t)) +(\lambda (t: T).(subst0 i0 v (THead k u0 x) t))) (subst0 i0 v (THead k u0 t2) +(THead k u0 x)) (subst0 i0 v (THead k u0 x) (THead k u0 t2)) (subst0_snd k v +x t2 i0 H6 u0))) (\lambda (H6: (subst0 (s k i0) v x t2)).(or4_intro3 (eq T +(THead k u0 t2) (THead k u0 x)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k +u0 t2) t)) (\lambda (t: T).(subst0 i0 v (THead k u0 x) t))) (subst0 i0 v +(THead k u0 t2) (THead k u0 x)) (subst0 i0 v (THead k u0 x) (THead k u0 t2)) +(subst0_snd k v t2 x i0 H6 u0))) (H1 x H5)) t4 H4)))) H3)) (\lambda (H3: +(ex3_2 T T (\lambda (u2: T).(\lambda (t2: T).(eq T t4 (THead k u2 t2)))) +(\lambda (u2: T).(\lambda (_: T).(subst0 i0 v u0 u2))) (\lambda (_: +T).(\lambda (t2: T).(subst0 (s k i0) v t3 t2))))).(ex3_2_ind T T (\lambda +(u2: T).(\lambda (t5: T).(eq T t4 (THead k u2 t5)))) (\lambda (u2: +T).(\lambda (_: T).(subst0 i0 v u0 u2))) (\lambda (_: T).(\lambda (t5: +T).(subst0 (s k i0) v t3 t5))) (or4 (eq T (THead k u0 t2) t4) (ex2 T (\lambda +(t: T).(subst0 i0 v (THead k u0 t2) t)) (\lambda (t: T).(subst0 i0 v t4 t))) +(subst0 i0 v (THead k u0 t2) t4) (subst0 i0 v t4 (THead k u0 t2))) (\lambda +(x0: T).(\lambda (x1: T).(\lambda (H4: (eq T t4 (THead k x0 x1))).(\lambda +(H5: (subst0 i0 v u0 x0)).(\lambda (H6: (subst0 (s k i0) v t3 x1)).(eq_ind_r +T (THead k x0 x1) (\lambda (t: T).(or4 (eq T (THead k u0 t2) t) (ex2 T +(\lambda (t5: T).(subst0 i0 v (THead k u0 t2) t5)) (\lambda (t5: T).(subst0 +i0 v t t5))) (subst0 i0 v (THead k u0 t2) t) (subst0 i0 v t (THead k u0 +t2)))) (or4_ind (eq T t2 x1) (ex2 T (\lambda (t: T).(subst0 (s k i0) v t2 t)) +(\lambda (t: T).(subst0 (s k i0) v x1 t))) (subst0 (s k i0) v t2 x1) (subst0 +(s k i0) v x1 t2) (or4 (eq T (THead k u0 t2) (THead k x0 x1)) (ex2 T (\lambda +(t: T).(subst0 i0 v (THead k u0 t2) t)) (\lambda (t: T).(subst0 i0 v (THead k +x0 x1) t))) (subst0 i0 v (THead k u0 t2) (THead k x0 x1)) (subst0 i0 v (THead +k x0 x1) (THead k u0 t2))) (\lambda (H7: (eq T t2 x1)).(eq_ind_r T x1 +(\lambda (t: T).(or4 (eq T (THead k u0 t) (THead k x0 x1)) (ex2 T (\lambda +(t5: T).(subst0 i0 v (THead k u0 t) t5)) (\lambda (t5: T).(subst0 i0 v (THead +k x0 x1) t5))) (subst0 i0 v (THead k u0 t) (THead k x0 x1)) (subst0 i0 v +(THead k x0 x1) (THead k u0 t)))) (or4_intro2 (eq T (THead k u0 x1) (THead k +x0 x1)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k u0 x1) t)) (\lambda (t: +T).(subst0 i0 v (THead k x0 x1) t))) (subst0 i0 v (THead k u0 x1) (THead k x0 +x1)) (subst0 i0 v (THead k x0 x1) (THead k u0 x1)) (subst0_fst v x0 u0 i0 H5 +x1 k)) t2 H7)) (\lambda (H7: (ex2 T (\lambda (t: T).(subst0 (s k i0) v t2 t)) +(\lambda (t: T).(subst0 (s k i0) v x1 t)))).(ex2_ind T (\lambda (t: +T).(subst0 (s k i0) v t2 t)) (\lambda (t: T).(subst0 (s k i0) v x1 t)) (or4 +(eq T (THead k u0 t2) (THead k x0 x1)) (ex2 T (\lambda (t: T).(subst0 i0 v +(THead k u0 t2) t)) (\lambda (t: T).(subst0 i0 v (THead k x0 x1) t))) (subst0 +i0 v (THead k u0 t2) (THead k x0 x1)) (subst0 i0 v (THead k x0 x1) (THead k +u0 t2))) (\lambda (x: T).(\lambda (H8: (subst0 (s k i0) v t2 x)).(\lambda +(H9: (subst0 (s k i0) v x1 x)).(or4_intro1 (eq T (THead k u0 t2) (THead k x0 +x1)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k u0 t2) t)) (\lambda (t: +T).(subst0 i0 v (THead k x0 x1) t))) (subst0 i0 v (THead k u0 t2) (THead k x0 +x1)) (subst0 i0 v (THead k x0 x1) (THead k u0 t2)) (ex_intro2 T (\lambda (t: +T).(subst0 i0 v (THead k u0 t2) t)) (\lambda (t: T).(subst0 i0 v (THead k x0 +x1) t)) (THead k x0 x) (subst0_both v u0 x0 i0 H5 k t2 x H8) (subst0_snd k v +x x1 i0 H9 x0)))))) H7)) (\lambda (H7: (subst0 (s k i0) v t2 x1)).(or4_intro2 +(eq T (THead k u0 t2) (THead k x0 x1)) (ex2 T (\lambda (t: T).(subst0 i0 v +(THead k u0 t2) t)) (\lambda (t: T).(subst0 i0 v (THead k x0 x1) t))) (subst0 +i0 v (THead k u0 t2) (THead k x0 x1)) (subst0 i0 v (THead k x0 x1) (THead k +u0 t2)) (subst0_both v u0 x0 i0 H5 k t2 x1 H7))) (\lambda (H7: (subst0 (s k +i0) v x1 t2)).(or4_intro1 (eq T (THead k u0 t2) (THead k x0 x1)) (ex2 T +(\lambda (t: T).(subst0 i0 v (THead k u0 t2) t)) (\lambda (t: T).(subst0 i0 v +(THead k x0 x1) t))) (subst0 i0 v (THead k u0 t2) (THead k x0 x1)) (subst0 i0 +v (THead k x0 x1) (THead k u0 t2)) (ex_intro2 T (\lambda (t: T).(subst0 i0 v +(THead k u0 t2) t)) (\lambda (t: T).(subst0 i0 v (THead k x0 x1) t)) (THead k +x0 t2) (subst0_fst v x0 u0 i0 H5 t2 k) (subst0_snd k v t2 x1 i0 H7 x0)))) (H1 +x1 H6)) t4 H4)))))) H3)) (subst0_gen_head k v u0 t3 t4 i0 H2)))))))))))) +(\lambda (v: T).(\lambda (u1: T).(\lambda (u2: T).(\lambda (i0: nat).(\lambda +(H0: (subst0 i0 v u1 u2)).(\lambda (H1: ((\forall (t2: T).((subst0 i0 v u1 +t2) \to (or4 (eq T u2 t2) (ex2 T (\lambda (t: T).(subst0 i0 v u2 t)) (\lambda +(t: T).(subst0 i0 v t2 t))) (subst0 i0 v u2 t2) (subst0 i0 v t2 +u2)))))).(\lambda (k: K).(\lambda (t2: T).(\lambda (t3: T).(\lambda (H2: +(subst0 (s k i0) v t2 t3)).(\lambda (H3: ((\forall (t4: T).((subst0 (s k i0) +v t2 t4) \to (or4 (eq T t3 t4) (ex2 T (\lambda (t: T).(subst0 (s k i0) v t3 +t)) (\lambda (t: T).(subst0 (s k i0) v t4 t))) (subst0 (s k i0) v t3 t4) +(subst0 (s k i0) v t4 t3)))))).(\lambda (t4: T).(\lambda (H4: (subst0 i0 v +(THead k u1 t2) t4)).(or3_ind (ex2 T (\lambda (u3: T).(eq T t4 (THead k u3 +t2))) (\lambda (u3: T).(subst0 i0 v u1 u3))) (ex2 T (\lambda (t5: T).(eq T t4 +(THead k u1 t5))) (\lambda (t5: T).(subst0 (s k i0) v t2 t5))) (ex3_2 T T +(\lambda (u3: T).(\lambda (t5: T).(eq T t4 (THead k u3 t5)))) (\lambda (u3: +T).(\lambda (_: T).(subst0 i0 v u1 u3))) (\lambda (_: T).(\lambda (t5: +T).(subst0 (s k i0) v t2 t5)))) (or4 (eq T (THead k u2 t3) t4) (ex2 T +(\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v +t4 t))) (subst0 i0 v (THead k u2 t3) t4) (subst0 i0 v t4 (THead k u2 t3))) +(\lambda (H5: (ex2 T (\lambda (u2: T).(eq T t4 (THead k u2 t2))) (\lambda +(u2: T).(subst0 i0 v u1 u2)))).(ex2_ind T (\lambda (u3: T).(eq T t4 (THead k +u3 t2))) (\lambda (u3: T).(subst0 i0 v u1 u3)) (or4 (eq T (THead k u2 t3) t4) +(ex2 T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: +T).(subst0 i0 v t4 t))) (subst0 i0 v (THead k u2 t3) t4) (subst0 i0 v t4 +(THead k u2 t3))) (\lambda (x: T).(\lambda (H6: (eq T t4 (THead k x +t2))).(\lambda (H7: (subst0 i0 v u1 x)).(eq_ind_r T (THead k x t2) (\lambda +(t: T).(or4 (eq T (THead k u2 t3) t) (ex2 T (\lambda (t5: T).(subst0 i0 v +(THead k u2 t3) t5)) (\lambda (t5: T).(subst0 i0 v t t5))) (subst0 i0 v +(THead k u2 t3) t) (subst0 i0 v t (THead k u2 t3)))) (or4_ind (eq T t3 t3) +(ex2 T (\lambda (t: T).(subst0 (s k i0) v t3 t)) (\lambda (t: T).(subst0 (s k +i0) v t3 t))) (subst0 (s k i0) v t3 t3) (subst0 (s k i0) v t3 t3) (or4 (eq T +(THead k u2 t3) (THead k x t2)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k +u2 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k x t2) t))) (subst0 i0 v +(THead k u2 t3) (THead k x t2)) (subst0 i0 v (THead k x t2) (THead k u2 t3))) +(\lambda (_: (eq T t3 t3)).(or4_ind (eq T u2 x) (ex2 T (\lambda (t: +T).(subst0 i0 v u2 t)) (\lambda (t: T).(subst0 i0 v x t))) (subst0 i0 v u2 x) +(subst0 i0 v x u2) (or4 (eq T (THead k u2 t3) (THead k x t2)) (ex2 T (\lambda +(t: T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k +x t2) t))) (subst0 i0 v (THead k u2 t3) (THead k x t2)) (subst0 i0 v (THead k +x t2) (THead k u2 t3))) (\lambda (H9: (eq T u2 x)).(eq_ind_r T x (\lambda (t: +T).(or4 (eq T (THead k t t3) (THead k x t2)) (ex2 T (\lambda (t5: T).(subst0 +i0 v (THead k t t3) t5)) (\lambda (t5: T).(subst0 i0 v (THead k x t2) t5))) +(subst0 i0 v (THead k t t3) (THead k x t2)) (subst0 i0 v (THead k x t2) +(THead k t t3)))) (or4_intro3 (eq T (THead k x t3) (THead k x t2)) (ex2 T +(\lambda (t: T).(subst0 i0 v (THead k x t3) t)) (\lambda (t: T).(subst0 i0 v +(THead k x t2) t))) (subst0 i0 v (THead k x t3) (THead k x t2)) (subst0 i0 v +(THead k x t2) (THead k x t3)) (subst0_snd k v t3 t2 i0 H2 x)) u2 H9)) +(\lambda (H9: (ex2 T (\lambda (t: T).(subst0 i0 v u2 t)) (\lambda (t: +T).(subst0 i0 v x t)))).(ex2_ind T (\lambda (t: T).(subst0 i0 v u2 t)) +(\lambda (t: T).(subst0 i0 v x t)) (or4 (eq T (THead k u2 t3) (THead k x t2)) +(ex2 T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: +T).(subst0 i0 v (THead k x t2) t))) (subst0 i0 v (THead k u2 t3) (THead k x +t2)) (subst0 i0 v (THead k x t2) (THead k u2 t3))) (\lambda (x0: T).(\lambda +(H10: (subst0 i0 v u2 x0)).(\lambda (H11: (subst0 i0 v x x0)).(or4_intro1 (eq +T (THead k u2 t3) (THead k x t2)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead +k u2 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k x t2) t))) (subst0 i0 v +(THead k u2 t3) (THead k x t2)) (subst0 i0 v (THead k x t2) (THead k u2 t3)) +(ex_intro2 T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: +T).(subst0 i0 v (THead k x t2) t)) (THead k x0 t3) (subst0_fst v x0 u2 i0 H10 +t3 k) (subst0_both v x x0 i0 H11 k t2 t3 H2)))))) H9)) (\lambda (H9: (subst0 +i0 v u2 x)).(or4_intro1 (eq T (THead k u2 t3) (THead k x t2)) (ex2 T (\lambda +(t: T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k +x t2) t))) (subst0 i0 v (THead k u2 t3) (THead k x t2)) (subst0 i0 v (THead k +x t2) (THead k u2 t3)) (ex_intro2 T (\lambda (t: T).(subst0 i0 v (THead k u2 +t3) t)) (\lambda (t: T).(subst0 i0 v (THead k x t2) t)) (THead k x t3) +(subst0_fst v x u2 i0 H9 t3 k) (subst0_snd k v t3 t2 i0 H2 x)))) (\lambda +(H9: (subst0 i0 v x u2)).(or4_intro3 (eq T (THead k u2 t3) (THead k x t2)) +(ex2 T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: +T).(subst0 i0 v (THead k x t2) t))) (subst0 i0 v (THead k u2 t3) (THead k x +t2)) (subst0 i0 v (THead k x t2) (THead k u2 t3)) (subst0_both v x u2 i0 H9 k +t2 t3 H2))) (H1 x H7))) (\lambda (H8: (ex2 T (\lambda (t: T).(subst0 (s k i0) +v t3 t)) (\lambda (t: T).(subst0 (s k i0) v t3 t)))).(ex2_ind T (\lambda (t: +T).(subst0 (s k i0) v t3 t)) (\lambda (t: T).(subst0 (s k i0) v t3 t)) (or4 +(eq T (THead k u2 t3) (THead k x t2)) (ex2 T (\lambda (t: T).(subst0 i0 v +(THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k x t2) t))) (subst0 +i0 v (THead k u2 t3) (THead k x t2)) (subst0 i0 v (THead k x t2) (THead k u2 +t3))) (\lambda (x0: T).(\lambda (_: (subst0 (s k i0) v t3 x0)).(\lambda (_: +(subst0 (s k i0) v t3 x0)).(or4_ind (eq T u2 x) (ex2 T (\lambda (t: +T).(subst0 i0 v u2 t)) (\lambda (t: T).(subst0 i0 v x t))) (subst0 i0 v u2 x) +(subst0 i0 v x u2) (or4 (eq T (THead k u2 t3) (THead k x t2)) (ex2 T (\lambda +(t: T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k +x t2) t))) (subst0 i0 v (THead k u2 t3) (THead k x t2)) (subst0 i0 v (THead k +x t2) (THead k u2 t3))) (\lambda (H11: (eq T u2 x)).(eq_ind_r T x (\lambda +(t: T).(or4 (eq T (THead k t t3) (THead k x t2)) (ex2 T (\lambda (t5: +T).(subst0 i0 v (THead k t t3) t5)) (\lambda (t5: T).(subst0 i0 v (THead k x +t2) t5))) (subst0 i0 v (THead k t t3) (THead k x t2)) (subst0 i0 v (THead k x +t2) (THead k t t3)))) (or4_intro3 (eq T (THead k x t3) (THead k x t2)) (ex2 T +(\lambda (t: T).(subst0 i0 v (THead k x t3) t)) (\lambda (t: T).(subst0 i0 v +(THead k x t2) t))) (subst0 i0 v (THead k x t3) (THead k x t2)) (subst0 i0 v +(THead k x t2) (THead k x t3)) (subst0_snd k v t3 t2 i0 H2 x)) u2 H11)) +(\lambda (H11: (ex2 T (\lambda (t: T).(subst0 i0 v u2 t)) (\lambda (t: +T).(subst0 i0 v x t)))).(ex2_ind T (\lambda (t: T).(subst0 i0 v u2 t)) +(\lambda (t: T).(subst0 i0 v x t)) (or4 (eq T (THead k u2 t3) (THead k x t2)) +(ex2 T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: +T).(subst0 i0 v (THead k x t2) t))) (subst0 i0 v (THead k u2 t3) (THead k x +t2)) (subst0 i0 v (THead k x t2) (THead k u2 t3))) (\lambda (x1: T).(\lambda +(H12: (subst0 i0 v u2 x1)).(\lambda (H13: (subst0 i0 v x x1)).(or4_intro1 (eq +T (THead k u2 t3) (THead k x t2)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead +k u2 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k x t2) t))) (subst0 i0 v +(THead k u2 t3) (THead k x t2)) (subst0 i0 v (THead k x t2) (THead k u2 t3)) +(ex_intro2 T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: +T).(subst0 i0 v (THead k x t2) t)) (THead k x1 t3) (subst0_fst v x1 u2 i0 H12 +t3 k) (subst0_both v x x1 i0 H13 k t2 t3 H2)))))) H11)) (\lambda (H11: +(subst0 i0 v u2 x)).(or4_intro1 (eq T (THead k u2 t3) (THead k x t2)) (ex2 T +(\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v +(THead k x t2) t))) (subst0 i0 v (THead k u2 t3) (THead k x t2)) (subst0 i0 v +(THead k x t2) (THead k u2 t3)) (ex_intro2 T (\lambda (t: T).(subst0 i0 v +(THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k x t2) t)) (THead k +x t3) (subst0_fst v x u2 i0 H11 t3 k) (subst0_snd k v t3 t2 i0 H2 x)))) +(\lambda (H11: (subst0 i0 v x u2)).(or4_intro3 (eq T (THead k u2 t3) (THead k +x t2)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: +T).(subst0 i0 v (THead k x t2) t))) (subst0 i0 v (THead k u2 t3) (THead k x +t2)) (subst0 i0 v (THead k x t2) (THead k u2 t3)) (subst0_both v x u2 i0 H11 +k t2 t3 H2))) (H1 x H7))))) H8)) (\lambda (_: (subst0 (s k i0) v t3 +t3)).(or4_ind (eq T u2 x) (ex2 T (\lambda (t: T).(subst0 i0 v u2 t)) (\lambda +(t: T).(subst0 i0 v x t))) (subst0 i0 v u2 x) (subst0 i0 v x u2) (or4 (eq T +(THead k u2 t3) (THead k x t2)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k +u2 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k x t2) t))) (subst0 i0 v +(THead k u2 t3) (THead k x t2)) (subst0 i0 v (THead k x t2) (THead k u2 t3))) +(\lambda (H9: (eq T u2 x)).(eq_ind_r T x (\lambda (t: T).(or4 (eq T (THead k +t t3) (THead k x t2)) (ex2 T (\lambda (t5: T).(subst0 i0 v (THead k t t3) +t5)) (\lambda (t5: T).(subst0 i0 v (THead k x t2) t5))) (subst0 i0 v (THead k +t t3) (THead k x t2)) (subst0 i0 v (THead k x t2) (THead k t t3)))) +(or4_intro3 (eq T (THead k x t3) (THead k x t2)) (ex2 T (\lambda (t: +T).(subst0 i0 v (THead k x t3) t)) (\lambda (t: T).(subst0 i0 v (THead k x +t2) t))) (subst0 i0 v (THead k x t3) (THead k x t2)) (subst0 i0 v (THead k x +t2) (THead k x t3)) (subst0_snd k v t3 t2 i0 H2 x)) u2 H9)) (\lambda (H9: +(ex2 T (\lambda (t: T).(subst0 i0 v u2 t)) (\lambda (t: T).(subst0 i0 v x +t)))).(ex2_ind T (\lambda (t: T).(subst0 i0 v u2 t)) (\lambda (t: T).(subst0 +i0 v x t)) (or4 (eq T (THead k u2 t3) (THead k x t2)) (ex2 T (\lambda (t: +T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k x +t2) t))) (subst0 i0 v (THead k u2 t3) (THead k x t2)) (subst0 i0 v (THead k x +t2) (THead k u2 t3))) (\lambda (x0: T).(\lambda (H10: (subst0 i0 v u2 +x0)).(\lambda (H11: (subst0 i0 v x x0)).(or4_intro1 (eq T (THead k u2 t3) +(THead k x t2)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) +(\lambda (t: T).(subst0 i0 v (THead k x t2) t))) (subst0 i0 v (THead k u2 t3) +(THead k x t2)) (subst0 i0 v (THead k x t2) (THead k u2 t3)) (ex_intro2 T +(\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v +(THead k x t2) t)) (THead k x0 t3) (subst0_fst v x0 u2 i0 H10 t3 k) +(subst0_both v x x0 i0 H11 k t2 t3 H2)))))) H9)) (\lambda (H9: (subst0 i0 v +u2 x)).(or4_intro1 (eq T (THead k u2 t3) (THead k x t2)) (ex2 T (\lambda (t: +T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k x +t2) t))) (subst0 i0 v (THead k u2 t3) (THead k x t2)) (subst0 i0 v (THead k x +t2) (THead k u2 t3)) (ex_intro2 T (\lambda (t: T).(subst0 i0 v (THead k u2 +t3) t)) (\lambda (t: T).(subst0 i0 v (THead k x t2) t)) (THead k x t3) +(subst0_fst v x u2 i0 H9 t3 k) (subst0_snd k v t3 t2 i0 H2 x)))) (\lambda +(H9: (subst0 i0 v x u2)).(or4_intro3 (eq T (THead k u2 t3) (THead k x t2)) +(ex2 T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: +T).(subst0 i0 v (THead k x t2) t))) (subst0 i0 v (THead k u2 t3) (THead k x +t2)) (subst0 i0 v (THead k x t2) (THead k u2 t3)) (subst0_both v x u2 i0 H9 k +t2 t3 H2))) (H1 x H7))) (\lambda (_: (subst0 (s k i0) v t3 t3)).(or4_ind (eq +T u2 x) (ex2 T (\lambda (t: T).(subst0 i0 v u2 t)) (\lambda (t: T).(subst0 i0 +v x t))) (subst0 i0 v u2 x) (subst0 i0 v x u2) (or4 (eq T (THead k u2 t3) +(THead k x t2)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) +(\lambda (t: T).(subst0 i0 v (THead k x t2) t))) (subst0 i0 v (THead k u2 t3) +(THead k x t2)) (subst0 i0 v (THead k x t2) (THead k u2 t3))) (\lambda (H9: +(eq T u2 x)).(eq_ind_r T x (\lambda (t: T).(or4 (eq T (THead k t t3) (THead k +x t2)) (ex2 T (\lambda (t5: T).(subst0 i0 v (THead k t t3) t5)) (\lambda (t5: +T).(subst0 i0 v (THead k x t2) t5))) (subst0 i0 v (THead k t t3) (THead k x +t2)) (subst0 i0 v (THead k x t2) (THead k t t3)))) (or4_intro3 (eq T (THead k +x t3) (THead k x t2)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k x t3) t)) +(\lambda (t: T).(subst0 i0 v (THead k x t2) t))) (subst0 i0 v (THead k x t3) +(THead k x t2)) (subst0 i0 v (THead k x t2) (THead k x t3)) (subst0_snd k v +t3 t2 i0 H2 x)) u2 H9)) (\lambda (H9: (ex2 T (\lambda (t: T).(subst0 i0 v u2 +t)) (\lambda (t: T).(subst0 i0 v x t)))).(ex2_ind T (\lambda (t: T).(subst0 +i0 v u2 t)) (\lambda (t: T).(subst0 i0 v x t)) (or4 (eq T (THead k u2 t3) +(THead k x t2)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) +(\lambda (t: T).(subst0 i0 v (THead k x t2) t))) (subst0 i0 v (THead k u2 t3) +(THead k x t2)) (subst0 i0 v (THead k x t2) (THead k u2 t3))) (\lambda (x0: +T).(\lambda (H10: (subst0 i0 v u2 x0)).(\lambda (H11: (subst0 i0 v x +x0)).(or4_intro1 (eq T (THead k u2 t3) (THead k x t2)) (ex2 T (\lambda (t: +T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k x +t2) t))) (subst0 i0 v (THead k u2 t3) (THead k x t2)) (subst0 i0 v (THead k x +t2) (THead k u2 t3)) (ex_intro2 T (\lambda (t: T).(subst0 i0 v (THead k u2 +t3) t)) (\lambda (t: T).(subst0 i0 v (THead k x t2) t)) (THead k x0 t3) +(subst0_fst v x0 u2 i0 H10 t3 k) (subst0_both v x x0 i0 H11 k t2 t3 H2)))))) +H9)) (\lambda (H9: (subst0 i0 v u2 x)).(or4_intro1 (eq T (THead k u2 t3) +(THead k x t2)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) +(\lambda (t: T).(subst0 i0 v (THead k x t2) t))) (subst0 i0 v (THead k u2 t3) +(THead k x t2)) (subst0 i0 v (THead k x t2) (THead k u2 t3)) (ex_intro2 T +(\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v +(THead k x t2) t)) (THead k x t3) (subst0_fst v x u2 i0 H9 t3 k) (subst0_snd +k v t3 t2 i0 H2 x)))) (\lambda (H9: (subst0 i0 v x u2)).(or4_intro3 (eq T +(THead k u2 t3) (THead k x t2)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k +u2 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k x t2) t))) (subst0 i0 v +(THead k u2 t3) (THead k x t2)) (subst0 i0 v (THead k x t2) (THead k u2 t3)) +(subst0_both v x u2 i0 H9 k t2 t3 H2))) (H1 x H7))) (H3 t3 H2)) t4 H6)))) +H5)) (\lambda (H5: (ex2 T (\lambda (t2: T).(eq T t4 (THead k u1 t2))) +(\lambda (t3: T).(subst0 (s k i0) v t2 t3)))).(ex2_ind T (\lambda (t5: T).(eq +T t4 (THead k u1 t5))) (\lambda (t5: T).(subst0 (s k i0) v t2 t5)) (or4 (eq T +(THead k u2 t3) t4) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) +(\lambda (t: T).(subst0 i0 v t4 t))) (subst0 i0 v (THead k u2 t3) t4) (subst0 +i0 v t4 (THead k u2 t3))) (\lambda (x: T).(\lambda (H6: (eq T t4 (THead k u1 +x))).(\lambda (H7: (subst0 (s k i0) v t2 x)).(eq_ind_r T (THead k u1 x) +(\lambda (t: T).(or4 (eq T (THead k u2 t3) t) (ex2 T (\lambda (t5: T).(subst0 +i0 v (THead k u2 t3) t5)) (\lambda (t5: T).(subst0 i0 v t t5))) (subst0 i0 v +(THead k u2 t3) t) (subst0 i0 v t (THead k u2 t3)))) (or4_ind (eq T t3 x) +(ex2 T (\lambda (t: T).(subst0 (s k i0) v t3 t)) (\lambda (t: T).(subst0 (s k +i0) v x t))) (subst0 (s k i0) v t3 x) (subst0 (s k i0) v x t3) (or4 (eq T +(THead k u2 t3) (THead k u1 x)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k +u2 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k u1 x) t))) (subst0 i0 v +(THead k u2 t3) (THead k u1 x)) (subst0 i0 v (THead k u1 x) (THead k u2 t3))) +(\lambda (H8: (eq T t3 x)).(eq_ind_r T x (\lambda (t: T).(or4 (eq T (THead k +u2 t) (THead k u1 x)) (ex2 T (\lambda (t5: T).(subst0 i0 v (THead k u2 t) +t5)) (\lambda (t5: T).(subst0 i0 v (THead k u1 x) t5))) (subst0 i0 v (THead k +u2 t) (THead k u1 x)) (subst0 i0 v (THead k u1 x) (THead k u2 t)))) (or4_ind +(eq T u2 u2) (ex2 T (\lambda (t: T).(subst0 i0 v u2 t)) (\lambda (t: +T).(subst0 i0 v u2 t))) (subst0 i0 v u2 u2) (subst0 i0 v u2 u2) (or4 (eq T +(THead k u2 x) (THead k u1 x)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k +u2 x) t)) (\lambda (t: T).(subst0 i0 v (THead k u1 x) t))) (subst0 i0 v +(THead k u2 x) (THead k u1 x)) (subst0 i0 v (THead k u1 x) (THead k u2 x))) +(\lambda (_: (eq T u2 u2)).(or4_intro3 (eq T (THead k u2 x) (THead k u1 x)) +(ex2 T (\lambda (t: T).(subst0 i0 v (THead k u2 x) t)) (\lambda (t: +T).(subst0 i0 v (THead k u1 x) t))) (subst0 i0 v (THead k u2 x) (THead k u1 +x)) (subst0 i0 v (THead k u1 x) (THead k u2 x)) (subst0_fst v u2 u1 i0 H0 x +k))) (\lambda (H9: (ex2 T (\lambda (t: T).(subst0 i0 v u2 t)) (\lambda (t: +T).(subst0 i0 v u2 t)))).(ex2_ind T (\lambda (t: T).(subst0 i0 v u2 t)) +(\lambda (t: T).(subst0 i0 v u2 t)) (or4 (eq T (THead k u2 x) (THead k u1 x)) +(ex2 T (\lambda (t: T).(subst0 i0 v (THead k u2 x) t)) (\lambda (t: +T).(subst0 i0 v (THead k u1 x) t))) (subst0 i0 v (THead k u2 x) (THead k u1 +x)) (subst0 i0 v (THead k u1 x) (THead k u2 x))) (\lambda (x0: T).(\lambda +(_: (subst0 i0 v u2 x0)).(\lambda (_: (subst0 i0 v u2 x0)).(or4_intro3 (eq T +(THead k u2 x) (THead k u1 x)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k +u2 x) t)) (\lambda (t: T).(subst0 i0 v (THead k u1 x) t))) (subst0 i0 v +(THead k u2 x) (THead k u1 x)) (subst0 i0 v (THead k u1 x) (THead k u2 x)) +(subst0_fst v u2 u1 i0 H0 x k))))) H9)) (\lambda (_: (subst0 i0 v u2 +u2)).(or4_intro3 (eq T (THead k u2 x) (THead k u1 x)) (ex2 T (\lambda (t: +T).(subst0 i0 v (THead k u2 x) t)) (\lambda (t: T).(subst0 i0 v (THead k u1 +x) t))) (subst0 i0 v (THead k u2 x) (THead k u1 x)) (subst0 i0 v (THead k u1 +x) (THead k u2 x)) (subst0_fst v u2 u1 i0 H0 x k))) (\lambda (_: (subst0 i0 v +u2 u2)).(or4_intro3 (eq T (THead k u2 x) (THead k u1 x)) (ex2 T (\lambda (t: +T).(subst0 i0 v (THead k u2 x) t)) (\lambda (t: T).(subst0 i0 v (THead k u1 +x) t))) (subst0 i0 v (THead k u2 x) (THead k u1 x)) (subst0 i0 v (THead k u1 +x) (THead k u2 x)) (subst0_fst v u2 u1 i0 H0 x k))) (H1 u2 H0)) t3 H8)) +(\lambda (H8: (ex2 T (\lambda (t: T).(subst0 (s k i0) v t3 t)) (\lambda (t: +T).(subst0 (s k i0) v x t)))).(ex2_ind T (\lambda (t: T).(subst0 (s k i0) v +t3 t)) (\lambda (t: T).(subst0 (s k i0) v x t)) (or4 (eq T (THead k u2 t3) +(THead k u1 x)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) +(\lambda (t: T).(subst0 i0 v (THead k u1 x) t))) (subst0 i0 v (THead k u2 t3) +(THead k u1 x)) (subst0 i0 v (THead k u1 x) (THead k u2 t3))) (\lambda (x0: +T).(\lambda (H9: (subst0 (s k i0) v t3 x0)).(\lambda (H10: (subst0 (s k i0) v +x x0)).(or4_ind (eq T u2 u2) (ex2 T (\lambda (t: T).(subst0 i0 v u2 t)) +(\lambda (t: T).(subst0 i0 v u2 t))) (subst0 i0 v u2 u2) (subst0 i0 v u2 u2) +(or4 (eq T (THead k u2 t3) (THead k u1 x)) (ex2 T (\lambda (t: T).(subst0 i0 +v (THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k u1 x) t))) +(subst0 i0 v (THead k u2 t3) (THead k u1 x)) (subst0 i0 v (THead k u1 x) +(THead k u2 t3))) (\lambda (_: (eq T u2 u2)).(or4_intro1 (eq T (THead k u2 +t3) (THead k u1 x)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) +(\lambda (t: T).(subst0 i0 v (THead k u1 x) t))) (subst0 i0 v (THead k u2 t3) +(THead k u1 x)) (subst0 i0 v (THead k u1 x) (THead k u2 t3)) (ex_intro2 T +(\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v +(THead k u1 x) t)) (THead k u2 x0) (subst0_snd k v x0 t3 i0 H9 u2) +(subst0_both v u1 u2 i0 H0 k x x0 H10)))) (\lambda (H11: (ex2 T (\lambda (t: +T).(subst0 i0 v u2 t)) (\lambda (t: T).(subst0 i0 v u2 t)))).(ex2_ind T +(\lambda (t: T).(subst0 i0 v u2 t)) (\lambda (t: T).(subst0 i0 v u2 t)) (or4 +(eq T (THead k u2 t3) (THead k u1 x)) (ex2 T (\lambda (t: T).(subst0 i0 v +(THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k u1 x) t))) (subst0 +i0 v (THead k u2 t3) (THead k u1 x)) (subst0 i0 v (THead k u1 x) (THead k u2 +t3))) (\lambda (x1: T).(\lambda (_: (subst0 i0 v u2 x1)).(\lambda (_: (subst0 +i0 v u2 x1)).(or4_intro1 (eq T (THead k u2 t3) (THead k u1 x)) (ex2 T +(\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v +(THead k u1 x) t))) (subst0 i0 v (THead k u2 t3) (THead k u1 x)) (subst0 i0 v +(THead k u1 x) (THead k u2 t3)) (ex_intro2 T (\lambda (t: T).(subst0 i0 v +(THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k u1 x) t)) (THead k +u2 x0) (subst0_snd k v x0 t3 i0 H9 u2) (subst0_both v u1 u2 i0 H0 k x x0 +H10)))))) H11)) (\lambda (_: (subst0 i0 v u2 u2)).(or4_intro1 (eq T (THead k +u2 t3) (THead k u1 x)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) +t)) (\lambda (t: T).(subst0 i0 v (THead k u1 x) t))) (subst0 i0 v (THead k u2 +t3) (THead k u1 x)) (subst0 i0 v (THead k u1 x) (THead k u2 t3)) (ex_intro2 T +(\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v +(THead k u1 x) t)) (THead k u2 x0) (subst0_snd k v x0 t3 i0 H9 u2) +(subst0_both v u1 u2 i0 H0 k x x0 H10)))) (\lambda (_: (subst0 i0 v u2 +u2)).(or4_intro1 (eq T (THead k u2 t3) (THead k u1 x)) (ex2 T (\lambda (t: +T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k u1 +x) t))) (subst0 i0 v (THead k u2 t3) (THead k u1 x)) (subst0 i0 v (THead k u1 +x) (THead k u2 t3)) (ex_intro2 T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) +t)) (\lambda (t: T).(subst0 i0 v (THead k u1 x) t)) (THead k u2 x0) +(subst0_snd k v x0 t3 i0 H9 u2) (subst0_both v u1 u2 i0 H0 k x x0 H10)))) (H1 +u2 H0))))) H8)) (\lambda (H8: (subst0 (s k i0) v t3 x)).(or4_ind (eq T u2 u2) +(ex2 T (\lambda (t: T).(subst0 i0 v u2 t)) (\lambda (t: T).(subst0 i0 v u2 +t))) (subst0 i0 v u2 u2) (subst0 i0 v u2 u2) (or4 (eq T (THead k u2 t3) +(THead k u1 x)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) +(\lambda (t: T).(subst0 i0 v (THead k u1 x) t))) (subst0 i0 v (THead k u2 t3) +(THead k u1 x)) (subst0 i0 v (THead k u1 x) (THead k u2 t3))) (\lambda (_: +(eq T u2 u2)).(or4_intro1 (eq T (THead k u2 t3) (THead k u1 x)) (ex2 T +(\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v +(THead k u1 x) t))) (subst0 i0 v (THead k u2 t3) (THead k u1 x)) (subst0 i0 v +(THead k u1 x) (THead k u2 t3)) (ex_intro2 T (\lambda (t: T).(subst0 i0 v +(THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k u1 x) t)) (THead k +u2 x) (subst0_snd k v x t3 i0 H8 u2) (subst0_fst v u2 u1 i0 H0 x k)))) +(\lambda (H9: (ex2 T (\lambda (t: T).(subst0 i0 v u2 t)) (\lambda (t: +T).(subst0 i0 v u2 t)))).(ex2_ind T (\lambda (t: T).(subst0 i0 v u2 t)) +(\lambda (t: T).(subst0 i0 v u2 t)) (or4 (eq T (THead k u2 t3) (THead k u1 +x)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: +T).(subst0 i0 v (THead k u1 x) t))) (subst0 i0 v (THead k u2 t3) (THead k u1 +x)) (subst0 i0 v (THead k u1 x) (THead k u2 t3))) (\lambda (x0: T).(\lambda +(_: (subst0 i0 v u2 x0)).(\lambda (_: (subst0 i0 v u2 x0)).(or4_intro1 (eq T +(THead k u2 t3) (THead k u1 x)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k +u2 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k u1 x) t))) (subst0 i0 v +(THead k u2 t3) (THead k u1 x)) (subst0 i0 v (THead k u1 x) (THead k u2 t3)) +(ex_intro2 T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: +T).(subst0 i0 v (THead k u1 x) t)) (THead k u2 x) (subst0_snd k v x t3 i0 H8 +u2) (subst0_fst v u2 u1 i0 H0 x k)))))) H9)) (\lambda (_: (subst0 i0 v u2 +u2)).(or4_intro1 (eq T (THead k u2 t3) (THead k u1 x)) (ex2 T (\lambda (t: +T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k u1 +x) t))) (subst0 i0 v (THead k u2 t3) (THead k u1 x)) (subst0 i0 v (THead k u1 +x) (THead k u2 t3)) (ex_intro2 T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) +t)) (\lambda (t: T).(subst0 i0 v (THead k u1 x) t)) (THead k u2 x) +(subst0_snd k v x t3 i0 H8 u2) (subst0_fst v u2 u1 i0 H0 x k)))) (\lambda (_: +(subst0 i0 v u2 u2)).(or4_intro1 (eq T (THead k u2 t3) (THead k u1 x)) (ex2 T +(\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v +(THead k u1 x) t))) (subst0 i0 v (THead k u2 t3) (THead k u1 x)) (subst0 i0 v +(THead k u1 x) (THead k u2 t3)) (ex_intro2 T (\lambda (t: T).(subst0 i0 v +(THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k u1 x) t)) (THead k +u2 x) (subst0_snd k v x t3 i0 H8 u2) (subst0_fst v u2 u1 i0 H0 x k)))) (H1 u2 +H0))) (\lambda (H8: (subst0 (s k i0) v x t3)).(or4_ind (eq T u2 u2) (ex2 T +(\lambda (t: T).(subst0 i0 v u2 t)) (\lambda (t: T).(subst0 i0 v u2 t))) +(subst0 i0 v u2 u2) (subst0 i0 v u2 u2) (or4 (eq T (THead k u2 t3) (THead k +u1 x)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: +T).(subst0 i0 v (THead k u1 x) t))) (subst0 i0 v (THead k u2 t3) (THead k u1 +x)) (subst0 i0 v (THead k u1 x) (THead k u2 t3))) (\lambda (_: (eq T u2 +u2)).(or4_intro3 (eq T (THead k u2 t3) (THead k u1 x)) (ex2 T (\lambda (t: +T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k u1 +x) t))) (subst0 i0 v (THead k u2 t3) (THead k u1 x)) (subst0 i0 v (THead k u1 +x) (THead k u2 t3)) (subst0_both v u1 u2 i0 H0 k x t3 H8))) (\lambda (H9: +(ex2 T (\lambda (t: T).(subst0 i0 v u2 t)) (\lambda (t: T).(subst0 i0 v u2 +t)))).(ex2_ind T (\lambda (t: T).(subst0 i0 v u2 t)) (\lambda (t: T).(subst0 +i0 v u2 t)) (or4 (eq T (THead k u2 t3) (THead k u1 x)) (ex2 T (\lambda (t: +T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k u1 +x) t))) (subst0 i0 v (THead k u2 t3) (THead k u1 x)) (subst0 i0 v (THead k u1 +x) (THead k u2 t3))) (\lambda (x0: T).(\lambda (_: (subst0 i0 v u2 +x0)).(\lambda (_: (subst0 i0 v u2 x0)).(or4_intro3 (eq T (THead k u2 t3) +(THead k u1 x)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) +(\lambda (t: T).(subst0 i0 v (THead k u1 x) t))) (subst0 i0 v (THead k u2 t3) +(THead k u1 x)) (subst0 i0 v (THead k u1 x) (THead k u2 t3)) (subst0_both v +u1 u2 i0 H0 k x t3 H8))))) H9)) (\lambda (_: (subst0 i0 v u2 u2)).(or4_intro3 +(eq T (THead k u2 t3) (THead k u1 x)) (ex2 T (\lambda (t: T).(subst0 i0 v +(THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k u1 x) t))) (subst0 +i0 v (THead k u2 t3) (THead k u1 x)) (subst0 i0 v (THead k u1 x) (THead k u2 +t3)) (subst0_both v u1 u2 i0 H0 k x t3 H8))) (\lambda (_: (subst0 i0 v u2 +u2)).(or4_intro3 (eq T (THead k u2 t3) (THead k u1 x)) (ex2 T (\lambda (t: +T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k u1 +x) t))) (subst0 i0 v (THead k u2 t3) (THead k u1 x)) (subst0 i0 v (THead k u1 +x) (THead k u2 t3)) (subst0_both v u1 u2 i0 H0 k x t3 H8))) (H1 u2 H0))) (H3 +x H7)) t4 H6)))) H5)) (\lambda (H5: (ex3_2 T T (\lambda (u2: T).(\lambda (t2: +T).(eq T t4 (THead k u2 t2)))) (\lambda (u2: T).(\lambda (_: T).(subst0 i0 v +u1 u2))) (\lambda (_: T).(\lambda (t3: T).(subst0 (s k i0) v t2 +t3))))).(ex3_2_ind T T (\lambda (u3: T).(\lambda (t5: T).(eq T t4 (THead k u3 +t5)))) (\lambda (u3: T).(\lambda (_: T).(subst0 i0 v u1 u3))) (\lambda (_: +T).(\lambda (t5: T).(subst0 (s k i0) v t2 t5))) (or4 (eq T (THead k u2 t3) +t4) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: +T).(subst0 i0 v t4 t))) (subst0 i0 v (THead k u2 t3) t4) (subst0 i0 v t4 +(THead k u2 t3))) (\lambda (x0: T).(\lambda (x1: T).(\lambda (H6: (eq T t4 +(THead k x0 x1))).(\lambda (H7: (subst0 i0 v u1 x0)).(\lambda (H8: (subst0 (s +k i0) v t2 x1)).(eq_ind_r T (THead k x0 x1) (\lambda (t: T).(or4 (eq T (THead +k u2 t3) t) (ex2 T (\lambda (t5: T).(subst0 i0 v (THead k u2 t3) t5)) +(\lambda (t5: T).(subst0 i0 v t t5))) (subst0 i0 v (THead k u2 t3) t) (subst0 +i0 v t (THead k u2 t3)))) (or4_ind (eq T t3 x1) (ex2 T (\lambda (t: +T).(subst0 (s k i0) v t3 t)) (\lambda (t: T).(subst0 (s k i0) v x1 t))) +(subst0 (s k i0) v t3 x1) (subst0 (s k i0) v x1 t3) (or4 (eq T (THead k u2 +t3) (THead k x0 x1)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) +(\lambda (t: T).(subst0 i0 v (THead k x0 x1) t))) (subst0 i0 v (THead k u2 +t3) (THead k x0 x1)) (subst0 i0 v (THead k x0 x1) (THead k u2 t3))) (\lambda +(H9: (eq T t3 x1)).(eq_ind_r T x1 (\lambda (t: T).(or4 (eq T (THead k u2 t) +(THead k x0 x1)) (ex2 T (\lambda (t5: T).(subst0 i0 v (THead k u2 t) t5)) +(\lambda (t5: T).(subst0 i0 v (THead k x0 x1) t5))) (subst0 i0 v (THead k u2 +t) (THead k x0 x1)) (subst0 i0 v (THead k x0 x1) (THead k u2 t)))) (or4_ind +(eq T u2 x0) (ex2 T (\lambda (t: T).(subst0 i0 v u2 t)) (\lambda (t: +T).(subst0 i0 v x0 t))) (subst0 i0 v u2 x0) (subst0 i0 v x0 u2) (or4 (eq T +(THead k u2 x1) (THead k x0 x1)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k +u2 x1) t)) (\lambda (t: T).(subst0 i0 v (THead k x0 x1) t))) (subst0 i0 v +(THead k u2 x1) (THead k x0 x1)) (subst0 i0 v (THead k x0 x1) (THead k u2 +x1))) (\lambda (H10: (eq T u2 x0)).(eq_ind_r T x0 (\lambda (t: T).(or4 (eq T +(THead k t x1) (THead k x0 x1)) (ex2 T (\lambda (t5: T).(subst0 i0 v (THead k +t x1) t5)) (\lambda (t5: T).(subst0 i0 v (THead k x0 x1) t5))) (subst0 i0 v +(THead k t x1) (THead k x0 x1)) (subst0 i0 v (THead k x0 x1) (THead k t +x1)))) (or4_intro0 (eq T (THead k x0 x1) (THead k x0 x1)) (ex2 T (\lambda (t: +T).(subst0 i0 v (THead k x0 x1) t)) (\lambda (t: T).(subst0 i0 v (THead k x0 +x1) t))) (subst0 i0 v (THead k x0 x1) (THead k x0 x1)) (subst0 i0 v (THead k +x0 x1) (THead k x0 x1)) (refl_equal T (THead k x0 x1))) u2 H10)) (\lambda +(H10: (ex2 T (\lambda (t: T).(subst0 i0 v u2 t)) (\lambda (t: T).(subst0 i0 v +x0 t)))).(ex2_ind T (\lambda (t: T).(subst0 i0 v u2 t)) (\lambda (t: +T).(subst0 i0 v x0 t)) (or4 (eq T (THead k u2 x1) (THead k x0 x1)) (ex2 T +(\lambda (t: T).(subst0 i0 v (THead k u2 x1) t)) (\lambda (t: T).(subst0 i0 v +(THead k x0 x1) t))) (subst0 i0 v (THead k u2 x1) (THead k x0 x1)) (subst0 i0 +v (THead k x0 x1) (THead k u2 x1))) (\lambda (x: T).(\lambda (H11: (subst0 i0 +v u2 x)).(\lambda (H12: (subst0 i0 v x0 x)).(or4_intro1 (eq T (THead k u2 x1) +(THead k x0 x1)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k u2 x1) t)) +(\lambda (t: T).(subst0 i0 v (THead k x0 x1) t))) (subst0 i0 v (THead k u2 +x1) (THead k x0 x1)) (subst0 i0 v (THead k x0 x1) (THead k u2 x1)) (ex_intro2 +T (\lambda (t: T).(subst0 i0 v (THead k u2 x1) t)) (\lambda (t: T).(subst0 i0 +v (THead k x0 x1) t)) (THead k x x1) (subst0_fst v x u2 i0 H11 x1 k) +(subst0_fst v x x0 i0 H12 x1 k)))))) H10)) (\lambda (H10: (subst0 i0 v u2 +x0)).(or4_intro2 (eq T (THead k u2 x1) (THead k x0 x1)) (ex2 T (\lambda (t: +T).(subst0 i0 v (THead k u2 x1) t)) (\lambda (t: T).(subst0 i0 v (THead k x0 +x1) t))) (subst0 i0 v (THead k u2 x1) (THead k x0 x1)) (subst0 i0 v (THead k +x0 x1) (THead k u2 x1)) (subst0_fst v x0 u2 i0 H10 x1 k))) (\lambda (H10: +(subst0 i0 v x0 u2)).(or4_intro3 (eq T (THead k u2 x1) (THead k x0 x1)) (ex2 +T (\lambda (t: T).(subst0 i0 v (THead k u2 x1) t)) (\lambda (t: T).(subst0 i0 +v (THead k x0 x1) t))) (subst0 i0 v (THead k u2 x1) (THead k x0 x1)) (subst0 +i0 v (THead k x0 x1) (THead k u2 x1)) (subst0_fst v u2 x0 i0 H10 x1 k))) (H1 +x0 H7)) t3 H9)) (\lambda (H9: (ex2 T (\lambda (t: T).(subst0 (s k i0) v t3 +t)) (\lambda (t: T).(subst0 (s k i0) v x1 t)))).(ex2_ind T (\lambda (t: +T).(subst0 (s k i0) v t3 t)) (\lambda (t: T).(subst0 (s k i0) v x1 t)) (or4 +(eq T (THead k u2 t3) (THead k x0 x1)) (ex2 T (\lambda (t: T).(subst0 i0 v +(THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k x0 x1) t))) (subst0 +i0 v (THead k u2 t3) (THead k x0 x1)) (subst0 i0 v (THead k x0 x1) (THead k +u2 t3))) (\lambda (x: T).(\lambda (H10: (subst0 (s k i0) v t3 x)).(\lambda +(H11: (subst0 (s k i0) v x1 x)).(or4_ind (eq T u2 x0) (ex2 T (\lambda (t: +T).(subst0 i0 v u2 t)) (\lambda (t: T).(subst0 i0 v x0 t))) (subst0 i0 v u2 +x0) (subst0 i0 v x0 u2) (or4 (eq T (THead k u2 t3) (THead k x0 x1)) (ex2 T +(\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v +(THead k x0 x1) t))) (subst0 i0 v (THead k u2 t3) (THead k x0 x1)) (subst0 i0 +v (THead k x0 x1) (THead k u2 t3))) (\lambda (H12: (eq T u2 x0)).(eq_ind_r T +x0 (\lambda (t: T).(or4 (eq T (THead k t t3) (THead k x0 x1)) (ex2 T (\lambda +(t5: T).(subst0 i0 v (THead k t t3) t5)) (\lambda (t5: T).(subst0 i0 v (THead +k x0 x1) t5))) (subst0 i0 v (THead k t t3) (THead k x0 x1)) (subst0 i0 v +(THead k x0 x1) (THead k t t3)))) (or4_intro1 (eq T (THead k x0 t3) (THead k +x0 x1)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k x0 t3) t)) (\lambda (t: +T).(subst0 i0 v (THead k x0 x1) t))) (subst0 i0 v (THead k x0 t3) (THead k x0 +x1)) (subst0 i0 v (THead k x0 x1) (THead k x0 t3)) (ex_intro2 T (\lambda (t: +T).(subst0 i0 v (THead k x0 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k x0 +x1) t)) (THead k x0 x) (subst0_snd k v x t3 i0 H10 x0) (subst0_snd k v x x1 +i0 H11 x0))) u2 H12)) (\lambda (H12: (ex2 T (\lambda (t: T).(subst0 i0 v u2 +t)) (\lambda (t: T).(subst0 i0 v x0 t)))).(ex2_ind T (\lambda (t: T).(subst0 +i0 v u2 t)) (\lambda (t: T).(subst0 i0 v x0 t)) (or4 (eq T (THead k u2 t3) +(THead k x0 x1)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) +(\lambda (t: T).(subst0 i0 v (THead k x0 x1) t))) (subst0 i0 v (THead k u2 +t3) (THead k x0 x1)) (subst0 i0 v (THead k x0 x1) (THead k u2 t3))) (\lambda +(x2: T).(\lambda (H13: (subst0 i0 v u2 x2)).(\lambda (H14: (subst0 i0 v x0 +x2)).(or4_intro1 (eq T (THead k u2 t3) (THead k x0 x1)) (ex2 T (\lambda (t: +T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k x0 +x1) t))) (subst0 i0 v (THead k u2 t3) (THead k x0 x1)) (subst0 i0 v (THead k +x0 x1) (THead k u2 t3)) (ex_intro2 T (\lambda (t: T).(subst0 i0 v (THead k u2 +t3) t)) (\lambda (t: T).(subst0 i0 v (THead k x0 x1) t)) (THead k x2 x) +(subst0_both v u2 x2 i0 H13 k t3 x H10) (subst0_both v x0 x2 i0 H14 k x1 x +H11)))))) H12)) (\lambda (H12: (subst0 i0 v u2 x0)).(or4_intro1 (eq T (THead +k u2 t3) (THead k x0 x1)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) +t)) (\lambda (t: T).(subst0 i0 v (THead k x0 x1) t))) (subst0 i0 v (THead k +u2 t3) (THead k x0 x1)) (subst0 i0 v (THead k x0 x1) (THead k u2 t3)) +(ex_intro2 T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: +T).(subst0 i0 v (THead k x0 x1) t)) (THead k x0 x) (subst0_both v u2 x0 i0 +H12 k t3 x H10) (subst0_snd k v x x1 i0 H11 x0)))) (\lambda (H12: (subst0 i0 +v x0 u2)).(or4_intro1 (eq T (THead k u2 t3) (THead k x0 x1)) (ex2 T (\lambda +(t: T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k +x0 x1) t))) (subst0 i0 v (THead k u2 t3) (THead k x0 x1)) (subst0 i0 v (THead +k x0 x1) (THead k u2 t3)) (ex_intro2 T (\lambda (t: T).(subst0 i0 v (THead k +u2 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k x0 x1) t)) (THead k u2 x) +(subst0_snd k v x t3 i0 H10 u2) (subst0_both v x0 u2 i0 H12 k x1 x H11)))) +(H1 x0 H7))))) H9)) (\lambda (H9: (subst0 (s k i0) v t3 x1)).(or4_ind (eq T +u2 x0) (ex2 T (\lambda (t: T).(subst0 i0 v u2 t)) (\lambda (t: T).(subst0 i0 +v x0 t))) (subst0 i0 v u2 x0) (subst0 i0 v x0 u2) (or4 (eq T (THead k u2 t3) +(THead k x0 x1)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) +(\lambda (t: T).(subst0 i0 v (THead k x0 x1) t))) (subst0 i0 v (THead k u2 +t3) (THead k x0 x1)) (subst0 i0 v (THead k x0 x1) (THead k u2 t3))) (\lambda +(H10: (eq T u2 x0)).(eq_ind_r T x0 (\lambda (t: T).(or4 (eq T (THead k t t3) +(THead k x0 x1)) (ex2 T (\lambda (t5: T).(subst0 i0 v (THead k t t3) t5)) +(\lambda (t5: T).(subst0 i0 v (THead k x0 x1) t5))) (subst0 i0 v (THead k t +t3) (THead k x0 x1)) (subst0 i0 v (THead k x0 x1) (THead k t t3)))) +(or4_intro2 (eq T (THead k x0 t3) (THead k x0 x1)) (ex2 T (\lambda (t: +T).(subst0 i0 v (THead k x0 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k x0 +x1) t))) (subst0 i0 v (THead k x0 t3) (THead k x0 x1)) (subst0 i0 v (THead k +x0 x1) (THead k x0 t3)) (subst0_snd k v x1 t3 i0 H9 x0)) u2 H10)) (\lambda +(H10: (ex2 T (\lambda (t: T).(subst0 i0 v u2 t)) (\lambda (t: T).(subst0 i0 v +x0 t)))).(ex2_ind T (\lambda (t: T).(subst0 i0 v u2 t)) (\lambda (t: +T).(subst0 i0 v x0 t)) (or4 (eq T (THead k u2 t3) (THead k x0 x1)) (ex2 T +(\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v +(THead k x0 x1) t))) (subst0 i0 v (THead k u2 t3) (THead k x0 x1)) (subst0 i0 +v (THead k x0 x1) (THead k u2 t3))) (\lambda (x: T).(\lambda (H11: (subst0 i0 +v u2 x)).(\lambda (H12: (subst0 i0 v x0 x)).(or4_intro1 (eq T (THead k u2 t3) +(THead k x0 x1)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) +(\lambda (t: T).(subst0 i0 v (THead k x0 x1) t))) (subst0 i0 v (THead k u2 +t3) (THead k x0 x1)) (subst0 i0 v (THead k x0 x1) (THead k u2 t3)) (ex_intro2 +T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 +v (THead k x0 x1) t)) (THead k x x1) (subst0_both v u2 x i0 H11 k t3 x1 H9) +(subst0_fst v x x0 i0 H12 x1 k)))))) H10)) (\lambda (H10: (subst0 i0 v u2 +x0)).(or4_intro2 (eq T (THead k u2 t3) (THead k x0 x1)) (ex2 T (\lambda (t: +T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k x0 +x1) t))) (subst0 i0 v (THead k u2 t3) (THead k x0 x1)) (subst0 i0 v (THead k +x0 x1) (THead k u2 t3)) (subst0_both v u2 x0 i0 H10 k t3 x1 H9))) (\lambda +(H10: (subst0 i0 v x0 u2)).(or4_intro1 (eq T (THead k u2 t3) (THead k x0 x1)) +(ex2 T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: +T).(subst0 i0 v (THead k x0 x1) t))) (subst0 i0 v (THead k u2 t3) (THead k x0 +x1)) (subst0 i0 v (THead k x0 x1) (THead k u2 t3)) (ex_intro2 T (\lambda (t: +T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k x0 +x1) t)) (THead k u2 x1) (subst0_snd k v x1 t3 i0 H9 u2) (subst0_fst v u2 x0 +i0 H10 x1 k)))) (H1 x0 H7))) (\lambda (H9: (subst0 (s k i0) v x1 +t3)).(or4_ind (eq T u2 x0) (ex2 T (\lambda (t: T).(subst0 i0 v u2 t)) +(\lambda (t: T).(subst0 i0 v x0 t))) (subst0 i0 v u2 x0) (subst0 i0 v x0 u2) +(or4 (eq T (THead k u2 t3) (THead k x0 x1)) (ex2 T (\lambda (t: T).(subst0 i0 +v (THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k x0 x1) t))) +(subst0 i0 v (THead k u2 t3) (THead k x0 x1)) (subst0 i0 v (THead k x0 x1) +(THead k u2 t3))) (\lambda (H10: (eq T u2 x0)).(eq_ind_r T x0 (\lambda (t: +T).(or4 (eq T (THead k t t3) (THead k x0 x1)) (ex2 T (\lambda (t5: T).(subst0 +i0 v (THead k t t3) t5)) (\lambda (t5: T).(subst0 i0 v (THead k x0 x1) t5))) +(subst0 i0 v (THead k t t3) (THead k x0 x1)) (subst0 i0 v (THead k x0 x1) +(THead k t t3)))) (or4_intro3 (eq T (THead k x0 t3) (THead k x0 x1)) (ex2 T +(\lambda (t: T).(subst0 i0 v (THead k x0 t3) t)) (\lambda (t: T).(subst0 i0 v +(THead k x0 x1) t))) (subst0 i0 v (THead k x0 t3) (THead k x0 x1)) (subst0 i0 +v (THead k x0 x1) (THead k x0 t3)) (subst0_snd k v t3 x1 i0 H9 x0)) u2 H10)) +(\lambda (H10: (ex2 T (\lambda (t: T).(subst0 i0 v u2 t)) (\lambda (t: +T).(subst0 i0 v x0 t)))).(ex2_ind T (\lambda (t: T).(subst0 i0 v u2 t)) +(\lambda (t: T).(subst0 i0 v x0 t)) (or4 (eq T (THead k u2 t3) (THead k x0 +x1)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: +T).(subst0 i0 v (THead k x0 x1) t))) (subst0 i0 v (THead k u2 t3) (THead k x0 +x1)) (subst0 i0 v (THead k x0 x1) (THead k u2 t3))) (\lambda (x: T).(\lambda +(H11: (subst0 i0 v u2 x)).(\lambda (H12: (subst0 i0 v x0 x)).(or4_intro1 (eq +T (THead k u2 t3) (THead k x0 x1)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead +k u2 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k x0 x1) t))) (subst0 i0 v +(THead k u2 t3) (THead k x0 x1)) (subst0 i0 v (THead k x0 x1) (THead k u2 +t3)) (ex_intro2 T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) (\lambda +(t: T).(subst0 i0 v (THead k x0 x1) t)) (THead k x t3) (subst0_fst v x u2 i0 +H11 t3 k) (subst0_both v x0 x i0 H12 k x1 t3 H9)))))) H10)) (\lambda (H10: +(subst0 i0 v u2 x0)).(or4_intro1 (eq T (THead k u2 t3) (THead k x0 x1)) (ex2 +T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 +v (THead k x0 x1) t))) (subst0 i0 v (THead k u2 t3) (THead k x0 x1)) (subst0 +i0 v (THead k x0 x1) (THead k u2 t3)) (ex_intro2 T (\lambda (t: T).(subst0 i0 +v (THead k u2 t3) t)) (\lambda (t: T).(subst0 i0 v (THead k x0 x1) t)) (THead +k x0 t3) (subst0_fst v x0 u2 i0 H10 t3 k) (subst0_snd k v t3 x1 i0 H9 x0)))) +(\lambda (H10: (subst0 i0 v x0 u2)).(or4_intro3 (eq T (THead k u2 t3) (THead +k x0 x1)) (ex2 T (\lambda (t: T).(subst0 i0 v (THead k u2 t3) t)) (\lambda +(t: T).(subst0 i0 v (THead k x0 x1) t))) (subst0 i0 v (THead k u2 t3) (THead +k x0 x1)) (subst0 i0 v (THead k x0 x1) (THead k u2 t3)) (subst0_both v x0 u2 +i0 H10 k x1 t3 H9))) (H1 x0 H7))) (H3 x1 H8)) t4 H6)))))) H5)) +(subst0_gen_head k v u1 t2 t4 i0 H4))))))))))))))) i u t0 t1 H))))). + +theorem subst0_confluence_lift: + \forall (t0: T).(\forall (t1: T).(\forall (u: T).(\forall (i: nat).((subst0 +i u t0 (lift (S O) i t1)) \to (\forall (t2: T).((subst0 i u t0 (lift (S O) i +t2)) \to (eq T t1 t2))))))) +\def + \lambda (t0: T).(\lambda (t1: T).(\lambda (u: T).(\lambda (i: nat).(\lambda +(H: (subst0 i u t0 (lift (S O) i t1))).(\lambda (t2: T).(\lambda (H0: (subst0 +i u t0 (lift (S O) i t2))).(or4_ind (eq T (lift (S O) i t2) (lift (S O) i +t1)) (ex2 T (\lambda (t: T).(subst0 i u (lift (S O) i t2) t)) (\lambda (t: +T).(subst0 i u (lift (S O) i t1) t))) (subst0 i u (lift (S O) i t2) (lift (S +O) i t1)) (subst0 i u (lift (S O) i t1) (lift (S O) i t2)) (eq T t1 t2) +(\lambda (H1: (eq T (lift (S O) i t2) (lift (S O) i t1))).(let H2 \def +(sym_equal T (lift (S O) i t2) (lift (S O) i t1) H1) in (lift_inj t1 t2 (S O) +i H2))) (\lambda (H1: (ex2 T (\lambda (t: T).(subst0 i u (lift (S O) i t2) +t)) (\lambda (t: T).(subst0 i u (lift (S O) i t1) t)))).(ex2_ind T (\lambda +(t: T).(subst0 i u (lift (S O) i t2) t)) (\lambda (t: T).(subst0 i u (lift (S +O) i t1) t)) (eq T t1 t2) (\lambda (x: T).(\lambda (_: (subst0 i u (lift (S +O) i t2) x)).(\lambda (H3: (subst0 i u (lift (S O) i t1) +x)).(subst0_gen_lift_false t1 u x (S O) i i (le_n i) (eq_ind_r nat (plus (S +O) i) (\lambda (n: nat).(lt i n)) (le_n (plus (S O) i)) (plus i (S O)) +(plus_comm i (S O))) H3 (eq T t1 t2))))) H1)) (\lambda (H1: (subst0 i u (lift +(S O) i t2) (lift (S O) i t1))).(subst0_gen_lift_false t2 u (lift (S O) i t1) +(S O) i i (le_n i) (eq_ind_r nat (plus (S O) i) (\lambda (n: nat).(lt i n)) +(le_n (plus (S O) i)) (plus i (S O)) (plus_comm i (S O))) H1 (eq T t1 t2))) +(\lambda (H1: (subst0 i u (lift (S O) i t1) (lift (S O) i +t2))).(subst0_gen_lift_false t1 u (lift (S O) i t2) (S O) i i (le_n i) +(eq_ind_r nat (plus (S O) i) (\lambda (n: nat).(lt i n)) (le_n (plus (S O) +i)) (plus i (S O)) (plus_comm i (S O))) H1 (eq T t1 t2))) +(subst0_confluence_eq t0 (lift (S O) i t2) u i H0 (lift (S O) i t1) H)))))))). + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/subst0/tlt.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/subst0/tlt.ma new file mode 100644 index 000000000..901254e9e --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/subst0/tlt.ma @@ -0,0 +1,472 @@ +(**************************************************************************) +(* ___ *) +(* ||M|| *) +(* ||A|| A project by Andrea Asperti *) +(* ||T|| *) +(* ||I|| Developers: *) +(* ||T|| The HELM team. *) +(* ||A|| http://helm.cs.unibo.it *) +(* \ / *) +(* \ / This file is distributed under the terms of the *) +(* v GNU General Public License Version 2 *) +(* *) +(**************************************************************************) + +(* This file was automatically generated: do not edit *********************) + +set "baseuri" "cic:/matita/LAMBDA-TYPES/Level-1/LambdaDelta/subst0/tlt". + +include "subst0/defs.ma". + +include "lift/props.ma". + +include "lift/tlt.ma". + +theorem subst0_weight_le: + \forall (u: T).(\forall (t: T).(\forall (z: T).(\forall (d: nat).((subst0 d +u t z) \to (\forall (f: ((nat \to nat))).(\forall (g: ((nat \to +nat))).(((\forall (m: nat).(le (f m) (g m)))) \to ((lt (weight_map f (lift (S +d) O u)) (g d)) \to (le (weight_map f z) (weight_map g t)))))))))) +\def + \lambda (u: T).(\lambda (t: T).(\lambda (z: T).(\lambda (d: nat).(\lambda +(H: (subst0 d u t z)).(subst0_ind (\lambda (n: nat).(\lambda (t0: T).(\lambda +(t1: T).(\lambda (t2: T).(\forall (f: ((nat \to nat))).(\forall (g: ((nat \to +nat))).(((\forall (m: nat).(le (f m) (g m)))) \to ((lt (weight_map f (lift (S +n) O t0)) (g n)) \to (le (weight_map f t2) (weight_map g t1)))))))))) +(\lambda (v: T).(\lambda (i: nat).(\lambda (f: ((nat \to nat))).(\lambda (g: +((nat \to nat))).(\lambda (_: ((\forall (m: nat).(le (f m) (g m))))).(\lambda +(H1: (lt (weight_map f (lift (S i) O v)) (g i))).(le_S_n (weight_map f (lift +(S i) O v)) (weight_map g (TLRef i)) (le_S (S (weight_map f (lift (S i) O +v))) (weight_map g (TLRef i)) H1)))))))) (\lambda (v: T).(\lambda (u2: +T).(\lambda (u1: T).(\lambda (i: nat).(\lambda (_: (subst0 i v u1 +u2)).(\lambda (H1: ((\forall (f: ((nat \to nat))).(\forall (g: ((nat \to +nat))).(((\forall (m: nat).(le (f m) (g m)))) \to ((lt (weight_map f (lift (S +i) O v)) (g i)) \to (le (weight_map f u2) (weight_map g u1)))))))).(\lambda +(t0: T).(\lambda (k: K).(K_ind (\lambda (k0: K).(\forall (f: ((nat \to +nat))).(\forall (g: ((nat \to nat))).(((\forall (m: nat).(le (f m) (g m)))) +\to ((lt (weight_map f (lift (S i) O v)) (g i)) \to (le (weight_map f (THead +k0 u2 t0)) (weight_map g (THead k0 u1 t0)))))))) (\lambda (b: B).(B_ind +(\lambda (b0: B).(\forall (f: ((nat \to nat))).(\forall (g: ((nat \to +nat))).(((\forall (m: nat).(le (f m) (g m)))) \to ((lt (weight_map f (lift (S +i) O v)) (g i)) \to (le (weight_map f (THead (Bind b0) u2 t0)) (weight_map g +(THead (Bind b0) u1 t0)))))))) (\lambda (f: ((nat \to nat))).(\lambda (g: +((nat \to nat))).(\lambda (H2: ((\forall (m: nat).(le (f m) (g +m))))).(\lambda (H3: (lt (weight_map f (lift (S i) O v)) (g i))).(le_n_S +(plus (weight_map f u2) (weight_map (wadd f (S (weight_map f u2))) t0)) (plus +(weight_map g u1) (weight_map (wadd g (S (weight_map g u1))) t0)) +(plus_le_compat (weight_map f u2) (weight_map g u1) (weight_map (wadd f (S +(weight_map f u2))) t0) (weight_map (wadd g (S (weight_map g u1))) t0) (H1 f +g H2 H3) (weight_le t0 (wadd f (S (weight_map f u2))) (wadd g (S (weight_map +g u1))) (\lambda (n: nat).(wadd_le f g H2 (S (weight_map f u2)) (S +(weight_map g u1)) (le_n_S (weight_map f u2) (weight_map g u1) (H1 f g H2 +H3)) n))))))))) (\lambda (f: ((nat \to nat))).(\lambda (g: ((nat \to +nat))).(\lambda (H2: ((\forall (m: nat).(le (f m) (g m))))).(\lambda (H3: (lt +(weight_map f (lift (S i) O v)) (g i))).(le_n_S (plus (weight_map f u2) +(weight_map (wadd f O) t0)) (plus (weight_map g u1) (weight_map (wadd g O) +t0)) (plus_le_compat (weight_map f u2) (weight_map g u1) (weight_map (wadd f +O) t0) (weight_map (wadd g O) t0) (H1 f g H2 H3) (weight_le t0 (wadd f O) +(wadd g O) (\lambda (n: nat).(wadd_le f g H2 O O (le_n O) n))))))))) (\lambda +(f: ((nat \to nat))).(\lambda (g: ((nat \to nat))).(\lambda (H2: ((\forall +(m: nat).(le (f m) (g m))))).(\lambda (H3: (lt (weight_map f (lift (S i) O +v)) (g i))).(le_n_S (plus (weight_map f u2) (weight_map (wadd f O) t0)) (plus +(weight_map g u1) (weight_map (wadd g O) t0)) (plus_le_compat (weight_map f +u2) (weight_map g u1) (weight_map (wadd f O) t0) (weight_map (wadd g O) t0) +(H1 f g H2 H3) (weight_le t0 (wadd f O) (wadd g O) (\lambda (n: nat).(wadd_le +f g H2 O O (le_n O) n))))))))) b)) (\lambda (_: F).(\lambda (f0: ((nat \to +nat))).(\lambda (g: ((nat \to nat))).(\lambda (H2: ((\forall (m: nat).(le (f0 +m) (g m))))).(\lambda (H3: (lt (weight_map f0 (lift (S i) O v)) (g +i))).(lt_le_S (plus (weight_map f0 u2) (weight_map f0 t0)) (S (plus +(weight_map g u1) (weight_map g t0))) (le_lt_n_Sm (plus (weight_map f0 u2) +(weight_map f0 t0)) (plus (weight_map g u1) (weight_map g t0)) +(plus_le_compat (weight_map f0 u2) (weight_map g u1) (weight_map f0 t0) +(weight_map g t0) (H1 f0 g H2 H3) (weight_le t0 f0 g H2))))))))) k))))))))) +(\lambda (k: K).(K_ind (\lambda (k0: K).(\forall (v: T).(\forall (t2: +T).(\forall (t1: T).(\forall (i: nat).((subst0 (s k0 i) v t1 t2) \to +(((\forall (f: ((nat \to nat))).(\forall (g: ((nat \to nat))).(((\forall (m: +nat).(le (f m) (g m)))) \to ((lt (weight_map f (lift (S (s k0 i)) O v)) (g (s +k0 i))) \to (le (weight_map f t2) (weight_map g t1))))))) \to (\forall (u0: +T).(\forall (f: ((nat \to nat))).(\forall (g: ((nat \to nat))).(((\forall (m: +nat).(le (f m) (g m)))) \to ((lt (weight_map f (lift (S i) O v)) (g i)) \to +(le (weight_map f (THead k0 u0 t2)) (weight_map g (THead k0 u0 +t1))))))))))))))) (\lambda (b: B).(B_ind (\lambda (b0: B).(\forall (v: +T).(\forall (t2: T).(\forall (t1: T).(\forall (i: nat).((subst0 (s (Bind b0) +i) v t1 t2) \to (((\forall (f: ((nat \to nat))).(\forall (g: ((nat \to +nat))).(((\forall (m: nat).(le (f m) (g m)))) \to ((lt (weight_map f (lift (S +(s (Bind b0) i)) O v)) (g (s (Bind b0) i))) \to (le (weight_map f t2) +(weight_map g t1))))))) \to (\forall (u0: T).(\forall (f: ((nat \to +nat))).(\forall (g: ((nat \to nat))).(((\forall (m: nat).(le (f m) (g m)))) +\to ((lt (weight_map f (lift (S i) O v)) (g i)) \to (le (weight_map f (THead +(Bind b0) u0 t2)) (weight_map g (THead (Bind b0) u0 t1))))))))))))))) +(\lambda (v: T).(\lambda (t2: T).(\lambda (t1: T).(\lambda (i: nat).(\lambda +(_: (subst0 (S i) v t1 t2)).(\lambda (H1: ((\forall (f: ((nat \to +nat))).(\forall (g: ((nat \to nat))).(((\forall (m: nat).(le (f m) (g m)))) +\to ((lt (weight_map f (lift (S (S i)) O v)) (g (S i))) \to (le (weight_map f +t2) (weight_map g t1)))))))).(\lambda (u0: T).(\lambda (f: ((nat \to +nat))).(\lambda (g: ((nat \to nat))).(\lambda (H2: ((\forall (m: nat).(le (f +m) (g m))))).(\lambda (H3: (lt (weight_map f (lift (S i) O v)) (g +i))).(le_n_S (plus (weight_map f u0) (weight_map (wadd f (S (weight_map f +u0))) t2)) (plus (weight_map g u0) (weight_map (wadd g (S (weight_map g u0))) +t1)) (plus_le_compat (weight_map f u0) (weight_map g u0) (weight_map (wadd f +(S (weight_map f u0))) t2) (weight_map (wadd g (S (weight_map g u0))) t1) +(weight_le u0 f g H2) (H1 (wadd f (S (weight_map f u0))) (wadd g (S +(weight_map g u0))) (\lambda (m: nat).(wadd_le f g H2 (S (weight_map f u0)) +(S (weight_map g u0)) (le_n_S (weight_map f u0) (weight_map g u0) (weight_le +u0 f g H2)) m)) (lt_le_S (weight_map (wadd f (S (weight_map f u0))) (lift (S +(S i)) O v)) (wadd g (S (weight_map g u0)) (S i)) (eq_ind nat (weight_map f +(lift (S i) O v)) (\lambda (n: nat).(lt n (g i))) H3 (weight_map (wadd f (S +(weight_map f u0))) (lift (S (S i)) O v)) (lift_weight_add_O (S (weight_map f +u0)) v (S i) f))))))))))))))))) (\lambda (v: T).(\lambda (t2: T).(\lambda +(t1: T).(\lambda (i: nat).(\lambda (_: (subst0 (S i) v t1 t2)).(\lambda (H1: +((\forall (f: ((nat \to nat))).(\forall (g: ((nat \to nat))).(((\forall (m: +nat).(le (f m) (g m)))) \to ((lt (weight_map f (lift (S (S i)) O v)) (g (S +i))) \to (le (weight_map f t2) (weight_map g t1)))))))).(\lambda (u0: +T).(\lambda (f: ((nat \to nat))).(\lambda (g: ((nat \to nat))).(\lambda (H2: +((\forall (m: nat).(le (f m) (g m))))).(\lambda (H3: (lt (weight_map f (lift +(S i) O v)) (g i))).(le_n_S (plus (weight_map f u0) (weight_map (wadd f O) +t2)) (plus (weight_map g u0) (weight_map (wadd g O) t1)) (plus_le_compat +(weight_map f u0) (weight_map g u0) (weight_map (wadd f O) t2) (weight_map +(wadd g O) t1) (weight_le u0 f g H2) (H1 (wadd f O) (wadd g O) (\lambda (m: +nat).(wadd_le f g H2 O O (le_n O) m)) (eq_ind nat (weight_map f (lift (S i) O +v)) (\lambda (n: nat).(lt n (g i))) H3 (weight_map (wadd f O) (lift (S (S i)) +O v)) (lift_weight_add_O O v (S i) f)))))))))))))))) (\lambda (v: T).(\lambda +(t2: T).(\lambda (t1: T).(\lambda (i: nat).(\lambda (_: (subst0 (S i) v t1 +t2)).(\lambda (H1: ((\forall (f: ((nat \to nat))).(\forall (g: ((nat \to +nat))).(((\forall (m: nat).(le (f m) (g m)))) \to ((lt (weight_map f (lift (S +(S i)) O v)) (g (S i))) \to (le (weight_map f t2) (weight_map g +t1)))))))).(\lambda (u0: T).(\lambda (f: ((nat \to nat))).(\lambda (g: ((nat +\to nat))).(\lambda (H2: ((\forall (m: nat).(le (f m) (g m))))).(\lambda (H3: +(lt (weight_map f (lift (S i) O v)) (g i))).(le_n_S (plus (weight_map f u0) +(weight_map (wadd f O) t2)) (plus (weight_map g u0) (weight_map (wadd g O) +t1)) (plus_le_compat (weight_map f u0) (weight_map g u0) (weight_map (wadd f +O) t2) (weight_map (wadd g O) t1) (weight_le u0 f g H2) (H1 (wadd f O) (wadd +g O) (\lambda (m: nat).(wadd_le f g H2 O O (le_n O) m)) (eq_ind nat +(weight_map f (lift (S i) O v)) (\lambda (n: nat).(lt n (g i))) H3 +(weight_map (wadd f O) (lift (S (S i)) O v)) (lift_weight_add_O O v (S i) +f)))))))))))))))) b)) (\lambda (_: F).(\lambda (v: T).(\lambda (t2: +T).(\lambda (t1: T).(\lambda (i: nat).(\lambda (_: (subst0 i v t1 +t2)).(\lambda (H1: ((\forall (f: ((nat \to nat))).(\forall (g: ((nat \to +nat))).(((\forall (m: nat).(le (f m) (g m)))) \to ((lt (weight_map f (lift (S +i) O v)) (g i)) \to (le (weight_map f t2) (weight_map g t1)))))))).(\lambda +(u0: T).(\lambda (f0: ((nat \to nat))).(\lambda (g: ((nat \to nat))).(\lambda +(H2: ((\forall (m: nat).(le (f0 m) (g m))))).(\lambda (H3: (lt (weight_map f0 +(lift (S i) O v)) (g i))).(lt_le_S (plus (weight_map f0 u0) (weight_map f0 +t2)) (S (plus (weight_map g u0) (weight_map g t1))) (le_lt_n_Sm (plus +(weight_map f0 u0) (weight_map f0 t2)) (plus (weight_map g u0) (weight_map g +t1)) (plus_le_compat (weight_map f0 u0) (weight_map g u0) (weight_map f0 t2) +(weight_map g t1) (weight_le u0 f0 g H2) (H1 f0 g H2 H3)))))))))))))))) k)) +(\lambda (v: T).(\lambda (u1: T).(\lambda (u2: T).(\lambda (i: nat).(\lambda +(_: (subst0 i v u1 u2)).(\lambda (H1: ((\forall (f: ((nat \to nat))).(\forall +(g: ((nat \to nat))).(((\forall (m: nat).(le (f m) (g m)))) \to ((lt +(weight_map f (lift (S i) O v)) (g i)) \to (le (weight_map f u2) (weight_map +g u1)))))))).(\lambda (k: K).(K_ind (\lambda (k0: K).(\forall (t1: +T).(\forall (t2: T).((subst0 (s k0 i) v t1 t2) \to (((\forall (f: ((nat \to +nat))).(\forall (g: ((nat \to nat))).(((\forall (m: nat).(le (f m) (g m)))) +\to ((lt (weight_map f (lift (S (s k0 i)) O v)) (g (s k0 i))) \to (le +(weight_map f t2) (weight_map g t1))))))) \to (\forall (f: ((nat \to +nat))).(\forall (g: ((nat \to nat))).(((\forall (m: nat).(le (f m) (g m)))) +\to ((lt (weight_map f (lift (S i) O v)) (g i)) \to (le (weight_map f (THead +k0 u2 t2)) (weight_map g (THead k0 u1 t1)))))))))))) (\lambda (b: B).(B_ind +(\lambda (b0: B).(\forall (t1: T).(\forall (t2: T).((subst0 (s (Bind b0) i) v +t1 t2) \to (((\forall (f: ((nat \to nat))).(\forall (g: ((nat \to +nat))).(((\forall (m: nat).(le (f m) (g m)))) \to ((lt (weight_map f (lift (S +(s (Bind b0) i)) O v)) (g (s (Bind b0) i))) \to (le (weight_map f t2) +(weight_map g t1))))))) \to (\forall (f: ((nat \to nat))).(\forall (g: ((nat +\to nat))).(((\forall (m: nat).(le (f m) (g m)))) \to ((lt (weight_map f +(lift (S i) O v)) (g i)) \to (le (weight_map f (THead (Bind b0) u2 t2)) +(weight_map g (THead (Bind b0) u1 t1)))))))))))) (\lambda (t1: T).(\lambda +(t2: T).(\lambda (_: (subst0 (S i) v t1 t2)).(\lambda (H3: ((\forall (f: +((nat \to nat))).(\forall (g: ((nat \to nat))).(((\forall (m: nat).(le (f m) +(g m)))) \to ((lt (weight_map f (lift (S (S i)) O v)) (g (S i))) \to (le +(weight_map f t2) (weight_map g t1)))))))).(\lambda (f: ((nat \to +nat))).(\lambda (g: ((nat \to nat))).(\lambda (H4: ((\forall (m: nat).(le (f +m) (g m))))).(\lambda (H5: (lt (weight_map f (lift (S i) O v)) (g +i))).(le_n_S (plus (weight_map f u2) (weight_map (wadd f (S (weight_map f +u2))) t2)) (plus (weight_map g u1) (weight_map (wadd g (S (weight_map g u1))) +t1)) (plus_le_compat (weight_map f u2) (weight_map g u1) (weight_map (wadd f +(S (weight_map f u2))) t2) (weight_map (wadd g (S (weight_map g u1))) t1) (H1 +f g H4 H5) (H3 (wadd f (S (weight_map f u2))) (wadd g (S (weight_map g u1))) +(\lambda (m: nat).(wadd_le f g H4 (S (weight_map f u2)) (S (weight_map g u1)) +(le_n_S (weight_map f u2) (weight_map g u1) (H1 f g H4 H5)) m)) (lt_le_S +(weight_map (wadd f (S (weight_map f u2))) (lift (S (S i)) O v)) (wadd g (S +(weight_map g u1)) (S i)) (eq_ind nat (weight_map f (lift (S i) O v)) +(\lambda (n: nat).(lt n (g i))) H5 (weight_map (wadd f (S (weight_map f u2))) +(lift (S (S i)) O v)) (lift_weight_add_O (S (weight_map f u2)) v (S i) +f)))))))))))))) (\lambda (t1: T).(\lambda (t2: T).(\lambda (_: (subst0 (S i) +v t1 t2)).(\lambda (H3: ((\forall (f: ((nat \to nat))).(\forall (g: ((nat \to +nat))).(((\forall (m: nat).(le (f m) (g m)))) \to ((lt (weight_map f (lift (S +(S i)) O v)) (g (S i))) \to (le (weight_map f t2) (weight_map g +t1)))))))).(\lambda (f: ((nat \to nat))).(\lambda (g: ((nat \to +nat))).(\lambda (H4: ((\forall (m: nat).(le (f m) (g m))))).(\lambda (H5: (lt +(weight_map f (lift (S i) O v)) (g i))).(le_n_S (plus (weight_map f u2) +(weight_map (wadd f O) t2)) (plus (weight_map g u1) (weight_map (wadd g O) +t1)) (plus_le_compat (weight_map f u2) (weight_map g u1) (weight_map (wadd f +O) t2) (weight_map (wadd g O) t1) (H1 f g H4 H5) (H3 (wadd f O) (wadd g O) +(\lambda (m: nat).(wadd_le f g H4 O O (le_n O) m)) (eq_ind nat (weight_map f +(lift (S i) O v)) (\lambda (n: nat).(lt n (g i))) H5 (weight_map (wadd f O) +(lift (S (S i)) O v)) (lift_weight_add_O O v (S i) f))))))))))))) (\lambda +(t1: T).(\lambda (t2: T).(\lambda (_: (subst0 (S i) v t1 t2)).(\lambda (H3: +((\forall (f: ((nat \to nat))).(\forall (g: ((nat \to nat))).(((\forall (m: +nat).(le (f m) (g m)))) \to ((lt (weight_map f (lift (S (S i)) O v)) (g (S +i))) \to (le (weight_map f t2) (weight_map g t1)))))))).(\lambda (f: ((nat +\to nat))).(\lambda (g: ((nat \to nat))).(\lambda (H4: ((\forall (m: nat).(le +(f m) (g m))))).(\lambda (H5: (lt (weight_map f (lift (S i) O v)) (g +i))).(le_n_S (plus (weight_map f u2) (weight_map (wadd f O) t2)) (plus +(weight_map g u1) (weight_map (wadd g O) t1)) (plus_le_compat (weight_map f +u2) (weight_map g u1) (weight_map (wadd f O) t2) (weight_map (wadd g O) t1) +(H1 f g H4 H5) (H3 (wadd f O) (wadd g O) (\lambda (m: nat).(wadd_le f g H4 O +O (le_n O) m)) (eq_ind nat (weight_map f (lift (S i) O v)) (\lambda (n: +nat).(lt n (g i))) H5 (weight_map (wadd f O) (lift (S (S i)) O v)) +(lift_weight_add_O O v (S i) f))))))))))))) b)) (\lambda (_: F).(\lambda (t1: +T).(\lambda (t2: T).(\lambda (_: (subst0 i v t1 t2)).(\lambda (H3: ((\forall +(f: ((nat \to nat))).(\forall (g: ((nat \to nat))).(((\forall (m: nat).(le (f +m) (g m)))) \to ((lt (weight_map f (lift (S i) O v)) (g i)) \to (le +(weight_map f t2) (weight_map g t1)))))))).(\lambda (f0: ((nat \to +nat))).(\lambda (g: ((nat \to nat))).(\lambda (H4: ((\forall (m: nat).(le (f0 +m) (g m))))).(\lambda (H5: (lt (weight_map f0 (lift (S i) O v)) (g +i))).(lt_le_S (plus (weight_map f0 u2) (weight_map f0 t2)) (S (plus +(weight_map g u1) (weight_map g t1))) (le_lt_n_Sm (plus (weight_map f0 u2) +(weight_map f0 t2)) (plus (weight_map g u1) (weight_map g t1)) +(plus_le_compat (weight_map f0 u2) (weight_map g u1) (weight_map f0 t2) +(weight_map g t1) (H1 f0 g H4 H5) (H3 f0 g H4 H5))))))))))))) k)))))))) d u t +z H))))). + +theorem subst0_weight_lt: + \forall (u: T).(\forall (t: T).(\forall (z: T).(\forall (d: nat).((subst0 d +u t z) \to (\forall (f: ((nat \to nat))).(\forall (g: ((nat \to +nat))).(((\forall (m: nat).(le (f m) (g m)))) \to ((lt (weight_map f (lift (S +d) O u)) (g d)) \to (lt (weight_map f z) (weight_map g t)))))))))) +\def + \lambda (u: T).(\lambda (t: T).(\lambda (z: T).(\lambda (d: nat).(\lambda +(H: (subst0 d u t z)).(subst0_ind (\lambda (n: nat).(\lambda (t0: T).(\lambda +(t1: T).(\lambda (t2: T).(\forall (f: ((nat \to nat))).(\forall (g: ((nat \to +nat))).(((\forall (m: nat).(le (f m) (g m)))) \to ((lt (weight_map f (lift (S +n) O t0)) (g n)) \to (lt (weight_map f t2) (weight_map g t1)))))))))) +(\lambda (v: T).(\lambda (i: nat).(\lambda (f: ((nat \to nat))).(\lambda (g: +((nat \to nat))).(\lambda (_: ((\forall (m: nat).(le (f m) (g m))))).(\lambda +(H1: (lt (weight_map f (lift (S i) O v)) (g i))).H1)))))) (\lambda (v: +T).(\lambda (u2: T).(\lambda (u1: T).(\lambda (i: nat).(\lambda (_: (subst0 i +v u1 u2)).(\lambda (H1: ((\forall (f: ((nat \to nat))).(\forall (g: ((nat \to +nat))).(((\forall (m: nat).(le (f m) (g m)))) \to ((lt (weight_map f (lift (S +i) O v)) (g i)) \to (lt (weight_map f u2) (weight_map g u1)))))))).(\lambda +(t0: T).(\lambda (k: K).(K_ind (\lambda (k0: K).(\forall (f: ((nat \to +nat))).(\forall (g: ((nat \to nat))).(((\forall (m: nat).(le (f m) (g m)))) +\to ((lt (weight_map f (lift (S i) O v)) (g i)) \to (lt (weight_map f (THead +k0 u2 t0)) (weight_map g (THead k0 u1 t0)))))))) (\lambda (b: B).(B_ind +(\lambda (b0: B).(\forall (f: ((nat \to nat))).(\forall (g: ((nat \to +nat))).(((\forall (m: nat).(le (f m) (g m)))) \to ((lt (weight_map f (lift (S +i) O v)) (g i)) \to (lt (weight_map f (THead (Bind b0) u2 t0)) (weight_map g +(THead (Bind b0) u1 t0)))))))) (\lambda (f: ((nat \to nat))).(\lambda (g: +((nat \to nat))).(\lambda (H2: ((\forall (m: nat).(le (f m) (g +m))))).(\lambda (H3: (lt (weight_map f (lift (S i) O v)) (g i))).(lt_n_S +(plus (weight_map f u2) (weight_map (wadd f (S (weight_map f u2))) t0)) (plus +(weight_map g u1) (weight_map (wadd g (S (weight_map g u1))) t0)) +(plus_lt_le_compat (weight_map f u2) (weight_map g u1) (weight_map (wadd f (S +(weight_map f u2))) t0) (weight_map (wadd g (S (weight_map g u1))) t0) (H1 f +g H2 H3) (weight_le t0 (wadd f (S (weight_map f u2))) (wadd g (S (weight_map +g u1))) (\lambda (n: nat).(wadd_le f g H2 (S (weight_map f u2)) (S +(weight_map g u1)) (le_S (S (weight_map f u2)) (weight_map g u1) (lt_le_S +(weight_map f u2) (weight_map g u1) (H1 f g H2 H3))) n))))))))) (\lambda (f: +((nat \to nat))).(\lambda (g: ((nat \to nat))).(\lambda (H2: ((\forall (m: +nat).(le (f m) (g m))))).(\lambda (H3: (lt (weight_map f (lift (S i) O v)) (g +i))).(lt_n_S (plus (weight_map f u2) (weight_map (wadd f O) t0)) (plus +(weight_map g u1) (weight_map (wadd g O) t0)) (plus_lt_le_compat (weight_map +f u2) (weight_map g u1) (weight_map (wadd f O) t0) (weight_map (wadd g O) t0) +(H1 f g H2 H3) (weight_le t0 (wadd f O) (wadd g O) (\lambda (n: nat).(le_S_n +(wadd f O n) (wadd g O n) (le_n_S (wadd f O n) (wadd g O n) (wadd_le f g H2 O +O (le_n O) n))))))))))) (\lambda (f: ((nat \to nat))).(\lambda (g: ((nat \to +nat))).(\lambda (H2: ((\forall (m: nat).(le (f m) (g m))))).(\lambda (H3: (lt +(weight_map f (lift (S i) O v)) (g i))).(lt_n_S (plus (weight_map f u2) +(weight_map (wadd f O) t0)) (plus (weight_map g u1) (weight_map (wadd g O) +t0)) (plus_lt_le_compat (weight_map f u2) (weight_map g u1) (weight_map (wadd +f O) t0) (weight_map (wadd g O) t0) (H1 f g H2 H3) (weight_le t0 (wadd f O) +(wadd g O) (\lambda (n: nat).(le_S_n (wadd f O n) (wadd g O n) (le_n_S (wadd +f O n) (wadd g O n) (wadd_le f g H2 O O (le_n O) n))))))))))) b)) (\lambda +(_: F).(\lambda (f0: ((nat \to nat))).(\lambda (g: ((nat \to nat))).(\lambda +(H2: ((\forall (m: nat).(le (f0 m) (g m))))).(\lambda (H3: (lt (weight_map f0 +(lift (S i) O v)) (g i))).(lt_n_S (plus (weight_map f0 u2) (weight_map f0 +t0)) (plus (weight_map g u1) (weight_map g t0)) (plus_lt_le_compat +(weight_map f0 u2) (weight_map g u1) (weight_map f0 t0) (weight_map g t0) (H1 +f0 g H2 H3) (weight_le t0 f0 g H2)))))))) k))))))))) (\lambda (k: K).(K_ind +(\lambda (k0: K).(\forall (v: T).(\forall (t2: T).(\forall (t1: T).(\forall +(i: nat).((subst0 (s k0 i) v t1 t2) \to (((\forall (f: ((nat \to +nat))).(\forall (g: ((nat \to nat))).(((\forall (m: nat).(le (f m) (g m)))) +\to ((lt (weight_map f (lift (S (s k0 i)) O v)) (g (s k0 i))) \to (lt +(weight_map f t2) (weight_map g t1))))))) \to (\forall (u0: T).(\forall (f: +((nat \to nat))).(\forall (g: ((nat \to nat))).(((\forall (m: nat).(le (f m) +(g m)))) \to ((lt (weight_map f (lift (S i) O v)) (g i)) \to (lt (weight_map +f (THead k0 u0 t2)) (weight_map g (THead k0 u0 t1))))))))))))))) (\lambda (b: +B).(B_ind (\lambda (b0: B).(\forall (v: T).(\forall (t2: T).(\forall (t1: +T).(\forall (i: nat).((subst0 (s (Bind b0) i) v t1 t2) \to (((\forall (f: +((nat \to nat))).(\forall (g: ((nat \to nat))).(((\forall (m: nat).(le (f m) +(g m)))) \to ((lt (weight_map f (lift (S (s (Bind b0) i)) O v)) (g (s (Bind +b0) i))) \to (lt (weight_map f t2) (weight_map g t1))))))) \to (\forall (u0: +T).(\forall (f: ((nat \to nat))).(\forall (g: ((nat \to nat))).(((\forall (m: +nat).(le (f m) (g m)))) \to ((lt (weight_map f (lift (S i) O v)) (g i)) \to +(lt (weight_map f (THead (Bind b0) u0 t2)) (weight_map g (THead (Bind b0) u0 +t1))))))))))))))) (\lambda (v: T).(\lambda (t2: T).(\lambda (t1: T).(\lambda +(i: nat).(\lambda (_: (subst0 (S i) v t1 t2)).(\lambda (H1: ((\forall (f: +((nat \to nat))).(\forall (g: ((nat \to nat))).(((\forall (m: nat).(le (f m) +(g m)))) \to ((lt (weight_map f (lift (S (S i)) O v)) (g (S i))) \to (lt +(weight_map f t2) (weight_map g t1)))))))).(\lambda (u0: T).(\lambda (f: +((nat \to nat))).(\lambda (g: ((nat \to nat))).(\lambda (H2: ((\forall (m: +nat).(le (f m) (g m))))).(\lambda (H3: (lt (weight_map f (lift (S i) O v)) (g +i))).(lt_n_S (plus (weight_map f u0) (weight_map (wadd f (S (weight_map f +u0))) t2)) (plus (weight_map g u0) (weight_map (wadd g (S (weight_map g u0))) +t1)) (plus_le_lt_compat (weight_map f u0) (weight_map g u0) (weight_map (wadd +f (S (weight_map f u0))) t2) (weight_map (wadd g (S (weight_map g u0))) t1) +(weight_le u0 f g H2) (H1 (wadd f (S (weight_map f u0))) (wadd g (S +(weight_map g u0))) (\lambda (m: nat).(wadd_le f g H2 (S (weight_map f u0)) +(S (weight_map g u0)) (lt_le_S (weight_map f u0) (S (weight_map g u0)) +(le_lt_n_Sm (weight_map f u0) (weight_map g u0) (weight_le u0 f g H2))) m)) +(lt_le_S (weight_map (wadd f (S (weight_map f u0))) (lift (S (S i)) O v)) +(wadd g (S (weight_map g u0)) (S i)) (eq_ind nat (weight_map f (lift (S i) O +v)) (\lambda (n: nat).(lt n (g i))) H3 (weight_map (wadd f (S (weight_map f +u0))) (lift (S (S i)) O v)) (lift_weight_add_O (S (weight_map f u0)) v (S i) +f))))))))))))))))) (\lambda (v: T).(\lambda (t2: T).(\lambda (t1: T).(\lambda +(i: nat).(\lambda (_: (subst0 (S i) v t1 t2)).(\lambda (H1: ((\forall (f: +((nat \to nat))).(\forall (g: ((nat \to nat))).(((\forall (m: nat).(le (f m) +(g m)))) \to ((lt (weight_map f (lift (S (S i)) O v)) (g (S i))) \to (lt +(weight_map f t2) (weight_map g t1)))))))).(\lambda (u0: T).(\lambda (f: +((nat \to nat))).(\lambda (g: ((nat \to nat))).(\lambda (H2: ((\forall (m: +nat).(le (f m) (g m))))).(\lambda (H3: (lt (weight_map f (lift (S i) O v)) (g +i))).(lt_n_S (plus (weight_map f u0) (weight_map (wadd f O) t2)) (plus +(weight_map g u0) (weight_map (wadd g O) t1)) (plus_le_lt_compat (weight_map +f u0) (weight_map g u0) (weight_map (wadd f O) t2) (weight_map (wadd g O) t1) +(weight_le u0 f g H2) (H1 (wadd f O) (wadd g O) (\lambda (m: nat).(wadd_le f +g H2 O O (le_n O) m)) (eq_ind nat (weight_map f (lift (S i) O v)) (\lambda +(n: nat).(lt n (g i))) H3 (weight_map (wadd f O) (lift (S (S i)) O v)) +(lift_weight_add_O O v (S i) f)))))))))))))))) (\lambda (v: T).(\lambda (t2: +T).(\lambda (t1: T).(\lambda (i: nat).(\lambda (_: (subst0 (S i) v t1 +t2)).(\lambda (H1: ((\forall (f: ((nat \to nat))).(\forall (g: ((nat \to +nat))).(((\forall (m: nat).(le (f m) (g m)))) \to ((lt (weight_map f (lift (S +(S i)) O v)) (g (S i))) \to (lt (weight_map f t2) (weight_map g +t1)))))))).(\lambda (u0: T).(\lambda (f: ((nat \to nat))).(\lambda (g: ((nat +\to nat))).(\lambda (H2: ((\forall (m: nat).(le (f m) (g m))))).(\lambda (H3: +(lt (weight_map f (lift (S i) O v)) (g i))).(lt_n_S (plus (weight_map f u0) +(weight_map (wadd f O) t2)) (plus (weight_map g u0) (weight_map (wadd g O) +t1)) (plus_le_lt_compat (weight_map f u0) (weight_map g u0) (weight_map (wadd +f O) t2) (weight_map (wadd g O) t1) (weight_le u0 f g H2) (H1 (wadd f O) +(wadd g O) (\lambda (m: nat).(wadd_le f g H2 O O (le_n O) m)) (eq_ind nat +(weight_map f (lift (S i) O v)) (\lambda (n: nat).(lt n (g i))) H3 +(weight_map (wadd f O) (lift (S (S i)) O v)) (lift_weight_add_O O v (S i) +f)))))))))))))))) b)) (\lambda (_: F).(\lambda (v: T).(\lambda (t2: +T).(\lambda (t1: T).(\lambda (i: nat).(\lambda (_: (subst0 i v t1 +t2)).(\lambda (H1: ((\forall (f: ((nat \to nat))).(\forall (g: ((nat \to +nat))).(((\forall (m: nat).(le (f m) (g m)))) \to ((lt (weight_map f (lift (S +i) O v)) (g i)) \to (lt (weight_map f t2) (weight_map g t1)))))))).(\lambda +(u0: T).(\lambda (f0: ((nat \to nat))).(\lambda (g: ((nat \to nat))).(\lambda +(H2: ((\forall (m: nat).(le (f0 m) (g m))))).(\lambda (H3: (lt (weight_map f0 +(lift (S i) O v)) (g i))).(lt_n_S (plus (weight_map f0 u0) (weight_map f0 +t2)) (plus (weight_map g u0) (weight_map g t1)) (plus_le_lt_compat +(weight_map f0 u0) (weight_map g u0) (weight_map f0 t2) (weight_map g t1) +(weight_le u0 f0 g H2) (H1 f0 g H2 H3))))))))))))))) k)) (\lambda (v: +T).(\lambda (u1: T).(\lambda (u2: T).(\lambda (i: nat).(\lambda (_: (subst0 i +v u1 u2)).(\lambda (H1: ((\forall (f: ((nat \to nat))).(\forall (g: ((nat \to +nat))).(((\forall (m: nat).(le (f m) (g m)))) \to ((lt (weight_map f (lift (S +i) O v)) (g i)) \to (lt (weight_map f u2) (weight_map g u1)))))))).(\lambda +(k: K).(K_ind (\lambda (k0: K).(\forall (t1: T).(\forall (t2: T).((subst0 (s +k0 i) v t1 t2) \to (((\forall (f: ((nat \to nat))).(\forall (g: ((nat \to +nat))).(((\forall (m: nat).(le (f m) (g m)))) \to ((lt (weight_map f (lift (S +(s k0 i)) O v)) (g (s k0 i))) \to (lt (weight_map f t2) (weight_map g +t1))))))) \to (\forall (f: ((nat \to nat))).(\forall (g: ((nat \to +nat))).(((\forall (m: nat).(le (f m) (g m)))) \to ((lt (weight_map f (lift (S +i) O v)) (g i)) \to (lt (weight_map f (THead k0 u2 t2)) (weight_map g (THead +k0 u1 t1)))))))))))) (\lambda (b: B).(B_ind (\lambda (b0: B).(\forall (t1: +T).(\forall (t2: T).((subst0 (s (Bind b0) i) v t1 t2) \to (((\forall (f: +((nat \to nat))).(\forall (g: ((nat \to nat))).(((\forall (m: nat).(le (f m) +(g m)))) \to ((lt (weight_map f (lift (S (s (Bind b0) i)) O v)) (g (s (Bind +b0) i))) \to (lt (weight_map f t2) (weight_map g t1))))))) \to (\forall (f: +((nat \to nat))).(\forall (g: ((nat \to nat))).(((\forall (m: nat).(le (f m) +(g m)))) \to ((lt (weight_map f (lift (S i) O v)) (g i)) \to (lt (weight_map +f (THead (Bind b0) u2 t2)) (weight_map g (THead (Bind b0) u1 t1)))))))))))) +(\lambda (t1: T).(\lambda (t2: T).(\lambda (H2: (subst0 (S i) v t1 +t2)).(\lambda (_: ((\forall (f: ((nat \to nat))).(\forall (g: ((nat \to +nat))).(((\forall (m: nat).(le (f m) (g m)))) \to ((lt (weight_map f (lift (S +(S i)) O v)) (g (S i))) \to (lt (weight_map f t2) (weight_map g +t1)))))))).(\lambda (f: ((nat \to nat))).(\lambda (g: ((nat \to +nat))).(\lambda (H4: ((\forall (m: nat).(le (f m) (g m))))).(\lambda (H5: (lt +(weight_map f (lift (S i) O v)) (g i))).(lt_n_S (plus (weight_map f u2) +(weight_map (wadd f (S (weight_map f u2))) t2)) (plus (weight_map g u1) +(weight_map (wadd g (S (weight_map g u1))) t1)) (plus_lt_le_compat +(weight_map f u2) (weight_map g u1) (weight_map (wadd f (S (weight_map f +u2))) t2) (weight_map (wadd g (S (weight_map g u1))) t1) (H1 f g H4 H5) +(subst0_weight_le v t1 t2 (S i) H2 (wadd f (S (weight_map f u2))) (wadd g (S +(weight_map g u1))) (\lambda (m: nat).(wadd_le f g H4 (S (weight_map f u2)) +(S (weight_map g u1)) (le_S (S (weight_map f u2)) (weight_map g u1) (lt_le_S +(weight_map f u2) (weight_map g u1) (H1 f g H4 H5))) m)) (lt_le_S (weight_map +(wadd f (S (weight_map f u2))) (lift (S (S i)) O v)) (wadd g (S (weight_map g +u1)) (S i)) (eq_ind nat (weight_map f (lift (S i) O v)) (\lambda (n: nat).(lt +n (g i))) H5 (weight_map (wadd f (S (weight_map f u2))) (lift (S (S i)) O v)) +(lift_weight_add_O (S (weight_map f u2)) v (S i) f)))))))))))))) (\lambda +(t1: T).(\lambda (t2: T).(\lambda (_: (subst0 (S i) v t1 t2)).(\lambda (H3: +((\forall (f: ((nat \to nat))).(\forall (g: ((nat \to nat))).(((\forall (m: +nat).(le (f m) (g m)))) \to ((lt (weight_map f (lift (S (S i)) O v)) (g (S +i))) \to (lt (weight_map f t2) (weight_map g t1)))))))).(\lambda (f: ((nat +\to nat))).(\lambda (g: ((nat \to nat))).(\lambda (H4: ((\forall (m: nat).(le +(f m) (g m))))).(\lambda (H5: (lt (weight_map f (lift (S i) O v)) (g +i))).(lt_n_S (plus (weight_map f u2) (weight_map (wadd f O) t2)) (plus +(weight_map g u1) (weight_map (wadd g O) t1)) (plus_lt_compat (weight_map f +u2) (weight_map g u1) (weight_map (wadd f O) t2) (weight_map (wadd g O) t1) +(H1 f g H4 H5) (H3 (wadd f O) (wadd g O) (\lambda (m: nat).(le_S_n (wadd f O +m) (wadd g O m) (le_n_S (wadd f O m) (wadd g O m) (wadd_le f g H4 O O (le_n +O) m)))) (lt_le_S (weight_map (wadd f O) (lift (S (S i)) O v)) (wadd g O (S +i)) (eq_ind nat (weight_map f (lift (S i) O v)) (\lambda (n: nat).(lt n (g +i))) H5 (weight_map (wadd f O) (lift (S (S i)) O v)) (lift_weight_add_O O v +(S i) f)))))))))))))) (\lambda (t1: T).(\lambda (t2: T).(\lambda (_: (subst0 +(S i) v t1 t2)).(\lambda (H3: ((\forall (f: ((nat \to nat))).(\forall (g: +((nat \to nat))).(((\forall (m: nat).(le (f m) (g m)))) \to ((lt (weight_map +f (lift (S (S i)) O v)) (g (S i))) \to (lt (weight_map f t2) (weight_map g +t1)))))))).(\lambda (f: ((nat \to nat))).(\lambda (g: ((nat \to +nat))).(\lambda (H4: ((\forall (m: nat).(le (f m) (g m))))).(\lambda (H5: (lt +(weight_map f (lift (S i) O v)) (g i))).(lt_n_S (plus (weight_map f u2) +(weight_map (wadd f O) t2)) (plus (weight_map g u1) (weight_map (wadd g O) +t1)) (plus_lt_compat (weight_map f u2) (weight_map g u1) (weight_map (wadd f +O) t2) (weight_map (wadd g O) t1) (H1 f g H4 H5) (H3 (wadd f O) (wadd g O) +(\lambda (m: nat).(le_S_n (wadd f O m) (wadd g O m) (le_n_S (wadd f O m) +(wadd g O m) (wadd_le f g H4 O O (le_n O) m)))) (lt_le_S (weight_map (wadd f +O) (lift (S (S i)) O v)) (wadd g O (S i)) (eq_ind nat (weight_map f (lift (S +i) O v)) (\lambda (n: nat).(lt n (g i))) H5 (weight_map (wadd f O) (lift (S +(S i)) O v)) (lift_weight_add_O O v (S i) f)))))))))))))) b)) (\lambda (_: +F).(\lambda (t1: T).(\lambda (t2: T).(\lambda (_: (subst0 i v t1 +t2)).(\lambda (H3: ((\forall (f: ((nat \to nat))).(\forall (g: ((nat \to +nat))).(((\forall (m: nat).(le (f m) (g m)))) \to ((lt (weight_map f (lift (S +i) O v)) (g i)) \to (lt (weight_map f t2) (weight_map g t1)))))))).(\lambda +(f0: ((nat \to nat))).(\lambda (g: ((nat \to nat))).(\lambda (H4: ((\forall +(m: nat).(le (f0 m) (g m))))).(\lambda (H5: (lt (weight_map f0 (lift (S i) O +v)) (g i))).(lt_n_S (plus (weight_map f0 u2) (weight_map f0 t2)) (plus +(weight_map g u1) (weight_map g t1)) (plus_lt_compat (weight_map f0 u2) +(weight_map g u1) (weight_map f0 t2) (weight_map g t1) (H1 f0 g H4 H5) (H3 f0 +g H4 H5)))))))))))) k)))))))) d u t z H))))). + +theorem subst0_tlt_head: + \forall (u: T).(\forall (t: T).(\forall (z: T).((subst0 O u t z) \to (tlt +(THead (Bind Abbr) u z) (THead (Bind Abbr) u t))))) +\def + \lambda (u: T).(\lambda (t: T).(\lambda (z: T).(\lambda (H: (subst0 O u t +z)).(lt_n_S (plus (weight_map (\lambda (_: nat).O) u) (weight_map (wadd +(\lambda (_: nat).O) (S (weight_map (\lambda (_: nat).O) u))) z)) (plus +(weight_map (\lambda (_: nat).O) u) (weight_map (wadd (\lambda (_: nat).O) (S +(weight_map (\lambda (_: nat).O) u))) t)) (plus_le_lt_compat (weight_map +(\lambda (_: nat).O) u) (weight_map (\lambda (_: nat).O) u) (weight_map (wadd +(\lambda (_: nat).O) (S (weight_map (\lambda (_: nat).O) u))) z) (weight_map +(wadd (\lambda (_: nat).O) (S (weight_map (\lambda (_: nat).O) u))) t) (le_n +(weight_map (\lambda (_: nat).O) u)) (subst0_weight_lt u t z O H (wadd +(\lambda (_: nat).O) (S (weight_map (\lambda (_: nat).O) u))) (wadd (\lambda +(_: nat).O) (S (weight_map (\lambda (_: nat).O) u))) (\lambda (m: nat).(le_n +(wadd (\lambda (_: nat).O) (S (weight_map (\lambda (_: nat).O) u)) m))) +(eq_ind nat (weight_map (\lambda (_: nat).O) (lift O O u)) (\lambda (n: +nat).(lt n (S (weight_map (\lambda (_: nat).O) u)))) (eq_ind_r T u (\lambda +(t0: T).(lt (weight_map (\lambda (_: nat).O) t0) (S (weight_map (\lambda (_: +nat).O) u)))) (le_n (S (weight_map (\lambda (_: nat).O) u))) (lift O O u) +(lift_r u O)) (weight_map (wadd (\lambda (_: nat).O) (S (weight_map (\lambda +(_: nat).O) u))) (lift (S O) O u)) (lift_weight_add_O (S (weight_map (\lambda +(_: nat).O) u)) u O (\lambda (_: nat).O))))))))). + +theorem subst0_tlt: + \forall (u: T).(\forall (t: T).(\forall (z: T).((subst0 O u t z) \to (tlt z +(THead (Bind Abbr) u t))))) +\def + \lambda (u: T).(\lambda (t: T).(\lambda (z: T).(\lambda (H: (subst0 O u t +z)).(tlt_trans (THead (Bind Abbr) u z) z (THead (Bind Abbr) u t) (tlt_head_dx +(Bind Abbr) u z) (subst0_tlt_head u t z H))))). + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/theory.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/theory.ma index 7f15aaf08..b6324afbd 100644 --- a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/theory.ma +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/theory.ma @@ -80,6 +80,8 @@ include "drop1/defs.ma". include "drop1/props.ma". +include "drop1/getl.ma". + include "clear/defs.ma". include "clear/fwd.ma". @@ -98,12 +100,28 @@ include "getl/clear.ma". include "getl/drop.ma". +include "getl/getl.ma". + include "getl/dec.ma". include "getl/flt.ma". include "cimp/defs.ma". +include "cimp/props.ma". + +include "subst0/defs.ma". + +include "subst0/fwd.ma". + +include "subst0/props.ma". + +include "subst0/subst0.ma". + +include "subst0/tlt.ma". + +include "subst0/dec.ma". + include "G/defs.ma". include "next_plus/defs.ma". diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/problems-1.ma b/matita/contribs/LAMBDA-TYPES/Level-1/problems-1.ma new file mode 100644 index 000000000..f3b166546 --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/problems-1.ma @@ -0,0 +1,107 @@ +(**************************************************************************) +(* ___ *) +(* ||M|| *) +(* ||A|| A project by Andrea Asperti *) +(* ||T|| *) +(* ||I|| Developers: *) +(* ||T|| The HELM team. *) +(* ||A|| http://helm.cs.unibo.it *) +(* \ / *) +(* \ / This file is distributed under the terms of the *) +(* v GNU General Public License Version 2 *) +(* *) +(**************************************************************************) + +(* Problematic objects for disambiguation/typechecking ********************) +(* FG: PLEASE COMMENT THE NON WORKING OBJECTS *****************************) + +set "baseuri" "cic:/matita/LAMBDA-TYPES/Level-1/problems". + +include "LambdaDelta/theory.ma". + +theorem iso_trans: + \forall (t1: T).(\forall (t2: T).((iso t1 t2) \to (\forall (t3: T).((iso t2 +t3) \to (iso t1 t3))))) +\def + \lambda (t1: T).(\lambda (t2: T).(\lambda (H: (iso t1 t2)).(iso_ind (\lambda +(t: T).(\lambda (t0: T).(\forall (t3: T).((iso t0 t3) \to (iso t t3))))) +(\lambda (n1: nat).(\lambda (n2: nat).(\lambda (t3: T).(\lambda (H0: (iso +(TSort n2) t3)).(let H1 \def (match H0 in iso return (\lambda (t: T).(\lambda +(t0: T).(\lambda (_: (iso t t0)).((eq T t (TSort n2)) \to ((eq T t0 t3) \to +(iso (TSort n1) t3)))))) with [(iso_sort n0 n3) \Rightarrow (\lambda (H0: (eq +T (TSort n0) (TSort n2))).(\lambda (H1: (eq T (TSort n3) t3)).((let H2 \def +(f_equal T nat (\lambda (e: T).(match e in T return (\lambda (_: T).nat) with +[(TSort n) \Rightarrow n | (TLRef _) \Rightarrow n0 | (THead _ _ _) +\Rightarrow n0])) (TSort n0) (TSort n2) H0) in (eq_ind nat n2 (\lambda (_: +nat).((eq T (TSort n3) t3) \to (iso (TSort n1) t3))) (\lambda (H3: (eq T +(TSort n3) t3)).(eq_ind T (TSort n3) (\lambda (t: T).(iso (TSort n1) t)) +(iso_sort n1 n3) t3 H3)) n0 (sym_eq nat n0 n2 H2))) H1))) | (iso_lref i1 i2) +\Rightarrow (\lambda (H0: (eq T (TLRef i1) (TSort n2))).(\lambda (H1: (eq T +(TLRef i2) t3)).((let H2 \def (eq_ind T (TLRef i1) (\lambda (e: T).(match e +in T return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | (TLRef +_) \Rightarrow True | (THead _ _ _) \Rightarrow False])) I (TSort n2) H0) in +(False_ind ((eq T (TLRef i2) t3) \to (iso (TSort n1) t3)) H2)) H1))) | +(iso_head k v1 v2 t1 t2) \Rightarrow (\lambda (H0: (eq T (THead k v1 t1) +(TSort n2))).(\lambda (H1: (eq T (THead k v2 t2) t3)).((let H2 \def (eq_ind T +(THead k v1 t1) (\lambda (e: T).(match e in T return (\lambda (_: T).Prop) +with [(TSort _) \Rightarrow False | (TLRef _) \Rightarrow False | (THead _ _ +_) \Rightarrow True])) I (TSort n2) H0) in (False_ind ((eq T (THead k v2 t2) +t3) \to (iso (TSort n1) t3)) H2)) H1)))]) in (H1 (refl_equal T (TSort n2)) +(refl_equal T t3))))))) (\lambda (i1: nat).(\lambda (i2: nat).(\lambda (t3: +T).(\lambda (H0: (iso (TLRef i2) t3)).(let H1 \def (match H0 in iso return +(\lambda (t: T).(\lambda (t0: T).(\lambda (_: (iso t t0)).((eq T t (TLRef +i2)) \to ((eq T t0 t3) \to (iso (TLRef i1) t3)))))) with [(iso_sort n1 n2) +\Rightarrow (\lambda (H0: (eq T (TSort n1) (TLRef i2))).(\lambda (H1: (eq T +(TSort n2) t3)).((let H2 \def (eq_ind T (TSort n1) (\lambda (e: T).(match e +in T return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow True | (TLRef +_) \Rightarrow False | (THead _ _ _) \Rightarrow False])) I (TLRef i2) H0) in +(False_ind ((eq T (TSort n2) t3) \to (iso (TLRef i1) t3)) H2)) H1))) | +(iso_lref i0 i3) \Rightarrow (\lambda (H0: (eq T (TLRef i0) (TLRef +i2))).(\lambda (H1: (eq T (TLRef i3) t3)).((let H2 \def (f_equal T nat +(\lambda (e: T).(match e in T return (\lambda (_: T).nat) with [(TSort _) +\Rightarrow i0 | (TLRef n) \Rightarrow n | (THead _ _ _) \Rightarrow i0])) +(TLRef i0) (TLRef i2) H0) in (eq_ind nat i2 (\lambda (_: nat).((eq T (TLRef +i3) t3) \to (iso (TLRef i1) t3))) (\lambda (H3: (eq T (TLRef i3) t3)).(eq_ind +T (TLRef i3) (\lambda (t: T).(iso (TLRef i1) t)) (iso_lref i1 i3) t3 H3)) i0 +(sym_eq nat i0 i2 H2))) H1))) | (iso_head k v1 v2 t1 t2) \Rightarrow (\lambda +(H0: (eq T (THead k v1 t1) (TLRef i2))).(\lambda (H1: (eq T (THead k v2 t2) +t3)).((let H2 \def (eq_ind T (THead k v1 t1) (\lambda (e: T).(match e in T +return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) +\Rightarrow False | (THead _ _ _) \Rightarrow True])) I (TLRef i2) H0) in +(False_ind ((eq T (THead k v2 t2) t3) \to (iso (TLRef i1) t3)) H2)) H1)))]) +in (H1 (refl_equal T (TLRef i2)) (refl_equal T t3))))))) (\lambda (k: +K).(\lambda (v1: T).(\lambda (v2: T).(\lambda (t3: T).(\lambda (t4: +T).(\lambda (t5: T).(\lambda (H0: (iso (THead k v2 t4) t5)).(let H1 \def +(match H0 in iso return (\lambda (t: T).(\lambda (t0: T).(\lambda (_: (iso t +t0)).((eq T t (THead k v2 t4)) \to ((eq T t0 t5) \to (iso (THead k v1 t3) +t5)))))) with [(iso_sort n1 n2) \Rightarrow (\lambda (H0: (eq T (TSort n1) +(THead k v2 t4))).(\lambda (H1: (eq T (TSort n2) t5)).((let H2 \def (eq_ind T +(TSort n1) (\lambda (e: T).(match e in T return (\lambda (_: T).Prop) with +[(TSort _) \Rightarrow True | (TLRef _) \Rightarrow False | (THead _ _ _) +\Rightarrow False])) I (THead k v2 t4) H0) in (False_ind ((eq T (TSort n2) +t5) \to (iso (THead k v1 t3) t5)) H2)) H1))) | (iso_lref i1 i2) \Rightarrow +(\lambda (H0: (eq T (TLRef i1) (THead k v2 t4))).(\lambda (H1: (eq T (TLRef +i2) t5)).((let H2 \def (eq_ind T (TLRef i1) (\lambda (e: T).(match e in T +return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) +\Rightarrow True | (THead _ _ _) \Rightarrow False])) I (THead k v2 t4) H0) +in (False_ind ((eq T (TLRef i2) t5) \to (iso (THead k v1 t3) t5)) H2)) H1))) +| (iso_head k0 v0 v3 t0 t4) \Rightarrow (\lambda (H0: (eq T (THead k0 v0 t0) +(THead k v2 t4))).(\lambda (H1: (eq T (THead k0 v3 t4) t5)).((let H2 \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 v0 t0) (THead k v2 t4) H0) in ((let H3 \def +(f_equal T T (\lambda (e: T).(match e in T return (\lambda (_: T).T) with +[(TSort _) \Rightarrow v0 | (TLRef _) \Rightarrow v0 | (THead _ t _) +\Rightarrow t])) (THead k0 v0 t0) (THead k v2 t4) H0) in ((let H4 \def +(f_equal T K (\lambda (e: T).(match e in T return (\lambda (_: T).K) with +[(TSort _) \Rightarrow k0 | (TLRef _) \Rightarrow k0 | (THead k _ _) +\Rightarrow k])) (THead k0 v0 t0) (THead k v2 t4) H0) in (eq_ind K k (\lambda +(k1: K).((eq T v0 v2) \to ((eq T t0 t4) \to ((eq T (THead k1 v3 t4) t5) \to +(iso (THead k v1 t3) t5))))) (\lambda (H5: (eq T v0 v2)).(eq_ind T v2 +(\lambda (_: T).((eq T t0 t4) \to ((eq T (THead k v3 t4) t5) \to (iso (THead +k v1 t3) t5)))) (\lambda (H6: (eq T t0 t4)).(eq_ind T t4 (\lambda (_: T).((eq +T (THead k v3 t4) t5) \to (iso (THead k v1 t3) t5))) (\lambda (H7: (eq T +(THead k v3 t4) t5)).(eq_ind T (THead k v3 t4) (\lambda (t: T).(iso (THead k +v1 t3) t)) (iso_head k v1 v3 t3 t4) t5 H7)) t0 (sym_eq T t0 t4 H6))) v0 +(sym_eq T v0 v2 H5))) k0 (sym_eq K k0 k H4))) H3)) H2)) H1)))]) in (H1 +(refl_equal T (THead k v2 t4)) (refl_equal T t5)))))))))) t1 t2 H))). diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/problems-2.ma b/matita/contribs/LAMBDA-TYPES/Level-1/problems-2.ma new file mode 100644 index 000000000..a0f6f0275 --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/problems-2.ma @@ -0,0 +1,158 @@ +(**************************************************************************) +(* ___ *) +(* ||M|| *) +(* ||A|| A project by Andrea Asperti *) +(* ||T|| *) +(* ||I|| Developers: *) +(* ||T|| The HELM team. *) +(* ||A|| http://helm.cs.unibo.it *) +(* \ / *) +(* \ / This file is distributed under the terms of the *) +(* v GNU General Public License Version 2 *) +(* *) +(**************************************************************************) + +(* Problematic objects for disambiguation/typechecking ********************) +(* FG: PLEASE COMMENT THE NON WORKING OBJECTS *****************************) + +set "baseuri" "cic:/matita/LAMBDA-TYPES/Level-1/problems". + +include "LambdaDelta/theory.ma". + +theorem drop1_getl_trans: + \forall (hds: PList).(\forall (c1: C).(\forall (c2: C).((drop1 hds c2 c1) +\to (\forall (b: B).(\forall (e1: C).(\forall (v: T).(\forall (i: nat).((getl +i c1 (CHead e1 (Bind b) v)) \to (ex C (\lambda (e2: C).(getl (trans hds i) c2 +(CHead e2 (Bind b) (ctrans hds i v))))))))))))) +\def + \lambda (hds: PList).(PList_ind (\lambda (p: PList).(\forall (c1: +C).(\forall (c2: C).((drop1 p c2 c1) \to (\forall (b: B).(\forall (e1: +C).(\forall (v: T).(\forall (i: nat).((getl i c1 (CHead e1 (Bind b) v)) \to +(ex C (\lambda (e2: C).(getl (trans p i) c2 (CHead e2 (Bind b) (ctrans p i +v)))))))))))))) (\lambda (c1: C).(\lambda (c2: C).(\lambda (H: (drop1 PNil c2 +c1)).(\lambda (b: B).(\lambda (e1: C).(\lambda (v: T).(\lambda (i: +nat).(\lambda (H0: (getl i c1 (CHead e1 (Bind b) v))).(let H1 \def (match H +in drop1 return (\lambda (p: PList).(\lambda (c: C).(\lambda (c0: C).(\lambda +(_: (drop1 p c c0)).((eq PList p PNil) \to ((eq C c c2) \to ((eq C c0 c1) \to +(ex C (\lambda (e2: C).(getl i c2 (CHead e2 (Bind b) v))))))))))) with +[(drop1_nil c) \Rightarrow (\lambda (_: (eq PList PNil PNil)).(\lambda (H2: +(eq C c c2)).(\lambda (H3: (eq C c c1)).(eq_ind C c2 (\lambda (c0: C).((eq C +c0 c1) \to (ex C (\lambda (e2: C).(getl i c2 (CHead e2 (Bind b) v)))))) +(\lambda (H4: (eq C c2 c1)).(eq_ind C c1 (\lambda (c0: C).(ex C (\lambda (e2: +C).(getl i c0 (CHead e2 (Bind b) v))))) (ex_intro C (\lambda (e2: C).(getl i +c1 (CHead e2 (Bind b) v))) e1 H0) c2 (sym_eq C c2 c1 H4))) c (sym_eq C c c2 +H2) H3)))) | (drop1_cons c0 c3 h d H1 c4 hds H2) \Rightarrow (\lambda (H3: +(eq PList (PCons h d hds) PNil)).(\lambda (H4: (eq C c0 c2)).(\lambda (H5: +(eq C c4 c1)).((let H6 \def (eq_ind PList (PCons h d hds) (\lambda (e: +PList).(match e in PList return (\lambda (_: PList).Prop) with [PNil +\Rightarrow False | (PCons _ _ _) \Rightarrow True])) I PNil H3) in +(False_ind ((eq C c0 c2) \to ((eq C c4 c1) \to ((drop h d c0 c3) \to ((drop1 +hds c3 c4) \to (ex C (\lambda (e2: C).(getl i c2 (CHead e2 (Bind b) v)))))))) +H6)) H4 H5 H1 H2))))]) in (H1 (refl_equal PList PNil) (refl_equal C c2) +(refl_equal C c1))))))))))) (\lambda (h: nat).(\lambda (d: nat).(\lambda +(hds0: PList).(\lambda (H: ((\forall (c1: C).(\forall (c2: C).((drop1 hds0 c2 +c1) \to (\forall (b: B).(\forall (e1: C).(\forall (v: T).(\forall (i: +nat).((getl i c1 (CHead e1 (Bind b) v)) \to (ex C (\lambda (e2: C).(getl +(trans hds0 i) c2 (CHead e2 (Bind b) (ctrans hds0 i v))))))))))))))).(\lambda +(c1: C).(\lambda (c2: C).(\lambda (H0: (drop1 (PCons h d hds0) c2 +c1)).(\lambda (b: B).(\lambda (e1: C).(\lambda (v: T).(\lambda (i: +nat).(\lambda (H1: (getl i c1 (CHead e1 (Bind b) v))).(let H2 \def (match H0 +in drop1 return (\lambda (p: PList).(\lambda (c: C).(\lambda (c0: C).(\lambda +(_: (drop1 p c c0)).((eq PList p (PCons h d hds0)) \to ((eq C c c2) \to ((eq +C c0 c1) \to (ex C (\lambda (e2: C).(getl (match (blt (trans hds0 i) d) with +[true \Rightarrow (trans hds0 i) | false \Rightarrow (plus (trans hds0 i) +h)]) c2 (CHead e2 (Bind b) (match (blt (trans hds0 i) d) with [true +\Rightarrow (lift h (minus d (S (trans hds0 i))) (ctrans hds0 i v)) | false +\Rightarrow (ctrans hds0 i v)])))))))))))) with [(drop1_nil c) \Rightarrow +(\lambda (H2: (eq PList PNil (PCons h d hds0))).(\lambda (H3: (eq C c +c2)).(\lambda (H4: (eq C c c1)).((let H5 \def (eq_ind PList PNil (\lambda (e: +PList).(match e in PList return (\lambda (_: PList).Prop) with [PNil +\Rightarrow True | (PCons _ _ _) \Rightarrow False])) I (PCons h d hds0) H2) +in (False_ind ((eq C c c2) \to ((eq C c c1) \to (ex C (\lambda (e2: C).(getl +(match (blt (trans hds0 i) d) with [true \Rightarrow (trans hds0 i) | false +\Rightarrow (plus (trans hds0 i) h)]) c2 (CHead e2 (Bind b) (match (blt +(trans hds0 i) d) with [true \Rightarrow (lift h (minus d (S (trans hds0 i))) +(ctrans hds0 i v)) | false \Rightarrow (ctrans hds0 i v)]))))))) H5)) H3 +H4)))) | (drop1_cons c0 c3 h0 d0 H2 c4 hds0 H3) \Rightarrow (\lambda (H4: (eq +PList (PCons h0 d0 hds0) (PCons h d hds0))).(\lambda (H5: (eq C c0 +c2)).(\lambda (H6: (eq C c4 c1)).((let H7 \def (f_equal PList PList (\lambda +(e: PList).(match e in PList return (\lambda (_: PList).PList) with [PNil +\Rightarrow hds0 | (PCons _ _ p) \Rightarrow p])) (PCons h0 d0 hds0) (PCons h +d hds0) H4) in ((let H8 \def (f_equal PList nat (\lambda (e: PList).(match e +in PList return (\lambda (_: PList).nat) with [PNil \Rightarrow d0 | (PCons _ +n _) \Rightarrow n])) (PCons h0 d0 hds0) (PCons h d hds0) H4) in ((let H9 +\def (f_equal PList nat (\lambda (e: PList).(match e in PList return (\lambda +(_: PList).nat) with [PNil \Rightarrow h0 | (PCons n _ _) \Rightarrow n])) +(PCons h0 d0 hds0) (PCons h d hds0) H4) in (eq_ind nat h (\lambda (n: +nat).((eq nat d0 d) \to ((eq PList hds0 hds0) \to ((eq C c0 c2) \to ((eq C c4 +c1) \to ((drop n d0 c0 c3) \to ((drop1 hds0 c3 c4) \to (ex C (\lambda (e2: +C).(getl (match (blt (trans hds0 i) d) with [true \Rightarrow (trans hds0 i) +| false \Rightarrow (plus (trans hds0 i) h)]) c2 (CHead e2 (Bind b) (match +(blt (trans hds0 i) d) with [true \Rightarrow (lift h (minus d (S (trans hds0 +i))) (ctrans hds0 i v)) | false \Rightarrow (ctrans hds0 i v)])))))))))))) +(\lambda (H10: (eq nat d0 d)).(eq_ind nat d (\lambda (n: nat).((eq PList hds0 +hds0) \to ((eq C c0 c2) \to ((eq C c4 c1) \to ((drop h n c0 c3) \to ((drop1 +hds0 c3 c4) \to (ex C (\lambda (e2: C).(getl (match (blt (trans hds0 i) d) +with [true \Rightarrow (trans hds0 i) | false \Rightarrow (plus (trans hds0 +i) h)]) c2 (CHead e2 (Bind b) (match (blt (trans hds0 i) d) with [true +\Rightarrow (lift h (minus d (S (trans hds0 i))) (ctrans hds0 i v)) | false +\Rightarrow (ctrans hds0 i v)]))))))))))) (\lambda (H11: (eq PList hds0 +hds0)).(eq_ind PList hds0 (\lambda (p: PList).((eq C c0 c2) \to ((eq C c4 c1) +\to ((drop h d c0 c3) \to ((drop1 p c3 c4) \to (ex C (\lambda (e2: C).(getl +(match (blt (trans hds0 i) d) with [true \Rightarrow (trans hds0 i) | false +\Rightarrow (plus (trans hds0 i) h)]) c2 (CHead e2 (Bind b) (match (blt +(trans hds0 i) d) with [true \Rightarrow (lift h (minus d (S (trans hds0 i))) +(ctrans hds0 i v)) | false \Rightarrow (ctrans hds0 i v)])))))))))) (\lambda +(H12: (eq C c0 c2)).(eq_ind C c2 (\lambda (c: C).((eq C c4 c1) \to ((drop h d +c c3) \to ((drop1 hds0 c3 c4) \to (ex C (\lambda (e2: C).(getl (match (blt +(trans hds0 i) d) with [true \Rightarrow (trans hds0 i) | false \Rightarrow +(plus (trans hds0 i) h)]) c2 (CHead e2 (Bind b) (match (blt (trans hds0 i) d) +with [true \Rightarrow (lift h (minus d (S (trans hds0 i))) (ctrans hds0 i +v)) | false \Rightarrow (ctrans hds0 i v)]))))))))) (\lambda (H13: (eq C c4 +c1)).(eq_ind C c1 (\lambda (c: C).((drop h d c2 c3) \to ((drop1 hds0 c3 c) +\to (ex C (\lambda (e2: C).(getl (match (blt (trans hds0 i) d) with [true +\Rightarrow (trans hds0 i) | false \Rightarrow (plus (trans hds0 i) h)]) c2 +(CHead e2 (Bind b) (match (blt (trans hds0 i) d) with [true \Rightarrow (lift +h (minus d (S (trans hds0 i))) (ctrans hds0 i v)) | false \Rightarrow (ctrans +hds0 i v)])))))))) (\lambda (H14: (drop h d c2 c3)).(\lambda (H15: (drop1 +hds0 c3 c1)).(xinduction bool (blt (trans hds0 i) d) (\lambda (b0: bool).(ex +C (\lambda (e2: C).(getl (match b0 with [true \Rightarrow (trans hds0 i) | +false \Rightarrow (plus (trans hds0 i) h)]) c2 (CHead e2 (Bind b) (match b0 +with [true \Rightarrow (lift h (minus d (S (trans hds0 i))) (ctrans hds0 i +v)) | false \Rightarrow (ctrans hds0 i v)])))))) (\lambda (x_x: +bool).(bool_ind (\lambda (b0: bool).((eq bool (blt (trans hds0 i) d) b0) \to +(ex C (\lambda (e2: C).(getl (match b0 with [true \Rightarrow (trans hds0 i) +| false \Rightarrow (plus (trans hds0 i) h)]) c2 (CHead e2 (Bind b) (match b0 +with [true \Rightarrow (lift h (minus d (S (trans hds0 i))) (ctrans hds0 i +v)) | false \Rightarrow (ctrans hds0 i v)]))))))) (\lambda (H0: (eq bool (blt +(trans hds0 i) d) true)).(let H_x \def (H c1 c3 H15 b e1 v i H1) in (let H16 +\def H_x in (ex_ind C (\lambda (e2: C).(getl (trans hds0 i) c3 (CHead e2 +(Bind b) (ctrans hds0 i v)))) (ex C (\lambda (e2: C).(getl (trans hds0 i) c2 +(CHead e2 (Bind b) (lift h (minus d (S (trans hds0 i))) (ctrans hds0 i +v)))))) (\lambda (x: C).(\lambda (H17: (getl (trans hds0 i) c3 (CHead x (Bind +b) (ctrans hds0 i v)))).(let H_x0 \def (drop_getl_trans_lt (trans hds0 i) d +(le_S_n (S (trans hds0 i)) d (lt_le_S (S (trans hds0 i)) (S d) (blt_lt (S d) +(S (trans hds0 i)) H0))) c2 c3 h H14 b x (ctrans hds0 i v) H17) in (let H +\def H_x0 in (ex2_ind C (\lambda (e1: C).(getl (trans hds0 i) c2 (CHead e1 +(Bind b) (lift h (minus d (S (trans hds0 i))) (ctrans hds0 i v))))) (\lambda +(e1: C).(drop h (minus d (S (trans hds0 i))) e1 x)) (ex C (\lambda (e2: +C).(getl (trans hds0 i) c2 (CHead e2 (Bind b) (lift h (minus d (S (trans hds0 +i))) (ctrans hds0 i v)))))) (\lambda (x0: C).(\lambda (H1: (getl (trans hds0 +i) c2 (CHead x0 (Bind b) (lift h (minus d (S (trans hds0 i))) (ctrans hds0 i +v))))).(\lambda (_: (drop h (minus d (S (trans hds0 i))) x0 x)).(ex_intro C +(\lambda (e2: C).(getl (trans hds0 i) c2 (CHead e2 (Bind b) (lift h (minus d +(S (trans hds0 i))) (ctrans hds0 i v))))) x0 H1)))) H))))) H16)))) (\lambda +(H0: (eq bool (blt (trans hds0 i) d) false)).(let H_x \def (H c1 c3 H15 b e1 +v i H1) in (let H16 \def H_x in (ex_ind C (\lambda (e2: C).(getl (trans hds0 +i) c3 (CHead e2 (Bind b) (ctrans hds0 i v)))) (ex C (\lambda (e2: C).(getl +(plus (trans hds0 i) h) c2 (CHead e2 (Bind b) (ctrans hds0 i v))))) (\lambda +(x: C).(\lambda (H17: (getl (trans hds0 i) c3 (CHead x (Bind b) (ctrans hds0 +i v)))).(let H \def (drop_getl_trans_ge (trans hds0 i) c2 c3 d h H14 (CHead x +(Bind b) (ctrans hds0 i v)) H17) in (ex_intro C (\lambda (e2: C).(getl (plus +(trans hds0 i) h) c2 (CHead e2 (Bind b) (ctrans hds0 i v)))) x (H (bge_le d +(trans hds0 i) H0)))))) H16)))) x_x))))) c4 (sym_eq C c4 c1 H13))) c0 (sym_eq +C c0 c2 H12))) hds0 (sym_eq PList hds0 hds0 H11))) d0 (sym_eq nat d0 d H10))) +h0 (sym_eq nat h0 h H9))) H8)) H7)) H5 H6 H2 H3))))]) in (H2 (refl_equal +PList (PCons h d hds0)) (refl_equal C c2) (refl_equal C c1))))))))))))))) +hds). + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/problems.ma b/matita/contribs/LAMBDA-TYPES/Level-1/problems.ma index 995eeae40..72b810c22 100644 --- a/matita/contribs/LAMBDA-TYPES/Level-1/problems.ma +++ b/matita/contribs/LAMBDA-TYPES/Level-1/problems.ma @@ -13,109 +13,18 @@ (**************************************************************************) (* Problematic objects for disambiguation/typechecking ********************) -(* FG: PLEASE COMMENT THE NON WORKING OBJECTS *****************************) set "baseuri" "cic:/matita/LAMBDA-TYPES/Level-1/problems". include "LambdaDelta/theory.ma". -(* +(* Problem 1: disambiguation errors with these objects *) -(* Problem 2: disambiguation errors with these objects *) +(* iso_trans (in problems-1) + * drop1_getl_trans (in problems-2) + *) -iso_trans (in iso/props) - -theorem iso_trans: - \forall (t1: T).(\forall (t2: T).((iso t1 t2) \to (\forall (t3: T).((iso t2 -t3) \to (iso t1 t3))))) -\def - \lambda (t1: T).(\lambda (t2: T).(\lambda (H: (iso t1 t2)).(iso_ind (\lambda -(t: T).(\lambda (t0: T).(\forall (t3: T).((iso t0 t3) \to (iso t t3))))) -(\lambda (n1: nat).(\lambda (n2: nat).(\lambda (t3: T).(\lambda (H0: (iso -(TSort n2) t3)).(let H1 \def (match H0 in iso return (\lambda (t: T).(\lambda -(t0: T).(\lambda (_: (iso t t0)).((eq T t (TSort n2)) \to ((eq T t0 t3) \to -(iso (TSort n1) t3)))))) with [(iso_sort n0 n3) \Rightarrow (\lambda (H0: (eq -T (TSort n0) (TSort n2))).(\lambda (H1: (eq T (TSort n3) t3)).((let H2 \def -(f_equal T nat (\lambda (e: T).(match e in T return (\lambda (_: T).nat) with -[(TSort n) \Rightarrow n | (TLRef _) \Rightarrow n0 | (THead _ _ _) -\Rightarrow n0])) (TSort n0) (TSort n2) H0) in (eq_ind nat n2 (\lambda (_: -nat).((eq T (TSort n3) t3) \to (iso (TSort n1) t3))) (\lambda (H3: (eq T -(TSort n3) t3)).(eq_ind T (TSort n3) (\lambda (t: T).(iso (TSort n1) t)) -(iso_sort n1 n3) t3 H3)) n0 (sym_eq nat n0 n2 H2))) H1))) | (iso_lref i1 i2) -\Rightarrow (\lambda (H0: (eq T (TLRef i1) (TSort n2))).(\lambda (H1: (eq T -(TLRef i2) t3)).((let H2 \def (eq_ind T (TLRef i1) (\lambda (e: T).(match e -in T return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | (TLRef -_) \Rightarrow True | (THead _ _ _) \Rightarrow False])) I (TSort n2) H0) in -(False_ind ((eq T (TLRef i2) t3) \to (iso (TSort n1) t3)) H2)) H1))) | -(iso_head k v1 v2 t1 t2) \Rightarrow (\lambda (H0: (eq T (THead k v1 t1) -(TSort n2))).(\lambda (H1: (eq T (THead k v2 t2) t3)).((let H2 \def (eq_ind T -(THead k v1 t1) (\lambda (e: T).(match e in T return (\lambda (_: T).Prop) -with [(TSort _) \Rightarrow False | (TLRef _) \Rightarrow False | (THead _ _ -_) \Rightarrow True])) I (TSort n2) H0) in (False_ind ((eq T (THead k v2 t2) -t3) \to (iso (TSort n1) t3)) H2)) H1)))]) in (H1 (refl_equal T (TSort n2)) -(refl_equal T t3))))))) (\lambda (i1: nat).(\lambda (i2: nat).(\lambda (t3: -T).(\lambda (H0: (iso (TLRef i2) t3)).(let H1 \def (match H0 in iso return -(\lambda (t: T).(\lambda (t0: T).(\lambda (_: (iso t t0)).((eq T t (TLRef -i2)) \to ((eq T t0 t3) \to (iso (TLRef i1) t3)))))) with [(iso_sort n1 n2) -\Rightarrow (\lambda (H0: (eq T (TSort n1) (TLRef i2))).(\lambda (H1: (eq T -(TSort n2) t3)).((let H2 \def (eq_ind T (TSort n1) (\lambda (e: T).(match e -in T return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow True | (TLRef -_) \Rightarrow False | (THead _ _ _) \Rightarrow False])) I (TLRef i2) H0) in -(False_ind ((eq T (TSort n2) t3) \to (iso (TLRef i1) t3)) H2)) H1))) | -(iso_lref i0 i3) \Rightarrow (\lambda (H0: (eq T (TLRef i0) (TLRef -i2))).(\lambda (H1: (eq T (TLRef i3) t3)).((let H2 \def (f_equal T nat -(\lambda (e: T).(match e in T return (\lambda (_: T).nat) with [(TSort _) -\Rightarrow i0 | (TLRef n) \Rightarrow n | (THead _ _ _) \Rightarrow i0])) -(TLRef i0) (TLRef i2) H0) in (eq_ind nat i2 (\lambda (_: nat).((eq T (TLRef -i3) t3) \to (iso (TLRef i1) t3))) (\lambda (H3: (eq T (TLRef i3) t3)).(eq_ind -T (TLRef i3) (\lambda (t: T).(iso (TLRef i1) t)) (iso_lref i1 i3) t3 H3)) i0 -(sym_eq nat i0 i2 H2))) H1))) | (iso_head k v1 v2 t1 t2) \Rightarrow (\lambda -(H0: (eq T (THead k v1 t1) (TLRef i2))).(\lambda (H1: (eq T (THead k v2 t2) -t3)).((let H2 \def (eq_ind T (THead k v1 t1) (\lambda (e: T).(match e in T -return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) -\Rightarrow False | (THead _ _ _) \Rightarrow True])) I (TLRef i2) H0) in -(False_ind ((eq T (THead k v2 t2) t3) \to (iso (TLRef i1) t3)) H2)) H1)))]) -in (H1 (refl_equal T (TLRef i2)) (refl_equal T t3))))))) (\lambda (k: -K).(\lambda (v1: T).(\lambda (v2: T).(\lambda (t3: T).(\lambda (t4: -T).(\lambda (t5: T).(\lambda (H0: (iso (THead k v2 t4) t5)).(let H1 \def -(match H0 in iso return (\lambda (t: T).(\lambda (t0: T).(\lambda (_: (iso t -t0)).((eq T t (THead k v2 t4)) \to ((eq T t0 t5) \to (iso (THead k v1 t3) -t5)))))) with [(iso_sort n1 n2) \Rightarrow (\lambda (H0: (eq T (TSort n1) -(THead k v2 t4))).(\lambda (H1: (eq T (TSort n2) t5)).((let H2 \def (eq_ind T -(TSort n1) (\lambda (e: T).(match e in T return (\lambda (_: T).Prop) with -[(TSort _) \Rightarrow True | (TLRef _) \Rightarrow False | (THead _ _ _) -\Rightarrow False])) I (THead k v2 t4) H0) in (False_ind ((eq T (TSort n2) -t5) \to (iso (THead k v1 t3) t5)) H2)) H1))) | (iso_lref i1 i2) \Rightarrow -(\lambda (H0: (eq T (TLRef i1) (THead k v2 t4))).(\lambda (H1: (eq T (TLRef -i2) t5)).((let H2 \def (eq_ind T (TLRef i1) (\lambda (e: T).(match e in T -return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) -\Rightarrow True | (THead _ _ _) \Rightarrow False])) I (THead k v2 t4) H0) -in (False_ind ((eq T (TLRef i2) t5) \to (iso (THead k v1 t3) t5)) H2)) H1))) -| (iso_head k0 v0 v3 t0 t4) \Rightarrow (\lambda (H0: (eq T (THead k0 v0 t0) -(THead k v2 t4))).(\lambda (H1: (eq T (THead k0 v3 t4) t5)).((let H2 \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 v0 t0) (THead k v2 t4) H0) in ((let H3 \def -(f_equal T T (\lambda (e: T).(match e in T return (\lambda (_: T).T) with -[(TSort _) \Rightarrow v0 | (TLRef _) \Rightarrow v0 | (THead _ t _) -\Rightarrow t])) (THead k0 v0 t0) (THead k v2 t4) H0) in ((let H4 \def -(f_equal T K (\lambda (e: T).(match e in T return (\lambda (_: T).K) with -[(TSort _) \Rightarrow k0 | (TLRef _) \Rightarrow k0 | (THead k _ _) -\Rightarrow k])) (THead k0 v0 t0) (THead k v2 t4) H0) in (eq_ind K k (\lambda -(k1: K).((eq T v0 v2) \to ((eq T t0 t4) \to ((eq T (THead k1 v3 t4) t5) \to -(iso (THead k v1 t3) t5))))) (\lambda (H5: (eq T v0 v2)).(eq_ind T v2 -(\lambda (_: T).((eq T t0 t4) \to ((eq T (THead k v3 t4) t5) \to (iso (THead -k v1 t3) t5)))) (\lambda (H6: (eq T t0 t4)).(eq_ind T t4 (\lambda (_: T).((eq -T (THead k v3 t4) t5) \to (iso (THead k v1 t3) t5))) (\lambda (H7: (eq T -(THead k v3 t4) t5)).(eq_ind T (THead k v3 t4) (\lambda (t: T).(iso (THead k -v1 t3) t)) (iso_head k v1 v3 t3 t4) t5 H7)) t0 (sym_eq T t0 t4 H6))) v0 -(sym_eq T v0 v2 H5))) k0 (sym_eq K k0 k H4))) H3)) H2)) H1)))]) in (H1 -(refl_equal T (THead k v2 t4)) (refl_equal T t5)))))))))) t1 t2 H))). - - -drop1_getl_trans - -(* Problem 1: does not typecheck a match on an empty type *) +(* Problem 2: does not typecheck a match on an empty type *) theorem subst0_confluence_neq: \forall (t0: T).(\forall (t1: T).(\forall (u1: T).(\forall (i1: nat).((subst0 i1 u1 t0 t1) \to (\forall (t2: T).(\forall (u2: T).(\forall (i2: nat).((subst0 i2 u2 t0 t2) \to ((not (eq nat i1 i2)) \to (ex2 T (\lambda (t: T).(subst0 i2 u2 t1 t)) (\lambda (t: T).(subst0 i1 u1 t2 t)))))))))))) @@ -124,6 +33,5 @@ theorem subst0_confluence_neq: (* Problem 3: assertion failure raised by type checker on this object *) -tau1 - -*) +(* tau1 + *)