From: Ferruccio Guidi Date: Sun, 10 Sep 2006 15:19:54 +0000 (+0000) Subject: ok up to arity assignment X-Git-Tag: 0.4.95@7852~1057 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=2a50a96876a87f5189558a49c21167131ff95b6b;p=helm.git ok up to arity assignment --- diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/aprem/defs.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/aprem/defs.ma new file mode 100644 index 000000000..5d627311f --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/aprem/defs.ma @@ -0,0 +1,25 @@ +(**************************************************************************) +(* ___ *) +(* ||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/aprem/defs". + +include "A/defs.ma". + +inductive aprem: nat \to (A \to (A \to Prop)) \def +| aprem_zero: \forall (a1: A).(\forall (a2: A).(aprem O (AHead a1 a2) a1)) +| aprem_succ: \forall (a2: A).(\forall (a: A).(\forall (i: nat).((aprem i a2 +a) \to (\forall (a1: A).(aprem (S i) (AHead a1 a2) a))))). + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/aprem/props.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/aprem/props.ma new file mode 100644 index 000000000..6f3e8dbf9 --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/aprem/props.ma @@ -0,0 +1,150 @@ +(**************************************************************************) +(* ___ *) +(* ||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/aprem/props". + +include "aprem/defs.ma". + +include "leq/defs.ma". + +theorem aprem_repl: + \forall (g: G).(\forall (a1: A).(\forall (a2: A).((leq g a1 a2) \to (\forall +(i: nat).(\forall (b2: A).((aprem i a2 b2) \to (ex2 A (\lambda (b1: A).(leq g +b1 b2)) (\lambda (b1: A).(aprem i a1 b1))))))))) +\def + \lambda (g: G).(\lambda (a1: A).(\lambda (a2: A).(\lambda (H: (leq g a1 +a2)).(leq_ind g (\lambda (a: A).(\lambda (a0: A).(\forall (i: nat).(\forall +(b2: A).((aprem i a0 b2) \to (ex2 A (\lambda (b1: A).(leq g b1 b2)) (\lambda +(b1: A).(aprem i a b1)))))))) (\lambda (h1: nat).(\lambda (h2: nat).(\lambda +(n1: nat).(\lambda (n2: nat).(\lambda (k: nat).(\lambda (_: (eq A (aplus g +(ASort h1 n1) k) (aplus g (ASort h2 n2) k))).(\lambda (i: nat).(\lambda (b2: +A).(\lambda (H1: (aprem i (ASort h2 n2) b2)).(let H2 \def (match H1 in aprem +return (\lambda (n: nat).(\lambda (a: A).(\lambda (a0: A).(\lambda (_: (aprem +n a a0)).((eq nat n i) \to ((eq A a (ASort h2 n2)) \to ((eq A a0 b2) \to (ex2 +A (\lambda (b1: A).(leq g b1 b2)) (\lambda (b1: A).(aprem i (ASort h1 n1) +b1)))))))))) with [(aprem_zero a0 a3) \Rightarrow (\lambda (H2: (eq nat O +i)).(\lambda (H3: (eq A (AHead a0 a3) (ASort h2 n2))).(\lambda (H4: (eq A a0 +b2)).(eq_ind nat O (\lambda (n: nat).((eq A (AHead a0 a3) (ASort h2 n2)) \to +((eq A a0 b2) \to (ex2 A (\lambda (b1: A).(leq g b1 b2)) (\lambda (b1: +A).(aprem n (ASort h1 n1) b1)))))) (\lambda (H5: (eq A (AHead a0 a3) (ASort +h2 n2))).(let H6 \def (eq_ind A (AHead a0 a3) (\lambda (e: A).(match e in A +return (\lambda (_: A).Prop) with [(ASort _ _) \Rightarrow False | (AHead _ +_) \Rightarrow True])) I (ASort h2 n2) H5) in (False_ind ((eq A a0 b2) \to +(ex2 A (\lambda (b1: A).(leq g b1 b2)) (\lambda (b1: A).(aprem O (ASort h1 +n1) b1)))) H6))) i H2 H3 H4)))) | (aprem_succ a0 a i0 H2 a3) \Rightarrow +(\lambda (H3: (eq nat (S i0) i)).(\lambda (H4: (eq A (AHead a3 a0) (ASort h2 +n2))).(\lambda (H5: (eq A a b2)).(eq_ind nat (S i0) (\lambda (n: nat).((eq A +(AHead a3 a0) (ASort h2 n2)) \to ((eq A a b2) \to ((aprem i0 a0 a) \to (ex2 A +(\lambda (b1: A).(leq g b1 b2)) (\lambda (b1: A).(aprem n (ASort h1 n1) +b1))))))) (\lambda (H6: (eq A (AHead a3 a0) (ASort h2 n2))).(let H7 \def +(eq_ind A (AHead a3 a0) (\lambda (e: A).(match e in A return (\lambda (_: +A).Prop) with [(ASort _ _) \Rightarrow False | (AHead _ _) \Rightarrow +True])) I (ASort h2 n2) H6) in (False_ind ((eq A a b2) \to ((aprem i0 a0 a) +\to (ex2 A (\lambda (b1: A).(leq g b1 b2)) (\lambda (b1: A).(aprem (S i0) +(ASort h1 n1) b1))))) H7))) i H3 H4 H5 H2))))]) in (H2 (refl_equal nat i) +(refl_equal A (ASort h2 n2)) (refl_equal A b2)))))))))))) (\lambda (a0: +A).(\lambda (a3: A).(\lambda (H0: (leq g a0 a3)).(\lambda (_: ((\forall (i: +nat).(\forall (b2: A).((aprem i a3 b2) \to (ex2 A (\lambda (b1: A).(leq g b1 +b2)) (\lambda (b1: A).(aprem i a0 b1)))))))).(\lambda (a4: A).(\lambda (a5: +A).(\lambda (_: (leq g a4 a5)).(\lambda (H3: ((\forall (i: nat).(\forall (b2: +A).((aprem i a5 b2) \to (ex2 A (\lambda (b1: A).(leq g b1 b2)) (\lambda (b1: +A).(aprem i a4 b1)))))))).(\lambda (i: nat).(\lambda (b2: A).(\lambda (H4: +(aprem i (AHead a3 a5) b2)).((match i in nat return (\lambda (n: nat).((aprem +n (AHead a3 a5) b2) \to (ex2 A (\lambda (b1: A).(leq g b1 b2)) (\lambda (b1: +A).(aprem n (AHead a0 a4) b1))))) with [O \Rightarrow (\lambda (H5: (aprem O +(AHead a3 a5) b2)).(let H6 \def (match H5 in aprem return (\lambda (n: +nat).(\lambda (a: A).(\lambda (a6: A).(\lambda (_: (aprem n a a6)).((eq nat n +O) \to ((eq A a (AHead a3 a5)) \to ((eq A a6 b2) \to (ex2 A (\lambda (b1: +A).(leq g b1 b2)) (\lambda (b1: A).(aprem O (AHead a0 a4) b1)))))))))) with +[(aprem_zero a6 a7) \Rightarrow (\lambda (_: (eq nat O O)).(\lambda (H7: (eq +A (AHead a6 a7) (AHead a3 a5))).(\lambda (H8: (eq A a6 b2)).((let H9 \def +(f_equal A A (\lambda (e: A).(match e in A return (\lambda (_: A).A) with +[(ASort _ _) \Rightarrow a7 | (AHead _ a) \Rightarrow a])) (AHead a6 a7) +(AHead a3 a5) H7) in ((let H10 \def (f_equal A A (\lambda (e: A).(match e in +A return (\lambda (_: A).A) with [(ASort _ _) \Rightarrow a6 | (AHead a _) +\Rightarrow a])) (AHead a6 a7) (AHead a3 a5) H7) in (eq_ind A a3 (\lambda (a: +A).((eq A a7 a5) \to ((eq A a b2) \to (ex2 A (\lambda (b1: A).(leq g b1 b2)) +(\lambda (b1: A).(aprem O (AHead a0 a4) b1)))))) (\lambda (H11: (eq A a7 +a5)).(eq_ind A a5 (\lambda (_: A).((eq A a3 b2) \to (ex2 A (\lambda (b1: +A).(leq g b1 b2)) (\lambda (b1: A).(aprem O (AHead a0 a4) b1))))) (\lambda +(H12: (eq A a3 b2)).(eq_ind A b2 (\lambda (_: A).(ex2 A (\lambda (b1: A).(leq +g b1 b2)) (\lambda (b1: A).(aprem O (AHead a0 a4) b1)))) (eq_ind A a3 +(\lambda (a: A).(ex2 A (\lambda (b1: A).(leq g b1 a)) (\lambda (b1: A).(aprem +O (AHead a0 a4) b1)))) (ex_intro2 A (\lambda (b1: A).(leq g b1 a3)) (\lambda +(b1: A).(aprem O (AHead a0 a4) b1)) a0 H0 (aprem_zero a0 a4)) b2 H12) a3 +(sym_eq A a3 b2 H12))) a7 (sym_eq A a7 a5 H11))) a6 (sym_eq A a6 a3 H10))) +H9)) H8)))) | (aprem_succ a6 a i0 H6 a7) \Rightarrow (\lambda (H7: (eq nat (S +i0) O)).(\lambda (H8: (eq A (AHead a7 a6) (AHead a3 a5))).(\lambda (H9: (eq A +a b2)).((let H10 \def (eq_ind nat (S i0) (\lambda (e: nat).(match e in nat +return (\lambda (_: nat).Prop) with [O \Rightarrow False | (S _) \Rightarrow +True])) I O H7) in (False_ind ((eq A (AHead a7 a6) (AHead a3 a5)) \to ((eq A +a b2) \to ((aprem i0 a6 a) \to (ex2 A (\lambda (b1: A).(leq g b1 b2)) +(\lambda (b1: A).(aprem O (AHead a0 a4) b1)))))) H10)) H8 H9 H6))))]) in (H6 +(refl_equal nat O) (refl_equal A (AHead a3 a5)) (refl_equal A b2)))) | (S n) +\Rightarrow (\lambda (H5: (aprem (S n) (AHead a3 a5) b2)).(let H6 \def (match +H5 in aprem return (\lambda (n0: nat).(\lambda (a: A).(\lambda (a6: +A).(\lambda (_: (aprem n0 a a6)).((eq nat n0 (S n)) \to ((eq A a (AHead a3 +a5)) \to ((eq A a6 b2) \to (ex2 A (\lambda (b1: A).(leq g b1 b2)) (\lambda +(b1: A).(aprem (S n) (AHead a0 a4) b1)))))))))) with [(aprem_zero a6 a7) +\Rightarrow (\lambda (H6: (eq nat O (S n))).(\lambda (H7: (eq A (AHead a6 a7) +(AHead a3 a5))).(\lambda (H8: (eq A a6 b2)).((let H9 \def (eq_ind nat O +(\lambda (e: nat).(match e in nat return (\lambda (_: nat).Prop) with [O +\Rightarrow True | (S _) \Rightarrow False])) I (S n) H6) in (False_ind ((eq +A (AHead a6 a7) (AHead a3 a5)) \to ((eq A a6 b2) \to (ex2 A (\lambda (b1: +A).(leq g b1 b2)) (\lambda (b1: A).(aprem (S n) (AHead a0 a4) b1))))) H9)) H7 +H8)))) | (aprem_succ a6 a i0 H6 a7) \Rightarrow (\lambda (H7: (eq nat (S i0) +(S n))).(\lambda (H8: (eq A (AHead a7 a6) (AHead a3 a5))).(\lambda (H9: (eq A +a b2)).((let H10 \def (f_equal nat nat (\lambda (e: nat).(match e in nat +return (\lambda (_: nat).nat) with [O \Rightarrow i0 | (S n0) \Rightarrow +n0])) (S i0) (S n) H7) in (eq_ind nat n (\lambda (n0: nat).((eq A (AHead a7 +a6) (AHead a3 a5)) \to ((eq A a b2) \to ((aprem n0 a6 a) \to (ex2 A (\lambda +(b1: A).(leq g b1 b2)) (\lambda (b1: A).(aprem (S n) (AHead a0 a4) b1))))))) +(\lambda (H11: (eq A (AHead a7 a6) (AHead a3 a5))).(let H12 \def (f_equal A A +(\lambda (e: A).(match e in A return (\lambda (_: A).A) with [(ASort _ _) +\Rightarrow a6 | (AHead _ a8) \Rightarrow a8])) (AHead a7 a6) (AHead a3 a5) +H11) in ((let H13 \def (f_equal A A (\lambda (e: A).(match e in A return +(\lambda (_: A).A) with [(ASort _ _) \Rightarrow a7 | (AHead a8 _) +\Rightarrow a8])) (AHead a7 a6) (AHead a3 a5) H11) in (eq_ind A a3 (\lambda +(_: A).((eq A a6 a5) \to ((eq A a b2) \to ((aprem n a6 a) \to (ex2 A (\lambda +(b1: A).(leq g b1 b2)) (\lambda (b1: A).(aprem (S n) (AHead a0 a4) b1))))))) +(\lambda (H14: (eq A a6 a5)).(eq_ind A a5 (\lambda (a8: A).((eq A a b2) \to +((aprem n a8 a) \to (ex2 A (\lambda (b1: A).(leq g b1 b2)) (\lambda (b1: +A).(aprem (S n) (AHead a0 a4) b1)))))) (\lambda (H15: (eq A a b2)).(eq_ind A +b2 (\lambda (a8: A).((aprem n a5 a8) \to (ex2 A (\lambda (b1: A).(leq g b1 +b2)) (\lambda (b1: A).(aprem (S n) (AHead a0 a4) b1))))) (\lambda (H16: +(aprem n a5 b2)).(let H_x \def (H3 n b2 H16) in (let H17 \def H_x in (ex2_ind +A (\lambda (b1: A).(leq g b1 b2)) (\lambda (b1: A).(aprem n a4 b1)) (ex2 A +(\lambda (b1: A).(leq g b1 b2)) (\lambda (b1: A).(aprem (S n) (AHead a0 a4) +b1))) (\lambda (x: A).(\lambda (H18: (leq g x b2)).(\lambda (H19: (aprem n a4 +x)).(ex_intro2 A (\lambda (b1: A).(leq g b1 b2)) (\lambda (b1: A).(aprem (S +n) (AHead a0 a4) b1)) x H18 (aprem_succ a4 x n H19 a0))))) H17)))) a (sym_eq +A a b2 H15))) a6 (sym_eq A a6 a5 H14))) a7 (sym_eq A a7 a3 H13))) H12))) i0 +(sym_eq nat i0 n H10))) H8 H9 H6))))]) in (H6 (refl_equal nat (S n)) +(refl_equal A (AHead a3 a5)) (refl_equal A b2))))]) H4)))))))))))) a1 a2 +H)))). + +theorem aprem_asucc: + \forall (g: G).(\forall (a1: A).(\forall (a2: A).(\forall (i: nat).((aprem i +a1 a2) \to (aprem i (asucc g a1) a2))))) +\def + \lambda (g: G).(\lambda (a1: A).(\lambda (a2: A).(\lambda (i: nat).(\lambda +(H: (aprem i a1 a2)).(aprem_ind (\lambda (n: nat).(\lambda (a: A).(\lambda +(a0: A).(aprem n (asucc g a) a0)))) (\lambda (a0: A).(\lambda (a3: +A).(aprem_zero a0 (asucc g a3)))) (\lambda (a0: A).(\lambda (a: A).(\lambda +(i0: nat).(\lambda (_: (aprem i0 a0 a)).(\lambda (H1: (aprem i0 (asucc g a0) +a)).(\lambda (a3: A).(aprem_succ (asucc g a0) a i0 H1 a3))))))) i a1 a2 +H))))). + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/arity/aprem.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/arity/aprem.ma new file mode 100644 index 000000000..ae345b6a8 --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/arity/aprem.ma @@ -0,0 +1,353 @@ +(**************************************************************************) +(* ___ *) +(* ||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/arity/aprem". + +include "arity/props.ma". + +include "arity/cimp.ma". + +include "aprem/props.ma". + +theorem arity_aprem: + \forall (g: G).(\forall (c: C).(\forall (t: T).(\forall (a: A).((arity g c t +a) \to (\forall (i: nat).(\forall (b: A).((aprem i a b) \to (ex2_3 C T nat +(\lambda (d: C).(\lambda (_: T).(\lambda (j: nat).(drop (plus i j) O d c)))) +(\lambda (d: C).(\lambda (u: T).(\lambda (_: nat).(arity g d u (asucc g +b))))))))))))) +\def + \lambda (g: G).(\lambda (c: C).(\lambda (t: T).(\lambda (a: A).(\lambda (H: +(arity g c t a)).(arity_ind g (\lambda (c0: C).(\lambda (_: T).(\lambda (a0: +A).(\forall (i: nat).(\forall (b: A).((aprem i a0 b) \to (ex2_3 C T nat +(\lambda (d: C).(\lambda (_: T).(\lambda (j: nat).(drop (plus i j) O d c0)))) +(\lambda (d: C).(\lambda (u: T).(\lambda (_: nat).(arity g d u (asucc g +b)))))))))))) (\lambda (c0: C).(\lambda (n: nat).(\lambda (i: nat).(\lambda +(b: A).(\lambda (H0: (aprem i (ASort O n) b)).(let H1 \def (match H0 in aprem +return (\lambda (n0: nat).(\lambda (a0: A).(\lambda (a1: A).(\lambda (_: +(aprem n0 a0 a1)).((eq nat n0 i) \to ((eq A a0 (ASort O n)) \to ((eq A a1 b) +\to (ex2_3 C T nat (\lambda (d: C).(\lambda (_: T).(\lambda (j: nat).(drop +(plus i j) O d c0)))) (\lambda (d: C).(\lambda (u: T).(\lambda (_: +nat).(arity g d u (asucc g b))))))))))))) with [(aprem_zero a1 a2) +\Rightarrow (\lambda (H1: (eq nat O i)).(\lambda (H2: (eq A (AHead a1 a2) +(ASort O n))).(\lambda (H3: (eq A a1 b)).(eq_ind nat O (\lambda (n0: +nat).((eq A (AHead a1 a2) (ASort O n)) \to ((eq A a1 b) \to (ex2_3 C T nat +(\lambda (d: C).(\lambda (_: T).(\lambda (j: nat).(drop (plus n0 j) O d +c0)))) (\lambda (d: C).(\lambda (u: T).(\lambda (_: nat).(arity g d u (asucc +g b))))))))) (\lambda (H4: (eq A (AHead a1 a2) (ASort O n))).(let H5 \def +(eq_ind A (AHead a1 a2) (\lambda (e: A).(match e in A return (\lambda (_: +A).Prop) with [(ASort _ _) \Rightarrow False | (AHead _ _) \Rightarrow +True])) I (ASort O n) H4) in (False_ind ((eq A a1 b) \to (ex2_3 C T nat +(\lambda (d: C).(\lambda (_: T).(\lambda (j: nat).(drop (plus O j) O d c0)))) +(\lambda (d: C).(\lambda (u: T).(\lambda (_: nat).(arity g d u (asucc g +b))))))) H5))) i H1 H2 H3)))) | (aprem_succ a2 a0 i0 H1 a1) \Rightarrow +(\lambda (H2: (eq nat (S i0) i)).(\lambda (H3: (eq A (AHead a1 a2) (ASort O +n))).(\lambda (H4: (eq A a0 b)).(eq_ind nat (S i0) (\lambda (n0: nat).((eq A +(AHead a1 a2) (ASort O n)) \to ((eq A a0 b) \to ((aprem i0 a2 a0) \to (ex2_3 +C T nat (\lambda (d: C).(\lambda (_: T).(\lambda (j: nat).(drop (plus n0 j) O +d c0)))) (\lambda (d: C).(\lambda (u: T).(\lambda (_: nat).(arity g d u +(asucc g b)))))))))) (\lambda (H5: (eq A (AHead a1 a2) (ASort O n))).(let H6 +\def (eq_ind A (AHead a1 a2) (\lambda (e: A).(match e in A return (\lambda +(_: A).Prop) with [(ASort _ _) \Rightarrow False | (AHead _ _) \Rightarrow +True])) I (ASort O n) H5) in (False_ind ((eq A a0 b) \to ((aprem i0 a2 a0) +\to (ex2_3 C T nat (\lambda (d: C).(\lambda (_: T).(\lambda (j: nat).(drop +(plus (S i0) j) O d c0)))) (\lambda (d: C).(\lambda (u: T).(\lambda (_: +nat).(arity g d u (asucc g b)))))))) H6))) i H2 H3 H4 H1))))]) in (H1 +(refl_equal nat i) (refl_equal A (ASort O n)) (refl_equal A b)))))))) +(\lambda (c0: C).(\lambda (d: C).(\lambda (u: T).(\lambda (i: nat).(\lambda +(H0: (getl i c0 (CHead d (Bind Abbr) u))).(\lambda (a0: A).(\lambda (_: +(arity g d u a0)).(\lambda (H2: ((\forall (i0: nat).(\forall (b: A).((aprem +i0 a0 b) \to (ex2_3 C T nat (\lambda (d0: C).(\lambda (_: T).(\lambda (j: +nat).(drop (plus i0 j) O d0 d)))) (\lambda (d0: C).(\lambda (u0: T).(\lambda +(_: nat).(arity g d0 u0 (asucc g b))))))))))).(\lambda (i0: nat).(\lambda (b: +A).(\lambda (H3: (aprem i0 a0 b)).(let H_x \def (H2 i0 b H3) in (let H4 \def +H_x in (ex2_3_ind C T nat (\lambda (d0: C).(\lambda (_: T).(\lambda (j: +nat).(drop (plus i0 j) O d0 d)))) (\lambda (d0: C).(\lambda (u0: T).(\lambda +(_: nat).(arity g d0 u0 (asucc g b))))) (ex2_3 C T nat (\lambda (d0: +C).(\lambda (_: T).(\lambda (j: nat).(drop (plus i0 j) O d0 c0)))) (\lambda +(d0: C).(\lambda (u0: T).(\lambda (_: nat).(arity g d0 u0 (asucc g b)))))) +(\lambda (x0: C).(\lambda (x1: T).(\lambda (x2: nat).(\lambda (H5: (drop +(plus i0 x2) O x0 d)).(\lambda (H6: (arity g x0 x1 (asucc g b))).(let H_x0 +\def (getl_drop_conf_rev (plus i0 x2) x0 d H5 Abbr c0 u i H0) in (let H7 \def +H_x0 in (ex2_ind C (\lambda (c1: C).(drop (plus i0 x2) O c1 c0)) (\lambda +(c1: C).(drop (S i) (plus i0 x2) c1 x0)) (ex2_3 C T nat (\lambda (d0: +C).(\lambda (_: T).(\lambda (j: nat).(drop (plus i0 j) O d0 c0)))) (\lambda +(d0: C).(\lambda (u0: T).(\lambda (_: nat).(arity g d0 u0 (asucc g b)))))) +(\lambda (x: C).(\lambda (H8: (drop (plus i0 x2) O x c0)).(\lambda (H9: (drop +(S i) (plus i0 x2) x x0)).(ex2_3_intro C T nat (\lambda (d0: C).(\lambda (_: +T).(\lambda (j: nat).(drop (plus i0 j) O d0 c0)))) (\lambda (d0: C).(\lambda +(u0: T).(\lambda (_: nat).(arity g d0 u0 (asucc g b))))) x (lift (S i) (plus +i0 x2) x1) x2 H8 (arity_lift g x0 x1 (asucc g b) H6 x (S i) (plus i0 x2) +H9))))) H7)))))))) H4)))))))))))))) (\lambda (c0: C).(\lambda (d: C).(\lambda +(u: T).(\lambda (i: nat).(\lambda (H0: (getl i c0 (CHead d (Bind Abst) +u))).(\lambda (a0: A).(\lambda (_: (arity g d u (asucc g a0))).(\lambda (H2: +((\forall (i0: nat).(\forall (b: A).((aprem i0 (asucc g a0) b) \to (ex2_3 C T +nat (\lambda (d0: C).(\lambda (_: T).(\lambda (j: nat).(drop (plus i0 j) O d0 +d)))) (\lambda (d0: C).(\lambda (u0: T).(\lambda (_: nat).(arity g d0 u0 +(asucc g b))))))))))).(\lambda (i0: nat).(\lambda (b: A).(\lambda (H3: (aprem +i0 a0 b)).(let H4 \def (H2 i0 b (aprem_asucc g a0 b i0 H3)) in (ex2_3_ind C T +nat (\lambda (d0: C).(\lambda (_: T).(\lambda (j: nat).(drop (plus i0 j) O d0 +d)))) (\lambda (d0: C).(\lambda (u0: T).(\lambda (_: nat).(arity g d0 u0 +(asucc g b))))) (ex2_3 C T nat (\lambda (d0: C).(\lambda (_: T).(\lambda (j: +nat).(drop (plus i0 j) O d0 c0)))) (\lambda (d0: C).(\lambda (u0: T).(\lambda +(_: nat).(arity g d0 u0 (asucc g b)))))) (\lambda (x0: C).(\lambda (x1: +T).(\lambda (x2: nat).(\lambda (H5: (drop (plus i0 x2) O x0 d)).(\lambda (H6: +(arity g x0 x1 (asucc g b))).(let H_x \def (getl_drop_conf_rev (plus i0 x2) +x0 d H5 Abst c0 u i H0) in (let H7 \def H_x in (ex2_ind C (\lambda (c1: +C).(drop (plus i0 x2) O c1 c0)) (\lambda (c1: C).(drop (S i) (plus i0 x2) c1 +x0)) (ex2_3 C T nat (\lambda (d0: C).(\lambda (_: T).(\lambda (j: nat).(drop +(plus i0 j) O d0 c0)))) (\lambda (d0: C).(\lambda (u0: T).(\lambda (_: +nat).(arity g d0 u0 (asucc g b)))))) (\lambda (x: C).(\lambda (H8: (drop +(plus i0 x2) O x c0)).(\lambda (H9: (drop (S i) (plus i0 x2) x +x0)).(ex2_3_intro C T nat (\lambda (d0: C).(\lambda (_: T).(\lambda (j: +nat).(drop (plus i0 j) O d0 c0)))) (\lambda (d0: C).(\lambda (u0: T).(\lambda +(_: nat).(arity g d0 u0 (asucc g b))))) x (lift (S i) (plus i0 x2) x1) x2 H8 +(arity_lift g x0 x1 (asucc g b) H6 x (S i) (plus i0 x2) H9))))) H7)))))))) +H4))))))))))))) (\lambda (b: B).(\lambda (_: (not (eq B b Abst))).(\lambda +(c0: C).(\lambda (u: T).(\lambda (a1: A).(\lambda (_: (arity g c0 u +a1)).(\lambda (_: ((\forall (i: nat).(\forall (b0: A).((aprem i a1 b0) \to +(ex2_3 C T nat (\lambda (d: C).(\lambda (_: T).(\lambda (j: nat).(drop (plus +i j) O d c0)))) (\lambda (d: C).(\lambda (u0: T).(\lambda (_: nat).(arity g d +u0 (asucc g b0))))))))))).(\lambda (t0: T).(\lambda (a2: A).(\lambda (_: +(arity g (CHead c0 (Bind b) u) t0 a2)).(\lambda (H4: ((\forall (i: +nat).(\forall (b0: A).((aprem i a2 b0) \to (ex2_3 C T nat (\lambda (d: +C).(\lambda (_: T).(\lambda (j: nat).(drop (plus i j) O d (CHead c0 (Bind b) +u))))) (\lambda (d: C).(\lambda (u0: T).(\lambda (_: nat).(arity g d u0 +(asucc g b0))))))))))).(\lambda (i: nat).(\lambda (b0: A).(\lambda (H5: +(aprem i a2 b0)).(let H_x \def (H4 i b0 H5) in (let H6 \def H_x in (ex2_3_ind +C T nat (\lambda (d: C).(\lambda (_: T).(\lambda (j: nat).(drop (plus i j) O +d (CHead c0 (Bind b) u))))) (\lambda (d: C).(\lambda (u0: T).(\lambda (_: +nat).(arity g d u0 (asucc g b0))))) (ex2_3 C T nat (\lambda (d: C).(\lambda +(_: T).(\lambda (j: nat).(drop (plus i j) O d c0)))) (\lambda (d: C).(\lambda +(u0: T).(\lambda (_: nat).(arity g d u0 (asucc g b0)))))) (\lambda (x0: +C).(\lambda (x1: T).(\lambda (x2: nat).(\lambda (H7: (drop (plus i x2) O x0 +(CHead c0 (Bind b) u))).(\lambda (H8: (arity g x0 x1 (asucc g b0))).(let H9 +\def (eq_ind nat (S (plus i x2)) (\lambda (n: nat).(drop n O x0 c0)) (drop_S +b x0 c0 u (plus i x2) H7) (plus i (S x2)) (plus_n_Sm i x2)) in (ex2_3_intro C +T nat (\lambda (d: C).(\lambda (_: T).(\lambda (j: nat).(drop (plus i j) O d +c0)))) (\lambda (d: C).(\lambda (u0: T).(\lambda (_: nat).(arity g d u0 +(asucc g b0))))) x0 x1 (S x2) H9 H8))))))) H6))))))))))))))))) (\lambda (c0: +C).(\lambda (u: T).(\lambda (a1: A).(\lambda (H0: (arity g c0 u (asucc g +a1))).(\lambda (_: ((\forall (i: nat).(\forall (b: A).((aprem i (asucc g a1) +b) \to (ex2_3 C T nat (\lambda (d: C).(\lambda (_: T).(\lambda (j: nat).(drop +(plus i j) O d c0)))) (\lambda (d: C).(\lambda (u0: T).(\lambda (_: +nat).(arity g d u0 (asucc g b))))))))))).(\lambda (t0: T).(\lambda (a2: +A).(\lambda (_: (arity g (CHead c0 (Bind Abst) u) t0 a2)).(\lambda (H3: +((\forall (i: nat).(\forall (b: A).((aprem i a2 b) \to (ex2_3 C T nat +(\lambda (d: C).(\lambda (_: T).(\lambda (j: nat).(drop (plus i j) O d (CHead +c0 (Bind Abst) u))))) (\lambda (d: C).(\lambda (u0: T).(\lambda (_: +nat).(arity g d u0 (asucc g b))))))))))).(\lambda (i: nat).(\lambda (b: +A).(\lambda (H4: (aprem i (AHead a1 a2) b)).((match i in nat return (\lambda +(n: nat).((aprem n (AHead a1 a2) b) \to (ex2_3 C T nat (\lambda (d: +C).(\lambda (_: T).(\lambda (j: nat).(drop (plus n j) O d c0)))) (\lambda (d: +C).(\lambda (u0: T).(\lambda (_: nat).(arity g d u0 (asucc g b)))))))) with +[O \Rightarrow (\lambda (H5: (aprem O (AHead a1 a2) b)).(let H6 \def (match +H5 in aprem return (\lambda (n: nat).(\lambda (a0: A).(\lambda (a3: +A).(\lambda (_: (aprem n a0 a3)).((eq nat n O) \to ((eq A a0 (AHead a1 a2)) +\to ((eq A a3 b) \to (ex2_3 C T nat (\lambda (d: C).(\lambda (_: T).(\lambda +(j: nat).(drop (plus O j) O d c0)))) (\lambda (d: C).(\lambda (u0: +T).(\lambda (_: nat).(arity g d u0 (asucc g b))))))))))))) with [(aprem_zero +a0 a3) \Rightarrow (\lambda (_: (eq nat O O)).(\lambda (H7: (eq A (AHead a0 +a3) (AHead a1 a2))).(\lambda (H8: (eq A a0 b)).((let H9 \def (f_equal A A +(\lambda (e: A).(match e in A return (\lambda (_: A).A) with [(ASort _ _) +\Rightarrow a3 | (AHead _ a4) \Rightarrow a4])) (AHead a0 a3) (AHead a1 a2) +H7) in ((let H10 \def (f_equal A A (\lambda (e: A).(match e in A return +(\lambda (_: A).A) with [(ASort _ _) \Rightarrow a0 | (AHead a4 _) +\Rightarrow a4])) (AHead a0 a3) (AHead a1 a2) H7) in (eq_ind A a1 (\lambda +(a4: A).((eq A a3 a2) \to ((eq A a4 b) \to (ex2_3 C T nat (\lambda (d: +C).(\lambda (_: T).(\lambda (j: nat).(drop (plus O j) O d c0)))) (\lambda (d: +C).(\lambda (u0: T).(\lambda (_: nat).(arity g d u0 (asucc g b))))))))) +(\lambda (H11: (eq A a3 a2)).(eq_ind A a2 (\lambda (_: A).((eq A a1 b) \to +(ex2_3 C T nat (\lambda (d: C).(\lambda (_: T).(\lambda (j: nat).(drop (plus +O j) O d c0)))) (\lambda (d: C).(\lambda (u0: T).(\lambda (_: nat).(arity g d +u0 (asucc g b)))))))) (\lambda (H12: (eq A a1 b)).(eq_ind A b (\lambda (_: +A).(ex2_3 C T nat (\lambda (d: C).(\lambda (_: T).(\lambda (j: nat).(drop +(plus O j) O d c0)))) (\lambda (d: C).(\lambda (u0: T).(\lambda (_: +nat).(arity g d u0 (asucc g b))))))) (eq_ind A a1 (\lambda (a4: A).(ex2_3 C T +nat (\lambda (d: C).(\lambda (_: T).(\lambda (j: nat).(drop (plus O j) O d +c0)))) (\lambda (d: C).(\lambda (u0: T).(\lambda (_: nat).(arity g d u0 +(asucc g a4))))))) (ex2_3_intro C T nat (\lambda (d: C).(\lambda (_: +T).(\lambda (j: nat).(drop (plus O j) O d c0)))) (\lambda (d: C).(\lambda +(u0: T).(\lambda (_: nat).(arity g d u0 (asucc g a1))))) c0 u O (drop_refl +c0) H0) b H12) a1 (sym_eq A a1 b H12))) a3 (sym_eq A a3 a2 H11))) a0 (sym_eq +A a0 a1 H10))) H9)) H8)))) | (aprem_succ a0 a3 i0 H6 a4) \Rightarrow (\lambda +(H7: (eq nat (S i0) O)).(\lambda (H8: (eq A (AHead a4 a0) (AHead a1 +a2))).(\lambda (H9: (eq A a3 b)).((let H10 \def (eq_ind nat (S i0) (\lambda +(e: nat).(match e in nat return (\lambda (_: nat).Prop) with [O \Rightarrow +False | (S _) \Rightarrow True])) I O H7) in (False_ind ((eq A (AHead a4 a0) +(AHead a1 a2)) \to ((eq A a3 b) \to ((aprem i0 a0 a3) \to (ex2_3 C T nat +(\lambda (d: C).(\lambda (_: T).(\lambda (j: nat).(drop (plus O j) O d c0)))) +(\lambda (d: C).(\lambda (u0: T).(\lambda (_: nat).(arity g d u0 (asucc g +b))))))))) H10)) H8 H9 H6))))]) in (H6 (refl_equal nat O) (refl_equal A +(AHead a1 a2)) (refl_equal A b)))) | (S n) \Rightarrow (\lambda (H5: (aprem +(S n) (AHead a1 a2) b)).(let H6 \def (match H5 in aprem return (\lambda (n0: +nat).(\lambda (a0: A).(\lambda (a3: A).(\lambda (_: (aprem n0 a0 a3)).((eq +nat n0 (S n)) \to ((eq A a0 (AHead a1 a2)) \to ((eq A a3 b) \to (ex2_3 C T +nat (\lambda (d: C).(\lambda (_: T).(\lambda (j: nat).(drop (plus (S n) j) O +d c0)))) (\lambda (d: C).(\lambda (u0: T).(\lambda (_: nat).(arity g d u0 +(asucc g b))))))))))))) with [(aprem_zero a0 a3) \Rightarrow (\lambda (H6: +(eq nat O (S n))).(\lambda (H7: (eq A (AHead a0 a3) (AHead a1 a2))).(\lambda +(H8: (eq A a0 b)).((let H9 \def (eq_ind nat O (\lambda (e: nat).(match e in +nat return (\lambda (_: nat).Prop) with [O \Rightarrow True | (S _) +\Rightarrow False])) I (S n) H6) in (False_ind ((eq A (AHead a0 a3) (AHead a1 +a2)) \to ((eq A a0 b) \to (ex2_3 C T nat (\lambda (d: C).(\lambda (_: +T).(\lambda (j: nat).(drop (plus (S n) j) O d c0)))) (\lambda (d: C).(\lambda +(u0: T).(\lambda (_: nat).(arity g d u0 (asucc g b)))))))) H9)) H7 H8)))) | +(aprem_succ a0 a3 i0 H6 a4) \Rightarrow (\lambda (H7: (eq nat (S i0) (S +n))).(\lambda (H8: (eq A (AHead a4 a0) (AHead a1 a2))).(\lambda (H9: (eq A a3 +b)).((let H10 \def (f_equal nat nat (\lambda (e: nat).(match e in nat return +(\lambda (_: nat).nat) with [O \Rightarrow i0 | (S n0) \Rightarrow n0])) (S +i0) (S n) H7) in (eq_ind nat n (\lambda (n0: nat).((eq A (AHead a4 a0) (AHead +a1 a2)) \to ((eq A a3 b) \to ((aprem n0 a0 a3) \to (ex2_3 C T nat (\lambda +(d: C).(\lambda (_: T).(\lambda (j: nat).(drop (plus (S n) j) O d c0)))) +(\lambda (d: C).(\lambda (u0: T).(\lambda (_: nat).(arity g d u0 (asucc g +b)))))))))) (\lambda (H11: (eq A (AHead a4 a0) (AHead a1 a2))).(let H12 \def +(f_equal A A (\lambda (e: A).(match e in A return (\lambda (_: A).A) with +[(ASort _ _) \Rightarrow a0 | (AHead _ a5) \Rightarrow a5])) (AHead a4 a0) +(AHead a1 a2) H11) in ((let H13 \def (f_equal A A (\lambda (e: A).(match e in +A return (\lambda (_: A).A) with [(ASort _ _) \Rightarrow a4 | (AHead a5 _) +\Rightarrow a5])) (AHead a4 a0) (AHead a1 a2) H11) in (eq_ind A a1 (\lambda +(_: A).((eq A a0 a2) \to ((eq A a3 b) \to ((aprem n a0 a3) \to (ex2_3 C T nat +(\lambda (d: C).(\lambda (_: T).(\lambda (j: nat).(drop (plus (S n) j) O d +c0)))) (\lambda (d: C).(\lambda (u0: T).(\lambda (_: nat).(arity g d u0 +(asucc g b)))))))))) (\lambda (H14: (eq A a0 a2)).(eq_ind A a2 (\lambda (a5: +A).((eq A a3 b) \to ((aprem n a5 a3) \to (ex2_3 C T nat (\lambda (d: +C).(\lambda (_: T).(\lambda (j: nat).(drop (plus (S n) j) O d c0)))) (\lambda +(d: C).(\lambda (u0: T).(\lambda (_: nat).(arity g d u0 (asucc g b))))))))) +(\lambda (H15: (eq A a3 b)).(eq_ind A b (\lambda (a5: A).((aprem n a2 a5) \to +(ex2_3 C T nat (\lambda (d: C).(\lambda (_: T).(\lambda (j: nat).(drop (plus +(S n) j) O d c0)))) (\lambda (d: C).(\lambda (u0: T).(\lambda (_: nat).(arity +g d u0 (asucc g b)))))))) (\lambda (H16: (aprem n a2 b)).(let H_x \def (H3 n +b H16) in (let H17 \def H_x in (ex2_3_ind C T nat (\lambda (d: C).(\lambda +(_: T).(\lambda (j: nat).(drop (plus n j) O d (CHead c0 (Bind Abst) u))))) +(\lambda (d: C).(\lambda (u0: T).(\lambda (_: nat).(arity g d u0 (asucc g +b))))) (ex2_3 C T nat (\lambda (d: C).(\lambda (_: T).(\lambda (j: nat).(drop +(plus (S n) j) O d c0)))) (\lambda (d: C).(\lambda (u0: T).(\lambda (_: +nat).(arity g d u0 (asucc g b)))))) (\lambda (x0: C).(\lambda (x1: +T).(\lambda (x2: nat).(\lambda (H18: (drop (plus n x2) O x0 (CHead c0 (Bind +Abst) u))).(\lambda (H19: (arity g x0 x1 (asucc g b))).(ex2_3_intro C T nat +(\lambda (d: C).(\lambda (_: T).(\lambda (j: nat).(drop (plus (S n) j) O d +c0)))) (\lambda (d: C).(\lambda (u0: T).(\lambda (_: nat).(arity g d u0 +(asucc g b))))) x0 x1 x2 (drop_S Abst x0 c0 u (plus n x2) H18) H19)))))) +H17)))) a3 (sym_eq A a3 b H15))) a0 (sym_eq A a0 a2 H14))) a4 (sym_eq A a4 a1 +H13))) H12))) i0 (sym_eq nat i0 n H10))) H8 H9 H6))))]) in (H6 (refl_equal +nat (S n)) (refl_equal A (AHead a1 a2)) (refl_equal A b))))]) H4))))))))))))) +(\lambda (c0: C).(\lambda (u: T).(\lambda (a1: A).(\lambda (_: (arity g c0 u +a1)).(\lambda (_: ((\forall (i: nat).(\forall (b: A).((aprem i a1 b) \to +(ex2_3 C T nat (\lambda (d: C).(\lambda (_: T).(\lambda (j: nat).(drop (plus +i j) O d c0)))) (\lambda (d: C).(\lambda (u0: T).(\lambda (_: nat).(arity g d +u0 (asucc g b))))))))))).(\lambda (t0: T).(\lambda (a2: A).(\lambda (_: +(arity g c0 t0 (AHead a1 a2))).(\lambda (H3: ((\forall (i: nat).(\forall (b: +A).((aprem i (AHead a1 a2) b) \to (ex2_3 C T nat (\lambda (d: C).(\lambda (_: +T).(\lambda (j: nat).(drop (plus i j) O d c0)))) (\lambda (d: C).(\lambda +(u0: T).(\lambda (_: nat).(arity g d u0 (asucc g b))))))))))).(\lambda (i: +nat).(\lambda (b: A).(\lambda (H4: (aprem i a2 b)).(let H5 \def (H3 (S i) b +(aprem_succ a2 b i H4 a1)) in (ex2_3_ind C T nat (\lambda (d: C).(\lambda (_: +T).(\lambda (j: nat).(drop (S (plus i j)) O d c0)))) (\lambda (d: C).(\lambda +(u0: T).(\lambda (_: nat).(arity g d u0 (asucc g b))))) (ex2_3 C T nat +(\lambda (d: C).(\lambda (_: T).(\lambda (j: nat).(drop (plus i j) O d c0)))) +(\lambda (d: C).(\lambda (u0: T).(\lambda (_: nat).(arity g d u0 (asucc g +b)))))) (\lambda (x0: C).(\lambda (x1: T).(\lambda (x2: nat).(\lambda (H6: +(drop (S (plus i x2)) O x0 c0)).(\lambda (H7: (arity g x0 x1 (asucc g +b))).(C_ind (\lambda (c1: C).((drop (S (plus i x2)) O c1 c0) \to ((arity g c1 +x1 (asucc g b)) \to (ex2_3 C T nat (\lambda (d: C).(\lambda (_: T).(\lambda +(j: nat).(drop (plus i j) O d c0)))) (\lambda (d: C).(\lambda (u0: +T).(\lambda (_: nat).(arity g d u0 (asucc g b))))))))) (\lambda (n: +nat).(\lambda (H8: (drop (S (plus i x2)) O (CSort n) c0)).(\lambda (_: (arity +g (CSort n) x1 (asucc g b))).(and3_ind (eq C c0 (CSort n)) (eq nat (S (plus i +x2)) O) (eq nat O O) (ex2_3 C T nat (\lambda (d: C).(\lambda (_: T).(\lambda +(j: nat).(drop (plus i j) O d c0)))) (\lambda (d: C).(\lambda (u0: +T).(\lambda (_: nat).(arity g d u0 (asucc g b)))))) (\lambda (_: (eq C c0 +(CSort n))).(\lambda (H11: (eq nat (S (plus i x2)) O)).(\lambda (_: (eq nat O +O)).(let H13 \def (eq_ind nat (S (plus i x2)) (\lambda (ee: nat).(match ee in +nat return (\lambda (_: nat).Prop) with [O \Rightarrow False | (S _) +\Rightarrow True])) I O H11) in (False_ind (ex2_3 C T nat (\lambda (d: +C).(\lambda (_: T).(\lambda (j: nat).(drop (plus i j) O d c0)))) (\lambda (d: +C).(\lambda (u0: T).(\lambda (_: nat).(arity g d u0 (asucc g b)))))) H13))))) +(drop_gen_sort n (S (plus i x2)) O c0 H8))))) (\lambda (d: C).(\lambda (IHd: +(((drop (S (plus i x2)) O d c0) \to ((arity g d x1 (asucc g b)) \to (ex2_3 C +T nat (\lambda (d0: C).(\lambda (_: T).(\lambda (j: nat).(drop (plus i j) O +d0 c0)))) (\lambda (d0: C).(\lambda (u0: T).(\lambda (_: nat).(arity g d0 u0 +(asucc g b)))))))))).(\lambda (k: K).(\lambda (t1: T).(\lambda (H8: (drop (S +(plus i x2)) O (CHead d k t1) c0)).(\lambda (H9: (arity g (CHead d k t1) x1 +(asucc g b))).((match k in K return (\lambda (k0: K).((arity g (CHead d k0 +t1) x1 (asucc g b)) \to ((drop (r k0 (plus i x2)) O d c0) \to (ex2_3 C T nat +(\lambda (d0: C).(\lambda (_: T).(\lambda (j: nat).(drop (plus i j) O d0 +c0)))) (\lambda (d0: C).(\lambda (u0: T).(\lambda (_: nat).(arity g d0 u0 +(asucc g b))))))))) with [(Bind b0) \Rightarrow (\lambda (H10: (arity g +(CHead d (Bind b0) t1) x1 (asucc g b))).(\lambda (H11: (drop (r (Bind b0) +(plus i x2)) O d c0)).(ex2_3_intro C T nat (\lambda (d0: C).(\lambda (_: +T).(\lambda (j: nat).(drop (plus i j) O d0 c0)))) (\lambda (d0: C).(\lambda +(u0: T).(\lambda (_: nat).(arity g d0 u0 (asucc g b))))) (CHead d (Bind b0) +t1) x1 (S x2) (eq_ind nat (S (plus i x2)) (\lambda (n: nat).(drop n O (CHead +d (Bind b0) t1) c0)) (drop_drop (Bind b0) (plus i x2) d c0 H11 t1) (plus i (S +x2)) (plus_n_Sm i x2)) H10))) | (Flat f) \Rightarrow (\lambda (H10: (arity g +(CHead d (Flat f) t1) x1 (asucc g b))).(\lambda (H11: (drop (r (Flat f) (plus +i x2)) O d c0)).(let H12 \def (IHd H11 (arity_cimp_conf g (CHead d (Flat f) +t1) x1 (asucc g b) H10 d (cimp_flat_sx f d t1))) in (ex2_3_ind C T nat +(\lambda (d0: C).(\lambda (_: T).(\lambda (j: nat).(drop (plus i j) O d0 +c0)))) (\lambda (d0: C).(\lambda (u0: T).(\lambda (_: nat).(arity g d0 u0 +(asucc g b))))) (ex2_3 C T nat (\lambda (d0: C).(\lambda (_: T).(\lambda (j: +nat).(drop (plus i j) O d0 c0)))) (\lambda (d0: C).(\lambda (u0: T).(\lambda +(_: nat).(arity g d0 u0 (asucc g b)))))) (\lambda (x3: C).(\lambda (x4: +T).(\lambda (x5: nat).(\lambda (H13: (drop (plus i x5) O x3 c0)).(\lambda +(H14: (arity g x3 x4 (asucc g b))).(ex2_3_intro C T nat (\lambda (d0: +C).(\lambda (_: T).(\lambda (j: nat).(drop (plus i j) O d0 c0)))) (\lambda +(d0: C).(\lambda (u0: T).(\lambda (_: nat).(arity g d0 u0 (asucc g b))))) x3 +x4 x5 H13 H14)))))) H12))))]) H9 (drop_gen_drop k d c0 t1 (plus i x2) +H8)))))))) x0 H6 H7)))))) H5)))))))))))))) (\lambda (c0: C).(\lambda (u: +T).(\lambda (a0: A).(\lambda (_: (arity g c0 u (asucc g a0))).(\lambda (_: +((\forall (i: nat).(\forall (b: A).((aprem i (asucc g a0) b) \to (ex2_3 C T +nat (\lambda (d: C).(\lambda (_: T).(\lambda (j: nat).(drop (plus i j) O d +c0)))) (\lambda (d: C).(\lambda (u0: T).(\lambda (_: nat).(arity g d u0 +(asucc g b))))))))))).(\lambda (t0: T).(\lambda (_: (arity g c0 t0 +a0)).(\lambda (H3: ((\forall (i: nat).(\forall (b: A).((aprem i a0 b) \to +(ex2_3 C T nat (\lambda (d: C).(\lambda (_: T).(\lambda (j: nat).(drop (plus +i j) O d c0)))) (\lambda (d: C).(\lambda (u0: T).(\lambda (_: nat).(arity g d +u0 (asucc g b))))))))))).(\lambda (i: nat).(\lambda (b: A).(\lambda (H4: +(aprem i a0 b)).(let H_x \def (H3 i b H4) in (let H5 \def H_x in (ex2_3_ind C +T nat (\lambda (d: C).(\lambda (_: T).(\lambda (j: nat).(drop (plus i j) O d +c0)))) (\lambda (d: C).(\lambda (u0: T).(\lambda (_: nat).(arity g d u0 +(asucc g b))))) (ex2_3 C T nat (\lambda (d: C).(\lambda (_: T).(\lambda (j: +nat).(drop (plus i j) O d c0)))) (\lambda (d: C).(\lambda (u0: T).(\lambda +(_: nat).(arity g d u0 (asucc g b)))))) (\lambda (x0: C).(\lambda (x1: +T).(\lambda (x2: nat).(\lambda (H6: (drop (plus i x2) O x0 c0)).(\lambda (H7: +(arity g x0 x1 (asucc g b))).(ex2_3_intro C T nat (\lambda (d: C).(\lambda +(_: T).(\lambda (j: nat).(drop (plus i j) O d c0)))) (\lambda (d: C).(\lambda +(u0: T).(\lambda (_: nat).(arity g d u0 (asucc g b))))) x0 x1 x2 H6 H7)))))) +H5)))))))))))))) (\lambda (c0: C).(\lambda (t0: T).(\lambda (a1: A).(\lambda +(_: (arity g c0 t0 a1)).(\lambda (H1: ((\forall (i: nat).(\forall (b: +A).((aprem i a1 b) \to (ex2_3 C T nat (\lambda (d: C).(\lambda (_: +T).(\lambda (j: nat).(drop (plus i j) O d c0)))) (\lambda (d: C).(\lambda (u: +T).(\lambda (_: nat).(arity g d u (asucc g b))))))))))).(\lambda (a2: +A).(\lambda (H2: (leq g a1 a2)).(\lambda (i: nat).(\lambda (b: A).(\lambda +(H3: (aprem i a2 b)).(let H_x \def (aprem_repl g a1 a2 H2 i b H3) in (let H4 +\def H_x in (ex2_ind A (\lambda (b1: A).(leq g b1 b)) (\lambda (b1: A).(aprem +i a1 b1)) (ex2_3 C T nat (\lambda (d: C).(\lambda (_: T).(\lambda (j: +nat).(drop (plus i j) O d c0)))) (\lambda (d: C).(\lambda (u: T).(\lambda (_: +nat).(arity g d u (asucc g b)))))) (\lambda (x: A).(\lambda (H5: (leq g x +b)).(\lambda (H6: (aprem i a1 x)).(let H_x0 \def (H1 i x H6) in (let H7 \def +H_x0 in (ex2_3_ind C T nat (\lambda (d: C).(\lambda (_: T).(\lambda (j: +nat).(drop (plus i j) O d c0)))) (\lambda (d: C).(\lambda (u: T).(\lambda (_: +nat).(arity g d u (asucc g x))))) (ex2_3 C T nat (\lambda (d: C).(\lambda (_: +T).(\lambda (j: nat).(drop (plus i j) O d c0)))) (\lambda (d: C).(\lambda (u: +T).(\lambda (_: nat).(arity g d u (asucc g b)))))) (\lambda (x0: C).(\lambda +(x1: T).(\lambda (x2: nat).(\lambda (H8: (drop (plus i x2) O x0 c0)).(\lambda +(H9: (arity g x0 x1 (asucc g x))).(ex2_3_intro C T nat (\lambda (d: +C).(\lambda (_: T).(\lambda (j: nat).(drop (plus i j) O d c0)))) (\lambda (d: +C).(\lambda (u: T).(\lambda (_: nat).(arity g d u (asucc g b))))) x0 x1 x2 H8 +(arity_repl g x0 x1 (asucc g x) H9 (asucc g b) (asucc_repl g x b H5)))))))) +H7)))))) H4))))))))))))) c t a H))))). + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/arity/cimp.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/arity/cimp.ma new file mode 100644 index 000000000..f4eb23020 --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/arity/cimp.ma @@ -0,0 +1,101 @@ +(**************************************************************************) +(* ___ *) +(* ||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/arity/cimp". + +include "arity/defs.ma". + +include "cimp/props.ma". + +theorem arity_cimp_conf: + \forall (g: G).(\forall (c1: C).(\forall (t: T).(\forall (a: A).((arity g c1 +t a) \to (\forall (c2: C).((cimp c1 c2) \to (arity g c2 t a))))))) +\def + \lambda (g: G).(\lambda (c1: C).(\lambda (t: T).(\lambda (a: A).(\lambda (H: +(arity g c1 t a)).(arity_ind g (\lambda (c: C).(\lambda (t0: T).(\lambda (a0: +A).(\forall (c2: C).((cimp c c2) \to (arity g c2 t0 a0)))))) (\lambda (c: +C).(\lambda (n: nat).(\lambda (c2: C).(\lambda (_: (cimp c c2)).(arity_sort g +c2 n))))) (\lambda (c: C).(\lambda (d: C).(\lambda (u: T).(\lambda (i: +nat).(\lambda (H0: (getl i c (CHead d (Bind Abbr) u))).(\lambda (a0: +A).(\lambda (_: (arity g d u a0)).(\lambda (H2: ((\forall (c2: C).((cimp d +c2) \to (arity g c2 u a0))))).(\lambda (c2: C).(\lambda (H3: (cimp c +c2)).(let H_x \def (H3 Abbr d u i H0) in (let H4 \def H_x in (ex_ind C +(\lambda (d2: C).(getl i c2 (CHead d2 (Bind Abbr) u))) (arity g c2 (TLRef i) +a0) (\lambda (x: C).(\lambda (H5: (getl i c2 (CHead x (Bind Abbr) u))).(let +H_x0 \def (cimp_getl_conf c c2 H3 Abbr d u i H0) in (let H6 \def H_x0 in +(ex2_ind C (\lambda (d2: C).(cimp d d2)) (\lambda (d2: C).(getl i c2 (CHead +d2 (Bind Abbr) u))) (arity g c2 (TLRef i) a0) (\lambda (x0: C).(\lambda (H7: +(cimp d x0)).(\lambda (H8: (getl i c2 (CHead x0 (Bind Abbr) u))).(let H9 \def +(eq_ind C (CHead x (Bind Abbr) u) (\lambda (c0: C).(getl i c2 c0)) H5 (CHead +x0 (Bind Abbr) u) (getl_mono c2 (CHead x (Bind Abbr) u) i H5 (CHead x0 (Bind +Abbr) u) H8)) in (let H10 \def (f_equal C C (\lambda (e: C).(match e in C +return (\lambda (_: C).C) with [(CSort _) \Rightarrow x | (CHead c0 _ _) +\Rightarrow c0])) (CHead x (Bind Abbr) u) (CHead x0 (Bind Abbr) u) (getl_mono +c2 (CHead x (Bind Abbr) u) i H5 (CHead x0 (Bind Abbr) u) H8)) in (let H11 +\def (eq_ind_r C x0 (\lambda (c0: C).(getl i c2 (CHead c0 (Bind Abbr) u))) H9 +x H10) in (let H12 \def (eq_ind_r C x0 (\lambda (c0: C).(cimp d c0)) H7 x +H10) in (arity_abbr g c2 x u i H11 a0 (H2 x H12))))))))) H6))))) +H4))))))))))))) (\lambda (c: C).(\lambda (d: C).(\lambda (u: T).(\lambda (i: +nat).(\lambda (H0: (getl i c (CHead d (Bind Abst) u))).(\lambda (a0: +A).(\lambda (_: (arity g d u (asucc g a0))).(\lambda (H2: ((\forall (c2: +C).((cimp d c2) \to (arity g c2 u (asucc g a0)))))).(\lambda (c2: C).(\lambda +(H3: (cimp c c2)).(let H_x \def (H3 Abst d u i H0) in (let H4 \def H_x in +(ex_ind C (\lambda (d2: C).(getl i c2 (CHead d2 (Bind Abst) u))) (arity g c2 +(TLRef i) a0) (\lambda (x: C).(\lambda (H5: (getl i c2 (CHead x (Bind Abst) +u))).(let H_x0 \def (cimp_getl_conf c c2 H3 Abst d u i H0) in (let H6 \def +H_x0 in (ex2_ind C (\lambda (d2: C).(cimp d d2)) (\lambda (d2: C).(getl i c2 +(CHead d2 (Bind Abst) u))) (arity g c2 (TLRef i) a0) (\lambda (x0: +C).(\lambda (H7: (cimp d x0)).(\lambda (H8: (getl i c2 (CHead x0 (Bind Abst) +u))).(let H9 \def (eq_ind C (CHead x (Bind Abst) u) (\lambda (c0: C).(getl i +c2 c0)) H5 (CHead x0 (Bind Abst) u) (getl_mono c2 (CHead x (Bind Abst) u) i +H5 (CHead x0 (Bind Abst) u) H8)) in (let H10 \def (f_equal C C (\lambda (e: +C).(match e in C return (\lambda (_: C).C) with [(CSort _) \Rightarrow x | +(CHead c0 _ _) \Rightarrow c0])) (CHead x (Bind Abst) u) (CHead x0 (Bind +Abst) u) (getl_mono c2 (CHead x (Bind Abst) u) i H5 (CHead x0 (Bind Abst) u) +H8)) in (let H11 \def (eq_ind_r C x0 (\lambda (c0: C).(getl i c2 (CHead c0 +(Bind Abst) u))) H9 x H10) in (let H12 \def (eq_ind_r C x0 (\lambda (c0: +C).(cimp d c0)) H7 x H10) in (arity_abst g c2 x u i H11 a0 (H2 x H12))))))))) +H6))))) H4))))))))))))) (\lambda (b: B).(\lambda (H0: (not (eq B b +Abst))).(\lambda (c: C).(\lambda (u: T).(\lambda (a1: A).(\lambda (_: (arity +g c u a1)).(\lambda (H2: ((\forall (c2: C).((cimp c c2) \to (arity g c2 u +a1))))).(\lambda (t0: T).(\lambda (a2: A).(\lambda (_: (arity g (CHead c +(Bind b) u) t0 a2)).(\lambda (H4: ((\forall (c2: C).((cimp (CHead c (Bind b) +u) c2) \to (arity g c2 t0 a2))))).(\lambda (c2: C).(\lambda (H5: (cimp c +c2)).(arity_bind g b H0 c2 u a1 (H2 c2 H5) t0 a2 (H4 (CHead c2 (Bind b) u) +(cimp_bind c c2 H5 b u)))))))))))))))) (\lambda (c: C).(\lambda (u: +T).(\lambda (a1: A).(\lambda (_: (arity g c u (asucc g a1))).(\lambda (H1: +((\forall (c2: C).((cimp c c2) \to (arity g c2 u (asucc g a1)))))).(\lambda +(t0: T).(\lambda (a2: A).(\lambda (_: (arity g (CHead c (Bind Abst) u) t0 +a2)).(\lambda (H3: ((\forall (c2: C).((cimp (CHead c (Bind Abst) u) c2) \to +(arity g c2 t0 a2))))).(\lambda (c2: C).(\lambda (H4: (cimp c +c2)).(arity_head g c2 u a1 (H1 c2 H4) t0 a2 (H3 (CHead c2 (Bind Abst) u) +(cimp_bind c c2 H4 Abst u)))))))))))))) (\lambda (c: C).(\lambda (u: +T).(\lambda (a1: A).(\lambda (_: (arity g c u a1)).(\lambda (H1: ((\forall +(c2: C).((cimp c c2) \to (arity g c2 u a1))))).(\lambda (t0: T).(\lambda (a2: +A).(\lambda (_: (arity g c t0 (AHead a1 a2))).(\lambda (H3: ((\forall (c2: +C).((cimp c c2) \to (arity g c2 t0 (AHead a1 a2)))))).(\lambda (c2: +C).(\lambda (H4: (cimp c c2)).(arity_appl g c2 u a1 (H1 c2 H4) t0 a2 (H3 c2 +H4))))))))))))) (\lambda (c: C).(\lambda (u: T).(\lambda (a0: A).(\lambda (_: +(arity g c u (asucc g a0))).(\lambda (H1: ((\forall (c2: C).((cimp c c2) \to +(arity g c2 u (asucc g a0)))))).(\lambda (t0: T).(\lambda (_: (arity g c t0 +a0)).(\lambda (H3: ((\forall (c2: C).((cimp c c2) \to (arity g c2 t0 +a0))))).(\lambda (c2: C).(\lambda (H4: (cimp c c2)).(arity_cast g c2 u a0 (H1 +c2 H4) t0 (H3 c2 H4)))))))))))) (\lambda (c: C).(\lambda (t0: T).(\lambda +(a1: A).(\lambda (_: (arity g c t0 a1)).(\lambda (H1: ((\forall (c2: +C).((cimp c c2) \to (arity g c2 t0 a1))))).(\lambda (a2: A).(\lambda (H2: +(leq g a1 a2)).(\lambda (c2: C).(\lambda (H3: (cimp c c2)).(arity_repl g c2 +t0 a1 (H1 c2 H3) a2 H2)))))))))) c1 t a H))))). + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/arity/defs.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/arity/defs.ma new file mode 100644 index 000000000..3ce54e042 --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/arity/defs.ma @@ -0,0 +1,47 @@ +(**************************************************************************) +(* ___ *) +(* ||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/arity/defs". + +include "leq/defs.ma". + +include "getl/defs.ma". + +inductive arity (g:G): C \to (T \to (A \to Prop)) \def +| arity_sort: \forall (c: C).(\forall (n: nat).(arity g c (TSort n) (ASort O +n))) +| arity_abbr: \forall (c: C).(\forall (d: C).(\forall (u: T).(\forall (i: +nat).((getl i c (CHead d (Bind Abbr) u)) \to (\forall (a: A).((arity g d u a) +\to (arity g c (TLRef i) a))))))) +| arity_abst: \forall (c: C).(\forall (d: C).(\forall (u: T).(\forall (i: +nat).((getl i c (CHead d (Bind Abst) u)) \to (\forall (a: A).((arity g d u +(asucc g a)) \to (arity g c (TLRef i) a))))))) +| arity_bind: \forall (b: B).((not (eq B b Abst)) \to (\forall (c: +C).(\forall (u: T).(\forall (a1: A).((arity g c u a1) \to (\forall (t: +T).(\forall (a2: A).((arity g (CHead c (Bind b) u) t a2) \to (arity g c +(THead (Bind b) u t) a2))))))))) +| arity_head: \forall (c: C).(\forall (u: T).(\forall (a1: A).((arity g c u +(asucc g a1)) \to (\forall (t: T).(\forall (a2: A).((arity g (CHead c (Bind +Abst) u) t a2) \to (arity g c (THead (Bind Abst) u t) (AHead a1 a2)))))))) +| arity_appl: \forall (c: C).(\forall (u: T).(\forall (a1: A).((arity g c u +a1) \to (\forall (t: T).(\forall (a2: A).((arity g c t (AHead a1 a2)) \to +(arity g c (THead (Flat Appl) u t) a2))))))) +| arity_cast: \forall (c: C).(\forall (u: T).(\forall (a: A).((arity g c u +(asucc g a)) \to (\forall (t: T).((arity g c t a) \to (arity g c (THead (Flat +Cast) u t) a)))))) +| arity_repl: \forall (c: C).(\forall (t: T).(\forall (a1: A).((arity g c t +a1) \to (\forall (a2: A).((leq g a1 a2) \to (arity g c t a2)))))). + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/arity/fwd.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/arity/fwd.ma new file mode 100644 index 000000000..7562bc1e3 --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/arity/fwd.ma @@ -0,0 +1,1140 @@ +(**************************************************************************) +(* ___ *) +(* ||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/arity/fwd". + +include "arity/defs.ma". + +include "leq/asucc.ma". + +include "leq/fwd.ma". + +include "getl/drop.ma". + +theorem arity_gen_sort: + \forall (g: G).(\forall (c: C).(\forall (n: nat).(\forall (a: A).((arity g c +(TSort n) a) \to (leq g a (ASort O n)))))) +\def + \lambda (g: G).(\lambda (c: C).(\lambda (n: nat).(\lambda (a: A).(\lambda +(H: (arity g c (TSort n) a)).(insert_eq T (TSort n) (\lambda (t: T).(arity g +c t a)) (leq g a (ASort O n)) (\lambda (y: T).(\lambda (H0: (arity g c y +a)).(arity_ind g (\lambda (_: C).(\lambda (t: T).(\lambda (a0: A).((eq T t +(TSort n)) \to (leq g a0 (ASort O n)))))) (\lambda (_: C).(\lambda (n0: +nat).(\lambda (H1: (eq T (TSort n0) (TSort n))).(let H2 \def (f_equal T nat +(\lambda (e: T).(match e in T return (\lambda (_: T).nat) with [(TSort n1) +\Rightarrow n1 | (TLRef _) \Rightarrow n0 | (THead _ _ _) \Rightarrow n0])) +(TSort n0) (TSort n) H1) in (eq_ind_r nat n (\lambda (n1: nat).(leq g (ASort +O n1) (ASort O n))) (leq_refl g (ASort O n)) n0 H2))))) (\lambda (c0: +C).(\lambda (d: C).(\lambda (u: T).(\lambda (i: nat).(\lambda (_: (getl i c0 +(CHead d (Bind Abbr) u))).(\lambda (a0: A).(\lambda (_: (arity g d u +a0)).(\lambda (_: (((eq T u (TSort n)) \to (leq g a0 (ASort O n))))).(\lambda +(H4: (eq T (TLRef i) (TSort n))).(let H5 \def (eq_ind T (TLRef i) (\lambda +(ee: T).(match ee in T return (\lambda (_: T).Prop) with [(TSort _) +\Rightarrow False | (TLRef _) \Rightarrow True | (THead _ _ _) \Rightarrow +False])) I (TSort n) H4) in (False_ind (leq g a0 (ASort O n)) H5))))))))))) +(\lambda (c0: C).(\lambda (d: C).(\lambda (u: T).(\lambda (i: nat).(\lambda +(_: (getl i c0 (CHead d (Bind Abst) u))).(\lambda (a0: A).(\lambda (_: (arity +g d u (asucc g a0))).(\lambda (_: (((eq T u (TSort n)) \to (leq g (asucc g +a0) (ASort O n))))).(\lambda (H4: (eq T (TLRef i) (TSort n))).(let H5 \def +(eq_ind T (TLRef i) (\lambda (ee: T).(match ee in T return (\lambda (_: +T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) \Rightarrow True | +(THead _ _ _) \Rightarrow False])) I (TSort n) H4) in (False_ind (leq g a0 +(ASort O n)) H5))))))))))) (\lambda (b: B).(\lambda (_: (not (eq B b +Abst))).(\lambda (c0: C).(\lambda (u: T).(\lambda (a1: A).(\lambda (_: (arity +g c0 u a1)).(\lambda (_: (((eq T u (TSort n)) \to (leq g a1 (ASort O +n))))).(\lambda (t: T).(\lambda (a2: A).(\lambda (_: (arity g (CHead c0 (Bind +b) u) t a2)).(\lambda (_: (((eq T t (TSort n)) \to (leq g a2 (ASort O +n))))).(\lambda (H6: (eq T (THead (Bind b) u t) (TSort n))).(let H7 \def +(eq_ind T (THead (Bind b) u t) (\lambda (ee: T).(match ee in T return +(\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) +\Rightarrow False | (THead _ _ _) \Rightarrow True])) I (TSort n) H6) in +(False_ind (leq g a2 (ASort O n)) H7)))))))))))))) (\lambda (c0: C).(\lambda +(u: T).(\lambda (a1: A).(\lambda (_: (arity g c0 u (asucc g a1))).(\lambda +(_: (((eq T u (TSort n)) \to (leq g (asucc g a1) (ASort O n))))).(\lambda (t: +T).(\lambda (a2: A).(\lambda (_: (arity g (CHead c0 (Bind Abst) u) t +a2)).(\lambda (_: (((eq T t (TSort n)) \to (leq g a2 (ASort O n))))).(\lambda +(H5: (eq T (THead (Bind Abst) u t) (TSort n))).(let H6 \def (eq_ind T (THead +(Bind Abst) u t) (\lambda (ee: T).(match ee in T return (\lambda (_: T).Prop) +with [(TSort _) \Rightarrow False | (TLRef _) \Rightarrow False | (THead _ _ +_) \Rightarrow True])) I (TSort n) H5) in (False_ind (leq g (AHead a1 a2) +(ASort O n)) H6)))))))))))) (\lambda (c0: C).(\lambda (u: T).(\lambda (a1: +A).(\lambda (_: (arity g c0 u a1)).(\lambda (_: (((eq T u (TSort n)) \to (leq +g a1 (ASort O n))))).(\lambda (t: T).(\lambda (a2: A).(\lambda (_: (arity g +c0 t (AHead a1 a2))).(\lambda (_: (((eq T t (TSort n)) \to (leq g (AHead a1 +a2) (ASort O n))))).(\lambda (H5: (eq T (THead (Flat Appl) u t) (TSort +n))).(let H6 \def (eq_ind T (THead (Flat Appl) u t) (\lambda (ee: T).(match +ee in T return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | +(TLRef _) \Rightarrow False | (THead _ _ _) \Rightarrow True])) I (TSort n) +H5) in (False_ind (leq g a2 (ASort O n)) H6)))))))))))) (\lambda (c0: +C).(\lambda (u: T).(\lambda (a0: A).(\lambda (_: (arity g c0 u (asucc g +a0))).(\lambda (_: (((eq T u (TSort n)) \to (leq g (asucc g a0) (ASort O +n))))).(\lambda (t: T).(\lambda (_: (arity g c0 t a0)).(\lambda (_: (((eq T t +(TSort n)) \to (leq g a0 (ASort O n))))).(\lambda (H5: (eq T (THead (Flat +Cast) u t) (TSort n))).(let H6 \def (eq_ind T (THead (Flat Cast) u t) +(\lambda (ee: T).(match ee in T return (\lambda (_: T).Prop) with [(TSort _) +\Rightarrow False | (TLRef _) \Rightarrow False | (THead _ _ _) \Rightarrow +True])) I (TSort n) H5) in (False_ind (leq g a0 (ASort O n)) H6))))))))))) +(\lambda (c0: C).(\lambda (t: T).(\lambda (a1: A).(\lambda (H1: (arity g c0 t +a1)).(\lambda (H2: (((eq T t (TSort n)) \to (leq g a1 (ASort O +n))))).(\lambda (a2: A).(\lambda (H3: (leq g a1 a2)).(\lambda (H4: (eq T t +(TSort n))).(let H5 \def (f_equal T T (\lambda (e: T).e) t (TSort n) H4) in +(let H6 \def (eq_ind T t (\lambda (t0: T).((eq T t0 (TSort n)) \to (leq g a1 +(ASort O n)))) H2 (TSort n) H5) in (let H7 \def (eq_ind T t (\lambda (t0: +T).(arity g c0 t0 a1)) H1 (TSort n) H5) in (leq_trans g a2 a1 (leq_sym g a1 +a2 H3) (ASort O n) (H6 (refl_equal T (TSort n))))))))))))))) c y a H0))) +H))))). + +theorem arity_gen_lref: + \forall (g: G).(\forall (c: C).(\forall (i: nat).(\forall (a: A).((arity g c +(TLRef i) a) \to (or (ex2_2 C T (\lambda (d: C).(\lambda (u: T).(getl i c +(CHead d (Bind Abbr) u)))) (\lambda (d: C).(\lambda (u: T).(arity g d u a)))) +(ex2_2 C T (\lambda (d: C).(\lambda (u: T).(getl i c (CHead d (Bind Abst) +u)))) (\lambda (d: C).(\lambda (u: T).(arity g d u (asucc g a)))))))))) +\def + \lambda (g: G).(\lambda (c: C).(\lambda (i: nat).(\lambda (a: A).(\lambda +(H: (arity g c (TLRef i) a)).(insert_eq T (TLRef i) (\lambda (t: T).(arity g +c t a)) (or (ex2_2 C T (\lambda (d: C).(\lambda (u: T).(getl i c (CHead d +(Bind Abbr) u)))) (\lambda (d: C).(\lambda (u: T).(arity g d u a)))) (ex2_2 C +T (\lambda (d: C).(\lambda (u: T).(getl i c (CHead d (Bind Abst) u)))) +(\lambda (d: C).(\lambda (u: T).(arity g d u (asucc g a)))))) (\lambda (y: +T).(\lambda (H0: (arity g c y a)).(arity_ind g (\lambda (c0: C).(\lambda (t: +T).(\lambda (a0: A).((eq T t (TLRef i)) \to (or (ex2_2 C T (\lambda (d: +C).(\lambda (u: T).(getl i c0 (CHead d (Bind Abbr) u)))) (\lambda (d: +C).(\lambda (u: T).(arity g d u a0)))) (ex2_2 C T (\lambda (d: C).(\lambda +(u: T).(getl i c0 (CHead d (Bind Abst) u)))) (\lambda (d: C).(\lambda (u: +T).(arity g d u (asucc g a0)))))))))) (\lambda (c0: C).(\lambda (n: +nat).(\lambda (H1: (eq T (TSort n) (TLRef i))).(let H2 \def (eq_ind T (TSort +n) (\lambda (ee: T).(match ee in T return (\lambda (_: T).Prop) with [(TSort +_) \Rightarrow True | (TLRef _) \Rightarrow False | (THead _ _ _) \Rightarrow +False])) I (TLRef i) H1) in (False_ind (or (ex2_2 C T (\lambda (d: +C).(\lambda (u: T).(getl i c0 (CHead d (Bind Abbr) u)))) (\lambda (d: +C).(\lambda (u: T).(arity g d u (ASort O n))))) (ex2_2 C T (\lambda (d: +C).(\lambda (u: T).(getl i c0 (CHead d (Bind Abst) u)))) (\lambda (d: +C).(\lambda (u: T).(arity g d u (asucc g (ASort O n))))))) H2))))) (\lambda +(c0: C).(\lambda (d: C).(\lambda (u: T).(\lambda (i0: nat).(\lambda (H1: +(getl i0 c0 (CHead d (Bind Abbr) u))).(\lambda (a0: A).(\lambda (H2: (arity g +d u a0)).(\lambda (_: (((eq T u (TLRef i)) \to (or (ex2_2 C T (\lambda (d0: +C).(\lambda (u0: T).(getl i d (CHead d0 (Bind Abbr) u0)))) (\lambda (d0: +C).(\lambda (u0: T).(arity g d0 u0 a0)))) (ex2_2 C T (\lambda (d0: +C).(\lambda (u0: T).(getl i d (CHead d0 (Bind Abst) u0)))) (\lambda (d0: +C).(\lambda (u0: T).(arity g d0 u0 (asucc g a0))))))))).(\lambda (H4: (eq T +(TLRef i0) (TLRef i))).(let H5 \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 i) H4) in +(let H6 \def (eq_ind nat i0 (\lambda (n: nat).(getl n c0 (CHead d (Bind Abbr) +u))) H1 i H5) in (or_introl (ex2_2 C T (\lambda (d0: C).(\lambda (u0: +T).(getl i c0 (CHead d0 (Bind Abbr) u0)))) (\lambda (d0: C).(\lambda (u0: +T).(arity g d0 u0 a0)))) (ex2_2 C T (\lambda (d0: C).(\lambda (u0: T).(getl i +c0 (CHead d0 (Bind Abst) u0)))) (\lambda (d0: C).(\lambda (u0: T).(arity g d0 +u0 (asucc g a0))))) (ex2_2_intro C T (\lambda (d0: C).(\lambda (u0: T).(getl +i c0 (CHead d0 (Bind Abbr) u0)))) (\lambda (d0: C).(\lambda (u0: T).(arity g +d0 u0 a0))) d u H6 H2))))))))))))) (\lambda (c0: C).(\lambda (d: C).(\lambda +(u: T).(\lambda (i0: nat).(\lambda (H1: (getl i0 c0 (CHead d (Bind Abst) +u))).(\lambda (a0: A).(\lambda (H2: (arity g d u (asucc g a0))).(\lambda (_: +(((eq T u (TLRef i)) \to (or (ex2_2 C T (\lambda (d0: C).(\lambda (u0: +T).(getl i d (CHead d0 (Bind Abbr) u0)))) (\lambda (d0: C).(\lambda (u0: +T).(arity g d0 u0 (asucc g a0))))) (ex2_2 C T (\lambda (d0: C).(\lambda (u0: +T).(getl i d (CHead d0 (Bind Abst) u0)))) (\lambda (d0: C).(\lambda (u0: +T).(arity g d0 u0 (asucc g (asucc g a0)))))))))).(\lambda (H4: (eq T (TLRef +i0) (TLRef i))).(let H5 \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 i) H4) in +(let H6 \def (eq_ind nat i0 (\lambda (n: nat).(getl n c0 (CHead d (Bind Abst) +u))) H1 i H5) in (or_intror (ex2_2 C T (\lambda (d0: C).(\lambda (u0: +T).(getl i c0 (CHead d0 (Bind Abbr) u0)))) (\lambda (d0: C).(\lambda (u0: +T).(arity g d0 u0 a0)))) (ex2_2 C T (\lambda (d0: C).(\lambda (u0: T).(getl i +c0 (CHead d0 (Bind Abst) u0)))) (\lambda (d0: C).(\lambda (u0: T).(arity g d0 +u0 (asucc g a0))))) (ex2_2_intro C T (\lambda (d0: C).(\lambda (u0: T).(getl +i c0 (CHead d0 (Bind Abst) u0)))) (\lambda (d0: C).(\lambda (u0: T).(arity g +d0 u0 (asucc g a0)))) d u H6 H2))))))))))))) (\lambda (b: B).(\lambda (_: +(not (eq B b Abst))).(\lambda (c0: C).(\lambda (u: T).(\lambda (a1: +A).(\lambda (_: (arity g c0 u a1)).(\lambda (_: (((eq T u (TLRef i)) \to (or +(ex2_2 C T (\lambda (d: C).(\lambda (u0: T).(getl i c0 (CHead d (Bind Abbr) +u0)))) (\lambda (d: C).(\lambda (u0: T).(arity g d u0 a1)))) (ex2_2 C T +(\lambda (d: C).(\lambda (u0: T).(getl i c0 (CHead d (Bind Abst) u0)))) +(\lambda (d: C).(\lambda (u0: T).(arity g d u0 (asucc g a1))))))))).(\lambda +(t: T).(\lambda (a2: A).(\lambda (_: (arity g (CHead c0 (Bind b) u) t +a2)).(\lambda (_: (((eq T t (TLRef i)) \to (or (ex2_2 C T (\lambda (d: +C).(\lambda (u0: T).(getl i (CHead c0 (Bind b) u) (CHead d (Bind Abbr) u0)))) +(\lambda (d: C).(\lambda (u0: T).(arity g d u0 a2)))) (ex2_2 C T (\lambda (d: +C).(\lambda (u0: T).(getl i (CHead c0 (Bind b) u) (CHead d (Bind Abst) u0)))) +(\lambda (d: C).(\lambda (u0: T).(arity g d u0 (asucc g a2))))))))).(\lambda +(H6: (eq T (THead (Bind b) u t) (TLRef i))).(let H7 \def (eq_ind T (THead +(Bind b) u t) (\lambda (ee: T).(match ee in T return (\lambda (_: T).Prop) +with [(TSort _) \Rightarrow False | (TLRef _) \Rightarrow False | (THead _ _ +_) \Rightarrow True])) I (TLRef i) H6) in (False_ind (or (ex2_2 C T (\lambda +(d: C).(\lambda (u0: T).(getl i c0 (CHead d (Bind Abbr) u0)))) (\lambda (d: +C).(\lambda (u0: T).(arity g d u0 a2)))) (ex2_2 C T (\lambda (d: C).(\lambda +(u0: T).(getl i c0 (CHead d (Bind Abst) u0)))) (\lambda (d: C).(\lambda (u0: +T).(arity g d u0 (asucc g a2)))))) H7)))))))))))))) (\lambda (c0: C).(\lambda +(u: T).(\lambda (a1: A).(\lambda (_: (arity g c0 u (asucc g a1))).(\lambda +(_: (((eq T u (TLRef i)) \to (or (ex2_2 C T (\lambda (d: C).(\lambda (u0: +T).(getl i c0 (CHead d (Bind Abbr) u0)))) (\lambda (d: C).(\lambda (u0: +T).(arity g d u0 (asucc g a1))))) (ex2_2 C T (\lambda (d: C).(\lambda (u0: +T).(getl i c0 (CHead d (Bind Abst) u0)))) (\lambda (d: C).(\lambda (u0: +T).(arity g d u0 (asucc g (asucc g a1)))))))))).(\lambda (t: T).(\lambda (a2: +A).(\lambda (_: (arity g (CHead c0 (Bind Abst) u) t a2)).(\lambda (_: (((eq T +t (TLRef i)) \to (or (ex2_2 C T (\lambda (d: C).(\lambda (u0: T).(getl i +(CHead c0 (Bind Abst) u) (CHead d (Bind Abbr) u0)))) (\lambda (d: C).(\lambda +(u0: T).(arity g d u0 a2)))) (ex2_2 C T (\lambda (d: C).(\lambda (u0: +T).(getl i (CHead c0 (Bind Abst) u) (CHead d (Bind Abst) u0)))) (\lambda (d: +C).(\lambda (u0: T).(arity g d u0 (asucc g a2))))))))).(\lambda (H5: (eq T +(THead (Bind Abst) u t) (TLRef i))).(let H6 \def (eq_ind T (THead (Bind Abst) +u t) (\lambda (ee: T).(match ee in T return (\lambda (_: T).Prop) with +[(TSort _) \Rightarrow False | (TLRef _) \Rightarrow False | (THead _ _ _) +\Rightarrow True])) I (TLRef i) H5) in (False_ind (or (ex2_2 C T (\lambda (d: +C).(\lambda (u0: T).(getl i c0 (CHead d (Bind Abbr) u0)))) (\lambda (d: +C).(\lambda (u0: T).(arity g d u0 (AHead a1 a2))))) (ex2_2 C T (\lambda (d: +C).(\lambda (u0: T).(getl i c0 (CHead d (Bind Abst) u0)))) (\lambda (d: +C).(\lambda (u0: T).(arity g d u0 (asucc g (AHead a1 a2))))))) H6)))))))))))) +(\lambda (c0: C).(\lambda (u: T).(\lambda (a1: A).(\lambda (_: (arity g c0 u +a1)).(\lambda (_: (((eq T u (TLRef i)) \to (or (ex2_2 C T (\lambda (d: +C).(\lambda (u0: T).(getl i c0 (CHead d (Bind Abbr) u0)))) (\lambda (d: +C).(\lambda (u0: T).(arity g d u0 a1)))) (ex2_2 C T (\lambda (d: C).(\lambda +(u0: T).(getl i c0 (CHead d (Bind Abst) u0)))) (\lambda (d: C).(\lambda (u0: +T).(arity g d u0 (asucc g a1))))))))).(\lambda (t: T).(\lambda (a2: +A).(\lambda (_: (arity g c0 t (AHead a1 a2))).(\lambda (_: (((eq T t (TLRef +i)) \to (or (ex2_2 C T (\lambda (d: C).(\lambda (u0: T).(getl i c0 (CHead d +(Bind Abbr) u0)))) (\lambda (d: C).(\lambda (u0: T).(arity g d u0 (AHead a1 +a2))))) (ex2_2 C T (\lambda (d: C).(\lambda (u0: T).(getl i c0 (CHead d (Bind +Abst) u0)))) (\lambda (d: C).(\lambda (u0: T).(arity g d u0 (asucc g (AHead +a1 a2)))))))))).(\lambda (H5: (eq T (THead (Flat Appl) u t) (TLRef i))).(let +H6 \def (eq_ind T (THead (Flat Appl) u t) (\lambda (ee: T).(match ee in T +return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) +\Rightarrow False | (THead _ _ _) \Rightarrow True])) I (TLRef i) H5) in +(False_ind (or (ex2_2 C T (\lambda (d: C).(\lambda (u0: T).(getl i c0 (CHead +d (Bind Abbr) u0)))) (\lambda (d: C).(\lambda (u0: T).(arity g d u0 a2)))) +(ex2_2 C T (\lambda (d: C).(\lambda (u0: T).(getl i c0 (CHead d (Bind Abst) +u0)))) (\lambda (d: C).(\lambda (u0: T).(arity g d u0 (asucc g a2)))))) +H6)))))))))))) (\lambda (c0: C).(\lambda (u: T).(\lambda (a0: A).(\lambda (_: +(arity g c0 u (asucc g a0))).(\lambda (_: (((eq T u (TLRef i)) \to (or (ex2_2 +C T (\lambda (d: C).(\lambda (u0: T).(getl i c0 (CHead d (Bind Abbr) u0)))) +(\lambda (d: C).(\lambda (u0: T).(arity g d u0 (asucc g a0))))) (ex2_2 C T +(\lambda (d: C).(\lambda (u0: T).(getl i c0 (CHead d (Bind Abst) u0)))) +(\lambda (d: C).(\lambda (u0: T).(arity g d u0 (asucc g (asucc g +a0)))))))))).(\lambda (t: T).(\lambda (_: (arity g c0 t a0)).(\lambda (_: +(((eq T t (TLRef i)) \to (or (ex2_2 C T (\lambda (d: C).(\lambda (u0: +T).(getl i c0 (CHead d (Bind Abbr) u0)))) (\lambda (d: C).(\lambda (u0: +T).(arity g d u0 a0)))) (ex2_2 C T (\lambda (d: C).(\lambda (u0: T).(getl i +c0 (CHead d (Bind Abst) u0)))) (\lambda (d: C).(\lambda (u0: T).(arity g d u0 +(asucc g a0))))))))).(\lambda (H5: (eq T (THead (Flat Cast) u t) (TLRef +i))).(let H6 \def (eq_ind T (THead (Flat Cast) u t) (\lambda (ee: T).(match +ee in T return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | +(TLRef _) \Rightarrow False | (THead _ _ _) \Rightarrow True])) I (TLRef i) +H5) in (False_ind (or (ex2_2 C T (\lambda (d: C).(\lambda (u0: T).(getl i c0 +(CHead d (Bind Abbr) u0)))) (\lambda (d: C).(\lambda (u0: T).(arity g d u0 +a0)))) (ex2_2 C T (\lambda (d: C).(\lambda (u0: T).(getl i c0 (CHead d (Bind +Abst) u0)))) (\lambda (d: C).(\lambda (u0: T).(arity g d u0 (asucc g a0)))))) +H6))))))))))) (\lambda (c0: C).(\lambda (t: T).(\lambda (a1: A).(\lambda (H1: +(arity g c0 t a1)).(\lambda (H2: (((eq T t (TLRef i)) \to (or (ex2_2 C T +(\lambda (d: C).(\lambda (u: T).(getl i c0 (CHead d (Bind Abbr) u)))) +(\lambda (d: C).(\lambda (u: T).(arity g d u a1)))) (ex2_2 C T (\lambda (d: +C).(\lambda (u: T).(getl i c0 (CHead d (Bind Abst) u)))) (\lambda (d: +C).(\lambda (u: T).(arity g d u (asucc g a1))))))))).(\lambda (a2: +A).(\lambda (H3: (leq g a1 a2)).(\lambda (H4: (eq T t (TLRef i))).(let H5 +\def (f_equal T T (\lambda (e: T).e) t (TLRef i) H4) in (let H6 \def (eq_ind +T t (\lambda (t0: T).((eq T t0 (TLRef i)) \to (or (ex2_2 C T (\lambda (d: +C).(\lambda (u: T).(getl i c0 (CHead d (Bind Abbr) u)))) (\lambda (d: +C).(\lambda (u: T).(arity g d u a1)))) (ex2_2 C T (\lambda (d: C).(\lambda +(u: T).(getl i c0 (CHead d (Bind Abst) u)))) (\lambda (d: C).(\lambda (u: +T).(arity g d u (asucc g a1)))))))) H2 (TLRef i) H5) in (let H7 \def (eq_ind +T t (\lambda (t0: T).(arity g c0 t0 a1)) H1 (TLRef i) H5) in (let H8 \def (H6 +(refl_equal T (TLRef i))) in (or_ind (ex2_2 C T (\lambda (d: C).(\lambda (u: +T).(getl i c0 (CHead d (Bind Abbr) u)))) (\lambda (d: C).(\lambda (u: +T).(arity g d u a1)))) (ex2_2 C T (\lambda (d: C).(\lambda (u: T).(getl i c0 +(CHead d (Bind Abst) u)))) (\lambda (d: C).(\lambda (u: T).(arity g d u +(asucc g a1))))) (or (ex2_2 C T (\lambda (d: C).(\lambda (u: T).(getl i c0 +(CHead d (Bind Abbr) u)))) (\lambda (d: C).(\lambda (u: T).(arity g d u +a2)))) (ex2_2 C T (\lambda (d: C).(\lambda (u: T).(getl i c0 (CHead d (Bind +Abst) u)))) (\lambda (d: C).(\lambda (u: T).(arity g d u (asucc g a2)))))) +(\lambda (H9: (ex2_2 C T (\lambda (d: C).(\lambda (u: T).(getl i c0 (CHead d +(Bind Abbr) u)))) (\lambda (d: C).(\lambda (u: T).(arity g d u +a1))))).(ex2_2_ind C T (\lambda (d: C).(\lambda (u: T).(getl i c0 (CHead d +(Bind Abbr) u)))) (\lambda (d: C).(\lambda (u: T).(arity g d u a1))) (or +(ex2_2 C T (\lambda (d: C).(\lambda (u: T).(getl i c0 (CHead d (Bind Abbr) +u)))) (\lambda (d: C).(\lambda (u: T).(arity g d u a2)))) (ex2_2 C T (\lambda +(d: C).(\lambda (u: T).(getl i c0 (CHead d (Bind Abst) u)))) (\lambda (d: +C).(\lambda (u: T).(arity g d u (asucc g a2)))))) (\lambda (x0: C).(\lambda +(x1: T).(\lambda (H10: (getl i c0 (CHead x0 (Bind Abbr) x1))).(\lambda (H11: +(arity g x0 x1 a1)).(or_introl (ex2_2 C T (\lambda (d: C).(\lambda (u: +T).(getl i c0 (CHead d (Bind Abbr) u)))) (\lambda (d: C).(\lambda (u: +T).(arity g d u a2)))) (ex2_2 C T (\lambda (d: C).(\lambda (u: T).(getl i c0 +(CHead d (Bind Abst) u)))) (\lambda (d: C).(\lambda (u: T).(arity g d u +(asucc g a2))))) (ex2_2_intro C T (\lambda (d: C).(\lambda (u: T).(getl i c0 +(CHead d (Bind Abbr) u)))) (\lambda (d: C).(\lambda (u: T).(arity g d u a2))) +x0 x1 H10 (arity_repl g x0 x1 a1 H11 a2 H3))))))) H9)) (\lambda (H9: (ex2_2 C +T (\lambda (d: C).(\lambda (u: T).(getl i c0 (CHead d (Bind Abst) u)))) +(\lambda (d: C).(\lambda (u: T).(arity g d u (asucc g a1)))))).(ex2_2_ind C T +(\lambda (d: C).(\lambda (u: T).(getl i c0 (CHead d (Bind Abst) u)))) +(\lambda (d: C).(\lambda (u: T).(arity g d u (asucc g a1)))) (or (ex2_2 C T +(\lambda (d: C).(\lambda (u: T).(getl i c0 (CHead d (Bind Abbr) u)))) +(\lambda (d: C).(\lambda (u: T).(arity g d u a2)))) (ex2_2 C T (\lambda (d: +C).(\lambda (u: T).(getl i c0 (CHead d (Bind Abst) u)))) (\lambda (d: +C).(\lambda (u: T).(arity g d u (asucc g a2)))))) (\lambda (x0: C).(\lambda +(x1: T).(\lambda (H10: (getl i c0 (CHead x0 (Bind Abst) x1))).(\lambda (H11: +(arity g x0 x1 (asucc g a1))).(or_intror (ex2_2 C T (\lambda (d: C).(\lambda +(u: T).(getl i c0 (CHead d (Bind Abbr) u)))) (\lambda (d: C).(\lambda (u: +T).(arity g d u a2)))) (ex2_2 C T (\lambda (d: C).(\lambda (u: T).(getl i c0 +(CHead d (Bind Abst) u)))) (\lambda (d: C).(\lambda (u: T).(arity g d u +(asucc g a2))))) (ex2_2_intro C T (\lambda (d: C).(\lambda (u: T).(getl i c0 +(CHead d (Bind Abst) u)))) (\lambda (d: C).(\lambda (u: T).(arity g d u +(asucc g a2)))) x0 x1 H10 (arity_repl g x0 x1 (asucc g a1) H11 (asucc g a2) +(asucc_repl g a1 a2 H3)))))))) H9)) H8))))))))))))) c y a H0))) H))))). + +theorem arity_gen_bind: + \forall (b: B).((not (eq B b Abst)) \to (\forall (g: G).(\forall (c: +C).(\forall (u: T).(\forall (t: T).(\forall (a2: A).((arity g c (THead (Bind +b) u t) a2) \to (ex2 A (\lambda (a1: A).(arity g c u a1)) (\lambda (_: +A).(arity g (CHead c (Bind b) u) t a2)))))))))) +\def + \lambda (b: B).(\lambda (H: (not (eq B b Abst))).(\lambda (g: G).(\lambda +(c: C).(\lambda (u: T).(\lambda (t: T).(\lambda (a2: A).(\lambda (H0: (arity +g c (THead (Bind b) u t) a2)).(insert_eq T (THead (Bind b) u t) (\lambda (t0: +T).(arity g c t0 a2)) (ex2 A (\lambda (a1: A).(arity g c u a1)) (\lambda (_: +A).(arity g (CHead c (Bind b) u) t a2))) (\lambda (y: T).(\lambda (H1: (arity +g c y a2)).(arity_ind g (\lambda (c0: C).(\lambda (t0: T).(\lambda (a: +A).((eq T t0 (THead (Bind b) u t)) \to (ex2 A (\lambda (a1: A).(arity g c0 u +a1)) (\lambda (_: A).(arity g (CHead c0 (Bind b) u) t a))))))) (\lambda (c0: +C).(\lambda (n: nat).(\lambda (H2: (eq T (TSort n) (THead (Bind b) u +t))).(let H3 \def (eq_ind T (TSort n) (\lambda (ee: T).(match ee in T return +(\lambda (_: T).Prop) with [(TSort _) \Rightarrow True | (TLRef _) +\Rightarrow False | (THead _ _ _) \Rightarrow False])) I (THead (Bind b) u t) +H2) in (False_ind (ex2 A (\lambda (a1: A).(arity g c0 u a1)) (\lambda (_: +A).(arity g (CHead c0 (Bind b) u) t (ASort O n)))) H3))))) (\lambda (c0: +C).(\lambda (d: C).(\lambda (u0: T).(\lambda (i: nat).(\lambda (_: (getl i c0 +(CHead d (Bind Abbr) u0))).(\lambda (a: A).(\lambda (_: (arity g d u0 +a)).(\lambda (_: (((eq T u0 (THead (Bind b) u t)) \to (ex2 A (\lambda (a1: +A).(arity g d u a1)) (\lambda (_: A).(arity g (CHead d (Bind b) u) t +a)))))).(\lambda (H5: (eq T (TLRef i) (THead (Bind b) u t))).(let H6 \def +(eq_ind T (TLRef i) (\lambda (ee: T).(match ee in T return (\lambda (_: +T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) \Rightarrow True | +(THead _ _ _) \Rightarrow False])) I (THead (Bind b) u t) H5) in (False_ind +(ex2 A (\lambda (a1: A).(arity g c0 u a1)) (\lambda (_: A).(arity g (CHead c0 +(Bind b) u) t a))) H6))))))))))) (\lambda (c0: C).(\lambda (d: C).(\lambda +(u0: T).(\lambda (i: nat).(\lambda (_: (getl i c0 (CHead d (Bind Abst) +u0))).(\lambda (a: A).(\lambda (_: (arity g d u0 (asucc g a))).(\lambda (_: +(((eq T u0 (THead (Bind b) u t)) \to (ex2 A (\lambda (a1: A).(arity g d u +a1)) (\lambda (_: A).(arity g (CHead d (Bind b) u) t (asucc g +a))))))).(\lambda (H5: (eq T (TLRef i) (THead (Bind b) u t))).(let H6 \def +(eq_ind T (TLRef i) (\lambda (ee: T).(match ee in T return (\lambda (_: +T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) \Rightarrow True | +(THead _ _ _) \Rightarrow False])) I (THead (Bind b) u t) H5) in (False_ind +(ex2 A (\lambda (a1: A).(arity g c0 u a1)) (\lambda (_: A).(arity g (CHead c0 +(Bind b) u) t a))) H6))))))))))) (\lambda (b0: B).(\lambda (H2: (not (eq B b0 +Abst))).(\lambda (c0: C).(\lambda (u0: T).(\lambda (a1: A).(\lambda (H3: +(arity g c0 u0 a1)).(\lambda (H4: (((eq T u0 (THead (Bind b) u t)) \to (ex2 A +(\lambda (a3: A).(arity g c0 u a3)) (\lambda (_: A).(arity g (CHead c0 (Bind +b) u) t a1)))))).(\lambda (t0: T).(\lambda (a0: A).(\lambda (H5: (arity g +(CHead c0 (Bind b0) u0) t0 a0)).(\lambda (H6: (((eq T t0 (THead (Bind b) u +t)) \to (ex2 A (\lambda (a3: A).(arity g (CHead c0 (Bind b0) u0) u a3)) +(\lambda (_: A).(arity g (CHead (CHead c0 (Bind b0) u0) (Bind b) u) t +a0)))))).(\lambda (H7: (eq T (THead (Bind b0) u0 t0) (THead (Bind b) u +t))).(let H8 \def (f_equal T B (\lambda (e: T).(match e in T return (\lambda +(_: T).B) with [(TSort _) \Rightarrow b0 | (TLRef _) \Rightarrow b0 | (THead +k _ _) \Rightarrow (match k in K return (\lambda (_: K).B) with [(Bind b1) +\Rightarrow b1 | (Flat _) \Rightarrow b0])])) (THead (Bind b0) u0 t0) (THead +(Bind b) u t) 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 _ t1 _) \Rightarrow t1])) (THead (Bind b0) u0 t0) +(THead (Bind b) u t) H7) in ((let H10 \def (f_equal T T (\lambda (e: +T).(match e in T return (\lambda (_: T).T) with [(TSort _) \Rightarrow t0 | +(TLRef _) \Rightarrow t0 | (THead _ _ t1) \Rightarrow t1])) (THead (Bind b0) +u0 t0) (THead (Bind b) u t) H7) in (\lambda (H11: (eq T u0 u)).(\lambda (H12: +(eq B b0 b)).(let H13 \def (eq_ind T t0 (\lambda (t1: T).((eq T t1 (THead +(Bind b) u t)) \to (ex2 A (\lambda (a3: A).(arity g (CHead c0 (Bind b0) u0) u +a3)) (\lambda (_: A).(arity g (CHead (CHead c0 (Bind b0) u0) (Bind b) u) t +a0))))) H6 t H10) in (let H14 \def (eq_ind T t0 (\lambda (t1: T).(arity g +(CHead c0 (Bind b0) u0) t1 a0)) H5 t H10) in (let H15 \def (eq_ind T u0 +(\lambda (t1: T).((eq T t (THead (Bind b) u t)) \to (ex2 A (\lambda (a3: +A).(arity g (CHead c0 (Bind b0) t1) u a3)) (\lambda (_: A).(arity g (CHead +(CHead c0 (Bind b0) t1) (Bind b) u) t a0))))) H13 u H11) in (let H16 \def +(eq_ind T u0 (\lambda (t1: T).(arity g (CHead c0 (Bind b0) t1) t a0)) H14 u +H11) in (let H17 \def (eq_ind T u0 (\lambda (t1: T).((eq T t1 (THead (Bind b) +u t)) \to (ex2 A (\lambda (a3: A).(arity g c0 u a3)) (\lambda (_: A).(arity g +(CHead c0 (Bind b) u) t a1))))) H4 u H11) in (let H18 \def (eq_ind T u0 +(\lambda (t1: T).(arity g c0 t1 a1)) H3 u H11) in (let H19 \def (eq_ind B b0 +(\lambda (b1: B).((eq T t (THead (Bind b) u t)) \to (ex2 A (\lambda (a3: +A).(arity g (CHead c0 (Bind b1) u) u a3)) (\lambda (_: A).(arity g (CHead +(CHead c0 (Bind b1) u) (Bind b) u) t a0))))) H15 b H12) in (let H20 \def +(eq_ind B b0 (\lambda (b1: B).(arity g (CHead c0 (Bind b1) u) t a0)) H16 b +H12) in (let H21 \def (eq_ind B b0 (\lambda (b1: B).(not (eq B b1 Abst))) H2 +b H12) in (ex_intro2 A (\lambda (a3: A).(arity g c0 u a3)) (\lambda (_: +A).(arity g (CHead c0 (Bind b) u) t a0)) a1 H18 H20))))))))))))) H9)) +H8)))))))))))))) (\lambda (c0: C).(\lambda (u0: T).(\lambda (a1: A).(\lambda +(H2: (arity g c0 u0 (asucc g a1))).(\lambda (H3: (((eq T u0 (THead (Bind b) u +t)) \to (ex2 A (\lambda (a3: A).(arity g c0 u a3)) (\lambda (_: A).(arity g +(CHead c0 (Bind b) u) t (asucc g a1))))))).(\lambda (t0: T).(\lambda (a0: +A).(\lambda (H4: (arity g (CHead c0 (Bind Abst) u0) t0 a0)).(\lambda (H5: +(((eq T t0 (THead (Bind b) u t)) \to (ex2 A (\lambda (a3: A).(arity g (CHead +c0 (Bind Abst) u0) u a3)) (\lambda (_: A).(arity g (CHead (CHead c0 (Bind +Abst) u0) (Bind b) u) t a0)))))).(\lambda (H6: (eq T (THead (Bind Abst) u0 +t0) (THead (Bind b) u t))).(let H7 \def (f_equal T B (\lambda (e: T).(match e +in T return (\lambda (_: T).B) with [(TSort _) \Rightarrow Abst | (TLRef _) +\Rightarrow Abst | (THead k _ _) \Rightarrow (match k in K return (\lambda +(_: K).B) with [(Bind b0) \Rightarrow b0 | (Flat _) \Rightarrow Abst])])) +(THead (Bind Abst) u0 t0) (THead (Bind b) u t) 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 _ t1 _) \Rightarrow t1])) +(THead (Bind Abst) u0 t0) (THead (Bind b) u t) H6) in ((let H9 \def (f_equal +T T (\lambda (e: T).(match e in T return (\lambda (_: T).T) with [(TSort _) +\Rightarrow t0 | (TLRef _) \Rightarrow t0 | (THead _ _ t1) \Rightarrow t1])) +(THead (Bind Abst) u0 t0) (THead (Bind b) u t) H6) in (\lambda (H10: (eq T u0 +u)).(\lambda (H11: (eq B Abst b)).(let H12 \def (eq_ind T t0 (\lambda (t1: +T).((eq T t1 (THead (Bind b) u t)) \to (ex2 A (\lambda (a3: A).(arity g +(CHead c0 (Bind Abst) u0) u a3)) (\lambda (_: A).(arity g (CHead (CHead c0 +(Bind Abst) u0) (Bind b) u) t a0))))) H5 t H9) in (let H13 \def (eq_ind T t0 +(\lambda (t1: T).(arity g (CHead c0 (Bind Abst) u0) t1 a0)) H4 t H9) in (let +H14 \def (eq_ind T u0 (\lambda (t1: T).((eq T t (THead (Bind b) u t)) \to +(ex2 A (\lambda (a3: A).(arity g (CHead c0 (Bind Abst) t1) u a3)) (\lambda +(_: A).(arity g (CHead (CHead c0 (Bind Abst) t1) (Bind b) u) t a0))))) H12 u +H10) in (let H15 \def (eq_ind T u0 (\lambda (t1: T).(arity g (CHead c0 (Bind +Abst) t1) t a0)) H13 u H10) in (let H16 \def (eq_ind T u0 (\lambda (t1: +T).((eq T t1 (THead (Bind b) u t)) \to (ex2 A (\lambda (a3: A).(arity g c0 u +a3)) (\lambda (_: A).(arity g (CHead c0 (Bind b) u) t (asucc g a1)))))) H3 u +H10) in (let H17 \def (eq_ind T u0 (\lambda (t1: T).(arity g c0 t1 (asucc g +a1))) H2 u H10) in (let H18 \def (eq_ind_r B b (\lambda (b0: B).((eq T t +(THead (Bind b0) u t)) \to (ex2 A (\lambda (a3: A).(arity g (CHead c0 (Bind +Abst) u) u a3)) (\lambda (_: A).(arity g (CHead (CHead c0 (Bind Abst) u) +(Bind b0) u) t a0))))) H14 Abst H11) in (let H19 \def (eq_ind_r B b (\lambda +(b0: B).((eq T u (THead (Bind b0) u t)) \to (ex2 A (\lambda (a3: A).(arity g +c0 u a3)) (\lambda (_: A).(arity g (CHead c0 (Bind b0) u) t (asucc g a1)))))) +H16 Abst H11) in (let H20 \def (eq_ind_r B b (\lambda (b0: B).(not (eq B b0 +Abst))) H Abst H11) in (eq_ind B Abst (\lambda (b0: B).(ex2 A (\lambda (a3: +A).(arity g c0 u a3)) (\lambda (_: A).(arity g (CHead c0 (Bind b0) u) t +(AHead a1 a0))))) (let H21 \def (match (H20 (refl_equal B Abst)) in False +return (\lambda (_: False).(ex2 A (\lambda (a3: A).(arity g c0 u a3)) +(\lambda (_: A).(arity g (CHead c0 (Bind Abst) u) t (AHead a1 a0))))) with +[]) in H21) b H11))))))))))))) H8)) H7)))))))))))) (\lambda (c0: C).(\lambda +(u0: T).(\lambda (a1: A).(\lambda (_: (arity g c0 u0 a1)).(\lambda (_: (((eq +T u0 (THead (Bind b) u t)) \to (ex2 A (\lambda (a3: A).(arity g c0 u a3)) +(\lambda (_: A).(arity g (CHead c0 (Bind b) u) t a1)))))).(\lambda (t0: +T).(\lambda (a0: A).(\lambda (_: (arity g c0 t0 (AHead a1 a0))).(\lambda (_: +(((eq T t0 (THead (Bind b) u t)) \to (ex2 A (\lambda (a3: A).(arity g c0 u +a3)) (\lambda (_: A).(arity g (CHead c0 (Bind b) u) t (AHead a1 +a0))))))).(\lambda (H6: (eq T (THead (Flat Appl) u0 t0) (THead (Bind b) u +t))).(let H7 \def (eq_ind T (THead (Flat Appl) u0 t0) (\lambda (ee: T).(match +ee in T return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | +(TLRef _) \Rightarrow False | (THead k _ _) \Rightarrow (match k in K return +(\lambda (_: K).Prop) with [(Bind _) \Rightarrow False | (Flat _) \Rightarrow +True])])) I (THead (Bind b) u t) H6) in (False_ind (ex2 A (\lambda (a3: +A).(arity g c0 u a3)) (\lambda (_: A).(arity g (CHead c0 (Bind b) u) t a0))) +H7)))))))))))) (\lambda (c0: C).(\lambda (u0: T).(\lambda (a: A).(\lambda (_: +(arity g c0 u0 (asucc g a))).(\lambda (_: (((eq T u0 (THead (Bind b) u t)) +\to (ex2 A (\lambda (a1: A).(arity g c0 u a1)) (\lambda (_: A).(arity g +(CHead c0 (Bind b) u) t (asucc g a))))))).(\lambda (t0: T).(\lambda (_: +(arity g c0 t0 a)).(\lambda (_: (((eq T t0 (THead (Bind b) u t)) \to (ex2 A +(\lambda (a1: A).(arity g c0 u a1)) (\lambda (_: A).(arity g (CHead c0 (Bind +b) u) t a)))))).(\lambda (H6: (eq T (THead (Flat Cast) u0 t0) (THead (Bind b) +u t))).(let H7 \def (eq_ind T (THead (Flat Cast) u0 t0) (\lambda (ee: +T).(match ee in T return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow +False | (TLRef _) \Rightarrow False | (THead k _ _) \Rightarrow (match k in K +return (\lambda (_: K).Prop) with [(Bind _) \Rightarrow False | (Flat _) +\Rightarrow True])])) I (THead (Bind b) u t) H6) in (False_ind (ex2 A +(\lambda (a1: A).(arity g c0 u a1)) (\lambda (_: A).(arity g (CHead c0 (Bind +b) u) t a))) H7))))))))))) (\lambda (c0: C).(\lambda (t0: T).(\lambda (a1: +A).(\lambda (H2: (arity g c0 t0 a1)).(\lambda (H3: (((eq T t0 (THead (Bind b) +u t)) \to (ex2 A (\lambda (a3: A).(arity g c0 u a3)) (\lambda (_: A).(arity g +(CHead c0 (Bind b) u) t a1)))))).(\lambda (a0: A).(\lambda (H4: (leq g a1 +a0)).(\lambda (H5: (eq T t0 (THead (Bind b) u t))).(let H6 \def (f_equal T T +(\lambda (e: T).e) t0 (THead (Bind b) u t) H5) in (let H7 \def (eq_ind T t0 +(\lambda (t1: T).((eq T t1 (THead (Bind b) u t)) \to (ex2 A (\lambda (a3: +A).(arity g c0 u a3)) (\lambda (_: A).(arity g (CHead c0 (Bind b) u) t +a1))))) H3 (THead (Bind b) u t) H6) in (let H8 \def (eq_ind T t0 (\lambda +(t1: T).(arity g c0 t1 a1)) H2 (THead (Bind b) u t) H6) in (let H9 \def (H7 +(refl_equal T (THead (Bind b) u t))) in (ex2_ind A (\lambda (a3: A).(arity g +c0 u a3)) (\lambda (_: A).(arity g (CHead c0 (Bind b) u) t a1)) (ex2 A +(\lambda (a3: A).(arity g c0 u a3)) (\lambda (_: A).(arity g (CHead c0 (Bind +b) u) t a0))) (\lambda (x: A).(\lambda (H10: (arity g c0 u x)).(\lambda (H11: +(arity g (CHead c0 (Bind b) u) t a1)).(ex_intro2 A (\lambda (a3: A).(arity g +c0 u a3)) (\lambda (_: A).(arity g (CHead c0 (Bind b) u) t a0)) x H10 +(arity_repl g (CHead c0 (Bind b) u) t a1 H11 a0 H4))))) H9))))))))))))) c y +a2 H1))) H0)))))))). + +theorem arity_gen_abst: + \forall (g: G).(\forall (c: C).(\forall (u: T).(\forall (t: T).(\forall (a: +A).((arity g c (THead (Bind Abst) u t) a) \to (ex3_2 A A (\lambda (a1: +A).(\lambda (a2: A).(eq A a (AHead a1 a2)))) (\lambda (a1: A).(\lambda (_: +A).(arity g c u (asucc g a1)))) (\lambda (_: A).(\lambda (a2: A).(arity g +(CHead c (Bind Abst) u) t a2))))))))) +\def + \lambda (g: G).(\lambda (c: C).(\lambda (u: T).(\lambda (t: T).(\lambda (a: +A).(\lambda (H: (arity g c (THead (Bind Abst) u t) a)).(insert_eq T (THead +(Bind Abst) u t) (\lambda (t0: T).(arity g c t0 a)) (ex3_2 A A (\lambda (a1: +A).(\lambda (a2: A).(eq A a (AHead a1 a2)))) (\lambda (a1: A).(\lambda (_: +A).(arity g c u (asucc g a1)))) (\lambda (_: A).(\lambda (a2: A).(arity g +(CHead c (Bind Abst) u) t a2)))) (\lambda (y: T).(\lambda (H0: (arity g c y +a)).(arity_ind g (\lambda (c0: C).(\lambda (t0: T).(\lambda (a0: A).((eq T t0 +(THead (Bind Abst) u t)) \to (ex3_2 A A (\lambda (a1: A).(\lambda (a2: A).(eq +A a0 (AHead a1 a2)))) (\lambda (a1: A).(\lambda (_: A).(arity g c0 u (asucc g +a1)))) (\lambda (_: A).(\lambda (a2: A).(arity g (CHead c0 (Bind Abst) u) t +a2)))))))) (\lambda (c0: C).(\lambda (n: nat).(\lambda (H1: (eq T (TSort n) +(THead (Bind Abst) u t))).(let H2 \def (eq_ind T (TSort n) (\lambda (ee: +T).(match ee in T return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow +True | (TLRef _) \Rightarrow False | (THead _ _ _) \Rightarrow False])) I +(THead (Bind Abst) u t) H1) in (False_ind (ex3_2 A A (\lambda (a1: +A).(\lambda (a2: A).(eq A (ASort O n) (AHead a1 a2)))) (\lambda (a1: +A).(\lambda (_: A).(arity g c0 u (asucc g a1)))) (\lambda (_: A).(\lambda +(a2: A).(arity g (CHead c0 (Bind Abst) u) t a2)))) H2))))) (\lambda (c0: +C).(\lambda (d: C).(\lambda (u0: T).(\lambda (i: nat).(\lambda (_: (getl i c0 +(CHead d (Bind Abbr) u0))).(\lambda (a0: A).(\lambda (_: (arity g d u0 +a0)).(\lambda (_: (((eq T u0 (THead (Bind Abst) u t)) \to (ex3_2 A A (\lambda +(a1: A).(\lambda (a2: A).(eq A a0 (AHead a1 a2)))) (\lambda (a1: A).(\lambda +(_: A).(arity g d u (asucc g a1)))) (\lambda (_: A).(\lambda (a2: A).(arity g +(CHead d (Bind Abst) u) t a2))))))).(\lambda (H4: (eq T (TLRef i) (THead +(Bind Abst) u t))).(let H5 \def (eq_ind T (TLRef i) (\lambda (ee: T).(match +ee in T return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | +(TLRef _) \Rightarrow True | (THead _ _ _) \Rightarrow False])) I (THead +(Bind Abst) u t) H4) in (False_ind (ex3_2 A A (\lambda (a1: A).(\lambda (a2: +A).(eq A a0 (AHead a1 a2)))) (\lambda (a1: A).(\lambda (_: A).(arity g c0 u +(asucc g a1)))) (\lambda (_: A).(\lambda (a2: A).(arity g (CHead c0 (Bind +Abst) u) t a2)))) H5))))))))))) (\lambda (c0: C).(\lambda (d: C).(\lambda +(u0: T).(\lambda (i: nat).(\lambda (_: (getl i c0 (CHead d (Bind Abst) +u0))).(\lambda (a0: A).(\lambda (_: (arity g d u0 (asucc g a0))).(\lambda (_: +(((eq T u0 (THead (Bind Abst) u t)) \to (ex3_2 A A (\lambda (a1: A).(\lambda +(a2: A).(eq A (asucc g a0) (AHead a1 a2)))) (\lambda (a1: A).(\lambda (_: +A).(arity g d u (asucc g a1)))) (\lambda (_: A).(\lambda (a2: A).(arity g +(CHead d (Bind Abst) u) t a2))))))).(\lambda (H4: (eq T (TLRef i) (THead +(Bind Abst) u t))).(let H5 \def (eq_ind T (TLRef i) (\lambda (ee: T).(match +ee in T return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | +(TLRef _) \Rightarrow True | (THead _ _ _) \Rightarrow False])) I (THead +(Bind Abst) u t) H4) in (False_ind (ex3_2 A A (\lambda (a1: A).(\lambda (a2: +A).(eq A a0 (AHead a1 a2)))) (\lambda (a1: A).(\lambda (_: A).(arity g c0 u +(asucc g a1)))) (\lambda (_: A).(\lambda (a2: A).(arity g (CHead c0 (Bind +Abst) u) t a2)))) H5))))))))))) (\lambda (b: B).(\lambda (H1: (not (eq B b +Abst))).(\lambda (c0: C).(\lambda (u0: T).(\lambda (a1: A).(\lambda (H2: +(arity g c0 u0 a1)).(\lambda (H3: (((eq T u0 (THead (Bind Abst) u t)) \to +(ex3_2 A A (\lambda (a2: A).(\lambda (a3: A).(eq A a1 (AHead a2 a3)))) +(\lambda (a2: A).(\lambda (_: A).(arity g c0 u (asucc g a2)))) (\lambda (_: +A).(\lambda (a3: A).(arity g (CHead c0 (Bind Abst) u) t a3))))))).(\lambda +(t0: T).(\lambda (a2: A).(\lambda (H4: (arity g (CHead c0 (Bind b) u0) t0 +a2)).(\lambda (H5: (((eq T t0 (THead (Bind Abst) u t)) \to (ex3_2 A A +(\lambda (a3: A).(\lambda (a4: A).(eq A a2 (AHead a3 a4)))) (\lambda (a3: +A).(\lambda (_: A).(arity g (CHead c0 (Bind b) u0) u (asucc g a3)))) (\lambda +(_: A).(\lambda (a4: A).(arity g (CHead (CHead c0 (Bind b) u0) (Bind Abst) u) +t a4))))))).(\lambda (H6: (eq T (THead (Bind b) u0 t0) (THead (Bind Abst) u +t))).(let H7 \def (f_equal T B (\lambda (e: T).(match e in T return (\lambda +(_: T).B) with [(TSort _) \Rightarrow b | (TLRef _) \Rightarrow b | (THead k +_ _) \Rightarrow (match k in K return (\lambda (_: K).B) with [(Bind b0) +\Rightarrow b0 | (Flat _) \Rightarrow b])])) (THead (Bind b) u0 t0) (THead +(Bind Abst) u t) 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 _ t1 _) \Rightarrow t1])) (THead (Bind b) u0 t0) +(THead (Bind Abst) u t) H6) in ((let H9 \def (f_equal T T (\lambda (e: +T).(match e in T return (\lambda (_: T).T) with [(TSort _) \Rightarrow t0 | +(TLRef _) \Rightarrow t0 | (THead _ _ t1) \Rightarrow t1])) (THead (Bind b) +u0 t0) (THead (Bind Abst) u t) H6) in (\lambda (H10: (eq T u0 u)).(\lambda +(H11: (eq B b Abst)).(let H12 \def (eq_ind T t0 (\lambda (t1: T).((eq T t1 +(THead (Bind Abst) u t)) \to (ex3_2 A A (\lambda (a3: A).(\lambda (a4: A).(eq +A a2 (AHead a3 a4)))) (\lambda (a3: A).(\lambda (_: A).(arity g (CHead c0 +(Bind b) u0) u (asucc g a3)))) (\lambda (_: A).(\lambda (a4: A).(arity g +(CHead (CHead c0 (Bind b) u0) (Bind Abst) u) t a4)))))) H5 t H9) in (let H13 +\def (eq_ind T t0 (\lambda (t1: T).(arity g (CHead c0 (Bind b) u0) t1 a2)) H4 +t H9) in (let H14 \def (eq_ind T u0 (\lambda (t1: T).((eq T t (THead (Bind +Abst) u t)) \to (ex3_2 A A (\lambda (a3: A).(\lambda (a4: A).(eq A a2 (AHead +a3 a4)))) (\lambda (a3: A).(\lambda (_: A).(arity g (CHead c0 (Bind b) t1) u +(asucc g a3)))) (\lambda (_: A).(\lambda (a4: A).(arity g (CHead (CHead c0 +(Bind b) t1) (Bind Abst) u) t a4)))))) H12 u H10) in (let H15 \def (eq_ind T +u0 (\lambda (t1: T).(arity g (CHead c0 (Bind b) t1) t a2)) H13 u H10) in (let +H16 \def (eq_ind T u0 (\lambda (t1: T).((eq T t1 (THead (Bind Abst) u t)) \to +(ex3_2 A A (\lambda (a3: A).(\lambda (a4: A).(eq A a1 (AHead a3 a4)))) +(\lambda (a3: A).(\lambda (_: A).(arity g c0 u (asucc g a3)))) (\lambda (_: +A).(\lambda (a4: A).(arity g (CHead c0 (Bind Abst) u) t a4)))))) H3 u H10) in +(let H17 \def (eq_ind T u0 (\lambda (t1: T).(arity g c0 t1 a1)) H2 u H10) in +(let H18 \def (eq_ind B b (\lambda (b0: B).((eq T t (THead (Bind Abst) u t)) +\to (ex3_2 A A (\lambda (a3: A).(\lambda (a4: A).(eq A a2 (AHead a3 a4)))) +(\lambda (a3: A).(\lambda (_: A).(arity g (CHead c0 (Bind b0) u) u (asucc g +a3)))) (\lambda (_: A).(\lambda (a4: A).(arity g (CHead (CHead c0 (Bind b0) +u) (Bind Abst) u) t a4)))))) H14 Abst H11) in (let H19 \def (eq_ind B b +(\lambda (b0: B).(arity g (CHead c0 (Bind b0) u) t a2)) H15 Abst H11) in (let +H20 \def (eq_ind B b (\lambda (b0: B).(not (eq B b0 Abst))) H1 Abst H11) in +(let H21 \def (match (H20 (refl_equal B Abst)) in False return (\lambda (_: +False).(ex3_2 A A (\lambda (a3: A).(\lambda (a4: A).(eq A a2 (AHead a3 a4)))) +(\lambda (a3: A).(\lambda (_: A).(arity g c0 u (asucc g a3)))) (\lambda (_: +A).(\lambda (a4: A).(arity g (CHead c0 (Bind Abst) u) t a4))))) with []) in +H21))))))))))))) H8)) H7)))))))))))))) (\lambda (c0: C).(\lambda (u0: +T).(\lambda (a1: A).(\lambda (H1: (arity g c0 u0 (asucc g a1))).(\lambda (H2: +(((eq T u0 (THead (Bind Abst) u t)) \to (ex3_2 A A (\lambda (a2: A).(\lambda +(a3: A).(eq A (asucc g a1) (AHead a2 a3)))) (\lambda (a2: A).(\lambda (_: +A).(arity g c0 u (asucc g a2)))) (\lambda (_: A).(\lambda (a3: A).(arity g +(CHead c0 (Bind Abst) u) t a3))))))).(\lambda (t0: T).(\lambda (a2: +A).(\lambda (H3: (arity g (CHead c0 (Bind Abst) u0) t0 a2)).(\lambda (H4: +(((eq T t0 (THead (Bind Abst) u t)) \to (ex3_2 A A (\lambda (a3: A).(\lambda +(a4: A).(eq A a2 (AHead a3 a4)))) (\lambda (a3: A).(\lambda (_: A).(arity g +(CHead c0 (Bind Abst) u0) u (asucc g a3)))) (\lambda (_: A).(\lambda (a4: +A).(arity g (CHead (CHead c0 (Bind Abst) u0) (Bind Abst) u) t +a4))))))).(\lambda (H5: (eq T (THead (Bind Abst) u0 t0) (THead (Bind Abst) u +t))).(let H6 \def (f_equal T T (\lambda (e: T).(match e in T return (\lambda +(_: T).T) with [(TSort _) \Rightarrow u0 | (TLRef _) \Rightarrow u0 | (THead +_ t1 _) \Rightarrow t1])) (THead (Bind Abst) u0 t0) (THead (Bind Abst) u t) +H5) in ((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 _ _ t1) \Rightarrow t1])) (THead (Bind Abst) u0 t0) (THead (Bind +Abst) u t) H5) in (\lambda (H8: (eq T u0 u)).(let H9 \def (eq_ind T t0 +(\lambda (t1: T).((eq T t1 (THead (Bind Abst) u t)) \to (ex3_2 A A (\lambda +(a3: A).(\lambda (a4: A).(eq A a2 (AHead a3 a4)))) (\lambda (a3: A).(\lambda +(_: A).(arity g (CHead c0 (Bind Abst) u0) u (asucc g a3)))) (\lambda (_: +A).(\lambda (a4: A).(arity g (CHead (CHead c0 (Bind Abst) u0) (Bind Abst) u) +t a4)))))) H4 t H7) in (let H10 \def (eq_ind T t0 (\lambda (t1: T).(arity g +(CHead c0 (Bind Abst) u0) t1 a2)) H3 t H7) in (let H11 \def (eq_ind T u0 +(\lambda (t1: T).((eq T t (THead (Bind Abst) u t)) \to (ex3_2 A A (\lambda +(a3: A).(\lambda (a4: A).(eq A a2 (AHead a3 a4)))) (\lambda (a3: A).(\lambda +(_: A).(arity g (CHead c0 (Bind Abst) t1) u (asucc g a3)))) (\lambda (_: +A).(\lambda (a4: A).(arity g (CHead (CHead c0 (Bind Abst) t1) (Bind Abst) u) +t a4)))))) H9 u H8) in (let H12 \def (eq_ind T u0 (\lambda (t1: T).(arity g +(CHead c0 (Bind Abst) t1) t a2)) H10 u H8) in (let H13 \def (eq_ind T u0 +(\lambda (t1: T).((eq T t1 (THead (Bind Abst) u t)) \to (ex3_2 A A (\lambda +(a3: A).(\lambda (a4: A).(eq A (asucc g a1) (AHead a3 a4)))) (\lambda (a3: +A).(\lambda (_: A).(arity g c0 u (asucc g a3)))) (\lambda (_: A).(\lambda +(a4: A).(arity g (CHead c0 (Bind Abst) u) t a4)))))) H2 u H8) in (let H14 +\def (eq_ind T u0 (\lambda (t1: T).(arity g c0 t1 (asucc g a1))) H1 u H8) in +(ex3_2_intro A A (\lambda (a3: A).(\lambda (a4: A).(eq A (AHead a1 a2) (AHead +a3 a4)))) (\lambda (a3: A).(\lambda (_: A).(arity g c0 u (asucc g a3)))) +(\lambda (_: A).(\lambda (a4: A).(arity g (CHead c0 (Bind Abst) u) t a4))) a1 +a2 (refl_equal A (AHead a1 a2)) H14 H12))))))))) H6)))))))))))) (\lambda (c0: +C).(\lambda (u0: T).(\lambda (a1: A).(\lambda (_: (arity g c0 u0 +a1)).(\lambda (_: (((eq T u0 (THead (Bind Abst) u t)) \to (ex3_2 A A (\lambda +(a2: A).(\lambda (a3: A).(eq A a1 (AHead a2 a3)))) (\lambda (a2: A).(\lambda +(_: A).(arity g c0 u (asucc g a2)))) (\lambda (_: A).(\lambda (a3: A).(arity +g (CHead c0 (Bind Abst) u) t a3))))))).(\lambda (t0: T).(\lambda (a2: +A).(\lambda (_: (arity g c0 t0 (AHead a1 a2))).(\lambda (_: (((eq T t0 (THead +(Bind Abst) u t)) \to (ex3_2 A A (\lambda (a3: A).(\lambda (a4: A).(eq A +(AHead a1 a2) (AHead a3 a4)))) (\lambda (a3: A).(\lambda (_: A).(arity g c0 u +(asucc g a3)))) (\lambda (_: A).(\lambda (a4: A).(arity g (CHead c0 (Bind +Abst) u) t a4))))))).(\lambda (H5: (eq T (THead (Flat Appl) u0 t0) (THead +(Bind Abst) u t))).(let H6 \def (eq_ind T (THead (Flat Appl) u0 t0) (\lambda +(ee: T).(match ee in T return (\lambda (_: T).Prop) with [(TSort _) +\Rightarrow False | (TLRef _) \Rightarrow False | (THead k _ _) \Rightarrow +(match k in K return (\lambda (_: K).Prop) with [(Bind _) \Rightarrow False | +(Flat _) \Rightarrow True])])) I (THead (Bind Abst) u t) H5) in (False_ind +(ex3_2 A A (\lambda (a3: A).(\lambda (a4: A).(eq A a2 (AHead a3 a4)))) +(\lambda (a3: A).(\lambda (_: A).(arity g c0 u (asucc g a3)))) (\lambda (_: +A).(\lambda (a4: A).(arity g (CHead c0 (Bind Abst) u) t a4)))) H6)))))))))))) +(\lambda (c0: C).(\lambda (u0: T).(\lambda (a0: A).(\lambda (_: (arity g c0 +u0 (asucc g a0))).(\lambda (_: (((eq T u0 (THead (Bind Abst) u t)) \to (ex3_2 +A A (\lambda (a1: A).(\lambda (a2: A).(eq A (asucc g a0) (AHead a1 a2)))) +(\lambda (a1: A).(\lambda (_: A).(arity g c0 u (asucc g a1)))) (\lambda (_: +A).(\lambda (a2: A).(arity g (CHead c0 (Bind Abst) u) t a2))))))).(\lambda +(t0: T).(\lambda (_: (arity g c0 t0 a0)).(\lambda (_: (((eq T t0 (THead (Bind +Abst) u t)) \to (ex3_2 A A (\lambda (a1: A).(\lambda (a2: A).(eq A a0 (AHead +a1 a2)))) (\lambda (a1: A).(\lambda (_: A).(arity g c0 u (asucc g a1)))) +(\lambda (_: A).(\lambda (a2: A).(arity g (CHead c0 (Bind Abst) u) t +a2))))))).(\lambda (H5: (eq T (THead (Flat Cast) u0 t0) (THead (Bind Abst) u +t))).(let H6 \def (eq_ind T (THead (Flat Cast) u0 t0) (\lambda (ee: T).(match +ee in T return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | +(TLRef _) \Rightarrow False | (THead k _ _) \Rightarrow (match k in K return +(\lambda (_: K).Prop) with [(Bind _) \Rightarrow False | (Flat _) \Rightarrow +True])])) I (THead (Bind Abst) u t) H5) in (False_ind (ex3_2 A A (\lambda +(a1: A).(\lambda (a2: A).(eq A a0 (AHead a1 a2)))) (\lambda (a1: A).(\lambda +(_: A).(arity g c0 u (asucc g a1)))) (\lambda (_: A).(\lambda (a2: A).(arity +g (CHead c0 (Bind Abst) u) t a2)))) H6))))))))))) (\lambda (c0: C).(\lambda +(t0: T).(\lambda (a1: A).(\lambda (H1: (arity g c0 t0 a1)).(\lambda (H2: +(((eq T t0 (THead (Bind Abst) u t)) \to (ex3_2 A A (\lambda (a2: A).(\lambda +(a3: A).(eq A a1 (AHead a2 a3)))) (\lambda (a2: A).(\lambda (_: A).(arity g +c0 u (asucc g a2)))) (\lambda (_: A).(\lambda (a3: A).(arity g (CHead c0 +(Bind Abst) u) t a3))))))).(\lambda (a2: A).(\lambda (H3: (leq g a1 +a2)).(\lambda (H4: (eq T t0 (THead (Bind Abst) u t))).(let H5 \def (f_equal T +T (\lambda (e: T).e) t0 (THead (Bind Abst) u t) H4) in (let H6 \def (eq_ind T +t0 (\lambda (t1: T).((eq T t1 (THead (Bind Abst) u t)) \to (ex3_2 A A +(\lambda (a3: A).(\lambda (a4: A).(eq A a1 (AHead a3 a4)))) (\lambda (a3: +A).(\lambda (_: A).(arity g c0 u (asucc g a3)))) (\lambda (_: A).(\lambda +(a4: A).(arity g (CHead c0 (Bind Abst) u) t a4)))))) H2 (THead (Bind Abst) u +t) H5) in (let H7 \def (eq_ind T t0 (\lambda (t1: T).(arity g c0 t1 a1)) H1 +(THead (Bind Abst) u t) H5) in (let H8 \def (H6 (refl_equal T (THead (Bind +Abst) u t))) in (ex3_2_ind A A (\lambda (a3: A).(\lambda (a4: A).(eq A a1 +(AHead a3 a4)))) (\lambda (a3: A).(\lambda (_: A).(arity g c0 u (asucc g +a3)))) (\lambda (_: A).(\lambda (a4: A).(arity g (CHead c0 (Bind Abst) u) t +a4))) (ex3_2 A A (\lambda (a3: A).(\lambda (a4: A).(eq A a2 (AHead a3 a4)))) +(\lambda (a3: A).(\lambda (_: A).(arity g c0 u (asucc g a3)))) (\lambda (_: +A).(\lambda (a4: A).(arity g (CHead c0 (Bind Abst) u) t a4)))) (\lambda (x0: +A).(\lambda (x1: A).(\lambda (H9: (eq A a1 (AHead x0 x1))).(\lambda (H10: +(arity g c0 u (asucc g x0))).(\lambda (H11: (arity g (CHead c0 (Bind Abst) u) +t x1)).(let H12 \def (eq_ind A a1 (\lambda (a0: A).(leq g a0 a2)) H3 (AHead +x0 x1) H9) in (let H13 \def (eq_ind A a1 (\lambda (a0: A).(arity g c0 (THead +(Bind Abst) u t) a0)) H7 (AHead x0 x1) H9) in (let H_x \def (leq_gen_head g +x0 x1 a2 H12) in (let H14 \def H_x in (ex3_2_ind A A (\lambda (a3: +A).(\lambda (a4: A).(eq A a2 (AHead a3 a4)))) (\lambda (a3: A).(\lambda (_: +A).(leq g x0 a3))) (\lambda (_: A).(\lambda (a4: A).(leq g x1 a4))) (ex3_2 A +A (\lambda (a3: A).(\lambda (a4: A).(eq A a2 (AHead a3 a4)))) (\lambda (a3: +A).(\lambda (_: A).(arity g c0 u (asucc g a3)))) (\lambda (_: A).(\lambda +(a4: A).(arity g (CHead c0 (Bind Abst) u) t a4)))) (\lambda (x2: A).(\lambda +(x3: A).(\lambda (H15: (eq A a2 (AHead x2 x3))).(\lambda (H16: (leq g x0 +x2)).(\lambda (H17: (leq g x1 x3)).(eq_ind_r A (AHead x2 x3) (\lambda (a0: +A).(ex3_2 A A (\lambda (a3: A).(\lambda (a4: A).(eq A a0 (AHead a3 a4)))) +(\lambda (a3: A).(\lambda (_: A).(arity g c0 u (asucc g a3)))) (\lambda (_: +A).(\lambda (a4: A).(arity g (CHead c0 (Bind Abst) u) t a4))))) (ex3_2_intro +A A (\lambda (a3: A).(\lambda (a4: A).(eq A (AHead x2 x3) (AHead a3 a4)))) +(\lambda (a3: A).(\lambda (_: A).(arity g c0 u (asucc g a3)))) (\lambda (_: +A).(\lambda (a4: A).(arity g (CHead c0 (Bind Abst) u) t a4))) x2 x3 +(refl_equal A (AHead x2 x3)) (arity_repl g c0 u (asucc g x0) H10 (asucc g x2) +(asucc_repl g x0 x2 H16)) (arity_repl g (CHead c0 (Bind Abst) u) t x1 H11 x3 +H17)) a2 H15)))))) H14)))))))))) H8))))))))))))) c y a H0))) H)))))). + +theorem arity_gen_appl: + \forall (g: G).(\forall (c: C).(\forall (u: T).(\forall (t: T).(\forall (a2: +A).((arity g c (THead (Flat Appl) u t) a2) \to (ex2 A (\lambda (a1: A).(arity +g c u a1)) (\lambda (a1: A).(arity g c t (AHead a1 a2))))))))) +\def + \lambda (g: G).(\lambda (c: C).(\lambda (u: T).(\lambda (t: T).(\lambda (a2: +A).(\lambda (H: (arity g c (THead (Flat Appl) u t) a2)).(insert_eq T (THead +(Flat Appl) u t) (\lambda (t0: T).(arity g c t0 a2)) (ex2 A (\lambda (a1: +A).(arity g c u a1)) (\lambda (a1: A).(arity g c t (AHead a1 a2)))) (\lambda +(y: T).(\lambda (H0: (arity g c y a2)).(arity_ind g (\lambda (c0: C).(\lambda +(t0: T).(\lambda (a: A).((eq T t0 (THead (Flat Appl) u t)) \to (ex2 A +(\lambda (a1: A).(arity g c0 u a1)) (\lambda (a1: A).(arity g c0 t (AHead a1 +a)))))))) (\lambda (c0: C).(\lambda (n: nat).(\lambda (H1: (eq T (TSort n) +(THead (Flat Appl) u t))).(let H2 \def (eq_ind T (TSort n) (\lambda (ee: +T).(match ee in T return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow +True | (TLRef _) \Rightarrow False | (THead _ _ _) \Rightarrow False])) I +(THead (Flat Appl) u t) H1) in (False_ind (ex2 A (\lambda (a1: A).(arity g c0 +u a1)) (\lambda (a1: A).(arity g c0 t (AHead a1 (ASort O n))))) H2))))) +(\lambda (c0: C).(\lambda (d: C).(\lambda (u0: T).(\lambda (i: nat).(\lambda +(_: (getl i c0 (CHead d (Bind Abbr) u0))).(\lambda (a: A).(\lambda (_: (arity +g d u0 a)).(\lambda (_: (((eq T u0 (THead (Flat Appl) u t)) \to (ex2 A +(\lambda (a1: A).(arity g d u a1)) (\lambda (a1: A).(arity g d t (AHead a1 +a))))))).(\lambda (H4: (eq T (TLRef i) (THead (Flat Appl) u t))).(let H5 \def +(eq_ind T (TLRef i) (\lambda (ee: T).(match ee in T return (\lambda (_: +T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) \Rightarrow True | +(THead _ _ _) \Rightarrow False])) I (THead (Flat Appl) u t) H4) in +(False_ind (ex2 A (\lambda (a1: A).(arity g c0 u a1)) (\lambda (a1: A).(arity +g c0 t (AHead a1 a)))) H5))))))))))) (\lambda (c0: C).(\lambda (d: +C).(\lambda (u0: T).(\lambda (i: nat).(\lambda (_: (getl i c0 (CHead d (Bind +Abst) u0))).(\lambda (a: A).(\lambda (_: (arity g d u0 (asucc g a))).(\lambda +(_: (((eq T u0 (THead (Flat Appl) u t)) \to (ex2 A (\lambda (a1: A).(arity g +d u a1)) (\lambda (a1: A).(arity g d t (AHead a1 (asucc g a)))))))).(\lambda +(H4: (eq T (TLRef i) (THead (Flat Appl) u t))).(let H5 \def (eq_ind T (TLRef +i) (\lambda (ee: T).(match ee in T return (\lambda (_: T).Prop) with [(TSort +_) \Rightarrow False | (TLRef _) \Rightarrow True | (THead _ _ _) \Rightarrow +False])) I (THead (Flat Appl) u t) H4) in (False_ind (ex2 A (\lambda (a1: +A).(arity g c0 u a1)) (\lambda (a1: A).(arity g c0 t (AHead a1 a)))) +H5))))))))))) (\lambda (b: B).(\lambda (_: (not (eq B b Abst))).(\lambda (c0: +C).(\lambda (u0: T).(\lambda (a1: A).(\lambda (_: (arity g c0 u0 +a1)).(\lambda (_: (((eq T u0 (THead (Flat Appl) u t)) \to (ex2 A (\lambda +(a3: A).(arity g c0 u a3)) (\lambda (a3: A).(arity g c0 t (AHead a3 +a1))))))).(\lambda (t0: T).(\lambda (a0: A).(\lambda (_: (arity g (CHead c0 +(Bind b) u0) t0 a0)).(\lambda (_: (((eq T t0 (THead (Flat Appl) u t)) \to +(ex2 A (\lambda (a3: A).(arity g (CHead c0 (Bind b) u0) u a3)) (\lambda (a3: +A).(arity g (CHead c0 (Bind b) u0) t (AHead a3 a0))))))).(\lambda (H6: (eq T +(THead (Bind b) u0 t0) (THead (Flat Appl) u t))).(let H7 \def (eq_ind T +(THead (Bind b) u0 t0) (\lambda (ee: T).(match ee in T return (\lambda (_: +T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) \Rightarrow False | +(THead k _ _) \Rightarrow (match k in K return (\lambda (_: K).Prop) with +[(Bind _) \Rightarrow True | (Flat _) \Rightarrow False])])) I (THead (Flat +Appl) u t) H6) in (False_ind (ex2 A (\lambda (a3: A).(arity g c0 u a3)) +(\lambda (a3: A).(arity g c0 t (AHead a3 a0)))) H7)))))))))))))) (\lambda +(c0: C).(\lambda (u0: T).(\lambda (a1: A).(\lambda (_: (arity g c0 u0 (asucc +g a1))).(\lambda (_: (((eq T u0 (THead (Flat Appl) u t)) \to (ex2 A (\lambda +(a3: A).(arity g c0 u a3)) (\lambda (a3: A).(arity g c0 t (AHead a3 (asucc g +a1)))))))).(\lambda (t0: T).(\lambda (a0: A).(\lambda (_: (arity g (CHead c0 +(Bind Abst) u0) t0 a0)).(\lambda (_: (((eq T t0 (THead (Flat Appl) u t)) \to +(ex2 A (\lambda (a3: A).(arity g (CHead c0 (Bind Abst) u0) u a3)) (\lambda +(a3: A).(arity g (CHead c0 (Bind Abst) u0) t (AHead a3 a0))))))).(\lambda +(H5: (eq T (THead (Bind Abst) u0 t0) (THead (Flat Appl) u t))).(let H6 \def +(eq_ind T (THead (Bind Abst) u0 t0) (\lambda (ee: T).(match ee in T return +(\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) +\Rightarrow False | (THead k _ _) \Rightarrow (match k in K return (\lambda +(_: K).Prop) with [(Bind _) \Rightarrow True | (Flat _) \Rightarrow +False])])) I (THead (Flat Appl) u t) H5) in (False_ind (ex2 A (\lambda (a3: +A).(arity g c0 u a3)) (\lambda (a3: A).(arity g c0 t (AHead a3 (AHead a1 +a0))))) H6)))))))))))) (\lambda (c0: C).(\lambda (u0: T).(\lambda (a1: +A).(\lambda (H1: (arity g c0 u0 a1)).(\lambda (H2: (((eq T u0 (THead (Flat +Appl) u t)) \to (ex2 A (\lambda (a3: A).(arity g c0 u a3)) (\lambda (a3: +A).(arity g c0 t (AHead a3 a1))))))).(\lambda (t0: T).(\lambda (a0: +A).(\lambda (H3: (arity g c0 t0 (AHead a1 a0))).(\lambda (H4: (((eq T t0 +(THead (Flat Appl) u t)) \to (ex2 A (\lambda (a3: A).(arity g c0 u a3)) +(\lambda (a3: A).(arity g c0 t (AHead a3 (AHead a1 a0)))))))).(\lambda (H5: +(eq T (THead (Flat Appl) u0 t0) (THead (Flat Appl) u t))).(let H6 \def +(f_equal T T (\lambda (e: T).(match e in T return (\lambda (_: T).T) with +[(TSort _) \Rightarrow u0 | (TLRef _) \Rightarrow u0 | (THead _ t1 _) +\Rightarrow t1])) (THead (Flat Appl) u0 t0) (THead (Flat Appl) u t) H5) in +((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 _ _ +t1) \Rightarrow t1])) (THead (Flat Appl) u0 t0) (THead (Flat Appl) u t) H5) +in (\lambda (H8: (eq T u0 u)).(let H9 \def (eq_ind T t0 (\lambda (t1: T).((eq +T t1 (THead (Flat Appl) u t)) \to (ex2 A (\lambda (a3: A).(arity g c0 u a3)) +(\lambda (a3: A).(arity g c0 t (AHead a3 (AHead a1 a0))))))) H4 t H7) in (let +H10 \def (eq_ind T t0 (\lambda (t1: T).(arity g c0 t1 (AHead a1 a0))) H3 t +H7) in (let H11 \def (eq_ind T u0 (\lambda (t1: T).((eq T t1 (THead (Flat +Appl) u t)) \to (ex2 A (\lambda (a3: A).(arity g c0 u a3)) (\lambda (a3: +A).(arity g c0 t (AHead a3 a1)))))) H2 u H8) in (let H12 \def (eq_ind T u0 +(\lambda (t1: T).(arity g c0 t1 a1)) H1 u H8) in (ex_intro2 A (\lambda (a3: +A).(arity g c0 u a3)) (\lambda (a3: A).(arity g c0 t (AHead a3 a0))) a1 H12 +H10))))))) H6)))))))))))) (\lambda (c0: C).(\lambda (u0: T).(\lambda (a: +A).(\lambda (_: (arity g c0 u0 (asucc g a))).(\lambda (_: (((eq T u0 (THead +(Flat Appl) u t)) \to (ex2 A (\lambda (a1: A).(arity g c0 u a1)) (\lambda +(a1: A).(arity g c0 t (AHead a1 (asucc g a)))))))).(\lambda (t0: T).(\lambda +(_: (arity g c0 t0 a)).(\lambda (_: (((eq T t0 (THead (Flat Appl) u t)) \to +(ex2 A (\lambda (a1: A).(arity g c0 u a1)) (\lambda (a1: A).(arity g c0 t +(AHead a1 a))))))).(\lambda (H5: (eq T (THead (Flat Cast) u0 t0) (THead (Flat +Appl) u t))).(let H6 \def (eq_ind T (THead (Flat Cast) u0 t0) (\lambda (ee: +T).(match ee in T return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow +False | (TLRef _) \Rightarrow False | (THead k _ _) \Rightarrow (match k in K +return (\lambda (_: K).Prop) with [(Bind _) \Rightarrow False | (Flat f) +\Rightarrow (match f in F return (\lambda (_: F).Prop) with [Appl \Rightarrow +False | Cast \Rightarrow True])])])) I (THead (Flat Appl) u t) H5) in +(False_ind (ex2 A (\lambda (a1: A).(arity g c0 u a1)) (\lambda (a1: A).(arity +g c0 t (AHead a1 a)))) H6))))))))))) (\lambda (c0: C).(\lambda (t0: +T).(\lambda (a1: A).(\lambda (H1: (arity g c0 t0 a1)).(\lambda (H2: (((eq T +t0 (THead (Flat Appl) u t)) \to (ex2 A (\lambda (a3: A).(arity g c0 u a3)) +(\lambda (a3: A).(arity g c0 t (AHead a3 a1))))))).(\lambda (a0: A).(\lambda +(H3: (leq g a1 a0)).(\lambda (H4: (eq T t0 (THead (Flat Appl) u t))).(let H5 +\def (f_equal T T (\lambda (e: T).e) t0 (THead (Flat Appl) u t) H4) in (let +H6 \def (eq_ind T t0 (\lambda (t1: T).((eq T t1 (THead (Flat Appl) u t)) \to +(ex2 A (\lambda (a3: A).(arity g c0 u a3)) (\lambda (a3: A).(arity g c0 t +(AHead a3 a1)))))) H2 (THead (Flat Appl) u t) H5) in (let H7 \def (eq_ind T +t0 (\lambda (t1: T).(arity g c0 t1 a1)) H1 (THead (Flat Appl) u t) H5) in +(let H8 \def (H6 (refl_equal T (THead (Flat Appl) u t))) in (ex2_ind A +(\lambda (a3: A).(arity g c0 u a3)) (\lambda (a3: A).(arity g c0 t (AHead a3 +a1))) (ex2 A (\lambda (a3: A).(arity g c0 u a3)) (\lambda (a3: A).(arity g c0 +t (AHead a3 a0)))) (\lambda (x: A).(\lambda (H9: (arity g c0 u x)).(\lambda +(H10: (arity g c0 t (AHead x a1))).(ex_intro2 A (\lambda (a3: A).(arity g c0 +u a3)) (\lambda (a3: A).(arity g c0 t (AHead a3 a0))) x H9 (arity_repl g c0 t +(AHead x a1) H10 (AHead x a0) (leq_head g x x (leq_refl g x) a1 a0 H3)))))) +H8))))))))))))) c y a2 H0))) H)))))). + +theorem arity_gen_cast: + \forall (g: G).(\forall (c: C).(\forall (u: T).(\forall (t: T).(\forall (a: +A).((arity g c (THead (Flat Cast) u t) a) \to (land (arity g c u (asucc g a)) +(arity g c t a))))))) +\def + \lambda (g: G).(\lambda (c: C).(\lambda (u: T).(\lambda (t: T).(\lambda (a: +A).(\lambda (H: (arity g c (THead (Flat Cast) u t) a)).(insert_eq T (THead +(Flat Cast) u t) (\lambda (t0: T).(arity g c t0 a)) (land (arity g c u (asucc +g a)) (arity g c t a)) (\lambda (y: T).(\lambda (H0: (arity g c y +a)).(arity_ind g (\lambda (c0: C).(\lambda (t0: T).(\lambda (a0: A).((eq T t0 +(THead (Flat Cast) u t)) \to (land (arity g c0 u (asucc g a0)) (arity g c0 t +a0)))))) (\lambda (c0: C).(\lambda (n: nat).(\lambda (H1: (eq T (TSort n) +(THead (Flat Cast) u t))).(let H2 \def (eq_ind T (TSort n) (\lambda (ee: +T).(match ee in T return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow +True | (TLRef _) \Rightarrow False | (THead _ _ _) \Rightarrow False])) I +(THead (Flat Cast) u t) H1) in (False_ind (land (arity g c0 u (asucc g (ASort +O n))) (arity g c0 t (ASort O n))) H2))))) (\lambda (c0: C).(\lambda (d: +C).(\lambda (u0: T).(\lambda (i: nat).(\lambda (_: (getl i c0 (CHead d (Bind +Abbr) u0))).(\lambda (a0: A).(\lambda (_: (arity g d u0 a0)).(\lambda (_: +(((eq T u0 (THead (Flat Cast) u t)) \to (land (arity g d u (asucc g a0)) +(arity g d t a0))))).(\lambda (H4: (eq T (TLRef i) (THead (Flat Cast) u +t))).(let H5 \def (eq_ind T (TLRef i) (\lambda (ee: T).(match ee in T return +(\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) +\Rightarrow True | (THead _ _ _) \Rightarrow False])) I (THead (Flat Cast) u +t) H4) in (False_ind (land (arity g c0 u (asucc g a0)) (arity g c0 t a0)) +H5))))))))))) (\lambda (c0: C).(\lambda (d: C).(\lambda (u0: T).(\lambda (i: +nat).(\lambda (_: (getl i c0 (CHead d (Bind Abst) u0))).(\lambda (a0: +A).(\lambda (_: (arity g d u0 (asucc g a0))).(\lambda (_: (((eq T u0 (THead +(Flat Cast) u t)) \to (land (arity g d u (asucc g (asucc g a0))) (arity g d t +(asucc g a0)))))).(\lambda (H4: (eq T (TLRef i) (THead (Flat Cast) u +t))).(let H5 \def (eq_ind T (TLRef i) (\lambda (ee: T).(match ee in T return +(\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) +\Rightarrow True | (THead _ _ _) \Rightarrow False])) I (THead (Flat Cast) u +t) H4) in (False_ind (land (arity g c0 u (asucc g a0)) (arity g c0 t a0)) +H5))))))))))) (\lambda (b: B).(\lambda (_: (not (eq B b Abst))).(\lambda (c0: +C).(\lambda (u0: T).(\lambda (a1: A).(\lambda (_: (arity g c0 u0 +a1)).(\lambda (_: (((eq T u0 (THead (Flat Cast) u t)) \to (land (arity g c0 u +(asucc g a1)) (arity g c0 t a1))))).(\lambda (t0: T).(\lambda (a2: +A).(\lambda (_: (arity g (CHead c0 (Bind b) u0) t0 a2)).(\lambda (_: (((eq T +t0 (THead (Flat Cast) u t)) \to (land (arity g (CHead c0 (Bind b) u0) u +(asucc g a2)) (arity g (CHead c0 (Bind b) u0) t a2))))).(\lambda (H6: (eq T +(THead (Bind b) u0 t0) (THead (Flat Cast) u t))).(let H7 \def (eq_ind T +(THead (Bind b) u0 t0) (\lambda (ee: T).(match ee in T return (\lambda (_: +T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) \Rightarrow False | +(THead k _ _) \Rightarrow (match k in K return (\lambda (_: K).Prop) with +[(Bind _) \Rightarrow True | (Flat _) \Rightarrow False])])) I (THead (Flat +Cast) u t) H6) in (False_ind (land (arity g c0 u (asucc g a2)) (arity g c0 t +a2)) H7)))))))))))))) (\lambda (c0: C).(\lambda (u0: T).(\lambda (a1: +A).(\lambda (_: (arity g c0 u0 (asucc g a1))).(\lambda (_: (((eq T u0 (THead +(Flat Cast) u t)) \to (land (arity g c0 u (asucc g (asucc g a1))) (arity g c0 +t (asucc g a1)))))).(\lambda (t0: T).(\lambda (a2: A).(\lambda (_: (arity g +(CHead c0 (Bind Abst) u0) t0 a2)).(\lambda (_: (((eq T t0 (THead (Flat Cast) +u t)) \to (land (arity g (CHead c0 (Bind Abst) u0) u (asucc g a2)) (arity g +(CHead c0 (Bind Abst) u0) t a2))))).(\lambda (H5: (eq T (THead (Bind Abst) u0 +t0) (THead (Flat Cast) u t))).(let H6 \def (eq_ind T (THead (Bind Abst) u0 +t0) (\lambda (ee: T).(match ee in T return (\lambda (_: T).Prop) with [(TSort +_) \Rightarrow False | (TLRef _) \Rightarrow False | (THead k _ _) +\Rightarrow (match k in K return (\lambda (_: K).Prop) with [(Bind _) +\Rightarrow True | (Flat _) \Rightarrow False])])) I (THead (Flat Cast) u t) +H5) in (False_ind (land (arity g c0 u (asucc g (AHead a1 a2))) (arity g c0 t +(AHead a1 a2))) H6)))))))))))) (\lambda (c0: C).(\lambda (u0: T).(\lambda +(a1: A).(\lambda (_: (arity g c0 u0 a1)).(\lambda (_: (((eq T u0 (THead (Flat +Cast) u t)) \to (land (arity g c0 u (asucc g a1)) (arity g c0 t +a1))))).(\lambda (t0: T).(\lambda (a2: A).(\lambda (_: (arity g c0 t0 (AHead +a1 a2))).(\lambda (_: (((eq T t0 (THead (Flat Cast) u t)) \to (land (arity g +c0 u (asucc g (AHead a1 a2))) (arity g c0 t (AHead a1 a2)))))).(\lambda (H5: +(eq T (THead (Flat Appl) u0 t0) (THead (Flat Cast) u t))).(let H6 \def +(eq_ind T (THead (Flat Appl) u0 t0) (\lambda (ee: T).(match ee in T return +(\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) +\Rightarrow False | (THead k _ _) \Rightarrow (match k in K return (\lambda +(_: K).Prop) with [(Bind _) \Rightarrow False | (Flat f) \Rightarrow (match f +in F return (\lambda (_: F).Prop) with [Appl \Rightarrow True | Cast +\Rightarrow False])])])) I (THead (Flat Cast) u t) H5) in (False_ind (land +(arity g c0 u (asucc g a2)) (arity g c0 t a2)) H6)))))))))))) (\lambda (c0: +C).(\lambda (u0: T).(\lambda (a0: A).(\lambda (H1: (arity g c0 u0 (asucc g +a0))).(\lambda (H2: (((eq T u0 (THead (Flat Cast) u t)) \to (land (arity g c0 +u (asucc g (asucc g a0))) (arity g c0 t (asucc g a0)))))).(\lambda (t0: +T).(\lambda (H3: (arity g c0 t0 a0)).(\lambda (H4: (((eq T t0 (THead (Flat +Cast) u t)) \to (land (arity g c0 u (asucc g a0)) (arity g c0 t +a0))))).(\lambda (H5: (eq T (THead (Flat Cast) u0 t0) (THead (Flat Cast) u +t))).(let H6 \def (f_equal T T (\lambda (e: T).(match e in T return (\lambda +(_: T).T) with [(TSort _) \Rightarrow u0 | (TLRef _) \Rightarrow u0 | (THead +_ t1 _) \Rightarrow t1])) (THead (Flat Cast) u0 t0) (THead (Flat Cast) u t) +H5) in ((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 _ _ t1) \Rightarrow t1])) (THead (Flat Cast) u0 t0) (THead (Flat +Cast) u t) H5) in (\lambda (H8: (eq T u0 u)).(let H9 \def (eq_ind T t0 +(\lambda (t1: T).((eq T t1 (THead (Flat Cast) u t)) \to (land (arity g c0 u +(asucc g a0)) (arity g c0 t a0)))) H4 t H7) in (let H10 \def (eq_ind T t0 +(\lambda (t1: T).(arity g c0 t1 a0)) H3 t H7) in (let H11 \def (eq_ind T u0 +(\lambda (t1: T).((eq T t1 (THead (Flat Cast) u t)) \to (land (arity g c0 u +(asucc g (asucc g a0))) (arity g c0 t (asucc g a0))))) H2 u H8) in (let H12 +\def (eq_ind T u0 (\lambda (t1: T).(arity g c0 t1 (asucc g a0))) H1 u H8) in +(conj (arity g c0 u (asucc g a0)) (arity g c0 t a0) H12 H10))))))) +H6))))))))))) (\lambda (c0: C).(\lambda (t0: T).(\lambda (a1: A).(\lambda +(H1: (arity g c0 t0 a1)).(\lambda (H2: (((eq T t0 (THead (Flat Cast) u t)) +\to (land (arity g c0 u (asucc g a1)) (arity g c0 t a1))))).(\lambda (a2: +A).(\lambda (H3: (leq g a1 a2)).(\lambda (H4: (eq T t0 (THead (Flat Cast) u +t))).(let H5 \def (f_equal T T (\lambda (e: T).e) t0 (THead (Flat Cast) u t) +H4) in (let H6 \def (eq_ind T t0 (\lambda (t1: T).((eq T t1 (THead (Flat +Cast) u t)) \to (land (arity g c0 u (asucc g a1)) (arity g c0 t a1)))) H2 +(THead (Flat Cast) u t) H5) in (let H7 \def (eq_ind T t0 (\lambda (t1: +T).(arity g c0 t1 a1)) H1 (THead (Flat Cast) u t) H5) in (let H8 \def (H6 +(refl_equal T (THead (Flat Cast) u t))) in (and_ind (arity g c0 u (asucc g +a1)) (arity g c0 t a1) (land (arity g c0 u (asucc g a2)) (arity g c0 t a2)) +(\lambda (H9: (arity g c0 u (asucc g a1))).(\lambda (H10: (arity g c0 t +a1)).(conj (arity g c0 u (asucc g a2)) (arity g c0 t a2) (arity_repl g c0 u +(asucc g a1) H9 (asucc g a2) (asucc_repl g a1 a2 H3)) (arity_repl g c0 t a1 +H10 a2 H3)))) H8))))))))))))) c y a H0))) H)))))). + +theorem arity_gen_appls: + \forall (g: G).(\forall (c: C).(\forall (t: T).(\forall (vs: TList).(\forall +(a2: A).((arity g c (THeads (Flat Appl) vs t) a2) \to (ex A (\lambda (a: +A).(arity g c t a)))))))) +\def + \lambda (g: G).(\lambda (c: C).(\lambda (t: T).(\lambda (vs: +TList).(TList_ind (\lambda (t0: TList).(\forall (a2: A).((arity g c (THeads +(Flat Appl) t0 t) a2) \to (ex A (\lambda (a: A).(arity g c t a)))))) (\lambda +(a2: A).(\lambda (H: (arity g c t a2)).(ex_intro A (\lambda (a: A).(arity g c +t a)) a2 H))) (\lambda (t0: T).(\lambda (t1: TList).(\lambda (H: ((\forall +(a2: A).((arity g c (THeads (Flat Appl) t1 t) a2) \to (ex A (\lambda (a: +A).(arity g c t a))))))).(\lambda (a2: A).(\lambda (H0: (arity g c (THead +(Flat Appl) t0 (THeads (Flat Appl) t1 t)) a2)).(let H1 \def (arity_gen_appl g +c t0 (THeads (Flat Appl) t1 t) a2 H0) in (ex2_ind A (\lambda (a1: A).(arity g +c t0 a1)) (\lambda (a1: A).(arity g c (THeads (Flat Appl) t1 t) (AHead a1 +a2))) (ex A (\lambda (a: A).(arity g c t a))) (\lambda (x: A).(\lambda (_: +(arity g c t0 x)).(\lambda (H3: (arity g c (THeads (Flat Appl) t1 t) (AHead x +a2))).(let H_x \def (H (AHead x a2) H3) in (let H4 \def H_x in (ex_ind A +(\lambda (a: A).(arity g c t a)) (ex A (\lambda (a: A).(arity g c t a))) +(\lambda (x0: A).(\lambda (H5: (arity g c t x0)).(ex_intro A (\lambda (a: +A).(arity g c t a)) x0 H5))) H4)))))) H1))))))) vs)))). + +theorem arity_gen_lift: + \forall (g: G).(\forall (c1: C).(\forall (t: T).(\forall (a: A).(\forall (h: +nat).(\forall (d: nat).((arity g c1 (lift h d t) a) \to (\forall (c2: +C).((drop h d c1 c2) \to (arity g c2 t a))))))))) +\def + \lambda (g: G).(\lambda (c1: C).(\lambda (t: T).(\lambda (a: A).(\lambda (h: +nat).(\lambda (d: nat).(\lambda (H: (arity g c1 (lift h d t) a)).(insert_eq T +(lift h d t) (\lambda (t0: T).(arity g c1 t0 a)) (\forall (c2: C).((drop h d +c1 c2) \to (arity g c2 t a))) (\lambda (y: T).(\lambda (H0: (arity g c1 y +a)).(unintro T t (\lambda (t0: T).((eq T y (lift h d t0)) \to (\forall (c2: +C).((drop h d c1 c2) \to (arity g c2 t0 a))))) (unintro nat d (\lambda (n: +nat).(\forall (x: T).((eq T y (lift h n x)) \to (\forall (c2: C).((drop h n +c1 c2) \to (arity g c2 x a)))))) (arity_ind g (\lambda (c: C).(\lambda (t0: +T).(\lambda (a0: A).(\forall (x: nat).(\forall (x0: T).((eq T t0 (lift h x +x0)) \to (\forall (c2: C).((drop h x c c2) \to (arity g c2 x0 a0))))))))) +(\lambda (c: C).(\lambda (n: nat).(\lambda (x: nat).(\lambda (x0: T).(\lambda +(H1: (eq T (TSort n) (lift h x x0))).(\lambda (c2: C).(\lambda (_: (drop h x +c c2)).(eq_ind_r T (TSort n) (\lambda (t0: T).(arity g c2 t0 (ASort O n))) +(arity_sort g c2 n) x0 (lift_gen_sort h x n x0 H1))))))))) (\lambda (c: +C).(\lambda (d0: C).(\lambda (u: T).(\lambda (i: nat).(\lambda (H1: (getl i c +(CHead d0 (Bind Abbr) u))).(\lambda (a0: A).(\lambda (H2: (arity g d0 u +a0)).(\lambda (H3: ((\forall (x: nat).(\forall (x0: T).((eq T u (lift h x +x0)) \to (\forall (c2: C).((drop h x d0 c2) \to (arity g c2 x0 +a0)))))))).(\lambda (x: nat).(\lambda (x0: T).(\lambda (H4: (eq T (TLRef i) +(lift h x x0))).(\lambda (c2: C).(\lambda (H5: (drop h x c c2)).(let H_x \def +(lift_gen_lref x0 x h i H4) in (let H6 \def H_x in (or_ind (land (lt i x) (eq +T x0 (TLRef i))) (land (le (plus x h) i) (eq T x0 (TLRef (minus i h)))) +(arity g c2 x0 a0) (\lambda (H7: (land (lt i x) (eq T x0 (TLRef +i)))).(and_ind (lt i x) (eq T x0 (TLRef i)) (arity g c2 x0 a0) (\lambda (H8: +(lt i x)).(\lambda (H9: (eq T x0 (TLRef i))).(eq_ind_r T (TLRef i) (\lambda +(t0: T).(arity g c2 t0 a0)) (let H10 \def (eq_ind nat x (\lambda (n: +nat).(drop h n c c2)) H5 (S (plus i (minus x (S i)))) (lt_plus_minus i x H8)) +in (ex3_2_ind T C (\lambda (v: T).(\lambda (_: C).(eq T u (lift h (minus x (S +i)) v)))) (\lambda (v: T).(\lambda (e0: C).(getl i c2 (CHead e0 (Bind Abbr) +v)))) (\lambda (_: T).(\lambda (e0: C).(drop h (minus x (S i)) d0 e0))) +(arity g c2 (TLRef i) a0) (\lambda (x1: T).(\lambda (x2: C).(\lambda (H11: +(eq T u (lift h (minus x (S i)) x1))).(\lambda (H12: (getl i c2 (CHead x2 +(Bind Abbr) x1))).(\lambda (H13: (drop h (minus x (S i)) d0 x2)).(let H14 +\def (eq_ind T u (\lambda (t0: T).(\forall (x3: nat).(\forall (x4: T).((eq T +t0 (lift h x3 x4)) \to (\forall (c3: C).((drop h x3 d0 c3) \to (arity g c3 x4 +a0))))))) H3 (lift h (minus x (S i)) x1) H11) in (let H15 \def (eq_ind T u +(\lambda (t0: T).(arity g d0 t0 a0)) H2 (lift h (minus x (S i)) x1) H11) in +(arity_abbr g c2 x2 x1 i H12 a0 (H14 (minus x (S i)) x1 (refl_equal T (lift h +(minus x (S i)) x1)) x2 H13))))))))) (getl_drop_conf_lt Abbr c d0 u i H1 c2 h +(minus x (S i)) H10))) x0 H9))) H7)) (\lambda (H7: (land (le (plus x h) i) +(eq T x0 (TLRef (minus i h))))).(and_ind (le (plus x h) i) (eq T x0 (TLRef +(minus i h))) (arity g c2 x0 a0) (\lambda (H8: (le (plus x h) i)).(\lambda +(H9: (eq T x0 (TLRef (minus i h)))).(eq_ind_r T (TLRef (minus i h)) (\lambda +(t0: T).(arity g c2 t0 a0)) (arity_abbr g c2 d0 u (minus i h) +(getl_drop_conf_ge i (CHead d0 (Bind Abbr) u) c H1 c2 h x H5 H8) a0 H2) x0 +H9))) H7)) H6)))))))))))))))) (\lambda (c: C).(\lambda (d0: C).(\lambda (u: +T).(\lambda (i: nat).(\lambda (H1: (getl i c (CHead d0 (Bind Abst) +u))).(\lambda (a0: A).(\lambda (H2: (arity g d0 u (asucc g a0))).(\lambda +(H3: ((\forall (x: nat).(\forall (x0: T).((eq T u (lift h x x0)) \to (\forall +(c2: C).((drop h x d0 c2) \to (arity g c2 x0 (asucc g a0))))))))).(\lambda +(x: nat).(\lambda (x0: T).(\lambda (H4: (eq T (TLRef i) (lift h x +x0))).(\lambda (c2: C).(\lambda (H5: (drop h x c c2)).(let H_x \def +(lift_gen_lref x0 x h i H4) in (let H6 \def H_x in (or_ind (land (lt i x) (eq +T x0 (TLRef i))) (land (le (plus x h) i) (eq T x0 (TLRef (minus i h)))) +(arity g c2 x0 a0) (\lambda (H7: (land (lt i x) (eq T x0 (TLRef +i)))).(and_ind (lt i x) (eq T x0 (TLRef i)) (arity g c2 x0 a0) (\lambda (H8: +(lt i x)).(\lambda (H9: (eq T x0 (TLRef i))).(eq_ind_r T (TLRef i) (\lambda +(t0: T).(arity g c2 t0 a0)) (let H10 \def (eq_ind nat x (\lambda (n: +nat).(drop h n c c2)) H5 (S (plus i (minus x (S i)))) (lt_plus_minus i x H8)) +in (ex3_2_ind T C (\lambda (v: T).(\lambda (_: C).(eq T u (lift h (minus x (S +i)) v)))) (\lambda (v: T).(\lambda (e0: C).(getl i c2 (CHead e0 (Bind Abst) +v)))) (\lambda (_: T).(\lambda (e0: C).(drop h (minus x (S i)) d0 e0))) +(arity g c2 (TLRef i) a0) (\lambda (x1: T).(\lambda (x2: C).(\lambda (H11: +(eq T u (lift h (minus x (S i)) x1))).(\lambda (H12: (getl i c2 (CHead x2 +(Bind Abst) x1))).(\lambda (H13: (drop h (minus x (S i)) d0 x2)).(let H14 +\def (eq_ind T u (\lambda (t0: T).(\forall (x3: nat).(\forall (x4: T).((eq T +t0 (lift h x3 x4)) \to (\forall (c3: C).((drop h x3 d0 c3) \to (arity g c3 x4 +(asucc g a0)))))))) H3 (lift h (minus x (S i)) x1) H11) in (let H15 \def +(eq_ind T u (\lambda (t0: T).(arity g d0 t0 (asucc g a0))) H2 (lift h (minus +x (S i)) x1) H11) in (arity_abst g c2 x2 x1 i H12 a0 (H14 (minus x (S i)) x1 +(refl_equal T (lift h (minus x (S i)) x1)) x2 H13))))))))) (getl_drop_conf_lt +Abst c d0 u i H1 c2 h (minus x (S i)) H10))) x0 H9))) H7)) (\lambda (H7: +(land (le (plus x h) i) (eq T x0 (TLRef (minus i h))))).(and_ind (le (plus x +h) i) (eq T x0 (TLRef (minus i h))) (arity g c2 x0 a0) (\lambda (H8: (le +(plus x h) i)).(\lambda (H9: (eq T x0 (TLRef (minus i h)))).(eq_ind_r T +(TLRef (minus i h)) (\lambda (t0: T).(arity g c2 t0 a0)) (arity_abst g c2 d0 +u (minus i h) (getl_drop_conf_ge i (CHead d0 (Bind Abst) u) c H1 c2 h x H5 +H8) a0 H2) x0 H9))) H7)) H6)))))))))))))))) (\lambda (b: B).(\lambda (H1: +(not (eq B b Abst))).(\lambda (c: C).(\lambda (u: T).(\lambda (a1: +A).(\lambda (H2: (arity g c u a1)).(\lambda (H3: ((\forall (x: nat).(\forall +(x0: T).((eq T u (lift h x x0)) \to (\forall (c2: C).((drop h x c c2) \to +(arity g c2 x0 a1)))))))).(\lambda (t0: T).(\lambda (a2: A).(\lambda (H4: +(arity g (CHead c (Bind b) u) t0 a2)).(\lambda (H5: ((\forall (x: +nat).(\forall (x0: T).((eq T t0 (lift h x x0)) \to (\forall (c2: C).((drop h +x (CHead c (Bind b) u) c2) \to (arity g c2 x0 a2)))))))).(\lambda (x: +nat).(\lambda (x0: T).(\lambda (H6: (eq T (THead (Bind b) u t0) (lift h x +x0))).(\lambda (c2: C).(\lambda (H7: (drop h x c c2)).(ex3_2_ind T T (\lambda +(y0: T).(\lambda (z: T).(eq T x0 (THead (Bind b) y0 z)))) (\lambda (y0: +T).(\lambda (_: T).(eq T u (lift h x y0)))) (\lambda (_: T).(\lambda (z: +T).(eq T t0 (lift h (S x) z)))) (arity g c2 x0 a2) (\lambda (x1: T).(\lambda +(x2: T).(\lambda (H8: (eq T x0 (THead (Bind b) x1 x2))).(\lambda (H9: (eq T u +(lift h x x1))).(\lambda (H10: (eq T t0 (lift h (S x) x2))).(eq_ind_r T +(THead (Bind b) x1 x2) (\lambda (t1: T).(arity g c2 t1 a2)) (let H11 \def +(eq_ind T t0 (\lambda (t1: T).(\forall (x3: nat).(\forall (x4: T).((eq T t1 +(lift h x3 x4)) \to (\forall (c3: C).((drop h x3 (CHead c (Bind b) u) c3) \to +(arity g c3 x4 a2))))))) H5 (lift h (S x) x2) H10) in (let H12 \def (eq_ind T +t0 (\lambda (t1: T).(arity g (CHead c (Bind b) u) t1 a2)) H4 (lift h (S x) +x2) H10) in (let H13 \def (eq_ind T u (\lambda (t1: T).(arity g (CHead c +(Bind b) t1) (lift h (S x) x2) a2)) H12 (lift h x x1) H9) in (let H14 \def +(eq_ind T u (\lambda (t1: T).(\forall (x3: nat).(\forall (x4: T).((eq T (lift +h (S x) x2) (lift h x3 x4)) \to (\forall (c3: C).((drop h x3 (CHead c (Bind +b) t1) c3) \to (arity g c3 x4 a2))))))) H11 (lift h x x1) H9) in (let H15 +\def (eq_ind T u (\lambda (t1: T).(\forall (x3: nat).(\forall (x4: T).((eq T +t1 (lift h x3 x4)) \to (\forall (c3: C).((drop h x3 c c3) \to (arity g c3 x4 +a1))))))) H3 (lift h x x1) H9) in (let H16 \def (eq_ind T u (\lambda (t1: +T).(arity g c t1 a1)) H2 (lift h x x1) H9) in (arity_bind g b H1 c2 x1 a1 +(H15 x x1 (refl_equal T (lift h x x1)) c2 H7) x2 a2 (H14 (S x) x2 (refl_equal +T (lift h (S x) x2)) (CHead c2 (Bind b) x1) (drop_skip_bind h x c c2 H7 b +x1))))))))) x0 H8)))))) (lift_gen_bind b u t0 x0 h x H6)))))))))))))))))) +(\lambda (c: C).(\lambda (u: T).(\lambda (a1: A).(\lambda (H1: (arity g c u +(asucc g a1))).(\lambda (H2: ((\forall (x: nat).(\forall (x0: T).((eq T u +(lift h x x0)) \to (\forall (c2: C).((drop h x c c2) \to (arity g c2 x0 +(asucc g a1))))))))).(\lambda (t0: T).(\lambda (a2: A).(\lambda (H3: (arity g +(CHead c (Bind Abst) u) t0 a2)).(\lambda (H4: ((\forall (x: nat).(\forall +(x0: T).((eq T t0 (lift h x x0)) \to (\forall (c2: C).((drop h x (CHead c +(Bind Abst) u) c2) \to (arity g c2 x0 a2)))))))).(\lambda (x: nat).(\lambda +(x0: T).(\lambda (H5: (eq T (THead (Bind Abst) u t0) (lift h x x0))).(\lambda +(c2: C).(\lambda (H6: (drop h x c c2)).(ex3_2_ind T T (\lambda (y0: +T).(\lambda (z: T).(eq T x0 (THead (Bind Abst) y0 z)))) (\lambda (y0: +T).(\lambda (_: T).(eq T u (lift h x y0)))) (\lambda (_: T).(\lambda (z: +T).(eq T t0 (lift h (S x) z)))) (arity g c2 x0 (AHead a1 a2)) (\lambda (x1: +T).(\lambda (x2: T).(\lambda (H7: (eq T x0 (THead (Bind Abst) x1 +x2))).(\lambda (H8: (eq T u (lift h x x1))).(\lambda (H9: (eq T t0 (lift h (S +x) x2))).(eq_ind_r T (THead (Bind Abst) x1 x2) (\lambda (t1: T).(arity g c2 +t1 (AHead a1 a2))) (let H10 \def (eq_ind T t0 (\lambda (t1: T).(\forall (x3: +nat).(\forall (x4: T).((eq T t1 (lift h x3 x4)) \to (\forall (c3: C).((drop h +x3 (CHead c (Bind Abst) u) c3) \to (arity g c3 x4 a2))))))) H4 (lift h (S x) +x2) H9) in (let H11 \def (eq_ind T t0 (\lambda (t1: T).(arity g (CHead c +(Bind Abst) u) t1 a2)) H3 (lift h (S x) x2) H9) in (let H12 \def (eq_ind T u +(\lambda (t1: T).(arity g (CHead c (Bind Abst) t1) (lift h (S x) x2) a2)) H11 +(lift h x x1) H8) in (let H13 \def (eq_ind T u (\lambda (t1: T).(\forall (x3: +nat).(\forall (x4: T).((eq T (lift h (S x) x2) (lift h x3 x4)) \to (\forall +(c3: C).((drop h x3 (CHead c (Bind Abst) t1) c3) \to (arity g c3 x4 a2))))))) +H10 (lift h x x1) H8) in (let H14 \def (eq_ind T u (\lambda (t1: T).(\forall +(x3: nat).(\forall (x4: T).((eq T t1 (lift h x3 x4)) \to (\forall (c3: +C).((drop h x3 c c3) \to (arity g c3 x4 (asucc g a1)))))))) H2 (lift h x x1) +H8) in (let H15 \def (eq_ind T u (\lambda (t1: T).(arity g c t1 (asucc g +a1))) H1 (lift h x x1) H8) in (arity_head g c2 x1 a1 (H14 x x1 (refl_equal T +(lift h x x1)) c2 H6) x2 a2 (H13 (S x) x2 (refl_equal T (lift h (S x) x2)) +(CHead c2 (Bind Abst) x1) (drop_skip_bind h x c c2 H6 Abst x1))))))))) x0 +H7)))))) (lift_gen_bind Abst u t0 x0 h x H5)))))))))))))))) (\lambda (c: +C).(\lambda (u: T).(\lambda (a1: A).(\lambda (H1: (arity g c u a1)).(\lambda +(H2: ((\forall (x: nat).(\forall (x0: T).((eq T u (lift h x x0)) \to (\forall +(c2: C).((drop h x c c2) \to (arity g c2 x0 a1)))))))).(\lambda (t0: +T).(\lambda (a2: A).(\lambda (H3: (arity g c t0 (AHead a1 a2))).(\lambda (H4: +((\forall (x: nat).(\forall (x0: T).((eq T t0 (lift h x x0)) \to (\forall +(c2: C).((drop h x c c2) \to (arity g c2 x0 (AHead a1 a2))))))))).(\lambda +(x: nat).(\lambda (x0: T).(\lambda (H5: (eq T (THead (Flat Appl) u t0) (lift +h x x0))).(\lambda (c2: C).(\lambda (H6: (drop h x c c2)).(ex3_2_ind T T +(\lambda (y0: T).(\lambda (z: T).(eq T x0 (THead (Flat Appl) y0 z)))) +(\lambda (y0: T).(\lambda (_: T).(eq T u (lift h x y0)))) (\lambda (_: +T).(\lambda (z: T).(eq T t0 (lift h x z)))) (arity g c2 x0 a2) (\lambda (x1: +T).(\lambda (x2: T).(\lambda (H7: (eq T x0 (THead (Flat Appl) x1 +x2))).(\lambda (H8: (eq T u (lift h x x1))).(\lambda (H9: (eq T t0 (lift h x +x2))).(eq_ind_r T (THead (Flat Appl) x1 x2) (\lambda (t1: T).(arity g c2 t1 +a2)) (let H10 \def (eq_ind T t0 (\lambda (t1: T).(\forall (x3: nat).(\forall +(x4: T).((eq T t1 (lift h x3 x4)) \to (\forall (c3: C).((drop h x3 c c3) \to +(arity g c3 x4 (AHead a1 a2)))))))) H4 (lift h x x2) H9) in (let H11 \def +(eq_ind T t0 (\lambda (t1: T).(arity g c t1 (AHead a1 a2))) H3 (lift h x x2) +H9) in (let H12 \def (eq_ind T u (\lambda (t1: T).(\forall (x3: nat).(\forall +(x4: T).((eq T t1 (lift h x3 x4)) \to (\forall (c3: C).((drop h x3 c c3) \to +(arity g c3 x4 a1))))))) H2 (lift h x x1) H8) in (let H13 \def (eq_ind T u +(\lambda (t1: T).(arity g c t1 a1)) H1 (lift h x x1) H8) in (arity_appl g c2 +x1 a1 (H12 x x1 (refl_equal T (lift h x x1)) c2 H6) x2 a2 (H10 x x2 +(refl_equal T (lift h x x2)) c2 H6)))))) x0 H7)))))) (lift_gen_flat Appl u t0 +x0 h x H5)))))))))))))))) (\lambda (c: C).(\lambda (u: T).(\lambda (a0: +A).(\lambda (H1: (arity g c u (asucc g a0))).(\lambda (H2: ((\forall (x: +nat).(\forall (x0: T).((eq T u (lift h x x0)) \to (\forall (c2: C).((drop h x +c c2) \to (arity g c2 x0 (asucc g a0))))))))).(\lambda (t0: T).(\lambda (H3: +(arity g c t0 a0)).(\lambda (H4: ((\forall (x: nat).(\forall (x0: T).((eq T +t0 (lift h x x0)) \to (\forall (c2: C).((drop h x c c2) \to (arity g c2 x0 +a0)))))))).(\lambda (x: nat).(\lambda (x0: T).(\lambda (H5: (eq T (THead +(Flat Cast) u t0) (lift h x x0))).(\lambda (c2: C).(\lambda (H6: (drop h x c +c2)).(ex3_2_ind T T (\lambda (y0: T).(\lambda (z: T).(eq T x0 (THead (Flat +Cast) y0 z)))) (\lambda (y0: T).(\lambda (_: T).(eq T u (lift h x y0)))) +(\lambda (_: T).(\lambda (z: T).(eq T t0 (lift h x z)))) (arity g c2 x0 a0) +(\lambda (x1: T).(\lambda (x2: T).(\lambda (H7: (eq T x0 (THead (Flat Cast) +x1 x2))).(\lambda (H8: (eq T u (lift h x x1))).(\lambda (H9: (eq T t0 (lift h +x x2))).(eq_ind_r T (THead (Flat Cast) x1 x2) (\lambda (t1: T).(arity g c2 t1 +a0)) (let H10 \def (eq_ind T t0 (\lambda (t1: T).(\forall (x3: nat).(\forall +(x4: T).((eq T t1 (lift h x3 x4)) \to (\forall (c3: C).((drop h x3 c c3) \to +(arity g c3 x4 a0))))))) H4 (lift h x x2) H9) in (let H11 \def (eq_ind T t0 +(\lambda (t1: T).(arity g c t1 a0)) H3 (lift h x x2) H9) in (let H12 \def +(eq_ind T u (\lambda (t1: T).(\forall (x3: nat).(\forall (x4: T).((eq T t1 +(lift h x3 x4)) \to (\forall (c3: C).((drop h x3 c c3) \to (arity g c3 x4 +(asucc g a0)))))))) H2 (lift h x x1) H8) in (let H13 \def (eq_ind T u +(\lambda (t1: T).(arity g c t1 (asucc g a0))) H1 (lift h x x1) H8) in +(arity_cast g c2 x1 a0 (H12 x x1 (refl_equal T (lift h x x1)) c2 H6) x2 (H10 +x x2 (refl_equal T (lift h x x2)) c2 H6)))))) x0 H7)))))) (lift_gen_flat Cast +u t0 x0 h x H5))))))))))))))) (\lambda (c: C).(\lambda (t0: T).(\lambda (a1: +A).(\lambda (_: (arity g c t0 a1)).(\lambda (H2: ((\forall (x: nat).(\forall +(x0: T).((eq T t0 (lift h x x0)) \to (\forall (c2: C).((drop h x c c2) \to +(arity g c2 x0 a1)))))))).(\lambda (a2: A).(\lambda (H3: (leq g a1 +a2)).(\lambda (x: nat).(\lambda (x0: T).(\lambda (H4: (eq T t0 (lift h x +x0))).(\lambda (c2: C).(\lambda (H5: (drop h x c c2)).(arity_repl g c2 x0 a1 +(H2 x x0 H4 c2 H5) a2 H3))))))))))))) c1 y a H0))))) H))))))). + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/arity/lift1.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/arity/lift1.ma new file mode 100644 index 000000000..cad59b67d --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/arity/lift1.ma @@ -0,0 +1,88 @@ +(**************************************************************************) +(* ___ *) +(* ||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/arity/lift1". + +include "arity/props.ma". + +include "drop1/defs.ma". + +theorem arity_lift1: + \forall (g: G).(\forall (a: A).(\forall (c2: C).(\forall (hds: +PList).(\forall (c1: C).(\forall (t: T).((drop1 hds c1 c2) \to ((arity g c2 t +a) \to (arity g c1 (lift1 hds t) a)))))))) +\def + \lambda (g: G).(\lambda (a: A).(\lambda (c2: C).(\lambda (hds: +PList).(PList_ind (\lambda (p: PList).(\forall (c1: C).(\forall (t: +T).((drop1 p c1 c2) \to ((arity g c2 t a) \to (arity g c1 (lift1 p t) a)))))) +(\lambda (c1: C).(\lambda (t: T).(\lambda (H: (drop1 PNil c1 c2)).(\lambda +(H0: (arity g c2 t a)).(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 c1) \to ((eq C c0 c2) \to (arity g c1 t a)))))))) +with [(drop1_nil c) \Rightarrow (\lambda (_: (eq PList PNil PNil)).(\lambda +(H2: (eq C c c1)).(\lambda (H3: (eq C c c2)).(eq_ind C c1 (\lambda (c0: +C).((eq C c0 c2) \to (arity g c1 t a))) (\lambda (H4: (eq C c1 c2)).(eq_ind C +c2 (\lambda (c0: C).(arity g c0 t a)) H0 c1 (sym_eq C c1 c2 H4))) c (sym_eq C +c c1 H2) H3)))) | (drop1_cons c0 c3 h d H1 c4 hds0 H2) \Rightarrow (\lambda +(H3: (eq PList (PCons h d hds0) PNil)).(\lambda (H4: (eq C c0 c1)).(\lambda +(H5: (eq C c4 c2)).((let H6 \def (eq_ind PList (PCons h d hds0) (\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 c1) \to ((eq C c4 c2) \to ((drop h d c0 c3) \to ((drop1 +hds0 c3 c4) \to (arity g c1 t a))))) H6)) H4 H5 H1 H2))))]) in (H1 +(refl_equal PList PNil) (refl_equal C c1) (refl_equal C c2))))))) (\lambda +(n: nat).(\lambda (n0: nat).(\lambda (p: PList).(\lambda (H: ((\forall (c1: +C).(\forall (t: T).((drop1 p c1 c2) \to ((arity g c2 t a) \to (arity g c1 +(lift1 p t) a))))))).(\lambda (c1: C).(\lambda (t: T).(\lambda (H0: (drop1 +(PCons n n0 p) c1 c2)).(\lambda (H1: (arity g c2 t a)).(let H2 \def (match H0 +in drop1 return (\lambda (p0: PList).(\lambda (c: C).(\lambda (c0: +C).(\lambda (_: (drop1 p0 c c0)).((eq PList p0 (PCons n n0 p)) \to ((eq C c +c1) \to ((eq C c0 c2) \to (arity g c1 (lift n n0 (lift1 p t)) a)))))))) with +[(drop1_nil c) \Rightarrow (\lambda (H2: (eq PList PNil (PCons n n0 +p))).(\lambda (H3: (eq C c c1)).(\lambda (H4: (eq C c c2)).((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 n n0 p) H2) in (False_ind ((eq C c c1) \to ((eq C c c2) \to (arity g +c1 (lift n n0 (lift1 p t)) a))) H5)) H3 H4)))) | (drop1_cons c0 c3 h d H2 c4 +hds0 H3) \Rightarrow (\lambda (H4: (eq PList (PCons h d hds0) (PCons n n0 +p))).(\lambda (H5: (eq C c0 c1)).(\lambda (H6: (eq C c4 c2)).((let H7 \def +(f_equal PList PList (\lambda (e: PList).(match e in PList return (\lambda +(_: PList).PList) with [PNil \Rightarrow hds0 | (PCons _ _ p0) \Rightarrow +p0])) (PCons h d hds0) (PCons n n0 p) H4) in ((let H8 \def (f_equal PList nat +(\lambda (e: PList).(match e in PList return (\lambda (_: PList).nat) with +[PNil \Rightarrow d | (PCons _ n1 _) \Rightarrow n1])) (PCons h d hds0) +(PCons n n0 p) H4) in ((let H9 \def (f_equal PList nat (\lambda (e: +PList).(match e in PList return (\lambda (_: PList).nat) with [PNil +\Rightarrow h | (PCons n1 _ _) \Rightarrow n1])) (PCons h d hds0) (PCons n n0 +p) H4) in (eq_ind nat n (\lambda (n1: nat).((eq nat d n0) \to ((eq PList hds0 +p) \to ((eq C c0 c1) \to ((eq C c4 c2) \to ((drop n1 d c0 c3) \to ((drop1 +hds0 c3 c4) \to (arity g c1 (lift n n0 (lift1 p t)) a)))))))) (\lambda (H10: +(eq nat d n0)).(eq_ind nat n0 (\lambda (n1: nat).((eq PList hds0 p) \to ((eq +C c0 c1) \to ((eq C c4 c2) \to ((drop n n1 c0 c3) \to ((drop1 hds0 c3 c4) \to +(arity g c1 (lift n n0 (lift1 p t)) a))))))) (\lambda (H11: (eq PList hds0 +p)).(eq_ind PList p (\lambda (p0: PList).((eq C c0 c1) \to ((eq C c4 c2) \to +((drop n n0 c0 c3) \to ((drop1 p0 c3 c4) \to (arity g c1 (lift n n0 (lift1 p +t)) a)))))) (\lambda (H12: (eq C c0 c1)).(eq_ind C c1 (\lambda (c: C).((eq C +c4 c2) \to ((drop n n0 c c3) \to ((drop1 p c3 c4) \to (arity g c1 (lift n n0 +(lift1 p t)) a))))) (\lambda (H13: (eq C c4 c2)).(eq_ind C c2 (\lambda (c: +C).((drop n n0 c1 c3) \to ((drop1 p c3 c) \to (arity g c1 (lift n n0 (lift1 p +t)) a)))) (\lambda (H14: (drop n n0 c1 c3)).(\lambda (H15: (drop1 p c3 +c2)).(arity_lift g c3 (lift1 p t) a (H c3 t H15 H1) c1 n n0 H14))) c4 (sym_eq +C c4 c2 H13))) c0 (sym_eq C c0 c1 H12))) hds0 (sym_eq PList hds0 p H11))) d +(sym_eq nat d n0 H10))) h (sym_eq nat h n H9))) H8)) H7)) H5 H6 H2 H3))))]) +in (H2 (refl_equal PList (PCons n n0 p)) (refl_equal C c1) (refl_equal C +c2))))))))))) hds)))). + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/arity/props.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/arity/props.ma new file mode 100644 index 000000000..7ce027561 --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/arity/props.ma @@ -0,0 +1,395 @@ +(**************************************************************************) +(* ___ *) +(* ||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/arity/props". + +include "arity/fwd.ma". + +theorem node_inh: + \forall (g: G).(\forall (n: nat).(\forall (k: nat).(ex_2 C T (\lambda (c: +C).(\lambda (t: T).(arity g c t (ASort k n))))))) +\def + \lambda (g: G).(\lambda (n: nat).(\lambda (k: nat).(nat_ind (\lambda (n0: +nat).(ex_2 C T (\lambda (c: C).(\lambda (t: T).(arity g c t (ASort n0 n)))))) +(ex_2_intro C T (\lambda (c: C).(\lambda (t: T).(arity g c t (ASort O n)))) +(CSort O) (TSort n) (arity_sort g (CSort O) n)) (\lambda (n0: nat).(\lambda +(H: (ex_2 C T (\lambda (c: C).(\lambda (t: T).(arity g c t (ASort n0 +n)))))).(let H0 \def H in (ex_2_ind C T (\lambda (c: C).(\lambda (t: +T).(arity g c t (ASort n0 n)))) (ex_2 C T (\lambda (c: C).(\lambda (t: +T).(arity g c t (ASort (S n0) n))))) (\lambda (x0: C).(\lambda (x1: +T).(\lambda (H1: (arity g x0 x1 (ASort n0 n))).(ex_2_intro C T (\lambda (c: +C).(\lambda (t: T).(arity g c t (ASort (S n0) n)))) (CHead x0 (Bind Abst) x1) +(TLRef O) (arity_abst g (CHead x0 (Bind Abst) x1) x0 x1 O (getl_refl Abst x0 +x1) (ASort (S n0) n) H1))))) H0)))) k))). + +theorem arity_lift: + \forall (g: G).(\forall (c2: C).(\forall (t: T).(\forall (a: A).((arity g c2 +t a) \to (\forall (c1: C).(\forall (h: nat).(\forall (d: nat).((drop h d c1 +c2) \to (arity g c1 (lift h d t) a))))))))) +\def + \lambda (g: G).(\lambda (c2: C).(\lambda (t: T).(\lambda (a: A).(\lambda (H: +(arity g c2 t a)).(arity_ind g (\lambda (c: C).(\lambda (t0: T).(\lambda (a0: +A).(\forall (c1: C).(\forall (h: nat).(\forall (d: nat).((drop h d c1 c) \to +(arity g c1 (lift h d t0) a0)))))))) (\lambda (c: C).(\lambda (n: +nat).(\lambda (c1: C).(\lambda (h: nat).(\lambda (d: nat).(\lambda (_: (drop +h d c1 c)).(eq_ind_r T (TSort n) (\lambda (t0: T).(arity g c1 t0 (ASort O +n))) (arity_sort g c1 n) (lift h d (TSort n)) (lift_sort n h d)))))))) +(\lambda (c: C).(\lambda (d: C).(\lambda (u: T).(\lambda (i: nat).(\lambda +(H0: (getl i c (CHead d (Bind Abbr) u))).(\lambda (a0: A).(\lambda (H1: +(arity g d u a0)).(\lambda (H2: ((\forall (c1: C).(\forall (h: nat).(\forall +(d0: nat).((drop h d0 c1 d) \to (arity g c1 (lift h d0 u) a0))))))).(\lambda +(c1: C).(\lambda (h: nat).(\lambda (d0: nat).(\lambda (H3: (drop h d0 c1 +c)).(lt_le_e i d0 (arity g c1 (lift h d0 (TLRef i)) a0) (\lambda (H4: (lt i +d0)).(eq_ind_r T (TLRef i) (\lambda (t0: T).(arity g c1 t0 a0)) (let H5 \def +(drop_getl_trans_le i d0 (le_S_n i d0 (le_S (S i) d0 H4)) c1 c h H3 (CHead d +(Bind Abbr) u) H0) in (ex3_2_ind C C (\lambda (e0: C).(\lambda (_: C).(drop i +O c1 e0))) (\lambda (e0: C).(\lambda (e1: C).(drop h (minus d0 i) e0 e1))) +(\lambda (_: C).(\lambda (e1: C).(clear e1 (CHead d (Bind Abbr) u)))) (arity +g c1 (TLRef i) a0) (\lambda (x0: C).(\lambda (x1: C).(\lambda (H6: (drop i O +c1 x0)).(\lambda (H7: (drop h (minus d0 i) x0 x1)).(\lambda (H8: (clear x1 +(CHead d (Bind Abbr) u))).(let H9 \def (eq_ind nat (minus d0 i) (\lambda (n: +nat).(drop h n x0 x1)) H7 (S (minus d0 (S i))) (minus_x_Sy d0 i H4)) in (let +H10 \def (drop_clear_S x1 x0 h (minus d0 (S i)) H9 Abbr d u H8) in (ex2_ind C +(\lambda (c3: C).(clear x0 (CHead c3 (Bind Abbr) (lift h (minus d0 (S i)) +u)))) (\lambda (c3: C).(drop h (minus d0 (S i)) c3 d)) (arity g c1 (TLRef i) +a0) (\lambda (x: C).(\lambda (H11: (clear x0 (CHead x (Bind Abbr) (lift h +(minus d0 (S i)) u)))).(\lambda (H12: (drop h (minus d0 (S i)) x +d)).(arity_abbr g c1 x (lift h (minus d0 (S i)) u) i (getl_intro i c1 (CHead +x (Bind Abbr) (lift h (minus d0 (S i)) u)) x0 H6 H11) a0 (H2 x h (minus d0 (S +i)) H12))))) H10)))))))) H5)) (lift h d0 (TLRef i)) (lift_lref_lt i h d0 +H4))) (\lambda (H4: (le d0 i)).(eq_ind_r T (TLRef (plus i h)) (\lambda (t0: +T).(arity g c1 t0 a0)) (arity_abbr g c1 d u (plus i h) (drop_getl_trans_ge i +c1 c d0 h H3 (CHead d (Bind Abbr) u) H0 H4) a0 H1) (lift h d0 (TLRef i)) +(lift_lref_ge i h d0 H4)))))))))))))))) (\lambda (c: C).(\lambda (d: +C).(\lambda (u: T).(\lambda (i: nat).(\lambda (H0: (getl i c (CHead d (Bind +Abst) u))).(\lambda (a0: A).(\lambda (H1: (arity g d u (asucc g +a0))).(\lambda (H2: ((\forall (c1: C).(\forall (h: nat).(\forall (d0: +nat).((drop h d0 c1 d) \to (arity g c1 (lift h d0 u) (asucc g +a0)))))))).(\lambda (c1: C).(\lambda (h: nat).(\lambda (d0: nat).(\lambda +(H3: (drop h d0 c1 c)).(lt_le_e i d0 (arity g c1 (lift h d0 (TLRef i)) a0) +(\lambda (H4: (lt i d0)).(eq_ind_r T (TLRef i) (\lambda (t0: T).(arity g c1 +t0 a0)) (let H5 \def (drop_getl_trans_le i d0 (le_S_n i d0 (le_S (S i) d0 +H4)) c1 c h H3 (CHead d (Bind Abst) u) H0) in (ex3_2_ind C C (\lambda (e0: +C).(\lambda (_: C).(drop i O c1 e0))) (\lambda (e0: C).(\lambda (e1: C).(drop +h (minus d0 i) e0 e1))) (\lambda (_: C).(\lambda (e1: C).(clear e1 (CHead d +(Bind Abst) u)))) (arity g c1 (TLRef i) a0) (\lambda (x0: C).(\lambda (x1: +C).(\lambda (H6: (drop i O c1 x0)).(\lambda (H7: (drop h (minus d0 i) x0 +x1)).(\lambda (H8: (clear x1 (CHead d (Bind Abst) u))).(let H9 \def (eq_ind +nat (minus d0 i) (\lambda (n: nat).(drop h n x0 x1)) H7 (S (minus d0 (S i))) +(minus_x_Sy d0 i H4)) in (let H10 \def (drop_clear_S x1 x0 h (minus d0 (S i)) +H9 Abst d u H8) in (ex2_ind C (\lambda (c3: C).(clear x0 (CHead c3 (Bind +Abst) (lift h (minus d0 (S i)) u)))) (\lambda (c3: C).(drop h (minus d0 (S +i)) c3 d)) (arity g c1 (TLRef i) a0) (\lambda (x: C).(\lambda (H11: (clear x0 +(CHead x (Bind Abst) (lift h (minus d0 (S i)) u)))).(\lambda (H12: (drop h +(minus d0 (S i)) x d)).(arity_abst g c1 x (lift h (minus d0 (S i)) u) i +(getl_intro i c1 (CHead x (Bind Abst) (lift h (minus d0 (S i)) u)) x0 H6 H11) +a0 (H2 x h (minus d0 (S i)) H12))))) H10)))))))) H5)) (lift h d0 (TLRef i)) +(lift_lref_lt i h d0 H4))) (\lambda (H4: (le d0 i)).(eq_ind_r T (TLRef (plus +i h)) (\lambda (t0: T).(arity g c1 t0 a0)) (arity_abst g c1 d u (plus i h) +(drop_getl_trans_ge i c1 c d0 h H3 (CHead d (Bind Abst) u) H0 H4) a0 H1) +(lift h d0 (TLRef i)) (lift_lref_ge i h d0 H4)))))))))))))))) (\lambda (b: +B).(\lambda (H0: (not (eq B b Abst))).(\lambda (c: C).(\lambda (u: +T).(\lambda (a1: A).(\lambda (_: (arity g c u a1)).(\lambda (H2: ((\forall +(c1: C).(\forall (h: nat).(\forall (d: nat).((drop h d c1 c) \to (arity g c1 +(lift h d u) a1))))))).(\lambda (t0: T).(\lambda (a2: A).(\lambda (_: (arity +g (CHead c (Bind b) u) t0 a2)).(\lambda (H4: ((\forall (c1: C).(\forall (h: +nat).(\forall (d: nat).((drop h d c1 (CHead c (Bind b) u)) \to (arity g c1 +(lift h d t0) a2))))))).(\lambda (c1: C).(\lambda (h: nat).(\lambda (d: +nat).(\lambda (H5: (drop h d c1 c)).(eq_ind_r T (THead (Bind b) (lift h d u) +(lift h (s (Bind b) d) t0)) (\lambda (t1: T).(arity g c1 t1 a2)) (arity_bind +g b H0 c1 (lift h d u) a1 (H2 c1 h d H5) (lift h (s (Bind b) d) t0) a2 (H4 +(CHead c1 (Bind b) (lift h d u)) h (s (Bind b) d) (drop_skip_bind h d c1 c H5 +b u))) (lift h d (THead (Bind b) u t0)) (lift_head (Bind b) u t0 h +d))))))))))))))))) (\lambda (c: C).(\lambda (u: T).(\lambda (a1: A).(\lambda +(_: (arity g c u (asucc g a1))).(\lambda (H1: ((\forall (c1: C).(\forall (h: +nat).(\forall (d: nat).((drop h d c1 c) \to (arity g c1 (lift h d u) (asucc g +a1)))))))).(\lambda (t0: T).(\lambda (a2: A).(\lambda (_: (arity g (CHead c +(Bind Abst) u) t0 a2)).(\lambda (H3: ((\forall (c1: C).(\forall (h: +nat).(\forall (d: nat).((drop h d c1 (CHead c (Bind Abst) u)) \to (arity g c1 +(lift h d t0) a2))))))).(\lambda (c1: C).(\lambda (h: nat).(\lambda (d: +nat).(\lambda (H4: (drop h d c1 c)).(eq_ind_r T (THead (Bind Abst) (lift h d +u) (lift h (s (Bind Abst) d) t0)) (\lambda (t1: T).(arity g c1 t1 (AHead a1 +a2))) (arity_head g c1 (lift h d u) a1 (H1 c1 h d H4) (lift h (s (Bind Abst) +d) t0) a2 (H3 (CHead c1 (Bind Abst) (lift h d u)) h (s (Bind Abst) d) +(drop_skip_bind h d c1 c H4 Abst u))) (lift h d (THead (Bind Abst) u t0)) +(lift_head (Bind Abst) u t0 h d))))))))))))))) (\lambda (c: C).(\lambda (u: +T).(\lambda (a1: A).(\lambda (_: (arity g c u a1)).(\lambda (H1: ((\forall +(c1: C).(\forall (h: nat).(\forall (d: nat).((drop h d c1 c) \to (arity g c1 +(lift h d u) a1))))))).(\lambda (t0: T).(\lambda (a2: A).(\lambda (_: (arity +g c t0 (AHead a1 a2))).(\lambda (H3: ((\forall (c1: C).(\forall (h: +nat).(\forall (d: nat).((drop h d c1 c) \to (arity g c1 (lift h d t0) (AHead +a1 a2)))))))).(\lambda (c1: C).(\lambda (h: nat).(\lambda (d: nat).(\lambda +(H4: (drop h d c1 c)).(eq_ind_r T (THead (Flat Appl) (lift h d u) (lift h (s +(Flat Appl) d) t0)) (\lambda (t1: T).(arity g c1 t1 a2)) (arity_appl g c1 +(lift h d u) a1 (H1 c1 h d H4) (lift h (s (Flat Appl) d) t0) a2 (H3 c1 h (s +(Flat Appl) d) H4)) (lift h d (THead (Flat Appl) u t0)) (lift_head (Flat +Appl) u t0 h d))))))))))))))) (\lambda (c: C).(\lambda (u: T).(\lambda (a0: +A).(\lambda (_: (arity g c u (asucc g a0))).(\lambda (H1: ((\forall (c1: +C).(\forall (h: nat).(\forall (d: nat).((drop h d c1 c) \to (arity g c1 (lift +h d u) (asucc g a0)))))))).(\lambda (t0: T).(\lambda (_: (arity g c t0 +a0)).(\lambda (H3: ((\forall (c1: C).(\forall (h: nat).(\forall (d: +nat).((drop h d c1 c) \to (arity g c1 (lift h d t0) a0))))))).(\lambda (c1: +C).(\lambda (h: nat).(\lambda (d: nat).(\lambda (H4: (drop h d c1 +c)).(eq_ind_r T (THead (Flat Cast) (lift h d u) (lift h (s (Flat Cast) d) +t0)) (\lambda (t1: T).(arity g c1 t1 a0)) (arity_cast g c1 (lift h d u) a0 +(H1 c1 h d H4) (lift h (s (Flat Cast) d) t0) (H3 c1 h (s (Flat Cast) d) H4)) +(lift h d (THead (Flat Cast) u t0)) (lift_head (Flat Cast) u t0 h +d)))))))))))))) (\lambda (c: C).(\lambda (t0: T).(\lambda (a1: A).(\lambda +(_: (arity g c t0 a1)).(\lambda (H1: ((\forall (c1: C).(\forall (h: +nat).(\forall (d: nat).((drop h d c1 c) \to (arity g c1 (lift h d t0) +a1))))))).(\lambda (a2: A).(\lambda (H2: (leq g a1 a2)).(\lambda (c1: +C).(\lambda (h: nat).(\lambda (d: nat).(\lambda (H3: (drop h d c1 +c)).(arity_repl g c1 (lift h d t0) a1 (H1 c1 h d H3) a2 H2)))))))))))) c2 t a +H))))). + +theorem arity_mono: + \forall (g: G).(\forall (c: C).(\forall (t: T).(\forall (a1: A).((arity g c +t a1) \to (\forall (a2: A).((arity g c t a2) \to (leq g a1 a2))))))) +\def + \lambda (g: G).(\lambda (c: C).(\lambda (t: T).(\lambda (a1: A).(\lambda (H: +(arity g c t a1)).(arity_ind g (\lambda (c0: C).(\lambda (t0: T).(\lambda (a: +A).(\forall (a2: A).((arity g c0 t0 a2) \to (leq g a a2)))))) (\lambda (c0: +C).(\lambda (n: nat).(\lambda (a2: A).(\lambda (H0: (arity g c0 (TSort n) +a2)).(leq_sym g a2 (ASort O n) (arity_gen_sort g c0 n a2 H0)))))) (\lambda +(c0: C).(\lambda (d: C).(\lambda (u: T).(\lambda (i: nat).(\lambda (H0: (getl +i c0 (CHead d (Bind Abbr) u))).(\lambda (a: A).(\lambda (_: (arity g d u +a)).(\lambda (H2: ((\forall (a2: A).((arity g d u a2) \to (leq g a +a2))))).(\lambda (a2: A).(\lambda (H3: (arity g c0 (TLRef i) a2)).(let H4 +\def (arity_gen_lref g c0 i a2 H3) in (or_ind (ex2_2 C T (\lambda (d0: +C).(\lambda (u0: T).(getl i c0 (CHead d0 (Bind Abbr) u0)))) (\lambda (d0: +C).(\lambda (u0: T).(arity g d0 u0 a2)))) (ex2_2 C T (\lambda (d0: +C).(\lambda (u0: T).(getl i c0 (CHead d0 (Bind Abst) u0)))) (\lambda (d0: +C).(\lambda (u0: T).(arity g d0 u0 (asucc g a2))))) (leq g a a2) (\lambda +(H5: (ex2_2 C T (\lambda (d0: C).(\lambda (u0: T).(getl i c0 (CHead d0 (Bind +Abbr) u0)))) (\lambda (d0: C).(\lambda (u0: T).(arity g d0 u0 +a2))))).(ex2_2_ind C T (\lambda (d0: C).(\lambda (u0: T).(getl i c0 (CHead d0 +(Bind Abbr) u0)))) (\lambda (d0: C).(\lambda (u0: T).(arity g d0 u0 a2))) +(leq g a a2) (\lambda (x0: C).(\lambda (x1: T).(\lambda (H6: (getl i c0 +(CHead x0 (Bind Abbr) x1))).(\lambda (H7: (arity g x0 x1 a2)).(let H8 \def +(eq_ind C (CHead d (Bind Abbr) u) (\lambda (c1: C).(getl i c0 c1)) H0 (CHead +x0 (Bind Abbr) x1) (getl_mono c0 (CHead d (Bind Abbr) u) i H0 (CHead x0 (Bind +Abbr) x1) H6)) in (let H9 \def (f_equal C C (\lambda (e: C).(match e in C +return (\lambda (_: C).C) with [(CSort _) \Rightarrow d | (CHead c1 _ _) +\Rightarrow c1])) (CHead d (Bind Abbr) u) (CHead x0 (Bind Abbr) x1) +(getl_mono c0 (CHead d (Bind Abbr) u) i H0 (CHead x0 (Bind Abbr) x1) H6)) in +((let H10 \def (f_equal C T (\lambda (e: C).(match e in C return (\lambda (_: +C).T) with [(CSort _) \Rightarrow u | (CHead _ _ t0) \Rightarrow t0])) (CHead +d (Bind Abbr) u) (CHead x0 (Bind Abbr) x1) (getl_mono c0 (CHead d (Bind Abbr) +u) i H0 (CHead x0 (Bind Abbr) x1) H6)) in (\lambda (H11: (eq C d x0)).(let +H12 \def (eq_ind_r T x1 (\lambda (t0: T).(getl i c0 (CHead x0 (Bind Abbr) +t0))) H8 u H10) in (let H13 \def (eq_ind_r T x1 (\lambda (t0: T).(arity g x0 +t0 a2)) H7 u H10) in (let H14 \def (eq_ind_r C x0 (\lambda (c1: C).(getl i c0 +(CHead c1 (Bind Abbr) u))) H12 d H11) in (let H15 \def (eq_ind_r C x0 +(\lambda (c1: C).(arity g c1 u a2)) H13 d H11) in (H2 a2 H15))))))) H9))))))) +H5)) (\lambda (H5: (ex2_2 C T (\lambda (d0: C).(\lambda (u0: T).(getl i c0 +(CHead d0 (Bind Abst) u0)))) (\lambda (d0: C).(\lambda (u0: T).(arity g d0 u0 +(asucc g a2)))))).(ex2_2_ind C T (\lambda (d0: C).(\lambda (u0: T).(getl i c0 +(CHead d0 (Bind Abst) u0)))) (\lambda (d0: C).(\lambda (u0: T).(arity g d0 u0 +(asucc g a2)))) (leq g a a2) (\lambda (x0: C).(\lambda (x1: T).(\lambda (H6: +(getl i c0 (CHead x0 (Bind Abst) x1))).(\lambda (_: (arity g x0 x1 (asucc g +a2))).(let H8 \def (eq_ind C (CHead d (Bind Abbr) u) (\lambda (c1: C).(getl i +c0 c1)) H0 (CHead x0 (Bind Abst) x1) (getl_mono c0 (CHead d (Bind Abbr) u) i +H0 (CHead x0 (Bind Abst) x1) H6)) in (let H9 \def (eq_ind C (CHead d (Bind +Abbr) u) (\lambda (ee: C).(match ee in C return (\lambda (_: C).Prop) with +[(CSort _) \Rightarrow False | (CHead _ k _) \Rightarrow (match k in K return +(\lambda (_: K).Prop) with [(Bind b) \Rightarrow (match b in B return +(\lambda (_: B).Prop) with [Abbr \Rightarrow True | Abst \Rightarrow False | +Void \Rightarrow False]) | (Flat _) \Rightarrow False])])) I (CHead x0 (Bind +Abst) x1) (getl_mono c0 (CHead d (Bind Abbr) u) i H0 (CHead x0 (Bind Abst) +x1) H6)) in (False_ind (leq g a a2) H9))))))) H5)) H4)))))))))))) (\lambda +(c0: C).(\lambda (d: C).(\lambda (u: T).(\lambda (i: nat).(\lambda (H0: (getl +i c0 (CHead d (Bind Abst) u))).(\lambda (a: A).(\lambda (_: (arity g d u +(asucc g a))).(\lambda (H2: ((\forall (a2: A).((arity g d u a2) \to (leq g +(asucc g a) a2))))).(\lambda (a2: A).(\lambda (H3: (arity g c0 (TLRef i) +a2)).(let H4 \def (arity_gen_lref g c0 i a2 H3) in (or_ind (ex2_2 C T +(\lambda (d0: C).(\lambda (u0: T).(getl i c0 (CHead d0 (Bind Abbr) u0)))) +(\lambda (d0: C).(\lambda (u0: T).(arity g d0 u0 a2)))) (ex2_2 C T (\lambda +(d0: C).(\lambda (u0: T).(getl i c0 (CHead d0 (Bind Abst) u0)))) (\lambda +(d0: C).(\lambda (u0: T).(arity g d0 u0 (asucc g a2))))) (leq g a a2) +(\lambda (H5: (ex2_2 C T (\lambda (d0: C).(\lambda (u0: T).(getl i c0 (CHead +d0 (Bind Abbr) u0)))) (\lambda (d0: C).(\lambda (u0: T).(arity g d0 u0 +a2))))).(ex2_2_ind C T (\lambda (d0: C).(\lambda (u0: T).(getl i c0 (CHead d0 +(Bind Abbr) u0)))) (\lambda (d0: C).(\lambda (u0: T).(arity g d0 u0 a2))) +(leq g a a2) (\lambda (x0: C).(\lambda (x1: T).(\lambda (H6: (getl i c0 +(CHead x0 (Bind Abbr) x1))).(\lambda (_: (arity g x0 x1 a2)).(let H8 \def +(eq_ind C (CHead d (Bind Abst) u) (\lambda (c1: C).(getl i c0 c1)) H0 (CHead +x0 (Bind Abbr) x1) (getl_mono c0 (CHead d (Bind Abst) u) i H0 (CHead x0 (Bind +Abbr) x1) H6)) in (let H9 \def (eq_ind C (CHead d (Bind Abst) u) (\lambda +(ee: C).(match ee in C return (\lambda (_: C).Prop) with [(CSort _) +\Rightarrow False | (CHead _ k _) \Rightarrow (match k in K return (\lambda +(_: K).Prop) with [(Bind b) \Rightarrow (match b in B return (\lambda (_: +B).Prop) with [Abbr \Rightarrow False | Abst \Rightarrow True | Void +\Rightarrow False]) | (Flat _) \Rightarrow False])])) I (CHead x0 (Bind Abbr) +x1) (getl_mono c0 (CHead d (Bind Abst) u) i H0 (CHead x0 (Bind Abbr) x1) H6)) +in (False_ind (leq g a a2) H9))))))) H5)) (\lambda (H5: (ex2_2 C T (\lambda +(d0: C).(\lambda (u0: T).(getl i c0 (CHead d0 (Bind Abst) u0)))) (\lambda +(d0: C).(\lambda (u0: T).(arity g d0 u0 (asucc g a2)))))).(ex2_2_ind C T +(\lambda (d0: C).(\lambda (u0: T).(getl i c0 (CHead d0 (Bind Abst) u0)))) +(\lambda (d0: C).(\lambda (u0: T).(arity g d0 u0 (asucc g a2)))) (leq g a a2) +(\lambda (x0: C).(\lambda (x1: T).(\lambda (H6: (getl i c0 (CHead x0 (Bind +Abst) x1))).(\lambda (H7: (arity g x0 x1 (asucc g a2))).(let H8 \def (eq_ind +C (CHead d (Bind Abst) u) (\lambda (c1: C).(getl i c0 c1)) H0 (CHead x0 (Bind +Abst) x1) (getl_mono c0 (CHead d (Bind Abst) u) i H0 (CHead x0 (Bind Abst) +x1) H6)) in (let H9 \def (f_equal C C (\lambda (e: C).(match e in C return +(\lambda (_: C).C) with [(CSort _) \Rightarrow d | (CHead c1 _ _) \Rightarrow +c1])) (CHead d (Bind Abst) u) (CHead x0 (Bind Abst) x1) (getl_mono c0 (CHead +d (Bind Abst) u) i H0 (CHead x0 (Bind Abst) x1) H6)) in ((let H10 \def +(f_equal C T (\lambda (e: C).(match e in C return (\lambda (_: C).T) with +[(CSort _) \Rightarrow u | (CHead _ _ t0) \Rightarrow t0])) (CHead d (Bind +Abst) u) (CHead x0 (Bind Abst) x1) (getl_mono c0 (CHead d (Bind Abst) u) i H0 +(CHead x0 (Bind Abst) x1) H6)) in (\lambda (H11: (eq C d x0)).(let H12 \def +(eq_ind_r T x1 (\lambda (t0: T).(getl i c0 (CHead x0 (Bind Abst) t0))) H8 u +H10) in (let H13 \def (eq_ind_r T x1 (\lambda (t0: T).(arity g x0 t0 (asucc g +a2))) H7 u H10) in (let H14 \def (eq_ind_r C x0 (\lambda (c1: C).(getl i c0 +(CHead c1 (Bind Abst) u))) H12 d H11) in (let H15 \def (eq_ind_r C x0 +(\lambda (c1: C).(arity g c1 u (asucc g a2))) H13 d H11) in (asucc_inj g a a2 +(H2 (asucc g a2) H15)))))))) H9))))))) H5)) H4)))))))))))) (\lambda (b: +B).(\lambda (H0: (not (eq B b Abst))).(\lambda (c0: C).(\lambda (u: +T).(\lambda (a2: A).(\lambda (_: (arity g c0 u a2)).(\lambda (_: ((\forall +(a3: A).((arity g c0 u a3) \to (leq g a2 a3))))).(\lambda (t0: T).(\lambda +(a3: A).(\lambda (_: (arity g (CHead c0 (Bind b) u) t0 a3)).(\lambda (H4: +((\forall (a4: A).((arity g (CHead c0 (Bind b) u) t0 a4) \to (leq g a3 +a4))))).(\lambda (a0: A).(\lambda (H5: (arity g c0 (THead (Bind b) u t0) +a0)).(let H6 \def (arity_gen_bind b H0 g c0 u t0 a0 H5) in (ex2_ind A +(\lambda (a4: A).(arity g c0 u a4)) (\lambda (_: A).(arity g (CHead c0 (Bind +b) u) t0 a0)) (leq g a3 a0) (\lambda (x: A).(\lambda (_: (arity g c0 u +x)).(\lambda (H8: (arity g (CHead c0 (Bind b) u) t0 a0)).(H4 a0 H8)))) +H6))))))))))))))) (\lambda (c0: C).(\lambda (u: T).(\lambda (a2: A).(\lambda +(_: (arity g c0 u (asucc g a2))).(\lambda (H1: ((\forall (a3: A).((arity g c0 +u a3) \to (leq g (asucc g a2) a3))))).(\lambda (t0: T).(\lambda (a3: +A).(\lambda (_: (arity g (CHead c0 (Bind Abst) u) t0 a3)).(\lambda (H3: +((\forall (a4: A).((arity g (CHead c0 (Bind Abst) u) t0 a4) \to (leq g a3 +a4))))).(\lambda (a0: A).(\lambda (H4: (arity g c0 (THead (Bind Abst) u t0) +a0)).(let H5 \def (arity_gen_abst g c0 u t0 a0 H4) in (ex3_2_ind A A (\lambda +(a4: A).(\lambda (a5: A).(eq A a0 (AHead a4 a5)))) (\lambda (a4: A).(\lambda +(_: A).(arity g c0 u (asucc g a4)))) (\lambda (_: A).(\lambda (a5: A).(arity +g (CHead c0 (Bind Abst) u) t0 a5))) (leq g (AHead a2 a3) a0) (\lambda (x0: +A).(\lambda (x1: A).(\lambda (H6: (eq A a0 (AHead x0 x1))).(\lambda (H7: +(arity g c0 u (asucc g x0))).(\lambda (H8: (arity g (CHead c0 (Bind Abst) u) +t0 x1)).(eq_ind_r A (AHead x0 x1) (\lambda (a: A).(leq g (AHead a2 a3) a)) +(leq_head g a2 x0 (asucc_inj g a2 x0 (H1 (asucc g x0) H7)) a3 x1 (H3 x1 H8)) +a0 H6)))))) H5))))))))))))) (\lambda (c0: C).(\lambda (u: T).(\lambda (a2: +A).(\lambda (_: (arity g c0 u a2)).(\lambda (_: ((\forall (a3: A).((arity g +c0 u a3) \to (leq g a2 a3))))).(\lambda (t0: T).(\lambda (a3: A).(\lambda (_: +(arity g c0 t0 (AHead a2 a3))).(\lambda (H3: ((\forall (a4: A).((arity g c0 +t0 a4) \to (leq g (AHead a2 a3) a4))))).(\lambda (a0: A).(\lambda (H4: (arity +g c0 (THead (Flat Appl) u t0) a0)).(let H5 \def (arity_gen_appl g c0 u t0 a0 +H4) in (ex2_ind A (\lambda (a4: A).(arity g c0 u a4)) (\lambda (a4: A).(arity +g c0 t0 (AHead a4 a0))) (leq g a3 a0) (\lambda (x: A).(\lambda (_: (arity g +c0 u x)).(\lambda (H7: (arity g c0 t0 (AHead x a0))).(ahead_inj_snd g a2 a3 x +a0 (H3 (AHead x a0) H7))))) H5))))))))))))) (\lambda (c0: C).(\lambda (u: +T).(\lambda (a: A).(\lambda (_: (arity g c0 u (asucc g a))).(\lambda (_: +((\forall (a2: A).((arity g c0 u a2) \to (leq g (asucc g a) a2))))).(\lambda +(t0: T).(\lambda (_: (arity g c0 t0 a)).(\lambda (H3: ((\forall (a2: +A).((arity g c0 t0 a2) \to (leq g a a2))))).(\lambda (a2: A).(\lambda (H4: +(arity g c0 (THead (Flat Cast) u t0) a2)).(let H5 \def (arity_gen_cast g c0 u +t0 a2 H4) in (and_ind (arity g c0 u (asucc g a2)) (arity g c0 t0 a2) (leq g a +a2) (\lambda (_: (arity g c0 u (asucc g a2))).(\lambda (H7: (arity g c0 t0 +a2)).(H3 a2 H7))) H5)))))))))))) (\lambda (c0: C).(\lambda (t0: T).(\lambda +(a2: A).(\lambda (_: (arity g c0 t0 a2)).(\lambda (H1: ((\forall (a3: +A).((arity g c0 t0 a3) \to (leq g a2 a3))))).(\lambda (a3: A).(\lambda (H2: +(leq g a2 a3)).(\lambda (a0: A).(\lambda (H3: (arity g c0 t0 a0)).(leq_trans +g a3 a2 (leq_sym g a2 a3 H2) a0 (H1 a0 H3))))))))))) c t a1 H))))). + +theorem arity_appls_cast: + \forall (g: G).(\forall (c: C).(\forall (u: T).(\forall (t: T).(\forall (vs: +TList).(\forall (a: A).((arity g c (THeads (Flat Appl) vs u) (asucc g a)) \to +((arity g c (THeads (Flat Appl) vs t) a) \to (arity g c (THeads (Flat Appl) +vs (THead (Flat Cast) u t)) a)))))))) +\def + \lambda (g: G).(\lambda (c: C).(\lambda (u: T).(\lambda (t: T).(\lambda (vs: +TList).(TList_ind (\lambda (t0: TList).(\forall (a: A).((arity g c (THeads +(Flat Appl) t0 u) (asucc g a)) \to ((arity g c (THeads (Flat Appl) t0 t) a) +\to (arity g c (THeads (Flat Appl) t0 (THead (Flat Cast) u t)) a))))) +(\lambda (a: A).(\lambda (H: (arity g c u (asucc g a))).(\lambda (H0: (arity +g c t a)).(arity_cast g c u a H t H0)))) (\lambda (t0: T).(\lambda (t1: +TList).(\lambda (H: ((\forall (a: A).((arity g c (THeads (Flat Appl) t1 u) +(asucc g a)) \to ((arity g c (THeads (Flat Appl) t1 t) a) \to (arity g c +(THeads (Flat Appl) t1 (THead (Flat Cast) u t)) a)))))).(\lambda (a: +A).(\lambda (H0: (arity g c (THead (Flat Appl) t0 (THeads (Flat Appl) t1 u)) +(asucc g a))).(\lambda (H1: (arity g c (THead (Flat Appl) t0 (THeads (Flat +Appl) t1 t)) a)).(let H2 \def (arity_gen_appl g c t0 (THeads (Flat Appl) t1 +t) a H1) in (ex2_ind A (\lambda (a1: A).(arity g c t0 a1)) (\lambda (a1: +A).(arity g c (THeads (Flat Appl) t1 t) (AHead a1 a))) (arity g c (THead +(Flat Appl) t0 (THeads (Flat Appl) t1 (THead (Flat Cast) u t))) a) (\lambda +(x: A).(\lambda (H3: (arity g c t0 x)).(\lambda (H4: (arity g c (THeads (Flat +Appl) t1 t) (AHead x a))).(let H5 \def (arity_gen_appl g c t0 (THeads (Flat +Appl) t1 u) (asucc g a) H0) in (ex2_ind A (\lambda (a1: A).(arity g c t0 a1)) +(\lambda (a1: A).(arity g c (THeads (Flat Appl) t1 u) (AHead a1 (asucc g +a)))) (arity g c (THead (Flat Appl) t0 (THeads (Flat Appl) t1 (THead (Flat +Cast) u t))) a) (\lambda (x0: A).(\lambda (H6: (arity g c t0 x0)).(\lambda +(H7: (arity g c (THeads (Flat Appl) t1 u) (AHead x0 (asucc g +a)))).(arity_appl g c t0 x H3 (THeads (Flat Appl) t1 (THead (Flat Cast) u t)) +a (H (AHead x a) (arity_repl g c (THeads (Flat Appl) t1 u) (AHead x (asucc g +a)) (arity_repl g c (THeads (Flat Appl) t1 u) (AHead x0 (asucc g a)) H7 +(AHead x (asucc g a)) (leq_head g x0 x (arity_mono g c t0 x0 H6 x H3) (asucc +g a) (asucc g a) (leq_refl g (asucc g a)))) (asucc g (AHead x a)) (leq_refl g +(asucc g (AHead x a)))) H4))))) H5))))) H2)))))))) vs))))). + +theorem arity_appls_abbr: + \forall (g: G).(\forall (c: C).(\forall (d: C).(\forall (v: T).(\forall (i: +nat).((getl i c (CHead d (Bind Abbr) v)) \to (\forall (vs: TList).(\forall +(a: A).((arity g c (THeads (Flat Appl) vs (lift (S i) O v)) a) \to (arity g c +(THeads (Flat Appl) vs (TLRef i)) a))))))))) +\def + \lambda (g: G).(\lambda (c: C).(\lambda (d: C).(\lambda (v: T).(\lambda (i: +nat).(\lambda (H: (getl i c (CHead d (Bind Abbr) v))).(\lambda (vs: +TList).(TList_ind (\lambda (t: TList).(\forall (a: A).((arity g c (THeads +(Flat Appl) t (lift (S i) O v)) a) \to (arity g c (THeads (Flat Appl) t +(TLRef i)) a)))) (\lambda (a: A).(\lambda (H0: (arity g c (lift (S i) O v) +a)).(arity_abbr g c d v i H a (arity_gen_lift g c v a (S i) O H0 d (getl_drop +Abbr c d v i H))))) (\lambda (t: T).(\lambda (t0: TList).(\lambda (H0: +((\forall (a: A).((arity g c (THeads (Flat Appl) t0 (lift (S i) O v)) a) \to +(arity g c (THeads (Flat Appl) t0 (TLRef i)) a))))).(\lambda (a: A).(\lambda +(H1: (arity g c (THead (Flat Appl) t (THeads (Flat Appl) t0 (lift (S i) O +v))) a)).(let H2 \def (arity_gen_appl g c t (THeads (Flat Appl) t0 (lift (S +i) O v)) a H1) in (ex2_ind A (\lambda (a1: A).(arity g c t a1)) (\lambda (a1: +A).(arity g c (THeads (Flat Appl) t0 (lift (S i) O v)) (AHead a1 a))) (arity +g c (THead (Flat Appl) t (THeads (Flat Appl) t0 (TLRef i))) a) (\lambda (x: +A).(\lambda (H3: (arity g c t x)).(\lambda (H4: (arity g c (THeads (Flat +Appl) t0 (lift (S i) O v)) (AHead x a))).(arity_appl g c t x H3 (THeads (Flat +Appl) t0 (TLRef i)) a (H0 (AHead x a) H4))))) H2))))))) vs))))))). + +theorem arity_appls_bind: + \forall (g: G).(\forall (b: B).((not (eq B b Abst)) \to (\forall (c: +C).(\forall (v: T).(\forall (a1: A).((arity g c v a1) \to (\forall (t: +T).(\forall (vs: TList).(\forall (a2: A).((arity g (CHead c (Bind b) v) +(THeads (Flat Appl) (lifts (S O) O vs) t) a2) \to (arity g c (THeads (Flat +Appl) vs (THead (Bind b) v t)) a2))))))))))) +\def + \lambda (g: G).(\lambda (b: B).(\lambda (H: (not (eq B b Abst))).(\lambda +(c: C).(\lambda (v: T).(\lambda (a1: A).(\lambda (H0: (arity g c v +a1)).(\lambda (t: T).(\lambda (vs: TList).(TList_ind (\lambda (t0: +TList).(\forall (a2: A).((arity g (CHead c (Bind b) v) (THeads (Flat Appl) +(lifts (S O) O t0) t) a2) \to (arity g c (THeads (Flat Appl) t0 (THead (Bind +b) v t)) a2)))) (\lambda (a2: A).(\lambda (H1: (arity g (CHead c (Bind b) v) +t a2)).(arity_bind g b H c v a1 H0 t a2 H1))) (\lambda (t0: T).(\lambda (t1: +TList).(\lambda (H1: ((\forall (a2: A).((arity g (CHead c (Bind b) v) (THeads +(Flat Appl) (lifts (S O) O t1) t) a2) \to (arity g c (THeads (Flat Appl) t1 +(THead (Bind b) v t)) a2))))).(\lambda (a2: A).(\lambda (H2: (arity g (CHead +c (Bind b) v) (THead (Flat Appl) (lift (S O) O t0) (THeads (Flat Appl) (lifts +(S O) O t1) t)) a2)).(let H3 \def (arity_gen_appl g (CHead c (Bind b) v) +(lift (S O) O t0) (THeads (Flat Appl) (lifts (S O) O t1) t) a2 H2) in +(ex2_ind A (\lambda (a3: A).(arity g (CHead c (Bind b) v) (lift (S O) O t0) +a3)) (\lambda (a3: A).(arity g (CHead c (Bind b) v) (THeads (Flat Appl) +(lifts (S O) O t1) t) (AHead a3 a2))) (arity g c (THead (Flat Appl) t0 +(THeads (Flat Appl) t1 (THead (Bind b) v t))) a2) (\lambda (x: A).(\lambda +(H4: (arity g (CHead c (Bind b) v) (lift (S O) O t0) x)).(\lambda (H5: (arity +g (CHead c (Bind b) v) (THeads (Flat Appl) (lifts (S O) O t1) t) (AHead x +a2))).(arity_appl g c t0 x (arity_gen_lift g (CHead c (Bind b) v) t0 x (S O) +O H4 c (drop_drop (Bind b) O c c (drop_refl c) v)) (THeads (Flat Appl) t1 +(THead (Bind b) v t)) a2 (H1 (AHead x a2) H5))))) H3))))))) vs))))))))). + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/arity/subst0.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/arity/subst0.ma new file mode 100644 index 000000000..02fd3734e --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/arity/subst0.ma @@ -0,0 +1,1129 @@ +(**************************************************************************) +(* ___ *) +(* ||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/arity/subst0". + +include "arity/props.ma". + +include "fsubst0/fwd.ma". + +include "csubst0/getl.ma". + +include "csubst0/props.ma". + +include "subst0/dec.ma". + +include "subst0/fwd.ma". + +include "getl/getl.ma". + +theorem arity_gen_cvoid_subst0: + \forall (g: G).(\forall (c: C).(\forall (t: T).(\forall (a: A).((arity g c t +a) \to (\forall (d: C).(\forall (u: T).(\forall (i: nat).((getl i c (CHead d +(Bind Void) u)) \to (\forall (w: T).(\forall (v: T).((subst0 i w t v) \to +(\forall (P: Prop).P)))))))))))) +\def + \lambda (g: G).(\lambda (c: C).(\lambda (t: T).(\lambda (a: A).(\lambda (H: +(arity g c t a)).(arity_ind g (\lambda (c0: C).(\lambda (t0: T).(\lambda (_: +A).(\forall (d: C).(\forall (u: T).(\forall (i: nat).((getl i c0 (CHead d +(Bind Void) u)) \to (\forall (w: T).(\forall (v: T).((subst0 i w t0 v) \to +(\forall (P: Prop).P))))))))))) (\lambda (c0: C).(\lambda (n: nat).(\lambda +(d: C).(\lambda (u: T).(\lambda (i: nat).(\lambda (_: (getl i c0 (CHead d +(Bind Void) u))).(\lambda (w: T).(\lambda (v: T).(\lambda (H1: (subst0 i w +(TSort n) v)).(\lambda (P: Prop).(subst0_gen_sort w v i n H1 P))))))))))) +(\lambda (c0: C).(\lambda (d: C).(\lambda (u: T).(\lambda (i: nat).(\lambda +(H0: (getl i c0 (CHead d (Bind Abbr) u))).(\lambda (a0: A).(\lambda (_: +(arity g d u a0)).(\lambda (_: ((\forall (d0: C).(\forall (u0: T).(\forall +(i0: nat).((getl i0 d (CHead d0 (Bind Void) u0)) \to (\forall (w: T).(\forall +(v: T).((subst0 i0 w u v) \to (\forall (P: Prop).P)))))))))).(\lambda (d0: +C).(\lambda (u0: T).(\lambda (i0: nat).(\lambda (H3: (getl i0 c0 (CHead d0 +(Bind Void) u0))).(\lambda (w: T).(\lambda (v: T).(\lambda (H4: (subst0 i0 w +(TLRef i) v)).(\lambda (P: Prop).(and_ind (eq nat i i0) (eq T v (lift (S i) O +w)) P (\lambda (H5: (eq nat i i0)).(\lambda (_: (eq T v (lift (S i) O +w))).(let H7 \def (eq_ind_r nat i0 (\lambda (n: nat).(getl n c0 (CHead d0 +(Bind Void) u0))) H3 i H5) in (let H8 \def (eq_ind C (CHead d (Bind Abbr) u) +(\lambda (c1: C).(getl i c0 c1)) H0 (CHead d0 (Bind Void) u0) (getl_mono c0 +(CHead d (Bind Abbr) u) i H0 (CHead d0 (Bind Void) u0) H7)) in (let H9 \def +(eq_ind C (CHead d (Bind Abbr) u) (\lambda (ee: C).(match ee in C return +(\lambda (_: C).Prop) with [(CSort _) \Rightarrow False | (CHead _ k _) +\Rightarrow (match k in K return (\lambda (_: K).Prop) with [(Bind b) +\Rightarrow (match b in B return (\lambda (_: B).Prop) with [Abbr \Rightarrow +True | Abst \Rightarrow False | Void \Rightarrow False]) | (Flat _) +\Rightarrow False])])) I (CHead d0 (Bind Void) u0) (getl_mono c0 (CHead d +(Bind Abbr) u) i H0 (CHead d0 (Bind Void) u0) H7)) in (False_ind P H9)))))) +(subst0_gen_lref w v i0 i H4)))))))))))))))))) (\lambda (c0: C).(\lambda (d: +C).(\lambda (u: T).(\lambda (i: nat).(\lambda (H0: (getl i c0 (CHead d (Bind +Abst) u))).(\lambda (a0: A).(\lambda (_: (arity g d u (asucc g a0))).(\lambda +(_: ((\forall (d0: C).(\forall (u0: T).(\forall (i0: nat).((getl i0 d (CHead +d0 (Bind Void) u0)) \to (\forall (w: T).(\forall (v: T).((subst0 i0 w u v) +\to (\forall (P: Prop).P)))))))))).(\lambda (d0: C).(\lambda (u0: T).(\lambda +(i0: nat).(\lambda (H3: (getl i0 c0 (CHead d0 (Bind Void) u0))).(\lambda (w: +T).(\lambda (v: T).(\lambda (H4: (subst0 i0 w (TLRef i) v)).(\lambda (P: +Prop).(and_ind (eq nat i i0) (eq T v (lift (S i) O w)) P (\lambda (H5: (eq +nat i i0)).(\lambda (_: (eq T v (lift (S i) O w))).(let H7 \def (eq_ind_r nat +i0 (\lambda (n: nat).(getl n c0 (CHead d0 (Bind Void) u0))) H3 i H5) in (let +H8 \def (eq_ind C (CHead d (Bind Abst) u) (\lambda (c1: C).(getl i c0 c1)) H0 +(CHead d0 (Bind Void) u0) (getl_mono c0 (CHead d (Bind Abst) u) i H0 (CHead +d0 (Bind Void) u0) H7)) in (let H9 \def (eq_ind C (CHead d (Bind Abst) u) +(\lambda (ee: C).(match ee in C return (\lambda (_: C).Prop) with [(CSort _) +\Rightarrow False | (CHead _ k _) \Rightarrow (match k in K return (\lambda +(_: K).Prop) with [(Bind b) \Rightarrow (match b in B return (\lambda (_: +B).Prop) with [Abbr \Rightarrow False | Abst \Rightarrow True | Void +\Rightarrow False]) | (Flat _) \Rightarrow False])])) I (CHead d0 (Bind Void) +u0) (getl_mono c0 (CHead d (Bind Abst) u) i H0 (CHead d0 (Bind Void) u0) H7)) +in (False_ind P H9)))))) (subst0_gen_lref w v i0 i H4)))))))))))))))))) +(\lambda (b: B).(\lambda (_: (not (eq B b Abst))).(\lambda (c0: C).(\lambda +(u: T).(\lambda (a1: A).(\lambda (_: (arity g c0 u a1)).(\lambda (H2: +((\forall (d: C).(\forall (u0: T).(\forall (i: nat).((getl i c0 (CHead d +(Bind Void) u0)) \to (\forall (w: T).(\forall (v: T).((subst0 i w u v) \to +(\forall (P: Prop).P)))))))))).(\lambda (t0: T).(\lambda (a2: A).(\lambda (_: +(arity g (CHead c0 (Bind b) u) t0 a2)).(\lambda (H4: ((\forall (d: +C).(\forall (u0: T).(\forall (i: nat).((getl i (CHead c0 (Bind b) u) (CHead d +(Bind Void) u0)) \to (\forall (w: T).(\forall (v: T).((subst0 i w t0 v) \to +(\forall (P: Prop).P)))))))))).(\lambda (d: C).(\lambda (u0: T).(\lambda (i: +nat).(\lambda (H5: (getl i c0 (CHead d (Bind Void) u0))).(\lambda (w: +T).(\lambda (v: T).(\lambda (H6: (subst0 i w (THead (Bind b) u t0) +v)).(\lambda (P: Prop).(or3_ind (ex2 T (\lambda (u2: T).(eq T v (THead (Bind +b) u2 t0))) (\lambda (u2: T).(subst0 i w u u2))) (ex2 T (\lambda (t2: T).(eq +T v (THead (Bind b) u t2))) (\lambda (t2: T).(subst0 (s (Bind b) i) w t0 +t2))) (ex3_2 T T (\lambda (u2: T).(\lambda (t2: T).(eq T v (THead (Bind b) u2 +t2)))) (\lambda (u2: T).(\lambda (_: T).(subst0 i w u u2))) (\lambda (_: +T).(\lambda (t2: T).(subst0 (s (Bind b) i) w t0 t2)))) P (\lambda (H7: (ex2 T +(\lambda (u2: T).(eq T v (THead (Bind b) u2 t0))) (\lambda (u2: T).(subst0 i +w u u2)))).(ex2_ind T (\lambda (u2: T).(eq T v (THead (Bind b) u2 t0))) +(\lambda (u2: T).(subst0 i w u u2)) P (\lambda (x: T).(\lambda (_: (eq T v +(THead (Bind b) x t0))).(\lambda (H9: (subst0 i w u x)).(H2 d u0 i H5 w x H9 +P)))) H7)) (\lambda (H7: (ex2 T (\lambda (t2: T).(eq T v (THead (Bind b) u +t2))) (\lambda (t2: T).(subst0 (s (Bind b) i) w t0 t2)))).(ex2_ind T (\lambda +(t2: T).(eq T v (THead (Bind b) u t2))) (\lambda (t2: T).(subst0 (s (Bind b) +i) w t0 t2)) P (\lambda (x: T).(\lambda (_: (eq T v (THead (Bind b) u +x))).(\lambda (H9: (subst0 (s (Bind b) i) w t0 x)).(H4 d u0 (S i) +(getl_clear_bind b (CHead c0 (Bind b) u) c0 u (clear_bind b c0 u) (CHead d +(Bind Void) u0) i H5) w x H9 P)))) H7)) (\lambda (H7: (ex3_2 T T (\lambda +(u2: T).(\lambda (t2: T).(eq T v (THead (Bind b) u2 t2)))) (\lambda (u2: +T).(\lambda (_: T).(subst0 i w u u2))) (\lambda (_: T).(\lambda (t2: +T).(subst0 (s (Bind b) i) w t0 t2))))).(ex3_2_ind T T (\lambda (u2: +T).(\lambda (t2: T).(eq T v (THead (Bind b) u2 t2)))) (\lambda (u2: +T).(\lambda (_: T).(subst0 i w u u2))) (\lambda (_: T).(\lambda (t2: +T).(subst0 (s (Bind b) i) w t0 t2))) P (\lambda (x0: T).(\lambda (x1: +T).(\lambda (_: (eq T v (THead (Bind b) x0 x1))).(\lambda (H9: (subst0 i w u +x0)).(\lambda (_: (subst0 (s (Bind b) i) w t0 x1)).(H2 d u0 i H5 w x0 H9 +P)))))) H7)) (subst0_gen_head (Bind b) w u t0 v i H6))))))))))))))))))))) +(\lambda (c0: C).(\lambda (u: T).(\lambda (a1: A).(\lambda (_: (arity g c0 u +(asucc g a1))).(\lambda (H1: ((\forall (d: C).(\forall (u0: T).(\forall (i: +nat).((getl i c0 (CHead d (Bind Void) u0)) \to (\forall (w: T).(\forall (v: +T).((subst0 i w u v) \to (\forall (P: Prop).P)))))))))).(\lambda (t0: +T).(\lambda (a2: A).(\lambda (_: (arity g (CHead c0 (Bind Abst) u) t0 +a2)).(\lambda (H3: ((\forall (d: C).(\forall (u0: T).(\forall (i: nat).((getl +i (CHead c0 (Bind Abst) u) (CHead d (Bind Void) u0)) \to (\forall (w: +T).(\forall (v: T).((subst0 i w t0 v) \to (\forall (P: +Prop).P)))))))))).(\lambda (d: C).(\lambda (u0: T).(\lambda (i: nat).(\lambda +(H4: (getl i c0 (CHead d (Bind Void) u0))).(\lambda (w: T).(\lambda (v: +T).(\lambda (H5: (subst0 i w (THead (Bind Abst) u t0) v)).(\lambda (P: +Prop).(or3_ind (ex2 T (\lambda (u2: T).(eq T v (THead (Bind Abst) u2 t0))) +(\lambda (u2: T).(subst0 i w u u2))) (ex2 T (\lambda (t2: T).(eq T v (THead +(Bind Abst) u t2))) (\lambda (t2: T).(subst0 (s (Bind Abst) i) w t0 t2))) +(ex3_2 T T (\lambda (u2: T).(\lambda (t2: T).(eq T v (THead (Bind Abst) u2 +t2)))) (\lambda (u2: T).(\lambda (_: T).(subst0 i w u u2))) (\lambda (_: +T).(\lambda (t2: T).(subst0 (s (Bind Abst) i) w t0 t2)))) P (\lambda (H6: +(ex2 T (\lambda (u2: T).(eq T v (THead (Bind Abst) u2 t0))) (\lambda (u2: +T).(subst0 i w u u2)))).(ex2_ind T (\lambda (u2: T).(eq T v (THead (Bind +Abst) u2 t0))) (\lambda (u2: T).(subst0 i w u u2)) P (\lambda (x: T).(\lambda +(_: (eq T v (THead (Bind Abst) x t0))).(\lambda (H8: (subst0 i w u x)).(H1 d +u0 i H4 w x H8 P)))) H6)) (\lambda (H6: (ex2 T (\lambda (t2: T).(eq T v +(THead (Bind Abst) u t2))) (\lambda (t2: T).(subst0 (s (Bind Abst) i) w t0 +t2)))).(ex2_ind T (\lambda (t2: T).(eq T v (THead (Bind Abst) u t2))) +(\lambda (t2: T).(subst0 (s (Bind Abst) i) w t0 t2)) P (\lambda (x: +T).(\lambda (_: (eq T v (THead (Bind Abst) u x))).(\lambda (H8: (subst0 (s +(Bind Abst) i) w t0 x)).(H3 d u0 (S i) (getl_clear_bind Abst (CHead c0 (Bind +Abst) u) c0 u (clear_bind Abst c0 u) (CHead d (Bind Void) u0) i H4) w x H8 +P)))) H6)) (\lambda (H6: (ex3_2 T T (\lambda (u2: T).(\lambda (t2: T).(eq T v +(THead (Bind Abst) u2 t2)))) (\lambda (u2: T).(\lambda (_: T).(subst0 i w u +u2))) (\lambda (_: T).(\lambda (t2: T).(subst0 (s (Bind Abst) i) w t0 +t2))))).(ex3_2_ind T T (\lambda (u2: T).(\lambda (t2: T).(eq T v (THead (Bind +Abst) u2 t2)))) (\lambda (u2: T).(\lambda (_: T).(subst0 i w u u2))) (\lambda +(_: T).(\lambda (t2: T).(subst0 (s (Bind Abst) i) w t0 t2))) P (\lambda (x0: +T).(\lambda (x1: T).(\lambda (_: (eq T v (THead (Bind Abst) x0 x1))).(\lambda +(H8: (subst0 i w u x0)).(\lambda (_: (subst0 (s (Bind Abst) i) w t0 x1)).(H1 +d u0 i H4 w x0 H8 P)))))) H6)) (subst0_gen_head (Bind Abst) w u t0 v i +H5))))))))))))))))))) (\lambda (c0: C).(\lambda (u: T).(\lambda (a1: +A).(\lambda (_: (arity g c0 u a1)).(\lambda (H1: ((\forall (d: C).(\forall +(u0: T).(\forall (i: nat).((getl i c0 (CHead d (Bind Void) u0)) \to (\forall +(w: T).(\forall (v: T).((subst0 i w u v) \to (\forall (P: +Prop).P)))))))))).(\lambda (t0: T).(\lambda (a2: A).(\lambda (_: (arity g c0 +t0 (AHead a1 a2))).(\lambda (H3: ((\forall (d: C).(\forall (u0: T).(\forall +(i: nat).((getl i c0 (CHead d (Bind Void) u0)) \to (\forall (w: T).(\forall +(v: T).((subst0 i w t0 v) \to (\forall (P: Prop).P)))))))))).(\lambda (d: +C).(\lambda (u0: T).(\lambda (i: nat).(\lambda (H4: (getl i c0 (CHead d (Bind +Void) u0))).(\lambda (w: T).(\lambda (v: T).(\lambda (H5: (subst0 i w (THead +(Flat Appl) u t0) v)).(\lambda (P: Prop).(or3_ind (ex2 T (\lambda (u2: T).(eq +T v (THead (Flat Appl) u2 t0))) (\lambda (u2: T).(subst0 i w u u2))) (ex2 T +(\lambda (t2: T).(eq T v (THead (Flat Appl) u t2))) (\lambda (t2: T).(subst0 +(s (Flat Appl) i) w t0 t2))) (ex3_2 T T (\lambda (u2: T).(\lambda (t2: T).(eq +T v (THead (Flat Appl) u2 t2)))) (\lambda (u2: T).(\lambda (_: T).(subst0 i w +u u2))) (\lambda (_: T).(\lambda (t2: T).(subst0 (s (Flat Appl) i) w t0 +t2)))) P (\lambda (H6: (ex2 T (\lambda (u2: T).(eq T v (THead (Flat Appl) u2 +t0))) (\lambda (u2: T).(subst0 i w u u2)))).(ex2_ind T (\lambda (u2: T).(eq T +v (THead (Flat Appl) u2 t0))) (\lambda (u2: T).(subst0 i w u u2)) P (\lambda +(x: T).(\lambda (_: (eq T v (THead (Flat Appl) x t0))).(\lambda (H8: (subst0 +i w u x)).(H1 d u0 i H4 w x H8 P)))) H6)) (\lambda (H6: (ex2 T (\lambda (t2: +T).(eq T v (THead (Flat Appl) u t2))) (\lambda (t2: T).(subst0 (s (Flat Appl) +i) w t0 t2)))).(ex2_ind T (\lambda (t2: T).(eq T v (THead (Flat Appl) u t2))) +(\lambda (t2: T).(subst0 (s (Flat Appl) i) w t0 t2)) P (\lambda (x: +T).(\lambda (_: (eq T v (THead (Flat Appl) u x))).(\lambda (H8: (subst0 (s +(Flat Appl) i) w t0 x)).(H3 d u0 i H4 w x H8 P)))) H6)) (\lambda (H6: (ex3_2 +T T (\lambda (u2: T).(\lambda (t2: T).(eq T v (THead (Flat Appl) u2 t2)))) +(\lambda (u2: T).(\lambda (_: T).(subst0 i w u u2))) (\lambda (_: T).(\lambda +(t2: T).(subst0 (s (Flat Appl) i) w t0 t2))))).(ex3_2_ind T T (\lambda (u2: +T).(\lambda (t2: T).(eq T v (THead (Flat Appl) u2 t2)))) (\lambda (u2: +T).(\lambda (_: T).(subst0 i w u u2))) (\lambda (_: T).(\lambda (t2: +T).(subst0 (s (Flat Appl) i) w t0 t2))) P (\lambda (x0: T).(\lambda (x1: +T).(\lambda (_: (eq T v (THead (Flat Appl) x0 x1))).(\lambda (H8: (subst0 i w +u x0)).(\lambda (_: (subst0 (s (Flat Appl) i) w t0 x1)).(H1 d u0 i H4 w x0 H8 +P)))))) H6)) (subst0_gen_head (Flat Appl) w u t0 v i H5))))))))))))))))))) +(\lambda (c0: C).(\lambda (u: T).(\lambda (a0: A).(\lambda (_: (arity g c0 u +(asucc g a0))).(\lambda (H1: ((\forall (d: C).(\forall (u0: T).(\forall (i: +nat).((getl i c0 (CHead d (Bind Void) u0)) \to (\forall (w: T).(\forall (v: +T).((subst0 i w u v) \to (\forall (P: Prop).P)))))))))).(\lambda (t0: +T).(\lambda (_: (arity g c0 t0 a0)).(\lambda (H3: ((\forall (d: C).(\forall +(u0: T).(\forall (i: nat).((getl i c0 (CHead d (Bind Void) u0)) \to (\forall +(w: T).(\forall (v: T).((subst0 i w t0 v) \to (\forall (P: +Prop).P)))))))))).(\lambda (d: C).(\lambda (u0: T).(\lambda (i: nat).(\lambda +(H4: (getl i c0 (CHead d (Bind Void) u0))).(\lambda (w: T).(\lambda (v: +T).(\lambda (H5: (subst0 i w (THead (Flat Cast) u t0) v)).(\lambda (P: +Prop).(or3_ind (ex2 T (\lambda (u2: T).(eq T v (THead (Flat Cast) u2 t0))) +(\lambda (u2: T).(subst0 i w u u2))) (ex2 T (\lambda (t2: T).(eq T v (THead +(Flat Cast) u t2))) (\lambda (t2: T).(subst0 (s (Flat Cast) i) w t0 t2))) +(ex3_2 T T (\lambda (u2: T).(\lambda (t2: T).(eq T v (THead (Flat Cast) u2 +t2)))) (\lambda (u2: T).(\lambda (_: T).(subst0 i w u u2))) (\lambda (_: +T).(\lambda (t2: T).(subst0 (s (Flat Cast) i) w t0 t2)))) P (\lambda (H6: +(ex2 T (\lambda (u2: T).(eq T v (THead (Flat Cast) u2 t0))) (\lambda (u2: +T).(subst0 i w u u2)))).(ex2_ind T (\lambda (u2: T).(eq T v (THead (Flat +Cast) u2 t0))) (\lambda (u2: T).(subst0 i w u u2)) P (\lambda (x: T).(\lambda +(_: (eq T v (THead (Flat Cast) x t0))).(\lambda (H8: (subst0 i w u x)).(H1 d +u0 i H4 w x H8 P)))) H6)) (\lambda (H6: (ex2 T (\lambda (t2: T).(eq T v +(THead (Flat Cast) u t2))) (\lambda (t2: T).(subst0 (s (Flat Cast) i) w t0 +t2)))).(ex2_ind T (\lambda (t2: T).(eq T v (THead (Flat Cast) u t2))) +(\lambda (t2: T).(subst0 (s (Flat Cast) i) w t0 t2)) P (\lambda (x: +T).(\lambda (_: (eq T v (THead (Flat Cast) u x))).(\lambda (H8: (subst0 (s +(Flat Cast) i) w t0 x)).(H3 d u0 i H4 w x H8 P)))) H6)) (\lambda (H6: (ex3_2 +T T (\lambda (u2: T).(\lambda (t2: T).(eq T v (THead (Flat Cast) u2 t2)))) +(\lambda (u2: T).(\lambda (_: T).(subst0 i w u u2))) (\lambda (_: T).(\lambda +(t2: T).(subst0 (s (Flat Cast) i) w t0 t2))))).(ex3_2_ind T T (\lambda (u2: +T).(\lambda (t2: T).(eq T v (THead (Flat Cast) u2 t2)))) (\lambda (u2: +T).(\lambda (_: T).(subst0 i w u u2))) (\lambda (_: T).(\lambda (t2: +T).(subst0 (s (Flat Cast) i) w t0 t2))) P (\lambda (x0: T).(\lambda (x1: +T).(\lambda (_: (eq T v (THead (Flat Cast) x0 x1))).(\lambda (H8: (subst0 i w +u x0)).(\lambda (_: (subst0 (s (Flat Cast) i) w t0 x1)).(H1 d u0 i H4 w x0 H8 +P)))))) H6)) (subst0_gen_head (Flat Cast) w u t0 v i H5)))))))))))))))))) +(\lambda (c0: C).(\lambda (t0: T).(\lambda (a1: A).(\lambda (_: (arity g c0 +t0 a1)).(\lambda (H1: ((\forall (d: C).(\forall (u: T).(\forall (i: +nat).((getl i c0 (CHead d (Bind Void) u)) \to (\forall (w: T).(\forall (v: +T).((subst0 i w t0 v) \to (\forall (P: Prop).P)))))))))).(\lambda (a2: +A).(\lambda (_: (leq g a1 a2)).(\lambda (d: C).(\lambda (u: T).(\lambda (i: +nat).(\lambda (H3: (getl i c0 (CHead d (Bind Void) u))).(\lambda (w: +T).(\lambda (v: T).(\lambda (H4: (subst0 i w t0 v)).(\lambda (P: Prop).(H1 d +u i H3 w v H4 P)))))))))))))))) c t a H))))). + +theorem arity_gen_cvoid: + \forall (g: G).(\forall (c: C).(\forall (t: T).(\forall (a: A).((arity g c t +a) \to (\forall (d: C).(\forall (u: T).(\forall (i: nat).((getl i c (CHead d +(Bind Void) u)) \to (ex T (\lambda (v: T).(eq T t (lift (S O) i v)))))))))))) +\def + \lambda (g: G).(\lambda (c: C).(\lambda (t: T).(\lambda (a: A).(\lambda (H: +(arity g c t a)).(\lambda (d: C).(\lambda (u: T).(\lambda (i: nat).(\lambda +(H0: (getl i c (CHead d (Bind Void) u))).(let H_x \def (dnf_dec u t i) in +(let H1 \def H_x in (ex_ind T (\lambda (v: T).(or (subst0 i u t (lift (S O) i +v)) (eq T t (lift (S O) i v)))) (ex T (\lambda (v: T).(eq T t (lift (S O) i +v)))) (\lambda (x: T).(\lambda (H2: (or (subst0 i u t (lift (S O) i x)) (eq T +t (lift (S O) i x)))).(or_ind (subst0 i u t (lift (S O) i x)) (eq T t (lift +(S O) i x)) (ex T (\lambda (v: T).(eq T t (lift (S O) i v)))) (\lambda (H3: +(subst0 i u t (lift (S O) i x))).(arity_gen_cvoid_subst0 g c t a H d u i H0 u +(lift (S O) i x) H3 (ex T (\lambda (v: T).(eq T t (lift (S O) i v)))))) +(\lambda (H3: (eq T t (lift (S O) i x))).(let H4 \def (eq_ind T t (\lambda +(t0: T).(arity g c t0 a)) H (lift (S O) i x) H3) in (eq_ind_r T (lift (S O) i +x) (\lambda (t0: T).(ex T (\lambda (v: T).(eq T t0 (lift (S O) i v))))) +(ex_intro T (\lambda (v: T).(eq T (lift (S O) i x) (lift (S O) i v))) x +(refl_equal T (lift (S O) i x))) t H3))) H2))) H1))))))))))). + +theorem arity_fsubst0: + \forall (g: G).(\forall (c1: C).(\forall (t1: T).(\forall (a: A).((arity g +c1 t1 a) \to (\forall (d1: C).(\forall (u: T).(\forall (i: nat).((getl i c1 +(CHead d1 (Bind Abbr) u)) \to (\forall (c2: C).(\forall (t2: T).((fsubst0 i u +c1 t1 c2 t2) \to (arity g c2 t2 a)))))))))))) +\def + \lambda (g: G).(\lambda (c1: C).(\lambda (t1: T).(\lambda (a: A).(\lambda +(H: (arity g c1 t1 a)).(arity_ind g (\lambda (c: C).(\lambda (t: T).(\lambda +(a0: A).(\forall (d1: C).(\forall (u: T).(\forall (i: nat).((getl i c (CHead +d1 (Bind Abbr) u)) \to (\forall (c2: C).(\forall (t2: T).((fsubst0 i u c t c2 +t2) \to (arity g c2 t2 a0))))))))))) (\lambda (c: C).(\lambda (n: +nat).(\lambda (d1: C).(\lambda (u: T).(\lambda (i: nat).(\lambda (_: (getl i +c (CHead d1 (Bind Abbr) u))).(\lambda (c2: C).(\lambda (t2: T).(\lambda (H1: +(fsubst0 i u c (TSort n) c2 t2)).(let H2 \def (fsubst0_gen_base c c2 (TSort +n) t2 u i H1) in (or3_ind (land (eq C c c2) (subst0 i u (TSort n) t2)) (land +(eq T (TSort n) t2) (csubst0 i u c c2)) (land (subst0 i u (TSort n) t2) +(csubst0 i u c c2)) (arity g c2 t2 (ASort O n)) (\lambda (H3: (land (eq C c +c2) (subst0 i u (TSort n) t2))).(and_ind (eq C c c2) (subst0 i u (TSort n) +t2) (arity g c2 t2 (ASort O n)) (\lambda (H4: (eq C c c2)).(\lambda (H5: +(subst0 i u (TSort n) t2)).(eq_ind C c (\lambda (c0: C).(arity g c0 t2 (ASort +O n))) (subst0_gen_sort u t2 i n H5 (arity g c t2 (ASort O n))) c2 H4))) H3)) +(\lambda (H3: (land (eq T (TSort n) t2) (csubst0 i u c c2))).(and_ind (eq T +(TSort n) t2) (csubst0 i u c c2) (arity g c2 t2 (ASort O n)) (\lambda (H4: +(eq T (TSort n) t2)).(\lambda (_: (csubst0 i u c c2)).(eq_ind T (TSort n) +(\lambda (t: T).(arity g c2 t (ASort O n))) (arity_sort g c2 n) t2 H4))) H3)) +(\lambda (H3: (land (subst0 i u (TSort n) t2) (csubst0 i u c c2))).(and_ind +(subst0 i u (TSort n) t2) (csubst0 i u c c2) (arity g c2 t2 (ASort O n)) +(\lambda (H4: (subst0 i u (TSort n) t2)).(\lambda (_: (csubst0 i u c +c2)).(subst0_gen_sort u t2 i n H4 (arity g c2 t2 (ASort O n))))) H3)) +H2))))))))))) (\lambda (c: C).(\lambda (d: C).(\lambda (u: T).(\lambda (i: +nat).(\lambda (H0: (getl i c (CHead d (Bind Abbr) u))).(\lambda (a0: +A).(\lambda (H1: (arity g d u a0)).(\lambda (H2: ((\forall (d1: C).(\forall +(u0: T).(\forall (i0: nat).((getl i0 d (CHead d1 (Bind Abbr) u0)) \to +(\forall (c2: C).(\forall (t2: T).((fsubst0 i0 u0 d u c2 t2) \to (arity g c2 +t2 a0)))))))))).(\lambda (d1: C).(\lambda (u0: T).(\lambda (i0: nat).(\lambda +(H3: (getl i0 c (CHead d1 (Bind Abbr) u0))).(\lambda (c2: C).(\lambda (t2: +T).(\lambda (H4: (fsubst0 i0 u0 c (TLRef i) c2 t2)).(let H5 \def +(fsubst0_gen_base c c2 (TLRef i) t2 u0 i0 H4) in (or3_ind (land (eq C c c2) +(subst0 i0 u0 (TLRef i) t2)) (land (eq T (TLRef i) t2) (csubst0 i0 u0 c c2)) +(land (subst0 i0 u0 (TLRef i) t2) (csubst0 i0 u0 c c2)) (arity g c2 t2 a0) +(\lambda (H6: (land (eq C c c2) (subst0 i0 u0 (TLRef i) t2))).(and_ind (eq C +c c2) (subst0 i0 u0 (TLRef i) t2) (arity g c2 t2 a0) (\lambda (H7: (eq C c +c2)).(\lambda (H8: (subst0 i0 u0 (TLRef i) t2)).(eq_ind C c (\lambda (c0: +C).(arity g c0 t2 a0)) (and_ind (eq nat i i0) (eq T t2 (lift (S i) O u0)) +(arity g c t2 a0) (\lambda (H9: (eq nat i i0)).(\lambda (H10: (eq T t2 (lift +(S i) O u0))).(eq_ind_r T (lift (S i) O u0) (\lambda (t: T).(arity g c t a0)) +(let H11 \def (eq_ind_r nat i0 (\lambda (n: nat).(getl n c (CHead d1 (Bind +Abbr) u0))) H3 i H9) in (let H12 \def (eq_ind C (CHead d (Bind Abbr) u) +(\lambda (c0: C).(getl i c c0)) H0 (CHead d1 (Bind Abbr) u0) (getl_mono c +(CHead d (Bind Abbr) u) i H0 (CHead d1 (Bind Abbr) u0) H11)) in (let H13 \def +(f_equal C C (\lambda (e: C).(match e in C return (\lambda (_: C).C) with +[(CSort _) \Rightarrow d | (CHead c0 _ _) \Rightarrow c0])) (CHead d (Bind +Abbr) u) (CHead d1 (Bind Abbr) u0) (getl_mono c (CHead d (Bind Abbr) u) i H0 +(CHead d1 (Bind Abbr) u0) H11)) in ((let H14 \def (f_equal C T (\lambda (e: +C).(match e in C return (\lambda (_: C).T) with [(CSort _) \Rightarrow u | +(CHead _ _ t) \Rightarrow t])) (CHead d (Bind Abbr) u) (CHead d1 (Bind Abbr) +u0) (getl_mono c (CHead d (Bind Abbr) u) i H0 (CHead d1 (Bind Abbr) u0) H11)) +in (\lambda (H15: (eq C d d1)).(let H16 \def (eq_ind_r T u0 (\lambda (t: +T).(getl i c (CHead d1 (Bind Abbr) t))) H12 u H14) in (eq_ind T u (\lambda +(t: T).(arity g c (lift (S i) O t) a0)) (let H17 \def (eq_ind_r C d1 (\lambda +(c0: C).(getl i c (CHead c0 (Bind Abbr) u))) H16 d H15) in (arity_lift g d u +a0 H1 c (S i) O (getl_drop Abbr c d u i H17))) u0 H14)))) H13)))) t2 H10))) +(subst0_gen_lref u0 t2 i0 i H8)) c2 H7))) H6)) (\lambda (H6: (land (eq T +(TLRef i) t2) (csubst0 i0 u0 c c2))).(and_ind (eq T (TLRef i) t2) (csubst0 i0 +u0 c c2) (arity g c2 t2 a0) (\lambda (H7: (eq T (TLRef i) t2)).(\lambda (H8: +(csubst0 i0 u0 c c2)).(eq_ind T (TLRef i) (\lambda (t: T).(arity g c2 t a0)) +(lt_le_e i i0 (arity g c2 (TLRef i) a0) (\lambda (H9: (lt i i0)).(let H10 +\def (csubst0_getl_lt i0 i H9 c c2 u0 H8 (CHead d (Bind Abbr) u) H0) in +(or4_ind (getl i c2 (CHead d (Bind Abbr) u)) (ex3_4 B C T T (\lambda (b: +B).(\lambda (e0: C).(\lambda (u1: T).(\lambda (_: T).(eq C (CHead d (Bind +Abbr) u) (CHead e0 (Bind b) u1)))))) (\lambda (b: B).(\lambda (e0: +C).(\lambda (_: T).(\lambda (w: T).(getl i c2 (CHead e0 (Bind b) w)))))) +(\lambda (_: B).(\lambda (_: C).(\lambda (u1: T).(\lambda (w: T).(subst0 +(minus i0 (S i)) u0 u1 w)))))) (ex3_4 B C C T (\lambda (b: B).(\lambda (e1: +C).(\lambda (_: C).(\lambda (u1: T).(eq C (CHead d (Bind Abbr) u) (CHead e1 +(Bind b) u1)))))) (\lambda (b: B).(\lambda (_: C).(\lambda (e2: C).(\lambda +(u1: T).(getl i c2 (CHead e2 (Bind b) u1)))))) (\lambda (_: B).(\lambda (e1: +C).(\lambda (e2: C).(\lambda (_: T).(csubst0 (minus i0 (S i)) u0 e1 e2)))))) +(ex4_5 B C C T T (\lambda (b: B).(\lambda (e1: C).(\lambda (_: C).(\lambda +(u1: T).(\lambda (_: T).(eq C (CHead d (Bind Abbr) u) (CHead e1 (Bind b) +u1))))))) (\lambda (b: B).(\lambda (_: C).(\lambda (e2: C).(\lambda (_: +T).(\lambda (w: T).(getl i c2 (CHead e2 (Bind b) w))))))) (\lambda (_: +B).(\lambda (_: C).(\lambda (_: C).(\lambda (u1: T).(\lambda (w: T).(subst0 +(minus i0 (S i)) u0 u1 w)))))) (\lambda (_: B).(\lambda (e1: C).(\lambda (e2: +C).(\lambda (_: T).(\lambda (_: T).(csubst0 (minus i0 (S i)) u0 e1 e2))))))) +(arity g c2 (TLRef i) a0) (\lambda (H11: (getl i c2 (CHead d (Bind Abbr) +u))).(let H12 \def (eq_ind nat (minus i0 i) (\lambda (n: nat).(getl n (CHead +d (Bind Abbr) u) (CHead d1 (Bind Abbr) u0))) (getl_conf_le i0 (CHead d1 (Bind +Abbr) u0) c H3 (CHead d (Bind Abbr) u) i H0 (le_S_n i i0 (le_S (S i) i0 H9))) +(S (minus i0 (S i))) (minus_x_Sy i0 i H9)) in (arity_abbr g c2 d u i H11 a0 +H1))) (\lambda (H11: (ex3_4 B C T T (\lambda (b: B).(\lambda (e0: C).(\lambda +(u1: T).(\lambda (_: T).(eq C (CHead d (Bind Abbr) u) (CHead e0 (Bind b) +u1)))))) (\lambda (b: B).(\lambda (e0: C).(\lambda (_: T).(\lambda (w: +T).(getl i c2 (CHead e0 (Bind b) w)))))) (\lambda (_: B).(\lambda (_: +C).(\lambda (u1: T).(\lambda (w: T).(subst0 (minus i0 (S i)) u0 u1 +w))))))).(ex3_4_ind B C T T (\lambda (b: B).(\lambda (e0: C).(\lambda (u1: +T).(\lambda (_: T).(eq C (CHead d (Bind Abbr) u) (CHead e0 (Bind b) u1)))))) +(\lambda (b: B).(\lambda (e0: C).(\lambda (_: T).(\lambda (w: T).(getl i c2 +(CHead e0 (Bind b) w)))))) (\lambda (_: B).(\lambda (_: C).(\lambda (u1: +T).(\lambda (w: T).(subst0 (minus i0 (S i)) u0 u1 w))))) (arity g c2 (TLRef +i) a0) (\lambda (x0: B).(\lambda (x1: C).(\lambda (x2: T).(\lambda (x3: +T).(\lambda (H12: (eq C (CHead d (Bind Abbr) u) (CHead x1 (Bind x0) +x2))).(\lambda (H13: (getl i c2 (CHead x1 (Bind x0) x3))).(\lambda (H14: +(subst0 (minus i0 (S i)) u0 x2 x3)).(let H15 \def (eq_ind nat (minus i0 i) +(\lambda (n: nat).(getl n (CHead d (Bind Abbr) u) (CHead d1 (Bind Abbr) u0))) +(getl_conf_le i0 (CHead d1 (Bind Abbr) u0) c H3 (CHead d (Bind Abbr) u) i H0 +(le_S_n i i0 (le_S (S i) i0 H9))) (S (minus i0 (S i))) (minus_x_Sy i0 i H9)) +in (let H16 \def (f_equal C C (\lambda (e: C).(match e in C return (\lambda +(_: C).C) with [(CSort _) \Rightarrow d | (CHead c0 _ _) \Rightarrow c0])) +(CHead d (Bind Abbr) u) (CHead x1 (Bind x0) x2) H12) in ((let H17 \def +(f_equal C B (\lambda (e: C).(match e in C return (\lambda (_: C).B) with +[(CSort _) \Rightarrow Abbr | (CHead _ k _) \Rightarrow (match k in K return +(\lambda (_: K).B) with [(Bind b) \Rightarrow b | (Flat _) \Rightarrow +Abbr])])) (CHead d (Bind Abbr) u) (CHead x1 (Bind x0) x2) H12) in ((let H18 +\def (f_equal C T (\lambda (e: C).(match e in C return (\lambda (_: C).T) +with [(CSort _) \Rightarrow u | (CHead _ _ t) \Rightarrow t])) (CHead d (Bind +Abbr) u) (CHead x1 (Bind x0) x2) H12) in (\lambda (H19: (eq B Abbr +x0)).(\lambda (H20: (eq C d x1)).(let H21 \def (eq_ind_r T x2 (\lambda (t: +T).(subst0 (minus i0 (S i)) u0 t x3)) H14 u H18) in (let H22 \def (eq_ind_r C +x1 (\lambda (c0: C).(getl i c2 (CHead c0 (Bind x0) x3))) H13 d H20) in (let +H23 \def (eq_ind_r B x0 (\lambda (b: B).(getl i c2 (CHead d (Bind b) x3))) +H22 Abbr H19) in (arity_abbr g c2 d x3 i H23 a0 (H2 d1 u0 (r (Bind Abbr) +(minus i0 (S i))) (getl_gen_S (Bind Abbr) d (CHead d1 (Bind Abbr) u0) u +(minus i0 (S i)) H15) d x3 (fsubst0_snd (r (Bind Abbr) (minus i0 (S i))) u0 d +u x3 H21))))))))) H17)) H16)))))))))) H11)) (\lambda (H11: (ex3_4 B C C T +(\lambda (b: B).(\lambda (e1: C).(\lambda (_: C).(\lambda (u1: T).(eq C +(CHead d (Bind Abbr) u) (CHead e1 (Bind b) u1)))))) (\lambda (b: B).(\lambda +(_: C).(\lambda (e2: C).(\lambda (u1: T).(getl i c2 (CHead e2 (Bind b) +u1)))))) (\lambda (_: B).(\lambda (e1: C).(\lambda (e2: C).(\lambda (_: +T).(csubst0 (minus i0 (S i)) u0 e1 e2))))))).(ex3_4_ind B C C T (\lambda (b: +B).(\lambda (e1: C).(\lambda (_: C).(\lambda (u1: T).(eq C (CHead d (Bind +Abbr) u) (CHead e1 (Bind b) u1)))))) (\lambda (b: B).(\lambda (_: C).(\lambda +(e2: C).(\lambda (u1: T).(getl i c2 (CHead e2 (Bind b) u1)))))) (\lambda (_: +B).(\lambda (e1: C).(\lambda (e2: C).(\lambda (_: T).(csubst0 (minus i0 (S +i)) u0 e1 e2))))) (arity g c2 (TLRef i) a0) (\lambda (x0: B).(\lambda (x1: +C).(\lambda (x2: C).(\lambda (x3: T).(\lambda (H12: (eq C (CHead d (Bind +Abbr) u) (CHead x1 (Bind x0) x3))).(\lambda (H13: (getl i c2 (CHead x2 (Bind +x0) x3))).(\lambda (H14: (csubst0 (minus i0 (S i)) u0 x1 x2)).(let H15 \def +(eq_ind nat (minus i0 i) (\lambda (n: nat).(getl n (CHead d (Bind Abbr) u) +(CHead d1 (Bind Abbr) u0))) (getl_conf_le i0 (CHead d1 (Bind Abbr) u0) c H3 +(CHead d (Bind Abbr) u) i H0 (le_S_n i i0 (le_S (S i) i0 H9))) (S (minus i0 +(S i))) (minus_x_Sy i0 i H9)) in (let H16 \def (f_equal C C (\lambda (e: +C).(match e in C return (\lambda (_: C).C) with [(CSort _) \Rightarrow d | +(CHead c0 _ _) \Rightarrow c0])) (CHead d (Bind Abbr) u) (CHead x1 (Bind x0) +x3) H12) in ((let H17 \def (f_equal C B (\lambda (e: C).(match e in C return +(\lambda (_: C).B) with [(CSort _) \Rightarrow Abbr | (CHead _ k _) +\Rightarrow (match k in K return (\lambda (_: K).B) with [(Bind b) +\Rightarrow b | (Flat _) \Rightarrow Abbr])])) (CHead d (Bind Abbr) u) (CHead +x1 (Bind x0) x3) H12) in ((let H18 \def (f_equal C T (\lambda (e: C).(match e +in C return (\lambda (_: C).T) with [(CSort _) \Rightarrow u | (CHead _ _ t) +\Rightarrow t])) (CHead d (Bind Abbr) u) (CHead x1 (Bind x0) x3) H12) in +(\lambda (H19: (eq B Abbr x0)).(\lambda (H20: (eq C d x1)).(let H21 \def +(eq_ind_r T x3 (\lambda (t: T).(getl i c2 (CHead x2 (Bind x0) t))) H13 u H18) +in (let H22 \def (eq_ind_r C x1 (\lambda (c0: C).(csubst0 (minus i0 (S i)) u0 +c0 x2)) H14 d H20) in (let H23 \def (eq_ind_r B x0 (\lambda (b: B).(getl i c2 +(CHead x2 (Bind b) u))) H21 Abbr H19) in (arity_abbr g c2 x2 u i H23 a0 (H2 +d1 u0 (r (Bind Abbr) (minus i0 (S i))) (getl_gen_S (Bind Abbr) d (CHead d1 +(Bind Abbr) u0) u (minus i0 (S i)) H15) x2 u (fsubst0_fst (r (Bind Abbr) +(minus i0 (S i))) u0 d u x2 H22))))))))) H17)) H16)))))))))) H11)) (\lambda +(H11: (ex4_5 B C C T T (\lambda (b: B).(\lambda (e1: C).(\lambda (_: +C).(\lambda (u1: T).(\lambda (_: T).(eq C (CHead d (Bind Abbr) u) (CHead e1 +(Bind b) u1))))))) (\lambda (b: B).(\lambda (_: C).(\lambda (e2: C).(\lambda +(_: T).(\lambda (w: T).(getl i c2 (CHead e2 (Bind b) w))))))) (\lambda (_: +B).(\lambda (_: C).(\lambda (_: C).(\lambda (u1: T).(\lambda (w: T).(subst0 +(minus i0 (S i)) u0 u1 w)))))) (\lambda (_: B).(\lambda (e1: C).(\lambda (e2: +C).(\lambda (_: T).(\lambda (_: T).(csubst0 (minus i0 (S i)) u0 e1 +e2)))))))).(ex4_5_ind B C C T T (\lambda (b: B).(\lambda (e1: C).(\lambda (_: +C).(\lambda (u1: T).(\lambda (_: T).(eq C (CHead d (Bind Abbr) u) (CHead e1 +(Bind b) u1))))))) (\lambda (b: B).(\lambda (_: C).(\lambda (e2: C).(\lambda +(_: T).(\lambda (w: T).(getl i c2 (CHead e2 (Bind b) w))))))) (\lambda (_: +B).(\lambda (_: C).(\lambda (_: C).(\lambda (u1: T).(\lambda (w: T).(subst0 +(minus i0 (S i)) u0 u1 w)))))) (\lambda (_: B).(\lambda (e1: C).(\lambda (e2: +C).(\lambda (_: T).(\lambda (_: T).(csubst0 (minus i0 (S i)) u0 e1 e2)))))) +(arity g c2 (TLRef i) a0) (\lambda (x0: B).(\lambda (x1: C).(\lambda (x2: +C).(\lambda (x3: T).(\lambda (x4: T).(\lambda (H12: (eq C (CHead d (Bind +Abbr) u) (CHead x1 (Bind x0) x3))).(\lambda (H13: (getl i c2 (CHead x2 (Bind +x0) x4))).(\lambda (H14: (subst0 (minus i0 (S i)) u0 x3 x4)).(\lambda (H15: +(csubst0 (minus i0 (S i)) u0 x1 x2)).(let H16 \def (eq_ind nat (minus i0 i) +(\lambda (n: nat).(getl n (CHead d (Bind Abbr) u) (CHead d1 (Bind Abbr) u0))) +(getl_conf_le i0 (CHead d1 (Bind Abbr) u0) c H3 (CHead d (Bind Abbr) u) i H0 +(le_S_n i i0 (le_S (S i) i0 H9))) (S (minus i0 (S i))) (minus_x_Sy i0 i H9)) +in (let H17 \def (f_equal C C (\lambda (e: C).(match e in C return (\lambda +(_: C).C) with [(CSort _) \Rightarrow d | (CHead c0 _ _) \Rightarrow c0])) +(CHead d (Bind Abbr) u) (CHead x1 (Bind x0) x3) H12) in ((let H18 \def +(f_equal C B (\lambda (e: C).(match e in C return (\lambda (_: C).B) with +[(CSort _) \Rightarrow Abbr | (CHead _ k _) \Rightarrow (match k in K return +(\lambda (_: K).B) with [(Bind b) \Rightarrow b | (Flat _) \Rightarrow +Abbr])])) (CHead d (Bind Abbr) u) (CHead x1 (Bind x0) x3) H12) in ((let H19 +\def (f_equal C T (\lambda (e: C).(match e in C return (\lambda (_: C).T) +with [(CSort _) \Rightarrow u | (CHead _ _ t) \Rightarrow t])) (CHead d (Bind +Abbr) u) (CHead x1 (Bind x0) x3) H12) in (\lambda (H20: (eq B Abbr +x0)).(\lambda (H21: (eq C d x1)).(let H22 \def (eq_ind_r T x3 (\lambda (t: +T).(subst0 (minus i0 (S i)) u0 t x4)) H14 u H19) in (let H23 \def (eq_ind_r C +x1 (\lambda (c0: C).(csubst0 (minus i0 (S i)) u0 c0 x2)) H15 d H21) in (let +H24 \def (eq_ind_r B x0 (\lambda (b: B).(getl i c2 (CHead x2 (Bind b) x4))) +H13 Abbr H20) in (arity_abbr g c2 x2 x4 i H24 a0 (H2 d1 u0 (r (Bind Abbr) +(minus i0 (S i))) (getl_gen_S (Bind Abbr) d (CHead d1 (Bind Abbr) u0) u +(minus i0 (S i)) H16) x2 x4 (fsubst0_both (r (Bind Abbr) (minus i0 (S i))) u0 +d u x4 H22 x2 H23))))))))) H18)) H17)))))))))))) H11)) H10))) (\lambda (H9: +(le i0 i)).(arity_abbr g c2 d u i (csubst0_getl_ge i0 i H9 c c2 u0 H8 (CHead +d (Bind Abbr) u) H0) a0 H1))) t2 H7))) H6)) (\lambda (H6: (land (subst0 i0 u0 +(TLRef i) t2) (csubst0 i0 u0 c c2))).(and_ind (subst0 i0 u0 (TLRef i) t2) +(csubst0 i0 u0 c c2) (arity g c2 t2 a0) (\lambda (H7: (subst0 i0 u0 (TLRef i) +t2)).(\lambda (H8: (csubst0 i0 u0 c c2)).(and_ind (eq nat i i0) (eq T t2 +(lift (S i) O u0)) (arity g c2 t2 a0) (\lambda (H9: (eq nat i i0)).(\lambda +(H10: (eq T t2 (lift (S i) O u0))).(eq_ind_r T (lift (S i) O u0) (\lambda (t: +T).(arity g c2 t a0)) (let H11 \def (eq_ind_r nat i0 (\lambda (n: +nat).(csubst0 n u0 c c2)) H8 i H9) in (let H12 \def (eq_ind_r nat i0 (\lambda +(n: nat).(getl n c (CHead d1 (Bind Abbr) u0))) H3 i H9) in (let H13 \def +(eq_ind C (CHead d (Bind Abbr) u) (\lambda (c0: C).(getl i c c0)) H0 (CHead +d1 (Bind Abbr) u0) (getl_mono c (CHead d (Bind Abbr) u) i H0 (CHead d1 (Bind +Abbr) u0) H12)) in (let H14 \def (f_equal C C (\lambda (e: C).(match e in C +return (\lambda (_: C).C) with [(CSort _) \Rightarrow d | (CHead c0 _ _) +\Rightarrow c0])) (CHead d (Bind Abbr) u) (CHead d1 (Bind Abbr) u0) +(getl_mono c (CHead d (Bind Abbr) u) i H0 (CHead d1 (Bind Abbr) u0) H12)) in +((let H15 \def (f_equal C T (\lambda (e: C).(match e in C return (\lambda (_: +C).T) with [(CSort _) \Rightarrow u | (CHead _ _ t) \Rightarrow t])) (CHead d +(Bind Abbr) u) (CHead d1 (Bind Abbr) u0) (getl_mono c (CHead d (Bind Abbr) u) +i H0 (CHead d1 (Bind Abbr) u0) H12)) in (\lambda (H16: (eq C d d1)).(let H17 +\def (eq_ind_r T u0 (\lambda (t: T).(getl i c (CHead d1 (Bind Abbr) t))) H13 +u H15) in (let H18 \def (eq_ind_r T u0 (\lambda (t: T).(csubst0 i t c c2)) +H11 u H15) in (eq_ind T u (\lambda (t: T).(arity g c2 (lift (S i) O t) a0)) +(let H19 \def (eq_ind_r C d1 (\lambda (c0: C).(getl i c (CHead c0 (Bind Abbr) +u))) H17 d H16) in (arity_lift g d u a0 H1 c2 (S i) O (getl_drop Abbr c2 d u +i (csubst0_getl_ge i i (le_n i) c c2 u H18 (CHead d (Bind Abbr) u) H19)))) u0 +H15))))) H14))))) t2 H10))) (subst0_gen_lref u0 t2 i0 i H7)))) H6)) +H5))))))))))))))))) (\lambda (c: C).(\lambda (d: C).(\lambda (u: T).(\lambda +(i: nat).(\lambda (H0: (getl i c (CHead d (Bind Abst) u))).(\lambda (a0: +A).(\lambda (H1: (arity g d u (asucc g a0))).(\lambda (H2: ((\forall (d1: +C).(\forall (u0: T).(\forall (i0: nat).((getl i0 d (CHead d1 (Bind Abbr) u0)) +\to (\forall (c2: C).(\forall (t2: T).((fsubst0 i0 u0 d u c2 t2) \to (arity g +c2 t2 (asucc g a0))))))))))).(\lambda (d1: C).(\lambda (u0: T).(\lambda (i0: +nat).(\lambda (H3: (getl i0 c (CHead d1 (Bind Abbr) u0))).(\lambda (c2: +C).(\lambda (t2: T).(\lambda (H4: (fsubst0 i0 u0 c (TLRef i) c2 t2)).(let H5 +\def (fsubst0_gen_base c c2 (TLRef i) t2 u0 i0 H4) in (or3_ind (land (eq C c +c2) (subst0 i0 u0 (TLRef i) t2)) (land (eq T (TLRef i) t2) (csubst0 i0 u0 c +c2)) (land (subst0 i0 u0 (TLRef i) t2) (csubst0 i0 u0 c c2)) (arity g c2 t2 +a0) (\lambda (H6: (land (eq C c c2) (subst0 i0 u0 (TLRef i) t2))).(and_ind +(eq C c c2) (subst0 i0 u0 (TLRef i) t2) (arity g c2 t2 a0) (\lambda (H7: (eq +C c c2)).(\lambda (H8: (subst0 i0 u0 (TLRef i) t2)).(eq_ind C c (\lambda (c0: +C).(arity g c0 t2 a0)) (and_ind (eq nat i i0) (eq T t2 (lift (S i) O u0)) +(arity g c t2 a0) (\lambda (H9: (eq nat i i0)).(\lambda (H10: (eq T t2 (lift +(S i) O u0))).(eq_ind_r T (lift (S i) O u0) (\lambda (t: T).(arity g c t a0)) +(let H11 \def (eq_ind_r nat i0 (\lambda (n: nat).(getl n c (CHead d1 (Bind +Abbr) u0))) H3 i H9) in (let H12 \def (eq_ind C (CHead d (Bind Abst) u) +(\lambda (c0: C).(getl i c c0)) H0 (CHead d1 (Bind Abbr) u0) (getl_mono c +(CHead d (Bind Abst) u) i H0 (CHead d1 (Bind Abbr) u0) H11)) in (let H13 \def +(eq_ind C (CHead d (Bind Abst) u) (\lambda (ee: C).(match ee in C return +(\lambda (_: C).Prop) with [(CSort _) \Rightarrow False | (CHead _ k _) +\Rightarrow (match k in K return (\lambda (_: K).Prop) with [(Bind b) +\Rightarrow (match b in B return (\lambda (_: B).Prop) with [Abbr \Rightarrow +False | Abst \Rightarrow True | Void \Rightarrow False]) | (Flat _) +\Rightarrow False])])) I (CHead d1 (Bind Abbr) u0) (getl_mono c (CHead d +(Bind Abst) u) i H0 (CHead d1 (Bind Abbr) u0) H11)) in (False_ind (arity g c +(lift (S i) O u0) a0) H13)))) t2 H10))) (subst0_gen_lref u0 t2 i0 i H8)) c2 +H7))) H6)) (\lambda (H6: (land (eq T (TLRef i) t2) (csubst0 i0 u0 c +c2))).(and_ind (eq T (TLRef i) t2) (csubst0 i0 u0 c c2) (arity g c2 t2 a0) +(\lambda (H7: (eq T (TLRef i) t2)).(\lambda (H8: (csubst0 i0 u0 c +c2)).(eq_ind T (TLRef i) (\lambda (t: T).(arity g c2 t a0)) (lt_le_e i i0 +(arity g c2 (TLRef i) a0) (\lambda (H9: (lt i i0)).(let H10 \def +(csubst0_getl_lt i0 i H9 c c2 u0 H8 (CHead d (Bind Abst) u) H0) in (or4_ind +(getl i c2 (CHead d (Bind Abst) u)) (ex3_4 B C T T (\lambda (b: B).(\lambda +(e0: C).(\lambda (u1: T).(\lambda (_: T).(eq C (CHead d (Bind Abst) u) (CHead +e0 (Bind b) u1)))))) (\lambda (b: B).(\lambda (e0: C).(\lambda (_: +T).(\lambda (w: T).(getl i c2 (CHead e0 (Bind b) w)))))) (\lambda (_: +B).(\lambda (_: C).(\lambda (u1: T).(\lambda (w: T).(subst0 (minus i0 (S i)) +u0 u1 w)))))) (ex3_4 B C C T (\lambda (b: B).(\lambda (e1: C).(\lambda (_: +C).(\lambda (u1: T).(eq C (CHead d (Bind Abst) u) (CHead e1 (Bind b) u1)))))) +(\lambda (b: B).(\lambda (_: C).(\lambda (e2: C).(\lambda (u1: T).(getl i c2 +(CHead e2 (Bind b) u1)))))) (\lambda (_: B).(\lambda (e1: C).(\lambda (e2: +C).(\lambda (_: T).(csubst0 (minus i0 (S i)) u0 e1 e2)))))) (ex4_5 B C C T T +(\lambda (b: B).(\lambda (e1: C).(\lambda (_: C).(\lambda (u1: T).(\lambda +(_: T).(eq C (CHead d (Bind Abst) u) (CHead e1 (Bind b) u1))))))) (\lambda +(b: B).(\lambda (_: C).(\lambda (e2: C).(\lambda (_: T).(\lambda (w: T).(getl +i c2 (CHead e2 (Bind b) w))))))) (\lambda (_: B).(\lambda (_: C).(\lambda (_: +C).(\lambda (u1: T).(\lambda (w: T).(subst0 (minus i0 (S i)) u0 u1 w)))))) +(\lambda (_: B).(\lambda (e1: C).(\lambda (e2: C).(\lambda (_: T).(\lambda +(_: T).(csubst0 (minus i0 (S i)) u0 e1 e2))))))) (arity g c2 (TLRef i) a0) +(\lambda (H11: (getl i c2 (CHead d (Bind Abst) u))).(let H12 \def (eq_ind nat +(minus i0 i) (\lambda (n: nat).(getl n (CHead d (Bind Abst) u) (CHead d1 +(Bind Abbr) u0))) (getl_conf_le i0 (CHead d1 (Bind Abbr) u0) c H3 (CHead d +(Bind Abst) u) i H0 (le_S_n i i0 (le_S (S i) i0 H9))) (S (minus i0 (S i))) +(minus_x_Sy i0 i H9)) in (arity_abst g c2 d u i H11 a0 H1))) (\lambda (H11: +(ex3_4 B C T T (\lambda (b: B).(\lambda (e0: C).(\lambda (u1: T).(\lambda (_: +T).(eq C (CHead d (Bind Abst) u) (CHead e0 (Bind b) u1)))))) (\lambda (b: +B).(\lambda (e0: C).(\lambda (_: T).(\lambda (w: T).(getl i c2 (CHead e0 +(Bind b) w)))))) (\lambda (_: B).(\lambda (_: C).(\lambda (u1: T).(\lambda +(w: T).(subst0 (minus i0 (S i)) u0 u1 w))))))).(ex3_4_ind B C T T (\lambda +(b: B).(\lambda (e0: C).(\lambda (u1: T).(\lambda (_: T).(eq C (CHead d (Bind +Abst) u) (CHead e0 (Bind b) u1)))))) (\lambda (b: B).(\lambda (e0: +C).(\lambda (_: T).(\lambda (w: T).(getl i c2 (CHead e0 (Bind b) w)))))) +(\lambda (_: B).(\lambda (_: C).(\lambda (u1: T).(\lambda (w: T).(subst0 +(minus i0 (S i)) u0 u1 w))))) (arity g c2 (TLRef i) a0) (\lambda (x0: +B).(\lambda (x1: C).(\lambda (x2: T).(\lambda (x3: T).(\lambda (H12: (eq C +(CHead d (Bind Abst) u) (CHead x1 (Bind x0) x2))).(\lambda (H13: (getl i c2 +(CHead x1 (Bind x0) x3))).(\lambda (H14: (subst0 (minus i0 (S i)) u0 x2 +x3)).(let H15 \def (eq_ind nat (minus i0 i) (\lambda (n: nat).(getl n (CHead +d (Bind Abst) u) (CHead d1 (Bind Abbr) u0))) (getl_conf_le i0 (CHead d1 (Bind +Abbr) u0) c H3 (CHead d (Bind Abst) u) i H0 (le_S_n i i0 (le_S (S i) i0 H9))) +(S (minus i0 (S i))) (minus_x_Sy i0 i H9)) in (let H16 \def (f_equal C C +(\lambda (e: C).(match e in C return (\lambda (_: C).C) with [(CSort _) +\Rightarrow d | (CHead c0 _ _) \Rightarrow c0])) (CHead d (Bind Abst) u) +(CHead x1 (Bind x0) x2) H12) in ((let H17 \def (f_equal C B (\lambda (e: +C).(match e in C return (\lambda (_: C).B) with [(CSort _) \Rightarrow Abst | +(CHead _ k _) \Rightarrow (match k in K return (\lambda (_: K).B) with [(Bind +b) \Rightarrow b | (Flat _) \Rightarrow Abst])])) (CHead d (Bind Abst) u) +(CHead x1 (Bind x0) x2) H12) in ((let H18 \def (f_equal C T (\lambda (e: +C).(match e in C return (\lambda (_: C).T) with [(CSort _) \Rightarrow u | +(CHead _ _ t) \Rightarrow t])) (CHead d (Bind Abst) u) (CHead x1 (Bind x0) +x2) H12) in (\lambda (H19: (eq B Abst x0)).(\lambda (H20: (eq C d x1)).(let +H21 \def (eq_ind_r T x2 (\lambda (t: T).(subst0 (minus i0 (S i)) u0 t x3)) +H14 u H18) in (let H22 \def (eq_ind_r C x1 (\lambda (c0: C).(getl i c2 (CHead +c0 (Bind x0) x3))) H13 d H20) in (let H23 \def (eq_ind_r B x0 (\lambda (b: +B).(getl i c2 (CHead d (Bind b) x3))) H22 Abst H19) in (arity_abst g c2 d x3 +i H23 a0 (H2 d1 u0 (r (Bind Abst) (minus i0 (S i))) (getl_gen_S (Bind Abst) d +(CHead d1 (Bind Abbr) u0) u (minus i0 (S i)) H15) d x3 (fsubst0_snd (r (Bind +Abst) (minus i0 (S i))) u0 d u x3 H21))))))))) H17)) H16)))))))))) H11)) +(\lambda (H11: (ex3_4 B C C T (\lambda (b: B).(\lambda (e1: C).(\lambda (_: +C).(\lambda (u1: T).(eq C (CHead d (Bind Abst) u) (CHead e1 (Bind b) u1)))))) +(\lambda (b: B).(\lambda (_: C).(\lambda (e2: C).(\lambda (u1: T).(getl i c2 +(CHead e2 (Bind b) u1)))))) (\lambda (_: B).(\lambda (e1: C).(\lambda (e2: +C).(\lambda (_: T).(csubst0 (minus i0 (S i)) u0 e1 e2))))))).(ex3_4_ind B C C +T (\lambda (b: B).(\lambda (e1: C).(\lambda (_: C).(\lambda (u1: T).(eq C +(CHead d (Bind Abst) u) (CHead e1 (Bind b) u1)))))) (\lambda (b: B).(\lambda +(_: C).(\lambda (e2: C).(\lambda (u1: T).(getl i c2 (CHead e2 (Bind b) +u1)))))) (\lambda (_: B).(\lambda (e1: C).(\lambda (e2: C).(\lambda (_: +T).(csubst0 (minus i0 (S i)) u0 e1 e2))))) (arity g c2 (TLRef i) a0) (\lambda +(x0: B).(\lambda (x1: C).(\lambda (x2: C).(\lambda (x3: T).(\lambda (H12: (eq +C (CHead d (Bind Abst) u) (CHead x1 (Bind x0) x3))).(\lambda (H13: (getl i c2 +(CHead x2 (Bind x0) x3))).(\lambda (H14: (csubst0 (minus i0 (S i)) u0 x1 +x2)).(let H15 \def (eq_ind nat (minus i0 i) (\lambda (n: nat).(getl n (CHead +d (Bind Abst) u) (CHead d1 (Bind Abbr) u0))) (getl_conf_le i0 (CHead d1 (Bind +Abbr) u0) c H3 (CHead d (Bind Abst) u) i H0 (le_S_n i i0 (le_S (S i) i0 H9))) +(S (minus i0 (S i))) (minus_x_Sy i0 i H9)) in (let H16 \def (f_equal C C +(\lambda (e: C).(match e in C return (\lambda (_: C).C) with [(CSort _) +\Rightarrow d | (CHead c0 _ _) \Rightarrow c0])) (CHead d (Bind Abst) u) +(CHead x1 (Bind x0) x3) H12) in ((let H17 \def (f_equal C B (\lambda (e: +C).(match e in C return (\lambda (_: C).B) with [(CSort _) \Rightarrow Abst | +(CHead _ k _) \Rightarrow (match k in K return (\lambda (_: K).B) with [(Bind +b) \Rightarrow b | (Flat _) \Rightarrow Abst])])) (CHead d (Bind Abst) u) +(CHead x1 (Bind x0) x3) H12) in ((let H18 \def (f_equal C T (\lambda (e: +C).(match e in C return (\lambda (_: C).T) with [(CSort _) \Rightarrow u | +(CHead _ _ t) \Rightarrow t])) (CHead d (Bind Abst) u) (CHead x1 (Bind x0) +x3) H12) in (\lambda (H19: (eq B Abst x0)).(\lambda (H20: (eq C d x1)).(let +H21 \def (eq_ind_r T x3 (\lambda (t: T).(getl i c2 (CHead x2 (Bind x0) t))) +H13 u H18) in (let H22 \def (eq_ind_r C x1 (\lambda (c0: C).(csubst0 (minus +i0 (S i)) u0 c0 x2)) H14 d H20) in (let H23 \def (eq_ind_r B x0 (\lambda (b: +B).(getl i c2 (CHead x2 (Bind b) u))) H21 Abst H19) in (arity_abst g c2 x2 u +i H23 a0 (H2 d1 u0 (r (Bind Abst) (minus i0 (S i))) (getl_gen_S (Bind Abst) d +(CHead d1 (Bind Abbr) u0) u (minus i0 (S i)) H15) x2 u (fsubst0_fst (r (Bind +Abst) (minus i0 (S i))) u0 d u x2 H22))))))))) H17)) H16)))))))))) H11)) +(\lambda (H11: (ex4_5 B C C T T (\lambda (b: B).(\lambda (e1: C).(\lambda (_: +C).(\lambda (u1: T).(\lambda (_: T).(eq C (CHead d (Bind Abst) u) (CHead e1 +(Bind b) u1))))))) (\lambda (b: B).(\lambda (_: C).(\lambda (e2: C).(\lambda +(_: T).(\lambda (w: T).(getl i c2 (CHead e2 (Bind b) w))))))) (\lambda (_: +B).(\lambda (_: C).(\lambda (_: C).(\lambda (u1: T).(\lambda (w: T).(subst0 +(minus i0 (S i)) u0 u1 w)))))) (\lambda (_: B).(\lambda (e1: C).(\lambda (e2: +C).(\lambda (_: T).(\lambda (_: T).(csubst0 (minus i0 (S i)) u0 e1 +e2)))))))).(ex4_5_ind B C C T T (\lambda (b: B).(\lambda (e1: C).(\lambda (_: +C).(\lambda (u1: T).(\lambda (_: T).(eq C (CHead d (Bind Abst) u) (CHead e1 +(Bind b) u1))))))) (\lambda (b: B).(\lambda (_: C).(\lambda (e2: C).(\lambda +(_: T).(\lambda (w: T).(getl i c2 (CHead e2 (Bind b) w))))))) (\lambda (_: +B).(\lambda (_: C).(\lambda (_: C).(\lambda (u1: T).(\lambda (w: T).(subst0 +(minus i0 (S i)) u0 u1 w)))))) (\lambda (_: B).(\lambda (e1: C).(\lambda (e2: +C).(\lambda (_: T).(\lambda (_: T).(csubst0 (minus i0 (S i)) u0 e1 e2)))))) +(arity g c2 (TLRef i) a0) (\lambda (x0: B).(\lambda (x1: C).(\lambda (x2: +C).(\lambda (x3: T).(\lambda (x4: T).(\lambda (H12: (eq C (CHead d (Bind +Abst) u) (CHead x1 (Bind x0) x3))).(\lambda (H13: (getl i c2 (CHead x2 (Bind +x0) x4))).(\lambda (H14: (subst0 (minus i0 (S i)) u0 x3 x4)).(\lambda (H15: +(csubst0 (minus i0 (S i)) u0 x1 x2)).(let H16 \def (eq_ind nat (minus i0 i) +(\lambda (n: nat).(getl n (CHead d (Bind Abst) u) (CHead d1 (Bind Abbr) u0))) +(getl_conf_le i0 (CHead d1 (Bind Abbr) u0) c H3 (CHead d (Bind Abst) u) i H0 +(le_S_n i i0 (le_S (S i) i0 H9))) (S (minus i0 (S i))) (minus_x_Sy i0 i H9)) +in (let H17 \def (f_equal C C (\lambda (e: C).(match e in C return (\lambda +(_: C).C) with [(CSort _) \Rightarrow d | (CHead c0 _ _) \Rightarrow c0])) +(CHead d (Bind Abst) u) (CHead x1 (Bind x0) x3) H12) in ((let H18 \def +(f_equal C B (\lambda (e: C).(match e in C return (\lambda (_: C).B) with +[(CSort _) \Rightarrow Abst | (CHead _ k _) \Rightarrow (match k in K return +(\lambda (_: K).B) with [(Bind b) \Rightarrow b | (Flat _) \Rightarrow +Abst])])) (CHead d (Bind Abst) u) (CHead x1 (Bind x0) x3) H12) in ((let H19 +\def (f_equal C T (\lambda (e: C).(match e in C return (\lambda (_: C).T) +with [(CSort _) \Rightarrow u | (CHead _ _ t) \Rightarrow t])) (CHead d (Bind +Abst) u) (CHead x1 (Bind x0) x3) H12) in (\lambda (H20: (eq B Abst +x0)).(\lambda (H21: (eq C d x1)).(let H22 \def (eq_ind_r T x3 (\lambda (t: +T).(subst0 (minus i0 (S i)) u0 t x4)) H14 u H19) in (let H23 \def (eq_ind_r C +x1 (\lambda (c0: C).(csubst0 (minus i0 (S i)) u0 c0 x2)) H15 d H21) in (let +H24 \def (eq_ind_r B x0 (\lambda (b: B).(getl i c2 (CHead x2 (Bind b) x4))) +H13 Abst H20) in (arity_abst g c2 x2 x4 i H24 a0 (H2 d1 u0 (r (Bind Abst) +(minus i0 (S i))) (getl_gen_S (Bind Abst) d (CHead d1 (Bind Abbr) u0) u +(minus i0 (S i)) H16) x2 x4 (fsubst0_both (r (Bind Abst) (minus i0 (S i))) u0 +d u x4 H22 x2 H23))))))))) H18)) H17)))))))))))) H11)) H10))) (\lambda (H9: +(le i0 i)).(arity_abst g c2 d u i (csubst0_getl_ge i0 i H9 c c2 u0 H8 (CHead +d (Bind Abst) u) H0) a0 H1))) t2 H7))) H6)) (\lambda (H6: (land (subst0 i0 u0 +(TLRef i) t2) (csubst0 i0 u0 c c2))).(and_ind (subst0 i0 u0 (TLRef i) t2) +(csubst0 i0 u0 c c2) (arity g c2 t2 a0) (\lambda (H7: (subst0 i0 u0 (TLRef i) +t2)).(\lambda (H8: (csubst0 i0 u0 c c2)).(and_ind (eq nat i i0) (eq T t2 +(lift (S i) O u0)) (arity g c2 t2 a0) (\lambda (H9: (eq nat i i0)).(\lambda +(H10: (eq T t2 (lift (S i) O u0))).(eq_ind_r T (lift (S i) O u0) (\lambda (t: +T).(arity g c2 t a0)) (let H11 \def (eq_ind_r nat i0 (\lambda (n: +nat).(csubst0 n u0 c c2)) H8 i H9) in (let H12 \def (eq_ind_r nat i0 (\lambda +(n: nat).(getl n c (CHead d1 (Bind Abbr) u0))) H3 i H9) in (let H13 \def +(eq_ind C (CHead d (Bind Abst) u) (\lambda (c0: C).(getl i c c0)) H0 (CHead +d1 (Bind Abbr) u0) (getl_mono c (CHead d (Bind Abst) u) i H0 (CHead d1 (Bind +Abbr) u0) H12)) in (let H14 \def (eq_ind C (CHead d (Bind Abst) u) (\lambda +(ee: C).(match ee in C return (\lambda (_: C).Prop) with [(CSort _) +\Rightarrow False | (CHead _ k _) \Rightarrow (match k in K return (\lambda +(_: K).Prop) with [(Bind b) \Rightarrow (match b in B return (\lambda (_: +B).Prop) with [Abbr \Rightarrow False | Abst \Rightarrow True | Void +\Rightarrow False]) | (Flat _) \Rightarrow False])])) I (CHead d1 (Bind Abbr) +u0) (getl_mono c (CHead d (Bind Abst) u) i H0 (CHead d1 (Bind Abbr) u0) H12)) +in (False_ind (arity g c2 (lift (S i) O u0) a0) H14))))) t2 H10))) +(subst0_gen_lref u0 t2 i0 i H7)))) H6)) H5))))))))))))))))) (\lambda (b: +B).(\lambda (H0: (not (eq B b Abst))).(\lambda (c: C).(\lambda (u: +T).(\lambda (a1: A).(\lambda (H1: (arity g c u a1)).(\lambda (H2: ((\forall +(d1: C).(\forall (u0: T).(\forall (i: nat).((getl i c (CHead d1 (Bind Abbr) +u0)) \to (\forall (c2: C).(\forall (t2: T).((fsubst0 i u0 c u c2 t2) \to +(arity g c2 t2 a1)))))))))).(\lambda (t: T).(\lambda (a2: A).(\lambda (_: +(arity g (CHead c (Bind b) u) t a2)).(\lambda (H4: ((\forall (d1: C).(\forall +(u0: T).(\forall (i: nat).((getl i (CHead c (Bind b) u) (CHead d1 (Bind Abbr) +u0)) \to (\forall (c2: C).(\forall (t2: T).((fsubst0 i u0 (CHead c (Bind b) +u) t c2 t2) \to (arity g c2 t2 a2)))))))))).(\lambda (d1: C).(\lambda (u0: +T).(\lambda (i: nat).(\lambda (H5: (getl i c (CHead d1 (Bind Abbr) +u0))).(\lambda (c2: C).(\lambda (t2: T).(\lambda (H6: (fsubst0 i u0 c (THead +(Bind b) u t) c2 t2)).(let H7 \def (fsubst0_gen_base c c2 (THead (Bind b) u +t) t2 u0 i H6) in (or3_ind (land (eq C c c2) (subst0 i u0 (THead (Bind b) u +t) t2)) (land (eq T (THead (Bind b) u t) t2) (csubst0 i u0 c c2)) (land +(subst0 i u0 (THead (Bind b) u t) t2) (csubst0 i u0 c c2)) (arity g c2 t2 a2) +(\lambda (H8: (land (eq C c c2) (subst0 i u0 (THead (Bind b) u t) +t2))).(and_ind (eq C c c2) (subst0 i u0 (THead (Bind b) u t) t2) (arity g c2 +t2 a2) (\lambda (H9: (eq C c c2)).(\lambda (H10: (subst0 i u0 (THead (Bind b) +u t) t2)).(eq_ind C c (\lambda (c0: C).(arity g c0 t2 a2)) (or3_ind (ex2 T +(\lambda (u2: T).(eq T t2 (THead (Bind b) u2 t))) (\lambda (u2: T).(subst0 i +u0 u u2))) (ex2 T (\lambda (t3: T).(eq T t2 (THead (Bind b) u t3))) (\lambda +(t3: T).(subst0 (s (Bind b) i) u0 t t3))) (ex3_2 T T (\lambda (u2: +T).(\lambda (t3: T).(eq T t2 (THead (Bind b) u2 t3)))) (\lambda (u2: +T).(\lambda (_: T).(subst0 i u0 u u2))) (\lambda (_: T).(\lambda (t3: +T).(subst0 (s (Bind b) i) u0 t t3)))) (arity g c t2 a2) (\lambda (H11: (ex2 T +(\lambda (u2: T).(eq T t2 (THead (Bind b) u2 t))) (\lambda (u2: T).(subst0 i +u0 u u2)))).(ex2_ind T (\lambda (u2: T).(eq T t2 (THead (Bind b) u2 t))) +(\lambda (u2: T).(subst0 i u0 u u2)) (arity g c t2 a2) (\lambda (x: +T).(\lambda (H12: (eq T t2 (THead (Bind b) x t))).(\lambda (H13: (subst0 i u0 +u x)).(eq_ind_r T (THead (Bind b) x t) (\lambda (t0: T).(arity g c t0 a2)) +(arity_bind g b H0 c x a1 (H2 d1 u0 i H5 c x (fsubst0_snd i u0 c u x H13)) t +a2 (H4 d1 u0 (S i) (getl_clear_bind b (CHead c (Bind b) u) c u (clear_bind b +c u) (CHead d1 (Bind Abbr) u0) i H5) (CHead c (Bind b) x) t (fsubst0_fst (S +i) u0 (CHead c (Bind b) u) t (CHead c (Bind b) x) (csubst0_snd_bind b i u0 u +x H13 c)))) t2 H12)))) H11)) (\lambda (H11: (ex2 T (\lambda (t3: T).(eq T t2 +(THead (Bind b) u t3))) (\lambda (t3: T).(subst0 (s (Bind b) i) u0 t +t3)))).(ex2_ind T (\lambda (t3: T).(eq T t2 (THead (Bind b) u t3))) (\lambda +(t3: T).(subst0 (s (Bind b) i) u0 t t3)) (arity g c t2 a2) (\lambda (x: +T).(\lambda (H12: (eq T t2 (THead (Bind b) u x))).(\lambda (H13: (subst0 (s +(Bind b) i) u0 t x)).(eq_ind_r T (THead (Bind b) u x) (\lambda (t0: T).(arity +g c t0 a2)) (arity_bind g b H0 c u a1 H1 x a2 (H4 d1 u0 (S i) +(getl_clear_bind b (CHead c (Bind b) u) c u (clear_bind b c u) (CHead d1 +(Bind Abbr) u0) i H5) (CHead c (Bind b) u) x (fsubst0_snd (S i) u0 (CHead c +(Bind b) u) t x H13))) t2 H12)))) H11)) (\lambda (H11: (ex3_2 T T (\lambda +(u2: T).(\lambda (t3: T).(eq T t2 (THead (Bind b) u2 t3)))) (\lambda (u2: +T).(\lambda (_: T).(subst0 i u0 u u2))) (\lambda (_: T).(\lambda (t3: +T).(subst0 (s (Bind b) i) u0 t t3))))).(ex3_2_ind T T (\lambda (u2: +T).(\lambda (t3: T).(eq T t2 (THead (Bind b) u2 t3)))) (\lambda (u2: +T).(\lambda (_: T).(subst0 i u0 u u2))) (\lambda (_: T).(\lambda (t3: +T).(subst0 (s (Bind b) i) u0 t t3))) (arity g c t2 a2) (\lambda (x0: +T).(\lambda (x1: T).(\lambda (H12: (eq T t2 (THead (Bind b) x0 x1))).(\lambda +(H13: (subst0 i u0 u x0)).(\lambda (H14: (subst0 (s (Bind b) i) u0 t +x1)).(eq_ind_r T (THead (Bind b) x0 x1) (\lambda (t0: T).(arity g c t0 a2)) +(arity_bind g b H0 c x0 a1 (H2 d1 u0 i H5 c x0 (fsubst0_snd i u0 c u x0 H13)) +x1 a2 (H4 d1 u0 (S i) (getl_clear_bind b (CHead c (Bind b) u) c u (clear_bind +b c u) (CHead d1 (Bind Abbr) u0) i H5) (CHead c (Bind b) x0) x1 (fsubst0_both +(S i) u0 (CHead c (Bind b) u) t x1 H14 (CHead c (Bind b) x0) +(csubst0_snd_bind b i u0 u x0 H13 c)))) t2 H12)))))) H11)) (subst0_gen_head +(Bind b) u0 u t t2 i H10)) c2 H9))) H8)) (\lambda (H8: (land (eq T (THead +(Bind b) u t) t2) (csubst0 i u0 c c2))).(and_ind (eq T (THead (Bind b) u t) +t2) (csubst0 i u0 c c2) (arity g c2 t2 a2) (\lambda (H9: (eq T (THead (Bind +b) u t) t2)).(\lambda (H10: (csubst0 i u0 c c2)).(eq_ind T (THead (Bind b) u +t) (\lambda (t0: T).(arity g c2 t0 a2)) (arity_bind g b H0 c2 u a1 (H2 d1 u0 +i H5 c2 u (fsubst0_fst i u0 c u c2 H10)) t a2 (H4 d1 u0 (S i) +(getl_clear_bind b (CHead c (Bind b) u) c u (clear_bind b c u) (CHead d1 +(Bind Abbr) u0) i H5) (CHead c2 (Bind b) u) t (fsubst0_fst (S i) u0 (CHead c +(Bind b) u) t (CHead c2 (Bind b) u) (csubst0_fst_bind b i c c2 u0 H10 u)))) +t2 H9))) H8)) (\lambda (H8: (land (subst0 i u0 (THead (Bind b) u t) t2) +(csubst0 i u0 c c2))).(and_ind (subst0 i u0 (THead (Bind b) u t) t2) (csubst0 +i u0 c c2) (arity g c2 t2 a2) (\lambda (H9: (subst0 i u0 (THead (Bind b) u t) +t2)).(\lambda (H10: (csubst0 i u0 c c2)).(or3_ind (ex2 T (\lambda (u2: T).(eq +T t2 (THead (Bind b) u2 t))) (\lambda (u2: T).(subst0 i u0 u u2))) (ex2 T +(\lambda (t3: T).(eq T t2 (THead (Bind b) u t3))) (\lambda (t3: T).(subst0 (s +(Bind b) i) u0 t t3))) (ex3_2 T T (\lambda (u2: T).(\lambda (t3: T).(eq T t2 +(THead (Bind b) u2 t3)))) (\lambda (u2: T).(\lambda (_: T).(subst0 i u0 u +u2))) (\lambda (_: T).(\lambda (t3: T).(subst0 (s (Bind b) i) u0 t t3)))) +(arity g c2 t2 a2) (\lambda (H11: (ex2 T (\lambda (u2: T).(eq T t2 (THead +(Bind b) u2 t))) (\lambda (u2: T).(subst0 i u0 u u2)))).(ex2_ind T (\lambda +(u2: T).(eq T t2 (THead (Bind b) u2 t))) (\lambda (u2: T).(subst0 i u0 u u2)) +(arity g c2 t2 a2) (\lambda (x: T).(\lambda (H12: (eq T t2 (THead (Bind b) x +t))).(\lambda (H13: (subst0 i u0 u x)).(eq_ind_r T (THead (Bind b) x t) +(\lambda (t0: T).(arity g c2 t0 a2)) (arity_bind g b H0 c2 x a1 (H2 d1 u0 i +H5 c2 x (fsubst0_both i u0 c u x H13 c2 H10)) t a2 (H4 d1 u0 (S i) +(getl_clear_bind b (CHead c (Bind b) u) c u (clear_bind b c u) (CHead d1 +(Bind Abbr) u0) i H5) (CHead c2 (Bind b) x) t (fsubst0_fst (S i) u0 (CHead c +(Bind b) u) t (CHead c2 (Bind b) x) (csubst0_both_bind b i u0 u x H13 c c2 +H10)))) t2 H12)))) H11)) (\lambda (H11: (ex2 T (\lambda (t3: T).(eq T t2 +(THead (Bind b) u t3))) (\lambda (t3: T).(subst0 (s (Bind b) i) u0 t +t3)))).(ex2_ind T (\lambda (t3: T).(eq T t2 (THead (Bind b) u t3))) (\lambda +(t3: T).(subst0 (s (Bind b) i) u0 t t3)) (arity g c2 t2 a2) (\lambda (x: +T).(\lambda (H12: (eq T t2 (THead (Bind b) u x))).(\lambda (H13: (subst0 (s +(Bind b) i) u0 t x)).(eq_ind_r T (THead (Bind b) u x) (\lambda (t0: T).(arity +g c2 t0 a2)) (arity_bind g b H0 c2 u a1 (H2 d1 u0 i H5 c2 u (fsubst0_fst i u0 +c u c2 H10)) x a2 (H4 d1 u0 (S i) (getl_clear_bind b (CHead c (Bind b) u) c u +(clear_bind b c u) (CHead d1 (Bind Abbr) u0) i H5) (CHead c2 (Bind b) u) x +(fsubst0_both (S i) u0 (CHead c (Bind b) u) t x H13 (CHead c2 (Bind b) u) +(csubst0_fst_bind b i c c2 u0 H10 u)))) t2 H12)))) H11)) (\lambda (H11: +(ex3_2 T T (\lambda (u2: T).(\lambda (t3: T).(eq T t2 (THead (Bind b) u2 +t3)))) (\lambda (u2: T).(\lambda (_: T).(subst0 i u0 u u2))) (\lambda (_: +T).(\lambda (t3: T).(subst0 (s (Bind b) i) u0 t t3))))).(ex3_2_ind T T +(\lambda (u2: T).(\lambda (t3: T).(eq T t2 (THead (Bind b) u2 t3)))) (\lambda +(u2: T).(\lambda (_: T).(subst0 i u0 u u2))) (\lambda (_: T).(\lambda (t3: +T).(subst0 (s (Bind b) i) u0 t t3))) (arity g c2 t2 a2) (\lambda (x0: +T).(\lambda (x1: T).(\lambda (H12: (eq T t2 (THead (Bind b) x0 x1))).(\lambda +(H13: (subst0 i u0 u x0)).(\lambda (H14: (subst0 (s (Bind b) i) u0 t +x1)).(eq_ind_r T (THead (Bind b) x0 x1) (\lambda (t0: T).(arity g c2 t0 a2)) +(arity_bind g b H0 c2 x0 a1 (H2 d1 u0 i H5 c2 x0 (fsubst0_both i u0 c u x0 +H13 c2 H10)) x1 a2 (H4 d1 u0 (S i) (getl_clear_bind b (CHead c (Bind b) u) c +u (clear_bind b c u) (CHead d1 (Bind Abbr) u0) i H5) (CHead c2 (Bind b) x0) +x1 (fsubst0_both (S i) u0 (CHead c (Bind b) u) t x1 H14 (CHead c2 (Bind b) +x0) (csubst0_both_bind b i u0 u x0 H13 c c2 H10)))) t2 H12)))))) H11)) +(subst0_gen_head (Bind b) u0 u t t2 i H9)))) H8)) H7)))))))))))))))))))) +(\lambda (c: C).(\lambda (u: T).(\lambda (a1: A).(\lambda (H0: (arity g c u +(asucc g a1))).(\lambda (H1: ((\forall (d1: C).(\forall (u0: T).(\forall (i: +nat).((getl i c (CHead d1 (Bind Abbr) u0)) \to (\forall (c2: C).(\forall (t2: +T).((fsubst0 i u0 c u c2 t2) \to (arity g c2 t2 (asucc g +a1))))))))))).(\lambda (t: T).(\lambda (a2: A).(\lambda (_: (arity g (CHead c +(Bind Abst) u) t a2)).(\lambda (H3: ((\forall (d1: C).(\forall (u0: +T).(\forall (i: nat).((getl i (CHead c (Bind Abst) u) (CHead d1 (Bind Abbr) +u0)) \to (\forall (c2: C).(\forall (t2: T).((fsubst0 i u0 (CHead c (Bind +Abst) u) t c2 t2) \to (arity g c2 t2 a2)))))))))).(\lambda (d1: C).(\lambda +(u0: T).(\lambda (i: nat).(\lambda (H4: (getl i c (CHead d1 (Bind Abbr) +u0))).(\lambda (c2: C).(\lambda (t2: T).(\lambda (H5: (fsubst0 i u0 c (THead +(Bind Abst) u t) c2 t2)).(let H6 \def (fsubst0_gen_base c c2 (THead (Bind +Abst) u t) t2 u0 i H5) in (or3_ind (land (eq C c c2) (subst0 i u0 (THead +(Bind Abst) u t) t2)) (land (eq T (THead (Bind Abst) u t) t2) (csubst0 i u0 c +c2)) (land (subst0 i u0 (THead (Bind Abst) u t) t2) (csubst0 i u0 c c2)) +(arity g c2 t2 (AHead a1 a2)) (\lambda (H7: (land (eq C c c2) (subst0 i u0 +(THead (Bind Abst) u t) t2))).(and_ind (eq C c c2) (subst0 i u0 (THead (Bind +Abst) u t) t2) (arity g c2 t2 (AHead a1 a2)) (\lambda (H8: (eq C c +c2)).(\lambda (H9: (subst0 i u0 (THead (Bind Abst) u t) t2)).(eq_ind C c +(\lambda (c0: C).(arity g c0 t2 (AHead a1 a2))) (or3_ind (ex2 T (\lambda (u2: +T).(eq T t2 (THead (Bind Abst) u2 t))) (\lambda (u2: T).(subst0 i u0 u u2))) +(ex2 T (\lambda (t3: T).(eq T t2 (THead (Bind Abst) u t3))) (\lambda (t3: +T).(subst0 (s (Bind Abst) i) u0 t t3))) (ex3_2 T T (\lambda (u2: T).(\lambda +(t3: T).(eq T t2 (THead (Bind Abst) u2 t3)))) (\lambda (u2: T).(\lambda (_: +T).(subst0 i u0 u u2))) (\lambda (_: T).(\lambda (t3: T).(subst0 (s (Bind +Abst) i) u0 t t3)))) (arity g c t2 (AHead a1 a2)) (\lambda (H10: (ex2 T +(\lambda (u2: T).(eq T t2 (THead (Bind Abst) u2 t))) (\lambda (u2: T).(subst0 +i u0 u u2)))).(ex2_ind T (\lambda (u2: T).(eq T t2 (THead (Bind Abst) u2 t))) +(\lambda (u2: T).(subst0 i u0 u u2)) (arity g c t2 (AHead a1 a2)) (\lambda +(x: T).(\lambda (H11: (eq T t2 (THead (Bind Abst) x t))).(\lambda (H12: +(subst0 i u0 u x)).(eq_ind_r T (THead (Bind Abst) x t) (\lambda (t0: +T).(arity g c t0 (AHead a1 a2))) (arity_head g c x a1 (H1 d1 u0 i H4 c x +(fsubst0_snd i u0 c u x H12)) t a2 (H3 d1 u0 (S i) (getl_clear_bind Abst +(CHead c (Bind Abst) u) c u (clear_bind Abst c u) (CHead d1 (Bind Abbr) u0) i +H4) (CHead c (Bind Abst) x) t (fsubst0_fst (S i) u0 (CHead c (Bind Abst) u) t +(CHead c (Bind Abst) x) (csubst0_snd_bind Abst i u0 u x H12 c)))) t2 H11)))) +H10)) (\lambda (H10: (ex2 T (\lambda (t3: T).(eq T t2 (THead (Bind Abst) u +t3))) (\lambda (t3: T).(subst0 (s (Bind Abst) i) u0 t t3)))).(ex2_ind T +(\lambda (t3: T).(eq T t2 (THead (Bind Abst) u t3))) (\lambda (t3: T).(subst0 +(s (Bind Abst) i) u0 t t3)) (arity g c t2 (AHead a1 a2)) (\lambda (x: +T).(\lambda (H11: (eq T t2 (THead (Bind Abst) u x))).(\lambda (H12: (subst0 +(s (Bind Abst) i) u0 t x)).(eq_ind_r T (THead (Bind Abst) u x) (\lambda (t0: +T).(arity g c t0 (AHead a1 a2))) (arity_head g c u a1 H0 x a2 (H3 d1 u0 (S i) +(getl_clear_bind Abst (CHead c (Bind Abst) u) c u (clear_bind Abst c u) +(CHead d1 (Bind Abbr) u0) i H4) (CHead c (Bind Abst) u) x (fsubst0_snd (S i) +u0 (CHead c (Bind Abst) u) t x H12))) t2 H11)))) H10)) (\lambda (H10: (ex3_2 +T T (\lambda (u2: T).(\lambda (t3: T).(eq T t2 (THead (Bind Abst) u2 t3)))) +(\lambda (u2: T).(\lambda (_: T).(subst0 i u0 u u2))) (\lambda (_: +T).(\lambda (t3: T).(subst0 (s (Bind Abst) i) u0 t t3))))).(ex3_2_ind T T +(\lambda (u2: T).(\lambda (t3: T).(eq T t2 (THead (Bind Abst) u2 t3)))) +(\lambda (u2: T).(\lambda (_: T).(subst0 i u0 u u2))) (\lambda (_: +T).(\lambda (t3: T).(subst0 (s (Bind Abst) i) u0 t t3))) (arity g c t2 (AHead +a1 a2)) (\lambda (x0: T).(\lambda (x1: T).(\lambda (H11: (eq T t2 (THead +(Bind Abst) x0 x1))).(\lambda (H12: (subst0 i u0 u x0)).(\lambda (H13: +(subst0 (s (Bind Abst) i) u0 t x1)).(eq_ind_r T (THead (Bind Abst) x0 x1) +(\lambda (t0: T).(arity g c t0 (AHead a1 a2))) (arity_head g c x0 a1 (H1 d1 +u0 i H4 c x0 (fsubst0_snd i u0 c u x0 H12)) x1 a2 (H3 d1 u0 (S i) +(getl_clear_bind Abst (CHead c (Bind Abst) u) c u (clear_bind Abst c u) +(CHead d1 (Bind Abbr) u0) i H4) (CHead c (Bind Abst) x0) x1 (fsubst0_both (S +i) u0 (CHead c (Bind Abst) u) t x1 H13 (CHead c (Bind Abst) x0) +(csubst0_snd_bind Abst i u0 u x0 H12 c)))) t2 H11)))))) H10)) +(subst0_gen_head (Bind Abst) u0 u t t2 i H9)) c2 H8))) H7)) (\lambda (H7: +(land (eq T (THead (Bind Abst) u t) t2) (csubst0 i u0 c c2))).(and_ind (eq T +(THead (Bind Abst) u t) t2) (csubst0 i u0 c c2) (arity g c2 t2 (AHead a1 a2)) +(\lambda (H8: (eq T (THead (Bind Abst) u t) t2)).(\lambda (H9: (csubst0 i u0 +c c2)).(eq_ind T (THead (Bind Abst) u t) (\lambda (t0: T).(arity g c2 t0 +(AHead a1 a2))) (arity_head g c2 u a1 (H1 d1 u0 i H4 c2 u (fsubst0_fst i u0 c +u c2 H9)) t a2 (H3 d1 u0 (S i) (getl_clear_bind Abst (CHead c (Bind Abst) u) +c u (clear_bind Abst c u) (CHead d1 (Bind Abbr) u0) i H4) (CHead c2 (Bind +Abst) u) t (fsubst0_fst (S i) u0 (CHead c (Bind Abst) u) t (CHead c2 (Bind +Abst) u) (csubst0_fst_bind Abst i c c2 u0 H9 u)))) t2 H8))) H7)) (\lambda +(H7: (land (subst0 i u0 (THead (Bind Abst) u t) t2) (csubst0 i u0 c +c2))).(and_ind (subst0 i u0 (THead (Bind Abst) u t) t2) (csubst0 i u0 c c2) +(arity g c2 t2 (AHead a1 a2)) (\lambda (H8: (subst0 i u0 (THead (Bind Abst) u +t) t2)).(\lambda (H9: (csubst0 i u0 c c2)).(or3_ind (ex2 T (\lambda (u2: +T).(eq T t2 (THead (Bind Abst) u2 t))) (\lambda (u2: T).(subst0 i u0 u u2))) +(ex2 T (\lambda (t3: T).(eq T t2 (THead (Bind Abst) u t3))) (\lambda (t3: +T).(subst0 (s (Bind Abst) i) u0 t t3))) (ex3_2 T T (\lambda (u2: T).(\lambda +(t3: T).(eq T t2 (THead (Bind Abst) u2 t3)))) (\lambda (u2: T).(\lambda (_: +T).(subst0 i u0 u u2))) (\lambda (_: T).(\lambda (t3: T).(subst0 (s (Bind +Abst) i) u0 t t3)))) (arity g c2 t2 (AHead a1 a2)) (\lambda (H10: (ex2 T +(\lambda (u2: T).(eq T t2 (THead (Bind Abst) u2 t))) (\lambda (u2: T).(subst0 +i u0 u u2)))).(ex2_ind T (\lambda (u2: T).(eq T t2 (THead (Bind Abst) u2 t))) +(\lambda (u2: T).(subst0 i u0 u u2)) (arity g c2 t2 (AHead a1 a2)) (\lambda +(x: T).(\lambda (H11: (eq T t2 (THead (Bind Abst) x t))).(\lambda (H12: +(subst0 i u0 u x)).(eq_ind_r T (THead (Bind Abst) x t) (\lambda (t0: +T).(arity g c2 t0 (AHead a1 a2))) (arity_head g c2 x a1 (H1 d1 u0 i H4 c2 x +(fsubst0_both i u0 c u x H12 c2 H9)) t a2 (H3 d1 u0 (S i) (getl_clear_bind +Abst (CHead c (Bind Abst) u) c u (clear_bind Abst c u) (CHead d1 (Bind Abbr) +u0) i H4) (CHead c2 (Bind Abst) x) t (fsubst0_fst (S i) u0 (CHead c (Bind +Abst) u) t (CHead c2 (Bind Abst) x) (csubst0_both_bind Abst i u0 u x H12 c c2 +H9)))) t2 H11)))) H10)) (\lambda (H10: (ex2 T (\lambda (t3: T).(eq T t2 +(THead (Bind Abst) u t3))) (\lambda (t3: T).(subst0 (s (Bind Abst) i) u0 t +t3)))).(ex2_ind T (\lambda (t3: T).(eq T t2 (THead (Bind Abst) u t3))) +(\lambda (t3: T).(subst0 (s (Bind Abst) i) u0 t t3)) (arity g c2 t2 (AHead a1 +a2)) (\lambda (x: T).(\lambda (H11: (eq T t2 (THead (Bind Abst) u +x))).(\lambda (H12: (subst0 (s (Bind Abst) i) u0 t x)).(eq_ind_r T (THead +(Bind Abst) u x) (\lambda (t0: T).(arity g c2 t0 (AHead a1 a2))) (arity_head +g c2 u a1 (H1 d1 u0 i H4 c2 u (fsubst0_fst i u0 c u c2 H9)) x a2 (H3 d1 u0 (S +i) (getl_clear_bind Abst (CHead c (Bind Abst) u) c u (clear_bind Abst c u) +(CHead d1 (Bind Abbr) u0) i H4) (CHead c2 (Bind Abst) u) x (fsubst0_both (S +i) u0 (CHead c (Bind Abst) u) t x H12 (CHead c2 (Bind Abst) u) +(csubst0_fst_bind Abst i c c2 u0 H9 u)))) t2 H11)))) H10)) (\lambda (H10: +(ex3_2 T T (\lambda (u2: T).(\lambda (t3: T).(eq T t2 (THead (Bind Abst) u2 +t3)))) (\lambda (u2: T).(\lambda (_: T).(subst0 i u0 u u2))) (\lambda (_: +T).(\lambda (t3: T).(subst0 (s (Bind Abst) i) u0 t t3))))).(ex3_2_ind T T +(\lambda (u2: T).(\lambda (t3: T).(eq T t2 (THead (Bind Abst) u2 t3)))) +(\lambda (u2: T).(\lambda (_: T).(subst0 i u0 u u2))) (\lambda (_: +T).(\lambda (t3: T).(subst0 (s (Bind Abst) i) u0 t t3))) (arity g c2 t2 +(AHead a1 a2)) (\lambda (x0: T).(\lambda (x1: T).(\lambda (H11: (eq T t2 +(THead (Bind Abst) x0 x1))).(\lambda (H12: (subst0 i u0 u x0)).(\lambda (H13: +(subst0 (s (Bind Abst) i) u0 t x1)).(eq_ind_r T (THead (Bind Abst) x0 x1) +(\lambda (t0: T).(arity g c2 t0 (AHead a1 a2))) (arity_head g c2 x0 a1 (H1 d1 +u0 i H4 c2 x0 (fsubst0_both i u0 c u x0 H12 c2 H9)) x1 a2 (H3 d1 u0 (S i) +(getl_clear_bind Abst (CHead c (Bind Abst) u) c u (clear_bind Abst c u) +(CHead d1 (Bind Abbr) u0) i H4) (CHead c2 (Bind Abst) x0) x1 (fsubst0_both (S +i) u0 (CHead c (Bind Abst) u) t x1 H13 (CHead c2 (Bind Abst) x0) +(csubst0_both_bind Abst i u0 u x0 H12 c c2 H9)))) t2 H11)))))) H10)) +(subst0_gen_head (Bind Abst) u0 u t t2 i H8)))) H7)) H6)))))))))))))))))) +(\lambda (c: C).(\lambda (u: T).(\lambda (a1: A).(\lambda (H0: (arity g c u +a1)).(\lambda (H1: ((\forall (d1: C).(\forall (u0: T).(\forall (i: +nat).((getl i c (CHead d1 (Bind Abbr) u0)) \to (\forall (c2: C).(\forall (t2: +T).((fsubst0 i u0 c u c2 t2) \to (arity g c2 t2 a1)))))))))).(\lambda (t: +T).(\lambda (a2: A).(\lambda (H2: (arity g c t (AHead a1 a2))).(\lambda (H3: +((\forall (d1: C).(\forall (u0: T).(\forall (i: nat).((getl i c (CHead d1 +(Bind Abbr) u0)) \to (\forall (c2: C).(\forall (t2: T).((fsubst0 i u0 c t c2 +t2) \to (arity g c2 t2 (AHead a1 a2))))))))))).(\lambda (d1: C).(\lambda (u0: +T).(\lambda (i: nat).(\lambda (H4: (getl i c (CHead d1 (Bind Abbr) +u0))).(\lambda (c2: C).(\lambda (t2: T).(\lambda (H5: (fsubst0 i u0 c (THead +(Flat Appl) u t) c2 t2)).(let H6 \def (fsubst0_gen_base c c2 (THead (Flat +Appl) u t) t2 u0 i H5) in (or3_ind (land (eq C c c2) (subst0 i u0 (THead +(Flat Appl) u t) t2)) (land (eq T (THead (Flat Appl) u t) t2) (csubst0 i u0 c +c2)) (land (subst0 i u0 (THead (Flat Appl) u t) t2) (csubst0 i u0 c c2)) +(arity g c2 t2 a2) (\lambda (H7: (land (eq C c c2) (subst0 i u0 (THead (Flat +Appl) u t) t2))).(and_ind (eq C c c2) (subst0 i u0 (THead (Flat Appl) u t) +t2) (arity g c2 t2 a2) (\lambda (H8: (eq C c c2)).(\lambda (H9: (subst0 i u0 +(THead (Flat Appl) u t) t2)).(eq_ind C c (\lambda (c0: C).(arity g c0 t2 a2)) +(or3_ind (ex2 T (\lambda (u2: T).(eq T t2 (THead (Flat Appl) u2 t))) (\lambda +(u2: T).(subst0 i u0 u u2))) (ex2 T (\lambda (t3: T).(eq T t2 (THead (Flat +Appl) u t3))) (\lambda (t3: T).(subst0 (s (Flat Appl) i) u0 t t3))) (ex3_2 T +T (\lambda (u2: T).(\lambda (t3: T).(eq T t2 (THead (Flat Appl) u2 t3)))) +(\lambda (u2: T).(\lambda (_: T).(subst0 i u0 u u2))) (\lambda (_: +T).(\lambda (t3: T).(subst0 (s (Flat Appl) i) u0 t t3)))) (arity g c t2 a2) +(\lambda (H10: (ex2 T (\lambda (u2: T).(eq T t2 (THead (Flat Appl) u2 t))) +(\lambda (u2: T).(subst0 i u0 u u2)))).(ex2_ind T (\lambda (u2: T).(eq T t2 +(THead (Flat Appl) u2 t))) (\lambda (u2: T).(subst0 i u0 u u2)) (arity g c t2 +a2) (\lambda (x: T).(\lambda (H11: (eq T t2 (THead (Flat Appl) x +t))).(\lambda (H12: (subst0 i u0 u x)).(eq_ind_r T (THead (Flat Appl) x t) +(\lambda (t0: T).(arity g c t0 a2)) (arity_appl g c x a1 (H1 d1 u0 i H4 c x +(fsubst0_snd i u0 c u x H12)) t a2 H2) t2 H11)))) H10)) (\lambda (H10: (ex2 T +(\lambda (t3: T).(eq T t2 (THead (Flat Appl) u t3))) (\lambda (t3: T).(subst0 +(s (Flat Appl) i) u0 t t3)))).(ex2_ind T (\lambda (t3: T).(eq T t2 (THead +(Flat Appl) u t3))) (\lambda (t3: T).(subst0 (s (Flat Appl) i) u0 t t3)) +(arity g c t2 a2) (\lambda (x: T).(\lambda (H11: (eq T t2 (THead (Flat Appl) +u x))).(\lambda (H12: (subst0 (s (Flat Appl) i) u0 t x)).(eq_ind_r T (THead +(Flat Appl) u x) (\lambda (t0: T).(arity g c t0 a2)) (arity_appl g c u a1 H0 +x a2 (H3 d1 u0 i H4 c x (fsubst0_snd i u0 c t x H12))) t2 H11)))) H10)) +(\lambda (H10: (ex3_2 T T (\lambda (u2: T).(\lambda (t3: T).(eq T t2 (THead +(Flat Appl) u2 t3)))) (\lambda (u2: T).(\lambda (_: T).(subst0 i u0 u u2))) +(\lambda (_: T).(\lambda (t3: T).(subst0 (s (Flat Appl) i) u0 t +t3))))).(ex3_2_ind T T (\lambda (u2: T).(\lambda (t3: T).(eq T t2 (THead +(Flat Appl) u2 t3)))) (\lambda (u2: T).(\lambda (_: T).(subst0 i u0 u u2))) +(\lambda (_: T).(\lambda (t3: T).(subst0 (s (Flat Appl) i) u0 t t3))) (arity +g c t2 a2) (\lambda (x0: T).(\lambda (x1: T).(\lambda (H11: (eq T t2 (THead +(Flat Appl) x0 x1))).(\lambda (H12: (subst0 i u0 u x0)).(\lambda (H13: +(subst0 (s (Flat Appl) i) u0 t x1)).(eq_ind_r T (THead (Flat Appl) x0 x1) +(\lambda (t0: T).(arity g c t0 a2)) (arity_appl g c x0 a1 (H1 d1 u0 i H4 c x0 +(fsubst0_snd i u0 c u x0 H12)) x1 a2 (H3 d1 u0 i H4 c x1 (fsubst0_snd i u0 c +t x1 H13))) t2 H11)))))) H10)) (subst0_gen_head (Flat Appl) u0 u t t2 i H9)) +c2 H8))) H7)) (\lambda (H7: (land (eq T (THead (Flat Appl) u t) t2) (csubst0 +i u0 c c2))).(and_ind (eq T (THead (Flat Appl) u t) t2) (csubst0 i u0 c c2) +(arity g c2 t2 a2) (\lambda (H8: (eq T (THead (Flat Appl) u t) t2)).(\lambda +(H9: (csubst0 i u0 c c2)).(eq_ind T (THead (Flat Appl) u t) (\lambda (t0: +T).(arity g c2 t0 a2)) (arity_appl g c2 u a1 (H1 d1 u0 i H4 c2 u (fsubst0_fst +i u0 c u c2 H9)) t a2 (H3 d1 u0 i H4 c2 t (fsubst0_fst i u0 c t c2 H9))) t2 +H8))) H7)) (\lambda (H7: (land (subst0 i u0 (THead (Flat Appl) u t) t2) +(csubst0 i u0 c c2))).(and_ind (subst0 i u0 (THead (Flat Appl) u t) t2) +(csubst0 i u0 c c2) (arity g c2 t2 a2) (\lambda (H8: (subst0 i u0 (THead +(Flat Appl) u t) t2)).(\lambda (H9: (csubst0 i u0 c c2)).(or3_ind (ex2 T +(\lambda (u2: T).(eq T t2 (THead (Flat Appl) u2 t))) (\lambda (u2: T).(subst0 +i u0 u u2))) (ex2 T (\lambda (t3: T).(eq T t2 (THead (Flat Appl) u t3))) +(\lambda (t3: T).(subst0 (s (Flat Appl) i) u0 t t3))) (ex3_2 T T (\lambda +(u2: T).(\lambda (t3: T).(eq T t2 (THead (Flat Appl) u2 t3)))) (\lambda (u2: +T).(\lambda (_: T).(subst0 i u0 u u2))) (\lambda (_: T).(\lambda (t3: +T).(subst0 (s (Flat Appl) i) u0 t t3)))) (arity g c2 t2 a2) (\lambda (H10: +(ex2 T (\lambda (u2: T).(eq T t2 (THead (Flat Appl) u2 t))) (\lambda (u2: +T).(subst0 i u0 u u2)))).(ex2_ind T (\lambda (u2: T).(eq T t2 (THead (Flat +Appl) u2 t))) (\lambda (u2: T).(subst0 i u0 u u2)) (arity g c2 t2 a2) +(\lambda (x: T).(\lambda (H11: (eq T t2 (THead (Flat Appl) x t))).(\lambda +(H12: (subst0 i u0 u x)).(eq_ind_r T (THead (Flat Appl) x t) (\lambda (t0: +T).(arity g c2 t0 a2)) (arity_appl g c2 x a1 (H1 d1 u0 i H4 c2 x +(fsubst0_both i u0 c u x H12 c2 H9)) t a2 (H3 d1 u0 i H4 c2 t (fsubst0_fst i +u0 c t c2 H9))) t2 H11)))) H10)) (\lambda (H10: (ex2 T (\lambda (t3: T).(eq T +t2 (THead (Flat Appl) u t3))) (\lambda (t3: T).(subst0 (s (Flat Appl) i) u0 t +t3)))).(ex2_ind T (\lambda (t3: T).(eq T t2 (THead (Flat Appl) u t3))) +(\lambda (t3: T).(subst0 (s (Flat Appl) i) u0 t t3)) (arity g c2 t2 a2) +(\lambda (x: T).(\lambda (H11: (eq T t2 (THead (Flat Appl) u x))).(\lambda +(H12: (subst0 (s (Flat Appl) i) u0 t x)).(eq_ind_r T (THead (Flat Appl) u x) +(\lambda (t0: T).(arity g c2 t0 a2)) (arity_appl g c2 u a1 (H1 d1 u0 i H4 c2 +u (fsubst0_fst i u0 c u c2 H9)) x a2 (H3 d1 u0 i H4 c2 x (fsubst0_both i u0 c +t x H12 c2 H9))) t2 H11)))) H10)) (\lambda (H10: (ex3_2 T T (\lambda (u2: +T).(\lambda (t3: T).(eq T t2 (THead (Flat Appl) u2 t3)))) (\lambda (u2: +T).(\lambda (_: T).(subst0 i u0 u u2))) (\lambda (_: T).(\lambda (t3: +T).(subst0 (s (Flat Appl) i) u0 t t3))))).(ex3_2_ind T T (\lambda (u2: +T).(\lambda (t3: T).(eq T t2 (THead (Flat Appl) u2 t3)))) (\lambda (u2: +T).(\lambda (_: T).(subst0 i u0 u u2))) (\lambda (_: T).(\lambda (t3: +T).(subst0 (s (Flat Appl) i) u0 t t3))) (arity g c2 t2 a2) (\lambda (x0: +T).(\lambda (x1: T).(\lambda (H11: (eq T t2 (THead (Flat Appl) x0 +x1))).(\lambda (H12: (subst0 i u0 u x0)).(\lambda (H13: (subst0 (s (Flat +Appl) i) u0 t x1)).(eq_ind_r T (THead (Flat Appl) x0 x1) (\lambda (t0: +T).(arity g c2 t0 a2)) (arity_appl g c2 x0 a1 (H1 d1 u0 i H4 c2 x0 +(fsubst0_both i u0 c u x0 H12 c2 H9)) x1 a2 (H3 d1 u0 i H4 c2 x1 +(fsubst0_both i u0 c t x1 H13 c2 H9))) t2 H11)))))) H10)) (subst0_gen_head +(Flat Appl) u0 u t t2 i H8)))) H7)) H6)))))))))))))))))) (\lambda (c: +C).(\lambda (u: T).(\lambda (a0: A).(\lambda (H0: (arity g c u (asucc g +a0))).(\lambda (H1: ((\forall (d1: C).(\forall (u0: T).(\forall (i: +nat).((getl i c (CHead d1 (Bind Abbr) u0)) \to (\forall (c2: C).(\forall (t2: +T).((fsubst0 i u0 c u c2 t2) \to (arity g c2 t2 (asucc g +a0))))))))))).(\lambda (t: T).(\lambda (H2: (arity g c t a0)).(\lambda (H3: +((\forall (d1: C).(\forall (u0: T).(\forall (i: nat).((getl i c (CHead d1 +(Bind Abbr) u0)) \to (\forall (c2: C).(\forall (t2: T).((fsubst0 i u0 c t c2 +t2) \to (arity g c2 t2 a0)))))))))).(\lambda (d1: C).(\lambda (u0: +T).(\lambda (i: nat).(\lambda (H4: (getl i c (CHead d1 (Bind Abbr) +u0))).(\lambda (c2: C).(\lambda (t2: T).(\lambda (H5: (fsubst0 i u0 c (THead +(Flat Cast) u t) c2 t2)).(let H6 \def (fsubst0_gen_base c c2 (THead (Flat +Cast) u t) t2 u0 i H5) in (or3_ind (land (eq C c c2) (subst0 i u0 (THead +(Flat Cast) u t) t2)) (land (eq T (THead (Flat Cast) u t) t2) (csubst0 i u0 c +c2)) (land (subst0 i u0 (THead (Flat Cast) u t) t2) (csubst0 i u0 c c2)) +(arity g c2 t2 a0) (\lambda (H7: (land (eq C c c2) (subst0 i u0 (THead (Flat +Cast) u t) t2))).(and_ind (eq C c c2) (subst0 i u0 (THead (Flat Cast) u t) +t2) (arity g c2 t2 a0) (\lambda (H8: (eq C c c2)).(\lambda (H9: (subst0 i u0 +(THead (Flat Cast) u t) t2)).(eq_ind C c (\lambda (c0: C).(arity g c0 t2 a0)) +(or3_ind (ex2 T (\lambda (u2: T).(eq T t2 (THead (Flat Cast) u2 t))) (\lambda +(u2: T).(subst0 i u0 u u2))) (ex2 T (\lambda (t3: T).(eq T t2 (THead (Flat +Cast) u t3))) (\lambda (t3: T).(subst0 (s (Flat Cast) i) u0 t t3))) (ex3_2 T +T (\lambda (u2: T).(\lambda (t3: T).(eq T t2 (THead (Flat Cast) u2 t3)))) +(\lambda (u2: T).(\lambda (_: T).(subst0 i u0 u u2))) (\lambda (_: +T).(\lambda (t3: T).(subst0 (s (Flat Cast) i) u0 t t3)))) (arity g c t2 a0) +(\lambda (H10: (ex2 T (\lambda (u2: T).(eq T t2 (THead (Flat Cast) u2 t))) +(\lambda (u2: T).(subst0 i u0 u u2)))).(ex2_ind T (\lambda (u2: T).(eq T t2 +(THead (Flat Cast) u2 t))) (\lambda (u2: T).(subst0 i u0 u u2)) (arity g c t2 +a0) (\lambda (x: T).(\lambda (H11: (eq T t2 (THead (Flat Cast) x +t))).(\lambda (H12: (subst0 i u0 u x)).(eq_ind_r T (THead (Flat Cast) x t) +(\lambda (t0: T).(arity g c t0 a0)) (arity_cast g c x a0 (H1 d1 u0 i H4 c x +(fsubst0_snd i u0 c u x H12)) t H2) t2 H11)))) H10)) (\lambda (H10: (ex2 T +(\lambda (t3: T).(eq T t2 (THead (Flat Cast) u t3))) (\lambda (t3: T).(subst0 +(s (Flat Cast) i) u0 t t3)))).(ex2_ind T (\lambda (t3: T).(eq T t2 (THead +(Flat Cast) u t3))) (\lambda (t3: T).(subst0 (s (Flat Cast) i) u0 t t3)) +(arity g c t2 a0) (\lambda (x: T).(\lambda (H11: (eq T t2 (THead (Flat Cast) +u x))).(\lambda (H12: (subst0 (s (Flat Cast) i) u0 t x)).(eq_ind_r T (THead +(Flat Cast) u x) (\lambda (t0: T).(arity g c t0 a0)) (arity_cast g c u a0 H0 +x (H3 d1 u0 i H4 c x (fsubst0_snd i u0 c t x H12))) t2 H11)))) H10)) (\lambda +(H10: (ex3_2 T T (\lambda (u2: T).(\lambda (t3: T).(eq T t2 (THead (Flat +Cast) u2 t3)))) (\lambda (u2: T).(\lambda (_: T).(subst0 i u0 u u2))) +(\lambda (_: T).(\lambda (t3: T).(subst0 (s (Flat Cast) i) u0 t +t3))))).(ex3_2_ind T T (\lambda (u2: T).(\lambda (t3: T).(eq T t2 (THead +(Flat Cast) u2 t3)))) (\lambda (u2: T).(\lambda (_: T).(subst0 i u0 u u2))) +(\lambda (_: T).(\lambda (t3: T).(subst0 (s (Flat Cast) i) u0 t t3))) (arity +g c t2 a0) (\lambda (x0: T).(\lambda (x1: T).(\lambda (H11: (eq T t2 (THead +(Flat Cast) x0 x1))).(\lambda (H12: (subst0 i u0 u x0)).(\lambda (H13: +(subst0 (s (Flat Cast) i) u0 t x1)).(eq_ind_r T (THead (Flat Cast) x0 x1) +(\lambda (t0: T).(arity g c t0 a0)) (arity_cast g c x0 a0 (H1 d1 u0 i H4 c x0 +(fsubst0_snd i u0 c u x0 H12)) x1 (H3 d1 u0 i H4 c x1 (fsubst0_snd i u0 c t +x1 H13))) t2 H11)))))) H10)) (subst0_gen_head (Flat Cast) u0 u t t2 i H9)) c2 +H8))) H7)) (\lambda (H7: (land (eq T (THead (Flat Cast) u t) t2) (csubst0 i +u0 c c2))).(and_ind (eq T (THead (Flat Cast) u t) t2) (csubst0 i u0 c c2) +(arity g c2 t2 a0) (\lambda (H8: (eq T (THead (Flat Cast) u t) t2)).(\lambda +(H9: (csubst0 i u0 c c2)).(eq_ind T (THead (Flat Cast) u t) (\lambda (t0: +T).(arity g c2 t0 a0)) (arity_cast g c2 u a0 (H1 d1 u0 i H4 c2 u (fsubst0_fst +i u0 c u c2 H9)) t (H3 d1 u0 i H4 c2 t (fsubst0_fst i u0 c t c2 H9))) t2 +H8))) H7)) (\lambda (H7: (land (subst0 i u0 (THead (Flat Cast) u t) t2) +(csubst0 i u0 c c2))).(and_ind (subst0 i u0 (THead (Flat Cast) u t) t2) +(csubst0 i u0 c c2) (arity g c2 t2 a0) (\lambda (H8: (subst0 i u0 (THead +(Flat Cast) u t) t2)).(\lambda (H9: (csubst0 i u0 c c2)).(or3_ind (ex2 T +(\lambda (u2: T).(eq T t2 (THead (Flat Cast) u2 t))) (\lambda (u2: T).(subst0 +i u0 u u2))) (ex2 T (\lambda (t3: T).(eq T t2 (THead (Flat Cast) u t3))) +(\lambda (t3: T).(subst0 (s (Flat Cast) i) u0 t t3))) (ex3_2 T T (\lambda +(u2: T).(\lambda (t3: T).(eq T t2 (THead (Flat Cast) u2 t3)))) (\lambda (u2: +T).(\lambda (_: T).(subst0 i u0 u u2))) (\lambda (_: T).(\lambda (t3: +T).(subst0 (s (Flat Cast) i) u0 t t3)))) (arity g c2 t2 a0) (\lambda (H10: +(ex2 T (\lambda (u2: T).(eq T t2 (THead (Flat Cast) u2 t))) (\lambda (u2: +T).(subst0 i u0 u u2)))).(ex2_ind T (\lambda (u2: T).(eq T t2 (THead (Flat +Cast) u2 t))) (\lambda (u2: T).(subst0 i u0 u u2)) (arity g c2 t2 a0) +(\lambda (x: T).(\lambda (H11: (eq T t2 (THead (Flat Cast) x t))).(\lambda +(H12: (subst0 i u0 u x)).(eq_ind_r T (THead (Flat Cast) x t) (\lambda (t0: +T).(arity g c2 t0 a0)) (arity_cast g c2 x a0 (H1 d1 u0 i H4 c2 x +(fsubst0_both i u0 c u x H12 c2 H9)) t (H3 d1 u0 i H4 c2 t (fsubst0_fst i u0 +c t c2 H9))) t2 H11)))) H10)) (\lambda (H10: (ex2 T (\lambda (t3: T).(eq T t2 +(THead (Flat Cast) u t3))) (\lambda (t3: T).(subst0 (s (Flat Cast) i) u0 t +t3)))).(ex2_ind T (\lambda (t3: T).(eq T t2 (THead (Flat Cast) u t3))) +(\lambda (t3: T).(subst0 (s (Flat Cast) i) u0 t t3)) (arity g c2 t2 a0) +(\lambda (x: T).(\lambda (H11: (eq T t2 (THead (Flat Cast) u x))).(\lambda +(H12: (subst0 (s (Flat Cast) i) u0 t x)).(eq_ind_r T (THead (Flat Cast) u x) +(\lambda (t0: T).(arity g c2 t0 a0)) (arity_cast g c2 u a0 (H1 d1 u0 i H4 c2 +u (fsubst0_fst i u0 c u c2 H9)) x (H3 d1 u0 i H4 c2 x (fsubst0_both i u0 c t +x H12 c2 H9))) t2 H11)))) H10)) (\lambda (H10: (ex3_2 T T (\lambda (u2: +T).(\lambda (t3: T).(eq T t2 (THead (Flat Cast) u2 t3)))) (\lambda (u2: +T).(\lambda (_: T).(subst0 i u0 u u2))) (\lambda (_: T).(\lambda (t3: +T).(subst0 (s (Flat Cast) i) u0 t t3))))).(ex3_2_ind T T (\lambda (u2: +T).(\lambda (t3: T).(eq T t2 (THead (Flat Cast) u2 t3)))) (\lambda (u2: +T).(\lambda (_: T).(subst0 i u0 u u2))) (\lambda (_: T).(\lambda (t3: +T).(subst0 (s (Flat Cast) i) u0 t t3))) (arity g c2 t2 a0) (\lambda (x0: +T).(\lambda (x1: T).(\lambda (H11: (eq T t2 (THead (Flat Cast) x0 +x1))).(\lambda (H12: (subst0 i u0 u x0)).(\lambda (H13: (subst0 (s (Flat +Cast) i) u0 t x1)).(eq_ind_r T (THead (Flat Cast) x0 x1) (\lambda (t0: +T).(arity g c2 t0 a0)) (arity_cast g c2 x0 a0 (H1 d1 u0 i H4 c2 x0 +(fsubst0_both i u0 c u x0 H12 c2 H9)) x1 (H3 d1 u0 i H4 c2 x1 (fsubst0_both i +u0 c t x1 H13 c2 H9))) t2 H11)))))) H10)) (subst0_gen_head (Flat Cast) u0 u t +t2 i H8)))) H7)) H6))))))))))))))))) (\lambda (c: C).(\lambda (t: T).(\lambda +(a1: A).(\lambda (_: (arity g c t a1)).(\lambda (H1: ((\forall (d1: +C).(\forall (u: T).(\forall (i: nat).((getl i c (CHead d1 (Bind Abbr) u)) \to +(\forall (c2: C).(\forall (t2: T).((fsubst0 i u c t c2 t2) \to (arity g c2 t2 +a1)))))))))).(\lambda (a2: A).(\lambda (H2: (leq g a1 a2)).(\lambda (d1: +C).(\lambda (u: T).(\lambda (i: nat).(\lambda (H3: (getl i c (CHead d1 (Bind +Abbr) u))).(\lambda (c2: C).(\lambda (t2: T).(\lambda (H4: (fsubst0 i u c t +c2 t2)).(let H5 \def (fsubst0_gen_base c c2 t t2 u i H4) in (or3_ind (land +(eq C c c2) (subst0 i u t t2)) (land (eq T t t2) (csubst0 i u c c2)) (land +(subst0 i u t t2) (csubst0 i u c c2)) (arity g c2 t2 a2) (\lambda (H6: (land +(eq C c c2) (subst0 i u t t2))).(and_ind (eq C c c2) (subst0 i u t t2) (arity +g c2 t2 a2) (\lambda (H7: (eq C c c2)).(\lambda (H8: (subst0 i u t +t2)).(eq_ind C c (\lambda (c0: C).(arity g c0 t2 a2)) (arity_repl g c t2 a1 +(H1 d1 u i H3 c t2 (fsubst0_snd i u c t t2 H8)) a2 H2) c2 H7))) H6)) (\lambda +(H6: (land (eq T t t2) (csubst0 i u c c2))).(and_ind (eq T t t2) (csubst0 i u +c c2) (arity g c2 t2 a2) (\lambda (H7: (eq T t t2)).(\lambda (H8: (csubst0 i +u c c2)).(eq_ind T t (\lambda (t0: T).(arity g c2 t0 a2)) (arity_repl g c2 t +a1 (H1 d1 u i H3 c2 t (fsubst0_fst i u c t c2 H8)) a2 H2) t2 H7))) H6)) +(\lambda (H6: (land (subst0 i u t t2) (csubst0 i u c c2))).(and_ind (subst0 i +u t t2) (csubst0 i u c c2) (arity g c2 t2 a2) (\lambda (H7: (subst0 i u t +t2)).(\lambda (H8: (csubst0 i u c c2)).(arity_repl g c2 t2 a1 (H1 d1 u i H3 +c2 t2 (fsubst0_both i u c t t2 H7 c2 H8)) a2 H2))) H6)) H5)))))))))))))))) c1 +t1 a H))))). + +theorem arity_subst0: + \forall (g: G).(\forall (c: C).(\forall (t1: T).(\forall (a: A).((arity g c +t1 a) \to (\forall (d: C).(\forall (u: T).(\forall (i: nat).((getl i c (CHead +d (Bind Abbr) u)) \to (\forall (t2: T).((subst0 i u t1 t2) \to (arity g c t2 +a))))))))))) +\def + \lambda (g: G).(\lambda (c: C).(\lambda (t1: T).(\lambda (a: A).(\lambda (H: +(arity g c t1 a)).(\lambda (d: C).(\lambda (u: T).(\lambda (i: nat).(\lambda +(H0: (getl i c (CHead d (Bind Abbr) u))).(\lambda (t2: T).(\lambda (H1: +(subst0 i u t1 t2)).(arity_fsubst0 g c t1 a H d u i H0 c t2 (fsubst0_snd i u +c t1 t2 H1)))))))))))). + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/gz/defs.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/gz/defs.ma new file mode 100644 index 000000000..8ea75dbee --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/gz/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/gz/defs". + +include "A/defs.ma". + +include "G/defs.ma". + +definition gz: + G +\def + mk_G S lt_n_Sn. + +inductive leqz: A \to (A \to Prop) \def +| leqz_sort: \forall (h1: nat).(\forall (h2: nat).(\forall (n1: nat).(\forall +(n2: nat).((eq nat (plus h1 n2) (plus h2 n1)) \to (leqz (ASort h1 n1) (ASort +h2 n2)))))) +| leqz_head: \forall (a1: A).(\forall (a2: A).((leqz a1 a2) \to (\forall (a3: +A).(\forall (a4: A).((leqz a3 a4) \to (leqz (AHead a1 a3) (AHead a2 a4))))))). + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/gz/props.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/gz/props.ma new file mode 100644 index 000000000..9612d298d --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/gz/props.ma @@ -0,0 +1,208 @@ +(**************************************************************************) +(* ___ *) +(* ||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/gz/props". + +include "gz/defs.ma". + +include "leq/defs.ma". + +include "aplus/props.ma". + +theorem aplus_gz_le: + \forall (k: nat).(\forall (h: nat).(\forall (n: nat).((le h k) \to (eq A +(aplus gz (ASort h n) k) (ASort O (plus (minus k h) n)))))) +\def + \lambda (k: nat).(nat_ind (\lambda (n: nat).(\forall (h: nat).(\forall (n0: +nat).((le h n) \to (eq A (aplus gz (ASort h n0) n) (ASort O (plus (minus n h) +n0))))))) (\lambda (h: nat).(\lambda (n: nat).(\lambda (H: (le h O)).(let H_y +\def (le_n_O_eq h H) in (eq_ind nat O (\lambda (n0: nat).(eq A (ASort n0 n) +(ASort O n))) (refl_equal A (ASort O n)) h H_y))))) (\lambda (k0: +nat).(\lambda (IH: ((\forall (h: nat).(\forall (n: nat).((le h k0) \to (eq A +(aplus gz (ASort h n) k0) (ASort O (plus (minus k0 h) n)))))))).(\lambda (h: +nat).(nat_ind (\lambda (n: nat).(\forall (n0: nat).((le n (S k0)) \to (eq A +(asucc gz (aplus gz (ASort n n0) k0)) (ASort O (plus (match n with [O +\Rightarrow (S k0) | (S l) \Rightarrow (minus k0 l)]) n0)))))) (\lambda (n: +nat).(\lambda (_: (le O (S k0))).(eq_ind A (aplus gz (asucc gz (ASort O n)) +k0) (\lambda (a: A).(eq A a (ASort O (S (plus k0 n))))) (eq_ind_r A (ASort O +(plus (minus k0 O) (S n))) (\lambda (a: A).(eq A a (ASort O (S (plus k0 +n))))) (eq_ind nat k0 (\lambda (n0: nat).(eq A (ASort O (plus n0 (S n))) +(ASort O (S (plus k0 n))))) (eq_ind nat (S (plus k0 n)) (\lambda (n0: +nat).(eq A (ASort O n0) (ASort O (S (plus k0 n))))) (refl_equal A (ASort O (S +(plus k0 n)))) (plus k0 (S n)) (plus_n_Sm k0 n)) (minus k0 O) (minus_n_O k0)) +(aplus gz (ASort O (S n)) k0) (IH O (S n) (le_O_n k0))) (asucc gz (aplus gz +(ASort O n) k0)) (aplus_asucc gz k0 (ASort O n))))) (\lambda (n: +nat).(\lambda (_: ((\forall (n0: nat).((le n (S k0)) \to (eq A (asucc gz +(aplus gz (ASort n n0) k0)) (ASort O (plus (match n with [O \Rightarrow (S +k0) | (S l) \Rightarrow (minus k0 l)]) n0))))))).(\lambda (n0: nat).(\lambda +(H0: (le (S n) (S k0))).(ex2_ind nat (\lambda (n1: nat).(eq nat (S k0) (S +n1))) (\lambda (n1: nat).(le n n1)) (eq A (asucc gz (aplus gz (ASort (S n) +n0) k0)) (ASort O (plus (minus k0 n) n0))) (\lambda (x: nat).(\lambda (H1: +(eq nat (S k0) (S x))).(\lambda (H2: (le n x)).(let H3 \def (f_equal nat nat +(\lambda (e: nat).(match e in nat return (\lambda (_: nat).nat) with [O +\Rightarrow k0 | (S n1) \Rightarrow n1])) (S k0) (S x) H1) in (let H4 \def +(eq_ind_r nat x (\lambda (n1: nat).(le n n1)) H2 k0 H3) in (eq_ind A (aplus +gz (ASort n n0) k0) (\lambda (a: A).(eq A (asucc gz (aplus gz (ASort (S n) +n0) k0)) a)) (eq_ind A (aplus gz (asucc gz (ASort (S n) n0)) k0) (\lambda (a: +A).(eq A a (aplus gz (ASort n n0) k0))) (refl_equal A (aplus gz (ASort n n0) +k0)) (asucc gz (aplus gz (ASort (S n) n0) k0)) (aplus_asucc gz k0 (ASort (S +n) n0))) (ASort O (plus (minus k0 n) n0)) (IH n n0 H4))))))) (le_gen_S n (S +k0) H0)))))) h)))) k). + +theorem aplus_gz_ge: + \forall (n: nat).(\forall (k: nat).(\forall (h: nat).((le k h) \to (eq A +(aplus gz (ASort h n) k) (ASort (minus h k) n))))) +\def + \lambda (n: nat).(\lambda (k: nat).(nat_ind (\lambda (n0: nat).(\forall (h: +nat).((le n0 h) \to (eq A (aplus gz (ASort h n) n0) (ASort (minus h n0) +n))))) (\lambda (h: nat).(\lambda (_: (le O h)).(eq_ind nat h (\lambda (n0: +nat).(eq A (ASort h n) (ASort n0 n))) (refl_equal A (ASort h n)) (minus h O) +(minus_n_O h)))) (\lambda (k0: nat).(\lambda (IH: ((\forall (h: nat).((le k0 +h) \to (eq A (aplus gz (ASort h n) k0) (ASort (minus h k0) n)))))).(\lambda +(h: nat).(nat_ind (\lambda (n0: nat).((le (S k0) n0) \to (eq A (asucc gz +(aplus gz (ASort n0 n) k0)) (ASort (minus n0 (S k0)) n)))) (\lambda (H: (le +(S k0) O)).(ex2_ind nat (\lambda (n0: nat).(eq nat O (S n0))) (\lambda (n0: +nat).(le k0 n0)) (eq A (asucc gz (aplus gz (ASort O n) k0)) (ASort O n)) +(\lambda (x: nat).(\lambda (H0: (eq nat O (S x))).(\lambda (_: (le k0 +x)).(let H2 \def (eq_ind nat O (\lambda (ee: nat).(match ee in nat return +(\lambda (_: nat).Prop) with [O \Rightarrow True | (S _) \Rightarrow False])) +I (S x) H0) in (False_ind (eq A (asucc gz (aplus gz (ASort O n) k0)) (ASort O +n)) H2))))) (le_gen_S k0 O H))) (\lambda (n0: nat).(\lambda (_: (((le (S k0) +n0) \to (eq A (asucc gz (aplus gz (ASort n0 n) k0)) (ASort (minus n0 (S k0)) +n))))).(\lambda (H0: (le (S k0) (S n0))).(ex2_ind nat (\lambda (n1: nat).(eq +nat (S n0) (S n1))) (\lambda (n1: nat).(le k0 n1)) (eq A (asucc gz (aplus gz +(ASort (S n0) n) k0)) (ASort (minus n0 k0) n)) (\lambda (x: nat).(\lambda +(H1: (eq nat (S n0) (S x))).(\lambda (H2: (le k0 x)).(let H3 \def (f_equal +nat nat (\lambda (e: nat).(match e in nat return (\lambda (_: nat).nat) with +[O \Rightarrow n0 | (S n1) \Rightarrow n1])) (S n0) (S x) H1) in (let H4 \def +(eq_ind_r nat x (\lambda (n1: nat).(le k0 n1)) H2 n0 H3) in (eq_ind A (aplus +gz (ASort n0 n) k0) (\lambda (a: A).(eq A (asucc gz (aplus gz (ASort (S n0) +n) k0)) a)) (eq_ind A (aplus gz (asucc gz (ASort (S n0) n)) k0) (\lambda (a: +A).(eq A a (aplus gz (ASort n0 n) k0))) (refl_equal A (aplus gz (ASort n0 n) +k0)) (asucc gz (aplus gz (ASort (S n0) n) k0)) (aplus_asucc gz k0 (ASort (S +n0) n))) (ASort (minus n0 k0) n) (IH n0 H4))))))) (le_gen_S k0 (S n0) H0))))) +h)))) k)). + +theorem next_plus_gz: + \forall (n: nat).(\forall (h: nat).(eq nat (next_plus gz n h) (plus h n))) +\def + \lambda (n: nat).(\lambda (h: nat).(nat_ind (\lambda (n0: nat).(eq nat +(next_plus gz n n0) (plus n0 n))) (refl_equal nat n) (\lambda (n0: +nat).(\lambda (H: (eq nat (next_plus gz n n0) (plus n0 n))).(f_equal nat nat +S (next_plus gz n n0) (plus n0 n) H))) h)). + +theorem leqz_leq: + \forall (a1: A).(\forall (a2: A).((leq gz a1 a2) \to (leqz a1 a2))) +\def + \lambda (a1: A).(\lambda (a2: A).(\lambda (H: (leq gz a1 a2)).(leq_ind gz +(\lambda (a: A).(\lambda (a0: A).(leqz a a0))) (\lambda (h1: nat).(\lambda +(h2: nat).(\lambda (n1: nat).(\lambda (n2: nat).(\lambda (k: nat).(\lambda +(H0: (eq A (aplus gz (ASort h1 n1) k) (aplus gz (ASort h2 n2) k))).(lt_le_e k +h1 (leqz (ASort h1 n1) (ASort h2 n2)) (\lambda (H1: (lt k h1)).(lt_le_e k h2 +(leqz (ASort h1 n1) (ASort h2 n2)) (\lambda (H2: (lt k h2)).(let H3 \def +(eq_ind A (aplus gz (ASort h1 n1) k) (\lambda (a: A).(eq A a (aplus gz (ASort +h2 n2) k))) H0 (ASort (minus h1 k) n1) (aplus_gz_ge n1 k h1 (le_S_n k h1 +(le_S (S k) h1 H1)))) in (let H4 \def (eq_ind A (aplus gz (ASort h2 n2) k) +(\lambda (a: A).(eq A (ASort (minus h1 k) n1) a)) H3 (ASort (minus h2 k) n2) +(aplus_gz_ge n2 k h2 (le_S_n k h2 (le_S (S k) h2 H2)))) in (let H5 \def +(f_equal A nat (\lambda (e: A).(match e in A return (\lambda (_: A).nat) with +[(ASort n _) \Rightarrow n | (AHead _ _) \Rightarrow ((let rec minus (n: nat) +on n: (nat \to nat) \def (\lambda (m: nat).(match n with [O \Rightarrow O | +(S k0) \Rightarrow (match m with [O \Rightarrow (S k0) | (S l) \Rightarrow +(minus k0 l)])])) in minus) h1 k)])) (ASort (minus h1 k) n1) (ASort (minus h2 +k) n2) H4) in ((let H6 \def (f_equal A nat (\lambda (e: A).(match e in A +return (\lambda (_: A).nat) with [(ASort _ n) \Rightarrow n | (AHead _ _) +\Rightarrow n1])) (ASort (minus h1 k) n1) (ASort (minus h2 k) n2) H4) in +(\lambda (H7: (eq nat (minus h1 k) (minus h2 k))).(eq_ind nat n1 (\lambda (n: +nat).(leqz (ASort h1 n1) (ASort h2 n))) (eq_ind nat h1 (\lambda (n: +nat).(leqz (ASort h1 n1) (ASort n n1))) (leqz_sort h1 h1 n1 n1 (refl_equal +nat (plus h1 n1))) h2 (minus_minus k h1 h2 (le_S_n k h1 (le_S (S k) h1 H1)) +(le_S_n k h2 (le_S (S k) h2 H2)) H7)) n2 H6))) H5))))) (\lambda (H2: (le h2 +k)).(let H3 \def (eq_ind A (aplus gz (ASort h1 n1) k) (\lambda (a: A).(eq A a +(aplus gz (ASort h2 n2) k))) H0 (ASort (minus h1 k) n1) (aplus_gz_ge n1 k h1 +(le_S_n k h1 (le_S (S k) h1 H1)))) in (let H4 \def (eq_ind A (aplus gz (ASort +h2 n2) k) (\lambda (a: A).(eq A (ASort (minus h1 k) n1) a)) H3 (ASort O (plus +(minus k h2) n2)) (aplus_gz_le k h2 n2 H2)) in (let H5 \def (eq_ind nat +(minus h1 k) (\lambda (n: nat).(eq A (ASort n n1) (ASort O (plus (minus k h2) +n2)))) H4 (S (minus h1 (S k))) (minus_x_Sy h1 k H1)) in (let H6 \def (eq_ind +A (ASort (S (minus h1 (S k))) n1) (\lambda (ee: A).(match ee in A return +(\lambda (_: A).Prop) with [(ASort n _) \Rightarrow (match n in nat return +(\lambda (_: nat).Prop) with [O \Rightarrow False | (S _) \Rightarrow True]) +| (AHead _ _) \Rightarrow False])) I (ASort O (plus (minus k h2) n2)) H5) in +(False_ind (leqz (ASort h1 n1) (ASort h2 n2)) H6)))))))) (\lambda (H1: (le h1 +k)).(lt_le_e k h2 (leqz (ASort h1 n1) (ASort h2 n2)) (\lambda (H2: (lt k +h2)).(let H3 \def (eq_ind A (aplus gz (ASort h1 n1) k) (\lambda (a: A).(eq A +a (aplus gz (ASort h2 n2) k))) H0 (ASort O (plus (minus k h1) n1)) +(aplus_gz_le k h1 n1 H1)) in (let H4 \def (eq_ind A (aplus gz (ASort h2 n2) +k) (\lambda (a: A).(eq A (ASort O (plus (minus k h1) n1)) a)) H3 (ASort +(minus h2 k) n2) (aplus_gz_ge n2 k h2 (le_S_n k h2 (le_S (S k) h2 H2)))) in +(let H5 \def (sym_equal A (ASort O (plus (minus k h1) n1)) (ASort (minus h2 +k) n2) H4) in (let H6 \def (eq_ind nat (minus h2 k) (\lambda (n: nat).(eq A +(ASort n n2) (ASort O (plus (minus k h1) n1)))) H5 (S (minus h2 (S k))) +(minus_x_Sy h2 k H2)) in (let H7 \def (eq_ind A (ASort (S (minus h2 (S k))) +n2) (\lambda (ee: A).(match ee in A return (\lambda (_: A).Prop) with [(ASort +n _) \Rightarrow (match n in nat return (\lambda (_: nat).Prop) with [O +\Rightarrow False | (S _) \Rightarrow True]) | (AHead _ _) \Rightarrow +False])) I (ASort O (plus (minus k h1) n1)) H6) in (False_ind (leqz (ASort h1 +n1) (ASort h2 n2)) H7))))))) (\lambda (H2: (le h2 k)).(let H3 \def (eq_ind A +(aplus gz (ASort h1 n1) k) (\lambda (a: A).(eq A a (aplus gz (ASort h2 n2) +k))) H0 (ASort O (plus (minus k h1) n1)) (aplus_gz_le k h1 n1 H1)) in (let H4 +\def (eq_ind A (aplus gz (ASort h2 n2) k) (\lambda (a: A).(eq A (ASort O +(plus (minus k h1) n1)) a)) H3 (ASort O (plus (minus k h2) n2)) (aplus_gz_le +k h2 n2 H2)) in (let H5 \def (f_equal A nat (\lambda (e: A).(match e in A +return (\lambda (_: A).nat) with [(ASort _ n) \Rightarrow n | (AHead _ _) +\Rightarrow ((let rec plus (n: nat) on n: (nat \to nat) \def (\lambda (m: +nat).(match n with [O \Rightarrow m | (S p) \Rightarrow (S (plus p m))])) in +plus) (minus k h1) n1)])) (ASort O (plus (minus k h1) n1)) (ASort O (plus +(minus k h2) n2)) H4) in (let H_y \def (plus_plus k h1 h2 n1 n2 H1 H2 H5) in +(leqz_sort h1 h2 n1 n2 H_y))))))))))))))) (\lambda (a0: A).(\lambda (a3: +A).(\lambda (_: (leq gz a0 a3)).(\lambda (H1: (leqz a0 a3)).(\lambda (a4: +A).(\lambda (a5: A).(\lambda (_: (leq gz a4 a5)).(\lambda (H3: (leqz a4 +a5)).(leqz_head a0 a3 H1 a4 a5 H3))))))))) a1 a2 H))). + +theorem leq_leqz: + \forall (a1: A).(\forall (a2: A).((leqz a1 a2) \to (leq gz a1 a2))) +\def + \lambda (a1: A).(\lambda (a2: A).(\lambda (H: (leqz a1 a2)).(leqz_ind +(\lambda (a: A).(\lambda (a0: A).(leq gz a a0))) (\lambda (h1: nat).(\lambda +(h2: nat).(\lambda (n1: nat).(\lambda (n2: nat).(\lambda (H0: (eq nat (plus +h1 n2) (plus h2 n1))).(leq_sort gz h1 h2 n1 n2 (plus h1 h2) (eq_ind_r A +(ASort (minus h1 (plus h1 h2)) (next_plus gz n1 (minus (plus h1 h2) h1))) +(\lambda (a: A).(eq A a (aplus gz (ASort h2 n2) (plus h1 h2)))) (eq_ind_r A +(ASort (minus h2 (plus h1 h2)) (next_plus gz n2 (minus (plus h1 h2) h2))) +(\lambda (a: A).(eq A (ASort (minus h1 (plus h1 h2)) (next_plus gz n1 (minus +(plus h1 h2) h1))) a)) (eq_ind_r nat h2 (\lambda (n: nat).(eq A (ASort (minus +h1 (plus h1 h2)) (next_plus gz n1 n)) (ASort (minus h2 (plus h1 h2)) +(next_plus gz n2 (minus (plus h1 h2) h2))))) (eq_ind_r nat h1 (\lambda (n: +nat).(eq A (ASort (minus h1 (plus h1 h2)) (next_plus gz n1 h2)) (ASort (minus +h2 (plus h1 h2)) (next_plus gz n2 n)))) (eq_ind_r nat O (\lambda (n: nat).(eq +A (ASort n (next_plus gz n1 h2)) (ASort (minus h2 (plus h1 h2)) (next_plus gz +n2 h1)))) (eq_ind_r nat O (\lambda (n: nat).(eq A (ASort O (next_plus gz n1 +h2)) (ASort n (next_plus gz n2 h1)))) (eq_ind_r nat (plus h2 n1) (\lambda (n: +nat).(eq A (ASort O n) (ASort O (next_plus gz n2 h1)))) (eq_ind_r nat (plus +h1 n2) (\lambda (n: nat).(eq A (ASort O (plus h2 n1)) (ASort O n))) (f_equal +nat A (ASort O) (plus h2 n1) (plus h1 n2) (sym_eq nat (plus h1 n2) (plus h2 +n1) H0)) (next_plus gz n2 h1) (next_plus_gz n2 h1)) (next_plus gz n1 h2) +(next_plus_gz n1 h2)) (minus h2 (plus h1 h2)) (O_minus h2 (plus h1 h2) +(le_plus_r h1 h2))) (minus h1 (plus h1 h2)) (O_minus h1 (plus h1 h2) +(le_plus_l h1 h2))) (minus (plus h1 h2) h2) (minus_plus_r h1 h2)) (minus +(plus h1 h2) h1) (minus_plus h1 h2)) (aplus gz (ASort h2 n2) (plus h1 h2)) +(aplus_asort_simpl gz (plus h1 h2) h2 n2)) (aplus gz (ASort h1 n1) (plus h1 +h2)) (aplus_asort_simpl gz (plus h1 h2) h1 n1)))))))) (\lambda (a0: +A).(\lambda (a3: A).(\lambda (_: (leqz a0 a3)).(\lambda (H1: (leq gz a0 +a3)).(\lambda (a4: A).(\lambda (a5: A).(\lambda (_: (leqz a4 a5)).(\lambda +(H3: (leq gz a4 a5)).(leq_head gz a0 a3 H1 a4 a5 H3))))))))) a1 a2 H))). + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/leq/fwd.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/leq/fwd.ma new file mode 100644 index 000000000..ee5d66749 --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/leq/fwd.ma @@ -0,0 +1,118 @@ +(**************************************************************************) +(* ___ *) +(* ||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/leq/fwd". + +include "leq/defs.ma". + +theorem leq_gen_sort: + \forall (g: G).(\forall (h1: nat).(\forall (n1: nat).(\forall (a2: A).((leq +g (ASort h1 n1) a2) \to (ex2_3 nat nat nat (\lambda (n2: nat).(\lambda (h2: +nat).(\lambda (_: nat).(eq A a2 (ASort h2 n2))))) (\lambda (n2: nat).(\lambda +(h2: nat).(\lambda (k: nat).(eq A (aplus g (ASort h1 n1) k) (aplus g (ASort +h2 n2) k)))))))))) +\def + \lambda (g: G).(\lambda (h1: nat).(\lambda (n1: nat).(\lambda (a2: +A).(\lambda (H: (leq g (ASort h1 n1) a2)).(let H0 \def (match H in leq return +(\lambda (a: A).(\lambda (a0: A).(\lambda (_: (leq ? a a0)).((eq A a (ASort +h1 n1)) \to ((eq A a0 a2) \to (ex2_3 nat nat nat (\lambda (n2: nat).(\lambda +(h2: nat).(\lambda (_: nat).(eq A a2 (ASort h2 n2))))) (\lambda (n2: +nat).(\lambda (h2: nat).(\lambda (k: nat).(eq A (aplus g (ASort h1 n1) k) +(aplus g (ASort h2 n2) k))))))))))) with [(leq_sort h0 h2 n0 n2 k H0) +\Rightarrow (\lambda (H1: (eq A (ASort h0 n0) (ASort h1 n1))).(\lambda (H2: +(eq A (ASort h2 n2) a2)).((let H3 \def (f_equal A nat (\lambda (e: A).(match +e in A return (\lambda (_: A).nat) with [(ASort _ n) \Rightarrow n | (AHead _ +_) \Rightarrow n0])) (ASort h0 n0) (ASort h1 n1) H1) in ((let H4 \def +(f_equal A nat (\lambda (e: A).(match e in A return (\lambda (_: A).nat) with +[(ASort n _) \Rightarrow n | (AHead _ _) \Rightarrow h0])) (ASort h0 n0) +(ASort h1 n1) H1) in (eq_ind nat h1 (\lambda (n: nat).((eq nat n0 n1) \to +((eq A (ASort h2 n2) a2) \to ((eq A (aplus g (ASort n n0) k) (aplus g (ASort +h2 n2) k)) \to (ex2_3 nat nat nat (\lambda (n3: nat).(\lambda (h3: +nat).(\lambda (_: nat).(eq A a2 (ASort h3 n3))))) (\lambda (n3: nat).(\lambda +(h3: nat).(\lambda (k0: nat).(eq A (aplus g (ASort h1 n1) k0) (aplus g (ASort +h3 n3) k0)))))))))) (\lambda (H5: (eq nat n0 n1)).(eq_ind nat n1 (\lambda (n: +nat).((eq A (ASort h2 n2) a2) \to ((eq A (aplus g (ASort h1 n) k) (aplus g +(ASort h2 n2) k)) \to (ex2_3 nat nat nat (\lambda (n3: nat).(\lambda (h3: +nat).(\lambda (_: nat).(eq A a2 (ASort h3 n3))))) (\lambda (n3: nat).(\lambda +(h3: nat).(\lambda (k0: nat).(eq A (aplus g (ASort h1 n1) k0) (aplus g (ASort +h3 n3) k0))))))))) (\lambda (H6: (eq A (ASort h2 n2) a2)).(eq_ind A (ASort h2 +n2) (\lambda (a: A).((eq A (aplus g (ASort h1 n1) k) (aplus g (ASort h2 n2) +k)) \to (ex2_3 nat nat nat (\lambda (n3: nat).(\lambda (h3: nat).(\lambda (_: +nat).(eq A a (ASort h3 n3))))) (\lambda (n3: nat).(\lambda (h3: nat).(\lambda +(k0: nat).(eq A (aplus g (ASort h1 n1) k0) (aplus g (ASort h3 n3) k0)))))))) +(\lambda (H7: (eq A (aplus g (ASort h1 n1) k) (aplus g (ASort h2 n2) +k))).(ex2_3_intro nat nat nat (\lambda (n3: nat).(\lambda (h3: nat).(\lambda +(_: nat).(eq A (ASort h2 n2) (ASort h3 n3))))) (\lambda (n3: nat).(\lambda +(h3: nat).(\lambda (k0: nat).(eq A (aplus g (ASort h1 n1) k0) (aplus g (ASort +h3 n3) k0))))) n2 h2 k (refl_equal A (ASort h2 n2)) H7)) a2 H6)) n0 (sym_eq +nat n0 n1 H5))) h0 (sym_eq nat h0 h1 H4))) H3)) H2 H0))) | (leq_head a1 a0 H0 +a3 a4 H1) \Rightarrow (\lambda (H2: (eq A (AHead a1 a3) (ASort h1 +n1))).(\lambda (H3: (eq A (AHead a0 a4) a2)).((let H4 \def (eq_ind A (AHead +a1 a3) (\lambda (e: A).(match e in A return (\lambda (_: A).Prop) with +[(ASort _ _) \Rightarrow False | (AHead _ _) \Rightarrow True])) I (ASort h1 +n1) H2) in (False_ind ((eq A (AHead a0 a4) a2) \to ((leq g a1 a0) \to ((leq g +a3 a4) \to (ex2_3 nat nat nat (\lambda (n2: nat).(\lambda (h2: nat).(\lambda +(_: nat).(eq A a2 (ASort h2 n2))))) (\lambda (n2: nat).(\lambda (h2: +nat).(\lambda (k: nat).(eq A (aplus g (ASort h1 n1) k) (aplus g (ASort h2 n2) +k))))))))) H4)) H3 H0 H1)))]) in (H0 (refl_equal A (ASort h1 n1)) (refl_equal +A a2))))))). + +theorem leq_gen_head: + \forall (g: G).(\forall (a1: A).(\forall (a2: A).(\forall (a: A).((leq g +(AHead a1 a2) a) \to (ex3_2 A A (\lambda (a3: A).(\lambda (a4: A).(eq A a +(AHead a3 a4)))) (\lambda (a3: A).(\lambda (_: A).(leq g a1 a3))) (\lambda +(_: A).(\lambda (a4: A).(leq g a2 a4)))))))) +\def + \lambda (g: G).(\lambda (a1: A).(\lambda (a2: A).(\lambda (a: A).(\lambda +(H: (leq g (AHead a1 a2) a)).(let H0 \def (match H in leq return (\lambda +(a0: A).(\lambda (a3: A).(\lambda (_: (leq ? a0 a3)).((eq A a0 (AHead a1 a2)) +\to ((eq A a3 a) \to (ex3_2 A A (\lambda (a4: A).(\lambda (a5: A).(eq A a +(AHead a4 a5)))) (\lambda (a4: A).(\lambda (_: A).(leq g a1 a4))) (\lambda +(_: A).(\lambda (a5: A).(leq g a2 a5))))))))) with [(leq_sort h1 h2 n1 n2 k +H0) \Rightarrow (\lambda (H1: (eq A (ASort h1 n1) (AHead a1 a2))).(\lambda +(H2: (eq A (ASort h2 n2) a)).((let H3 \def (eq_ind A (ASort h1 n1) (\lambda +(e: A).(match e in A return (\lambda (_: A).Prop) with [(ASort _ _) +\Rightarrow True | (AHead _ _) \Rightarrow False])) I (AHead a1 a2) H1) in +(False_ind ((eq A (ASort h2 n2) a) \to ((eq A (aplus g (ASort h1 n1) k) +(aplus g (ASort h2 n2) k)) \to (ex3_2 A A (\lambda (a3: A).(\lambda (a4: +A).(eq A a (AHead a3 a4)))) (\lambda (a3: A).(\lambda (_: A).(leq g a1 a3))) +(\lambda (_: A).(\lambda (a4: A).(leq g a2 a4)))))) H3)) H2 H0))) | (leq_head +a0 a3 H0 a4 a5 H1) \Rightarrow (\lambda (H2: (eq A (AHead a0 a4) (AHead a1 +a2))).(\lambda (H3: (eq A (AHead a3 a5) a)).((let H4 \def (f_equal A A +(\lambda (e: A).(match e in A return (\lambda (_: A).A) with [(ASort _ _) +\Rightarrow a4 | (AHead _ a6) \Rightarrow a6])) (AHead a0 a4) (AHead a1 a2) +H2) in ((let H5 \def (f_equal A A (\lambda (e: A).(match e in A return +(\lambda (_: A).A) with [(ASort _ _) \Rightarrow a0 | (AHead a6 _) +\Rightarrow a6])) (AHead a0 a4) (AHead a1 a2) H2) in (eq_ind A a1 (\lambda +(a6: A).((eq A a4 a2) \to ((eq A (AHead a3 a5) a) \to ((leq g a6 a3) \to +((leq g a4 a5) \to (ex3_2 A A (\lambda (a7: A).(\lambda (a8: A).(eq A a +(AHead a7 a8)))) (\lambda (a7: A).(\lambda (_: A).(leq g a1 a7))) (\lambda +(_: A).(\lambda (a8: A).(leq g a2 a8))))))))) (\lambda (H6: (eq A a4 +a2)).(eq_ind A a2 (\lambda (a6: A).((eq A (AHead a3 a5) a) \to ((leq g a1 a3) +\to ((leq g a6 a5) \to (ex3_2 A A (\lambda (a7: A).(\lambda (a8: A).(eq A a +(AHead a7 a8)))) (\lambda (a7: A).(\lambda (_: A).(leq g a1 a7))) (\lambda +(_: A).(\lambda (a8: A).(leq g a2 a8)))))))) (\lambda (H7: (eq A (AHead a3 +a5) a)).(eq_ind A (AHead a3 a5) (\lambda (a6: A).((leq g a1 a3) \to ((leq g +a2 a5) \to (ex3_2 A A (\lambda (a7: A).(\lambda (a8: A).(eq A a6 (AHead a7 +a8)))) (\lambda (a7: A).(\lambda (_: A).(leq g a1 a7))) (\lambda (_: +A).(\lambda (a8: A).(leq g a2 a8))))))) (\lambda (H8: (leq g a1 a3)).(\lambda +(H9: (leq g a2 a5)).(ex3_2_intro A A (\lambda (a6: A).(\lambda (a7: A).(eq A +(AHead a3 a5) (AHead a6 a7)))) (\lambda (a6: A).(\lambda (_: A).(leq g a1 +a6))) (\lambda (_: A).(\lambda (a7: A).(leq g a2 a7))) a3 a5 (refl_equal A +(AHead a3 a5)) H8 H9))) a H7)) a4 (sym_eq A a4 a2 H6))) a0 (sym_eq A a0 a1 +H5))) H4)) H3 H0 H1)))]) in (H0 (refl_equal A (AHead a1 a2)) (refl_equal A +a))))))). + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/leq/props.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/leq/props.ma index 65f43ac68..7ec9240f4 100644 --- a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/leq/props.ma +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/leq/props.ma @@ -18,103 +18,43 @@ set "baseuri" "cic:/matita/LAMBDA-TYPES/Level-1/LambdaDelta/leq/props". include "leq/defs.ma". -theorem leq_gen_sort: - \forall (g: G).(\forall (h1: nat).(\forall (n1: nat).(\forall (a2: A).((leq -g (ASort h1 n1) a2) \to (ex2_3 nat nat nat (\lambda (n2: nat).(\lambda (h2: -nat).(\lambda (_: nat).(eq A a2 (ASort h2 n2))))) (\lambda (n2: nat).(\lambda -(h2: nat).(\lambda (k: nat).(eq A (aplus g (ASort h1 n1) k) (aplus g (ASort -h2 n2) k)))))))))) +theorem ahead_inj_snd: + \forall (g: G).(\forall (a1: A).(\forall (a2: A).(\forall (a3: A).(\forall +(a4: A).((leq g (AHead a1 a2) (AHead a3 a4)) \to (leq g a2 a4)))))) \def - \lambda (g: G).(\lambda (h1: nat).(\lambda (n1: nat).(\lambda (a2: -A).(\lambda (H: (leq g (ASort h1 n1) a2)).(let H0 \def (match H in leq return -(\lambda (a: A).(\lambda (a0: A).(\lambda (_: (leq ? a a0)).((eq A a (ASort -h1 n1)) \to ((eq A a0 a2) \to (ex2_3 nat nat nat (\lambda (n2: nat).(\lambda -(h2: nat).(\lambda (_: nat).(eq A a2 (ASort h2 n2))))) (\lambda (n2: -nat).(\lambda (h2: nat).(\lambda (k: nat).(eq A (aplus g (ASort h1 n1) k) -(aplus g (ASort h2 n2) k))))))))))) with [(leq_sort h0 h2 n0 n2 k H0) -\Rightarrow (\lambda (H1: (eq A (ASort h0 n0) (ASort h1 n1))).(\lambda (H2: -(eq A (ASort h2 n2) a2)).((let H3 \def (f_equal A nat (\lambda (e: A).(match -e in A return (\lambda (_: A).nat) with [(ASort _ n) \Rightarrow n | (AHead _ -_) \Rightarrow n0])) (ASort h0 n0) (ASort h1 n1) H1) in ((let H4 \def -(f_equal A nat (\lambda (e: A).(match e in A return (\lambda (_: A).nat) with -[(ASort n _) \Rightarrow n | (AHead _ _) \Rightarrow h0])) (ASort h0 n0) -(ASort h1 n1) H1) in (eq_ind nat h1 (\lambda (n: nat).((eq nat n0 n1) \to -((eq A (ASort h2 n2) a2) \to ((eq A (aplus g (ASort n n0) k) (aplus g (ASort -h2 n2) k)) \to (ex2_3 nat nat nat (\lambda (n3: nat).(\lambda (h3: -nat).(\lambda (_: nat).(eq A a2 (ASort h3 n3))))) (\lambda (n3: nat).(\lambda -(h3: nat).(\lambda (k0: nat).(eq A (aplus g (ASort h1 n1) k0) (aplus g (ASort -h3 n3) k0)))))))))) (\lambda (H5: (eq nat n0 n1)).(eq_ind nat n1 (\lambda (n: -nat).((eq A (ASort h2 n2) a2) \to ((eq A (aplus g (ASort h1 n) k) (aplus g -(ASort h2 n2) k)) \to (ex2_3 nat nat nat (\lambda (n3: nat).(\lambda (h3: -nat).(\lambda (_: nat).(eq A a2 (ASort h3 n3))))) (\lambda (n3: nat).(\lambda -(h3: nat).(\lambda (k0: nat).(eq A (aplus g (ASort h1 n1) k0) (aplus g (ASort -h3 n3) k0))))))))) (\lambda (H6: (eq A (ASort h2 n2) a2)).(eq_ind A (ASort h2 -n2) (\lambda (a: A).((eq A (aplus g (ASort h1 n1) k) (aplus g (ASort h2 n2) -k)) \to (ex2_3 nat nat nat (\lambda (n3: nat).(\lambda (h3: nat).(\lambda (_: -nat).(eq A a (ASort h3 n3))))) (\lambda (n3: nat).(\lambda (h3: nat).(\lambda -(k0: nat).(eq A (aplus g (ASort h1 n1) k0) (aplus g (ASort h3 n3) k0)))))))) -(\lambda (H7: (eq A (aplus g (ASort h1 n1) k) (aplus g (ASort h2 n2) -k))).(ex2_3_intro nat nat nat (\lambda (n3: nat).(\lambda (h3: nat).(\lambda -(_: nat).(eq A (ASort h2 n2) (ASort h3 n3))))) (\lambda (n3: nat).(\lambda -(h3: nat).(\lambda (k0: nat).(eq A (aplus g (ASort h1 n1) k0) (aplus g (ASort -h3 n3) k0))))) n2 h2 k (refl_equal A (ASort h2 n2)) H7)) a2 H6)) n0 (sym_eq -nat n0 n1 H5))) h0 (sym_eq nat h0 h1 H4))) H3)) H2 H0))) | (leq_head a1 a0 H0 -a3 a4 H1) \Rightarrow (\lambda (H2: (eq A (AHead a1 a3) (ASort h1 -n1))).(\lambda (H3: (eq A (AHead a0 a4) a2)).((let H4 \def (eq_ind A (AHead -a1 a3) (\lambda (e: A).(match e in A return (\lambda (_: A).Prop) with -[(ASort _ _) \Rightarrow False | (AHead _ _) \Rightarrow True])) I (ASort h1 -n1) H2) in (False_ind ((eq A (AHead a0 a4) a2) \to ((leq g a1 a0) \to ((leq g -a3 a4) \to (ex2_3 nat nat nat (\lambda (n2: nat).(\lambda (h2: nat).(\lambda -(_: nat).(eq A a2 (ASort h2 n2))))) (\lambda (n2: nat).(\lambda (h2: -nat).(\lambda (k: nat).(eq A (aplus g (ASort h1 n1) k) (aplus g (ASort h2 n2) -k))))))))) H4)) H3 H0 H1)))]) in (H0 (refl_equal A (ASort h1 n1)) (refl_equal -A a2))))))). - -theorem leq_gen_head: - \forall (g: G).(\forall (a1: A).(\forall (a2: A).(\forall (a: A).((leq g -(AHead a1 a2) a) \to (ex3_2 A A (\lambda (a3: A).(\lambda (a4: A).(eq A a -(AHead a3 a4)))) (\lambda (a3: A).(\lambda (_: A).(leq g a1 a3))) (\lambda -(_: A).(\lambda (a4: A).(leq g a2 a4)))))))) -\def - \lambda (g: G).(\lambda (a1: A).(\lambda (a2: A).(\lambda (a: A).(\lambda -(H: (leq g (AHead a1 a2) a)).(let H0 \def (match H in leq return (\lambda -(a0: A).(\lambda (a3: A).(\lambda (_: (leq ? a0 a3)).((eq A a0 (AHead a1 a2)) -\to ((eq A a3 a) \to (ex3_2 A A (\lambda (a4: A).(\lambda (a5: A).(eq A a -(AHead a4 a5)))) (\lambda (a4: A).(\lambda (_: A).(leq g a1 a4))) (\lambda -(_: A).(\lambda (a5: A).(leq g a2 a5))))))))) with [(leq_sort h1 h2 n1 n2 k -H0) \Rightarrow (\lambda (H1: (eq A (ASort h1 n1) (AHead a1 a2))).(\lambda -(H2: (eq A (ASort h2 n2) a)).((let H3 \def (eq_ind A (ASort h1 n1) (\lambda -(e: A).(match e in A return (\lambda (_: A).Prop) with [(ASort _ _) -\Rightarrow True | (AHead _ _) \Rightarrow False])) I (AHead a1 a2) H1) in -(False_ind ((eq A (ASort h2 n2) a) \to ((eq A (aplus g (ASort h1 n1) k) -(aplus g (ASort h2 n2) k)) \to (ex3_2 A A (\lambda (a3: A).(\lambda (a4: -A).(eq A a (AHead a3 a4)))) (\lambda (a3: A).(\lambda (_: A).(leq g a1 a3))) -(\lambda (_: A).(\lambda (a4: A).(leq g a2 a4)))))) H3)) H2 H0))) | (leq_head -a0 a3 H0 a4 a5 H1) \Rightarrow (\lambda (H2: (eq A (AHead a0 a4) (AHead a1 -a2))).(\lambda (H3: (eq A (AHead a3 a5) a)).((let H4 \def (f_equal A A -(\lambda (e: A).(match e in A return (\lambda (_: A).A) with [(ASort _ _) -\Rightarrow a4 | (AHead _ a6) \Rightarrow a6])) (AHead a0 a4) (AHead a1 a2) -H2) in ((let H5 \def (f_equal A A (\lambda (e: A).(match e in A return -(\lambda (_: A).A) with [(ASort _ _) \Rightarrow a0 | (AHead a6 _) -\Rightarrow a6])) (AHead a0 a4) (AHead a1 a2) H2) in (eq_ind A a1 (\lambda -(a6: A).((eq A a4 a2) \to ((eq A (AHead a3 a5) a) \to ((leq g a6 a3) \to -((leq g a4 a5) \to (ex3_2 A A (\lambda (a7: A).(\lambda (a8: A).(eq A a -(AHead a7 a8)))) (\lambda (a7: A).(\lambda (_: A).(leq g a1 a7))) (\lambda -(_: A).(\lambda (a8: A).(leq g a2 a8))))))))) (\lambda (H6: (eq A a4 -a2)).(eq_ind A a2 (\lambda (a6: A).((eq A (AHead a3 a5) a) \to ((leq g a1 a3) -\to ((leq g a6 a5) \to (ex3_2 A A (\lambda (a7: A).(\lambda (a8: A).(eq A a -(AHead a7 a8)))) (\lambda (a7: A).(\lambda (_: A).(leq g a1 a7))) (\lambda -(_: A).(\lambda (a8: A).(leq g a2 a8)))))))) (\lambda (H7: (eq A (AHead a3 -a5) a)).(eq_ind A (AHead a3 a5) (\lambda (a6: A).((leq g a1 a3) \to ((leq g -a2 a5) \to (ex3_2 A A (\lambda (a7: A).(\lambda (a8: A).(eq A a6 (AHead a7 -a8)))) (\lambda (a7: A).(\lambda (_: A).(leq g a1 a7))) (\lambda (_: -A).(\lambda (a8: A).(leq g a2 a8))))))) (\lambda (H8: (leq g a1 a3)).(\lambda -(H9: (leq g a2 a5)).(ex3_2_intro A A (\lambda (a6: A).(\lambda (a7: A).(eq A -(AHead a3 a5) (AHead a6 a7)))) (\lambda (a6: A).(\lambda (_: A).(leq g a1 -a6))) (\lambda (_: A).(\lambda (a7: A).(leq g a2 a7))) a3 a5 (refl_equal A -(AHead a3 a5)) H8 H9))) a H7)) a4 (sym_eq A a4 a2 H6))) a0 (sym_eq A a0 a1 -H5))) H4)) H3 H0 H1)))]) in (H0 (refl_equal A (AHead a1 a2)) (refl_equal A -a))))))). + \lambda (g: G).(\lambda (a1: A).(\lambda (a2: A).(\lambda (a3: A).(\lambda +(a4: A).(\lambda (H: (leq g (AHead a1 a2) (AHead a3 a4))).(let H0 \def (match +H in leq return (\lambda (a: A).(\lambda (a0: A).(\lambda (_: (leq ? a +a0)).((eq A a (AHead a1 a2)) \to ((eq A a0 (AHead a3 a4)) \to (leq g a2 +a4)))))) with [(leq_sort h1 h2 n1 n2 k H0) \Rightarrow (\lambda (H1: (eq A +(ASort h1 n1) (AHead a1 a2))).(\lambda (H2: (eq A (ASort h2 n2) (AHead a3 +a4))).((let H3 \def (eq_ind A (ASort h1 n1) (\lambda (e: A).(match e in A +return (\lambda (_: A).Prop) with [(ASort _ _) \Rightarrow True | (AHead _ _) +\Rightarrow False])) I (AHead a1 a2) H1) in (False_ind ((eq A (ASort h2 n2) +(AHead a3 a4)) \to ((eq A (aplus g (ASort h1 n1) k) (aplus g (ASort h2 n2) +k)) \to (leq g a2 a4))) H3)) H2 H0))) | (leq_head a0 a5 H0 a6 a7 H1) +\Rightarrow (\lambda (H2: (eq A (AHead a0 a6) (AHead a1 a2))).(\lambda (H3: +(eq A (AHead a5 a7) (AHead a3 a4))).((let H4 \def (f_equal A A (\lambda (e: +A).(match e in A return (\lambda (_: A).A) with [(ASort _ _) \Rightarrow a6 | +(AHead _ a) \Rightarrow a])) (AHead a0 a6) (AHead a1 a2) H2) in ((let H5 \def +(f_equal A A (\lambda (e: A).(match e in A return (\lambda (_: A).A) with +[(ASort _ _) \Rightarrow a0 | (AHead a _) \Rightarrow a])) (AHead a0 a6) +(AHead a1 a2) H2) in (eq_ind A a1 (\lambda (a: A).((eq A a6 a2) \to ((eq A +(AHead a5 a7) (AHead a3 a4)) \to ((leq g a a5) \to ((leq g a6 a7) \to (leq g +a2 a4)))))) (\lambda (H6: (eq A a6 a2)).(eq_ind A a2 (\lambda (a: A).((eq A +(AHead a5 a7) (AHead a3 a4)) \to ((leq g a1 a5) \to ((leq g a a7) \to (leq g +a2 a4))))) (\lambda (H7: (eq A (AHead a5 a7) (AHead a3 a4))).(let H8 \def +(f_equal A A (\lambda (e: A).(match e in A return (\lambda (_: A).A) with +[(ASort _ _) \Rightarrow a7 | (AHead _ a) \Rightarrow a])) (AHead a5 a7) +(AHead a3 a4) H7) in ((let H9 \def (f_equal A A (\lambda (e: A).(match e in A +return (\lambda (_: A).A) with [(ASort _ _) \Rightarrow a5 | (AHead a _) +\Rightarrow a])) (AHead a5 a7) (AHead a3 a4) H7) in (eq_ind A a3 (\lambda (a: +A).((eq A a7 a4) \to ((leq g a1 a) \to ((leq g a2 a7) \to (leq g a2 a4))))) +(\lambda (H10: (eq A a7 a4)).(eq_ind A a4 (\lambda (a: A).((leq g a1 a3) \to +((leq g a2 a) \to (leq g a2 a4)))) (\lambda (_: (leq g a1 a3)).(\lambda (H12: +(leq g a2 a4)).H12)) a7 (sym_eq A a7 a4 H10))) a5 (sym_eq A a5 a3 H9))) H8))) +a6 (sym_eq A a6 a2 H6))) a0 (sym_eq A a0 a1 H5))) H4)) H3 H0 H1)))]) in (H0 +(refl_equal A (AHead a1 a2)) (refl_equal A (AHead a3 a4))))))))). theorem leq_refl: \forall (g: G).(\forall (a: A).(leq g a a)) diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/llt/defs.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/llt/defs.ma new file mode 100644 index 000000000..ae8e69c09 --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/llt/defs.ma @@ -0,0 +1,32 @@ +(**************************************************************************) +(* ___ *) +(* ||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/llt/defs". + +include "A/defs.ma". + +definition lweight: + A \to nat +\def + let rec lweight (a: A) on a: nat \def (match a with [(ASort _ _) \Rightarrow +O | (AHead a1 a2) \Rightarrow (S (plus (lweight a1) (lweight a2)))]) in +lweight. + +definition llt: + A \to (A \to Prop) +\def + \lambda (a1: A).(\lambda (a2: A).(lt (lweight a1) (lweight a2))). + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/llt/props.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/llt/props.ma new file mode 100644 index 000000000..4a3b2b3e1 --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/llt/props.ma @@ -0,0 +1,99 @@ +(**************************************************************************) +(* ___ *) +(* ||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/llt/props". + +include "llt/defs.ma". + +include "leq/defs.ma". + +theorem lweight_repl: + \forall (g: G).(\forall (a1: A).(\forall (a2: A).((leq g a1 a2) \to (eq nat +(lweight a1) (lweight a2))))) +\def + \lambda (g: G).(\lambda (a1: A).(\lambda (a2: A).(\lambda (H: (leq g a1 +a2)).(leq_ind g (\lambda (a: A).(\lambda (a0: A).(eq nat (lweight a) (lweight +a0)))) (\lambda (h1: nat).(\lambda (h2: nat).(\lambda (n1: nat).(\lambda (n2: +nat).(\lambda (k: nat).(\lambda (_: (eq A (aplus g (ASort h1 n1) k) (aplus g +(ASort h2 n2) k))).(refl_equal nat O))))))) (\lambda (a0: A).(\lambda (a3: +A).(\lambda (_: (leq g a0 a3)).(\lambda (H1: (eq nat (lweight a0) (lweight +a3))).(\lambda (a4: A).(\lambda (a5: A).(\lambda (_: (leq g a4 a5)).(\lambda +(H3: (eq nat (lweight a4) (lweight a5))).(f_equal nat nat S (plus (lweight +a0) (lweight a4)) (plus (lweight a3) (lweight a5)) (f_equal2 nat nat nat plus +(lweight a0) (lweight a3) (lweight a4) (lweight a5) H1 H3)))))))))) a1 a2 +H)))). + +theorem llt_repl: + \forall (g: G).(\forall (a1: A).(\forall (a2: A).((leq g a1 a2) \to (\forall +(a3: A).((llt a1 a3) \to (llt a2 a3)))))) +\def + \lambda (g: G).(\lambda (a1: A).(\lambda (a2: A).(\lambda (H: (leq g a1 +a2)).(\lambda (a3: A).(\lambda (H0: (lt (lweight a1) (lweight a3))).(let H1 +\def (eq_ind nat (lweight a1) (\lambda (n: nat).(lt n (lweight a3))) H0 +(lweight a2) (lweight_repl g a1 a2 H)) in H1)))))). + +theorem llt_trans: + \forall (a1: A).(\forall (a2: A).(\forall (a3: A).((llt a1 a2) \to ((llt a2 +a3) \to (llt a1 a3))))) +\def + \lambda (a1: A).(\lambda (a2: A).(\lambda (a3: A).(\lambda (H: (lt (lweight +a1) (lweight a2))).(\lambda (H0: (lt (lweight a2) (lweight a3))).(lt_trans +(lweight a1) (lweight a2) (lweight a3) H H0))))). + +theorem llt_head_sx: + \forall (a1: A).(\forall (a2: A).(llt a1 (AHead a1 a2))) +\def + \lambda (a1: A).(\lambda (a2: A).(le_S_n (S (lweight a1)) (S (plus (lweight +a1) (lweight a2))) (le_n_S (S (lweight a1)) (S (plus (lweight a1) (lweight +a2))) (le_n_S (lweight a1) (plus (lweight a1) (lweight a2)) (le_plus_l +(lweight a1) (lweight a2)))))). + +theorem llt_head_dx: + \forall (a1: A).(\forall (a2: A).(llt a2 (AHead a1 a2))) +\def + \lambda (a1: A).(\lambda (a2: A).(le_S_n (S (lweight a2)) (S (plus (lweight +a1) (lweight a2))) (le_n_S (S (lweight a2)) (S (plus (lweight a1) (lweight +a2))) (le_n_S (lweight a2) (plus (lweight a1) (lweight a2)) (le_plus_r +(lweight a1) (lweight a2)))))). + +theorem llt_wf__q_ind: + \forall (P: ((A \to Prop))).(((\forall (n: nat).((\lambda (P0: ((A \to +Prop))).(\lambda (n0: nat).(\forall (a: A).((eq nat (lweight a) n0) \to (P0 +a))))) P n))) \to (\forall (a: A).(P a))) +\def + let Q \def (\lambda (P: ((A \to Prop))).(\lambda (n: nat).(\forall (a: +A).((eq nat (lweight a) n) \to (P a))))) in (\lambda (P: ((A \to +Prop))).(\lambda (H: ((\forall (n: nat).(\forall (a: A).((eq nat (lweight a) +n) \to (P a)))))).(\lambda (a: A).(H (lweight a) a (refl_equal nat (lweight +a)))))). + +theorem llt_wf_ind: + \forall (P: ((A \to Prop))).(((\forall (a2: A).(((\forall (a1: A).((llt a1 +a2) \to (P a1)))) \to (P a2)))) \to (\forall (a: A).(P a))) +\def + let Q \def (\lambda (P: ((A \to Prop))).(\lambda (n: nat).(\forall (a: +A).((eq nat (lweight a) n) \to (P a))))) in (\lambda (P: ((A \to +Prop))).(\lambda (H: ((\forall (a2: A).(((\forall (a1: A).((lt (lweight a1) +(lweight a2)) \to (P a1)))) \to (P a2))))).(\lambda (a: A).(llt_wf__q_ind +(\lambda (a0: A).(P a0)) (\lambda (n: nat).(lt_wf_ind n (Q (\lambda (a0: +A).(P a0))) (\lambda (n0: nat).(\lambda (H0: ((\forall (m: nat).((lt m n0) +\to (Q (\lambda (a0: A).(P a0)) m))))).(\lambda (a0: A).(\lambda (H1: (eq nat +(lweight a0) n0)).(let H2 \def (eq_ind_r nat n0 (\lambda (n1: nat).(\forall +(m: nat).((lt m n1) \to (\forall (a1: A).((eq nat (lweight a1) m) \to (P +a1)))))) H0 (lweight a0) H1) in (H a0 (\lambda (a1: A).(\lambda (H3: (lt +(lweight a1) (lweight a0))).(H2 (lweight a1) H3 a1 (refl_equal nat (lweight +a1))))))))))))) a)))). + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/theory.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/theory.ma index 8b96936ab..423565e49 100644 --- a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/theory.ma +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/theory.ma @@ -176,7 +176,35 @@ include "aplus/props.ma". include "leq/defs.ma". +include "leq/fwd.ma". + include "leq/props.ma". include "leq/asucc.ma". +include "llt/defs.ma". + +include "llt/props.ma". + +include "aprem/defs.ma". + +include "aprem/props.ma". + +include "gz/defs.ma". + +include "gz/props.ma". + +include "arity/defs.ma". + +include "arity/fwd.ma". + +include "arity/props.ma". + +include "arity/subst0.ma". + +include "arity/lift1.ma". + +include "arity/cimp.ma". + +include "arity/aprem.ma". +