src/HOL/Hyperreal/Series.thy
changeset 15546 5188ce7316b7
parent 15543 0024472afce7
child 15561 045a07ac35a7
equal deleted inserted replaced
15545:0efa7126003f 15546:5188ce7316b7
    24    "summable f == (\<exists>s. f sums s)"
    24    "summable f == (\<exists>s. f sums s)"
    25 
    25 
    26    suminf   :: "(nat=>real) => real"
    26    suminf   :: "(nat=>real) => real"
    27    "suminf f == SOME s. f sums s"
    27    "suminf f == SOME s. f sums s"
    28 
    28 
       
    29 syntax
       
    30   "_suminf" :: "idt => real => real"    ("\<Sum>_. _" [0, 10] 10)
       
    31 translations
       
    32   "\<Sum>i. b" == "suminf (%i. b)"
       
    33 
    29 lemma setsum_Suc[simp]:
    34 lemma setsum_Suc[simp]:
    30   "setsum f {m..<Suc n} = (if n < m then 0 else setsum f {m..<n} + f(n))"
    35   "setsum f {m..<Suc n} = (if n < m then 0 else setsum f {m..<n} + f(n))"
    31 by (simp add: atLeastLessThanSuc add_commute)
    36 by (simp add: atLeastLessThanSuc add_commute)
    32 
    37 
    33 lemma sumr_diff_mult_const:
    38 lemma sumr_diff_mult_const:
   103 by (simp add: real_divide_def sums_mult mult_commute [of _ "inverse c"])
   108 by (simp add: real_divide_def sums_mult mult_commute [of _ "inverse c"])
   104 
   109 
   105 lemma sums_diff: "[| x sums x0; y sums y0 |] ==> (%n. x n - y n) sums (x0-y0)"
   110 lemma sums_diff: "[| x sums x0; y sums y0 |] ==> (%n. x n - y n) sums (x0-y0)"
   106 by (auto simp add: sums_def setsum_subtractf intro: LIMSEQ_diff)
   111 by (auto simp add: sums_def setsum_subtractf intro: LIMSEQ_diff)
   107 
   112 
   108 lemma suminf_mult: "summable f ==> suminf f * c = suminf(%n. f n * c)"
   113 lemma suminf_mult: "summable f ==> suminf f * c = (\<Sum>n. f n * c)"
   109 by (auto intro!: sums_unique sums_mult summable_sums simp add: mult_commute)
   114 by (auto intro!: sums_unique sums_mult summable_sums simp add: mult_commute)
   110 
   115 
   111 lemma suminf_mult2: "summable f ==> c * suminf f  = suminf(%n. c * f n)"
   116 lemma suminf_mult2: "summable f ==> c * suminf f  = (\<Sum>n. c * f n)"
   112 by (auto intro!: sums_unique sums_mult summable_sums)
   117 by (auto intro!: sums_unique sums_mult summable_sums)
   113 
   118 
   114 lemma suminf_diff:
   119 lemma suminf_diff:
   115      "[| summable f; summable g |]   
   120      "[| summable f; summable g |]   
   116       ==> suminf f - suminf g  = suminf(%n. f n - g n)"
   121       ==> suminf f - suminf g  = (\<Sum>n. f n - g n)"
   117 by (auto intro!: sums_diff sums_unique summable_sums)
   122 by (auto intro!: sums_diff sums_unique summable_sums)
   118 
   123 
   119 lemma sums_minus: "x sums x0 ==> (%n. - x n) sums - x0"
   124 lemma sums_minus: "x sums x0 ==> (%n. - x n) sums - x0"
   120 by (auto simp add: sums_def intro!: LIMSEQ_minus simp add: setsum_negf)
   125 by (auto simp add: sums_def intro!: LIMSEQ_minus simp add: setsum_negf)
   121 
   126 
   283 apply (auto)
   288 apply (auto)
   284 done
   289 done
   285 
   290 
   286 text{*Absolute convergence of series*}
   291 text{*Absolute convergence of series*}
   287 lemma summable_rabs:
   292 lemma summable_rabs:
   288      "summable (%n. abs (f n)) ==> abs(suminf f) \<le> suminf (%n. abs(f n))"
   293      "summable (%n. abs (f n)) ==> abs(suminf f) \<le> (\<Sum>n. abs(f n))"
   289 by (auto intro: LIMSEQ_le LIMSEQ_imp_rabs summable_rabs_cancel summable_sumr_LIMSEQ_suminf)
   294 by (auto intro: LIMSEQ_le LIMSEQ_imp_rabs summable_rabs_cancel summable_sumr_LIMSEQ_suminf)
   290 
   295 
   291 
   296 
   292 subsection{* The Ratio Test*}
   297 subsection{* The Ratio Test*}
   293 
   298