| author | hoelzl | 
| Tue, 05 Jul 2016 20:29:58 +0200 | |
| changeset 63393 | c22928719e19 | 
| parent 63365 | 5340fb6633d0 | 
| child 63550 | 3a0f40a6fa42 | 
| 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 | 
| 41970 | 8 | *) | 
| 10751 | 9 | |
| 60758 | 10 | section \<open>Infinite Series\<close> | 
| 10751 | 11 | |
| 15131 | 12 | theory Series | 
| 59712 
6c013328b885
add inequalities (move from AFP/Amortized_Complexity)
 hoelzl parents: 
59613diff
changeset | 13 | imports Limits Inequalities | 
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61531diff
changeset | 14 | begin | 
| 15561 | 15 | |
| 60758 | 16 | subsection \<open>Definition of infinite summability\<close> | 
| 56213 | 17 | |
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 18 | definition | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 19 |   sums :: "(nat \<Rightarrow> 'a::{topological_space, comm_monoid_add}) \<Rightarrow> 'a \<Rightarrow> bool"
 | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 20 | (infixr "sums" 80) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 21 | where | 
| 61969 | 22 | "f sums s \<longleftrightarrow> (\<lambda>n. \<Sum>i<n. f i) \<longlonglongrightarrow> s" | 
| 14416 | 23 | |
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 24 | definition summable :: "(nat \<Rightarrow> 'a::{topological_space, comm_monoid_add}) \<Rightarrow> bool" where
 | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 25 | "summable f \<longleftrightarrow> (\<exists>s. f sums s)" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 26 | |
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 27 | definition | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 28 |   suminf :: "(nat \<Rightarrow> 'a::{topological_space, comm_monoid_add}) \<Rightarrow> 'a"
 | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 29 | (binder "\<Sum>" 10) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 30 | where | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 31 | "suminf f = (THE s. f sums s)" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 32 | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
62049diff
changeset | 33 | lemma sums_def': "f sums s \<longleftrightarrow> (\<lambda>n. \<Sum>i = 0..n. f i) \<longlonglongrightarrow> s" | 
| 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
62049diff
changeset | 34 | apply (simp add: sums_def) | 
| 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
62049diff
changeset | 35 | apply (subst LIMSEQ_Suc_iff [symmetric]) | 
| 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
62049diff
changeset | 36 | apply (simp only: lessThan_Suc_atMost atLeast0AtMost) | 
| 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
62049diff
changeset | 37 | done | 
| 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
62049diff
changeset | 38 | |
| 60758 | 39 | subsection \<open>Infinite summability on topological monoids\<close> | 
| 56213 | 40 | |
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 41 | lemma sums_subst[trans]: "f = g \<Longrightarrow> g sums z \<Longrightarrow> f sums z" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 42 | by simp | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 43 | |
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 44 | lemma sums_cong: "(\<And>n. f n = g n) \<Longrightarrow> f sums c \<longleftrightarrow> g sums c" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 45 | by (drule ext) simp | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 46 | |
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 47 | lemma sums_summable: "f sums l \<Longrightarrow> summable f" | 
| 41970 | 48 | by (simp add: sums_def summable_def, blast) | 
| 14416 | 49 | |
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 50 | lemma summable_iff_convergent: "summable f \<longleftrightarrow> convergent (\<lambda>n. \<Sum>i<n. f i)" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 51 | by (simp add: summable_def sums_def convergent_def) | 
| 14416 | 52 | |
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 53 | lemma summable_iff_convergent': | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 54 |   "summable f \<longleftrightarrow> convergent (\<lambda>n. setsum f {..n})"
 | 
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61531diff
changeset | 55 | by (simp_all only: summable_iff_convergent convergent_def | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 56 |         lessThan_Suc_atMost [symmetric] LIMSEQ_Suc_iff[of "\<lambda>n. setsum f {..<n}"])
 | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 57 | |
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 58 | lemma suminf_eq_lim: "suminf f = lim (\<lambda>n. \<Sum>i<n. f i)" | 
| 41970 | 59 | by (simp add: suminf_def sums_def lim_def) | 
| 32707 
836ec9d0a0c8
New lemmas involving the real numbers, especially limits and series
 paulson parents: 
31336diff
changeset | 60 | |
| 56213 | 61 | lemma sums_zero[simp, intro]: "(\<lambda>n. 0) sums 0" | 
| 58729 
e8ecc79aee43
add tendsto_const and tendsto_ident_at as simp and intro rules
 hoelzl parents: 
57418diff
changeset | 62 | unfolding sums_def by simp | 
| 56213 | 63 | |
| 64 | lemma summable_zero[simp, intro]: "summable (\<lambda>n. 0)" | |
| 65 | by (rule sums_zero [THEN sums_summable]) | |
| 66 | ||
| 67 | lemma sums_group: "f sums s \<Longrightarrow> 0 < k \<Longrightarrow> (\<lambda>n. setsum f {n * k ..< n * k + k}) sums s"
 | |
| 68 | apply (simp only: sums_def setsum_nat_group tendsto_def eventually_sequentially) | |
| 69 | apply safe | |
| 70 | apply (erule_tac x=S in allE) | |
| 71 | apply safe | |
| 72 | apply (rule_tac x="N" in exI, safe) | |
| 73 | apply (drule_tac x="n*k" in spec) | |
| 74 | apply (erule mp) | |
| 75 | apply (erule order_trans) | |
| 76 | apply simp | |
| 77 | done | |
| 78 | ||
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 79 | lemma suminf_cong: "(\<And>n. f n = g n) \<Longrightarrow> suminf f = suminf g" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 80 | by (rule arg_cong[of f g], rule ext) simp | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 81 | |
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 82 | lemma summable_cong: | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 83 | assumes "eventually (\<lambda>x. f x = (g x :: 'a :: real_normed_vector)) sequentially" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 84 | shows "summable f = summable g" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 85 | proof - | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 86 | from assms obtain N where N: "\<forall>n\<ge>N. f n = g n" by (auto simp: eventually_at_top_linorder) | 
| 63040 | 87 | define C where "C = (\<Sum>k<N. f k - g k)" | 
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61531diff
changeset | 88 | from eventually_ge_at_top[of N] | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 89 |     have "eventually (\<lambda>n. setsum f {..<n} = C + setsum g {..<n}) sequentially"
 | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 90 | proof eventually_elim | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 91 | fix n assume n: "n \<ge> N" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 92 |     from n have "{..<n} = {..<N} \<union> {N..<n}" by auto
 | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 93 |     also have "setsum f ... = setsum f {..<N} + setsum f {N..<n}"
 | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 94 | by (intro setsum.union_disjoint) auto | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 95 |     also from N have "setsum f {N..<n} = setsum g {N..<n}" by (intro setsum.cong) simp_all
 | 
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61531diff
changeset | 96 |     also have "setsum f {..<N} + setsum g {N..<n} = C + (setsum g {..<N} + setsum g {N..<n})"
 | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 97 | unfolding C_def by (simp add: algebra_simps setsum_subtractf) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 98 |     also have "setsum g {..<N} + setsum g {N..<n} = setsum g ({..<N} \<union> {N..<n})"
 | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 99 | by (intro setsum.union_disjoint [symmetric]) auto | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 100 |     also from n have "{..<N} \<union> {N..<n} = {..<n}" by auto
 | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 101 |     finally show "setsum f {..<n} = C + setsum g {..<n}" .
 | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 102 | qed | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 103 | from convergent_cong[OF this] show ?thesis | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 104 | by (simp add: summable_iff_convergent convergent_add_const_iff) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 105 | qed | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 106 | |
| 47761 | 107 | lemma sums_finite: | 
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 108 | assumes [simp]: "finite N" and f: "\<And>n. n \<notin> N \<Longrightarrow> f n = 0" | 
| 47761 | 109 | shows "f sums (\<Sum>n\<in>N. f n)" | 
| 110 | proof - | |
| 111 |   { fix n
 | |
| 112 |     have "setsum f {..<n + Suc (Max N)} = setsum f N"
 | |
| 113 | proof cases | |
| 114 |       assume "N = {}"
 | |
| 115 | with f have "f = (\<lambda>x. 0)" by auto | |
| 116 | then show ?thesis by simp | |
| 117 | next | |
| 118 |       assume [simp]: "N \<noteq> {}"
 | |
| 119 | show ?thesis | |
| 57418 | 120 | proof (safe intro!: setsum.mono_neutral_right f) | 
| 47761 | 121 | fix i assume "i \<in> N" | 
| 122 | then have "i \<le> Max N" by simp | |
| 123 | then show "i < n + Suc (Max N)" by simp | |
| 124 | qed | |
| 125 | qed } | |
| 126 | note eq = this | |
| 127 | show ?thesis unfolding sums_def | |
| 128 | by (rule LIMSEQ_offset[of _ "Suc (Max N)"]) | |
| 58729 
e8ecc79aee43
add tendsto_const and tendsto_ident_at as simp and intro rules
 hoelzl parents: 
57418diff
changeset | 129 | (simp add: eq atLeast0LessThan del: add_Suc_right) | 
| 47761 | 130 | qed | 
| 131 | ||
| 62217 | 132 | corollary sums_0: | 
| 133 | "(\<And>n. f n = 0) \<Longrightarrow> (f sums 0)" | |
| 134 | by (metis (no_types) finite.emptyI setsum.empty sums_finite) | |
| 135 | ||
| 56213 | 136 | lemma summable_finite: "finite N \<Longrightarrow> (\<And>n. n \<notin> N \<Longrightarrow> f n = 0) \<Longrightarrow> summable f" | 
| 137 | by (rule sums_summable) (rule sums_finite) | |
| 138 | ||
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 139 | lemma sums_If_finite_set: "finite A \<Longrightarrow> (\<lambda>r. if r \<in> A then f r else 0) sums (\<Sum>r\<in>A. f r)" | 
| 47761 | 140 | using sums_finite[of A "(\<lambda>r. if r \<in> A then f r else 0)"] by simp | 
| 141 | ||
| 56213 | 142 | lemma summable_If_finite_set[simp, intro]: "finite A \<Longrightarrow> summable (\<lambda>r. if r \<in> A then f r else 0)" | 
| 143 | by (rule sums_summable) (rule sums_If_finite_set) | |
| 144 | ||
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 145 | lemma sums_If_finite: "finite {r. P r} \<Longrightarrow> (\<lambda>r. if P r then f r else 0) sums (\<Sum>r | P r. f r)"
 | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 146 |   using sums_If_finite_set[of "{r. P r}"] by simp
 | 
| 16819 | 147 | |
| 56213 | 148 | lemma summable_If_finite[simp, intro]: "finite {r. P r} \<Longrightarrow> summable (\<lambda>r. if P r then f r else 0)"
 | 
| 149 | by (rule sums_summable) (rule sums_If_finite) | |
| 150 | ||
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 151 | lemma sums_single: "(\<lambda>r. if r = i then f r else 0) sums f i" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 152 | using sums_If_finite[of "\<lambda>r. r = i"] by simp | 
| 29803 
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
 hoelzl parents: 
29197diff
changeset | 153 | |
| 56213 | 154 | lemma summable_single[simp, intro]: "summable (\<lambda>r. if r = i then f r else 0)" | 
| 155 | by (rule sums_summable) (rule sums_single) | |
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 156 | |
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 157 | context | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 158 |   fixes f :: "nat \<Rightarrow> 'a::{t2_space, comm_monoid_add}"
 | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 159 | begin | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 160 | |
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 161 | lemma summable_sums[intro]: "summable f \<Longrightarrow> f sums (suminf f)" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 162 | by (simp add: summable_def sums_def suminf_def) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 163 | (metis convergent_LIMSEQ_iff convergent_def lim_def) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 164 | |
| 61969 | 165 | lemma summable_LIMSEQ: "summable f \<Longrightarrow> (\<lambda>n. \<Sum>i<n. f i) \<longlonglongrightarrow> suminf f" | 
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 166 | by (rule summable_sums [unfolded sums_def]) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 167 | |
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 168 | lemma sums_unique: "f sums s \<Longrightarrow> s = suminf f" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 169 | by (metis limI suminf_eq_lim sums_def) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 170 | |
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 171 | lemma sums_iff: "f sums x \<longleftrightarrow> summable f \<and> (suminf f = x)" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 172 | by (metis summable_sums sums_summable sums_unique) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 173 | |
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61531diff
changeset | 174 | lemma summable_sums_iff: | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 175 |   "summable (f :: nat \<Rightarrow> 'a :: {comm_monoid_add,t2_space}) \<longleftrightarrow> f sums suminf f"
 | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 176 | by (auto simp: sums_iff summable_sums) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 177 | |
