src/HOL/Hyperreal/Series.thy
author nipkow
Mon Aug 16 14:22:27 2004 +0200 (2004-08-16)
changeset 15131 c69542757a4d
parent 15085 5693a977a767
child 15140 322485b816ac
permissions -rw-r--r--
New theory header syntax.
     1 (*  Title       : Series.thy
     2     Author      : Jacques D. Fleuriot
     3     Copyright   : 1998  University of Cambridge
     4 
     5 Converted to Isar and polished by lcp
     6 *) 
     7 
     8 header{*Finite Summation and Infinite Series*}
     9 
    10 theory Series
    11 import SEQ Lim
    12 begin
    13 
    14 syntax sumr :: "[nat,nat,(nat=>real)] => real"
    15 translations
    16   "sumr m n f" => "setsum (f::nat=>real) (atLeastLessThan m n)"
    17 
    18 constdefs
    19    sums  :: "[nat=>real,real] => bool"     (infixr "sums" 80)
    20    "f sums s  == (%n. sumr 0 n f) ----> s"
    21 
    22    summable :: "(nat=>real) => bool"
    23    "summable f == (\<exists>s. f sums s)"
    24 
    25    suminf   :: "(nat=>real) => real"
    26    "suminf f == (@s. f sums s)"
    27 
    28 
    29 lemma sumr_Suc [simp]:
    30      "sumr m (Suc n) f = (if n < m then 0 else sumr m n f + f(n))"
    31 by (simp add: atLeastLessThanSuc)
    32 
    33 lemma sumr_add: "sumr m n f + sumr m n g = sumr m n (%n. f n + g n)"
    34 by (simp add: setsum_addf)
    35 
    36 lemma sumr_mult: "r * sumr m n (f::nat=>real) = sumr m n (%n. r * f n)"
    37 by (simp add: setsum_mult)
    38 
    39 lemma sumr_split_add [rule_format]:
    40      "n < p --> sumr 0 n f + sumr n p f = sumr 0 p (f::nat=>real)"
    41 apply (induct_tac "p", auto)
    42 apply (rename_tac k) 
    43 apply (subgoal_tac "n=k", auto) 
    44 done
    45 
    46 lemma sumr_split_add_minus:
    47      "n < p ==> sumr 0 p f + - sumr 0 n f = sumr n p (f::nat=>real)"
    48 apply (drule_tac f1 = f in sumr_split_add [symmetric])
    49 apply (simp add: add_ac)
    50 done
    51 
    52 lemma sumr_rabs: "abs(sumr m n  (f::nat=>real)) \<le> sumr m n (%i. abs(f i))"
    53 by (simp add: setsum_abs)
    54 
    55 lemma sumr_rabs_ge_zero [iff]: "0 \<le> sumr m n (%n. abs (f n))"
    56 by (simp add: setsum_abs_ge_zero)
    57 
    58 text{*Just a congruence rule*}
    59 lemma sumr_fun_eq:
    60      "(\<forall>r. m \<le> r & r < n --> f r = g r) ==> sumr m n f = sumr m n g"
    61 by (auto intro: setsum_cong) 
    62 
    63 lemma sumr_diff_mult_const: "sumr 0 n f - (real n*r) = sumr 0 n (%i. f i - r)"
    64 by (simp add: diff_minus setsum_addf real_of_nat_def)
    65 
    66 lemma sumr_less_bounds_zero [simp]: "n < m ==> sumr m n f = 0"
    67 by (simp add: atLeastLessThan_empty)
    68 
    69 lemma sumr_minus: "sumr m n (%i. - f i) = - sumr m n f"
    70 by (simp add: Finite_Set.setsum_negf)
    71 
    72 lemma sumr_shift_bounds: "sumr (m+k) (n+k) f = sumr m n (%i. f(i + k))"
    73 by (induct_tac "n", auto)
    74 
    75 lemma sumr_minus_one_realpow_zero [simp]: "sumr 0 (2*n) (%i. (-1) ^ Suc i) = 0"
    76 by (induct_tac "n", auto)
    77 
    78 lemma sumr_interval_const [rule_format (no_asm)]:
    79      "(\<forall>n. m \<le> Suc n --> f n = r) --> m \<le> k --> sumr m k f = (real(k-m) * r)"
    80 apply (induct_tac "k", auto) 
    81 apply (drule_tac x = n in spec)
    82 apply (auto dest!: le_imp_less_or_eq)
    83 apply (simp add: left_distrib real_of_nat_Suc split: nat_diff_split)
    84 done
    85 
    86 lemma sumr_interval_const2 [rule_format (no_asm)]:
    87      "(\<forall>n. m \<le> n --> f n = r) --> m \<le> k  
    88       --> sumr m k f = (real (k - m) * r)"
    89 apply (induct_tac "k", auto) 
    90 apply (drule_tac x = n in spec)
    91 apply (auto dest!: le_imp_less_or_eq)
    92 apply (simp add: left_distrib real_of_nat_Suc split: nat_diff_split)
    93 done
    94 
    95 
    96 lemma sumr_le [rule_format (no_asm)]:
    97      "(\<forall>n. m \<le> n --> 0 \<le> f n) --> m < k --> sumr 0 m f \<le> sumr 0 k f"
    98 apply (induct_tac "k")
    99 apply (auto simp add: less_Suc_eq_le)
   100 apply (drule_tac [!] x = n in spec, safe)
   101 apply (drule le_imp_less_or_eq, safe)
   102 apply (arith) 
   103 apply (drule_tac a = "sumr 0 m f" in order_refl [THEN add_mono], auto)
   104 done
   105 
   106 lemma sumr_le2 [rule_format (no_asm)]:
   107      "(\<forall>r. m \<le> r & r < n --> f r \<le> g r) --> sumr m n f \<le> sumr m n g"
   108 apply (induct_tac "n")
   109 apply (auto intro: add_mono simp add: le_def)
   110 done
   111 
   112 lemma sumr_ge_zero [rule_format (no_asm)]: "(\<forall>n. 0 \<le> f n) --> 0 \<le> sumr m n f"
   113 apply (induct_tac "n", auto)
   114 apply (drule_tac x = n in spec, arith)
   115 done
   116 
   117 lemma sumr_ge_zero2 [rule_format (no_asm)]:
   118      "(\<forall>n. m \<le> n --> 0 \<le> f n) --> 0 \<le> sumr m n f"
   119 apply (induct_tac "n", auto)
   120 apply (drule_tac x = n in spec, arith)
   121 done
   122 
   123 lemma rabs_sumr_rabs_cancel [simp]:
   124      "abs (sumr m n (%n. abs (f n))) = (sumr m n (%n. abs (f n)))"
   125 apply (induct_tac "n")
   126 apply (auto, arith)
   127 done
   128 
   129 lemma sumr_zero [rule_format]:
   130      "\<forall>n. N \<le> n --> f n = 0 ==> N \<le> m --> sumr m n f = 0"
   131 by (induct_tac "n", auto)
   132 
   133 lemma Suc_le_imp_diff_ge2:
   134      "[|\<forall>n. N \<le> n --> f (Suc n) = 0; Suc N \<le> m|] ==> sumr m n f = 0"
   135 apply (rule sumr_zero) 
   136 apply (case_tac "n", auto)
   137 done
   138 
   139 lemma sumr_one_lb_realpow_zero [simp]: "sumr (Suc 0) n (%n. f(n) * 0 ^ n) = 0"
   140 apply (induct_tac "n")
   141 apply (case_tac [2] "n", auto)
   142 done
   143 
   144 lemma sumr_diff: "sumr m n f - sumr m n g = sumr m n (%n. f n - g n)"
   145 by (simp add: diff_minus sumr_add [symmetric] sumr_minus)
   146 
   147 lemma sumr_subst [rule_format (no_asm)]:
   148      "(\<forall>p. m \<le> p & p < m+n --> (f p = g p)) --> sumr m n f = sumr m n g"
   149 by (induct_tac "n", auto)
   150 
   151 lemma sumr_bound [rule_format (no_asm)]:
   152      "(\<forall>p. m \<le> p & p < m + n --> (f(p) \<le> K))  
   153       --> (sumr m (m + n) f \<le> (real n * K))"
   154 apply (induct_tac "n")
   155 apply (auto intro: add_mono simp add: left_distrib real_of_nat_Suc)
   156 done
   157 
   158 lemma sumr_bound2 [rule_format (no_asm)]:
   159      "(\<forall>p. 0 \<le> p & p < n --> (f(p) \<le> K))  
   160       --> (sumr 0 n f \<le> (real n * K))"
   161 apply (induct_tac "n")
   162 apply (auto intro: add_mono simp add: left_distrib real_of_nat_Suc add_commute)
   163 done
   164 
   165 lemma sumr_group [simp]:
   166      "sumr 0 n (%m. sumr (m * k) (m*k + k) f) = sumr 0 (n * k) f"
   167 apply (subgoal_tac "k = 0 | 0 < k", auto)
   168 apply (induct_tac "n")
   169 apply (simp_all add: sumr_split_add add_commute)
   170 done
   171 
   172 subsection{* Infinite Sums, by the Properties of Limits*}
   173 
   174 (*----------------------
   175    suminf is the sum   
   176  ---------------------*)
   177 lemma sums_summable: "f sums l ==> summable f"
   178 by (simp add: sums_def summable_def, blast)
   179 
   180 lemma summable_sums: "summable f ==> f sums (suminf f)"
   181 apply (simp add: summable_def suminf_def)
   182 apply (blast intro: someI2)
   183 done
   184 
   185 lemma summable_sumr_LIMSEQ_suminf: 
   186      "summable f ==> (%n. sumr 0 n f) ----> (suminf f)"
   187 apply (simp add: summable_def suminf_def sums_def)
   188 apply (blast intro: someI2)
   189 done
   190 
   191 (*-------------------
   192     sum is unique                    
   193  ------------------*)
   194 lemma sums_unique: "f sums s ==> (s = suminf f)"
   195 apply (frule sums_summable [THEN summable_sums])
   196 apply (auto intro!: LIMSEQ_unique simp add: sums_def)
   197 done
   198 
   199 (*
   200 Goalw [sums_def,LIMSEQ_def] 
   201      "(\<forall>m. n \<le> Suc m --> f(m) = 0) ==> f sums (sumr 0 n f)"
   202 by safe
   203 by (res_inst_tac [("x","n")] exI 1);
   204 by (safe THEN ftac le_imp_less_or_eq 1)
   205 by safe
   206 by (dres_inst_tac [("f","f")] sumr_split_add_minus 1);
   207 by (ALLGOALS (Asm_simp_tac));
   208 by (dtac (conjI RS sumr_interval_const) 1);
   209 by Auto_tac
   210 qed "series_zero";
   211 next one was called series_zero2
   212 **********************)
   213 
   214 lemma series_zero: 
   215      "(\<forall>m. n \<le> m --> f(m) = 0) ==> f sums (sumr 0 n f)"
   216 apply (simp add: sums_def LIMSEQ_def, safe)
   217 apply (rule_tac x = n in exI)
   218 apply (safe, frule le_imp_less_or_eq, safe)
   219 apply (drule_tac f = f in sumr_split_add_minus, simp_all)
   220 apply (drule sumr_interval_const2, auto)
   221 done
   222 
   223 lemma sums_mult: "x sums x0 ==> (%n. c * x(n)) sums (c * x0)"
   224 by (auto simp add: sums_def sumr_mult [symmetric]
   225          intro!: LIMSEQ_mult intro: LIMSEQ_const)
   226 
   227 lemma sums_divide: "x sums x' ==> (%n. x(n)/c) sums (x'/c)"
   228 by (simp add: real_divide_def sums_mult mult_commute [of _ "inverse c"])
   229 
   230 lemma sums_diff: "[| x sums x0; y sums y0 |] ==> (%n. x n - y n) sums (x0-y0)"
   231 by (auto simp add: sums_def sumr_diff [symmetric] intro: LIMSEQ_diff)
   232 
   233 lemma suminf_mult: "summable f ==> suminf f * c = suminf(%n. f n * c)"
   234 by (auto intro!: sums_unique sums_mult summable_sums simp add: mult_commute)
   235 
   236 lemma suminf_mult2: "summable f ==> c * suminf f  = suminf(%n. c * f n)"
   237 by (auto intro!: sums_unique sums_mult summable_sums)
   238 
   239 lemma suminf_diff:
   240      "[| summable f; summable g |]   
   241       ==> suminf f - suminf g  = suminf(%n. f n - g n)"
   242 by (auto intro!: sums_diff sums_unique summable_sums)
   243 
   244 lemma sums_minus: "x sums x0 ==> (%n. - x n) sums - x0"
   245 by (auto simp add: sums_def intro!: LIMSEQ_minus simp add: sumr_minus)
   246 
   247 lemma sums_group:
   248      "[|summable f; 0 < k |] ==> (%n. sumr (n*k) (n*k + k) f) sums (suminf f)"
   249 apply (drule summable_sums)
   250 apply (auto simp add: sums_def LIMSEQ_def)
   251 apply (drule_tac x = r in spec, safe)
   252 apply (rule_tac x = no in exI, safe)
   253 apply (drule_tac x = "n*k" in spec)
   254 apply (auto dest!: not_leE)
   255 apply (drule_tac j = no in less_le_trans, auto)
   256 done
   257 
   258 lemma sumr_pos_lt_pair_lemma:
   259      "[|\<forall>d. - f (n + (d + d)) < f (Suc (n + (d + d)))|]
   260       ==> sumr 0 (n + Suc (Suc 0)) f \<le> sumr 0 (Suc (Suc 0) * Suc no + n) f"
   261 apply (induct_tac "no", simp)
   262 apply (rule_tac y = "sumr 0 (Suc (Suc 0) * (Suc na) +n) f" in order_trans)
   263 apply assumption
   264 apply (drule_tac x = "Suc na" in spec)
   265 apply (simp add: add_ac) 
   266 done
   267 
   268 
   269 lemma sumr_pos_lt_pair:
   270      "[|summable f; \<forall>d. 0 < (f(n + (Suc(Suc 0) * d))) + f(n + ((Suc(Suc 0) * d) + 1))|]  
   271       ==> sumr 0 n f < suminf f"
   272 apply (drule summable_sums)
   273 apply (auto simp add: sums_def LIMSEQ_def)
   274 apply (drule_tac x = "f (n) + f (n + 1) " in spec)
   275 apply (auto iff: real_0_less_add_iff)
   276    --{*legacy proof: not necessarily better!*}
   277 apply (rule_tac [2] ccontr, drule_tac [2] linorder_not_less [THEN iffD1])
   278 apply (frule_tac [2] no=no in sumr_pos_lt_pair_lemma) 
   279 apply (drule_tac x = 0 in spec, simp)
   280 apply (rotate_tac 1, drule_tac x = "Suc (Suc 0) * (Suc no) + n" in spec)
   281 apply (safe, simp)
   282 apply (subgoal_tac "suminf f + (f (n) + f (n + 1)) \<le> sumr 0 (Suc (Suc 0) * (Suc no) + n) f")
   283 apply (rule_tac [2] y = "sumr 0 (n+ Suc (Suc 0)) f" in order_trans)
   284 prefer 3 apply assumption
   285 apply (rule_tac [2] y = "sumr 0 n f + (f (n) + f (n + 1))" in order_trans)
   286 apply simp_all 
   287 apply (subgoal_tac "suminf f \<le> sumr 0 (Suc (Suc 0) * (Suc no) + n) f")
   288 apply (rule_tac [2] y = "suminf f + (f (n) + f (n + 1))" in order_trans)
   289 prefer 3 apply simp 
   290 apply (drule_tac [2] x = 0 in spec)
   291  prefer 2 apply simp 
   292 apply (subgoal_tac "0 \<le> sumr 0 (Suc (Suc 0) * Suc no + n) f + - suminf f")
   293 apply (simp add: abs_if) 
   294 apply (auto simp add: linorder_not_less [symmetric])
   295 done
   296 
   297 text{*A summable series of positive terms has limit that is at least as
   298 great as any partial sum.*}
   299 
   300 lemma series_pos_le: 
   301      "[| summable f; \<forall>m. n \<le> m --> 0 \<le> f(m) |] ==> sumr 0 n f \<le> suminf f"
   302 apply (drule summable_sums)
   303 apply (simp add: sums_def)
   304 apply (cut_tac k = "sumr 0 n f" in LIMSEQ_const)
   305 apply (erule LIMSEQ_le, blast) 
   306 apply (rule_tac x = n in exI, clarify) 
   307 apply (drule le_imp_less_or_eq)
   308 apply (auto intro: sumr_le)
   309 done
   310 
   311 lemma series_pos_less:
   312      "[| summable f; \<forall>m. n \<le> m --> 0 < f(m) |] ==> sumr 0 n f < suminf f"
   313 apply (rule_tac y = "sumr 0 (Suc n) f" in order_less_le_trans)
   314 apply (rule_tac [2] series_pos_le, auto)
   315 apply (drule_tac x = m in spec, auto)
   316 done
   317 
   318 text{*Sum of a geometric progression.*}
   319 
   320 lemma sumr_geometric: "x ~= 1 ==> sumr 0 n (%n. x ^ n) = (x ^ n - 1) / (x - 1)"
   321 apply (induct_tac "n", auto)
   322 apply (rule_tac c1 = "x - 1" in real_mult_right_cancel [THEN iffD1])
   323 apply (auto simp add: real_mult_assoc left_distrib)
   324 apply (simp add: right_distrib real_diff_def real_mult_commute)
   325 done
   326 
   327 lemma geometric_sums: "abs(x) < 1 ==> (%n. x ^ n) sums (1/(1 - x))"
   328 apply (case_tac "x = 1")
   329 apply (auto dest!: LIMSEQ_rabs_realpow_zero2 simp add: sumr_geometric sums_def real_diff_def add_divide_distrib)
   330 apply (subgoal_tac "1 / (1 + -x) = 0/ (x - 1) + - 1/ (x - 1) ")
   331 apply (erule ssubst)
   332 apply (rule LIMSEQ_add, rule LIMSEQ_divide)
   333 apply (auto intro: LIMSEQ_const simp add: real_diff_def minus_divide_right LIMSEQ_rabs_realpow_zero2)
   334 done
   335 
   336 text{*Cauchy-type criterion for convergence of series (c.f. Harrison)*}
   337 
   338 lemma summable_convergent_sumr_iff: "summable f = convergent (%n. sumr 0 n f)"
   339 by (simp add: summable_def sums_def convergent_def)
   340 
   341 lemma summable_Cauchy:
   342      "summable f =  
   343       (\<forall>e. 0 < e --> (\<exists>N. \<forall>m n. N \<le> m --> abs(sumr m n f) < e))"
   344 apply (auto simp add: summable_convergent_sumr_iff Cauchy_convergent_iff [symmetric] Cauchy_def)
   345 apply (drule_tac [!] spec, auto) 
   346 apply (rule_tac x = M in exI)
   347 apply (rule_tac [2] x = N in exI, auto)
   348 apply (cut_tac [!] m = m and n = n in less_linear, auto)
   349 apply (frule le_less_trans [THEN less_imp_le], assumption)
   350 apply (drule_tac x = n in spec)
   351 apply (drule_tac x = m in spec)
   352 apply (auto intro: abs_minus_add_cancel [THEN subst]
   353             simp add: sumr_split_add_minus abs_minus_add_cancel)
   354 done
   355 
   356 text{*Comparison test*}
   357 
   358 lemma summable_comparison_test:
   359      "[| \<exists>N. \<forall>n. N \<le> n --> abs(f n) \<le> g n; summable g |] ==> summable f"
   360 apply (auto simp add: summable_Cauchy)
   361 apply (drule spec, auto)
   362 apply (rule_tac x = "N + Na" in exI, auto)
   363 apply (rotate_tac 2)
   364 apply (drule_tac x = m in spec)
   365 apply (auto, rotate_tac 2, drule_tac x = n in spec)
   366 apply (rule_tac y = "sumr m n (%k. abs (f k))" in order_le_less_trans)
   367 apply (rule sumr_rabs)
   368 apply (rule_tac y = "sumr m n g" in order_le_less_trans)
   369 apply (auto intro: sumr_le2 simp add: abs_interval_iff)
   370 done
   371 
   372 lemma summable_rabs_comparison_test:
   373      "[| \<exists>N. \<forall>n. N \<le> n --> abs(f n) \<le> g n; summable g |] 
   374       ==> summable (%k. abs (f k))"
   375 apply (rule summable_comparison_test)
   376 apply (auto simp add: abs_idempotent)
   377 done
   378 
   379 text{*Limit comparison property for series (c.f. jrh)*}
   380 
   381 lemma summable_le:
   382      "[|\<forall>n. f n \<le> g n; summable f; summable g |] ==> suminf f \<le> suminf g"
   383 apply (drule summable_sums)+
   384 apply (auto intro!: LIMSEQ_le simp add: sums_def)
   385 apply (rule exI)
   386 apply (auto intro!: sumr_le2)
   387 done
   388 
   389 lemma summable_le2:
   390      "[|\<forall>n. abs(f n) \<le> g n; summable g |]  
   391       ==> summable f & suminf f \<le> suminf g"
   392 apply (auto intro: summable_comparison_test intro!: summable_le)
   393 apply (simp add: abs_le_interval_iff)
   394 done
   395 
   396 text{*Absolute convergence imples normal convergence*}
   397 lemma summable_rabs_cancel: "summable (%n. abs (f n)) ==> summable f"
   398 apply (auto simp add: sumr_rabs summable_Cauchy)
   399 apply (drule spec, auto)
   400 apply (rule_tac x = N in exI, auto)
   401 apply (drule spec, auto)
   402 apply (rule_tac y = "sumr m n (%n. abs (f n))" in order_le_less_trans)
   403 apply (auto intro: sumr_rabs)
   404 done
   405 
   406 text{*Absolute convergence of series*}
   407 lemma summable_rabs:
   408      "summable (%n. abs (f n)) ==> abs(suminf f) \<le> suminf (%n. abs(f n))"
   409 by (auto intro: LIMSEQ_le LIMSEQ_imp_rabs summable_rabs_cancel summable_sumr_LIMSEQ_suminf sumr_rabs)
   410 
   411 
   412 subsection{* The Ratio Test*}
   413 
   414 lemma rabs_ratiotest_lemma: "[| c \<le> 0; abs x \<le> c * abs y |] ==> x = (0::real)"
   415 apply (drule order_le_imp_less_or_eq, auto)
   416 apply (subgoal_tac "0 \<le> c * abs y")
   417 apply (simp add: zero_le_mult_iff, arith)
   418 done
   419 
   420 lemma le_Suc_ex: "(k::nat) \<le> l ==> (\<exists>n. l = k + n)"
   421 apply (drule le_imp_less_or_eq)
   422 apply (auto dest: less_imp_Suc_add)
   423 done
   424 
   425 lemma le_Suc_ex_iff: "((k::nat) \<le> l) = (\<exists>n. l = k + n)"
   426 by (auto simp add: le_Suc_ex)
   427 
   428 (*All this trouble just to get 0<c *)
   429 lemma ratio_test_lemma2:
   430      "[| \<forall>n. N \<le> n --> abs(f(Suc n)) \<le> c*abs(f n) |]  
   431       ==> 0 < c | summable f"
   432 apply (simp (no_asm) add: linorder_not_le [symmetric])
   433 apply (simp add: summable_Cauchy)
   434 apply (safe, subgoal_tac "\<forall>n. N \<le> n --> f (Suc n) = 0")
   435 prefer 2 apply (blast intro: rabs_ratiotest_lemma)
   436 apply (rule_tac x = "Suc N" in exI, clarify)
   437 apply (drule_tac n=n in Suc_le_imp_diff_ge2, auto) 
   438 done
   439 
   440 lemma ratio_test:
   441      "[| c < 1; \<forall>n. N \<le> n --> abs(f(Suc n)) \<le> c*abs(f n) |]  
   442       ==> summable f"
   443 apply (frule ratio_test_lemma2, auto)
   444 apply (rule_tac g = "%n. (abs (f N) / (c ^ N))*c ^ n" in summable_comparison_test)
   445 apply (rule_tac x = N in exI, safe)
   446 apply (drule le_Suc_ex_iff [THEN iffD1])
   447 apply (auto simp add: power_add realpow_not_zero)
   448 apply (induct_tac "na", auto)
   449 apply (rule_tac y = "c*abs (f (N + n))" in order_trans)
   450 apply (auto intro: mult_right_mono simp add: summable_def)
   451 apply (simp add: mult_ac)
   452 apply (rule_tac x = "abs (f N) * (1/ (1 - c)) / (c ^ N) " in exI)
   453 apply (rule sums_divide)
   454 apply (rule sums_mult)
   455 apply (auto intro!: sums_mult geometric_sums simp add: abs_if)
   456 done
   457 
   458 
   459 text{*Differentiation of finite sum*}
   460 
   461 lemma DERIV_sumr [rule_format (no_asm)]:
   462      "(\<forall>r. m \<le> r & r < (m + n) --> DERIV (%x. f r x) x :> (f' r x))  
   463       --> DERIV (%x. sumr m n (%n. f n x)) x :> sumr m n (%r. f' r x)"
   464 apply (induct_tac "n")
   465 apply (auto intro: DERIV_add)
   466 done
   467 
   468 ML
   469 {*
   470 val sumr_Suc = thm"sumr_Suc";
   471 val sums_def = thm"sums_def";
   472 val summable_def = thm"summable_def";
   473 val suminf_def = thm"suminf_def";
   474 
   475 val sumr_add = thm "sumr_add";
   476 val sumr_mult = thm "sumr_mult";
   477 val sumr_split_add = thm "sumr_split_add";
   478 val sumr_rabs = thm "sumr_rabs";
   479 val sumr_fun_eq = thm "sumr_fun_eq";
   480 val sumr_diff_mult_const = thm "sumr_diff_mult_const";
   481 val sumr_minus_one_realpow_zero = thm "sumr_minus_one_realpow_zero";
   482 val sumr_le2 = thm "sumr_le2";
   483 val sumr_ge_zero = thm "sumr_ge_zero";
   484 val sumr_ge_zero2 = thm "sumr_ge_zero2";
   485 val sumr_rabs_ge_zero = thm "sumr_rabs_ge_zero";
   486 val rabs_sumr_rabs_cancel = thm "rabs_sumr_rabs_cancel";
   487 val sumr_zero = thm "sumr_zero";
   488 val Suc_le_imp_diff_ge2 = thm "Suc_le_imp_diff_ge2";
   489 val sumr_one_lb_realpow_zero = thm "sumr_one_lb_realpow_zero";
   490 val sumr_diff = thm "sumr_diff";
   491 val sumr_subst = thm "sumr_subst";
   492 val sumr_bound = thm "sumr_bound";
   493 val sumr_bound2 = thm "sumr_bound2";
   494 val sumr_group = thm "sumr_group";
   495 val sums_summable = thm "sums_summable";
   496 val summable_sums = thm "summable_sums";
   497 val summable_sumr_LIMSEQ_suminf = thm "summable_sumr_LIMSEQ_suminf";
   498 val sums_unique = thm "sums_unique";
   499 val series_zero = thm "series_zero";
   500 val sums_mult = thm "sums_mult";
   501 val sums_divide = thm "sums_divide";
   502 val sums_diff = thm "sums_diff";
   503 val suminf_mult = thm "suminf_mult";
   504 val suminf_mult2 = thm "suminf_mult2";
   505 val suminf_diff = thm "suminf_diff";
   506 val sums_minus = thm "sums_minus";
   507 val sums_group = thm "sums_group";
   508 val sumr_pos_lt_pair_lemma = thm "sumr_pos_lt_pair_lemma";
   509 val sumr_pos_lt_pair = thm "sumr_pos_lt_pair";
   510 val series_pos_le = thm "series_pos_le";
   511 val series_pos_less = thm "series_pos_less";
   512 val sumr_geometric = thm "sumr_geometric";
   513 val geometric_sums = thm "geometric_sums";
   514 val summable_convergent_sumr_iff = thm "summable_convergent_sumr_iff";
   515 val summable_Cauchy = thm "summable_Cauchy";
   516 val summable_comparison_test = thm "summable_comparison_test";
   517 val summable_rabs_comparison_test = thm "summable_rabs_comparison_test";
   518 val summable_le = thm "summable_le";
   519 val summable_le2 = thm "summable_le2";
   520 val summable_rabs_cancel = thm "summable_rabs_cancel";
   521 val summable_rabs = thm "summable_rabs";
   522 val rabs_ratiotest_lemma = thm "rabs_ratiotest_lemma";
   523 val le_Suc_ex = thm "le_Suc_ex";
   524 val le_Suc_ex_iff = thm "le_Suc_ex_iff";
   525 val ratio_test_lemma2 = thm "ratio_test_lemma2";
   526 val ratio_test = thm "ratio_test";
   527 val DERIV_sumr = thm "DERIV_sumr";
   528 *}
   529 
   530 end