# HG changeset patch # User huffman # Date 1395002075 25200 # Node ID ac8098b0e458c862ec201be57d8f237cfde03d87 # Parent 9a241bc276cddb9c40dac2b59bead5489fdde197 tuned proofs diff -r 9a241bc276cd -r ac8098b0e458 src/HOL/Transcendental.thy --- a/src/HOL/Transcendental.thy Sun Mar 16 18:09:04 2014 +0100 +++ b/src/HOL/Transcendental.thy Sun Mar 16 13:34:35 2014 -0700 @@ -533,54 +533,28 @@ qed lemma lemma_termdiff4: - fixes f :: "'a::{real_normed_field} \ - 'b::real_normed_vector" + fixes f :: "'a::real_normed_vector \ 'b::real_normed_vector" assumes k: "0 < (k::real)" and le: "\h. \h \ 0; norm h < k\ \ norm (f h) \ K * norm h" shows "f -- 0 --> 0" - unfolding LIM_eq diff_0_right -proof safe - let ?h = "of_real (k / 2)::'a" - have "?h \ 0" and "norm ?h < k" using k by simp_all - hence "norm (f ?h) \ K * norm ?h" by (rule le) - hence "0 \ K * norm ?h" by (rule order_trans [OF norm_ge_zero]) - hence zero_le_K: "0 \ K" using k by (simp add: zero_le_mult_iff) - - fix r::real - assume r: "0 < r" - show "\s. 0 < s \ (\x. x \ 0 \ norm x < s \ norm (f x) < r)" - proof cases - assume "K = 0" - with k r le have "0 < k \ (\x. x \ 0 \ norm x < k \ norm (f x) < r)" +proof (rule tendsto_norm_zero_cancel) + show "(\h. norm (f h)) -- 0 --> 0" + proof (rule real_tendsto_sandwich) + show "eventually (\h. 0 \ norm (f h)) (at 0)" by simp - thus "\s. 0 < s \ (\x. x \ 0 \ norm x < s \ norm (f x) < r)" .. - next - assume K_neq_zero: "K \ 0" - with zero_le_K have K: "0 < K" by simp - show "\s. 0 < s \ (\x. x \ 0 \ norm x < s \ norm (f x) < r)" - proof (rule exI, safe) - from k r K - show "0 < min k (r * inverse K / 2)" - by (simp add: mult_pos_pos positive_imp_inverse_positive) - next - fix x::'a - assume x1: "x \ 0" and x2: "norm x < min k (r * inverse K / 2)" - from x2 have x3: "norm x < k" and x4: "norm x < r * inverse K / 2" - by simp_all - from x1 x3 le have "norm (f x) \ K * norm x" by simp - also from x4 K have "K * norm x < K * (r * inverse K / 2)" - by (rule mult_strict_left_mono) - also have "\ = r / 2" - using K_neq_zero by simp - also have "r / 2 < r" - using r by simp - finally show "norm (f x) < r" . - qed + show "eventually (\h. norm (f h) \ K * norm h) (at 0)" + using k by (auto simp add: eventually_at dist_norm le) + show "(\h. 0) -- (0::'a) --> (0::real)" + by (rule tendsto_const) + have "(\h. K * norm h) -- (0::'a) --> K * norm (0::'a)" + by (intro tendsto_intros) + then show "(\h. K * norm h) -- (0::'a) --> 0" + by simp qed qed lemma lemma_termdiff5: - fixes g :: "'a::real_normed_field \ nat \ 'b::banach" + fixes g :: "'a::real_normed_vector \ nat \ 'b::banach" assumes k: "0 < (k::real)" assumes f: "summable f" assumes le: "\h n. \h \ 0; norm h < k\ \ norm (g h n) \ f n * norm h" @@ -685,34 +659,20 @@ show "0 < norm K - norm x" using 4 by (simp add: less_diff_eq) next fix h :: 'a - assume "h \ 0" assume "norm (h - 0) < norm K - norm x" hence "norm x + norm h < norm K" by simp hence 5: "norm (x + h) < norm K" by (rule norm_triangle_ineq [THEN order_le_less_trans]) - have A: "summable (\n. c n * x ^ n)" - by (rule powser_inside [OF 1 4]) - have B: "summable (\n. c n * (x + h) ^ n)" - by (rule powser_inside [OF 1 5]) - have C: "summable (\n. diffs c n * x ^ n)" - by (rule powser_inside [OF 2 4]) - let ?dp = "(\n. of_nat n * c n * x ^ (n - Suc 0))" - have "((\n. c n * (x + h) ^ n) - (\n. c n * x ^ n)) / h - (\n. diffs c n * x ^ n) = - ((\n. c n * (x + h) ^ n) - (\n. c n * x ^ n)) / h - ?dp" - by (metis sums_unique [OF diffs_equiv [OF C]]) - also have "... = (\n. c n * (x + h) ^ n - c n * x ^ n) / h - ?dp" - by (metis suminf_diff [OF B A]) - also have "... = (\n. (c n * (x + h) ^ n - c n * x ^ n) / h) - ?dp" - by (metis suminf_divide [OF summable_diff [OF B A]] ) - also have "... = (\n. (c n * (x + h) ^ n - c n * x ^ n) / h - of_nat n * c n * x ^ (n - Suc 0))" - apply (subst suminf_diff) - apply (auto intro: summable_divide summable_diff [OF B A] sums_summable [OF diffs_equiv [OF C]]) - done - also have "... = (\n. c n * (((x + h) ^ n - x ^ n) / h - of_nat n * x ^ (n - Suc 0)))" + have "summable (\n. c n * x ^ n)" + and "summable (\n. c n * (x + h) ^ n)" + and "summable (\n. diffs c n * x ^ n)" + using 1 2 4 5 by (auto elim: powser_inside) + then have "((\n. c n * (x + h) ^ n) - (\n. c n * x ^ n)) / h - (\n. diffs c n * x ^ n) = + (\n. (c n * (x + h) ^ n - c n * x ^ n) / h - of_nat n * c n * x ^ (n - Suc 0))" + by (intro sums_unique sums_diff sums_divide diffs_equiv summable_sums) + then show "((\n. c n * (x + h) ^ n) - (\n. c n * x ^ n)) / h - (\n. diffs c n * x ^ n) = + (\n. c n * (((x + h) ^ n - x ^ n) / h - of_nat n * x ^ (n - Suc 0)))" by (simp add: algebra_simps) - finally show "((\n. c n * (x + h) ^ n) - (\n. c n * x ^ n)) / h - - (\n. diffs c n * x ^ n) = - (\n. c n * (((x + h) ^ n - x ^ n) / h - of_nat n * x ^ (n - Suc 0)))" . next show "(\h. \n. c n * (((x + h) ^ n - x ^ n) / h - of_nat n * x ^ (n - Suc 0))) -- 0 --> 0" by (rule termdiffs_aux [OF 3 4])