| 59613 
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
 paulson <lp15@cam.ac.uk> parents: 
59025diff
changeset | 178 | lemma sums_unique2: | 
| 
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
 paulson <lp15@cam.ac.uk> parents: 
59025diff
changeset | 179 |   fixes a b :: "'a::{comm_monoid_add,t2_space}"
 | 
| 
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
 paulson <lp15@cam.ac.uk> parents: 
59025diff
changeset | 180 | shows "f sums a \<Longrightarrow> f sums b \<Longrightarrow> a = b" | 
| 
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
 paulson <lp15@cam.ac.uk> parents: 
59025diff
changeset | 181 | by (simp add: sums_iff) | 
| 
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
 paulson <lp15@cam.ac.uk> parents: 
59025diff
changeset | 182 | |
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 183 | lemma suminf_finite: | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 184 | assumes N: "finite N" and f: "\<And>n. n \<notin> N \<Longrightarrow> f n = 0" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 185 | shows "suminf f = (\<Sum>n\<in>N. f n)" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 186 | using sums_finite[OF assms, THEN sums_unique] by simp | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 187 | |
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 188 | end | 
| 16819 | 189 | |
| 41970 | 190 | lemma suminf_zero[simp]: "suminf (\<lambda>n. 0::'a::{t2_space, comm_monoid_add}) = 0"
 | 
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 191 | by (rule sums_zero [THEN sums_unique, symmetric]) | 
| 16819 | 192 | |
| 56213 | 193 | |
| 60758 | 194 | subsection \<open>Infinite summability on ordered, topological monoids\<close> | 
| 56213 | 195 | |
| 196 | lemma sums_le: | |
| 197 |   fixes f g :: "nat \<Rightarrow> 'a::{ordered_comm_monoid_add, linorder_topology}"
 | |
| 198 | shows "\<forall>n. f n \<le> g n \<Longrightarrow> f sums s \<Longrightarrow> g sums t \<Longrightarrow> s \<le> t" | |
| 199 | by (rule LIMSEQ_le) (auto intro: setsum_mono simp: sums_def) | |
| 200 | ||
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 201 | context | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 202 |   fixes f :: "nat \<Rightarrow> 'a::{ordered_comm_monoid_add, linorder_topology}"
 | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 203 | begin | 
| 14416 | 204 | |
| 56213 | 205 | lemma suminf_le: "\<lbrakk>\<forall>n. f n \<le> g n; summable f; summable g\<rbrakk> \<Longrightarrow> suminf f \<le> suminf g" | 
| 206 | by (auto dest: sums_summable intro: sums_le) | |
| 207 | ||
| 208 | lemma setsum_le_suminf: "summable f \<Longrightarrow> \<forall>m\<ge>n. 0 \<le> f m \<Longrightarrow> setsum f {..<n} \<le> suminf f"
 | |
| 209 | by (rule sums_le[OF _ sums_If_finite_set summable_sums]) auto | |
| 210 | ||
| 211 | lemma suminf_nonneg: "summable f \<Longrightarrow> \<forall>n. 0 \<le> f n \<Longrightarrow> 0 \<le> suminf f" | |
| 212 | using setsum_le_suminf[of 0] by simp | |
| 213 | ||
| 214 | lemma suminf_le_const: "summable f \<Longrightarrow> (\<And>n. setsum f {..<n} \<le> x) \<Longrightarrow> suminf f \<le> x"
 | |
| 215 | by (metis LIMSEQ_le_const2 summable_LIMSEQ) | |
| 14416 | 216 | |
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 217 | lemma suminf_eq_zero_iff: "summable f \<Longrightarrow> \<forall>n. 0 \<le> f n \<Longrightarrow> suminf f = 0 \<longleftrightarrow> (\<forall>n. f n = 0)" | 
| 50999 | 218 | proof | 
| 219 | assume "summable f" "suminf f = 0" and pos: "\<forall>n. 0 \<le> f n" | |
| 61969 | 220 | then have f: "(\<lambda>n. \<Sum>i<n. f i) \<longlonglongrightarrow> 0" | 
| 56213 | 221 | using summable_LIMSEQ[of f] by simp | 
| 222 |   then have "\<And>i. (\<Sum>n\<in>{i}. f n) \<le> 0"
 | |
| 223 | proof (rule LIMSEQ_le_const) | |
| 50999 | 224 |     fix i show "\<exists>N. \<forall>n\<ge>N. (\<Sum>n\<in>{i}. f n) \<le> setsum f {..<n}"
 | 
| 225 | using pos by (intro exI[of _ "Suc i"] allI impI setsum_mono2) auto | |
| 226 | qed | |
| 227 | with pos show "\<forall>n. f n = 0" | |
| 228 | by (auto intro!: antisym) | |
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 229 | qed (metis suminf_zero fun_eq_iff) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 230 | |
| 62377 
ace69956d018
moved more proofs to ordered_comm_monoid_add; introduced strict_ordered_ab_semigroup/comm_monoid_add
 hoelzl parents: 
62376diff
changeset | 231 | lemma suminf_pos_iff: | 
| 
ace69956d018
moved more proofs to ordered_comm_monoid_add; introduced strict_ordered_ab_semigroup/comm_monoid_add
 hoelzl parents: 
62376diff
changeset | 232 | "summable f \<Longrightarrow> \<forall>n. 0 \<le> f n \<Longrightarrow> 0 < suminf f \<longleftrightarrow> (\<exists>i. 0 < f i)" | 
| 
ace69956d018
moved more proofs to ordered_comm_monoid_add; introduced strict_ordered_ab_semigroup/comm_monoid_add
 hoelzl parents: 
62376diff
changeset | 233 | using setsum_le_suminf[of 0] suminf_eq_zero_iff by (simp add: less_le) | 
| 
ace69956d018
moved more proofs to ordered_comm_monoid_add; introduced strict_ordered_ab_semigroup/comm_monoid_add
 hoelzl parents: 
62376diff
changeset | 234 | |
| 
ace69956d018
moved more proofs to ordered_comm_monoid_add; introduced strict_ordered_ab_semigroup/comm_monoid_add
 hoelzl parents: 
62376diff
changeset | 235 | lemma suminf_pos2: | 
| 
ace69956d018
moved more proofs to ordered_comm_monoid_add; introduced strict_ordered_ab_semigroup/comm_monoid_add
 hoelzl parents: 
62376diff
changeset | 236 | assumes "summable f" "\<forall>n. 0 \<le> f n" "0 < f i" | 
| 
ace69956d018
moved more proofs to ordered_comm_monoid_add; introduced strict_ordered_ab_semigroup/comm_monoid_add
 hoelzl parents: 
62376diff
changeset | 237 | shows "0 < suminf f" | 
| 
ace69956d018
moved more proofs to ordered_comm_monoid_add; introduced strict_ordered_ab_semigroup/comm_monoid_add
 hoelzl parents: 
62376diff
changeset | 238 | proof - | 
| 
ace69956d018
moved more proofs to ordered_comm_monoid_add; introduced strict_ordered_ab_semigroup/comm_monoid_add
 hoelzl parents: 
62376diff
changeset | 239 | have "0 < (\<Sum>n<Suc i. f n)" | 
| 
ace69956d018
moved more proofs to ordered_comm_monoid_add; introduced strict_ordered_ab_semigroup/comm_monoid_add
 hoelzl parents: 
62376diff
changeset | 240 | using assms by (intro setsum_pos2[where i=i]) auto | 
| 
ace69956d018
moved more proofs to ordered_comm_monoid_add; introduced strict_ordered_ab_semigroup/comm_monoid_add
 hoelzl parents: 
62376diff
changeset | 241 | also have "\<dots> \<le> suminf f" | 
| 
ace69956d018
moved more proofs to ordered_comm_monoid_add; introduced strict_ordered_ab_semigroup/comm_monoid_add
 hoelzl parents: 
62376diff
changeset | 242 | using assms by (intro setsum_le_suminf) auto | 
| 
ace69956d018
moved more proofs to ordered_comm_monoid_add; introduced strict_ordered_ab_semigroup/comm_monoid_add
 hoelzl parents: 
62376diff
changeset | 243 | finally show ?thesis . | 
| 
ace69956d018
moved more proofs to ordered_comm_monoid_add; introduced strict_ordered_ab_semigroup/comm_monoid_add
 hoelzl parents: 
62376diff
changeset | 244 | qed | 
| 
ace69956d018
moved more proofs to ordered_comm_monoid_add; introduced strict_ordered_ab_semigroup/comm_monoid_add
 hoelzl parents: 
62376diff
changeset | 245 | |
| 
ace69956d018
moved more proofs to ordered_comm_monoid_add; introduced strict_ordered_ab_semigroup/comm_monoid_add
 hoelzl parents: 
62376diff
changeset | 246 | lemma suminf_pos: "summable f \<Longrightarrow> \<forall>n. 0 < f n \<Longrightarrow> 0 < suminf f" | 
| 
ace69956d018
moved more proofs to ordered_comm_monoid_add; introduced strict_ordered_ab_semigroup/comm_monoid_add
 hoelzl parents: 
62376diff
changeset | 247 | by (intro suminf_pos2[where i=0]) (auto intro: less_imp_le) | 
| 
ace69956d018
moved more proofs to ordered_comm_monoid_add; introduced strict_ordered_ab_semigroup/comm_monoid_add
 hoelzl parents: 
62376diff
changeset | 248 | |
| 62376 
85f38d5f8807
Rename ordered_comm_monoid_add to ordered_cancel_comm_monoid_add. Introduce ordreed_comm_monoid_add, canonically_ordered_comm_monoid and dioid. Setup nat, entat and ennreal as dioids.
 hoelzl parents: 
62368diff
changeset | 249 | end | 
| 
85f38d5f8807
Rename ordered_comm_monoid_add to ordered_cancel_comm_monoid_add. Introduce ordreed_comm_monoid_add, canonically_ordered_comm_monoid and dioid. Setup nat, entat and ennreal as dioids.
 hoelzl parents: 
62368diff
changeset | 250 | |
| 
85f38d5f8807
Rename ordered_comm_monoid_add to ordered_cancel_comm_monoid_add. Introduce ordreed_comm_monoid_add, canonically_ordered_comm_monoid and dioid. Setup nat, entat and ennreal as dioids.
 hoelzl parents: 
62368diff
changeset | 251 | context | 
| 
85f38d5f8807
Rename ordered_comm_monoid_add to ordered_cancel_comm_monoid_add. Introduce ordreed_comm_monoid_add, canonically_ordered_comm_monoid and dioid. Setup nat, entat and ennreal as dioids.
 hoelzl parents: 
62368diff
changeset | 252 |   fixes f :: "nat \<Rightarrow> 'a::{ordered_cancel_comm_monoid_add, linorder_topology}"
 | 
| 
85f38d5f8807
Rename ordered_comm_monoid_add to ordered_cancel_comm_monoid_add. Introduce ordreed_comm_monoid_add, canonically_ordered_comm_monoid and dioid. Setup nat, entat and ennreal as dioids.
 hoelzl parents: 
62368diff
changeset | 253 | begin | 
| 
85f38d5f8807
Rename ordered_comm_monoid_add to ordered_cancel_comm_monoid_add. Introduce ordreed_comm_monoid_add, canonically_ordered_comm_monoid and dioid. Setup nat, entat and ennreal as dioids.
 hoelzl parents: 
62368diff
changeset | 254 | |
| 
85f38d5f8807
Rename ordered_comm_monoid_add to ordered_cancel_comm_monoid_add. Introduce ordreed_comm_monoid_add, canonically_ordered_comm_monoid and dioid. Setup nat, entat and ennreal as dioids.
 hoelzl parents: 
62368diff
changeset | 255 | lemma setsum_less_suminf2: "summable f \<Longrightarrow> \<forall>m\<ge>n. 0 \<le> f m \<Longrightarrow> n \<le> i \<Longrightarrow> 0 < f i \<Longrightarrow> setsum f {..<n} < suminf f"
 | 
| 
85f38d5f8807
Rename ordered_comm_monoid_add to ordered_cancel_comm_monoid_add. Introduce ordreed_comm_monoid_add, canonically_ordered_comm_monoid and dioid. Setup nat, entat and ennreal as dioids.
 hoelzl parents: 
