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 (* This file was automatically generated: do not edit *********************)
17 include "basic_1A/aplus/defs.ma".
19 include "basic_1A/A/fwd.ma".
21 include "basic_1A/next_plus/props.ma".
24 \forall (g: G).(\forall (a1: A).(\forall (a2: A).(\forall (h1: nat).(\forall
25 (h2: nat).((eq A (aplus g a1 h1) (aplus g a2 h2)) \to (\forall (h: nat).(eq A
26 (aplus g a1 (plus h h1)) (aplus g a2 (plus h h2)))))))))
28 \lambda (g: G).(\lambda (a1: A).(\lambda (a2: A).(\lambda (h1: nat).(\lambda
29 (h2: nat).(\lambda (H: (eq A (aplus g a1 h1) (aplus g a2 h2))).(\lambda (h:
30 nat).(nat_ind (\lambda (n: nat).(eq A (aplus g a1 (plus n h1)) (aplus g a2
31 (plus n h2)))) H (\lambda (n: nat).(\lambda (H0: (eq A (aplus g a1 (plus n
32 h1)) (aplus g a2 (plus n h2)))).(f_equal2 G A A asucc g g (aplus g a1 (plus n
33 h1)) (aplus g a2 (plus n h2)) (refl_equal G g) H0))) h))))))).
36 \forall (g: G).(\forall (a: A).(\forall (h1: nat).(\forall (h2: nat).(eq A
37 (aplus g (aplus g a h1) h2) (aplus g a (plus h1 h2))))))
39 \lambda (g: G).(\lambda (a: A).(\lambda (h1: nat).(nat_ind (\lambda (n:
40 nat).(\forall (h2: nat).(eq A (aplus g (aplus g a n) h2) (aplus g a (plus n
41 h2))))) (\lambda (h2: nat).(refl_equal A (aplus g a h2))) (\lambda (n:
42 nat).(\lambda (_: ((\forall (h2: nat).(eq A (aplus g (aplus g a n) h2) (aplus
43 g a (plus n h2)))))).(\lambda (h2: nat).(nat_ind (\lambda (n0: nat).(eq A
44 (aplus g (asucc g (aplus g a n)) n0) (asucc g (aplus g a (plus n n0)))))
45 (eq_ind nat n (\lambda (n0: nat).(eq A (asucc g (aplus g a n)) (asucc g
46 (aplus g a n0)))) (refl_equal A (asucc g (aplus g a n))) (plus n O) (plus_n_O
47 n)) (\lambda (n0: nat).(\lambda (H0: (eq A (aplus g (asucc g (aplus g a n))
48 n0) (asucc g (aplus g a (plus n n0))))).(eq_ind nat (S (plus n n0)) (\lambda
49 (n1: nat).(eq A (asucc g (aplus g (asucc g (aplus g a n)) n0)) (asucc g
50 (aplus g a n1)))) (f_equal2 G A A asucc g g (aplus g (asucc g (aplus g a n))
51 n0) (asucc g (aplus g a (plus n n0))) (refl_equal G g) H0) (plus n (S n0))
52 (plus_n_Sm n n0)))) h2)))) h1))).
55 \forall (g: G).(\forall (h: nat).(\forall (a: A).(eq A (aplus g (asucc g a)
56 h) (asucc g (aplus g a h)))))
58 \lambda (g: G).(\lambda (h: nat).(\lambda (a: A).(eq_ind_r A (aplus g a
59 (plus (S O) h)) (\lambda (a0: A).(eq A a0 (asucc g (aplus g a h))))
60 (refl_equal A (asucc g (aplus g a h))) (aplus g (aplus g a (S O)) h)
61 (aplus_assoc g a (S O) h)))).
63 lemma aplus_sort_O_S_simpl:
64 \forall (g: G).(\forall (n: nat).(\forall (k: nat).(eq A (aplus g (ASort O
65 n) (S k)) (aplus g (ASort O (next g n)) k))))
67 \lambda (g: G).(\lambda (n: nat).(\lambda (k: nat).(eq_ind A (aplus g (asucc
68 g (ASort O n)) k) (\lambda (a: A).(eq A a (aplus g (ASort O (next g n)) k)))
69 (refl_equal A (aplus g (ASort O (next g n)) k)) (asucc g (aplus g (ASort O n)
70 k)) (aplus_asucc g k (ASort O n))))).
72 lemma aplus_sort_S_S_simpl:
73 \forall (g: G).(\forall (n: nat).(\forall (h: nat).(\forall (k: nat).(eq A
74 (aplus g (ASort (S h) n) (S k)) (aplus g (ASort h n) k)))))
76 \lambda (g: G).(\lambda (n: nat).(\lambda (h: nat).(\lambda (k: nat).(eq_ind
77 A (aplus g (asucc g (ASort (S h) n)) k) (\lambda (a: A).(eq A a (aplus g
78 (ASort h n) k))) (refl_equal A (aplus g (ASort h n) k)) (asucc g (aplus g
79 (ASort (S h) n) k)) (aplus_asucc g k (ASort (S h) n)))))).
81 lemma aplus_asort_O_simpl:
82 \forall (g: G).(\forall (h: nat).(\forall (n: nat).(eq A (aplus g (ASort O
83 n) h) (ASort O (next_plus g n h)))))
85 \lambda (g: G).(\lambda (h: nat).(nat_ind (\lambda (n: nat).(\forall (n0:
86 nat).(eq A (aplus g (ASort O n0) n) (ASort O (next_plus g n0 n))))) (\lambda
87 (n: nat).(refl_equal A (ASort O n))) (\lambda (n: nat).(\lambda (H: ((\forall
88 (n0: nat).(eq A (aplus g (ASort O n0) n) (ASort O (next_plus g n0
89 n)))))).(\lambda (n0: nat).(eq_ind A (aplus g (asucc g (ASort O n0)) n)
90 (\lambda (a: A).(eq A a (ASort O (next g (next_plus g n0 n))))) (eq_ind nat
91 (next_plus g (next g n0) n) (\lambda (n1: nat).(eq A (aplus g (ASort O (next
92 g n0)) n) (ASort O n1))) (H (next g n0)) (next g (next_plus g n0 n))
93 (next_plus_next g n0 n)) (asucc g (aplus g (ASort O n0) n)) (aplus_asucc g n
94 (ASort O n0)))))) h)).
96 lemma aplus_asort_le_simpl:
97 \forall (g: G).(\forall (h: nat).(\forall (k: nat).(\forall (n: nat).((le h
98 k) \to (eq A (aplus g (ASort k n) h) (ASort (minus k h) n))))))
100 \lambda (g: G).(\lambda (h: nat).(nat_ind (\lambda (n: nat).(\forall (k:
101 nat).(\forall (n0: nat).((le n k) \to (eq A (aplus g (ASort k n0) n) (ASort
102 (minus k n) n0)))))) (\lambda (k: nat).(\lambda (n: nat).(\lambda (_: (le O
103 k)).(eq_ind nat k (\lambda (n0: nat).(eq A (ASort k n) (ASort n0 n)))
104 (refl_equal A (ASort k n)) (minus k O) (minus_n_O k))))) (\lambda (h0:
105 nat).(\lambda (H: ((\forall (k: nat).(\forall (n: nat).((le h0 k) \to (eq A
106 (aplus g (ASort k n) h0) (ASort (minus k h0) n))))))).(\lambda (k:
107 nat).(nat_ind (\lambda (n: nat).(\forall (n0: nat).((le (S h0) n) \to (eq A
108 (asucc g (aplus g (ASort n n0) h0)) (ASort (minus n (S h0)) n0))))) (\lambda
109 (n: nat).(\lambda (H0: (le (S h0) O)).(ex2_ind nat (\lambda (n0: nat).(eq nat
110 O (S n0))) (\lambda (n0: nat).(le h0 n0)) (eq A (asucc g (aplus g (ASort O n)
111 h0)) (ASort (minus O (S h0)) n)) (\lambda (x: nat).(\lambda (H1: (eq nat O (S
112 x))).(\lambda (_: (le h0 x)).(let H3 \def (eq_ind nat O (\lambda (ee:
113 nat).(match ee with [O \Rightarrow True | (S _) \Rightarrow False])) I (S x)
114 H1) in (False_ind (eq A (asucc g (aplus g (ASort O n) h0)) (ASort (minus O (S
115 h0)) n)) H3))))) (le_gen_S h0 O H0)))) (\lambda (n: nat).(\lambda (_:
116 ((\forall (n0: nat).((le (S h0) n) \to (eq A (asucc g (aplus g (ASort n n0)
117 h0)) (ASort (minus n (S h0)) n0)))))).(\lambda (n0: nat).(\lambda (H1: (le (S
118 h0) (S n))).(eq_ind A (aplus g (asucc g (ASort (S n) n0)) h0) (\lambda (a:
119 A).(eq A a (ASort (minus (S n) (S h0)) n0))) (H n n0 (le_S_n h0 n H1)) (asucc
120 g (aplus g (ASort (S n) n0) h0)) (aplus_asucc g h0 (ASort (S n) n0)))))))
123 lemma aplus_asort_simpl:
124 \forall (g: G).(\forall (h: nat).(\forall (k: nat).(\forall (n: nat).(eq A
125 (aplus g (ASort k n) h) (ASort (minus k h) (next_plus g n (minus h k)))))))
127 \lambda (g: G).(\lambda (h: nat).(\lambda (k: nat).(\lambda (n:
128 nat).(lt_le_e k h (eq A (aplus g (ASort k n) h) (ASort (minus k h) (next_plus
129 g n (minus h k)))) (\lambda (H: (lt k h)).(eq_ind_r nat (plus k (minus h k))
130 (\lambda (n0: nat).(eq A (aplus g (ASort k n) n0) (ASort (minus k h)
131 (next_plus g n (minus h k))))) (eq_ind A (aplus g (aplus g (ASort k n) k)
132 (minus h k)) (\lambda (a: A).(eq A a (ASort (minus k h) (next_plus g n (minus
133 h k))))) (eq_ind_r A (ASort (minus k k) n) (\lambda (a: A).(eq A (aplus g a
134 (minus h k)) (ASort (minus k h) (next_plus g n (minus h k))))) (eq_ind nat O
135 (\lambda (n0: nat).(eq A (aplus g (ASort n0 n) (minus h k)) (ASort (minus k
136 h) (next_plus g n (minus h k))))) (eq_ind_r nat O (\lambda (n0: nat).(eq A
137 (aplus g (ASort O n) (minus h k)) (ASort n0 (next_plus g n (minus h k)))))
138 (aplus_asort_O_simpl g (minus h k) n) (minus k h) (O_minus k h (le_S_n k h
139 (le_S_n (S k) (S h) (le_S (S (S k)) (S h) (le_n_S (S k) h H)))))) (minus k k)
140 (minus_n_n k)) (aplus g (ASort k n) k) (aplus_asort_le_simpl g k k n (le_n
141 k))) (aplus g (ASort k n) (plus k (minus h k))) (aplus_assoc g (ASort k n) k
142 (minus h k))) h (le_plus_minus k h (le_S_n k h (le_S_n (S k) (S h) (le_S (S
143 (S k)) (S h) (le_n_S (S k) h H))))))) (\lambda (H: (le h k)).(eq_ind_r A
144 (ASort (minus k h) n) (\lambda (a: A).(eq A a (ASort (minus k h) (next_plus g
145 n (minus h k))))) (eq_ind_r nat O (\lambda (n0: nat).(eq A (ASort (minus k h)
146 n) (ASort (minus k h) (next_plus g n n0)))) (refl_equal A (ASort (minus k h)
147 (next_plus g n O))) (minus h k) (O_minus h k H)) (aplus g (ASort k n) h)
148 (aplus_asort_le_simpl g h k n H))))))).
150 lemma aplus_ahead_simpl:
151 \forall (g: G).(\forall (h: nat).(\forall (a1: A).(\forall (a2: A).(eq A
152 (aplus g (AHead a1 a2) h) (AHead a1 (aplus g a2 h))))))
154 \lambda (g: G).(\lambda (h: nat).(nat_ind (\lambda (n: nat).(\forall (a1:
155 A).(\forall (a2: A).(eq A (aplus g (AHead a1 a2) n) (AHead a1 (aplus g a2
156 n)))))) (\lambda (a1: A).(\lambda (a2: A).(refl_equal A (AHead a1 a2))))
157 (\lambda (n: nat).(\lambda (H: ((\forall (a1: A).(\forall (a2: A).(eq A
158 (aplus g (AHead a1 a2) n) (AHead a1 (aplus g a2 n))))))).(\lambda (a1:
159 A).(\lambda (a2: A).(eq_ind A (aplus g (asucc g (AHead a1 a2)) n) (\lambda
160 (a: A).(eq A a (AHead a1 (asucc g (aplus g a2 n))))) (eq_ind A (aplus g
161 (asucc g a2) n) (\lambda (a: A).(eq A (aplus g (asucc g (AHead a1 a2)) n)
162 (AHead a1 a))) (H a1 (asucc g a2)) (asucc g (aplus g a2 n)) (aplus_asucc g n
163 a2)) (asucc g (aplus g (AHead a1 a2) n)) (aplus_asucc g n (AHead a1 a2)))))))
166 lemma aplus_asucc_false:
167 \forall (g: G).(\forall (a: A).(\forall (h: nat).((eq A (aplus g (asucc g a)
168 h) a) \to (\forall (P: Prop).P))))
170 \lambda (g: G).(\lambda (a: A).(A_ind (\lambda (a0: A).(\forall (h:
171 nat).((eq A (aplus g (asucc g a0) h) a0) \to (\forall (P: Prop).P))))
172 (\lambda (n: nat).(\lambda (n0: nat).(\lambda (h: nat).(\lambda (H: (eq A
173 (aplus g (match n with [O \Rightarrow (ASort O (next g n0)) | (S h0)
174 \Rightarrow (ASort h0 n0)]) h) (ASort n n0))).(\lambda (P: Prop).(nat_ind
175 (\lambda (n1: nat).((eq A (aplus g (match n1 with [O \Rightarrow (ASort O
176 (next g n0)) | (S h0) \Rightarrow (ASort h0 n0)]) h) (ASort n1 n0)) \to P))
177 (\lambda (H0: (eq A (aplus g (ASort O (next g n0)) h) (ASort O n0))).(let H1
178 \def (eq_ind A (aplus g (ASort O (next g n0)) h) (\lambda (a0: A).(eq A a0
179 (ASort O n0))) H0 (ASort (minus O h) (next_plus g (next g n0) (minus h O)))
180 (aplus_asort_simpl g h O (next g n0))) in (let H2 \def (f_equal A nat
181 (\lambda (e: A).(match e with [(ASort _ n1) \Rightarrow n1 | (AHead _ _)
182 \Rightarrow (next_plus g (next g n0) (minus h O))])) (ASort (minus O h)
183 (next_plus g (next g n0) (minus h O))) (ASort O n0) H1) in (let H3 \def
184 (eq_ind_r nat (minus h O) (\lambda (n1: nat).(eq nat (next_plus g (next g n0)
185 n1) n0)) H2 h (minus_n_O h)) in (le_lt_false n0 n0 (le_n n0) (eq_ind nat
186 (next_plus g (next g n0) h) (\lambda (n1: nat).(lt n0 n1)) (next_plus_lt g h
187 n0) n0 H3) P))))) (\lambda (n1: nat).(\lambda (_: (((eq A (aplus g (match n1
188 with [O \Rightarrow (ASort O (next g n0)) | (S h0) \Rightarrow (ASort h0
189 n0)]) h) (ASort n1 n0)) \to P))).(\lambda (H0: (eq A (aplus g (ASort n1 n0)
190 h) (ASort (S n1) n0))).(let H1 \def (eq_ind A (aplus g (ASort n1 n0) h)
191 (\lambda (a0: A).(eq A a0 (ASort (S n1) n0))) H0 (ASort (minus n1 h)
192 (next_plus g n0 (minus h n1))) (aplus_asort_simpl g h n1 n0)) in (let H2 \def
193 (f_equal A nat (\lambda (e: A).(match e with [(ASort n2 _) \Rightarrow n2 |
194 (AHead _ _) \Rightarrow (minus n1 h)])) (ASort (minus n1 h) (next_plus g n0
195 (minus h n1))) (ASort (S n1) n0) H1) in ((let H3 \def (f_equal A nat (\lambda
196 (e: A).(match e with [(ASort _ n2) \Rightarrow n2 | (AHead _ _) \Rightarrow
197 (next_plus g n0 (minus h n1))])) (ASort (minus n1 h) (next_plus g n0 (minus h
198 n1))) (ASort (S n1) n0) H1) in (\lambda (H4: (eq nat (minus n1 h) (S
199 n1))).(le_Sx_x n1 (eq_ind nat (minus n1 h) (\lambda (n2: nat).(le n2 n1))
200 (minus_le n1 h) (S n1) H4) P))) H2)))))) n H)))))) (\lambda (a0: A).(\lambda
201 (_: ((\forall (h: nat).((eq A (aplus g (asucc g a0) h) a0) \to (\forall (P:
202 Prop).P))))).(\lambda (a1: A).(\lambda (H0: ((\forall (h: nat).((eq A (aplus
203 g (asucc g a1) h) a1) \to (\forall (P: Prop).P))))).(\lambda (h:
204 nat).(\lambda (H1: (eq A (aplus g (AHead a0 (asucc g a1)) h) (AHead a0
205 a1))).(\lambda (P: Prop).(let H2 \def (eq_ind A (aplus g (AHead a0 (asucc g
206 a1)) h) (\lambda (a2: A).(eq A a2 (AHead a0 a1))) H1 (AHead a0 (aplus g
207 (asucc g a1) h)) (aplus_ahead_simpl g h a0 (asucc g a1))) in (let H3 \def
208 (f_equal A A (\lambda (e: A).(match e with [(ASort _ _) \Rightarrow (aplus g
209 (asucc g a1) h) | (AHead _ a2) \Rightarrow a2])) (AHead a0 (aplus g (asucc g
210 a1) h)) (AHead a0 a1) H2) in (H0 h H3 P)))))))))) a)).
213 \forall (g: G).(\forall (h1: nat).(\forall (h2: nat).(\forall (a: A).((eq A
214 (aplus g a h1) (aplus g a h2)) \to (eq nat h1 h2)))))
216 \lambda (g: G).(\lambda (h1: nat).(nat_ind (\lambda (n: nat).(\forall (h2:
217 nat).(\forall (a: A).((eq A (aplus g a n) (aplus g a h2)) \to (eq nat n
218 h2))))) (\lambda (h2: nat).(nat_ind (\lambda (n: nat).(\forall (a: A).((eq A
219 (aplus g a O) (aplus g a n)) \to (eq nat O n)))) (\lambda (a: A).(\lambda (_:
220 (eq A a a)).(refl_equal nat O))) (\lambda (n: nat).(\lambda (_: ((\forall (a:
221 A).((eq A a (aplus g a n)) \to (eq nat O n))))).(\lambda (a: A).(\lambda (H0:
222 (eq A a (asucc g (aplus g a n)))).(let H1 \def (eq_ind_r A (asucc g (aplus g
223 a n)) (\lambda (a0: A).(eq A a a0)) H0 (aplus g (asucc g a) n) (aplus_asucc g
224 n a)) in (aplus_asucc_false g a n (sym_eq A a (aplus g (asucc g a) n) H1) (eq
225 nat O (S n)))))))) h2)) (\lambda (n: nat).(\lambda (H: ((\forall (h2:
226 nat).(\forall (a: A).((eq A (aplus g a n) (aplus g a h2)) \to (eq nat n
227 h2)))))).(\lambda (h2: nat).(nat_ind (\lambda (n0: nat).(\forall (a: A).((eq
228 A (aplus g a (S n)) (aplus g a n0)) \to (eq nat (S n) n0)))) (\lambda (a:
229 A).(\lambda (H0: (eq A (asucc g (aplus g a n)) a)).(let H1 \def (eq_ind_r A
230 (asucc g (aplus g a n)) (\lambda (a0: A).(eq A a0 a)) H0 (aplus g (asucc g a)
231 n) (aplus_asucc g n a)) in (aplus_asucc_false g a n H1 (eq nat (S n) O)))))
232 (\lambda (n0: nat).(\lambda (_: ((\forall (a: A).((eq A (asucc g (aplus g a
233 n)) (aplus g a n0)) \to (eq nat (S n) n0))))).(\lambda (a: A).(\lambda (H1:
234 (eq A (asucc g (aplus g a n)) (asucc g (aplus g a n0)))).(let H2 \def
235 (eq_ind_r A (asucc g (aplus g a n)) (\lambda (a0: A).(eq A a0 (asucc g (aplus
236 g a n0)))) H1 (aplus g (asucc g a) n) (aplus_asucc g n a)) in (let H3 \def
237 (eq_ind_r A (asucc g (aplus g a n0)) (\lambda (a0: A).(eq A (aplus g (asucc g
238 a) n) a0)) H2 (aplus g (asucc g a) n0) (aplus_asucc g n0 a)) in (f_equal nat
239 nat S n n0 (H n0 (asucc g a) H3)))))))) h2)))) h1)).