# HG changeset patch # User paulson # Date 1604603342 0 # Node ID 16345c07bd8c3b01a46885165d649d7eb2bdf64c # Parent 97f12d2c8bf2c735c02f63728855c63e8d12b9ee cleanup and de-applying diff -r 97f12d2c8bf2 -r 16345c07bd8c src/HOL/Analysis/Henstock_Kurzweil_Integration.thy --- a/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy Sun Nov 01 18:24:10 2020 +0100 +++ b/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy Thu Nov 05 19:09:02 2020 +0000 @@ -5799,7 +5799,8 @@ obtain u v where uv: "l = cbox u v" using inp p'(4) by blast have "content (cbox u v) = 0" - unfolding content_eq_0_interior using that p(1) uv by auto + unfolding content_eq_0_interior using that p(1) uv + by (auto dest: tagged_partial_division_ofD) then show ?thesis using uv by blast qed @@ -5824,7 +5825,7 @@ shows "sum (\(x,k). norm (content k *\<^sub>R f x - integral k f)) p \ 2 * real (DIM('n)) * e" proof - have "finite p" - using tag by blast + using tag tagged_partial_division_ofD by blast then show ?thesis unfolding split_def proof (rule sum_norm_allsubsets_bound) diff -r 97f12d2c8bf2 -r 16345c07bd8c src/HOL/Analysis/Improper_Integral.thy --- a/src/HOL/Analysis/Improper_Integral.thy Sun Nov 01 18:24:10 2020 +0100 +++ b/src/HOL/Analysis/Improper_Integral.thy Thu Nov 05 19:09:02 2020 +0000 @@ -248,8 +248,8 @@ lemma equiintegrable_on_null [simp]: "content(cbox a b) = 0 \ F equiintegrable_on cbox a b" - apply (auto simp: equiintegrable_on_def) - by (metis gauge_trivial norm_eq_zero sum_content_null) + unfolding equiintegrable_on_def + by (metis diff_zero gauge_trivial integrable_on_null integral_null norm_zero sum_content_null) text\ Main limit theorem for an equiintegrable sequence.\ @@ -333,7 +333,7 @@ assumes "F equiintegrable_on cbox a b" shows "(\f. f \ uminus) ` F equiintegrable_on cbox (-b) (-a)" proof - - have "\\. gauge \ \ + have \
: "\\. gauge \ \ (\f \. f \ (\f. f \ uminus) ` F \ \ tagged_division_of cbox (- b) (- a) \ \ fine \ \ norm ((\(x,K) \ \. content K *\<^sub>R f x) - integral (cbox (- b) (- a)) f) < e)" if "gauge \" and @@ -389,19 +389,18 @@ qed have "(\(x,K) \ (\(x,K). (- x, uminus ` K)) ` \. content K *\<^sub>R f x) = (\(x,K) \ \. content K *\<^sub>R f (- x))" - apply (simp add: sum.reindex [OF inj]) - apply (auto simp: eq intro!: sum.cong) - done + by (auto simp add: eq sum.reindex [OF inj] intro!: sum.cong) then show ?thesis using \ [OF \f \ F\ tag' fine'] integral_reflect by (metis (mono_tags, lifting) Henstock_Kurzweil_Integration.integral_cong comp_apply split_def sum.cong) qed qed - then show ?thesis + show ?thesis using assms apply (auto simp: equiintegrable_on_def) - apply (rule integrable_eq) - by auto + subgoal for f + by (metis (mono_tags, lifting) comp_apply integrable_eq integrable_reflect) + using \
by fastforce qed subsection\Subinterval restrictions for equiintegrable families\ @@ -440,13 +439,18 @@ using S div by auto have "\K. K \ \ \ K \ {}" using div by blast + have extend_cbox: "\K. K \ \ \ \a b. extend K = cbox a b" + using extend_def by blast have extend: "extend K \ {}" "extend K \ cbox a b" if K: "K \ \" for K proof - obtain u v where K: "K = cbox u v" "K \ {}" "K \ cbox a b" using K cbox_division_memE [OF _ div] by (meson div_subset_cbox) - with i show "extend K \ {}" "extend K \ cbox a b" - apply (auto simp: extend_def subset_box box_ne_empty) - by fastforce + with i show "extend K \ cbox a b" + by (auto simp: extend_def subset_box box_ne_empty) + have "a \ i \ b \ i" + using K by (metis bot.extremum_uniqueI box_ne_empty(1) i) + with K show "extend K \ {}" + by (simp add: extend_def i box_ne_empty) qed have int_extend_disjoint: "interior(extend K1) \ interior(extend K2) = {}" if K: "K1 \ \" "K2 \ \" "K1 \ K2" for K1 K2 @@ -488,19 +492,22 @@ using i K2(1) K2(3) \t \ i = a \ i\ q s t [OF i] by (force simp: subset_box) have w: "w \ i < s \ i" using i K1(1) K1(3) \r \ i = a \ i\ s r [OF i] by (force simp: subset_box) - let ?x = "(\j \ Basis. if j = i then min (q \ i) (s \ i) *\<^sub>R i else (x \ j) *\<^sub>R j)" + define \ where "\ \ (\j \ Basis. if j = i then min (q \ i) (s \ i) *\<^sub>R i else (x \ j) *\<^sub>R j)" + have [simp]: "\ \ j = (if j = i then min (q \ j) (s \ j) else x \ j)" if "j \ Basis" for j + unfolding \_def + by (intro sum_if_inner that \i \ Basis\) show ?thesis proof (intro exI conjI) - show "?x \ box u v" - using \i \ Basis\ s apply (clarsimp simp: mem_box) - apply (subst sum_if_inner; simp)+ - apply (fastforce simp: u ux xv) - done - show "?x \ box w z" - using \i \ Basis\ q apply (clarsimp simp: mem_box) - apply (subst sum_if_inner; simp)+ - apply (fastforce simp: w wx xz) - done + have "min (q \ i) (s \ i) < v \ i" + using i s by fastforce + with \i \ Basis\ s u ux xv + show "\ \ box u v" + by (force simp: mem_box) + have "min (q \ i) (s \ i) < z \ i" + using i q by force + with \i \ Basis\ q w wx xz + show "\ \ box w z" + by (force simp: mem_box) qed next assume "\K\\. K \ {x. x \ i = b \ i} \ {}" @@ -514,26 +521,24 @@ using K1(1) K1(3) \r \ i = b \ i\ r [OF i] i s by (force simp: subset_box) have v: "q \ i < v \ i" using K2(1) K2(3) \t \ i = b \ i\ t [OF i] i q by (force simp: subset_box) - let ?x = "(\j \ Basis. if j = i then max (q \ i) (s \ i) *\<^sub>R i else (x \ j) *\<^sub>R j)" + define \ where "\ \ (\j \ Basis. if j = i then max (q \ i) (s \ i) *\<^sub>R i else (x \ j) *\<^sub>R j)" + have [simp]: "\ \ j = (if j = i then max (q \ j) (s \ j) else x \ j)" if "j \ Basis" for j + unfolding \_def + by (intro sum_if_inner that \i \ Basis\) show ?thesis proof (intro exI conjI) - show "?x \ box u v" - using \i \ Basis\ s apply (clarsimp simp: mem_box) - apply (subst sum_if_inner; simp)+ - apply (fastforce simp: v ux xv) - done - show "?x \ box w z" - using \i \ Basis\ q apply (clarsimp simp: mem_box) - apply (subst sum_if_inner; simp)+ - apply (fastforce simp: z wx xz) - done + show "\ \ box u v" + using \i \ Basis\ s by (force simp: mem_box ux v xv) + show "\ \ box w z" + using \i \ Basis\ q by (force simp: mem_box wx xz z) qed qed qed ultimately show ?thesis by auto qed - have "?lhs = (\K\\. (b \ i - a \ i) * content K / (interval_upperbound K \ i - interval_lowerbound K \ i))" - by (simp add: sum_distrib_left) + define interv_diff where "interv_diff \ \K. \i::'a. interval_upperbound K \ i - interval_lowerbound K \ i" + have "?lhs = (\K\\. (b \ i - a \ i) * content K / (interv_diff K i))" + by (simp add: sum_distrib_left interv_diff_def) also have "\ = sum (content \ extend) \" proof (rule sum.cong [OF refl]) fix K assume "K \ \" @@ -543,29 +548,25 @@ using mt [OF \K \ \\] \i \ Basis\ content_eq_0 by fastforce have "insert i (Basis \ -{i}) = Basis" using \i \ Basis\ by auto - then have "(b \ i - a \ i) * content K / (interval_upperbound K \ i - interval_lowerbound K \ i) - = (b \ i - a \ i) * (\i \ insert i (Basis \ -{i}). v \ i - u \ i) / (interval_upperbound (cbox u v) \ i - interval_lowerbound (cbox u v) \ i)" + then have "(b \ i - a \ i) * content K / (interv_diff K i) + = (b \ i - a \ i) * (\i \ insert i (Basis \ -{i}). v \ i - u \ i) / (interv_diff (cbox u v) i)" using K box_ne_empty(1) content_cbox by fastforce also have "... = (\x\Basis. if x = i then b \ x - a \ x else (interval_upperbound (cbox u v) - interval_lowerbound (cbox u v)) \ x)" - using \i \ Basis\ K uv by (simp add: prod.If_cases) (simp add: algebra_simps) + using \i \ Basis\ K uv by (simp add: prod.If_cases interv_diff_def) (simp add: algebra_simps) also have "... = (\k\Basis. - (\j\Basis. if j = i then (b \ i - a \ i) *\<^sub>R i else ((interval_upperbound (cbox u v) - interval_lowerbound (cbox u v)) \ j) *\<^sub>R j) \ k)" + (\j\Basis. if j = i then (b \ i - a \ i) *\<^sub>R i + else ((interval_upperbound (cbox u v) - interval_lowerbound (cbox u v)) \ j) *\<^sub>R j) \ k)" using \i \ Basis\ by (subst prod.cong [OF refl sum_if_inner]; simp) also have "... = (\k\Basis. (\j\Basis. if j = i then (b \ i) *\<^sub>R i else (interval_upperbound (cbox u v) \ j) *\<^sub>R j) \ k - (\j\Basis. if j = i then (a \ i) *\<^sub>R i else (interval_lowerbound (cbox u v) \ j) *\<^sub>R j) \ k)" - apply (rule prod.cong [OF refl]) using \i \ Basis\ - apply (subst sum_if_inner; simp add: algebra_simps)+ - done + by (intro prod.cong [OF refl]) (subst sum_if_inner; simp add: algebra_simps)+ also have "... = (content \ extend) K" - using \i \ Basis\ K box_ne_empty - apply (simp add: extend_def) - apply (subst content_cbox, auto) - done - finally show "(b \ i - a \ i) * content K / (interval_upperbound K \ i - interval_lowerbound K \ i) - = (content \ extend) K" . + using \i \ Basis\ K box_ne_empty \K \ \\ extend(1) + by (auto simp add: extend_def content_cbox_if) + finally show "(b \ i - a \ i) * content K / (interv_diff K i) = (content \ extend) K" . qed also have "... = sum content (extend ` \)" proof - @@ -577,9 +578,7 @@ also have "... \ ?rhs" proof (rule subadditive_content_division) show "extend ` \ division_of \ (extend ` \)" - using int_extend_disjoint apply (auto simp: division_of_def \finite \\ extend) - using extend_def apply blast - done + using int_extend_disjoint by (auto simp: division_of_def \finite \\ extend extend_cbox) show "\ (extend ` \) \ cbox a b" using extend by fastforce qed @@ -611,6 +610,7 @@ define Dgec where "Dgec \ {L \ (\L. L \ {x. x \ i \ c}) ` \. content L \ 0}" define a' where "a' \ (\j\Basis. (if j = i then c else a \ j) *\<^sub>R j)" define b' where "b' \ (\j\Basis. (if j = i then c else b \ j) *\<^sub>R j)" + define interv_diff where "interv_diff \ \K. \i::'a. interval_upperbound K \ i - interval_lowerbound K \ i" have Dlec_cbox: "\K. K \ Dlec \ \a b. K = cbox a b" using interval_split [OF i] div by (fastforce simp: Dlec_def division_of_def) then have lec_is_cbox: "\content (L \ {x. x \ i \ c}) \ 0; L \ \\ \ \a b. L \ {x. x \ i \ c} = cbox a b" for L @@ -619,7 +619,16 @@ using interval_split [OF i] div by (fastforce simp: Dgec_def division_of_def) then have gec_is_cbox: "\content (L \ {x. x \ i \ c}) \ 0; L \ \\ \ \a b. L \ {x. x \ i \ c} = cbox a b" for L using Dgec_def by blast - have "(b' \ i - a \ i) * (\K\Dlec. content K / (interval_upperbound K \ i - interval_lowerbound K \ i)) \ content(cbox a b')" + + have zero_left: "\x y. \x \ \; y \ \; x \ y; x \ {x. x \ i \ c} = y \ {x. x \ i \ c}\ + \ content (y \ {x. x \ i \ c}) = 0" + by (metis division_split_left_inj [OF div] lec_is_cbox content_eq_0_interior) + have zero_right: "\x y. \x \ \; y \ \; x \ y; x \ {x. c \ x \ i} = y \ {x. c \ x \ i}\ + \ content (y \ {x. c \ x \ i}) = 0" + by (metis division_split_right_inj [OF div] gec_is_cbox content_eq_0_interior) + + have "(b' \ i - a \ i) * (\K\Dlec. content K / interv_diff K i) \ content(cbox a b')" + unfolding interv_diff_def proof (rule content_division_lemma1) show "Dlec division_of \Dlec" unfolding division_of_def @@ -633,20 +642,20 @@ using nonmt by (fastforce simp: Dlec_def b'_def i) qed (use i Dlec_def in auto) moreover - have "(\K\Dlec. content K / (interval_upperbound K \ i - interval_lowerbound K \ i)) = - (\K\\. ((\K. content K / (interval_upperbound K \ i - interval_lowerbound K \ i)) \ ((\K. K \ {x. x \ i \ c}))) K)" - apply (subst sum.reindex_nontrivial [OF \finite \\, symmetric], simp) - apply (metis division_split_left_inj [OF div] lec_is_cbox content_eq_0_interior) - unfolding Dlec_def using \finite \\ apply (auto simp: sum.mono_neutral_left) - done + have "(\K\Dlec. content K / (interv_diff K i)) = (\K\(\K. K \ {x. x \ i \ c}) ` \. content K / interv_diff K i)" + unfolding Dlec_def using \finite \\ by (auto simp: sum.mono_neutral_left) + moreover have "... = + (\K\\. ((\K. content K / (interv_diff K i)) \ ((\K. K \ {x. x \ i \ c}))) K)" + by (simp add: zero_left sum.reindex_nontrivial [OF \finite \\]) moreover have "(b' \ i - a \ i) = (c - a \ i)" by (simp add: b'_def i) ultimately - have lec: "(c - a \ i) * (\K\\. ((\K. content K / (interval_upperbound K \ i - interval_lowerbound K \ i)) \ ((\K. K \ {x. x \ i \ c}))) K) + have lec: "(c - a \ i) * (\K\\. ((\K. content K / (interv_diff K i)) \ ((\K. K \ {x. x \ i \ c}))) K) \ content(cbox a b')" by simp - have "(b \ i - a' \ i) * (\K\Dgec. content K / (interval_upperbound K \ i - interval_lowerbound K \ i)) \ content(cbox a' b)" + have "(b \ i - a' \ i) * (\K\Dgec. content K / (interv_diff K i)) \ content(cbox a' b)" + unfolding interv_diff_def proof (rule content_division_lemma1) show "Dgec division_of \Dgec" unfolding division_of_def @@ -660,33 +669,35 @@ using nonmt by (fastforce simp: Dgec_def a'_def i) qed (use i Dgec_def in auto) moreover - have "(\K\Dgec. content K / (interval_upperbound K \ i - interval_lowerbound K \ i)) = - (\K\\. ((\K. content K / (interval_upperbound K \ i - interval_lowerbound K \ i)) \ ((\K. K \ {x. x \ i \ c}))) K)" - apply (subst sum.reindex_nontrivial [OF \finite \\, symmetric], simp) - apply (metis division_split_right_inj [OF div] gec_is_cbox content_eq_0_interior) - unfolding Dgec_def using \finite \\ apply (auto simp: sum.mono_neutral_left) - done + have "(\K\Dgec. content K / (interv_diff K i)) = (\K\(\K. K \ {x. c \ x \ i}) ` \. + content K / interv_diff K i)" + unfolding Dgec_def using \finite \\ by (auto simp: sum.mono_neutral_left) + moreover have "\ = + (\K\\. ((\K. content K / (interv_diff K i)) \ ((\K. K \ {x. x \ i \ c}))) K)" + by (simp add: zero_right sum.reindex_nontrivial [OF \finite \\]) moreover have "(b \ i - a' \ i) = (b \ i - c)" by (simp add: a'_def i) ultimately - have gec: "(b \ i - c) * (\K\\. ((\K. content K / (interval_upperbound K \ i - interval_lowerbound K \ i)) \ ((\K. K \ {x. x \ i \ c}))) K) + have gec: "(b \ i - c) * (\K\\. ((\K. content K / (interv_diff K i)) \ ((\K. K \ {x. x \ i \ c}))) K) \ content(cbox a' b)" by simp + show ?thesis proof (cases "c = a \ i \ c = b \ i") case True then show ?thesis proof assume c: "c = a \ i" - then have "a' = a" - apply (simp add: i a'_def cong: if_cong) + moreover + have "(\j\Basis. (if j = i then a \ i else a \ j) *\<^sub>R j) = a" using euclidean_representation [of a] sum.cong [OF refl, of Basis "\i. (a \ i) *\<^sub>R i"] by presburger + ultimately have "a' = a" + by (simp add: i a'_def cong: if_cong) then have "content (cbox a' b) \ 2 * content (cbox a b)" by simp moreover - have eq: "(\K\\. content (K \ {x. a \ i \ x \ i}) / - (interval_upperbound (K \ {x. a \ i \ x \ i}) \ i - interval_lowerbound (K \ {x. a \ i \ x \ i}) \ i)) - = (\K\\. content K / (interval_upperbound K \ i - interval_lowerbound K \ i))" - (is "sum ?f _ = sum ?g _") + have eq: "(\K\\. content (K \ {x. a \ i \ x \ i}) / interv_diff (K \ {x. a \ i \ x \ i}) i) + = (\K\\. content K / interv_diff K i)" + (is "sum ?f _ = sum ?g _") proof (rule sum.cong [OF refl]) fix K assume "K \ \" then have "a \ i \ x \ i" if "x \ K" for x @@ -697,17 +708,17 @@ by simp qed ultimately show ?thesis - using gec c eq by auto + using gec c eq interv_diff_def by auto next assume c: "c = b \ i" - then have "b' = b" - apply (simp add: i b'_def cong: if_cong) + moreover have "(\j\Basis. (if j = i then b \ i else b \ j) *\<^sub>R j) = b" using euclidean_representation [of b] sum.cong [OF refl, of Basis "\i. (b \ i) *\<^sub>R i"] by presburger + ultimately have "b' = b" + by (simp add: i b'_def cong: if_cong) then have "content (cbox a b') \ 2 * content (cbox a b)" by simp moreover - have eq: "(\K\\. content (K \ {x. x \ i \ b \ i}) / - (interval_upperbound (K \ {x. x \ i \ b \ i}) \ i - interval_lowerbound (K \ {x. x \ i \ b \ i}) \ i)) - = (\K\\. content K / (interval_upperbound K \ i - interval_lowerbound K \ i))" + have eq: "(\K\\. content (K \ {x. x \ i \ b \ i}) / interv_diff (K \ {x. x \ i \ b \ i}) i) + = (\K\\. content K / interv_diff K i)" (is "sum ?f _ = sum ?g _") proof (rule sum.cong [OF refl]) fix K assume "K \ \" @@ -719,30 +730,34 @@ by simp qed ultimately show ?thesis - using lec c eq by auto + using lec c eq interv_diff_def by auto qed next case False have prod_if: "(\k\Basis \ - {i}. f k) = (\k\Basis. f k) / f i" if "f i \ (0::real)" for f - using that mk_disjoint_insert [OF i] - apply (clarsimp simp add: field_split_simps) - by (metis Int_insert_left_if0 finite_Basis finite_insert le_iff_inf order_refl prod.insert subset_Compl_singleton) + proof - + have "f i * prod f (Basis \ - {i}) = prod f Basis" + using that mk_disjoint_insert [OF i] + by (metis Int_insert_left_if0 finite_Basis finite_insert le_iff_inf order_refl prod.insert subset_Compl_singleton) + then show ?thesis + by (metis nonzero_mult_div_cancel_left that) + qed have abc: "a \ i < c" "c < b \ i" using False assms by auto - then have "(\K\\. ((\K. content K / (interval_upperbound K \ i - interval_lowerbound K \ i)) \ ((\K. K \ {x. x \ i \ c}))) K) + then have "(\K\\. ((\K. content K / (interv_diff K i)) \ ((\K. K \ {x. x \ i \ c}))) K) \ content(cbox a b') / (c - a \ i)" - "(\K\\. ((\K. content K / (interval_upperbound K \ i - interval_lowerbound K \ i)) \ ((\K. K \ {x. x \ i \ c}))) K) + "(\K\\. ((\K. content K / (interv_diff K i)) \ ((\K. K \ {x. x \ i \ c}))) K) \ content(cbox a' b) / (b \ i - c)" using lec gec by (simp_all add: field_split_simps) moreover - have "(\K\\. content K / (interval_upperbound K \ i - interval_lowerbound K \ i)) - \ (\K\\. ((\K. content K / (interval_upperbound K \ i - interval_lowerbound K \ i)) \ ((\K. K \ {x. x \ i \ c}))) K) + - (\K\\. ((\K. content K / (interval_upperbound K \ i - interval_lowerbound K \ i)) \ ((\K. K \ {x. x \ i \ c}))) K)" + have "(\K\\. content K / (interv_diff K i)) + \ (\K\\. ((\K. content K / (interv_diff K i)) \ ((\K. K \ {x. x \ i \ c}))) K) + + (\K\\. ((\K. content K / (interv_diff K i)) \ ((\K. K \ {x. x \ i \ c}))) K)" (is "?lhs \ ?rhs") proof - have "?lhs \ - (\K\\. ((\K. content K / (interval_upperbound K \ i - interval_lowerbound K \ i)) \ ((\K. K \ {x. x \ i \ c}))) K + - ((\K. content K / (interval_upperbound K \ i - interval_lowerbound K \ i)) \ ((\K. K \ {x. x \ i \ c}))) K)" + (\K\\. ((\K. content K / (interv_diff K i)) \ ((\K. K \ {x. x \ i \ c}))) K + + ((\K. content K / (interv_diff K i)) \ ((\K. K \ {x. x \ i \ c}))) K)" (is "sum ?f _ \ sum ?g _") proof (rule sum_mono) fix K assume "K \ \" @@ -757,9 +772,10 @@ "content (cbox u' v) \ 0 \ content (cbox u v) \ 0" "content (cbox u v') \ 0 \ content (cbox u v) \ 0" using i uv uv' by (auto simp: content_eq_0 le_max_iff_disj min_le_iff_disj split: if_split_asm intro: order_trans) + have uniq: "\j. \j \ Basis; \ u \ j \ v \ j\ \ j = i" + by (metis \K \ \\ box_ne_empty(1) div division_of_def uv) show "?f K \ ?g K" - using i uv uv' apply (clarsimp simp add: lemma0 * intro!: prod_nonneg) - by (metis content_eq_0 le_less_linear order.strict_implies_order) + using i uv uv' by (auto simp add: interv_diff_def lemma0 dest: uniq * intro!: prod_nonneg) qed also have "... = ?rhs" by (simp add: sum.distrib) @@ -776,17 +792,14 @@ apply (auto simp: if_distrib prod.If_cases [of Basis "\x. x = i", simplified] prod_if field_simps) done ultimately - have "(\K\\. content K / (interval_upperbound K \ i - interval_lowerbound K \ i)) - \ 2 * content (cbox a b) / (b \ i - a \ i)" + have "(\K\\. content K / (interv_diff K i)) \ 2 * content (cbox a b) / (b \ i - a \ i)" by linarith then show ?thesis - using abc by (simp add: field_split_simps) + using abc interv_diff_def by (simp add: field_split_simps) qed qed - - proposition bounded_equiintegral_over_thin_tagged_partial_division: fixes f :: "'a::euclidean_space \ 'b::euclidean_space" assumes F: "F equiintegrable_on cbox a b" and f: "f \ F" and "0 < \" @@ -853,12 +866,13 @@ qed define \ where "\ \ \x. \0 x \ ball x ((\/8 / (norm(f x) + 1)) * (INF m\Basis. b \ m - a \ m) / content(cbox a b))" - have "gauge (\x. ball x + define interv_diff where "interv_diff \ \K. \i::'a. interval_upperbound K \ i - interval_lowerbound K \ i" + have "8 * content (cbox a b) + norm (f x) * (8 * content (cbox a b)) > 0" for x + by (metis add.right_neutral add_pos_pos contab_gt0 mult_pos_pos mult_zero_left norm_eq_zero zero_less_norm_iff zero_less_numeral) + then have "gauge (\x. ball x (\ * (INF m\Basis. b \ m - a \ m) / ((8 * norm (f x) + 8) * content (cbox a b))))" - using \0 < content (cbox a b)\ \0 < \\ a_less_b - apply (auto simp: gauge_def field_split_simps add_nonneg_eq_0_iff finite_less_Inf_iff) - apply (meson add_increasing measure_nonneg mult_nonneg_nonneg norm_ge_zero not_le zero_le_numeral) - done + using \0 < content (cbox a b)\ \0 < \\ a_less_b + by (auto simp add: gauge_def field_split_simps add_nonneg_eq_0_iff finite_less_Inf_iff) then have "gauge \" unfolding \_def using \gauge \0\ gauge_Int by auto moreover @@ -869,7 +883,7 @@ have "cbox c b \ cbox a b" by (meson mem_box(2) order_refl subset_box(1) that(1)) have "finite S" - using S by blast + using S unfolding tagged_partial_division_of_def by blast have "\0 fine S" and fineS: "(\x. ball x (\ * (INF m\Basis. b \ m - a \ m) / ((8 * norm (f x) + 8) * content (cbox a b)))) fine S" using \\ fine S\ by (auto simp: \_def fine_Int) @@ -888,15 +902,13 @@ by simp finally show "norm (integral K h) - norm (content K *\<^sub>R h x - integral K h) \ norm (content K *\<^sub>R h x)" . qed - also have "... \ (\(x,K) \ S. \/4 * (b \ i - a \ i) / content (cbox a b) * - content K / (interval_upperbound K \ i - interval_lowerbound K \ i))" + also have "... \ (\(x,K) \ S. \/4 * (b \ i - a \ i) / content (cbox a b) * content K / interv_diff K i)" proof (clarify intro!: sum_mono) fix x K assume xK: "(x,K) \ S" then have x: "x \ cbox a b" using S unfolding tagged_partial_division_of_def by (meson subset_iff) - let ?\ = "interval_upperbound K \ i - interval_lowerbound K \ i" - show "norm (content K *\<^sub>R h x) \ \/4 * (b \ i - a \ i) / content (cbox a b) * content K / ?\" + show "norm (content K *\<^sub>R h x) \ \/4 * (b \ i - a \ i) / content (cbox a b) * content K / interv_diff K i" proof (cases "content K = 0") case True then show ?thesis by simp @@ -906,12 +918,12 @@ using zero_less_measure_iff by blast moreover obtain u v where uv: "K = cbox u v" - using S \(x,K) \ S\ by blast + using S \(x,K) \ S\ unfolding tagged_partial_division_of_def by blast then have u_less_v: "\i. i \ Basis \ u \ i < v \ i" using content_pos_lt_eq uv Kgt0 by blast then have dist_uv: "dist u v > 0" using that by auto - ultimately have "norm (h x) \ (\ * (b \ i - a \ i)) / (4 * content (cbox a b) * ?\)" + ultimately have "norm (h x) \ (\ * (b \ i - a \ i)) / (4 * content (cbox a b) * interv_diff K i)" proof - have "dist x u < \ * (INF m\Basis. b \ m - a \ m) / (4 * (norm (f x) + 1) * content (cbox a b)) / 2" "dist x v < \ * (INF m\Basis. b \ m - a \ m) / (4 * (norm (f x) + 1) * content (cbox a b)) / 2" @@ -919,9 +931,10 @@ by (force simp: fine_def mem_box field_simps dest!: bspec)+ moreover have "\ * (INF m\Basis. b \ m - a \ m) / (4 * (norm (f x) + 1) * content (cbox a b)) / 2 \ \ * (b \ i - a \ i) / (4 * (norm (f x) + 1) * content (cbox a b)) / 2" - apply (intro mult_left_mono divide_right_mono) - using \i \ Basis\ \0 < \\ apply (auto simp: intro!: cInf_le_finite) - done + proof (intro mult_left_mono divide_right_mono) + show "(INF m\Basis. b \ m - a \ m) \ b \ i - a \ i" + using \i \ Basis\ by (auto intro!: cInf_le_finite) + qed (use \0 < \\ in auto) ultimately have "dist x u < \ * (b \ i - a \ i) / (4 * (norm (f x) + 1) * content (cbox a b)) / 2" "dist x v < \ * (b \ i - a \ i) / (4 * (norm (f x) + 1) * content (cbox a b)) / 2" @@ -935,48 +948,54 @@ also have "... < (norm (f x) + 1)" by simp also have "... < \ * (b \ i - a \ i) / dist u v / (4 * content (cbox a b))" - using duv dist_uv contab_gt0 - apply (simp add: field_split_simps split: if_split_asm) - by (meson add_nonneg_nonneg linorder_not_le measure_nonneg mult_nonneg_nonneg norm_ge_zero zero_le_numeral) + proof - + have "0 < norm (f x) + 1" + by (simp add: add.commute add_pos_nonneg) + then show ?thesis + using duv dist_uv contab_gt0 + by (simp only: mult_ac divide_simps) auto + qed also have "... = \ * (b \ i - a \ i) / norm (v - u) / (4 * content (cbox a b))" by (simp add: dist_norm norm_minus_commute) also have "... \ \ * (b \ i - a \ i) / \v \ i - u \ i\ / (4 * content (cbox a b))" - apply (intro mult_right_mono divide_left_mono divide_right_mono uvi) - using \0 < \\ a_less_b [OF \i \ Basis\] u_less_v [OF \i \ Basis\] contab_gt0 - by (auto simp: less_eq_real_def zero_less_mult_iff that) - also have "... = \ * (b \ i - a \ i) - / (4 * content (cbox a b) * ?\)" - using uv False that(2) u_less_v by fastforce + proof (intro mult_right_mono divide_left_mono divide_right_mono uvi) + show "norm (v - u) * \v \ i - u \ i\ > 0" + using u_less_v [OF \i \ Basis\] + by (auto simp: less_eq_real_def zero_less_mult_iff that) + show "\ * (b \ i - a \ i) \ 0" + using a_less_b \0 < \\ \i \ Basis\ by force + qed auto + also have "... = \ * (b \ i - a \ i) / (4 * content (cbox a b) * interv_diff K i)" + using uv False that(2) u_less_v interv_diff_def by fastforce finally show ?thesis by simp qed - with Kgt0 have "norm (content K *\<^sub>R h x) \ content K * ((\/4 * (b \ i - a \ i) / content (cbox a b)) / ?\)" + with Kgt0 have "norm (content K *\<^sub>R h x) \ content K * ((\/4 * (b \ i - a \ i) / content (cbox a b)) / interv_diff K i)" using mult_left_mono by fastforce - also have "... = \/4 * (b \ i - a \ i) / content (cbox a b) * - content K / ?\" + also have "... = \/4 * (b \ i - a \ i) / content (cbox a b) * content K / interv_diff K i" by (simp add: field_split_simps) finally show ?thesis . qed qed - also have "... = (\K\snd ` S. \/4 * (b \ i - a \ i) / content (cbox a b) * content K - / (interval_upperbound K \ i - interval_lowerbound K \ i))" + also have "... = (\K\snd ` S. \/4 * (b \ i - a \ i) / content (cbox a b) * content K / interv_diff K i)" + unfolding interv_diff_def apply (rule sum.over_tagged_division_lemma [OF tagged_partial_division_of_Union_self [OF S]]) apply (simp add: box_eq_empty(1) content_eq_0) done - also have "... = \/2 * ((b \ i - a \ i) / (2 * content (cbox a b)) * (\K\snd ` S. content K / (interval_upperbound K \ i - interval_lowerbound K \ i)))" - by (simp add: sum_distrib_left mult.assoc) + also have "... = \/2 * ((b \ i - a \ i) / (2 * content (cbox a b)) * (\K\snd ` S. content K / interv_diff K i))" + by (simp add: interv_diff_def sum_distrib_left mult.assoc) also have "... \ (\/2) * 1" proof (rule mult_left_mono) - have "(b \ i - a \ i) * (\K\snd ` S. content K / (interval_upperbound K \ i - interval_lowerbound K \ i)) - \ 2 * content (cbox a b)" + have "(b \ i - a \ i) * (\K\snd ` S. content K / interv_diff K i) \ 2 * content (cbox a b)" + unfolding interv_diff_def proof (rule sum_content_area_over_thin_division) show "snd ` S division_of \(snd ` S)" by (auto intro: S tagged_partial_division_of_Union_self division_of_tagged_division) show "\(snd ` S) \ cbox a b" - using S by force + using S unfolding tagged_partial_division_of_def by force show "a \ i \ c \ i" "c \ i \ b \ i" using mem_box(2) that by blast+ qed (use that in auto) - then show "(b \ i - a \ i) / (2 * content (cbox a b)) * (\K\snd ` S. content K / (interval_upperbound K \ i - interval_lowerbound K \ i)) \ 1" + then show "(b \ i - a \ i) / (2 * content (cbox a b)) * (\K\snd ` S. content K / interv_diff K i) \ 1" by (simp add: contab_gt0) qed (use \0 < \\ in auto) finally show ?thesis by simp @@ -1014,8 +1033,7 @@ proof (intro conjI; clarify) show int_lec: "\i \ Basis; h \ F\ \ (\x. if x \ i \ c then h x else 0) integrable_on cbox a b" for i c h using integrable_restrict_Int [of "{x. x \ i \ c}" h] - apply (auto simp: interval_split Int_commute mem_box intro!: integrable_on_subcbox int_F) - by (metis (full_types, hide_lams) min.bounded_iff) + by (simp add: inf_commute int_F integrable_split(1)) show "\\. gauge \ \ (\f T. f \ (\i\Basis. \c. \h\F. {\x. if x \ i \ c then h x else 0}) \ T tagged_division_of cbox a b \ \ fine T \ @@ -1026,8 +1044,10 @@ "\c i S h. \c \ cbox a b; i \ Basis; S tagged_partial_division_of cbox a b; \0 fine S; h \ F; \x K. (x,K) \ S \ (K \ {x. x \ i = c \ i} \ {})\ \ (\(x,K) \ S. norm (integral K h)) < \/12" - apply (rule bounded_equiintegral_over_thin_tagged_partial_division [OF F f, of \\/12\]) - using \\ > 0\ by (auto simp: norm_f) + proof (rule bounded_equiintegral_over_thin_tagged_partial_division [OF F f, of \\/12\]) + show "\h x. \h \ F; x \ cbox a b\ \ norm (h x) \ norm (f x)" + by (auto simp: norm_f) + qed (use \\ > 0\ in auto) obtain \1 where "gauge \1" and \1: "\h T. \h \ F; T tagged_division_of cbox a b; \1 fine T\ \ norm ((\(x,K) \ T. content K *\<^sub>R h x) - integral (cbox a b) h) @@ -1045,9 +1065,7 @@ proof (rule Henstock_lemma_part2 [of h a b]) show "h integrable_on cbox a b" using that F equiintegrable_on_def by metis - show "gauge \1" - by (rule \gauge \1\) - qed (use that \\ > 0\ \1 in auto) + qed (use that \\ > 0\ \gauge \1\ \1 in auto) also have "... < \/3" using \\ > 0\ by (simp add: divide_simps) finally show ?thesis . @@ -1070,15 +1088,16 @@ have fine': "\0 fine T'" "\1 fine T'" using \T' \ T\ fine_Int fine_subset fine by blast+ have int_KK': "(\(x,K) \ T. integral K f) = (\(x,K) \ T'. integral K f)" - apply (rule sum.mono_neutral_right [OF \finite T\ \T' \ T\]) - using f \finite T\ \T' \ T\ - using integral_restrict_Int [of _ "{x. x \ i \ c}" h] - apply (auto simp: T'_def Int_commute) - done + proof (rule sum.mono_neutral_right [OF \finite T\ \T' \ T\]) + show "\i \ T - T'. (case i of (x, K) \ integral K f) = 0" + using f \finite T\ \T' \ T\ integral_restrict_Int [of _ "{x. x \ i \ c}" h] + by (auto simp: T'_def Int_commute) + qed have "(\(x,K) \ T. content K *\<^sub>R f x) = (\(x,K) \ T'. content K *\<^sub>R f x)" - apply (rule sum.mono_neutral_right [OF \finite T\ \T' \ T\]) - using T f \finite T\ \T' \ T\ apply (force simp: T'_def) - done + proof (rule sum.mono_neutral_right [OF \finite T\ \T' \ T\]) + show "\i \ T - T'. (case i of (x, K) \ content K *\<^sub>R f x) = 0" + using T f \finite T\ \T' \ T\ by (force simp: T'_def) + qed moreover have "norm ((\(x,K) \ T'. content K *\<^sub>R f x) - integral (cbox a b) f) < \" proof - have *: "norm y < \" if "norm x < \/3" "norm(x - y) \ 2 * \/3" for x y::'b @@ -1117,7 +1136,7 @@ fix x K assume "(x,K) \ T'" "(x,K) \ T''" then have "x \ K" "x \ i \ c" "{x. x \ i \ c} \ K = K" - using T''_def T'_tagged by blast+ + using T''_def T'_tagged tagged_partial_division_of_def by blast+ then show "?CI K h x - ?CI K f x = 0" using integral_restrict_Int [of _ "{x. x \ i \ c}" h] by (auto simp: f) qed @@ -1164,12 +1183,14 @@ have False if "K \ L" proof - obtain u v where uv: "L = cbox u v" - using T'_tagged \(x, L) \ A\ \A \ T''\ \T'' \ T'\ by blast - have "A tagged_division_of \(snd ` A)" - using A_tagged tagged_partial_division_of_Union_self by auto - then have "interior (K \ {x. x \ i \ c}) = {}" - apply (rule tagged_division_split_left_inj [OF _ \(x,K) \ A\ \(x,L) \ A\]) - using that eq \i \ Basis\ by auto + using T'_tagged \(x, L) \ A\ \A \ T''\ \T'' \ T'\ by (blast dest: tagged_partial_division_ofD) + have "interior (K \ {x. x \ i \ c}) = {}" + proof (rule tagged_division_split_left_inj [OF _ \(x,K) \ A\ \(x,L) \ A\]) + show "A tagged_division_of \(snd ` A)" + using A_tagged tagged_partial_division_of_Union_self by auto + show "K \ {x. x \ i \ c} = L \ {x. x \ i \ c}" + using eq \i \ Basis\ by auto + qed (use that in auto) then show False using interval_split [OF \i \ Basis\] int_ne0 content_eq_0_interior eq uv by fastforce qed @@ -1193,12 +1214,14 @@ have False if "K \ L" proof - obtain u v where uv: "L = cbox u v" - using T'_tagged \(x, L) \ B\ \B \ T''\ \T'' \ T'\ by blast - have "B tagged_division_of \(snd ` B)" - using B_tagged tagged_partial_division_of_Union_self by auto - then have "interior (K \ {x. c \ x \ i}) = {}" - apply (rule tagged_division_split_right_inj [OF _ \(x,K) \ B\ \(x,L) \ B\]) - using that eq \i \ Basis\ by auto + using T'_tagged \(x, L) \ B\ \B \ T''\ \T'' \ T'\ by (blast dest: tagged_partial_division_ofD) + have "interior (K \ {x. c \ x \ i}) = {}" + proof (rule tagged_division_split_right_inj [OF _ \(x,K) \ B\ \(x,L) \ B\]) + show "B tagged_division_of \(snd ` B)" + using B_tagged tagged_partial_division_of_Union_self by auto + show "K \ {x. c \ x \ i} = L \ {x. c \ x \ i}" + using eq \i \ Basis\ by auto + qed (use that in auto) then show False using interval_split [OF \i \ Basis\] int_ne0 content_eq_0_interior eq uv by fastforce @@ -1215,12 +1238,14 @@ for i::'b and c i1 i2 by (metis add.commute add.left_commute add_diff_cancel_right' dual_order.refl norm_add_rule_thm norm_triangle_ineq4) obtain u v where uv: "K = cbox u v" - using T'_tagged \(x,K) \ B\ \B \ T''\ \T'' \ T'\ by blast - have "h integrable_on cbox a b" - by (simp add: int_F \h \ F\) - then have huv: "h integrable_on cbox u v" - apply (rule integrable_on_subcbox) - using B_tagged \(x,K) \ B\ uv by blast + using T'_tagged \(x,K) \ B\ \B \ T''\ \T'' \ T'\ by (blast dest: tagged_partial_division_ofD) + have huv: "h integrable_on cbox u v" + proof (rule integrable_on_subcbox) + show "cbox u v \ cbox a b" + using B_tagged \(x,K) \ B\ uv by (blast dest: tagged_partial_division_ofD) + show "h integrable_on cbox a b" + by (simp add: int_F \h \ F\) + qed have "integral K h = integral K f + integral (K \ {x. c \ x \ i}) h" using integral_restrict_Int [of _ "{x. x \ i \ c}" h] f uv \i \ Basis\ by (simp add: Int_commute integral_split [OF huv \i \ Basis\]) @@ -1237,7 +1262,7 @@ obtain y y' where y: "y' \ K" "c < y' \ i" "y \ K" "y \ i \ c" using that T''_def T'_def \(x,K) \ T''\ by fastforce obtain u v where uv: "K = cbox u v" - using T''_tagged \(x,K) \ T''\ by blast + using T''_tagged \(x,K) \ T''\ by (blast dest: tagged_partial_division_ofD) then have "connected K" by (simp add: is_interval_connected) then have "(\z \ K. z \ i = c)" @@ -1251,26 +1276,27 @@ proof (rule **) have cb_ab: "(\j \ Basis. if j = i then c *\<^sub>R i else (a \ j) *\<^sub>R j) \ cbox a b" using \i \ Basis\ True \\i. i \ Basis \ a \ i < b \ i\ - apply (clarsimp simp add: mem_box) - apply (subst sum_if_inner | force)+ - done + by (force simp add: mem_box sum_if_inner [where f = "\j. c"]) show "(\(x,K) \ A. norm (integral K h)) < \/12" - apply (rule \0 [OF cb_ab \i \ Basis\ A_tagged fineA(1) \h \ F\]) using \i \ Basis\ \A \ T''\ overlap - apply (subst sum_if_inner | force)+ - done - have 1: "(\(x,K). (x,K \ {x. x \ i \ c})) ` A tagged_partial_division_of cbox a b" - using \finite A\ \i \ Basis\ - apply (auto simp: tagged_partial_division_of_def) - using A_tagged apply (auto simp: A_def) - using interval_split(1) by blast + by (force simp add: sum_if_inner [where f = "\j. c"] + intro!: \0 [OF cb_ab \i \ Basis\ A_tagged fineA(1) \h \ F\]) + let ?F = "\(x,K). (x, K \ {x. x \ i \ c})" + have 1: "?F ` A tagged_partial_division_of cbox a b" + unfolding tagged_partial_division_of_def + proof (intro conjI strip) + show "\x K. (x, K) \ ?F ` A \ \a b. K = cbox a b" + using A_tagged interval_split(1) [OF \i \ Basis\, of _ _ c] + by (force dest: tagged_partial_division_ofD(4)) + show "\x K. (x, K) \ ?F ` A \ x \ K" + using A_def A_tagged by (fastforce dest: tagged_partial_division_ofD) + qed (use A_tagged in \fastforce dest: tagged_partial_division_ofD\)+ have 2: "\0 fine (\(x,K). (x,K \ {x. x \ i \ c})) ` A" using fineA(1) fine_def by fastforce show "(\(x,K) \ (\(x,K). (x,K \ {x. x \ i \ c})) ` A. norm (integral K h)) < \/12" - apply (rule \0 [OF cb_ab \i \ Basis\ 1 2 \h \ F\]) - using \i \ Basis\ apply (subst sum_if_inner | force)+ - using overlap apply (auto simp: A_def) - done + using \i \ Basis\ \A \ T''\ overlap + by (force simp add: sum_if_inner [where f = "\j. c"] + intro!: \0 [OF cb_ab \i \ Basis\ 1 2 \h \ F\]) have *: "\x < \/3; y < \/12; z < \/12\ \ x + y + z \ \/2" for x y z by auto show "(\(x,K) \ B. norm (?CI K h x)) + @@ -1281,20 +1307,25 @@ show "(\(x,K) \ B. norm (?CI K h x)) < \/3" by (intro h_less3 B_tagged fineB that) show "(\(x,K) \ B. norm (integral K h)) < \/12" - apply (rule \0 [OF cb_ab \i \ Basis\ B_tagged fineB(1) \h \ F\]) - using \i \ Basis\ \B \ T''\ overlap by (subst sum_if_inner | force)+ - have 1: "(\(x,K). (x,K \ {x. c \ x \ i})) ` B tagged_partial_division_of cbox a b" - using \finite B\ \i \ Basis\ - apply (auto simp: tagged_partial_division_of_def) - using B_tagged apply (auto simp: B_def) - using interval_split(2) by blast + using \i \ Basis\ \B \ T''\ overlap + by (force simp add: sum_if_inner [where f = "\j. c"] + intro!: \0 [OF cb_ab \i \ Basis\ B_tagged fineB(1) \h \ F\]) + let ?F = "\(x,K). (x, K \ {x. c \ x \ i})" + have 1: "?F ` B tagged_partial_division_of cbox a b" + unfolding tagged_partial_division_of_def + proof (intro conjI strip) + show "\x K. (x, K) \ ?F ` B \ \a b. K = cbox a b" + using B_tagged interval_split(2) [OF \i \ Basis\, of _ _ c] + by (force dest: tagged_partial_division_ofD(4)) + show "\x K. (x, K) \ ?F ` B \ x \ K" + using B_def B_tagged by (fastforce dest: tagged_partial_division_ofD) + qed (use B_tagged in \fastforce dest: tagged_partial_division_ofD\)+ have 2: "\0 fine (\(x,K). (x,K \ {x. c \ x \ i})) ` B" using fineB(1) fine_def by fastforce show "(\(x,K) \ (\(x,K). (x,K \ {x. c \ x \ i})) ` B. norm (integral K h)) < \/12" - apply (rule \0 [OF cb_ab \i \ Basis\ 1 2 \h \ F\]) - using \i \ Basis\ apply (subst sum_if_inner | force)+ - using overlap apply (auto simp: B_def) - done + using \i \ Basis\ \A \ T''\ overlap + by (force simp add: B_def sum_if_inner [where f = "\j. c"] + intro!: \0 [OF cb_ab \i \ Basis\ 1 2 \h \ F\]) qed qed qed @@ -1318,7 +1349,7 @@ then have int_f0: "integral (cbox a b) f = 0" by (simp add: integral_cong) have f0_tag: "f x = 0" if "(x,K) \ T" for x K - using T f0 that by (force simp: tagged_division_of_def) + using T f0 that by (meson tag_in_interval) then have "(\(x,K) \ T. content K *\<^sub>R f x) = 0" by (metis (mono_tags, lifting) real_vector.scale_eq_0_iff split_conv sum.neutral surj_pair) then show ?thesis @@ -1330,14 +1361,17 @@ then have int_f: "integral (cbox a b) f = integral (cbox a b) h" using integral_cong by blast have fh_tag: "f x = h x" if "(x,K) \ T" for x K - using T fh that by (force simp: tagged_division_of_def) - then have "(\(x,K) \ T. content K *\<^sub>R f x) = (\(x,K) \ T. content K *\<^sub>R h x)" + using T fh that by (meson tag_in_interval) + then have fh: "(\(x,K) \ T. content K *\<^sub>R f x) = (\(x,K) \ T. content K *\<^sub>R h x)" by (metis (mono_tags, lifting) split_cong sum.cong) - with \0 < \\ show ?thesis - apply (simp add: int_f) - apply (rule less_trans [OF \1]) - using that fine_Int apply (force simp: divide_simps)+ - done + show ?thesis + unfolding fh int_f + proof (rule less_trans [OF \1]) + show "\1 fine T" + by (meson fine fine_Int) + show "\ / (7 * Suc DIM('b)) < \" + using \0 < \\ by (force simp: divide_simps)+ + qed (use that in auto) qed qed have "gauge (\x. \0 x \ \1 x)" @@ -1364,17 +1398,20 @@ show "f \ uminus \ (\f. f \ uminus) ` F" using f by auto show "\h x. \h \ (\f. f \ uminus) ` F; x \ cbox (- b) (- a)\ \ norm (h x) \ norm ((f \ uminus) x)" - using f apply (clarsimp simp:) - by (metis add.inverse_inverse image_eqI norm_f uminus_interval_vector) + using f unfolding comp_def image_iff + by (metis (no_types, lifting) equation_minus_iff imageE norm_f uminus_interval_vector) qed have eq: "(\f. f \ uminus) ` (\i\Basis. \c. \h\F. {\x. if x \ i \ c then (h \ uminus) x else 0}) = - (\i\Basis. \c. \h\F. {\x. if c \ x \ i then h x else 0})" - apply (auto simp: o_def cong: if_cong) - using minus_le_iff apply fastforce + (\i\Basis. \c. \h\F. {\x. if c \ x \ i then h x else 0})" (is "?lhs = ?rhs") + proof + show "?lhs \ ?rhs" + using minus_le_iff by fastforce + show "?rhs \ ?lhs" + apply clarsimp apply (rule_tac x="\x. if c \ (-x) \ i then h(-x) else 0" in image_eqI) - using le_minus_iff apply fastforce+ - done + using le_minus_iff by fastforce+ + qed show ?thesis using equiintegrable_reflect [OF *] by (auto simp: eq) qed @@ -1427,43 +1464,45 @@ with f show ?case by auto next case (insert i B) - then have "i \ Basis" + then have "i \ Basis" "B \ Basis" by auto have *: "norm (h x) \ norm (f x)" if "h \ insert f (\c d. {?g B c d})" "x \ cbox a b" for h x using that by auto - have "(\i\Basis. + define F where "F \ (\i\Basis. \\. \h\insert f (\i\Basis. \\. \h\insert f (\c d. {?g B c d}). {\x. if x \ i \ \ then h x else 0}). - {\x. if \ \ x \ i then h x else 0}) + {\x. if \ \ x \ i then h x else 0})" + show ?case + proof (rule equiintegrable_on_subset) + have "F equiintegrable_on cbox a b" + unfolding F_def + proof (rule equiintegrable_halfspace_restrictions_ge) + show "insert f (\i\Basis. \\. \h\insert f (\c d. {?g B c d}). + {\x. if x \ i \ \ then h x else 0}) equiintegrable_on cbox a b" + by (intro * f equiintegrable_on_insert equiintegrable_halfspace_restrictions_le [OF insert.IH insertI1] \B \ Basis\) + show "norm(h x) \ norm(f x)" + if "h \ insert f (\i\Basis. \\. \h\insert f (\c d. {?g B c d}). {\x. if x \ i \ \ then h x else 0})" + "x \ cbox a b" for h x + using that by auto + qed auto + then show "insert f F equiintegrable_on cbox a b" - proof (rule equiintegrable_halfspace_restrictions_ge [where f=f]) - show "insert f (\i\Basis. \\. \h\insert f (\c d. {?g B c d}). - {\x. if x \ i \ \ then h x else 0}) equiintegrable_on cbox a b" - apply (intro * f equiintegrable_on_insert equiintegrable_halfspace_restrictions_le [OF insert.IH insertI1]) - using insert.prems apply auto + by (blast intro: f equiintegrable_on_insert) + show "insert f (\c d. {\x. if \j\insert i B. c \ j \ x \ j \ x \ j \ d \ j then f x else 0}) + \ insert f F" + using \i \ Basis\ + apply clarify + apply (simp add: F_def) + apply (drule_tac x=i in bspec, assumption) + apply (drule_tac x="c \ i" in spec, clarify) + apply (drule_tac x=i in bspec, assumption) + apply (drule_tac x="d \ i" in spec) + apply (clarsimp simp: fun_eq_iff) + apply (drule_tac x=c in spec) + apply (drule_tac x=d in spec) + apply (simp split: if_split_asm) done - show"norm(h x) \ norm(f x)" - if "h \ insert f (\i\Basis. \\. \h\insert f (\c d. {?g B c d}). {\x. if x \ i \ \ then h x else 0})" - "x \ cbox a b" for h x - using that by auto - qed auto - then have "insert f (\i\Basis. - \\. \h\insert f (\i\Basis. \\. \h\insert f (\c d. {?g B c d}). {\x. if x \ i \ \ then h x else 0}). - {\x. if \ \ x \ i then h x else 0}) - equiintegrable_on cbox a b" - by (blast intro: f equiintegrable_on_insert) - then show ?case - apply (rule equiintegrable_on_subset, clarify) - using \i \ Basis\ apply simp - apply (drule_tac x=i in bspec, assumption) - apply (drule_tac x="c \ i" in spec, clarify) - apply (drule_tac x=i in bspec, assumption) - apply (drule_tac x="d \ i" in spec) - apply (clarsimp simp add: fun_eq_iff) - apply (drule_tac x=c in spec) - apply (drule_tac x=d in spec) - apply (simp add: split: if_split_asm) - done + qed qed qed show ?thesis @@ -1471,7 +1510,6 @@ qed - subsection\Continuity of the indefinite integral\ proposition indefinite_integral_continuous: @@ -1510,9 +1548,8 @@ then obtain n where "n \ 0" and n: "1 / (real n) < \" by (metis inverse_eq_divide real_arch_inverse) have emin: "\ \ min \x \ i - c \ i\ \x \ i - d \ i\" if "i \ Basis" for i - unfolding \_def - apply (rule Min.coboundedI) - using that by force+ + unfolding \_def + by (meson Min.coboundedI euclidean_space_class.finite_Basis finite_imageI image_iff that) have "1 / real (Suc n) < \" using n \n \ 0\ \\ > 0\ by (simp add: field_simps) have "x \ cbox (u m) (v m) \ x \ cbox c d" if "m \ n" for m @@ -1607,10 +1644,10 @@ with \0 < B\ that show ?thesis by auto next case False - show ?thesis - apply (rule B) - using that \B > 0\ False apply (clarsimp simp: image_def) - by (metis cbox_Pair_iff interval_subset_is_interval is_interval_cbox prod.sel) + then have "\x \ cbox (a,a) (b,b). integral (cbox c d) f = integral (cbox (fst x) (snd x)) f" + using that by (metis cbox_Pair_iff interval_subset_is_interval is_interval_cbox prod.sel) + then show ?thesis + using B that(1) by blast qed then show ?thesis by (blast intro: boundedI) @@ -1648,25 +1685,30 @@ using absi by blast have int_gab: "g integrable_on cbox a b" using absint_g set_lebesgue_integral_eq_integral(1) by blast - have 1: "cbox (a + (b - a) /\<^sub>R real (Suc n)) (b - (b - a) /\<^sub>R real (Suc n)) \ box a b" for n - apply (rule subset_box_imp) - using pos apply (auto simp: content_pos_lt_eq algebra_simps) - done - have 2: "cbox (a + (b - a) /\<^sub>R real (Suc n)) (b - (b - a) /\<^sub>R real (Suc n)) \ - cbox (a + (b - a) /\<^sub>R real (Suc n + 1)) (b - (b - a) /\<^sub>R real (Suc n + 1))" for n - apply (rule subset_box_imp) - using pos apply (simp add: content_pos_lt_eq algebra_simps) - apply (simp add: divide_simps) - apply (auto simp: field_simps) - done - have getN: "\N::nat. \k. k \ N \ x \ cbox (a + (b - a) /\<^sub>R real k) (b - (b - a) /\<^sub>R real k)" + define \ where "\ \ \k. a + (b - a) /\<^sub>R real k" + define \ where "\ \ \k. b - (b - a) /\<^sub>R real k" + define I where "I \ \k. cbox (\ k) (\ k)" + have ISuc_box: "I (Suc n) \ box a b" for n + using pos unfolding I_def + by (intro subset_box_imp) (auto simp: \_def \_def content_pos_lt_eq algebra_simps) + have ISucSuc: "I (Suc n) \ I (Suc (Suc n))" for n + proof - + have "\i. i \ Basis + \ a \ i / Suc n + b \ i / (real n + 2) \ b \ i / Suc n + a \ i / (real n + 2)" + using pos + by (simp add: content_pos_lt_eq divide_simps) (auto simp: algebra_simps) + then show ?thesis + unfolding I_def + by (intro subset_box_imp) (auto simp: algebra_simps inverse_eq_divide \_def \_def) + qed + have getN: "\N::nat. \k. k \ N \ x \ I k" if x: "x \ box a b" for x proof - - let ?\ = "(\i \ Basis. {((x - a) \ i) / ((b - a) \ i), (b - x) \ i / ((b - a) \ i)})" - obtain N where N: "real N > 1 / Inf ?\" + define \ where "\ \ (\i \ Basis. {((x - a) \ i) / ((b - a) \ i), (b - x) \ i / ((b - a) \ i)})" + obtain N where N: "real N > 1 / Inf \" using reals_Archimedean2 by blast - moreover have \: "Inf ?\ > 0" - using that by (auto simp: finite_less_Inf_iff mem_box algebra_simps divide_simps) + moreover have \: "Inf \ > 0" + using that by (auto simp: \_def finite_less_Inf_iff mem_box algebra_simps divide_simps) ultimately have "N > 0" using of_nat_0_less_iff by fastforce show ?thesis @@ -1676,9 +1718,9 @@ by linarith have xa_gt: "(x - a) \ i > ((b - a) \ i) / (real k)" if "i \ Basis" for i proof - - have *: "Inf ?\ \ ((x - a) \ i) / ((b - a) \ i)" - using that by (force intro: cInf_le_finite) - have "1 / Inf ?\ \ ((b - a) \ i) / ((x - a) \ i)" + have *: "Inf \ \ ((x - a) \ i) / ((b - a) \ i)" + unfolding \_def using that by (force intro: cInf_le_finite) + have "1 / Inf \ \ ((b - a) \ i) / ((x - a) \ i)" using le_imp_inverse_le [OF * \] by (simp add: field_simps) with N have "k > ((b - a) \ i) / ((x - a) \ i)" @@ -1688,9 +1730,9 @@ qed have bx_gt: "(b - x) \ i > ((b - a) \ i) / k" if "i \ Basis" for i proof - - have *: "Inf ?\ \ ((b - x) \ i) / ((b - a) \ i)" - using that by (force intro: cInf_le_finite) - have "1 / Inf ?\ \ ((b - a) \ i) / ((b - x) \ i)" + have *: "Inf \ \ ((b - x) \ i) / ((b - a) \ i)" + using that unfolding \_def by (force intro: cInf_le_finite) + have "1 / Inf \ \ ((b - a) \ i) / ((b - x) \ i)" using le_imp_inverse_le [OF * \] by (simp add: field_simps) with N have "k > ((b - a) \ i) / ((b - x) \ i)" @@ -1698,15 +1740,15 @@ with x that show ?thesis by (auto simp: mem_box algebra_simps field_split_simps) qed - show "x \ cbox (a + (b - a) /\<^sub>R k) (b - (b - a) /\<^sub>R k)" - using that \ \k > 0\ - by (auto simp: mem_box algebra_simps divide_inverse dest: xa_gt bx_gt) + show "x \ I k" + using that \ \k > 0\ unfolding I_def + by (auto simp: \_def \_def mem_box algebra_simps divide_inverse dest: xa_gt bx_gt) qed qed - obtain Bf where "Bf > 0" and Bf: "\c d. cbox c d \ box a b \ norm (integral (cbox c d) f) \ Bf" - using bo unfolding bounded_pos by blast - obtain Bg where "Bg > 0" and Bg:"\c d. cbox c d \ cbox a b \ \integral (cbox c d) g\ \ Bg" - using bounded_integrals_over_subintervals [OF int_gab] unfolding bounded_pos real_norm_def by blast + obtain Bf where Bf: "\c d. cbox c d \ box a b \ norm (integral (cbox c d) f) \ Bf" + using bo unfolding bounded_iff by blast + obtain Bg where Bg:"\c d. cbox c d \ cbox a b \ \integral (cbox c d) g\ \ Bg" + using bounded_integrals_over_subintervals [OF int_gab] unfolding bounded_iff real_norm_def by blast show "(\x. f x \ j) absolutely_integrable_on cbox a b" using g proof \ \A lot of duplication in the two proofs\ @@ -1715,67 +1757,61 @@ by simp moreover have "(\x. g x - (g x - (f x \ j))) integrable_on cbox a b" proof (rule Henstock_Kurzweil_Integration.integrable_diff [OF int_gab]) - let ?\ = "\k x. if x \ cbox (a + (b - a) /\<^sub>R (Suc k)) (b - (b - a) /\<^sub>R (Suc k)) - then g x - f x \ j else 0" + define \ where "\ \ \k x. if x \ I (Suc k) then g x - f x \ j else 0" have "(\x. g x - f x \ j) integrable_on box a b" - proof (rule monotone_convergence_increasing [of ?\, THEN conjunct1]) - have *: "cbox (a + (b - a) /\<^sub>R (1 + real k)) (b - (b - a) /\<^sub>R (1 + real k)) \ box a b - = cbox (a + (b - a) /\<^sub>R (1 + real k)) (b - (b - a) /\<^sub>R (1 + real k))" for k - using box_subset_cbox "1" by fastforce - show "?\ k integrable_on box a b" for k - apply (simp add: integrable_restrict_Int integral_restrict_Int *) - apply (rule integrable_diff [OF integrable_on_subcbox [OF int_gab]]) - using "*" box_subset_cbox apply blast - by (metis "1" int_f integrable_component of_nat_Suc) - have cb12: "cbox (a + (b - a) /\<^sub>R (1 + real k)) (b - (b - a) /\<^sub>R (1 + real k)) - \ cbox (a + (b - a) /\<^sub>R (2 + real k)) (b - (b - a) /\<^sub>R (2 + real k))" for k - using False content_eq_0 - apply (simp add: subset_box algebra_simps) - apply (simp add: divide_simps) - apply (fastforce simp: field_simps) - done - show "?\ k x \ ?\ (Suc k) x" if "x \ box a b" for k x - using cb12 box_subset_cbox that by (force simp: intro!: fg) - show "(\k. ?\ k x) \ g x - f x \ j" if x: "x \ box a b" for x + proof (rule monotone_convergence_increasing [of \, THEN conjunct1]) + have *: "I (Suc k) \ box a b = I (Suc k)" for k + using box_subset_cbox ISuc_box by fastforce + show "\ k integrable_on box a b" for k + proof - + have "I (Suc k) \ cbox a b" + using "*" box_subset_cbox by blast + moreover have "(\m. f m \ j) integrable_on I (Suc k)" + by (metis ISuc_box I_def int_f integrable_component) + ultimately have "(\m. g m - f m \ j) integrable_on I (Suc k)" + by (metis Henstock_Kurzweil_Integration.integrable_diff I_def int_gab integrable_on_subcbox) + then show ?thesis + by (simp add: "*" \_def integrable_restrict_Int) + qed + show "\ k x \ \ (Suc k) x" if "x \ box a b" for k x + using ISucSuc box_subset_cbox that by (force simp: \_def intro!: fg) + show "(\k. \ k x) \ g x - f x \ j" if x: "x \ box a b" for x proof (rule tendsto_eventually) - obtain N::nat where N: "\k. k \ N \ x \ cbox (a + (b - a) /\<^sub>R real k) (b - (b - a) /\<^sub>R real k)" + obtain N::nat where N: "\k. k \ N \ x \ I k" using getN [OF x] by blast - show "\\<^sub>F k in sequentially. ?\ k x = g x - f x \ j" + show "\\<^sub>F k in sequentially. \ k x = g x - f x \ j" proof fix k::nat assume "N \ k" - have "x \ cbox (a + (b - a) /\<^sub>R (Suc k)) (b - (b - a) /\<^sub>R (Suc k))" + have "x \ I (Suc k)" by (metis \N \ k\ le_Suc_eq N) - then show "?\ k x = g x - f x \ j" - by simp + then show "\ k x = g x - f x \ j" + by (simp add: \_def) qed qed - have "\integral (box a b) - (\x. if x \ cbox (a + (b - a) /\<^sub>R (1 + real k)) (b - (b - a) /\<^sub>R (1 + real k)) - then g x - f x \ j else 0)\ \ Bg + Bf" for k + have "\integral (box a b) (\x. if x \ I (Suc k) then g x - f x \ j else 0)\ \ Bg + Bf" for k proof - - let ?I = "cbox (a + (b - a) /\<^sub>R (1 + real k)) (b - (b - a) /\<^sub>R (1 + real k))" - have I_int [simp]: "?I \ box a b = ?I" - using 1 by (simp add: Int_absorb2) - have int_fI: "f integrable_on ?I" - by (metis I_int inf_le2 int_f) - then have "(\x. f x \ j) integrable_on ?I" - by (simp add: integrable_component) - moreover have "g integrable_on ?I" - by (metis I_int inf.orderI int_gab integrable_on_open_interval integrable_on_subcbox) + have ABK_def [simp]: "I (Suc k) \ box a b = I (Suc k)" + using ISuc_box by (simp add: Int_absorb2) + have int_fI: "f integrable_on I (Suc k)" + using ISuc_box I_def int_f by auto moreover - have "\integral ?I (\x. f x \ j)\ \ norm (integral ?I f)" + have "\integral (I (Suc k)) (\x. f x \ j)\ \ norm (integral (I (Suc k)) f)" by (simp add: Basis_le_norm int_fI \j \ Basis\) - with 1 I_int have "\integral ?I (\x. f x \ j)\ \ Bf" - by (blast intro: order_trans [OF _ Bf]) - ultimately show ?thesis - apply (simp add: integral_restrict_Int integral_diff) - using "*" box_subset_cbox by (blast intro: Bg add_mono order_trans [OF abs_triangle_ineq4]) + with ISuc_box ABK_def have "\integral (I (Suc k)) (\x. f x \ j)\ \ Bf" + by (metis Bf I_def \j \ Basis\ int_fI integral_component_eq norm_bound_Basis_le) + ultimately + have "\integral (I (Suc k)) g - integral (I (Suc k)) (\x. f x \ j)\ \ Bg + Bf" + using "*" box_subset_cbox unfolding I_def + by (blast intro: Bg add_mono order_trans [OF abs_triangle_ineq4]) + moreover have "g integrable_on I (Suc k)" + by (metis ISuc_box I_def int_gab integrable_on_open_interval integrable_on_subcbox) + moreover have "(\x. f x \ j) integrable_on I (Suc k)" + using int_fI by (simp add: integrable_component) + ultimately show ?thesis + by (simp add: integral_restrict_Int integral_diff) qed - then show "bounded (range (\k. integral (box a b) (?\ k)))" - apply (simp add: bounded_pos) - apply (rule_tac x="Bg+Bf" in exI) - using \0 < Bf\ \0 < Bg\ apply auto - done + then show "bounded (range (\k. integral (box a b) (\ k)))" + by (auto simp add: bounded_iff \_def) qed then show "(\x. g x - f x \ j) integrable_on cbox a b" by (simp add: integrable_on_open_interval) @@ -1783,76 +1819,57 @@ ultimately have "(\x. f x \ j) integrable_on cbox a b" by auto then show ?thesis - apply (rule absolutely_integrable_component_ubound [OF _ absint_g]) - by (simp add: fg) + using absolutely_integrable_component_ubound [OF _ absint_g] fg by force next assume gf [rule_format]: "\x\cbox a b. g x \ f x \ j" have "(\x. (f x \ j)) = (\x. ((f x \ j) - g x) + g x)" by simp moreover have "(\x. (f x \ j - g x) + g x) integrable_on cbox a b" proof (rule Henstock_Kurzweil_Integration.integrable_add [OF _ int_gab]) - let ?\ = "\k x. if x \ cbox (a + (b - a) /\<^sub>R (Suc k)) (b - (b - a) /\<^sub>R (Suc k)) - then f x \ j - g x else 0" + let ?\ = "\k x. if x \ I(Suc k) then f x \ j - g x else 0" have "(\x. f x \ j - g x) integrable_on box a b" proof (rule monotone_convergence_increasing [of ?\, THEN conjunct1]) - have *: "cbox (a + (b - a) /\<^sub>R (1 + real k)) (b - (b - a) /\<^sub>R (1 + real k)) \ box a b - = cbox (a + (b - a) /\<^sub>R (1 + real k)) (b - (b - a) /\<^sub>R (1 + real k))" for k - using box_subset_cbox "1" by fastforce + have *: "I (Suc k) \ box a b = I (Suc k)" for k + using box_subset_cbox ISuc_box by fastforce show "?\ k integrable_on box a b" for k - apply (simp add: integrable_restrict_Int integral_restrict_Int *) - apply (rule integrable_diff) - apply (metis "1" int_f integrable_component of_nat_Suc) - apply (rule integrable_on_subcbox [OF int_gab]) - using "*" box_subset_cbox apply blast - done - have cb12: "cbox (a + (b - a) /\<^sub>R (1 + real k)) (b - (b - a) /\<^sub>R (1 + real k)) - \ cbox (a + (b - a) /\<^sub>R (2 + real k)) (b - (b - a) /\<^sub>R (2 + real k))" for k - using False content_eq_0 - apply (simp add: subset_box algebra_simps) - apply (simp add: divide_simps) - apply (fastforce simp: field_simps) - done + proof (simp add: integrable_restrict_Int integral_restrict_Int *) + show "(\x. f x \ j - g x) integrable_on I (Suc k)" + by (metis ISuc_box Henstock_Kurzweil_Integration.integrable_diff I_def int_f int_gab integrable_component integrable_on_open_interval integrable_on_subcbox) + qed show "?\ k x \ ?\ (Suc k) x" if "x \ box a b" for k x - using cb12 box_subset_cbox that by (force simp: intro!: gf) + using ISucSuc box_subset_cbox that by (force simp: I_def intro!: gf) show "(\k. ?\ k x) \ f x \ j - g x" if x: "x \ box a b" for x proof (rule tendsto_eventually) - obtain N::nat where N: "\k. k \ N \ x \ cbox (a + (b - a) /\<^sub>R real k) (b - (b - a) /\<^sub>R real k)" + obtain N::nat where N: "\k. k \ N \ x \ I k" using getN [OF x] by blast - show "\\<^sub>F k in sequentially. ?\ k x = f x \ j - g x" - proof - fix k::nat assume "N \ k" - have "x \ cbox (a + (b - a) /\<^sub>R (Suc k)) (b - (b - a) /\<^sub>R (Suc k))" - by (metis \N \ k\ le_Suc_eq N) - then show "?\ k x = f x \ j - g x" - by simp - qed + then show "\\<^sub>F k in sequentially. ?\ k x = f x \ j - g x" + by (metis (no_types, lifting) eventually_at_top_linorderI le_Suc_eq) qed have "\integral (box a b) - (\x. if x \ cbox (a + (b - a) /\<^sub>R (1 + real k)) (b - (b - a) /\<^sub>R (1 + real k)) - then f x \ j - g x else 0)\ \ Bf + Bg" for k + (\x. if x \ I (Suc k) then f x \ j - g x else 0)\ \ Bf + Bg" for k proof - - let ?I = "cbox (a + (b - a) /\<^sub>R (1 + real k)) (b - (b - a) /\<^sub>R (1 + real k))" - have I_int [simp]: "?I \ box a b = ?I" - using 1 by (simp add: Int_absorb2) - have int_fI: "f integrable_on ?I" - by (simp add: inf.orderI int_f) - then have "(\x. f x \ j) integrable_on ?I" + define ABK where "ABK \ cbox (a + (b - a) /\<^sub>R (1 + real k)) (b - (b - a) /\<^sub>R (1 + real k))" + have ABK_eq [simp]: "ABK \ box a b = ABK" + using "*" I_def \_def \_def ABK_def by auto + have int_fI: "f integrable_on ABK" + unfolding ABK_def + using ISuc_box I_def \_def \_def int_f by force + then have "(\x. f x \ j) integrable_on ABK" by (simp add: integrable_component) - moreover have "g integrable_on ?I" - by (metis I_int inf.orderI int_gab integrable_on_open_interval integrable_on_subcbox) + moreover have "g integrable_on ABK" + by (metis ABK_def ABK_eq IntE box_subset_cbox int_gab integrable_on_subcbox subset_eq) moreover - have "\integral ?I (\x. f x \ j)\ \ norm (integral ?I f)" + have "\integral ABK (\x. f x \ j)\ \ norm (integral ABK f)" by (simp add: Basis_le_norm int_fI \j \ Basis\) - with 1 I_int have "\integral ?I (\x. f x \ j)\ \ Bf" - by (blast intro: order_trans [OF _ Bf]) + then have "\integral ABK (\x. f x \ j)\ \ Bf" + by (metis ABK_eq ABK_def Bf IntE dual_order.trans subset_eq) ultimately show ?thesis - apply (simp add: integral_restrict_Int integral_diff) - using "*" box_subset_cbox by (blast intro: Bg add_mono order_trans [OF abs_triangle_ineq4]) + using "*" box_subset_cbox + apply (simp add: integral_restrict_Int integral_diff ABK_def I_def \_def \_def) + by (blast intro: Bg add_mono order_trans [OF abs_triangle_ineq4]) qed then show "bounded (range (\k. integral (box a b) (?\ k)))" - apply (simp add: bounded_pos) - apply (rule_tac x="Bf+Bg" in exI) - using \0 < Bf\ \0 < Bg\ by auto + by (auto simp add: bounded_iff) qed then show "(\x. f x \ j - g x) integrable_on cbox a b" by (simp add: integrable_on_open_interval) @@ -1860,16 +1877,11 @@ ultimately have "(\x. f x \ j) integrable_on cbox a b" by auto then show ?thesis - apply (rule absolutely_integrable_component_lbound [OF absint_g]) - by (simp add: gf) + using absint_g absolutely_integrable_absolutely_integrable_lbound gf by blast qed qed qed -subsection\Second Mean Value Theorem\ - - - subsection\Second mean value theorem and corollaries\ lemma level_approx: @@ -1921,10 +1933,12 @@ let ?\ = "Inf {x. g x \ y}" case False have lower: "?\ \ x" if "g x \ y" for x - apply (rule cInf_lower) - using False - apply (auto simp: that bdd_below_def) - by (meson dual_order.trans g linear) + proof (rule cInf_lower) + show "x \ {x. y \ g x}" + using False by (auto simp: that) + show "bdd_below {x. y \ g x}" + by (metis False bdd_belowI dual_order.trans g linear mem_Collect_eq) + qed have greatest: "?\ \ z" if "(\x. g x \ y \ z \ x)" for z by (metis False cInf_greatest empty_iff mem_Collect_eq that) show ?thesis @@ -1936,7 +1950,7 @@ by (force simp: \) next case False - have "(y \ g x) = (?\ < x)" for x + have "(y \ g x) \ (?\ < x)" for x proof show "?\ < x" if "y \ g x" using that False less_eq_real_def lower by blast @@ -1949,9 +1963,7 @@ qed qed auto show ?thesis - apply (rule equiintegrable_on_subset [OF equiintegrable_on_Un [OF gt equiintegrable_on_Un [OF ge equiintegrable_on_Un [OF ffab 0]]]]) - using \ apply (simp add: UN_subset_iff) - done + using \ by (simp add: UN_subset_iff equiintegrable_on_subset [OF equiintegrable_on_Un [OF gt equiintegrable_on_Un [OF ge equiintegrable_on_Un [OF ffab 0]]]]) qed @@ -1992,15 +2004,19 @@ have "\d. d \ {a..b} \ integral {a..b} (\x. if g x \ y then f x else 0) = integral {d..b} f" for y proof - let ?X = "{x. g x \ y}" - have *: "\a. ?X = {x. a \ x} \ ?X = {x. a < x}" + have *: "\a. ?X = {a..} \ ?X = {a<..}" if 1: "?X \ {}" and 2: "?X \ UNIV" proof - let ?\ = "Inf{x. g x \ y}" have lower: "?\ \ x" if "g x \ y" for x - apply (rule cInf_lower) - using 1 2 apply (auto simp: that bdd_below_def) - by (meson dual_order.trans g linear) - have greatest: "?\ \ z" if "(\x. g x \ y \ z \ x)" for z + proof (rule cInf_lower) + show "x \ {x. y \ g x}" + using 1 2 by (auto simp: that) + show "bdd_below {x. y \ g x}" + unfolding bdd_below_def + by (metis "2" UNIV_eq_I dual_order.trans g less_eq_real_def mem_Collect_eq not_le) + qed + have greatest: "?\ \ z" if "\x. g x \ y \ z \ x" for z by (metis cInf_greatest mem_Collect_eq that 1) show ?thesis proof (cases "g ?\ \ y") @@ -2023,51 +2039,43 @@ by (force simp: \) qed qed - then consider "?X = {}" | "?X = UNIV" | d where "?X = {x. d \ x} \?X = {x. d < x}" + then consider "?X = {}" | "?X = UNIV" | (intv) d where "?X = {d..} \ ?X = {d<..}" by metis then have "\d. d \ {a..b} \ integral {a..b} (\x. if x \ ?X then f x else 0) = integral {d..b} f" proof cases - case 1 - then show ?thesis - using \a \ b\ by auto - next - case 2 - then show ?thesis - using \a \ b\ by auto - next - case (3 d) + case (intv d) show ?thesis proof (cases "d < a") case True - with 3 show ?thesis - apply (rule_tac x=a in exI) - apply (auto simp: \a \ b\ iff del: mem_Collect_eq intro!: Henstock_Kurzweil_Integration.integral_cong, simp_all) - done + with intv have "integral {a..b} (\x. if y \ g x then f x else 0) = integral {a..b} f" + by (intro Henstock_Kurzweil_Integration.integral_cong) force + then show ?thesis + by (rule_tac x=a in exI) (simp add: \a \ b\) next case False show ?thesis proof (cases "b < d") case True have "integral {a..b} (\x. if x \ {x. y \ g x} then f x else 0) = integral {a..b} (\x. 0)" - by (rule Henstock_Kurzweil_Integration.integral_cong) (use 3 True in fastforce) + by (rule Henstock_Kurzweil_Integration.integral_cong) (use intv True in fastforce) then show ?thesis using \a \ b\ by auto next case False - with \\ d < a\ have eq: "Collect ((\) d) \ {a..b} = {d..b}" "Collect ((<) d) \ {a..b} = {d<..b}" + with \\ d < a\ have eq: "{d..} \ {a..b} = {d..b}" "{d<..} \ {a..b} = {d<..b}" by force+ moreover have "integral {d<..b} f = integral {d..b} f" by (rule integral_spike_set [OF empty_imp_negligible negligible_subset [OF negligible_sing [of d]]]) auto - ultimately - show ?thesis - using \\ d < a\ False 3 - apply (rule_tac x=d in exI) - apply (auto simp: \a \ b\ iff del: mem_Collect_eq; subst Henstock_Kurzweil_Integration.integral_restrict_Int) - apply (simp_all add: \a \ b\ not_less eq) - done + ultimately + have "integral {a..b} (\x. if x \ {x. y \ g x} then f x else 0) = integral {d..b} f" + unfolding integral_restrict_Int using intv by presburger + moreover have "d \ {a..b}" + using \\ d < a\ \a \ b\ False by auto + ultimately show ?thesis + by auto qed qed - qed + qed (use \a \ b\ in auto) then show ?thesis by auto qed @@ -2179,14 +2187,12 @@ proof (rule tendsto_unique) show "(\n. integral {c(\ n)..b} f) \ integral {a..b} (\x. g x *\<^sub>R f x)" using ** by (simp add: c \_def) - show "(\n. integral {c(\ n)..b} f) \ integral {d..b} f" - using indefinite_integral_continuous_1' [OF f] - using d unfolding o_def - apply (simp add: continuous_on_eq_continuous_within) - apply (drule_tac x=d in bspec) - using \d \ {a..b}\ apply blast - apply (simp add: continuous_within_sequentially o_def) - using cab by auto + have "continuous (at d within {a..b}) (\x. integral {x..b} f)" + using indefinite_integral_continuous_1' [OF f] \d \ {a..b}\ + by (simp add: continuous_on_eq_continuous_within) + then show "(\n. integral {c(\ n)..b} f) \ integral {d..b} f" + using d cab unfolding o_def + by (simp add: continuous_within_sequentially o_def) qed auto qed qed @@ -2259,8 +2265,7 @@ assumes f: "f integrable_on {a..b}" and "a \ b" and g: "\x y. \a \ x; x \ y; y \ b\ \ g x \ g y" obtains c where "c \ {a..b}" - "integral {a..b} (\x. g x * f x) - = g a * integral {a..c} f + g b * integral {c..b} f" + "integral {a..b} (\x. g x * f x) = g a * integral {a..c} f + g b * integral {c..b} f" using second_mean_value_theorem_full [where g=g, OF assms] by (metis (full_types) integral_unique) diff -r 97f12d2c8bf2 -r 16345c07bd8c src/HOL/Analysis/Tagged_Division.thy --- a/src/HOL/Analysis/Tagged_Division.thy Sun Nov 01 18:24:10 2020 +0100 +++ b/src/HOL/Analysis/Tagged_Division.thy Thu Nov 05 19:09:02 2020 +0000 @@ -1002,7 +1002,7 @@ (\x1 K1 x2 K2. (x1, K1) \ s \ (x2, K2) \ s \ (x1, K1) \ (x2, K2) \ interior K1 \ interior K2 = {})" -lemma tagged_partial_division_ofD[dest]: +lemma tagged_partial_division_ofD: assumes "s tagged_partial_division_of i" shows "finite s" and "\x K. (x,K) \ s \ x \ K" @@ -2235,7 +2235,7 @@ and "\(x,k) \ p. k \ d(x) \ (x,k) \ q" proof - have p: "finite p" "p tagged_partial_division_of (cbox a b)" - using ptag unfolding tagged_division_of_def by auto + using ptag tagged_division_of_def by blast+ have "(\q. q tagged_division_of (\{k. \x. (x,k) \ p}) \ d fine q \ (\(x,k) \ p. k \ d(x) \ (x,k) \ q))" if "finite p" "p tagged_partial_division_of (cbox a b)" "gauge d" for p using that