src/HOL/Hyperreal/Series.thy
author nipkow
Mon Feb 21 19:23:46 2005 +0100 (2005-02-21)
changeset 15542 ee6cd48cf840
parent 15539 333a88244569
child 15543 0024472afce7
permissions -rw-r--r--
more fine tuniung
paulson@10751
     1
(*  Title       : Series.thy
paulson@10751
     2
    Author      : Jacques D. Fleuriot
paulson@10751
     3
    Copyright   : 1998  University of Cambridge
paulson@14416
     4
paulson@14416
     5
Converted to Isar and polished by lcp
nipkow@15539
     6
Converted to setsum and polished yet more by TNN
paulson@10751
     7
*) 
paulson@10751
     8
paulson@14416
     9
header{*Finite Summation and Infinite Series*}
paulson@10751
    10
nipkow@15131
    11
theory Series
nipkow@15140
    12
imports SEQ Lim
nipkow@15131
    13
begin
paulson@10751
    14
nipkow@15539
    15
(* FIXME why not globally? *)
nipkow@15536
    16
declare atLeastLessThan_empty[simp];
nipkow@15539
    17
declare atLeastLessThan_iff[iff]
paulson@10751
    18
paulson@10751
    19
constdefs
paulson@14416
    20
   sums  :: "[nat=>real,real] => bool"     (infixr "sums" 80)
nipkow@15536
    21
   "f sums s  == (%n. setsum f {0..<n}) ----> s"
paulson@10751
    22
paulson@14416
    23
   summable :: "(nat=>real) => bool"
paulson@14416
    24
   "summable f == (\<exists>s. f sums s)"
paulson@14416
    25
paulson@14416
    26
   suminf   :: "(nat=>real) => real"
nipkow@15539
    27
   "suminf f == SOME s. f sums s"
paulson@14416
    28
nipkow@15539
    29
lemma setsum_Suc[simp]:
nipkow@15536
    30
  "setsum f {m..<Suc n} = (if n < m then 0 else setsum f {m..<n} + f(n))"
nipkow@15536
    31
by (simp add: atLeastLessThanSuc add_commute)
paulson@14416
    32
nipkow@15539
    33
lemma sumr_diff_mult_const:
nipkow@15539
    34
 "setsum f {0..<n} - (real n*r) = setsum (%i. f i - r) {0..<n::nat}"
nipkow@15536
    35
by (simp add: diff_minus setsum_addf real_of_nat_def)
nipkow@15536
    36
nipkow@15542
    37
lemma real_setsum_nat_ivl_bounded:
nipkow@15542
    38
     "(!!p. p < n \<Longrightarrow> f(p) \<le> K)
nipkow@15542
    39
      \<Longrightarrow> setsum f {0..<n::nat} \<le> real n * K"
nipkow@15542
    40
using setsum_bounded[where A = "{0..<n}"]
nipkow@15542
    41
by (auto simp:real_of_nat_def)
paulson@14416
    42
nipkow@15539
    43
(* Generalize from real to some algebraic structure? *)
nipkow@15539
    44
lemma sumr_minus_one_realpow_zero [simp]:
nipkow@15539
    45
  "setsum (%i. (-1) ^ Suc i) {0..<2*n} = (0::real)"
paulson@15251
    46
by (induct "n", auto)
paulson@14416
    47
nipkow@15542
    48
(* FIXME get rid of this one! *)
paulson@14416
    49
lemma Suc_le_imp_diff_ge2:
nipkow@15539
    50
     "[|\<forall>n \<ge> N. f (Suc n) = 0; Suc N \<le> m|] ==> setsum f {m..<n} = 0"
nipkow@15539
    51
