# HG changeset patch # User paulson # Date 1503514451 -3600 # Node ID 0b46bd0812285ab92b498dd0e1727630d9f6fc51 # Parent 307c19f24d5cf183e4a3ddcc1efde81cc59e30b7 More tidying up of monotone_convergence_interval diff -r 307c19f24d5c -r 0b46bd081228 src/HOL/Analysis/Harmonic_Numbers.thy --- a/src/HOL/Analysis/Harmonic_Numbers.thy Wed Aug 23 00:38:53 2017 +0100 +++ b/src/HOL/Analysis/Harmonic_Numbers.thy Wed Aug 23 19:54:11 2017 +0100 @@ -38,7 +38,7 @@ unfolding harm_def by simp lemma abs_harm [simp]: "(abs (harm n) :: real) = harm n" - using harm_nonneg[of n] by (rule abs_of_nonneg) + using harm_nonneg[of n] by (rule abs_of_nonneg) lemma norm_harm: "norm (harm n) = harm n" by (subst of_real_harm [symmetric]) (simp add: harm_nonneg) @@ -99,12 +99,12 @@ show "eventually (\n. harm n \ ln (real (Suc n))) at_top" using ln_le_harm by (intro always_eventually allI) (simp_all add: add_ac) show "filterlim (\n. ln (real (Suc n))) at_top sequentially" - by (intro filterlim_compose[OF ln_at_top] filterlim_compose[OF filterlim_real_sequentially] + by (intro filterlim_compose[OF ln_at_top] filterlim_compose[OF filterlim_real_sequentially] filterlim_Suc) qed -subsection \The Euler--Mascheroni constant\ +subsection \The Euler-Mascheroni constant\ text \ The limit of the difference between the partial harmonic sum and the natural logarithm @@ -250,7 +250,7 @@ qed -subsection \Bounds on the Euler--Mascheroni constant\ +subsection \Bounds on the Euler-Mascheroni constant\ (* TODO: Move? *) lemma ln_inverse_approx_le: @@ -295,7 +295,7 @@ finally show "inverse t \ (t - x) * f' + inverse x" . qed hence "integral {x..x+a} inverse \ integral {x..x+a} ?f" using f'_nonpos assms - by (intro integral_le has_integral_integrable[OF int1] has_integral_integrable[OF int2] ineq) + by (blast intro: integral_le has_integral_integrable[OF int1] has_integral_integrable[OF int2] ineq) also have "\ = ?A" using int1 by (rule integral_unique) finally show ?thesis . qed @@ -332,7 +332,7 @@ thus "(t - m) * f' + inverse m \ inverse t" by (simp add: algebra_simps) qed hence "integral {x..y} inverse \ integral {x..y} (\t. (t - m) * f' + inverse m)" - using int1 int2 by (intro integral_le has_integral_integrable) + using int1 int2 by (blast intro: integral_le has_integral_integrable) also have "integral {x..y} (\t. (t - m) * f' + inverse m) = ?A" using integral_unique[OF int1] by simp finally show ?thesis . @@ -359,7 +359,7 @@ from euler_mascheroni_sum_real have "euler_mascheroni = (\k. D k)" by (simp add: sums_iff D_def) also have "\ = (\k. D (k + Suc n)) + (\k\n. D k)" - by (subst suminf_split_initial_segment[OF summable, of "Suc n"], + by (subst suminf_split_initial_segment[OF summable, of "Suc n"], subst lessThan_Suc_atMost) simp finally have sum: "(\k\n. D k) - euler_mascheroni = -(\k. D (k + Suc n))" by simp @@ -524,7 +524,7 @@ text \ - Approximation of the Euler--Mascheroni constant. The lower bound is accurate to about 0.0015; + Approximation of the Euler-Mascheroni constant. The lower bound is accurate to about 0.0015; the upper bound is accurate to about 0.015. \ lemma euler_mascheroni_gt_19_over_33: "(euler_mascheroni :: real) > 19/33" (is ?th1) diff -r 307c19f24d5c -r 0b46bd081228 src/HOL/Analysis/Henstock_Kurzweil_Integration.thy --- a/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy Wed Aug 23 00:38:53 2017 +0100 +++ b/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy Wed Aug 23 19:54:11 2017 +0100 @@ -245,26 +245,25 @@ lemma has_integral: "(f has_integral y) (cbox a b) \ - (\e>0. \d. gauge d \ - (\p. p tagged_division_of (cbox a b) \ d fine p \ - norm (sum (\(x,k). content(k) *\<^sub>R f x) p - y) < e))" + (\e>0. \\. gauge \ \ + (\\. \ tagged_division_of (cbox a b) \ \ fine \ \ + norm (sum (\(x,k). content(k) *\<^sub>R f x) \ - y) < e))" by (auto simp: dist_norm eventually_division_filter has_integral_def tendsto_iff) lemma has_integral_real: "(f has_integral y) {a..b::real} \ - (\e>0. \d. gauge d \ - (\p. p tagged_division_of {a..b} \ d fine p \ - norm (sum (\(x,k). content(k) *\<^sub>R f x) p - y) < e))" - unfolding box_real[symmetric] - by (rule has_integral) + (\e>0. \\. gauge \ \ + (\\. \ tagged_division_of {a..b} \ \ fine \ \ + norm (sum (\(x,k). content(k) *\<^sub>R f x) \ - y) < e))" + unfolding box_real[symmetric] by (rule has_integral) lemma has_integralD[dest]: assumes "(f has_integral y) (cbox a b)" and "e > 0" - obtains d - where "gauge d" - and "\p. p tagged_division_of (cbox a b) \ d fine p \ - norm ((\(x,k)\p. content k *\<^sub>R f x) - y) < e" + obtains \ + where "gauge \" + and "\\. \ tagged_division_of (cbox a b) \ \ fine \ \ + norm ((\(x,k)\\. content k *\<^sub>R f x) - y) < e" using assms unfolding has_integral by auto lemma has_integral_alt: @@ -906,28 +905,28 @@ subsection \Cauchy-type criterion for integrability.\ -lemma integrable_Cauchy: +proposition integrable_Cauchy: fixes f :: "'n::euclidean_space \ 'a::{real_normed_vector,complete_space}" shows "f integrable_on cbox a b \ (\e>0. \\. gauge \ \ - (\p1 p2. p1 tagged_division_of (cbox a b) \ \ fine p1 \ - p2 tagged_division_of (cbox a b) \ \ fine p2 \ - norm ((\(x,K)\p1. content K *\<^sub>R f x) - (\(x,K)\p2. content K *\<^sub>R f x)) < e))" + (\\1 \2. \1 tagged_division_of (cbox a b) \ \ fine \1 \ + \2 tagged_division_of (cbox a b) \ \ fine \2 \ + norm ((\(x,K)\\1. content K *\<^sub>R f x) - (\(x,K)\\2. content K *\<^sub>R f x)) < e))" (is "?l = (\e>0. \\. ?P e \)") proof (intro iffI allI impI) assume ?l then obtain y where y: "\e. e > 0 \ \\. gauge \ \ - (\p. p tagged_division_of cbox a b \ \ fine p \ - norm ((\(x,K) \ p. content K *\<^sub>R f x) - y) < e)" + (\\. \ tagged_division_of cbox a b \ \ fine \ \ + norm ((\(x,K) \ \. content K *\<^sub>R f x) - y) < e)" by (auto simp: integrable_on_def has_integral) show "\\. ?P e \" if "e > 0" for e proof - have "e/2 > 0" using that by auto with y obtain \ where "gauge \" - and \: "\p. p tagged_division_of cbox a b \ \ fine p \ - norm ((\(x,K)\p. content K *\<^sub>R f x) - y) < e/2" + and \: "\\. \ tagged_division_of cbox a b \ \ fine \ \ + norm ((\(x,K)\\. content K *\<^sub>R f x) - y) < e/2" by meson show ?thesis apply (rule_tac x=\ in exI, clarsimp simp: \gauge \\) @@ -939,9 +938,9 @@ by auto then obtain \ :: "nat \ 'n \ 'n set" where \: "\m. gauge (\ m)" - "\m p1 p2. \p1 tagged_division_of cbox a b; - \ m fine p1; p2 tagged_division_of cbox a b; \ m fine p2\ - \ norm ((\(x,K) \ p1. content K *\<^sub>R f x) - (\(x,K) \ p2. content K *\<^sub>R f x)) + "\m \1 \2. \\1 tagged_division_of cbox a b; + \ m fine \1; \2 tagged_division_of cbox a b; \ m fine \2\ + \ norm ((\(x,K) \ \1. content K *\<^sub>R f x) - (\(x,K) \ \2. content K *\<^sub>R f x)) < 1 / (m + 1)" by metis have "\n. gauge (\x. \{\ i x |i. i \ {0..n}})" @@ -985,8 +984,8 @@ obtain N2::nat where N2: "\n. n \ N2 \ norm ((\(x,K) \ p n. content K *\<^sub>R f x) - y) < e/2" using y[OF e2] by metis show "\\. gauge \ \ - (\p. p tagged_division_of (cbox a b) \ \ fine p \ - norm ((\(x,K) \ p. content K *\<^sub>R f x) - y) < e)" + (\\. \ tagged_division_of (cbox a b) \ \ fine \ \ + norm ((\(x,K) \ \. content K *\<^sub>R f x) - y) < e)" proof (intro exI conjI allI impI) show "gauge (\ (N1+N2))" using \ by auto @@ -1051,15 +1050,15 @@ by auto obtain \1 where \1: "gauge \1" and \1norm: - "\p. \p tagged_division_of cbox a b \ {x. x \ k \ c}; \1 fine p\ - \ norm ((\(x,K) \ p. content K *\<^sub>R f x) - i) < e/2" + "\\. \\ tagged_division_of cbox a b \ {x. x \ k \ c}; \1 fine \\ + \ norm ((\(x,K) \ \. content K *\<^sub>R f x) - i) < e/2" apply (rule has_integralD[OF fi[unfolded interval_split[OF k]] e]) apply (simp add: interval_split[symmetric] k) done obtain \2 where \2: "gauge \2" and \2norm: - "\p. \p tagged_division_of cbox a b \ {x. c \ x \ k}; \2 fine p\ - \ norm ((\(x, k) \ p. content k *\<^sub>R f x) - j) < e/2" + "\\. \\ tagged_division_of cbox a b \ {x. c \ x \ k}; \2 fine \\ + \ norm ((\(x, k) \ \. content k *\<^sub>R f x) - j) < e/2" apply (rule has_integralD[OF fj[unfolded interval_split[OF k]] e]) apply (simp add: interval_split[symmetric] k) done @@ -1067,8 +1066,8 @@ have "gauge ?\" using \1 \2 unfolding gauge_def by auto then show "\\. gauge \ \ - (\p. p tagged_division_of cbox a b \ \ fine p \ - norm ((\(x, k)\p. content k *\<^sub>R f x) - (i + j)) < e)" + (\\. \ tagged_division_of cbox a b \ \ fine \ \ + norm ((\(x, k)\\. content k *\<^sub>R f x) - (i + j)) < e)" proof (rule_tac x="?\" in exI, safe) fix p assume p: "p tagged_division_of (cbox a b)" and "?\ fine p" @@ -4741,9 +4740,9 @@ lemma has_integral_le: fixes f :: "'n::euclidean_space \ real" - assumes "(f has_integral i) s" - and "(g has_integral j) s" - and "\x\s. f x \ g x" + assumes "(f has_integral i) S" + and "(g has_integral j) S" + and "\x. x \ S \ f x \ g x" shows "i \ j" using has_integral_component_le[OF _ assms(1-2), of 1] using assms(3) @@ -4751,27 +4750,27 @@ lemma integral_le: fixes f :: "'n::euclidean_space \ real" - assumes "f integrable_on s" - and "g integrable_on s" - and "\x\s. f x \ g x" - shows "integral s f \ integral s g" + assumes "f integrable_on S" + and "g integrable_on S" + and "\x. x \ S \ f x \ g x" + shows "integral S f \ integral S g" by (rule has_integral_le[OF assms(1,2)[unfolded has_integral_integral] assms(3)]) lemma has_integral_nonneg: fixes f :: "'n::euclidean_space \ real" - assumes "(f has_integral i) s" - and "\x\s. 0 \ f x" + assumes "(f has_integral i) S" + and "\x. x \ S \ 0 \ f x" shows "0 \ i" - using has_integral_component_nonneg[of 1 f i s] + using has_integral_component_nonneg[of 1 f i S] unfolding o_def using assms by auto lemma integral_nonneg: fixes f :: "'n::euclidean_space \ real" - assumes "f integrable_on s" - and "\x\s. 0 \ f x" - shows "0 \ integral s f" + assumes "f integrable_on S" + and "\x. x \ S \ 0 \ f x" + shows "0 \ integral S f" by (rule has_integral_nonneg[OF assms(1)[unfolded has_integral_integral] assms(2)]) @@ -5897,8 +5896,8 @@ lemma henstock_lemma_part2: fixes f :: "'m::euclidean_space \ 'n::euclidean_space" assumes fed: "f integrable_on cbox a b" "e > 0" "gauge d" - and less_e: "\p. \p tagged_division_of (cbox a b); d fine p\ \ - norm (sum (\(x,k). content k *\<^sub>R f x) p - integral (cbox a b) f) < e" + and less_e: "\\. \\ tagged_division_of (cbox a b); d fine \\ \ + norm (sum (\(x,k). content k *\<^sub>R f x) \ - integral (cbox a b) f) < e" and tag: "p tagged_partial_division_of (cbox a b)" and "d fine p" shows "sum (\(x,k). norm (content k *\<^sub>R f x - integral k f)) p \ 2 * real (DIM('n)) * e" @@ -5930,8 +5929,8 @@ have *: "e/(2 * (real DIM('n) + 1)) > 0" using \e > 0\ by simp with integrable_integral[OF intf, unfolded has_integral] obtain \ where "gauge \" - and \: "\p. \p tagged_division_of cbox a b; \ fine p\ \ - norm ((\(x,K)\p. content K *\<^sub>R f x) - integral (cbox a b) f) + and \: "\\. \\ tagged_division_of cbox a b; \ fine \\ \ + norm ((\(x,K)\\. content K *\<^sub>R f x) - integral (cbox a b) f) < e/(2 * (real DIM('n) + 1))" by metis show thesis @@ -5951,14 +5950,12 @@ subsection \Monotone convergence (bounded interval first)\ -(* TODO: is this lemma necessary? *) lemma bounded_increasing_convergent: fixes f :: "nat \ real" shows "\bounded (range f); \n. f n \ f (Suc n)\ \ \l. f \ l" using Bseq_mono_convergent[of f] incseq_Suc_iff[of f] by (auto simp: image_def Bseq_eq_bounded convergent_def incseq_def) -(*FIXME: why so much " \ 1"? *) lemma monotone_convergence_interval: fixes f :: "nat \ 'n::euclidean_space \ real" assumes intf: "\k. (f k) integrable_on cbox a b" @@ -5967,57 +5964,53 @@ and bou: "bounded (range (\k. integral (cbox a b) (f k)))" shows "g integrable_on cbox a b \ ((\k. integral (cbox a b) (f k)) \ integral (cbox a b) g) sequentially" proof (cases "content (cbox a b) = 0") - case True - then show ?thesis + case True then show ?thesis by auto next case False - have fg1: "(f k x) \ 1 \ (g x) \ 1" if x: "x \ cbox a b" for x k + have fg1: "(f k x) \ (g x)" if x: "x \ cbox a b" for x k proof - - have "\\<^sub>F xa in sequentially. f k x \ 1 \ f xa x \ 1" - unfolding eventually_sequentially - apply (rule_tac x=k in exI) + have "\\<^sub>F j in sequentially. f k x \ f j x" + apply (rule eventually_sequentiallyI [of k]) using le x apply (force intro: transitive_stepwise_le) done - with Lim_component_ge [OF fg] x - show "f k x \ 1 \ g x \ 1" - using trivial_limit_sequentially by blast + then show "f k x \ g x" + using tendsto_lowerbound [OF fg] x trivial_limit_sequentially by blast qed have int_inc: "\n. integral (cbox a b) (f n) \ integral (cbox a b) (f (Suc n))" - by (metis integral_le assms(1-2)) + by (metis integral_le intf le) then obtain i where i: "(\k. integral (cbox a b) (f k)) \ i" using bounded_increasing_convergent bou by blast - have "\k. \\<^sub>F x in sequentially. integral (cbox a b) (f k) \ integral (cbox a b) (f x) \ 1" + have "\k. \\<^sub>F x in sequentially. integral (cbox a b) (f k) \ integral (cbox a b) (f x)" unfolding eventually_sequentially by (force intro: transitive_stepwise_le int_inc) - then have i': "\k. (integral(cbox a b) (f k)) \ i\1" - using Lim_component_ge [OF i] trivial_limit_sequentially by blast + then have i': "\k. (integral(cbox a b) (f k)) \ i" + using tendsto_le [OF trivial_limit_sequentially i] by blast have "(g has_integral i) (cbox a b)" unfolding has_integral real_norm_def proof clarify fix e::real assume e: "e > 0" - have "\k. (\d. gauge d \ (\p. p tagged_division_of (cbox a b) \ d fine p \ - abs ((\(x, ka)\p. content ka *\<^sub>R f k x) - integral (cbox a b) (f k)) < e/2 ^ (k + 2)))" + have "\k. (\\. gauge \ \ (\\. \ tagged_division_of (cbox a b) \ \ fine \ \ + abs ((\(x,K)\\. content K *\<^sub>R f k x) - integral (cbox a b) (f k)) < e/2 ^ (k + 2)))" using intf e by (auto simp: has_integral_integral has_integral) - then obtain c where c: - "\x. gauge (c x)" - "\x p. \p tagged_division_of cbox a b; c x fine p\ \ - abs ((\(u, ka)\p. content ka *\<^sub>R f x u) - integral (cbox a b) (f x)) + then obtain c where c: "\x. gauge (c x)" + "\x \. \\ tagged_division_of cbox a b; c x fine \\ \ + abs ((\(u,K)\\. content K *\<^sub>R f x u) - integral (cbox a b) (f x)) < e/2 ^ (x + 2)" by metis - have "\r. \k\r. 0 \ i\1 - (integral (cbox a b) (f k)) \ i\1 - (integral (cbox a b) (f k)) < e/4" + have "\r. \k\r. 0 \ i - (integral (cbox a b) (f k)) \ i - (integral (cbox a b) (f k)) < e/4" proof - have "e/4 > 0" using e by auto show ?thesis using LIMSEQ_D [OF i \e/4 > 0\] i' by auto qed - then obtain r where r: "\k. r \ k \ 0 \ i \ 1 - integral (cbox a b) (f k)" - "\k. r \ k \ i \ 1 - integral (cbox a b) (f k) < e/4" + then obtain r where r: "\k. r \ k \ 0 \ i - integral (cbox a b) (f k)" + "\k. r \ k \ i - integral (cbox a b) (f k) < e/4" by metis - have "\n\r. \k\n. 0 \ (g x)\1 - (f k x)\1 \ (g x)\1 - (f k x)\1 < e/(4 * content(cbox a b))" + have "\n\r. \k\n. 0 \ (g x) - (f k x) \ (g x) - (f k x) < e/(4 * content(cbox a b))" if "x \ cbox a b" for x proof - have "e/(4 * content (cbox a b)) > 0" @@ -6027,8 +6020,8 @@ by metis then show "\n\r. \k\n. - 0 \ g x \ 1 - f k x \ 1 \ - g x \ 1 - f k x \ 1 + 0 \ g x - f k x \ + g x - f k x < e/(4 * content (cbox a b))" apply (rule_tac x="N + r" in exI) using fg1[OF that] apply (auto simp add: field_simps) @@ -6036,30 +6029,29 @@ qed then obtain m where r_le_m: "\x. x \ cbox a b \ r \ m x" and m: "\x k. \x \ cbox a b; m x \ k\ - \ 0 \ g x \ 1 - f k x \ 1 \ g x \ 1 - f k x \ 1 < e/(4 * content (cbox a b))" + \ 0 \ g x - f k x \ g x - f k x < e/(4 * content (cbox a b))" by metis define d where "d x = c (m x) x" for x show "\\. gauge \ \ - (\p. p tagged_division_of cbox a b \ - \ fine p \ abs ((\(x,K)\p. content K *\<^sub>R g x) - i) < e)" + (\\. \ tagged_division_of cbox a b \ + \ fine \ \ abs ((\(x,K)\\. content K *\<^sub>R g x) - i) < e)" proof (rule exI, safe) show "gauge d" using c(1) unfolding gauge_def d_def by auto next - fix p - assume p: "p tagged_division_of (cbox a b)" "d fine p" + fix \ + assume p: "\ tagged_division_of (cbox a b)" "d fine \" note p'=tagged_division_ofD[OF p(1)] - obtain s where s: "\x. x \ p \ m (fst x) \ s" + obtain s where s: "\x. x \ \ \ m (fst x) \ s" by (metis finite_imageI finite_nat_set_iff_bounded_le p'(1) rev_image_eqI) have *: "\a - d\ < e" if "\a - b\ \ e/4" "\b - c\ < e/2" "\c - d\ < e/4" for a b c d using that norm_triangle_lt[of "a - b" "b - c" "3* e/4"] norm_triangle_lt[of "a - b + (b - c)" "c - d" e] by (auto simp add: algebra_simps) - show "abs ((\(x, k)\p. content k *\<^sub>R g x) - i) < e" + show "\(\(x, k)\\. content k *\<^sub>R g x) - i\ < e" proof (rule *) - show "\(\(x, k)\p. content k *\<^sub>R g x) - (\(x, K)\p. content K *\<^sub>R f (m x) x)\ - \ e/4" - apply (rule order_trans[of _ "\(x, k)\p. content k * (e/(4 * content (cbox a b)))"]) + show "\(\(x,K)\\. content K *\<^sub>R g x) - (\(x,K)\\. content K *\<^sub>R f (m x) x)\ \ e/4" + apply (rule order_trans[of _ "\(x, k)\\. content k * (e/(4 * content (cbox a b)))"]) unfolding sum_subtractf[symmetric] apply (rule order_trans) apply (rule sum_abs) @@ -6069,94 +6061,85 @@ unfolding additive_content_tagged_division[OF p(1), unfolded split_def] proof - fix x K - assume xk: "(x, K) \ p" - then have x: "x \ cbox a b" - using p'(2-3)[OF xk] by auto - with p'(4)[OF xk] obtain u v where "K = cbox u v" by metis + assume xk: "(x, K) \ \" + with p(1) have x: "x \ cbox a b" + by blast then show "abs (content K *\<^sub>R (g x - f (m x) x)) \ content K * (e/(4 * content (cbox a b)))" - unfolding abs_scaleR using m[OF x] - by (metis real_inner_1_right real_scaleR_def abs_of_nonneg inner_real_def less_eq_real_def measure_nonneg mult_left_mono order_refl) + unfolding abs_scaleR using m[OF x] p'(4)[OF xk] + by (metis real_scaleR_def abs_of_nonneg less_eq_real_def measure_nonneg mult_left_mono order_refl) qed (insert False, auto) - next - have "norm ((\(x, K)\p. content K *\<^sub>R f (m x) x) - (\(x, k)\p. integral k (f (m x)))) - \ norm - (\j = 0..s. - \(x, K)\{xk \ p. m (fst xk) = j}. - content K *\<^sub>R f (m x) x - integral K (f (m x)))" + have "norm ((\(x,K)\\. content K *\<^sub>R f (m x) x) - (\(x,K)\\. integral K (f (m x)))) + \ norm (\j = 0..s. \(x,K)\{xk \ \. m (fst xk) = j}. content K *\<^sub>R f (m x) x - integral K (f (m x)))" apply (subst sum_group) using s by (auto simp: sum_subtractf split_def p'(1)) also have "\ < e/2" proof - - have "norm (\j = 0..s. \(x, k)\{xk \ p. m (fst xk) = j}. content k *\<^sub>R f (m x) x - integral k (f (m x))) + have "norm (\j = 0..s. \(x, k)\{xk \ \. m (fst xk) = j}. content k *\<^sub>R f (m x) x - integral k (f (m x))) \ (\i = 0..s. e/2 ^ (i + 2))" proof (rule sum_norm_le) fix t assume "t \ {0..s}" - have "norm (\(x,k)\{xk \ p. m (fst xk) = t}. content k *\<^sub>R f (m x) x - integral k (f (m x))) = - norm (\(x,k)\{xk \ p. m (fst xk) = t}. content k *\<^sub>R f t x - integral k (f t))" + have "norm (\(x,k)\{xk \ \. m (fst xk) = t}. content k *\<^sub>R f (m x) x - integral k (f (m x))) = + norm (\(x,k)\{xk \ \. m (fst xk) = t}. content k *\<^sub>R f t x - integral k (f t))" by (force intro!: sum.cong arg_cong[where f=norm]) also have "... \ e/2 ^ (t + 2)" proof (rule henstock_lemma_part1 [OF intf]) - show "{xk \ p. m (fst xk) = t} tagged_partial_division_of cbox a b" - apply (rule tagged_partial_division_subset[of p]) + show "{xk \ \. m (fst xk) = t} tagged_partial_division_of cbox a b" + apply (rule tagged_partial_division_subset[of \]) using p by (auto simp: tagged_division_of_def) - show "c t fine {xk \ p. m (fst xk) = t}" + show "c t fine {xk \ \. m (fst xk) = t}" using p(2) by (auto simp: fine_def d_def) qed (use c e in auto) - finally show "norm (\(x,K)\{xk \ p. m (fst xk) = t}. content K *\<^sub>R f (m x) x - + finally show "norm (\(x,K)\{xk \ \. m (fst xk) = t}. content K *\<^sub>R f (m x) x - integral K (f (m x))) \ e/2 ^ (t + 2)" . qed also have "... = (e/2/2) * (\i = 0..s. (1/2) ^ i)" by (simp add: sum_distrib_left field_simps) also have "\ < e/2" by (simp add: sum_gp mult_strict_left_mono[OF _ e]) - finally show "norm (\j = 0..s. \(x, k)\{xk \ p. + finally show "norm (\j = 0..s. \(x, k)\{xk \ \. m (fst xk) = j}. content k *\<^sub>R f (m x) x - integral k (f (m x))) < e/2" . qed - finally show "\(\(x,K)\p. content K *\<^sub>R f (m x) x) - (\(x,K)\p. integral K (f (m x)))\ < e/2" + finally show "\(\(x,K)\\. content K *\<^sub>R f (m x) x) - (\(x,K)\\. integral K (f (m x)))\ < e/2" by simp next - note comb = integral_combine_tagged_division_topdown[OF assms(1)[rule_format] p(1)] - have *: "\sr sx ss ks kr. \kr = sr; ks = ss; - ks \ i; sr \ sx; sx \ ss; 0 \ i\1 - kr\1; i\1 - kr\1 < e/4\ \ \sx - i\ < e/4" - by auto - show "\(\(x, k)\p. integral k (f (m x))) - i\ < e/4" - unfolding real_norm_def - apply (rule *) - apply (rule comb[of r]) - apply (rule comb[of s]) - apply (rule i'[unfolded real_inner_1_right]) - apply (rule_tac[1-2] sum_mono) - unfolding split_paired_all split_conv - apply (rule_tac[1-2] integral_le[OF ]) - proof safe - show "0 \ i\1 - (integral (cbox a b) (f r))\1" "i\1 - (integral (cbox a b) (f r))\1 < e/4" - using r by auto + have comb: "integral (cbox a b) (f y) = (\(x, k)\\. integral k (f y))" for y + using integral_combine_tagged_division_topdown[OF intf p(1)] by metis + have f_le: "\y m n. \y \ cbox a b; n\m\ \ f m y \ f n y" + using le by (auto intro: transitive_stepwise_le) + have "(\(x, k)\\. integral k (f r)) \ (\(x, K)\\. integral K (f (m x)))" + proof (rule sum_mono, simp add: split_paired_all) fix x K - assume xk: "(x, K) \ p" - from p'(4)[OF this] guess u v by (elim exE) note uv=this - show "f r integrable_on K" - and "f s integrable_on K" - and "f (m x) integrable_on K" - and "f (m x) integrable_on K" - unfolding uv - apply (rule_tac[!] integrable_on_subcbox[OF assms(1)[rule_format]]) - using p'(3)[OF xk] - unfolding uv - apply auto - done - fix y - assume "y \ K" - then have "y \ cbox a b" - using p'(3)[OF xk] by auto - then have *: "\m n. n\m \ f m y \ f n y" - using assms(2) by (auto intro: transitive_stepwise_le) - show "f r y \ f (m x) y" "f (m x) y \ f s y" - using s[rule_format,OF xk] r_le_m[of x] p'(2-3)[OF xk] - apply (auto intro!: *) - done + assume xK: "(x, K) \ \" + show "integral K (f r) \ integral K (f (m x))" + proof (rule integral_le) + show "f r integrable_on K" + by (metis integrable_on_subcbox intf p'(3) p'(4) xK) + show "f (m x) integrable_on K" + by (metis elementary_interval integrable_on_subdivision intf p'(3) p'(4) xK) + show "f r y \ f (m x) y" if "y \ K" for y + using that r_le_m[of x] p'(2-3)[OF xK] f_le by auto + qed qed + moreover have "(\(x, K)\\. integral K (f (m x))) \ (\(x, k)\\. integral k (f s))" + proof (rule sum_mono, simp add: split_paired_all) + fix x K + assume xK: "(x, K) \ \" + show "integral K (f (m x)) \ integral K (f s)" + proof (rule integral_le) + show "f (m x) integrable_on K" + by (metis elementary_interval integrable_on_subdivision intf p'(3) p'(4) xK) + show "f s integrable_on K" + by (metis integrable_on_subcbox intf p'(3) p'(4) xK) + show "f (m x) y \ f s y" if "y \ K" for y + using that s xK f_le p'(3) by fastforce + qed + qed + moreover have "0 \ i - integral (cbox a b) (f r)" "i - integral (cbox a b) (f r) < e / 4" + using r by auto + ultimately show "\(\(x,K)\\. integral K (f (m x))) - i\ < e/4" + using comb i'[of s] by auto qed qed qed @@ -6180,23 +6163,19 @@ and bou: "bounded (range(\k. integral S (f k)))" for f :: "nat \ 'n::euclidean_space \ real" and g S proof - - have fg: "(f k x)\1 \ (g x)\1" if "x \ S" for x k - apply (rule Lim_component_ge [OF lim [OF that] trivial_limit_sequentially]) - unfolding eventually_sequentially - apply (rule_tac x=k in exI) - using le by (force intro: transitive_stepwise_le that) - + have fg: "(f k x) \ (g x)" if "x \ S" for x k + apply (rule tendsto_lowerbound [OF lim [OF that]]) + apply (rule eventually_sequentiallyI [of k]) + using le by (force intro: transitive_stepwise_le that)+ obtain i where i: "(\k. integral S (f k)) \ i" using bounded_increasing_convergent [OF bou] le int_f integral_le by blast - have i': "(integral S (f k))\1 \ i\1" for k + have i': "(integral S (f k)) \ i" for k proof - have *: "\k. \x\S. \n\k. f k x \ f n x" using le by (force intro: transitive_stepwise_le) show ?thesis - apply (rule Lim_component_ge [OF i trivial_limit_sequentially]) - unfolding eventually_sequentially - apply (rule_tac x=k in exI) - using * by (simp add: int_f integral_le) + using tendsto_lowerbound [OF i eventually_sequentiallyI trivial_limit_sequentially] + by (meson "*" int_f integral_le) qed let ?f = "(\k x. if x \ S then f k x else 0)" @@ -6256,7 +6235,7 @@ show "integral (cbox a b) (?f N) \ integral (cbox a b) (?f (M + N))" proof (intro ballI integral_le[OF int int]) fix x assume "x \ cbox a b" - have "(f m x)\1 \ (f n x)\1" if "x \ S" "n \ m" for m n + have "(f m x) \ (f n x)" if "x \ S" "n \ m" for m n apply (rule transitive_stepwise_le [OF \n \ m\ order_refl]) using dual_order.trans apply blast by (simp add: le \x \ S\) @@ -6395,41 +6374,41 @@ by auto with integrable_integral[OF f,unfolded has_integral[of f]] obtain \ where \: "gauge \" - "\p. p tagged_division_of cbox a b \ \ fine p - \ norm ((\(x, k)\p. content k *\<^sub>R f x) - integral (cbox a b) f) < e/2" + "\\. \ tagged_division_of cbox a b \ \ fine \ + \ norm ((\(x, k)\\. content k *\<^sub>R f x) - integral (cbox a b) f) < e/2" by meson moreover from integrable_integral[OF g,unfolded has_integral[of g]] e obtain \ where \: "gauge \" - "\p. p tagged_division_of cbox a b \ \ fine p - \ norm ((\(x, k)\p. content k *\<^sub>R g x) - integral (cbox a b) g) < e/2" + "\\. \ tagged_division_of cbox a b \ \ fine \ + \ norm ((\(x, k)\\. content k *\<^sub>R g x) - integral (cbox a b) g) < e/2" by meson ultimately have "gauge (\x. \ x \ \ x)" using gauge_Int by blast - with fine_division_exists obtain p - where p: "p tagged_division_of cbox a b" "(\x. \ x \ \ x) fine p" + with fine_division_exists obtain \ + where p: "\ tagged_division_of cbox a b" "(\x. \ x \ \ x) fine \" by metis - have "\ fine p" "\ fine p" + have "\ fine \" "\ fine \" using fine_Int p(2) by blast+ show "norm (integral (cbox a b) f) < integral (cbox a b) g + e" proof (rule norm) - have "norm (content K *\<^sub>R f x) \ content K *\<^sub>R g x" if "(x, K) \ p" for x K + have "norm (content K *\<^sub>R f x) \ content K *\<^sub>R g x" if "(x, K) \ \" for x K proof- have K: "x \ K" "K \ cbox a b" - using \(x, K) \ p\ p(1) by blast+ + using \(x, K) \ \\ p(1) by blast+ obtain u v where "K = cbox u v" - using \(x, K) \ p\ p(1) by blast + using \(x, K) \ \\ p(1) by blast moreover have "content K * norm (f x) \ content K * g x" by (metis K subsetD dual_order.antisym measure_nonneg mult_zero_left nle not_le real_mult_le_cancel_iff2) then show ?thesis by simp qed - then show "norm (\(x, k)\p. content k *\<^sub>R f x) \ (\(x, k)\p. content k *\<^sub>R g x)" + then show "norm (\(x, k)\\. content k *\<^sub>R f x) \ (\(x, k)\\. content k *\<^sub>R g x)" by (simp add: sum_norm_le split_def) - show "norm ((\(x, k)\p. content k *\<^sub>R f x) - integral (cbox a b) f) < e/2" - using \\ fine p\ \ p(1) by simp - show "\(\(x, k)\p. content k *\<^sub>R g x) - integral (cbox a b) g\ < e/2" - using \\ fine p\ \ p(1) by simp + show "norm ((\(x, k)\\. content k *\<^sub>R f x) - integral (cbox a b) f) < e/2" + using \\ fine \\ \ p(1) by simp + show "\(\(x, k)\\. content k *\<^sub>R g x) - integral (cbox a b) g\ < e/2" + using \\ fine \\ \ p(1) by simp qed qed show ?thesis @@ -7144,13 +7123,13 @@ norm (integral ?CBOX f - integral (cbox a b) (\x. integral (cbox c d) (\y. f (x,y)))) \ e" using opd1 [OF p] False by (simp add: comm_monoid_set_F_and) } note op_acbd = this - { fix k::real and p and u::'a and v w and z::'b and t1 t2 l + { fix k::real and \ and u::'a and v w and z::'b and t1 t2 l assume k: "0 < k" and nf: "\x y u v. \x \ cbox a b; y \ cbox c d; u \ cbox a b; v\cbox c d; norm (u-x, v-y) < k\ \ norm (f(u,v) - f(x,y)) < e/(2 * (content ?CBOX))" - and p_acbd: "p tagged_division_of cbox (a,c) (b,d)" - and fine: "(\x. ball x k) fine p" "((t1,t2), l) \ p" + and p_acbd: "\ tagged_division_of cbox (a,c) (b,d)" + and fine: "(\x. ball x k) fine \" "((t1,t2), l) \ \" and uwvz_sub: "cbox (u,w) (v,z) \ l" "cbox (u,w) (v,z) \ cbox (a,c) (b,d)" have t: "t1 \ cbox a b" "t2 \ cbox c d" by (meson fine p_acbd cbox_Pair_iff tag_in_interval)+