62368diff
changeset | 256 | using | 
| 
85f38d5f8807
Rename ordered_comm_monoid_add to ordered_cancel_comm_monoid_add. Introduce ordreed_comm_monoid_add, canonically_ordered_comm_monoid and dioid. Setup nat, entat and ennreal as dioids.
 hoelzl parents: 
62368diff
changeset | 257 | setsum_le_suminf[of f "Suc i"] | 
| 
85f38d5f8807
Rename ordered_comm_monoid_add to ordered_cancel_comm_monoid_add. Introduce ordreed_comm_monoid_add, canonically_ordered_comm_monoid and dioid. Setup nat, entat and ennreal as dioids.
 hoelzl parents: 
62368diff
changeset | 258 |     add_strict_increasing[of "f i" "setsum f {..<n}" "setsum f {..<i}"]
 | 
| 
85f38d5f8807
Rename ordered_comm_monoid_add to ordered_cancel_comm_monoid_add. Introduce ordreed_comm_monoid_add, canonically_ordered_comm_monoid and dioid. Setup nat, entat and ennreal as dioids.
 hoelzl parents: 
62368diff
changeset | 259 |     setsum_mono2[of "{..<i}" "{..<n}" f]
 | 
| 
85f38d5f8807
Rename ordered_comm_monoid_add to ordered_cancel_comm_monoid_add. Introduce ordreed_comm_monoid_add, canonically_ordered_comm_monoid and dioid. Setup nat, entat and ennreal as dioids.
 hoelzl parents: 
62368diff
changeset | 260 | by (auto simp: less_imp_le ac_simps) | 
| 
85f38d5f8807
Rename ordered_comm_monoid_add to ordered_cancel_comm_monoid_add. Introduce ordreed_comm_monoid_add, canonically_ordered_comm_monoid and dioid. Setup nat, entat and ennreal as dioids.
 hoelzl parents: 
62368diff
changeset | 261 | |
| 
85f38d5f8807
Rename ordered_comm_monoid_add to ordered_cancel_comm_monoid_add. Introduce ordreed_comm_monoid_add, canonically_ordered_comm_monoid and dioid. Setup nat, entat and ennreal as dioids.
 hoelzl parents: 
62368diff
changeset | 262 | lemma setsum_less_suminf: "summable f \<Longrightarrow> \<forall>m\<ge>n. 0 < f m \<Longrightarrow> setsum f {..<n} < suminf f"
 | 
| 
85f38d5f8807
Rename ordered_comm_monoid_add to ordered_cancel_comm_monoid_add. Introduce ordreed_comm_monoid_add, canonically_ordered_comm_monoid and dioid. Setup nat, entat and ennreal as dioids.
 hoelzl parents: 
62368diff
changeset | 263 | using setsum_less_suminf2[of n n] by (simp add: less_imp_le) | 
| 
85f38d5f8807
Rename ordered_comm_monoid_add to ordered_cancel_comm_monoid_add. Introduce ordreed_comm_monoid_add, canonically_ordered_comm_monoid and dioid. Setup nat, entat and ennreal as dioids.
 hoelzl parents: 
62368diff
changeset | 264 | |
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 265 | end | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 266 | |
| 56213 | 267 | lemma summableI_nonneg_bounded: | 
| 268 |   fixes f:: "nat \<Rightarrow> 'a::{ordered_comm_monoid_add, linorder_topology, conditionally_complete_linorder}"
 | |
| 269 | assumes pos[simp]: "\<And>n. 0 \<le> f n" and le: "\<And>n. (\<Sum>i<n. f i) \<le> x" | |
| 270 | shows "summable f" | |
| 271 | unfolding summable_def sums_def[abs_def] | |
| 62377 
ace69956d018
moved more proofs to ordered_comm_monoid_add; introduced strict_ordered_ab_semigroup/comm_monoid_add
 hoelzl parents: 
62376diff
changeset | 272 | proof (rule exI LIMSEQ_incseq_SUP)+ | 
| 
ace69956d018
moved more proofs to ordered_comm_monoid_add; introduced strict_ordered_ab_semigroup/comm_monoid_add
 hoelzl parents: 
62376diff
changeset | 273 |   show "bdd_above (range (\<lambda>n. setsum f {..<n}))"
 | 
| 56213 | 274 | using le by (auto simp: bdd_above_def) | 
| 62377 
ace69956d018
moved more proofs to ordered_comm_monoid_add; introduced strict_ordered_ab_semigroup/comm_monoid_add
 hoelzl parents: 
62376diff
changeset | 275 |   show "incseq (\<lambda>n. setsum f {..<n})"
 | 
| 
ace69956d018
moved more proofs to ordered_comm_monoid_add; introduced strict_ordered_ab_semigroup/comm_monoid_add
 hoelzl parents: 
62376diff
changeset | 276 | by (auto simp: mono_def intro!: setsum_mono2) | 
| 56213 | 277 | qed | 
| 278 | ||
| 62377 
ace69956d018
moved more proofs to ordered_comm_monoid_add; introduced strict_ordered_ab_semigroup/comm_monoid_add
 hoelzl parents: 
62376diff
changeset | 279 | lemma summableI[intro, simp]: | 
| 
ace69956d018
moved more proofs to ordered_comm_monoid_add; introduced strict_ordered_ab_semigroup/comm_monoid_add
 hoelzl parents: 
62376diff
changeset | 280 |   fixes f:: "nat \<Rightarrow> 'a::{canonically_ordered_monoid_add, linorder_topology, complete_linorder}"
 | 
| 
ace69956d018
moved more proofs to ordered_comm_monoid_add; introduced strict_ordered_ab_semigroup/comm_monoid_add
 hoelzl parents: 
62376diff
changeset | 281 | shows "summable f" | 
| 
ace69956d018
moved more proofs to ordered_comm_monoid_add; introduced strict_ordered_ab_semigroup/comm_monoid_add
 hoelzl parents: 
62376diff
changeset | 282 | by (intro summableI_nonneg_bounded[where x=top] zero_le top_greatest) | 
| 
ace69956d018
moved more proofs to ordered_comm_monoid_add; introduced strict_ordered_ab_semigroup/comm_monoid_add
 hoelzl parents: 
62376diff
changeset | 283 | |
| 62368 | 284 | subsection \<open>Infinite summability on topological monoids\<close> | 
| 285 | ||
| 286 | context | |
| 287 |   fixes f g :: "nat \<Rightarrow> 'a :: {t2_space, topological_comm_monoid_add}"
 | |
| 288 | begin | |
| 289 | ||
| 290 | lemma sums_Suc: | |
| 291 | assumes "(\<lambda>n. f (Suc n)) sums l" shows "f sums (l + f 0)" | |
| 292 | proof - | |
| 293 | have "(\<lambda>n. (\<Sum>i<n. f (Suc i)) + f 0) \<longlonglongrightarrow> l + f 0" | |
| 294 | using assms by (auto intro!: tendsto_add simp: sums_def) | |
| 295 | moreover have "(\<Sum>i<n. f (Suc i)) + f 0 = (\<Sum>i<Suc n. f i)" for n | |
| 63365 | 296 | unfolding lessThan_Suc_eq_insert_0 | 
| 297 | by (simp add: ac_simps setsum_atLeast1_atMost_eq image_Suc_lessThan) | |
| 62368 | 298 | ultimately show ?thesis | 
| 299 | by (auto simp add: sums_def simp del: setsum_lessThan_Suc intro: LIMSEQ_Suc_iff[THEN iffD1]) | |
| 300 | qed | |
| 301 | ||
| 302 | lemma sums_add: "f sums a \<Longrightarrow> g sums b \<Longrightarrow> (\<lambda>n. f n + g n) sums (a + b)" | |
| 303 | unfolding sums_def by (simp add: setsum.distrib tendsto_add) | |
| 304 | ||
| 305 | lemma summable_add: "summable f \<Longrightarrow> summable g \<Longrightarrow> summable (\<lambda>n. f n + g n)" | |
| 306 | unfolding summable_def by (auto intro: sums_add) | |
| 307 | ||
| 308 | lemma suminf_add: "summable f \<Longrightarrow> summable g \<Longrightarrow> suminf f + suminf g = (\<Sum>n. f n + g n)" | |
| 309 | by (intro sums_unique sums_add summable_sums) | |
| 310 | ||
| 311 | end | |
| 312 | ||
| 313 | context | |
| 314 |   fixes f :: "'i \<Rightarrow> nat \<Rightarrow> 'a::{t2_space, topological_comm_monoid_add}" and I :: "'i set"
 | |
| 315 | begin | |
| 316 | ||
| 317 | lemma sums_setsum: "(\<And>i. i \<in> I \<Longrightarrow> (f i) sums (x i)) \<Longrightarrow> (\<lambda>n. \<Sum>i\<in>I. f i n) sums (\<Sum>i\<in>I. x i)" | |
| 318 | by (induct I rule: infinite_finite_induct) (auto intro!: sums_add) | |
| 319 | ||
| 320 | lemma suminf_setsum: "(\<And>i. i \<in> I \<Longrightarrow> summable (f i)) \<Longrightarrow> (\<Sum>n. \<Sum>i\<in>I. f i n) = (\<Sum>i\<in>I. \<Sum>n. f i n)" | |
| 321 | using sums_unique[OF sums_setsum, OF summable_sums] by simp | |
| 322 | ||
| 323 | lemma summable_setsum: "(\<And>i. i \<in> I \<Longrightarrow> summable (f i)) \<Longrightarrow> summable (\<lambda>n. \<Sum>i\<in>I. f i n)" | |
| 324 | using sums_summable[OF sums_setsum[OF summable_sums]] . | |
| 325 | ||
| 326 | end | |
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 327 | |
| 60758 | 328 | subsection \<open>Infinite summability on real normed vector spaces\<close> | 
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 329 | |
| 62368 | 330 | context | 
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 331 | fixes f :: "nat \<Rightarrow> 'a::real_normed_vector" | 
| 62368 | 332 | begin | 
| 333 | ||
| 334 | lemma sums_Suc_iff: "(\<lambda>n. f (Suc n)) sums s \<longleftrightarrow> f sums (s + f 0)" | |
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 335 | proof - | 
| 61969 | 336 | have "f sums (s + f 0) \<longleftrightarrow> (\<lambda>i. \<Sum>j<Suc i. f j) \<longlonglongrightarrow> s + f 0" | 
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 337 | by (subst LIMSEQ_Suc_iff) (simp add: sums_def) | 
| 61969 | 338 | also have "\<dots> \<longleftrightarrow> (\<lambda>i. (\<Sum>j<i. f (Suc j)) + f 0) \<longlonglongrightarrow> s + f 0" | 
| 63365 | 339 | by (simp add: ac_simps lessThan_Suc_eq_insert_0 image_Suc_lessThan setsum_atLeast1_atMost_eq) | 
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 340 | also have "\<dots> \<longleftrightarrow> (\<lambda>n. f (Suc n)) sums s" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 341 | proof | 
| 61969 | 342 | assume "(\<lambda>i. (\<Sum>j<i. f (Suc j)) + f 0) \<longlonglongrightarrow> s + f 0" | 
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 343 | with tendsto_add[OF this tendsto_const, of "- f 0"] | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 344 | show "(\<lambda>i. f (Suc i)) sums s" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 345 | by (simp add: sums_def) | 
| 58729 
e8ecc79aee43
add tendsto_const and tendsto_ident_at as simp and intro rules
 hoelzl parents: 
