From f9ee4e9041c5ef7dff72da0f6fbe8f2d8204c99e Mon Sep 17 00:00:00 2001 From: Ferruccio Guidi Date: Fri, 8 Sep 2006 09:41:37 +0000 Subject: [PATCH] - some theorems from levels_defs - a new problem --- .../LAMBDA-TYPES/Level-1/Base/ext/preamble.ma | 1 + .../Level-1/LambdaDelta/A/defs.ma | 24 ++ .../Level-1/LambdaDelta/aplus/defs.ma | 26 ++ .../Level-1/LambdaDelta/aplus/props.ma | 257 ++++++++++++ .../Level-1/LambdaDelta/aplus/props.ma~ | 259 ++++++++++++ .../Level-1/LambdaDelta/asucc/defs.ma | 30 ++ .../Level-1/LambdaDelta/asucc/fwd.ma | 94 +++++ .../Level-1/LambdaDelta/leq/asucc.ma | 88 ++++ .../Level-1/LambdaDelta/leq/defs.ma | 28 ++ .../Level-1/LambdaDelta/theory.ma | 14 + .../LAMBDA-TYPES/Level-1/problems-1.ma | 1 - .../LAMBDA-TYPES/Level-1/problems-1.ma~ | 107 +++++ .../LAMBDA-TYPES/Level-1/problems-2.ma | 1 - .../LAMBDA-TYPES/Level-1/problems-2.ma~ | 158 +++++++ .../LAMBDA-TYPES/Level-1/problems-3.ma | 396 ++++++++++++++++++ .../contribs/LAMBDA-TYPES/Level-1/problems.ma | 1 + .../LAMBDA-TYPES/Level-1/problems.ma~ | 32 ++ 17 files changed, 1515 insertions(+), 2 deletions(-) create mode 100644 matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/A/defs.ma create mode 100644 matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/aplus/defs.ma create mode 100644 matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/aplus/props.ma create mode 100644 matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/aplus/props.ma~ create mode 100644 matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/asucc/defs.ma create mode 100644 matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/asucc/fwd.ma create mode 100644 matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/leq/asucc.ma create mode 100644 matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/leq/defs.ma create mode 100644 matita/contribs/LAMBDA-TYPES/Level-1/problems-1.ma~ create mode 100644 matita/contribs/LAMBDA-TYPES/Level-1/problems-2.ma~ create mode 100644 matita/contribs/LAMBDA-TYPES/Level-1/problems-3.ma create mode 100644 matita/contribs/LAMBDA-TYPES/Level-1/problems.ma~ diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/Base/ext/preamble.ma b/matita/contribs/LAMBDA-TYPES/Level-1/Base/ext/preamble.ma index 0e68a2b79..3892cb628 100644 --- a/matita/contribs/LAMBDA-TYPES/Level-1/Base/ext/preamble.ma +++ b/matita/contribs/LAMBDA-TYPES/Level-1/Base/ext/preamble.ma @@ -123,6 +123,7 @@ alias id "plus_Snm_nSm" = "cic:/Coq/Arith/Plus/plus_Snm_nSm.con". alias id "plus_lt_le_compat" = "cic:/Coq/Arith/Plus/plus_lt_le_compat.con". alias id "plus_lt_compat" = "cic:/Coq/Arith/Plus/plus_lt_compat.con". alias id "lt_S_n" = "cic:/Coq/Arith/Lt/lt_S_n.con". +alias id "minus_n_n" = "cic:/Coq/Arith/Minus/minus_n_n.con". theorem f_equal: \forall A,B:Type. \forall f:A \to B. \forall x,y:A. x = y \to f x = f y. diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/A/defs.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/A/defs.ma new file mode 100644 index 000000000..b7b8eb3bc --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/A/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 *) +(* *) +(**************************************************************************) + +(* This file was automatically generated: do not edit *********************) + +set "baseuri" "cic:/matita/LAMBDA-TYPES/Level-1/LambdaDelta/A/defs". + +include "../Base/theory.ma". + +inductive A: Set \def +| ASort: nat \to (nat \to A) +| AHead: A \to (A \to A). + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/aplus/defs.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/aplus/defs.ma new file mode 100644 index 000000000..48b155164 --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/aplus/defs.ma @@ -0,0 +1,26 @@ +(**************************************************************************) +(* ___ *) +(* ||M|| *) +(* ||A|| A project by Andrea Asperti *) +(* ||T|| *) +(* ||I|| Developers: *) +(* ||T|| The HELM team. *) +(* ||A|| http://helm.cs.unibo.it *) +(* \ / *) +(* \ / This file is distributed under the terms of the *) +(* v GNU General Public License Version 2 *) +(* *) +(**************************************************************************) + +(* This file was automatically generated: do not edit *********************) + +set "baseuri" "cic:/matita/LAMBDA-TYPES/Level-1/LambdaDelta/aplus/defs". + +include "asucc/defs.ma". + +definition aplus: + G \to (A \to (nat \to A)) +\def + let rec aplus (g: G) (a: A) (n: nat) on n: A \def (match n with [O +\Rightarrow a | (S n0) \Rightarrow (asucc g (aplus g a n0))]) in aplus. + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/aplus/props.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/aplus/props.ma new file mode 100644 index 000000000..7907d8b96 --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/aplus/props.ma @@ -0,0 +1,257 @@ +(**************************************************************************) +(* ___ *) +(* ||M|| *) +(* ||A|| A project by Andrea Asperti *) +(* ||T|| *) +(* ||I|| Developers: *) +(* ||T|| The HELM team. *) +(* ||A|| http://helm.cs.unibo.it *) +(* \ / *) +(* \ / This file is distributed under the terms of the *) +(* v GNU General Public License Version 2 *) +(* *) +(**************************************************************************) + +(* This file was automatically generated: do not edit *********************) + +set "baseuri" "cic:/matita/LAMBDA-TYPES/Level-1/LambdaDelta/aplus/props". + +include "aplus/defs.ma". + +include "next_plus/props.ma". + +theorem aplus_reg_r: + \forall (g: G).(\forall (a1: A).(\forall (a2: A).(\forall (h1: nat).(\forall +(h2: nat).((eq A (aplus g a1 h1) (aplus g a2 h2)) \to (\forall (h: nat).(eq A +(aplus g a1 (plus h h1)) (aplus g a2 (plus h h2))))))))) +\def + \lambda (g: G).(\lambda (a1: A).(\lambda (a2: A).(\lambda (h1: nat).(\lambda +(h2: nat).(\lambda (H: (eq A (aplus g a1 h1) (aplus g a2 h2))).(\lambda (h: +nat).(nat_ind (\lambda (n: nat).(eq A (aplus g a1 (plus n h1)) (aplus g a2 +(plus n h2)))) H (\lambda (n: nat).(\lambda (H0: (eq A (aplus g a1 (plus n +h1)) (aplus g a2 (plus n h2)))).(sym_equal A (asucc g (aplus g a2 (plus n +h2))) (asucc g (aplus g a1 (plus n h1))) (sym_equal A (asucc g (aplus g a1 +(plus n h1))) (asucc g (aplus g a2 (plus n h2))) (sym_equal A (asucc g (aplus +g a2 (plus n h2))) (asucc g (aplus g a1 (plus n h1))) (f_equal2 G A A asucc g +g (aplus g a2 (plus n h2)) (aplus g a1 (plus n h1)) (refl_equal G g) (sym_eq +A (aplus g a1 (plus n h1)) (aplus g a2 (plus n h2)) H0))))))) h))))))). + +theorem aplus_assoc: + \forall (g: G).(\forall (a: A).(\forall (h1: nat).(\forall (h2: nat).(eq A +(aplus g (aplus g a h1) h2) (aplus g a (plus h1 h2)))))) +\def + \lambda (g: G).(\lambda (a: A).(\lambda (h1: nat).(nat_ind (\lambda (n: +nat).(\forall (h2: nat).(eq A (aplus g (aplus g a n) h2) (aplus g a (plus n +h2))))) (\lambda (h2: nat).(refl_equal A (aplus g a h2))) (\lambda (n: +nat).(\lambda (_: ((\forall (h2: nat).(eq A (aplus g (aplus g a n) h2) (aplus +g a (plus n h2)))))).(\lambda (h2: nat).(nat_ind (\lambda (n0: nat).(eq A +(aplus g (asucc g (aplus g a n)) n0) (asucc g (aplus g a (plus n n0))))) +(eq_ind nat n (\lambda (n0: nat).(eq A (asucc g (aplus g a n)) (asucc g +(aplus g a n0)))) (refl_equal A (asucc g (aplus g a n))) (plus n O) (plus_n_O +n)) (\lambda (n0: nat).(\lambda (H0: (eq A (aplus g (asucc g (aplus g a n)) +n0) (asucc g (aplus g a (plus n n0))))).(eq_ind nat (S (plus n n0)) (\lambda +(n1: nat).(eq A (asucc g (aplus g (asucc g (aplus g a n)) n0)) (asucc g +(aplus g a n1)))) (sym_equal A (asucc g (asucc g (aplus g a (plus n n0)))) +(asucc g (aplus g (asucc g (aplus g a n)) n0)) (sym_equal A (asucc g (aplus g +(asucc g (aplus g a n)) n0)) (asucc g (asucc g (aplus g a (plus n n0)))) +(sym_equal A (asucc g (asucc g (aplus g a (plus n n0)))) (asucc g (aplus g +(asucc g (aplus g a n)) n0)) (f_equal2 G A A asucc g g (asucc g (aplus g a +(plus n n0))) (aplus g (asucc g (aplus g a n)) n0) (refl_equal G g) (sym_eq A +(aplus g (asucc g (aplus g a n)) n0) (asucc g (aplus g a (plus n n0))) +H0))))) (plus n (S n0)) (plus_n_Sm n n0)))) h2)))) h1))). + +theorem aplus_asucc: + \forall (g: G).(\forall (h: nat).(\forall (a: A).(eq A (aplus g (asucc g a) +h) (asucc g (aplus g a h))))) +\def + \lambda (g: G).(\lambda (h: nat).(\lambda (a: A).(eq_ind_r A (aplus g a +(plus (S O) h)) (\lambda (a0: A).(eq A a0 (asucc g (aplus g a h)))) +(refl_equal A (asucc g (aplus g a h))) (aplus g (aplus g a (S O)) h) +(aplus_assoc g a (S O) h)))). + +theorem aplus_sort_O_S_simpl: + \forall (g: G).(\forall (n: nat).(\forall (k: nat).(eq A (aplus g (ASort O +n) (S k)) (aplus g (ASort O (next g n)) k)))) +\def + \lambda (g: G).(\lambda (n: nat).(\lambda (k: nat).(eq_ind A (aplus g (asucc +g (ASort O n)) k) (\lambda (a: A).(eq A a (aplus g (ASort O (next g n)) k))) +(refl_equal A (aplus g (ASort O (next g n)) k)) (asucc g (aplus g (ASort O n) +k)) (aplus_asucc g k (ASort O n))))). + +theorem aplus_sort_S_S_simpl: + \forall (g: G).(\forall (n: nat).(\forall (h: nat).(\forall (k: nat).(eq A +(aplus g (ASort (S h) n) (S k)) (aplus g (ASort h n) k))))) +\def + \lambda (g: G).(\lambda (n: nat).(\lambda (h: nat).(\lambda (k: nat).(eq_ind +A (aplus g (asucc g (ASort (S h) n)) k) (\lambda (a: A).(eq A a (aplus g +(ASort h n) k))) (refl_equal A (aplus g (ASort h n) k)) (asucc g (aplus g +(ASort (S h) n) k)) (aplus_asucc g k (ASort (S h) n)))))). + +theorem aplus_asort_O_simpl: + \forall (g: G).(\forall (h: nat).(\forall (n: nat).(eq A (aplus g (ASort O +n) h) (ASort O (next_plus g n h))))) +\def + \lambda (g: G).(\lambda (h: nat).(nat_ind (\lambda (n: nat).(\forall (n0: +nat).(eq A (aplus g (ASort O n0) n) (ASort O (next_plus g n0 n))))) (\lambda +(n: nat).(refl_equal A (ASort O n))) (\lambda (n: nat).(\lambda (H: ((\forall +(n0: nat).(eq A (aplus g (ASort O n0) n) (ASort O (next_plus g n0 +n)))))).(\lambda (n0: nat).(eq_ind A (aplus g (asucc g (ASort O n0)) n) +(\lambda (a: A).(eq A a (ASort O (next g (next_plus g n0 n))))) (eq_ind nat +(next_plus g (next g n0) n) (\lambda (n1: nat).(eq A (aplus g (ASort O (next +g n0)) n) (ASort O n1))) (H (next g n0)) (next g (next_plus g n0 n)) +(next_plus_next g n0 n)) (asucc g (aplus g (ASort O n0) n)) (aplus_asucc g n +(ASort O n0)))))) h)). + +theorem aplus_asort_le_simpl: + \forall (g: G).(\forall (h: nat).(\forall (k: nat).(\forall (n: nat).((le h +k) \to (eq A (aplus g (ASort k n) h) (ASort (minus k h) n)))))) +\def + \lambda (g: G).(\lambda (h: nat).(nat_ind (\lambda (n: nat).(\forall (k: +nat).(\forall (n0: nat).((le n k) \to (eq A (aplus g (ASort k n0) n) (ASort +(minus k n) n0)))))) (\lambda (k: nat).(\lambda (n: nat).(\lambda (_: (le O +k)).(eq_ind nat k (\lambda (n0: nat).(eq A (ASort k n) (ASort n0 n))) +(refl_equal A (ASort k n)) (minus k O) (minus_n_O k))))) (\lambda (h0: +nat).(\lambda (H: ((\forall (k: nat).(\forall (n: nat).((le h0 k) \to (eq A +(aplus g (ASort k n) h0) (ASort (minus k h0) n))))))).(\lambda (k: +nat).(nat_ind (\lambda (n: nat).(\forall (n0: nat).((le (S h0) n) \to (eq A +(asucc g (aplus g (ASort n n0) h0)) (ASort (minus n (S h0)) n0))))) (\lambda +(n: nat).(\lambda (H0: (le (S h0) O)).(ex2_ind nat (\lambda (n0: nat).(eq nat +O (S n0))) (\lambda (n0: nat).(le h0 n0)) (eq A (asucc g (aplus g (ASort O n) +h0)) (ASort (minus O (S h0)) n)) (\lambda (x: nat).(\lambda (H1: (eq nat O (S +x))).(\lambda (_: (le h0 x)).(let H3 \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) H1) in (False_ind (eq A (asucc g (aplus +g (ASort O n) h0)) (ASort (minus O (S h0)) n)) H3))))) (le_gen_S h0 O H0)))) +(\lambda (n: nat).(\lambda (_: ((\forall (n0: nat).((le (S h0) n) \to (eq A +(asucc g (aplus g (ASort n n0) h0)) (ASort (minus n (S h0)) n0)))))).(\lambda +(n0: nat).(\lambda (H1: (le (S h0) (S n))).(eq_ind A (aplus g (asucc g (ASort +(S n) n0)) h0) (\lambda (a: A).(eq A a (ASort (minus (S n) (S h0)) n0))) (H n +n0 (le_S_n h0 n H1)) (asucc g (aplus g (ASort (S n) n0) h0)) (aplus_asucc g +h0 (ASort (S n) n0))))))) k)))) h)). + +theorem aplus_asort_simpl: + \forall (g: G).(\forall (h: nat).(\forall (k: nat).(\forall (n: nat).(eq A +(aplus g (ASort k n) h) (ASort (minus k h) (next_plus g n (minus h k))))))) +\def + \lambda (g: G).(\lambda (h: nat).(\lambda (k: nat).(\lambda (n: +nat).(lt_le_e k h (eq A (aplus g (ASort k n) h) (ASort (minus k h) (next_plus +g n (minus h k)))) (\lambda (H: (lt k h)).(eq_ind_r nat (plus k (minus h k)) +(\lambda (n0: nat).(eq A (aplus g (ASort k n) n0) (ASort (minus k h) +(next_plus g n (minus h k))))) (eq_ind A (aplus g (aplus g (ASort k n) k) +(minus h k)) (\lambda (a: A).(eq A a (ASort (minus k h) (next_plus g n (minus +h k))))) (eq_ind_r A (ASort (minus k k) n) (\lambda (a: A).(eq A (aplus g a +(minus h k)) (ASort (minus k h) (next_plus g n (minus h k))))) (eq_ind nat O +(\lambda (n0: nat).(eq A (aplus g (ASort n0 n) (minus h k)) (ASort (minus k +h) (next_plus g n (minus h k))))) (eq_ind_r nat O (\lambda (n0: nat).(eq A +(aplus g (ASort O n) (minus h k)) (ASort n0 (next_plus g n (minus h k))))) +(aplus_asort_O_simpl g (minus h k) n) (minus k h) (O_minus k h (le_S_n k h +(le_S (S k) h H)))) (minus k k) (minus_n_n k)) (aplus g (ASort k n) k) +(aplus_asort_le_simpl g k k n (le_n k))) (aplus g (ASort k n) (plus k (minus +h k))) (aplus_assoc g (ASort k n) k (minus h k))) h (le_plus_minus k h +(le_S_n k h (le_S (S k) h H))))) (\lambda (H: (le h k)).(eq_ind_r A (ASort +(minus k h) n) (\lambda (a: A).(eq A a (ASort (minus k h) (next_plus g n +(minus h k))))) (eq_ind_r nat O (\lambda (n0: nat).(eq A (ASort (minus k h) +n) (ASort (minus k h) (next_plus g n n0)))) (refl_equal A (ASort (minus k h) +(next_plus g n O))) (minus h k) (O_minus h k H)) (aplus g (ASort k n) h) +(aplus_asort_le_simpl g h k n H))))))). + +theorem aplus_ahead_simpl: + \forall (g: G).(\forall (h: nat).(\forall (a1: A).(\forall (a2: A).(eq A +(aplus g (AHead a1 a2) h) (AHead a1 (aplus g a2 h)))))) +\def + \lambda (g: G).(\lambda (h: nat).(nat_ind (\lambda (n: nat).(\forall (a1: +A).(\forall (a2: A).(eq A (aplus g (AHead a1 a2) n) (AHead a1 (aplus g a2 +n)))))) (\lambda (a1: A).(\lambda (a2: A).(refl_equal A (AHead a1 a2)))) +(\lambda (n: nat).(\lambda (H: ((\forall (a1: A).(\forall (a2: A).(eq A +(aplus g (AHead a1 a2) n) (AHead a1 (aplus g a2 n))))))).(\lambda (a1: +A).(\lambda (a2: A).(eq_ind A (aplus g (asucc g (AHead a1 a2)) n) (\lambda +(a: A).(eq A a (AHead a1 (asucc g (aplus g a2 n))))) (eq_ind A (aplus g +(asucc g a2) n) (\lambda (a: A).(eq A (aplus g (asucc g (AHead a1 a2)) n) +(AHead a1 a))) (H a1 (asucc g a2)) (asucc g (aplus g a2 n)) (aplus_asucc g n +a2)) (asucc g (aplus g (AHead a1 a2) n)) (aplus_asucc g n (AHead a1 a2))))))) +h)). + +theorem aplus_asucc_false: + \forall (g: G).(\forall (a: A).(\forall (h: nat).((eq A (aplus g (asucc g a) +h) a) \to (\forall (P: Prop).P)))) +\def + \lambda (g: G).(\lambda (a: A).(A_ind (\lambda (a0: A).(\forall (h: +nat).((eq A (aplus g (asucc g a0) h) a0) \to (\forall (P: Prop).P)))) +(\lambda (n: nat).(\lambda (n0: nat).(\lambda (h: nat).(\lambda (H: (eq A +(aplus g (match n with [O \Rightarrow (ASort O (next g n0)) | (S h) +\Rightarrow (ASort h n0)]) h) (ASort n n0))).(\lambda (P: Prop).((match n in +nat return (\lambda (n1: nat).((eq A (aplus g (match n1 with [O \Rightarrow +(ASort O (next g n0)) | (S h) \Rightarrow (ASort h n0)]) h) (ASort n1 n0)) +\to P)) with [O \Rightarrow (\lambda (H0: (eq A (aplus g (ASort O (next g +n0)) h) (ASort O n0))).(let H1 \def (eq_ind A (aplus g (ASort O (next g n0)) +h) (\lambda (a: A).(eq A a (ASort O n0))) H0 (ASort (minus O h) (next_plus g +(next g n0) (minus h O))) (aplus_asort_simpl g h O (next g n0))) in (let H2 +\def (f_equal A nat (\lambda (e: A).(match e in A return (\lambda (_: A).nat) +with [(ASort _ n) \Rightarrow n | (AHead _ _) \Rightarrow ((let rec next_plus +(g: G) (n: nat) (i: nat) on i: nat \def (match i with [O \Rightarrow n | (S +i0) \Rightarrow (next g (next_plus g n i0))]) in next_plus) g (next g n0) +(minus h O))])) (ASort (minus O h) (next_plus g (next g n0) (minus h O))) +(ASort O n0) H1) in (let H3 \def (eq_ind_r nat (minus h O) (\lambda (n: +nat).(eq nat (next_plus g (next g n0) n) n0)) H2 h (minus_n_O h)) in +(le_lt_false (next_plus g (next g n0) h) n0 (eq_ind nat (next_plus g (next g +n0) h) (\lambda (n1: nat).(le (next_plus g (next g n0) h) n1)) (le_n +(next_plus g (next g n0) h)) n0 H3) (next_plus_lt g h n0) P))))) | (S n1) +\Rightarrow (\lambda (H0: (eq A (aplus g (ASort n1 n0) h) (ASort (S n1) +n0))).(let H1 \def (eq_ind A (aplus g (ASort n1 n0) h) (\lambda (a: A).(eq A +a (ASort (S n1) n0))) H0 (ASort (minus n1 h) (next_plus g n0 (minus h n1))) +(aplus_asort_simpl g h n1 n0)) in (let H2 \def (f_equal A nat (\lambda (e: +A).(match e in A return (\lambda (_: A).nat) with [(ASort n _) \Rightarrow n +| (AHead _ _) \Rightarrow ((let rec minus (n: nat) on n: (nat \to nat) \def +(\lambda (m: nat).(match n with [O \Rightarrow O | (S k) \Rightarrow (match m +with [O \Rightarrow (S k) | (S l) \Rightarrow (minus k l)])])) in minus) n1 +h)])) (ASort (minus n1 h) (next_plus g n0 (minus h n1))) (ASort (S n1) n0) +H1) in ((let H3 \def (f_equal A nat (\lambda (e: A).(match e in A return +(\lambda (_: A).nat) with [(ASort _ n) \Rightarrow n | (AHead _ _) +\Rightarrow ((let rec next_plus (g: G) (n: nat) (i: nat) on i: nat \def +(match i with [O \Rightarrow n | (S i0) \Rightarrow (next g (next_plus g n +i0))]) in next_plus) g n0 (minus h n1))])) (ASort (minus n1 h) (next_plus g +n0 (minus h n1))) (ASort (S n1) n0) H1) in (\lambda (H4: (eq nat (minus n1 h) +(S n1))).(le_Sx_x n1 (eq_ind nat (minus n1 h) (\lambda (n2: nat).(le n2 n1)) +(minus_le n1 h) (S n1) H4) P))) H2))))]) H)))))) (\lambda (a0: A).(\lambda +(_: ((\forall (h: nat).((eq A (aplus g (asucc g a0) h) a0) \to (\forall (P: +Prop).P))))).(\lambda (a1: A).(\lambda (H0: ((\forall (h: nat).((eq A (aplus +g (asucc g a1) h) a1) \to (\forall (P: Prop).P))))).(\lambda (h: +nat).(\lambda (H1: (eq A (aplus g (AHead a0 (asucc g a1)) h) (AHead a0 +a1))).(\lambda (P: Prop).(let H2 \def (eq_ind A (aplus g (AHead a0 (asucc g +a1)) h) (\lambda (a: A).(eq A a (AHead a0 a1))) H1 (AHead a0 (aplus g (asucc +g a1) h)) (aplus_ahead_simpl g h a0 (asucc g a1))) in (let H3 \def (f_equal A +A (\lambda (e: A).(match e in A return (\lambda (_: A).A) with [(ASort _ _) +\Rightarrow ((let rec aplus (g: G) (a: A) (n: nat) on n: A \def (match n with +[O \Rightarrow a | (S n0) \Rightarrow (asucc g (aplus g a n0))]) in aplus) g +(asucc g a1) h) | (AHead _ a) \Rightarrow a])) (AHead a0 (aplus g (asucc g +a1) h)) (AHead a0 a1) H2) in (H0 h H3 P)))))))))) a)). + +theorem aplus_inj: + \forall (g: G).(\forall (h1: nat).(\forall (h2: nat).(\forall (a: A).((eq A +(aplus g a h1) (aplus g a h2)) \to (eq nat h1 h2))))) +\def + \lambda (g: G).(\lambda (h1: nat).(nat_ind (\lambda (n: nat).(\forall (h2: +nat).(\forall (a: A).((eq A (aplus g a n) (aplus g a h2)) \to (eq nat n +h2))))) (\lambda (h2: nat).(nat_ind (\lambda (n: nat).(\forall (a: A).((eq A +(aplus g a O) (aplus g a n)) \to (eq nat O n)))) (\lambda (a: A).(\lambda (_: +(eq A a a)).(refl_equal nat O))) (\lambda (n: nat).(\lambda (_: ((\forall (a: +A).((eq A a (aplus g a n)) \to (eq nat O n))))).(\lambda (a: A).(\lambda (H0: +(eq A a (asucc g (aplus g a n)))).(let H1 \def (eq_ind_r A (asucc g (aplus g +a n)) (\lambda (a0: A).(eq A a a0)) H0 (aplus g (asucc g a) n) (aplus_asucc g +n a)) in (aplus_asucc_false g a n (sym_eq A a (aplus g (asucc g a) n) H1) (eq +nat O (S n)))))))) h2)) (\lambda (n: nat).(\lambda (H: ((\forall (h2: +nat).(\forall (a: A).((eq A (aplus g a n) (aplus g a h2)) \to (eq nat n +h2)))))).(\lambda (h2: nat).(nat_ind (\lambda (n0: nat).(\forall (a: A).((eq +A (aplus g a (S n)) (aplus g a n0)) \to (eq nat (S n) n0)))) (\lambda (a: +A).(\lambda (H0: (eq A (asucc g (aplus g a n)) a)).(let H1 \def (eq_ind_r A +(asucc g (aplus g a n)) (\lambda (a0: A).(eq A a0 a)) H0 (aplus g (asucc g a) +n) (aplus_asucc g n a)) in (aplus_asucc_false g a n H1 (eq nat (S n) O))))) +(\lambda (n0: nat).(\lambda (_: ((\forall (a: A).((eq A (asucc g (aplus g a +n)) (aplus g a n0)) \to (eq nat (S n) n0))))).(\lambda (a: A).(\lambda (H1: +(eq A (asucc g (aplus g a n)) (asucc g (aplus g a n0)))).(let H2 \def +(eq_ind_r A (asucc g (aplus g a n)) (\lambda (a0: A).(eq A a0 (asucc g (aplus +g a n0)))) H1 (aplus g (asucc g a) n) (aplus_asucc g n a)) in (let H3 \def +(eq_ind_r A (asucc g (aplus g a n0)) (\lambda (a0: A).(eq A (aplus g (asucc g +a) n) a0)) H2 (aplus g (asucc g a) n0) (aplus_asucc g n0 a)) in (f_equal nat +nat S n n0 (H n0 (asucc g a) H3)))))))) h2)))) h1)). + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/aplus/props.ma~ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/aplus/props.ma~ new file mode 100644 index 000000000..9f259df79 --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/aplus/props.ma~ @@ -0,0 +1,259 @@ +(**************************************************************************) +(* ___ *) +(* ||M|| *) +(* ||A|| A project by Andrea Asperti *) +(* ||T|| *) +(* ||I|| Developers: *) +(* ||T|| The HELM team. *) +(* ||A|| http://helm.cs.unibo.it *) +(* \ / *) +(* \ / This file is distributed under the terms of the *) +(* v GNU General Public License Version 2 *) +(* *) +(**************************************************************************) + +(* This file was automatically generated: do not edit *********************) + +set "baseuri" "cic:/matita/LAMBDA-TYPES/Level-1/LambdaDelta/aplus/props". + +include "aplus/defs.ma". + +theorem aplus_reg_r: + \forall (g: G).(\forall (a1: A).(\forall (a2: A).(\forall (h1: nat).(\forall +(h2: nat).((eq A (aplus g a1 h1) (aplus g a2 h2)) \to (\forall (h: nat).(eq A +(aplus g a1 (plus h h1)) (aplus g a2 (plus h h2))))))))) +\def + \lambda (g: G).(\lambda (a1: A).(\lambda (a2: A).(\lambda (h1: nat).(\lambda +(h2: nat).(\lambda (H: (eq A (aplus g a1 h1) (aplus g a2 h2))).(\lambda (h: +nat).(nat_ind (\lambda (n: nat).(eq A (aplus g a1 (plus n h1)) (aplus g a2 +(plus n h2)))) H (\lambda (n: nat).(\lambda (H0: (eq A (aplus g a1 (plus n +h1)) (aplus g a2 (plus n h2)))).(sym_equal A (asucc g (aplus g a2 (plus n +h2))) (asucc g (aplus g a1 (plus n h1))) (sym_equal A (asucc g (aplus g a1 +(plus n h1))) (asucc g (aplus g a2 (plus n h2))) (sym_equal A (asucc g (aplus +g a2 (plus n h2))) (asucc g (aplus g a1 (plus n h1))) (f_equal2 G A A asucc g +g (aplus g a2 (plus n h2)) (aplus g a1 (plus n h1)) (refl_equal G g) (sym_eq +A (aplus g a1 (plus n h1)) (aplus g a2 (plus n h2)) H0))))))) h))))))). + +theorem aplus_assoc: + \forall (g: G).(\forall (a: A).(\forall (h1: nat).(\forall (h2: nat).(eq A +(aplus g (aplus g a h1) h2) (aplus g a (plus h1 h2)))))) +\def + \lambda (g: G).(\lambda (a: A).(\lambda (h1: nat).(nat_ind (\lambda (n: +nat).(\forall (h2: nat).(eq A (aplus g (aplus g a n) h2) (aplus g a (plus n +h2))))) (\lambda (h2: nat).(refl_equal A (aplus g a h2))) (\lambda (n: +nat).(\lambda (_: ((\forall (h2: nat).(eq A (aplus g (aplus g a n) h2) (aplus +g a (plus n h2)))))).(\lambda (h2: nat).(nat_ind (\lambda (n0: nat).(eq A +(aplus g (asucc g (aplus g a n)) n0) (asucc g (aplus g a (plus n n0))))) +(eq_ind nat n (\lambda (n0: nat).(eq A (asucc g (aplus g a n)) (asucc g +(aplus g a n0)))) (refl_equal A (asucc g (aplus g a n))) (plus n O) (plus_n_O +n)) (\lambda (n0: nat).(\lambda (H0: (eq A (aplus g (asucc g (aplus g a n)) +n0) (asucc g (aplus g a (plus n n0))))).(eq_ind nat (S (plus n n0)) (\lambda +(n1: nat).(eq A (asucc g (aplus g (asucc g (aplus g a n)) n0)) (asucc g +(aplus g a n1)))) (sym_equal A (asucc g (asucc g (aplus g a (plus n n0)))) +(asucc g (aplus g (asucc g (aplus g a n)) n0)) (sym_equal A (asucc g (aplus g +(asucc g (aplus g a n)) n0)) (asucc g (asucc g (aplus g a (plus n n0)))) +(sym_equal A (asucc g (asucc g (aplus g a (plus n n0)))) (asucc g (aplus g +(asucc g (aplus g a n)) n0)) (f_equal2 G A A asucc g g (asucc g (aplus g a +(plus n n0))) (aplus g (asucc g (aplus g a n)) n0) (refl_equal G g) (sym_eq A +(aplus g (asucc g (aplus g a n)) n0) (asucc g (aplus g a (plus n n0))) +H0))))) (plus n (S n0)) (plus_n_Sm n n0)))) h2)))) h1))). + +theorem aplus_asucc: + \forall (g: G).(\forall (h: nat).(\forall (a: A).(eq A (aplus g (asucc g a) +h) (asucc g (aplus g a h))))) +\def + \lambda (g: G).(\lambda (h: nat).(\lambda (a: A).(eq_ind_r A (aplus g a +(plus (S O) h)) (\lambda (a0: A).(eq A a0 (asucc g (aplus g a h)))) +(refl_equal A (asucc g (aplus g a h))) (aplus g (aplus g a (S O)) h) +(aplus_assoc g a (S O) h)))). + +theorem aplus_sort_O_S_simpl: + \forall (g: G).(\forall (n: nat).(\forall (k: nat).(eq A (aplus g (ASort O +n) (S k)) (aplus g (ASort O (next g n)) k)))) +\def + \lambda (g: G).(\lambda (n: nat).(\lambda (k: nat).(eq_ind A (aplus g (asucc +g (ASort O n)) k) (\lambda (a: A).(eq A a (aplus g (ASort O (next g n)) k))) +(refl_equal A (aplus g (ASort O (next g n)) k)) (asucc g (aplus g (ASort O n) +k)) (aplus_asucc g k (ASort O n))))). + +theorem aplus_sort_S_S_simpl: + \forall (g: G).(\forall (n: nat).(\forall (h: nat).(\forall (k: nat).(eq A +(aplus g (ASort (S h) n) (S k)) (aplus g (ASort h n) k))))) +\def + \lambda (g: G).(\lambda (n: nat).(\lambda (h: nat).(\lambda (k: nat).(eq_ind +A (aplus g (asucc g (ASort (S h) n)) k) (\lambda (a: A).(eq A a (aplus g +(ASort h n) k))) (refl_equal A (aplus g (ASort h n) k)) (asucc g (aplus g +(ASort (S h) n) k)) (aplus_asucc g k (ASort (S h) n)))))). + +alias id "next_plus_next" = "cic:/matita/LAMBDA-TYPES/Level-1/LambdaDelta/next_plus/props/next_plus_next.con". +alias id "next_plus" = "cic:/matita/LAMBDA-TYPES/Level-1/LambdaDelta/next_plus/defs/next_plus.con". +theorem aplus_asort_O_simpl: + \forall (g: G).(\forall (h: nat).(\forall (n: nat).(eq A (aplus g (ASort O +n) h) (ASort O (next_plus g n h))))) +\def + \lambda (g: G).(\lambda (h: nat).(nat_ind (\lambda (n: nat).(\forall (n0: +nat).(eq A (aplus g (ASort O n0) n) (ASort O (next_plus g n0 n))))) (\lambda +(n: nat).(refl_equal A (ASort O n))) (\lambda (n: nat).(\lambda (H: ((\forall +(n0: nat).(eq A (aplus g (ASort O n0) n) (ASort O (next_plus g n0 +n)))))).(\lambda (n0: nat).(eq_ind A (aplus g (asucc g (ASort O n0)) n) +(\lambda (a: A).(eq A a (ASort O (next g (next_plus g n0 n))))) (eq_ind nat +(next_plus g (next g n0) n) (\lambda (n1: nat).(eq A (aplus g (ASort O (next +g n0)) n) (ASort O n1))) (H (next g n0)) (next g (next_plus g n0 n)) +(next_plus_next g n0 n)) (asucc g (aplus g (ASort O n0) n)) (aplus_asucc g n +(ASort O n0)))))) h)). + +theorem aplus_asort_le_simpl: + \forall (g: G).(\forall (h: nat).(\forall (k: nat).(\forall (n: nat).((le h +k) \to (eq A (aplus g (ASort k n) h) (ASort (minus k h) n)))))) +\def + \lambda (g: G).(\lambda (h: nat).(nat_ind (\lambda (n: nat).(\forall (k: +nat).(\forall (n0: nat).((le n k) \to (eq A (aplus g (ASort k n0) n) (ASort +(minus k n) n0)))))) (\lambda (k: nat).(\lambda (n: nat).(\lambda (_: (le O +k)).(eq_ind nat k (\lambda (n0: nat).(eq A (ASort k n) (ASort n0 n))) +(refl_equal A (ASort k n)) (minus k O) (minus_n_O k))))) (\lambda (h0: +nat).(\lambda (H: ((\forall (k: nat).(\forall (n: nat).((le h0 k) \to (eq A +(aplus g (ASort k n) h0) (ASort (minus k h0) n))))))).(\lambda (k: +nat).(nat_ind (\lambda (n: nat).(\forall (n0: nat).((le (S h0) n) \to (eq A +(asucc g (aplus g (ASort n n0) h0)) (ASort (minus n (S h0)) n0))))) (\lambda +(n: nat).(\lambda (H0: (le (S h0) O)).(ex2_ind nat (\lambda (n0: nat).(eq nat +O (S n0))) (\lambda (n0: nat).(le h0 n0)) (eq A (asucc g (aplus g (ASort O n) +h0)) (ASort (minus O (S h0)) n)) (\lambda (x: nat).(\lambda (H1: (eq nat O (S +x))).(\lambda (_: (le h0 x)).(let H3 \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) H1) in (False_ind (eq A (asucc g (aplus +g (ASort O n) h0)) (ASort (minus O (S h0)) n)) H3))))) (le_gen_S h0 O H0)))) +(\lambda (n: nat).(\lambda (_: ((\forall (n0: nat).((le (S h0) n) \to (eq A +(asucc g (aplus g (ASort n n0) h0)) (ASort (minus n (S h0)) n0)))))).(\lambda +(n0: nat).(\lambda (H1: (le (S h0) (S n))).(eq_ind A (aplus g (asucc g (ASort +(S n) n0)) h0) (\lambda (a: A).(eq A a (ASort (minus (S n) (S h0)) n0))) (H n +n0 (le_S_n h0 n H1)) (asucc g (aplus g (ASort (S n) n0) h0)) (aplus_asucc g +h0 (ASort (S n) n0))))))) k)))) h)). + +alias id "minus_n_n" = "cic:/Coq/Arith/Minus/minus_n_n.con". +theorem aplus_asort_simpl: + \forall (g: G).(\forall (h: nat).(\forall (k: nat).(\forall (n: nat).(eq A +(aplus g (ASort k n) h) (ASort (minus k h) (next_plus g n (minus h k))))))) +\def + \lambda (g: G).(\lambda (h: nat).(\lambda (k: nat).(\lambda (n: +nat).(lt_le_e k h (eq A (aplus g (ASort k n) h) (ASort (minus k h) (next_plus +g n (minus h k)))) (\lambda (H: (lt k h)).(eq_ind_r nat (plus k (minus h k)) +(\lambda (n0: nat).(eq A (aplus g (ASort k n) n0) (ASort (minus k h) +(next_plus g n (minus h k))))) (eq_ind A (aplus g (aplus g (ASort k n) k) +(minus h k)) (\lambda (a: A).(eq A a (ASort (minus k h) (next_plus g n (minus +h k))))) (eq_ind_r A (ASort (minus k k) n) (\lambda (a: A).(eq A (aplus g a +(minus h k)) (ASort (minus k h) (next_plus g n (minus h k))))) (eq_ind nat O +(\lambda (n0: nat).(eq A (aplus g (ASort n0 n) (minus h k)) (ASort (minus k +h) (next_plus g n (minus h k))))) (eq_ind_r nat O (\lambda (n0: nat).(eq A +(aplus g (ASort O n) (minus h k)) (ASort n0 (next_plus g n (minus h k))))) +(aplus_asort_O_simpl g (minus h k) n) (minus k h) (O_minus k h (le_S_n k h +(le_S (S k) h H)))) (minus k k) (minus_n_n k)) (aplus g (ASort k n) k) +(aplus_asort_le_simpl g k k n (le_n k))) (aplus g (ASort k n) (plus k (minus +h k))) (aplus_assoc g (ASort k n) k (minus h k))) h (le_plus_minus k h +(le_S_n k h (le_S (S k) h H))))) (\lambda (H: (le h k)).(eq_ind_r A (ASort +(minus k h) n) (\lambda (a: A).(eq A a (ASort (minus k h) (next_plus g n +(minus h k))))) (eq_ind_r nat O (\lambda (n0: nat).(eq A (ASort (minus k h) +n) (ASort (minus k h) (next_plus g n n0)))) (refl_equal A (ASort (minus k h) +(next_plus g n O))) (minus h k) (O_minus h k H)) (aplus g (ASort k n) h) +(aplus_asort_le_simpl g h k n H))))))). + +theorem aplus_ahead_simpl: + \forall (g: G).(\forall (h: nat).(\forall (a1: A).(\forall (a2: A).(eq A +(aplus g (AHead a1 a2) h) (AHead a1 (aplus g a2 h)))))) +\def + \lambda (g: G).(\lambda (h: nat).(nat_ind (\lambda (n: nat).(\forall (a1: +A).(\forall (a2: A).(eq A (aplus g (AHead a1 a2) n) (AHead a1 (aplus g a2 +n)))))) (\lambda (a1: A).(\lambda (a2: A).(refl_equal A (AHead a1 a2)))) +(\lambda (n: nat).(\lambda (H: ((\forall (a1: A).(\forall (a2: A).(eq A +(aplus g (AHead a1 a2) n) (AHead a1 (aplus g a2 n))))))).(\lambda (a1: +A).(\lambda (a2: A).(eq_ind A (aplus g (asucc g (AHead a1 a2)) n) (\lambda +(a: A).(eq A a (AHead a1 (asucc g (aplus g a2 n))))) (eq_ind A (aplus g +(asucc g a2) n) (\lambda (a: A).(eq A (aplus g (asucc g (AHead a1 a2)) n) +(AHead a1 a))) (H a1 (asucc g a2)) (asucc g (aplus g a2 n)) (aplus_asucc g n +a2)) (asucc g (aplus g (AHead a1 a2) n)) (aplus_asucc g n (AHead a1 a2))))))) +h)). + +alias id "next_plus_lt" = "cic:/matita/LAMBDA-TYPES/Level-1/LambdaDelta/next_plus/props/next_plus_lt.con". +theorem aplus_asucc_false: + \forall (g: G).(\forall (a: A).(\forall (h: nat).((eq A (aplus g (asucc g a) +h) a) \to (\forall (P: Prop).P)))) +\def + \lambda (g: G).(\lambda (a: A).(A_ind (\lambda (a0: A).(\forall (h: +nat).((eq A (aplus g (asucc g a0) h) a0) \to (\forall (P: Prop).P)))) +(\lambda (n: nat).(\lambda (n0: nat).(\lambda (h: nat).(\lambda (H: (eq A +(aplus g (match n with [O \Rightarrow (ASort O (next g n0)) | (S h) +\Rightarrow (ASort h n0)]) h) (ASort n n0))).(\lambda (P: Prop).((match n in +nat return (\lambda (n1: nat).((eq A (aplus g (match n1 with [O \Rightarrow +(ASort O (next g n0)) | (S h) \Rightarrow (ASort h n0)]) h) (ASort n1 n0)) +\to P)) with [O \Rightarrow (\lambda (H0: (eq A (aplus g (ASort O (next g +n0)) h) (ASort O n0))).(let H1 \def (eq_ind A (aplus g (ASort O (next g n0)) +h) (\lambda (a: A).(eq A a (ASort O n0))) H0 (ASort (minus O h) (next_plus g +(next g n0) (minus h O))) (aplus_asort_simpl g h O (next g n0))) in (let H2 +\def (f_equal A nat (\lambda (e: A).(match e in A return (\lambda (_: A).nat) +with [(ASort _ n) \Rightarrow n | (AHead _ _) \Rightarrow ((let rec next_plus +(g: G) (n: nat) (i: nat) on i: nat \def (match i with [O \Rightarrow n | (S +i0) \Rightarrow (next g (next_plus g n i0))]) in next_plus) g (next g n0) +(minus h O))])) (ASort (minus O h) (next_plus g (next g n0) (minus h O))) +(ASort O n0) H1) in (let H3 \def (eq_ind_r nat (minus h O) (\lambda (n: +nat).(eq nat (next_plus g (next g n0) n) n0)) H2 h (minus_n_O h)) in +(le_lt_false (next_plus g (next g n0) h) n0 (eq_ind nat (next_plus g (next g +n0) h) (\lambda (n1: nat).(le (next_plus g (next g n0) h) n1)) (le_n +(next_plus g (next g n0) h)) n0 H3) (next_plus_lt g h n0) P))))) | (S n1) +\Rightarrow (\lambda (H0: (eq A (aplus g (ASort n1 n0) h) (ASort (S n1) +n0))).(let H1 \def (eq_ind A (aplus g (ASort n1 n0) h) (\lambda (a: A).(eq A +a (ASort (S n1) n0))) H0 (ASort (minus n1 h) (next_plus g n0 (minus h n1))) +(aplus_asort_simpl g h n1 n0)) in (let H2 \def (f_equal A nat (\lambda (e: +A).(match e in A return (\lambda (_: A).nat) with [(ASort n _) \Rightarrow n +| (AHead _ _) \Rightarrow ((let rec minus (n: nat) on n: (nat \to nat) \def +(\lambda (m: nat).(match n with [O \Rightarrow O | (S k) \Rightarrow (match m +with [O \Rightarrow (S k) | (S l) \Rightarrow (minus k l)])])) in minus) n1 +h)])) (ASort (minus n1 h) (next_plus g n0 (minus h n1))) (ASort (S n1) n0) +H1) in ((let H3 \def (f_equal A nat (\lambda (e: A).(match e in A return +(\lambda (_: A).nat) with [(ASort _ n) \Rightarrow n | (AHead _ _) +\Rightarrow ((let rec next_plus (g: G) (n: nat) (i: nat) on i: nat \def +(match i with [O \Rightarrow n | (S i0) \Rightarrow (next g (next_plus g n +i0))]) in next_plus) g n0 (minus h n1))])) (ASort (minus n1 h) (next_plus g +n0 (minus h n1))) (ASort (S n1) n0) H1) in (\lambda (H4: (eq nat (minus n1 h) +(S n1))).(le_Sx_x n1 (eq_ind nat (minus n1 h) (\lambda (n2: nat).(le n2 n1)) +(minus_le n1 h) (S n1) H4) P))) H2))))]) H)))))) (\lambda (a0: A).(\lambda +(_: ((\forall (h: nat).((eq A (aplus g (asucc g a0) h) a0) \to (\forall (P: +Prop).P))))).(\lambda (a1: A).(\lambda (H0: ((\forall (h: nat).((eq A (aplus +g (asucc g a1) h) a1) \to (\forall (P: Prop).P))))).(\lambda (h: +nat).(\lambda (H1: (eq A (aplus g (AHead a0 (asucc g a1)) h) (AHead a0 +a1))).(\lambda (P: Prop).(let H2 \def (eq_ind A (aplus g (AHead a0 (asucc g +a1)) h) (\lambda (a: A).(eq A a (AHead a0 a1))) H1 (AHead a0 (aplus g (asucc +g a1) h)) (aplus_ahead_simpl g h a0 (asucc g a1))) in (let H3 \def (f_equal A +A (\lambda (e: A).(match e in A return (\lambda (_: A).A) with [(ASort _ _) +\Rightarrow ((let rec aplus (g: G) (a: A) (n: nat) on n: A \def (match n with +[O \Rightarrow a | (S n0) \Rightarrow (asucc g (aplus g a n0))]) in aplus) g +(asucc g a1) h) | (AHead _ a) \Rightarrow a])) (AHead a0 (aplus g (asucc g +a1) h)) (AHead a0 a1) H2) in (H0 h H3 P)))))))))) a)). + +theorem aplus_inj: + \forall (g: G).(\forall (h1: nat).(\forall (h2: nat).(\forall (a: A).((eq A +(aplus g a h1) (aplus g a h2)) \to (eq nat h1 h2))))) +\def + \lambda (g: G).(\lambda (h1: nat).(nat_ind (\lambda (n: nat).(\forall (h2: +nat).(\forall (a: A).((eq A (aplus g a n) (aplus g a h2)) \to (eq nat n +h2))))) (\lambda (h2: nat).(nat_ind (\lambda (n: nat).(\forall (a: A).((eq A +(aplus g a O) (aplus g a n)) \to (eq nat O n)))) (\lambda (a: A).(\lambda (_: +(eq A a a)).(refl_equal nat O))) (\lambda (n: nat).(\lambda (_: ((\forall (a: +A).((eq A a (aplus g a n)) \to (eq nat O n))))).(\lambda (a: A).(\lambda (H0: +(eq A a (asucc g (aplus g a n)))).(let H1 \def (eq_ind_r A (asucc g (aplus g +a n)) (\lambda (a0: A).(eq A a a0)) H0 (aplus g (asucc g a) n) (aplus_asucc g +n a)) in (aplus_asucc_false g a n (sym_eq A a (aplus g (asucc g a) n) H1) (eq +nat O (S n)))))))) h2)) (\lambda (n: nat).(\lambda (H: ((\forall (h2: +nat).(\forall (a: A).((eq A (aplus g a n) (aplus g a h2)) \to (eq nat n +h2)))))).(\lambda (h2: nat).(nat_ind (\lambda (n0: nat).(\forall (a: A).((eq +A (aplus g a (S n)) (aplus g a n0)) \to (eq nat (S n) n0)))) (\lambda (a: +A).(\lambda (H0: (eq A (asucc g (aplus g a n)) a)).(let H1 \def (eq_ind_r A +(asucc g (aplus g a n)) (\lambda (a0: A).(eq A a0 a)) H0 (aplus g (asucc g a) +n) (aplus_asucc g n a)) in (aplus_asucc_false g a n H1 (eq nat (S n) O))))) +(\lambda (n0: nat).(\lambda (_: ((\forall (a: A).((eq A (asucc g (aplus g a +n)) (aplus g a n0)) \to (eq nat (S n) n0))))).(\lambda (a: A).(\lambda (H1: +(eq A (asucc g (aplus g a n)) (asucc g (aplus g a n0)))).(let H2 \def +(eq_ind_r A (asucc g (aplus g a n)) (\lambda (a0: A).(eq A a0 (asucc g (aplus +g a n0)))) H1 (aplus g (asucc g a) n) (aplus_asucc g n a)) in (let H3 \def +(eq_ind_r A (asucc g (aplus g a n0)) (\lambda (a0: A).(eq A (aplus g (asucc g +a) n) a0)) H2 (aplus g (asucc g a) n0) (aplus_asucc g n0 a)) in (f_equal nat +nat S n n0 (H n0 (asucc g a) H3)))))))) h2)))) h1)). + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/asucc/defs.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/asucc/defs.ma new file mode 100644 index 000000000..16b40e80d --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/asucc/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/Level-1/LambdaDelta/asucc/defs". + +include "A/defs.ma". + +include "G/defs.ma". + +definition asucc: + G \to (A \to A) +\def + let rec asucc (g: G) (l: A) on l: A \def (match l with [(ASort n0 n) +\Rightarrow (match n0 with [O \Rightarrow (ASort O (next g n)) | (S h) +\Rightarrow (ASort h n)]) | (AHead a1 a2) \Rightarrow (AHead a1 (asucc g +a2))]) in asucc. + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/asucc/fwd.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/asucc/fwd.ma new file mode 100644 index 000000000..76009b124 --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/asucc/fwd.ma @@ -0,0 +1,94 @@ +(**************************************************************************) +(* ___ *) +(* ||M|| *) +(* ||A|| A project by Andrea Asperti *) +(* ||T|| *) +(* ||I|| Developers: *) +(* ||T|| The HELM team. *) +(* ||A|| http://helm.cs.unibo.it *) +(* \ / *) +(* \ / This file is distributed under the terms of the *) +(* v GNU General Public License Version 2 *) +(* *) +(**************************************************************************) + +(* This file was automatically generated: do not edit *********************) + +set "baseuri" "cic:/matita/LAMBDA-TYPES/Level-1/LambdaDelta/asucc/fwd". + +include "asucc/defs.ma". + +theorem asucc_gen_sort: + \forall (g: G).(\forall (h: nat).(\forall (n: nat).(\forall (a: A).((eq A +(ASort h n) (asucc g a)) \to (ex_2 nat nat (\lambda (h0: nat).(\lambda (n0: +nat).(eq A a (ASort h0 n0))))))))) +\def + \lambda (g: G).(\lambda (h: nat).(\lambda (n: nat).(\lambda (a: A).(A_ind +(\lambda (a0: A).((eq A (ASort h n) (asucc g a0)) \to (ex_2 nat nat (\lambda +(h0: nat).(\lambda (n0: nat).(eq A a0 (ASort h0 n0))))))) (\lambda (n0: +nat).(\lambda (n1: nat).(\lambda (H: (eq A (ASort h n) (asucc g (ASort n0 +n1)))).(let H0 \def (f_equal A A (\lambda (e: A).e) (ASort h n) (match n0 +with [O \Rightarrow (ASort O (next g n1)) | (S h) \Rightarrow (ASort h n1)]) +H) in (ex_2_intro nat nat (\lambda (h0: nat).(\lambda (n2: nat).(eq A (ASort +n0 n1) (ASort h0 n2)))) n0 n1 (refl_equal A (ASort n0 n1))))))) (\lambda (a0: +A).(\lambda (_: (((eq A (ASort h n) (asucc g a0)) \to (ex_2 nat nat (\lambda +(h0: nat).(\lambda (n0: nat).(eq A a0 (ASort h0 n0)))))))).(\lambda (a1: +A).(\lambda (_: (((eq A (ASort h n) (asucc g a1)) \to (ex_2 nat nat (\lambda +(h0: nat).(\lambda (n0: nat).(eq A a1 (ASort h0 n0)))))))).(\lambda (H1: (eq +A (ASort h n) (asucc g (AHead a0 a1)))).(let H2 \def (eq_ind A (ASort h n) +(\lambda (ee: A).(match ee in A return (\lambda (_: A).Prop) with [(ASort _ +_) \Rightarrow True | (AHead _ _) \Rightarrow False])) I (asucc g (AHead a0 +a1)) H1) in (False_ind (ex_2 nat nat (\lambda (h0: nat).(\lambda (n0: +nat).(eq A (AHead a0 a1) (ASort h0 n0))))) H2))))))) a)))). + +theorem asucc_gen_head: + \forall (g: G).(\forall (a1: A).(\forall (a2: A).(\forall (a: A).((eq A +(AHead a1 a2) (asucc g a)) \to (ex2 A (\lambda (a0: A).(eq A a (AHead a1 +a0))) (\lambda (a0: A).(eq A a2 (asucc g a0)))))))) +\def + \lambda (g: G).(\lambda (a1: A).(\lambda (a2: A).(\lambda (a: A).(A_ind +(\lambda (a0: A).((eq A (AHead a1 a2) (asucc g a0)) \to (ex2 A (\lambda (a3: +A).(eq A a0 (AHead a1 a3))) (\lambda (a3: A).(eq A a2 (asucc g a3)))))) +(\lambda (n: nat).(\lambda (n0: nat).(\lambda (H: (eq A (AHead a1 a2) (asucc +g (ASort n n0)))).(nat_ind (\lambda (n1: nat).((eq A (AHead a1 a2) (asucc g +(ASort n1 n0))) \to (ex2 A (\lambda (a0: A).(eq A (ASort n1 n0) (AHead a1 +a0))) (\lambda (a0: A).(eq A a2 (asucc g a0)))))) (\lambda (H0: (eq A (AHead +a1 a2) (asucc g (ASort O n0)))).(let H1 \def (eq_ind A (AHead a1 a2) (\lambda +(ee: A).(match ee in A return (\lambda (_: A).Prop) with [(ASort _ _) +\Rightarrow False | (AHead _ _) \Rightarrow True])) I (ASort O (next g n0)) +H0) in (False_ind (ex2 A (\lambda (a0: A).(eq A (ASort O n0) (AHead a1 a0))) +(\lambda (a0: A).(eq A a2 (asucc g a0)))) H1))) (\lambda (n1: nat).(\lambda +(_: (((eq A (AHead a1 a2) (asucc g (ASort n1 n0))) \to (ex2 A (\lambda (a0: +A).(eq A (ASort n1 n0) (AHead a1 a0))) (\lambda (a0: A).(eq A a2 (asucc g +a0))))))).(\lambda (H0: (eq A (AHead a1 a2) (asucc g (ASort (S n1) +n0)))).(let H1 \def (eq_ind A (AHead a1 a2) (\lambda (ee: A).(match ee in A +return (\lambda (_: A).Prop) with [(ASort _ _) \Rightarrow False | (AHead _ +_) \Rightarrow True])) I (ASort n1 n0) H0) in (False_ind (ex2 A (\lambda (a0: +A).(eq A (ASort (S n1) n0) (AHead a1 a0))) (\lambda (a0: A).(eq A a2 (asucc g +a0)))) H1))))) n H)))) (\lambda (a0: A).(\lambda (H: (((eq A (AHead a1 a2) +(asucc g a0)) \to (ex2 A (\lambda (a2: A).(eq A a0 (AHead a1 a2))) (\lambda +(a0: A).(eq A a2 (asucc g a0))))))).(\lambda (a3: A).(\lambda (H0: (((eq A +(AHead a1 a2) (asucc g a3)) \to (ex2 A (\lambda (a0: A).(eq A a3 (AHead a1 +a0))) (\lambda (a0: A).(eq A a2 (asucc g a0))))))).(\lambda (H1: (eq A (AHead +a1 a2) (asucc g (AHead a0 a3)))).(let H2 \def (f_equal A A (\lambda (e: +A).(match e in A return (\lambda (_: A).A) with [(ASort _ _) \Rightarrow a1 | +(AHead a _) \Rightarrow a])) (AHead a1 a2) (AHead a0 (asucc g a3)) H1) in +((let H3 \def (f_equal A A (\lambda (e: A).(match e in A return (\lambda (_: +A).A) with [(ASort _ _) \Rightarrow a2 | (AHead _ a) \Rightarrow a])) (AHead +a1 a2) (AHead a0 (asucc g a3)) H1) in (\lambda (H4: (eq A a1 a0)).(let H5 +\def (eq_ind_r A a0 (\lambda (a: A).((eq A (AHead a1 a2) (asucc g a)) \to +(ex2 A (\lambda (a0: A).(eq A a (AHead a1 a0))) (\lambda (a0: A).(eq A a2 +(asucc g a0)))))) H a1 H4) in (eq_ind A a1 (\lambda (a4: A).(ex2 A (\lambda +(a5: A).(eq A (AHead a4 a3) (AHead a1 a5))) (\lambda (a5: A).(eq A a2 (asucc +g a5))))) (let H6 \def (eq_ind A a2 (\lambda (a: A).((eq A (AHead a1 a) +(asucc g a3)) \to (ex2 A (\lambda (a0: A).(eq A a3 (AHead a1 a0))) (\lambda +(a0: A).(eq A a (asucc g a0)))))) H0 (asucc g a3) H3) in (let H7 \def (eq_ind +A a2 (\lambda (a: A).((eq A (AHead a1 a) (asucc g a1)) \to (ex2 A (\lambda +(a0: A).(eq A a1 (AHead a1 a0))) (\lambda (a0: A).(eq A a (asucc g a0)))))) +H5 (asucc g a3) H3) in (eq_ind_r A (asucc g a3) (\lambda (a4: A).(ex2 A +(\lambda (a5: A).(eq A (AHead a1 a3) (AHead a1 a5))) (\lambda (a5: A).(eq A +a4 (asucc g a5))))) (ex_intro2 A (\lambda (a4: A).(eq A (AHead a1 a3) (AHead +a1 a4))) (\lambda (a4: A).(eq A (asucc g a3) (asucc g a4))) a3 (refl_equal A +(AHead a1 a3)) (refl_equal A (asucc g a3))) a2 H3))) a0 H4)))) H2))))))) +a)))). + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/leq/asucc.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/leq/asucc.ma new file mode 100644 index 000000000..290c32cc9 --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/leq/asucc.ma @@ -0,0 +1,88 @@ +(**************************************************************************) +(* ___ *) +(* ||M|| *) +(* ||A|| A project by Andrea Asperti *) +(* ||T|| *) +(* ||I|| Developers: *) +(* ||T|| The HELM team. *) +(* ||A|| http://helm.cs.unibo.it *) +(* \ / *) +(* \ / This file is distributed under the terms of the *) +(* v GNU General Public License Version 2 *) +(* *) +(**************************************************************************) + +(* This file was automatically generated: do not edit *********************) + +set "baseuri" "cic:/matita/LAMBDA-TYPES/Level-1/LambdaDelta/leq/asucc". + +include "leq/defs.ma". + +include "aplus/props.ma". + +theorem asucc_repl: + \forall (g: G).(\forall (a1: A).(\forall (a2: A).((leq g a1 a2) \to (leq g +(asucc g a1) (asucc g a2))))) +\def + \lambda (g: G).(\lambda (a1: A).(\lambda (a2: A).(\lambda (H: (leq g a1 +a2)).(leq_ind g (\lambda (a: A).(\lambda (a0: A).(leq g (asucc g a) (asucc g +a0)))) (\lambda (h1: nat).(\lambda (h2: nat).(\lambda (n1: nat).(\lambda (n2: +nat).(\lambda (k: nat).(\lambda (H0: (eq A (aplus g (ASort h1 n1) k) (aplus g +(ASort h2 n2) k))).((match h1 in nat return (\lambda (n: nat).((eq A (aplus g +(ASort n n1) k) (aplus g (ASort h2 n2) k)) \to (leq g (match n with [O +\Rightarrow (ASort O (next g n1)) | (S h) \Rightarrow (ASort h n1)]) (match +h2 with [O \Rightarrow (ASort O (next g n2)) | (S h) \Rightarrow (ASort h +n2)])))) with [O \Rightarrow (\lambda (H1: (eq A (aplus g (ASort O n1) k) +(aplus g (ASort h2 n2) k))).((match h2 in nat return (\lambda (n: nat).((eq A +(aplus g (ASort O n1) k) (aplus g (ASort n n2) k)) \to (leq g (ASort O (next +g n1)) (match n with [O \Rightarrow (ASort O (next g n2)) | (S h) \Rightarrow +(ASort h n2)])))) with [O \Rightarrow (\lambda (H2: (eq A (aplus g (ASort O +n1) k) (aplus g (ASort O n2) k))).(leq_sort g O O (next g n1) (next g n2) k +(eq_ind A (aplus g (ASort O n1) (S k)) (\lambda (a: A).(eq A a (aplus g +(ASort O (next g n2)) k))) (eq_ind A (aplus g (ASort O n2) (S k)) (\lambda +(a: A).(eq A (aplus g (ASort O n1) (S k)) a)) (eq_ind_r A (aplus g (ASort O +n2) k) (\lambda (a: A).(eq A (asucc g a) (asucc g (aplus g (ASort O n2) k)))) +(refl_equal A (asucc g (aplus g (ASort O n2) k))) (aplus g (ASort O n1) k) +H2) (aplus g (ASort O (next g n2)) k) (aplus_sort_O_S_simpl g n2 k)) (aplus g +(ASort O (next g n1)) k) (aplus_sort_O_S_simpl g n1 k)))) | (S n) \Rightarrow +(\lambda (H2: (eq A (aplus g (ASort O n1) k) (aplus g (ASort (S n) n2) +k))).(leq_sort g O n (next g n1) n2 k (eq_ind A (aplus g (ASort O n1) (S k)) +(\lambda (a: A).(eq A a (aplus g (ASort n n2) k))) (eq_ind A (aplus g (ASort +(S n) n2) (S k)) (\lambda (a: A).(eq A (aplus g (ASort O n1) (S k)) a)) +(eq_ind_r A (aplus g (ASort (S n) n2) k) (\lambda (a: A).(eq A (asucc g a) +(asucc g (aplus g (ASort (S n) n2) k)))) (refl_equal A (asucc g (aplus g +(ASort (S n) n2) k))) (aplus g (ASort O n1) k) H2) (aplus g (ASort n n2) k) +(aplus_sort_S_S_simpl g n2 n k)) (aplus g (ASort O (next g n1)) k) +(aplus_sort_O_S_simpl g n1 k))))]) H1)) | (S n) \Rightarrow (\lambda (H1: (eq +A (aplus g (ASort (S n) n1) k) (aplus g (ASort h2 n2) k))).((match h2 in nat +return (\lambda (n0: nat).((eq A (aplus g (ASort (S n) n1) k) (aplus g (ASort +n0 n2) k)) \to (leq g (ASort n n1) (match n0 with [O \Rightarrow (ASort O +(next g n2)) | (S h) \Rightarrow (ASort h n2)])))) with [O \Rightarrow +(\lambda (H2: (eq A (aplus g (ASort (S n) n1) k) (aplus g (ASort O n2) +k))).(leq_sort g n O n1 (next g n2) k (eq_ind A (aplus g (ASort O n2) (S k)) +(\lambda (a: A).(eq A (aplus g (ASort n n1) k) a)) (eq_ind A (aplus g (ASort +(S n) n1) (S k)) (\lambda (a: A).(eq A a (aplus g (ASort O n2) (S k)))) +(eq_ind_r A (aplus g (ASort O n2) k) (\lambda (a: A).(eq A (asucc g a) (asucc +g (aplus g (ASort O n2) k)))) (refl_equal A (asucc g (aplus g (ASort O n2) +k))) (aplus g (ASort (S n) n1) k) H2) (aplus g (ASort n n1) k) +(aplus_sort_S_S_simpl g n1 n k)) (aplus g (ASort O (next g n2)) k) +(aplus_sort_O_S_simpl g n2 k)))) | (S n0) \Rightarrow (\lambda (H2: (eq A +(aplus g (ASort (S n) n1) k) (aplus g (ASort (S n0) n2) k))).(leq_sort g n n0 +n1 n2 k (eq_ind A (aplus g (ASort (S n) n1) (S k)) (\lambda (a: A).(eq A a +(aplus g (ASort n0 n2) k))) (eq_ind A (aplus g (ASort (S n0) n2) (S k)) +(\lambda (a: A).(eq A (aplus g (ASort (S n) n1) (S k)) a)) (eq_ind_r A (aplus +g (ASort (S n0) n2) k) (\lambda (a: A).(eq A (asucc g a) (asucc g (aplus g +(ASort (S n0) n2) k)))) (refl_equal A (asucc g (aplus g (ASort (S n0) n2) +k))) (aplus g (ASort (S n) n1) k) H2) (aplus g (ASort n0 n2) k) +(aplus_sort_S_S_simpl g n2 n0 k)) (aplus g (ASort n n1) k) +(aplus_sort_S_S_simpl g n1 n k))))]) H1))]) H0))))))) (\lambda (a3: +A).(\lambda (a4: A).(\lambda (H0: (leq g a3 a4)).(\lambda (_: (leq g (asucc g +a3) (asucc g a4))).(\lambda (a5: A).(\lambda (a6: A).(\lambda (_: (leq g a5 +a6)).(\lambda (H3: (leq g (asucc g a5) (asucc g a6))).(leq_head g a3 a4 H0 +(asucc g a5) (asucc g a6) H3))))))))) a1 a2 H)))). + +axiom asucc_inj: + \forall (g: G).(\forall (a1: A).(\forall (a2: A).((leq g (asucc g a1) (asucc +g a2)) \to (leq g a1 a2)))) +. + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/leq/defs.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/leq/defs.ma new file mode 100644 index 000000000..8015e7132 --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/leq/defs.ma @@ -0,0 +1,28 @@ +(**************************************************************************) +(* ___ *) +(* ||M|| *) +(* ||A|| A project by Andrea Asperti *) +(* ||T|| *) +(* ||I|| Developers: *) +(* ||T|| The HELM team. *) +(* ||A|| http://helm.cs.unibo.it *) +(* \ / *) +(* \ / This file is distributed under the terms of the *) +(* v GNU General Public License Version 2 *) +(* *) +(**************************************************************************) + +(* This file was automatically generated: do not edit *********************) + +set "baseuri" "cic:/matita/LAMBDA-TYPES/Level-1/LambdaDelta/leq/defs". + +include "aplus/defs.ma". + +inductive leq (g:G): A \to (A \to Prop) \def +| leq_sort: \forall (h1: nat).(\forall (h2: nat).(\forall (n1: nat).(\forall +(n2: nat).(\forall (k: nat).((eq A (aplus g (ASort h1 n1) k) (aplus g (ASort +h2 n2) k)) \to (leq g (ASort h1 n1) (ASort h2 n2))))))) +| leq_head: \forall (a1: A).(\forall (a2: A).((leq g a1 a2) \to (\forall (a3: +A).(\forall (a4: A).((leq g a3 a4) \to (leq g (AHead a1 a3) (AHead a2 +a4))))))). + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/theory.ma b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/theory.ma index 4a9a6d76f..405f95aff 100644 --- a/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/theory.ma +++ b/matita/contribs/LAMBDA-TYPES/Level-1/LambdaDelta/theory.ma @@ -164,3 +164,17 @@ include "tau0/defs.ma". include "tau0/props.ma". +include "A/defs.ma". + +include "asucc/defs.ma". + +include "asucc/fwd.ma". + +include "aplus/defs.ma". + +include "aplus/props.ma". + +include "leq/defs.ma". + +include "leq/asucc.ma". + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/problems-1.ma b/matita/contribs/LAMBDA-TYPES/Level-1/problems-1.ma index f3b166546..0c747cdf0 100644 --- a/matita/contribs/LAMBDA-TYPES/Level-1/problems-1.ma +++ b/matita/contribs/LAMBDA-TYPES/Level-1/problems-1.ma @@ -13,7 +13,6 @@ (**************************************************************************) (* Problematic objects for disambiguation/typechecking ********************) -(* FG: PLEASE COMMENT THE NON WORKING OBJECTS *****************************) set "baseuri" "cic:/matita/LAMBDA-TYPES/Level-1/problems". diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/problems-1.ma~ b/matita/contribs/LAMBDA-TYPES/Level-1/problems-1.ma~ new file mode 100644 index 000000000..f3b166546 --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/problems-1.ma~ @@ -0,0 +1,107 @@ +(**************************************************************************) +(* ___ *) +(* ||M|| *) +(* ||A|| A project by Andrea Asperti *) +(* ||T|| *) +(* ||I|| Developers: *) +(* ||T|| The HELM team. *) +(* ||A|| http://helm.cs.unibo.it *) +(* \ / *) +(* \ / This file is distributed under the terms of the *) +(* v GNU General Public License Version 2 *) +(* *) +(**************************************************************************) + +(* Problematic objects for disambiguation/typechecking ********************) +(* FG: PLEASE COMMENT THE NON WORKING OBJECTS *****************************) + +set "baseuri" "cic:/matita/LAMBDA-TYPES/Level-1/problems". + +include "LambdaDelta/theory.ma". + +theorem iso_trans: + \forall (t1: T).(\forall (t2: T).((iso t1 t2) \to (\forall (t3: T).((iso t2 +t3) \to (iso t1 t3))))) +\def + \lambda (t1: T).(\lambda (t2: T).(\lambda (H: (iso t1 t2)).(iso_ind (\lambda +(t: T).(\lambda (t0: T).(\forall (t3: T).((iso t0 t3) \to (iso t t3))))) +(\lambda (n1: nat).(\lambda (n2: nat).(\lambda (t3: T).(\lambda (H0: (iso +(TSort n2) t3)).(let H1 \def (match H0 in iso return (\lambda (t: T).(\lambda +(t0: T).(\lambda (_: (iso t t0)).((eq T t (TSort n2)) \to ((eq T t0 t3) \to +(iso (TSort n1) t3)))))) with [(iso_sort n0 n3) \Rightarrow (\lambda (H0: (eq +T (TSort n0) (TSort n2))).(\lambda (H1: (eq T (TSort n3) t3)).((let H2 \def +(f_equal T nat (\lambda (e: T).(match e in T return (\lambda (_: T).nat) with +[(TSort n) \Rightarrow n | (TLRef _) \Rightarrow n0 | (THead _ _ _) +\Rightarrow n0])) (TSort n0) (TSort n2) H0) in (eq_ind nat n2 (\lambda (_: +nat).((eq T (TSort n3) t3) \to (iso (TSort n1) t3))) (\lambda (H3: (eq T +(TSort n3) t3)).(eq_ind T (TSort n3) (\lambda (t: T).(iso (TSort n1) t)) +(iso_sort n1 n3) t3 H3)) n0 (sym_eq nat n0 n2 H2))) H1))) | (iso_lref i1 i2) +\Rightarrow (\lambda (H0: (eq T (TLRef i1) (TSort n2))).(\lambda (H1: (eq T +(TLRef i2) t3)).((let H2 \def (eq_ind T (TLRef i1) (\lambda (e: T).(match e +in T return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | (TLRef +_) \Rightarrow True | (THead _ _ _) \Rightarrow False])) I (TSort n2) H0) in +(False_ind ((eq T (TLRef i2) t3) \to (iso (TSort n1) t3)) H2)) H1))) | +(iso_head k v1 v2 t1 t2) \Rightarrow (\lambda (H0: (eq T (THead k v1 t1) +(TSort n2))).(\lambda (H1: (eq T (THead k v2 t2) t3)).((let H2 \def (eq_ind T +(THead k v1 t1) (\lambda (e: T).(match e in T return (\lambda (_: T).Prop) +with [(TSort _) \Rightarrow False | (TLRef _) \Rightarrow False | (THead _ _ +_) \Rightarrow True])) I (TSort n2) H0) in (False_ind ((eq T (THead k v2 t2) +t3) \to (iso (TSort n1) t3)) H2)) H1)))]) in (H1 (refl_equal T (TSort n2)) +(refl_equal T t3))))))) (\lambda (i1: nat).(\lambda (i2: nat).(\lambda (t3: +T).(\lambda (H0: (iso (TLRef i2) t3)).(let H1 \def (match H0 in iso return +(\lambda (t: T).(\lambda (t0: T).(\lambda (_: (iso t t0)).((eq T t (TLRef +i2)) \to ((eq T t0 t3) \to (iso (TLRef i1) t3)))))) with [(iso_sort n1 n2) +\Rightarrow (\lambda (H0: (eq T (TSort n1) (TLRef i2))).(\lambda (H1: (eq T +(TSort n2) t3)).((let H2 \def (eq_ind T (TSort n1) (\lambda (e: T).(match e +in T return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow True | (TLRef +_) \Rightarrow False | (THead _ _ _) \Rightarrow False])) I (TLRef i2) H0) in +(False_ind ((eq T (TSort n2) t3) \to (iso (TLRef i1) t3)) H2)) H1))) | +(iso_lref i0 i3) \Rightarrow (\lambda (H0: (eq T (TLRef i0) (TLRef +i2))).(\lambda (H1: (eq T (TLRef i3) t3)).((let H2 \def (f_equal T nat +(\lambda (e: T).(match e in T return (\lambda (_: T).nat) with [(TSort _) +\Rightarrow i0 | (TLRef n) \Rightarrow n | (THead _ _ _) \Rightarrow i0])) +(TLRef i0) (TLRef i2) H0) in (eq_ind nat i2 (\lambda (_: nat).((eq T (TLRef +i3) t3) \to (iso (TLRef i1) t3))) (\lambda (H3: (eq T (TLRef i3) t3)).(eq_ind +T (TLRef i3) (\lambda (t: T).(iso (TLRef i1) t)) (iso_lref i1 i3) t3 H3)) i0 +(sym_eq nat i0 i2 H2))) H1))) | (iso_head k v1 v2 t1 t2) \Rightarrow (\lambda +(H0: (eq T (THead k v1 t1) (TLRef i2))).(\lambda (H1: (eq T (THead k v2 t2) +t3)).((let H2 \def (eq_ind T (THead k v1 t1) (\lambda (e: T).(match e in T +return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) +\Rightarrow False | (THead _ _ _) \Rightarrow True])) I (TLRef i2) H0) in +(False_ind ((eq T (THead k v2 t2) t3) \to (iso (TLRef i1) t3)) H2)) H1)))]) +in (H1 (refl_equal T (TLRef i2)) (refl_equal T t3))))))) (\lambda (k: +K).(\lambda (v1: T).(\lambda (v2: T).(\lambda (t3: T).(\lambda (t4: +T).(\lambda (t5: T).(\lambda (H0: (iso (THead k v2 t4) t5)).(let H1 \def +(match H0 in iso return (\lambda (t: T).(\lambda (t0: T).(\lambda (_: (iso t +t0)).((eq T t (THead k v2 t4)) \to ((eq T t0 t5) \to (iso (THead k v1 t3) +t5)))))) with [(iso_sort n1 n2) \Rightarrow (\lambda (H0: (eq T (TSort n1) +(THead k v2 t4))).(\lambda (H1: (eq T (TSort n2) t5)).((let H2 \def (eq_ind T +(TSort n1) (\lambda (e: T).(match e in T return (\lambda (_: T).Prop) with +[(TSort _) \Rightarrow True | (TLRef _) \Rightarrow False | (THead _ _ _) +\Rightarrow False])) I (THead k v2 t4) H0) in (False_ind ((eq T (TSort n2) +t5) \to (iso (THead k v1 t3) t5)) H2)) H1))) | (iso_lref i1 i2) \Rightarrow +(\lambda (H0: (eq T (TLRef i1) (THead k v2 t4))).(\lambda (H1: (eq T (TLRef +i2) t5)).((let H2 \def (eq_ind T (TLRef i1) (\lambda (e: T).(match e in T +return (\lambda (_: T).Prop) with [(TSort _) \Rightarrow False | (TLRef _) +\Rightarrow True | (THead _ _ _) \Rightarrow False])) I (THead k v2 t4) H0) +in (False_ind ((eq T (TLRef i2) t5) \to (iso (THead k v1 t3) t5)) H2)) H1))) +| (iso_head k0 v0 v3 t0 t4) \Rightarrow (\lambda (H0: (eq T (THead k0 v0 t0) +(THead k v2 t4))).(\lambda (H1: (eq T (THead k0 v3 t4) t5)).((let H2 \def +(f_equal T T (\lambda (e: T).(match e in T return (\lambda (_: T).T) with +[(TSort _) \Rightarrow t0 | (TLRef _) \Rightarrow t0 | (THead _ _ t) +\Rightarrow t])) (THead k0 v0 t0) (THead k v2 t4) H0) in ((let H3 \def +(f_equal T T (\lambda (e: T).(match e in T return (\lambda (_: T).T) with +[(TSort _) \Rightarrow v0 | (TLRef _) \Rightarrow v0 | (THead _ t _) +\Rightarrow t])) (THead k0 v0 t0) (THead k v2 t4) H0) in ((let H4 \def +(f_equal T K (\lambda (e: T).(match e in T return (\lambda (_: T).K) with +[(TSort _) \Rightarrow k0 | (TLRef _) \Rightarrow k0 | (THead k _ _) +\Rightarrow k])) (THead k0 v0 t0) (THead k v2 t4) H0) in (eq_ind K k (\lambda +(k1: K).((eq T v0 v2) \to ((eq T t0 t4) \to ((eq T (THead k1 v3 t4) t5) \to +(iso (THead k v1 t3) t5))))) (\lambda (H5: (eq T v0 v2)).(eq_ind T v2 +(\lambda (_: T).((eq T t0 t4) \to ((eq T (THead k v3 t4) t5) \to (iso (THead +k v1 t3) t5)))) (\lambda (H6: (eq T t0 t4)).(eq_ind T t4 (\lambda (_: T).((eq +T (THead k v3 t4) t5) \to (iso (THead k v1 t3) t5))) (\lambda (H7: (eq T +(THead k v3 t4) t5)).(eq_ind T (THead k v3 t4) (\lambda (t: T).(iso (THead k +v1 t3) t)) (iso_head k v1 v3 t3 t4) t5 H7)) t0 (sym_eq T t0 t4 H6))) v0 +(sym_eq T v0 v2 H5))) k0 (sym_eq K k0 k H4))) H3)) H2)) H1)))]) in (H1 +(refl_equal T (THead k v2 t4)) (refl_equal T t5)))))))))) t1 t2 H))). diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/problems-2.ma b/matita/contribs/LAMBDA-TYPES/Level-1/problems-2.ma index a0f6f0275..7d70d242f 100644 --- a/matita/contribs/LAMBDA-TYPES/Level-1/problems-2.ma +++ b/matita/contribs/LAMBDA-TYPES/Level-1/problems-2.ma @@ -13,7 +13,6 @@ (**************************************************************************) (* Problematic objects for disambiguation/typechecking ********************) -(* FG: PLEASE COMMENT THE NON WORKING OBJECTS *****************************) set "baseuri" "cic:/matita/LAMBDA-TYPES/Level-1/problems". diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/problems-2.ma~ b/matita/contribs/LAMBDA-TYPES/Level-1/problems-2.ma~ new file mode 100644 index 000000000..a0f6f0275 --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/problems-2.ma~ @@ -0,0 +1,158 @@ +(**************************************************************************) +(* ___ *) +(* ||M|| *) +(* ||A|| A project by Andrea Asperti *) +(* ||T|| *) +(* ||I|| Developers: *) +(* ||T|| The HELM team. *) +(* ||A|| http://helm.cs.unibo.it *) +(* \ / *) +(* \ / This file is distributed under the terms of the *) +(* v GNU General Public License Version 2 *) +(* *) +(**************************************************************************) + +(* Problematic objects for disambiguation/typechecking ********************) +(* FG: PLEASE COMMENT THE NON WORKING OBJECTS *****************************) + +set "baseuri" "cic:/matita/LAMBDA-TYPES/Level-1/problems". + +include "LambdaDelta/theory.ma". + +theorem drop1_getl_trans: + \forall (hds: PList).(\forall (c1: C).(\forall (c2: C).((drop1 hds c2 c1) +\to (\forall (b: B).(\forall (e1: C).(\forall (v: T).(\forall (i: nat).((getl +i c1 (CHead e1 (Bind b) v)) \to (ex C (\lambda (e2: C).(getl (trans hds i) c2 +(CHead e2 (Bind b) (ctrans hds i v))))))))))))) +\def + \lambda (hds: PList).(PList_ind (\lambda (p: PList).(\forall (c1: +C).(\forall (c2: C).((drop1 p c2 c1) \to (\forall (b: B).(\forall (e1: +C).(\forall (v: T).(\forall (i: nat).((getl i c1 (CHead e1 (Bind b) v)) \to +(ex C (\lambda (e2: C).(getl (trans p i) c2 (CHead e2 (Bind b) (ctrans p i +v)))))))))))))) (\lambda (c1: C).(\lambda (c2: C).(\lambda (H: (drop1 PNil c2 +c1)).(\lambda (b: B).(\lambda (e1: C).(\lambda (v: T).(\lambda (i: +nat).(\lambda (H0: (getl i c1 (CHead e1 (Bind b) v))).(let H1 \def (match H +in drop1 return (\lambda (p: PList).(\lambda (c: C).(\lambda (c0: C).(\lambda +(_: (drop1 p c c0)).((eq PList p PNil) \to ((eq C c c2) \to ((eq C c0 c1) \to +(ex C (\lambda (e2: C).(getl i c2 (CHead e2 (Bind b) v))))))))))) with +[(drop1_nil c) \Rightarrow (\lambda (_: (eq PList PNil PNil)).(\lambda (H2: +(eq C c c2)).(\lambda (H3: (eq C c c1)).(eq_ind C c2 (\lambda (c0: C).((eq C +c0 c1) \to (ex C (\lambda (e2: C).(getl i c2 (CHead e2 (Bind b) v)))))) +(\lambda (H4: (eq C c2 c1)).(eq_ind C c1 (\lambda (c0: C).(ex C (\lambda (e2: +C).(getl i c0 (CHead e2 (Bind b) v))))) (ex_intro C (\lambda (e2: C).(getl i +c1 (CHead e2 (Bind b) v))) e1 H0) c2 (sym_eq C c2 c1 H4))) c (sym_eq C c c2 +H2) H3)))) | (drop1_cons c0 c3 h d H1 c4 hds H2) \Rightarrow (\lambda (H3: +(eq PList (PCons h d hds) PNil)).(\lambda (H4: (eq C c0 c2)).(\lambda (H5: +(eq C c4 c1)).((let H6 \def (eq_ind PList (PCons h d hds) (\lambda (e: +PList).(match e in PList return (\lambda (_: PList).Prop) with [PNil +\Rightarrow False | (PCons _ _ _) \Rightarrow True])) I PNil H3) in +(False_ind ((eq C c0 c2) \to ((eq C c4 c1) \to ((drop h d c0 c3) \to ((drop1 +hds c3 c4) \to (ex C (\lambda (e2: C).(getl i c2 (CHead e2 (Bind b) v)))))))) +H6)) H4 H5 H1 H2))))]) in (H1 (refl_equal PList PNil) (refl_equal C c2) +(refl_equal C c1))))))))))) (\lambda (h: nat).(\lambda (d: nat).(\lambda +(hds0: PList).(\lambda (H: ((\forall (c1: C).(\forall (c2: C).((drop1 hds0 c2 +c1) \to (\forall (b: B).(\forall (e1: C).(\forall (v: T).(\forall (i: +nat).((getl i c1 (CHead e1 (Bind b) v)) \to (ex C (\lambda (e2: C).(getl +(trans hds0 i) c2 (CHead e2 (Bind b) (ctrans hds0 i v))))))))))))))).(\lambda +(c1: C).(\lambda (c2: C).(\lambda (H0: (drop1 (PCons h d hds0) c2 +c1)).(\lambda (b: B).(\lambda (e1: C).(\lambda (v: T).(\lambda (i: +nat).(\lambda (H1: (getl i c1 (CHead e1 (Bind b) v))).(let H2 \def (match H0 +in drop1 return (\lambda (p: PList).(\lambda (c: C).(\lambda (c0: C).(\lambda +(_: (drop1 p c c0)).((eq PList p (PCons h d hds0)) \to ((eq C c c2) \to ((eq +C c0 c1) \to (ex C (\lambda (e2: C).(getl (match (blt (trans hds0 i) d) with +[true \Rightarrow (trans hds0 i) | false \Rightarrow (plus (trans hds0 i) +h)]) c2 (CHead e2 (Bind b) (match (blt (trans hds0 i) d) with [true +\Rightarrow (lift h (minus d (S (trans hds0 i))) (ctrans hds0 i v)) | false +\Rightarrow (ctrans hds0 i v)])))))))))))) with [(drop1_nil c) \Rightarrow +(\lambda (H2: (eq PList PNil (PCons h d hds0))).(\lambda (H3: (eq C c +c2)).(\lambda (H4: (eq C c c1)).((let H5 \def (eq_ind PList PNil (\lambda (e: +PList).(match e in PList return (\lambda (_: PList).Prop) with [PNil +\Rightarrow True | (PCons _ _ _) \Rightarrow False])) I (PCons h d hds0) H2) +in (False_ind ((eq C c c2) \to ((eq C c c1) \to (ex C (\lambda (e2: C).(getl +(match (blt (trans hds0 i) d) with [true \Rightarrow (trans hds0 i) | false +\Rightarrow (plus (trans hds0 i) h)]) c2 (CHead e2 (Bind b) (match (blt +(trans hds0 i) d) with [true \Rightarrow (lift h (minus d (S (trans hds0 i))) +(ctrans hds0 i v)) | false \Rightarrow (ctrans hds0 i v)]))))))) H5)) H3 +H4)))) | (drop1_cons c0 c3 h0 d0 H2 c4 hds0 H3) \Rightarrow (\lambda (H4: (eq +PList (PCons h0 d0 hds0) (PCons h d hds0))).(\lambda (H5: (eq C c0 +c2)).(\lambda (H6: (eq C c4 c1)).((let H7 \def (f_equal PList PList (\lambda +(e: PList).(match e in PList return (\lambda (_: PList).PList) with [PNil +\Rightarrow hds0 | (PCons _ _ p) \Rightarrow p])) (PCons h0 d0 hds0) (PCons h +d hds0) H4) in ((let H8 \def (f_equal PList nat (\lambda (e: PList).(match e +in PList return (\lambda (_: PList).nat) with [PNil \Rightarrow d0 | (PCons _ +n _) \Rightarrow n])) (PCons h0 d0 hds0) (PCons h d hds0) H4) in ((let H9 +\def (f_equal PList nat (\lambda (e: PList).(match e in PList return (\lambda +(_: PList).nat) with [PNil \Rightarrow h0 | (PCons n _ _) \Rightarrow n])) +(PCons h0 d0 hds0) (PCons h d hds0) H4) in (eq_ind nat h (\lambda (n: +nat).((eq nat d0 d) \to ((eq PList hds0 hds0) \to ((eq C c0 c2) \to ((eq C c4 +c1) \to ((drop n d0 c0 c3) \to ((drop1 hds0 c3 c4) \to (ex C (\lambda (e2: +C).(getl (match (blt (trans hds0 i) d) with [true \Rightarrow (trans hds0 i) +| false \Rightarrow (plus (trans hds0 i) h)]) c2 (CHead e2 (Bind b) (match +(blt (trans hds0 i) d) with [true \Rightarrow (lift h (minus d (S (trans hds0 +i))) (ctrans hds0 i v)) | false \Rightarrow (ctrans hds0 i v)])))))))))))) +(\lambda (H10: (eq nat d0 d)).(eq_ind nat d (\lambda (n: nat).((eq PList hds0 +hds0) \to ((eq C c0 c2) \to ((eq C c4 c1) \to ((drop h n c0 c3) \to ((drop1 +hds0 c3 c4) \to (ex C (\lambda (e2: C).(getl (match (blt (trans hds0 i) d) +with [true \Rightarrow (trans hds0 i) | false \Rightarrow (plus (trans hds0 +i) h)]) c2 (CHead e2 (Bind b) (match (blt (trans hds0 i) d) with [true +\Rightarrow (lift h (minus d (S (trans hds0 i))) (ctrans hds0 i v)) | false +\Rightarrow (ctrans hds0 i v)]))))))))))) (\lambda (H11: (eq PList hds0 +hds0)).(eq_ind PList hds0 (\lambda (p: PList).((eq C c0 c2) \to ((eq C c4 c1) +\to ((drop h d c0 c3) \to ((drop1 p c3 c4) \to (ex C (\lambda (e2: C).(getl +(match (blt (trans hds0 i) d) with [true \Rightarrow (trans hds0 i) | false +\Rightarrow (plus (trans hds0 i) h)]) c2 (CHead e2 (Bind b) (match (blt +(trans hds0 i) d) with [true \Rightarrow (lift h (minus d (S (trans hds0 i))) +(ctrans hds0 i v)) | false \Rightarrow (ctrans hds0 i v)])))))))))) (\lambda +(H12: (eq C c0 c2)).(eq_ind C c2 (\lambda (c: C).((eq C c4 c1) \to ((drop h d +c c3) \to ((drop1 hds0 c3 c4) \to (ex C (\lambda (e2: C).(getl (match (blt +(trans hds0 i) d) with [true \Rightarrow (trans hds0 i) | false \Rightarrow +(plus (trans hds0 i) h)]) c2 (CHead e2 (Bind b) (match (blt (trans hds0 i) d) +with [true \Rightarrow (lift h (minus d (S (trans hds0 i))) (ctrans hds0 i +v)) | false \Rightarrow (ctrans hds0 i v)]))))))))) (\lambda (H13: (eq C c4 +c1)).(eq_ind C c1 (\lambda (c: C).((drop h d c2 c3) \to ((drop1 hds0 c3 c) +\to (ex C (\lambda (e2: C).(getl (match (blt (trans hds0 i) d) with [true +\Rightarrow (trans hds0 i) | false \Rightarrow (plus (trans hds0 i) h)]) c2 +(CHead e2 (Bind b) (match (blt (trans hds0 i) d) with [true \Rightarrow (lift +h (minus d (S (trans hds0 i))) (ctrans hds0 i v)) | false \Rightarrow (ctrans +hds0 i v)])))))))) (\lambda (H14: (drop h d c2 c3)).(\lambda (H15: (drop1 +hds0 c3 c1)).(xinduction bool (blt (trans hds0 i) d) (\lambda (b0: bool).(ex +C (\lambda (e2: C).(getl (match b0 with [true \Rightarrow (trans hds0 i) | +false \Rightarrow (plus (trans hds0 i) h)]) c2 (CHead e2 (Bind b) (match b0 +with [true \Rightarrow (lift h (minus d (S (trans hds0 i))) (ctrans hds0 i +v)) | false \Rightarrow (ctrans hds0 i v)])))))) (\lambda (x_x: +bool).(bool_ind (\lambda (b0: bool).((eq bool (blt (trans hds0 i) d) b0) \to +(ex C (\lambda (e2: C).(getl (match b0 with [true \Rightarrow (trans hds0 i) +| false \Rightarrow (plus (trans hds0 i) h)]) c2 (CHead e2 (Bind b) (match b0 +with [true \Rightarrow (lift h (minus d (S (trans hds0 i))) (ctrans hds0 i +v)) | false \Rightarrow (ctrans hds0 i v)]))))))) (\lambda (H0: (eq bool (blt +(trans hds0 i) d) true)).(let H_x \def (H c1 c3 H15 b e1 v i H1) in (let H16 +\def H_x in (ex_ind C (\lambda (e2: C).(getl (trans hds0 i) c3 (CHead e2 +(Bind b) (ctrans hds0 i v)))) (ex C (\lambda (e2: C).(getl (trans hds0 i) c2 +(CHead e2 (Bind b) (lift h (minus d (S (trans hds0 i))) (ctrans hds0 i +v)))))) (\lambda (x: C).(\lambda (H17: (getl (trans hds0 i) c3 (CHead x (Bind +b) (ctrans hds0 i v)))).(let H_x0 \def (drop_getl_trans_lt (trans hds0 i) d +(le_S_n (S (trans hds0 i)) d (lt_le_S (S (trans hds0 i)) (S d) (blt_lt (S d) +(S (trans hds0 i)) H0))) c2 c3 h H14 b x (ctrans hds0 i v) H17) in (let H +\def H_x0 in (ex2_ind C (\lambda (e1: C).(getl (trans hds0 i) c2 (CHead e1 +(Bind b) (lift h (minus d (S (trans hds0 i))) (ctrans hds0 i v))))) (\lambda +(e1: C).(drop h (minus d (S (trans hds0 i))) e1 x)) (ex C (\lambda (e2: +C).(getl (trans hds0 i) c2 (CHead e2 (Bind b) (lift h (minus d (S (trans hds0 +i))) (ctrans hds0 i v)))))) (\lambda (x0: C).(\lambda (H1: (getl (trans hds0 +i) c2 (CHead x0 (Bind b) (lift h (minus d (S (trans hds0 i))) (ctrans hds0 i +v))))).(\lambda (_: (drop h (minus d (S (trans hds0 i))) x0 x)).(ex_intro C +(\lambda (e2: C).(getl (trans hds0 i) c2 (CHead e2 (Bind b) (lift h (minus d +(S (trans hds0 i))) (ctrans hds0 i v))))) x0 H1)))) H))))) H16)))) (\lambda +(H0: (eq bool (blt (trans hds0 i) d) false)).(let H_x \def (H c1 c3 H15 b e1 +v i H1) in (let H16 \def H_x in (ex_ind C (\lambda (e2: C).(getl (trans hds0 +i) c3 (CHead e2 (Bind b) (ctrans hds0 i v)))) (ex C (\lambda (e2: C).(getl +(plus (trans hds0 i) h) c2 (CHead e2 (Bind b) (ctrans hds0 i v))))) (\lambda +(x: C).(\lambda (H17: (getl (trans hds0 i) c3 (CHead x (Bind b) (ctrans hds0 +i v)))).(let H \def (drop_getl_trans_ge (trans hds0 i) c2 c3 d h H14 (CHead x +(Bind b) (ctrans hds0 i v)) H17) in (ex_intro C (\lambda (e2: C).(getl (plus +(trans hds0 i) h) c2 (CHead e2 (Bind b) (ctrans hds0 i v)))) x (H (bge_le d +(trans hds0 i) H0)))))) H16)))) x_x))))) c4 (sym_eq C c4 c1 H13))) c0 (sym_eq +C c0 c2 H12))) hds0 (sym_eq PList hds0 hds0 H11))) d0 (sym_eq nat d0 d H10))) +h0 (sym_eq nat h0 h H9))) H8)) H7)) H5 H6 H2 H3))))]) in (H2 (refl_equal +PList (PCons h d hds0)) (refl_equal C c2) (refl_equal C c1))))))))))))))) +hds). + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/problems-3.ma b/matita/contribs/LAMBDA-TYPES/Level-1/problems-3.ma new file mode 100644 index 000000000..b4020afb8 --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/problems-3.ma @@ -0,0 +1,396 @@ +(**************************************************************************) +(* ___ *) +(* ||M|| *) +(* ||A|| A project by Andrea Asperti *) +(* ||T|| *) +(* ||I|| Developers: *) +(* ||T|| The HELM team. *) +(* ||A|| http://helm.cs.unibo.it *) +(* \ / *) +(* \ / This file is distributed under the terms of the *) +(* v GNU General Public License Version 2 *) +(* *) +(**************************************************************************) + +(* Problematic objects for disambiguation/typechecking ********************) + +set "baseuri" "cic:/matita/LAMBDA-TYPES/Level-1/problems". + +include "LambdaDelta/theory.ma". + +theorem asucc_inj: + \forall (g: G).(\forall (a1: A).(\forall (a2: A).((leq g (asucc g a1) (asucc +g a2)) \to (leq g a1 a2)))) +\def + \lambda (g: G).(\lambda (a1: A).(A_ind (\lambda (a: A).(\forall (a2: +A).((leq g (asucc g a) (asucc g a2)) \to (leq g a a2)))) (\lambda (n: +nat).(\lambda (n0: nat).(\lambda (a2: A).(A_ind (\lambda (a: A).((leq g +(asucc g (ASort n n0)) (asucc g a)) \to (leq g (ASort n n0) a))) (\lambda +(n1: nat).(\lambda (n2: nat).(\lambda (H: (leq g (asucc g (ASort n n0)) +(asucc g (ASort n1 n2)))).((match n in nat return (\lambda (n3: nat).((leq g +(asucc g (ASort n3 n0)) (asucc g (ASort n1 n2))) \to (leq g (ASort n3 n0) +(ASort n1 n2)))) with [O \Rightarrow (\lambda (H0: (leq g (asucc g (ASort O +n0)) (asucc g (ASort n1 n2)))).((match n1 in nat return (\lambda (n3: +nat).((leq g (asucc g (ASort O n0)) (asucc g (ASort n3 n2))) \to (leq g +(ASort O n0) (ASort n3 n2)))) with [O \Rightarrow (\lambda (H1: (leq g (asucc +g (ASort O n0)) (asucc g (ASort O n2)))).(let H2 \def (match H1 in leq return +(\lambda (a: A).(\lambda (a0: A).(\lambda (_: (leq ? a a0)).((eq A a (ASort O +(next g n0))) \to ((eq A a0 (ASort O (next g n2))) \to (leq g (ASort O n0) +(ASort O n2))))))) with [(leq_sort h1 h2 n1 n3 k H0) \Rightarrow (\lambda +(H1: (eq A (ASort h1 n1) (ASort O (next g n0)))).(\lambda (H2: (eq A (ASort +h2 n3) (ASort O (next g n2)))).((let H3 \def (f_equal A nat (\lambda (e: +A).(match e in A return (\lambda (_: A).nat) with [(ASort _ n) \Rightarrow n +| (AHead _ _) \Rightarrow n1])) (ASort h1 n1) (ASort O (next g n0)) H1) in +((let H4 \def (f_equal A nat (\lambda (e: A).(match e in A return (\lambda +(_: A).nat) with [(ASort n _) \Rightarrow n | (AHead _ _) \Rightarrow h1])) +(ASort h1 n1) (ASort O (next g n0)) H1) in (eq_ind nat O (\lambda (n: +nat).((eq nat n1 (next g n0)) \to ((eq A (ASort h2 n3) (ASort O (next g n2))) +\to ((eq A (aplus g (ASort n n1) k) (aplus g (ASort h2 n3) k)) \to (leq g +(ASort O n0) (ASort O n2)))))) (\lambda (H5: (eq nat n1 (next g n0))).(eq_ind +nat (next g n0) (\lambda (n: nat).((eq A (ASort h2 n3) (ASort O (next g n2))) +\to ((eq A (aplus g (ASort O n) k) (aplus g (ASort h2 n3) k)) \to (leq g +(ASort O n0) (ASort O n2))))) (\lambda (H6: (eq A (ASort h2 n3) (ASort O +(next g n2)))).(let H7 \def (f_equal A nat (\lambda (e: A).(match e in A +return (\lambda (_: A).nat) with [(ASort _ n) \Rightarrow n | (AHead _ _) +\Rightarrow n3])) (ASort h2 n3) (ASort O (next g n2)) H6) in ((let H8 \def +(f_equal A nat (\lambda (e: A).(match e in A return (\lambda (_: A).nat) with +[(ASort n _) \Rightarrow n | (AHead _ _) \Rightarrow h2])) (ASort h2 n3) +(ASort O (next g n2)) H6) in (eq_ind nat O (\lambda (n: nat).((eq nat n3 +(next g n2)) \to ((eq A (aplus g (ASort O (next g n0)) k) (aplus g (ASort n +n3) k)) \to (leq g (ASort O n0) (ASort O n2))))) (\lambda (H9: (eq nat n3 +(next g n2))).(eq_ind nat (next g n2) (\lambda (n: nat).((eq A (aplus g +(ASort O (next g n0)) k) (aplus g (ASort O n) k)) \to (leq g (ASort O n0) +(ASort O n2)))) (\lambda (H10: (eq A (aplus g (ASort O (next g n0)) k) (aplus +g (ASort O (next g n2)) k))).(let H \def (eq_ind_r A (aplus g (ASort O (next +g n0)) k) (\lambda (a: A).(eq A a (aplus g (ASort O (next g n2)) k))) H10 +(aplus g (ASort O n0) (S k)) (aplus_sort_O_S_simpl g n0 k)) in (let H11 \def +(eq_ind_r A (aplus g (ASort O (next g n2)) k) (\lambda (a: A).(eq A (aplus g +(ASort O n0) (S k)) a)) H (aplus g (ASort O n2) (S k)) (aplus_sort_O_S_simpl +g n2 k)) in (leq_sort g O O n0 n2 (S k) H11)))) n3 (sym_eq nat n3 (next g n2) +H9))) h2 (sym_eq nat h2 O H8))) H7))) n1 (sym_eq nat n1 (next g n0) H5))) h1 +(sym_eq nat h1 O H4))) H3)) H2 H0))) | (leq_head a1 a2 H0 a3 a4 H1) +\Rightarrow (\lambda (H2: (eq A (AHead a1 a3) (ASort O (next g +n0)))).(\lambda (H3: (eq A (AHead a2 a4) (ASort O (next g n2)))).((let H4 +\def (eq_ind A (AHead a1 a3) (\lambda (e: A).(match e in A return (\lambda +(_: A).Prop) with [(ASort _ _) \Rightarrow False | (AHead _ _) \Rightarrow +True])) I (ASort O (next g n0)) H2) in (False_ind ((eq A (AHead a2 a4) (ASort +O (next g n2))) \to ((leq g a1 a2) \to ((leq g a3 a4) \to (leq g (ASort O n0) +(ASort O n2))))) H4)) H3 H0 H1)))]) in (H2 (refl_equal A (ASort O (next g +n0))) (refl_equal A (ASort O (next g n2)))))) | (S n3) \Rightarrow (\lambda +(H1: (leq g (asucc g (ASort O n0)) (asucc g (ASort (S n3) n2)))).(let H2 \def +(match H1 in leq return (\lambda (a: A).(\lambda (a0: A).(\lambda (_: (leq ? +a a0)).((eq A a (ASort O (next g n0))) \to ((eq A a0 (ASort n3 n2)) \to (leq +g (ASort O n0) (ASort (S n3) n2))))))) with [(leq_sort h1 h2 n1 n3 k H0) +\Rightarrow (\lambda (H1: (eq A (ASort h1 n1) (ASort O (next g +n0)))).(\lambda (H2: (eq A (ASort h2 n3) (ASort n3 n2))).((let H3 \def +(f_equal A nat (\lambda (e: A).(match e in A return (\lambda (_: A).nat) with +[(ASort _ n) \Rightarrow n | (AHead _ _) \Rightarrow n1])) (ASort h1 n1) +(ASort O (next g n0)) H1) in ((let H4 \def (f_equal A nat (\lambda (e: +A).(match e in A return (\lambda (_: A).nat) with [(ASort n _) \Rightarrow n +| (AHead _ _) \Rightarrow h1])) (ASort h1 n1) (ASort O (next g n0)) H1) in +(eq_ind nat O (\lambda (n: nat).((eq nat n1 (next g n0)) \to ((eq A (ASort h2 +n3) (ASort n3 n2)) \to ((eq A (aplus g (ASort n n1) k) (aplus g (ASort h2 n3) +k)) \to (leq g (ASort O n0) (ASort (S n3) n2)))))) (\lambda (H5: (eq nat n1 +(next g n0))).(eq_ind nat (next g n0) (\lambda (n: nat).((eq A (ASort h2 n3) +(ASort n3 n2)) \to ((eq A (aplus g (ASort O n) k) (aplus g (ASort h2 n3) k)) +\to (leq g (ASort O n0) (ASort (S n3) n2))))) (\lambda (H6: (eq A (ASort h2 +n3) (ASort n3 n2))).(let H7 \def (f_equal A nat (\lambda (e: A).(match e in A +return (\lambda (_: A).nat) with [(ASort _ n) \Rightarrow n | (AHead _ _) +\Rightarrow n3])) (ASort h2 n3) (ASort n3 n2) H6) in ((let H8 \def (f_equal A +nat (\lambda (e: A).(match e in A return (\lambda (_: A).nat) with [(ASort n +_) \Rightarrow n | (AHead _ _) \Rightarrow h2])) (ASort h2 n3) (ASort n3 n2) +H6) in (eq_ind nat n3 (\lambda (n: nat).((eq nat n3 n2) \to ((eq A (aplus g +(ASort O (next g n0)) k) (aplus g (ASort n n3) k)) \to (leq g (ASort O n0) +(ASort (S n3) n2))))) (\lambda (H9: (eq nat n3 n2)).(eq_ind nat n2 (\lambda +(n: nat).((eq A (aplus g (ASort O (next g n0)) k) (aplus g (ASort n3 n) k)) +\to (leq g (ASort O n0) (ASort (S n3) n2)))) (\lambda (H10: (eq A (aplus g +(ASort O (next g n0)) k) (aplus g (ASort n3 n2) k))).(let H \def (eq_ind_r A +(aplus g (ASort O (next g n0)) k) (\lambda (a: A).(eq A a (aplus g (ASort n3 +n2) k))) H10 (aplus g (ASort O n0) (S k)) (aplus_sort_O_S_simpl g n0 k)) in +(let H11 \def (eq_ind_r A (aplus g (ASort n3 n2) k) (\lambda (a: A).(eq A +(aplus g (ASort O n0) (S k)) a)) H (aplus g (ASort (S n3) n2) (S k)) +(aplus_sort_S_S_simpl g n2 n3 k)) in (leq_sort g O (S n3) n0 n2 (S k) H11)))) +n3 (sym_eq nat n3 n2 H9))) h2 (sym_eq nat h2 n3 H8))) H7))) n1 (sym_eq nat n1 +(next g n0) H5))) h1 (sym_eq nat h1 O H4))) H3)) H2 H0))) | (leq_head a1 a2 +H0 a3 a4 H1) \Rightarrow (\lambda (H2: (eq A (AHead a1 a3) (ASort O (next g +n0)))).(\lambda (H3: (eq A (AHead a2 a4) (ASort n3 n2))).((let H4 \def +(eq_ind A (AHead a1 a3) (\lambda (e: A).(match e in A return (\lambda (_: +A).Prop) with [(ASort _ _) \Rightarrow False | (AHead _ _) \Rightarrow +True])) I (ASort O (next g n0)) H2) in (False_ind ((eq A (AHead a2 a4) (ASort +n3 n2)) \to ((leq g a1 a2) \to ((leq g a3 a4) \to (leq g (ASort O n0) (ASort +(S n3) n2))))) H4)) H3 H0 H1)))]) in (H2 (refl_equal A (ASort O (next g n0))) +(refl_equal A (ASort n3 n2)))))]) H0)) | (S n3) \Rightarrow (\lambda (H0: +(leq g (asucc g (ASort (S n3) n0)) (asucc g (ASort n1 n2)))).((match n1 in +nat return (\lambda (n4: nat).((leq g (asucc g (ASort (S n3) n0)) (asucc g +(ASort n4 n2))) \to (leq g (ASort (S n3) n0) (ASort n4 n2)))) with [O +\Rightarrow (\lambda (H1: (leq g (asucc g (ASort (S n3) n0)) (asucc g (ASort +O n2)))).(let H2 \def (match H1 in leq return (\lambda (a: A).(\lambda (a0: +A).(\lambda (_: (leq ? a a0)).((eq A a (ASort n3 n0)) \to ((eq A a0 (ASort O +(next g n2))) \to (leq g (ASort (S n3) n0) (ASort O n2))))))) with [(leq_sort +h1 h2 n1 n3 k H0) \Rightarrow (\lambda (H1: (eq A (ASort h1 n1) (ASort n3 +n0))).(\lambda (H2: (eq A (ASort h2 n3) (ASort O (next g n2)))).((let H3 \def +(f_equal A nat (\lambda (e: A).(match e in A return (\lambda (_: A).nat) with +[(ASort _ n) \Rightarrow n | (AHead _ _) \Rightarrow n1])) (ASort h1 n1) +(ASort n3 n0) H1) in ((let H4 \def (f_equal A nat (\lambda (e: A).(match e in +A return (\lambda (_: A).nat) with [(ASort n _) \Rightarrow n | (AHead _ _) +\Rightarrow h1])) (ASort h1 n1) (ASort n3 n0) H1) in (eq_ind nat n3 (\lambda +(n: nat).((eq nat n1 n0) \to ((eq A (ASort h2 n3) (ASort O (next g n2))) \to +((eq A (aplus g (ASort n n1) k) (aplus g (ASort h2 n3) k)) \to (leq g (ASort +(S n3) n0) (ASort O n2)))))) (\lambda (H5: (eq nat n1 n0)).(eq_ind nat n0 +(\lambda (n: nat).((eq A (ASort h2 n3) (ASort O (next g n2))) \to ((eq A +(aplus g (ASort n3 n) k) (aplus g (ASort h2 n3) k)) \to (leq g (ASort (S n3) +n0) (ASort O n2))))) (\lambda (H6: (eq A (ASort h2 n3) (ASort O (next g +n2)))).(let H7 \def (f_equal A nat (\lambda (e: A).(match e in A return +(\lambda (_: A).nat) with [(ASort _ n) \Rightarrow n | (AHead _ _) +\Rightarrow n3])) (ASort h2 n3) (ASort O (next g n2)) H6) in ((let H8 \def +(f_equal A nat (\lambda (e: A).(match e in A return (\lambda (_: A).nat) with +[(ASort n _) \Rightarrow n | (AHead _ _) \Rightarrow h2])) (ASort h2 n3) +(ASort O (next g n2)) H6) in (eq_ind nat O (\lambda (n: nat).((eq nat n3 +(next g n2)) \to ((eq A (aplus g (ASort n3 n0) k) (aplus g (ASort n n3) k)) +\to (leq g (ASort (S n3) n0) (ASort O n2))))) (\lambda (H9: (eq nat n3 (next +g n2))).(eq_ind nat (next g n2) (\lambda (n: nat).((eq A (aplus g (ASort n3 +n0) k) (aplus g (ASort O n) k)) \to (leq g (ASort (S n3) n0) (ASort O n2)))) +(\lambda (H10: (eq A (aplus g (ASort n3 n0) k) (aplus g (ASort O (next g n2)) +k))).(let H \def (eq_ind_r A (aplus g (ASort n3 n0) k) (\lambda (a: A).(eq A +a (aplus g (ASort O (next g n2)) k))) H10 (aplus g (ASort (S n3) n0) (S k)) +(aplus_sort_S_S_simpl g n0 n3 k)) in (let H11 \def (eq_ind_r A (aplus g +(ASort O (next g n2)) k) (\lambda (a: A).(eq A (aplus g (ASort (S n3) n0) (S +k)) a)) H (aplus g (ASort O n2) (S k)) (aplus_sort_O_S_simpl g n2 k)) in +(leq_sort g (S n3) O n0 n2 (S k) H11)))) n3 (sym_eq nat n3 (next g n2) H9))) +h2 (sym_eq nat h2 O H8))) H7))) n1 (sym_eq nat n1 n0 H5))) h1 (sym_eq nat h1 +n3 H4))) H3)) H2 H0))) | (leq_head a1 a2 H0 a3 a4 H1) \Rightarrow (\lambda +(H2: (eq A (AHead a1 a3) (ASort n3 n0))).(\lambda (H3: (eq A (AHead a2 a4) +(ASort O (next g n2)))).((let H4 \def (eq_ind A (AHead a1 a3) (\lambda (e: +A).(match e in A return (\lambda (_: A).Prop) with [(ASort _ _) \Rightarrow +False | (AHead _ _) \Rightarrow True])) I (ASort n3 n0) H2) in (False_ind +((eq A (AHead a2 a4) (ASort O (next g n2))) \to ((leq g a1 a2) \to ((leq g a3 +a4) \to (leq g (ASort (S n3) n0) (ASort O n2))))) H4)) H3 H0 H1)))]) in (H2 +(refl_equal A (ASort n3 n0)) (refl_equal A (ASort O (next g n2)))))) | (S n4) +\Rightarrow (\lambda (H1: (leq g (asucc g (ASort (S n3) n0)) (asucc g (ASort +(S n4) n2)))).(let H2 \def (match H1 in leq return (\lambda (a: A).(\lambda +(a0: A).(\lambda (_: (leq ? a a0)).((eq A a (ASort n3 n0)) \to ((eq A a0 +(ASort n4 n2)) \to (leq g (ASort (S n3) n0) (ASort (S n4) n2))))))) with +[(leq_sort h1 h2 n3 n4 k H0) \Rightarrow (\lambda (H1: (eq A (ASort h1 n3) +(ASort n3 n0))).(\lambda (H2: (eq A (ASort h2 n4) (ASort n4 n2))).((let H3 +\def (f_equal A nat (\lambda (e: A).(match e in A return (\lambda (_: A).nat) +with [(ASort _ n) \Rightarrow n | (AHead _ _) \Rightarrow n3])) (ASort h1 n3) +(ASort n3 n0) H1) in ((let H4 \def (f_equal A nat (\lambda (e: A).(match e in +A return (\lambda (_: A).nat) with [(ASort n _) \Rightarrow n | (AHead _ _) +\Rightarrow h1])) (ASort h1 n3) (ASort n3 n0) H1) in (eq_ind nat n3 (\lambda +(n: nat).((eq nat n3 n0) \to ((eq A (ASort h2 n4) (ASort n4 n2)) \to ((eq A +(aplus g (ASort n n3) k) (aplus g (ASort h2 n4) k)) \to (leq g (ASort (S n3) +n0) (ASort (S n4) n2)))))) (\lambda (H5: (eq nat n3 n0)).(eq_ind nat n0 +(\lambda (n: nat).((eq A (ASort h2 n4) (ASort n4 n2)) \to ((eq A (aplus g +(ASort n3 n) k) (aplus g (ASort h2 n4) k)) \to (leq g (ASort (S n3) n0) +(ASort (S n4) n2))))) (\lambda (H6: (eq A (ASort h2 n4) (ASort n4 n2))).(let +H7 \def (f_equal A nat (\lambda (e: A).(match e in A return (\lambda (_: +A).nat) with [(ASort _ n) \Rightarrow n | (AHead _ _) \Rightarrow n4])) +(ASort h2 n4) (ASort n4 n2) H6) in ((let H8 \def (f_equal A nat (\lambda (e: +A).(match e in A return (\lambda (_: A).nat) with [(ASort n _) \Rightarrow n +| (AHead _ _) \Rightarrow h2])) (ASort h2 n4) (ASort n4 n2) H6) in (eq_ind +nat n4 (\lambda (n: nat).((eq nat n4 n2) \to ((eq A (aplus g (ASort n3 n0) k) +(aplus g (ASort n n4) k)) \to (leq g (ASort (S n3) n0) (ASort (S n4) n2))))) +(\lambda (H9: (eq nat n4 n2)).(eq_ind nat n2 (\lambda (n: nat).((eq A (aplus +g (ASort n3 n0) k) (aplus g (ASort n4 n) k)) \to (leq g (ASort (S n3) n0) +(ASort (S n4) n2)))) (\lambda (H10: (eq A (aplus g (ASort n3 n0) k) (aplus g +(ASort n4 n2) k))).(let H \def (eq_ind_r A (aplus g (ASort n3 n0) k) (\lambda +(a: A).(eq A a (aplus g (ASort n4 n2) k))) H10 (aplus g (ASort (S n3) n0) (S +k)) (aplus_sort_S_S_simpl g n0 n3 k)) in (let H11 \def (eq_ind_r A (aplus g +(ASort n4 n2) k) (\lambda (a: A).(eq A (aplus g (ASort (S n3) n0) (S k)) a)) +H (aplus g (ASort (S n4) n2) (S k)) (aplus_sort_S_S_simpl g n2 n4 k)) in +(leq_sort g (S n3) (S n4) n0 n2 (S k) H11)))) n4 (sym_eq nat n4 n2 H9))) h2 +(sym_eq nat h2 n4 H8))) H7))) n3 (sym_eq nat n3 n0 H5))) h1 (sym_eq nat h1 n3 +H4))) H3)) H2 H0))) | (leq_head a1 a2 H0 a3 a4 H1) \Rightarrow (\lambda (H2: +(eq A (AHead a1 a3) (ASort n3 n0))).(\lambda (H3: (eq A (AHead a2 a4) (ASort +n4 n2))).((let H4 \def (eq_ind A (AHead a1 a3) (\lambda (e: A).(match e in A +return (\lambda (_: A).Prop) with [(ASort _ _) \Rightarrow False | (AHead _ +_) \Rightarrow True])) I (ASort n3 n0) H2) in (False_ind ((eq A (AHead a2 a4) +(ASort n4 n2)) \to ((leq g a1 a2) \to ((leq g a3 a4) \to (leq g (ASort (S n3) +n0) (ASort (S n4) n2))))) H4)) H3 H0 H1)))]) in (H2 (refl_equal A (ASort n3 +n0)) (refl_equal A (ASort n4 n2)))))]) H0))]) H)))) (\lambda (a: A).(\lambda +(H: (((leq g (asucc g (ASort n n0)) (asucc g a)) \to (leq g (ASort n n0) +a)))).(\lambda (a0: A).(\lambda (H0: (((leq g (asucc g (ASort n n0)) (asucc g +a0)) \to (leq g (ASort n n0) a0)))).(\lambda (H1: (leq g (asucc g (ASort n +n0)) (asucc g (AHead a a0)))).((match n in nat return (\lambda (n1: +nat).((((leq g (asucc g (ASort n1 n0)) (asucc g a)) \to (leq g (ASort n1 n0) +a))) \to ((((leq g (asucc g (ASort n1 n0)) (asucc g a0)) \to (leq g (ASort n1 +n0) a0))) \to ((leq g (asucc g (ASort n1 n0)) (asucc g (AHead a a0))) \to +(leq g (ASort n1 n0) (AHead a a0)))))) with [O \Rightarrow (\lambda (_: +(((leq g (asucc g (ASort O n0)) (asucc g a)) \to (leq g (ASort O n0) +a)))).(\lambda (_: (((leq g (asucc g (ASort O n0)) (asucc g a0)) \to (leq g +(ASort O n0) a0)))).(\lambda (H4: (leq g (asucc g (ASort O n0)) (asucc g +(AHead a a0)))).(let H5 \def (match H4 in leq return (\lambda (a1: +A).(\lambda (a2: A).(\lambda (_: (leq ? a1 a2)).((eq A a1 (ASort O (next g +n0))) \to ((eq A a2 (AHead a (asucc g a0))) \to (leq g (ASort O n0) (AHead a +a0))))))) with [(leq_sort h1 h2 n1 n2 k H2) \Rightarrow (\lambda (H3: (eq A +(ASort h1 n1) (ASort O (next g n0)))).(\lambda (H4: (eq A (ASort h2 n2) +(AHead a (asucc g a0)))).((let H5 \def (f_equal A nat (\lambda (e: A).(match +e in A return (\lambda (_: A).nat) with [(ASort _ n) \Rightarrow n | (AHead _ +_) \Rightarrow n1])) (ASort h1 n1) (ASort O (next g n0)) H3) in ((let H6 \def +(f_equal A nat (\lambda (e: A).(match e in A return (\lambda (_: A).nat) with +[(ASort n _) \Rightarrow n | (AHead _ _) \Rightarrow h1])) (ASort h1 n1) +(ASort O (next g n0)) H3) in (eq_ind nat O (\lambda (n: nat).((eq nat n1 +(next g n0)) \to ((eq A (ASort h2 n2) (AHead a (asucc g a0))) \to ((eq A +(aplus g (ASort n n1) k) (aplus g (ASort h2 n2) k)) \to (leq g (ASort O n0) +(AHead a a0)))))) (\lambda (H7: (eq nat n1 (next g n0))).(eq_ind nat (next g +n0) (\lambda (n: nat).((eq A (ASort h2 n2) (AHead a (asucc g a0))) \to ((eq A +(aplus g (ASort O n) k) (aplus g (ASort h2 n2) k)) \to (leq g (ASort O n0) +(AHead a a0))))) (\lambda (H8: (eq A (ASort h2 n2) (AHead a (asucc g +a0)))).(let H9 \def (eq_ind A (ASort h2 n2) (\lambda (e: A).(match e in A +return (\lambda (_: A).Prop) with [(ASort _ _) \Rightarrow True | (AHead _ _) +\Rightarrow False])) I (AHead a (asucc g a0)) H8) in (False_ind ((eq A (aplus +g (ASort O (next g n0)) k) (aplus g (ASort h2 n2) k)) \to (leq g (ASort O n0) +(AHead a a0))) H9))) n1 (sym_eq nat n1 (next g n0) H7))) h1 (sym_eq nat h1 O +H6))) H5)) H4 H2))) | (leq_head a1 a2 H2 a3 a4 H3) \Rightarrow (\lambda (H4: +(eq A (AHead a1 a3) (ASort O (next g n0)))).(\lambda (H5: (eq A (AHead a2 a4) +(AHead a (asucc g a0)))).((let H6 \def (eq_ind A (AHead a1 a3) (\lambda (e: +A).(match e in A return (\lambda (_: A).Prop) with [(ASort _ _) \Rightarrow +False | (AHead _ _) \Rightarrow True])) I (ASort O (next g n0)) H4) in +(False_ind ((eq A (AHead a2 a4) (AHead a (asucc g a0))) \to ((leq g a1 a2) +\to ((leq g a3 a4) \to (leq g (ASort O n0) (AHead a a0))))) H6)) H5 H2 +H3)))]) in (H5 (refl_equal A (ASort O (next g n0))) (refl_equal A (AHead a +(asucc g a0)))))))) | (S n1) \Rightarrow (\lambda (_: (((leq g (asucc g +(ASort (S n1) n0)) (asucc g a)) \to (leq g (ASort (S n1) n0) a)))).(\lambda +(_: (((leq g (asucc g (ASort (S n1) n0)) (asucc g a0)) \to (leq g (ASort (S +n1) n0) a0)))).(\lambda (H4: (leq g (asucc g (ASort (S n1) n0)) (asucc g +(AHead a a0)))).(let H5 \def (match H4 in leq return (\lambda (a1: +A).(\lambda (a2: A).(\lambda (_: (leq ? a1 a2)).((eq A a1 (ASort n1 n0)) \to +((eq A a2 (AHead a (asucc g a0))) \to (leq g (ASort (S n1) n0) (AHead a +a0))))))) with [(leq_sort h1 h2 n1 n2 k H2) \Rightarrow (\lambda (H3: (eq A +(ASort h1 n1) (ASort n1 n0))).(\lambda (H4: (eq A (ASort h2 n2) (AHead a +(asucc g a0)))).((let H5 \def (f_equal A nat (\lambda (e: A).(match e in A +return (\lambda (_: A).nat) with [(ASort _ n) \Rightarrow n | (AHead _ _) +\Rightarrow n1])) (ASort h1 n1) (ASort n1 n0) H3) in ((let H6 \def (f_equal A +nat (\lambda (e: A).(match e in A return (\lambda (_: A).nat) with [(ASort n +_) \Rightarrow n | (AHead _ _) \Rightarrow h1])) (ASort h1 n1) (ASort n1 n0) +H3) in (eq_ind nat n1 (\lambda (n: nat).((eq nat n1 n0) \to ((eq A (ASort h2 +n2) (AHead a (asucc g a0))) \to ((eq A (aplus g (ASort n n1) k) (aplus g +(ASort h2 n2) k)) \to (leq g (ASort (S n1) n0) (AHead a a0)))))) (\lambda +(H7: (eq nat n1 n0)).(eq_ind nat n0 (\lambda (n: nat).((eq A (ASort h2 n2) +(AHead a (asucc g a0))) \to ((eq A (aplus g (ASort n1 n) k) (aplus g (ASort +h2 n2) k)) \to (leq g (ASort (S n1) n0) (AHead a a0))))) (\lambda (H8: (eq A +(ASort h2 n2) (AHead a (asucc g a0)))).(let H9 \def (eq_ind A (ASort h2 n2) +(\lambda (e: A).(match e in A return (\lambda (_: A).Prop) with [(ASort _ _) +\Rightarrow True | (AHead _ _) \Rightarrow False])) I (AHead a (asucc g a0)) +H8) in (False_ind ((eq A (aplus g (ASort n1 n0) k) (aplus g (ASort h2 n2) k)) +\to (leq g (ASort (S n1) n0) (AHead a a0))) H9))) n1 (sym_eq nat n1 n0 H7))) +h1 (sym_eq nat h1 n1 H6))) H5)) H4 H2))) | (leq_head a1 a2 H2 a3 a4 H3) +\Rightarrow (\lambda (H4: (eq A (AHead a1 a3) (ASort n1 n0))).(\lambda (H5: +(eq A (AHead a2 a4) (AHead a (asucc g a0)))).((let H6 \def (eq_ind A (AHead +a1 a3) (\lambda (e: A).(match e in A return (\lambda (_: A).Prop) with +[(ASort _ _) \Rightarrow False | (AHead _ _) \Rightarrow True])) I (ASort n1 +n0) H4) in (False_ind ((eq A (AHead a2 a4) (AHead a (asucc g a0))) \to ((leq +g a1 a2) \to ((leq g a3 a4) \to (leq g (ASort (S n1) n0) (AHead a a0))))) +H6)) H5 H2 H3)))]) in (H5 (refl_equal A (ASort n1 n0)) (refl_equal A (AHead a +(asucc g a0))))))))]) H H0 H1)))))) a2)))) (\lambda (a: A).(\lambda (_: +((\forall (a2: A).((leq g (asucc g a) (asucc g a2)) \to (leq g a +a2))))).(\lambda (a0: A).(\lambda (H0: ((\forall (a2: A).((leq g (asucc g a0) +(asucc g a2)) \to (leq g a0 a2))))).(\lambda (a2: A).(A_ind (\lambda (a3: +A).((leq g (asucc g (AHead a a0)) (asucc g a3)) \to (leq g (AHead a a0) a3))) +(\lambda (n: nat).(\lambda (n0: nat).(\lambda (H1: (leq g (asucc g (AHead a +a0)) (asucc g (ASort n n0)))).((match n in nat return (\lambda (n1: +nat).((leq g (asucc g (AHead a a0)) (asucc g (ASort n1 n0))) \to (leq g +(AHead a a0) (ASort n1 n0)))) with [O \Rightarrow (\lambda (H2: (leq g (asucc +g (AHead a a0)) (asucc g (ASort O n0)))).(let H3 \def (match H2 in leq return +(\lambda (a1: A).(\lambda (a2: A).(\lambda (_: (leq ? a1 a2)).((eq A a1 +(AHead a (asucc g a0))) \to ((eq A a2 (ASort O (next g n0))) \to (leq g +(AHead a a0) (ASort O n0))))))) with [(leq_sort h1 h2 n1 n2 k H2) \Rightarrow +(\lambda (H3: (eq A (ASort h1 n1) (AHead a (asucc g a0)))).(\lambda (H4: (eq +A (ASort h2 n2) (ASort O (next g n0)))).((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 a (asucc g a0)) +H3) in (False_ind ((eq A (ASort h2 n2) (ASort O (next g n0))) \to ((eq A +(aplus g (ASort h1 n1) k) (aplus g (ASort h2 n2) k)) \to (leq g (AHead a a0) +(ASort O n0)))) H5)) H4 H2))) | (leq_head a1 a2 H2 a3 a4 H3) \Rightarrow +(\lambda (H4: (eq A (AHead a1 a3) (AHead a (asucc g a0)))).(\lambda (H5: (eq +A (AHead a2 a4) (ASort O (next g n0)))).((let H6 \def (f_equal A A (\lambda +(e: A).(match e in A return (\lambda (_: A).A) with [(ASort _ _) \Rightarrow +a3 | (AHead _ a) \Rightarrow a])) (AHead a1 a3) (AHead a (asucc g a0)) H4) in +((let H7 \def (f_equal A A (\lambda (e: A).(match e in A return (\lambda (_: +A).A) with [(ASort _ _) \Rightarrow a1 | (AHead a _) \Rightarrow a])) (AHead +a1 a3) (AHead a (asucc g a0)) H4) in (eq_ind A a (\lambda (a5: A).((eq A a3 +(asucc g a0)) \to ((eq A (AHead a2 a4) (ASort O (next g n0))) \to ((leq g a5 +a2) \to ((leq g a3 a4) \to (leq g (AHead a a0) (ASort O n0))))))) (\lambda +(H8: (eq A a3 (asucc g a0))).(eq_ind A (asucc g a0) (\lambda (a5: A).((eq A +(AHead a2 a4) (ASort O (next g n0))) \to ((leq g a a2) \to ((leq g a5 a4) \to +(leq g (AHead a a0) (ASort O n0)))))) (\lambda (H9: (eq A (AHead a2 a4) +(ASort O (next g n0)))).(let H10 \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 (next g n0)) H9) in +(False_ind ((leq g a a2) \to ((leq g (asucc g a0) a4) \to (leq g (AHead a a0) +(ASort O n0)))) H10))) a3 (sym_eq A a3 (asucc g a0) H8))) a1 (sym_eq A a1 a +H7))) H6)) H5 H2 H3)))]) in (H3 (refl_equal A (AHead a (asucc g a0))) +(refl_equal A (ASort O (next g n0)))))) | (S n1) \Rightarrow (\lambda (H2: +(leq g (asucc g (AHead a a0)) (asucc g (ASort (S n1) n0)))).(let H3 \def +(match H2 in leq return (\lambda (a1: A).(\lambda (a2: A).(\lambda (_: (leq ? +a1 a2)).((eq A a1 (AHead a (asucc g a0))) \to ((eq A a2 (ASort n1 n0)) \to +(leq g (AHead a a0) (ASort (S n1) n0))))))) with [(leq_sort h1 h2 n1 n2 k H2) +\Rightarrow (\lambda (H3: (eq A (ASort h1 n1) (AHead a (asucc g +a0)))).(\lambda (H4: (eq A (ASort h2 n2) (ASort n1 n0))).((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 a (asucc g a0)) H3) in (False_ind ((eq A (ASort h2 n2) +(ASort n1 n0)) \to ((eq A (aplus g (ASort h1 n1) k) (aplus g (ASort h2 n2) +k)) \to (leq g (AHead a a0) (ASort (S n1) n0)))) H5)) H4 H2))) | (leq_head a1 +a2 H2 a3 a4 H3) \Rightarrow (\lambda (H4: (eq A (AHead a1 a3) (AHead a (asucc +g a0)))).(\lambda (H5: (eq A (AHead a2 a4) (ASort n1 n0))).((let H6 \def +(f_equal A A (\lambda (e: A).(match e in A return (\lambda (_: A).A) with +[(ASort _ _) \Rightarrow a3 | (AHead _ a) \Rightarrow a])) (AHead a1 a3) +(AHead a (asucc g a0)) H4) in ((let H7 \def (f_equal A A (\lambda (e: +A).(match e in A return (\lambda (_: A).A) with [(ASort _ _) \Rightarrow a1 | +(AHead a _) \Rightarrow a])) (AHead a1 a3) (AHead a (asucc g a0)) H4) in +(eq_ind A a (\lambda (a5: A).((eq A a3 (asucc g a0)) \to ((eq A (AHead a2 a4) +(ASort n1 n0)) \to ((leq g a5 a2) \to ((leq g a3 a4) \to (leq g (AHead a a0) +(ASort (S n1) n0))))))) (\lambda (H8: (eq A a3 (asucc g a0))).(eq_ind A +(asucc g a0) (\lambda (a5: A).((eq A (AHead a2 a4) (ASort n1 n0)) \to ((leq g +a a2) \to ((leq g a5 a4) \to (leq g (AHead a a0) (ASort (S n1) n0)))))) +(\lambda (H9: (eq A (AHead a2 a4) (ASort n1 n0))).(let H10 \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 n1 +n0) H9) in (False_ind ((leq g a a2) \to ((leq g (asucc g a0) a4) \to (leq g +(AHead a a0) (ASort (S n1) n0)))) H10))) a3 (sym_eq A a3 (asucc g a0) H8))) +a1 (sym_eq A a1 a H7))) H6)) H5 H2 H3)))]) in (H3 (refl_equal A (AHead a +(asucc g a0))) (refl_equal A (ASort n1 n0)))))]) H1)))) (\lambda (a3: +A).(\lambda (_: (((leq g (asucc g (AHead a a0)) (asucc g a3)) \to (leq g +(AHead a a0) a3)))).(\lambda (a4: A).(\lambda (_: (((leq g (asucc g (AHead a +a0)) (asucc g a4)) \to (leq g (AHead a a0) a4)))).(\lambda (H3: (leq g (asucc +g (AHead a a0)) (asucc g (AHead a3 a4)))).(let H4 \def (match H3 in leq +return (\lambda (a1: A).(\lambda (a2: A).(\lambda (_: (leq ? a1 a2)).((eq A +a1 (AHead a (asucc g a0))) \to ((eq A a2 (AHead a3 (asucc g a4))) \to (leq g +(AHead a a0) (AHead a3 a4))))))) with [(leq_sort h1 h2 n1 n2 k H4) +\Rightarrow (\lambda (H5: (eq A (ASort h1 n1) (AHead a (asucc g +a0)))).(\lambda (H6: (eq A (ASort h2 n2) (AHead a3 (asucc g a4)))).((let H7 +\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 a (asucc g a0)) H5) in (False_ind ((eq A (ASort h2 n2) +(AHead a3 (asucc g a4))) \to ((eq A (aplus g (ASort h1 n1) k) (aplus g (ASort +h2 n2) k)) \to (leq g (AHead a a0) (AHead a3 a4)))) H7)) H6 H4))) | (leq_head +a3 a4 H4 a5 a6 H5) \Rightarrow (\lambda (H6: (eq A (AHead a3 a5) (AHead a +(asucc g a0)))).(\lambda (H7: (eq A (AHead a4 a6) (AHead a3 (asucc g +a4)))).((let H8 \def (f_equal A A (\lambda (e: A).(match e in A return +(\lambda (_: A).A) with [(ASort _ _) \Rightarrow a5 | (AHead _ a) \Rightarrow +a])) (AHead a3 a5) (AHead a (asucc g a0)) H6) in ((let H9 \def (f_equal A A +(\lambda (e: A).(match e in A return (\lambda (_: A).A) with [(ASort _ _) +\Rightarrow a3 | (AHead a _) \Rightarrow a])) (AHead a3 a5) (AHead a (asucc g +a0)) H6) in (eq_ind A a (\lambda (a1: A).((eq A a5 (asucc g a0)) \to ((eq A +(AHead a4 a6) (AHead a3 (asucc g a4))) \to ((leq g a1 a4) \to ((leq g a5 a6) +\to (leq g (AHead a a0) (AHead a3 a4))))))) (\lambda (H10: (eq A a5 (asucc g +a0))).(eq_ind A (asucc g a0) (\lambda (a1: A).((eq A (AHead a4 a6) (AHead a3 +(asucc g a4))) \to ((leq g a a4) \to ((leq g a1 a6) \to (leq g (AHead a a0) +(AHead a3 a4)))))) (\lambda (H11: (eq A (AHead a4 a6) (AHead a3 (asucc g +a4)))).(let H12 \def (f_equal A A (\lambda (e: A).(match e in A return +(\lambda (_: A).A) with [(ASort _ _) \Rightarrow a6 | (AHead _ a) \Rightarrow +a])) (AHead a4 a6) (AHead a3 (asucc g a4)) H11) in ((let H13 \def (f_equal A +A (\lambda (e: A).(match e in A return (\lambda (_: A).A) with [(ASort _ _) +\Rightarrow a4 | (AHead a _) \Rightarrow a])) (AHead a4 a6) (AHead a3 (asucc +g a4)) H11) in (eq_ind A a3 (\lambda (a1: A).((eq A a6 (asucc g a4)) \to +((leq g a a1) \to ((leq g (asucc g a0) a6) \to (leq g (AHead a a0) (AHead a3 +a4)))))) (\lambda (H14: (eq A a6 (asucc g a4))).(eq_ind A (asucc g a4) +(\lambda (a1: A).((leq g a a3) \to ((leq g (asucc g a0) a1) \to (leq g (AHead +a a0) (AHead a3 a4))))) (\lambda (H15: (leq g a a3)).(\lambda (H16: (leq g +(asucc g a0) (asucc g a4))).(leq_head g a a3 H15 a0 a4 (H0 a4 H16)))) a6 +(sym_eq A a6 (asucc g a4) H14))) a4 (sym_eq A a4 a3 H13))) H12))) a5 (sym_eq +A a5 (asucc g a0) H10))) a3 (sym_eq A a3 a H9))) H8)) H7 H4 H5)))]) in (H4 +(refl_equal A (AHead a (asucc g a0))) (refl_equal A (AHead a3 (asucc g +a4)))))))))) a2)))))) a1)). + diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/problems.ma b/matita/contribs/LAMBDA-TYPES/Level-1/problems.ma index c727f77db..9f9ce1b36 100644 --- a/matita/contribs/LAMBDA-TYPES/Level-1/problems.ma +++ b/matita/contribs/LAMBDA-TYPES/Level-1/problems.ma @@ -22,6 +22,7 @@ include "LambdaDelta/theory.ma". (* iso_trans (in problems-1) * drop1_getl_trans (in problems-2) + * asucc_inj (in problems-3) *) (* Problem 2: assertion failure raised by type checker on this object *) diff --git a/matita/contribs/LAMBDA-TYPES/Level-1/problems.ma~ b/matita/contribs/LAMBDA-TYPES/Level-1/problems.ma~ new file mode 100644 index 000000000..c727f77db --- /dev/null +++ b/matita/contribs/LAMBDA-TYPES/Level-1/problems.ma~ @@ -0,0 +1,32 @@ +(**************************************************************************) +(* ___ *) +(* ||M|| *) +(* ||A|| A project by Andrea Asperti *) +(* ||T|| *) +(* ||I|| Developers: *) +(* ||T|| The HELM team. *) +(* ||A|| http://helm.cs.unibo.it *) +(* \ / *) +(* \ / This file is distributed under the terms of the *) +(* v GNU General Public License Version 2 *) +(* *) +(**************************************************************************) + +(* Problematic objects for disambiguation/typechecking ********************) + +set "baseuri" "cic:/matita/LAMBDA-TYPES/Level-1/problems". + +include "LambdaDelta/theory.ma". + +(* Problem 1: disambiguation errors with these objects *) + +(* iso_trans (in problems-1) + * drop1_getl_trans (in problems-2) + *) + +(* Problem 2: assertion failure raised by type checker on this object *) + +inductive tau1 (g:G) (c:C) (t1:T): T \to Prop \def +| tau1_tau0: \forall (t2: T).((tau0 g c t1 t2) \to (tau1 g c t1 t2)) +| tau1_sing: \forall (t: T).((tau1 g c t1 t) \to (\forall (t2: T).((tau0 g c +t t2) \to (tau1 g c t1 t2)))). -- 2.39.2