author | huffman |
Tue, 29 May 2007 17:37:04 +0200 | |
changeset 23119 | 0082459a255b |
parent 23111 | f8583c2a491a |
child 23121 | 5feeb93b3ba8 |
permissions | -rw-r--r-- |
10751 | 1 |
(* Title : Series.thy |
2 |
Author : Jacques D. Fleuriot |
|
3 |
Copyright : 1998 University of Cambridge |
|
14416 | 4 |
|
5 |
Converted to Isar and polished by lcp |
|
15539 | 6 |
Converted to setsum and polished yet more by TNN |
16819 | 7 |
Additional contributions by Jeremy Avigad |
10751 | 8 |
*) |
9 |
||
14416 | 10 |
header{*Finite Summation and Infinite Series*} |
10751 | 11 |
|
15131 | 12 |
theory Series |
21141 | 13 |
imports SEQ |
15131 | 14 |
begin |
15561 | 15 |
|
19765 | 16 |
definition |
20692 | 17 |
sums :: "(nat \<Rightarrow> 'a::real_normed_vector) \<Rightarrow> 'a \<Rightarrow> bool" |
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21141
diff
changeset
|
18 |
(infixr "sums" 80) where |
19765 | 19 |
"f sums s = (%n. setsum f {0..<n}) ----> s" |
10751 | 20 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21141
diff
changeset
|
21 |
definition |
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21141
diff
changeset
|
22 |
summable :: "(nat \<Rightarrow> 'a::real_normed_vector) \<Rightarrow> bool" where |
19765 | 23 |
"summable f = (\<exists>s. f sums s)" |
14416 | 24 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21141
diff
changeset
|
25 |
definition |
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21141
diff
changeset
|
26 |
suminf :: "(nat \<Rightarrow> 'a::real_normed_vector) \<Rightarrow> 'a" where |
20688 | 27 |
"suminf f = (THE s. f sums s)" |
14416 | 28 |
|
15546 | 29 |
syntax |
20692 | 30 |
"_suminf" :: "idt \<Rightarrow> 'a \<Rightarrow> 'a" ("\<Sum>_. _" [0, 10] 10) |
15546 | 31 |
translations |
20770 | 32 |
"\<Sum>i. b" == "CONST suminf (%i. b)" |
15546 | 33 |
|
14416 | 34 |
|
15539 | 35 |
lemma sumr_diff_mult_const: |
36 |
"setsum f {0..<n} - (real n*r) = setsum (%i. f i - r) {0..<n::nat}" |
|
15536 | 37 |
by (simp add: diff_minus setsum_addf real_of_nat_def) |
38 |
||
15542 | 39 |
lemma real_setsum_nat_ivl_bounded: |
40 |
"(!!p. p < n \<Longrightarrow> f(p) \<le> K) |
|
41 |
\<Longrightarrow> setsum f {0..<n::nat} \<le> real n * K" |
|
42 |
using setsum_bounded[where A = "{0..<n}"] |
|
43 |
by (auto simp:real_of_nat_def) |
|
14416 | 44 |
|
15539 | 45 |
(* Generalize from real to some algebraic structure? *) |
46 |
lemma sumr_minus_one_realpow_zero [simp]: |
|
15543 | 47 |
"(\<Sum>i=0..<2*n. (-1) ^ Suc i) = (0::real)" |
15251 | 48 |
by (induct "n", auto) |
14416 | 49 |
|
15539 | 50 |
(* FIXME this is an awful lemma! *) |
51 |
lemma sumr_one_lb_realpow_zero [simp]: |
|
52 |
"(\<Sum>n=Suc 0..<n. f(n) * (0::real) ^ n) = 0" |
|
20692 | 53 |
by (rule setsum_0', simp) |
14416 | 54 |
|
15543 | 55 |
lemma sumr_group: |
15539 | 56 |
"(\<Sum>m=0..<n::nat. setsum f {m * k ..< m*k + k}) = setsum f {0 ..< n * k}" |
15543 | 57 |
apply (subgoal_tac "k = 0 | 0 < k", auto) |
15251 | 58 |
apply (induct "n") |
15539 | 59 |
apply (simp_all add: setsum_add_nat_ivl add_commute) |
14416 | 60 |
done |
15539 | 61 |
|
20692 | 62 |
lemma sumr_offset3: |
63 |
"setsum f {0::nat..<n+k} = (\<Sum>m=0..<n. f (m+k)) + setsum f {0..<k}" |
|
64 |
apply (subst setsum_shift_bounds_nat_ivl [symmetric]) |
|
65 |
apply (simp add: setsum_add_nat_ivl add_commute) |
|
66 |
done |
|
67 |
||
16819 | 68 |
lemma sumr_offset: |
20692 | 69 |
fixes f :: "nat \<Rightarrow> 'a::ab_group_add" |
70 |
shows "(\<Sum>m=0..<n. f(m+k)) = setsum f {0..<n+k} - setsum f {0..<k}" |
|
71 |
by (simp add: sumr_offset3) |
|
16819 | 72 |
|
73 |
lemma sumr_offset2: |
|
74 |
"\<forall>f. (\<Sum>m=0..<n::nat. f(m+k)::real) = setsum f {0..<n+k} - setsum f {0..<k}" |
|
20692 | 75 |
by (simp add: sumr_offset) |
16819 | 76 |
|
77 |
lemma sumr_offset4: |
|
20692 | 78 |
"\<forall>n f. setsum f {0::nat..<n+k} = (\<Sum>m=0..<n. f (m+k)::real) + setsum f {0..<k}" |
79 |
by (clarify, rule sumr_offset3) |
|
16819 | 80 |
|
81 |
(* |
|
82 |
lemma sumr_from_1_from_0: "0 < n ==> |
|
83 |
(\<Sum>n=Suc 0 ..< Suc n. if even(n) then 0 else |
|
84 |
((- 1) ^ ((n - (Suc 0)) div 2))/(real (fact n))) * a ^ n = |
|
85 |
(\<Sum>n=0..<Suc n. if even(n) then 0 else |
|
86 |
((- 1) ^ ((n - (Suc 0)) div 2))/(real (fact n))) * a ^ n" |
|
87 |
by (rule_tac n1 = 1 in sumr_split_add [THEN subst], auto) |
|
88 |
*) |
|
14416 | 89 |
|
90 |
subsection{* Infinite Sums, by the Properties of Limits*} |
|
91 |
||
92 |
(*---------------------- |
|
93 |
suminf is the sum |
|
94 |
---------------------*) |
|
95 |
lemma sums_summable: "f sums l ==> summable f" |
|
96 |
by (simp add: sums_def summable_def, blast) |
|
97 |
||
98 |
lemma summable_sums: "summable f ==> f sums (suminf f)" |
|
20688 | 99 |
apply (simp add: summable_def suminf_def sums_def) |
100 |
apply (blast intro: theI LIMSEQ_unique) |
|
14416 | 101 |
done |
102 |
||
103 |
lemma summable_sumr_LIMSEQ_suminf: |
|
15539 | 104 |
"summable f ==> (%n. setsum f {0..<n}) ----> (suminf f)" |
20688 | 105 |
by (rule summable_sums [unfolded sums_def]) |
14416 | 106 |
|
107 |
(*------------------- |
|
108 |
sum is unique |
|
109 |
------------------*) |
|
110 |
lemma sums_unique: "f sums s ==> (s = suminf f)" |
|
111 |
apply (frule sums_summable [THEN summable_sums]) |
|
112 |
apply (auto intro!: LIMSEQ_unique simp add: sums_def) |
|
113 |
done |
|
114 |
||
16819 | 115 |
lemma sums_split_initial_segment: "f sums s ==> |
116 |
(%n. f(n + k)) sums (s - (SUM i = 0..< k. f i))" |
|
117 |
apply (unfold sums_def); |
|
118 |
apply (simp add: sumr_offset); |
|
119 |
apply (rule LIMSEQ_diff_const) |
|
120 |
apply (rule LIMSEQ_ignore_initial_segment) |
|
121 |
apply assumption |
|
122 |
done |
|
123 |
||
124 |
lemma summable_ignore_initial_segment: "summable f ==> |
|
125 |
summable (%n. f(n + k))" |
|
126 |
apply (unfold summable_def) |
|
127 |
apply (auto intro: sums_split_initial_segment) |
|
128 |
done |
|
129 |
||
130 |
lemma suminf_minus_initial_segment: "summable f ==> |
|
131 |
suminf f = s ==> suminf (%n. f(n + k)) = s - (SUM i = 0..< k. f i)" |
|
132 |
apply (frule summable_ignore_initial_segment) |
|
133 |
apply (rule sums_unique [THEN sym]) |
|
134 |
apply (frule summable_sums) |
|
135 |
apply (rule sums_split_initial_segment) |
|
136 |
apply auto |
|
137 |
done |
|
138 |
||
139 |
lemma suminf_split_initial_segment: "summable f ==> |
|
140 |
suminf f = (SUM i = 0..< k. f i) + suminf (%n. f(n + k))" |
|
141 |
by (auto simp add: suminf_minus_initial_segment) |
|
142 |
||
14416 | 143 |
lemma series_zero: |
15539 | 144 |
"(\<forall>m. n \<le> m --> f(m) = 0) ==> f sums (setsum f {0..<n})" |
15537 | 145 |
apply (simp add: sums_def LIMSEQ_def diff_minus[symmetric], safe) |
14416 | 146 |
apply (rule_tac x = n in exI) |
15542 | 147 |
apply (clarsimp simp add:setsum_diff[symmetric] cong:setsum_ivl_cong) |
14416 | 148 |
done |
149 |
||
16819 | 150 |
lemma sums_zero: "(%n. 0) sums 0"; |
151 |
apply (unfold sums_def); |
|
152 |
apply simp; |
|
153 |
apply (rule LIMSEQ_const); |
|
154 |
done; |
|
15539 | 155 |
|
16819 | 156 |
lemma summable_zero: "summable (%n. 0)"; |
157 |
apply (rule sums_summable); |
|
158 |
apply (rule sums_zero); |
|
159 |
done; |
|
160 |
||
161 |
lemma suminf_zero: "suminf (%n. 0) = 0"; |
|
162 |
apply (rule sym); |
|
163 |
apply (rule sums_unique); |
|
164 |
apply (rule sums_zero); |
|
165 |
done; |
|
166 |
||
23119 | 167 |
lemma (in bounded_linear) sums: |
168 |
"(\<lambda>n. X n) sums a \<Longrightarrow> (\<lambda>n. f (X n)) sums (f a)" |
|
169 |
unfolding sums_def by (drule LIMSEQ, simp only: setsum) |
|
170 |
||
171 |
lemma (in bounded_linear) summable: |
|
172 |
"summable (\<lambda>n. X n) \<Longrightarrow> summable (\<lambda>n. f (X n))" |
|
173 |
unfolding summable_def by (auto intro: sums) |
|
174 |
||
175 |
lemma (in bounded_linear) suminf: |
|
176 |
"summable (\<lambda>n. X n) \<Longrightarrow> f (\<Sum>n. X n) = (\<Sum>n. f (X n))" |
|
177 |
by (rule summable_sums [THEN sums, THEN sums_unique]) |
|
178 |
||
20692 | 179 |
lemma sums_mult: |
180 |
fixes c :: "'a::real_normed_algebra" |
|
181 |
shows "f sums a \<Longrightarrow> (\<lambda>n. c * f n) sums (c * a)" |
|
19279 | 182 |
by (auto simp add: sums_def setsum_right_distrib [symmetric] |
14416 | 183 |
intro!: LIMSEQ_mult intro: LIMSEQ_const) |
184 |
||
20692 | 185 |
lemma summable_mult: |
186 |
fixes c :: "'a::real_normed_algebra" |
|
187 |
shows "summable f \<Longrightarrow> summable (%n. c * f n)"; |
|
16819 | 188 |
apply (unfold summable_def); |
189 |
apply (auto intro: sums_mult); |
|
190 |
done; |
|
191 |
||
20692 | 192 |
lemma suminf_mult: |
193 |
fixes c :: "'a::real_normed_algebra" |
|
194 |
shows "summable f \<Longrightarrow> suminf (\<lambda>n. c * f n) = c * suminf f"; |
|
16819 | 195 |
apply (rule sym); |
196 |
apply (rule sums_unique); |
|
197 |
apply (rule sums_mult); |
|
198 |
apply (erule summable_sums); |
|
199 |
done; |
|
200 |
||
20692 | 201 |
lemma sums_mult2: |
202 |
fixes c :: "'a::real_normed_algebra" |
|
203 |
shows "f sums a \<Longrightarrow> (\<lambda>n. f n * c) sums (a * c)" |
|
204 |
by (auto simp add: sums_def setsum_left_distrib [symmetric] |
|
205 |
intro!: LIMSEQ_mult LIMSEQ_const) |
|
16819 | 206 |
|
20692 | 207 |
lemma summable_mult2: |
208 |
fixes c :: "'a::real_normed_algebra" |
|
209 |
shows "summable f \<Longrightarrow> summable (\<lambda>n. f n * c)" |
|
16819 | 210 |
apply (unfold summable_def) |
211 |
apply (auto intro: sums_mult2) |
|
212 |
done |
|
213 |
||
20692 | 214 |
lemma suminf_mult2: |
215 |
fixes c :: "'a::real_normed_algebra" |
|
216 |
shows "summable f \<Longrightarrow> suminf f * c = (\<Sum>n. f n * c)" |
|
217 |
by (auto intro!: sums_unique sums_mult2 summable_sums) |
|
16819 | 218 |
|
20692 | 219 |
lemma sums_divide: |
220 |
fixes c :: "'a::real_normed_field" |
|
221 |
shows "f sums a \<Longrightarrow> (\<lambda>n. f n / c) sums (a / c)" |
|
222 |
by (simp add: divide_inverse sums_mult2) |
|
14416 | 223 |
|
20692 | 224 |
lemma summable_divide: |
225 |
fixes c :: "'a::real_normed_field" |
|
226 |
shows "summable f \<Longrightarrow> summable (\<lambda>n. f n / c)" |
|
16819 | 227 |
apply (unfold summable_def); |
228 |
apply (auto intro: sums_divide); |
|
229 |
done; |
|
230 |
||
20692 | 231 |
lemma suminf_divide: |
232 |
fixes c :: "'a::real_normed_field" |
|
233 |
shows "summable f \<Longrightarrow> suminf (\<lambda>n. f n / c) = suminf f / c" |
|
16819 | 234 |
apply (rule sym); |
235 |
apply (rule sums_unique); |
|
236 |
apply (rule sums_divide); |
|
237 |
apply (erule summable_sums); |
|
238 |
done; |
|
239 |
||
240 |
lemma sums_add: "[| x sums x0; y sums y0 |] ==> (%n. x n + y n) sums (x0+y0)" |
|
241 |
by (auto simp add: sums_def setsum_addf intro: LIMSEQ_add) |
|
242 |
||
243 |
lemma summable_add: "summable f ==> summable g ==> summable (%x. f x + g x)"; |
|
244 |
apply (unfold summable_def); |
|
245 |
apply clarify; |
|
246 |
apply (rule exI); |
|
247 |
apply (erule sums_add); |
|
248 |
apply assumption; |
|
249 |
done; |
|
250 |
||
251 |
lemma suminf_add: |
|
252 |
"[| summable f; summable g |] |
|
253 |
==> suminf f + suminf g = (\<Sum>n. f n + g n)" |
|
254 |
by (auto intro!: sums_add sums_unique summable_sums) |
|
255 |
||
14416 | 256 |
lemma sums_diff: "[| x sums x0; y sums y0 |] ==> (%n. x n - y n) sums (x0-y0)" |
15536 | 257 |
by (auto simp add: sums_def setsum_subtractf intro: LIMSEQ_diff) |
14416 | 258 |
|
16819 | 259 |
lemma summable_diff: "summable f ==> summable g ==> summable (%x. f x - g x)"; |
260 |
apply (unfold summable_def); |
|
261 |
apply clarify; |
|
262 |
apply (rule exI); |
|
263 |
apply (erule sums_diff); |
|
264 |
apply assumption; |
|
265 |
done; |
|
14416 | 266 |
|
267 |
lemma suminf_diff: |
|
268 |
"[| summable f; summable g |] |
|
15546 | 269 |
==> suminf f - suminf g = (\<Sum>n. f n - g n)" |
14416 | 270 |
by (auto intro!: sums_diff sums_unique summable_sums) |
271 |
||
16819 | 272 |
lemma sums_minus: "f sums s ==> (%x. - f x) sums (- s)"; |
273 |
by (simp add: sums_def setsum_negf LIMSEQ_minus); |
|
274 |
||
275 |
lemma summable_minus: "summable f ==> summable (%x. - f x)"; |
|
276 |
by (auto simp add: summable_def intro: sums_minus); |
|
277 |
||
278 |
lemma suminf_minus: "summable f ==> suminf (%x. - f x) = - (suminf f)"; |
|
279 |
apply (rule sym); |
|
280 |
apply (rule sums_unique); |
|
281 |
apply (rule sums_minus); |
|
282 |
apply (erule summable_sums); |
|
283 |
done; |
|
14416 | 284 |
|
285 |
lemma sums_group: |
|
15539 | 286 |
"[|summable f; 0 < k |] ==> (%n. setsum f {n*k..<n*k+k}) sums (suminf f)" |
14416 | 287 |
apply (drule summable_sums) |
20692 | 288 |
apply (simp only: sums_def sumr_group) |
289 |
apply (unfold LIMSEQ_def, safe) |
|
290 |
apply (drule_tac x="r" in spec, safe) |
|
291 |
apply (rule_tac x="no" in exI, safe) |
|
292 |
apply (drule_tac x="n*k" in spec) |
|
293 |
apply (erule mp) |
|
294 |
apply (erule order_trans) |
|
295 |
apply simp |
|
14416 | 296 |
done |
297 |
||
15085
5693a977a767
removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents:
15053
diff
changeset
|
298 |
text{*A summable series of positive terms has limit that is at least as |
5693a977a767
removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents:
15053
diff
changeset
|
299 |
great as any partial sum.*} |
14416 | 300 |
|
20692 | 301 |
lemma series_pos_le: |
302 |
fixes f :: "nat \<Rightarrow> real" |
|
303 |
shows "\<lbrakk>summable f; \<forall>m\<ge>n. 0 \<le> f m\<rbrakk> \<Longrightarrow> setsum f {0..<n} \<le> suminf f" |
|
14416 | 304 |
apply (drule summable_sums) |
305 |
apply (simp add: sums_def) |
|
15539 | 306 |
apply (cut_tac k = "setsum f {0..<n}" in LIMSEQ_const) |
307 |
apply (erule LIMSEQ_le, blast) |
|
20692 | 308 |
apply (rule_tac x="n" in exI, clarify) |
15539 | 309 |
apply (rule setsum_mono2) |
310 |
apply auto |
|
14416 | 311 |
done |
312 |
||
313 |
lemma series_pos_less: |
|
20692 | 314 |
fixes f :: "nat \<Rightarrow> real" |
315 |
shows "\<lbrakk>summable f; \<forall>m\<ge>n. 0 < f m\<rbrakk> \<Longrightarrow> setsum f {0..<n} < suminf f" |
|
316 |
apply (rule_tac y="setsum f {0..<Suc n}" in order_less_le_trans) |
|
317 |
apply simp |
|
318 |
apply (erule series_pos_le) |
|
319 |
apply (simp add: order_less_imp_le) |
|
320 |
done |
|
321 |
||
322 |
lemma suminf_gt_zero: |
|
323 |
fixes f :: "nat \<Rightarrow> real" |
|
324 |
shows "\<lbrakk>summable f; \<forall>n. 0 < f n\<rbrakk> \<Longrightarrow> 0 < suminf f" |
|
325 |
by (drule_tac n="0" in series_pos_less, simp_all) |
|
326 |
||
327 |
lemma suminf_ge_zero: |
|
328 |
fixes f :: "nat \<Rightarrow> real" |
|
329 |
shows "\<lbrakk>summable f; \<forall>n. 0 \<le> f n\<rbrakk> \<Longrightarrow> 0 \<le> suminf f" |
|
330 |
by (drule_tac n="0" in series_pos_le, simp_all) |
|
331 |
||
332 |
lemma sumr_pos_lt_pair: |
|
333 |
fixes f :: "nat \<Rightarrow> real" |
|
334 |
shows "\<lbrakk>summable f; |
|
335 |
\<forall>d. 0 < f (k + (Suc(Suc 0) * d)) + f (k + ((Suc(Suc 0) * d) + 1))\<rbrakk> |
|
336 |
\<Longrightarrow> setsum f {0..<k} < suminf f" |
|
337 |
apply (subst suminf_split_initial_segment [where k="k"]) |
|
338 |
apply assumption |
|
339 |
apply simp |
|
340 |
apply (drule_tac k="k" in summable_ignore_initial_segment) |
|
341 |
apply (drule_tac k="Suc (Suc 0)" in sums_group, simp) |
|
342 |
apply simp |
|
343 |
apply (frule sums_unique) |
|
344 |
apply (drule sums_summable) |
|
345 |
apply simp |
|
346 |
apply (erule suminf_gt_zero) |
|
347 |
apply (simp add: add_ac) |
|
14416 | 348 |
done |
349 |
||
15085
5693a977a767
removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents:
15053
diff
changeset
|
350 |
text{*Sum of a geometric progression.*} |
14416 | 351 |
|
17149
e2b19c92ef51
Lemmas on dvd, power and finite summation added or strengthened.
ballarin
parents:
16819
diff
changeset
|
352 |
lemmas sumr_geometric = geometric_sum [where 'a = real] |
14416 | 353 |
|
20692 | 354 |
lemma geometric_sums: |
22719
c51667189bd3
lemma geometric_sum no longer needs class division_by_zero
huffman
parents:
21404
diff
changeset
|
355 |
fixes x :: "'a::{real_normed_field,recpower}" |
20692 | 356 |
shows "norm x < 1 \<Longrightarrow> (\<lambda>n. x ^ n) sums (1 / (1 - x))" |
357 |
proof - |
|
358 |
assume less_1: "norm x < 1" |
|
359 |
hence neq_1: "x \<noteq> 1" by auto |
|
360 |
hence neq_0: "x - 1 \<noteq> 0" by simp |
|
361 |
from less_1 have lim_0: "(\<lambda>n. x ^ n) ----> 0" |
|
362 |
by (rule LIMSEQ_power_zero) |
|
22719
c51667189bd3
lemma geometric_sum no longer needs class division_by_zero
huffman
parents:
21404
diff
changeset
|
363 |
hence "(\<lambda>n. x ^ n / (x - 1) - 1 / (x - 1)) ----> 0 / (x - 1) - 1 / (x - 1)" |
20692 | 364 |
using neq_0 by (intro LIMSEQ_divide LIMSEQ_diff LIMSEQ_const) |
365 |
hence "(\<lambda>n. (x ^ n - 1) / (x - 1)) ----> 1 / (1 - x)" |
|
366 |
by (simp add: nonzero_minus_divide_right [OF neq_0] diff_divide_distrib) |
|
367 |
thus "(\<lambda>n. x ^ n) sums (1 / (1 - x))" |
|
368 |
by (simp add: sums_def geometric_sum neq_1) |
|
369 |
qed |
|
370 |
||
371 |
lemma summable_geometric: |
|
22719
c51667189bd3
lemma geometric_sum no longer needs class division_by_zero
huffman
parents:
21404
diff
changeset
|
372 |
fixes x :: "'a::{real_normed_field,recpower}" |
20692 | 373 |
shows "norm x < 1 \<Longrightarrow> summable (\<lambda>n. x ^ n)" |
374 |
by (rule geometric_sums [THEN sums_summable]) |
|
14416 | 375 |
|
15085
5693a977a767
removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents:
15053
diff
changeset
|
376 |
text{*Cauchy-type criterion for convergence of series (c.f. Harrison)*} |
5693a977a767
removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents:
15053
diff
changeset
|
377 |
|
15539 | 378 |
lemma summable_convergent_sumr_iff: |
379 |
"summable f = convergent (%n. setsum f {0..<n})" |
|
14416 | 380 |
by (simp add: summable_def sums_def convergent_def) |
381 |
||
20689 | 382 |
lemma summable_LIMSEQ_zero: "summable f \<Longrightarrow> f ----> 0" |
383 |
apply (drule summable_convergent_sumr_iff [THEN iffD1]) |
|
20692 | 384 |
apply (drule convergent_Cauchy) |
20689 | 385 |
apply (simp only: Cauchy_def LIMSEQ_def, safe) |
386 |
apply (drule_tac x="r" in spec, safe) |
|
387 |
apply (rule_tac x="M" in exI, safe) |
|
388 |
apply (drule_tac x="Suc n" in spec, simp) |
|
389 |
apply (drule_tac x="n" in spec, simp) |
|
390 |
done |
|
391 |
||
14416 | 392 |
lemma summable_Cauchy: |
20848 | 393 |
"summable (f::nat \<Rightarrow> 'a::banach) = |
394 |
(\<forall>e > 0. \<exists>N. \<forall>m \<ge> N. \<forall>n. norm (setsum f {m..<n}) < e)" |
|
395 |
apply (simp only: summable_convergent_sumr_iff Cauchy_convergent_iff [symmetric] Cauchy_def, safe) |
|
20410 | 396 |
apply (drule spec, drule (1) mp) |
397 |
apply (erule exE, rule_tac x="M" in exI, clarify) |
|
398 |
apply (rule_tac x="m" and y="n" in linorder_le_cases) |
|
399 |
apply (frule (1) order_trans) |
|
400 |
apply (drule_tac x="n" in spec, drule (1) mp) |
|
401 |
apply (drule_tac x="m" in spec, drule (1) mp) |
|
402 |
apply (simp add: setsum_diff [symmetric]) |
|
403 |
apply simp |
|
404 |
apply (drule spec, drule (1) mp) |
|
405 |
apply (erule exE, rule_tac x="N" in exI, clarify) |
|
406 |
apply (rule_tac x="m" and y="n" in linorder_le_cases) |
|
20552
2c31dd358c21
generalized types of many constants to work over arbitrary vector spaces;
huffman
parents:
20432
diff
changeset
|
407 |
apply (subst norm_minus_commute) |
20410 | 408 |
apply (simp add: setsum_diff [symmetric]) |
409 |
apply (simp add: setsum_diff [symmetric]) |
|
14416 | 410 |
done |
411 |
||
15085
5693a977a767
removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents:
15053
diff
changeset
|
412 |
text{*Comparison test*} |
5693a977a767
removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents:
15053
diff
changeset
|
413 |
|
20692 | 414 |
lemma norm_setsum: |
415 |
fixes f :: "'a \<Rightarrow> 'b::real_normed_vector" |
|
416 |
shows "norm (setsum f A) \<le> (\<Sum>i\<in>A. norm (f i))" |
|
417 |
apply (case_tac "finite A") |
|
418 |
apply (erule finite_induct) |
|
419 |
apply simp |
|
420 |
apply simp |
|
421 |
apply (erule order_trans [OF norm_triangle_ineq add_left_mono]) |
|
422 |
apply simp |
|
423 |
done |
|
424 |
||
14416 | 425 |
lemma summable_comparison_test: |
20848 | 426 |
fixes f :: "nat \<Rightarrow> 'a::banach" |
427 |
shows "\<lbrakk>\<exists>N. \<forall>n\<ge>N. norm (f n) \<le> g n; summable g\<rbrakk> \<Longrightarrow> summable f" |
|
20692 | 428 |
apply (simp add: summable_Cauchy, safe) |
429 |
apply (drule_tac x="e" in spec, safe) |
|
430 |
apply (rule_tac x = "N + Na" in exI, safe) |
|
14416 | 431 |
apply (rotate_tac 2) |
432 |
apply (drule_tac x = m in spec) |
|
433 |
apply (auto, rotate_tac 2, drule_tac x = n in spec) |
|
20848 | 434 |
apply (rule_tac y = "\<Sum>k=m..<n. norm (f k)" in order_le_less_trans) |
435 |
apply (rule norm_setsum) |
|
15539 | 436 |
apply (rule_tac y = "setsum g {m..<n}" in order_le_less_trans) |
22998 | 437 |
apply (auto intro: setsum_mono simp add: abs_less_iff) |
14416 | 438 |
done |
439 |
||
20848 | 440 |
lemma summable_norm_comparison_test: |
441 |
fixes f :: "nat \<Rightarrow> 'a::banach" |
|
442 |
shows "\<lbrakk>\<exists>N. \<forall>n\<ge>N. norm (f n) \<le> g n; summable g\<rbrakk> |
|
443 |
\<Longrightarrow> summable (\<lambda>n. norm (f n))" |
|
444 |
apply (rule summable_comparison_test) |
|
445 |
apply (auto) |
|
446 |
done |
|
447 |
||
14416 | 448 |
lemma summable_rabs_comparison_test: |
20692 | 449 |
fixes f :: "nat \<Rightarrow> real" |
450 |
shows "\<lbrakk>\<exists>N. \<forall>n\<ge>N. \<bar>f n\<bar> \<le> g n; summable g\<rbrakk> \<Longrightarrow> summable (\<lambda>n. \<bar>f n\<bar>)" |
|
14416 | 451 |
apply (rule summable_comparison_test) |
15543 | 452 |
apply (auto) |
14416 | 453 |
done |
454 |
||
23084 | 455 |
text{*Summability of geometric series for real algebras*} |
456 |
||
457 |
lemma complete_algebra_summable_geometric: |
|
458 |
fixes x :: "'a::{real_normed_algebra_1,banach,recpower}" |
|
459 |
shows "norm x < 1 \<Longrightarrow> summable (\<lambda>n. x ^ n)" |
|
460 |
proof (rule summable_comparison_test) |
|
461 |
show "\<exists>N. \<forall>n\<ge>N. norm (x ^ n) \<le> norm x ^ n" |
|
462 |
by (simp add: norm_power_ineq) |
|
463 |
show "norm x < 1 \<Longrightarrow> summable (\<lambda>n. norm x ^ n)" |
|
464 |
by (simp add: summable_geometric) |
|
465 |
qed |
|
466 |
||
15085
5693a977a767
removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents:
15053
diff
changeset
|
467 |
text{*Limit comparison property for series (c.f. jrh)*} |
5693a977a767
removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents:
15053
diff
changeset
|
468 |
|
14416 | 469 |
lemma summable_le: |
20692 | 470 |
fixes f g :: "nat \<Rightarrow> real" |
471 |
shows "\<lbrakk>\<forall>n. f n \<le> g n; summable f; summable g\<rbrakk> \<Longrightarrow> suminf f \<le> suminf g" |
|
14416 | 472 |
apply (drule summable_sums)+ |
20692 | 473 |
apply (simp only: sums_def, erule (1) LIMSEQ_le) |
14416 | 474 |
apply (rule exI) |
15539 | 475 |
apply (auto intro!: setsum_mono) |
14416 | 476 |
done |
477 |
||
478 |
lemma summable_le2: |
|
20692 | 479 |
fixes f g :: "nat \<Rightarrow> real" |
480 |
shows "\<lbrakk>\<forall>n. \<bar>f n\<bar> \<le> g n; summable g\<rbrakk> \<Longrightarrow> summable f \<and> suminf f \<le> suminf g" |
|
20848 | 481 |
apply (subgoal_tac "summable f") |
482 |
apply (auto intro!: summable_le) |
|
22998 | 483 |
apply (simp add: abs_le_iff) |
20848 | 484 |
apply (rule_tac g="g" in summable_comparison_test, simp_all) |
14416 | 485 |
done |
486 |
||
19106
6e6b5b1fdc06
* added Library/ASeries (sum of arithmetic series with instantiation to nat and int)
kleing
parents:
17149
diff
changeset
|
487 |
(* specialisation for the common 0 case *) |
6e6b5b1fdc06
* added Library/ASeries (sum of arithmetic series with instantiation to nat and int)
kleing
parents:
17149
diff
changeset
|
488 |
lemma suminf_0_le: |
6e6b5b1fdc06
* added Library/ASeries (sum of arithmetic series with instantiation to nat and int)
kleing
parents:
17149
diff
changeset
|
489 |
fixes f::"nat\<Rightarrow>real" |
6e6b5b1fdc06
* added Library/ASeries (sum of arithmetic series with instantiation to nat and int)
kleing
parents:
17149
diff
changeset
|
490 |
assumes gt0: "\<forall>n. 0 \<le> f n" and sm: "summable f" |
6e6b5b1fdc06
* added Library/ASeries (sum of arithmetic series with instantiation to nat and int)
kleing
parents:
17149
diff
changeset
|
491 |
shows "0 \<le> suminf f" |
6e6b5b1fdc06
* added Library/ASeries (sum of arithmetic series with instantiation to nat and int)
kleing
parents:
17149
diff
changeset
|
492 |
proof - |
6e6b5b1fdc06
* added Library/ASeries (sum of arithmetic series with instantiation to nat and int)
kleing
parents:
17149
diff
changeset
|
493 |
let ?g = "(\<lambda>n. (0::real))" |
6e6b5b1fdc06
* added Library/ASeries (sum of arithmetic series with instantiation to nat and int)
kleing
parents:
17149
diff
changeset
|
494 |
from gt0 have "\<forall>n. ?g n \<le> f n" by simp |
6e6b5b1fdc06
* added Library/ASeries (sum of arithmetic series with instantiation to nat and int)
kleing
parents:
17149
diff
changeset
|
495 |
moreover have "summable ?g" by (rule summable_zero) |
6e6b5b1fdc06
* added Library/ASeries (sum of arithmetic series with instantiation to nat and int)
kleing
parents:
17149
diff
changeset
|
496 |
moreover from sm have "summable f" . |
6e6b5b1fdc06
* added Library/ASeries (sum of arithmetic series with instantiation to nat and int)
kleing
parents:
17149
diff
changeset
|
497 |
ultimately have "suminf ?g \<le> suminf f" by (rule summable_le) |
6e6b5b1fdc06
* added Library/ASeries (sum of arithmetic series with instantiation to nat and int)
kleing
parents:
17149
diff
changeset
|
498 |
then show "0 \<le> suminf f" by (simp add: suminf_zero) |
6e6b5b1fdc06
* added Library/ASeries (sum of arithmetic series with instantiation to nat and int)
kleing
parents:
17149
diff
changeset
|
499 |
qed |
6e6b5b1fdc06
* added Library/ASeries (sum of arithmetic series with instantiation to nat and int)
kleing
parents:
17149
diff
changeset
|
500 |
|
6e6b5b1fdc06
* added Library/ASeries (sum of arithmetic series with instantiation to nat and int)
kleing
parents:
17149
diff
changeset
|
501 |
|
15085
5693a977a767
removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents:
15053
diff
changeset
|
502 |
text{*Absolute convergence imples normal convergence*} |
20848 | 503 |
lemma summable_norm_cancel: |
504 |
fixes f :: "nat \<Rightarrow> 'a::banach" |
|
505 |
shows "summable (\<lambda>n. norm (f n)) \<Longrightarrow> summable f" |
|
20692 | 506 |
apply (simp only: summable_Cauchy, safe) |
507 |
apply (drule_tac x="e" in spec, safe) |
|
508 |
apply (rule_tac x="N" in exI, safe) |
|
509 |
apply (drule_tac x="m" in spec, safe) |
|
20848 | 510 |
apply (rule order_le_less_trans [OF norm_setsum]) |
511 |
apply (rule order_le_less_trans [OF abs_ge_self]) |
|
20692 | 512 |
apply simp |
14416 | 513 |
done |
514 |
||
20848 | 515 |
lemma summable_rabs_cancel: |
516 |
fixes f :: "nat \<Rightarrow> real" |
|
517 |
shows "summable (\<lambda>n. \<bar>f n\<bar>) \<Longrightarrow> summable f" |
|
518 |
by (rule summable_norm_cancel, simp) |
|
519 |
||
15085
5693a977a767
removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents:
15053
diff
changeset
|
520 |
text{*Absolute convergence of series*} |
20848 | 521 |
lemma summable_norm: |
522 |
fixes f :: "nat \<Rightarrow> 'a::banach" |
|
523 |
shows "summable (\<lambda>n. norm (f n)) \<Longrightarrow> norm (suminf f) \<le> (\<Sum>n. norm (f n))" |
|
524 |
by (auto intro: LIMSEQ_le LIMSEQ_norm summable_norm_cancel |
|
525 |
summable_sumr_LIMSEQ_suminf norm_setsum) |
|
526 |
||
14416 | 527 |
lemma summable_rabs: |
20692 | 528 |
fixes f :: "nat \<Rightarrow> real" |
529 |
shows "summable (\<lambda>n. \<bar>f n\<bar>) \<Longrightarrow> \<bar>suminf f\<bar> \<le> (\<Sum>n. \<bar>f n\<bar>)" |
|
20848 | 530 |
by (fold real_norm_def, rule summable_norm) |
14416 | 531 |
|
532 |
subsection{* The Ratio Test*} |
|
533 |
||
20848 | 534 |
lemma norm_ratiotest_lemma: |
22852 | 535 |
fixes x y :: "'a::real_normed_vector" |
20848 | 536 |
shows "\<lbrakk>c \<le> 0; norm x \<le> c * norm y\<rbrakk> \<Longrightarrow> x = 0" |
537 |
apply (subgoal_tac "norm x \<le> 0", simp) |
|
538 |
apply (erule order_trans) |
|
539 |
apply (simp add: mult_le_0_iff) |
|
540 |
done |
|
541 |
||
14416 | 542 |
lemma rabs_ratiotest_lemma: "[| c \<le> 0; abs x \<le> c * abs y |] ==> x = (0::real)" |
20848 | 543 |
by (erule norm_ratiotest_lemma, simp) |
14416 | 544 |
|
545 |
lemma le_Suc_ex: "(k::nat) \<le> l ==> (\<exists>n. l = k + n)" |
|
546 |
apply (drule le_imp_less_or_eq) |
|
547 |
apply (auto dest: less_imp_Suc_add) |
|
548 |
done |
|
549 |
||
550 |
lemma le_Suc_ex_iff: "((k::nat) \<le> l) = (\<exists>n. l = k + n)" |
|
551 |
by (auto simp add: le_Suc_ex) |
|
552 |
||
553 |
(*All this trouble just to get 0<c *) |
|
554 |
lemma ratio_test_lemma2: |
|
20848 | 555 |
fixes f :: "nat \<Rightarrow> 'a::banach" |
556 |
shows "\<lbrakk>\<forall>n\<ge>N. norm (f (Suc n)) \<le> c * norm (f n)\<rbrakk> \<Longrightarrow> 0 < c \<or> summable f" |
|
14416 | 557 |
apply (simp (no_asm) add: linorder_not_le [symmetric]) |
558 |
apply (simp add: summable_Cauchy) |
|
15543 | 559 |
apply (safe, subgoal_tac "\<forall>n. N < n --> f (n) = 0") |
560 |
prefer 2 |
|
561 |
apply clarify |
|
562 |
apply(erule_tac x = "n - 1" in allE) |
|
563 |
apply (simp add:diff_Suc split:nat.splits) |
|
20848 | 564 |
apply (blast intro: norm_ratiotest_lemma) |
14416 | 565 |
apply (rule_tac x = "Suc N" in exI, clarify) |
15543 | 566 |
apply(simp cong:setsum_ivl_cong) |
14416 | 567 |
done |
568 |
||
569 |
lemma ratio_test: |
|
20848 | 570 |
fixes f :: "nat \<Rightarrow> 'a::banach" |
571 |
shows "\<lbrakk>c < 1; \<forall>n\<ge>N. norm (f (Suc n)) \<le> c * norm (f n)\<rbrakk> \<Longrightarrow> summable f" |
|
14416 | 572 |
apply (frule ratio_test_lemma2, auto) |
20848 | 573 |
apply (rule_tac g = "%n. (norm (f N) / (c ^ N))*c ^ n" |
15234
ec91a90c604e
simplification tweaks for better arithmetic reasoning
paulson
parents:
15229
diff
changeset
|
574 |
in summable_comparison_test) |
14416 | 575 |
apply (rule_tac x = N in exI, safe) |
576 |
apply (drule le_Suc_ex_iff [THEN iffD1]) |
|
22959 | 577 |
apply (auto simp add: power_add field_power_not_zero) |
15539 | 578 |
apply (induct_tac "na", auto) |
20848 | 579 |
apply (rule_tac y = "c * norm (f (N + n))" in order_trans) |
14416 | 580 |
apply (auto intro: mult_right_mono simp add: summable_def) |
581 |
apply (simp add: mult_ac) |
|
20848 | 582 |
apply (rule_tac x = "norm (f N) * (1/ (1 - c)) / (c ^ N)" in exI) |
15234
ec91a90c604e
simplification tweaks for better arithmetic reasoning
paulson
parents:
15229
diff
changeset
|
583 |
apply (rule sums_divide) |
ec91a90c604e
simplification tweaks for better arithmetic reasoning
paulson
parents:
15229
diff
changeset
|
584 |
apply (rule sums_mult) |
ec91a90c604e
simplification tweaks for better arithmetic reasoning
paulson
parents:
15229
diff
changeset
|
585 |
apply (auto intro!: geometric_sums) |
14416 | 586 |
done |
587 |
||
23111 | 588 |
subsection {* Cauchy Product Formula *} |
589 |
||
590 |
(* Proof based on Analysis WebNotes: Chapter 07, Class 41 |
|
591 |
http://www.math.unl.edu/~webnotes/classes/class41/prp77.htm *) |
|
592 |
||
593 |
lemma setsum_triangle_reindex: |
|
594 |
fixes n :: nat |
|
595 |
shows "(\<Sum>(i,j)\<in>{(i,j). i+j < n}. f i j) = (\<Sum>k=0..<n. \<Sum>i=0..k. f i (k - i))" |
|
596 |
proof - |
|
597 |
have "(\<Sum>(i, j)\<in>{(i, j). i + j < n}. f i j) = |
|
598 |
(\<Sum>(k, i)\<in>(SIGMA k:{0..<n}. {0..k}). f i (k - i))" |
|
599 |
proof (rule setsum_reindex_cong) |
|
600 |
show "inj_on (\<lambda>(k,i). (i, k - i)) (SIGMA k:{0..<n}. {0..k})" |
|
601 |
by (rule inj_on_inverseI [where g="\<lambda>(i,j). (i+j, i)"], auto) |
|
602 |
show "{(i,j). i + j < n} = (\<lambda>(k,i). (i, k - i)) ` (SIGMA k:{0..<n}. {0..k})" |
|
603 |
by (safe, rule_tac x="(a+b,a)" in image_eqI, auto) |
|
604 |
show "\<And>a. (\<lambda>(k, i). f i (k - i)) a = split f ((\<lambda>(k, i). (i, k - i)) a)" |
|
605 |
by clarify |
|
606 |
qed |
|
607 |
thus ?thesis by (simp add: setsum_Sigma) |
|
608 |
qed |
|
609 |
||
610 |
lemma Cauchy_product_sums: |
|
611 |
fixes a b :: "nat \<Rightarrow> 'a::{real_normed_algebra,banach}" |
|
612 |
assumes a: "summable (\<lambda>k. norm (a k))" |
|
613 |
assumes b: "summable (\<lambda>k. norm (b k))" |
|
614 |
shows "(\<lambda>k. \<Sum>i=0..k. a i * b (k - i)) sums ((\<Sum>k. a k) * (\<Sum>k. b k))" |
|
615 |
proof - |
|
616 |
let ?S1 = "\<lambda>n::nat. {0..<n} \<times> {0..<n}" |
|
617 |
let ?S2 = "\<lambda>n::nat. {(i,j). i + j < n}" |
|
618 |
have S1_mono: "\<And>m n. m \<le> n \<Longrightarrow> ?S1 m \<subseteq> ?S1 n" by auto |
|
619 |
have S2_le_S1: "\<And>n. ?S2 n \<subseteq> ?S1 n" by auto |
|
620 |
have S1_le_S2: "\<And>n. ?S1 (n div 2) \<subseteq> ?S2 n" by auto |
|
621 |
have finite_S1: "\<And>n. finite (?S1 n)" by simp |
|
622 |
with S2_le_S1 have finite_S2: "\<And>n. finite (?S2 n)" by (rule finite_subset) |
|
623 |
||
624 |
let ?g = "\<lambda>(i,j). a i * b j" |
|
625 |
let ?f = "\<lambda>(i,j). norm (a i) * norm (b j)" |
|
626 |
have f_nonneg: "\<And>x. 0 \<le> ?f x" |
|
627 |
by (auto simp add: mult_nonneg_nonneg) |
|
628 |
hence norm_setsum_f: "\<And>A. norm (setsum ?f A) = setsum ?f A" |
|
629 |
unfolding real_norm_def |
|
630 |
by (simp only: abs_of_nonneg setsum_nonneg [rule_format]) |
|
631 |
||
632 |
have "(\<lambda>n. (\<Sum>k=0..<n. a k) * (\<Sum>k=0..<n. b k)) |
|
633 |
----> (\<Sum>k. a k) * (\<Sum>k. b k)" |
|
634 |
by (intro LIMSEQ_mult summable_sumr_LIMSEQ_suminf |
|
635 |
summable_norm_cancel [OF a] summable_norm_cancel [OF b]) |
|
636 |
hence 1: "(\<lambda>n. setsum ?g (?S1 n)) ----> (\<Sum>k. a k) * (\<Sum>k. b k)" |
|
637 |
by (simp only: setsum_product setsum_Sigma [rule_format] |
|
638 |
finite_atLeastLessThan) |
|
639 |
||
640 |
have "(\<lambda>n. (\<Sum>k=0..<n. norm (a k)) * (\<Sum>k=0..<n. norm (b k))) |
|
641 |
----> (\<Sum>k. norm (a k)) * (\<Sum>k. norm (b k))" |
|
642 |
using a b by (intro LIMSEQ_mult summable_sumr_LIMSEQ_suminf) |
|
643 |
hence "(\<lambda>n. setsum ?f (?S1 n)) ----> (\<Sum>k. norm (a k)) * (\<Sum>k. norm (b k))" |
|
644 |
by (simp only: setsum_product setsum_Sigma [rule_format] |
|
645 |
finite_atLeastLessThan) |
|
646 |
hence "convergent (\<lambda>n. setsum ?f (?S1 n))" |
|
647 |
by (rule convergentI) |
|
648 |
hence Cauchy: "Cauchy (\<lambda>n. setsum ?f (?S1 n))" |
|
649 |
by (rule convergent_Cauchy) |
|
650 |
have "Zseq (\<lambda>n. setsum ?f (?S1 n - ?S2 n))" |
|
651 |
proof (rule ZseqI, simp only: norm_setsum_f) |
|
652 |
fix r :: real |
|
653 |
assume r: "0 < r" |
|
654 |
from CauchyD [OF Cauchy r] obtain N |
|
655 |
where "\<forall>m\<ge>N. \<forall>n\<ge>N. norm (setsum ?f (?S1 m) - setsum ?f (?S1 n)) < r" .. |
|
656 |
hence "\<And>m n. \<lbrakk>N \<le> n; n \<le> m\<rbrakk> \<Longrightarrow> norm (setsum ?f (?S1 m - ?S1 n)) < r" |
|
657 |
by (simp only: setsum_diff finite_S1 S1_mono) |
|
658 |
hence N: "\<And>m n. \<lbrakk>N \<le> n; n \<le> m\<rbrakk> \<Longrightarrow> setsum ?f (?S1 m - ?S1 n) < r" |
|
659 |
by (simp only: norm_setsum_f) |
|
660 |
show "\<exists>N. \<forall>n\<ge>N. setsum ?f (?S1 n - ?S2 n) < r" |
|
661 |
proof (intro exI allI impI) |
|
662 |
fix n assume "2 * N \<le> n" |
|
663 |
hence n: "N \<le> n div 2" by simp |
|
664 |
have "setsum ?f (?S1 n - ?S2 n) \<le> setsum ?f (?S1 n - ?S1 (n div 2))" |
|
665 |
by (intro setsum_mono2 finite_Diff finite_S1 f_nonneg |
|
666 |
Diff_mono subset_refl S1_le_S2) |
|
667 |
also have "\<dots> < r" |
|
668 |
using n div_le_dividend by (rule N) |
|
669 |
finally show "setsum ?f (?S1 n - ?S2 n) < r" . |
|
670 |
qed |
|
671 |
qed |
|
672 |
hence "Zseq (\<lambda>n. setsum ?g (?S1 n - ?S2 n))" |
|
673 |
apply (rule Zseq_le [rule_format]) |
|
674 |
apply (simp only: norm_setsum_f) |
|
675 |
apply (rule order_trans [OF norm_setsum setsum_mono]) |
|
676 |
apply (auto simp add: norm_mult_ineq) |
|
677 |
done |
|
678 |
hence 2: "(\<lambda>n. setsum ?g (?S1 n) - setsum ?g (?S2 n)) ----> 0" |
|
679 |
by (simp only: LIMSEQ_Zseq_iff setsum_diff finite_S1 S2_le_S1 diff_0_right) |
|
680 |
||
681 |
with 1 have "(\<lambda>n. setsum ?g (?S2 n)) ----> (\<Sum>k. a k) * (\<Sum>k. b k)" |
|
682 |
by (rule LIMSEQ_diff_approach_zero2) |
|
683 |
thus ?thesis by (simp only: sums_def setsum_triangle_reindex) |
|
684 |
qed |
|
685 |
||
686 |
lemma Cauchy_product: |
|
687 |
fixes a b :: "nat \<Rightarrow> 'a::{real_normed_algebra,banach}" |
|
688 |
assumes a: "summable (\<lambda>k. norm (a k))" |
|
689 |
assumes b: "summable (\<lambda>k. norm (b k))" |
|
690 |
shows "(\<Sum>k. a k) * (\<Sum>k. b k) = (\<Sum>k. \<Sum>i=0..k. a i * b (k - i))" |
|
691 |
by (rule Cauchy_product_sums [THEN sums_unique]) |
|
692 |
||
14416 | 693 |
end |