57418diff
changeset | 346 | qed (auto intro: tendsto_add simp: sums_def) | 
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 347 | finally show ?thesis .. | 
| 50999 | 348 | qed | 
| 349 | ||
| 62368 | 350 | lemma summable_Suc_iff: "summable (\<lambda>n. f (Suc n)) = summable f" | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 351 | proof | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 352 | assume "summable f" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 353 | hence "f sums suminf f" by (rule summable_sums) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 354 | hence "(\<lambda>n. f (Suc n)) sums (suminf f - f 0)" by (simp add: sums_Suc_iff) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 355 | thus "summable (\<lambda>n. f (Suc n))" unfolding summable_def by blast | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 356 | qed (auto simp: sums_Suc_iff summable_def) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 357 | |
| 62381 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62379diff
changeset | 358 | lemma sums_Suc_imp: "f 0 = 0 \<Longrightarrow> (\<lambda>n. f (Suc n)) sums s \<Longrightarrow> (\<lambda>n. f n) sums s" | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62379diff
changeset | 359 | using sums_Suc_iff by simp | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62379diff
changeset | 360 | |
| 62368 | 361 | end | 
| 362 | ||
| 63145 | 363 | context \<comment>\<open>Separate contexts are necessary to allow general use of the results above, here.\<close> | 
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 364 | fixes f :: "nat \<Rightarrow> 'a::real_normed_vector" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 365 | begin | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 366 | |
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 367 | lemma sums_diff: "f sums a \<Longrightarrow> g sums b \<Longrightarrow> (\<lambda>n. f n - g n) sums (a - b)" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 368 | unfolding sums_def by (simp add: setsum_subtractf tendsto_diff) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 369 | |
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 370 | lemma summable_diff: "summable f \<Longrightarrow> summable g \<Longrightarrow> summable (\<lambda>n. f n - g n)" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 371 | unfolding summable_def by (auto intro: sums_diff) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 372 | |
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 373 | lemma suminf_diff: "summable f \<Longrightarrow> summable g \<Longrightarrow> suminf f - suminf g = (\<Sum>n. f n - g n)" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 374 | by (intro sums_unique sums_diff summable_sums) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 375 | |
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 376 | lemma sums_minus: "f sums a \<Longrightarrow> (\<lambda>n. - f n) sums (- a)" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 377 | unfolding sums_def by (simp add: setsum_negf tendsto_minus) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 378 | |
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 379 | lemma summable_minus: "summable f \<Longrightarrow> summable (\<lambda>n. - f n)" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 380 | unfolding summable_def by (auto intro: sums_minus) | 
| 20692 | 381 | |
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 382 | lemma suminf_minus: "summable f \<Longrightarrow> (\<Sum>n. - f n) = - (\<Sum>n. f n)" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 383 | by (intro sums_unique [symmetric] sums_minus summable_sums) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 384 | |
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 385 | lemma sums_iff_shift: "(\<lambda>i. f (i + n)) sums s \<longleftrightarrow> f sums (s + (\<Sum>i<n. f i))" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 386 | proof (induct n arbitrary: s) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 387 | case (Suc n) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 388 | moreover have "(\<lambda>i. f (Suc i + n)) sums s \<longleftrightarrow> (\<lambda>i. f (i + n)) sums (s + f n)" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 389 | by (subst sums_Suc_iff) simp | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 390 | ultimately show ?case | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 391 | by (simp add: ac_simps) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 392 | qed simp | 
| 20692 | 393 | |
| 62379 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 paulson <lp15@cam.ac.uk> parents: 
62377diff
changeset | 394 | corollary sums_iff_shift': "(\<lambda>i. f (i + n)) sums (s - (\<Sum>i<n. f i)) \<longleftrightarrow> f sums s" | 
| 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 paulson <lp15@cam.ac.uk> parents: 
62377diff
changeset | 395 | by (simp add: sums_iff_shift) | 
| 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 paulson <lp15@cam.ac.uk> parents: 
62377diff
changeset | 396 | |
| 62381 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62379diff
changeset | 397 | lemma sums_zero_iff_shift: | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62379diff
changeset | 398 | assumes "\<And>i. i < n \<Longrightarrow> f i = 0" | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62379diff
changeset | 399 | shows "(\<lambda>i. f (i+n)) sums s \<longleftrightarrow> (\<lambda>i. f i) sums s" | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62379diff
changeset | 400 | by (simp add: assms sums_iff_shift) | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62379diff
changeset | 401 | |
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 402 | lemma summable_iff_shift: "summable (\<lambda>n. f (n + k)) \<longleftrightarrow> summable f" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 403 | by (metis diff_add_cancel summable_def sums_iff_shift[abs_def]) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 404 | |
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 405 | lemma sums_split_initial_segment: "f sums s \<Longrightarrow> (\<lambda>i. f (i + n)) sums (s - (\<Sum>i<n. f i))" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 406 | by (simp add: sums_iff_shift) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 407 | |
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 408 | lemma summable_ignore_initial_segment: "summable f \<Longrightarrow> summable (\<lambda>n. f(n + k))" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 409 | by (simp add: summable_iff_shift) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 410 | |
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 411 | lemma suminf_minus_initial_segment: "summable f \<Longrightarrow> (\<Sum>n. f (n + k)) = (\<Sum>n. f n) - (\<Sum>i<k. f i)" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 412 | by (rule sums_unique[symmetric]) (auto simp: sums_iff_shift) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 413 | |
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 414 | lemma suminf_split_initial_segment: "summable f \<Longrightarrow> suminf f = (\<Sum>n. f(n + k)) + (\<Sum>i<k. f i)" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 415 | by (auto simp add: suminf_minus_initial_segment) | 
| 20692 | 416 | |
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 417 | lemma suminf_split_head: "summable f \<Longrightarrow> (\<Sum>n. f (Suc n)) = suminf f - f 0" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 418 | using suminf_split_initial_segment[of 1] by simp | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 419 | |
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61531diff
changeset | 420 | lemma suminf_exist_split: | 
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 421 | fixes r :: real assumes "0 < r" and "summable f" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 422 | shows "\<exists>N. \<forall>n\<ge>N. norm (\<Sum>i. f (i + n)) < r" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 423 | proof - | 
| 60758 | 424 | from LIMSEQ_D[OF summable_LIMSEQ[OF \<open>summable f\<close>] \<open>0 < r\<close>] | 
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 425 |   obtain N :: nat where "\<forall> n \<ge> N. norm (setsum f {..<n} - suminf f) < r" by auto
 | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 426 | thus ?thesis | 
| 60758 | 427 | by (auto simp: norm_minus_commute suminf_minus_initial_segment[OF \<open>summable f\<close>]) | 
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 428 | qed | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 429 | |
| 61969 | 430 | lemma summable_LIMSEQ_zero: "summable f \<Longrightarrow> f \<longlonglongrightarrow> 0" | 
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 431 | apply (drule summable_iff_convergent [THEN iffD1]) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 432 | apply (drule convergent_Cauchy) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 433 | apply (simp only: Cauchy_iff LIMSEQ_iff, safe) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 434 | apply (drule_tac x="r" in spec, safe) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 435 | apply (rule_tac x="M" in exI, safe) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 436 | apply (drule_tac x="Suc n" in spec, simp) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 437 | apply (drule_tac x="n" in spec, simp) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 438 | done | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 439 | |
| 62368 | 440 | lemma summable_imp_convergent: "summable f \<Longrightarrow> convergent f" | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 441 | by (force dest!: summable_LIMSEQ_zero simp: convergent_def) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 442 | |
| 62368 | 443 | lemma summable_imp_Bseq: "summable f \<Longrightarrow> Bseq f" | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 444 | by (simp add: convergent_imp_Bseq summable_imp_convergent) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 445 | |
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 446 | end | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 447 | |
| 59613 
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
 paulson <lp15@cam.ac.uk> parents: 
59025diff
changeset | 448 | lemma summable_minus_iff: | 
| 
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
 paulson <lp15@cam.ac.uk> parents: 
59025diff
changeset | 449 | fixes f :: "nat \<Rightarrow> 'a::real_normed_vector" | 
| 
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
 paulson <lp15@cam.ac.uk> parents: 
59025diff
changeset | 450 | shows "summable (\<lambda>n. - f n) \<longleftrightarrow> summable f" | 
| 61799 | 451 | by (auto dest: summable_minus) \<comment>\<open>used two ways, hence must be outside the context above\<close> | 
| 59613 
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
 paulson <lp15@cam.ac.uk> parents: 
59025diff
changeset | 452 | |
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 453 | lemma (in bounded_linear) sums: "(\<lambda>n. X n) sums a \<Longrightarrow> (\<lambda>n. f (X n)) sums (f a)" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 454 | unfolding sums_def by (drule tendsto, simp only: setsum) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 455 | |
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 456 | lemma (in bounded_linear) summable: "summable (\<lambda>n. X n) \<Longrightarrow> summable (\<lambda>n. f (X n))" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 457 | unfolding summable_def by (auto intro: sums) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 458 | |
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 459 | lemma (in bounded_linear) suminf: "summable (\<lambda>n. X n) \<Longrightarrow> f (\<Sum>n. X n) = (\<Sum>n. f (X n))" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 460 | by (intro sums_unique sums summable_sums) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 461 | |
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 462 | lemmas sums_of_real = bounded_linear.sums [OF bounded_linear_of_real] | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 463 | lemmas summable_of_real = bounded_linear.summable [OF bounded_linear_of_real] | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 464 | lemmas suminf_of_real = bounded_linear.suminf [OF bounded_linear_of_real] | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 465 | |
| 57275 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 hoelzl parents: 
57129diff
changeset | 466 | lemmas sums_scaleR_left = bounded_linear.sums[OF bounded_linear_scaleR_left] | 
| 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 hoelzl parents: 
57129diff
changeset | 467 | lemmas summable_scaleR_left = bounded_linear.summable[OF bounded_linear_scaleR_left] | 
| 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 hoelzl parents: 
57129diff
changeset | 468 | lemmas suminf_scaleR_left = bounded_linear.suminf[OF bounded_linear_scaleR_left] | 
| 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 hoelzl parents: 
57129diff
changeset | 469 | |
| 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 hoelzl parents: 
57129diff
changeset | 470 | lemmas sums_scaleR_right = bounded_linear.sums[OF bounded_linear_scaleR_right] | 
| 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 hoelzl parents: 
57129diff
changeset | 471 | lemmas summable_scaleR_right = bounded_linear.summable[OF bounded_linear_scaleR_right] | 
| 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 hoelzl parents: 
57129diff
changeset | 472 | lemmas suminf_scaleR_right = bounded_linear.suminf[OF bounded_linear_scaleR_right] | 
| 
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
 hoelzl parents: 
