| author | wenzelm | 
| Sat, 10 Oct 2020 21:12:20 +0200 | |
| changeset 72425 | d0937d55eb90 | 
| parent 70817 | dd675800469d | 
| child 73932 | fd21b4a93043 | 
| permissions | -rw-r--r-- | 
| 63627 | 1 | (* Title: HOL/Analysis/Uniform_Limit.thy | 
| 60812 | 2 | Author: Christoph Traut, TU München | 
| 3 | Author: Fabian Immler, TU München | |
| 4 | *) | |
| 5 | ||
| 6 | section \<open>Uniform Limit and Uniform Convergence\<close> | |
| 7 | ||
| 8 | theory Uniform_Limit | |
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: 
65204diff
changeset | 9 | imports Connected Summation_Tests | 
| 60812 | 10 | begin | 
| 11 | ||
| 68838 | 12 | |
| 13 | subsection \<open>Definition\<close> | |
| 14 | ||
| 70136 | 15 | definition\<^marker>\<open>tag important\<close> uniformly_on :: "'a set \<Rightarrow> ('a \<Rightarrow> 'b::metric_space) \<Rightarrow> ('a \<Rightarrow> 'b) filter"
 | 
| 69260 
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
 haftmann parents: 
68838diff
changeset | 16 |   where "uniformly_on S l = (INF e\<in>{0 <..}. principal {f. \<forall>x\<in>S. dist (f x) (l x) < e})"
 | 
| 60812 | 17 | |
| 70136 | 18 | abbreviation\<^marker>\<open>tag important\<close> | 
| 60812 | 19 | "uniform_limit S f l \<equiv> filterlim f (uniformly_on S l)" | 
| 20 | ||
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 21 | definition uniformly_convergent_on where | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 22 | "uniformly_convergent_on X f \<longleftrightarrow> (\<exists>l. uniform_limit X f l sequentially)" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 23 | |
| 63594 
bd218a9320b5
HOL-Multivariate_Analysis: rename theories for more descriptive names
 hoelzl parents: 
63040diff
changeset | 24 | definition uniformly_Cauchy_on where | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 25 | "uniformly_Cauchy_on X f \<longleftrightarrow> (\<forall>e>0. \<exists>M. \<forall>x\<in>X. \<forall>(m::nat)\<ge>M. \<forall>n\<ge>M. dist (f m x) (f n x) < e)" | 
| 63594 
bd218a9320b5
HOL-Multivariate_Analysis: rename theories for more descriptive names
 hoelzl parents: 
63040diff
changeset | 26 | |
| 68838 | 27 | proposition uniform_limit_iff: | 
| 60812 | 28 | "uniform_limit S f l F \<longleftrightarrow> (\<forall>e>0. \<forall>\<^sub>F n in F. \<forall>x\<in>S. dist (f n x) (l x) < e)" | 
| 29 | unfolding filterlim_iff uniformly_on_def | |
| 30 | by (subst eventually_INF_base) | |
| 31 | (fastforce | |
| 32 | simp: eventually_principal uniformly_on_def | |
| 33 | intro: bexI[where x="min a b" for a b] | |
| 61810 | 34 | elim: eventually_mono)+ | 
| 60812 | 35 | |
| 36 | lemma uniform_limitD: | |
| 37 | "uniform_limit S f l F \<Longrightarrow> e > 0 \<Longrightarrow> \<forall>\<^sub>F n in F. \<forall>x\<in>S. dist (f n x) (l x) < e" | |
| 38 | by (simp add: uniform_limit_iff) | |
| 39 | ||
| 40 | lemma uniform_limitI: | |
| 41 | "(\<And>e. e > 0 \<Longrightarrow> \<forall>\<^sub>F n in F. \<forall>x\<in>S. dist (f n x) (l x) < e) \<Longrightarrow> uniform_limit S f l F" | |
| 42 | by (simp add: uniform_limit_iff) | |
| 43 | ||
| 44 | lemma uniform_limit_sequentially_iff: | |
| 45 | "uniform_limit S f l sequentially \<longleftrightarrow> (\<forall>e>0. \<exists>N. \<forall>n\<ge>N. \<forall>x \<in> S. dist (f n x) (l x) < e)" | |
| 46 | unfolding uniform_limit_iff eventually_sequentially .. | |
| 47 | ||
| 48 | lemma uniform_limit_at_iff: | |
| 49 | "uniform_limit S f l (at x) \<longleftrightarrow> | |
| 50 | (\<forall>e>0. \<exists>d>0. \<forall>z. 0 < dist z x \<and> dist z x < d \<longrightarrow> (\<forall>x\<in>S. dist (f z x) (l x) < e))" | |
| 62381 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 51 | unfolding uniform_limit_iff eventually_at by simp | 
| 60812 | 52 | |
| 53 | lemma uniform_limit_at_le_iff: | |
| 54 | "uniform_limit S f l (at x) \<longleftrightarrow> | |
| 55 | (\<forall>e>0. \<exists>d>0. \<forall>z. 0 < dist z x \<and> dist z x < d \<longrightarrow> (\<forall>x\<in>S. dist (f z x) (l x) \<le> e))" | |
| 62381 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 56 | unfolding uniform_limit_iff eventually_at | 
| 60812 | 57 | by (fastforce dest: spec[where x = "e / 2" for e]) | 
| 58 | ||
| 62949 
f36a54da47a4
added derivative of scaling in exponential function
 immler parents: 
62393diff
changeset | 59 | lemma metric_uniform_limit_imp_uniform_limit: | 
| 
f36a54da47a4
added derivative of scaling in exponential function
 immler parents: 
62393diff
changeset | 60 | assumes f: "uniform_limit S f a F" | 
| 
f36a54da47a4
added derivative of scaling in exponential function
 immler parents: 
62393diff
changeset | 61 | assumes le: "eventually (\<lambda>x. \<forall>y\<in>S. dist (g x y) (b y) \<le> dist (f x y) (a y)) F" | 
| 
f36a54da47a4
added derivative of scaling in exponential function
 immler parents: 
62393diff
changeset | 62 | shows "uniform_limit S g b F" | 
| 
f36a54da47a4
added derivative of scaling in exponential function
 immler parents: 
62393diff
changeset | 63 | proof (rule uniform_limitI) | 
| 
f36a54da47a4
added derivative of scaling in exponential function
 immler parents: 
62393diff
changeset | 64 | fix e :: real assume "0 < e" | 
| 
f36a54da47a4
added derivative of scaling in exponential function
 immler parents: 
62393diff
changeset | 65 | from uniform_limitD[OF f this] le | 
| 
f36a54da47a4
added derivative of scaling in exponential function
 immler parents: 
62393diff
changeset | 66 | show "\<forall>\<^sub>F x in F. \<forall>y\<in>S. dist (g x y) (b y) < e" | 
| 
f36a54da47a4
added derivative of scaling in exponential function
 immler parents: 
62393diff
changeset | 67 | by eventually_elim force | 
| 
f36a54da47a4
added derivative of scaling in exponential function
 immler parents: 
62393diff
changeset | 68 | qed | 
| 
f36a54da47a4
added derivative of scaling in exponential function
 immler parents: 