apply (rule setsum_0')
paulson@14416
    52
apply (case_tac "n", auto)
nipkow@15539
    53
apply(erule_tac x = "a - 1" in allE)
nipkow@15539
    54
apply (simp split:nat_diff_split)
paulson@14416
    55
done
paulson@14416
    56
nipkow@15539
    57
(* FIXME this is an awful lemma! *)
nipkow@15539
    58
lemma sumr_one_lb_realpow_zero [simp]:
nipkow@15539
    59
  "(\<Sum>n=Suc 0..<n. f(n) * (0::real) ^ n) = 0"
paulson@15251
    60
apply (induct "n")
paulson@14416
    61
apply (case_tac [2] "n", auto)
paulson@14416
    62
done
paulson@14416
    63
nipkow@15539
    64
(* FIXME a bit specialized for [simp]! *)
paulson@14416
    65
lemma sumr_group [simp]:
nipkow@15539
    66
     "(\<Sum>m=0..<n::nat. setsum f {m * k ..< m*k + k}) = setsum f {0 ..< n * k}"
nipkow@15539
    67
apply (subgoal_tac "k = 0 | 0 < k", auto simp:setsum_0')
paulson@15251
    68
apply (induct "n")
nipkow@15539
    69
apply (simp_all add: setsum_add_nat_ivl add_commute)
paulson@14416
    70
done
nipkow@15539
    71
paulson@14416
    72
paulson@14416
    73
subsection{* Infinite Sums, by the Properties of Limits*}
paulson@14416
    74
paulson@14416
    75
(*----------------------
paulson@14416
    76
   suminf is the sum   
paulson@14416
    77
 ---------------------*)
paulson@14416
    78
lemma sums_summable: "f sums l ==> summable f"
paulson@14416
    79
by (simp add: sums_def summable_def, blast)
paulson@14416
    80
paulson@14416
    81
lemma summable_sums: "summable f ==> f sums (suminf f)"
paulson@14416
    82
apply (simp add: summable_def suminf_def)
paulson@14416
    83
apply (blast intro: someI2)
paulson@14416
    84
done
paulson@14416
    85
paulson@14416
    86
lemma summable_sumr_LIMSEQ_suminf: 
nipkow@15539
    87
     "summable f ==> (%n. setsum f {0..<n}) ----> (suminf f)"
paulson@14416
    88
apply (simp add: summable_def suminf_def sums_def)
paulson@14416
    89
apply (blast intro: someI2)
paulson@14416
    90
done
paulson@14416
    91
paulson@14416
    92
(*-------------------
paulson@14416
    93
    sum is unique                    
paulson@14416
    94
 ------------------*)
paulson@14416
    95
lemma sums_unique: "f sums s ==> (s = suminf f)"
paulson@14416
    96
apply (frule sums_summable [THEN summable_sums])
paulson@14416
    97
apply (auto intro!: LIMSEQ_unique simp add: sums_def)
paulson@14416
    98
done
paulson@14416
    99
paulson@14416
   100
lemma series_zero: 
nipkow@15539
   101
     "(\<forall>m. n \<le> m --> f(m) = 0) ==> f sums (setsum f {0..<n})"
nipkow@15537
   102
apply (simp add: sums_def LIMSEQ_def diff_minus[symmetric], safe)
paulson@14416
   103
apply (rule_tac x = n in exI)
nipkow@15542
   104
apply (clarsimp simp add:setsum_diff[symmetric] cong:setsum_ivl_cong)
paulson@14416
   105
done
paulson@14416
   106
nipkow@15539
   107
paulson@14416
   108
lemma sums_mult: "x sums x0 ==> (%n. c * x(n)) sums (c * x0)"
nipkow@15536
   109
by (auto simp add: sums_def setsum_mult [symmetric]
paulson@14416
   110
         intro!: LIMSEQ_mult intro: LIMSEQ_const)
paulson@14416
   111
paulson@14416
   112
lemma sums_divide: "x sums x' ==> (%n. x(n)/c) sums (x'/c)"
paulson@14416
   113
by (simp add: real_divide_def sums_mult mult_commute [of _ "inverse c"])
paulson@14416
   114
paulson@14416
   115
lemma sums_diff: "[| x sums x0; y sums y0 |] ==> (%n. x n - y n) sums (x0-y0)"
nipkow@15536
   116
by (auto simp add: sums_def setsum_subtractf intro: LIMSEQ_diff)
paulson@14416
   117
paulson@14416
   118
lemma suminf_mult: "summable f ==> suminf f * c = suminf(%n. f n * c)"
paulson@14416
   119
by (auto intro!: sums_unique sums_mult summable_sums simp add: mult_commute)
paulson@14416
   120
paulson@14416
   121
lemma suminf_mult2: "summable f ==> c * suminf f  = suminf(%n. c * f n)"
paulson@14416
   122
by (auto intro!: sums_unique sums_mult summable_sums)
paulson@14416
   123
paulson@14416
   124
lemma suminf_diff:
paulson@14416
   125
     "[| summable f; summable g |]   
paulson@14416
   126
      ==> suminf f - suminf g  = suminf(%n. f n - g n)"
paulson@14416
   127
by (auto intro!: sums_diff sums_unique summable_sums)
paulson@14416
   128
paulson@14416
   129
lemma sums_minus: "x sums x0 ==> (%n. - x n) sums - x0"
nipkow@15536
   130
by (auto simp add: sums_def intro!: LIMSEQ_minus simp add: setsum_negf)
paulson@14416
   131
paulson@14416
   132
lemma sums_group:
nipkow@15539
   133
     "[|summable f; 0 < k |] ==> (%n. setsum f {n*k..<n*k+k}) sums (suminf f)"
paulson@14416
   134
apply (drule summable_sums)
paulson@14416
   135
apply (auto simp add: sums_def LIMSEQ_def)
paulson@14416
   136
apply (drule_tac x = r in spec, safe)
paulson@14416
   137
apply (rule_tac x = no in exI, safe)
paulson@14416
   138
apply (drule_tac x = "n*k" in spec)
paulson@14416
   139
apply (auto dest!: not_leE)
paulson@14416
   140
apply (drule_tac j = no in less_le_trans, auto)
paulson@14416
   141
done
paulson@14416
   142
paulson@14416
   143
lemma sumr_pos_lt_pair_lemma:
nipkow@15539
   144
  "[|\<forall>d. - f (n + (d + d)) < (f (Suc (n + (d + d))) :: real) |]
nipkow@15539
   145
   ==> setsum f {0..<n+Suc(Suc 0)} \<le> setsum f {0..<Suc(Suc 0) * Suc no + n}"
paulson@15251
   146
apply (induct "no", auto)
paulson@15251
   147
apply (drule_tac x = "Suc no" in spec)
nipkow@15539
   148
apply (simp add: add_ac)
paulson@14416
   149
done
paulson@10751
   150
paulson@10751
   151
paulson@14416
   152
lemma sumr_pos_lt_pair:
paulson@15234
   153
     "[|summable f; 
paulson@15234
   154
        \<forall>d. 0 < (f(n + (Suc(Suc 0) * d))) + f(n + ((Suc(Suc 0) * d) + 1))|]  
nipkow@15539
   155
      ==> setsum f {0..<n} < suminf f"
paulson@14416
   156
apply (drule summable_sums)
paulson@14416
   157
apply (auto simp add: sums_def LIMSEQ_def)
paulson@15234
   158
apply (drule_tac x = "f (n) + f (n + 1)" in spec)
paulson@15085
   159
apply (auto iff: real_0_less_add_iff)
paulson@15085
   160
   --{*legacy proof: not necessarily better!*}
paulson@14416
   161
apply (rule_tac [2] ccontr, drule_tac [2] linorder_not_less [THEN iffD1])
paulson@14416
   162
apply (frule_tac [2] no=no in sumr_pos_lt_pair_lemma) 
paulson@14416
   163
apply (drule_tac x = 0 in spec, simp)
paulson@14416
   164
apply (rotate_tac 1, drule_tac x = "Suc (Suc 0) * (Suc no) + n" in spec)
paulson@14416
   165
apply (safe, simp)
nipkow@15539
   166
apply (subgoal_tac "suminf f + (f (n) + f (n + 1)) \<le>
nipkow@15539
   167
 setsum f {0 ..< Suc (Suc 0) * (Suc no) + n}")
nipkow@15539
   168
apply (rule_tac [2] y = "setsum f {0..<n+ Suc (Suc 0)}" in order_trans)
paulson@14416
   169
prefer 3 apply assumption
nipkow@15539
   170
apply (rule_tac [2] y = "setsum f {0..<n} + (f (n) + f (n + 1))" in order_trans)
paulson@14416
   171
apply simp_all 
nipkow@15539
   172
apply (subgoal_tac "suminf f \<le> setsum f {0..< Suc (Suc 0) * (Suc no) + n}")
paulson@14416
   173
apply (rule_tac [2] y = "suminf f + (f (n) + f (n + 1))" in order_trans)
nipkow@15539
   174
prefer 3 apply simp
paulson@14416
   175
apply (drule_tac [2] x = 0 in spec)
paulson@14416
   176
 prefer 2 apply simp 
nipkow@15539
   177
apply (subgoal_tac "0 \<le> setsum f {0 ..< Suc (Suc 0) * Suc no + n} + - suminf f")
nipkow@15539
   178
apply (simp add: abs_if)
paulson@14416
   179
apply (auto simp add: linorder_not_less [symmetric])
paulson@14416
   180
done
paulson@14416
   181
paulson@15085
   182
text{*A summable series of positive terms has limit that is at least as
paulson@15085
   183
great as any partial sum.*}
paulson@14416
   184
paulson@14416
   185
lemma series_pos_le: 
nipkow@15539
   186
     "[| summable f; \<forall>m \<ge> n. 0 \<le> f(m) |] ==> setsum f {0..<n} \<le> suminf f"
paulson@14416
   187
apply (drule summable_sums)
paulson@14416
   188
apply (simp add: sums_def)
nipkow@15539
   189
apply (cut_tac k = "setsum f {0..<n}" in LIMSEQ_const)
nipkow@15539
   190
apply (erule LIMSEQ_le, blast)
nipkow@15539
   191
apply (rule_tac x = n in exI, clarify)
nipkow@15539
   192
apply (rule setsum_mono2)
nipkow@15539
   193
apply auto
paulson@14416
   194
done
paulson@14416
   195
paulson@14416
   196
lemma series_pos_less:
nipkow@15539
   197
     "[| summable f; \<forall>m \<ge> n. 0 < f(m) |] ==> setsum f {0..<n} < suminf f"
nipkow@15539
   198
apply (rule_tac y = "setsum f {0..<Suc n}" in order_less_le_trans)
paulson@14416
   199
apply (rule_tac [2] series_pos_le, auto)
paulson@14416
   200
apply (drule_tac x = m in spec, auto)
paulson@14416
   201
done
paulson@14416
   202
paulson@15085
   203
text{*Sum of a geometric progression.*}
paulson@14416
   204
nipkow@15539
   205
lemma sumr_geometric:
nipkow@15539
   206
 "x ~= 1 ==> (\<Sum>i=0..<n. x ^ i) = (x ^ n - 1) / (x - 1::real)"
paulson@15251
   207
apply (induct "n", auto)
paulson@14416
   208
apply (rule_tac c1 = "x - 1" in real_mult_right_cancel [THEN iffD1])
nipkow@15539
   209
apply (auto simp add: mult_assoc left_distrib)
paulson@15234
   210
apply (simp add: right_distrib diff_minus mult_commute)
paulson@14416
   211
done
paulson@14416
   212
paulson@14416
   213
lemma geometric_sums: "abs(x) < 1 ==> (%n. x ^ n) sums (1/(1 - x))"
paulson@14416
   214
apply (case_tac "x = 1")
paulson@15234
   215
apply (auto dest!: LIMSEQ_rabs_realpow_zero2 
paulson@15234
   216
        simp add: sumr_geometric sums_def diff_minus add_divide_distrib)
paulson@14416
   217
apply (subgoal_tac "1 / (1 + -x) = 0/ (x - 1) + - 1/ (x - 1) ")
paulson@14416
   218
apply (erule ssubst)
paulson@14416
   219
apply (rule LIMSEQ_add, rule LIMSEQ_divide)
paulson@15234
   220
apply (auto intro: LIMSEQ_const simp add: diff_minus minus_divide_right LIMSEQ_rabs_realpow_zero2)
paulson@14416
   221
done
paulson@14416
   222
paulson@15085
   223
text{*Cauchy-type criterion for convergence of series (c.f. Harrison)*}
paulson@15085
   224
nipkow@15539
   225
lemma summable_convergent_sumr_iff:
nipkow@15539
   226
 "summable f = convergent (%n. setsum f {0..<n})"
paulson@14416
   227
by (simp add: summable_def sums_def convergent_def)
paulson@14416
   228
paulson@14416
   229
lemma summable_Cauchy:
paulson@14416
   230
     "summable f =  
nipkow@15539
   231
      (\<forall>e > 0. \<exists>N. \<forall>m \<ge> N. \<forall>n. abs(setsum f {m..<n}) < e)"
nipkow@15537
   232
apply (auto simp add: summable_convergent_sumr_iff Cauchy_convergent_iff [symmetric] Cauchy_def diff_minus[symmetric])
nipkow@15539
   233
apply (drule_tac [!] spec, auto)
paulson@14416
   234
apply (rule_tac x = M in exI)
paulson@14416
   235
apply (rule_tac [2] x = N in exI, auto)
paulson@14416
   236
apply (cut_tac [!] m = m and n = n in less_linear, auto)
paulson@14416
   237
apply (frule le_less_trans [THEN less_imp_le], assumption)
nipkow@15360
   238
apply (drule_tac x = n in spec, simp)
paulson@14416
   239
apply (drule_tac x = m in spec)
nipkow@15539
   240
apply(simp add: setsum_diff[symmetric])
nipkow@15537
   241
apply(subst abs_minus_commute)
nipkow@15539
   242
apply(simp add: setsum_diff[symmetric])
nipkow@15539
   243
apply(simp add: setsum_diff[symmetric])
paulson@14416
   244
done
paulson@14416
   245
paulson@15085
   246
text{*Comparison test*}
paulson@15085
   247
paulson@14416
   248
lemma summable_comparison_test:
nipkow@15360
   249
     "[| \<exists>N. \<forall>n \<ge> N. abs(f n) \<le> g n; summable g |] ==> summable f"
paulson@14416
   250
apply (auto simp add: summable_Cauchy)
paulson@14416
   251
apply (drule spec, auto)
paulson@14416
   252
apply (rule_tac x = "N + Na" in exI, auto)
paulson@14416
   253
apply (rotate_tac 2)
paulson@14416
   254
apply (drule_tac x = m in spec)
paulson@14416
   255
apply (auto, rotate_tac 2, drule_tac x = n in spec)
nipkow@15539
   256
apply (rule_tac y = "\<Sum>k=m..<n. abs(f k)" in order_le_less_trans)
nipkow@15536
   257
apply (rule setsum_abs)
nipkow@15539
   258
apply (rule_tac y = "setsum g {m..<n}" in order_le_less_trans)
nipkow@15539
   259
apply (auto intro: setsum_mono simp add: abs_interval_iff)
paulson@14416
   260
done
paulson@14416
   261
paulson@14416
   262
lemma summable_rabs_comparison_test:
nipkow@15360
   263
     "[| \<exists>N. \<forall>n \<ge> N. abs(f n) \<le> g n; summable g |] 
paulson@14416
   264
      ==> summable (%k. abs (f k))"
paulson@14416
   265
apply (rule summable_comparison_test)
paulson@14416
   266
apply (auto simp add: abs_idempotent)
paulson@14416
   267
done
paulson@14416
   268
paulson@15085
   269
text{*Limit comparison property for series (c.f. jrh)*}
paulson@15085
   270
paulson@14416
   271
lemma summable_le:
paulson@14416
   272
     "[|\<forall>n. f n \<le> g n; summable f; summable g |] ==> suminf f \<le> suminf g"
paulson@14416
   273
apply (drule summable_sums)+
paulson@14416
   274
apply (auto intro!: LIMSEQ_le simp add: sums_def)
paulson@14416
   275
apply (rule exI)
nipkow@15539
   276
apply (auto intro!: setsum_mono)
paulson@14416
   277
done
paulson@14416
   278
paulson@14416
   279
lemma summable_le2:
paulson@14416
   280
     "[|\<forall>n. abs(f n) \<le> g n; summable g |]  
paulson@14416
   281
      ==> summable f & suminf f \<le> suminf g"
paulson@14416
   282
apply (auto intro: summable_comparison_test intro!: summable_le)
paulson@14416
   283
apply (simp add: abs_le_interval_iff)
paulson@14416
   284
done
paulson@14416
   285
paulson@15085
   286
text{*Absolute convergence imples normal convergence*}
paulson@14416
   287
lemma summable_rabs_cancel: "summable (%n. abs (f n)) ==> summable f"
nipkow@15536
   288
apply (auto simp add: summable_Cauchy)
paulson@14416
   289
apply (drule spec, auto)
paulson@14416
   290
apply (rule_tac x = N in exI, auto)
paulson@14416
   291
apply (drule spec, auto)
nipkow@15539
   292
apply (rule_tac y = "\<Sum>n=m..<n. abs(f n)" in order_le_less_trans)
nipkow@15536
   293
apply (auto)
paulson@14416
   294
done
paulson@14416
   295
paulson@15085
   296
text{*Absolute convergence of series*}
paulson@14416
   297
lemma summable_rabs:
paulson@14416
   298
     "summable (%n. abs (f n)) ==> abs(suminf f) \<le> suminf (%n. abs(f n))"
nipkow@15536
   299
by (auto intro: LIMSEQ_le LIMSEQ_imp_rabs summable_rabs_cancel summable_sumr_LIMSEQ_suminf)
paulson@14416
   300
paulson@14416
   301
paulson@14416
   302
subsection{* The Ratio Test*}
paulson@14416
   303
paulson@14416
   304
lemma rabs_ratiotest_lemma: "[| c \<le> 0; abs x \<le> c * abs y |] ==> x = (0::real)"
paulson@14416
   305
apply (drule order_le_imp_less_or_eq, auto)
paulson@14416
   306
apply (subgoal_tac "0 \<le> c * abs y")
paulson@14416
   307
apply (simp add: zero_le_mult_iff, arith)
paulson@14416
   308
done
paulson@14416
   309
paulson@14416
   310
lemma le_Suc_ex: "(k::nat) \<le> l ==> (\<exists>n. l = k + n)"
paulson@14416
   311
apply (drule le_imp_less_or_eq)
paulson@14416
   312
apply (auto dest: less_imp_Suc_add)
paulson@14416
   313
done
paulson@14416
   314
paulson@14416
   315
lemma le_Suc_ex_iff: "((k::nat) \<le> l) = (\<exists>n. l = k + n)"
paulson@14416
   316
by (auto simp add: le_Suc_ex)
paulson@14416
   317
paulson@14416
   318
(*All this trouble just to get 0<c *)
paulson@14416
   319
lemma ratio_test_lemma2:
nipkow@15360
   320
     "[| \<forall>n \<ge> N. abs(f(Suc n)) \<le> c*abs(f n) |]  
paulson@14416
   321
      ==> 0 < c | summable f"
paulson@14416
   322
apply (simp (no_asm) add: linorder_not_le [symmetric])
paulson@14416
   323
apply (simp add: summable_Cauchy)
paulson@14416
   324
apply (safe, subgoal_tac "\<forall>n. N \<le> n --> f (Suc n) = 0")
paulson@14416
   325
prefer 2 apply (blast intro: rabs_ratiotest_lemma)
paulson@14416
   326
apply (rule_tac x = "Suc N" in exI, clarify)
paulson@14416
   327
apply (drule_tac n=n in Suc_le_imp_diff_ge2, auto) 
paulson@14416
   328
done
paulson@14416
   329
paulson@14416
   330
lemma ratio_test:
nipkow@15360
   331
     "[| c < 1; \<forall>n \<ge> N. abs(f(Suc n)) \<le> c*abs(f n) |]  
paulson@14416
   332
      ==> summable f"
paulson@14416
   333
apply (frule ratio_test_lemma2, auto)
paulson@15234
   334
apply (rule_tac g = "%n. (abs (f N) / (c ^ N))*c ^ n" 
paulson@15234
   335
       in summable_comparison_test)
paulson@14416
   336
apply (rule_tac x = N in exI, safe)
paulson@14416
   337
apply (drule le_Suc_ex_iff [THEN iffD1])
paulson@14416
   338
apply (auto simp add: power_add realpow_not_zero)
nipkow@15539
   339
apply (induct_tac "na", auto)
paulson@14416
   340
apply (rule_tac y = "c*abs (f (N + n))" in order_trans)
paulson@14416
   341
apply (auto intro: mult_right_mono simp add: summable_def)
paulson@14416
   342
apply (simp add: mult_ac)
paulson@15234
   343
apply (rule_tac x = "abs (f N) * (1/ (1 - c)) / (c ^ N)" in exI)
paulson@15234
   344
apply (rule sums_divide) 
paulson@15234
   345
apply (rule sums_mult) 
paulson@15234
   346
apply (auto intro!: geometric_sums)
paulson@14416
   347
done
paulson@14416
   348
paulson@14416
   349
paulson@15085
   350
text{*Differentiation of finite sum*}
paulson@14416
   351
paulson@14416
   352
lemma DERIV_sumr [rule_format (no_asm)]:
paulson@14416
   353
     "(\<forall>r. m \<le> r & r < (m + n) --> DERIV (%x. f r x) x :> (f' r x))  
nipkow@15539
   354
      --> DERIV (%x. \<Sum>n=m..<n::nat. f n x) x :> (\<Sum>r=m..<n. f' r x)"
paulson@15251
   355
apply (induct "n")
paulson@14416
   356
apply (auto intro: DERIV_add)
paulson@14416
   357
done
paulson@14416
   358
paulson@14416
   359
ML
paulson@14416
   360
{*
paulson@14416
   361
val sums_def = thm"sums_def";
paulson@14416
   362
val summable_def = thm"summable_def";
paulson@14416
   363
val suminf_def = thm"suminf_def";
paulson@14416
   364
paulson@14416
   365
val sumr_minus_one_realpow_zero = thm "sumr_minus_one_realpow_zero";
paulson@14416
   366
val Suc_le_imp_diff_ge2 = thm "Suc_le_imp_diff_ge2";
paulson@14416
   367
val sumr_one_lb_realpow_zero = thm "sumr_one_lb_realpow_zero";
paulson@14416
   368
val sumr_group = thm "sumr_group";
paulson@14416
   369
val sums_summable = thm "sums_summable";
paulson@14416
   370
val summable_sums = thm "summable_sums";
paulson@14416
   371
val summable_sumr_LIMSEQ_suminf = thm "summable_sumr_LIMSEQ_suminf";
paulson@14416
   372
val sums_unique = thm "sums_unique";
paulson@14416
   373
val series_zero = thm "series_zero";
paulson@14416
   374
val sums_mult = thm "sums_mult";
paulson@14416
   375
val sums_divide = thm "sums_divide";
paulson@14416
   376
val sums_diff = thm "sums_diff";
paulson@14416
   377
val suminf_mult = thm "suminf_mult";
paulson@14416
   378
val suminf_mult2 = thm "suminf_mult2";
paulson@14416
   379
val suminf_diff = thm "suminf_diff";
paulson@14416
   380
val sums_minus = thm "sums_minus";
paulson@14416
   381
val sums_group = thm "sums_group";
paulson@14416
   382
val sumr_pos_lt_pair_lemma = thm "sumr_pos_lt_pair_lemma";
paulson@14416
   383
val sumr_pos_lt_pair = thm "sumr_pos_lt_pair";
paulson@14416
   384
val series_pos_le = thm "series_pos_le";
paulson@14416
   385
val series_pos_less = thm "series_pos_less";
paulson@14416
   386
val sumr_geometric = thm "sumr_geometric";
paulson@14416
   387
val geometric_sums = thm "geometric_sums";
paulson@14416
   388
val summable_convergent_sumr_iff = thm "summable_convergent_sumr_iff";
paulson@14416
   389
val summable_Cauchy = thm "summable_Cauchy";
paulson@14416
   390
val summable_comparison_test = thm "summable_comparison_test";
paulson@14416
   391
val summable_rabs_comparison_test = thm "summable_rabs_comparison_test";
paulson@14416
   392
val summable_le = thm "summable_le";
paulson@14416
   393
val summable_le2 = thm "summable_le2";
paulson@14416
   394
val summable_rabs_cancel = thm "summable_rabs_cancel";
paulson@14416
   395
val summable_rabs = thm "summable_rabs";
paulson@14416
   396
val rabs_ratiotest_lemma = thm "rabs_ratiotest_lemma";
paulson@14416
   397
val le_Suc_ex = thm "le_Suc_ex";
paulson@14416
   398
val le_Suc_ex_iff = thm "le_Suc_ex_iff";
paulson@14416
   399
val ratio_test_lemma2 = thm "ratio_test_lemma2";
paulson@14416
   400
val ratio_test = thm "ratio_test";
paulson@14416
   401
val DERIV_sumr = thm "DERIV_sumr";
paulson@14416
   402
*}
paulson@14416
   403
paulson@14416
   404
end