57129diff
changeset | 473 | |
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 474 | lemma summable_const_iff: "summable (\<lambda>_. c) \<longleftrightarrow> (c :: 'a :: real_normed_vector) = 0" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 475 | proof - | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 476 |   {
 | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 477 | assume "c \<noteq> 0" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 478 | hence "filterlim (\<lambda>n. of_nat n * norm c) at_top sequentially" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 479 | by (subst mult.commute) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 480 | (auto intro!: filterlim_tendsto_pos_mult_at_top filterlim_real_sequentially) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 481 | hence "\<not>convergent (\<lambda>n. norm (\<Sum>k<n. c))" | 
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61531diff
changeset | 482 | by (intro filterlim_at_infinity_imp_not_convergent filterlim_at_top_imp_at_infinity) | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 483 | (simp_all add: setsum_constant_scaleR) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 484 | hence "\<not>summable (\<lambda>_. c)" unfolding summable_iff_convergent using convergent_norm by blast | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 485 | } | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 486 | thus ?thesis by auto | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 487 | qed | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 488 | |
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 489 | |
| 60758 | 490 | subsection \<open>Infinite summability on real normed algebras\<close> | 
| 56213 | 491 | |
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 492 | context | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 493 | fixes f :: "nat \<Rightarrow> 'a::real_normed_algebra" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 494 | begin | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 495 | |
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 496 | lemma sums_mult: "f sums a \<Longrightarrow> (\<lambda>n. c * f n) sums (c * a)" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 497 | by (rule bounded_linear.sums [OF bounded_linear_mult_right]) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 498 | |
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 499 | lemma summable_mult: "summable f \<Longrightarrow> summable (\<lambda>n. c * f n)" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 500 | by (rule bounded_linear.summable [OF bounded_linear_mult_right]) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 501 | |
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 502 | lemma suminf_mult: "summable f \<Longrightarrow> suminf (\<lambda>n. c * f n) = c * suminf f" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 503 | by (rule bounded_linear.suminf [OF bounded_linear_mult_right, symmetric]) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 504 | |
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 505 | lemma sums_mult2: "f sums a \<Longrightarrow> (\<lambda>n. f n * c) sums (a * c)" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 506 | by (rule bounded_linear.sums [OF bounded_linear_mult_left]) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 507 | |
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 508 | lemma summable_mult2: "summable f \<Longrightarrow> summable (\<lambda>n. f n * c)" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 509 | by (rule bounded_linear.summable [OF bounded_linear_mult_left]) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 510 | |
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 511 | lemma suminf_mult2: "summable f \<Longrightarrow> suminf f * c = (\<Sum>n. f n * c)" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 512 | by (rule bounded_linear.suminf [OF bounded_linear_mult_left]) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 513 | |
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 514 | end | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 515 | |
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 516 | lemma sums_mult_iff: | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 517 | assumes "c \<noteq> 0" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 518 |   shows   "(\<lambda>n. c * f n :: 'a :: {real_normed_algebra,field}) sums (c * d) \<longleftrightarrow> f sums d"
 | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 519 | using sums_mult[of f d c] sums_mult[of "\<lambda>n. c * f n" "c * d" "inverse c"] | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 520 | by (force simp: field_simps assms) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 521 | |
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 522 | lemma sums_mult2_iff: | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 523 |   assumes "c \<noteq> (0 :: 'a :: {real_normed_algebra, field})"
 | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 524 | shows "(\<lambda>n. f n * c) sums (d * c) \<longleftrightarrow> f sums d" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 525 | using sums_mult_iff[OF assms, of f d] by (simp add: mult.commute) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 526 | |
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 527 | lemma sums_of_real_iff: | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 528 | "(\<lambda>n. of_real (f n) :: 'a :: real_normed_div_algebra) sums of_real c \<longleftrightarrow> f sums c" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 529 | by (simp add: sums_def of_real_setsum[symmetric] tendsto_of_real_iff del: of_real_setsum) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 530 | |
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 531 | |
| 60758 | 532 | subsection \<open>Infinite summability on real normed fields\<close> | 
| 56213 | 533 | |
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 534 | context | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 535 | fixes c :: "'a::real_normed_field" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 536 | begin | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 537 | |
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 538 | lemma sums_divide: "f sums a \<Longrightarrow> (\<lambda>n. f n / c) sums (a / c)" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 539 | by (rule bounded_linear.sums [OF bounded_linear_divide]) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 540 | |
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 541 | lemma summable_divide: "summable f \<Longrightarrow> summable (\<lambda>n. f n / c)" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 542 | by (rule bounded_linear.summable [OF bounded_linear_divide]) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 543 | |
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 544 | lemma suminf_divide: "summable f \<Longrightarrow> suminf (\<lambda>n. f n / c) = suminf f / c" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 545 | by (rule bounded_linear.suminf [OF bounded_linear_divide, symmetric]) | 
| 14416 | 546 | |
| 62379 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 paulson <lp15@cam.ac.uk> parents: 
62377diff
changeset | 547 | lemma sums_mult_D: "\<lbrakk>(\<lambda>n. c * f n) sums a; c \<noteq> 0\<rbrakk> \<Longrightarrow> f sums (a/c)" | 
| 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 paulson <lp15@cam.ac.uk> parents: 
62377diff
changeset | 548 | using sums_mult_iff by fastforce | 
| 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 paulson <lp15@cam.ac.uk> parents: 
62377diff
changeset | 549 | |
| 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 paulson <lp15@cam.ac.uk> parents: 
62377diff
changeset | 550 | lemma summable_mult_D: "\<lbrakk>summable (\<lambda>n. c * f n); c \<noteq> 0\<rbrakk> \<Longrightarrow> summable f" | 
| 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 paulson <lp15@cam.ac.uk> parents: 
62377diff
changeset | 551 | by (auto dest: summable_divide) | 
| 
340738057c8c
An assortment of useful lemmas about sums, norm, etc. Also: norm_conv_dist [symmetric] is now a simprule!
 paulson <lp15@cam.ac.uk> parents: 
62377diff
changeset | 552 | |
| 60758 | 553 | text\<open>Sum of a geometric progression.\<close> | 
| 14416 | 554 | |
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 555 | lemma geometric_sums: "norm c < 1 \<Longrightarrow> (\<lambda>n. c^n) sums (1 / (1 - c))" | 
| 20692 | 556 | proof - | 
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 557 | assume less_1: "norm c < 1" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 558 | hence neq_1: "c \<noteq> 1" by auto | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 559 | hence neq_0: "c - 1 \<noteq> 0" by simp | 
| 61969 | 560 | from less_1 have lim_0: "(\<lambda>n. c^n) \<longlonglongrightarrow> 0" | 
| 20692 | 561 | by (rule LIMSEQ_power_zero) | 
| 61969 | 562 | hence "(\<lambda>n. c ^ n / (c - 1) - 1 / (c - 1)) \<longlonglongrightarrow> 0 / (c - 1) - 1 / (c - 1)" | 
| 44568 
e6f291cb5810
discontinue many legacy theorems about LIM and LIMSEQ, in favor of tendsto theorems
 huffman parents: 
44289diff
changeset | 563 | using neq_0 by (intro tendsto_intros) | 
| 61969 | 564 | hence "(\<lambda>n. (c ^ n - 1) / (c - 1)) \<longlonglongrightarrow> 1 / (1 - c)" | 
| 20692 | 565 | by (simp add: nonzero_minus_divide_right [OF neq_0] diff_divide_distrib) | 
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 566 | thus "(\<lambda>n. c ^ n) sums (1 / (1 - c))" | 
| 20692 | 567 | by (simp add: sums_def geometric_sum neq_1) | 
| 568 | qed | |
| 569 | ||
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 570 | lemma summable_geometric: "norm c < 1 \<Longrightarrow> summable (\<lambda>n. c^n)" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 571 | by (rule geometric_sums [THEN sums_summable]) | 
| 14416 | 572 | |
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 573 | lemma suminf_geometric: "norm c < 1 \<Longrightarrow> suminf (\<lambda>n. c^n) = 1 / (1 - c)" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 574 | by (rule sums_unique[symmetric]) (rule geometric_sums) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 575 | |
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 576 | lemma summable_geometric_iff: "summable (\<lambda>n. c ^ n) \<longleftrightarrow> norm c < 1" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 577 | proof | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 578 | assume "summable (\<lambda>n. c ^ n :: 'a :: real_normed_field)" | 
| 61969 | 579 | hence "(\<lambda>n. norm c ^ n) \<longlonglongrightarrow> 0" | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 580 | by (simp add: norm_power [symmetric] tendsto_norm_zero_iff summable_LIMSEQ_zero) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 581 | from order_tendstoD(2)[OF this zero_less_one] obtain n where "norm c ^ n < 1" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 582 | by (auto simp: eventually_at_top_linorder) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 583 | thus "norm c < 1" using one_le_power[of "norm c" n] by (cases "norm c \<ge> 1") (linarith, simp) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 584 | qed (rule summable_geometric) | 
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61531diff
changeset | 585 | |
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 586 | end | 
| 33271 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 paulson parents: 
32877diff
changeset | 587 | |
| 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 paulson parents: 
32877diff
changeset | 588 | lemma power_half_series: "(\<lambda>n. (1/2::real)^Suc n) sums 1" | 
| 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 paulson parents: 
32877diff
changeset | 589 | proof - | 
| 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 paulson parents: 
32877diff
changeset | 590 | have 2: "(\<lambda>n. (1/2::real)^n) sums 2" using geometric_sums [of "1/2::real"] | 
| 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 paulson parents: 
32877diff
changeset | 591 | by auto | 
| 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 paulson parents: 
32877diff
changeset | 592 | have "(\<lambda>n. (1/2::real)^Suc n) = (\<lambda>n. (1 / 2) ^ n / 2)" | 
| 59741 
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
 paulson <lp15@cam.ac.uk> parents: 
59712diff
changeset | 593 | by (simp add: mult.commute) | 
| 44282 
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
 huffman parents: 
41970diff
changeset | 594 | thus ?thesis using sums_divide [OF 2, of 2] | 
| 33271 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 paulson parents: 
32877diff
changeset | 595 | by simp | 
| 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 paulson parents: 
32877diff
changeset | 596 | qed | 
| 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 paulson parents: 
32877diff
changeset | 597 | |
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 598 | |
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 599 | subsection \<open>Telescoping\<close> | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 600 | |
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 601 | lemma telescope_sums: | 
| 61969 | 602 | assumes "f \<longlonglongrightarrow> (c :: 'a :: real_normed_vector)" | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 603 | shows "(\<lambda>n. f (Suc n) - f n) sums (c - f 0)" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 604 | unfolding sums_def | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 605 | proof (subst LIMSEQ_Suc_iff [symmetric]) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 606 | have "(\<lambda>n. \<Sum>k<Suc n. f (Suc k) - f k) = (\<lambda>n. f (Suc n) - f 0)" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 607 | by (simp add: lessThan_Suc_atMost atLeast0AtMost [symmetric] setsum_Suc_diff) | 
| 61969 | 608 | also have "\<dots> \<longlonglongrightarrow> c - f 0" by (intro tendsto_diff LIMSEQ_Suc[OF assms] tendsto_const) | 
| 609 | finally show "(\<lambda>n. \<Sum>n<Suc n. f (Suc n) - f n) \<longlonglongrightarrow> c - f 0" . | |
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 610 | qed | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 611 | |
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 612 | lemma telescope_sums': | 
| 61969 | 613 | assumes "f \<longlonglongrightarrow> (c :: 'a :: real_normed_vector)" | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 614 | shows "(\<lambda>n. f n - f (Suc n)) sums (f 0 - c)" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 615 | using sums_minus[OF telescope_sums[OF assms]] by (simp add: algebra_simps) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 616 | |
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 617 | lemma telescope_summable: | 
| 61969 | 618 | assumes "f \<longlonglongrightarrow> (c :: 'a :: real_normed_vector)" | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 619 | shows "summable (\<lambda>n. f (Suc n) - f n)" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 620 | using telescope_sums[OF assms] by (simp add: sums_iff) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 621 | |
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 622 | lemma telescope_summable': | 
| 61969 | 623 | assumes "f \<longlonglongrightarrow> (c :: 'a :: real_normed_vector)" | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 624 | shows "summable (\<lambda>n. f n - f (Suc n))" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 625 | using summable_minus[OF telescope_summable[OF assms]] by (simp add: algebra_simps) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 626 | |
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 627 | |
| 60758 | 628 | subsection \<open>Infinite summability on Banach spaces\<close> | 
| 56213 | 629 | |
| 60758 | 630 | text\<open>Cauchy-type criterion for convergence of series (c.f. Harrison)\<close> | 
| 15085 
5693a977a767
removed some [iff] declarations from RealDef.thy, concerning inequalities
 paulson parents: 
15053diff
changeset | 631 | |
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 632 | lemma summable_Cauchy: | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 633 | fixes f :: "nat \<Rightarrow> 'a::banach" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 634 |   shows "summable f \<longleftrightarrow> (\<forall>e>0. \<exists>N. \<forall>m\<ge>N. \<forall>n. norm (setsum f {m..<n}) < e)"
 | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 635 | apply (simp only: summable_iff_convergent Cauchy_convergent_iff [symmetric] Cauchy_iff, safe) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 636 | apply (drule spec, drule (1) mp) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 637 | apply (erule exE, rule_tac x="M" in exI, clarify) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 638 | apply (rule_tac x="m" and y="n" in linorder_le_cases) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 639 | apply (frule (1) order_trans) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 640 | apply (drule_tac x="n" in spec, drule (1) mp) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 641 | apply (drule_tac x="m" in spec, drule (1) mp) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 642 | apply (simp_all add: setsum_diff [symmetric]) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 643 | apply (drule spec, drule (1) mp) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 644 | apply (erule exE, rule_tac x="N" in exI, clarify) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 645 | apply (rule_tac x="m" and y="n" in linorder_le_cases) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 646 | apply (subst norm_minus_commute) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 647 | apply (simp_all add: setsum_diff [symmetric]) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 648 | done | 
| 14416 | 649 | |
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 650 | context | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 651 | fixes f :: "nat \<Rightarrow> 'a::banach" | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 652 | begin | 
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 653 | |
| 60758 | 654 | text\<open>Absolute convergence imples normal convergence\<close> | 
| 20689 | 655 | |
| 56194 | 656 | lemma summable_norm_cancel: "summable (\<lambda>n. norm (f n)) \<Longrightarrow> summable f" | 
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 657 | apply (simp only: summable_Cauchy, safe) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 658 | apply (drule_tac x="e" in spec, safe) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 659 | apply (rule_tac x="N" in exI, safe) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 660 | apply (drule_tac x="m" in spec, safe) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 661 | apply (rule order_le_less_trans [OF norm_setsum]) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 662 | apply (rule order_le_less_trans [OF abs_ge_self]) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 663 | apply simp | 
| 50999 | 664 | done | 
| 32707 
836ec9d0a0c8
New lemmas involving the real numbers, especially limits and series
 paulson parents: 