62393diff
changeset | 69 | |
| 68838 | 70 | |
| 71 | subsection \<open>Exchange limits\<close> | |
| 72 | ||
| 73 | proposition swap_uniform_limit: | |
| 61973 | 74 | assumes f: "\<forall>\<^sub>F n in F. (f n \<longlongrightarrow> g n) (at x within S)" | 
| 75 | assumes g: "(g \<longlongrightarrow> l) F" | |
| 60812 | 76 | assumes uc: "uniform_limit S f h F" | 
| 77 | assumes "\<not>trivial_limit F" | |
| 61973 | 78 | shows "(h \<longlongrightarrow> l) (at x within S)" | 
| 60812 | 79 | proof (rule tendstoI) | 
| 80 | fix e :: real | |
| 63040 | 81 | define e' where "e' = e/3" | 
| 60812 | 82 | assume "0 < e" | 
| 83 | then have "0 < e'" by (simp add: e'_def) | |
| 61222 | 84 | from uniform_limitD[OF uc \<open>0 < e'\<close>] | 
| 60812 | 85 | have "\<forall>\<^sub>F n in F. \<forall>x\<in>S. dist (h x) (f n x) < e'" | 
| 86 | by (simp add: dist_commute) | |
| 87 | moreover | |
| 88 | from f | |
| 89 | have "\<forall>\<^sub>F n in F. \<forall>\<^sub>F x in at x within S. dist (g n) (f n x) < e'" | |
| 61222 | 90 | by eventually_elim (auto dest!: tendstoD[OF _ \<open>0 < e'\<close>] simp: dist_commute) | 
| 60812 | 91 | moreover | 
| 61222 | 92 | from tendstoD[OF g \<open>0 < e'\<close>] have "\<forall>\<^sub>F x in F. dist l (g x) < e'" | 
| 60812 | 93 | by (simp add: dist_commute) | 
| 94 | ultimately | |
| 95 | have "\<forall>\<^sub>F _ in F. \<forall>\<^sub>F x in at x within S. dist (h x) l < e" | |
| 96 | proof eventually_elim | |
| 97 | case (elim n) | |
| 98 | note fh = elim(1) | |
| 99 | note gl = elim(3) | |
| 100 | have "\<forall>\<^sub>F x in at x within S. x \<in> S" | |
| 101 | by (auto simp: eventually_at_filter) | |
| 102 | with elim(2) | |
| 103 | show ?case | |
| 104 | proof eventually_elim | |
| 105 | case (elim x) | |
| 61222 | 106 | from fh[rule_format, OF \<open>x \<in> S\<close>] elim(1) | 
| 60812 | 107 | have "dist (h x) (g n) < e' + e'" | 
| 108 | by (rule dist_triangle_lt[OF add_strict_mono]) | |
| 109 | from dist_triangle_lt[OF add_strict_mono, OF this gl] | |
| 110 | show ?case by (simp add: e'_def) | |
| 111 | qed | |
| 112 | qed | |
| 113 | thus "\<forall>\<^sub>F x in at x within S. dist (h x) l < e" | |
| 61222 | 114 | using eventually_happens by (metis \<open>\<not>trivial_limit F\<close>) | 
| 60812 | 115 | qed | 
| 116 | ||
| 68838 | 117 | |
| 118 | subsection \<open>Uniform limit theorem\<close> | |
| 119 | ||
| 67371 
2d9cf74943e1
moved in some material from Euler-MacLaurin
 paulson <lp15@cam.ac.uk> parents: 
66827diff
changeset | 120 | lemma tendsto_uniform_limitI: | 
| 60812 | 121 | assumes "uniform_limit S f l F" | 
| 122 | assumes "x \<in> S" | |
| 61973 | 123 | shows "((\<lambda>y. f y x) \<longlongrightarrow> l x) F" | 
| 60812 | 124 | using assms | 
| 61810 | 125 | by (auto intro!: tendstoI simp: eventually_mono dest!: uniform_limitD) | 
| 60812 | 126 | |
| 68838 | 127 | theorem uniform_limit_theorem: | 
| 60812 | 128 | assumes c: "\<forall>\<^sub>F n in F. continuous_on A (f n)" | 
| 129 | assumes ul: "uniform_limit A f l F" | |
| 130 | assumes "\<not> trivial_limit F" | |
| 131 | shows "continuous_on A l" | |
| 132 | unfolding continuous_on_def | |
| 133 | proof safe | |
| 134 | fix x assume "x \<in> A" | |
| 61973 | 135 | then have "\<forall>\<^sub>F n in F. (f n \<longlongrightarrow> f n x) (at x within A)" "((\<lambda>n. f n x) \<longlongrightarrow> l x) F" | 
| 60812 | 136 | using c ul | 
| 61810 | 137 | by (auto simp: continuous_on_def eventually_mono tendsto_uniform_limitI) | 
| 61973 | 138 | then show "(l \<longlongrightarrow> l x) (at x within A)" | 
| 60812 | 139 | by (rule swap_uniform_limit) fact+ | 
| 140 | qed | |
| 141 | ||
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 142 | lemma uniformly_Cauchy_onI: | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 143 | assumes "\<And>e. e > 0 \<Longrightarrow> \<exists>M. \<forall>x\<in>X. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (f m x) (f n x) < e" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 144 | shows "uniformly_Cauchy_on X f" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 145 | using assms unfolding uniformly_Cauchy_on_def by blast | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 146 | |
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 147 | lemma uniformly_Cauchy_onI': | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 148 | assumes "\<And>e. e > 0 \<Longrightarrow> \<exists>M. \<forall>x\<in>X. \<forall>m\<ge>M. \<forall>n>m. dist (f m x) (f n x) < e" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 149 | shows "uniformly_Cauchy_on X f" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 150 | proof (rule uniformly_Cauchy_onI) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 151 | fix e :: real assume e: "e > 0" | 
| 63594 
bd218a9320b5
HOL-Multivariate_Analysis: rename theories for more descriptive names
 hoelzl parents: 
63040diff
changeset | 152 | from assms[OF this] obtain M | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 153 | where M: "\<And>x m n. x \<in> X \<Longrightarrow> m \<ge> M \<Longrightarrow> n > m \<Longrightarrow> dist (f m x) (f n x) < e" by fast | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 154 |   {
 | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 155 | fix x m n assume x: "x \<in> X" and m: "m \<ge> M" and n: "n \<ge> M" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 156 | with M[OF this(1,2), of n] M[OF this(1,3), of m] e have "dist (f m x) (f n x) < e" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 157 | by (cases m n rule: linorder_cases) (simp_all add: dist_commute) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 158 | } | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 159 | thus "\<exists>M. \<forall>x\<in>X. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (f m x) (f n x) < e" by fast | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 160 | qed | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 161 | |
| 63594 
bd218a9320b5
HOL-Multivariate_Analysis: rename theories for more descriptive names
 hoelzl parents: 
63040diff
changeset | 162 | lemma uniformly_Cauchy_imp_Cauchy: | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 163 | "uniformly_Cauchy_on X f \<Longrightarrow> x \<in> X \<Longrightarrow> Cauchy (\<lambda>n. f n x)" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 164 | unfolding Cauchy_def uniformly_Cauchy_on_def by fast | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 165 | |
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 166 | lemma uniform_limit_cong: | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 167 |   fixes f g :: "'a \<Rightarrow> 'b \<Rightarrow> ('c :: metric_space)" and h i :: "'b \<Rightarrow> 'c"
 | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 168 | assumes "eventually (\<lambda>y. \<forall>x\<in>X. f y x = g y x) F" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 169 | assumes "\<And>x. x \<in> X \<Longrightarrow> h x = i x" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 170 | shows "uniform_limit X f h F \<longleftrightarrow> uniform_limit X g i F" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 171 | proof - | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 172 |   {
 | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 173 | fix f g :: "'a \<Rightarrow> 'b \<Rightarrow> 'c" and h i :: "'b \<Rightarrow> 'c" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 174 | assume C: "uniform_limit X f h F" and A: "eventually (\<lambda>y. \<forall>x\<in>X. f y x = g y x) F" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 175 | and B: "\<And>x. x \<in> X \<Longrightarrow> h x = i x" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 176 |     {
 | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 177 | fix e ::real assume "e > 0" | 
| 63594 
bd218a9320b5
HOL-Multivariate_Analysis: rename theories for more descriptive names
 hoelzl parents: 
63040diff
changeset | 178 | with C have "eventually (\<lambda>y. \<forall>x\<in>X. dist (f y x) (h x) < e) F" | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 179 | unfolding uniform_limit_iff by blast | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 180 | with A have "eventually (\<lambda>y. \<forall>x\<in>X. dist (g y x) (i x) < e) F" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 181 | by eventually_elim (insert B, simp_all) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 182 | } | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 183 | hence "uniform_limit X g i F" unfolding uniform_limit_iff by blast | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 184 | } note A = this | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 185 | show ?thesis by (rule iffI) (erule A; insert assms; simp add: eq_commute)+ | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 186 | qed | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 187 | |
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 188 | lemma uniform_limit_cong': | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 189 |   fixes f g :: "'a \<Rightarrow> 'b \<Rightarrow> ('c :: metric_space)" and h i :: "'b \<Rightarrow> 'c"
 | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 190 | assumes "\<And>y x. x \<in> X \<Longrightarrow> f y x = g y x" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 191 | assumes "\<And>x. x \<in> X \<Longrightarrow> h x = i x" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 192 | shows "uniform_limit X f h F \<longleftrightarrow> uniform_limit X g i F" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 193 | using assms by (intro uniform_limit_cong always_eventually) blast+ | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 194 | |
| 67371 
2d9cf74943e1
moved in some material from Euler-MacLaurin
 paulson <lp15@cam.ac.uk> parents: 
66827diff
changeset | 195 | lemma uniformly_convergent_cong: | 
| 
2d9cf74943e1
moved in some material from Euler-MacLaurin
 paulson <lp15@cam.ac.uk> parents: 
66827diff
changeset | 196 | assumes "eventually (\<lambda>x. \<forall>y\<in>A. f x y = g x y) sequentially" "A = B" | 
| 
2d9cf74943e1
moved in some material from Euler-MacLaurin
 paulson <lp15@cam.ac.uk> parents: 
66827diff
changeset | 197 | shows "uniformly_convergent_on A f \<longleftrightarrow> uniformly_convergent_on B g" | 
| 
2d9cf74943e1
moved in some material from Euler-MacLaurin
 paulson <lp15@cam.ac.uk> parents: 
66827diff
changeset | 198 | unfolding uniformly_convergent_on_def assms(2) [symmetric] | 
| 
2d9cf74943e1
moved in some material from Euler-MacLaurin
 paulson <lp15@cam.ac.uk> parents: 
66827diff
changeset | 199 | by (intro iff_exI uniform_limit_cong eventually_mono [OF assms(1)]) auto | 
| 
2d9cf74943e1
moved in some material from Euler-MacLaurin
 paulson <lp15@cam.ac.uk> parents: 
66827diff
changeset | 200 | |
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 201 | lemma uniformly_convergent_uniform_limit_iff: | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 202 | "uniformly_convergent_on X f \<longleftrightarrow> uniform_limit X f (\<lambda>x. lim (\<lambda>n. f n x)) sequentially" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 203 | proof | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 204 | assume "uniformly_convergent_on X f" | 
| 63594 
bd218a9320b5
HOL-Multivariate_Analysis: rename theories for more descriptive names
 hoelzl parents: 
63040diff
changeset | 205 | then obtain l where l: "uniform_limit X f l sequentially" | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 206 | unfolding uniformly_convergent_on_def by blast | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 207 | from l have "uniform_limit X f (\<lambda>x. lim (\<lambda>n. f n x)) sequentially \<longleftrightarrow> | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 208 | uniform_limit X f l sequentially" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 209 | by (intro uniform_limit_cong' limI tendsto_uniform_limitI[of f X l]) simp_all | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 210 | also note l | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 211 | finally show "uniform_limit X f (\<lambda>x. lim (\<lambda>n. f n x)) sequentially" . | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 212 | qed (auto simp: uniformly_convergent_on_def) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 213 | |
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 214 | lemma uniformly_convergentI: "uniform_limit X f l sequentially \<Longrightarrow> uniformly_convergent_on X f" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 215 | unfolding uniformly_convergent_on_def by blast | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 216 | |
| 62381 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 217 | lemma uniformly_convergent_on_empty [iff]: "uniformly_convergent_on {} f"
 | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 218 | by (simp add: uniformly_convergent_on_def uniform_limit_sequentially_iff) | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 219 | |
| 67371 
2d9cf74943e1
moved in some material from Euler-MacLaurin
 paulson <lp15@cam.ac.uk> parents: 
66827diff
changeset | 220 | lemma uniformly_convergent_on_const [simp,intro]: | 
| 
2d9cf74943e1
moved in some material from Euler-MacLaurin
 paulson <lp15@cam.ac.uk> parents: 
66827diff
changeset | 221 | "uniformly_convergent_on A (\<lambda>_. c)" | 
| 
2d9cf74943e1
moved in some material from Euler-MacLaurin
 paulson <lp15@cam.ac.uk> parents: 
66827diff
changeset | 222 | by (auto simp: uniformly_convergent_on_def uniform_limit_iff intro!: exI[of _ c]) | 
| 
2d9cf74943e1
moved in some material from Euler-MacLaurin
 paulson <lp15@cam.ac.uk> parents: 
66827diff
changeset | 223 | |
| 65204 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 224 | text\<open>Cauchy-type criteria for uniform convergence.\<close> | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 225 | |
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 226 | lemma Cauchy_uniformly_convergent: | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 227 | fixes f :: "nat \<Rightarrow> 'a \<Rightarrow> 'b :: complete_space" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 228 | assumes "uniformly_Cauchy_on X f" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 229 | shows "uniformly_convergent_on X f" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 230 | unfolding uniformly_convergent_uniform_limit_iff uniform_limit_iff | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 231 | proof safe | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 232 | let ?f = "\<lambda>x. lim (\<lambda>n. f n x)" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 233 | fix e :: real assume e: "e > 0" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 234 | hence "e/2 > 0" by simp | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 235 | with assms obtain N where N: "\<And>x m n. x \<in> X \<Longrightarrow> m \<ge> N \<Longrightarrow> n \<ge> N \<Longrightarrow> dist (f m x) (f n x) < e/2" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 236 | unfolding uniformly_Cauchy_on_def by fast | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 237 | show "eventually (\<lambda>n. \<forall>x\<in>X. dist (f n x) (?f x) < e) sequentially" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 238 | using eventually_ge_at_top[of N] | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 239 | proof eventually_elim | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 240 | fix n assume n: "n \<ge> N" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 241 | show "\<forall>x\<in>X. dist (f n x) (?f x) < e" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 242 | proof | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 243 | fix x assume x: "x \<in> X" | 
| 63594 
bd218a9320b5
HOL-Multivariate_Analysis: rename theories for more descriptive names
 hoelzl parents: 
63040diff
changeset | 244 | with assms have "(\<lambda>n. f n x) \<longlonglongrightarrow> ?f x" | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 245 | by (auto dest!: Cauchy_convergent uniformly_Cauchy_imp_Cauchy simp: convergent_LIMSEQ_iff) | 
| 61808 | 246 | with \<open>e/2 > 0\<close> have "eventually (\<lambda>m. m \<ge> N \<and> dist (f m x) (?f x) < e/2) sequentially" | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 247 | by (intro tendstoD eventually_conj eventually_ge_at_top) | 
| 63594 
bd218a9320b5
HOL-Multivariate_Analysis: rename theories for more descriptive names
 hoelzl parents: 
63040diff
changeset | 248 | then obtain m where m: "m \<ge> N" "dist (f m x) (?f x) < e/2" | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 249 | unfolding eventually_at_top_linorder by blast | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 250 | have "dist (f n x) (?f x) \<le> dist (f n x) (f m x) + dist (f m x) (?f x)" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 251 | by (rule dist_triangle) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 252 | also from x n have "... < e/2 + e/2" by (intro add_strict_mono N m) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 253 | finally show "dist (f n x) (?f x) < e" by simp | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 254 | qed | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 255 | qed | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 256 | qed | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 257 | |
| 65204 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 258 | lemma uniformly_convergent_Cauchy: | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 259 | assumes "uniformly_convergent_on X f" | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 260 | shows "uniformly_Cauchy_on X f" | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 261 | proof (rule uniformly_Cauchy_onI) | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 262 | fix e::real assume "e > 0" | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 263 | then have "0 < e / 2" by simp | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 264 | with assms[unfolded uniformly_convergent_on_def uniform_limit_sequentially_iff] | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 265 | obtain l N where l:"x \<in> X \<Longrightarrow> n \<ge> N \<Longrightarrow> dist (f n x) (l x) < e / 2" for n x | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 266 | by metis | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 267 | from l l have "x \<in> X \<Longrightarrow> n \<ge> N \<Longrightarrow> m \<ge> N \<Longrightarrow> dist (f n x) (f m x) < e" for n m x | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 268 | by (rule dist_triangle_half_l) | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 269 | then show "\<exists>M. \<forall>x\<in>X. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (f m x) (f n x) < e" by blast | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 270 | qed | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 271 | |
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 272 | lemma uniformly_convergent_eq_Cauchy: | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 273 | "uniformly_convergent_on X f = uniformly_Cauchy_on X f" for f::"nat \<Rightarrow> 'b \<Rightarrow> 'a::complete_space" | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 274 | using Cauchy_uniformly_convergent uniformly_convergent_Cauchy by blast | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 275 | |
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 276 | lemma uniformly_convergent_eq_cauchy: | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 277 | fixes s::"nat \<Rightarrow> 'b \<Rightarrow> 'a::complete_space" | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 278 | shows | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 279 | "(\<exists>l. \<forall>e>0. \<exists>N. \<forall>n x. N \<le> n \<and> P x \<longrightarrow> dist(s n x)(l x) < e) \<longleftrightarrow> | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 280 | (\<forall>e>0. \<exists>N. \<forall>m n x. N \<le> m \<and> N \<le> n \<and> P x \<longrightarrow> dist (s m x) (s n x) < e)" | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 281 | proof - | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 282 | have *: "(\<forall>n\<ge>N. \<forall>x. Q x \<longrightarrow> R n x) \<longleftrightarrow> (\<forall>n x. N \<le> n \<and> Q x \<longrightarrow> R n x)" | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 283 | "(\<forall>x. Q x \<longrightarrow> (\<forall>m\<ge>N. \<forall>n\<ge>N. S n m x)) \<longleftrightarrow> (\<forall>m n x. N \<le> m \<and> N \<le> n \<and> Q x \<longrightarrow> S n m x)" | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 284 | for N::nat and Q::"'b \<Rightarrow> bool" and R S | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 285 | by blast+ | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 286 | show ?thesis | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 287 | using uniformly_convergent_eq_Cauchy[of "Collect P" s] | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 288 | unfolding uniformly_convergent_on_def uniformly_Cauchy_on_def uniform_limit_sequentially_iff | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 289 | by (simp add: *) | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 290 | qed | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 291 | |
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 292 | lemma uniformly_cauchy_imp_uniformly_convergent: | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 293 | fixes s :: "nat \<Rightarrow> 'a \<Rightarrow> 'b::complete_space" | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 294 | assumes "\<forall>e>0.\<exists>N. \<forall>m (n::nat) x. N \<le> m \<and> N \<le> n \<and> P x --> dist(s m x)(s n x) < e" | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 295 | and "\<forall>x. P x --> (\<forall>e>0. \<exists>N. \<forall>n. N \<le> n \<longrightarrow> dist(s n x)(l x) < e)" | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 296 | shows "\<forall>e>0. \<exists>N. \<forall>n x. N \<le> n \<and> P x \<longrightarrow> dist(s n x)(l x) < e" | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 297 | proof - | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 298 | obtain l' where l:"\<forall>e>0. \<exists>N. \<forall>n x. N \<le> n \<and> P x \<longrightarrow> dist (s n x) (l' x) < e" | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 299 | using assms(1) unfolding uniformly_convergent_eq_cauchy[symmetric] by auto | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 300 | moreover | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 301 |   {
 | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 302 | fix x | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 303 | assume "P x" | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 304 | then have "l x = l' x" | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 305 | using tendsto_unique[OF trivial_limit_sequentially, of "\<lambda>n. s n x" "l x" "l' x"] | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 306 | using l and assms(2) unfolding lim_sequentially by blast | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 307 | } | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 308 | ultimately show ?thesis by auto | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 309 | qed | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 310 | |
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 311 | text \<open>TODO: remove explicit formulations | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 312 |   @{thm uniformly_convergent_eq_cauchy uniformly_cauchy_imp_uniformly_convergent}?!\<close>
 | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 313 | |
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 314 | lemma uniformly_convergent_imp_convergent: | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 315 | "uniformly_convergent_on X f \<Longrightarrow> x \<in> X \<Longrightarrow> convergent (\<lambda>n. f n x)" | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 316 | unfolding uniformly_convergent_on_def convergent_def | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 317 | by (auto dest: tendsto_uniform_limitI) | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 318 | |
| 68838 | 319 | |
| 320 | subsection \<open>Weierstrass M-Test\<close> | |
| 321 | ||
| 69529 | 322 | proposition Weierstrass_m_test_ev: | 
| 60812 | 323 | fixes f :: "_ \<Rightarrow> _ \<Rightarrow> _ :: banach" | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 324 | assumes "eventually (\<lambda>n. \<forall>x\<in>A. norm (f n x) \<le> M n) sequentially" | 
| 60812 | 325 | assumes "summable M" | 
| 326 | shows "uniform_limit A (\<lambda>n x. \<Sum>i<n. f i x) (\<lambda>x. suminf (\<lambda>i. f i x)) sequentially" | |
| 327 | proof (rule uniform_limitI) | |
| 328 | fix e :: real | |
| 329 | assume "0 < e" | |
| 61222 | 330 | from suminf_exist_split[OF \<open>0 < e\<close> \<open>summable M\<close>] | 
| 60812 | 331 | have "\<forall>\<^sub>F k in sequentially. norm (\<Sum>i. M (i + k)) < e" | 
| 332 | by (auto simp: eventually_sequentially) | |
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 333 | with eventually_all_ge_at_top[OF assms(1)] | 
| 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 334 | show "\<forall>\<^sub>F n in sequentially. \<forall>x\<in>A. dist (\<Sum>i<n. f i x) (\<Sum>i. f i x) < e" | 
| 60812 | 335 | proof eventually_elim | 
| 336 | case (elim k) | |
| 337 | show ?case | |
| 338 | proof safe | |
| 339 | fix x assume "x \<in> A" | |
| 340 | have "\<exists>N. \<forall>n\<ge>N. norm (f n x) \<le> M n" | |
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 341 | using assms(1) \<open>x \<in> A\<close> by (force simp: eventually_at_top_linorder) | 
| 60812 | 342 | hence summable_norm_f: "summable (\<lambda>n. norm (f n x))" | 
| 61222 | 343 | by(rule summable_norm_comparison_test[OF _ \<open>summable M\<close>]) | 
| 60812 | 344 | have summable_f: "summable (\<lambda>n. f n x)" | 
| 345 | using summable_norm_cancel[OF summable_norm_f] . | |
| 346 | have summable_norm_f_plus_k: "summable (\<lambda>i. norm (f (i + k) x))" | |
| 347 | using summable_ignore_initial_segment[OF summable_norm_f] | |
| 348 | by auto | |
| 349 | have summable_M_plus_k: "summable (\<lambda>i. M (i + k))" | |
| 61222 | 350 | using summable_ignore_initial_segment[OF \<open>summable M\<close>] | 
| 60812 | 351 | by auto | 
| 352 | ||
| 353 | have "dist (\<Sum>i<k. f i x) (\<Sum>i. f i x) = norm ((\<Sum>i. f i x) - (\<Sum>i<k. f i x))" | |
| 354 | using dist_norm dist_commute by (subst dist_commute) | |
| 355 | also have "... = norm (\<Sum>i. f (i + k) x)" | |
| 356 | using suminf_minus_initial_segment[OF summable_f, where k=k] by simp | |
| 357 | also have "... \<le> (\<Sum>i. norm (f (i + k) x))" | |
| 358 | using summable_norm[OF summable_norm_f_plus_k] . | |
| 359 | also have "... \<le> (\<Sum>i. M (i + k))" | |
| 360 | by (rule suminf_le[OF _ summable_norm_f_plus_k summable_M_plus_k]) | |
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 361 | (insert elim(1) \<open>x \<in> A\<close>, simp) | 
| 60812 | 362 | finally show "dist (\<Sum>i<k. f i x) (\<Sum>i. f i x) < e" | 
| 363 | using elim by auto | |
| 364 | qed | |
| 365 | qed | |
| 366 | qed | |
| 367 | ||
| 62175 | 368 | text\<open>Alternative version, formulated as in HOL Light\<close> | 
| 70136 | 369 | corollary\<^marker>\<open>tag unimportant\<close> series_comparison_uniform: | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
61973diff
changeset | 370 | fixes f :: "_ \<Rightarrow> nat \<Rightarrow> _ :: banach" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
61973diff
changeset | 371 | assumes g: "summable g" and le: "\<And>n x. N \<le> n \<and> x \<in> A \<Longrightarrow> norm(f x n) \<le> g n" | 
| 64267 | 372 |     shows "\<exists>l. \<forall>e. 0 < e \<longrightarrow> (\<exists>N. \<forall>n x. N \<le> n \<and> x \<in> A \<longrightarrow> dist(sum (f x) {..<n}) (l x) < e)"
 | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
61973diff
changeset | 373 | proof - | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
61973diff
changeset | 374 | have 1: "\<forall>\<^sub>F n in sequentially. \<forall>x\<in>A. norm (f x n) \<le> g n" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
61973diff
changeset | 375 | using le eventually_sequentially by auto | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
61973diff
changeset | 376 | show ?thesis | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
61973diff
changeset | 377 | apply (rule_tac x="(\<lambda>x. \<Sum>i. f x i)" in exI) | 
| 69529 | 378 | apply (metis (no_types, lifting) eventually_sequentially uniform_limitD [OF Weierstrass_m_test_ev [OF 1 g]]) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
61973diff
changeset | 379 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
61973diff
changeset | 380 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
61973diff
changeset | 381 | |
| 70136 | 382 | corollary\<^marker>\<open>tag unimportant\<close> Weierstrass_m_test: | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
61973diff
changeset | 383 | fixes f :: "_ \<Rightarrow> _ \<Rightarrow> _ :: banach" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
61973diff
changeset | 384 | assumes "\<And>n x. x \<in> A \<Longrightarrow> norm (f n x) \<le> M n" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
61973diff
changeset | 385 | assumes "summable M" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
61973diff
changeset | 386 | shows "uniform_limit A (\<lambda>n x. \<Sum>i<n. f i x) (\<lambda>x. suminf (\<lambda>i. f i x)) sequentially" | 
| 69529 | 387 | using assms by (intro Weierstrass_m_test_ev always_eventually) auto | 
| 63594 
bd218a9320b5
HOL-Multivariate_Analysis: rename theories for more descriptive names
 hoelzl parents: 
63040diff
changeset | 388 | |
| 70136 | 389 | corollary\<^marker>\<open>tag unimportant\<close> Weierstrass_m_test'_ev: | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 390 | fixes f :: "_ \<Rightarrow> _ \<Rightarrow> _ :: banach" | 
| 63594 
bd218a9320b5
HOL-Multivariate_Analysis: rename theories for more descriptive names
 hoelzl parents: 
63040diff
changeset | 391 | assumes "eventually (\<lambda>n. \<forall>x\<in>A. norm (f n x) \<le> M n) sequentially" "summable M" | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 392 | shows "uniformly_convergent_on A (\<lambda>n x. \<Sum>i<n. f i x)" | 
| 69529 | 393 | unfolding uniformly_convergent_on_def by (rule exI, rule Weierstrass_m_test_ev[OF assms]) | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 394 | |
| 70136 | 395 | corollary\<^marker>\<open>tag unimportant\<close> Weierstrass_m_test': | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 396 | fixes f :: "_ \<Rightarrow> _ \<Rightarrow> _ :: banach" | 
| 63594 
bd218a9320b5
HOL-Multivariate_Analysis: rename theories for more descriptive names
 hoelzl parents: 
63040diff
changeset | 397 | assumes "\<And>n x. x \<in> A \<Longrightarrow> norm (f n x) \<le> M n" "summable M" | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 398 | shows "uniformly_convergent_on A (\<lambda>n x. \<Sum>i<n. f i x)" | 
| 69529 | 399 | unfolding uniformly_convergent_on_def by (rule exI, rule Weierstrass_m_test[OF assms]) | 
| 61531 
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
 eberlm parents: 
61222diff
changeset | 400 | |
| 60812 | 401 | lemma uniform_limit_eq_rhs: "uniform_limit X f l F \<Longrightarrow> l = m \<Longrightarrow> uniform_limit X f m F" | 
| 402 | by simp | |
| 403 | ||
| 68838 | 404 | |
| 70136 | 405 | subsection\<^marker>\<open>tag unimportant\<close> \<open>Structural introduction rules\<close> | 
| 68838 | 406 | |
| 60812 | 407 | named_theorems uniform_limit_intros "introduction rules for uniform_limit" | 
| 61222 | 408 | setup \<open> | 
| 69597 | 409 | Global_Theory.add_thms_dynamic (\<^binding>\<open>uniform_limit_eq_intros\<close>, | 
| 60812 | 410 | fn context => | 
| 69597 | 411 | Named_Theorems.get (Context.proof_of context) \<^named_theorems>\<open>uniform_limit_intros\<close> | 
| 60812 | 412 |       |> map_filter (try (fn thm => @{thm uniform_limit_eq_rhs} OF [thm])))
 | 
| 61222 | 413 | \<close> | 
| 60812 | 414 | |
| 415 | lemma (in bounded_linear) uniform_limit[uniform_limit_intros]: | |
| 416 | assumes "uniform_limit X g l F" | |
| 417 | shows "uniform_limit X (\<lambda>a b. f (g a b)) (\<lambda>a. f (l a)) F" | |
| 418 | proof (rule uniform_limitI) | |
| 419 | fix e::real | |
| 420 | from pos_bounded obtain K | |
| 421 | where K: "\<And>x y. dist (f x) (f y) \<le> K * dist x y" "K > 0" | |
| 422 | by (auto simp: ac_simps dist_norm diff[symmetric]) | |
| 61222 | 423 | assume "0 < e" with \<open>K > 0\<close> have "e / K > 0" by simp | 
| 60812 | 424 | from uniform_limitD[OF assms this] | 
| 425 | show "\<forall>\<^sub>F n in F. \<forall>x\<in>X. dist (f (g n x)) (f (l x)) < e" | |
| 426 | by eventually_elim (metis le_less_trans mult.commute pos_less_divide_eq K) | |
| 427 | qed | |
| 428 | ||
| 67371 
2d9cf74943e1
moved in some material from Euler-MacLaurin
 paulson <lp15@cam.ac.uk> parents: 
66827diff
changeset | 429 | lemma (in bounded_linear) uniformly_convergent_on: | 
| 
2d9cf74943e1
moved in some material from Euler-MacLaurin
 paulson <lp15@cam.ac.uk> parents: 
66827diff
changeset | 430 | assumes "uniformly_convergent_on A g" | 
| 
2d9cf74943e1
moved in some material from Euler-MacLaurin
 paulson <lp15@cam.ac.uk> parents: 
66827diff
changeset | 431 | shows "uniformly_convergent_on A (\<lambda>x y. f (g x y))" | 
| 
2d9cf74943e1
moved in some material from Euler-MacLaurin
 paulson <lp15@cam.ac.uk> parents: 
66827diff
changeset | 432 | proof - | 
| 
2d9cf74943e1
moved in some material from Euler-MacLaurin
 paulson <lp15@cam.ac.uk> parents: 
66827diff
changeset | 433 | from assms obtain l where "uniform_limit A g l sequentially" | 
| 
2d9cf74943e1
moved in some material from Euler-MacLaurin
 paulson <lp15@cam.ac.uk> parents: 
66827diff
changeset | 434 | unfolding uniformly_convergent_on_def by blast | 
| 
2d9cf74943e1
moved in some material from Euler-MacLaurin
 paulson <lp15@cam.ac.uk> parents: 
66827diff
changeset | 435 | hence "uniform_limit A (\<lambda>x y. f (g x y)) (\<lambda>x. f (l x)) sequentially" | 
| 
2d9cf74943e1
moved in some material from Euler-MacLaurin
 paulson <lp15@cam.ac.uk> parents: 
66827diff
changeset | 436 | by (rule uniform_limit) | 
| 
2d9cf74943e1
moved in some material from Euler-MacLaurin
 paulson <lp15@cam.ac.uk> parents: 
66827diff
changeset | 437 | thus ?thesis unfolding uniformly_convergent_on_def by blast | 
| 
2d9cf74943e1
moved in some material from Euler-MacLaurin
 paulson <lp15@cam.ac.uk> parents: 
66827diff
changeset | 438 | qed | 
| 
2d9cf74943e1
moved in some material from Euler-MacLaurin
 paulson <lp15@cam.ac.uk> parents: 
66827diff
changeset | 439 | |
| 60812 | 440 | lemmas bounded_linear_uniform_limit_intros[uniform_limit_intros] = | 
| 441 | bounded_linear.uniform_limit[OF bounded_linear_Im] | |
| 442 | bounded_linear.uniform_limit[OF bounded_linear_Re] | |
| 443 | bounded_linear.uniform_limit[OF bounded_linear_cnj] | |
| 444 | bounded_linear.uniform_limit[OF bounded_linear_fst] | |
| 445 | bounded_linear.uniform_limit[OF bounded_linear_snd] | |
| 446 | bounded_linear.uniform_limit[OF bounded_linear_zero] | |
| 447 | bounded_linear.uniform_limit[OF bounded_linear_of_real] | |
| 448 | bounded_linear.uniform_limit[OF bounded_linear_inner_left] | |
| 449 | bounded_linear.uniform_limit[OF bounded_linear_inner_right] | |
| 450 | bounded_linear.uniform_limit[OF bounded_linear_divide] | |
| 451 | bounded_linear.uniform_limit[OF bounded_linear_scaleR_right] | |
| 452 | bounded_linear.uniform_limit[OF bounded_linear_mult_left] | |
| 453 | bounded_linear.uniform_limit[OF bounded_linear_mult_right] | |
| 454 | bounded_linear.uniform_limit[OF bounded_linear_scaleR_left] | |
| 455 | ||
| 67685 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 immler parents: 
67371diff
changeset | 456 | |
| 60812 | 457 | lemmas uniform_limit_uminus[uniform_limit_intros] = | 
| 458 | bounded_linear.uniform_limit[OF bounded_linear_minus[OF bounded_linear_ident]] | |
| 459 | ||
| 65204 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 460 | lemma uniform_limit_const[uniform_limit_intros]: "uniform_limit S (\<lambda>x. c) c f" | 
| 62949 
f36a54da47a4
added derivative of scaling in exponential function
 immler parents: 
62393diff
changeset | 461 | by (auto intro!: uniform_limitI) | 
| 
f36a54da47a4
added derivative of scaling in exponential function
 immler parents: 
62393diff
changeset | 462 | |
| 60812 | 463 | lemma uniform_limit_add[uniform_limit_intros]: | 
| 464 | fixes f g::"'a \<Rightarrow> 'b \<Rightarrow> 'c::real_normed_vector" | |
| 465 | assumes "uniform_limit X f l F" | |
| 466 | assumes "uniform_limit X g m F" | |
| 467 | shows "uniform_limit X (\<lambda>a b. f a b + g a b) (\<lambda>a. l a + m a) F" | |
| 468 | proof (rule uniform_limitI) | |
| 469 | fix e::real | |
| 470 | assume "0 < e" | |
| 471 | hence "0 < e / 2" by simp | |
| 472 | from | |
| 473 | uniform_limitD[OF assms(1) this] | |
| 474 | uniform_limitD[OF assms(2) this] | |
| 475 | show "\<forall>\<^sub>F n in F. \<forall>x\<in>X. dist (f n x + g n x) (l x + m x) < e" | |
| 476 | by eventually_elim (simp add: dist_triangle_add_half) | |
| 477 | qed | |
| 478 | ||
| 479 | lemma uniform_limit_minus[uniform_limit_intros]: | |
| 480 | fixes f g::"'a \<Rightarrow> 'b \<Rightarrow> 'c::real_normed_vector" | |
| 481 | assumes "uniform_limit X f l F" | |
| 482 | assumes "uniform_limit X g m F" | |
| 483 | shows "uniform_limit X (\<lambda>a b. f a b - g a b) (\<lambda>a. l a - m a) F" | |
| 484 | unfolding diff_conv_add_uminus | |
| 485 | by (rule uniform_limit_intros assms)+ | |
| 486 | ||
| 62949 
f36a54da47a4
added derivative of scaling in exponential function
 immler parents: 
62393diff
changeset | 487 | lemma uniform_limit_norm[uniform_limit_intros]: | 
| 
f36a54da47a4
added derivative of scaling in exponential function
 immler parents: 
62393diff
changeset | 488 | assumes "uniform_limit S g l f" | 
| 
f36a54da47a4
added derivative of scaling in exponential function
 immler parents: 
62393diff
changeset | 489 | shows "uniform_limit S (\<lambda>x y. norm (g x y)) (\<lambda>x. norm (l x)) f" | 
| 
f36a54da47a4
added derivative of scaling in exponential function
 immler parents: 
62393diff
changeset | 490 | using assms | 
| 
f36a54da47a4
added derivative of scaling in exponential function
 immler parents: 
62393diff
changeset | 491 | apply (rule metric_uniform_limit_imp_uniform_limit) | 
| 
f36a54da47a4
added derivative of scaling in exponential function
 immler parents: 
62393diff
changeset | 492 | apply (rule eventuallyI) | 
| 
f36a54da47a4
added derivative of scaling in exponential function
 immler parents: 
62393diff
changeset | 493 | by (metis dist_norm norm_triangle_ineq3 real_norm_def) | 
| 
f36a54da47a4
added derivative of scaling in exponential function
 immler parents: 
62393diff
changeset | 494 | |
| 60812 | 495 | lemma (in bounded_bilinear) bounded_uniform_limit[uniform_limit_intros]: | 
| 496 | assumes "uniform_limit X f l F" | |
| 497 | assumes "uniform_limit X g m F" | |
| 498 | assumes "bounded (m ` X)" | |
| 499 | assumes "bounded (l ` X)" | |
| 500 | shows "uniform_limit X (\<lambda>a b. prod (f a b) (g a b)) (\<lambda>a. prod (l a) (m a)) F" | |
| 501 | proof (rule uniform_limitI) | |
| 502 | fix e::real | |
| 503 | from pos_bounded obtain K where K: | |
| 504 | "0 < K" "\<And>a b. norm (prod a b) \<le> norm a * norm b * K" | |
| 505 | by auto | |
| 506 | hence "sqrt (K*4) > 0" by simp | |
| 507 | ||
| 508 | from assms obtain Km Kl | |
| 509 | where Km: "Km > 0" "\<And>x. x \<in> X \<Longrightarrow> norm (m x) \<le> Km" | |
| 510 | and Kl: "Kl > 0" "\<And>x. x \<in> X \<Longrightarrow> norm (l x) \<le> Kl" | |
| 511 | by (auto simp: bounded_pos) | |
| 512 | hence "K * Km * 4 > 0" "K * Kl * 4 > 0" | |
| 61222 | 513 | using \<open>K > 0\<close> | 
| 60812 | 514 | by simp_all | 
| 515 | assume "0 < e" | |
| 516 | ||
| 517 | hence "sqrt e > 0" by simp | |
| 61222 | 518 | from uniform_limitD[OF assms(1) divide_pos_pos[OF this \<open>sqrt (K*4) > 0\<close>]] | 
| 519 | uniform_limitD[OF assms(2) divide_pos_pos[OF this \<open>sqrt (K*4) > 0\<close>]] | |
| 520 | uniform_limitD[OF assms(1) divide_pos_pos[OF \<open>e > 0\<close> \<open>K * Km * 4 > 0\<close>]] | |
| 521 | uniform_limitD[OF assms(2) divide_pos_pos[OF \<open>e > 0\<close> \<open>K * Kl * 4 > 0\<close>]] | |
| 60812 | 522 | show "\<forall>\<^sub>F n in F. \<forall>x\<in>X. dist (prod (f n x) (g n x)) (prod (l x) (m x)) < e" | 
| 523 | proof eventually_elim | |
| 524 | case (elim n) | |
| 525 | show ?case | |
| 526 | proof safe | |
| 527 | fix x assume "x \<in> X" | |
| 528 | have "dist (prod (f n x) (g n x)) (prod (l x) (m x)) \<le> | |
| 529 | norm (prod (f n x - l x) (g n x - m x)) + | |
| 530 | norm (prod (f n x - l x) (m x)) + | |
| 531 | norm (prod (l x) (g n x - m x))" | |
| 532 | by (auto simp: dist_norm prod_diff_prod intro: order_trans norm_triangle_ineq add_mono) | |
| 533 | also note K(2)[of "f n x - l x" "g n x - m x"] | |
| 61222 | 534 | also from elim(1)[THEN bspec, OF \<open>_ \<in> X\<close>, unfolded dist_norm] | 
| 60812 | 535 | have "norm (f n x - l x) \<le> sqrt e / sqrt (K * 4)" | 
| 536 | by simp | |
| 61222 | 537 | also from elim(2)[THEN bspec, OF \<open>_ \<in> X\<close>, unfolded dist_norm] | 
| 60812 | 538 | have "norm (g n x - m x) \<le> sqrt e / sqrt (K * 4)" | 
| 539 | by simp | |
| 540 | also have "sqrt e / sqrt (K * 4) * (sqrt e / sqrt (K * 4)) * K = e / 4" | |
| 61222 | 541 | using \<open>K > 0\<close> \<open>e > 0\<close> by auto | 
| 60812 | 542 | also note K(2)[of "f n x - l x" "m x"] | 
| 543 | also note K(2)[of "l x" "g n x - m x"] | |
| 61222 | 544 | also from elim(3)[THEN bspec, OF \<open>_ \<in> X\<close>, unfolded dist_norm] | 
| 60812 | 545 | have "norm (f n x - l x) \<le> e / (K * Km * 4)" | 
| 546 | by simp | |
| 61222 | 547 | also from elim(4)[THEN bspec, OF \<open>_ \<in> X\<close>, unfolded dist_norm] | 
| 60812 | 548 | have "norm (g n x - m x) \<le> e / (K * Kl * 4)" | 
| 549 | by simp | |
| 61222 | 550 | also note Kl(2)[OF \<open>_ \<in> X\<close>] | 
| 551 | also note Km(2)[OF \<open>_ \<in> X\<close>] | |
| 60812 | 552 | also have "e / (K * Km * 4) * Km * K = e / 4" | 
| 61222 | 553 | using \<open>K > 0\<close> \<open>Km > 0\<close> by simp | 
| 60812 | 554 | also have " Kl * (e / (K * Kl * 4)) * K = e / 4" | 
| 61222 | 555 | using \<open>K > 0\<close> \<open>Kl > 0\<close> by simp | 
| 556 | also have "e / 4 + e / 4 + e / 4 < e" using \<open>e > 0\<close> by simp | |
| 60812 | 557 | finally show "dist (prod (f n x) (g n x)) (prod (l x) (m x)) < e" | 
| 61222 | 558 | using \<open>K > 0\<close> \<open>Kl > 0\<close> \<open>Km > 0\<close> \<open>e > 0\<close> | 
| 60812 | 559 | by (simp add: algebra_simps mult_right_mono divide_right_mono) | 
| 560 | qed | |
| 561 | qed | |
| 562 | qed | |
| 563 | ||
| 564 | lemmas bounded_bilinear_bounded_uniform_limit_intros[uniform_limit_intros] = | |
| 565 | bounded_bilinear.bounded_uniform_limit[OF Inner_Product.bounded_bilinear_inner] | |
| 566 | bounded_bilinear.bounded_uniform_limit[OF Real_Vector_Spaces.bounded_bilinear_mult] | |
| 567 | bounded_bilinear.bounded_uniform_limit[OF Real_Vector_Spaces.bounded_bilinear_scaleR] | |
| 568 | ||
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 569 | lemma uniform_lim_mult: | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 570 | fixes f :: "'a \<Rightarrow> 'b \<Rightarrow> 'c::real_normed_algebra" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 571 | assumes f: "uniform_limit S f l F" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 572 | and g: "uniform_limit S g m F" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 573 | and l: "bounded (l ` S)" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 574 | and m: "bounded (m ` S)" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 575 | shows "uniform_limit S (\<lambda>a b. f a b * g a b) (\<lambda>a. l a * m a) F" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 576 | by (intro bounded_bilinear_bounded_uniform_limit_intros assms) | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 577 | |
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 578 | lemma uniform_lim_inverse: | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 579 | fixes f :: "'a \<Rightarrow> 'b \<Rightarrow> 'c::real_normed_field" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 580 | assumes f: "uniform_limit S f l F" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 581 | and b: "\<And>x. x \<in> S \<Longrightarrow> b \<le> norm(l x)" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 582 | and "b > 0" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 583 | shows "uniform_limit S (\<lambda>x y. inverse (f x y)) (inverse \<circ> l) F" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 584 | proof (rule uniform_limitI) | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 585 | fix e::real | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 586 | assume "e > 0" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 587 | have lte: "dist (inverse (f x y)) ((inverse \<circ> l) y) < e" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 588 | if "b/2 \<le> norm (f x y)" "norm (f x y - l y) < e * b\<^sup>2 / 2" "y \<in> S" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 589 | for x y | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 590 | proof - | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 591 | have [simp]: "l y \<noteq> 0" "f x y \<noteq> 0" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 592 | using \<open>b > 0\<close> that b [OF \<open>y \<in> S\<close>] by fastforce+ | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 593 | have "norm (l y - f x y) < e * b\<^sup>2 / 2" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 594 | by (metis norm_minus_commute that(2)) | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 595 | also have "... \<le> e * (norm (f x y) * norm (l y))" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 596 | using \<open>e > 0\<close> that b [OF \<open>y \<in> S\<close>] apply (simp add: power2_eq_square) | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 597 | by (metis \<open>b > 0\<close> less_eq_real_def mult.left_commute mult_mono') | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 598 | finally show ?thesis | 
| 70817 
dd675800469d
dedicated fact collections for algebraic simplification rules potentially splitting goals
 haftmann parents: 
70136diff
changeset | 599 | by (auto simp: dist_norm field_split_simps norm_mult norm_divide) | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 600 | qed | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 601 | have "\<forall>\<^sub>F n in F. \<forall>x\<in>S. dist (f n x) (l x) < b/2" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 602 | using uniform_limitD [OF f, of "b/2"] by (simp add: \<open>b > 0\<close>) | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 603 | then have "\<forall>\<^sub>F x in F. \<forall>y\<in>S. b/2 \<le> norm (f x y)" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 604 | apply (rule eventually_mono) | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 605 | using b apply (simp only: dist_norm) | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 606 | by (metis (no_types, hide_lams) diff_zero dist_commute dist_norm norm_triangle_half_l not_less) | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 607 | then have "\<forall>\<^sub>F x in F. \<forall>y\<in>S. b/2 \<le> norm (f x y) \<and> norm (f x y - l y) < e * b\<^sup>2 / 2" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 608 | apply (simp only: ball_conj_distrib dist_norm [symmetric]) | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 609 | apply (rule eventually_conj, assumption) | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 610 | apply (rule uniform_limitD [OF f, of "e * b ^ 2 / 2"]) | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 611 | using \<open>b > 0\<close> \<open>e > 0\<close> by auto | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 612 | then show "\<forall>\<^sub>F x in F. \<forall>y\<in>S. dist (inverse (f x y)) ((inverse \<circ> l) y) < e" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 613 | using lte by (force intro: eventually_mono) | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 614 | qed | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 615 | |
| 65037 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 616 | lemma uniform_lim_divide: | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 617 | fixes f :: "'a \<Rightarrow> 'b \<Rightarrow> 'c::real_normed_field" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 618 | assumes f: "uniform_limit S f l F" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 619 | and g: "uniform_limit S g m F" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 620 | and l: "bounded (l ` S)" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 621 | and b: "\<And>x. x \<in> S \<Longrightarrow> b \<le> norm(m x)" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 622 | and "b > 0" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 623 | shows "uniform_limit S (\<lambda>a b. f a b / g a b) (\<lambda>a. l a / m a) F" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 624 | proof - | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 625 | have m: "bounded ((inverse \<circ> m) ` S)" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 626 | using b \<open>b > 0\<close> | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 627 | apply (simp add: bounded_iff) | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 628 | by (metis le_imp_inverse_le norm_inverse) | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 629 | have "uniform_limit S (\<lambda>a b. f a b * inverse (g a b)) | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 630 | (\<lambda>a. l a * (inverse \<circ> m) a) F" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 631 | by (rule uniform_lim_mult [OF f uniform_lim_inverse [OF g b \<open>b > 0\<close>] l m]) | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 632 | then show ?thesis | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 633 | by (simp add: field_class.field_divide_inverse) | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 634 | qed | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 635 | |
| 60812 | 636 | lemma uniform_limit_null_comparison: | 
| 637 | assumes "\<forall>\<^sub>F x in F. \<forall>a\<in>S. norm (f x a) \<le> g x a" | |
| 638 | assumes "uniform_limit S g (\<lambda>_. 0) F" | |
| 639 | shows "uniform_limit S f (\<lambda>_. 0) F" | |
| 640 | using assms(2) | |
| 641 | proof (rule metric_uniform_limit_imp_uniform_limit) | |
| 642 | show "\<forall>\<^sub>F x in F. \<forall>y\<in>S. dist (f x y) 0 \<le> dist (g x y) 0" | |
| 61810 | 643 | using assms(1) by (rule eventually_mono) (force simp add: dist_norm) | 
| 60812 | 644 | qed | 
| 645 | ||
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 646 | lemma uniform_limit_on_Un: | 
| 60812 | 647 | "uniform_limit I f g F \<Longrightarrow> uniform_limit J f g F \<Longrightarrow> uniform_limit (I \<union> J) f g F" | 
| 648 | by (auto intro!: uniform_limitI dest!: uniform_limitD elim: eventually_elim2) | |
| 649 | ||
| 62381 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 650 | lemma uniform_limit_on_empty [iff]: | 
| 60812 | 651 |   "uniform_limit {} f g F"
 | 
| 652 | by (auto intro!: uniform_limitI) | |
| 653 | ||
| 654 | lemma uniform_limit_on_UNION: | |
| 655 | assumes "finite S" | |
| 656 | assumes "\<And>s. s \<in> S \<Longrightarrow> uniform_limit (h s) f g F" | |
| 69313 | 657 | shows "uniform_limit (\<Union>(h ` S)) f g F" | 
| 60812 | 658 | using assms | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 659 | by induct (auto intro: uniform_limit_on_empty uniform_limit_on_Un) | 
| 60812 | 660 | |
| 661 | lemma uniform_limit_on_Union: | |
| 662 | assumes "finite I" | |
| 663 | assumes "\<And>J. J \<in> I \<Longrightarrow> uniform_limit J f g F" | |
| 664 | shows "uniform_limit (Union I) f g F" | |
| 665 | by (metis SUP_identity_eq assms uniform_limit_on_UNION) | |
| 666 | ||
| 667 | lemma uniform_limit_on_subset: | |
| 668 | "uniform_limit J f g F \<Longrightarrow> I \<subseteq> J \<Longrightarrow> uniform_limit I f g F" | |
| 61810 | 669 | by (auto intro!: uniform_limitI dest!: uniform_limitD intro: eventually_mono) | 
| 61552 
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
 eberlm parents: 
61531diff
changeset | 670 | |
| 65204 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 671 | lemma uniform_limit_bounded: | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 672 | fixes f::"'i \<Rightarrow> 'a::topological_space \<Rightarrow> 'b::metric_space" | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 673 | assumes l: "uniform_limit S f l F" | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 674 | assumes bnd: "\<forall>\<^sub>F i in F. bounded (f i ` S)" | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 675 | assumes "F \<noteq> bot" | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 676 | shows "bounded (l ` S)" | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 677 | proof - | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 678 | from l have "\<forall>\<^sub>F n in F. \<forall>x\<in>S. dist (l x) (f n x) < 1" | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 679 | by (auto simp: uniform_limit_iff dist_commute dest!: spec[where x=1]) | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 680 | with bnd | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 681 | have "\<forall>\<^sub>F n in F. \<exists>M. \<forall>x\<in>S. dist undefined (l x) \<le> M + 1" | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 682 | by eventually_elim | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 683 | (auto intro!: order_trans[OF dist_triangle2 add_mono] intro: less_imp_le | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 684 | simp: bounded_any_center[where a=undefined]) | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 685 | then show ?thesis using assms | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 686 | by (auto simp: bounded_any_center[where a=undefined] dest!: eventually_happens) | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 687 | qed | 
| 
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
 immler parents: 
65037diff
changeset | 688 | |
| 61552 
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
 eberlm parents: 
61531diff
changeset | 689 | lemma uniformly_convergent_add: | 
| 
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
 eberlm parents: 
61531diff
changeset | 690 | "uniformly_convergent_on A f \<Longrightarrow> uniformly_convergent_on A g\<Longrightarrow> | 
| 
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
 eberlm parents: 
61531diff
changeset | 691 |       uniformly_convergent_on A (\<lambda>k x. f k x + g k x :: 'a :: {real_normed_algebra})"
 | 
| 
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
 eberlm parents: 
61531diff
changeset | 692 | unfolding uniformly_convergent_on_def by (blast dest: uniform_limit_add) | 
| 
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
 eberlm parents: 
61531diff
changeset | 693 | |
| 
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
 eberlm parents: 
61531diff
changeset | 694 | lemma uniformly_convergent_minus: | 
| 
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
 eberlm parents: 
61531diff
changeset | 695 | "uniformly_convergent_on A f \<Longrightarrow> uniformly_convergent_on A g\<Longrightarrow> | 
| 
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
 eberlm parents: 
61531diff
changeset | 696 |       uniformly_convergent_on A (\<lambda>k x. f k x - g k x :: 'a :: {real_normed_algebra})"
 | 
| 
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
 eberlm parents: 
61531diff
changeset | 697 | unfolding uniformly_convergent_on_def by (blast dest: uniform_limit_minus) | 
| 
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
 eberlm parents: 
61531diff
changeset | 698 | |
| 
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
 eberlm parents: 
61531diff
changeset | 699 | lemma uniformly_convergent_mult: | 
| 63594 
bd218a9320b5
HOL-Multivariate_Analysis: rename theories for more descriptive names
 hoelzl parents: 
63040diff
changeset | 700 | "uniformly_convergent_on A f \<Longrightarrow> | 
| 61552 
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
 eberlm parents: 
61531diff
changeset | 701 |       uniformly_convergent_on A (\<lambda>k x. c * f k x :: 'a :: {real_normed_algebra})"
 | 
| 
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
 eberlm parents: 
61531diff
changeset | 702 | unfolding uniformly_convergent_on_def | 
| 
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
 eberlm parents: 
61531diff
changeset | 703 | by (blast dest: bounded_linear_uniform_limit_intros(13)) | 
| 
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
 eberlm parents: 
61531diff
changeset | 704 | |
| 62381 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 705 | subsection\<open>Power series and uniform convergence\<close> | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 706 | |
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 707 | proposition powser_uniformly_convergent: | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 708 |   fixes a :: "nat \<Rightarrow> 'a::{real_normed_div_algebra,banach}"
 | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 709 | assumes "r < conv_radius a" | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 710 | shows "uniformly_convergent_on (cball \<xi> r) (\<lambda>n x. \<Sum>i<n. a i * (x - \<xi>) ^ i)" | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 711 | proof (cases "0 \<le> r") | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 712 | case True | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 713 | then have *: "summable (\<lambda>n. norm (a n) * r ^ n)" | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 714 | using abs_summable_in_conv_radius [of "of_real r" a] assms | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 715 | by (simp add: norm_mult norm_power) | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 716 | show ?thesis | 
| 69529 | 717 | by (simp add: Weierstrass_m_test'_ev [OF _ *] norm_mult norm_power | 
| 62381 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 718 | mult_left_mono power_mono dist_norm norm_minus_commute) | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 719 | next | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 720 | case False then show ?thesis by (simp add: not_le) | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 721 | qed | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 722 | |
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 723 | lemma powser_uniform_limit: | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 724 |   fixes a :: "nat \<Rightarrow> 'a::{real_normed_div_algebra,banach}"
 | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 725 | assumes "r < conv_radius a" | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 726 | shows "uniform_limit (cball \<xi> r) (\<lambda>n x. \<Sum>i<n. a i * (x - \<xi>) ^ i) (\<lambda>x. suminf (\<lambda>i. a i * (x - \<xi>) ^ i)) sequentially" | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 727 | using powser_uniformly_convergent [OF assms] | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 728 | by (simp add: Uniform_Limit.uniformly_convergent_uniform_limit_iff Series.suminf_eq_lim) | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 729 | |
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 730 | lemma powser_continuous_suminf: | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 731 |   fixes a :: "nat \<Rightarrow> 'a::{real_normed_div_algebra,banach}"
 | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 732 | assumes "r < conv_radius a" | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 733 | shows "continuous_on (cball \<xi> r) (\<lambda>x. suminf (\<lambda>i. a i * (x - \<xi>) ^ i))" | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 734 | apply (rule uniform_limit_theorem [OF _ powser_uniform_limit]) | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 735 | apply (rule eventuallyI continuous_intros assms)+ | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 736 | apply (simp add:) | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 737 | done | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 738 | |
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 739 | lemma powser_continuous_sums: | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 740 |   fixes a :: "nat \<Rightarrow> 'a::{real_normed_div_algebra,banach}"
 | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 741 | assumes r: "r < conv_radius a" | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 742 | and sm: "\<And>x. x \<in> cball \<xi> r \<Longrightarrow> (\<lambda>n. a n * (x - \<xi>) ^ n) sums (f x)" | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 743 | shows "continuous_on (cball \<xi> r) f" | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 744 | apply (rule continuous_on_cong [THEN iffD1, OF refl _ powser_continuous_suminf [OF r]]) | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 745 | using sm sums_unique by fastforce | 
| 
a6479cb85944
New and revised material for (multivariate) analysis
 paulson <lp15@cam.ac.uk> parents: 
62175diff
changeset | 746 | |
| 67685 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 immler parents: 
67371diff
changeset | 747 | lemmas uniform_limit_subset_union = uniform_limit_on_subset[OF uniform_limit_on_Union] | 
| 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 immler parents: 
67371diff
changeset | 748 | |
| 62390 | 749 | end | 
| 62393 | 750 |