From fdda444a05fe4c68c925cd94e4e3a38c93d0c35f Mon Sep 17 00:00:00 2001 From: Ferruccio Guidi Date: Wed, 5 Sep 2007 13:50:38 +0000 Subject: [PATCH] - matitaInit matitaprover matitadep matitamake: fixed configuration precedence: cmdline > configuration_file > default - core_natation: added notation for single step parallel reduction: => - LAMBDA-TYPES: some new theorems - LOGIC: some new definitions --- .../contribs/LAMBDA-TYPES/Base-1/ext/arith.ma | 25 + .../contribs/LAMBDA-TYPES/Base-1/makefile | 2 +- .../contribs/LAMBDA-TYPES/Base-1/preamble.ma | 2 + .../contribs/LAMBDA-TYPES/Base-1/spare.ma | 154 +++ .../LAMBDA-TYPES/Base-1/types/defs.ma | 3 + .../contribs/LAMBDA-TYPES/Base-2/blt/defs.mma | 2 +- .../LAMBDA-TYPES/Base-2/ext/arith.mma | 6 + .../LAMBDA-TYPES/Base-2/plist/defs.mma | 2 +- .../contribs/LAMBDA-TYPES/Base-2/preamble.ma | 2 - .../LAMBDA-TYPES/Base-2/types/defs.mma | 5 +- .../LAMBDA-TYPES/LambdaDelta-1/arity/props.ma | 20 + .../LAMBDA-TYPES/LambdaDelta-1/definitions.ma | 2 + .../LAMBDA-TYPES/LambdaDelta-1/ex2/defs.ma | 30 + .../LAMBDA-TYPES/LambdaDelta-1/ex2/props.ma | 171 +++ .../LAMBDA-TYPES/LambdaDelta-1/leq/asucc.ma | 8 +- .../LAMBDA-TYPES/LambdaDelta-1/leq/props.ma | 105 +- .../LAMBDA-TYPES/LambdaDelta-1/makefile | 2 +- .../LAMBDA-TYPES/LambdaDelta-1/nf2/arity.ma | 534 +++++++++ .../LAMBDA-TYPES/LambdaDelta-1/nf2/defs.ma | 7 + .../LAMBDA-TYPES/LambdaDelta-1/nf2/fwd.ma | 113 ++ .../LAMBDA-TYPES/LambdaDelta-1/nf2/props.ma | 19 + .../LAMBDA-TYPES/LambdaDelta-1/pc3/fwd.ma | 22 + .../LAMBDA-TYPES/LambdaDelta-1/spare.ma | 1067 +---------------- .../LAMBDA-TYPES/LambdaDelta-1/theory.ma | 4 + .../LAMBDA-TYPES/LambdaDelta-1/ty3/arity.ma | 2 +- .../LambdaDelta-1/ty3/arity_props.ma | 33 + .../LAMBDA-TYPES/LambdaDelta-1/ty3/nf2.ma | 160 +++ .../LAMBDA-TYPES/LambdaDelta-1/ty3/props.ma | 52 + .../matita/contribs/LOGIC/PNF/defs.ma | 24 + .../matita/contribs/LOGIC/PRed/defs.ma | 39 + helm/software/matita/core_notation.moo | 4 + helm/software/matita/matitaInit.ml | 44 +- helm/software/matita/matitaInit.mli | 4 +- helm/software/matita/matitadep.ml | 4 +- helm/software/matita/matitamake.ml | 4 +- helm/software/matita/matitaprover.ml | 4 +- 36 files changed, 1569 insertions(+), 1112 deletions(-) create mode 100644 helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/ex2/defs.ma create mode 100644 helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/ex2/props.ma create mode 100644 helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/nf2/arity.ma create mode 100644 helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/ty3/nf2.ma create mode 100644 helm/software/matita/contribs/LOGIC/PNF/defs.ma create mode 100644 helm/software/matita/contribs/LOGIC/PRed/defs.ma diff --git a/helm/software/matita/contribs/LAMBDA-TYPES/Base-1/ext/arith.ma b/helm/software/matita/contribs/LAMBDA-TYPES/Base-1/ext/arith.ma index 1ce93fd7f..e8a076513 100644 --- a/helm/software/matita/contribs/LAMBDA-TYPES/Base-1/ext/arith.ma +++ b/helm/software/matita/contribs/LAMBDA-TYPES/Base-1/ext/arith.ma @@ -184,6 +184,14 @@ theorem le_Sx_x: \lambda (x: nat).(\lambda (H: (le (S x) x)).(\lambda (P: Prop).(let H0 \def le_Sn_n in (False_ind P (H0 x H))))). +theorem le_n_pred: + \forall (n: nat).(\forall (m: nat).((le n m) \to (le (pred n) (pred m)))) +\def + \lambda (n: nat).(\lambda (m: nat).(\lambda (H: (le n m)).(le_ind n (\lambda +(n0: nat).(le (pred n) (pred n0))) (le_n (pred n)) (\lambda (m0: +nat).(\lambda (_: (le n m0)).(\lambda (H1: (le (pred n) (pred m0))).(le_trans +(pred n) (pred m0) m0 H1 (le_pred_n m0))))) m H))). + theorem minus_le: \forall (x: nat).(\forall (y: nat).(le (minus x y) x)) \def @@ -264,6 +272,14 @@ theorem le_trans_plus_r: \lambda (x: nat).(\lambda (y: nat).(\lambda (z: nat).(\lambda (H: (le (plus x y) z)).(le_trans y (plus x y) z (le_plus_r x y) H)))). +theorem lt_x_O: + \forall (x: nat).((lt x O) \to (\forall (P: Prop).P)) +\def + \lambda (x: nat).(\lambda (H: (le (S x) O)).(\lambda (P: Prop).(let H_y \def +(le_n_O_eq (S x) H) in (let H0 \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) H_y) in (False_ind P H0))))). + theorem le_gen_S: \forall (m: nat).(\forall (x: nat).((le (S m) x) \to (ex2 nat (\lambda (n: nat).(eq nat x (S n))) (\lambda (n: nat).(le m n))))) @@ -586,3 +602,12 @@ d h) n)).(let H0 \def (le_trans d (plus d h) n (le_plus_l d h) H) in (let H1 (le_plus_minus_sym h n (le_trans_plus_r d h n H))) in (le_S d (minus n h) (le_minus d n h H))))))). +theorem lt_x_pred_y: + \forall (x: nat).(\forall (y: nat).((lt x (pred y)) \to (lt (S x) y))) +\def + \lambda (x: nat).(\lambda (y: nat).(nat_ind (\lambda (n: nat).((lt x (pred +n)) \to (lt (S x) n))) (\lambda (H: (lt x O)).(lt_x_O x H (lt (S x) O))) +(\lambda (n: nat).(\lambda (_: (((lt x (pred n)) \to (lt (S x) n)))).(\lambda +(H0: (lt x n)).(le_S_n (S (S x)) (S n) (le_n_S (S (S x)) (S n) (le_n_S (S x) +n H0)))))) y)). + diff --git a/helm/software/matita/contribs/LAMBDA-TYPES/Base-1/makefile b/helm/software/matita/contribs/LAMBDA-TYPES/Base-1/makefile index d7a63e5f1..e869346ab 100644 --- a/helm/software/matita/contribs/LAMBDA-TYPES/Base-1/makefile +++ b/helm/software/matita/contribs/LAMBDA-TYPES/Base-1/makefile @@ -1,7 +1,7 @@ H=@ RT_BASEDIR=../../../ -OPTIONS=-bench +OPTIONS=-bench -onepass MMAKE=$(RT_BASEDIR)matitamake $(OPTIONS) CLEAN=$(RT_BASEDIR)matitaclean $(OPTIONS) MMAKEO=$(RT_BASEDIR)matitamake.opt $(OPTIONS) diff --git a/helm/software/matita/contribs/LAMBDA-TYPES/Base-1/preamble.ma b/helm/software/matita/contribs/LAMBDA-TYPES/Base-1/preamble.ma index 44823fc81..f5ad380c9 100644 --- a/helm/software/matita/contribs/LAMBDA-TYPES/Base-1/preamble.ma +++ b/helm/software/matita/contribs/LAMBDA-TYPES/Base-1/preamble.ma @@ -36,6 +36,7 @@ alias id "False_ind" = "cic:/Coq/Init/Logic/False_ind.con". alias id "I" = "cic:/Coq/Init/Logic/True.ind#xpointer(1/1/1)". alias id "land" = "cic:/Coq/Init/Logic/and.ind#xpointer(1/1)". alias id "le" = "cic:/Coq/Init/Peano/le.ind#xpointer(1/1)". +alias id "le_ind" = "cic:/Coq/Init/Peano/le_ind.con". alias id "le_lt_n_Sm" = "cic:/Coq/Arith/Lt/le_lt_n_Sm.con". alias id "le_lt_or_eq" = "cic:/Coq/Arith/Lt/le_lt_or_eq.con". alias id "le_n" = "cic:/Coq/Init/Peano/le.ind#xpointer(1/1/1)". @@ -48,6 +49,7 @@ alias id "le_plus_l" = "cic:/Coq/Arith/Plus/le_plus_l.con". alias id "le_plus_minus" = "cic:/Coq/Arith/Minus/le_plus_minus.con". alias id "le_plus_minus_r" = "cic:/Coq/Arith/Minus/le_plus_minus_r.con". alias id "le_plus_r" = "cic:/Coq/Arith/Plus/le_plus_r.con". +alias id "le_pred_n" = "cic:/Coq/Arith/Le/le_pred_n.con". alias id "le_S" = "cic:/Coq/Init/Peano/le.ind#xpointer(1/1/2)". alias id "le_S_n" = "cic:/Coq/Arith/Le/le_S_n.con". alias id "le_Sn_n" = "cic:/Coq/Arith/Le/le_Sn_n.con". diff --git a/helm/software/matita/contribs/LAMBDA-TYPES/Base-1/spare.ma b/helm/software/matita/contribs/LAMBDA-TYPES/Base-1/spare.ma index f66934f78..e19f961cc 100644 --- a/helm/software/matita/contribs/LAMBDA-TYPES/Base-1/spare.ma +++ b/helm/software/matita/contribs/LAMBDA-TYPES/Base-1/spare.ma @@ -17,4 +17,158 @@ set "baseuri" "cic:/matita/LAMBDA-TYPES/Base-1/spare". include "theory.ma". +(* +inductive pr: Set \def +| pr_zero: pr +| pr_succ: pr +| pr_proj: nat \to pr +| pr_comp: ((nat \to pr)) \to (pr \to pr) +| pr_prec: pr \to (pr \to pr). +definition pr_type: + Set +\def + ((nat \to nat)) \to nat. + +definition prec_appl: + pr_type \to (pr_type \to (nat \to pr_type)) +\def + let rec prec_appl (f: pr_type) (g: pr_type) (n: nat) on n: pr_type \def +(match n with [O \Rightarrow f | (S m) \Rightarrow (\lambda (ns: ((nat \to +nat))).(g (\lambda (i: nat).(match i with [O \Rightarrow (prec_appl f g m ns) +| (S n0) \Rightarrow (match n0 with [O \Rightarrow m | (S j) \Rightarrow (ns +j)])]))))]) in prec_appl. + +definition pr_appl: + pr \to pr_type +\def + let rec pr_appl (h: pr) on h: pr_type \def (match h with [pr_zero +\Rightarrow (\lambda (_: ((nat \to nat))).O) | pr_succ \Rightarrow (\lambda +(ns: ((nat \to nat))).(S (ns O))) | (pr_proj i) \Rightarrow (\lambda (ns: +((nat \to nat))).(ns i)) | (pr_comp fs g) \Rightarrow (\lambda (ns: ((nat \to +nat))).(pr_appl g (\lambda (i: nat).(pr_appl (fs i) ns)))) | (pr_prec f g) +\Rightarrow (\lambda (ns: ((nat \to nat))).(prec_appl (pr_appl f) (pr_appl g) +(ns O) (\lambda (i: nat).(ns (S i)))))]) in pr_appl. + +inductive pr_arity: pr \to (nat \to Prop) \def +| pr_arity_zero: \forall (n: nat).(pr_arity pr_zero n) +| pr_arity_succ: \forall (n: nat).((lt O n) \to (pr_arity pr_succ n)) +| pr_arity_proj: \forall (n: nat).(\forall (i: nat).((lt i n) \to (pr_arity +(pr_proj i) n))) +| pr_arity_comp: \forall (n: nat).(\forall (m: nat).(\forall (fs: ((nat \to +pr))).(\forall (g: pr).((pr_arity g m) \to (((\forall (i: nat).((lt i m) \to +(pr_arity (fs i) n)))) \to (pr_arity (pr_comp fs g) n)))))) +| pr_arity_prec: \forall (n: nat).(\forall (f: pr).(\forall (g: pr).((lt O n) +\to ((pr_arity f (pred n)) \to ((pr_arity g (S n)) \to (pr_arity (pr_prec f +g) n)))))). + +theorem pr_arity_le: + \forall (h: pr).(\forall (m: nat).((pr_arity h m) \to (\forall (n: nat).((le +m n) \to (pr_arity h n))))) +\def + \lambda (h: pr).(\lambda (m: nat).(\lambda (H: (pr_arity h m)).(pr_arity_ind +(\lambda (p: pr).(\lambda (n: nat).(\forall (n0: nat).((le n n0) \to +(pr_arity p n0))))) (\lambda (n: nat).(\lambda (n0: nat).(\lambda (_: (le n +n0)).(pr_arity_zero n0)))) (\lambda (n: nat).(\lambda (H0: (lt O n)).(\lambda +(n0: nat).(\lambda (H1: (le n n0)).(pr_arity_succ n0 (lt_le_trans O n n0 H0 +H1)))))) (\lambda (n: nat).(\lambda (i: nat).(\lambda (H0: (lt i n)).(\lambda +(n0: nat).(\lambda (H1: (le n n0)).(pr_arity_proj n0 i (lt_le_trans i n n0 H0 +H1))))))) (\lambda (n: nat).(\lambda (m0: nat).(\lambda (fs: ((nat \to +pr))).(\lambda (g: pr).(\lambda (H0: (pr_arity g m0)).(\lambda (_: ((\forall +(n0: nat).((le m0 n0) \to (pr_arity g n0))))).(\lambda (_: ((\forall (i: +nat).((lt i m0) \to (pr_arity (fs i) n))))).(\lambda (H3: ((\forall (i: +nat).((lt i m0) \to (\forall (n0: nat).((le n n0) \to (pr_arity (fs i) +n0))))))).(\lambda (n0: nat).(\lambda (H4: (le n n0)).(pr_arity_comp n0 m0 fs +g H0 (\lambda (i: nat).(\lambda (H5: (lt i m0)).(H3 i H5 n0 H4)))))))))))))) +(\lambda (n: nat).(\lambda (f: pr).(\lambda (g: pr).(\lambda (H0: (lt O +n)).(\lambda (_: (pr_arity f (pred n))).(\lambda (H2: ((\forall (n0: +nat).((le (pred n) n0) \to (pr_arity f n0))))).(\lambda (_: (pr_arity g (S +n))).(\lambda (H4: ((\forall (n0: nat).((le (S n) n0) \to (pr_arity g +n0))))).(\lambda (n0: nat).(\lambda (H5: (le n n0)).(pr_arity_prec n0 f g +(lt_le_trans O n n0 H0 H5) (H2 (pred n0) (le_n_pred n n0 H5)) (H4 (S n0) +(le_n_S n n0 H5))))))))))))) h m H))). + +theorem pr_arity_appl: + \forall (h: pr).(\forall (n: nat).((pr_arity h n) \to (\forall (ns: ((nat +\to nat))).(\forall (ms: ((nat \to nat))).(((\forall (i: nat).((lt i n) \to +(eq nat (ns i) (ms i))))) \to (eq nat (pr_appl h ns) (pr_appl h ms))))))) +\def + \lambda (h: pr).(\lambda (n: nat).(\lambda (H: (pr_arity h n)).(pr_arity_ind +(\lambda (p: pr).(\lambda (n0: nat).(\forall (ns: ((nat \to nat))).(\forall +(ms: ((nat \to nat))).(((\forall (i: nat).((lt i n0) \to (eq nat (ns i) (ms +i))))) \to (eq nat (pr_appl p ns) (pr_appl p ms))))))) (\lambda (n0: +nat).(\lambda (ns: ((nat \to nat))).(\lambda (ms: ((nat \to nat))).(\lambda +(_: ((\forall (i: nat).((lt i n0) \to (eq nat (ns i) (ms i)))))).(refl_equal +nat O))))) (\lambda (n0: nat).(\lambda (H0: (lt O n0)).(\lambda (ns: ((nat +\to nat))).(\lambda (ms: ((nat \to nat))).(\lambda (H1: ((\forall (i: +nat).((lt i n0) \to (eq nat (ns i) (ms i)))))).(f_equal nat nat S (ns O) (ms +O) (H1 O H0))))))) (\lambda (n0: nat).(\lambda (i: nat).(\lambda (H0: (lt i +n0)).(\lambda (ns: ((nat \to nat))).(\lambda (ms: ((nat \to nat))).(\lambda +(H1: ((\forall (i0: nat).((lt i0 n0) \to (eq nat (ns i0) (ms i0)))))).(H1 i +H0))))))) (\lambda (n0: nat).(\lambda (m: nat).(\lambda (fs: ((nat \to +pr))).(\lambda (g: pr).(\lambda (_: (pr_arity g m)).(\lambda (H1: ((\forall +(ns: ((nat \to nat))).(\forall (ms: ((nat \to nat))).(((\forall (i: nat).((lt +i m) \to (eq nat (ns i) (ms i))))) \to (eq nat (pr_appl g ns) (pr_appl g +ms))))))).(\lambda (_: ((\forall (i: nat).((lt i m) \to (pr_arity (fs i) +n0))))).(\lambda (H3: ((\forall (i: nat).((lt i m) \to (\forall (ns: ((nat +\to nat))).(\forall (ms: ((nat \to nat))).(((\forall (i0: nat).((lt i0 n0) +\to (eq nat (ns i0) (ms i0))))) \to (eq nat (pr_appl (fs i) ns) (pr_appl (fs +i) ms))))))))).(\lambda (ns: ((nat \to nat))).(\lambda (ms: ((nat \to +nat))).(\lambda (H4: ((\forall (i: nat).((lt i n0) \to (eq nat (ns i) (ms +i)))))).(H1 (\lambda (i: nat).(pr_appl (fs i) ns)) (\lambda (i: nat).(pr_appl +(fs i) ms)) (\lambda (i: nat).(\lambda (H5: (lt i m)).(H3 i H5 ns ms +H4))))))))))))))) (\lambda (n0: nat).(\lambda (f: pr).(\lambda (g: +pr).(\lambda (H0: (lt O n0)).(\lambda (_: (pr_arity f (pred n0))).(\lambda +(H2: ((\forall (ns: ((nat \to nat))).(\forall (ms: ((nat \to +nat))).(((\forall (i: nat).((lt i (pred n0)) \to (eq nat (ns i) (ms i))))) +\to (eq nat (pr_appl f ns) (pr_appl f ms))))))).(\lambda (_: (pr_arity g (S +n0))).(\lambda (H4: ((\forall (ns: ((nat \to nat))).(\forall (ms: ((nat \to +nat))).(((\forall (i: nat).((lt i (S n0)) \to (eq nat (ns i) (ms i))))) \to +(eq nat (pr_appl g ns) (pr_appl g ms))))))).(\lambda (ns: ((nat \to +nat))).(\lambda (ms: ((nat \to nat))).(\lambda (H5: ((\forall (i: nat).((lt i +n0) \to (eq nat (ns i) (ms i)))))).(eq_ind nat (ns O) (\lambda (n1: nat).(eq +nat (prec_appl (pr_appl f) (pr_appl g) (ns O) (\lambda (i: nat).(ns (S i)))) +(prec_appl (pr_appl f) (pr_appl g) n1 (\lambda (i: nat).(ms (S i)))))) (let +n1 \def (ns O) in (nat_ind (\lambda (n2: nat).(eq nat (prec_appl (pr_appl f) +(pr_appl g) n2 (\lambda (i: nat).(ns (S i)))) (prec_appl (pr_appl f) (pr_appl +g) n2 (\lambda (i: nat).(ms (S i)))))) (H2 (\lambda (i: nat).(ns (S i))) +(\lambda (i: nat).(ms (S i))) (\lambda (i: nat).(\lambda (H6: (lt i (pred +n0))).(H5 (S i) (lt_x_pred_y i n0 H6))))) (\lambda (n2: nat).(\lambda (IHn0: +(eq nat (prec_appl (pr_appl f) (pr_appl g) n2 (\lambda (i: nat).(ns (S i)))) +(prec_appl (pr_appl f) (pr_appl g) n2 (\lambda (i: nat).(ms (S i)))))).(H4 +(\lambda (i: nat).(match i with [O \Rightarrow (prec_appl (pr_appl f) +(pr_appl g) n2 (\lambda (i0: nat).(ns (S i0)))) | (S n3) \Rightarrow (match +n3 with [O \Rightarrow n2 | (S j) \Rightarrow (ns (S j))])])) (\lambda (i: +nat).(match i with [O \Rightarrow (prec_appl (pr_appl f) (pr_appl g) n2 +(\lambda (i0: nat).(ms (S i0)))) | (S n3) \Rightarrow (match n3 with [O +\Rightarrow n2 | (S j) \Rightarrow (ms (S j))])])) (\lambda (i: nat).(\lambda +(H6: (lt i (S n0))).(nat_ind (\lambda (n3: nat).((lt n3 (S n0)) \to (eq nat +(match n3 with [O \Rightarrow (prec_appl (pr_appl f) (pr_appl g) n2 (\lambda +(i0: nat).(ns (S i0)))) | (S n4) \Rightarrow (match n4 with [O \Rightarrow n2 +| (S j) \Rightarrow (ns (S j))])]) (match n3 with [O \Rightarrow (prec_appl +(pr_appl f) (pr_appl g) n2 (\lambda (i0: nat).(ms (S i0)))) | (S n4) +\Rightarrow (match n4 with [O \Rightarrow n2 | (S j) \Rightarrow (ms (S +j))])])))) (\lambda (_: (lt O (S n0))).IHn0) (\lambda (i0: nat).(\lambda (_: +(((lt i0 (S n0)) \to (eq nat (match i0 with [O \Rightarrow (prec_appl +(pr_appl f) (pr_appl g) n2 (\lambda (i1: nat).(ns (S i1)))) | (S n3) +\Rightarrow (match n3 with [O \Rightarrow n2 | (S j) \Rightarrow (ns (S +j))])]) (match i0 with [O \Rightarrow (prec_appl (pr_appl f) (pr_appl g) n2 +(\lambda (i1: nat).(ms (S i1)))) | (S n3) \Rightarrow (match n3 with [O +\Rightarrow n2 | (S j) \Rightarrow (ms (S j))])]))))).(\lambda (H7: (lt (S +i0) (S n0))).(let H_y \def (H5 i0 (lt_S_n i0 n0 H7)) in (nat_ind (\lambda +(n3: nat).((eq nat (ns n3) (ms n3)) \to (eq nat (match n3 with [O \Rightarrow +n2 | (S j) \Rightarrow (ns (S j))]) (match n3 with [O \Rightarrow n2 | (S j) +\Rightarrow (ms (S j))])))) (\lambda (_: (eq nat (ns O) (ms O))).(refl_equal +nat n2)) (\lambda (i1: nat).(\lambda (_: (((eq nat (ns i1) (ms i1)) \to (eq +nat (match i1 with [O \Rightarrow n2 | (S j) \Rightarrow (ns (S j))]) (match +i1 with [O \Rightarrow n2 | (S j) \Rightarrow (ms (S j))]))))).(\lambda (H8: +(eq nat (ns (S i1)) (ms (S i1)))).H8))) i0 H_y))))) i H6)))))) n1)) (ms O) +(H5 O H0))))))))))))) h n H))). + +theorem pr_arity_comp_proj_zero: + \forall (n: nat).(pr_arity (pr_comp pr_proj pr_zero) n) +\def + \lambda (n: nat).(pr_arity_comp n n pr_proj pr_zero (pr_arity_zero n) +(\lambda (i: nat).(\lambda (H: (lt i n)).(pr_arity_proj n i H)))). + +*) diff --git a/helm/software/matita/contribs/LAMBDA-TYPES/Base-1/types/defs.ma b/helm/software/matita/contribs/LAMBDA-TYPES/Base-1/types/defs.ma index a60c1ad64..638fd2e49 100644 --- a/helm/software/matita/contribs/LAMBDA-TYPES/Base-1/types/defs.ma +++ b/helm/software/matita/contribs/LAMBDA-TYPES/Base-1/types/defs.ma @@ -21,6 +21,9 @@ include "preamble.ma". inductive and3 (P0: Prop) (P1: Prop) (P2: Prop): Prop \def | and3_intro: P0 \to (P1 \to (P2 \to (and3 P0 P1 P2))). +inductive and4 (P0: Prop) (P1: Prop) (P2: Prop) (P3: Prop): Prop \def +| and4_intro: P0 \to (P1 \to (P2 \to (P3 \to (and4 P0 P1 P2 P3)))). + inductive or3 (P0: Prop) (P1: Prop) (P2: Prop): Prop \def | or3_intro0: P0 \to (or3 P0 P1 P2) | or3_intro1: P1 \to (or3 P0 P1 P2) diff --git a/helm/software/matita/contribs/LAMBDA-TYPES/Base-2/blt/defs.mma b/helm/software/matita/contribs/LAMBDA-TYPES/Base-2/blt/defs.mma index 34839d833..12438b398 100644 --- a/helm/software/matita/contribs/LAMBDA-TYPES/Base-2/blt/defs.mma +++ b/helm/software/matita/contribs/LAMBDA-TYPES/Base-2/blt/defs.mma @@ -18,6 +18,6 @@ set "baseuri" "cic:/matita/LAMBDA-TYPES/Base-2/blt/defs". include "preamble.ma". -(* object blt not inlined *) +(* object blt not inlined *) diff --git a/helm/software/matita/contribs/LAMBDA-TYPES/Base-2/ext/arith.mma b/helm/software/matita/contribs/LAMBDA-TYPES/Base-2/ext/arith.mma index 240f138d5..ee4663a51 100644 --- a/helm/software/matita/contribs/LAMBDA-TYPES/Base-2/ext/arith.mma +++ b/helm/software/matita/contribs/LAMBDA-TYPES/Base-2/ext/arith.mma @@ -44,6 +44,8 @@ inline procedural "cic:/matita/LAMBDA-TYPES/Base-1/ext/arith/le_false.con". inline procedural "cic:/matita/LAMBDA-TYPES/Base-1/ext/arith/le_Sx_x.con". +inline procedural "cic:/matita/LAMBDA-TYPES/Base-1/ext/arith/le_n_pred.con". + inline procedural "cic:/matita/LAMBDA-TYPES/Base-1/ext/arith/minus_le.con". inline procedural @@ -60,6 +62,8 @@ inline procedural "cic:/matita/LAMBDA-TYPES/Base-1/ext/arith/le_minus.con". inline procedural "cic:/matita/LAMBDA-TYPES/Base-1/ext/arith/le_trans_plus_r.con". +inline procedural "cic:/matita/LAMBDA-TYPES/Base-1/ext/arith/lt_x_O.con". + inline procedural "cic:/matita/LAMBDA-TYPES/Base-1/ext/arith/le_gen_S.con". inline procedural @@ -104,3 +108,5 @@ inline procedural "cic:/matita/LAMBDA-TYPES/Base-1/ext/arith/plus_plus.con". inline procedural "cic:/matita/LAMBDA-TYPES/Base-1/ext/arith/le_S_minus.con". +inline procedural "cic:/matita/LAMBDA-TYPES/Base-1/ext/arith/lt_x_pred_y.con". + diff --git a/helm/software/matita/contribs/LAMBDA-TYPES/Base-2/plist/defs.mma b/helm/software/matita/contribs/LAMBDA-TYPES/Base-2/plist/defs.mma index a1b6cdfc1..3dc03da0b 100644 --- a/helm/software/matita/contribs/LAMBDA-TYPES/Base-2/plist/defs.mma +++ b/helm/software/matita/contribs/LAMBDA-TYPES/Base-2/plist/defs.mma @@ -18,6 +18,7 @@ set "baseuri" "cic:/matita/LAMBDA-TYPES/Base-2/plist/defs". include "preamble.ma". + (* object PList not inlined *) @@ -29,4 +30,3 @@ include "preamble.ma". (* object papp not inlined *) - diff --git a/helm/software/matita/contribs/LAMBDA-TYPES/Base-2/preamble.ma b/helm/software/matita/contribs/LAMBDA-TYPES/Base-2/preamble.ma index 84a495545..f04df2037 100644 --- a/helm/software/matita/contribs/LAMBDA-TYPES/Base-2/preamble.ma +++ b/helm/software/matita/contribs/LAMBDA-TYPES/Base-2/preamble.ma @@ -16,8 +16,6 @@ set "baseuri" "cic:/matita/LAMBDA-TYPES/Base-2/preamble". include "../Base-1/definitions.ma". -alias id "le_ind" = "cic:/Coq/Init/Peano/le_ind.con". - default "equality" cic:/Coq/Init/Logic/eq.ind cic:/matita/LAMBDA-TYPES/Base-1/preamble/sym_eq.con diff --git a/helm/software/matita/contribs/LAMBDA-TYPES/Base-2/types/defs.mma b/helm/software/matita/contribs/LAMBDA-TYPES/Base-2/types/defs.mma index cad4f8024..000f283aa 100644 --- a/helm/software/matita/contribs/LAMBDA-TYPES/Base-2/types/defs.mma +++ b/helm/software/matita/contribs/LAMBDA-TYPES/Base-2/types/defs.mma @@ -18,9 +18,13 @@ set "baseuri" "cic:/matita/LAMBDA-TYPES/Base-2/types/defs". include "preamble.ma". + (* object and3 not inlined *) +(* object and4 not inlined *) + + (* object or3 not inlined *) @@ -74,4 +78,3 @@ include "preamble.ma". (* object ex6_7 not inlined *) - diff --git a/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/arity/props.ma b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/arity/props.ma index caef281df..6c9662aeb 100644 --- a/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/arity/props.ma +++ b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/arity/props.ma @@ -304,6 +304,26 @@ 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_repellent: + \forall (g: G).(\forall (c: C).(\forall (w: T).(\forall (t: T).(\forall (a1: +A).((arity g (CHead c (Bind Abst) w) t a1) \to (\forall (a2: A).((arity g c +(THead (Bind Abst) w t) a2) \to ((leq g a1 a2) \to (\forall (P: +Prop).P))))))))) +\def + \lambda (g: G).(\lambda (c: C).(\lambda (w: T).(\lambda (t: T).(\lambda (a1: +A).(\lambda (H: (arity g (CHead c (Bind Abst) w) t a1)).(\lambda (a2: +A).(\lambda (H0: (arity g c (THead (Bind Abst) w t) a2)).(\lambda (H1: (leq g +a1 a2)).(\lambda (P: Prop).(let H_y \def (arity_repl g (CHead c (Bind Abst) +w) t a1 H a2 H1) in (let H2 \def (arity_gen_abst g c w t a2 H0) in (ex3_2_ind +A A (\lambda (a3: A).(\lambda (a4: A).(eq A a2 (AHead a3 a4)))) (\lambda (a3: +A).(\lambda (_: A).(arity g c w (asucc g a3)))) (\lambda (_: A).(\lambda (a4: +A).(arity g (CHead c (Bind Abst) w) t a4))) P (\lambda (x0: A).(\lambda (x1: +A).(\lambda (H3: (eq A a2 (AHead x0 x1))).(\lambda (_: (arity g c w (asucc g +x0))).(\lambda (H5: (arity g (CHead c (Bind Abst) w) t x1)).(let H6 \def +(eq_ind A a2 (\lambda (a: A).(arity g (CHead c (Bind Abst) w) t a)) H_y +(AHead x0 x1) H3) in (leq_ahead_false_2 g x1 x0 (arity_mono g (CHead c (Bind +Abst) w) t (AHead x0 x1) H6 x1 H5) P))))))) H2)))))))))))). + 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 diff --git a/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/definitions.ma b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/definitions.ma index 0129e4d02..809cb3235 100644 --- a/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/definitions.ma +++ b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/definitions.ma @@ -50,6 +50,8 @@ include "csuba/defs.ma". include "nf2/defs.ma". +include "ex2/defs.ma". + include "csubc/defs.ma". include "pc1/defs.ma". diff --git a/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/ex2/defs.ma b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/ex2/defs.ma new file mode 100644 index 000000000..482249d5e --- /dev/null +++ b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/ex2/defs.ma @@ -0,0 +1,30 @@ +(**************************************************************************) +(* ___ *) +(* ||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/LambdaDelta-1/ex2/defs". + +include "C/defs.ma". + +definition ex2_c: + C +\def + CSort O. + +definition ex2_t: + T +\def + THead (Flat Appl) (TSort O) (TSort O). + diff --git a/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/ex2/props.ma b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/ex2/props.ma new file mode 100644 index 000000000..f35ee3579 --- /dev/null +++ b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/ex2/props.ma @@ -0,0 +1,171 @@ +(**************************************************************************) +(* ___ *) +(* ||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/LambdaDelta-1/ex2/props". + +include "ex2/defs.ma". + +include "nf2/defs.ma". + +include "pr2/fwd.ma". + +include "arity/fwd.ma". + +theorem ex2_nf2: + nf2 ex2_c ex2_t +\def + \lambda (t2: T).(\lambda (H: (pr2 (CSort O) (THead (Flat Appl) (TSort O) +(TSort O)) t2)).(let H0 \def (pr2_gen_appl (CSort O) (TSort O) (TSort O) t2 +H) in (or3_ind (ex3_2 T T (\lambda (u2: T).(\lambda (t3: T).(eq T t2 (THead +(Flat Appl) u2 t3)))) (\lambda (u2: T).(\lambda (_: T).(pr2 (CSort O) (TSort +O) u2))) (\lambda (_: T).(\lambda (t3: T).(pr2 (CSort O) (TSort O) t3)))) +(ex4_4 T T T T (\lambda (y1: T).(\lambda (z1: T).(\lambda (_: T).(\lambda (_: +T).(eq T (TSort O) (THead (Bind Abst) y1 z1)))))) (\lambda (_: T).(\lambda +(_: T).(\lambda (u2: T).(\lambda (t3: T).(eq T t2 (THead (Bind Abbr) u2 +t3)))))) (\lambda (_: T).(\lambda (_: T).(\lambda (u2: T).(\lambda (_: +T).(pr2 (CSort O) (TSort O) u2))))) (\lambda (_: T).(\lambda (z1: T).(\lambda +(_: T).(\lambda (t3: T).(\forall (b: B).(\forall (u: T).(pr2 (CHead (CSort O) +(Bind b) u) z1 t3)))))))) (ex6_6 B T T T T T (\lambda (b: B).(\lambda (_: +T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(not (eq B +b Abst)))))))) (\lambda (b: B).(\lambda (y1: T).(\lambda (z1: T).(\lambda (_: +T).(\lambda (_: T).(\lambda (_: T).(eq T (TSort O) (THead (Bind b) y1 +z1)))))))) (\lambda (b: B).(\lambda (_: T).(\lambda (_: T).(\lambda (z2: +T).(\lambda (u2: T).(\lambda (y2: T).(eq T t2 (THead (Bind b) y2 (THead (Flat +Appl) (lift (S O) O u2) z2))))))))) (\lambda (_: B).(\lambda (_: T).(\lambda +(_: T).(\lambda (_: T).(\lambda (u2: T).(\lambda (_: T).(pr2 (CSort O) (TSort +O) u2))))))) (\lambda (_: B).(\lambda (y1: T).(\lambda (_: T).(\lambda (_: +T).(\lambda (_: T).(\lambda (y2: T).(pr2 (CSort O) y1 y2))))))) (\lambda (b: +B).(\lambda (_: T).(\lambda (z1: T).(\lambda (z2: T).(\lambda (_: T).(\lambda +(y2: T).(pr2 (CHead (CSort O) (Bind b) y2) z1 z2)))))))) (eq T (THead (Flat +Appl) (TSort O) (TSort O)) t2) (\lambda (H1: (ex3_2 T T (\lambda (u2: +T).(\lambda (t3: T).(eq T t2 (THead (Flat Appl) u2 t3)))) (\lambda (u2: +T).(\lambda (_: T).(pr2 (CSort O) (TSort O) u2))) (\lambda (_: T).(\lambda +(t3: T).(pr2 (CSort O) (TSort O) 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).(pr2 (CSort O) (TSort O) u2))) (\lambda (_: T).(\lambda +(t3: T).(pr2 (CSort O) (TSort O) t3))) (eq T (THead (Flat Appl) (TSort O) +(TSort O)) t2) (\lambda (x0: T).(\lambda (x1: T).(\lambda (H2: (eq T t2 +(THead (Flat Appl) x0 x1))).(\lambda (H3: (pr2 (CSort O) (TSort O) +x0)).(\lambda (H4: (pr2 (CSort O) (TSort O) x1)).(let H5 \def (eq_ind T x1 +(\lambda (t: T).(eq T t2 (THead (Flat Appl) x0 t))) H2 (TSort O) +(pr2_gen_sort (CSort O) x1 O H4)) in (let H6 \def (eq_ind T x0 (\lambda (t: +T).(eq T t2 (THead (Flat Appl) t (TSort O)))) H5 (TSort O) (pr2_gen_sort +(CSort O) x0 O H3)) in (eq_ind_r T (THead (Flat Appl) (TSort O) (TSort O)) +(\lambda (t: T).(eq T (THead (Flat Appl) (TSort O) (TSort O)) t)) (refl_equal +T (THead (Flat Appl) (TSort O) (TSort O))) t2 H6)))))))) H1)) (\lambda (H1: +(ex4_4 T T T T (\lambda (y1: T).(\lambda (z1: T).(\lambda (_: T).(\lambda (_: +T).(eq T (TSort O) (THead (Bind Abst) y1 z1)))))) (\lambda (_: T).(\lambda +(_: T).(\lambda (u2: T).(\lambda (t3: T).(eq T t2 (THead (Bind Abbr) u2 +t3)))))) (\lambda (_: T).(\lambda (_: T).(\lambda (u2: T).(\lambda (_: +T).(pr2 (CSort O) (TSort O) u2))))) (\lambda (_: T).(\lambda (z1: T).(\lambda +(_: T).(\lambda (t3: T).(\forall (b: B).(\forall (u: T).(pr2 (CHead (CSort O) +(Bind b) u) z1 t3))))))))).(ex4_4_ind T T T T (\lambda (y1: T).(\lambda (z1: +T).(\lambda (_: T).(\lambda (_: T).(eq T (TSort O) (THead (Bind Abst) y1 +z1)))))) (\lambda (_: T).(\lambda (_: T).(\lambda (u2: T).(\lambda (t3: +T).(eq T t2 (THead (Bind Abbr) u2 t3)))))) (\lambda (_: T).(\lambda (_: +T).(\lambda (u2: T).(\lambda (_: T).(pr2 (CSort O) (TSort O) u2))))) (\lambda +(_: T).(\lambda (z1: T).(\lambda (_: T).(\lambda (t3: T).(\forall (b: +B).(\forall (u: T).(pr2 (CHead (CSort O) (Bind b) u) z1 t3))))))) (eq T +(THead (Flat Appl) (TSort O) (TSort O)) t2) (\lambda (x0: T).(\lambda (x1: +T).(\lambda (x2: T).(\lambda (x3: T).(\lambda (H2: (eq T (TSort O) (THead +(Bind Abst) x0 x1))).(\lambda (H3: (eq T t2 (THead (Bind Abbr) x2 +x3))).(\lambda (H4: (pr2 (CSort O) (TSort O) x2)).(\lambda (_: ((\forall (b: +B).(\forall (u: T).(pr2 (CHead (CSort O) (Bind b) u) x1 x3))))).(let H6 \def +(eq_ind T x2 (\lambda (t: T).(eq T t2 (THead (Bind Abbr) t x3))) H3 (TSort O) +(pr2_gen_sort (CSort O) x2 O H4)) in (eq_ind_r T (THead (Bind Abbr) (TSort O) +x3) (\lambda (t: T).(eq T (THead (Flat Appl) (TSort O) (TSort O)) t)) (let H7 +\def (eq_ind T (TSort O) (\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) x0 x1) H2) in +(False_ind (eq T (THead (Flat Appl) (TSort O) (TSort O)) (THead (Bind Abbr) +(TSort O) x3)) H7)) t2 H6)))))))))) H1)) (\lambda (H1: (ex6_6 B T T T T T +(\lambda (b: B).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: +T).(\lambda (_: T).(not (eq B b Abst)))))))) (\lambda (b: B).(\lambda (y1: +T).(\lambda (z1: T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(eq T +(TSort O) (THead (Bind b) y1 z1)))))))) (\lambda (b: B).(\lambda (_: +T).(\lambda (_: T).(\lambda (z2: T).(\lambda (u2: T).(\lambda (y2: T).(eq T +t2 (THead (Bind b) y2 (THead (Flat Appl) (lift (S O) O u2) z2))))))))) +(\lambda (_: B).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(\lambda (u2: +T).(\lambda (_: T).(pr2 (CSort O) (TSort O) u2))))))) (\lambda (_: +B).(\lambda (y1: T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(\lambda +(y2: T).(pr2 (CSort O) y1 y2))))))) (\lambda (b: B).(\lambda (_: T).(\lambda +(z1: T).(\lambda (z2: T).(\lambda (_: T).(\lambda (y2: T).(pr2 (CHead (CSort +O) (Bind b) y2) z1 z2))))))))).(ex6_6_ind B T T T T T (\lambda (b: +B).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(\lambda +(_: T).(not (eq B b Abst)))))))) (\lambda (b: B).(\lambda (y1: T).(\lambda +(z1: T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(eq T (TSort O) +(THead (Bind b) y1 z1)))))))) (\lambda (b: B).(\lambda (_: T).(\lambda (_: +T).(\lambda (z2: T).(\lambda (u2: T).(\lambda (y2: T).(eq T t2 (THead (Bind +b) y2 (THead (Flat Appl) (lift (S O) O u2) z2))))))))) (\lambda (_: +B).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(\lambda (u2: T).(\lambda +(_: T).(pr2 (CSort O) (TSort O) u2))))))) (\lambda (_: B).(\lambda (y1: +T).(\lambda (_: T).(\lambda (_: T).(\lambda (_: T).(\lambda (y2: T).(pr2 +(CSort O) y1 y2))))))) (\lambda (b: B).(\lambda (_: T).(\lambda (z1: +T).(\lambda (z2: T).(\lambda (_: T).(\lambda (y2: T).(pr2 (CHead (CSort O) +(Bind b) y2) z1 z2))))))) (eq T (THead (Flat Appl) (TSort O) (TSort O)) t2) +(\lambda (x0: B).(\lambda (x1: T).(\lambda (x2: T).(\lambda (x3: T).(\lambda +(x4: T).(\lambda (x5: T).(\lambda (_: (not (eq B x0 Abst))).(\lambda (H3: (eq +T (TSort O) (THead (Bind x0) x1 x2))).(\lambda (H4: (eq T t2 (THead (Bind x0) +x5 (THead (Flat Appl) (lift (S O) O x4) x3)))).(\lambda (H5: (pr2 (CSort O) +(TSort O) x4)).(\lambda (H6: (pr2 (CSort O) x1 x5)).(\lambda (_: (pr2 (CHead +(CSort O) (Bind x0) x5) x2 x3)).(let H_y \def (pr2_gen_csort x1 x5 O H6) in +(let H8 \def (eq_ind T x4 (\lambda (t: T).(eq T t2 (THead (Bind x0) x5 (THead +(Flat Appl) (lift (S O) O t) x3)))) H4 (TSort O) (pr2_gen_sort (CSort O) x4 O +H5)) in (eq_ind_r T (THead (Bind x0) x5 (THead (Flat Appl) (lift (S O) O +(TSort O)) x3)) (\lambda (t: T).(eq T (THead (Flat Appl) (TSort O) (TSort O)) +t)) (let H9 \def (eq_ind T (TSort O) (\lambda (ee: T).(match ee in T return +(\lambda (_: T).Prop) with [(TSort _) \Rightarrow True | (TLRef _) +\Rightarrow False | (THead _ _ _) \Rightarrow False])) I (THead (Bind x0) x1 +x2) H3) in (False_ind (eq T (THead (Flat Appl) (TSort O) (TSort O)) (THead +(Bind x0) x5 (THead (Flat Appl) (lift (S O) O (TSort O)) x3))) H9)) t2 +H8))))))))))))))) H1)) H0))). + +theorem ex2_arity: + \forall (g: G).(\forall (a: A).((arity g ex2_c ex2_t a) \to (\forall (P: +Prop).P))) +\def + \lambda (g: G).(\lambda (a: A).(\lambda (H: (arity g (CSort O) (THead (Flat +Appl) (TSort O) (TSort O)) a)).(\lambda (P: Prop).(let H0 \def +(arity_gen_appl g (CSort O) (TSort O) (TSort O) a H) in (ex2_ind A (\lambda +(a1: A).(arity g (CSort O) (TSort O) a1)) (\lambda (a1: A).(arity g (CSort O) +(TSort O) (AHead a1 a))) P (\lambda (x: A).(\lambda (_: (arity g (CSort O) +(TSort O) x)).(\lambda (H2: (arity g (CSort O) (TSort O) (AHead x a))).(let +H3 \def (match (arity_gen_sort g (CSort O) O (AHead x a) H2) in leq return +(\lambda (a0: A).(\lambda (a1: A).(\lambda (_: (leq ? a0 a1)).((eq A a0 +(AHead x a)) \to ((eq A a1 (ASort O O)) \to P))))) with [(leq_sort h1 h2 n1 +n2 k H3) \Rightarrow (\lambda (H4: (eq A (ASort h1 n1) (AHead x a))).(\lambda +(H5: (eq A (ASort h2 n2) (ASort O O))).((let H6 \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 x a) H4) in +(False_ind ((eq A (ASort h2 n2) (ASort O O)) \to ((eq A (aplus g (ASort h1 +n1) k) (aplus g (ASort h2 n2) k)) \to P)) H6)) H5 H3))) | (leq_head a1 a2 H3 +a3 a4 H4) \Rightarrow (\lambda (H5: (eq A (AHead a1 a3) (AHead x +a))).(\lambda (H6: (eq A (AHead a2 a4) (ASort O O))).((let H7 \def (f_equal A +A (\lambda (e: A).(match e in A return (\lambda (_: A).A) with [(ASort _ _) +\Rightarrow a3 | (AHead _ a0) \Rightarrow a0])) (AHead a1 a3) (AHead x a) H5) +in ((let H8 \def (f_equal A A (\lambda (e: A).(match e in A return (\lambda +(_: A).A) with [(ASort _ _) \Rightarrow a1 | (AHead a0 _) \Rightarrow a0])) +(AHead a1 a3) (AHead x a) H5) in (eq_ind A x (\lambda (a0: A).((eq A a3 a) +\to ((eq A (AHead a2 a4) (ASort O O)) \to ((leq g a0 a2) \to ((leq g a3 a4) +\to P))))) (\lambda (H9: (eq A a3 a)).(eq_ind A a (\lambda (a0: A).((eq A +(AHead a2 a4) (ASort O O)) \to ((leq g x a2) \to ((leq g a0 a4) \to P)))) +(\lambda (H10: (eq A (AHead a2 a4) (ASort O O))).(let H11 \def (eq_ind A +(AHead a2 a4) (\lambda (e: A).(match e in A return (\lambda (_: A).Prop) with +[(ASort _ _) \Rightarrow False | (AHead _ _) \Rightarrow True])) I (ASort O +O) H10) in (False_ind ((leq g x a2) \to ((leq g a a4) \to P)) H11))) a3 +(sym_eq A a3 a H9))) a1 (sym_eq A a1 x H8))) H7)) H6 H3 H4)))]) in (H3 +(refl_equal A (AHead x a)) (refl_equal A (ASort O O))))))) H0))))). + diff --git a/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/leq/asucc.ma b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/leq/asucc.ma index c996451b4..25f9dfd07 100644 --- a/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/leq/asucc.ma +++ b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/leq/asucc.ma @@ -612,10 +612,10 @@ return (\lambda (_: A).A) with [(ASort _ _) \Rightarrow a4 | (AHead a7 _) ((leq g a2 a6) \to P)))) (\lambda (H12: (eq A a6 (asucc g a0))).(eq_ind A (asucc g a0) (\lambda (a7: A).((leq g (AHead a a0) a) \to ((leq g a2 a7) \to P))) (\lambda (H13: (leq g (AHead a a0) a)).(\lambda (_: (leq g a2 (asucc g -a0))).(leq_ahead_false g a a0 H13 P))) a6 (sym_eq A a6 (asucc g a0) H12))) a4 -(sym_eq A a4 a H11))) H10))) a5 (sym_eq A a5 a2 H8))) a3 (sym_eq A a3 (AHead -a a0) H7))) H6)) H5 H2 H3)))]) in (H2 (refl_equal A (AHead (AHead a a0) a2)) -(refl_equal A (AHead a (asucc g a0)))))))))))) a1)). +a0))).(leq_ahead_false_1 g a a0 H13 P))) a6 (sym_eq A a6 (asucc g a0) H12))) +a4 (sym_eq A a4 a H11))) H10))) a5 (sym_eq A a5 a2 H8))) a3 (sym_eq A a3 +(AHead a a0) H7))) H6)) H5 H2 H3)))]) in (H2 (refl_equal A (AHead (AHead a +a0) a2)) (refl_equal A (AHead a (asucc g a0)))))))))))) a1)). theorem leq_asucc_false: \forall (g: G).(\forall (a: A).((leq g (asucc g a) a) \to (\forall (P: diff --git a/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/leq/props.ma b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/leq/props.ma index 2fda46a6e..ac9ef3ee8 100644 --- a/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/leq/props.ma +++ b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/leq/props.ma @@ -165,7 +165,7 @@ a10 H14)))) a0 H12)) a9 (sym_eq A a9 a6 H11))) a7 (sym_eq A a7 a4 H10))) H9)) H8 H5 H6)))]) in (H5 (refl_equal A (AHead a4 a6)) (refl_equal A a0))))))))))))) a1 a2 H)))). -theorem leq_ahead_false: +theorem leq_ahead_false_1: \forall (g: G).(\forall (a1: A).(\forall (a2: A).((leq g (AHead a1 a2) a1) \to (\forall (P: Prop).P)))) \def @@ -268,3 +268,106 @@ a5 (sym_eq A a5 a2 H8))) a3 (sym_eq A a3 (AHead a a0) H7))) H6)) H5 H2 H3)))]) in (H2 (refl_equal A (AHead (AHead a a0) a2)) (refl_equal A (AHead a a0))))))))))) a1)). +theorem leq_ahead_false_2: + \forall (g: G).(\forall (a2: A).(\forall (a1: A).((leq g (AHead a1 a2) a2) +\to (\forall (P: Prop).P)))) +\def + \lambda (g: G).(\lambda (a2: A).(A_ind (\lambda (a: A).(\forall (a1: +A).((leq g (AHead a1 a) a) \to (\forall (P: Prop).P)))) (\lambda (n: +nat).(\lambda (n0: nat).(\lambda (a1: A).(\lambda (H: (leq g (AHead a1 (ASort +n n0)) (ASort n n0))).(\lambda (P: Prop).(nat_ind (\lambda (n1: nat).((leq g +(AHead a1 (ASort n1 n0)) (ASort n1 n0)) \to P)) (\lambda (H0: (leq g (AHead +a1 (ASort O n0)) (ASort O n0))).(let H1 \def (match H0 in leq return (\lambda +(a: A).(\lambda (a0: A).(\lambda (_: (leq ? a a0)).((eq A a (AHead a1 (ASort +O n0))) \to ((eq A a0 (ASort O n0)) \to P))))) with [(leq_sort h1 h2 n1 n2 k +H1) \Rightarrow (\lambda (H2: (eq A (ASort h1 n1) (AHead a1 (ASort O +n0)))).(\lambda (H3: (eq A (ASort h2 n2) (ASort O n0))).((let H4 \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 (ASort O n0)) H2) in (False_ind ((eq A (ASort h2 n2) (ASort O n0)) +\to ((eq A (aplus g (ASort h1 n1) k) (aplus g (ASort h2 n2) k)) \to P)) H4)) +H3 H1))) | (leq_head a0 a3 H1 a4 a5 H2) \Rightarrow (\lambda (H3: (eq A +(AHead a0 a4) (AHead a1 (ASort O n0)))).(\lambda (H4: (eq A (AHead a3 a5) +(ASort O n0))).((let H5 \def (f_equal A A (\lambda (e: A).(match e in A +return (\lambda (_: A).A) with [(ASort _ _) \Rightarrow a4 | (AHead _ a) +\Rightarrow a])) (AHead a0 a4) (AHead a1 (ASort O n0)) H3) in ((let H6 \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 a4) +(AHead a1 (ASort O n0)) H3) in (eq_ind A a1 (\lambda (a: A).((eq A a4 (ASort +O n0)) \to ((eq A (AHead a3 a5) (ASort O n0)) \to ((leq g a a3) \to ((leq g +a4 a5) \to P))))) (\lambda (H7: (eq A a4 (ASort O n0))).(eq_ind A (ASort O +n0) (\lambda (a: A).((eq A (AHead a3 a5) (ASort O n0)) \to ((leq g a1 a3) \to +((leq g a a5) \to P)))) (\lambda (H8: (eq A (AHead a3 a5) (ASort O n0))).(let +H9 \def (eq_ind A (AHead a3 a5) (\lambda (e: A).(match e in A return (\lambda +(_: A).Prop) with [(ASort _ _) \Rightarrow False | (AHead _ _) \Rightarrow +True])) I (ASort O n0) H8) in (False_ind ((leq g a1 a3) \to ((leq g (ASort O +n0) a5) \to P)) H9))) a4 (sym_eq A a4 (ASort O n0) H7))) a0 (sym_eq A a0 a1 +H6))) H5)) H4 H1 H2)))]) in (H1 (refl_equal A (AHead a1 (ASort O n0))) +(refl_equal A (ASort O n0))))) (\lambda (n1: nat).(\lambda (_: (((leq g +(AHead a1 (ASort n1 n0)) (ASort n1 n0)) \to P))).(\lambda (H0: (leq g (AHead +a1 (ASort (S n1) n0)) (ASort (S n1) n0))).(let H1 \def (match H0 in leq +return (\lambda (a: A).(\lambda (a0: A).(\lambda (_: (leq ? a a0)).((eq A a +(AHead a1 (ASort (S n1) n0))) \to ((eq A a0 (ASort (S n1) n0)) \to P))))) +with [(leq_sort h1 h2 n2 n3 k H1) \Rightarrow (\lambda (H2: (eq A (ASort h1 +n2) (AHead a1 (ASort (S n1) n0)))).(\lambda (H3: (eq A (ASort h2 n3) (ASort +(S n1) n0))).((let H4 \def (eq_ind A (ASort h1 n2) (\lambda (e: A).(match e +in A return (\lambda (_: A).Prop) with [(ASort _ _) \Rightarrow True | (AHead +_ _) \Rightarrow False])) I (AHead a1 (ASort (S n1) n0)) H2) in (False_ind +((eq A (ASort h2 n3) (ASort (S n1) n0)) \to ((eq A (aplus g (ASort h1 n2) k) +(aplus g (ASort h2 n3) k)) \to P)) H4)) H3 H1))) | (leq_head a0 a3 H1 a4 a5 +H2) \Rightarrow (\lambda (H3: (eq A (AHead a0 a4) (AHead a1 (ASort (S n1) +n0)))).(\lambda (H4: (eq A (AHead a3 a5) (ASort (S n1) n0))).((let H5 \def +(f_equal A A (\lambda (e: A).(match e in A return (\lambda (_: A).A) with +[(ASort _ _) \Rightarrow a4 | (AHead _ a) \Rightarrow a])) (AHead a0 a4) +(AHead a1 (ASort (S n1) n0)) H3) in ((let H6 \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 a4) (AHead a1 (ASort (S n1) n0)) H3) +in (eq_ind A a1 (\lambda (a: A).((eq A a4 (ASort (S n1) n0)) \to ((eq A +(AHead a3 a5) (ASort (S n1) n0)) \to ((leq g a a3) \to ((leq g a4 a5) \to +P))))) (\lambda (H7: (eq A a4 (ASort (S n1) n0))).(eq_ind A (ASort (S n1) n0) +(\lambda (a: A).((eq A (AHead a3 a5) (ASort (S n1) n0)) \to ((leq g a1 a3) +\to ((leq g a a5) \to P)))) (\lambda (H8: (eq A (AHead a3 a5) (ASort (S n1) +n0))).(let H9 \def (eq_ind A (AHead a3 a5) (\lambda (e: A).(match e in A +return (\lambda (_: A).Prop) with [(ASort _ _) \Rightarrow False | (AHead _ +_) \Rightarrow True])) I (ASort (S n1) n0) H8) in (False_ind ((leq g a1 a3) +\to ((leq g (ASort (S n1) n0) a5) \to P)) H9))) a4 (sym_eq A a4 (ASort (S n1) +n0) H7))) a0 (sym_eq A a0 a1 H6))) H5)) H4 H1 H2)))]) in (H1 (refl_equal A +(AHead a1 (ASort (S n1) n0))) (refl_equal A (ASort (S n1) n0))))))) n H)))))) +(\lambda (a: A).(\lambda (_: ((\forall (a1: A).((leq g (AHead a1 a) a) \to +(\forall (P: Prop).P))))).(\lambda (a0: A).(\lambda (H0: ((\forall (a1: +A).((leq g (AHead a1 a0) a0) \to (\forall (P: Prop).P))))).(\lambda (a1: +A).(\lambda (H1: (leq g (AHead a1 (AHead a a0)) (AHead a a0))).(\lambda (P: +Prop).(let H2 \def (match H1 in leq return (\lambda (a3: A).(\lambda (a4: +A).(\lambda (_: (leq ? a3 a4)).((eq A a3 (AHead a1 (AHead a a0))) \to ((eq A +a4 (AHead a a0)) \to P))))) with [(leq_sort h1 h2 n1 n2 k H2) \Rightarrow +(\lambda (H3: (eq A (ASort h1 n1) (AHead a1 (AHead a a0)))).(\lambda (H4: (eq +A (ASort h2 n2) (AHead a a0))).((let H5 \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 (AHead a a0)) +H3) in (False_ind ((eq A (ASort h2 n2) (AHead a a0)) \to ((eq A (aplus g +(ASort h1 n1) k) (aplus g (ASort h2 n2) k)) \to P)) H5)) H4 H2))) | (leq_head +a3 a4 H2 a5 a6 H3) \Rightarrow (\lambda (H4: (eq A (AHead a3 a5) (AHead a1 +(AHead a a0)))).(\lambda (H5: (eq A (AHead a4 a6) (AHead a a0))).((let H6 +\def (f_equal A A (\lambda (e: A).(match e in A return (\lambda (_: A).A) +with [(ASort _ _) \Rightarrow a5 | (AHead _ a7) \Rightarrow a7])) (AHead a3 +a5) (AHead a1 (AHead a a0)) H4) in ((let H7 \def (f_equal A A (\lambda (e: +A).(match e in A return (\lambda (_: A).A) with [(ASort _ _) \Rightarrow a3 | +(AHead a7 _) \Rightarrow a7])) (AHead a3 a5) (AHead a1 (AHead a a0)) H4) in +(eq_ind A a1 (\lambda (a7: A).((eq A a5 (AHead a a0)) \to ((eq A (AHead a4 +a6) (AHead a a0)) \to ((leq g a7 a4) \to ((leq g a5 a6) \to P))))) (\lambda +(H8: (eq A a5 (AHead a a0))).(eq_ind A (AHead a a0) (\lambda (a7: A).((eq A +(AHead a4 a6) (AHead a a0)) \to ((leq g a1 a4) \to ((leq g a7 a6) \to P)))) +(\lambda (H9: (eq A (AHead a4 a6) (AHead a a0))).(let H10 \def (f_equal A A +(\lambda (e: A).(match e in A return (\lambda (_: A).A) with [(ASort _ _) +\Rightarrow a6 | (AHead _ a7) \Rightarrow a7])) (AHead a4 a6) (AHead a a0) +H9) in ((let H11 \def (f_equal A A (\lambda (e: A).(match e in A return +(\lambda (_: A).A) with [(ASort _ _) \Rightarrow a4 | (AHead a7 _) +\Rightarrow a7])) (AHead a4 a6) (AHead a a0) H9) in (eq_ind A a (\lambda (a7: +A).((eq A a6 a0) \to ((leq g a1 a7) \to ((leq g (AHead a a0) a6) \to P)))) +(\lambda (H12: (eq A a6 a0)).(eq_ind A a0 (\lambda (a7: A).((leq g a1 a) \to +((leq g (AHead a a0) a7) \to P))) (\lambda (_: (leq g a1 a)).(\lambda (H14: +(leq g (AHead a a0) a0)).(H0 a H14 P))) a6 (sym_eq A a6 a0 H12))) a4 (sym_eq +A a4 a H11))) H10))) a5 (sym_eq A a5 (AHead a a0) H8))) a3 (sym_eq A a3 a1 +H7))) H6)) H5 H2 H3)))]) in (H2 (refl_equal A (AHead a1 (AHead a a0))) +(refl_equal A (AHead a a0))))))))))) a2)). + diff --git a/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/makefile b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/makefile index d7a63e5f1..b8fec3cd2 100644 --- a/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/makefile +++ b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/makefile @@ -1,7 +1,7 @@ H=@ RT_BASEDIR=../../../ -OPTIONS=-bench +OPTIONS=-bench -onepass MMAKE=$(RT_BASEDIR)matitamake $(OPTIONS) CLEAN=$(RT_BASEDIR)matitaclean $(OPTIONS) MMAKEO=$(RT_BASEDIR)matitamake.opt $(OPTIONS) diff --git a/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/nf2/arity.ma b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/nf2/arity.ma new file mode 100644 index 000000000..d67f67282 --- /dev/null +++ b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/nf2/arity.ma @@ -0,0 +1,534 @@ +(**************************************************************************) +(* ___ *) +(* ||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/LambdaDelta-1/nf2/arity". + +include "nf2/fwd.ma". + +include "arity/subst0.ma". + +theorem arity_nf2_inv_all: + \forall (g: G).(\forall (c: C).(\forall (t: T).(\forall (a: A).((arity g c t +a) \to ((nf2 c t) \to (or3 (ex3_2 T T (\lambda (w: T).(\lambda (u: T).(eq T t +(THead (Bind Abst) w u)))) (\lambda (w: T).(\lambda (_: T).(nf2 c w))) +(\lambda (w: T).(\lambda (u: T).(nf2 (CHead c (Bind Abst) w) u)))) (ex nat +(\lambda (n: nat).(eq T t (TSort n)))) (ex3_2 TList nat (\lambda (ws: +TList).(\lambda (i: nat).(eq T t (THeads (Flat Appl) ws (TLRef i))))) +(\lambda (ws: TList).(\lambda (_: nat).(nfs2 c ws))) (\lambda (_: +TList).(\lambda (i: nat).(nf2 c (TLRef i))))))))))) +\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).((nf2 c0 t0) \to (or3 (ex3_2 T T (\lambda (w: T).(\lambda (u: T).(eq T t0 +(THead (Bind Abst) w u)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) +(\lambda (w: T).(\lambda (u: T).(nf2 (CHead c0 (Bind Abst) w) u)))) (ex nat +(\lambda (n: nat).(eq T t0 (TSort n)))) (ex3_2 TList nat (\lambda (ws: +TList).(\lambda (i: nat).(eq T t0 (THeads (Flat Appl) ws (TLRef i))))) +(\lambda (ws: TList).(\lambda (_: nat).(nfs2 c0 ws))) (\lambda (_: +TList).(\lambda (i: nat).(nf2 c0 (TLRef i)))))))))) (\lambda (c0: C).(\lambda +(n: nat).(\lambda (_: (nf2 c0 (TSort n))).(or3_intro1 (ex3_2 T T (\lambda (w: +T).(\lambda (u: T).(eq T (TSort n) (THead (Bind Abst) w u)))) (\lambda (w: +T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u: T).(nf2 (CHead +c0 (Bind Abst) w) u)))) (ex nat (\lambda (n0: nat).(eq T (TSort n) (TSort +n0)))) (ex3_2 TList nat (\lambda (ws: TList).(\lambda (i: nat).(eq T (TSort +n) (THeads (Flat Appl) ws (TLRef i))))) (\lambda (ws: TList).(\lambda (_: +nat).(nfs2 c0 ws))) (\lambda (_: TList).(\lambda (i: nat).(nf2 c0 (TLRef +i))))) (ex_intro nat (\lambda (n0: nat).(eq T (TSort n) (TSort n0))) n +(refl_equal T (TSort n))))))) (\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 (_: (((nf2 d u) +\to (or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T u (THead (Bind +Abst) w u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 d w))) (\lambda (w: +T).(\lambda (u0: T).(nf2 (CHead d (Bind Abst) w) u0)))) (ex nat (\lambda (n: +nat).(eq T u (TSort n)))) (ex3_2 TList nat (\lambda (ws: TList).(\lambda (i0: +nat).(eq T u (THeads (Flat Appl) ws (TLRef i0))))) (\lambda (ws: +TList).(\lambda (_: nat).(nfs2 d ws))) (\lambda (_: TList).(\lambda (i0: +nat).(nf2 d (TLRef i0))))))))).(\lambda (H3: (nf2 c0 (TLRef +i))).(nf2_gen_lref c0 d u i H0 H3 (or3 (ex3_2 T T (\lambda (w: T).(\lambda +(u0: T).(eq T (TLRef i) (THead (Bind Abst) w u0)))) (\lambda (w: T).(\lambda +(_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u0: T).(nf2 (CHead c0 (Bind +Abst) w) u0)))) (ex nat (\lambda (n: nat).(eq T (TLRef i) (TSort n)))) (ex3_2 +TList nat (\lambda (ws: TList).(\lambda (i0: nat).(eq T (TLRef i) (THeads +(Flat Appl) ws (TLRef i0))))) (\lambda (ws: TList).(\lambda (_: nat).(nfs2 c0 +ws))) (\lambda (_: TList).(\lambda (i0: nat).(nf2 c0 (TLRef +i0)))))))))))))))) (\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 (_: (((nf2 d u) \to (or3 +(ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T u (THead (Bind Abst) w +u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 d w))) (\lambda (w: T).(\lambda +(u0: T).(nf2 (CHead d (Bind Abst) w) u0)))) (ex nat (\lambda (n: nat).(eq T u +(TSort n)))) (ex3_2 TList nat (\lambda (ws: TList).(\lambda (i0: nat).(eq T u +(THeads (Flat Appl) ws (TLRef i0))))) (\lambda (ws: TList).(\lambda (_: +nat).(nfs2 d ws))) (\lambda (_: TList).(\lambda (i0: nat).(nf2 d (TLRef +i0))))))))).(\lambda (H3: (nf2 c0 (TLRef i))).(or3_intro2 (ex3_2 T T (\lambda +(w: T).(\lambda (u0: T).(eq T (TLRef i) (THead (Bind Abst) w u0)))) (\lambda +(w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u0: T).(nf2 +(CHead c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: nat).(eq T (TLRef i) +(TSort n)))) (ex3_2 TList nat (\lambda (ws: TList).(\lambda (i0: nat).(eq T +(TLRef i) (THeads (Flat Appl) ws (TLRef i0))))) (\lambda (ws: TList).(\lambda +(_: nat).(nfs2 c0 ws))) (\lambda (_: TList).(\lambda (i0: nat).(nf2 c0 (TLRef +i0))))) (ex3_2_intro TList nat (\lambda (ws: TList).(\lambda (i0: nat).(eq T +(TLRef i) (THeads (Flat Appl) ws (TLRef i0))))) (\lambda (ws: TList).(\lambda +(_: nat).(nfs2 c0 ws))) (\lambda (_: TList).(\lambda (i0: nat).(nf2 c0 (TLRef +i0)))) TNil i (refl_equal T (TLRef i)) I H3))))))))))) (\lambda (b: +B).(\lambda (H0: (not (eq B b Abst))).(\lambda (c0: C).(\lambda (u: +T).(\lambda (a1: A).(\lambda (_: (arity g c0 u a1)).(\lambda (_: (((nf2 c0 u) +\to (or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T u (THead (Bind +Abst) w u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: +T).(\lambda (u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: +nat).(eq T u (TSort n)))) (ex3_2 TList nat (\lambda (ws: TList).(\lambda (i: +nat).(eq T u (THeads (Flat Appl) ws (TLRef i))))) (\lambda (ws: +TList).(\lambda (_: nat).(nfs2 c0 ws))) (\lambda (_: TList).(\lambda (i: +nat).(nf2 c0 (TLRef i))))))))).(\lambda (t0: T).(\lambda (a2: A).(\lambda +(H3: (arity g (CHead c0 (Bind b) u) t0 a2)).(\lambda (_: (((nf2 (CHead c0 +(Bind b) u) t0) \to (or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T t0 +(THead (Bind Abst) w u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 (CHead c0 +(Bind b) u) w))) (\lambda (w: T).(\lambda (u0: T).(nf2 (CHead (CHead c0 (Bind +b) u) (Bind Abst) w) u0)))) (ex nat (\lambda (n: nat).(eq T t0 (TSort n)))) +(ex3_2 TList nat (\lambda (ws: TList).(\lambda (i: nat).(eq T t0 (THeads +(Flat Appl) ws (TLRef i))))) (\lambda (ws: TList).(\lambda (_: nat).(nfs2 +(CHead c0 (Bind b) u) ws))) (\lambda (_: TList).(\lambda (i: nat).(nf2 (CHead +c0 (Bind b) u) (TLRef i))))))))).(\lambda (H5: (nf2 c0 (THead (Bind b) u +t0))).(B_ind (\lambda (b0: B).((not (eq B b0 Abst)) \to ((arity g (CHead c0 +(Bind b0) u) t0 a2) \to ((nf2 c0 (THead (Bind b0) u t0)) \to (or3 (ex3_2 T T +(\lambda (w: T).(\lambda (u0: T).(eq T (THead (Bind b0) u t0) (THead (Bind +Abst) w u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: +T).(\lambda (u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: +nat).(eq T (THead (Bind b0) u t0) (TSort n)))) (ex3_2 TList nat (\lambda (ws: +TList).(\lambda (i: nat).(eq T (THead (Bind b0) u t0) (THeads (Flat Appl) ws +(TLRef i))))) (\lambda (ws: TList).(\lambda (_: nat).(nfs2 c0 ws))) (\lambda +(_: TList).(\lambda (i: nat).(nf2 c0 (TLRef i)))))))))) (\lambda (_: (not (eq +B Abbr Abst))).(\lambda (_: (arity g (CHead c0 (Bind Abbr) u) t0 +a2)).(\lambda (H8: (nf2 c0 (THead (Bind Abbr) u t0))).(nf2_gen_abbr c0 u t0 +H8 (or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T (THead (Bind Abbr) +u t0) (THead (Bind Abst) w u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 +w))) (\lambda (w: T).(\lambda (u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) +(ex nat (\lambda (n: nat).(eq T (THead (Bind Abbr) u t0) (TSort n)))) (ex3_2 +TList nat (\lambda (ws: TList).(\lambda (i: nat).(eq T (THead (Bind Abbr) u +t0) (THeads (Flat Appl) ws (TLRef i))))) (\lambda (ws: TList).(\lambda (_: +nat).(nfs2 c0 ws))) (\lambda (_: TList).(\lambda (i: nat).(nf2 c0 (TLRef +i)))))))))) (\lambda (H6: (not (eq B Abst Abst))).(\lambda (_: (arity g +(CHead c0 (Bind Abst) u) t0 a2)).(\lambda (_: (nf2 c0 (THead (Bind Abst) u +t0))).(let H9 \def (match (H6 (refl_equal B Abst)) in False return (\lambda +(_: False).(or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T (THead +(Bind Abst) u t0) (THead (Bind Abst) w u0)))) (\lambda (w: T).(\lambda (_: +T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u0: T).(nf2 (CHead c0 (Bind Abst) +w) u0)))) (ex nat (\lambda (n: nat).(eq T (THead (Bind Abst) u t0) (TSort +n)))) (ex3_2 TList nat (\lambda (ws: TList).(\lambda (i: nat).(eq T (THead +(Bind Abst) u t0) (THeads (Flat Appl) ws (TLRef i))))) (\lambda (ws: +TList).(\lambda (_: nat).(nfs2 c0 ws))) (\lambda (_: TList).(\lambda (i: +nat).(nf2 c0 (TLRef i))))))) with []) in H9)))) (\lambda (_: (not (eq B Void +Abst))).(\lambda (H7: (arity g (CHead c0 (Bind Void) u) t0 a2)).(\lambda (H8: +(nf2 c0 (THead (Bind Void) u t0))).(let H9 \def (arity_gen_cvoid g (CHead c0 +(Bind Void) u) t0 a2 H7 c0 u O (getl_refl Void c0 u)) in (ex_ind T (\lambda +(v: T).(eq T t0 (lift (S O) O v))) (or3 (ex3_2 T T (\lambda (w: T).(\lambda +(u0: T).(eq T (THead (Bind Void) u t0) (THead (Bind Abst) w u0)))) (\lambda +(w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u0: T).(nf2 +(CHead c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: nat).(eq T (THead (Bind +Void) u t0) (TSort n)))) (ex3_2 TList nat (\lambda (ws: TList).(\lambda (i: +nat).(eq T (THead (Bind Void) u t0) (THeads (Flat Appl) ws (TLRef i))))) +(\lambda (ws: TList).(\lambda (_: nat).(nfs2 c0 ws))) (\lambda (_: +TList).(\lambda (i: nat).(nf2 c0 (TLRef i)))))) (\lambda (x: T).(\lambda +(H10: (eq T t0 (lift (S O) O x))).(let H11 \def (eq_ind T t0 (\lambda (t1: +T).(nf2 c0 (THead (Bind Void) u t1))) H8 (lift (S O) O x) H10) in (eq_ind_r T +(lift (S O) O x) (\lambda (t1: T).(or3 (ex3_2 T T (\lambda (w: T).(\lambda +(u0: T).(eq T (THead (Bind Void) u t1) (THead (Bind Abst) w u0)))) (\lambda +(w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u0: T).(nf2 +(CHead c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: nat).(eq T (THead (Bind +Void) u t1) (TSort n)))) (ex3_2 TList nat (\lambda (ws: TList).(\lambda (i: +nat).(eq T (THead (Bind Void) u t1) (THeads (Flat Appl) ws (TLRef i))))) +(\lambda (ws: TList).(\lambda (_: nat).(nfs2 c0 ws))) (\lambda (_: +TList).(\lambda (i: nat).(nf2 c0 (TLRef i))))))) (nf2_gen_void c0 u x H11 +(or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T (THead (Bind Void) u +(lift (S O) O x)) (THead (Bind Abst) w u0)))) (\lambda (w: T).(\lambda (_: +T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u0: T).(nf2 (CHead c0 (Bind Abst) +w) u0)))) (ex nat (\lambda (n: nat).(eq T (THead (Bind Void) u (lift (S O) O +x)) (TSort n)))) (ex3_2 TList nat (\lambda (ws: TList).(\lambda (i: nat).(eq +T (THead (Bind Void) u (lift (S O) O x)) (THeads (Flat Appl) ws (TLRef i))))) +(\lambda (ws: TList).(\lambda (_: nat).(nfs2 c0 ws))) (\lambda (_: +TList).(\lambda (i: nat).(nf2 c0 (TLRef i))))))) t0 H10)))) H9))))) b H0 H3 +H5))))))))))))) (\lambda (c0: C).(\lambda (u: T).(\lambda (a1: A).(\lambda +(_: (arity g c0 u (asucc g a1))).(\lambda (_: (((nf2 c0 u) \to (or3 (ex3_2 T +T (\lambda (w: T).(\lambda (u0: T).(eq T u (THead (Bind Abst) w u0)))) +(\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u0: +T).(nf2 (CHead c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: nat).(eq T u +(TSort n)))) (ex3_2 TList nat (\lambda (ws: TList).(\lambda (i: nat).(eq T u +(THeads (Flat Appl) ws (TLRef i))))) (\lambda (ws: TList).(\lambda (_: +nat).(nfs2 c0 ws))) (\lambda (_: TList).(\lambda (i: nat).(nf2 c0 (TLRef +i))))))))).(\lambda (t0: T).(\lambda (a2: A).(\lambda (_: (arity g (CHead c0 +(Bind Abst) u) t0 a2)).(\lambda (_: (((nf2 (CHead c0 (Bind Abst) u) t0) \to +(or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T t0 (THead (Bind Abst) +w u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 (CHead c0 (Bind Abst) u) w))) +(\lambda (w: T).(\lambda (u0: T).(nf2 (CHead (CHead c0 (Bind Abst) u) (Bind +Abst) w) u0)))) (ex nat (\lambda (n: nat).(eq T t0 (TSort n)))) (ex3_2 TList +nat (\lambda (ws: TList).(\lambda (i: nat).(eq T t0 (THeads (Flat Appl) ws +(TLRef i))))) (\lambda (ws: TList).(\lambda (_: nat).(nfs2 (CHead c0 (Bind +Abst) u) ws))) (\lambda (_: TList).(\lambda (i: nat).(nf2 (CHead c0 (Bind +Abst) u) (TLRef i))))))))).(\lambda (H4: (nf2 c0 (THead (Bind Abst) u +t0))).(let H5 \def (nf2_gen_abst c0 u t0 H4) in (and_ind (nf2 c0 u) (nf2 +(CHead c0 (Bind Abst) u) t0) (or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: +T).(eq T (THead (Bind Abst) u t0) (THead (Bind Abst) w u0)))) (\lambda (w: +T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u0: T).(nf2 (CHead +c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: nat).(eq T (THead (Bind Abst) u +t0) (TSort n)))) (ex3_2 TList nat (\lambda (ws: TList).(\lambda (i: nat).(eq +T (THead (Bind Abst) u t0) (THeads (Flat Appl) ws (TLRef i))))) (\lambda (ws: +TList).(\lambda (_: nat).(nfs2 c0 ws))) (\lambda (_: TList).(\lambda (i: +nat).(nf2 c0 (TLRef i)))))) (\lambda (H6: (nf2 c0 u)).(\lambda (H7: (nf2 +(CHead c0 (Bind Abst) u) t0)).(or3_intro0 (ex3_2 T T (\lambda (w: T).(\lambda +(u0: T).(eq T (THead (Bind Abst) u t0) (THead (Bind Abst) w u0)))) (\lambda +(w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u0: T).(nf2 +(CHead c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: nat).(eq T (THead (Bind +Abst) u t0) (TSort n)))) (ex3_2 TList nat (\lambda (ws: TList).(\lambda (i: +nat).(eq T (THead (Bind Abst) u t0) (THeads (Flat Appl) ws (TLRef i))))) +(\lambda (ws: TList).(\lambda (_: nat).(nfs2 c0 ws))) (\lambda (_: +TList).(\lambda (i: nat).(nf2 c0 (TLRef i))))) (ex3_2_intro T T (\lambda (w: +T).(\lambda (u0: T).(eq T (THead (Bind Abst) u t0) (THead (Bind Abst) w +u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda +(u0: T).(nf2 (CHead c0 (Bind Abst) w) u0))) u t0 (refl_equal T (THead (Bind +Abst) u t0)) H6 H7)))) H5)))))))))))) (\lambda (c0: C).(\lambda (u: +T).(\lambda (a1: A).(\lambda (_: (arity g c0 u a1)).(\lambda (_: (((nf2 c0 u) +\to (or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T u (THead (Bind +Abst) w u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: +T).(\lambda (u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: +nat).(eq T u (TSort n)))) (ex3_2 TList nat (\lambda (ws: TList).(\lambda (i: +nat).(eq T u (THeads (Flat Appl) ws (TLRef i))))) (\lambda (ws: +TList).(\lambda (_: nat).(nfs2 c0 ws))) (\lambda (_: TList).(\lambda (i: +nat).(nf2 c0 (TLRef i))))))))).(\lambda (t0: T).(\lambda (a2: A).(\lambda +(H2: (arity g c0 t0 (AHead a1 a2))).(\lambda (H3: (((nf2 c0 t0) \to (or3 +(ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T t0 (THead (Bind Abst) w +u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda +(u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: nat).(eq T +t0 (TSort n)))) (ex3_2 TList nat (\lambda (ws: TList).(\lambda (i: nat).(eq T +t0 (THeads (Flat Appl) ws (TLRef i))))) (\lambda (ws: TList).(\lambda (_: +nat).(nfs2 c0 ws))) (\lambda (_: TList).(\lambda (i: nat).(nf2 c0 (TLRef +i))))))))).(\lambda (H4: (nf2 c0 (THead (Flat Appl) u t0))).(let H5 \def +(nf2_gen_flat Appl c0 u t0 H4) in (and_ind (nf2 c0 u) (nf2 c0 t0) (or3 (ex3_2 +T T (\lambda (w: T).(\lambda (u0: T).(eq T (THead (Flat Appl) u t0) (THead +(Bind Abst) w u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda +(w: T).(\lambda (u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) (ex nat (\lambda +(n: nat).(eq T (THead (Flat Appl) u t0) (TSort n)))) (ex3_2 TList nat +(\lambda (ws: TList).(\lambda (i: nat).(eq T (THead (Flat Appl) u t0) (THeads +(Flat Appl) ws (TLRef i))))) (\lambda (ws: TList).(\lambda (_: nat).(nfs2 c0 +ws))) (\lambda (_: TList).(\lambda (i: nat).(nf2 c0 (TLRef i)))))) (\lambda +(H6: (nf2 c0 u)).(\lambda (H7: (nf2 c0 t0)).(let H_x \def (H3 H7) in (let H8 +\def H_x in (or3_ind (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T t0 +(THead (Bind Abst) w u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) +(\lambda (w: T).(\lambda (u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) (ex nat +(\lambda (n: nat).(eq T t0 (TSort n)))) (ex3_2 TList nat (\lambda (ws: +TList).(\lambda (i: nat).(eq T t0 (THeads (Flat Appl) ws (TLRef i))))) +(\lambda (ws: TList).(\lambda (_: nat).(nfs2 c0 ws))) (\lambda (_: +TList).(\lambda (i: nat).(nf2 c0 (TLRef i))))) (or3 (ex3_2 T T (\lambda (w: +T).(\lambda (u0: T).(eq T (THead (Flat Appl) u t0) (THead (Bind Abst) w +u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda +(u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: nat).(eq T +(THead (Flat Appl) u t0) (TSort n)))) (ex3_2 TList nat (\lambda (ws: +TList).(\lambda (i: nat).(eq T (THead (Flat Appl) u t0) (THeads (Flat Appl) +ws (TLRef i))))) (\lambda (ws: TList).(\lambda (_: nat).(nfs2 c0 ws))) +(\lambda (_: TList).(\lambda (i: nat).(nf2 c0 (TLRef i)))))) (\lambda (H9: +(ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T t0 (THead (Bind Abst) w +u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda +(u0: T).(nf2 (CHead c0 (Bind Abst) w) u0))))).(ex3_2_ind T T (\lambda (w: +T).(\lambda (u0: T).(eq T t0 (THead (Bind Abst) w u0)))) (\lambda (w: +T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u0: T).(nf2 (CHead +c0 (Bind Abst) w) u0))) (or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq +T (THead (Flat Appl) u t0) (THead (Bind Abst) w u0)))) (\lambda (w: +T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u0: T).(nf2 (CHead +c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: nat).(eq T (THead (Flat Appl) u +t0) (TSort n)))) (ex3_2 TList nat (\lambda (ws: TList).(\lambda (i: nat).(eq +T (THead (Flat Appl) u t0) (THeads (Flat Appl) ws (TLRef i))))) (\lambda (ws: +TList).(\lambda (_: nat).(nfs2 c0 ws))) (\lambda (_: TList).(\lambda (i: +nat).(nf2 c0 (TLRef i)))))) (\lambda (x0: T).(\lambda (x1: T).(\lambda (H10: +(eq T t0 (THead (Bind Abst) x0 x1))).(\lambda (_: (nf2 c0 x0)).(\lambda (_: +(nf2 (CHead c0 (Bind Abst) x0) x1)).(let H13 \def (eq_ind T t0 (\lambda (t1: +T).(nf2 c0 (THead (Flat Appl) u t1))) H4 (THead (Bind Abst) x0 x1) H10) in +(let H14 \def (eq_ind T t0 (\lambda (t1: T).(arity g c0 t1 (AHead a1 a2))) H2 +(THead (Bind Abst) x0 x1) H10) in (eq_ind_r T (THead (Bind Abst) x0 x1) +(\lambda (t1: T).(or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T +(THead (Flat Appl) u t1) (THead (Bind Abst) w u0)))) (\lambda (w: T).(\lambda +(_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u0: T).(nf2 (CHead c0 (Bind +Abst) w) u0)))) (ex nat (\lambda (n: nat).(eq T (THead (Flat Appl) u t1) +(TSort n)))) (ex3_2 TList nat (\lambda (ws: TList).(\lambda (i: nat).(eq T +(THead (Flat Appl) u t1) (THeads (Flat Appl) ws (TLRef i))))) (\lambda (ws: +TList).(\lambda (_: nat).(nfs2 c0 ws))) (\lambda (_: TList).(\lambda (i: +nat).(nf2 c0 (TLRef i))))))) (nf2_gen_beta c0 u x0 x1 H13 (or3 (ex3_2 T T +(\lambda (w: T).(\lambda (u0: T).(eq T (THead (Flat Appl) u (THead (Bind +Abst) x0 x1)) (THead (Bind Abst) w u0)))) (\lambda (w: T).(\lambda (_: +T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u0: T).(nf2 (CHead c0 (Bind Abst) +w) u0)))) (ex nat (\lambda (n: nat).(eq T (THead (Flat Appl) u (THead (Bind +Abst) x0 x1)) (TSort n)))) (ex3_2 TList nat (\lambda (ws: TList).(\lambda (i: +nat).(eq T (THead (Flat Appl) u (THead (Bind Abst) x0 x1)) (THeads (Flat +Appl) ws (TLRef i))))) (\lambda (ws: TList).(\lambda (_: nat).(nfs2 c0 ws))) +(\lambda (_: TList).(\lambda (i: nat).(nf2 c0 (TLRef i))))))) t0 H10)))))))) +H9)) (\lambda (H9: (ex nat (\lambda (n: nat).(eq T t0 (TSort n))))).(ex_ind +nat (\lambda (n: nat).(eq T t0 (TSort n))) (or3 (ex3_2 T T (\lambda (w: +T).(\lambda (u0: T).(eq T (THead (Flat Appl) u t0) (THead (Bind Abst) w +u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda +(u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: nat).(eq T +(THead (Flat Appl) u t0) (TSort n)))) (ex3_2 TList nat (\lambda (ws: +TList).(\lambda (i: nat).(eq T (THead (Flat Appl) u t0) (THeads (Flat Appl) +ws (TLRef i))))) (\lambda (ws: TList).(\lambda (_: nat).(nfs2 c0 ws))) +(\lambda (_: TList).(\lambda (i: nat).(nf2 c0 (TLRef i)))))) (\lambda (x: +nat).(\lambda (H10: (eq T t0 (TSort x))).(let H11 \def (eq_ind T t0 (\lambda +(t1: T).(nf2 c0 (THead (Flat Appl) u t1))) H4 (TSort x) H10) in (let H12 \def +(eq_ind T t0 (\lambda (t1: T).(arity g c0 t1 (AHead a1 a2))) H2 (TSort x) +H10) in (eq_ind_r T (TSort x) (\lambda (t1: T).(or3 (ex3_2 T T (\lambda (w: +T).(\lambda (u0: T).(eq T (THead (Flat Appl) u t1) (THead (Bind Abst) w +u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda +(u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: nat).(eq T +(THead (Flat Appl) u t1) (TSort n)))) (ex3_2 TList nat (\lambda (ws: +TList).(\lambda (i: nat).(eq T (THead (Flat Appl) u t1) (THeads (Flat Appl) +ws (TLRef i))))) (\lambda (ws: TList).(\lambda (_: nat).(nfs2 c0 ws))) +(\lambda (_: TList).(\lambda (i: nat).(nf2 c0 (TLRef i))))))) (let H13 \def +(match (arity_gen_sort g c0 x (AHead a1 a2) H12) in leq return (\lambda (a0: +A).(\lambda (a3: A).(\lambda (_: (leq ? a0 a3)).((eq A a0 (AHead a1 a2)) \to +((eq A a3 (ASort O x)) \to (or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: +T).(eq T (THead (Flat Appl) u (TSort x)) (THead (Bind Abst) w u0)))) (\lambda +(w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u0: T).(nf2 +(CHead c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: nat).(eq T (THead (Flat +Appl) u (TSort x)) (TSort n)))) (ex3_2 TList nat (\lambda (ws: +TList).(\lambda (i: nat).(eq T (THead (Flat Appl) u (TSort x)) (THeads (Flat +Appl) ws (TLRef i))))) (\lambda (ws: TList).(\lambda (_: nat).(nfs2 c0 ws))) +(\lambda (_: TList).(\lambda (i: nat).(nf2 c0 (TLRef i))))))))))) with +[(leq_sort h1 h2 n1 n2 k H13) \Rightarrow (\lambda (H14: (eq A (ASort h1 n1) +(AHead a1 a2))).(\lambda (H15: (eq A (ASort h2 n2) (ASort O x))).((let H16 +\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) H14) in (False_ind ((eq A (ASort h2 n2) (ASort O x)) +\to ((eq A (aplus g (ASort h1 n1) k) (aplus g (ASort h2 n2) k)) \to (or3 +(ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T (THead (Flat Appl) u (TSort +x)) (THead (Bind Abst) w u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) +(\lambda (w: T).(\lambda (u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) (ex nat +(\lambda (n: nat).(eq T (THead (Flat Appl) u (TSort x)) (TSort n)))) (ex3_2 +TList nat (\lambda (ws: TList).(\lambda (i: nat).(eq T (THead (Flat Appl) u +(TSort x)) (THeads (Flat Appl) ws (TLRef i))))) (\lambda (ws: TList).(\lambda +(_: nat).(nfs2 c0 ws))) (\lambda (_: TList).(\lambda (i: nat).(nf2 c0 (TLRef +i)))))))) H16)) H15 H13))) | (leq_head a0 a3 H13 a4 a5 H14) \Rightarrow +(\lambda (H15: (eq A (AHead a0 a4) (AHead a1 a2))).(\lambda (H16: (eq A +(AHead a3 a5) (ASort O x))).((let H17 \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) H15) in ((let H18 +\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) H15) in (eq_ind A a1 (\lambda (a6: A).((eq A a4 a2) \to +((eq A (AHead a3 a5) (ASort O x)) \to ((leq g a6 a3) \to ((leq g a4 a5) \to +(or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T (THead (Flat Appl) u +(TSort x)) (THead (Bind Abst) w u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 +c0 w))) (\lambda (w: T).(\lambda (u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) +(ex nat (\lambda (n: nat).(eq T (THead (Flat Appl) u (TSort x)) (TSort n)))) +(ex3_2 TList nat (\lambda (ws: TList).(\lambda (i: nat).(eq T (THead (Flat +Appl) u (TSort x)) (THeads (Flat Appl) ws (TLRef i))))) (\lambda (ws: +TList).(\lambda (_: nat).(nfs2 c0 ws))) (\lambda (_: TList).(\lambda (i: +nat).(nf2 c0 (TLRef i))))))))))) (\lambda (H19: (eq A a4 a2)).(eq_ind A a2 +(\lambda (a6: A).((eq A (AHead a3 a5) (ASort O x)) \to ((leq g a1 a3) \to +((leq g a6 a5) \to (or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T +(THead (Flat Appl) u (TSort x)) (THead (Bind Abst) w u0)))) (\lambda (w: +T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u0: T).(nf2 (CHead +c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: nat).(eq T (THead (Flat Appl) u +(TSort x)) (TSort n)))) (ex3_2 TList nat (\lambda (ws: TList).(\lambda (i: +nat).(eq T (THead (Flat Appl) u (TSort x)) (THeads (Flat Appl) ws (TLRef +i))))) (\lambda (ws: TList).(\lambda (_: nat).(nfs2 c0 ws))) (\lambda (_: +TList).(\lambda (i: nat).(nf2 c0 (TLRef i)))))))))) (\lambda (H20: (eq A +(AHead a3 a5) (ASort O x))).(let H21 \def (eq_ind A (AHead a3 a5) (\lambda +(e: A).(match e in A return (\lambda (_: A).Prop) with [(ASort _ _) +\Rightarrow False | (AHead _ _) \Rightarrow True])) I (ASort O x) H20) in +(False_ind ((leq g a1 a3) \to ((leq g a2 a5) \to (or3 (ex3_2 T T (\lambda (w: +T).(\lambda (u0: T).(eq T (THead (Flat Appl) u (TSort x)) (THead (Bind Abst) +w u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: +T).(\lambda (u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: +nat).(eq T (THead (Flat Appl) u (TSort x)) (TSort n)))) (ex3_2 TList nat +(\lambda (ws: TList).(\lambda (i: nat).(eq T (THead (Flat Appl) u (TSort x)) +(THeads (Flat Appl) ws (TLRef i))))) (\lambda (ws: TList).(\lambda (_: +nat).(nfs2 c0 ws))) (\lambda (_: TList).(\lambda (i: nat).(nf2 c0 (TLRef +i)))))))) H21))) a4 (sym_eq A a4 a2 H19))) a0 (sym_eq A a0 a1 H18))) H17)) +H16 H13 H14)))]) in (H13 (refl_equal A (AHead a1 a2)) (refl_equal A (ASort O +x)))) t0 H10))))) H9)) (\lambda (H9: (ex3_2 TList nat (\lambda (ws: +TList).(\lambda (i: nat).(eq T t0 (THeads (Flat Appl) ws (TLRef i))))) +(\lambda (ws: TList).(\lambda (_: nat).(nfs2 c0 ws))) (\lambda (_: +TList).(\lambda (i: nat).(nf2 c0 (TLRef i)))))).(ex3_2_ind TList nat (\lambda +(ws: TList).(\lambda (i: nat).(eq T t0 (THeads (Flat Appl) ws (TLRef i))))) +(\lambda (ws: TList).(\lambda (_: nat).(nfs2 c0 ws))) (\lambda (_: +TList).(\lambda (i: nat).(nf2 c0 (TLRef i)))) (or3 (ex3_2 T T (\lambda (w: +T).(\lambda (u0: T).(eq T (THead (Flat Appl) u t0) (THead (Bind Abst) w +u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda +(u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: nat).(eq T +(THead (Flat Appl) u t0) (TSort n)))) (ex3_2 TList nat (\lambda (ws: +TList).(\lambda (i: nat).(eq T (THead (Flat Appl) u t0) (THeads (Flat Appl) +ws (TLRef i))))) (\lambda (ws: TList).(\lambda (_: nat).(nfs2 c0 ws))) +(\lambda (_: TList).(\lambda (i: nat).(nf2 c0 (TLRef i)))))) (\lambda (x0: +TList).(\lambda (x1: nat).(\lambda (H10: (eq T t0 (THeads (Flat Appl) x0 +(TLRef x1)))).(\lambda (H11: (nfs2 c0 x0)).(\lambda (H12: (nf2 c0 (TLRef +x1))).(let H13 \def (eq_ind T t0 (\lambda (t1: T).(nf2 c0 (THead (Flat Appl) +u t1))) H4 (THeads (Flat Appl) x0 (TLRef x1)) H10) in (let H14 \def (eq_ind T +t0 (\lambda (t1: T).(arity g c0 t1 (AHead a1 a2))) H2 (THeads (Flat Appl) x0 +(TLRef x1)) H10) in (eq_ind_r T (THeads (Flat Appl) x0 (TLRef x1)) (\lambda +(t1: T).(or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T (THead (Flat +Appl) u t1) (THead (Bind Abst) w u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 +c0 w))) (\lambda (w: T).(\lambda (u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) +(ex nat (\lambda (n: nat).(eq T (THead (Flat Appl) u t1) (TSort n)))) (ex3_2 +TList nat (\lambda (ws: TList).(\lambda (i: nat).(eq T (THead (Flat Appl) u +t1) (THeads (Flat Appl) ws (TLRef i))))) (\lambda (ws: TList).(\lambda (_: +nat).(nfs2 c0 ws))) (\lambda (_: TList).(\lambda (i: nat).(nf2 c0 (TLRef +i))))))) (or3_intro2 (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T (THead +(Flat Appl) u (THeads (Flat Appl) x0 (TLRef x1))) (THead (Bind Abst) w u0)))) +(\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u0: +T).(nf2 (CHead c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: nat).(eq T +(THead (Flat Appl) u (THeads (Flat Appl) x0 (TLRef x1))) (TSort n)))) (ex3_2 +TList nat (\lambda (ws: TList).(\lambda (i: nat).(eq T (THead (Flat Appl) u +(THeads (Flat Appl) x0 (TLRef x1))) (THeads (Flat Appl) ws (TLRef i))))) +(\lambda (ws: TList).(\lambda (_: nat).(nfs2 c0 ws))) (\lambda (_: +TList).(\lambda (i: nat).(nf2 c0 (TLRef i))))) (ex3_2_intro TList nat +(\lambda (ws: TList).(\lambda (i: nat).(eq T (THead (Flat Appl) u (THeads +(Flat Appl) x0 (TLRef x1))) (THeads (Flat Appl) ws (TLRef i))))) (\lambda +(ws: TList).(\lambda (_: nat).(nfs2 c0 ws))) (\lambda (_: TList).(\lambda (i: +nat).(nf2 c0 (TLRef i)))) (TCons u x0) x1 (refl_equal T (THead (Flat Appl) u +(THeads (Flat Appl) x0 (TLRef x1)))) (conj (nf2 c0 u) (nfs2 c0 x0) H6 H11) +H12)) t0 H10)))))))) H9)) H8))))) H5)))))))))))) (\lambda (c0: C).(\lambda +(u: T).(\lambda (a0: A).(\lambda (_: (arity g c0 u (asucc g a0))).(\lambda +(_: (((nf2 c0 u) \to (or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T u +(THead (Bind Abst) w u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) +(\lambda (w: T).(\lambda (u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) (ex nat +(\lambda (n: nat).(eq T u (TSort n)))) (ex3_2 TList nat (\lambda (ws: +TList).(\lambda (i: nat).(eq T u (THeads (Flat Appl) ws (TLRef i))))) +(\lambda (ws: TList).(\lambda (_: nat).(nfs2 c0 ws))) (\lambda (_: +TList).(\lambda (i: nat).(nf2 c0 (TLRef i))))))))).(\lambda (t0: T).(\lambda +(_: (arity g c0 t0 a0)).(\lambda (_: (((nf2 c0 t0) \to (or3 (ex3_2 T T +(\lambda (w: T).(\lambda (u0: T).(eq T t0 (THead (Bind Abst) w u0)))) +(\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u0: +T).(nf2 (CHead c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: nat).(eq T t0 +(TSort n)))) (ex3_2 TList nat (\lambda (ws: TList).(\lambda (i: nat).(eq T t0 +(THeads (Flat Appl) ws (TLRef i))))) (\lambda (ws: TList).(\lambda (_: +nat).(nfs2 c0 ws))) (\lambda (_: TList).(\lambda (i: nat).(nf2 c0 (TLRef +i))))))))).(\lambda (H4: (nf2 c0 (THead (Flat Cast) u t0))).(nf2_gen_cast c0 +u t0 H4 (or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T (THead (Flat +Cast) u t0) (THead (Bind Abst) w u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 +c0 w))) (\lambda (w: T).(\lambda (u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) +(ex nat (\lambda (n: nat).(eq T (THead (Flat Cast) u t0) (TSort n)))) (ex3_2 +TList nat (\lambda (ws: TList).(\lambda (i: nat).(eq T (THead (Flat Cast) u +t0) (THeads (Flat Appl) ws (TLRef i))))) (\lambda (ws: TList).(\lambda (_: +nat).(nfs2 c0 ws))) (\lambda (_: TList).(\lambda (i: nat).(nf2 c0 (TLRef +i)))))))))))))))) (\lambda (c0: C).(\lambda (t0: T).(\lambda (a1: A).(\lambda +(_: (arity g c0 t0 a1)).(\lambda (H1: (((nf2 c0 t0) \to (or3 (ex3_2 T T +(\lambda (w: T).(\lambda (u: T).(eq T t0 (THead (Bind Abst) w u)))) (\lambda +(w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u: T).(nf2 +(CHead c0 (Bind Abst) w) u)))) (ex nat (\lambda (n: nat).(eq T t0 (TSort +n)))) (ex3_2 TList nat (\lambda (ws: TList).(\lambda (i: nat).(eq T t0 +(THeads (Flat Appl) ws (TLRef i))))) (\lambda (ws: TList).(\lambda (_: +nat).(nfs2 c0 ws))) (\lambda (_: TList).(\lambda (i: nat).(nf2 c0 (TLRef +i))))))))).(\lambda (a2: A).(\lambda (_: (leq g a1 a2)).(\lambda (H3: (nf2 c0 +t0)).(let H_x \def (H1 H3) in (let H4 \def H_x in (or3_ind (ex3_2 T T +(\lambda (w: T).(\lambda (u: T).(eq T t0 (THead (Bind Abst) w u)))) (\lambda +(w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u: T).(nf2 +(CHead c0 (Bind Abst) w) u)))) (ex nat (\lambda (n: nat).(eq T t0 (TSort +n)))) (ex3_2 TList nat (\lambda (ws: TList).(\lambda (i: nat).(eq T t0 +(THeads (Flat Appl) ws (TLRef i))))) (\lambda (ws: TList).(\lambda (_: +nat).(nfs2 c0 ws))) (\lambda (_: TList).(\lambda (i: nat).(nf2 c0 (TLRef +i))))) (or3 (ex3_2 T T (\lambda (w: T).(\lambda (u: T).(eq T t0 (THead (Bind +Abst) w u)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: +T).(\lambda (u: T).(nf2 (CHead c0 (Bind Abst) w) u)))) (ex nat (\lambda (n: +nat).(eq T t0 (TSort n)))) (ex3_2 TList nat (\lambda (ws: TList).(\lambda (i: +nat).(eq T t0 (THeads (Flat Appl) ws (TLRef i))))) (\lambda (ws: +TList).(\lambda (_: nat).(nfs2 c0 ws))) (\lambda (_: TList).(\lambda (i: +nat).(nf2 c0 (TLRef i)))))) (\lambda (H5: (ex3_2 T T (\lambda (w: T).(\lambda +(u: T).(eq T t0 (THead (Bind Abst) w u)))) (\lambda (w: T).(\lambda (_: +T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u: T).(nf2 (CHead c0 (Bind Abst) w) +u))))).(ex3_2_ind T T (\lambda (w: T).(\lambda (u: T).(eq T t0 (THead (Bind +Abst) w u)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: +T).(\lambda (u: T).(nf2 (CHead c0 (Bind Abst) w) u))) (or3 (ex3_2 T T +(\lambda (w: T).(\lambda (u: T).(eq T t0 (THead (Bind Abst) w u)))) (\lambda +(w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u: T).(nf2 +(CHead c0 (Bind Abst) w) u)))) (ex nat (\lambda (n: nat).(eq T t0 (TSort +n)))) (ex3_2 TList nat (\lambda (ws: TList).(\lambda (i: nat).(eq T t0 +(THeads (Flat Appl) ws (TLRef i))))) (\lambda (ws: TList).(\lambda (_: +nat).(nfs2 c0 ws))) (\lambda (_: TList).(\lambda (i: nat).(nf2 c0 (TLRef +i)))))) (\lambda (x0: T).(\lambda (x1: T).(\lambda (H6: (eq T t0 (THead (Bind +Abst) x0 x1))).(\lambda (H7: (nf2 c0 x0)).(\lambda (H8: (nf2 (CHead c0 (Bind +Abst) x0) x1)).(eq_ind_r T (THead (Bind Abst) x0 x1) (\lambda (t1: T).(or3 +(ex3_2 T T (\lambda (w: T).(\lambda (u: T).(eq T t1 (THead (Bind Abst) w +u)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda +(u: T).(nf2 (CHead c0 (Bind Abst) w) u)))) (ex nat (\lambda (n: nat).(eq T t1 +(TSort n)))) (ex3_2 TList nat (\lambda (ws: TList).(\lambda (i: nat).(eq T t1 +(THeads (Flat Appl) ws (TLRef i))))) (\lambda (ws: TList).(\lambda (_: +nat).(nfs2 c0 ws))) (\lambda (_: TList).(\lambda (i: nat).(nf2 c0 (TLRef +i))))))) (or3_intro0 (ex3_2 T T (\lambda (w: T).(\lambda (u: T).(eq T (THead +(Bind Abst) x0 x1) (THead (Bind Abst) w u)))) (\lambda (w: T).(\lambda (_: +T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u: T).(nf2 (CHead c0 (Bind Abst) w) +u)))) (ex nat (\lambda (n: nat).(eq T (THead (Bind Abst) x0 x1) (TSort n)))) +(ex3_2 TList nat (\lambda (ws: TList).(\lambda (i: nat).(eq T (THead (Bind +Abst) x0 x1) (THeads (Flat Appl) ws (TLRef i))))) (\lambda (ws: +TList).(\lambda (_: nat).(nfs2 c0 ws))) (\lambda (_: TList).(\lambda (i: +nat).(nf2 c0 (TLRef i))))) (ex3_2_intro T T (\lambda (w: T).(\lambda (u: +T).(eq T (THead (Bind Abst) x0 x1) (THead (Bind Abst) w u)))) (\lambda (w: +T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u: T).(nf2 (CHead +c0 (Bind Abst) w) u))) x0 x1 (refl_equal T (THead (Bind Abst) x0 x1)) H7 H8)) +t0 H6)))))) H5)) (\lambda (H5: (ex nat (\lambda (n: nat).(eq T t0 (TSort +n))))).(ex_ind nat (\lambda (n: nat).(eq T t0 (TSort n))) (or3 (ex3_2 T T +(\lambda (w: T).(\lambda (u: T).(eq T t0 (THead (Bind Abst) w u)))) (\lambda +(w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u: T).(nf2 +(CHead c0 (Bind Abst) w) u)))) (ex nat (\lambda (n: nat).(eq T t0 (TSort +n)))) (ex3_2 TList nat (\lambda (ws: TList).(\lambda (i: nat).(eq T t0 +(THeads (Flat Appl) ws (TLRef i))))) (\lambda (ws: TList).(\lambda (_: +nat).(nfs2 c0 ws))) (\lambda (_: TList).(\lambda (i: nat).(nf2 c0 (TLRef +i)))))) (\lambda (x: nat).(\lambda (H6: (eq T t0 (TSort x))).(eq_ind_r T +(TSort x) (\lambda (t1: T).(or3 (ex3_2 T T (\lambda (w: T).(\lambda (u: +T).(eq T t1 (THead (Bind Abst) w u)))) (\lambda (w: T).(\lambda (_: T).(nf2 +c0 w))) (\lambda (w: T).(\lambda (u: T).(nf2 (CHead c0 (Bind Abst) w) u)))) +(ex nat (\lambda (n: nat).(eq T t1 (TSort n)))) (ex3_2 TList nat (\lambda +(ws: TList).(\lambda (i: nat).(eq T t1 (THeads (Flat Appl) ws (TLRef i))))) +(\lambda (ws: TList).(\lambda (_: nat).(nfs2 c0 ws))) (\lambda (_: +TList).(\lambda (i: nat).(nf2 c0 (TLRef i))))))) (or3_intro1 (ex3_2 T T +(\lambda (w: T).(\lambda (u: T).(eq T (TSort x) (THead (Bind Abst) w u)))) +(\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u: +T).(nf2 (CHead c0 (Bind Abst) w) u)))) (ex nat (\lambda (n: nat).(eq T (TSort +x) (TSort n)))) (ex3_2 TList nat (\lambda (ws: TList).(\lambda (i: nat).(eq T +(TSort x) (THeads (Flat Appl) ws (TLRef i))))) (\lambda (ws: TList).(\lambda +(_: nat).(nfs2 c0 ws))) (\lambda (_: TList).(\lambda (i: nat).(nf2 c0 (TLRef +i))))) (ex_intro nat (\lambda (n: nat).(eq T (TSort x) (TSort n))) x +(refl_equal T (TSort x)))) t0 H6))) H5)) (\lambda (H5: (ex3_2 TList nat +(\lambda (ws: TList).(\lambda (i: nat).(eq T t0 (THeads (Flat Appl) ws (TLRef +i))))) (\lambda (ws: TList).(\lambda (_: nat).(nfs2 c0 ws))) (\lambda (_: +TList).(\lambda (i: nat).(nf2 c0 (TLRef i)))))).(ex3_2_ind TList nat (\lambda +(ws: TList).(\lambda (i: nat).(eq T t0 (THeads (Flat Appl) ws (TLRef i))))) +(\lambda (ws: TList).(\lambda (_: nat).(nfs2 c0 ws))) (\lambda (_: +TList).(\lambda (i: nat).(nf2 c0 (TLRef i)))) (or3 (ex3_2 T T (\lambda (w: +T).(\lambda (u: T).(eq T t0 (THead (Bind Abst) w u)))) (\lambda (w: +T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u: T).(nf2 (CHead +c0 (Bind Abst) w) u)))) (ex nat (\lambda (n: nat).(eq T t0 (TSort n)))) +(ex3_2 TList nat (\lambda (ws: TList).(\lambda (i: nat).(eq T t0 (THeads +(Flat Appl) ws (TLRef i))))) (\lambda (ws: TList).(\lambda (_: nat).(nfs2 c0 +ws))) (\lambda (_: TList).(\lambda (i: nat).(nf2 c0 (TLRef i)))))) (\lambda +(x0: TList).(\lambda (x1: nat).(\lambda (H6: (eq T t0 (THeads (Flat Appl) x0 +(TLRef x1)))).(\lambda (H7: (nfs2 c0 x0)).(\lambda (H8: (nf2 c0 (TLRef +x1))).(eq_ind_r T (THeads (Flat Appl) x0 (TLRef x1)) (\lambda (t1: T).(or3 +(ex3_2 T T (\lambda (w: T).(\lambda (u: T).(eq T t1 (THead (Bind Abst) w +u)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda +(u: T).(nf2 (CHead c0 (Bind Abst) w) u)))) (ex nat (\lambda (n: nat).(eq T t1 +(TSort n)))) (ex3_2 TList nat (\lambda (ws: TList).(\lambda (i: nat).(eq T t1 +(THeads (Flat Appl) ws (TLRef i))))) (\lambda (ws: TList).(\lambda (_: +nat).(nfs2 c0 ws))) (\lambda (_: TList).(\lambda (i: nat).(nf2 c0 (TLRef +i))))))) (or3_intro2 (ex3_2 T T (\lambda (w: T).(\lambda (u: T).(eq T (THeads +(Flat Appl) x0 (TLRef x1)) (THead (Bind Abst) w u)))) (\lambda (w: +T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u: T).(nf2 (CHead +c0 (Bind Abst) w) u)))) (ex nat (\lambda (n: nat).(eq T (THeads (Flat Appl) +x0 (TLRef x1)) (TSort n)))) (ex3_2 TList nat (\lambda (ws: TList).(\lambda +(i: nat).(eq T (THeads (Flat Appl) x0 (TLRef x1)) (THeads (Flat Appl) ws +(TLRef i))))) (\lambda (ws: TList).(\lambda (_: nat).(nfs2 c0 ws))) (\lambda +(_: TList).(\lambda (i: nat).(nf2 c0 (TLRef i))))) (ex3_2_intro TList nat +(\lambda (ws: TList).(\lambda (i: nat).(eq T (THeads (Flat Appl) x0 (TLRef +x1)) (THeads (Flat Appl) ws (TLRef i))))) (\lambda (ws: TList).(\lambda (_: +nat).(nfs2 c0 ws))) (\lambda (_: TList).(\lambda (i: nat).(nf2 c0 (TLRef +i)))) x0 x1 (refl_equal T (THeads (Flat Appl) x0 (TLRef x1))) H7 H8)) t0 +H6)))))) H5)) H4))))))))))) c t a H))))). + diff --git a/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/nf2/defs.ma b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/nf2/defs.ma index 2819de53b..23868ee8b 100644 --- a/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/nf2/defs.ma +++ b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/nf2/defs.ma @@ -24,3 +24,10 @@ definition nf2: \lambda (c: C).(\lambda (t1: T).(\forall (t2: T).((pr2 c t1 t2) \to (eq T t1 t2)))). +definition nfs2: + C \to (TList \to Prop) +\def + let rec nfs2 (c: C) (ts: TList) on ts: Prop \def (match ts with [TNil +\Rightarrow True | (TCons t ts0) \Rightarrow (land (nf2 c t) (nfs2 c ts0))]) +in nfs2. + diff --git a/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/nf2/fwd.ma b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/nf2/fwd.ma index 27a629724..849e86090 100644 --- a/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/nf2/fwd.ma +++ b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/nf2/fwd.ma @@ -20,6 +20,8 @@ include "nf2/defs.ma". include "pr2/clen.ma". +include "subst0/dec.ma". + include "T/props.ma". theorem nf2_gen_lref: @@ -65,6 +67,22 @@ t)) \to (\forall (P: Prop).P)))) (pr2_free c (THead (Flat Cast) u t) t (pr0_epsilon t t (pr0_refl t) u))) P))))). +theorem nf2_gen_beta: + \forall (c: C).(\forall (u: T).(\forall (v: T).(\forall (t: T).((nf2 c +(THead (Flat Appl) u (THead (Bind Abst) v t))) \to (\forall (P: Prop).P))))) +\def + \lambda (c: C).(\lambda (u: T).(\lambda (v: T).(\lambda (t: T).(\lambda (H: +((\forall (t2: T).((pr2 c (THead (Flat Appl) u (THead (Bind Abst) v t)) t2) +\to (eq T (THead (Flat Appl) u (THead (Bind Abst) v t)) t2))))).(\lambda (P: +Prop).(let H0 \def (eq_ind T (THead (Flat Appl) u (THead (Bind Abst) v t)) +(\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 Abbr) u t) (H (THead (Bind +Abbr) u t) (pr2_free c (THead (Flat Appl) u (THead (Bind Abst) v t)) (THead +(Bind Abbr) u t) (pr0_beta v u u (pr0_refl u) t t (pr0_refl t))))) in +(False_ind P H0))))))). + theorem nf2_gen_flat: \forall (f: F).(\forall (c: C).(\forall (u: T).(\forall (t: T).((nf2 c (THead (Flat f) u t)) \to (land (nf2 c u) (nf2 c t)))))) @@ -83,3 +101,98 @@ u t2)).(let H1 \def (f_equal T T (\lambda (e: T).(match e in T return (THead (Flat f) u t) (THead (Flat f) u t2) (H (THead (Flat f) u t2) (pr2_head_2 c u t t2 (Flat f) (pr2_cflat c t t2 H0 f u)))) in H1)))))))). +theorem nf2_gen__aux: + \forall (b: B).(\forall (x: T).(\forall (u: T).(\forall (d: nat).((eq T +(THead (Bind b) u (lift (S O) d x)) x) \to (\forall (P: Prop).P))))) +\def + \lambda (b: B).(\lambda (x: T).(T_ind (\lambda (t: T).(\forall (u: +T).(\forall (d: nat).((eq T (THead (Bind b) u (lift (S O) d t)) t) \to +(\forall (P: Prop).P))))) (\lambda (n: nat).(\lambda (u: T).(\lambda (d: +nat).(\lambda (H: (eq T (THead (Bind b) u (lift (S O) d (TSort n))) (TSort +n))).(\lambda (P: Prop).(let H0 \def (eq_ind T (THead (Bind b) u (lift (S O) +d (TSort n))) (\lambda (ee: T).(match ee in T return (\lambda (_: T).Prop) +with [(TSort _) \Rightarrow False | (TLRef _) \Rightarrow False | (THead _ _ +_) \Rightarrow True])) I (TSort n) H) in (False_ind P H0))))))) (\lambda (n: +nat).(\lambda (u: T).(\lambda (d: nat).(\lambda (H: (eq T (THead (Bind b) u +(lift (S O) d (TLRef n))) (TLRef n))).(\lambda (P: Prop).(let H0 \def (eq_ind +T (THead (Bind b) u (lift (S O) d (TLRef n))) (\lambda (ee: T).(match ee in T +return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) +\Rightarrow False | (THead _ _ _) \Rightarrow True])) I (TLRef n) H) in +(False_ind P H0))))))) (\lambda (k: K).(\lambda (t: T).(\lambda (_: ((\forall +(u: T).(\forall (d: nat).((eq T (THead (Bind b) u (lift (S O) d t)) t) \to +(\forall (P: Prop).P)))))).(\lambda (t0: T).(\lambda (H0: ((\forall (u: +T).(\forall (d: nat).((eq T (THead (Bind b) u (lift (S O) d t0)) t0) \to +(\forall (P: Prop).P)))))).(\lambda (u: T).(\lambda (d: nat).(\lambda (H1: +(eq T (THead (Bind b) u (lift (S O) d (THead k t t0))) (THead k t +t0))).(\lambda (P: Prop).(let H2 \def (f_equal T K (\lambda (e: T).(match e +in T return (\lambda (_: T).K) with [(TSort _) \Rightarrow (Bind b) | (TLRef +_) \Rightarrow (Bind b) | (THead k0 _ _) \Rightarrow k0])) (THead (Bind b) u +(lift (S O) d (THead k t t0))) (THead k t t0) H1) in ((let H3 \def (f_equal T +T (\lambda (e: T).(match e in T return (\lambda (_: T).T) with [(TSort _) +\Rightarrow u | (TLRef _) \Rightarrow u | (THead _ t1 _) \Rightarrow t1])) +(THead (Bind b) u (lift (S O) d (THead k t t0))) (THead k t t0) H1) in ((let +H4 \def (f_equal T T (\lambda (e: T).(match e in T return (\lambda (_: T).T) +with [(TSort _) \Rightarrow (THead k ((let rec lref_map (f: ((nat \to nat))) +(d0: nat) (t1: T) on t1: T \def (match t1 with [(TSort n) \Rightarrow (TSort +n) | (TLRef i) \Rightarrow (TLRef (match (blt i d0) with [true \Rightarrow i +| false \Rightarrow (f i)])) | (THead k0 u0 t2) \Rightarrow (THead k0 +(lref_map f d0 u0) (lref_map f (s k0 d0) t2))]) in lref_map) (\lambda (x0: +nat).(plus x0 (S O))) d t) ((let rec lref_map (f: ((nat \to nat))) (d0: nat) +(t1: T) on t1: T \def (match t1 with [(TSort n) \Rightarrow (TSort n) | +(TLRef i) \Rightarrow (TLRef (match (blt i d0) with [true \Rightarrow i | +false \Rightarrow (f i)])) | (THead k0 u0 t2) \Rightarrow (THead k0 (lref_map +f d0 u0) (lref_map f (s k0 d0) t2))]) in lref_map) (\lambda (x0: nat).(plus +x0 (S O))) (s k d) t0)) | (TLRef _) \Rightarrow (THead k ((let rec lref_map +(f: ((nat \to nat))) (d0: nat) (t1: T) on t1: T \def (match t1 with [(TSort +n) \Rightarrow (TSort n) | (TLRef i) \Rightarrow (TLRef (match (blt i d0) +with [true \Rightarrow i | false \Rightarrow (f i)])) | (THead k0 u0 t2) +\Rightarrow (THead k0 (lref_map f d0 u0) (lref_map f (s k0 d0) t2))]) in +lref_map) (\lambda (x0: nat).(plus x0 (S O))) d t) ((let rec lref_map (f: +((nat \to nat))) (d0: nat) (t1: T) on t1: T \def (match t1 with [(TSort n) +\Rightarrow (TSort n) | (TLRef i) \Rightarrow (TLRef (match (blt i d0) with +[true \Rightarrow i | false \Rightarrow (f i)])) | (THead k0 u0 t2) +\Rightarrow (THead k0 (lref_map f d0 u0) (lref_map f (s k0 d0) t2))]) in +lref_map) (\lambda (x0: nat).(plus x0 (S O))) (s k d) t0)) | (THead _ _ t1) +\Rightarrow t1])) (THead (Bind b) u (lift (S O) d (THead k t t0))) (THead k t +t0) H1) in (\lambda (_: (eq T u t)).(\lambda (H6: (eq K (Bind b) k)).(let H7 +\def (eq_ind_r K k (\lambda (k0: K).(eq T (lift (S O) d (THead k0 t t0)) t0)) +H4 (Bind b) H6) in (let H8 \def (eq_ind T (lift (S O) d (THead (Bind b) t +t0)) (\lambda (t1: T).(eq T t1 t0)) H7 (THead (Bind b) (lift (S O) d t) (lift +(S O) (S d) t0)) (lift_bind b t t0 (S O) d)) in (H0 (lift (S O) d t) (S d) H8 +P)))))) H3)) H2))))))))))) x)). + +theorem nf2_gen_abbr: + \forall (c: C).(\forall (u: T).(\forall (t: T).((nf2 c (THead (Bind Abbr) u +t)) \to (\forall (P: Prop).P)))) +\def + \lambda (c: C).(\lambda (u: T).(\lambda (t: T).(\lambda (H: ((\forall (t2: +T).((pr2 c (THead (Bind Abbr) u t) t2) \to (eq T (THead (Bind Abbr) u t) +t2))))).(\lambda (P: Prop).(let H_x \def (dnf_dec u t O) in (let H0 \def H_x +in (ex_ind T (\lambda (v: T).(or (subst0 O u t (lift (S O) O v)) (eq T t +(lift (S O) O v)))) P (\lambda (x: T).(\lambda (H1: (or (subst0 O u t (lift +(S O) O x)) (eq T t (lift (S O) O x)))).(or_ind (subst0 O u t (lift (S O) O +x)) (eq T t (lift (S O) O x)) P (\lambda (H2: (subst0 O u t (lift (S O) O +x))).(let H3 \def (f_equal T T (\lambda (e: T).(match e in T return (\lambda +(_: T).T) with [(TSort _) \Rightarrow t | (TLRef _) \Rightarrow t | (THead _ +_ t0) \Rightarrow t0])) (THead (Bind Abbr) u t) (THead (Bind Abbr) u (lift (S +O) O x)) (H (THead (Bind Abbr) u (lift (S O) O x)) (pr2_free c (THead (Bind +Abbr) u t) (THead (Bind Abbr) u (lift (S O) O x)) (pr0_delta u u (pr0_refl u) +t t (pr0_refl t) (lift (S O) O x) H2)))) in (let H4 \def (eq_ind T t (\lambda +(t0: T).(subst0 O u t0 (lift (S O) O x))) H2 (lift (S O) O x) H3) in +(subst0_refl u (lift (S O) O x) O H4 P)))) (\lambda (H2: (eq T t (lift (S O) +O x))).(let H3 \def (eq_ind T t (\lambda (t0: T).(\forall (t2: T).((pr2 c +(THead (Bind Abbr) u t0) t2) \to (eq T (THead (Bind Abbr) u t0) t2)))) H +(lift (S O) O x) H2) in (nf2_gen__aux Abbr x u O (H3 x (pr2_free c (THead +(Bind Abbr) u (lift (S O) O x)) x (pr0_zeta Abbr not_abbr_abst x x (pr0_refl +x) u))) P))) H1))) H0))))))). + +theorem nf2_gen_void: + \forall (c: C).(\forall (u: T).(\forall (t: T).((nf2 c (THead (Bind Void) u +(lift (S O) O t))) \to (\forall (P: Prop).P)))) +\def + \lambda (c: C).(\lambda (u: T).(\lambda (t: T).(\lambda (H: ((\forall (t2: +T).((pr2 c (THead (Bind Void) u (lift (S O) O t)) t2) \to (eq T (THead (Bind +Void) u (lift (S O) O t)) t2))))).(\lambda (P: Prop).(nf2_gen__aux Void t u O +(H t (pr2_free c (THead (Bind Void) u (lift (S O) O t)) t (pr0_zeta Void +not_void_abst t t (pr0_refl t) u))) P))))). + diff --git a/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/nf2/props.ma b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/nf2/props.ma index 5e056a423..08972e5e9 100644 --- a/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/nf2/props.ma +++ b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/nf2/props.ma @@ -48,6 +48,25 @@ x1))))).(eq_ind_r T (THead (Bind Abst) x0 x1) (\lambda (t0: T).(eq T (THead x1 (refl_equal K (Bind Abst)) (H x0 H4) (H0 x1 (H5 b v))) t2 H3)))))) H2)))))))))). +theorem nf2_abst_shift: + \forall (c: C).(\forall (u: T).((nf2 c u) \to (\forall (t: T).((nf2 (CHead c +(Bind Abst) u) t) \to (nf2 c (THead (Bind Abst) u t)))))) +\def + \lambda (c: C).(\lambda (u: T).(\lambda (H: ((\forall (t2: T).((pr2 c u t2) +\to (eq T u t2))))).(\lambda (t: T).(\lambda (H0: ((\forall (t2: T).((pr2 +(CHead c (Bind Abst) u) t t2) \to (eq T t t2))))).(\lambda (t2: T).(\lambda +(H1: (pr2 c (THead (Bind Abst) u t) t2)).(let H2 \def (pr2_gen_abst c u t t2 +H1) in (ex3_2_ind T T (\lambda (u2: T).(\lambda (t3: T).(eq T t2 (THead (Bind +Abst) u2 t3)))) (\lambda (u2: T).(\lambda (_: T).(pr2 c u u2))) (\lambda (_: +T).(\lambda (t3: T).(\forall (b: B).(\forall (u0: T).(pr2 (CHead c (Bind b) +u0) t t3))))) (eq T (THead (Bind Abst) u t) t2) (\lambda (x0: T).(\lambda +(x1: T).(\lambda (H3: (eq T t2 (THead (Bind Abst) x0 x1))).(\lambda (H4: (pr2 +c u x0)).(\lambda (H5: ((\forall (b: B).(\forall (u0: T).(pr2 (CHead c (Bind +b) u0) t x1))))).(eq_ind_r T (THead (Bind Abst) x0 x1) (\lambda (t0: T).(eq T +(THead (Bind Abst) u t) t0)) (f_equal3 K T T T THead (Bind Abst) (Bind Abst) +u x0 t x1 (refl_equal K (Bind Abst)) (H x0 H4) (H0 x1 (H5 Abst u))) t2 +H3)))))) H2)))))))). + theorem nf2_appl_lref: \forall (c: C).(\forall (u: T).((nf2 c u) \to (\forall (i: nat).((nf2 c (TLRef i)) \to (nf2 c (THead (Flat Appl) u (TLRef i))))))) diff --git a/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/pc3/fwd.ma b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/pc3/fwd.ma index cb4d66f03..701c00936 100644 --- a/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/pc3/fwd.ma +++ b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/pc3/fwd.ma @@ -277,3 +277,25 @@ T).(\lambda (t1: T).(\forall (b: B).(\forall (u: T).(pr3 (CHead c (Bind b) u) t2 (lift h (S d) t1)))))) x3 x4 H17 H16 H15))))))))) (lift_gen_bind Abst x1 x2 x0 h d H11)))))))) H7))))) H4))))) H1)))))))))). +theorem pc3_gen_sort_abst: + \forall (c: C).(\forall (u: T).(\forall (t: T).(\forall (n: nat).((pc3 c +(TSort n) (THead (Bind Abst) u t)) \to (\forall (P: Prop).P))))) +\def + \lambda (c: C).(\lambda (u: T).(\lambda (t: T).(\lambda (n: nat).(\lambda +(H: (pc3 c (TSort n) (THead (Bind Abst) u t))).(\lambda (P: Prop).(let H0 +\def H in (ex2_ind T (\lambda (t0: T).(pr3 c (TSort n) t0)) (\lambda (t0: +T).(pr3 c (THead (Bind Abst) u t) t0)) P (\lambda (x: T).(\lambda (H1: (pr3 c +(TSort n) x)).(\lambda (H2: (pr3 c (THead (Bind Abst) u t) x)).(let H3 \def +(pr3_gen_abst c u t x H2) in (ex3_2_ind T T (\lambda (u2: T).(\lambda (t2: +T).(eq T x (THead (Bind Abst) u2 t2)))) (\lambda (u2: T).(\lambda (_: T).(pr3 +c u u2))) (\lambda (_: T).(\lambda (t2: T).(\forall (b: B).(\forall (u0: +T).(pr3 (CHead c (Bind b) u0) t t2))))) P (\lambda (x0: T).(\lambda (x1: +T).(\lambda (H4: (eq T x (THead (Bind Abst) x0 x1))).(\lambda (_: (pr3 c u +x0)).(\lambda (_: ((\forall (b: B).(\forall (u0: T).(pr3 (CHead c (Bind b) +u0) t x1))))).(let H7 \def (eq_ind T x (\lambda (t0: T).(eq T t0 (TSort n))) +(pr3_gen_sort c x n H1) (THead (Bind Abst) x0 x1) H4) in (let H8 \def (eq_ind +T (THead (Bind Abst) x0 x1) (\lambda (ee: T).(match ee in T return (\lambda +(_: T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) \Rightarrow False +| (THead _ _ _) \Rightarrow True])) I (TSort n) H7) in (False_ind P +H8)))))))) H3))))) H0))))))). + diff --git a/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/spare.ma b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/spare.ma index 377501693..70b94347b 100644 --- a/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/spare.ma +++ b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/spare.ma @@ -18,806 +18,6 @@ set "baseuri" "cic:/matita/LAMBDA-TYPES/LambdaDelta-1/spare". include "theory.ma". -definition nfs2: - C \to (TList \to Prop) -\def - let rec nfs2 (c: C) (ts: TList) on ts: Prop \def (match ts with [TNil -\Rightarrow True | (TCons t ts0) \Rightarrow (land (nf2 c t) (nfs2 c ts0))]) -in nfs2. - -theorem nf2_gen_beta: - \forall (c: C).(\forall (u: T).(\forall (v: T).(\forall (t: T).((nf2 c -(THead (Flat Appl) u (THead (Bind Abst) v t))) \to (\forall (P: Prop).P))))) -\def - \lambda (c: C).(\lambda (u: T).(\lambda (v: T).(\lambda (t: T).(\lambda (H: -((\forall (t2: T).((pr2 c (THead (Flat Appl) u (THead (Bind Abst) v t)) t2) -\to (eq T (THead (Flat Appl) u (THead (Bind Abst) v t)) t2))))).(\lambda (P: -Prop).(let H0 \def (eq_ind T (THead (Flat Appl) u (THead (Bind Abst) v t)) -(\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 Abbr) u t) (H (THead (Bind -Abbr) u t) (pr2_free c (THead (Flat Appl) u (THead (Bind Abst) v t)) (THead -(Bind Abbr) u t) (pr0_beta v u u (pr0_refl u) t t (pr0_refl t))))) in -(False_ind P H0))))))). - -theorem nf2_gen__aux: - \forall (b: B).(\forall (x: T).(\forall (u: T).(\forall (d: nat).((eq T -(THead (Bind b) u (lift (S O) d x)) x) \to (\forall (P: Prop).P))))) -\def - \lambda (b: B).(\lambda (x: T).(T_ind (\lambda (t: T).(\forall (u: -T).(\forall (d: nat).((eq T (THead (Bind b) u (lift (S O) d t)) t) \to -(\forall (P: Prop).P))))) (\lambda (n: nat).(\lambda (u: T).(\lambda (d: -nat).(\lambda (H: (eq T (THead (Bind b) u (lift (S O) d (TSort n))) (TSort -n))).(\lambda (P: Prop).(let H0 \def (eq_ind T (THead (Bind b) u (lift (S O) -d (TSort n))) (\lambda (ee: T).(match ee in T return (\lambda (_: T).Prop) -with [(TSort _) \Rightarrow False | (TLRef _) \Rightarrow False | (THead _ _ -_) \Rightarrow True])) I (TSort n) H) in (False_ind P H0))))))) (\lambda (n: -nat).(\lambda (u: T).(\lambda (d: nat).(\lambda (H: (eq T (THead (Bind b) u -(lift (S O) d (TLRef n))) (TLRef n))).(\lambda (P: Prop).(let H0 \def (eq_ind -T (THead (Bind b) u (lift (S O) d (TLRef n))) (\lambda (ee: T).(match ee in T -return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) -\Rightarrow False | (THead _ _ _) \Rightarrow True])) I (TLRef n) H) in -(False_ind P H0))))))) (\lambda (k: K).(\lambda (t: T).(\lambda (_: ((\forall -(u: T).(\forall (d: nat).((eq T (THead (Bind b) u (lift (S O) d t)) t) \to -(\forall (P: Prop).P)))))).(\lambda (t0: T).(\lambda (H0: ((\forall (u: -T).(\forall (d: nat).((eq T (THead (Bind b) u (lift (S O) d t0)) t0) \to -(\forall (P: Prop).P)))))).(\lambda (u: T).(\lambda (d: nat).(\lambda (H1: -(eq T (THead (Bind b) u (lift (S O) d (THead k t t0))) (THead k t -t0))).(\lambda (P: Prop).(let H2 \def (f_equal T K (\lambda (e: T).(match e -in T return (\lambda (_: T).K) with [(TSort _) \Rightarrow (Bind b) | (TLRef -_) \Rightarrow (Bind b) | (THead k0 _ _) \Rightarrow k0])) (THead (Bind b) u -(lift (S O) d (THead k t t0))) (THead k t t0) H1) in ((let H3 \def (f_equal T -T (\lambda (e: T).(match e in T return (\lambda (_: T).T) with [(TSort _) -\Rightarrow u | (TLRef _) \Rightarrow u | (THead _ t1 _) \Rightarrow t1])) -(THead (Bind b) u (lift (S O) d (THead k t t0))) (THead k t t0) H1) in ((let -H4 \def (f_equal T T (\lambda (e: T).(match e in T return (\lambda (_: T).T) -with [(TSort _) \Rightarrow (THead k ((let rec lref_map (f: ((nat \to nat))) -(d0: nat) (t1: T) on t1: T \def (match t1 with [(TSort n) \Rightarrow (TSort -n) | (TLRef i) \Rightarrow (TLRef (match (blt i d0) with [true \Rightarrow i -| false \Rightarrow (f i)])) | (THead k0 u0 t2) \Rightarrow (THead k0 -(lref_map f d0 u0) (lref_map f (s k0 d0) t2))]) in lref_map) (\lambda (x0: -nat).(plus x0 (S O))) d t) ((let rec lref_map (f: ((nat \to nat))) (d0: nat) -(t1: T) on t1: T \def (match t1 with [(TSort n) \Rightarrow (TSort n) | -(TLRef i) \Rightarrow (TLRef (match (blt i d0) with [true \Rightarrow i | -false \Rightarrow (f i)])) | (THead k0 u0 t2) \Rightarrow (THead k0 (lref_map -f d0 u0) (lref_map f (s k0 d0) t2))]) in lref_map) (\lambda (x0: nat).(plus -x0 (S O))) (s k d) t0)) | (TLRef _) \Rightarrow (THead k ((let rec lref_map -(f: ((nat \to nat))) (d0: nat) (t1: T) on t1: T \def (match t1 with [(TSort -n) \Rightarrow (TSort n) | (TLRef i) \Rightarrow (TLRef (match (blt i d0) -with [true \Rightarrow i | false \Rightarrow (f i)])) | (THead k0 u0 t2) -\Rightarrow (THead k0 (lref_map f d0 u0) (lref_map f (s k0 d0) t2))]) in -lref_map) (\lambda (x0: nat).(plus x0 (S O))) d t) ((let rec lref_map (f: -((nat \to nat))) (d0: nat) (t1: T) on t1: T \def (match t1 with [(TSort n) -\Rightarrow (TSort n) | (TLRef i) \Rightarrow (TLRef (match (blt i d0) with -[true \Rightarrow i | false \Rightarrow (f i)])) | (THead k0 u0 t2) -\Rightarrow (THead k0 (lref_map f d0 u0) (lref_map f (s k0 d0) t2))]) in -lref_map) (\lambda (x0: nat).(plus x0 (S O))) (s k d) t0)) | (THead _ _ t1) -\Rightarrow t1])) (THead (Bind b) u (lift (S O) d (THead k t t0))) (THead k t -t0) H1) in (\lambda (_: (eq T u t)).(\lambda (H6: (eq K (Bind b) k)).(let H7 -\def (eq_ind_r K k (\lambda (k0: K).(eq T (lift (S O) d (THead k0 t t0)) t0)) -H4 (Bind b) H6) in (let H8 \def (eq_ind T (lift (S O) d (THead (Bind b) t -t0)) (\lambda (t1: T).(eq T t1 t0)) H7 (THead (Bind b) (lift (S O) d t) (lift -(S O) (S d) t0)) (lift_bind b t t0 (S O) d)) in (H0 (lift (S O) d t) (S d) H8 -P)))))) H3)) H2))))))))))) x)). - -theorem nf2_gen_abbr: - \forall (c: C).(\forall (u: T).(\forall (t: T).((nf2 c (THead (Bind Abbr) u -t)) \to (\forall (P: Prop).P)))) -\def - \lambda (c: C).(\lambda (u: T).(\lambda (t: T).(\lambda (H: ((\forall (t2: -T).((pr2 c (THead (Bind Abbr) u t) t2) \to (eq T (THead (Bind Abbr) u t) -t2))))).(\lambda (P: Prop).(let H_x \def (dnf_dec u t O) in (let H0 \def H_x -in (ex_ind T (\lambda (v: T).(or (subst0 O u t (lift (S O) O v)) (eq T t -(lift (S O) O v)))) P (\lambda (x: T).(\lambda (H1: (or (subst0 O u t (lift -(S O) O x)) (eq T t (lift (S O) O x)))).(or_ind (subst0 O u t (lift (S O) O -x)) (eq T t (lift (S O) O x)) P (\lambda (H2: (subst0 O u t (lift (S O) O -x))).(let H3 \def (f_equal T T (\lambda (e: T).(match e in T return (\lambda -(_: T).T) with [(TSort _) \Rightarrow t | (TLRef _) \Rightarrow t | (THead _ -_ t0) \Rightarrow t0])) (THead (Bind Abbr) u t) (THead (Bind Abbr) u (lift (S -O) O x)) (H (THead (Bind Abbr) u (lift (S O) O x)) (pr2_free c (THead (Bind -Abbr) u t) (THead (Bind Abbr) u (lift (S O) O x)) (pr0_delta u u (pr0_refl u) -t t (pr0_refl t) (lift (S O) O x) H2)))) in (let H4 \def (eq_ind T t (\lambda -(t0: T).(subst0 O u t0 (lift (S O) O x))) H2 (lift (S O) O x) H3) in -(subst0_refl u (lift (S O) O x) O H4 P)))) (\lambda (H2: (eq T t (lift (S O) -O x))).(let H3 \def (eq_ind T t (\lambda (t0: T).(\forall (t2: T).((pr2 c -(THead (Bind Abbr) u t0) t2) \to (eq T (THead (Bind Abbr) u t0) t2)))) H -(lift (S O) O x) H2) in (nf2_gen__aux Abbr x u O (H3 x (pr2_free c (THead -(Bind Abbr) u (lift (S O) O x)) x (pr0_zeta Abbr not_abbr_abst x x (pr0_refl -x) u))) P))) H1))) H0))))))). - -theorem nf2_gen_void: - \forall (c: C).(\forall (u: T).(\forall (t: T).((nf2 c (THead (Bind Void) u -(lift (S O) O t))) \to (\forall (P: Prop).P)))) -\def - \lambda (c: C).(\lambda (u: T).(\lambda (t: T).(\lambda (H: ((\forall (t2: -T).((pr2 c (THead (Bind Void) u (lift (S O) O t)) t2) \to (eq T (THead (Bind -Void) u (lift (S O) O t)) t2))))).(\lambda (P: Prop).(nf2_gen__aux Void t u O -(H t (pr2_free c (THead (Bind Void) u (lift (S O) O t)) t (pr0_zeta Void -not_void_abst t t (pr0_refl t) u))) P))))). - -theorem arity_nf2_inv_all: - \forall (g: G).(\forall (c: C).(\forall (t: T).(\forall (a: A).((arity g c t -a) \to ((nf2 c t) \to (or3 (ex3_2 T T (\lambda (w: T).(\lambda (u: T).(eq T t -(THead (Bind Abst) w u)))) (\lambda (w: T).(\lambda (_: T).(nf2 c w))) -(\lambda (w: T).(\lambda (u: T).(nf2 (CHead c (Bind Abst) w) u)))) (ex nat -(\lambda (n: nat).(eq T t (TSort n)))) (ex3_4 TList nat C T (\lambda (ws: -TList).(\lambda (i: nat).(\lambda (_: C).(\lambda (_: T).(eq T t (THeads -(Flat Appl) ws (TLRef i))))))) (\lambda (_: TList).(\lambda (i: nat).(\lambda -(d: C).(\lambda (v: T).(getl i c (CHead d (Bind Abst) v)))))) (\lambda (ws: -TList).(\lambda (_: nat).(\lambda (_: C).(\lambda (_: T).(nfs2 c -ws)))))))))))) -\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).((nf2 c0 t0) \to (or3 (ex3_2 T T (\lambda (w: T).(\lambda (u: T).(eq T t0 -(THead (Bind Abst) w u)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) -(\lambda (w: T).(\lambda (u: T).(nf2 (CHead c0 (Bind Abst) w) u)))) (ex nat -(\lambda (n: nat).(eq T t0 (TSort n)))) (ex3_4 TList nat C T (\lambda (ws: -TList).(\lambda (i: nat).(\lambda (_: C).(\lambda (_: T).(eq T t0 (THeads -(Flat Appl) ws (TLRef i))))))) (\lambda (_: TList).(\lambda (i: nat).(\lambda -(d: C).(\lambda (v: T).(getl i c0 (CHead d (Bind Abst) v)))))) (\lambda (ws: -TList).(\lambda (_: nat).(\lambda (_: C).(\lambda (_: T).(nfs2 c0 -ws))))))))))) (\lambda (c0: C).(\lambda (n: nat).(\lambda (_: (nf2 c0 (TSort -n))).(or3_intro1 (ex3_2 T T (\lambda (w: T).(\lambda (u: T).(eq T (TSort n) -(THead (Bind Abst) w u)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) -(\lambda (w: T).(\lambda (u: T).(nf2 (CHead c0 (Bind Abst) w) u)))) (ex nat -(\lambda (n0: nat).(eq T (TSort n) (TSort n0)))) (ex3_4 TList nat C T -(\lambda (ws: TList).(\lambda (i: nat).(\lambda (_: C).(\lambda (_: T).(eq T -(TSort n) (THeads (Flat Appl) ws (TLRef i))))))) (\lambda (_: TList).(\lambda -(i: nat).(\lambda (d: C).(\lambda (v: T).(getl i c0 (CHead d (Bind Abst) -v)))))) (\lambda (ws: TList).(\lambda (_: nat).(\lambda (_: C).(\lambda (_: -T).(nfs2 c0 ws)))))) (ex_intro nat (\lambda (n0: nat).(eq T (TSort n) (TSort -n0))) n (refl_equal T (TSort n))))))) (\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 (_: -(((nf2 d u) \to (or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T u -(THead (Bind Abst) w u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 d w))) -(\lambda (w: T).(\lambda (u0: T).(nf2 (CHead d (Bind Abst) w) u0)))) (ex nat -(\lambda (n: nat).(eq T u (TSort n)))) (ex3_4 TList nat C T (\lambda (ws: -TList).(\lambda (i0: nat).(\lambda (_: C).(\lambda (_: T).(eq T u (THeads -(Flat Appl) ws (TLRef i0))))))) (\lambda (_: TList).(\lambda (i0: -nat).(\lambda (d0: C).(\lambda (v: T).(getl i0 d (CHead d0 (Bind Abst) -v)))))) (\lambda (ws: TList).(\lambda (_: nat).(\lambda (_: C).(\lambda (_: -T).(nfs2 d ws)))))))))).(\lambda (H3: (nf2 c0 (TLRef i))).(nf2_gen_lref c0 d -u i H0 H3 (or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T (TLRef i) -(THead (Bind Abst) w u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) -(\lambda (w: T).(\lambda (u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) (ex nat -(\lambda (n: nat).(eq T (TLRef i) (TSort n)))) (ex3_4 TList nat C T (\lambda -(ws: TList).(\lambda (i0: nat).(\lambda (_: C).(\lambda (_: T).(eq T (TLRef -i) (THeads (Flat Appl) ws (TLRef i0))))))) (\lambda (_: TList).(\lambda (i0: -nat).(\lambda (d0: C).(\lambda (v: T).(getl i0 c0 (CHead d0 (Bind Abst) -v)))))) (\lambda (ws: TList).(\lambda (_: nat).(\lambda (_: C).(\lambda (_: -T).(nfs2 c0 ws))))))))))))))))) (\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 (_: -(((nf2 d u) \to (or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T u -(THead (Bind Abst) w u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 d w))) -(\lambda (w: T).(\lambda (u0: T).(nf2 (CHead d (Bind Abst) w) u0)))) (ex nat -(\lambda (n: nat).(eq T u (TSort n)))) (ex3_4 TList nat C T (\lambda (ws: -TList).(\lambda (i0: nat).(\lambda (_: C).(\lambda (_: T).(eq T u (THeads -(Flat Appl) ws (TLRef i0))))))) (\lambda (_: TList).(\lambda (i0: -nat).(\lambda (d0: C).(\lambda (v: T).(getl i0 d (CHead d0 (Bind Abst) -v)))))) (\lambda (ws: TList).(\lambda (_: nat).(\lambda (_: C).(\lambda (_: -T).(nfs2 d ws)))))))))).(\lambda (_: (nf2 c0 (TLRef i))).(or3_intro2 (ex3_2 T -T (\lambda (w: T).(\lambda (u0: T).(eq T (TLRef i) (THead (Bind Abst) w -u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda -(u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: nat).(eq T -(TLRef i) (TSort n)))) (ex3_4 TList nat C T (\lambda (ws: TList).(\lambda -(i0: nat).(\lambda (_: C).(\lambda (_: T).(eq T (TLRef i) (THeads (Flat Appl) -ws (TLRef i0))))))) (\lambda (_: TList).(\lambda (i0: nat).(\lambda (d0: -C).(\lambda (v: T).(getl i0 c0 (CHead d0 (Bind Abst) v)))))) (\lambda (ws: -TList).(\lambda (_: nat).(\lambda (_: C).(\lambda (_: T).(nfs2 c0 ws)))))) -(ex3_4_intro TList nat C T (\lambda (ws: TList).(\lambda (i0: nat).(\lambda -(_: C).(\lambda (_: T).(eq T (TLRef i) (THeads (Flat Appl) ws (TLRef -i0))))))) (\lambda (_: TList).(\lambda (i0: nat).(\lambda (d0: C).(\lambda -(v: T).(getl i0 c0 (CHead d0 (Bind Abst) v)))))) (\lambda (ws: -TList).(\lambda (_: nat).(\lambda (_: C).(\lambda (_: T).(nfs2 c0 ws))))) -TNil i d u (refl_equal T (TLRef i)) H0 I))))))))))) (\lambda (b: B).(\lambda -(H0: (not (eq B b Abst))).(\lambda (c0: C).(\lambda (u: T).(\lambda (a1: -A).(\lambda (_: (arity g c0 u a1)).(\lambda (_: (((nf2 c0 u) \to (or3 (ex3_2 -T T (\lambda (w: T).(\lambda (u0: T).(eq T u (THead (Bind Abst) w u0)))) -(\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u0: -T).(nf2 (CHead c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: nat).(eq T u -(TSort n)))) (ex3_4 TList nat C T (\lambda (ws: TList).(\lambda (i: -nat).(\lambda (_: C).(\lambda (_: T).(eq T u (THeads (Flat Appl) ws (TLRef -i))))))) (\lambda (_: TList).(\lambda (i: nat).(\lambda (d: C).(\lambda (v: -T).(getl i c0 (CHead d (Bind Abst) v)))))) (\lambda (ws: TList).(\lambda (_: -nat).(\lambda (_: C).(\lambda (_: T).(nfs2 c0 ws)))))))))).(\lambda (t0: -T).(\lambda (a2: A).(\lambda (H3: (arity g (CHead c0 (Bind b) u) t0 -a2)).(\lambda (_: (((nf2 (CHead c0 (Bind b) u) t0) \to (or3 (ex3_2 T T -(\lambda (w: T).(\lambda (u0: T).(eq T t0 (THead (Bind Abst) w u0)))) -(\lambda (w: T).(\lambda (_: T).(nf2 (CHead c0 (Bind b) u) w))) (\lambda (w: -T).(\lambda (u0: T).(nf2 (CHead (CHead c0 (Bind b) u) (Bind Abst) w) u0)))) -(ex nat (\lambda (n: nat).(eq T t0 (TSort n)))) (ex3_4 TList nat C T (\lambda -(ws: TList).(\lambda (i: nat).(\lambda (_: C).(\lambda (_: T).(eq T t0 -(THeads (Flat Appl) ws (TLRef i))))))) (\lambda (_: TList).(\lambda (i: -nat).(\lambda (d: C).(\lambda (v: T).(getl i (CHead c0 (Bind b) u) (CHead d -(Bind Abst) v)))))) (\lambda (ws: TList).(\lambda (_: nat).(\lambda (_: -C).(\lambda (_: T).(nfs2 (CHead c0 (Bind b) u) ws)))))))))).(\lambda (H5: -(nf2 c0 (THead (Bind b) u t0))).(B_ind (\lambda (b0: B).((not (eq B b0 Abst)) -\to ((arity g (CHead c0 (Bind b0) u) t0 a2) \to ((nf2 c0 (THead (Bind b0) u -t0)) \to (or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T (THead (Bind -b0) u t0) (THead (Bind Abst) w u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 -w))) (\lambda (w: T).(\lambda (u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) -(ex nat (\lambda (n: nat).(eq T (THead (Bind b0) u t0) (TSort n)))) (ex3_4 -TList nat C T (\lambda (ws: TList).(\lambda (i: nat).(\lambda (_: C).(\lambda -(_: T).(eq T (THead (Bind b0) u t0) (THeads (Flat Appl) ws (TLRef i))))))) -(\lambda (_: TList).(\lambda (i: nat).(\lambda (d: C).(\lambda (v: T).(getl i -c0 (CHead d (Bind Abst) v)))))) (\lambda (ws: TList).(\lambda (_: -nat).(\lambda (_: C).(\lambda (_: T).(nfs2 c0 ws))))))))))) (\lambda (_: (not -(eq B Abbr Abst))).(\lambda (_: (arity g (CHead c0 (Bind Abbr) u) t0 -a2)).(\lambda (H8: (nf2 c0 (THead (Bind Abbr) u t0))).(nf2_gen_abbr c0 u t0 -H8 (or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T (THead (Bind Abbr) -u t0) (THead (Bind Abst) w u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 -w))) (\lambda (w: T).(\lambda (u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) -(ex nat (\lambda (n: nat).(eq T (THead (Bind Abbr) u t0) (TSort n)))) (ex3_4 -TList nat C T (\lambda (ws: TList).(\lambda (i: nat).(\lambda (_: C).(\lambda -(_: T).(eq T (THead (Bind Abbr) u t0) (THeads (Flat Appl) ws (TLRef i))))))) -(\lambda (_: TList).(\lambda (i: nat).(\lambda (d: C).(\lambda (v: T).(getl i -c0 (CHead d (Bind Abst) v)))))) (\lambda (ws: TList).(\lambda (_: -nat).(\lambda (_: C).(\lambda (_: T).(nfs2 c0 ws))))))))))) (\lambda (H6: -(not (eq B Abst Abst))).(\lambda (_: (arity g (CHead c0 (Bind Abst) u) t0 -a2)).(\lambda (_: (nf2 c0 (THead (Bind Abst) u t0))).(let H9 \def (match (H6 -(refl_equal B Abst)) in False return (\lambda (_: False).(or3 (ex3_2 T T -(\lambda (w: T).(\lambda (u0: T).(eq T (THead (Bind Abst) u t0) (THead (Bind -Abst) w u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: -T).(\lambda (u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: -nat).(eq T (THead (Bind Abst) u t0) (TSort n)))) (ex3_4 TList nat C T -(\lambda (ws: TList).(\lambda (i: nat).(\lambda (_: C).(\lambda (_: T).(eq T -(THead (Bind Abst) u t0) (THeads (Flat Appl) ws (TLRef i))))))) (\lambda (_: -TList).(\lambda (i: nat).(\lambda (d: C).(\lambda (v: T).(getl i c0 (CHead d -(Bind Abst) v)))))) (\lambda (ws: TList).(\lambda (_: nat).(\lambda (_: -C).(\lambda (_: T).(nfs2 c0 ws)))))))) with []) in H9)))) (\lambda (_: (not -(eq B Void Abst))).(\lambda (H7: (arity g (CHead c0 (Bind Void) u) t0 -a2)).(\lambda (H8: (nf2 c0 (THead (Bind Void) u t0))).(let H9 \def -(arity_gen_cvoid g (CHead c0 (Bind Void) u) t0 a2 H7 c0 u O (getl_refl Void -c0 u)) in (ex_ind T (\lambda (v: T).(eq T t0 (lift (S O) O v))) (or3 (ex3_2 T -T (\lambda (w: T).(\lambda (u0: T).(eq T (THead (Bind Void) u t0) (THead -(Bind Abst) w u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda -(w: T).(\lambda (u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) (ex nat (\lambda -(n: nat).(eq T (THead (Bind Void) u t0) (TSort n)))) (ex3_4 TList nat C T -(\lambda (ws: TList).(\lambda (i: nat).(\lambda (_: C).(\lambda (_: T).(eq T -(THead (Bind Void) u t0) (THeads (Flat Appl) ws (TLRef i))))))) (\lambda (_: -TList).(\lambda (i: nat).(\lambda (d: C).(\lambda (v: T).(getl i c0 (CHead d -(Bind Abst) v)))))) (\lambda (ws: TList).(\lambda (_: nat).(\lambda (_: -C).(\lambda (_: T).(nfs2 c0 ws))))))) (\lambda (x: T).(\lambda (H10: (eq T t0 -(lift (S O) O x))).(let H11 \def (eq_ind T t0 (\lambda (t1: T).(nf2 c0 (THead -(Bind Void) u t1))) H8 (lift (S O) O x) H10) in (eq_ind_r T (lift (S O) O x) -(\lambda (t1: T).(or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T -(THead (Bind Void) u t1) (THead (Bind Abst) w u0)))) (\lambda (w: T).(\lambda -(_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u0: T).(nf2 (CHead c0 (Bind -Abst) w) u0)))) (ex nat (\lambda (n: nat).(eq T (THead (Bind Void) u t1) -(TSort n)))) (ex3_4 TList nat C T (\lambda (ws: TList).(\lambda (i: -nat).(\lambda (_: C).(\lambda (_: T).(eq T (THead (Bind Void) u t1) (THeads -(Flat Appl) ws (TLRef i))))))) (\lambda (_: TList).(\lambda (i: nat).(\lambda -(d: C).(\lambda (v: T).(getl i c0 (CHead d (Bind Abst) v)))))) (\lambda (ws: -TList).(\lambda (_: nat).(\lambda (_: C).(\lambda (_: T).(nfs2 c0 ws)))))))) -(nf2_gen_void c0 u x H11 (or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq -T (THead (Bind Void) u (lift (S O) O x)) (THead (Bind Abst) w u0)))) (\lambda -(w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u0: T).(nf2 -(CHead c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: nat).(eq T (THead (Bind -Void) u (lift (S O) O x)) (TSort n)))) (ex3_4 TList nat C T (\lambda (ws: -TList).(\lambda (i: nat).(\lambda (_: C).(\lambda (_: T).(eq T (THead (Bind -Void) u (lift (S O) O x)) (THeads (Flat Appl) ws (TLRef i))))))) (\lambda (_: -TList).(\lambda (i: nat).(\lambda (d: C).(\lambda (v: T).(getl i c0 (CHead d -(Bind Abst) v)))))) (\lambda (ws: TList).(\lambda (_: nat).(\lambda (_: -C).(\lambda (_: T).(nfs2 c0 ws)))))))) t0 H10)))) H9))))) b H0 H3 -H5))))))))))))) (\lambda (c0: C).(\lambda (u: T).(\lambda (a1: A).(\lambda -(_: (arity g c0 u (asucc g a1))).(\lambda (_: (((nf2 c0 u) \to (or3 (ex3_2 T -T (\lambda (w: T).(\lambda (u0: T).(eq T u (THead (Bind Abst) w u0)))) -(\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u0: -T).(nf2 (CHead c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: nat).(eq T u -(TSort n)))) (ex3_4 TList nat C T (\lambda (ws: TList).(\lambda (i: -nat).(\lambda (_: C).(\lambda (_: T).(eq T u (THeads (Flat Appl) ws (TLRef -i))))))) (\lambda (_: TList).(\lambda (i: nat).(\lambda (d: C).(\lambda (v: -T).(getl i c0 (CHead d (Bind Abst) v)))))) (\lambda (ws: TList).(\lambda (_: -nat).(\lambda (_: C).(\lambda (_: T).(nfs2 c0 ws)))))))))).(\lambda (t0: -T).(\lambda (a2: A).(\lambda (_: (arity g (CHead c0 (Bind Abst) u) t0 -a2)).(\lambda (_: (((nf2 (CHead c0 (Bind Abst) u) t0) \to (or3 (ex3_2 T T -(\lambda (w: T).(\lambda (u0: T).(eq T t0 (THead (Bind Abst) w u0)))) -(\lambda (w: T).(\lambda (_: T).(nf2 (CHead c0 (Bind Abst) u) w))) (\lambda -(w: T).(\lambda (u0: T).(nf2 (CHead (CHead c0 (Bind Abst) u) (Bind Abst) w) -u0)))) (ex nat (\lambda (n: nat).(eq T t0 (TSort n)))) (ex3_4 TList nat C T -(\lambda (ws: TList).(\lambda (i: nat).(\lambda (_: C).(\lambda (_: T).(eq T -t0 (THeads (Flat Appl) ws (TLRef i))))))) (\lambda (_: TList).(\lambda (i: -nat).(\lambda (d: C).(\lambda (v: T).(getl i (CHead c0 (Bind Abst) u) (CHead -d (Bind Abst) v)))))) (\lambda (ws: TList).(\lambda (_: nat).(\lambda (_: -C).(\lambda (_: T).(nfs2 (CHead c0 (Bind Abst) u) ws)))))))))).(\lambda (H4: -(nf2 c0 (THead (Bind Abst) u t0))).(let H5 \def (nf2_gen_abst c0 u t0 H4) in -(and_ind (nf2 c0 u) (nf2 (CHead c0 (Bind Abst) u) t0) (or3 (ex3_2 T T -(\lambda (w: T).(\lambda (u0: T).(eq T (THead (Bind Abst) u t0) (THead (Bind -Abst) w u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: -T).(\lambda (u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: -nat).(eq T (THead (Bind Abst) u t0) (TSort n)))) (ex3_4 TList nat C T -(\lambda (ws: TList).(\lambda (i: nat).(\lambda (_: C).(\lambda (_: T).(eq T -(THead (Bind Abst) u t0) (THeads (Flat Appl) ws (TLRef i))))))) (\lambda (_: -TList).(\lambda (i: nat).(\lambda (d: C).(\lambda (v: T).(getl i c0 (CHead d -(Bind Abst) v)))))) (\lambda (ws: TList).(\lambda (_: nat).(\lambda (_: -C).(\lambda (_: T).(nfs2 c0 ws))))))) (\lambda (H6: (nf2 c0 u)).(\lambda (H7: -(nf2 (CHead c0 (Bind Abst) u) t0)).(or3_intro0 (ex3_2 T T (\lambda (w: -T).(\lambda (u0: T).(eq T (THead (Bind Abst) u t0) (THead (Bind Abst) w -u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda -(u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: nat).(eq T -(THead (Bind Abst) u t0) (TSort n)))) (ex3_4 TList nat C T (\lambda (ws: -TList).(\lambda (i: nat).(\lambda (_: C).(\lambda (_: T).(eq T (THead (Bind -Abst) u t0) (THeads (Flat Appl) ws (TLRef i))))))) (\lambda (_: -TList).(\lambda (i: nat).(\lambda (d: C).(\lambda (v: T).(getl i c0 (CHead d -(Bind Abst) v)))))) (\lambda (ws: TList).(\lambda (_: nat).(\lambda (_: -C).(\lambda (_: T).(nfs2 c0 ws)))))) (ex3_2_intro T T (\lambda (w: -T).(\lambda (u0: T).(eq T (THead (Bind Abst) u t0) (THead (Bind Abst) w -u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda -(u0: T).(nf2 (CHead c0 (Bind Abst) w) u0))) u t0 (refl_equal T (THead (Bind -Abst) u t0)) H6 H7)))) H5)))))))))))) (\lambda (c0: C).(\lambda (u: -T).(\lambda (a1: A).(\lambda (_: (arity g c0 u a1)).(\lambda (_: (((nf2 c0 u) -\to (or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T u (THead (Bind -Abst) w u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: -T).(\lambda (u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: -nat).(eq T u (TSort n)))) (ex3_4 TList nat C T (\lambda (ws: TList).(\lambda -(i: nat).(\lambda (_: C).(\lambda (_: T).(eq T u (THeads (Flat Appl) ws -(TLRef i))))))) (\lambda (_: TList).(\lambda (i: nat).(\lambda (d: -C).(\lambda (v: T).(getl i c0 (CHead d (Bind Abst) v)))))) (\lambda (ws: -TList).(\lambda (_: nat).(\lambda (_: C).(\lambda (_: T).(nfs2 c0 -ws)))))))))).(\lambda (t0: T).(\lambda (a2: A).(\lambda (H2: (arity g c0 t0 -(AHead a1 a2))).(\lambda (H3: (((nf2 c0 t0) \to (or3 (ex3_2 T T (\lambda (w: -T).(\lambda (u0: T).(eq T t0 (THead (Bind Abst) w u0)))) (\lambda (w: -T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u0: T).(nf2 (CHead -c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: nat).(eq T t0 (TSort n)))) -(ex3_4 TList nat C T (\lambda (ws: TList).(\lambda (i: nat).(\lambda (_: -C).(\lambda (_: T).(eq T t0 (THeads (Flat Appl) ws (TLRef i))))))) (\lambda -(_: TList).(\lambda (i: nat).(\lambda (d: C).(\lambda (v: T).(getl i c0 -(CHead d (Bind Abst) v)))))) (\lambda (ws: TList).(\lambda (_: nat).(\lambda -(_: C).(\lambda (_: T).(nfs2 c0 ws)))))))))).(\lambda (H4: (nf2 c0 (THead -(Flat Appl) u t0))).(let H5 \def (nf2_gen_flat Appl c0 u t0 H4) in (and_ind -(nf2 c0 u) (nf2 c0 t0) (or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T -(THead (Flat Appl) u t0) (THead (Bind Abst) w u0)))) (\lambda (w: T).(\lambda -(_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u0: T).(nf2 (CHead c0 (Bind -Abst) w) u0)))) (ex nat (\lambda (n: nat).(eq T (THead (Flat Appl) u t0) -(TSort n)))) (ex3_4 TList nat C T (\lambda (ws: TList).(\lambda (i: -nat).(\lambda (_: C).(\lambda (_: T).(eq T (THead (Flat Appl) u t0) (THeads -(Flat Appl) ws (TLRef i))))))) (\lambda (_: TList).(\lambda (i: nat).(\lambda -(d: C).(\lambda (v: T).(getl i c0 (CHead d (Bind Abst) v)))))) (\lambda (ws: -TList).(\lambda (_: nat).(\lambda (_: C).(\lambda (_: T).(nfs2 c0 ws))))))) -(\lambda (H6: (nf2 c0 u)).(\lambda (H7: (nf2 c0 t0)).(let H_x \def (H3 H7) in -(let H8 \def H_x in (or3_ind (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq -T t0 (THead (Bind Abst) w u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) -(\lambda (w: T).(\lambda (u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) (ex nat -(\lambda (n: nat).(eq T t0 (TSort n)))) (ex3_4 TList nat C T (\lambda (ws: -TList).(\lambda (i: nat).(\lambda (_: C).(\lambda (_: T).(eq T t0 (THeads -(Flat Appl) ws (TLRef i))))))) (\lambda (_: TList).(\lambda (i: nat).(\lambda -(d: C).(\lambda (v: T).(getl i c0 (CHead d (Bind Abst) v)))))) (\lambda (ws: -TList).(\lambda (_: nat).(\lambda (_: C).(\lambda (_: T).(nfs2 c0 ws)))))) -(or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T (THead (Flat Appl) u -t0) (THead (Bind Abst) w u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) -(\lambda (w: T).(\lambda (u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) (ex nat -(\lambda (n: nat).(eq T (THead (Flat Appl) u t0) (TSort n)))) (ex3_4 TList -nat C T (\lambda (ws: TList).(\lambda (i: nat).(\lambda (_: C).(\lambda (_: -T).(eq T (THead (Flat Appl) u t0) (THeads (Flat Appl) ws (TLRef i))))))) -(\lambda (_: TList).(\lambda (i: nat).(\lambda (d: C).(\lambda (v: T).(getl i -c0 (CHead d (Bind Abst) v)))))) (\lambda (ws: TList).(\lambda (_: -nat).(\lambda (_: C).(\lambda (_: T).(nfs2 c0 ws))))))) (\lambda (H9: (ex3_2 -T T (\lambda (w: T).(\lambda (u0: T).(eq T t0 (THead (Bind Abst) w u0)))) -(\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u0: -T).(nf2 (CHead c0 (Bind Abst) w) u0))))).(ex3_2_ind T T (\lambda (w: -T).(\lambda (u0: T).(eq T t0 (THead (Bind Abst) w u0)))) (\lambda (w: -T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u0: T).(nf2 (CHead -c0 (Bind Abst) w) u0))) (or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq -T (THead (Flat Appl) u t0) (THead (Bind Abst) w u0)))) (\lambda (w: -T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u0: T).(nf2 (CHead -c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: nat).(eq T (THead (Flat Appl) u -t0) (TSort n)))) (ex3_4 TList nat C T (\lambda (ws: TList).(\lambda (i: -nat).(\lambda (_: C).(\lambda (_: T).(eq T (THead (Flat Appl) u t0) (THeads -(Flat Appl) ws (TLRef i))))))) (\lambda (_: TList).(\lambda (i: nat).(\lambda -(d: C).(\lambda (v: T).(getl i c0 (CHead d (Bind Abst) v)))))) (\lambda (ws: -TList).(\lambda (_: nat).(\lambda (_: C).(\lambda (_: T).(nfs2 c0 ws))))))) -(\lambda (x0: T).(\lambda (x1: T).(\lambda (H10: (eq T t0 (THead (Bind Abst) -x0 x1))).(\lambda (_: (nf2 c0 x0)).(\lambda (_: (nf2 (CHead c0 (Bind Abst) -x0) x1)).(let H13 \def (eq_ind T t0 (\lambda (t1: T).(nf2 c0 (THead (Flat -Appl) u t1))) H4 (THead (Bind Abst) x0 x1) H10) in (let H14 \def (eq_ind T t0 -(\lambda (t1: T).(arity g c0 t1 (AHead a1 a2))) H2 (THead (Bind Abst) x0 x1) -H10) in (eq_ind_r T (THead (Bind Abst) x0 x1) (\lambda (t1: T).(or3 (ex3_2 T -T (\lambda (w: T).(\lambda (u0: T).(eq T (THead (Flat Appl) u t1) (THead -(Bind Abst) w u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda -(w: T).(\lambda (u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) (ex nat (\lambda -(n: nat).(eq T (THead (Flat Appl) u t1) (TSort n)))) (ex3_4 TList nat C T -(\lambda (ws: TList).(\lambda (i: nat).(\lambda (_: C).(\lambda (_: T).(eq T -(THead (Flat Appl) u t1) (THeads (Flat Appl) ws (TLRef i))))))) (\lambda (_: -TList).(\lambda (i: nat).(\lambda (d: C).(\lambda (v: T).(getl i c0 (CHead d -(Bind Abst) v)))))) (\lambda (ws: TList).(\lambda (_: nat).(\lambda (_: -C).(\lambda (_: T).(nfs2 c0 ws)))))))) (nf2_gen_beta c0 u x0 x1 H13 (or3 -(ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T (THead (Flat Appl) u (THead -(Bind Abst) x0 x1)) (THead (Bind Abst) w u0)))) (\lambda (w: T).(\lambda (_: -T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u0: T).(nf2 (CHead c0 (Bind Abst) -w) u0)))) (ex nat (\lambda (n: nat).(eq T (THead (Flat Appl) u (THead (Bind -Abst) x0 x1)) (TSort n)))) (ex3_4 TList nat C T (\lambda (ws: TList).(\lambda -(i: nat).(\lambda (_: C).(\lambda (_: T).(eq T (THead (Flat Appl) u (THead -(Bind Abst) x0 x1)) (THeads (Flat Appl) ws (TLRef i))))))) (\lambda (_: -TList).(\lambda (i: nat).(\lambda (d: C).(\lambda (v: T).(getl i c0 (CHead d -(Bind Abst) v)))))) (\lambda (ws: TList).(\lambda (_: nat).(\lambda (_: -C).(\lambda (_: T).(nfs2 c0 ws)))))))) t0 H10)))))))) H9)) (\lambda (H9: (ex -nat (\lambda (n: nat).(eq T t0 (TSort n))))).(ex_ind nat (\lambda (n: -nat).(eq T t0 (TSort n))) (or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: -T).(eq T (THead (Flat Appl) u t0) (THead (Bind Abst) w u0)))) (\lambda (w: -T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u0: T).(nf2 (CHead -c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: nat).(eq T (THead (Flat Appl) u -t0) (TSort n)))) (ex3_4 TList nat C T (\lambda (ws: TList).(\lambda (i: -nat).(\lambda (_: C).(\lambda (_: T).(eq T (THead (Flat Appl) u t0) (THeads -(Flat Appl) ws (TLRef i))))))) (\lambda (_: TList).(\lambda (i: nat).(\lambda -(d: C).(\lambda (v: T).(getl i c0 (CHead d (Bind Abst) v)))))) (\lambda (ws: -TList).(\lambda (_: nat).(\lambda (_: C).(\lambda (_: T).(nfs2 c0 ws))))))) -(\lambda (x: nat).(\lambda (H10: (eq T t0 (TSort x))).(let H11 \def (eq_ind T -t0 (\lambda (t1: T).(nf2 c0 (THead (Flat Appl) u t1))) H4 (TSort x) H10) in -(let H12 \def (eq_ind T t0 (\lambda (t1: T).(arity g c0 t1 (AHead a1 a2))) H2 -(TSort x) H10) in (eq_ind_r T (TSort x) (\lambda (t1: T).(or3 (ex3_2 T T -(\lambda (w: T).(\lambda (u0: T).(eq T (THead (Flat Appl) u t1) (THead (Bind -Abst) w u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: -T).(\lambda (u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: -nat).(eq T (THead (Flat Appl) u t1) (TSort n)))) (ex3_4 TList nat C T -(\lambda (ws: TList).(\lambda (i: nat).(\lambda (_: C).(\lambda (_: T).(eq T -(THead (Flat Appl) u t1) (THeads (Flat Appl) ws (TLRef i))))))) (\lambda (_: -TList).(\lambda (i: nat).(\lambda (d: C).(\lambda (v: T).(getl i c0 (CHead d -(Bind Abst) v)))))) (\lambda (ws: TList).(\lambda (_: nat).(\lambda (_: -C).(\lambda (_: T).(nfs2 c0 ws)))))))) (let H13 \def (match (arity_gen_sort g -c0 x (AHead a1 a2) H12) in leq return (\lambda (a0: A).(\lambda (a3: -A).(\lambda (_: (leq ? a0 a3)).((eq A a0 (AHead a1 a2)) \to ((eq A a3 (ASort -O x)) \to (or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T (THead (Flat -Appl) u (TSort x)) (THead (Bind Abst) w u0)))) (\lambda (w: T).(\lambda (_: -T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u0: T).(nf2 (CHead c0 (Bind Abst) -w) u0)))) (ex nat (\lambda (n: nat).(eq T (THead (Flat Appl) u (TSort x)) -(TSort n)))) (ex3_4 TList nat C T (\lambda (ws: TList).(\lambda (i: -nat).(\lambda (_: C).(\lambda (_: T).(eq T (THead (Flat Appl) u (TSort x)) -(THeads (Flat Appl) ws (TLRef i))))))) (\lambda (_: TList).(\lambda (i: -nat).(\lambda (d: C).(\lambda (v: T).(getl i c0 (CHead d (Bind Abst) v)))))) -(\lambda (ws: TList).(\lambda (_: nat).(\lambda (_: C).(\lambda (_: T).(nfs2 -c0 ws)))))))))))) with [(leq_sort h1 h2 n1 n2 k H13) \Rightarrow (\lambda -(H14: (eq A (ASort h1 n1) (AHead a1 a2))).(\lambda (H15: (eq A (ASort h2 n2) -(ASort O x))).((let H16 \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) H14) in (False_ind ((eq A (ASort h2 -n2) (ASort O x)) \to ((eq A (aplus g (ASort h1 n1) k) (aplus g (ASort h2 n2) -k)) \to (or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T (THead (Flat -Appl) u (TSort x)) (THead (Bind Abst) w u0)))) (\lambda (w: T).(\lambda (_: -T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u0: T).(nf2 (CHead c0 (Bind Abst) -w) u0)))) (ex nat (\lambda (n: nat).(eq T (THead (Flat Appl) u (TSort x)) -(TSort n)))) (ex3_4 TList nat C T (\lambda (ws: TList).(\lambda (i: -nat).(\lambda (_: C).(\lambda (_: T).(eq T (THead (Flat Appl) u (TSort x)) -(THeads (Flat Appl) ws (TLRef i))))))) (\lambda (_: TList).(\lambda (i: -nat).(\lambda (d: C).(\lambda (v: T).(getl i c0 (CHead d (Bind Abst) v)))))) -(\lambda (ws: TList).(\lambda (_: nat).(\lambda (_: C).(\lambda (_: T).(nfs2 -c0 ws))))))))) H16)) H15 H13))) | (leq_head a0 a3 H13 a4 a5 H14) \Rightarrow -(\lambda (H15: (eq A (AHead a0 a4) (AHead a1 a2))).(\lambda (H16: (eq A -(AHead a3 a5) (ASort O x))).((let H17 \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) H15) in ((let H18 -\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) H15) in (eq_ind A a1 (\lambda (a6: A).((eq A a4 a2) \to -((eq A (AHead a3 a5) (ASort O x)) \to ((leq g a6 a3) \to ((leq g a4 a5) \to -(or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T (THead (Flat Appl) u -(TSort x)) (THead (Bind Abst) w u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 -c0 w))) (\lambda (w: T).(\lambda (u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) -(ex nat (\lambda (n: nat).(eq T (THead (Flat Appl) u (TSort x)) (TSort n)))) -(ex3_4 TList nat C T (\lambda (ws: TList).(\lambda (i: nat).(\lambda (_: -C).(\lambda (_: T).(eq T (THead (Flat Appl) u (TSort x)) (THeads (Flat Appl) -ws (TLRef i))))))) (\lambda (_: TList).(\lambda (i: nat).(\lambda (d: -C).(\lambda (v: T).(getl i c0 (CHead d (Bind Abst) v)))))) (\lambda (ws: -TList).(\lambda (_: nat).(\lambda (_: C).(\lambda (_: T).(nfs2 c0 -ws)))))))))))) (\lambda (H19: (eq A a4 a2)).(eq_ind A a2 (\lambda (a6: -A).((eq A (AHead a3 a5) (ASort O x)) \to ((leq g a1 a3) \to ((leq g a6 a5) -\to (or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T (THead (Flat Appl) -u (TSort x)) (THead (Bind Abst) w u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 -c0 w))) (\lambda (w: T).(\lambda (u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) -(ex nat (\lambda (n: nat).(eq T (THead (Flat Appl) u (TSort x)) (TSort n)))) -(ex3_4 TList nat C T (\lambda (ws: TList).(\lambda (i: nat).(\lambda (_: -C).(\lambda (_: T).(eq T (THead (Flat Appl) u (TSort x)) (THeads (Flat Appl) -ws (TLRef i))))))) (\lambda (_: TList).(\lambda (i: nat).(\lambda (d: -C).(\lambda (v: T).(getl i c0 (CHead d (Bind Abst) v)))))) (\lambda (ws: -TList).(\lambda (_: nat).(\lambda (_: C).(\lambda (_: T).(nfs2 c0 -ws))))))))))) (\lambda (H20: (eq A (AHead a3 a5) (ASort O x))).(let H21 \def -(eq_ind A (AHead a3 a5) (\lambda (e: A).(match e in A return (\lambda (_: -A).Prop) with [(ASort _ _) \Rightarrow False | (AHead _ _) \Rightarrow -True])) I (ASort O x) H20) in (False_ind ((leq g a1 a3) \to ((leq g a2 a5) -\to (or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T (THead (Flat Appl) -u (TSort x)) (THead (Bind Abst) w u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 -c0 w))) (\lambda (w: T).(\lambda (u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) -(ex nat (\lambda (n: nat).(eq T (THead (Flat Appl) u (TSort x)) (TSort n)))) -(ex3_4 TList nat C T (\lambda (ws: TList).(\lambda (i: nat).(\lambda (_: -C).(\lambda (_: T).(eq T (THead (Flat Appl) u (TSort x)) (THeads (Flat Appl) -ws (TLRef i))))))) (\lambda (_: TList).(\lambda (i: nat).(\lambda (d: -C).(\lambda (v: T).(getl i c0 (CHead d (Bind Abst) v)))))) (\lambda (ws: -TList).(\lambda (_: nat).(\lambda (_: C).(\lambda (_: T).(nfs2 c0 ws))))))))) -H21))) a4 (sym_eq A a4 a2 H19))) a0 (sym_eq A a0 a1 H18))) H17)) H16 H13 -H14)))]) in (H13 (refl_equal A (AHead a1 a2)) (refl_equal A (ASort O x)))) t0 -H10))))) H9)) (\lambda (H9: (ex3_4 TList nat C T (\lambda (ws: -TList).(\lambda (i: nat).(\lambda (_: C).(\lambda (_: T).(eq T t0 (THeads -(Flat Appl) ws (TLRef i))))))) (\lambda (_: TList).(\lambda (i: nat).(\lambda -(d: C).(\lambda (v: T).(getl i c0 (CHead d (Bind Abst) v)))))) (\lambda (ws: -TList).(\lambda (_: nat).(\lambda (_: C).(\lambda (_: T).(nfs2 c0 -ws))))))).(ex3_4_ind TList nat C T (\lambda (ws: TList).(\lambda (i: -nat).(\lambda (_: C).(\lambda (_: T).(eq T t0 (THeads (Flat Appl) ws (TLRef -i))))))) (\lambda (_: TList).(\lambda (i: nat).(\lambda (d: C).(\lambda (v: -T).(getl i c0 (CHead d (Bind Abst) v)))))) (\lambda (ws: TList).(\lambda (_: -nat).(\lambda (_: C).(\lambda (_: T).(nfs2 c0 ws))))) (or3 (ex3_2 T T -(\lambda (w: T).(\lambda (u0: T).(eq T (THead (Flat Appl) u t0) (THead (Bind -Abst) w u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: -T).(\lambda (u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: -nat).(eq T (THead (Flat Appl) u t0) (TSort n)))) (ex3_4 TList nat C T -(\lambda (ws: TList).(\lambda (i: nat).(\lambda (_: C).(\lambda (_: T).(eq T -(THead (Flat Appl) u t0) (THeads (Flat Appl) ws (TLRef i))))))) (\lambda (_: -TList).(\lambda (i: nat).(\lambda (d: C).(\lambda (v: T).(getl i c0 (CHead d -(Bind Abst) v)))))) (\lambda (ws: TList).(\lambda (_: nat).(\lambda (_: -C).(\lambda (_: T).(nfs2 c0 ws))))))) (\lambda (x0: TList).(\lambda (x1: -nat).(\lambda (x2: C).(\lambda (x3: T).(\lambda (H10: (eq T t0 (THeads (Flat -Appl) x0 (TLRef x1)))).(\lambda (H11: (getl x1 c0 (CHead x2 (Bind Abst) -x3))).(\lambda (H12: (nfs2 c0 x0)).(let H13 \def (eq_ind T t0 (\lambda (t1: -T).(nf2 c0 (THead (Flat Appl) u t1))) H4 (THeads (Flat Appl) x0 (TLRef x1)) -H10) in (let H14 \def (eq_ind T t0 (\lambda (t1: T).(arity g c0 t1 (AHead a1 -a2))) H2 (THeads (Flat Appl) x0 (TLRef x1)) H10) in (eq_ind_r T (THeads (Flat -Appl) x0 (TLRef x1)) (\lambda (t1: T).(or3 (ex3_2 T T (\lambda (w: -T).(\lambda (u0: T).(eq T (THead (Flat Appl) u t1) (THead (Bind Abst) w -u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda -(u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: nat).(eq T -(THead (Flat Appl) u t1) (TSort n)))) (ex3_4 TList nat C T (\lambda (ws: -TList).(\lambda (i: nat).(\lambda (_: C).(\lambda (_: T).(eq T (THead (Flat -Appl) u t1) (THeads (Flat Appl) ws (TLRef i))))))) (\lambda (_: -TList).(\lambda (i: nat).(\lambda (d: C).(\lambda (v: T).(getl i c0 (CHead d -(Bind Abst) v)))))) (\lambda (ws: TList).(\lambda (_: nat).(\lambda (_: -C).(\lambda (_: T).(nfs2 c0 ws)))))))) (or3_intro2 (ex3_2 T T (\lambda (w: -T).(\lambda (u0: T).(eq T (THead (Flat Appl) u (THeads (Flat Appl) x0 (TLRef -x1))) (THead (Bind Abst) w u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 -w))) (\lambda (w: T).(\lambda (u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) -(ex nat (\lambda (n: nat).(eq T (THead (Flat Appl) u (THeads (Flat Appl) x0 -(TLRef x1))) (TSort n)))) (ex3_4 TList nat C T (\lambda (ws: TList).(\lambda -(i: nat).(\lambda (_: C).(\lambda (_: T).(eq T (THead (Flat Appl) u (THeads -(Flat Appl) x0 (TLRef x1))) (THeads (Flat Appl) ws (TLRef i))))))) (\lambda -(_: TList).(\lambda (i: nat).(\lambda (d: C).(\lambda (v: T).(getl i c0 -(CHead d (Bind Abst) v)))))) (\lambda (ws: TList).(\lambda (_: nat).(\lambda -(_: C).(\lambda (_: T).(nfs2 c0 ws)))))) (ex3_4_intro TList nat C T (\lambda -(ws: TList).(\lambda (i: nat).(\lambda (_: C).(\lambda (_: T).(eq T (THead -(Flat Appl) u (THeads (Flat Appl) x0 (TLRef x1))) (THeads (Flat Appl) ws -(TLRef i))))))) (\lambda (_: TList).(\lambda (i: nat).(\lambda (d: -C).(\lambda (v: T).(getl i c0 (CHead d (Bind Abst) v)))))) (\lambda (ws: -TList).(\lambda (_: nat).(\lambda (_: C).(\lambda (_: T).(nfs2 c0 ws))))) -(TCons u x0) x1 x2 x3 (refl_equal T (THead (Flat Appl) u (THeads (Flat Appl) -x0 (TLRef x1)))) H11 (conj (nf2 c0 u) (nfs2 c0 x0) H6 H12))) t0 H10)))))))))) -H9)) H8))))) H5)))))))))))) (\lambda (c0: C).(\lambda (u: T).(\lambda (a0: -A).(\lambda (_: (arity g c0 u (asucc g a0))).(\lambda (_: (((nf2 c0 u) \to -(or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T u (THead (Bind Abst) w -u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda -(u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: nat).(eq T -u (TSort n)))) (ex3_4 TList nat C T (\lambda (ws: TList).(\lambda (i: -nat).(\lambda (_: C).(\lambda (_: T).(eq T u (THeads (Flat Appl) ws (TLRef -i))))))) (\lambda (_: TList).(\lambda (i: nat).(\lambda (d: C).(\lambda (v: -T).(getl i c0 (CHead d (Bind Abst) v)))))) (\lambda (ws: TList).(\lambda (_: -nat).(\lambda (_: C).(\lambda (_: T).(nfs2 c0 ws)))))))))).(\lambda (t0: -T).(\lambda (_: (arity g c0 t0 a0)).(\lambda (_: (((nf2 c0 t0) \to (or3 -(ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T t0 (THead (Bind Abst) w -u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda -(u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: nat).(eq T -t0 (TSort n)))) (ex3_4 TList nat C T (\lambda (ws: TList).(\lambda (i: -nat).(\lambda (_: C).(\lambda (_: T).(eq T t0 (THeads (Flat Appl) ws (TLRef -i))))))) (\lambda (_: TList).(\lambda (i: nat).(\lambda (d: C).(\lambda (v: -T).(getl i c0 (CHead d (Bind Abst) v)))))) (\lambda (ws: TList).(\lambda (_: -nat).(\lambda (_: C).(\lambda (_: T).(nfs2 c0 ws)))))))))).(\lambda (H4: (nf2 -c0 (THead (Flat Cast) u t0))).(nf2_gen_cast c0 u t0 H4 (or3 (ex3_2 T T -(\lambda (w: T).(\lambda (u0: T).(eq T (THead (Flat Cast) u t0) (THead (Bind -Abst) w u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: -T).(\lambda (u0: T).(nf2 (CHead c0 (Bind Abst) w) u0)))) (ex nat (\lambda (n: -nat).(eq T (THead (Flat Cast) u t0) (TSort n)))) (ex3_4 TList nat C T -(\lambda (ws: TList).(\lambda (i: nat).(\lambda (_: C).(\lambda (_: T).(eq T -(THead (Flat Cast) u t0) (THeads (Flat Appl) ws (TLRef i))))))) (\lambda (_: -TList).(\lambda (i: nat).(\lambda (d: C).(\lambda (v: T).(getl i c0 (CHead d -(Bind Abst) v)))))) (\lambda (ws: TList).(\lambda (_: nat).(\lambda (_: -C).(\lambda (_: T).(nfs2 c0 ws))))))))))))))))) (\lambda (c0: C).(\lambda -(t0: T).(\lambda (a1: A).(\lambda (_: (arity g c0 t0 a1)).(\lambda (H1: -(((nf2 c0 t0) \to (or3 (ex3_2 T T (\lambda (w: T).(\lambda (u: T).(eq T t0 -(THead (Bind Abst) w u)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) -(\lambda (w: T).(\lambda (u: T).(nf2 (CHead c0 (Bind Abst) w) u)))) (ex nat -(\lambda (n: nat).(eq T t0 (TSort n)))) (ex3_4 TList nat C T (\lambda (ws: -TList).(\lambda (i: nat).(\lambda (_: C).(\lambda (_: T).(eq T t0 (THeads -(Flat Appl) ws (TLRef i))))))) (\lambda (_: TList).(\lambda (i: nat).(\lambda -(d: C).(\lambda (v: T).(getl i c0 (CHead d (Bind Abst) v)))))) (\lambda (ws: -TList).(\lambda (_: nat).(\lambda (_: C).(\lambda (_: T).(nfs2 c0 -ws)))))))))).(\lambda (a2: A).(\lambda (_: (leq g a1 a2)).(\lambda (H3: (nf2 -c0 t0)).(let H_x \def (H1 H3) in (let H4 \def H_x in (or3_ind (ex3_2 T T -(\lambda (w: T).(\lambda (u: T).(eq T t0 (THead (Bind Abst) w u)))) (\lambda -(w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u: T).(nf2 -(CHead c0 (Bind Abst) w) u)))) (ex nat (\lambda (n: nat).(eq T t0 (TSort -n)))) (ex3_4 TList nat C T (\lambda (ws: TList).(\lambda (i: nat).(\lambda -(_: C).(\lambda (_: T).(eq T t0 (THeads (Flat Appl) ws (TLRef i))))))) -(\lambda (_: TList).(\lambda (i: nat).(\lambda (d: C).(\lambda (v: T).(getl i -c0 (CHead d (Bind Abst) v)))))) (\lambda (ws: TList).(\lambda (_: -nat).(\lambda (_: C).(\lambda (_: T).(nfs2 c0 ws)))))) (or3 (ex3_2 T T -(\lambda (w: T).(\lambda (u: T).(eq T t0 (THead (Bind Abst) w u)))) (\lambda -(w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u: T).(nf2 -(CHead c0 (Bind Abst) w) u)))) (ex nat (\lambda (n: nat).(eq T t0 (TSort -n)))) (ex3_4 TList nat C T (\lambda (ws: TList).(\lambda (i: nat).(\lambda -(_: C).(\lambda (_: T).(eq T t0 (THeads (Flat Appl) ws (TLRef i))))))) -(\lambda (_: TList).(\lambda (i: nat).(\lambda (d: C).(\lambda (v: T).(getl i -c0 (CHead d (Bind Abst) v)))))) (\lambda (ws: TList).(\lambda (_: -nat).(\lambda (_: C).(\lambda (_: T).(nfs2 c0 ws))))))) (\lambda (H5: (ex3_2 -T T (\lambda (w: T).(\lambda (u: T).(eq T t0 (THead (Bind Abst) w u)))) -(\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u: -T).(nf2 (CHead c0 (Bind Abst) w) u))))).(ex3_2_ind T T (\lambda (w: -T).(\lambda (u: T).(eq T t0 (THead (Bind Abst) w u)))) (\lambda (w: -T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u: T).(nf2 (CHead -c0 (Bind Abst) w) u))) (or3 (ex3_2 T T (\lambda (w: T).(\lambda (u: T).(eq T -t0 (THead (Bind Abst) w u)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) -(\lambda (w: T).(\lambda (u: T).(nf2 (CHead c0 (Bind Abst) w) u)))) (ex nat -(\lambda (n: nat).(eq T t0 (TSort n)))) (ex3_4 TList nat C T (\lambda (ws: -TList).(\lambda (i: nat).(\lambda (_: C).(\lambda (_: T).(eq T t0 (THeads -(Flat Appl) ws (TLRef i))))))) (\lambda (_: TList).(\lambda (i: nat).(\lambda -(d: C).(\lambda (v: T).(getl i c0 (CHead d (Bind Abst) v)))))) (\lambda (ws: -TList).(\lambda (_: nat).(\lambda (_: C).(\lambda (_: T).(nfs2 c0 ws))))))) -(\lambda (x0: T).(\lambda (x1: T).(\lambda (H6: (eq T t0 (THead (Bind Abst) -x0 x1))).(\lambda (H7: (nf2 c0 x0)).(\lambda (H8: (nf2 (CHead c0 (Bind Abst) -x0) x1)).(eq_ind_r T (THead (Bind Abst) x0 x1) (\lambda (t1: T).(or3 (ex3_2 T -T (\lambda (w: T).(\lambda (u: T).(eq T t1 (THead (Bind Abst) w u)))) -(\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u: -T).(nf2 (CHead c0 (Bind Abst) w) u)))) (ex nat (\lambda (n: nat).(eq T t1 -(TSort n)))) (ex3_4 TList nat C T (\lambda (ws: TList).(\lambda (i: -nat).(\lambda (_: C).(\lambda (_: T).(eq T t1 (THeads (Flat Appl) ws (TLRef -i))))))) (\lambda (_: TList).(\lambda (i: nat).(\lambda (d: C).(\lambda (v: -T).(getl i c0 (CHead d (Bind Abst) v)))))) (\lambda (ws: TList).(\lambda (_: -nat).(\lambda (_: C).(\lambda (_: T).(nfs2 c0 ws)))))))) (or3_intro0 (ex3_2 T -T (\lambda (w: T).(\lambda (u: T).(eq T (THead (Bind Abst) x0 x1) (THead -(Bind Abst) w u)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: -T).(\lambda (u: T).(nf2 (CHead c0 (Bind Abst) w) u)))) (ex nat (\lambda (n: -nat).(eq T (THead (Bind Abst) x0 x1) (TSort n)))) (ex3_4 TList nat C T -(\lambda (ws: TList).(\lambda (i: nat).(\lambda (_: C).(\lambda (_: T).(eq T -(THead (Bind Abst) x0 x1) (THeads (Flat Appl) ws (TLRef i))))))) (\lambda (_: -TList).(\lambda (i: nat).(\lambda (d: C).(\lambda (v: T).(getl i c0 (CHead d -(Bind Abst) v)))))) (\lambda (ws: TList).(\lambda (_: nat).(\lambda (_: -C).(\lambda (_: T).(nfs2 c0 ws)))))) (ex3_2_intro T T (\lambda (w: -T).(\lambda (u: T).(eq T (THead (Bind Abst) x0 x1) (THead (Bind Abst) w u)))) -(\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u: -T).(nf2 (CHead c0 (Bind Abst) w) u))) x0 x1 (refl_equal T (THead (Bind Abst) -x0 x1)) H7 H8)) t0 H6)))))) H5)) (\lambda (H5: (ex nat (\lambda (n: nat).(eq -T t0 (TSort n))))).(ex_ind nat (\lambda (n: nat).(eq T t0 (TSort n))) (or3 -(ex3_2 T T (\lambda (w: T).(\lambda (u: T).(eq T t0 (THead (Bind Abst) w -u)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda -(u: T).(nf2 (CHead c0 (Bind Abst) w) u)))) (ex nat (\lambda (n: nat).(eq T t0 -(TSort n)))) (ex3_4 TList nat C T (\lambda (ws: TList).(\lambda (i: -nat).(\lambda (_: C).(\lambda (_: T).(eq T t0 (THeads (Flat Appl) ws (TLRef -i))))))) (\lambda (_: TList).(\lambda (i: nat).(\lambda (d: C).(\lambda (v: -T).(getl i c0 (CHead d (Bind Abst) v)))))) (\lambda (ws: TList).(\lambda (_: -nat).(\lambda (_: C).(\lambda (_: T).(nfs2 c0 ws))))))) (\lambda (x: -nat).(\lambda (H6: (eq T t0 (TSort x))).(eq_ind_r T (TSort x) (\lambda (t1: -T).(or3 (ex3_2 T T (\lambda (w: T).(\lambda (u: T).(eq T t1 (THead (Bind -Abst) w u)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: -T).(\lambda (u: T).(nf2 (CHead c0 (Bind Abst) w) u)))) (ex nat (\lambda (n: -nat).(eq T t1 (TSort n)))) (ex3_4 TList nat C T (\lambda (ws: TList).(\lambda -(i: nat).(\lambda (_: C).(\lambda (_: T).(eq T t1 (THeads (Flat Appl) ws -(TLRef i))))))) (\lambda (_: TList).(\lambda (i: nat).(\lambda (d: -C).(\lambda (v: T).(getl i c0 (CHead d (Bind Abst) v)))))) (\lambda (ws: -TList).(\lambda (_: nat).(\lambda (_: C).(\lambda (_: T).(nfs2 c0 ws)))))))) -(or3_intro1 (ex3_2 T T (\lambda (w: T).(\lambda (u: T).(eq T (TSort x) (THead -(Bind Abst) w u)))) (\lambda (w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: -T).(\lambda (u: T).(nf2 (CHead c0 (Bind Abst) w) u)))) (ex nat (\lambda (n: -nat).(eq T (TSort x) (TSort n)))) (ex3_4 TList nat C T (\lambda (ws: -TList).(\lambda (i: nat).(\lambda (_: C).(\lambda (_: T).(eq T (TSort x) -(THeads (Flat Appl) ws (TLRef i))))))) (\lambda (_: TList).(\lambda (i: -nat).(\lambda (d: C).(\lambda (v: T).(getl i c0 (CHead d (Bind Abst) v)))))) -(\lambda (ws: TList).(\lambda (_: nat).(\lambda (_: C).(\lambda (_: T).(nfs2 -c0 ws)))))) (ex_intro nat (\lambda (n: nat).(eq T (TSort x) (TSort n))) x -(refl_equal T (TSort x)))) t0 H6))) H5)) (\lambda (H5: (ex3_4 TList nat C T -(\lambda (ws: TList).(\lambda (i: nat).(\lambda (_: C).(\lambda (_: T).(eq T -t0 (THeads (Flat Appl) ws (TLRef i))))))) (\lambda (_: TList).(\lambda (i: -nat).(\lambda (d: C).(\lambda (v: T).(getl i c0 (CHead d (Bind Abst) v)))))) -(\lambda (ws: TList).(\lambda (_: nat).(\lambda (_: C).(\lambda (_: T).(nfs2 -c0 ws))))))).(ex3_4_ind TList nat C T (\lambda (ws: TList).(\lambda (i: -nat).(\lambda (_: C).(\lambda (_: T).(eq T t0 (THeads (Flat Appl) ws (TLRef -i))))))) (\lambda (_: TList).(\lambda (i: nat).(\lambda (d: C).(\lambda (v: -T).(getl i c0 (CHead d (Bind Abst) v)))))) (\lambda (ws: TList).(\lambda (_: -nat).(\lambda (_: C).(\lambda (_: T).(nfs2 c0 ws))))) (or3 (ex3_2 T T -(\lambda (w: T).(\lambda (u: T).(eq T t0 (THead (Bind Abst) w u)))) (\lambda -(w: T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u: T).(nf2 -(CHead c0 (Bind Abst) w) u)))) (ex nat (\lambda (n: nat).(eq T t0 (TSort -n)))) (ex3_4 TList nat C T (\lambda (ws: TList).(\lambda (i: nat).(\lambda -(_: C).(\lambda (_: T).(eq T t0 (THeads (Flat Appl) ws (TLRef i))))))) -(\lambda (_: TList).(\lambda (i: nat).(\lambda (d: C).(\lambda (v: T).(getl i -c0 (CHead d (Bind Abst) v)))))) (\lambda (ws: TList).(\lambda (_: -nat).(\lambda (_: C).(\lambda (_: T).(nfs2 c0 ws))))))) (\lambda (x0: -TList).(\lambda (x1: nat).(\lambda (x2: C).(\lambda (x3: T).(\lambda (H6: (eq -T t0 (THeads (Flat Appl) x0 (TLRef x1)))).(\lambda (H7: (getl x1 c0 (CHead x2 -(Bind Abst) x3))).(\lambda (H8: (nfs2 c0 x0)).(eq_ind_r T (THeads (Flat Appl) -x0 (TLRef x1)) (\lambda (t1: T).(or3 (ex3_2 T T (\lambda (w: T).(\lambda (u: -T).(eq T t1 (THead (Bind Abst) w u)))) (\lambda (w: T).(\lambda (_: T).(nf2 -c0 w))) (\lambda (w: T).(\lambda (u: T).(nf2 (CHead c0 (Bind Abst) w) u)))) -(ex nat (\lambda (n: nat).(eq T t1 (TSort n)))) (ex3_4 TList nat C T (\lambda -(ws: TList).(\lambda (i: nat).(\lambda (_: C).(\lambda (_: T).(eq T t1 -(THeads (Flat Appl) ws (TLRef i))))))) (\lambda (_: TList).(\lambda (i: -nat).(\lambda (d: C).(\lambda (v: T).(getl i c0 (CHead d (Bind Abst) v)))))) -(\lambda (ws: TList).(\lambda (_: nat).(\lambda (_: C).(\lambda (_: T).(nfs2 -c0 ws)))))))) (or3_intro2 (ex3_2 T T (\lambda (w: T).(\lambda (u: T).(eq T -(THeads (Flat Appl) x0 (TLRef x1)) (THead (Bind Abst) w u)))) (\lambda (w: -T).(\lambda (_: T).(nf2 c0 w))) (\lambda (w: T).(\lambda (u: T).(nf2 (CHead -c0 (Bind Abst) w) u)))) (ex nat (\lambda (n: nat).(eq T (THeads (Flat Appl) -x0 (TLRef x1)) (TSort n)))) (ex3_4 TList nat C T (\lambda (ws: -TList).(\lambda (i: nat).(\lambda (_: C).(\lambda (_: T).(eq T (THeads (Flat -Appl) x0 (TLRef x1)) (THeads (Flat Appl) ws (TLRef i))))))) (\lambda (_: -TList).(\lambda (i: nat).(\lambda (d: C).(\lambda (v: T).(getl i c0 (CHead d -(Bind Abst) v)))))) (\lambda (ws: TList).(\lambda (_: nat).(\lambda (_: -C).(\lambda (_: T).(nfs2 c0 ws)))))) (ex3_4_intro TList nat C T (\lambda (ws: -TList).(\lambda (i: nat).(\lambda (_: C).(\lambda (_: T).(eq T (THeads (Flat -Appl) x0 (TLRef x1)) (THeads (Flat Appl) ws (TLRef i))))))) (\lambda (_: -TList).(\lambda (i: nat).(\lambda (d: C).(\lambda (v: T).(getl i c0 (CHead d -(Bind Abst) v)))))) (\lambda (ws: TList).(\lambda (_: nat).(\lambda (_: -C).(\lambda (_: T).(nfs2 c0 ws))))) x0 x1 x2 x3 (refl_equal T (THeads (Flat -Appl) x0 (TLRef x1))) H7 H8)) t0 H6)))))))) H5)) H4))))))))))) c t a H))))). - -theorem pc3_gen_sort_abst: - \forall (c: C).(\forall (u: T).(\forall (t: T).(\forall (n: nat).((pc3 c -(TSort n) (THead (Bind Abst) u t)) \to (\forall (P: Prop).P))))) -\def - \lambda (c: C).(\lambda (u: T).(\lambda (t: T).(\lambda (n: nat).(\lambda -(H: (pc3 c (TSort n) (THead (Bind Abst) u t))).(\lambda (P: Prop).(let H0 -\def H in (ex2_ind T (\lambda (t0: T).(pr3 c (TSort n) t0)) (\lambda (t0: -T).(pr3 c (THead (Bind Abst) u t) t0)) P (\lambda (x: T).(\lambda (H1: (pr3 c -(TSort n) x)).(\lambda (H2: (pr3 c (THead (Bind Abst) u t) x)).(let H3 \def -(pr3_gen_abst c u t x H2) in (ex3_2_ind T T (\lambda (u2: T).(\lambda (t2: -T).(eq T x (THead (Bind Abst) u2 t2)))) (\lambda (u2: T).(\lambda (_: T).(pr3 -c u u2))) (\lambda (_: T).(\lambda (t2: T).(\forall (b: B).(\forall (u0: -T).(pr3 (CHead c (Bind b) u0) t t2))))) P (\lambda (x0: T).(\lambda (x1: -T).(\lambda (H4: (eq T x (THead (Bind Abst) x0 x1))).(\lambda (_: (pr3 c u -x0)).(\lambda (_: ((\forall (b: B).(\forall (u0: T).(pr3 (CHead c (Bind b) -u0) t x1))))).(let H7 \def (eq_ind T x (\lambda (t0: T).(eq T t0 (TSort n))) -(pr3_gen_sort c x n H1) (THead (Bind Abst) x0 x1) H4) in (let H8 \def (eq_ind -T (THead (Bind Abst) x0 x1) (\lambda (ee: T).(match ee in T return (\lambda -(_: T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) \Rightarrow False -| (THead _ _ _) \Rightarrow True])) I (TSort n) H7) in (False_ind P -H8)))))))) H3))))) H0))))))). - -theorem ty3_gen_abst_abst: - \forall (g: G).(\forall (c: C).(\forall (u: T).(\forall (t1: T).(\forall -(t2: T).((ty3 g c (THead (Bind Abst) u t1) (THead (Bind Abst) u t2)) \to (ex2 -T (\lambda (w: T).(ty3 g c u w)) (\lambda (_: T).(ty3 g (CHead c (Bind Abst) -u) t1 t2)))))))) -\def - \lambda (g: G).(\lambda (c: C).(\lambda (u: T).(\lambda (t1: T).(\lambda -(t2: T).(\lambda (H: (ty3 g c (THead (Bind Abst) u t1) (THead (Bind Abst) u -t2))).(ex_ind T (\lambda (t: T).(ty3 g c (THead (Bind Abst) u t2) t)) (ex2 T -(\lambda (w: T).(ty3 g c u w)) (\lambda (_: T).(ty3 g (CHead c (Bind Abst) u) -t1 t2))) (\lambda (x: T).(\lambda (H0: (ty3 g c (THead (Bind Abst) u t2) -x)).(ex4_3_ind T T T (\lambda (t3: T).(\lambda (_: T).(\lambda (_: T).(pc3 c -(THead (Bind Abst) u t3) x)))) (\lambda (_: T).(\lambda (t: T).(\lambda (_: -T).(ty3 g c u t)))) (\lambda (t3: T).(\lambda (_: T).(\lambda (_: T).(ty3 g -(CHead c (Bind Abst) u) t2 t3)))) (\lambda (t3: T).(\lambda (_: T).(\lambda -(t0: T).(ty3 g (CHead c (Bind Abst) u) t3 t0)))) (ex2 T (\lambda (w: T).(ty3 -g c u w)) (\lambda (_: T).(ty3 g (CHead c (Bind Abst) u) t1 t2))) (\lambda -(x0: T).(\lambda (x1: T).(\lambda (x2: T).(\lambda (_: (pc3 c (THead (Bind -Abst) u x0) x)).(\lambda (_: (ty3 g c u x1)).(\lambda (H3: (ty3 g (CHead c -(Bind Abst) u) t2 x0)).(\lambda (_: (ty3 g (CHead c (Bind Abst) u) x0 -x2)).(ex4_3_ind T T T (\lambda (t3: T).(\lambda (_: T).(\lambda (_: T).(pc3 c -(THead (Bind Abst) u t3) (THead (Bind Abst) u t2))))) (\lambda (_: -T).(\lambda (t: T).(\lambda (_: T).(ty3 g c u t)))) (\lambda (t3: T).(\lambda -(_: T).(\lambda (_: T).(ty3 g (CHead c (Bind Abst) u) t1 t3)))) (\lambda (t3: -T).(\lambda (_: T).(\lambda (t0: T).(ty3 g (CHead c (Bind Abst) u) t3 t0)))) -(ex2 T (\lambda (w: T).(ty3 g c u w)) (\lambda (_: T).(ty3 g (CHead c (Bind -Abst) u) t1 t2))) (\lambda (x3: T).(\lambda (x4: T).(\lambda (x5: T).(\lambda -(H5: (pc3 c (THead (Bind Abst) u x3) (THead (Bind Abst) u t2))).(\lambda (H6: -(ty3 g c u x4)).(\lambda (H7: (ty3 g (CHead c (Bind Abst) u) t1 x3)).(\lambda -(_: (ty3 g (CHead c (Bind Abst) u) x3 x5)).(and_ind (pc3 c u u) (\forall (b: -B).(\forall (u0: T).(pc3 (CHead c (Bind b) u0) x3 t2))) (ex2 T (\lambda (w: -T).(ty3 g c u w)) (\lambda (_: T).(ty3 g (CHead c (Bind Abst) u) t1 t2))) -(\lambda (_: (pc3 c u u)).(\lambda (H10: ((\forall (b: B).(\forall (u0: -T).(pc3 (CHead c (Bind b) u0) x3 t2))))).(ex_intro2 T (\lambda (w: T).(ty3 g -c u w)) (\lambda (_: T).(ty3 g (CHead c (Bind Abst) u) t1 t2)) x4 H6 -(ty3_conv g (CHead c (Bind Abst) u) t2 x0 H3 t1 x3 H7 (H10 Abst u))))) -(pc3_gen_abst c u u x3 t2 H5))))))))) (ty3_gen_bind g Abst c u t1 (THead -(Bind Abst) u t2) H))))))))) (ty3_gen_bind g Abst c u t2 x H0)))) -(ty3_correct g c (THead (Bind Abst) u t1) (THead (Bind Abst) u t2) H))))))). - -theorem ty3_typecheck: - \forall (g: G).(\forall (c: C).(\forall (t: T).(\forall (v: T).((ty3 g c t -v) \to (ex T (\lambda (u: T).(ty3 g c (THead (Flat Cast) v t) u))))))) -\def - \lambda (g: G).(\lambda (c: C).(\lambda (t: T).(\lambda (v: T).(\lambda (H: -(ty3 g c t v)).(ex_ind T (\lambda (t0: T).(ty3 g c v t0)) (ex T (\lambda (u: -T).(ty3 g c (THead (Flat Cast) v t) u))) (\lambda (x: T).(\lambda (H0: (ty3 g -c v x)).(ex_intro T (\lambda (u: T).(ty3 g c (THead (Flat Cast) v t) u)) v -(ty3_cast g c t v H x H0)))) (ty3_correct g c t v H)))))). - inductive sort: T \to Prop \def | sort_sort: \forall (n: nat).(sort (TSort n)) | sort_abst: \forall (u: T).((sort u) \to (\forall (t: T).((sort t) \to (sort @@ -831,7 +31,7 @@ theorem sort_nf2: (\lambda (u: T).(\lambda (_: (sort u)).(\lambda (H1: ((\forall (c: C).(nf2 c u)))).(\lambda (t0: T).(\lambda (_: (sort t0)).(\lambda (H3: ((\forall (c: C).(nf2 c t0)))).(\lambda (c: C).(let H_y \def (H3 (CHead c (Bind Abst) u)) -in (nf2_abst c u (H1 c) Abst u t0 H_y))))))))) t H)). +in (nf2_abst_shift c u (H1 c) t0 H_y))))))))) t H)). theorem sort_pc3: \forall (t1: T).((sort t1) \to (\forall (t2: T).((sort t2) \to (\forall (c: @@ -916,268 +116,3 @@ t2)) (THead (Bind Abst) u x1) (tau0_bind g Abst c u t x1 H9) (ty3_bind g c u x0 H6 Abst t x1 H10 x H12) (sort_abst u H0 x1 H11)))) (ty3_correct g (CHead c (Bind Abst) u) t x1 H10)))))) H8))))))) H4)))))))))) t1 H))). -definition pchurch_context: - T \to (T \to T) -\def - \lambda (t: T).(\lambda (u: T).(THead (Bind Abst) t (THead (Bind Abst) -(THead (Bind Abst) (lift (S O) O t) (lift (S (S O)) O t)) u))). - -definition pnat: - T \to T -\def - \lambda (t: T).(pchurch_context t (lift (S (S O)) O t)). - -definition church_body: - nat \to T -\def - let rec church_body (n: nat) on n: T \def (match n with [O \Rightarrow -(TLRef (S O)) | (S n0) \Rightarrow (THead (Flat Appl) (church_body n0) (TLRef -O))]) in church_body. - -definition pchurch: - T \to (nat \to T) -\def - \lambda (t: T).(\lambda (n: nat).(pchurch_context t (church_body n))). - -theorem pnat_props__lift_SSO_O: - \forall (t: T).(eq T (lift (S (S O)) O t) (lift (S O) O (lift (S O) O t))) -\def - \lambda (t: T).(eq_ind_r T (lift (plus (S O) (S O)) O t) (\lambda (t0: -T).(eq T (lift (S (S O)) O t) t0)) (refl_equal T (lift (plus (S O) (S O)) O -t)) (lift (S O) O (lift (S O) O t)) (lift_free t (S O) (S O) O O (le_O_n -(plus O (S O))) (le_n O))). - -theorem pnat_props__lift_SO_SO: - \forall (t: T).(eq T (lift (S O) (S O) (lift (S O) O t)) (lift (S O) O (lift -(S O) O t))) -\def - \lambda (t: T).(eq_ind nat (plus (S O) O) (\lambda (n: nat).(eq T (lift (S -O) n (lift (S O) O t)) (lift (S O) O (lift (S O) O t)))) (eq_ind_r T (lift (S -O) O (lift (S O) O t)) (\lambda (t0: T).(eq T t0 (lift (S O) O (lift (S O) O -t)))) (refl_equal T (lift (S O) O (lift (S O) O t))) (lift (S O) (plus (S O) -O) (lift (S O) O t)) (lift_d t (S O) (S O) O O (le_n O))) (S O) (refl_equal -nat (S O))). - -theorem pnat_ty3: - \forall (g: G).(\forall (c: C).(\forall (t: T).(\forall (u: T).((ty3 g c t -u) \to (\forall (n: nat).(ty3 g c (pchurch t n) (pnat t))))))) -\def - \lambda (g: G).(\lambda (c: C).(\lambda (t: T).(\lambda (u: T).(\lambda (H: -(ty3 g c t u)).(ex_ind T (\lambda (t0: T).(ty3 g c u t0)) (\forall (n: -nat).(ty3 g c (THead (Bind Abst) t (THead (Bind Abst) (THead (Bind Abst) -(lift (S O) O t) (lift (S (S O)) O t)) (church_body n))) (THead (Bind Abst) t -(THead (Bind Abst) (THead (Bind Abst) (lift (S O) O t) (lift (S (S O)) O t)) -(lift (S (S O)) O t))))) (\lambda (x: T).(\lambda (H0: (ty3 g c u -x)).(\lambda (n: nat).(nat_ind (\lambda (n0: nat).(ty3 g c (THead (Bind Abst) -t (THead (Bind Abst) (THead (Bind Abst) (lift (S O) O t) (lift (S (S O)) O -t)) (church_body n0))) (THead (Bind Abst) t (THead (Bind Abst) (THead (Bind -Abst) (lift (S O) O t) (lift (S (S O)) O t)) (lift (S (S O)) O t))))) -(ty3_bind g c t u H Abst (THead (Bind Abst) (THead (Bind Abst) (lift (S O) O -t) (lift (S (S O)) O t)) (TLRef (S O))) (THead (Bind Abst) (THead (Bind Abst) -(lift (S O) O t) (lift (S (S O)) O t)) (lift (S (S O)) O t)) (ty3_bind g -(CHead c (Bind Abst) t) (THead (Bind Abst) (lift (S O) O t) (lift (S (S O)) O -t)) (THead (Bind Abst) (lift (S O) O t) (lift (S (S O)) O u)) (ty3_bind g -(CHead c (Bind Abst) t) (lift (S O) O t) (lift (S O) O u) (ty3_lift g c t u H -(CHead c (Bind Abst) t) O (S O) (drop_drop (Bind Abst) O c c (drop_refl c) -t)) Abst (lift (S (S O)) O t) (lift (S (S O)) O u) (ty3_lift g c t u H (CHead -(CHead c (Bind Abst) t) (Bind Abst) (lift (S O) O t)) O (S (S O)) (drop_S -Abst (CHead (CHead c (Bind Abst) t) (Bind Abst) (lift (S O) O t)) c t (S O) -(drop_drop (Bind Abst) O (CHead c (Bind Abst) t) (CHead c (Bind Abst) t) -(drop_refl (CHead c (Bind Abst) t)) (lift (S O) O t)))) (lift (S (S O)) O x) -(ty3_lift g c u x H0 (CHead (CHead c (Bind Abst) t) (Bind Abst) (lift (S O) O -t)) O (S (S O)) (drop_S Abst (CHead (CHead c (Bind Abst) t) (Bind Abst) (lift -(S O) O t)) c t (S O) (drop_drop (Bind Abst) O (CHead c (Bind Abst) t) (CHead -c (Bind Abst) t) (drop_refl (CHead c (Bind Abst) t)) (lift (S O) O t))))) -Abst (TLRef (S O)) (lift (S (S O)) O t) (ty3_abst g (S O) (CHead (CHead c -(Bind Abst) t) (Bind Abst) (THead (Bind Abst) (lift (S O) O t) (lift (S (S -O)) O t))) c t (getl_head (Bind Abst) O (CHead c (Bind Abst) t) (CHead c -(Bind Abst) t) (getl_refl Abst c t) (THead (Bind Abst) (lift (S O) O t) (lift -(S (S O)) O t))) u H) (lift (S (S O)) O u) (ty3_lift g c t u H (CHead (CHead -c (Bind Abst) t) (Bind Abst) (THead (Bind Abst) (lift (S O) O t) (lift (S (S -O)) O t))) O (S (S O)) (drop_S Abst (CHead (CHead c (Bind Abst) t) (Bind -Abst) (THead (Bind Abst) (lift (S O) O t) (lift (S (S O)) O t))) c t (S O) -(drop_drop (Bind Abst) O (CHead c (Bind Abst) t) (CHead c (Bind Abst) t) -(drop_refl (CHead c (Bind Abst) t)) (THead (Bind Abst) (lift (S O) O t) (lift -(S (S O)) O t)))))) (THead (Bind Abst) (THead (Bind Abst) (lift (S O) O t) -(lift (S (S O)) O t)) (lift (S (S O)) O u)) (ty3_bind g (CHead c (Bind Abst) -t) (THead (Bind Abst) (lift (S O) O t) (lift (S (S O)) O t)) (THead (Bind -Abst) (lift (S O) O t) (lift (S (S O)) O u)) (ty3_bind g (CHead c (Bind Abst) -t) (lift (S O) O t) (lift (S O) O u) (ty3_lift g c t u H (CHead c (Bind Abst) -t) O (S O) (drop_drop (Bind Abst) O c c (drop_refl c) t)) Abst (lift (S (S -O)) O t) (lift (S (S O)) O u) (ty3_lift g c t u H (CHead (CHead c (Bind Abst) -t) (Bind Abst) (lift (S O) O t)) O (S (S O)) (drop_S Abst (CHead (CHead c -(Bind Abst) t) (Bind Abst) (lift (S O) O t)) c t (S O) (drop_drop (Bind Abst) -O (CHead c (Bind Abst) t) (CHead c (Bind Abst) t) (drop_refl (CHead c (Bind -Abst) t)) (lift (S O) O t)))) (lift (S (S O)) O x) (ty3_lift g c u x H0 -(CHead (CHead c (Bind Abst) t) (Bind Abst) (lift (S O) O t)) O (S (S O)) -(drop_S Abst (CHead (CHead c (Bind Abst) t) (Bind Abst) (lift (S O) O t)) c t -(S O) (drop_drop (Bind Abst) O (CHead c (Bind Abst) t) (CHead c (Bind Abst) -t) (drop_refl (CHead c (Bind Abst) t)) (lift (S O) O t))))) Abst (lift (S (S -O)) O t) (lift (S (S O)) O u) (ty3_lift g c t u H (CHead (CHead c (Bind Abst) -t) (Bind Abst) (THead (Bind Abst) (lift (S O) O t) (lift (S (S O)) O t))) O -(S (S O)) (drop_S Abst (CHead (CHead c (Bind Abst) t) (Bind Abst) (THead -(Bind Abst) (lift (S O) O t) (lift (S (S O)) O t))) c t (S O) (drop_drop -(Bind Abst) O (CHead c (Bind Abst) t) (CHead c (Bind Abst) t) (drop_refl -(CHead c (Bind Abst) t)) (THead (Bind Abst) (lift (S O) O t) (lift (S (S O)) -O t))))) (lift (S (S O)) O x) (ty3_lift g c u x H0 (CHead (CHead c (Bind -Abst) t) (Bind Abst) (THead (Bind Abst) (lift (S O) O t) (lift (S (S O)) O -t))) O (S (S O)) (drop_S Abst (CHead (CHead c (Bind Abst) t) (Bind Abst) -(THead (Bind Abst) (lift (S O) O t) (lift (S (S O)) O t))) c t (S O) -(drop_drop (Bind Abst) O (CHead c (Bind Abst) t) (CHead c (Bind Abst) t) -(drop_refl (CHead c (Bind Abst) t)) (THead (Bind Abst) (lift (S O) O t) (lift -(S (S O)) O t))))))) (\lambda (n0: nat).(\lambda (H1: (ty3 g c (THead (Bind -Abst) t (THead (Bind Abst) (THead (Bind Abst) (lift (S O) O t) (lift (S (S -O)) O t)) (church_body n0))) (THead (Bind Abst) t (THead (Bind Abst) (THead -(Bind Abst) (lift (S O) O t) (lift (S (S O)) O t)) (lift (S (S O)) O -t))))).(let H_x \def (ty3_gen_abst_abst g c t (THead (Bind Abst) (THead (Bind -Abst) (lift (S O) O t) (lift (S (S O)) O t)) (church_body n0)) (THead (Bind -Abst) (THead (Bind Abst) (lift (S O) O t) (lift (S (S O)) O t)) (lift (S (S -O)) O t)) H1) in (let H2 \def H_x in (ex2_ind T (\lambda (w: T).(ty3 g c t -w)) (\lambda (_: T).(ty3 g (CHead c (Bind Abst) t) (THead (Bind Abst) (THead -(Bind Abst) (lift (S O) O t) (lift (S (S O)) O t)) (church_body n0)) (THead -(Bind Abst) (THead (Bind Abst) (lift (S O) O t) (lift (S (S O)) O t)) (lift -(S (S O)) O t)))) (ty3 g c (THead (Bind Abst) t (THead (Bind Abst) (THead -(Bind Abst) (lift (S O) O t) (lift (S (S O)) O t)) (THead (Flat Appl) -(church_body n0) (TLRef O)))) (THead (Bind Abst) t (THead (Bind Abst) (THead -(Bind Abst) (lift (S O) O t) (lift (S (S O)) O t)) (lift (S (S O)) O t)))) -(\lambda (x0: T).(\lambda (_: (ty3 g c t x0)).(\lambda (H4: (ty3 g (CHead c -(Bind Abst) t) (THead (Bind Abst) (THead (Bind Abst) (lift (S O) O t) (lift -(S (S O)) O t)) (church_body n0)) (THead (Bind Abst) (THead (Bind Abst) (lift -(S O) O t) (lift (S (S O)) O t)) (lift (S (S O)) O t)))).(let H_x0 \def -(ty3_gen_abst_abst g (CHead c (Bind Abst) t) (THead (Bind Abst) (lift (S O) O -t) (lift (S (S O)) O t)) (church_body n0) (lift (S (S O)) O t) H4) in (let H5 -\def H_x0 in (ex2_ind T (\lambda (w: T).(ty3 g (CHead c (Bind Abst) t) (THead -(Bind Abst) (lift (S O) O t) (lift (S (S O)) O t)) w)) (\lambda (_: T).(ty3 g -(CHead (CHead c (Bind Abst) t) (Bind Abst) (THead (Bind Abst) (lift (S O) O -t) (lift (S (S O)) O t))) (church_body n0) (lift (S (S O)) O t))) (ty3 g c -(THead (Bind Abst) t (THead (Bind Abst) (THead (Bind Abst) (lift (S O) O t) -(lift (S (S O)) O t)) (THead (Flat Appl) (church_body n0) (TLRef O)))) (THead -(Bind Abst) t (THead (Bind Abst) (THead (Bind Abst) (lift (S O) O t) (lift (S -(S O)) O t)) (lift (S (S O)) O t)))) (\lambda (x1: T).(\lambda (H6: (ty3 g -(CHead c (Bind Abst) t) (THead (Bind Abst) (lift (S O) O t) (lift (S (S O)) O -t)) x1)).(\lambda (H7: (ty3 g (CHead (CHead c (Bind Abst) t) (Bind Abst) -(THead (Bind Abst) (lift (S O) O t) (lift (S (S O)) O t))) (church_body n0) -(lift (S (S O)) O t))).(ty3_bind g c t u H Abst (THead (Bind Abst) (THead -(Bind Abst) (lift (S O) O t) (lift (S (S O)) O t)) (THead (Flat Appl) -(church_body n0) (TLRef O))) (THead (Bind Abst) (THead (Bind Abst) (lift (S -O) O t) (lift (S (S O)) O t)) (lift (S (S O)) O t)) (ty3_bind g (CHead c -(Bind Abst) t) (THead (Bind Abst) (lift (S O) O t) (lift (S (S O)) O t)) -(THead (Bind Abst) (lift (S O) O t) (lift (S (S O)) O u)) (ty3_bind g (CHead -c (Bind Abst) t) (lift (S O) O t) (lift (S O) O u) (ty3_lift g c t u H (CHead -c (Bind Abst) t) O (S O) (drop_drop (Bind Abst) O c c (drop_refl c) t)) Abst -(lift (S (S O)) O t) (lift (S (S O)) O u) (ty3_lift g c t u H (CHead (CHead c -(Bind Abst) t) (Bind Abst) (lift (S O) O t)) O (S (S O)) (drop_S Abst (CHead -(CHead c (Bind Abst) t) (Bind Abst) (lift (S O) O t)) c t (S O) (drop_drop -(Bind Abst) O (CHead c (Bind Abst) t) (CHead c (Bind Abst) t) (drop_refl -(CHead c (Bind Abst) t)) (lift (S O) O t)))) (lift (S (S O)) O x) (ty3_lift g -c u x H0 (CHead (CHead c (Bind Abst) t) (Bind Abst) (lift (S O) O t)) O (S (S -O)) (drop_S Abst (CHead (CHead c (Bind Abst) t) (Bind Abst) (lift (S O) O t)) -c t (S O) (drop_drop (Bind Abst) O (CHead c (Bind Abst) t) (CHead c (Bind -Abst) t) (drop_refl (CHead c (Bind Abst) t)) (lift (S O) O t))))) Abst (THead -(Flat Appl) (church_body n0) (TLRef O)) (lift (S (S O)) O t) (ex_ind T -(\lambda (t0: T).(ty3 g (CHead (CHead c (Bind Abst) t) (Bind Abst) (THead -(Bind Abst) (lift (S O) O t) (lift (S (S O)) O t))) (lift (S (S O)) O t) t0)) -(ty3 g (CHead (CHead c (Bind Abst) t) (Bind Abst) (THead (Bind Abst) (lift (S -O) O t) (lift (S (S O)) O t))) (THead (Flat Appl) (church_body n0) (TLRef O)) -(lift (S (S O)) O t)) (\lambda (x2: T).(\lambda (H8: (ty3 g (CHead (CHead c -(Bind Abst) t) (Bind Abst) (THead (Bind Abst) (lift (S O) O t) (lift (S (S -O)) O t))) (lift (S (S O)) O t) x2)).(ty3_conv g (CHead (CHead c (Bind Abst) -t) (Bind Abst) (THead (Bind Abst) (lift (S O) O t) (lift (S (S O)) O t))) -(lift (S (S O)) O t) x2 H8 (THead (Flat Appl) (church_body n0) (TLRef O)) -(THead (Flat Appl) (church_body n0) (THead (Bind Abst) (lift (S (S O)) O t) -(lift (S O) (S O) (lift (S O) O (lift (S O) O t))))) (ty3_appl g (CHead -(CHead c (Bind Abst) t) (Bind Abst) (THead (Bind Abst) (lift (S O) O t) (lift -(S (S O)) O t))) (church_body n0) (lift (S (S O)) O t) H7 (TLRef O) (lift (S -O) (S O) (lift (S O) O (lift (S O) O t))) (eq_ind_r T (lift (S O) O (lift (S -O) O t)) (\lambda (t0: T).(ty3 g (CHead (CHead c (Bind Abst) t) (Bind Abst) -(THead (Bind Abst) (lift (S O) O t) t0)) (TLRef O) (THead (Bind Abst) t0 -(lift (S O) (S O) (lift (S O) O (lift (S O) O t)))))) (let H9 \def (eq_ind T -(lift (S (S O)) O t) (\lambda (t0: T).(ty3 g (CHead c (Bind Abst) t) (THead -(Bind Abst) (lift (S O) O t) t0) x1)) H6 (lift (S O) O (lift (S O) O t)) -(pnat_props__lift_SSO_O t)) in (eq_ind T (lift (S O) O (THead (Bind Abst) -(lift (S O) O t) (lift (S O) O (lift (S O) O t)))) (\lambda (t0: T).(ty3 g -(CHead (CHead c (Bind Abst) t) (Bind Abst) (THead (Bind Abst) (lift (S O) O -t) (lift (S O) O (lift (S O) O t)))) (TLRef O) t0)) (ty3_abst g O (CHead -(CHead c (Bind Abst) t) (Bind Abst) (THead (Bind Abst) (lift (S O) O t) (lift -(S O) O (lift (S O) O t)))) (CHead c (Bind Abst) t) (THead (Bind Abst) (lift -(S O) O t) (lift (S O) O (lift (S O) O t))) (getl_refl Abst (CHead c (Bind -Abst) t) (THead (Bind Abst) (lift (S O) O t) (lift (S O) O (lift (S O) O -t)))) x1 H9) (THead (Bind Abst) (lift (S O) O (lift (S O) O t)) (lift (S O) -(S O) (lift (S O) O (lift (S O) O t)))) (lift_bind Abst (lift (S O) O t) -(lift (S O) O (lift (S O) O t)) (S O) O))) (lift (S (S O)) O t) -(pnat_props__lift_SSO_O t))) (eq_ind_r T (lift (S O) O (lift (S O) O (lift (S -O) O t))) (\lambda (t0: T).(pc3 (CHead (CHead c (Bind Abst) t) (Bind Abst) -(THead (Bind Abst) (lift (S O) O t) (lift (S (S O)) O t))) (THead (Flat Appl) -(church_body n0) (THead (Bind Abst) (lift (S (S O)) O t) t0)) (lift (S (S O)) -O t))) (eq_ind_r T (lift (S O) O (lift (S O) O t)) (\lambda (t0: T).(pc3 -(CHead (CHead c (Bind Abst) t) (Bind Abst) (THead (Bind Abst) (lift (S O) O -t) t0)) (THead (Flat Appl) (church_body n0) (THead (Bind Abst) t0 (lift (S O) -O (lift (S O) O (lift (S O) O t))))) t0)) (pc3_pr3_r (CHead (CHead c (Bind -Abst) t) (Bind Abst) (THead (Bind Abst) (lift (S O) O t) (lift (S O) O (lift -(S O) O t)))) (THead (Flat Appl) (church_body n0) (THead (Bind Abst) (lift (S -O) O (lift (S O) O t)) (lift (S O) O (lift (S O) O (lift (S O) O t))))) (lift -(S O) O (lift (S O) O t)) (pr3_t (THead (Bind Abbr) (church_body n0) (lift (S -O) O (lift (S O) O (lift (S O) O t)))) (THead (Flat Appl) (church_body n0) -(THead (Bind Abst) (lift (S O) O (lift (S O) O t)) (lift (S O) O (lift (S O) -O (lift (S O) O t))))) (CHead (CHead c (Bind Abst) t) (Bind Abst) (THead -(Bind Abst) (lift (S O) O t) (lift (S O) O (lift (S O) O t)))) (pr3_pr2 -(CHead (CHead c (Bind Abst) t) (Bind Abst) (THead (Bind Abst) (lift (S O) O -t) (lift (S O) O (lift (S O) O t)))) (THead (Flat Appl) (church_body n0) -(THead (Bind Abst) (lift (S O) O (lift (S O) O t)) (lift (S O) O (lift (S O) -O (lift (S O) O t))))) (THead (Bind Abbr) (church_body n0) (lift (S O) O -(lift (S O) O (lift (S O) O t)))) (pr2_free (CHead (CHead c (Bind Abst) t) -(Bind Abst) (THead (Bind Abst) (lift (S O) O t) (lift (S O) O (lift (S O) O -t)))) (THead (Flat Appl) (church_body n0) (THead (Bind Abst) (lift (S O) O -(lift (S O) O t)) (lift (S O) O (lift (S O) O (lift (S O) O t))))) (THead -(Bind Abbr) (church_body n0) (lift (S O) O (lift (S O) O (lift (S O) O t)))) -(pr0_beta (lift (S O) O (lift (S O) O t)) (church_body n0) (church_body n0) -(pr0_refl (church_body n0)) (lift (S O) O (lift (S O) O (lift (S O) O t))) -(lift (S O) O (lift (S O) O (lift (S O) O t))) (pr0_refl (lift (S O) O (lift -(S O) O (lift (S O) O t))))))) (lift (S O) O (lift (S O) O t)) (pr3_pr2 -(CHead (CHead c (Bind Abst) t) (Bind Abst) (THead (Bind Abst) (lift (S O) O -t) (lift (S O) O (lift (S O) O t)))) (THead (Bind Abbr) (church_body n0) -(lift (S O) O (lift (S O) O (lift (S O) O t)))) (lift (S O) O (lift (S O) O -t)) (pr2_free (CHead (CHead c (Bind Abst) t) (Bind Abst) (THead (Bind Abst) -(lift (S O) O t) (lift (S O) O (lift (S O) O t)))) (THead (Bind Abbr) -(church_body n0) (lift (S O) O (lift (S O) O (lift (S O) O t)))) (lift (S O) -O (lift (S O) O t)) (pr0_zeta Abbr not_abbr_abst (lift (S O) O (lift (S O) O -t)) (lift (S O) O (lift (S O) O t)) (pr0_refl (lift (S O) O (lift (S O) O -t))) (church_body n0)))))) (lift (S (S O)) O t) (pnat_props__lift_SSO_O t)) -(lift (S O) (S O) (lift (S O) O (lift (S O) O t))) (pnat_props__lift_SO_SO -(lift (S O) O t)))))) (ty3_correct g (CHead (CHead c (Bind Abst) t) (Bind -Abst) (THead (Bind Abst) (lift (S O) O t) (lift (S (S O)) O t))) (church_body -n0) (lift (S (S O)) O t) H7)) (lift (S (S O)) O u) (ty3_lift g c t u H (CHead -(CHead c (Bind Abst) t) (Bind Abst) (THead (Bind Abst) (lift (S O) O t) (lift -(S (S O)) O t))) O (S (S O)) (drop_S Abst (CHead (CHead c (Bind Abst) t) -(Bind Abst) (THead (Bind Abst) (lift (S O) O t) (lift (S (S O)) O t))) c t (S -O) (drop_drop (Bind Abst) O (CHead c (Bind Abst) t) (CHead c (Bind Abst) t) -(drop_refl (CHead c (Bind Abst) t)) (THead (Bind Abst) (lift (S O) O t) (lift -(S (S O)) O t)))))) (THead (Bind Abst) (THead (Bind Abst) (lift (S O) O t) -(lift (S (S O)) O t)) (lift (S (S O)) O u)) (ty3_bind g (CHead c (Bind Abst) -t) (THead (Bind Abst) (lift (S O) O t) (lift (S (S O)) O t)) (THead (Bind -Abst) (lift (S O) O t) (lift (S (S O)) O u)) (ty3_bind g (CHead c (Bind Abst) -t) (lift (S O) O t) (lift (S O) O u) (ty3_lift g c t u H (CHead c (Bind Abst) -t) O (S O) (drop_drop (Bind Abst) O c c (drop_refl c) t)) Abst (lift (S (S -O)) O t) (lift (S (S O)) O u) (ty3_lift g c t u H (CHead (CHead c (Bind Abst) -t) (Bind Abst) (lift (S O) O t)) O (S (S O)) (drop_S Abst (CHead (CHead c -(Bind Abst) t) (Bind Abst) (lift (S O) O t)) c t (S O) (drop_drop (Bind Abst) -O (CHead c (Bind Abst) t) (CHead c (Bind Abst) t) (drop_refl (CHead c (Bind -Abst) t)) (lift (S O) O t)))) (lift (S (S O)) O x) (ty3_lift g c u x H0 -(CHead (CHead c (Bind Abst) t) (Bind Abst) (lift (S O) O t)) O (S (S O)) -(drop_S Abst (CHead (CHead c (Bind Abst) t) (Bind Abst) (lift (S O) O t)) c t -(S O) (drop_drop (Bind Abst) O (CHead c (Bind Abst) t) (CHead c (Bind Abst) -t) (drop_refl (CHead c (Bind Abst) t)) (lift (S O) O t))))) Abst (lift (S (S -O)) O t) (lift (S (S O)) O u) (ty3_lift g c t u H (CHead (CHead c (Bind Abst) -t) (Bind Abst) (THead (Bind Abst) (lift (S O) O t) (lift (S (S O)) O t))) O -(S (S O)) (drop_S Abst (CHead (CHead c (Bind Abst) t) (Bind Abst) (THead -(Bind Abst) (lift (S O) O t) (lift (S (S O)) O t))) c t (S O) (drop_drop -(Bind Abst) O (CHead c (Bind Abst) t) (CHead c (Bind Abst) t) (drop_refl -(CHead c (Bind Abst) t)) (THead (Bind Abst) (lift (S O) O t) (lift (S (S O)) -O t))))) (lift (S (S O)) O x) (ty3_lift g c u x H0 (CHead (CHead c (Bind -Abst) t) (Bind Abst) (THead (Bind Abst) (lift (S O) O t) (lift (S (S O)) O -t))) O (S (S O)) (drop_S Abst (CHead (CHead c (Bind Abst) t) (Bind Abst) -(THead (Bind Abst) (lift (S O) O t) (lift (S (S O)) O t))) c t (S O) -(drop_drop (Bind Abst) O (CHead c (Bind Abst) t) (CHead c (Bind Abst) t) -(drop_refl (CHead c (Bind Abst) t)) (THead (Bind Abst) (lift (S O) O t) (lift -(S (S O)) O t)))))))))) H5)))))) H2))))) n)))) (ty3_correct g c t u H)))))). - diff --git a/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/theory.ma b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/theory.ma index 4f117d302..c8f4922b1 100644 --- a/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/theory.ma +++ b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/theory.ma @@ -26,9 +26,13 @@ include "wcpr0/fwd.ma". include "pr3/wcpr0.ma". +include "ex2/props.ma". + include "ex1/props.ma". include "ty3/tau0.ma". +include "ty3/nf2.ma". + include "ty3/dec.ma". diff --git a/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/ty3/arity.ma b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/ty3/arity.ma index 9db7a645c..25d4ad924 100644 --- a/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/ty3/arity.ma +++ b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/ty3/arity.ma @@ -16,7 +16,7 @@ set "baseuri" "cic:/matita/LAMBDA-TYPES/LambdaDelta-1/ty3/arity". -include "ty3/defs.ma". +include "ty3/pr3_props.ma". include "arity/pr3.ma". diff --git a/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/ty3/arity_props.ma b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/ty3/arity_props.ma index c42884171..2f758d80c 100644 --- a/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/ty3/arity_props.ma +++ b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/ty3/arity_props.ma @@ -53,6 +53,39 @@ x4)).(let H13 \def (eq_ind A x (\lambda (a: A).(arity g c v (asucc g a))) H8 c v (asucc g (AHead x3 x4)) H13 (asucc g x3) H11) P))))))) H9))))) H6))))))))))) (ty3_gen_bind g Abst c v t u H1)))))))))). +theorem ty3_repellent: + \forall (g: G).(\forall (c: C).(\forall (w: T).(\forall (t: T).(\forall (u1: +T).((ty3 g c (THead (Bind Abst) w t) u1) \to (\forall (u2: T).((ty3 g (CHead +c (Bind Abst) w) t (lift (S O) O u2)) \to ((pc3 c u1 u2) \to (\forall (P: +Prop).P))))))))) +\def + \lambda (g: G).(\lambda (c: C).(\lambda (w: T).(\lambda (t: T).(\lambda (u1: +T).(\lambda (H: (ty3 g c (THead (Bind Abst) w t) u1)).(\lambda (u2: +T).(\lambda (H0: (ty3 g (CHead c (Bind Abst) w) t (lift (S O) O +u2))).(\lambda (H1: (pc3 c u1 u2)).(\lambda (P: Prop).(ex_ind T (\lambda (t0: +T).(ty3 g (CHead c (Bind Abst) w) (lift (S O) O u2) t0)) P (\lambda (x: +T).(\lambda (H2: (ty3 g (CHead c (Bind Abst) w) (lift (S O) O u2) x)).(let H3 +\def (ty3_gen_lift g (CHead c (Bind Abst) w) u2 x (S O) O H2 c (drop_drop +(Bind Abst) O c c (drop_refl c) w)) in (ex2_ind T (\lambda (t2: T).(pc3 +(CHead c (Bind Abst) w) (lift (S O) O t2) x)) (\lambda (t2: T).(ty3 g c u2 +t2)) P (\lambda (x0: T).(\lambda (_: (pc3 (CHead c (Bind Abst) w) (lift (S O) +O x0) x)).(\lambda (H5: (ty3 g c u2 x0)).(let H_y \def (ty3_conv g c u2 x0 H5 +(THead (Bind Abst) w t) u1 H H1) in (let H_x \def (ty3_arity g (CHead c (Bind +Abst) w) t (lift (S O) O u2) H0) in (let H6 \def H_x in (ex2_ind A (\lambda +(a1: A).(arity g (CHead c (Bind Abst) w) t a1)) (\lambda (a1: A).(arity g +(CHead c (Bind Abst) w) (lift (S O) O u2) (asucc g a1))) P (\lambda (x1: +A).(\lambda (H7: (arity g (CHead c (Bind Abst) w) t x1)).(\lambda (H8: (arity +g (CHead c (Bind Abst) w) (lift (S O) O u2) (asucc g x1))).(let H_x0 \def +(ty3_arity g c (THead (Bind Abst) w t) u2 H_y) in (let H9 \def H_x0 in +(ex2_ind A (\lambda (a1: A).(arity g c (THead (Bind Abst) w t) a1)) (\lambda +(a1: A).(arity g c u2 (asucc g a1))) P (\lambda (x2: A).(\lambda (H10: (arity +g c (THead (Bind Abst) w t) x2)).(\lambda (H11: (arity g c u2 (asucc g +x2))).(arity_repellent g c w t x1 H7 x2 H10 (asucc_inj g x1 x2 (arity_mono g +c u2 (asucc g x1) (arity_gen_lift g (CHead c (Bind Abst) w) u2 (asucc g x1) +(S O) O H8 c (drop_drop (Bind Abst) O c c (drop_refl c) w)) (asucc g x2) +H11)) P)))) H9)))))) H6))))))) H3)))) (ty3_correct g (CHead c (Bind Abst) w) +t (lift (S O) O u2) H0))))))))))). + theorem ty3_acyclic: \forall (g: G).(\forall (c: C).(\forall (t: T).(\forall (u: T).((ty3 g c t u) \to ((pc3 c u t) \to (\forall (P: Prop).P)))))) diff --git a/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/ty3/nf2.ma b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/ty3/nf2.ma new file mode 100644 index 000000000..aad32f384 --- /dev/null +++ b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/ty3/nf2.ma @@ -0,0 +1,160 @@ +(**************************************************************************) +(* ___ *) +(* ||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/LambdaDelta-1/ty3/nf2". + +include "ty3/arity.ma". + +include "nf2/arity.ma". + +theorem ty3_nf2_inv_all: + \forall (g: G).(\forall (c: C).(\forall (t: T).(\forall (u: T).((ty3 g c t +u) \to ((nf2 c t) \to (or3 (ex3_2 T T (\lambda (w: T).(\lambda (u0: T).(eq T +t (THead (Bind Abst) w u0)))) (\lambda (w: T).(\lambda (_: T).(nf2 c w))) +(\lambda (w: T).(\lambda (u0: T).(nf2 (CHead c (Bind Abst) w) u0)))) (ex nat +(\lambda (n: nat).(eq T t (TSort n)))) (ex3_2 TList nat (\lambda (ws: +TList).(\lambda (i: nat).(eq T t (THeads (Flat Appl) ws (TLRef i))))) +(\lambda (ws: TList).(\lambda (_: nat).(nfs2 c ws))) (\lambda (_: +TList).(\lambda (i: nat).(nf2 c (TLRef i))))))))))) +\def + \lambda (g: G).(\lambda (c: C).(\lambda (t: T).(\lambda (u: T).(\lambda (H: +(ty3 g c t u)).(\lambda (H0: (nf2 c t)).(let H_x \def (ty3_arity g c t u H) +in (let H1 \def H_x in (ex2_ind A (\lambda (a1: A).(arity g c t a1)) (\lambda +(a1: A).(arity g c u (asucc g a1))) (or3 (ex3_2 T T (\lambda (w: T).(\lambda +(u0: T).(eq T t (THead (Bind Abst) w u0)))) (\lambda (w: T).(\lambda (_: +T).(nf2 c w))) (\lambda (w: T).(\lambda (u0: T).(nf2 (CHead c (Bind Abst) w) +u0)))) (ex nat (\lambda (n: nat).(eq T t (TSort n)))) (ex3_2 TList nat +(\lambda (ws: TList).(\lambda (i: nat).(eq T t (THeads (Flat Appl) ws (TLRef +i))))) (\lambda (ws: TList).(\lambda (_: nat).(nfs2 c ws))) (\lambda (_: +TList).(\lambda (i: nat).(nf2 c (TLRef i)))))) (\lambda (x: A).(\lambda (H2: +(arity g c t x)).(\lambda (_: (arity g c u (asucc g x))).(arity_nf2_inv_all g +c t x H2 H0)))) H1)))))))). + +theorem ty3_nf2_inv_sort: + \forall (g: G).(\forall (c: C).(\forall (t: T).(\forall (m: nat).((ty3 g c t +(TSort m)) \to ((nf2 c t) \to (or (ex2 nat (\lambda (n: nat).(eq T t (TSort +n))) (\lambda (n: nat).(eq nat m (next g n)))) (ex3_2 TList nat (\lambda (ws: +TList).(\lambda (i: nat).(eq T t (THeads (Flat Appl) ws (TLRef i))))) +(\lambda (ws: TList).(\lambda (_: nat).(nfs2 c ws))) (\lambda (_: +TList).(\lambda (i: nat).(nf2 c (TLRef i))))))))))) +\def + \lambda (g: G).(\lambda (c: C).(\lambda (t: T).(\lambda (m: nat).(\lambda +(H: (ty3 g c t (TSort m))).(\lambda (H0: (nf2 c t)).(let H_x \def +(ty3_nf2_inv_all g c t (TSort m) H H0) in (let H1 \def H_x in (or3_ind (ex3_2 +T T (\lambda (w: T).(\lambda (u: T).(eq T t (THead (Bind Abst) w u)))) +(\lambda (w: T).(\lambda (_: T).(nf2 c w))) (\lambda (w: T).(\lambda (u: +T).(nf2 (CHead c (Bind Abst) w) u)))) (ex nat (\lambda (n: nat).(eq T t +(TSort n)))) (ex3_2 TList nat (\lambda (ws: TList).(\lambda (i: nat).(eq T t +(THeads (Flat Appl) ws (TLRef i))))) (\lambda (ws: TList).(\lambda (_: +nat).(nfs2 c ws))) (\lambda (_: TList).(\lambda (i: nat).(nf2 c (TLRef i))))) +(or (ex2 nat (\lambda (n: nat).(eq T t (TSort n))) (\lambda (n: nat).(eq nat +m (next g n)))) (ex3_2 TList nat (\lambda (ws: TList).(\lambda (i: nat).(eq T +t (THeads (Flat Appl) ws (TLRef i))))) (\lambda (ws: TList).(\lambda (_: +nat).(nfs2 c ws))) (\lambda (_: TList).(\lambda (i: nat).(nf2 c (TLRef +i)))))) (\lambda (H2: (ex3_2 T T (\lambda (w: T).(\lambda (u: T).(eq T t +(THead (Bind Abst) w u)))) (\lambda (w: T).(\lambda (_: T).(nf2 c w))) +(\lambda (w: T).(\lambda (u: T).(nf2 (CHead c (Bind Abst) w) +u))))).(ex3_2_ind T T (\lambda (w: T).(\lambda (u: T).(eq T t (THead (Bind +Abst) w u)))) (\lambda (w: T).(\lambda (_: T).(nf2 c w))) (\lambda (w: +T).(\lambda (u: T).(nf2 (CHead c (Bind Abst) w) u))) (or (ex2 nat (\lambda +(n: nat).(eq T t (TSort n))) (\lambda (n: nat).(eq nat m (next g n)))) (ex3_2 +TList nat (\lambda (ws: TList).(\lambda (i: nat).(eq T t (THeads (Flat Appl) +ws (TLRef i))))) (\lambda (ws: TList).(\lambda (_: nat).(nfs2 c ws))) +(\lambda (_: TList).(\lambda (i: nat).(nf2 c (TLRef i)))))) (\lambda (x0: +T).(\lambda (x1: T).(\lambda (H3: (eq T t (THead (Bind Abst) x0 +x1))).(\lambda (_: (nf2 c x0)).(\lambda (_: (nf2 (CHead c (Bind Abst) x0) +x1)).(let H6 \def (eq_ind T t (\lambda (t0: T).(ty3 g c t0 (TSort m))) H +(THead (Bind Abst) x0 x1) H3) in (eq_ind_r T (THead (Bind Abst) x0 x1) +(\lambda (t0: T).(or (ex2 nat (\lambda (n: nat).(eq T t0 (TSort n))) (\lambda +(n: nat).(eq nat m (next g n)))) (ex3_2 TList nat (\lambda (ws: +TList).(\lambda (i: nat).(eq T t0 (THeads (Flat Appl) ws (TLRef i))))) +(\lambda (ws: TList).(\lambda (_: nat).(nfs2 c ws))) (\lambda (_: +TList).(\lambda (i: nat).(nf2 c (TLRef i))))))) (ex4_3_ind T T T (\lambda +(t2: T).(\lambda (_: T).(\lambda (_: T).(pc3 c (THead (Bind Abst) x0 t2) +(TSort m))))) (\lambda (_: T).(\lambda (t0: T).(\lambda (_: T).(ty3 g c x0 +t0)))) (\lambda (t2: T).(\lambda (_: T).(\lambda (_: T).(ty3 g (CHead c (Bind +Abst) x0) x1 t2)))) (\lambda (t2: T).(\lambda (_: T).(\lambda (t1: T).(ty3 g +(CHead c (Bind Abst) x0) t2 t1)))) (or (ex2 nat (\lambda (n: nat).(eq T +(THead (Bind Abst) x0 x1) (TSort n))) (\lambda (n: nat).(eq nat m (next g +n)))) (ex3_2 TList nat (\lambda (ws: TList).(\lambda (i: nat).(eq T (THead +(Bind Abst) x0 x1) (THeads (Flat Appl) ws (TLRef i))))) (\lambda (ws: +TList).(\lambda (_: nat).(nfs2 c ws))) (\lambda (_: TList).(\lambda (i: +nat).(nf2 c (TLRef i)))))) (\lambda (x2: T).(\lambda (x3: T).(\lambda (x4: +T).(\lambda (H7: (pc3 c (THead (Bind Abst) x0 x2) (TSort m))).(\lambda (_: +(ty3 g c x0 x3)).(\lambda (_: (ty3 g (CHead c (Bind Abst) x0) x1 +x2)).(\lambda (_: (ty3 g (CHead c (Bind Abst) x0) x2 x4)).(pc3_gen_sort_abst +c x0 x2 m (pc3_s c (TSort m) (THead (Bind Abst) x0 x2) H7) (or (ex2 nat +(\lambda (n: nat).(eq T (THead (Bind Abst) x0 x1) (TSort n))) (\lambda (n: +nat).(eq nat m (next g n)))) (ex3_2 TList nat (\lambda (ws: TList).(\lambda +(i: nat).(eq T (THead (Bind Abst) x0 x1) (THeads (Flat Appl) ws (TLRef i))))) +(\lambda (ws: TList).(\lambda (_: nat).(nfs2 c ws))) (\lambda (_: +TList).(\lambda (i: nat).(nf2 c (TLRef i)))))))))))))) (ty3_gen_bind g Abst c +x0 x1 (TSort m) H6)) t H3))))))) H2)) (\lambda (H2: (ex nat (\lambda (n: +nat).(eq T t (TSort n))))).(ex_ind nat (\lambda (n: nat).(eq T t (TSort n))) +(or (ex2 nat (\lambda (n: nat).(eq T t (TSort n))) (\lambda (n: nat).(eq nat +m (next g n)))) (ex3_2 TList nat (\lambda (ws: TList).(\lambda (i: nat).(eq T +t (THeads (Flat Appl) ws (TLRef i))))) (\lambda (ws: TList).(\lambda (_: +nat).(nfs2 c ws))) (\lambda (_: TList).(\lambda (i: nat).(nf2 c (TLRef +i)))))) (\lambda (x: nat).(\lambda (H3: (eq T t (TSort x))).(let H4 \def +(eq_ind T t (\lambda (t0: T).(ty3 g c t0 (TSort m))) H (TSort x) H3) in +(eq_ind_r T (TSort x) (\lambda (t0: T).(or (ex2 nat (\lambda (n: nat).(eq T +t0 (TSort n))) (\lambda (n: nat).(eq nat m (next g n)))) (ex3_2 TList nat +(\lambda (ws: TList).(\lambda (i: nat).(eq T t0 (THeads (Flat Appl) ws (TLRef +i))))) (\lambda (ws: TList).(\lambda (_: nat).(nfs2 c ws))) (\lambda (_: +TList).(\lambda (i: nat).(nf2 c (TLRef i))))))) (eq_ind nat (next g x) +(\lambda (n: nat).(or (ex2 nat (\lambda (n0: nat).(eq T (TSort x) (TSort +n0))) (\lambda (n0: nat).(eq nat n (next g n0)))) (ex3_2 TList nat (\lambda +(ws: TList).(\lambda (i: nat).(eq T (TSort x) (THeads (Flat Appl) ws (TLRef +i))))) (\lambda (ws: TList).(\lambda (_: nat).(nfs2 c ws))) (\lambda (_: +TList).(\lambda (i: nat).(nf2 c (TLRef i))))))) (or_introl (ex2 nat (\lambda +(n: nat).(eq T (TSort x) (TSort n))) (\lambda (n: nat).(eq nat (next g x) +(next g n)))) (ex3_2 TList nat (\lambda (ws: TList).(\lambda (i: nat).(eq T +(TSort x) (THeads (Flat Appl) ws (TLRef i))))) (\lambda (ws: TList).(\lambda +(_: nat).(nfs2 c ws))) (\lambda (_: TList).(\lambda (i: nat).(nf2 c (TLRef +i))))) (ex_intro2 nat (\lambda (n: nat).(eq T (TSort x) (TSort n))) (\lambda +(n: nat).(eq nat (next g x) (next g n))) x (refl_equal T (TSort x)) +(refl_equal nat (next g x)))) m (pc3_gen_sort c (next g x) m (ty3_gen_sort g +c (TSort m) x H4))) t H3)))) H2)) (\lambda (H2: (ex3_2 TList nat (\lambda +(ws: TList).(\lambda (i: nat).(eq T t (THeads (Flat Appl) ws (TLRef i))))) +(\lambda (ws: TList).(\lambda (_: nat).(nfs2 c ws))) (\lambda (_: +TList).(\lambda (i: nat).(nf2 c (TLRef i)))))).(ex3_2_ind TList nat (\lambda +(ws: TList).(\lambda (i: nat).(eq T t (THeads (Flat Appl) ws (TLRef i))))) +(\lambda (ws: TList).(\lambda (_: nat).(nfs2 c ws))) (\lambda (_: +TList).(\lambda (i: nat).(nf2 c (TLRef i)))) (or (ex2 nat (\lambda (n: +nat).(eq T t (TSort n))) (\lambda (n: nat).(eq nat m (next g n)))) (ex3_2 +TList nat (\lambda (ws: TList).(\lambda (i: nat).(eq T t (THeads (Flat Appl) +ws (TLRef i))))) (\lambda (ws: TList).(\lambda (_: nat).(nfs2 c ws))) +(\lambda (_: TList).(\lambda (i: nat).(nf2 c (TLRef i)))))) (\lambda (x0: +TList).(\lambda (x1: nat).(\lambda (H3: (eq T t (THeads (Flat Appl) x0 (TLRef +x1)))).(\lambda (H4: (nfs2 c x0)).(\lambda (H5: (nf2 c (TLRef x1))).(let H6 +\def (eq_ind T t (\lambda (t0: T).(ty3 g c t0 (TSort m))) H (THeads (Flat +Appl) x0 (TLRef x1)) H3) in (eq_ind_r T (THeads (Flat Appl) x0 (TLRef x1)) +(\lambda (t0: T).(or (ex2 nat (\lambda (n: nat).(eq T t0 (TSort n))) (\lambda +(n: nat).(eq nat m (next g n)))) (ex3_2 TList nat (\lambda (ws: +TList).(\lambda (i: nat).(eq T t0 (THeads (Flat Appl) ws (TLRef i))))) +(\lambda (ws: TList).(\lambda (_: nat).(nfs2 c ws))) (\lambda (_: +TList).(\lambda (i: nat).(nf2 c (TLRef i))))))) (or_intror (ex2 nat (\lambda +(n: nat).(eq T (THeads (Flat Appl) x0 (TLRef x1)) (TSort n))) (\lambda (n: +nat).(eq nat m (next g n)))) (ex3_2 TList nat (\lambda (ws: TList).(\lambda +(i: nat).(eq T (THeads (Flat Appl) x0 (TLRef x1)) (THeads (Flat Appl) ws +(TLRef i))))) (\lambda (ws: TList).(\lambda (_: nat).(nfs2 c ws))) (\lambda +(_: TList).(\lambda (i: nat).(nf2 c (TLRef i))))) (ex3_2_intro TList nat +(\lambda (ws: TList).(\lambda (i: nat).(eq T (THeads (Flat Appl) x0 (TLRef +x1)) (THeads (Flat Appl) ws (TLRef i))))) (\lambda (ws: TList).(\lambda (_: +nat).(nfs2 c ws))) (\lambda (_: TList).(\lambda (i: nat).(nf2 c (TLRef i)))) +x0 x1 (refl_equal T (THeads (Flat Appl) x0 (TLRef x1))) H4 H5)) t H3))))))) +H2)) H1)))))))). + diff --git a/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/ty3/props.ma b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/ty3/props.ma index 053b5d677..4fe0d6385 100644 --- a/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/ty3/props.ma +++ b/helm/software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1/ty3/props.ma @@ -18,6 +18,8 @@ set "baseuri" "cic:/matita/LAMBDA-TYPES/LambdaDelta-1/ty3/props". include "ty3/fwd.ma". +include "pc3/fwd.ma". + theorem ty3_lift: \forall (g: G).(\forall (e: C).(\forall (t1: T).(\forall (t2: T).((ty3 g e t1 t2) \to (\forall (c: C).(\forall (d: nat).(\forall (h: nat).((drop h d c @@ -420,3 +422,53 @@ t4)).(and_ind (pc3 c0 t2 t4) (ty3 g c0 t0 t2) (pc3 c0 t2 t4) (\lambda (H5: (pc3 c0 t2 t4)).(\lambda (_: (ty3 g c0 t0 t2)).H5)) (ty3_gen_cast g c0 t0 t2 t4 H4)))))))))))) c u t1 H))))). +theorem ty3_gen_abst_abst: + \forall (g: G).(\forall (c: C).(\forall (u: T).(\forall (t1: T).(\forall +(t2: T).((ty3 g c (THead (Bind Abst) u t1) (THead (Bind Abst) u t2)) \to (ex2 +T (\lambda (w: T).(ty3 g c u w)) (\lambda (_: T).(ty3 g (CHead c (Bind Abst) +u) t1 t2)))))))) +\def + \lambda (g: G).(\lambda (c: C).(\lambda (u: T).(\lambda (t1: T).(\lambda +(t2: T).(\lambda (H: (ty3 g c (THead (Bind Abst) u t1) (THead (Bind Abst) u +t2))).(ex_ind T (\lambda (t: T).(ty3 g c (THead (Bind Abst) u t2) t)) (ex2 T +(\lambda (w: T).(ty3 g c u w)) (\lambda (_: T).(ty3 g (CHead c (Bind Abst) u) +t1 t2))) (\lambda (x: T).(\lambda (H0: (ty3 g c (THead (Bind Abst) u t2) +x)).(ex4_3_ind T T T (\lambda (t3: T).(\lambda (_: T).(\lambda (_: T).(pc3 c +(THead (Bind Abst) u t3) x)))) (\lambda (_: T).(\lambda (t: T).(\lambda (_: +T).(ty3 g c u t)))) (\lambda (t3: T).(\lambda (_: T).(\lambda (_: T).(ty3 g +(CHead c (Bind Abst) u) t2 t3)))) (\lambda (t3: T).(\lambda (_: T).(\lambda +(t0: T).(ty3 g (CHead c (Bind Abst) u) t3 t0)))) (ex2 T (\lambda (w: T).(ty3 +g c u w)) (\lambda (_: T).(ty3 g (CHead c (Bind Abst) u) t1 t2))) (\lambda +(x0: T).(\lambda (x1: T).(\lambda (x2: T).(\lambda (_: (pc3 c (THead (Bind +Abst) u x0) x)).(\lambda (_: (ty3 g c u x1)).(\lambda (H3: (ty3 g (CHead c +(Bind Abst) u) t2 x0)).(\lambda (_: (ty3 g (CHead c (Bind Abst) u) x0 +x2)).(ex4_3_ind T T T (\lambda (t3: T).(\lambda (_: T).(\lambda (_: T).(pc3 c +(THead (Bind Abst) u t3) (THead (Bind Abst) u t2))))) (\lambda (_: +T).(\lambda (t: T).(\lambda (_: T).(ty3 g c u t)))) (\lambda (t3: T).(\lambda +(_: T).(\lambda (_: T).(ty3 g (CHead c (Bind Abst) u) t1 t3)))) (\lambda (t3: +T).(\lambda (_: T).(\lambda (t0: T).(ty3 g (CHead c (Bind Abst) u) t3 t0)))) +(ex2 T (\lambda (w: T).(ty3 g c u w)) (\lambda (_: T).(ty3 g (CHead c (Bind +Abst) u) t1 t2))) (\lambda (x3: T).(\lambda (x4: T).(\lambda (x5: T).(\lambda +(H5: (pc3 c (THead (Bind Abst) u x3) (THead (Bind Abst) u t2))).(\lambda (H6: +(ty3 g c u x4)).(\lambda (H7: (ty3 g (CHead c (Bind Abst) u) t1 x3)).(\lambda +(_: (ty3 g (CHead c (Bind Abst) u) x3 x5)).(and_ind (pc3 c u u) (\forall (b: +B).(\forall (u0: T).(pc3 (CHead c (Bind b) u0) x3 t2))) (ex2 T (\lambda (w: +T).(ty3 g c u w)) (\lambda (_: T).(ty3 g (CHead c (Bind Abst) u) t1 t2))) +(\lambda (_: (pc3 c u u)).(\lambda (H10: ((\forall (b: B).(\forall (u0: +T).(pc3 (CHead c (Bind b) u0) x3 t2))))).(ex_intro2 T (\lambda (w: T).(ty3 g +c u w)) (\lambda (_: T).(ty3 g (CHead c (Bind Abst) u) t1 t2)) x4 H6 +(ty3_conv g (CHead c (Bind Abst) u) t2 x0 H3 t1 x3 H7 (H10 Abst u))))) +(pc3_gen_abst c u u x3 t2 H5))))))))) (ty3_gen_bind g Abst c u t1 (THead +(Bind Abst) u t2) H))))))))) (ty3_gen_bind g Abst c u t2 x H0)))) +(ty3_correct g c (THead (Bind Abst) u t1) (THead (Bind Abst) u t2) H))))))). + +theorem ty3_typecheck: + \forall (g: G).(\forall (c: C).(\forall (t: T).(\forall (v: T).((ty3 g c t +v) \to (ex T (\lambda (u: T).(ty3 g c (THead (Flat Cast) v t) u))))))) +\def + \lambda (g: G).(\lambda (c: C).(\lambda (t: T).(\lambda (v: T).(\lambda (H: +(ty3 g c t v)).(ex_ind T (\lambda (t0: T).(ty3 g c v t0)) (ex T (\lambda (u: +T).(ty3 g c (THead (Flat Cast) v t) u))) (\lambda (x: T).(\lambda (H0: (ty3 g +c v x)).(ex_intro T (\lambda (u: T).(ty3 g c (THead (Flat Cast) v t) u)) v +(ty3_cast g c t v H x H0)))) (ty3_correct g c t v H)))))). + diff --git a/helm/software/matita/contribs/LOGIC/PNF/defs.ma b/helm/software/matita/contribs/LOGIC/PNF/defs.ma new file mode 100644 index 000000000..12a3b7be8 --- /dev/null +++ b/helm/software/matita/contribs/LOGIC/PNF/defs.ma @@ -0,0 +1,24 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +set "baseuri" "cic:/matita/LOGIC/PNF/defs". + +(* NORMAL FORM PREDICATE FOR PARALLEL REDUCTION +*) + +include "PRed/defs.ma". + +inductive PNF: Proof \to Prop \def + | pnf: \forall p. (\forall q. p => q \to p = q) \to PNF p +. diff --git a/helm/software/matita/contribs/LOGIC/PRed/defs.ma b/helm/software/matita/contribs/LOGIC/PRed/defs.ma new file mode 100644 index 000000000..36b431098 --- /dev/null +++ b/helm/software/matita/contribs/LOGIC/PRed/defs.ma @@ -0,0 +1,39 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +set "baseuri" "cic:/matita/LOGIC/PRed/defs". + +(* SINGLE STEP PARALLEL REDUCTION + For cut elimination +*) + +include "datatypes/Proof.ma". + +inductive PRed: Proof \to Proof \to Prop \def + | pred_lref: \forall i. PRed (lref i) (lref i) + | pred_parx: \forall h. PRed (parx h) (parx h) + | pred_impw: \forall p1,p2. PRed p1 p2 \to PRed (impw p1) (impw p2) + | pred_impr: \forall p1,p2. PRed p1 p2 \to PRed (impr p1) (impr p2) + | pred_impi: \forall p1,p2. PRed p1 p2 \to \forall q1,q2. PRed q1 q2 \to + \forall r1,r2. PRed r1 r2 \to + PRed (impi p1 q1 r1) (impi p2 q2 r2) + | pred_scut: \forall p1,p2. PRed p1 p2 \to \forall q1,q2. PRed q1 q2 \to + PRed (scut p1 q1) (scut p2 q2) +. + +(*CSC: the URI must disappear: there is a bug now *) +interpretation + "single step parallel reduction in B->" + 'parred x y = (cic:/matita/LOGIC/PRed/defs/PRed.ind#xpointer(1/1) x y) +. diff --git a/helm/software/matita/core_notation.moo b/helm/software/matita/core_notation.moo index 17d5993b1..2ecb35e8b 100644 --- a/helm/software/matita/core_notation.moo +++ b/helm/software/matita/core_notation.moo @@ -119,3 +119,7 @@ for @{ 'and $a $b }. notation "hvbox(\lnot a)" non associative with precedence 40 for @{ 'not $a }. + +notation "hvbox(a break => b)" + non associative with precedence 45 +for @{ 'parred $a $b }. diff --git a/helm/software/matita/matitaInit.ml b/helm/software/matita/matitaInit.ml index 7ffb67d9f..88f5c9c35 100644 --- a/helm/software/matita/matitaInit.ml +++ b/helm/software/matita/matitaInit.ml @@ -25,8 +25,6 @@ (* $Id$ *) -open Printf - type thingsToInitilaize = ConfigurationFile | Db | Environment | Getter | Makelib | CmdLine | Registry @@ -61,6 +59,7 @@ let set_registry_values = List.iter (fun key, value -> Helm_registry.set ~key ~value) let fill_registry init_status = + wants [ ConfigurationFile ] init_status; if not (already_configured [ Registry ] init_status) then begin set_registry_values registry_defaults; Registry :: init_status @@ -68,7 +67,6 @@ let fill_registry init_status = init_status let load_configuration init_status = - wants [ Registry ] init_status; if not (already_configured [ConfigurationFile] init_status) then begin Helm_registry.load_from !conffile; @@ -138,44 +136,44 @@ let _ = List.iter (fun (name, s) -> Hashtbl.replace usages name s) [ "matitac", - sprintf "MatitaC v%s + Printf.sprintf "MatitaC v%s Usage: matitac [ OPTION ... ] FILE Options:" BuildTimeConf.version; "gragrep", - sprintf "Grafite Grep v%s + Printf.sprintf "Grafite Grep v%s Usage: gragrep [ -r ] PATH Options:" BuildTimeConf.version; "matitaprover", - sprintf "Matita's prover v%s + Printf.sprintf "Matita's prover v%s Usage: matitaprover [ -tptppath ] FILE.p Options:" BuildTimeConf.version; "matita", - sprintf "Matita v%s + Printf.sprintf "Matita v%s Usage: matita [ OPTION ... ] [ FILE ... ] Options:" BuildTimeConf.version; "cicbrowser", - sprintf + Printf.sprintf "CIC Browser v%s Usage: cicbrowser [ URL | WHELP QUERY ] Options:" BuildTimeConf.version; "matitadep", - sprintf "MatitaDep v%s + Printf.sprintf "MatitaDep v%s Usage: matitadep [ OPTION ... ] FILE ... Options:" BuildTimeConf.version; "matitaclean", - sprintf "MatitaClean v%s + Printf.sprintf "MatitaClean v%s Usage: matitaclean all matitaclean [ (FILE | URI) ... ] Options:" BuildTimeConf.version; "matitamake", - sprintf "MatitaMake v%s + Printf.sprintf "MatitaMake v%s Usage: matitamake [ OPTION ... ] (init | clean | list | destroy | build) init Parameters: name (the name of the development, required) @@ -212,7 +210,8 @@ Options:" BuildTimeConf.version; ] let default_usage = - sprintf "Matita v%s\nUsage: matita [ ARG ]\nOptions:" BuildTimeConf.version + Printf.sprintf + "Matita v%s\nUsage: matita [ ARG ]\nOptions:" BuildTimeConf.version let usage () = let basename = Filename.basename Sys.argv.(0) in @@ -280,6 +279,9 @@ let parse_cmdline init_status = Arg.Unit (fun () -> Helm_registry.set_bool "matita.debug" true), ("Do not catch top-level exception " ^ "(useful for backtrace inspection)"); + "-onepass", + Arg.Unit (fun () -> GrafiteDisambiguator.only_one_pass := true), + "Enable only one disambiguation pass"; ] else [] in @@ -309,11 +311,16 @@ let die_usage () = print_endline (usage ()); exit 1 +let conf_components = + [ parse_cmdline; load_configuration; fill_registry ] + +let other_components = + [ initialize_makelib; initialize_db; initialize_environment ] + let initialize_all () = status := List.fold_left (fun s f -> f s) !status - [ fill_registry; parse_cmdline; load_configuration; initialize_makelib; - initialize_db; initialize_environment ] + (conf_components @ other_components) (* initialize_notation (initialize_environment (initialize_db @@ -321,14 +328,9 @@ let initialize_all () = (load_configuration (parse_cmdline !status))))) *) -let load_configuration_file () = - status := load_configuration !status - -let parse_cmdline () = - status := parse_cmdline !status +let parse_cmdline_and_configuration_file () = + status := List.fold_left (fun s f -> f s) !status conf_components -let fill_registry () = - status := fill_registry !status ;; Inversion_principle.init () diff --git a/helm/software/matita/matitaInit.mli b/helm/software/matita/matitaInit.mli index c796f4854..272657cc3 100644 --- a/helm/software/matita/matitaInit.mli +++ b/helm/software/matita/matitaInit.mli @@ -27,9 +27,7 @@ val initialize_all: unit -> unit (** {2 per-components initialization} *) -val fill_registry: unit -> unit (** fill registry with default values *) -val parse_cmdline: unit -> unit (** parse cmdline setting registry keys *) -val load_configuration_file: unit -> unit +val parse_cmdline_and_configuration_file: unit -> unit (** {2 Utilities} *) diff --git a/helm/software/matita/matitadep.ml b/helm/software/matita/matitadep.ml index 32de85707..3a5ee6561 100644 --- a/helm/software/matita/matitadep.ml +++ b/helm/software/matita/matitadep.ml @@ -50,13 +50,11 @@ let main () = let resolve alias current_buri = let buri = buri alias in if buri <> current_buri then Some buri else None in - MatitaInit.fill_registry (); let dot_file = ref "" in MatitaInit.add_cmdline_spec ["-dot", Arg.Set_string dot_file, " Save dependency graph in dot format to the given file"]; - MatitaInit.parse_cmdline (); - MatitaInit.load_configuration_file (); + MatitaInit.parse_cmdline_and_configuration_file (); let include_paths = Helm_registry.get_list Helm_registry.string "matita.includes" in let args = Helm_registry.get_list Helm_registry.string "matita.args" in diff --git a/helm/software/matita/matitamake.ml b/helm/software/matita/matitamake.ml index 09bc6c70b..ad4368738 100644 --- a/helm/software/matita/matitamake.ml +++ b/helm/software/matita/matitamake.ml @@ -28,9 +28,7 @@ module MK = MatitamakeLib ;; let main () = - MatitaInit.fill_registry (); - MatitaInit.parse_cmdline (); - MatitaInit.load_configuration_file (); + MatitaInit.parse_cmdline_and_configuration_file (); MK.initialize (); let usage = ref (fun () -> ()) in let dev_of_name name = diff --git a/helm/software/matita/matitaprover.ml b/helm/software/matita/matitaprover.ml index fd571065e..7a6503ab3 100644 --- a/helm/software/matita/matitaprover.ml +++ b/helm/software/matita/matitaprover.ml @@ -83,7 +83,6 @@ let p_to_ma ?timeout ~tptppath ~filename () = ;; let main () = - MatitaInit.fill_registry (); let tptppath = ref "./" in let timeout = ref 600 in MatitaInit.add_cmdline_spec @@ -91,8 +90,7 @@ let main () = "Where to find the Axioms/ and Problems/ directory"; "-timeout", Arg.Int (fun x -> timeout := x), "Timeout in seconds"]; - MatitaInit.parse_cmdline (); - MatitaInit.load_configuration_file (); + MatitaInit.parse_cmdline_and_configuration_file (); Helm_registry.set_bool "matita.nodisk" true; HLog.set_log_callback (fun _ _ -> ()); let args = Helm_registry.get_list Helm_registry.string "matita.args" in -- 2.39.2