31336diff
changeset | 665 | |
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 666 | lemma summable_norm: "summable (\<lambda>n. norm (f n)) \<Longrightarrow> norm (suminf f) \<le> (\<Sum>n. norm (f n))" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 667 | by (auto intro: LIMSEQ_le tendsto_norm summable_norm_cancel summable_LIMSEQ norm_setsum) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 668 | |
| 60758 | 669 | text \<open>Comparison tests\<close> | 
| 14416 | 670 | |
| 56194 | 671 | lemma summable_comparison_test: "\<exists>N. \<forall>n\<ge>N. norm (f n) \<le> g n \<Longrightarrow> summable g \<Longrightarrow> summable f" | 
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 672 | apply (simp add: summable_Cauchy, safe) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 673 | apply (drule_tac x="e" in spec, safe) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 674 | apply (rule_tac x = "N + Na" in exI, safe) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 675 | apply (rotate_tac 2) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 676 | apply (drule_tac x = m in spec) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 677 | apply (auto, rotate_tac 2, drule_tac x = n in spec) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 678 | apply (rule_tac y = "\<Sum>k=m..<n. norm (f k)" in order_le_less_trans) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 679 | apply (rule norm_setsum) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 680 |   apply (rule_tac y = "setsum g {m..<n}" in order_le_less_trans)
 | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 681 | apply (auto intro: setsum_mono simp add: abs_less_iff) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 682 | done | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 683 | |
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 684 | lemma summable_comparison_test_ev: | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 685 | shows "eventually (\<lambda>n. norm (f n) \<le> g n) sequentially \<Longrightarrow> summable g \<Longrightarrow> summable f" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 686 | by (rule summable_comparison_test) (auto simp: eventually_at_top_linorder) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 687 | |
| 56217 
dc429a5b13c4
Some rationalisation of basic lemmas
 paulson <lp15@cam.ac.uk> parents: 
56213diff
changeset | 688 | (*A better argument order*) | 
| 
dc429a5b13c4
Some rationalisation of basic lemmas
 paulson <lp15@cam.ac.uk> parents: 
56213diff
changeset | 689 | lemma summable_comparison_test': "summable g \<Longrightarrow> (\<And>n. n \<ge> N \<Longrightarrow> norm(f n) \<le> g n) \<Longrightarrow> summable f" | 
| 56369 
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
 hoelzl parents: 
56217diff
changeset | 690 | by (rule summable_comparison_test) auto | 
| 56217 
dc429a5b13c4
Some rationalisation of basic lemmas
 paulson <lp15@cam.ac.uk> parents: 
56213diff
changeset | 691 | |
| 60758 | 692 | subsection \<open>The Ratio Test\<close> | 
| 15085 
5693a977a767
removed some [iff] declarations from RealDef.thy, concerning inequalities
 paulson parents: 
15053diff
changeset | 693 | |
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61531diff
changeset | 694 | lemma summable_ratio_test: | 
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 695 | assumes "c < 1" "\<And>n. n \<ge> N \<Longrightarrow> norm (f (Suc n)) \<le> c * norm (f n)" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 696 | shows "summable f" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 697 | proof cases | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 698 | assume "0 < c" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 699 | show "summable f" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 700 | proof (rule summable_comparison_test) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 701 | show "\<exists>N'. \<forall>n\<ge>N'. norm (f n) \<le> (norm (f N) / (c ^ N)) * c ^ n" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 702 | proof (intro exI allI impI) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 703 | fix n assume "N \<le> n" then show "norm (f n) \<le> (norm (f N) / (c ^ N)) * c ^ n" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 704 | proof (induct rule: inc_induct) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 705 | case (step m) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 706 | moreover have "norm (f (Suc m)) / c ^ Suc m * c ^ n \<le> norm (f m) / c ^ m * c ^ n" | 
| 60758 | 707 | using \<open>0 < c\<close> \<open>c < 1\<close> assms(2)[OF \<open>N \<le> m\<close>] by (simp add: field_simps) | 
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 708 | ultimately show ?case by simp | 
| 60758 | 709 | qed (insert \<open>0 < c\<close>, simp) | 
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 710 | qed | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 711 | show "summable (\<lambda>n. norm (f N) / c ^ N * c ^ n)" | 
| 60758 | 712 | using \<open>0 < c\<close> \<open>c < 1\<close> by (intro summable_mult summable_geometric) simp | 
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 713 | qed | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 714 | next | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 715 | assume c: "\<not> 0 < c" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 716 |   { fix n assume "n \<ge> N"
 | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 717 | then have "norm (f (Suc n)) \<le> c * norm (f n)" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 718 | by fact | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 719 | also have "\<dots> \<le> 0" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 720 | using c by (simp add: not_less mult_nonpos_nonneg) | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 721 | finally have "f (Suc n) = 0" | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 722 | by auto } | 
| 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 723 | then show "summable f" | 
| 56194 | 724 |     by (intro sums_summable[OF sums_finite, of "{.. Suc N}"]) (auto simp: not_le Suc_less_eq2)
 | 
| 56178 | 725 | qed | 
| 726 | ||
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 727 | end | 
| 14416 | 728 | |
| 60758 | 729 | text\<open>Relations among convergence and absolute convergence for power series.\<close> | 
| 56369 
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
 hoelzl parents: 
56217diff
changeset | 730 | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
62049diff
changeset | 731 | lemma Abel_lemma: | 
| 56369 
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
 hoelzl parents: 
56217diff
changeset | 732 | fixes a :: "nat \<Rightarrow> 'a::real_normed_vector" | 
| 
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
 hoelzl parents: 
56217diff
changeset | 733 | assumes r: "0 \<le> r" and r0: "r < r0" and M: "\<And>n. norm (a n) * r0^n \<le> M" | 
| 
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
 hoelzl parents: 
56217diff
changeset | 734 | shows "summable (\<lambda>n. norm (a n) * r^n)" | 
| 
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
 hoelzl parents: 
