1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 (* Problematic objects for disambiguation/typechecking ********************)
16 (* FG: PLEASE COMMENT THE NON WORKING OBJECTS *****************************)
18 set "baseuri" "cic:/matita/LAMBDA-TYPES/Level-1/problems".
20 include "LambdaDelta/theory.ma".
22 theorem drop1_getl_trans:
23 \forall (hds: PList).(\forall (c1: C).(\forall (c2: C).((drop1 hds c2 c1)
24 \to (\forall (b: B).(\forall (e1: C).(\forall (v: T).(\forall (i: nat).((getl
25 i c1 (CHead e1 (Bind b) v)) \to (ex C (\lambda (e2: C).(getl (trans hds i) c2
26 (CHead e2 (Bind b) (ctrans hds i v)))))))))))))
28 \lambda (hds: PList).(PList_ind (\lambda (p: PList).(\forall (c1:
29 C).(\forall (c2: C).((drop1 p c2 c1) \to (\forall (b: B).(\forall (e1:
30 C).(\forall (v: T).(\forall (i: nat).((getl i c1 (CHead e1 (Bind b) v)) \to
31 (ex C (\lambda (e2: C).(getl (trans p i) c2 (CHead e2 (Bind b) (ctrans p i
32 v)))))))))))))) (\lambda (c1: C).(\lambda (c2: C).(\lambda (H: (drop1 PNil c2
33 c1)).(\lambda (b: B).(\lambda (e1: C).(\lambda (v: T).(\lambda (i:
34 nat).(\lambda (H0: (getl i c1 (CHead e1 (Bind b) v))).(let H1 \def (match H
35 in drop1 return (\lambda (p: PList).(\lambda (c: C).(\lambda (c0: C).(\lambda
36 (_: (drop1 p c c0)).((eq PList p PNil) \to ((eq C c c2) \to ((eq C c0 c1) \to
37 (ex C (\lambda (e2: C).(getl i c2 (CHead e2 (Bind b) v))))))))))) with
38 [(drop1_nil c) \Rightarrow (\lambda (_: (eq PList PNil PNil)).(\lambda (H2:
39 (eq C c c2)).(\lambda (H3: (eq C c c1)).(eq_ind C c2 (\lambda (c0: C).((eq C
40 c0 c1) \to (ex C (\lambda (e2: C).(getl i c2 (CHead e2 (Bind b) v))))))
41 (\lambda (H4: (eq C c2 c1)).(eq_ind C c1 (\lambda (c0: C).(ex C (\lambda (e2:
42 C).(getl i c0 (CHead e2 (Bind b) v))))) (ex_intro C (\lambda (e2: C).(getl i
43 c1 (CHead e2 (Bind b) v))) e1 H0) c2 (sym_eq C c2 c1 H4))) c (sym_eq C c c2
44 H2) H3)))) | (drop1_cons c0 c3 h d H1 c4 hds H2) \Rightarrow (\lambda (H3:
45 (eq PList (PCons h d hds) PNil)).(\lambda (H4: (eq C c0 c2)).(\lambda (H5:
46 (eq C c4 c1)).((let H6 \def (eq_ind PList (PCons h d hds) (\lambda (e:
47 PList).(match e in PList return (\lambda (_: PList).Prop) with [PNil
48 \Rightarrow False | (PCons _ _ _) \Rightarrow True])) I PNil H3) in
49 (False_ind ((eq C c0 c2) \to ((eq C c4 c1) \to ((drop h d c0 c3) \to ((drop1
50 hds c3 c4) \to (ex C (\lambda (e2: C).(getl i c2 (CHead e2 (Bind b) v))))))))
51 H6)) H4 H5 H1 H2))))]) in (H1 (refl_equal PList PNil) (refl_equal C c2)
52 (refl_equal C c1))))))))))) (\lambda (h: nat).(\lambda (d: nat).(\lambda
53 (hds0: PList).(\lambda (H: ((\forall (c1: C).(\forall (c2: C).((drop1 hds0 c2
54 c1) \to (\forall (b: B).(\forall (e1: C).(\forall (v: T).(\forall (i:
55 nat).((getl i c1 (CHead e1 (Bind b) v)) \to (ex C (\lambda (e2: C).(getl
56 (trans hds0 i) c2 (CHead e2 (Bind b) (ctrans hds0 i v))))))))))))))).(\lambda
57 (c1: C).(\lambda (c2: C).(\lambda (H0: (drop1 (PCons h d hds0) c2
58 c1)).(\lambda (b: B).(\lambda (e1: C).(\lambda (v: T).(\lambda (i:
59 nat).(\lambda (H1: (getl i c1 (CHead e1 (Bind b) v))).(let H2 \def (match H0
60 in drop1 return (\lambda (p: PList).(\lambda (c: C).(\lambda (c0: C).(\lambda
61 (_: (drop1 p c c0)).((eq PList p (PCons h d hds0)) \to ((eq C c c2) \to ((eq
62 C c0 c1) \to (ex C (\lambda (e2: C).(getl (match (blt (trans hds0 i) d) with
63 [true \Rightarrow (trans hds0 i) | false \Rightarrow (plus (trans hds0 i)
64 h)]) c2 (CHead e2 (Bind b) (match (blt (trans hds0 i) d) with [true
65 \Rightarrow (lift h (minus d (S (trans hds0 i))) (ctrans hds0 i v)) | false
66 \Rightarrow (ctrans hds0 i v)])))))))))))) with [(drop1_nil c) \Rightarrow
67 (\lambda (H2: (eq PList PNil (PCons h d hds0))).(\lambda (H3: (eq C c
68 c2)).(\lambda (H4: (eq C c c1)).((let H5 \def (eq_ind PList PNil (\lambda (e:
69 PList).(match e in PList return (\lambda (_: PList).Prop) with [PNil
70 \Rightarrow True | (PCons _ _ _) \Rightarrow False])) I (PCons h d hds0) H2)
71 in (False_ind ((eq C c c2) \to ((eq C c c1) \to (ex C (\lambda (e2: C).(getl
72 (match (blt (trans hds0 i) d) with [true \Rightarrow (trans hds0 i) | false
73 \Rightarrow (plus (trans hds0 i) h)]) c2 (CHead e2 (Bind b) (match (blt
74 (trans hds0 i) d) with [true \Rightarrow (lift h (minus d (S (trans hds0 i)))
75 (ctrans hds0 i v)) | false \Rightarrow (ctrans hds0 i v)]))))))) H5)) H3
76 H4)))) | (drop1_cons c0 c3 h0 d0 H2 c4 hds0 H3) \Rightarrow (\lambda (H4: (eq
77 PList (PCons h0 d0 hds0) (PCons h d hds0))).(\lambda (H5: (eq C c0
78 c2)).(\lambda (H6: (eq C c4 c1)).((let H7 \def (f_equal PList PList (\lambda
79 (e: PList).(match e in PList return (\lambda (_: PList).PList) with [PNil
80 \Rightarrow hds0 | (PCons _ _ p) \Rightarrow p])) (PCons h0 d0 hds0) (PCons h
81 d hds0) H4) in ((let H8 \def (f_equal PList nat (\lambda (e: PList).(match e
82 in PList return (\lambda (_: PList).nat) with [PNil \Rightarrow d0 | (PCons _
83 n _) \Rightarrow n])) (PCons h0 d0 hds0) (PCons h d hds0) H4) in ((let H9
84 \def (f_equal PList nat (\lambda (e: PList).(match e in PList return (\lambda
85 (_: PList).nat) with [PNil \Rightarrow h0 | (PCons n _ _) \Rightarrow n]))
86 (PCons h0 d0 hds0) (PCons h d hds0) H4) in (eq_ind nat h (\lambda (n:
87 nat).((eq nat d0 d) \to ((eq PList hds0 hds0) \to ((eq C c0 c2) \to ((eq C c4
88 c1) \to ((drop n d0 c0 c3) \to ((drop1 hds0 c3 c4) \to (ex C (\lambda (e2:
89 C).(getl (match (blt (trans hds0 i) d) with [true \Rightarrow (trans hds0 i)
90 | false \Rightarrow (plus (trans hds0 i) h)]) c2 (CHead e2 (Bind b) (match
91 (blt (trans hds0 i) d) with [true \Rightarrow (lift h (minus d (S (trans hds0
92 i))) (ctrans hds0 i v)) | false \Rightarrow (ctrans hds0 i v)]))))))))))))
93 (\lambda (H10: (eq nat d0 d)).(eq_ind nat d (\lambda (n: nat).((eq PList hds0
94 hds0) \to ((eq C c0 c2) \to ((eq C c4 c1) \to ((drop h n c0 c3) \to ((drop1
95 hds0 c3 c4) \to (ex C (\lambda (e2: C).(getl (match (blt (trans hds0 i) d)
96 with [true \Rightarrow (trans hds0 i) | false \Rightarrow (plus (trans hds0
97 i) h)]) c2 (CHead e2 (Bind b) (match (blt (trans hds0 i) d) with [true
98 \Rightarrow (lift h (minus d (S (trans hds0 i))) (ctrans hds0 i v)) | false
99 \Rightarrow (ctrans hds0 i v)]))))))))))) (\lambda (H11: (eq PList hds0
100 hds0)).(eq_ind PList hds0 (\lambda (p: PList).((eq C c0 c2) \to ((eq C c4 c1)
101 \to ((drop h d c0 c3) \to ((drop1 p c3 c4) \to (ex C (\lambda (e2: C).(getl
102 (match (blt (trans hds0 i) d) with [true \Rightarrow (trans hds0 i) | false
103 \Rightarrow (plus (trans hds0 i) h)]) c2 (CHead e2 (Bind b) (match (blt
104 (trans hds0 i) d) with [true \Rightarrow (lift h (minus d (S (trans hds0 i)))
105 (ctrans hds0 i v)) | false \Rightarrow (ctrans hds0 i v)])))))))))) (\lambda
106 (H12: (eq C c0 c2)).(eq_ind C c2 (\lambda (c: C).((eq C c4 c1) \to ((drop h d
107 c c3) \to ((drop1 hds0 c3 c4) \to (ex C (\lambda (e2: C).(getl (match (blt
108 (trans hds0 i) d) with [true \Rightarrow (trans hds0 i) | false \Rightarrow
109 (plus (trans hds0 i) h)]) c2 (CHead e2 (Bind b) (match (blt (trans hds0 i) d)
110 with [true \Rightarrow (lift h (minus d (S (trans hds0 i))) (ctrans hds0 i
111 v)) | false \Rightarrow (ctrans hds0 i v)]))))))))) (\lambda (H13: (eq C c4
112 c1)).(eq_ind C c1 (\lambda (c: C).((drop h d c2 c3) \to ((drop1 hds0 c3 c)
113 \to (ex C (\lambda (e2: C).(getl (match (blt (trans hds0 i) d) with [true
114 \Rightarrow (trans hds0 i) | false \Rightarrow (plus (trans hds0 i) h)]) c2
115 (CHead e2 (Bind b) (match (blt (trans hds0 i) d) with [true \Rightarrow (lift
116 h (minus d (S (trans hds0 i))) (ctrans hds0 i v)) | false \Rightarrow (ctrans
117 hds0 i v)])))))))) (\lambda (H14: (drop h d c2 c3)).(\lambda (H15: (drop1
118 hds0 c3 c1)).(xinduction bool (blt (trans hds0 i) d) (\lambda (b0: bool).(ex
119 C (\lambda (e2: C).(getl (match b0 with [true \Rightarrow (trans hds0 i) |
120 false \Rightarrow (plus (trans hds0 i) h)]) c2 (CHead e2 (Bind b) (match b0
121 with [true \Rightarrow (lift h (minus d (S (trans hds0 i))) (ctrans hds0 i
122 v)) | false \Rightarrow (ctrans hds0 i v)])))))) (\lambda (x_x:
123 bool).(bool_ind (\lambda (b0: bool).((eq bool (blt (trans hds0 i) d) b0) \to
124 (ex C (\lambda (e2: C).(getl (match b0 with [true \Rightarrow (trans hds0 i)
125 | false \Rightarrow (plus (trans hds0 i) h)]) c2 (CHead e2 (Bind b) (match b0
126 with [true \Rightarrow (lift h (minus d (S (trans hds0 i))) (ctrans hds0 i
127 v)) | false \Rightarrow (ctrans hds0 i v)]))))))) (\lambda (H0: (eq bool (blt
128 (trans hds0 i) d) true)).(let H_x \def (H c1 c3 H15 b e1 v i H1) in (let H16
129 \def H_x in (ex_ind C (\lambda (e2: C).(getl (trans hds0 i) c3 (CHead e2
130 (Bind b) (ctrans hds0 i v)))) (ex C (\lambda (e2: C).(getl (trans hds0 i) c2
131 (CHead e2 (Bind b) (lift h (minus d (S (trans hds0 i))) (ctrans hds0 i
132 v)))))) (\lambda (x: C).(\lambda (H17: (getl (trans hds0 i) c3 (CHead x (Bind
133 b) (ctrans hds0 i v)))).(let H_x0 \def (drop_getl_trans_lt (trans hds0 i) d
134 (le_S_n (S (trans hds0 i)) d (lt_le_S (S (trans hds0 i)) (S d) (blt_lt (S d)
135 (S (trans hds0 i)) H0))) c2 c3 h H14 b x (ctrans hds0 i v) H17) in (let H
136 \def H_x0 in (ex2_ind C (\lambda (e1: C).(getl (trans hds0 i) c2 (CHead e1
137 (Bind b) (lift h (minus d (S (trans hds0 i))) (ctrans hds0 i v))))) (\lambda
138 (e1: C).(drop h (minus d (S (trans hds0 i))) e1 x)) (ex C (\lambda (e2:
139 C).(getl (trans hds0 i) c2 (CHead e2 (Bind b) (lift h (minus d (S (trans hds0
140 i))) (ctrans hds0 i v)))))) (\lambda (x0: C).(\lambda (H1: (getl (trans hds0
141 i) c2 (CHead x0 (Bind b) (lift h (minus d (S (trans hds0 i))) (ctrans hds0 i
142 v))))).(\lambda (_: (drop h (minus d (S (trans hds0 i))) x0 x)).(ex_intro C
143 (\lambda (e2: C).(getl (trans hds0 i) c2 (CHead e2 (Bind b) (lift h (minus d
144 (S (trans hds0 i))) (ctrans hds0 i v))))) x0 H1)))) H))))) H16)))) (\lambda
145 (H0: (eq bool (blt (trans hds0 i) d) false)).(let H_x \def (H c1 c3 H15 b e1
146 v i H1) in (let H16 \def H_x in (ex_ind C (\lambda (e2: C).(getl (trans hds0
147 i) c3 (CHead e2 (Bind b) (ctrans hds0 i v)))) (ex C (\lambda (e2: C).(getl
148 (plus (trans hds0 i) h) c2 (CHead e2 (Bind b) (ctrans hds0 i v))))) (\lambda
149 (x: C).(\lambda (H17: (getl (trans hds0 i) c3 (CHead x (Bind b) (ctrans hds0
150 i v)))).(let H \def (drop_getl_trans_ge (trans hds0 i) c2 c3 d h H14 (CHead x
151 (Bind b) (ctrans hds0 i v)) H17) in (ex_intro C (\lambda (e2: C).(getl (plus
152 (trans hds0 i) h) c2 (CHead e2 (Bind b) (ctrans hds0 i v)))) x (H (bge_le d
153 (trans hds0 i) H0)))))) H16)))) x_x))))) c4 (sym_eq C c4 c1 H13))) c0 (sym_eq
154 C c0 c2 H12))) hds0 (sym_eq PList hds0 hds0 H11))) d0 (sym_eq nat d0 d H10)))
155 h0 (sym_eq nat h0 h H9))) H8)) H7)) H5 H6 H2 H3))))]) in (H2 (refl_equal
156 PList (PCons h d hds0)) (refl_equal C c2) (refl_equal C c1)))))))))))))))