diff -r ce9c7a527c4b -r 61b1e3d88e91 src/HOL/Multivariate_Analysis/Derivative.thy --- a/src/HOL/Multivariate_Analysis/Derivative.thy Mon Mar 24 19:06:20 2014 +0100 +++ b/src/HOL/Multivariate_Analysis/Derivative.thy Mon Mar 24 14:51:10 2014 -0700 @@ -1591,10 +1591,11 @@ subsection {* Uniformly convergent sequence of derivatives *} lemma has_derivative_sequence_lipschitz_lemma: - fixes f :: "nat \ 'm::euclidean_space \ 'n::euclidean_space" + fixes f :: "nat \ 'a::real_normed_vector \ 'b::real_inner" assumes "convex s" and "\n. \x\s. ((f n) has_derivative (f' n x)) (at x within s)" and "\n\N. \x\s. \h. norm (f' n x h - g' x h) \ e * norm h" + and "0 \ e" shows "\m\N. \n\N. \x\s. \y\s. norm ((f m x - f n x) - (f m y - f n y)) \ 2 * e * norm (x - y)" proof rule+ fix m n x y @@ -1607,7 +1608,8 @@ assume "x \ s" show "((\a. f m a - f n a) has_derivative (\h. f' m x h - f' n x h)) (at x within s)" by (rule has_derivative_intros assms(2)[rule_format] `x\s`)+ - { + show "onorm (\h. f' m x h - f' n x h) \ 2 * e" + proof (rule onorm_bound) fix h have "norm (f' m x h - f' n x h) \ norm (f' m x h - g' x h) + norm (f' n x h - g' x h)" using norm_triangle_ineq[of "f' m x h - g' x h" "- f' n x h + g' x h"] @@ -1617,23 +1619,17 @@ using assms(3)[rule_format,OF `N \ m` `x \ s`, of h] using assms(3)[rule_format,OF `N \ n` `x \ s`, of h] by (auto simp add: field_simps) - finally have "norm (f' m x h - f' n x h) \ 2 * e * norm h" + finally show "norm (f' m x h - f' n x h) \ 2 * e * norm h" by auto - } - then show "onorm (\h. f' m x h - f' n x h) \ 2 * e" - apply - - apply (rule onorm_le) - apply auto - done + qed (simp add: `0 \ e`) qed qed lemma has_derivative_sequence_lipschitz: - fixes f :: "nat \ 'm::euclidean_space \ 'n::euclidean_space" + fixes f :: "nat \ 'a::real_normed_vector \ 'b::real_inner" assumes "convex s" and "\n. \x\s. ((f n) has_derivative (f' n x)) (at x within s)" and "\e>0. \N. \n\N. \x\s. \h. norm (f' n x h - g' x h) \ e * norm h" - and "e > 0" shows "\e>0. \N. \m\N. \n\N. \x\s. \y\s. norm ((f m x - f n x) - (f m y - f n y)) \ e * norm (x - y)" proof (rule, rule) @@ -1644,13 +1640,13 @@ then show ?case apply (rule_tac x=N in exI) apply (rule has_derivative_sequence_lipschitz_lemma[where e="1/2 *e", unfolded *]) - using assms + using assms `e > 0` apply auto done qed lemma has_derivative_sequence: - fixes f::"nat\ 'm::euclidean_space \ 'n::euclidean_space" + fixes f :: "nat \ 'a::real_normed_vector \ 'b::{real_inner, complete_space}" assumes "convex s" and "\n. \x\s. ((f n) has_derivative (f' n x)) (at x within s)" and "\e>0. \N. \n\N. \x\s. \h. norm (f' n x h - g' x h) \ e * norm h" @@ -1660,9 +1656,8 @@ proof - have lem1: "\e>0. \N. \m\N. \n\N. \x\s. \y\s. norm ((f m x - f n x) - (f m y - f n y)) \ e * norm (x - y)" - apply (rule has_derivative_sequence_lipschitz[where e="42::nat"]) + apply (rule has_derivative_sequence_lipschitz) apply (rule assms)+ - apply auto done have "\g. \x\s. ((\n. f n x) ---> g x) sequentially" apply (rule bchoice) @@ -1798,15 +1793,8 @@ qed qed show "bounded_linear (g' x)" - unfolding linear_linear linear_iff - apply rule - apply rule - apply rule - defer - apply rule - apply rule - proof - - fix x' y z :: 'm + proof + fix x' y z :: 'a fix c :: real note lin = assms(2)[rule_format,OF `x\s`,THEN derivative_linear] show "g' x (c *\<^sub>R x') = c *\<^sub>R g' x x'" @@ -1823,6 +1811,24 @@ apply (rule tendsto_add) apply (rule lem3[rule_format])+ done + obtain N where N: "\h. norm (f' N x h - g' x h) \ 1 * norm h" + using assms(3) `x \ s` by (fast intro: zero_less_one order_refl) + have "bounded_linear (f' N x)" + using assms(2) `x \ s` by (fast dest: has_derivative_bounded_linear) + from bounded_linear.bounded [OF this] + obtain K where K: "\h. norm (f' N x h) \ norm h * K" .. + { + fix h + have "norm (g' x h) = norm (f' N x h - (f' N x h - g' x h))" + by simp + also have "\ \ norm (f' N x h) + norm (f' N x h - g' x h)" + by (rule norm_triangle_ineq4) + also have "\ \ norm h * K + 1 * norm h" + using N K by (fast intro: add_mono) + finally have "norm (g' x h) \ norm h * (K + 1)" + by (simp add: ring_distribs) + } + then show "\K. \h. norm (g' x h) \ norm h * K" by fast qed show "\e>0. \d>0. \y\s. norm (y - x) < d \ norm (g y - g x - g' x (y - x)) \ e * norm (y - x)" proof (rule, rule) @@ -1879,7 +1885,7 @@ text {* Can choose to line up antiderivatives if we want. *} lemma has_antiderivative_sequence: - fixes f :: "nat \ 'm::euclidean_space \ 'n::euclidean_space" + fixes f :: "nat \ 'a::real_normed_vector \ 'b::{real_inner, complete_space}" assumes "convex s" and "\n. \x\s. ((f n) has_derivative (f' n x)) (at x within s)" and "\e>0. \N. \n\N. \x\s. \h. norm (f' n x h - g' x h) \ e * norm h" @@ -1900,7 +1906,7 @@ qed auto lemma has_antiderivative_limit: - fixes g' :: "'m::euclidean_space \ 'm \ 'n::euclidean_space" + fixes g' :: "'a::real_normed_vector \ 'a \ 'b::{real_inner, complete_space}" assumes "convex s" and "\e>0. \f f'. \x\s. (f has_derivative (f' x)) (at x within s) \ (\h. norm (f' x h - g' x h) \ e * norm h)" @@ -1952,7 +1958,7 @@ subsection {* Differentiation of a series *} lemma has_derivative_series: - fixes f :: "nat \ 'm::euclidean_space \ 'n::euclidean_space" + fixes f :: "nat \ 'a::real_normed_vector \ 'b::{real_inner, complete_space}" assumes "convex s" and "\n x. x \ s \ ((f n) has_derivative (f' n x)) (at x within s)" and "\e>0. \N. \n\N. \x\s. \h. norm (setsum (\i. f' i x h) {.. e * norm h"