56217diff
changeset | 735 | proof (rule summable_comparison_test') | 
| 
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
 hoelzl parents: 
56217diff
changeset | 736 | show "summable (\<lambda>n. M * (r / r0) ^ n)" | 
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61531diff
changeset | 737 | using assms | 
| 56369 
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
 hoelzl parents: 
56217diff
changeset | 738 | by (auto simp add: summable_mult summable_geometric) | 
| 
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
 hoelzl parents: 
56217diff
changeset | 739 | next | 
| 
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
 hoelzl parents: 
56217diff
changeset | 740 | fix n | 
| 
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
 hoelzl parents: 
56217diff
changeset | 741 | show "norm (norm (a n) * r ^ n) \<le> M * (r / r0) ^ n" | 
| 
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
 hoelzl parents: 
56217diff
changeset | 742 | using r r0 M [of n] | 
| 60867 | 743 | apply (auto simp add: abs_mult field_simps) | 
| 56369 
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
 hoelzl parents: 
56217diff
changeset | 744 | apply (cases "r=0", simp) | 
| 
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
 hoelzl parents: 
56217diff
changeset | 745 | apply (cases n, auto) | 
| 
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
 hoelzl parents: 
56217diff
changeset | 746 | done | 
| 
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
 hoelzl parents: 
56217diff
changeset | 747 | qed | 
| 
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
 hoelzl parents: 
56217diff
changeset | 748 | |
| 
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
 hoelzl parents: 
56217diff
changeset | 749 | |
| 60758 | 750 | text\<open>Summability of geometric series for real algebras\<close> | 
| 23084 | 751 | |
| 752 | lemma complete_algebra_summable_geometric: | |
| 31017 | 753 |   fixes x :: "'a::{real_normed_algebra_1,banach}"
 | 
| 23084 | 754 | shows "norm x < 1 \<Longrightarrow> summable (\<lambda>n. x ^ n)" | 
| 755 | proof (rule summable_comparison_test) | |
| 756 | show "\<exists>N. \<forall>n\<ge>N. norm (x ^ n) \<le> norm x ^ n" | |
| 757 | by (simp add: norm_power_ineq) | |
| 758 | show "norm x < 1 \<Longrightarrow> summable (\<lambda>n. norm x ^ n)" | |
| 759 | by (simp add: summable_geometric) | |
| 760 | qed | |
| 761 | ||
| 60758 | 762 | subsection \<open>Cauchy Product Formula\<close> | 
| 23111 | 763 | |
| 60758 | 764 | text \<open> | 
| 54703 | 765 | Proof based on Analysis WebNotes: Chapter 07, Class 41 | 
| 766 |   @{url "http://www.math.unl.edu/~webnotes/classes/class41/prp77.htm"}
 | |
| 60758 | 767 | \<close> | 
| 23111 | 768 | |
| 769 | lemma Cauchy_product_sums: | |
| 770 |   fixes a b :: "nat \<Rightarrow> 'a::{real_normed_algebra,banach}"
 | |
| 771 | assumes a: "summable (\<lambda>k. norm (a k))" | |
| 772 | assumes b: "summable (\<lambda>k. norm (b k))" | |
| 56213 | 773 | shows "(\<lambda>k. \<Sum>i\<le>k. a i * b (k - i)) sums ((\<Sum>k. a k) * (\<Sum>k. b k))" | 
| 23111 | 774 | proof - | 
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 775 |   let ?S1 = "\<lambda>n::nat. {..<n} \<times> {..<n}"
 | 
| 23111 | 776 |   let ?S2 = "\<lambda>n::nat. {(i,j). i + j < n}"
 | 
| 777 | have S1_mono: "\<And>m n. m \<le> n \<Longrightarrow> ?S1 m \<subseteq> ?S1 n" by auto | |
| 778 | have S2_le_S1: "\<And>n. ?S2 n \<subseteq> ?S1 n" by auto | |
| 779 | have S1_le_S2: "\<And>n. ?S1 (n div 2) \<subseteq> ?S2 n" by auto | |
| 780 | have finite_S1: "\<And>n. finite (?S1 n)" by simp | |
| 781 | with S2_le_S1 have finite_S2: "\<And>n. finite (?S2 n)" by (rule finite_subset) | |
| 782 | ||
| 783 | let ?g = "\<lambda>(i,j). a i * b j" | |
| 784 | let ?f = "\<lambda>(i,j). norm (a i) * norm (b j)" | |
| 56536 | 785 | have f_nonneg: "\<And>x. 0 \<le> ?f x" by (auto) | 
| 23111 | 786 | hence norm_setsum_f: "\<And>A. norm (setsum ?f A) = setsum ?f A" | 
| 787 | unfolding real_norm_def | |
| 788 | by (simp only: abs_of_nonneg setsum_nonneg [rule_format]) | |
| 789 | ||
| 61969 | 790 | have "(\<lambda>n. (\<Sum>k<n. a k) * (\<Sum>k<n. b k)) \<longlonglongrightarrow> (\<Sum>k. a k) * (\<Sum>k. b k)" | 
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 791 | by (intro tendsto_mult summable_LIMSEQ summable_norm_cancel [OF a] summable_norm_cancel [OF b]) | 
| 61969 | 792 | hence 1: "(\<lambda>n. setsum ?g (?S1 n)) \<longlonglongrightarrow> (\<Sum>k. a k) * (\<Sum>k. b k)" | 
| 57418 | 793 | by (simp only: setsum_product setsum.Sigma [rule_format] finite_lessThan) | 
| 23111 | 794 | |
| 61969 | 795 | have "(\<lambda>n. (\<Sum>k<n. norm (a k)) * (\<Sum>k<n. norm (b k))) \<longlonglongrightarrow> (\<Sum>k. norm (a k)) * (\<Sum>k. norm (b k))" | 
| 56193 
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
 hoelzl parents: 
56178diff
changeset | 796 | using a b by (intro tendsto_mult summable_LIMSEQ) | 
| 61969 | 797 | hence "(\<lambda>n. setsum ?f (?S1 n)) \<longlonglongrightarrow> (\<Sum>k. norm (a k)) * (\<Sum>k. norm (b k))" | 
| 57418 | 798 | by (simp only: setsum_product setsum.Sigma [rule_format] finite_lessThan) | 
| 23111 | 799 | hence "convergent (\<lambda>n. setsum ?f (?S1 n))" | 
| 800 | by (rule convergentI) | |
| 801 | hence Cauchy: "Cauchy (\<lambda>n. setsum ?f (?S1 n))" | |
| 802 | by (rule convergent_Cauchy) | |
| 36657 | 803 | have "Zfun (\<lambda>n. setsum ?f (?S1 n - ?S2 n)) sequentially" | 
| 804 | proof (rule ZfunI, simp only: eventually_sequentially norm_setsum_f) | |
| 23111 | 805 | fix r :: real | 
| 806 | assume r: "0 < r" | |
| 807 | from CauchyD [OF Cauchy r] obtain N | |
| 808 | where "\<forall>m\<ge>N. \<forall>n\<ge>N. norm (setsum ?f (?S1 m) - setsum ?f (?S1 n)) < r" .. | |
| 809 | hence "\<And>m n. \<lbrakk>N \<le> n; n \<le> m\<rbrakk> \<Longrightarrow> norm (setsum ?f (?S1 m - ?S1 n)) < r" | |
| 810 | by (simp only: setsum_diff finite_S1 S1_mono) | |
| 811 | hence N: "\<And>m n. \<lbrakk>N \<le> n; n \<le> m\<rbrakk> \<Longrightarrow> setsum ?f (?S1 m - ?S1 n) < r" | |
| 812 | by (simp only: norm_setsum_f) | |
| 813 | show "\<exists>N. \<forall>n\<ge>N. setsum ?f (?S1 n - ?S2 n) < r" | |
| 814 | proof (intro exI allI impI) | |
| 815 | fix n assume "2 * N \<le> n" | |
| 816 | hence n: "N \<le> n div 2" by simp | |
| 817 | have "setsum ?f (?S1 n - ?S2 n) \<le> setsum ?f (?S1 n - ?S1 (n div 2))" | |
| 818 | by (intro setsum_mono2 finite_Diff finite_S1 f_nonneg | |
| 819 | Diff_mono subset_refl S1_le_S2) | |
| 820 | also have "\<dots> < r" | |
| 821 | using n div_le_dividend by (rule N) | |
| 822 | finally show "setsum ?f (?S1 n - ?S2 n) < r" . | |
| 823 | qed | |
| 824 | qed | |
| 36657 | 825 | hence "Zfun (\<lambda>n. setsum ?g (?S1 n - ?S2 n)) sequentially" | 
| 826 | apply (rule Zfun_le [rule_format]) | |
| 23111 | 827 | apply (simp only: norm_setsum_f) | 
| 828 | apply (rule order_trans [OF norm_setsum setsum_mono]) | |
| 829 | apply (auto simp add: norm_mult_ineq) | |
| 830 | done | |
| 61969 | 831 | hence 2: "(\<lambda>n. setsum ?g (?S1 n) - setsum ?g (?S2 n)) \<longlonglongrightarrow> 0" | 
| 36660 
1cc4ab4b7ff7
make (X ----> L) an abbreviation for (X ---> L) sequentially
 huffman parents: 
36657diff
changeset | 832 | unfolding tendsto_Zfun_iff diff_0_right | 
| 36657 | 833 | by (simp only: setsum_diff finite_S1 S2_le_S1) | 
| 23111 | 834 | |
| 61969 | 835 | with 1 have "(\<lambda>n. setsum ?g (?S2 n)) \<longlonglongrightarrow> (\<Sum>k. a k) * (\<Sum>k. b k)" | 
| 60141 
833adf7db7d8
New material, mostly about limits. Consolidation.
 paulson <lp15@cam.ac.uk> parents: 
59741diff
changeset | 836 | by (rule Lim_transform2) | 
| 23111 | 837 | thus ?thesis by (simp only: sums_def setsum_triangle_reindex) | 
| 838 | qed | |
| 839 | ||
| 840 | lemma Cauchy_product: | |
| 841 |   fixes a b :: "nat \<Rightarrow> 'a::{real_normed_algebra,banach}"
 | |
| 842 | assumes a: "summable (\<lambda>k. norm (a k))" | |
| 843 | assumes b: "summable (\<lambda>k. norm (b k))" | |
| 56213 | 844 | shows "(\<Sum>k. a k) * (\<Sum>k. b k) = (\<Sum>k. \<Sum>i\<le>k. a i * b (k - i))" | 
| 845 | using a b | |
| 846 | by (rule Cauchy_product_sums [THEN sums_unique]) | |
| 847 | ||
| 62049 
b0f941e207cf
Added lots of material on infinite sums, convergence radii, harmonic numbers, Gamma function
 eberlm parents: 
61969diff
changeset | 848 | lemma summable_Cauchy_product: | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
62049diff
changeset | 849 |   assumes "summable (\<lambda>k. norm (a k :: 'a :: {real_normed_algebra,banach}))"
 | 
| 62049 
b0f941e207cf
Added lots of material on infinite sums, convergence radii, harmonic numbers, Gamma function
 eberlm parents: 
61969diff
changeset | 850 | "summable (\<lambda>k. norm (b k))" | 
| 
b0f941e207cf
Added lots of material on infinite sums, convergence radii, harmonic numbers, Gamma function
 eberlm parents: 
61969diff
changeset | 851 | shows "summable (\<lambda>k. \<Sum>i\<le>k. a i * b (k - i))" | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
62049diff
changeset | 852 | using Cauchy_product_sums[OF assms] by (simp add: sums_iff) | 
| 62049 
b0f941e207cf
Added lots of material on infinite sums, convergence radii, harmonic numbers, Gamma function
 eberlm parents: 
61969diff
changeset | 853 | |
| 60758 | 854 | subsection \<open>Series on @{typ real}s\<close>
 | 
| 56213 | 855 | |
| 856 | lemma summable_norm_comparison_test: "\<exists>N. \<forall>n\<ge>N. norm (f n) \<le> g n \<Longrightarrow> summable g \<Longrightarrow> summable (\<lambda>n. norm (f n))" | |
| 857 | by (rule summable_comparison_test) auto | |
| 858 | ||
| 859 | lemma summable_rabs_comparison_test: "\<lbrakk>\<exists>N. \<forall>n\<ge>N. \<bar>f n\<bar> \<le> g n; summable g\<rbrakk> \<Longrightarrow> summable (\<lambda>n. \<bar>f n :: real\<bar>)" | |
| 860 | by (rule summable_comparison_test) auto | |
| 861 | ||
| 862 | lemma summable_rabs_cancel: "summable (\<lambda>n. \<bar>f n :: real\<bar>) \<Longrightarrow> summable f" | |
| 863 | by (rule summable_norm_cancel) simp | |
| 864 | ||
| 865 | lemma summable_rabs: "summable (\<lambda>n. \<bar>f n :: real\<bar>) \<Longrightarrow> \<bar>suminf f\<bar> \<le> (\<Sum>n. \<bar>f n\<bar>)" | |
| 866 | by (fold real_norm_def) (rule summable_norm) | |
| 23111 | 867 | |
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 868 | lemma summable_zero_power [simp]: "summable (\<lambda>n. 0 ^ n :: 'a :: {comm_ring_1,topological_space})"
 | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 869 | proof - | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 870 | have "(\<lambda>n. 0 ^ n :: 'a) = (\<lambda>n. if n = 0 then 0^0 else 0)" by (intro ext) (simp add: zero_power) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 871 | moreover have "summable \<dots>" by simp | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 872 | ultimately show ?thesis by simp | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 873 | qed | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 874 | |
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 875 | lemma summable_zero_power' [simp]: "summable (\<lambda>n. f n * 0 ^ n :: 'a :: {ring_1,topological_space})"
 | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 876 | proof - | 
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61531diff
changeset | 877 | have "(\<lambda>n. f n * 0 ^ n :: 'a) = (\<lambda>n. if n = 0 then f 0 * 0^0 else 0)" | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 878 | by (intro ext) (simp add: zero_power) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 879 | moreover have "summable \<dots>" by simp | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 880 | ultimately show ?thesis by simp | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 881 | qed | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 882 | |
| 59000 | 883 | lemma summable_power_series: | 
| 884 | fixes z :: real | |
| 885 | assumes le_1: "\<And>i. f i \<le> 1" and nonneg: "\<And>i. 0 \<le> f i" and z: "0 \<le> z" "z < 1" | |
| 886 | shows "summable (\<lambda>i. f i * z^i)" | |
| 887 | proof (rule summable_comparison_test[OF _ summable_geometric]) | |
| 888 | show "norm z < 1" using z by (auto simp: less_imp_le) | |
| 889 | show "\<And>n. \<exists>N. \<forall>na\<ge>N. norm (f na * z ^ na) \<le> z ^ na" | |
| 890 | using z by (auto intro!: exI[of _ 0] mult_left_le_one_le simp: abs_mult nonneg power_abs less_imp_le le_1) | |
| 891 | qed | |
| 892 | ||
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 893 | lemma summable_0_powser: | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 894 | "summable (\<lambda>n. f n * 0 ^ n :: 'a :: real_normed_div_algebra)" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 895 | proof - | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 896 | have A: "(\<lambda>n. f n * 0 ^ n) = (\<lambda>n. if n = 0 then f n else 0)" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 897 | by (intro ext) auto | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 898 | thus ?thesis by (subst A) simp_all | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 899 | qed | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 900 | |
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 901 | lemma summable_powser_split_head: | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 902 | "summable (\<lambda>n. f (Suc n) * z ^ n :: 'a :: real_normed_div_algebra) = summable (\<lambda>n. f n * z ^ n)" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 903 | proof - | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 904 | have "summable (\<lambda>n. f (Suc n) * z ^ n) \<longleftrightarrow> summable (\<lambda>n. f (Suc n) * z ^ Suc n)" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 905 | proof | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 906 | assume "summable (\<lambda>n. f (Suc n) * z ^ n)" | 
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61531diff
changeset | 907 | from summable_mult2[OF this, of z] show "summable (\<lambda>n. f (Suc n) * z ^ Suc n)" | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 908 | by (simp add: power_commutes algebra_simps) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 909 | next | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 910 | assume "summable (\<lambda>n. f (Suc n) * z ^ Suc n)" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 911 | from summable_mult2[OF this, of "inverse z"] show "summable (\<lambda>n. f (Suc n) * z ^ n)" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 912 | by (cases "z \<noteq> 0", subst (asm) power_Suc2) (simp_all add: algebra_simps) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 913 | qed | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 914 | also have "\<dots> \<longleftrightarrow> summable (\<lambda>n. f n * z ^ n)" by (rule summable_Suc_iff) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 915 | finally show ?thesis . | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 916 | qed | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 917 | |
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 918 | lemma powser_split_head: | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 919 |   assumes "summable (\<lambda>n. f n * z ^ n :: 'a :: {real_normed_div_algebra,banach})"
 | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 920 | shows "suminf (\<lambda>n. f n * z ^ n) = f 0 + suminf (\<lambda>n. f (Suc n) * z ^ n) * z" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 921 | "suminf (\<lambda>n. f (Suc n) * z ^ n) * z = suminf (\<lambda>n. f n * z ^ n) - f 0" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 922 | "summable (\<lambda>n. f (Suc n) * z ^ n)" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 923 | proof - | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 924 | from assms show "summable (\<lambda>n. f (Suc n) * z ^ n)" by (subst summable_powser_split_head) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 925 | |
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61531diff
changeset | 926 | from suminf_mult2[OF this, of z] | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 927 | have "(\<Sum>n. f (Suc n) * z ^ n) * z = (\<Sum>n. f (Suc n) * z ^ Suc n)" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 928 | by (simp add: power_commutes algebra_simps) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 929 | also from assms have "\<dots> = suminf (\<lambda>n. f n * z ^ n) - f 0" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 930 | by (subst suminf_split_head) simp_all | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 931 | finally show "suminf (\<lambda>n. f n * z ^ n) = f 0 + suminf (\<lambda>n. f (Suc n) * z ^ n) * z" by simp | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 932 | thus "suminf (\<lambda>n. f (Suc n) * z ^ n) * z = suminf (\<lambda>n. f n * z ^ n) - f 0" by simp | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 933 | qed | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 934 | |
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 935 | lemma summable_partial_sum_bound: | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 936 | fixes f :: "nat \<Rightarrow> 'a :: banach" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 937 | assumes summable: "summable f" and e: "e > (0::real)" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 938 | obtains N where "\<And>m n. m \<ge> N \<Longrightarrow> norm (\<Sum>k=m..n. f k) < e" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 939 | proof - | 
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61531diff
changeset | 940 | from summable have "Cauchy (\<lambda>n. \<Sum>k<n. f k)" | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 941 | by (simp add: Cauchy_convergent_iff summable_iff_convergent) | 
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61531diff
changeset | 942 | from CauchyD[OF this e] obtain N | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 943 | where N: "\<And>m n. m \<ge> N \<Longrightarrow> n \<ge> N \<Longrightarrow> norm ((\<Sum>k<m. f k) - (\<Sum>k<n. f k)) < e" by blast | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 944 |   {
 | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 945 | fix m n :: nat assume m: "m \<ge> N" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 946 | have "norm (\<Sum>k=m..n. f k) < e" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 947 | proof (cases "n \<ge> m") | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 948 | assume n: "n \<ge> m" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 949 | with m have "norm ((\<Sum>k<Suc n. f k) - (\<Sum>k<m. f k)) < e" by (intro N) simp_all | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 950 | also from n have "(\<Sum>k<Suc n. f k) - (\<Sum>k<m. f k) = (\<Sum>k=m..n. f k)" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 951 | by (subst setsum_diff [symmetric]) (simp_all add: setsum_last_plus) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 952 | finally show ?thesis . | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 953 | qed (insert e, simp_all) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 954 | } | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 955 | thus ?thesis by (rule that) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 956 | qed | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 957 | |
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61531diff
changeset | 958 | lemma powser_sums_if: | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 959 |   "(\<lambda>n. (if n = m then (1 :: 'a :: {ring_1,topological_space}) else 0) * z^n) sums z^m"
 | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 960 | proof - | 
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61531diff
changeset | 961 | have "(\<lambda>n. (if n = m then 1 else 0) * z^n) = (\<lambda>n. if n = m then z^n else 0)" | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 962 | by (intro ext) auto | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 963 | thus ?thesis by (simp add: sums_single) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 964 | qed | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 965 | |
| 59025 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 966 | lemma | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 967 | fixes f :: "nat \<Rightarrow> real" | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 968 | assumes "summable f" | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 969 | and "inj g" | 
| 62368 | 970 | and pos: "\<And>x. 0 \<le> f x" | 
| 59025 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 971 | shows summable_reindex: "summable (f o g)" | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 972 | and suminf_reindex_mono: "suminf (f o g) \<le> suminf f" | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 973 | and suminf_reindex: "(\<And>x. x \<notin> range g \<Longrightarrow> f x = 0) \<Longrightarrow> suminf (f \<circ> g) = suminf f" | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 974 | proof - | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 975 | from \<open>inj g\<close> have [simp]: "\<And>A. inj_on g A" by(rule subset_inj_on) simp | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 976 | |
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 977 | have smaller: "\<forall>n. (\<Sum>i<n. (f \<circ> g) i) \<le> suminf f" | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 978 | proof | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 979 | fix n | 
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61531diff
changeset | 980 |     have "\<forall> n' \<in> (g ` {..<n}). n' < Suc (Max (g ` {..<n}))"
 | 
