# HG changeset patch # User paulson # Date 1756568221 -3600 # Node ID cb5fc74454b067b7502e3772f39446495a757797 # Parent aad65db60c80b9d5d604adaa2767286f7a3a2284# Parent d39e4284805a71bf65fc268a712198277f362fa6 merged diff -r aad65db60c80 -r cb5fc74454b0 src/HOL/Analysis/Henstock_Kurzweil_Integration.thy --- a/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy Fri Aug 29 16:51:55 2025 +0100 +++ b/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy Sat Aug 30 16:37:01 2025 +0100 @@ -13,7 +13,7 @@ lemma norm_diff2: "\y = y1 + y2; x = x1 + x2; e = e1 + e2; norm(y1 - x1) \ e1; norm(y2 - x2) \ e2\ \ norm(y-x) \ e" - by (smt (verit, ccfv_SIG) norm_diff_triangle_ineq) + by (simp add: add_diff_add norm_add_rule_thm) lemma setcomp_dot1: "{z. P (z \ (i,0))} = {(x,y). P(x \ i)}" by auto @@ -28,7 +28,7 @@ by blast (* END MOVE *) -subsection \Content (length, area, volume...) of an interval\ +subsection \Content (length, area, volume, etc.) of an interval\ abbreviation content :: "'a::euclidean_space set \ real" where "content s \ measure lborel s" @@ -92,7 +92,7 @@ unfolding content_eq_0 interior_cbox box_eq_empty by auto lemma content_pos_lt_eq: "0 < content (cbox a (b::'a::euclidean_space)) \ (\i\Basis. a\i < b\i)" - by (auto simp add: content_cbox_cases less_le prod_nonneg) + by (auto simp: content_cbox_cases less_le prod_nonneg) lemma content_empty [simp]: "content {} = 0" by simp @@ -109,8 +109,8 @@ lemma content_Pair: "content (cbox (a,c) (b,d)) = content (cbox a b) * content (cbox c d)" unfolding measure_lborel_cbox_eq Basis_prod_def - apply (subst prod.union_disjoint) - apply (auto simp: bex_Un ball_Un) + using Basis_zero + apply (simp add: prod.union_disjoint disjoint_iff image_iff ball_Un prod.reindex_nontrivial) apply (subst (1 2) prod.reindex_nontrivial) apply auto done @@ -176,24 +176,22 @@ by (metis (no_types, lifting) assms finite_Basis mult.commute prod.remove) have "\x. min (b \ k) c = max (a \ k) c \ x * (b\k - a\k) = x * (max (a \ k) c - a \ k) + x * (b \ k - max (a \ k) c)" - by (auto simp add: field_simps) + by (auto simp: field_simps) moreover - have **: "(\i\Basis. ((\i\Basis. (if i = k then min (b \ k) c else b \ i) *\<^sub>R i) \ i - a \ i)) = + have 3: "(\i\Basis. ((\i\Basis. (if i = k then min (b \ k) c else b \ i) *\<^sub>R i) \ i - a \ i)) = (\i\Basis. (if i = k then min (b \ k) c else b \ i) - a \ i)" "(\i\Basis. b \ i - ((\i\Basis. (if i = k then max (a \ k) c else a \ i) *\<^sub>R i) \ i)) = (\i\Basis. b \ i - (if i = k then max (a \ k) c else a \ i))" - by (auto intro!: prod.cong) + by (simp_all cong: prod.cong) have "\ a \ k \ c \ \ c \ b \ k \ False" unfolding not_le using True assms by auto ultimately show ?thesis - using assms unfolding simps ** 1[of "\i x. b\i - x"] 1[of "\i x. x - a\i"] 2 + using assms unfolding simps 1[of "\i x. b\i - x"] 1[of "\i x. x - a\i"] 2 3 by auto next case False - then have "cbox a b = {}" - unfolding box_eq_empty by (auto simp: not_le) then show ?thesis - by (auto simp: not_le) + using box_ne_empty(1) by force qed lemma division_of_content_0: @@ -224,7 +222,7 @@ rewrites "comm_monoid_set.F plus 0 = sum" proof - interpret operative plus 0 content - by standard (auto simp add: content_split [symmetric] content_eq_0_interior) + by standard (auto simp: content_split [symmetric] content_eq_0_interior) show "operative plus 0 content" by standard show "comm_monoid_set.F plus 0 = sum" @@ -248,7 +246,7 @@ using partial_division_extend_interval by metis then have "sum content \ \ sum content \'" using sum_mono2 by blast - also have "... \ content(cbox a b)" + also have "\ \ content(cbox a b)" by (simp add: \\' division_of cbox a b\ additive_content_division less_eq_real_def) finally show ?thesis . qed @@ -281,7 +279,7 @@ lemma has_integral_cbox: "(f has_integral I) (cbox a b) \ ((\p. \(x,k)\p. content k *\<^sub>R f x) \ I) (division_filter (cbox a b))" - by (auto simp add: has_integral_def) + by (auto simp: has_integral_def) lemma has_integral: "(f has_integral y) (cbox a b) \ @@ -312,7 +310,7 @@ then (f has_integral y) i else (\e>0. \B>0. \a b. ball 0 B \ cbox a b \ (\z. ((\x. if x \ i then f x else 0) has_integral z) (cbox a b) \ norm (z - y) < e)))" - by (subst has_integral_def) (auto simp add: has_integral_cbox) + by (subst has_integral_def) (auto simp: has_integral_cbox) lemma has_integral_altD: assumes "(f has_integral y) i" @@ -382,7 +380,7 @@ using has_integral_unique_cbox[OF w(1) z(1)] by auto then have "norm (k1 - k2) \ norm (z - k2) + norm (w - k1)" using norm_triangle_ineq4 [of "k1 - w" "k2 - z"] - by (auto simp add: norm_minus_commute) + by (auto simp: norm_minus_commute) also have "\ < norm (k1 - k2)/2 + norm (k1 - k2)/2" by (metis add_strict_mono z(2) w(2)) finally show False by auto @@ -444,10 +442,10 @@ next case False have *: "(\x. if x \ S then f x else 0) = (\x. 0)" - by (auto simp add: assms) + by (auto simp: assms) show ?thesis using has_integral_is_0_cbox False - by (subst has_integral_alt) (force simp add: *) + by (subst has_integral_alt) (force simp: *) qed lemma has_integral_0[simp]: "((\x::'n::euclidean_space. 0) has_integral 0) S" @@ -556,7 +554,7 @@ next case False then have "\ (\x. f x * c) integrable_on S" using has_integral_mult_left [of "(\x. f x * c)" _ S "inverse c"] - by (auto simp add: mult.assoc) + by (auto simp: mult.assoc) with False show ?thesis by (simp add: not_integrable_integral) qed @@ -862,7 +860,7 @@ by (metis box_real(2) has_integral_null) lemma has_integral_null_eq[simp]: "content (cbox a b) = 0 \ (f has_integral i) (cbox a b) \ i = 0" - by (auto simp add: has_integral_null dest!: integral_unique) + by (auto simp: has_integral_null dest!: integral_unique) lemma integral_null [simp]: "content (cbox a b) = 0 \ integral (cbox a b) f = 0" by (metis has_integral_null integral_unique) @@ -874,7 +872,7 @@ by (meson ex_in_conv has_integral_is_0) lemma has_integral_empty_eq[simp]: "(f has_integral i) {} \ i = 0" - by (auto simp add: has_integral_empty has_integral_unique) + by (auto simp: has_integral_empty has_integral_unique) lemma integrable_on_empty[intro]: "f integrable_on {}" unfolding integrable_on_def by auto @@ -905,24 +903,26 @@ lemma integral_blinfun_apply: assumes "f integrable_on s" shows "integral s (\x. blinfun_apply h (f x)) = blinfun_apply h (integral s f)" - by (subst integral_linear[symmetric, OF assms blinfun.bounded_linear_right]) (simp add: o_def) + using integral_linear[OF assms blinfun.bounded_linear_right] + by (metis (no_types, lifting) ext comp_def) lemma blinfun_apply_integral: assumes "f integrable_on s" shows "blinfun_apply (integral s f) x = integral s (\y. blinfun_apply (f y) x)" - by (metis (no_types, lifting) assms blinfun.prod_left.rep_eq integral_blinfun_apply integral_cong) + by (metis (no_types, lifting) ext assms blinfun.prod_left.rep_eq + integral_blinfun_apply) lemma has_integral_componentwise_iff: fixes f :: "'a :: euclidean_space \ 'b :: euclidean_space" shows "(f has_integral y) A \ (\b\Basis. ((\x. f x \ b) has_integral (y \ b)) A)" -proof safe +proof (intro iffI strip) fix b :: 'b assume "(f has_integral y) A" from has_integral_linear[OF this(1) bounded_linear_inner_left, of b] show "((\x. f x \ b) has_integral (y \ b)) A" by (simp add: o_def) next assume "(\b\Basis. ((\x. f x \ b) has_integral (y \ b)) A)" hence "\b\Basis. (((\x. x *\<^sub>R b) \ (\x. f x \ b)) has_integral ((y \ b) *\<^sub>R b)) A" - by (intro ballI has_integral_linear) (simp_all add: bounded_linear_scaleR_left) + using bounded_linear_scaleR_left has_integral_linear by blast hence "((\x. \b\Basis. (f x \ b) *\<^sub>R b) has_integral (\b\Basis. (y \ b) *\<^sub>R b)) A" by (intro has_integral_sum) (simp_all add: o_def) thus "(f has_integral y) A" by (simp add: euclidean_representation) @@ -938,9 +938,8 @@ shows "f integrable_on A \ (\b\Basis. (\x. f x \ b) integrable_on A)" proof assume "f integrable_on A" - then obtain y where "(f has_integral y) A" by (auto simp: integrable_on_def) - hence "(\b\Basis. ((\x. f x \ b) has_integral (y \ b)) A)" - by (subst (asm) has_integral_componentwise_iff) + then obtain y where "\b\Basis. ((\x. f x \ b) has_integral (y \ b)) A" + using has_integral_componentwise_iff by blast thus "(\b\Basis. (\x. f x \ b) integrable_on A)" by (auto simp: integrable_on_def) next assume "(\b\Basis. (\x. f x \ b) integrable_on A)" @@ -964,8 +963,8 @@ shows "integral A f = (\b\Basis. integral A (\x. (f x \ b) *\<^sub>R b))" proof - from assms have integrable: "\b\Basis. (\x. x *\<^sub>R b) \ (\x. (f x \ b)) integrable_on A" - by (subst (asm) integrable_componentwise_iff, intro integrable_linear ballI) - (simp_all add: bounded_linear_scaleR_left) + using bounded_linear_scaleR_left integrable_componentwise_iff integrable_linear + by blast have "integral A f = integral A (\x. \b\Basis. (f x \ b) *\<^sub>R b)" by (simp add: euclidean_representation) also from integrable have "\ = (\a\Basis. integral A (\x. (f x \ a) *\<^sub>R a))" @@ -1000,12 +999,11 @@ proof - have "e/2 > 0" using that by auto with y obtain \ where "gauge \" - and \: "\\. \ tagged_division_of cbox a b \ \ fine \ \ + 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 \\) - by (blast intro!: \ dist_triangle_half_l[where y=y,unfolded dist_norm]) + then show ?thesis + by (metis norm_triangle_half_l) qed next assume "\e>0. \\. ?P e \" @@ -1038,9 +1036,10 @@ proof (intro exI allI impI) fix m n assume mn: "N \ m" "N \ n" - have "norm ((\(x,K) \ p m. content K *\<^sub>R f x) - (\(x,K) \ p n. content K *\<^sub>R f x)) < 1 / (real N + 1)" + have "norm ((\(x,K) \ p m. content K *\<^sub>R f x) + - (\(x,K) \ p n. content K *\<^sub>R f x)) < 1 / (real N + 1)" by (simp add: p(1) dp mn \) - also have "... < e" + also have "\ < e" using N \N \ 0\ \0 < e\ by (auto simp: field_simps) finally show "norm ((\(x,K) \ p m. content K *\<^sub>R f x) - (\(x,K) \ p n. content K *\<^sub>R f x)) < e" . qed @@ -1066,10 +1065,11 @@ show "norm ((\(x,K) \ q. content K *\<^sub>R f x) - y) < e" if "q tagged_division_of cbox a b \ \ (N1+N2) fine q" for q proof (rule norm_triangle_half_r) - have "norm ((\(x,K) \ p (N1+N2). content K *\<^sub>R f x) - (\(x,K) \ q. content K *\<^sub>R f x)) + have "norm ((\(x,K) \ p (N1+N2). content K *\<^sub>R f x) + - (\(x,K) \ q. content K *\<^sub>R f x)) < 1 / (real (N1+N2) + 1)" by (rule \; simp add: dp p that) - also have "... < e/2" + also have "\ < e/2" using N1 \0 < e\ by (auto simp: field_simps intro: less_le_trans) finally show "norm ((\(x,K) \ p (N1+N2). content K *\<^sub>R f x) - (\(x,K) \ q. content K *\<^sub>R f x)) < e/2" . show "norm ((\(x,K) \ p (N1+N2). content K *\<^sub>R f x) - y) < e/2" @@ -1126,9 +1126,7 @@ and \1norm: "\\. \\ 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 + by (metis (no_types, lifting) ext e fi has_integral interval_split(1) k) obtain \2 where \2: "gauge \2" and \2norm: "\\. \\ tagged_division_of cbox a b \ {x. c \ x \ k}; \2 fine \\ @@ -1156,9 +1154,9 @@ by blast then have "\x \ k - y \ k\ < \x \ k - c\" using Basis_le_norm[OF k, of "x - y"] - by (auto simp add: dist_norm inner_diff_left intro: le_less_trans) + by (auto simp: dist_norm inner_diff_left intro: le_less_trans) with y show False - using ** by (auto simp add: field_simps) + using ** by (auto simp: field_simps) qed have xk_ge_c: "x\k \ c" if as: "(x,K) \ p" and K: "K \ {x. x\k \ c} \ {}" for x K proof (rule ccontr) @@ -1169,9 +1167,9 @@ by blast then have "\x \ k - y \ k\ < \x \ k - c\" using Basis_le_norm[OF k, of "x - y"] - by (auto simp add: dist_norm inner_diff_left intro: le_less_trans) + by (auto simp: dist_norm inner_diff_left intro: le_less_trans) with y show False - using ** by (auto simp add: field_simps) + using ** by (auto simp: field_simps) qed have fin_finite: "finite {(x,f K) | x K. (x,K) \ s \ P x K}" if "finite s" for s and f :: "'a set \ 'a set" and P :: "'a \ 'a set \ bool" @@ -1185,7 +1183,7 @@ fix i :: "'a \ 'a set" assume "i \ (\(x, k). (x, \ k)) ` p - {(x, \ k) |x k. (x, k) \ p \ \ k \ {}}" then obtain x K where xk: "i = (x, \ K)" "(x,K) \ p" - "(x, \ K) \ {(x, \ K) |x K. (x,K) \ p \ \ K \ {}}" + "(x, \ K) \ {(x, \ K) |x K. (x,K) \ p \ \ K \ {}}" by auto have "content (\ K) = 0" using xk using content_empty by auto @@ -1214,7 +1212,7 @@ show "x \ L" "L \ cbox a b \ {x. x \ k \ c}" using p xk_le_c xL' by auto show "\a b. L = cbox a b" - using p xL' ab' by (auto simp add: interval_split[OF k,where c=c]) + using ab' interval_split(1) k xL'(2) by blast fix y R assume yR: "(y, R) \ ?M1" @@ -1260,7 +1258,7 @@ show "x \ L" "L \ cbox a b \ {x. x \ k \ c}" using p xk_ge_c xL' by auto show "\a b. L = cbox a b" - using p xL' ab' by (auto simp add: interval_split[OF k,where c=c]) + using p xL' ab' by (auto simp: interval_split[OF k,where c=c]) fix y R assume yR: "(y, R) \ ?M2" @@ -1372,10 +1370,7 @@ using x interior_subset by fastforce have "(\i\Basis. \(x - (x + (\/2 ) *\<^sub>R k)) \ i\) = (\i\Basis. (if i = k then \/2 else 0))" - proof (rule sum.cong [OF refl]) - show "\i. i \ Basis \ \(x - (x + (\/2) *\<^sub>R k)) \ i\ = (if i = k then \/2 else 0)" - using \0 < \\ k by (auto simp: inner_not_same_Basis) - qed + using \0 < \\ k by (intro sum.cong) (auto simp: inner_not_same_Basis) also have "\ < \" by (subst sum.delta) (use \0 < \\ in auto) finally have "x + (\/2) *\<^sub>R k \ ball x \" @@ -1439,7 +1434,7 @@ then show ?thesis using as norm_triangle_half_l[OF d[of p1 p] d[of p2 p]] unfolding interval_split[OF k] b'_def[symmetric] a'_def[symmetric] - by (auto simp add: algebra_simps) + by (auto simp: algebra_simps) qed qed qed @@ -1471,7 +1466,7 @@ then show ?thesis using as norm_triangle_half_l[OF d[of p p1] d[of p p2]] unfolding interval_split[OF k] b'_def[symmetric] a'_def[symmetric] - by (auto simp add: algebra_simps) + by (auto simp: algebra_simps) qed qed qed @@ -1485,8 +1480,7 @@ (\i. if f integrable_on i then Some (integral i f) else None)" proof - interpret comm_monoid "lift_option plus" "Some (0::'b)" - by (rule comm_monoid_lift_option) - (rule add.comm_monoid_axioms) + by (simp add: add.comm_monoid_axioms comm_monoid_lift_option) show ?thesis proof fix a b c @@ -1505,23 +1499,14 @@ proof (rule ccontr) assume "\ ?thesis" then have "f integrable_on cbox a b" - unfolding integrable_on_def - apply (rule_tac x="integral (cbox a b \ {x. x \ k \ c}) f + integral (cbox a b \ {x. x \ k \ c}) f" in exI) - apply (auto intro: has_integral_split[OF _ _ k]) - done + unfolding integrable_on_def using has_integral_split k by blast then show False using False by auto qed then show ?thesis using False by auto qed - next - fix a b :: 'a - assume "box a b = {}" - then show "(if f integrable_on cbox a b then Some (integral (cbox a b) f) else None) = Some 0" - using has_integral_null_eq - by (auto simp: integrable_on_null content_eq_0_interior) - qed + qed (auto simp: content_eq_0_interior) qed subsection \Bounds on the norm of Riemann sums and the integral itself\ @@ -1529,25 +1514,14 @@ lemma dsum_bound: assumes p: "p division_of (cbox a b)" and "norm c \ e" - shows "norm (sum (\l. content l *\<^sub>R c) p) \ e * content(cbox a b)" -proof - - have sumeq: "(\i\p. \content i\) = sum content p" - by simp - have e: "0 \ e" - using assms(2) norm_ge_zero order_trans by blast - have "norm (sum (\l. content l *\<^sub>R c) p) \ (\i\p. norm (content i *\<^sub>R c))" - using norm_sum by blast - also have "... \ e * (\i\p. \content i\)" - by (simp add: sum_distrib_left[symmetric] mult.commute assms(2) mult_right_mono sum_nonneg) - also have "... \ e * content (cbox a b)" - by (metis additive_content_division p eq_iff sumeq) - finally show ?thesis . -qed + shows "norm (\l\p. content l *\<^sub>R c) \ e * content(cbox a b)" + by (metis abs_of_nonneg assms measure_nonneg mult.commute mult_right_mono norm_scaleR + scaleR_left.sum sum_content.division) lemma rsum_bound: assumes p: "p tagged_division_of (cbox a b)" and "\x\cbox a b. norm (f x) \ e" - shows "norm (sum (\(x,k). content k *\<^sub>R f x) p) \ e * content (cbox a b)" + shows "norm (\(x, k)\p. content k *\<^sub>R f x) \ e * content (cbox a b)" proof (cases "cbox a b = {}") case True show ?thesis using p unfolding True tagged_division_of_trivial by auto @@ -1563,7 +1537,7 @@ by force have "norm (sum (\(x,k). content k *\<^sub>R f x) p) \ (\i\p. norm (case i of (x, k) \ content k *\<^sub>R f x))" by (rule norm_sum) - also have "... \ e * content (cbox a b)" + also have "\ \ e * content (cbox a b)" proof - have "\xk. xk \ p \ norm (f (fst xk)) \ e" using assms(2) p tag_in_interval by force @@ -1625,14 +1599,12 @@ assumes p: "p tagged_division_of (cbox a b)" and "\x. x \ cbox a b \ (f x)\i \ (g x)\i" shows "(\(x, K)\p. content K *\<^sub>R f x) \ i \ (\(x, K)\p. content K *\<^sub>R g x) \ i" -unfolding inner_sum_left -proof (rule sum_mono, clarify) - fix x K - assume ab: "(x, K) \ p" - with p obtain u v where K: "K = cbox u v" - by blast - then show "(content K *\<^sub>R f x) \ i \ (content K *\<^sub>R g x) \ i" - by (metis ab assms inner_scaleR_left measure_nonneg mult_left_mono tag_in_interval) +proof - +have "\a b. (a, b) \ p \ content b *\<^sub>R f a \ i \ content b *\<^sub>R g a \ i" + by (metis assms(2) inner_commute inner_scaleR_right mult_left_mono + measure_nonneg p tag_in_interval) + then show ?thesis + by (simp add: inner_sum_left split_def sum_mono) qed lemma has_integral_component_le: @@ -1643,9 +1615,8 @@ shows "i\k \ j\k" proof - have ik_le_jk: "i\k \ j\k" - if f_i: "(f has_integral i) (cbox a b)" - and g_j: "(g has_integral j) (cbox a b)" - and le: "\x\cbox a b. (f x)\k \ (g x)\k" + if f_i: "(f has_integral i) (cbox a b)" and g_j: "(g has_integral j) (cbox a b)" + and le: "\x\cbox a b. (f x)\k \ (g x)\k" for a b i and j :: 'b and f g :: "'a \ 'b" proof (rule ccontr) assume "\ ?thesis" @@ -1654,13 +1625,14 @@ obtain \1 where "gauge \1" and \1: "\p. \p tagged_division_of cbox a b; \1 fine p\ \ norm ((\(x, k)\p. content k *\<^sub>R f x) - i) < (i \ k - j \ k) / 3" - using f_i[unfolded has_integral,rule_format,OF *] by fastforce + by (metis "*" f_i has_integral) obtain \2 where "gauge \2" and \2: "\p. \p tagged_division_of cbox a b; \2 fine p\ \ norm ((\(x, k)\p. content k *\<^sub>R g x) - j) < (i \ k - j \ k) / 3" - using g_j[unfolded has_integral,rule_format,OF *] by fastforce + by (metis "*" g_j has_integral) obtain p where p: "p tagged_division_of cbox a b" and "\1 fine p" "\2 fine p" - using fine_division_exists[OF gauge_Int[OF \gauge \1\ \gauge \2\], of a b] unfolding fine_Int + using fine_division_exists[OF gauge_Int[OF \gauge \1\ \gauge \2\]] + unfolding fine_Int by metis then have "\((\(x, k)\p. content k *\<^sub>R f x) - i) \ k\ < (i \ k - j \ k) / 3" "\((\(x, k)\p. content k *\<^sub>R g x) - j) \ k\ < (i \ k - j \ k) / 3" @@ -1668,7 +1640,7 @@ then show False unfolding inner_simps using rsum_component_le[OF p] le - by (fastforce simp add: abs_real_def split: if_split_asm) + by (fastforce simp: abs_real_def split: if_split_asm) qed show ?thesis proof (cases "\a b. S = cbox a b") @@ -1737,7 +1709,8 @@ assumes "k \ Basis" and "\x. x \ S \ 0 \ (f x)\k" shows "0 \ (integral S f)\k" - by (smt (verit, ccfv_threshold) assms eq_integralD euclidean_all_zero_iff has_integral_component_nonneg) + by (metis assms order.refl has_integral_component_nonneg has_integral_integral + inner_zero_left not_integrable_integral) lemma has_integral_component_neg: fixes f :: "'a::euclidean_space \ 'b::euclidean_space" @@ -1754,7 +1727,7 @@ and "k \ Basis" shows "B * content (cbox a b) \ i\k" using has_integral_component_le[OF assms(3) has_integral_const assms(1),of "(\i\Basis. B *\<^sub>R i)::'b"] assms(2-) - by (auto simp add: field_simps) + by (auto simp: field_simps) lemma has_integral_component_ubound: fixes f::"'a::euclidean_space => 'b::euclidean_space" @@ -1763,7 +1736,7 @@ and "k \ Basis" shows "i\k \ B * content (cbox a b)" using has_integral_component_le[OF assms(3,1) has_integral_const, of "\i\Basis. B *\<^sub>R i"] assms(2-) - by (auto simp add: field_simps) + by (auto simp: field_simps) lemma integral_component_lbound: fixes f :: "'a::euclidean_space \ 'b::euclidean_space" @@ -1870,7 +1843,7 @@ qed have "norm ((\(x,K) \ \. content K *\<^sub>R g n x) - (\(x,K) \ \. content K *\<^sub>R g m x)) \ 2 / real M * content (cbox a b)" by (blast intro: norm_le rsum_diff_bound[OF \(1), where e="2 / real M"]) - also have "... \ e/2" + also have "\ \ e/2" using M True by (auto simp: field_simps) finally have le_e2: "norm ((\(x,K) \ \. content K *\<^sub>R g n x) - (\(x,K) \ \. content K *\<^sub>R g m x)) \ e/2" . @@ -1966,7 +1939,7 @@ proof (intro tendsto_cong eventually_at_rightI) fix d :: real assume d: "d \ {0<..<1}" have "cbox a b \ {x. \x\k - c\ \ d} = cbox (a' d) (b' d)" for d - using * d k by (auto simp add: cbox_def set_eq_iff Int_def ball_conj_distrib abs_diff_le_iff a'_def b'_def) + using * d k by (auto simp: cbox_def set_eq_iff Int_def ball_conj_distrib abs_diff_le_iff a'_def b'_def) moreover have "j \ Basis \ a' d \ j \ b' d \ j" for j using * d k by (auto simp: a'_def b'_def) ultimately show "(\j\Basis. (b' d - a' d) \ j) = content (cbox a b \ {x. \x\k - c\ \ d})" @@ -2061,7 +2034,7 @@ have "(\(x,K)\\. content (K \ {x. \x \ k - c\ \ d}) * indicator {x. x \ k = c} x) < e" proof - have "(\(x,K)\\. content (K \ {x. \x \ k - c\ \ d}) * ?i x) \ (\(x,K)\\. content (K \ {x. \x \ k - c\ \ d}))" - by (force simp add: indicator_def intro!: sum_mono) + by (force simp: indicator_def intro!: sum_mono) also have "\ < e" proof (subst sum.over_tagged_division_lemma[OF p(1)]) fix u v::'a @@ -2169,7 +2142,7 @@ by (rule sum_le_included[of \ T g snd f]; force) have "norm (\(x,K) \ \. content K *\<^sub>R f x) \ (\(x,K) \ \. norm (content K *\<^sub>R f x))" unfolding split_def by (rule norm_sum) - also have "... \ (\(i, j) \ Sigma {..N + 1} q. + also have "\ \ (\(i, j) \ Sigma {..N + 1} q. (real i + 1) * (case j of (x, K) \ content K *\<^sub>R indicator S x))" proof (rule sum_le_inc, safe) show "finite (Sigma {..N+1} q)" @@ -2184,12 +2157,8 @@ unfolding n_def by auto then have "n \ {0..N + 1}" using N[OF *] by auto - moreover have "K \ \ (nat \norm (f x)\) x" - using that(2) xk by auto - moreover then have "(x, K) \ q (nat \norm (f x)\)" - by (simp add: q(3) xk) - moreover then have "(x, K) \ q n" - using n_def by blast + moreover have "(x, K) \ q n" + using n_def q(3) that(2) xk by fastforce moreover have "norm (content K *\<^sub>R f x) \ (real n + 1) * (content K * indicator S x)" proof (cases "x \ S") @@ -2208,27 +2177,27 @@ (real y + 1) * (content K *\<^sub>R indicator S x)" by force qed auto - also have "... = (\i\N + 1. \j\q i. (real i + 1) * (case j of (x, K) \ content K *\<^sub>R indicator S x))" + also have "\ = (\i\N + 1. \j\q i. (real i + 1) * (case j of (x, K) \ content K *\<^sub>R indicator S x))" using q(1) by (intro sum_Sigma_product [symmetric]) auto - also have "... \ (\i\N + 1. (real i + 1) * \\(x,K) \ q i. content K *\<^sub>R indicator S x\)" - by (rule sum_mono) (simp add: sum_distrib_left [symmetric]) - also have "... \ (\i\N + 1. e/2/2 ^ i)" + also have "\ \ (\i\N + 1. (real i + 1) * \\(x,K) \ q i. content K *\<^sub>R indicator S x\)" + by (rule sum_mono) (simp flip: sum_distrib_left) + also have "\ \ (\i\N + 1. e/2/2 ^ i)" proof (rule sum_mono) show "(real i + 1) * \\(x,K) \ q i. content K *\<^sub>R indicator S x\ \ e/2/2 ^ i" if "i \ {..N + 1}" for i using \[of "q i" i] q by (simp add: divide_simps mult.left_commute) qed - also have "... = e/2 * (\i\N + 1. (1/2) ^ i)" + also have "\ = e/2 * (\i\N + 1. (1/2) ^ i)" unfolding sum_distrib_left by (metis divide_inverse inverse_eq_divide power_one_over) also have "\ < e/2 * 2" proof (rule mult_strict_left_mono) have "sum (power (1/2)) {..N + 1} = sum (power (1/2::real)) {.. < 2" by (auto simp: geometric_sum) finally show "sum (power (1/2::real)) {..N + 1} < 2" . qed (use \0 < e\ in auto) - finally show ?thesis by auto + finally show ?thesis by simp qed qed qed @@ -2302,8 +2271,7 @@ using assms unfolding integrable_on_def by (blast intro: has_integral_spike) lemma integral_spike: - assumes "negligible S" - and "\x. x \ T - S \ g x = f x" + assumes "negligible S" and "\x. x \ T - S \ g x = f x" shows "integral T f = integral T g" using has_integral_spike_eq[OF assms] by (auto simp: integral_def integrable_on_def) @@ -2312,19 +2280,19 @@ subsection \Some other trivialities about negligible sets\ lemma negligible_subset: - assumes "negligible s" "t \ s" - shows "negligible t" + assumes "negligible S" "T \ S" + shows "negligible T" unfolding negligible_def by (metis (no_types) Diff_iff assms contra_subsetD has_integral_negligible indicator_simps(2)) lemma negligible_diff[intro?]: - assumes "negligible s" - shows "negligible (s - t)" + assumes "negligible S" + shows "negligible (S - T)" using assms by (meson Diff_subset negligible_subset) lemma negligible_Int: - assumes "negligible s \ negligible t" - shows "negligible (s \ t)" + assumes "negligible S \ negligible T" + shows "negligible (S \ T)" using assms negligible_subset by force lemma negligible_Un: @@ -2344,13 +2312,13 @@ unfolding negligible_def by blast qed -lemma negligible_Un_eq[simp]: "negligible (s \ t) \ negligible s \ negligible t" +lemma negligible_Un_eq[simp]: "negligible (S \ T) \ negligible S \ negligible T" using negligible_Un negligible_subset by blast lemma negligible_sing[intro]: "negligible {a::'a::euclidean_space}" using negligible_standard_hyperplane[OF SOME_Basis, of "a \ (SOME i. i \ Basis)"] negligible_subset by blast -lemma negligible_insert[simp]: "negligible (insert a s) \ negligible s" +lemma negligible_insert[simp]: "negligible (insert a S) \ negligible S" by (metis insert_is_Un negligible_Un_eq negligible_sing) lemma negligible_empty[iff]: "negligible {}" @@ -2361,23 +2329,18 @@ by simp lemma negligible_finite[intro]: - assumes "finite s" - shows "negligible s" - using assms by (induct s) auto + assumes "finite S" + shows "negligible S" + using assms by (induct S) auto lemma negligible_Union[intro]: assumes "finite \" - and "\t. t \ \ \ negligible t" + and "\T. T \ \ \ negligible T" shows "negligible(\\)" using assms by induct auto lemma negligible: "negligible S \ (\T. (indicat_real S has_integral 0) T)" -proof (intro iffI allI) - fix T - assume "negligible S" - then show "(indicator S has_integral 0) T" - by (meson Diff_iff has_integral_negligible indicator_simps(2)) -qed (simp add: negligible_def) + by (meson DiffD2 has_integral_negligible indicator_simps(2) negligible_def) subsection \Finite case of the spike theorem is quite commonly needed\ @@ -2435,13 +2398,13 @@ subsection \In particular, the boundary of an interval is negligible\ -lemma negligible_frontier_interval: "negligible(cbox (a::'a::euclidean_space) b - box a b)" +lemma negligible_frontier_interval: "negligible(cbox a b - box a b)" proof - let ?A = "\((\k. {x. x\k = a\k} \ {x::'a. x\k = b\k}) ` Basis)" have "negligible ?A" - by (force simp add: negligible_Union[OF finite_imageI]) + by (force simp: negligible_Union[OF finite_imageI]) moreover have "cbox a b - box a b \ ?A" - by (force simp add: mem_box) + by (force simp: mem_box) ultimately show ?thesis by (rule negligible_subset) qed @@ -2544,7 +2507,7 @@ obtain p where ptag: "p tagged_division_of cbox a b" and finep: "(\x. ball x d) fine p" using fine_division_exists[OF gauge_ball[OF \0 < d\], of a b] . have *: "\i\snd ` p. \g. (\x\i. norm (f x - g x) \ e) \ g integrable_on i" - proof (safe, unfold snd_conv) + proof clarsimp fix x l assume as: "(x, l) \ p" obtain a b where l: "l = cbox a b" @@ -2606,10 +2569,10 @@ d fine p \ norm ((\(x, k)\p. content k *\<^sub>R f x) - i) \ e * content (cbox a b))" using that [of 1] - by (force simp add: True sum_content_null[OF True] intro: fine_division_exists[of _ a b]) + by (force simp: True sum_content_null[OF True] intro: fine_division_exists[of _ a b]) ultimately show ?thesis unfolding has_integral_null_eq[OF True] - by (force simp add: ) + by force next case False then have F: "0 < content (cbox a b)" @@ -2625,7 +2588,7 @@ by (meson F e less_imp_le mult_pos_pos) show "?P e (<)" if \
[rule_format]: "\\>0. ?P (\ * content (cbox a b)) (\)" using \
[of "e/2 / content (cbox a b)"] - using F e by (force simp add: algebra_simps) + using F e by (force simp: algebra_simps) qed qed @@ -2689,8 +2652,8 @@ have "u \ K" "v \ K" by (simp_all add: \u \ v\ k) have "norm ((v - u) *\<^sub>R f' x - (f v - f u)) = norm (f u - f x - (u - x) *\<^sub>R f' x - (f v - f x - (v - x) *\<^sub>R f' x))" - by (auto simp add: algebra_simps) - also have "... \ norm (f u - f x - (u - x) *\<^sub>R f' x) + norm (f v - f x - (v - x) *\<^sub>R f' x)" + by (auto simp: algebra_simps) + also have "\ \ norm (f u - f x - (u - x) *\<^sub>R f' x) + norm (f v - f x - (v - x) *\<^sub>R f' x)" by (rule norm_triangle_ineq4) finally have "norm ((v - u) *\<^sub>R f' x - (f v - f u)) \ norm (f u - f x - (u - x) *\<^sub>R f' x) + norm (f v - f x - (v - x) *\<^sub>R f' x)" . @@ -2699,12 +2662,12 @@ show "norm (f u - f x - (u - x) *\<^sub>R f' x) \ e * norm (u - x)" proof (rule d) show "norm (u - x) < d x" - using \u \ K\ ball by (auto simp add: dist_real_def) + using \u \ K\ ball by (auto simp: dist_real_def) qed (use \x \ K\ \u \ K\ kab in auto) show "norm (f v - f x - (v - x) *\<^sub>R f' x) \ e * norm (v - x)" proof (rule d) show "norm (v - x) < d x" - using \v \ K\ ball by (auto simp add: dist_real_def) + using \v \ K\ ball by (auto simp: dist_real_def) qed (use \x \ K\ \v \ K\ kab in auto) qed also have "\ \ e * (Sup K - Inf K)" @@ -2781,7 +2744,6 @@ by (meson DERIV_exp assms fundamental_theorem_of_calculus has_real_derivative_iff_has_vector_derivative has_vector_derivative_at_within integral_unique) - lemma has_integral_sin_nx: "((\x. sin(real_of_int n * x)) has_integral 0) {-pi..pi}" proof (cases "n = 0") case False @@ -2839,10 +2801,7 @@ from assms have subset: "(\xa. x + xa *\<^sub>R y) ` {0..1} \ S" by auto note [derivative_intros] = has_derivative_subset[OF _ subset] - has_derivative_in_compose[where f="(\xa. x + xa *\<^sub>R y)" and g = f] - note [continuous_intros] = - continuous_on_compose2[where f="(\xa. x + xa *\<^sub>R y)"] - continuous_on_subset[OF _ subset] + has_derivative_in_compose[where f="(\u. x + u *\<^sub>R y)" and g = f] have "\t. t \ {0..1} \ ((\t. f (x + t *\<^sub>R y)) has_vector_derivative f' (x + t *\<^sub>R y) y) (at t within {0..1})" @@ -2850,9 +2809,9 @@ by (auto simp: has_vector_derivative_def linear_cmul[OF has_derivative_linear[OF f'], symmetric] intro!: derivative_eq_intros) - from fundamental_theorem_of_calculus[rule_format, OF _ this] + from fundamental_theorem_of_calculus[OF _ this] show ?thesis - by (auto intro!: integral_unique[symmetric]) + by (simp add: integral_unique) qed lemma (in bounded_bilinear) sum_prod_derivatives_has_vector_derivative: @@ -2916,7 +2875,7 @@ "Dg n s = (if n < p then (-1)^n * (b - s)^(p - 1 - n) / fact (p - 1 - n) else 0)" for n s have g0: "Dg 0 = g" using \p > 0\ - by (auto simp add: Dg_def field_split_simps g_def split: if_split_asm) + by (auto simp: Dg_def field_split_simps g_def split: if_split_asm) have fact_eq: "real (p - Suc m) * fact (p - Suc (Suc m)) = fact (p - Suc m)" if "p > Suc m" for m by (metis Suc_diff_Suc fact_Suc that) @@ -2931,10 +2890,9 @@ (?sum has_vector_derivative g t *\<^sub>R Df p t - (- 1) ^ p *\<^sub>R Dg p t *\<^sub>R f t) (at t within {a..b})" by auto - from fundamental_theorem_of_calculus[rule_format, OF \a \ b\ deriv] + from fundamental_theorem_of_calculus[OF \a \ b\ deriv] have "(i has_integral ?sum b - ?sum a) {a..b}" - using atLeastatMost_empty'[simp del] - by (simp add: i_def g_def Dg_def) + using Dg_def g_def i_def by fastforce also have one: "(- 1) ^ p' * (- 1) ^ p' = (1::real)" "{.. {i. p = Suc i} = {p - 1}" for p' using \p > 0\ by (auto simp: power_mult_distrib) @@ -2949,11 +2907,12 @@ by (metis Suc_diff_Suc \p>0\ diff_Suc_less diff_diff_cancel less_or_eq_imp_le) then show "{..x. p - x - 1) ` {.." arbitrary: \ rule: less_induct) case less note \ = division_ofD[OF less.prems] - { - presume *: "{k \ \. content k \ 0} \ \ \ ?case" - then show ?case - using less.prems by fastforce - } - assume noteq: "{k \ \. content k \ 0} \ \" - then obtain K c d where "K \ \" and contk: "content K = 0" and keq: "K = cbox c d" - using \(4) by blast - then have "card \ > 0" - unfolding card_gt_0_iff using less by auto - then have card: "card (\ - {K}) < card \" - using less \K \ \\ by (simp add: \(1)) - have closed: "closed (\(\ - {K}))" - using less.prems by auto - have "x islimpt \(\ - {K})" if "x \ K" for x - unfolding islimpt_approachable - proof (intro allI impI) - fix e::real - assume "e > 0" - obtain i where i: "c\i = d\i" "i\Basis" - using contk \(3) [OF \K \ \\] unfolding box_ne_empty keq - by (meson content_eq_0 dual_order.antisym) - then have xi: "x\i = d\i" - using \x \ K\ unfolding keq mem_box by (metis antisym) - define y where "y = (\j\Basis. (if j = i then if c\i \ (a\i + b\i)/2 then c\i + + show ?case + proof (cases "{k \ \. content k \ 0} = \") + case False + then obtain K c d where "K \ \" and contk: "content K = 0" and keq: "K = cbox c d" + using \(4) by blast + then have "card \ > 0" + unfolding card_gt_0_iff using less by auto + then have card: "card (\ - {K}) < card \" + using less \K \ \\ by (simp add: \(1)) + have closed: "closed (\(\ - {K}))" + using less.prems by auto + have "x islimpt \(\ - {K})" if "x \ K" for x + unfolding islimpt_approachable + proof (intro allI impI) + fix e::real + assume "e > 0" + obtain i where i: "c\i = d\i" "i\Basis" + using contk \(3) [OF \K \ \\] unfolding box_ne_empty keq + by (meson content_eq_0 dual_order.antisym) + then have xi: "x\i = d\i" + using \x \ K\ unfolding keq mem_box by (metis antisym) + define y where "y = (\j\Basis. (if j = i then if c\i \ (a\i + b\i)/2 then c\i + min e (b\i - c\i)/2 else c\i - min e (c\i - a\i)/2 else x\j) *\<^sub>R j)" - show "\x'\\(\ - {K}). x' \ x \ dist x' x < e" - proof (intro bexI conjI) - have "d \ cbox c d" - using \(3)[OF \K \ \\] by (simp add: box_ne_empty(1) keq mem_box(2)) - then have "d \ cbox a b" - using \(2)[OF \K \ \\] by (auto simp: keq) - then have di: "a \ i \ d \ i \ d \ i \ b \ i" - using \i \ Basis\ mem_box(2) by blast - then have xyi: "y\i \ x\i" - unfolding y_def i xi using \e > 0\ cont0 \i \ Basis\ - by (auto simp: content_eq_0 elim!: ballE[of _ _ i]) - then show "y \ x" - unfolding euclidean_eq_iff[where 'a='a] using i by auto - have "norm (y-x) \ (\b\Basis. \(y - x) \ b\)" - by (rule norm_le_l1) - also have "... = \(y - x) \ i\ + (\b \ Basis - {i}. \(y - x) \ b\)" - by (meson finite_Basis i(2) sum.remove) - also have "... < e + sum (\i. 0) Basis" - proof (rule add_less_le_mono) - show "\(y-x) \ i\ < e" - using di \e > 0\ y_def i xi by (auto simp: inner_simps) - show "(\i\Basis - {i}. \(y-x) \ i\) \ (\i\Basis. 0)" - unfolding y_def by (auto simp: inner_simps) - qed - finally have "norm (y-x) < e + sum (\i. 0) Basis" . - then show "dist y x < e" - unfolding dist_norm by auto - have "y \ K" - unfolding keq mem_box using i(1) i(2) xi xyi by fastforce - moreover have "y \ \\" - using subsetD[OF \(2)[OF \K \ \\] \x \ K\] \e > 0\ di i - by (auto simp: \ mem_box y_def field_simps elim!: ballE[of _ _ i]) - ultimately show "y \ \(\ - {K})" by auto + show "\x'\\(\ - {K}). x' \ x \ dist x' x < e" + proof (intro bexI conjI) + have "d \ cbox c d" + using \(3)[OF \K \ \\] by (simp add: box_ne_empty(1) keq mem_box(2)) + then have "d \ cbox a b" + using \(2)[OF \K \ \\] by (auto simp: keq) + then have di: "a \ i \ d \ i \ d \ i \ b \ i" + using \i \ Basis\ mem_box(2) by blast + then have xyi: "y\i \ x\i" + unfolding y_def i xi using \e > 0\ cont0 \i \ Basis\ + by (auto simp: content_eq_0 elim!: ballE[of _ _ i]) + then show "y \ x" + unfolding euclidean_eq_iff[where 'a='a] using i by auto + have "norm (y-x) \ (\b\Basis. \(y - x) \ b\)" + by (rule norm_le_l1) + also have "\ = \(y - x) \ i\ + (\b \ Basis - {i}. \(y - x) \ b\)" + by (meson finite_Basis i(2) sum.remove) + also have "\ < e + sum (\i. 0) Basis" + proof (rule add_less_le_mono) + show "\(y-x) \ i\ < e" + using di \e > 0\ y_def i xi by (auto simp: inner_simps) + show "(\i\Basis - {i}. \(y-x) \ i\) \ (\i\Basis. 0)" + unfolding y_def by (auto simp: inner_simps) + qed + finally have "norm (y-x) < e + sum (\i. 0) Basis" . + then show "dist y x < e" + unfolding dist_norm by auto + have "y \ K" + unfolding keq mem_box using i(1) i(2) xi xyi by fastforce + moreover have "y \ \\" + using subsetD[OF \(2)[OF \K \ \\] \x \ K\] \e > 0\ di i + by (auto simp: \ mem_box y_def field_simps elim!: ballE[of _ _ i]) + ultimately show "y \ \(\ - {K})" by auto + qed qed - qed - then have "K \ \(\ - {K})" - using closed closed_limpt by blast - then have "\(\ - {K}) = cbox a b" - unfolding \(6)[symmetric] by auto - then have "\ - {K} division_of cbox a b" - by (metis Diff_subset less.prems division_of_subset \(6)) - then have "{ka \ \ - {K}. content ka \ 0} division_of (cbox a b)" - using card less.hyps by blast - moreover have "{ka \ \ - {K}. content ka \ 0} = {K \ \. content K \ 0}" - using contk by auto - ultimately show ?case by auto + then have "K \ \(\ - {K})" + using closed closed_limpt by blast + then have "\(\ - {K}) = cbox a b" + unfolding \(6)[symmetric] by auto + then have "\ - {K} division_of cbox a b" + by (metis Diff_subset less.prems division_of_subset \(6)) + then have "{ka \ \ - {K}. content ka \ 0} division_of (cbox a b)" + using card less.hyps by blast + moreover have "{ka \ \ - {K}. content ka \ 0} = {K \ \. content K \ 0}" + using contk by auto + ultimately show ?thesis by auto + qed (use less.prems in auto) qed - subsection \Integrability on subintervals\ lemma operative_integrableI: @@ -3105,7 +3061,7 @@ then have "f integrable_on cbox a b" using ac cb by (auto split: if_split_asm) with * show ?thesis - using ac cb by (auto simp add: integrable_on_def integral_unique split: if_split_asm) + using ac cb by (auto simp: integrable_on_def integral_unique split: if_split_asm) qed lemma integral_combine: @@ -3115,12 +3071,9 @@ and ab: "f integrable_on {a..b}" shows "integral {a..c} f + integral {c..b} f = integral {a..b} f" proof - - have "(f has_integral integral {a..c} f) {a..c}" - using ab \c \ b\ integrable_subinterval_real by fastforce - moreover - have "(f has_integral integral {c..b} f) {c..b}" - using ab \a \ c\ integrable_subinterval_real by fastforce - ultimately show ?thesis + have "(f has_integral integral {a..c} f) {a..c}" "(f has_integral integral {c..b} f) {c..b}" + using ab \c \ b\ \a \ c\ integrable_subinterval_real by fastforce+ + then show ?thesis by (smt (verit, best) assms has_integral_combine integral_unique) qed @@ -3171,7 +3124,7 @@ then have sndp: "snd ` p division_of cbox a b" by (metis division_of_tagged_division) have "f integrable_on k" if "(x, k) \ p" for x k - using tagged_division_ofD(2-4)[OF p(1) that] fineD[OF p(2) that] d[of x] by auto + using tagged_division_ofD(2-4)[OF p(1) that] fineD[OF p(2) that] d by blast then show ?thesis unfolding division [symmetric, OF sndp] comm_monoid_set_F_and by auto @@ -3214,7 +3167,7 @@ have "?lhs \ e * content {x..y}" using yx False d x y \e>0\ assms by (intro has_integral_bound_real[where f="(\u. f u - f x)"]) (auto simp: Idiff fux_int) - also have "... \ ?rhs" + also have "\ \ ?rhs" using False by auto finally show ?thesis . next @@ -3233,7 +3186,7 @@ have "norm (integral {a..x} f - integral {a..y} f - (x - y) *\<^sub>R f x) \ e * content {y..x}" using yx True d x y \e>0\ assms by (intro has_integral_bound_real[where f="(\u. f u - f x)"]) (auto simp: Idiff fux_int) - also have "... \ e * \y - x\" + also have "\ \ e * \y - x\" using True by auto finally have "norm (integral {a..x} f - integral {a..y} f - (x - y) *\<^sub>R f x) \ e * \y - x\" . then show ?thesis @@ -3282,9 +3235,9 @@ proof - have "\x. x \ cbox u v \ (g has_vector_derivative f x) (at x within cbox u v)" by (metis atLeastAtMost_iff atLeastatMost_subset_iff box_real(2) g - has_vector_derivative_within_subset subsetCE that(1,2)) + has_vector_derivative_within_subset subsetCE that) then show ?thesis - by (metis box_real(2) that(3) fundamental_theorem_of_calculus) + by (metis box_real(2) \u \ v\ fundamental_theorem_of_calculus) qed then show ?thesis using that by blast @@ -3304,10 +3257,6 @@ and intfi: "(f has_integral i) (cbox a b)" shows "((\x. f(g x)) has_integral (1 / r) *\<^sub>R i) (h ` cbox a b)" proof (cases "cbox a b = {}") - case True - then show ?thesis - using intfi by auto -next case False obtain w z where wz: "h ` cbox a b = cbox w z" using h by blast @@ -3382,7 +3331,7 @@ have "(\(x,K)\(\(y,L). (g y, g ` L)) ` p. content K *\<^sub>R f x) = (\u\p. case case u of (x,K) \ (g x, g ` K) of (y,L) \ content L *\<^sub>R f y)" by (metis (mono_tags, lifting) "*" sum.reindex_cong) - also have "... = (\(x,K)\p. r *\<^sub>R content K *\<^sub>R f (g x))" + also have "\ = (\(x,K)\p. r *\<^sub>R content K *\<^sub>R f (g x))" using r by (auto intro!: * sum.cong simp: bij_betw_def dest!: p(4)) finally have "(\(x, K)\(\(x,K). (g x, g ` K)) ` p. content K *\<^sub>R f x) - i = r *\<^sub>R (\(x,K)\p. content K *\<^sub>R f (g x)) - i" @@ -3395,7 +3344,7 @@ qed then show ?thesis by (auto simp: h_eq has_integral) -qed +qed (use intfi in auto) subsection \Special case of a basic affine transformation\ @@ -3409,7 +3358,7 @@ have "emeasure lborel {x\space lborel. x \ k = c} = emeasure (\\<^sub>M j::'a\Basis. lborel) (\\<^sub>E j\Basis. if j = k then {c} else UNIV)" using k - by (auto simp add: lborel_eq[where 'a='a] emeasure_distr intro!: arg_cong2[where f=emeasure]) + by (auto simp: lborel_eq[where 'a='a] emeasure_distr intro!: arg_cong2[where f=emeasure]) (auto simp: space_PiM PiE_iff extensional_def split: if_split_asm) also have "\ = (\j\Basis. emeasure lborel (if j = k then {c} else UNIV))" by (intro measure_times) auto @@ -3484,8 +3433,7 @@ moreover from False have *: "\i. (m *\<^sub>R a + c) \ i - (m *\<^sub>R b + c) \ i = (-m) *\<^sub>R (b-a) \ i" by (simp add: inner_simps field_simps) ultimately show ?thesis using False - by (simp add: image_affinity_cbox content_cbox' - prod.distrib[symmetric] inner_diff_left flip: prod_constant) + by (simp add: image_affinity_cbox content_cbox' inner_diff_left flip: prod_constant prod.distrib) qed qed @@ -3625,8 +3573,7 @@ lemma has_integral_stretch: fixes f :: "'a::euclidean_space \ 'b::real_normed_vector" - assumes "(f has_integral i) (cbox a b)" - and "\k\Basis. m k \ 0" + assumes "(f has_integral i) (cbox a b)" and "\k\Basis. m k \ 0" shows "((\x. f (\k\Basis. (m k * (x\k))*\<^sub>R k)) has_integral ((1/ \prod m Basis\) *\<^sub>R i)) ((\x. (\k\Basis. (1 / m k * (x\k))*\<^sub>R k)) ` cbox a b)" apply (rule has_integral_twiddle[where f=f]) @@ -3643,8 +3590,7 @@ lemma integrable_stretch: fixes f :: "'a::euclidean_space \ 'b::real_normed_vector" - assumes "f integrable_on cbox a b" - and "\k\Basis. m k \ 0" + assumes "f integrable_on cbox a b" and "\k\Basis. m k \ 0" shows "(\x::'a. f (\k\Basis. (m k * (x\k))*\<^sub>R k)) integrable_on ((\x. \k\Basis. (1 / m k * (x\k))*\<^sub>R k) ` cbox a b)" using assms unfolding integrable_on_def @@ -3655,9 +3601,9 @@ proof - have "?lhs = (\ k. f k (x \ axis k 1))" by (simp add: cart_eq_inner_axis) - also have "... = (\u\UNIV. f u (x \ axis u 1) *\<^sub>R axis u 1)" + also have "\ = (\u\UNIV. f u (x \ axis u 1) *\<^sub>R axis u 1)" by (simp add: vec_eq_iff axis_def if_distrib cong: if_cong) - also have "... = ?rhs" + also have "\ = ?rhs" by (simp add: Basis_vec_def UNION_singleton_eq_range sum.reindex axis_eq_axis inj_on_def) finally show ?thesis . qed @@ -3755,7 +3701,7 @@ proof (cases "a = b") case True then have *: "cbox a b = {b}" "f b - f a = 0" - by (auto simp add: order_antisym) + by (auto simp: order_antisym) with True show ?thesis by auto next case False @@ -3766,17 +3712,13 @@ fix e :: real assume e: "e > 0" then have eba8: "(e * (b-a)) / 8 > 0" - using ab by (auto simp add: field_simps) + using ab by (auto simp: field_simps) note derf_exp = derf[unfolded has_vector_derivative_def has_derivative_at_alt, THEN conjunct2, rule_format] have bounded: "\x. x \ {a<.. bounded_linear (\u. u *\<^sub>R f' x)" by (simp add: bounded_linear_scaleR_left) have "\x \ box a b. \d>0. \y. norm (y-x) < d \ norm (f y - f x - (y-x) *\<^sub>R f' x) \ e/2 * norm (y-x)" (is "\x \ box a b. ?Q x") \\The explicit quantifier is required by the following step\ - proof - fix x assume "x \ box a b" - with e show "?Q x" - using derf_exp [of x "e/2"] by auto - qed + using e derf_exp [of _ "e/2"] by auto then obtain d where d: "\x. 0 < d x" "\x y. \x \ box a b; norm (y-x) < d x\ \ norm (f y - f x - (y-x) *\<^sub>R f' x) \ e/2 * norm (y-x)" unfolding bgauge_existence_lemma by metis @@ -3803,7 +3745,7 @@ proof show "norm ((e * (b - a) / 8 / norm (f' a)) *\<^sub>R f' a) \ e * (b - a) / 8" "0 < e * (b - a) / 8 / norm (f' a)" - using False ab e by (auto simp add: field_simps) + using False ab e by (auto simp: field_simps) qed qed have "norm (content {a..c} *\<^sub>R f' a - (f c - f a)) \ e * (b-a) / 4" @@ -3840,7 +3782,7 @@ qed obtain db where "0 < db" and db: "\c. \c \ b; {c..b} \ {a..b}; {c..b} \ ball b db\ - \ norm (content {c..b} *\<^sub>R f' b - (f b - f c)) \ (e * (b-a)) / 4" + \ norm (content {c..b} *\<^sub>R f' b - (f b - f c)) \ (e * (b-a)) / 4" proof - have "continuous (at b within {a..b}) f" using contf continuous_on_eq_continuous_within by force @@ -3858,7 +3800,7 @@ proof show "norm ((e * (b - a) / 8 / norm (f' b)) *\<^sub>R f' b) \ e * (b - a) / 8" "0 < e * (b - a) / 8 / norm (f' b)" - using False ab e by (auto simp add: field_simps) + using False ab e by (auto simp: field_simps) qed qed have "norm (content {c..b} *\<^sub>R f' b - (f b - f c)) \ e * (b-a) / 4" @@ -3874,7 +3816,7 @@ proof (rule add_mono) have "norm ((b - c) *\<^sub>R f' b) \ norm (l *\<^sub>R f' b)" by (auto intro: mult_right_mono [OF lel]) - also have "... \ e * (b-a) / 8" + also have "\ \ e * (b-a) / 8" by (rule l) finally show "norm ((b - c) *\<^sub>R f' b) \ e * (b-a) / 8" . next @@ -3926,14 +3868,14 @@ by metis have xd: "norm (u - x) < d x" "norm (v - x) < d x" using fineD[OF fine xk] \x \ a\ \x \ b\ uv - by (auto simp add: k subset_eq dist_commute dist_real_def) + by (auto simp: k subset_eq dist_commute dist_real_def) have "norm ((v - u) *\<^sub>R f' x - (f v - f u)) = norm ((f u - f x - (u - x) *\<^sub>R f' x) - (f v - f x - (v - x) *\<^sub>R f' x))" by (rule arg_cong[where f=norm]) (auto simp: scaleR_left.diff) also have "\ \ e/2 * norm (u - x) + e/2 * norm (v - x)" by (metis norm_triangle_le_diff add_mono * xd) also have "\ \ e/2 * norm (v - u)" - using p(2)[OF xk] by (auto simp add: field_simps k) + using p(2)[OF xk] by (auto simp: field_simps k) also have "\ < norm ((v - u) *\<^sub>R f' x - (f v - f u))" using result by (simp add: \u \ v\) finally have "e * (v - u)/2 < e * (v - u)/2" @@ -3943,7 +3885,7 @@ have "norm (\(x, K)\p - ?A. content K *\<^sub>R f' x - (f (Sup K) - f (Inf K))) \ (\(x, K)\p - ?A. norm (content K *\<^sub>R f' x - (f (Sup K) - f (Inf K))))" by (auto intro: sum_norm_le) - also have "... \ (\n\p - ?A. e * (case n of (x, k) \ Sup k - Inf k)/2)" + also have "\ \ (\n\p - ?A. e * (case n of (x, k) \ Sup k - Inf k)/2)" using non by (fastforce intro: sum_mono) finally have I: "norm (\(x, k)\p - ?A. content k *\<^sub>R f' x - (f (Sup k) - f (Inf k))) \ (\n\p - ?A. e * (case n of (x, k) \ Sup k - Inf k))/2" @@ -3959,7 +3901,7 @@ with p that have "cbox u v \ {}" by blast then show "0 \ e * ((Sup k) - (Inf k))" - unfolding uv using e by (auto simp add: field_simps) + unfolding uv using e by (auto simp: field_simps) qed let ?B = "\x. {t \ p. fst t = x \ content (snd t) \ 0}" let ?C = "{t \ p. fst t \ {a, b} \ content (snd t) \ 0}" @@ -3980,28 +3922,26 @@ have 2: "norm(\(x,K)\p \ ?C. content K *\<^sub>R f' x - (f (Sup K) - f (Inf K))) \ e * (b-a)/2" proof - have norm_le: "norm (sum f S) \ e" - if "\x y. \x \ S; y \ S\ \ x = y" "\x. x \ S \ norm (f x) \ e" "e > 0" + if \
: "\x y. \x \ S; y \ S\ \ x = y" "\x. x \ S \ norm (f x) \ e" "e > 0" for S f and e :: real proof (cases "S = {}") case True with that show ?thesis by auto next - case False then obtain x where "x \ S" - by auto - then have "S = {x}" - using that(1) by auto + case False then obtain x where "S = {x}" + using \
by blast then show ?thesis - using \x \ S\ that(2) by auto + by (simp add: that(2)) qed have *: "p \ ?C = ?B a \ ?B b" by blast then have "norm (\(x,K)\p \ ?C. content K *\<^sub>R f' x - (f (Sup K) - f (Inf K))) = norm (\(x,K) \ ?B a \ ?B b. content K *\<^sub>R f' x - (f (Sup K) - f (Inf K)))" by simp - also have "... = norm ((\(x,K) \ ?B a. content K *\<^sub>R f' x - (f (Sup K) - f (Inf K))) + + also have "\ = norm ((\(x,K) \ ?B a. content K *\<^sub>R f' x - (f (Sup K) - f (Inf K))) + (\(x,K) \ ?B b. content K *\<^sub>R f' x - (f (Sup K) - f (Inf K))))" using p(1) ab e by (subst sum.union_disjoint) auto - also have "... \ e * (b - a) / 4 + e * (b - a) / 4" + also have "\ \ e * (b - a) / 4 + e * (b - a) / 4" proof (rule norm_triangle_le [OF add_mono]) have pa: "\v. k = cbox a v \ a \ v" if "(a, k) \ p" for k using p that by fastforce @@ -4013,12 +3953,12 @@ by blast let ?v = "min v v'" have "box a ?v \ K \ K'" - unfolding v v' by (auto simp add: mem_box) + unfolding v v' by (auto simp: mem_box) then have "interior (box a (min v v')) \ interior K \ interior K'" using interior_Int interior_mono by blast moreover have "(a + ?v)/2 \ box a ?v" using ne0 unfolding v v' content_eq_0 not_le - by (auto simp add: mem_box) + by (auto simp: mem_box) ultimately have "(a + ?v)/2 \ interior K \ interior K'" unfolding interior_open[OF open_box] by auto then show "K = K'" @@ -4068,7 +4008,7 @@ proof - obtain v where v: "c = cbox v b" and "v \ b" using \(b, c) \ p\ pb by blast - then have "v \ a""b \ {v.. b}" + then have "v \ a""b \ {v.. b}" using p(3)[OF \(b, c) \ p\] by auto moreover have "{v..b} \ ball b db" using fineD[OF \?d fine p\ \(b, c) \ p\] box_real(2) v False by force @@ -4077,7 +4017,7 @@ qed qed (use ab e in auto) qed - also have "... = e * (b-a)/2" + also have "\ = e * (b-a)/2" by simp finally show "norm (\(x,k)\p \ ?C. content k *\<^sub>R f' x - (f (Sup k) - f (Inf k))) \ e * (b-a)/2" . @@ -4086,7 +4026,7 @@ apply (rule * [OF sum.mono_neutral_right[OF pA(2)]]) using 1 2 by (auto simp: split_paired_all) qed - also have "... = (\n\p. e * (case n of (x, k) \ Sup k - Inf k))/2" + also have "\ = (\n\p. e * (case n of (x, k) \ Sup k - Inf k))/2" unfolding sum_distrib_left[symmetric] by (subst additive_tagged_division_1[OF \a \ b\ ptag]) auto finally have norm_le: "norm (\(x,K)\p \ {t. fst t \ {a, b}}. content K *\<^sub>R f' x - (f (Sup K) - f (Inf K))) @@ -4216,12 +4156,11 @@ then have d2_fin: "norm (?SUM p - integral {a..t} f) < e/3" using d2(2) ptag by auto have eqs: "{a..c} \ {x. x \ t} = {a..t}" "{a..c} \ {x. x \ t} = {t..c}" - using t by (auto simp add: field_simps) + using t by (auto simp: field_simps) have "p \ {(c, {t..c})} tagged_division_of {a..c}" - proof (intro tagged_division_Un_interval_real) - show "{(c, {t..c})} tagged_division_of {a..c} \ {x. t \ x \ 1}" - using \t \ c\ by (auto simp: eqs tagged_division_of_self_real) - qed (auto simp: eqs ptag) + using \t \ c\ + by (intro tagged_division_Un_interval_real [of _ _ _ 1 t]) + (auto simp: eqs tagged_division_of_self_real eqs ptag) moreover have "d1 fine p \ {(c, {t..c})}" unfolding fine_def @@ -4232,7 +4171,7 @@ next fix x assume "x \ {t..c}" then have "dist c x < k" - using t(1) by (auto simp add: field_simps dist_real_def) + using t(1) by (auto simp: field_simps dist_real_def) with k show "x \ d1 c" unfolding d_def by auto qed @@ -4245,24 +4184,24 @@ show "p \ {(c, {t..c})} = {}" using \t < c\ pt by force qed (use p'(1) in auto) - also have "... = (c - t) *\<^sub>R f c + ?SUM p" + also have "\ = (c - t) *\<^sub>R f c + ?SUM p" using \t \ c\ by auto finally show ?thesis . qed have "c - k < t" - using \k>0\ t(1) by (auto simp add: field_simps) + using \k>0\ t(1) by (auto simp: field_simps) moreover have "k \ w" proof (rule ccontr) assume "\ k \ w" then have "c + (k + w) / 2 \ d c" - by (auto simp add: field_simps not_le not_less dist_real_def d_def) + by (auto simp: field_simps not_le not_less dist_real_def d_def) then have "c + (k + w) / 2 \ ball c k" using k by blast then show False using \0 < w\ \\ k \ w\ dist_real_def by auto qed ultimately have cwt: "c - w < t" - by (auto simp add: field_simps) + by (auto simp: field_simps) have eq: "integral {a..c} f - integral {a..t} f = -(((c - t) *\<^sub>R f c + ?SUM p) - integral {a..c} f) + (?SUM p - integral {a..t} f) + (c - t) *\<^sub>R f c" by auto @@ -4310,7 +4249,7 @@ have "(- c) - d < (- t)" "- t \ - c" using t by auto from d[OF this] show "norm (integral {a..c} f - integral {a..t} f) < e" - by (auto simp add: algebra_simps norm_minus_commute *) + by (auto simp: algebra_simps norm_minus_commute *) qed qed @@ -4350,7 +4289,7 @@ using \0 < d1\ \0 < d2\ by simp show "dist (integral {a..y} f) (integral {a..x} f) < e" if "dist y x < min d1 d2" for y - by (smt (verit) d1 d2 dist_norm dist_real_def norm_minus_commute that) + by (smt (verit) d1 d2 dist_commute dist_norm dist_real_def that) qed qed qed @@ -4444,12 +4383,12 @@ have contf': "continuous_on {0 ..1} (f \ ?\)" proof (rule continuous_intros continuous_on_subset[OF contf])+ show "(\u. (1 - u) *\<^sub>R c + u *\<^sub>R x) ` {0..1} \ S" - using \convex S\ \x \ S\ \c \ S\ by (auto simp add: convex_alt algebra_simps) + using \convex S\ \x \ S\ \c \ S\ by (auto simp: convex_alt algebra_simps) qed have "t = u" if "?\ t = ?\ u" for t u proof - from that have "(t - u) *\<^sub>R x = (t - u) *\<^sub>R c" - by (auto simp add: algebra_simps) + by (auto simp: algebra_simps) then show ?thesis using \x \ c\ by auto qed @@ -4465,7 +4404,7 @@ proof - have df: "(f has_derivative (\h. 0)) (at (?\ t) within ?\ ` {0..1})" using \convex S\ \x \ S\ \c \ S\ that - by (auto simp add: convex_alt algebra_simps intro: has_derivative_subset [OF derf]) + by (auto simp: convex_alt algebra_simps intro: has_derivative_subset [OF derf]) have "(f \ ?\ has_derivative (\x. 0) \ (\z. (0 - z *\<^sub>R c) + z *\<^sub>R x)) (at t within {0..1})" by (rule derivative_eq_intros df | simp)+ then show ?thesis @@ -4584,7 +4523,7 @@ by (simp add: g_def) next case False - have iterate:"F (\i. if g integrable_on i then Some (integral i g) else None) (p - {cbox c d}) = Some 0" + have iterate: "F (\i. if g integrable_on i then Some (integral i g) else None) (p - {cbox c d}) = Some 0" proof (intro neutral ballI) fix x assume x: "x \ p - {cbox c d}" @@ -4640,10 +4579,12 @@ assume ?l then have "?g integrable_on cbox c d" using assms has_integral_integrable integrable_subinterval by blast - then have "f integrable_on cbox c d" + then have f: "f integrable_on cbox c d" by (rule integrable_eq) auto - moreover then have "i = integral (cbox c d) f" - by (meson \((\x. if x \ cbox c d then f x else 0) has_integral i) (cbox a b)\ assms has_integral_restrict_closed_subinterval has_integral_unique integrable_integral) + moreover have "i = integral (cbox c d) f" + using f \(?g has_integral i) (cbox a b)\ + by (simp add: assms has_integral_restrict_closed_subinterval has_integral_unique + integrable_integral) ultimately show ?r by auto next assume ?r then show ?l @@ -4689,7 +4630,7 @@ define d :: 'n where "d = (\i\Basis. max B C *\<^sub>R i)" have "c \ i \ x \ i \ x \ i \ d \ i" if "norm x \ B" "i \ Basis" for x i using that and Basis_le_norm[OF \i\Basis\, of x] - by (auto simp add: field_simps sum_negf c_def d_def) + by (auto simp: field_simps sum_negf c_def d_def) then have c_d: "cbox a b \ cbox c d" by (meson B mem_box(2) subsetI) have "c \ i \ x \ i \ x \ i \ d \ i" @@ -4712,7 +4653,7 @@ define d :: 'n where "d = (\i\Basis. max B C *\<^sub>R i)" have "c \ i \ x \ i \ x \ i \ d \ i" if "norm x \ B" and "i \ Basis" for x i - using that Basis_le_norm[of i x] by (auto simp add: field_simps sum_negf c_def d_def) + using that Basis_le_norm[of i x] by (auto simp: field_simps sum_negf c_def d_def) then have c_d: "cbox a b \ cbox c d" by (simp add: B mem_box(2) subset_eq) have "c \ i \ x \ i \ x \ i \ d \ i" if "norm (0 - x) < C" and "i \ Basis" for x i @@ -4721,8 +4662,8 @@ by (auto simp: mem_box dist_norm) with C obtain z where z: "(f has_integral z) (cbox a b)" "norm (z-i) < norm (y-i)" using has_integral_restrict_closed_subintervals_eq[OF c_d] S by blast - moreover then have "z = y" - by (blast intro: has_integral_unique[OF _ y]) + moreover have "z = y" + using z by (blast intro: has_integral_unique[OF _ y]) ultimately show False by auto qed @@ -4754,9 +4695,9 @@ lemma integral_nonneg: fixes f :: "'n::euclidean_space \ real" - assumes f: "f integrable_on S" and 0: "\x. x \ S \ 0 \ f x" + assumes "f integrable_on S" and "\x. x \ S \ 0 \ f x" shows "0 \ integral S f" - by (rule has_integral_nonneg[OF f[unfolded has_integral_integral] 0]) + using assms has_integral_nonneg by blast text \Hence a general restriction property.\ @@ -4865,7 +4806,7 @@ proof (rule has_integral_spike [OF neg]) have eq: "(\x. (if x \ S then f x else 0) - (if x \ T then f x else 0)) = (\x. if x \ T - S then - f x else if x \ S - T then f x else 0)" - by (force simp add: ) + by force have "((\x. if x \ S then f x else 0) has_integral i) UNIV" "((\x. if x \ T then f x else 0) has_integral j) UNIV" using S T has_integral_restrict_UNIV by auto @@ -4914,7 +4855,7 @@ then have *: "(indicator S has_integral 0) (cbox (a-c) (b-c))" by (meson Diff_iff assms has_integral_negligible indicator_simps(2)) have eq: "indicator ((+) c ` S) = (\x. indicator S (x - c))" - by (force simp add: indicator_def) + by (force simp: indicator_def) show "(indicator ((+) c ` S) has_integral 0) (cbox a b)" using has_integral_affinity [OF *, of 1 "-c"] cbox_translation [of "c" "-c+a" "-c+b"] @@ -4971,13 +4912,14 @@ lemma has_integral_interior: fixes f :: "'a :: euclidean_space \ 'b :: banach" shows "negligible(frontier S) \ (f has_integral y) (interior S) \ (f has_integral y) S" - by (rule has_integral_spike_set_eq [OF empty_imp_negligible negligible_subset]) - (use interior_subset in \auto simp: frontier_def closure_def\) +proof (rule has_integral_spike_set_eq [OF empty_imp_negligible negligible_subset]) +qed (use interior_subset in \auto simp: frontier_def closure_def\) lemma has_integral_closure: fixes f :: "'a :: euclidean_space \ 'b :: banach" shows "negligible(frontier S) \ (f has_integral y) (closure S) \ (f has_integral y) S" - by (rule has_integral_spike_set_eq [OF negligible_subset empty_imp_negligible]) (auto simp: closure_Un_frontier ) +proof (rule has_integral_spike_set_eq [OF negligible_subset empty_imp_negligible]) +qed (auto simp: closure_Un_frontier ) lemma has_integral_open_interval: fixes f :: "'a :: euclidean_space \ 'b :: banach" @@ -5082,7 +5024,7 @@ show "?f integrable_on cbox a b" proof (rule integrable_subinterval[of _ ?a ?b]) have "?a \ i \ x \ i \ x \ i \ ?b \ i" if "norm (0 - x) < B" "i \ Basis" for x i - using Basis_le_norm[of i x] that by (auto simp add:field_simps) + using Basis_le_norm[of i x] that by (auto simp:field_simps) then have "ball 0 B \ cbox ?a ?b" by (auto simp: mem_box dist_norm) then show "?f integrable_on cbox ?a ?b" @@ -5154,12 +5096,12 @@ have "sum ((*\<^sub>R) (- real n)) Basis \ i \ x \ i \ x \ i \ sum ((*\<^sub>R) (real n)) Basis \ i" if "norm x < B" "i \ Basis" for x i::'n - using Basis_le_norm[of i x] n N that by (auto simp add: field_simps sum_negf) + using Basis_le_norm[of i x] n N that by (auto simp: field_simps sum_negf) then show ?thesis by (auto simp: mem_box dist_norm) qed then show "\M. \m\M. \n\M. dist (integral (?cube m) ?F) (integral (?cube n) ?F) < e" - by (fastforce simp add: dist_norm intro!: B) + by (fastforce simp: dist_norm intro!: B) qed then obtain i where i: "(\n. integral (?cube n) ?F) \ i" using convergent_eq_Cauchy by blast @@ -5188,7 +5130,7 @@ assume x: "x \ ball 0 B" have "\norm (0 - x) < B; i \ Basis\ \ sum ((*\<^sub>R) (-n)) Basis \ i\ x \ i \ x \ i \ sum ((*\<^sub>R) n) Basis \ i" for i - using Basis_le_norm[of i x] n by (auto simp add: field_simps sum_negf) + using Basis_le_norm[of i x] n by (auto simp: field_simps sum_negf) then show "x \ ?cube n" using x by (auto simp: mem_box dist_norm) qed @@ -5267,7 +5209,7 @@ have "(\x. if x \ S then f x else 0) integrable_on cbox a b" by (simp add: intf integrable_altD(1)) then show ?thesis - by (metis (mono_tags) sub integrable_restrict_Int le_inf_iff order_refl subset_antisym) + by (simp add: inf.absorb2 integrable_restrict_Int sub) qed @@ -5450,8 +5392,7 @@ qed (use int_f int_g int_h fgh in \simp_all add: integral_le\) } then show ?thesis - apply (rule_tac x="max Bg Bh" in exI) - using \Bg > 0\ by auto + by (meson \0 < Bh\ linorder_not_less max.bounded_iff) qed then show ?thesis unfolding integrable_alt[of f] real_norm_def by (blast intro: int_f) @@ -5492,7 +5433,7 @@ fixes f :: "'a::euclidean_space \ 'b :: banach" assumes "f integrable_on A" "f integrable_on B" "negligible (A \ B)" "C = A \ B" shows "f integrable_on C" - using integrable_Un[of A B f] assms by simp + by (simp add: assms integrable_Un set_zero) lemma has_integral_UN: fixes f :: "'n::euclidean_space \ 'a::banach" @@ -5561,7 +5502,7 @@ by (meson \S \ \\ \s' \ \\ \(4)) from \(5)[OF that] show ?thesis unfolding obt interior_cbox - by (metis (no_types, lifting) Diff_empty Int_interval box_Int_box negligible_frontier_interval) + by (metis (lifting) Diff_empty Int_interval box_Int_box negligible_frontier_interval) qed show ?thesis unfolding \(6)[symmetric] @@ -5608,8 +5549,9 @@ and "i \ S" shows "f integrable_on i" proof - - have "f integrable_on i" if "i \ \" for i - by (smt (verit, best) assms cbox_division_memE f integrable_on_subcbox order_trans that) + have "f integrable_on j" if "j \ \" for j + using assms integrable_on_def that + by (metis cbox_division_memE elementary_interval has_integral_combine_division_topdown) then show ?thesis using \ integrable_combine_division by blast qed @@ -5626,10 +5568,10 @@ have *: "(f has_integral (\k\snd`p. integral k f)) S" by (smt (verit, del_insts) assms division_of_tagged_division has_integral_combine_division has_integral_iff imageE prod.collapse) also have "(\k\snd`p. integral k f) = (\(x, k)\p. integral k f)" - by (intro sum.over_tagged_division_lemma[OF assms(1), symmetric] integral_null) - (simp add: content_eq_0_interior) + by (metis assms(1) eq_integralD has_integral_empty_eq has_integral_open_interval + sum.over_tagged_division_lemma) finally show ?thesis - using assms by (auto simp add: has_integral_iff intro!: sum.cong) + using assms by (auto simp: has_integral_iff intro!: sum.cong) qed lemma integral_combine_tagged_division_bottomup: @@ -5655,7 +5597,7 @@ fixes f :: "'n::euclidean_space \ 'a::banach" assumes "f integrable_on cbox a b" and "p tagged_division_of (cbox a b)" - shows "integral (cbox a b) f = sum (\(x,k). integral k f) p" + shows "integral (cbox a b) f = (\(x, k)\p. integral k f)" using assms by (auto intro: integral_unique [OF has_integral_combine_tagged_division_topdown]) @@ -5792,17 +5734,17 @@ for ir ip i cr cp::'a using norm_triangle_le[of "cp + cr - i" "- (cr - ir)"] that unfolding that(3)[symmetric] norm_minus_cancel - by (auto simp add: algebra_simps) + by (auto simp: algebra_simps) have "?lhs = norm (?SUM p - (\(x, k)\p. integral k f))" unfolding split_def sum_subtractf .. also have "\ \ e + k" proof (rule norm_le[OF less_e]) have lessk: "k * real (card r) / (1 + real (card r)) < k" - using \k>0\ by (auto simp add: field_simps) + using \k>0\ by (auto simp: field_simps) have "norm (sum (?SUM \ qq) r - (\k\r. integral k f)) \ (\x\r. k / (real (card r) + 1))" unfolding sum_subtractf[symmetric] by (force dest: qq intro!: sum_norm_le) - also have "... < k" + also have "\ < k" by (simp add: lessk add.commute mult.commute) finally show "norm (sum (?SUM \ qq) r - (\k\r. integral k f)) < k" . next @@ -5814,15 +5756,14 @@ using inp p'(4) by blast then show ?thesis using uv that p - by (metis content_eq_0_interior dual_order.refl inf.orderE integral_null ne tagged_partial_division_ofD(5)) + by (metis content_eq_0_interior inf.orderE integral_null p'(5) subset_refl) qed then have "(\(x, K)\p. integral K f) = (\K\snd ` p. integral K f)" apply (subst sum.reindex_nontrivial [OF \finite p\]) unfolding split_paired_all split_def by auto then show "(\(x, k)\p. integral k f) + (\k\r. integral k f) = integral (cbox a b) f" unfolding integral_combine_division_topdown[OF intf qdiv] r_def - using q'(1) p'(1) sum.union_disjoint [of "snd ` p" "q - snd ` p", symmetric] - by simp + by (metis add.commute q q'(1) sum.subset_diff) qed finally show "?lhs \ e + k" . qed @@ -5847,7 +5788,7 @@ by (simp add: \d fine p\ fine_subset) show "norm (\x\Q. content (snd x) *\<^sub>R f (fst x) - integral (snd x) f) \ e" apply (rule Henstock_lemma_part1[OF fed less_e, unfolded split_def]) - using Q tag tagged_partial_division_subset by (force simp add: fine)+ + using Q tag tagged_partial_division_subset by (force simp: fine)+ qed qed @@ -5873,8 +5814,8 @@ have "(\(x,K)\p. norm (content K *\<^sub>R f x - integral K f)) \ 2 * real DIM('n) * (e/(2 * (real DIM('n) + 1)))" using Henstock_lemma_part2[OF intf * \gauge \\ \ p] by metis - also have "... < e" - using \e > 0\ by (auto simp add: field_simps) + also have "\ < e" + using \e > 0\ by (auto simp: field_simps) finally show "(\(x,K)\p. norm (content K *\<^sub>R f x - integral K f)) < e" . qed @@ -5904,10 +5845,7 @@ have fg1: "(f k x) \ (g x)" if x: "x \ cbox a b" for x k proof - have "\\<^sub>F j in sequentially. f k x \ f j x" - proof (rule eventually_sequentiallyI [of k]) - show "\j. k \ j \ f k x \ f j x" - using le x by (force intro: transitive_stepwise_le) - qed + by (metis eventually_sequentiallyI le lift_Suc_mono_le x) then show "f k x \ g x" using tendsto_lowerbound [OF fg] x trivial_limit_sequentially by blast qed @@ -5952,9 +5890,8 @@ with fg that LIMSEQ_D obtain N where "\n\N. norm (f n x - g x) < e/(4 * content (cbox a b))" by metis - then show "\n\r. \k\n. 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] by (auto simp add: field_simps) + with fg1[OF that] show "\n\r. \k\n. 0 \ g x - f k x \ g x - f k x < e/(4 * content (cbox a b))" + by (rule_tac x="N + r" in exI) (auto simp: field_simps) 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\ @@ -5976,13 +5913,13 @@ 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) + by (auto simp: algebra_simps) show "\(\(x, k)\\. content k *\<^sub>R g x) - i\ < e" proof (rule *) have "\(\(x,K)\\. content K *\<^sub>R g x) - (\(x,K)\\. content K *\<^sub>R f (m x) x)\ \ (\i\\. \(case i of (x, K) \ content K *\<^sub>R g x) - (case i of (x, K) \ content K *\<^sub>R f (m x) x)\)" by (metis (mono_tags) sum_subtractf sum_abs) - also have "... \ (\(x, k)\\. content k * (e/(4 * content (cbox a b))))" + also have "\ \ (\(x, k)\\. content k * (e/(4 * content (cbox a b))))" proof (rule sum_mono, simp add: split_paired_all) fix x K assume xk: "(x,K) \ \" @@ -5993,17 +5930,16 @@ then show "\content K * g x - content K * f (m x) x\ \ content K * e/(4 * content (cbox a b))" by (simp add: algebra_simps) qed - also have "... = (e/(4 * content (cbox a b))) * (\(x, k)\\. content k)" + also have "\ = (e/(4 * content (cbox a b))) * (\(x, k)\\. content k)" by (simp add: sum_distrib_left sum_divide_distrib split_def mult.commute) - also have "... \ e/4" + also have "\ \ e/4" by (metis False additive_content_tagged_division [OF ptag] nonzero_mult_divide_mult_cancel_right order_refl times_divide_eq_left) finally show "\(\(x,K)\\. content K *\<^sub>R g x) - (\(x,K)\\. content K *\<^sub>R f (m x) x)\ \ e/4" . next 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)) + using s by (subst sum.group) (auto simp: sum_subtractf split_def p') also have "\ < e/2" proof - 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))) @@ -6014,7 +5950,7 @@ 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)" + also have "\ \ e/2 ^ (t + 2)" proof (rule Henstock_lemma_part1 [OF intf]) show "{xk \ \. m (fst xk) = t} tagged_partial_division_of cbox a b" proof (rule tagged_partial_division_subset[of \]) @@ -6027,7 +5963,7 @@ 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)" + 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]) @@ -6145,14 +6081,13 @@ using that by auto with LIMSEQ_D [OF i] obtain N where N: "\n. n \ N \ norm (integral S (f n) - i) < e/4" by metis - with int_f[of N, unfolded has_integral_integral has_integral_alt'[of "f N"]] obtain B where "0 < B" and B: "\a b. ball 0 B \ cbox a b \ norm (integral (cbox a b) (?f N) - integral S (f N)) < e/4" - by (meson \0 < e/4\) + by (metis (lifting) ext \0 < e/4\ has_integral_alt' int_f integrable_integral) have "norm (integral (cbox a b) ?g - i) < e" if ab: "ball 0 B \ cbox a b" for a b proof - obtain M where M: "\n. n \ M \ abs (integral (cbox a b) (?f n) - integral (cbox a b) ?g) < e/2" - using \e > 0\ g by (fastforce simp add: dest!: LIMSEQ_D [where r = "e/2"]) + using \e > 0\ g by (fastforce simp: dest!: LIMSEQ_D [where r = "e/2"]) have *: "\\ \ g. \\\ - i\ < e/2; \\ - g\ < e/2; \ \ \; \ \ i\ \ \g - i\ < e" unfolding real_inner_1_right by arith show "norm (integral (cbox a b) ?g - i) < e" @@ -6182,7 +6117,7 @@ by (metis Int_lower1 f0 inf_commute int' int_f integral_subset_le) then have "integral (cbox a b) (?f (M + N)) \ integral S (f (M + N))" by (metis (no_types) inf_commute integral_restrict_Int) - also have "... \ i" + also have "\ \ i" using i'[of "M + N"] by auto finally show "integral (cbox a b) (?f (M + N)) \ i" . qed @@ -6206,12 +6141,8 @@ show "\k. (\x. f (Suc k) x - f 0 x) integrable_on S" by (simp add: integrable_diff int_f) show "(\k. f (Suc k) x - f 0 x) \ g x - f 0 x" if "x \ S" for x - proof - - have "(\n. f (Suc n) x) \ g x" - using LIMSEQ_ignore_initial_segment[OF fg[OF \x \ S\], of 1] by simp - then show ?thesis - by (simp add: tendsto_diff) - qed + using LIMSEQ_ignore_initial_segment[OF fg[OF \x \ S\], of 1] + by (simp add: tendsto_diff) show "bounded (range (\k. integral S (\x. f (Suc k) x - f 0 x)))" proof - obtain B where B: "\k. norm (integral S (f k)) \ B" @@ -6225,7 +6156,7 @@ qed (use * in auto) then have "(\x. integral S (\xa. f (Suc x) xa - f 0 xa) + integral S (f 0)) \ integral S (\x. g x - f 0 x) + integral S (f 0)" - by (auto simp add: tendsto_add) + by (auto simp: tendsto_add) moreover have "(\x. g x - f 0 x + f 0 x) integrable_on S" using gf integrable_add int_f [of 0] by metis ultimately show ?thesis @@ -6546,8 +6477,8 @@ norm (integral (cbox a b) (\t. f y t - f x t))" using elim \x \ U\ unfolding dist_norm - by (subst integral_diff) - (auto intro!: integrable_continuous continuous_intros) + proof (subst integral_diff) + qed (auto intro!: integrable_continuous continuous_intros) also have "\ \ e * content (cbox a b)" using elim \x \ U\ by (intro integrable_bound) @@ -6597,9 +6528,7 @@ moreover have "\\<^sub>F x in at x0 within U. x \ X0" using \open X0\ \x0 \ X0\ eventually_at_topological by blast - moreover have "\\<^sub>F x in at x0 within U. x \ x0" - by (auto simp: eventually_at_filter) - moreover have "\\<^sub>F x in at x0 within U. x \ U" + moreover have "\\<^sub>F x in at x0 within U. x \ x0" "\\<^sub>F x in at x0 within U. x \ U" by (auto simp: eventually_at_filter) ultimately show "\\<^sub>F x in at x0 within U. norm ((?F x - ?F x0 - ?dF (x - x0)) /\<^sub>R norm (x - x0)) < e'" @@ -6617,27 +6546,23 @@ auto intro!: integrable_diff integrable_f2 continuous_intros intro: integrable_continuous)+ also - { + have "norm ?id \ integral (cbox a b) (\_. e * norm (x - x0))" + proof (intro integral_norm_bound_integral) fix t assume t: "t \ (cbox a b)" then have deriv: "((\x. f x t) has_derivative (fx y t)) (at y within X0 \ U)" if "y \ X0 \ U" for y using fx has_derivative_subset that by fastforce have seg: "\t. t \ {0..1} \ x0 + t *\<^sub>R (x - x0) \ X0 \ U" - using \closed_segment x0 x \ U\ - \closed_segment x0 x \ X0\ + using \closed_segment x0 x \ U\ \closed_segment x0 x \ X0\ by (force simp: closed_segment_def algebra_simps) have "\x. x \ X0 \ U \ onorm (blinfun_apply (fx x t) - (fx x0 t)) \ e" using fx_bound t - by (auto simp add: norm_blinfun_def fun_diff_def blinfun.bilinear_simps[symmetric]) + by (auto simp: norm_blinfun_def fun_diff_def blinfun.bilinear_simps[symmetric]) from differentiable_bound_linearization[OF seg deriv this] X0 - have "norm (f x t - f x0 t - fx x0 t (x - x0)) \ e * norm (x - x0)" - by (auto simp add: ac_simps) - } - then have "norm ?id \ integral (cbox a b) (\_. e * norm (x - x0))" - by (intro integral_norm_bound_integral) - (auto intro!: continuous_intros integrable_diff integrable_f2 - intro: integrable_continuous) + show "norm (f x t - f x0 t - fx x0 t (x - x0)) \ e * norm (x - x0)" + by (auto simp: ac_simps) + qed (force intro: continuous_intros integrable_diff integrable_f2 integrable_continuous)+ also have "\ = content (cbox a b) * e * norm (x - x0)" by simp also have "\ < e' * norm (x - x0)" @@ -6769,8 +6694,7 @@ then show "\\<^sub>F n in F. dist (I n) J < e" proof eventually_elim case (elim n) - have "I n = integral (cbox a b) (f n)" - "J = integral (cbox a b) g" + have "I n = integral (cbox a b) (f n)" "J = integral (cbox a b) g" using I[of n] J by (simp_all add: integral_unique) then have "dist (I n) J = norm (integral (cbox a b) (\x. f n x - g x))" by (simp add: integral_diff dist_norm) @@ -6951,8 +6875,8 @@ and "continuous_on {c..d} f" and "\x. x \ {a..b} \ (g has_field_derivative g' x) (at x within {a..b})" shows "((\x. g' x *\<^sub>R f (g x)) has_integral (integral {g a..g b} f)) {a..b}" - by (intro has_integral_substitution_strong[of "{}" a b g c d] assms) - (auto intro: DERIV_continuous_on assms) +proof (intro has_integral_substitution_strong[of "{}" a b g c d] assms) +qed (auto intro: DERIV_continuous_on assms) lemma integral_shift: fixes f :: "real \ 'a::euclidean_space" @@ -7053,7 +6977,7 @@ show "norm (integral (cbox (u,w) (v,z)) f - integral (cbox u v) (\x. integral (cbox w z) (\y. f (x, y)))) \ e * content (cbox (u,w) (v,z))" using content_cbox_pair_eq0_D [OF c0'] - by (force simp add: c0') + by (force simp: c0') next fix a::'a and c::'b and b::'a and d::'b and M::real and i::'a and j::'b @@ -7171,7 +7095,7 @@ \ norm (integral (cbox (u, w) (v, z)) f - integral (cbox u v) (\x. integral (cbox w z) (\y. f (x, y)))) \ e' * content (cbox (u, w) (v, z))" - using that division [of p "(a, c)" "(b, d)"] p \finite p\ by (auto simp add: comm_monoid_set_F_and) + using that division [of p "(a, c)" "(b, d)"] p \finite p\ by (auto simp: comm_monoid_set_F_and) with False have "norm (integral ?CBOX f - integral (cbox a b) (\x. integral (cbox c d) (\y. f (x, y)))) \ e" if "\t u v w z. t \ p \ cbox (u, w) (v, z) \ t \ cbox (u, w) (v, z) \ ?CBOX @@ -7181,13 +7105,14 @@ using that by (simp add: e'_def) } note op_acbd = this { fix k::real and \ and u::'a and v w and z::'b and t1 t2 l + let ?CBUZ = "cbox (u,w) (v,z)" 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: "\ 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)" + and uwvz_sub: "?CBUZ \ l" "?CBUZ \ 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)+ have ls: "l \ ball (t1,t2) k" @@ -7200,17 +7125,17 @@ by (simp add: norm_Pair norm_minus_commute) also have "norm (t1 - x1, t2 - x2) < k" using xuvwz ls uwvz_sub unfolding ball_def - by (force simp add: cbox_Pair_eq dist_norm ) + by (force simp: cbox_Pair_eq dist_norm ) finally have "norm (f (x1,x2) - f (t1,t2)) \ e/content ?CBOX/2" using nf [OF t x] by simp } note nf' = this - have f_int_uwvz: "f integrable_on cbox (u,w) (v,z)" + have f_int_uwvz: "f integrable_on ?CBUZ" using f_int_acbd uwvz_sub integrable_on_subcbox by blast have f_int_uv: "\x. x \ cbox u v \ (\y. f (x,y)) integrable_on cbox w z" using assms continuous_on_subset uwvz_sub by (blast intro: continuous_on_imp_integrable_on_Pair1) - have 1: "norm (integral (cbox (u,w) (v,z)) f - integral (cbox (u,w) (v,z)) (\x. f (t1,t2))) - \ e * content (cbox (u,w) (v,z)) / content ?CBOX/2" + have 1: "norm (integral ?CBUZ f - integral ?CBUZ (\x. f (t1,t2))) + \ e * content ?CBUZ / content ?CBOX/2" using cbp \0 < e/content ?CBOX\ nf' apply (simp only: integral_diff [symmetric] f_int_uwvz integrable_const) apply (auto simp: integrable_diff f_int_uwvz integrable_const intro: order_trans [OF integrable_bound [of "e/content ?CBOX/2"]]) @@ -7232,17 +7157,17 @@ apply (intro integrable_bound [OF _ _ normint_wz]) apply (auto simp: field_split_simps integrable_diff int_integrable integrable_const) done - also have "... \ e * content (cbox (u,w) (v,z)) / content ?CBOX/2" + also have "\ \ e * content ?CBUZ / content ?CBOX/2" by (simp add: content_Pair field_split_simps) finally have 2: "norm (integral (cbox u v) (\x. integral (cbox w z) (\y. f (x,y))) - integral (cbox u v) (\x. integral (cbox w z) (\y. f (t1,t2)))) - \ e * content (cbox (u,w) (v,z)) / content ?CBOX/2" + \ e * content ?CBUZ / content ?CBOX/2" by (simp only: integral_diff [symmetric] int_integrable integrable_const) have norm_xx: "\x' = y'; norm(x - x') \ e/2; norm(y - y') \ e/2\ \ norm(x - y) \ e" for x::'c and y x' y' e using norm_triangle_mono [of "x-y'" "e/2" "y'-y" "e/2"] field_sum_of_halves by (simp add: norm_minus_commute) - have "norm (integral (cbox (u,w) (v,z)) f - integral (cbox u v) (\x. integral (cbox w z) (\y. f (x,y)))) - \ e * content (cbox (u,w) (v,z)) / content ?CBOX" + have "norm (integral ?CBUZ f - integral (cbox u v) (\x. integral (cbox w z) (\y. f (x,y)))) + \ e * content ?CBUZ / content ?CBOX" by (rule norm_xx [OF integral_Pair_const 1 2]) } note * = this have "norm (integral ?CBOX f - integral (cbox a b) (\x. integral (cbox c d) (\y. f (x,y)))) \ e" @@ -7289,9 +7214,9 @@ proof - have "integral (cbox a b) (\x. integral (cbox c d) (f x)) = integral (cbox (a, c) (b, d)) (\(x, y). f x y)" using integral_prod_continuous [OF assms] by auto - also have "... = integral (cbox (c, a) (d, b)) (\(x, y). f y x)" + also have "\ = integral (cbox (c, a) (d, b)) (\(x, y). f y x)" by (rule integral_swap_2dim [OF assms]) - also have "... = integral (cbox c d) (\y. integral (cbox a b) (\x. f x y))" + also have "\ = integral (cbox c d) (\y. integral (cbox a b) (\x. f x y))" using integral_prod_continuous [OF swap_continuous] assms by auto finally show ?thesis . @@ -7392,17 +7317,18 @@ proof (cases "inverse (of_nat (Suc k)) \ c") case True have x: "x > 0" if "x \ inverse (1 + real k)" for x - by (smt (verit) that inverse_Suc of_nat_Suc) + by (metis inverse_Suc of_nat_Suc order_less_le_trans that) hence "((\x. x powr a) has_integral c powr (a + 1) / (a + 1) - inverse (real (Suc k)) powr (a + 1) / (a + 1)) {inverse (real (Suc k))..c}" - using True a by (intro fundamental_theorem_of_calculus) - (auto intro!: derivative_eq_intros continuous_on_powr' continuous_on_const - simp: has_real_derivative_iff_has_vector_derivative [symmetric]) + using True a + proof (intro fundamental_theorem_of_calculus) + qed (auto intro!: derivative_eq_intros continuous_on_powr' continuous_on_const + simp flip: has_real_derivative_iff_has_vector_derivative) with True show ?thesis unfolding f_def F_def by (subst has_integral_restrict) simp_all next case False - thus ?thesis unfolding f_def F_def - by (subst has_integral_restrict) auto + thus ?thesis unfolding f_def F_def + by force qed then have integral_f: "integral {0..c} (f k) = F k" for k by blast @@ -7436,7 +7362,7 @@ { fix k from a have "F k \ c powr (a + 1) / (a + 1)" - by (auto simp add: F_def divide_simps) + by (auto simp: F_def divide_simps) also from a have "F k \ 0" by (auto simp: F_def divide_simps simp del: of_nat_Suc intro!: powr_mono2) hence "F k = abs (F k)" by simp @@ -7482,8 +7408,8 @@ by (meson eventually_at_top_linorderI integral_unique) moreover have "((\y::real. F y - F a) \ - F a) at_top" using assms unfolding F_def by real_asymp - ultimately show "((\y. integral {a..y} (\x. x powr e)) - \ - (a powr (e+1)) / (e+1)) at_top" + ultimately + show "((\y. integral {a..y} (\x. x powr e)) \ - (a powr (e+1)) / (e+1)) at_top" by (simp add: F_def filterlim_cong) qed (use assms in auto) @@ -7500,8 +7426,8 @@ also from assms have "a powr (real (n - 1)) = a ^ (n - 1)" by (intro powr_realpow) finally show ?thesis - by (rule has_integral_eq [rotated]) - (insert assms, simp_all add: powr_minus powr_realpow field_split_simps) + proof (rule has_integral_eq [rotated]) + qed (insert assms, simp_all add: powr_minus powr_realpow field_split_simps) qed subsection \Adaption to ordered Euclidean spaces and the Cartesian Euclidean space\