| 59025 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 981 | by(metis Max_ge finite_imageI finite_lessThan not_le not_less_eq) | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 982 | then obtain m where n: "\<And>n'. n' < n \<Longrightarrow> g n' < m" by blast | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 983 | |
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 984 |     have "(\<Sum>i<n. f (g i)) = setsum f (g ` {..<n})"
 | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 985 | by (simp add: setsum.reindex) | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 986 | also have "\<dots> \<le> (\<Sum>i<m. f i)" | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 987 | by (rule setsum_mono3) (auto simp add: pos n[rule_format]) | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 988 | also have "\<dots> \<le> suminf f" | 
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61531diff
changeset | 989 | using \<open>summable f\<close> | 
| 59025 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 990 | by (rule setsum_le_suminf) (simp add: pos) | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 991 | finally show "(\<Sum>i<n. (f \<circ> g) i) \<le> suminf f" by simp | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 992 | qed | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 993 | |
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 994 | have "incseq (\<lambda>n. \<Sum>i<n. (f \<circ> g) i)" | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 995 | by (rule incseq_SucI) (auto simp add: pos) | 
| 61969 | 996 | then obtain L where L: "(\<lambda> n. \<Sum>i<n. (f \<circ> g) i) \<longlonglongrightarrow> L" | 
| 59025 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 997 | using smaller by(rule incseq_convergent) | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 998 | hence "(f \<circ> g) sums L" by (simp add: sums_def) | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 999 | thus "summable (f o g)" by (auto simp add: sums_iff) | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 1000 | |
| 61969 | 1001 | hence "(\<lambda>n. \<Sum>i<n. (f \<circ> g) i) \<longlonglongrightarrow> suminf (f \<circ> g)" | 
| 59025 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 1002 | by(rule summable_LIMSEQ) | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 1003 | thus le: "suminf (f \<circ> g) \<le> suminf f" | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 1004 | by(rule LIMSEQ_le_const2)(blast intro: smaller[rule_format]) | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 1005 | |
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 1006 | assume f: "\<And>x. x \<notin> range g \<Longrightarrow> f x = 0" | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 1007 | |
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 1008 | from \<open>summable f\<close> have "suminf f \<le> suminf (f \<circ> g)" | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 1009 | proof(rule suminf_le_const) | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 1010 | fix n | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 1011 |     have "\<forall> n' \<in> (g -` {..<n}). n' < Suc (Max (g -` {..<n}))"
 | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 1012 | by(auto intro: Max_ge simp add: finite_vimageI less_Suc_eq_le) | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 1013 | then obtain m where n: "\<And>n'. g n' < n \<Longrightarrow> n' < m" by blast | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 1014 | |
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 1015 |     have "(\<Sum>i<n. f i) = (\<Sum>i\<in>{..<n} \<inter> range g. f i)"
 | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 1016 | using f by(auto intro: setsum.mono_neutral_cong_right) | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 1017 |     also have "\<dots> = (\<Sum>i\<in>g -` {..<n}. (f \<circ> g) i)"
 | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 1018 | by(rule setsum.reindex_cong[where l=g])(auto) | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 1019 | also have "\<dots> \<le> (\<Sum>i<m. (f \<circ> g) i)" | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 1020 | by(rule setsum_mono3)(auto simp add: pos n) | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 1021 | also have "\<dots> \<le> suminf (f \<circ> g)" | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 1022 | using \<open>summable (f o g)\<close> | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 1023 | by(rule setsum_le_suminf)(simp add: pos) | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 1024 |     finally show "setsum f {..<n} \<le> suminf (f \<circ> g)" .
 | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 1025 | qed | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 1026 | with le show "suminf (f \<circ> g) = suminf f" by(rule antisym) | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 1027 | qed | 
| 
d885cff91200
add lemma following a proof suggestion by Joachim Breitner
 Andreas Lochbihler parents: 
59000diff
changeset | 1028 | |
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1029 | lemma sums_mono_reindex: | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1030 | assumes subseq: "subseq g" and zero: "\<And>n. n \<notin> range g \<Longrightarrow> f n = 0" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1031 | shows "(\<lambda>n. f (g n)) sums c \<longleftrightarrow> f sums c" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1032 | unfolding sums_def | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1033 | proof | 
| 61969 | 1034 | assume lim: "(\<lambda>n. \<Sum>k<n. f k) \<longlonglongrightarrow> c" | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1035 | have "(\<lambda>n. \<Sum>k<n. f (g k)) = (\<lambda>n. \<Sum>k<g n. f k)" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1036 | proof | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1037 | fix n :: nat | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1038 |     from subseq have "(\<Sum>k<n. f (g k)) = (\<Sum>k\<in>g`{..<n}. f k)"
 | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1039 | by (subst setsum.reindex) (auto intro: subseq_imp_inj_on) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1040 | also from subseq have "\<dots> = (\<Sum>k<g n. f k)" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1041 | by (intro setsum.mono_neutral_left ballI zero) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1042 | (auto dest: subseq_strict_mono simp: strict_mono_less strict_mono_less_eq) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1043 | finally show "(\<Sum>k<n. f (g k)) = (\<Sum>k<g n. f k)" . | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1044 | qed | 
| 61969 | 1045 | also from LIMSEQ_subseq_LIMSEQ[OF lim subseq] have "\<dots> \<longlonglongrightarrow> c" unfolding o_def . | 
| 1046 | finally show "(\<lambda>n. \<Sum>k<n. f (g k)) \<longlonglongrightarrow> c" . | |
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1047 | next | 
| 61969 | 1048 | assume lim: "(\<lambda>n. \<Sum>k<n. f (g k)) \<longlonglongrightarrow> c" | 
| 63040 | 1049 | define g_inv where "g_inv n = (LEAST m. g m \<ge> n)" for n | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1050 | from filterlim_subseq[OF subseq] have g_inv_ex: "\<exists>m. g m \<ge> n" for n | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1051 | by (auto simp: filterlim_at_top eventually_at_top_linorder) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1052 | hence g_inv: "g (g_inv n) \<ge> n" for n unfolding g_inv_def by (rule LeastI_ex) | 
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61531diff
changeset | 1053 | have g_inv_least: "m \<ge> g_inv n" if "g m \<ge> n" for m n using that | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1054 | unfolding g_inv_def by (rule Least_le) | 
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61531diff
changeset | 1055 | have g_inv_least': "g m < n" if "m < g_inv n" for m n using that g_inv_least[of n m] by linarith | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1056 | have "(\<lambda>n. \<Sum>k<n. f k) = (\<lambda>n. \<Sum>k<g_inv n. f (g k))" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1057 | proof | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1058 | fix n :: nat | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1059 |     {
 | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1060 |       fix k assume k: "k \<in> {..<n} - g`{..<g_inv n}"
 | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1061 | have "k \<notin> range g" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1062 | proof (rule notI, elim imageE) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1063 | fix l assume l: "k = g l" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1064 | have "g l < g (g_inv n)" by (rule less_le_trans[OF _ g_inv]) (insert k l, simp_all) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1065 | with subseq have "l < g_inv n" by (simp add: subseq_strict_mono strict_mono_less) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1066 | with k l show False by simp | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1067 | qed | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1068 | hence "f k = 0" by (rule zero) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1069 | } | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1070 |     with g_inv_least' g_inv have "(\<Sum>k<n. f k) = (\<Sum>k\<in>g`{..<g_inv n}. f k)"
 | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1071 | by (intro setsum.mono_neutral_right) auto | 
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61531diff
changeset | 1072 | also from subseq have "\<dots> = (\<Sum>k<g_inv n. f (g k))" using subseq_imp_inj_on | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1073 | by (subst setsum.reindex) simp_all | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1074 | finally show "(\<Sum>k<n. f k) = (\<Sum>k<g_inv n. f (g k))" . | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1075 | qed | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1076 |   also {
 | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1077 | fix K n :: nat assume "g K \<le> n" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1078 | also have "n \<le> g (g_inv n)" by (rule g_inv) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1079 | finally have "K \<le> g_inv n" using subseq by (simp add: strict_mono_less_eq subseq_strict_mono) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1080 | } | 
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61531diff
changeset | 1081 | hence "filterlim g_inv at_top sequentially" | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1082 | by (auto simp: filterlim_at_top eventually_at_top_linorder) | 
| 61969 | 1083 | from lim and this have "(\<lambda>n. \<Sum>k<g_inv n. f (g k)) \<longlonglongrightarrow> c" by (rule filterlim_compose) | 
| 1084 | finally show "(\<lambda>n. \<Sum>k<n. f k) \<longlonglongrightarrow> c" . | |
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1085 | qed | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1086 | |
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1087 | lemma summable_mono_reindex: | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1088 | assumes subseq: "subseq g" and zero: "\<And>n. n \<notin> range g \<Longrightarrow> f n = 0" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1089 | shows "summable (\<lambda>n. f (g n)) \<longleftrightarrow> summable f" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1090 | using sums_mono_reindex[of g f, OF assms] by (simp add: summable_def) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1091 | |
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61531diff
changeset | 1092 | lemma suminf_mono_reindex: | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1093 |   assumes "subseq g" "\<And>n. n \<notin> range g \<Longrightarrow> f n = (0 :: 'a :: {t2_space,comm_monoid_add})"
 | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1094 | shows "suminf (\<lambda>n. f (g n)) = suminf f" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1095 | proof (cases "summable f") | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1096 | case False | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1097 | hence "\<not>(\<exists>c. f sums c)" unfolding summable_def by blast | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1098 | hence "suminf f = The (\<lambda>_. False)" by (simp add: suminf_def) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1099 | moreover from False have "\<not>summable (\<lambda>n. f (g n))" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1100 | using summable_mono_reindex[of g f, OF assms] by simp | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1101 | hence "\<not>(\<exists>c. (\<lambda>n. f (g n)) sums c)" unfolding summable_def by blast | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1102 | hence "suminf (\<lambda>n. f (g n)) = The (\<lambda>_. False)" by (simp add: suminf_def) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1103 | ultimately show ?thesis by simp | 
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61531diff
changeset | 1104 | qed (insert sums_mono_reindex[of g f, OF assms] summable_mono_reindex[of g f, OF assms], | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1105 | simp_all add: sums_iff) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
60867diff
changeset | 1106 | |
| 14416 | 1107 | end |