# HG changeset patch # User paulson # Date 1503662473 -3600 # Node ID 65b6d48fc9a90aba13376f81033d84135a520fbd # Parent 5df7a346f07bf7b7fca5a5ab49bd36a913ab0515# Parent 29d684ce23258101574999e7419e0e9555709cf3 merged diff -r 5df7a346f07b -r 65b6d48fc9a9 src/HOL/Analysis/Cauchy_Integral_Theorem.thy --- a/src/HOL/Analysis/Cauchy_Integral_Theorem.thy Fri Aug 25 08:59:54 2017 +0200 +++ b/src/HOL/Analysis/Cauchy_Integral_Theorem.thy Fri Aug 25 13:01:13 2017 +0100 @@ -1347,7 +1347,7 @@ has_integral contour_integral (subpath u v g) f) {u..v}" using assms apply (auto simp: has_integral_integrable_integral) - apply (rule integrable_on_subcbox [where a=u and b=v and s = "{0..1}", simplified]) + apply (rule integrable_on_subcbox [where a=u and b=v and S = "{0..1}", simplified]) apply (auto simp: contour_integral_unique [OF has_contour_integral_subpath] contour_integrable_on) done @@ -1364,7 +1364,7 @@ contour_integral (subpath u w g) f" using assms apply (auto simp: contour_integral_subcontour_integral) apply (rule integral_combine, auto) - apply (rule integrable_on_subcbox [where a=u and b=w and s = "{0..1}", simplified]) + apply (rule integrable_on_subcbox [where a=u and b=w and S = "{0..1}", simplified]) apply (auto simp: contour_integrable_on) done diff -r 5df7a346f07b -r 65b6d48fc9a9 src/HOL/Analysis/Henstock_Kurzweil_Integration.thy --- a/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy Fri Aug 25 08:59:54 2017 +0200 +++ b/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy Fri Aug 25 13:01:13 2017 +0100 @@ -11,8 +11,8 @@ (*FIXME DELETE*) lemma conjunctD2: assumes "a \ b" shows a b using assms by auto - (* try instead structured proofs below *) + lemma norm_diff2: "\y = y1 + y2; x = x1 + x2; e = e1 + e2; norm(y1 - x1) \ e1; norm(y2 - x2) \ e2\ \ norm(y-x) \ e" using norm_triangle_mono [of "y1 - x1" "e1" "y2 - x2" "e2"] @@ -4228,33 +4228,28 @@ obtains d where "0 < d" and "\t. c \ t \ t < c + d \ norm (integral {a..c} f - integral {a..t} f) < e" proof - - have *: "(\x. f (- x)) integrable_on {-b .. -a}" "- b < - c" "- c \ - a" + have intm: "(\x. f (- x)) integrable_on {-b .. -a}" "- b < - c" "- c \ - a" using assms by auto - from indefinite_integral_continuous_left[OF * \e>0\] guess d . note d = this + from indefinite_integral_continuous_left[OF intm \e>0\] + obtain d where "0 < d" + and d: "\t. \- c - d < t; t \ -c\ + \ norm (integral {- b..- c} (\x. f (-x)) - integral {- b..t} (\x. f (-x))) < e" + by metis let ?d = "min d (b - c)" show ?thesis - apply (rule that[of "?d"]) - apply safe - proof - + proof (intro that[of "?d"] allI impI) show "0 < ?d" - using d(1) assms(3) by auto + using \0 < d\ \c < b\ by auto fix t :: real - assume as: "c \ t" "t < c + ?d" + assume t: "c \ t \ t < c + ?d" have *: "integral {a..c} f = integral {a..b} f - integral {c..b} f" - "integral {a..t} f = integral {a..b} f - integral {t..b} f" + "integral {a..t} f = integral {a..b} f - integral {t..b} f" apply (simp_all only: algebra_simps) - apply (rule_tac[!] integral_combine) - using assms as - apply auto - done - have "(- c) - d < (- t) \ - t \ - c" - using as by auto note d(2)[rule_format,OF this] - then show "norm (integral {a..c} f - integral {a..t} f) < e" - unfolding * - unfolding integral_reflect - apply (subst norm_minus_commute) - apply (auto simp add: algebra_simps) - done + using assms t by (auto simp: integral_combine) + 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 *) qed qed @@ -4484,8 +4479,8 @@ lemma has_integral_restrict_open_subinterval: fixes f :: "'a::euclidean_space \ 'b::banach" - assumes "(f has_integral i) (cbox c d)" - and "cbox c d \ cbox a b" + assumes intf: "(f has_integral i) (cbox c d)" + and cb: "cbox c d \ cbox a b" shows "((\x. if x \ box c d then f x else 0) has_integral i) (cbox a b)" proof - define g where [abs_def]: "g x = (if x \box c d then f x else 0)" for x @@ -4507,7 +4502,8 @@ qed } assume "cbox c d \ {}" - from partial_division_extend_1 [OF assms(2) this] guess p . note p=this + then obtain p where p: "p division_of cbox a b" "cbox c d \ p" + using cb partial_division_extend_1 by blast interpret operative "lift_option plus" "Some (0 :: 'b)" "\i. if g integrable_on i then Some (integral i g) else None" by (fact operative_integralI) @@ -4536,16 +4532,13 @@ then have "x \ p" by auto note div = division_ofD(2-5)[OF p(1) this] - from div(3) guess u v by (elim exE) note uv=this + then obtain u v where uv: "x = cbox u v" by blast have "interior x \ interior (cbox c d) = {}" using div(4)[OF p(2)] x by auto then have "(g has_integral 0) x" unfolding uv - apply - - apply (rule has_integral_spike_interior[where f="\x. 0"]) - unfolding g_def interior_cbox - apply auto - done + using has_integral_spike_interior[where f="\x. 0"] + by (metis (no_types, lifting) disjoint_iff_not_equal g_def has_integral_0_eq interior_cbox) then show "(if g integrable_on x then Some (integral x g) else None) = Some 0" by auto qed @@ -4634,140 +4627,88 @@ lemma has_integral': fixes f :: "'n::euclidean_space \ 'a::banach" - shows "(f has_integral i) s \ + shows "(f has_integral i) S \ (\e>0. \B>0. \a b. ball 0 B \ cbox a b \ - (\z. ((\x. if x \ s then f(x) else 0) has_integral z) (cbox a b) \ norm(z - i) < e))" + (\z. ((\x. if x \ S then f(x) else 0) has_integral z) (cbox a b) \ norm(z - i) < e))" (is "?l \ (\e>0. ?r e)") -proof - - { - presume *: "\a b. s = cbox a b \ ?thesis" - show ?thesis - apply cases - apply (rule *) - apply assumption - apply (subst has_integral_alt) - apply auto - done - } - assume "\a b. s = cbox a b" - then guess a b by (elim exE) note s=this - from bounded_cbox[of a b, unfolded bounded_pos] guess B .. - note B = conjunctD2[OF this,rule_format] show ?thesis - apply safe - proof - +proof (cases "\a b. S = cbox a b") + case False then show ?thesis + by (simp add: has_integral_alt) +next + case True + then obtain a b where S: "S = cbox a b" + by blast + obtain B where " 0 < B" and B: "\x. x \ cbox a b \ norm x \ B" + using bounded_cbox[unfolded bounded_pos] by blast + show ?thesis + proof safe fix e :: real assume ?l and "e > 0" - show "?r e" + have "((\x. if x \ S then f x else 0) has_integral i) (cbox c d)" + if "ball 0 (B+1) \ cbox c d" for c d + unfolding S using B that + by (force intro: \?l\[unfolded S] has_integral_restrict_closed_subinterval) + then show "?r e" apply (rule_tac x="B+1" in exI) - apply safe - defer - apply (rule_tac x=i in exI) - proof - fix c d :: 'n - assume as: "ball 0 (B+1) \ cbox c d" - then show "((\x. if x \ s then f x else 0) has_integral i) (cbox c d)" - unfolding s - apply - - apply (rule has_integral_restrict_closed_subinterval) - apply (rule \?l\[unfolded s]) - apply safe - apply (drule B(2)[rule_format]) - unfolding subset_eq - apply (erule_tac x=x in ballE) - apply (auto simp add: dist_norm) - done - qed (insert B \e>0\, auto) + using \B>0\ \e>0\ by force next assume as: "\e>0. ?r e" - from this[rule_format,OF zero_less_one] guess C..note C=conjunctD2[OF this,rule_format] + then obtain C + where C: "\a b. ball 0 C \ cbox a b \ + \z. ((\x. if x \ S then f x else 0) has_integral z) (cbox a b)" + by (meson zero_less_one) define c :: 'n where "c = (\i\Basis. (- max B C) *\<^sub>R i)" define d :: 'n where "d = (\i\Basis. max B C *\<^sub>R i)" - have c_d: "cbox a b \ cbox c d" - apply safe - apply (drule B(2)) - unfolding mem_box - proof - fix x i - show "c \ i \ x \ i \ x \ i \ d \ i" if "norm x \ B" and "i \ Basis" - using that and Basis_le_norm[OF \i\Basis\, of x] - unfolding c_def d_def - by (auto simp add: field_simps sum_negf) - qed - have "ball 0 C \ cbox c d" - apply (rule subsetI) - unfolding mem_box mem_ball dist_norm - proof - fix x i :: 'n - assume x: "norm (0 - x) < C" and i: "i \ Basis" - show "c \ i \ x \ i \ x \ i \ d \ i" - using Basis_le_norm[OF i, of x] and x i - unfolding c_def d_def - by (auto simp: sum_negf) - qed - from C(2)[OF this] have "\y. (f has_integral y) (cbox a b)" - unfolding has_integral_restrict_closed_subintervals_eq[OF c_d,symmetric] - unfolding s - by auto - then guess y..note y=this - + 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) + 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" + if x: "norm (0 - x) < C" and i: "i \ Basis" for x i + using Basis_le_norm[OF i, of x] x i by (auto simp: sum_negf c_def d_def) + then have "ball 0 C \ cbox c d" + by (auto simp: mem_box dist_norm) + with C obtain y where y: "(f has_integral y) (cbox a b)" + using c_d has_integral_restrict_closed_subintervals_eq S by blast have "y = i" proof (rule ccontr) - assume "\ ?thesis" + assume "y \ i" then have "0 < norm (y - i)" by auto - from as[rule_format,OF this] guess C .. note C=conjunctD2[OF this,rule_format] + from as[rule_format,OF this] + obtain C where C: "\a b. ball 0 C \ cbox a b \ + \z. ((\x. if x \ S then f x else 0) has_integral z) (cbox a b) \ norm (z-i) < norm (y-i)" + by auto define c :: 'n where "c = (\i\Basis. (- max B C) *\<^sub>R i)" define d :: 'n where "d = (\i\Basis. max B C *\<^sub>R i)" - have c_d: "cbox a b \ cbox c d" - apply safe - apply (drule B(2)) - unfolding mem_box - proof - fix x i :: 'n - assume "norm x \ B" and "i \ Basis" - then show "c \ i \ x \ i \ x \ i \ d \ i" - using Basis_le_norm[of i x] - unfolding c_def d_def - by (auto simp add: field_simps sum_negf) - qed - have "ball 0 C \ cbox c d" - apply (rule subsetI) - unfolding mem_box mem_ball dist_norm - proof - fix x i :: 'n - assume "norm (0 - x) < C" and "i \ Basis" - then show "c \ i \ x \ i \ x \ i \ d \ i" - using Basis_le_norm[of i x] - unfolding c_def d_def - by (auto simp: sum_negf) - qed - note C(2)[OF this] then guess z..note z = conjunctD2[OF this, unfolded s] - note this[unfolded has_integral_restrict_closed_subintervals_eq[OF c_d]] - then have "z = y" and "norm (z - i) < norm (y - i)" - apply - - apply (rule has_integral_unique[OF _ y(1)]) - apply assumption - apply assumption - done - then show False + 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) + 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 + using Basis_le_norm[of i x] that by (auto simp: sum_negf c_def d_def) + then have "ball 0 C \ cbox c d" + 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]) + ultimately show False by auto qed then show ?l - using y - unfolding s - by auto + using y by (auto simp: S) qed qed lemma has_integral_le: fixes f :: "'n::euclidean_space \ real" - assumes "(f has_integral i) S" - and "(g has_integral j) S" - and "\x. x \ S \ f x \ g x" + assumes fg: "(f has_integral i) S" "(g has_integral j) S" + and le: "\x. x \ S \ f x \ g x" shows "i \ j" - using has_integral_component_le[OF _ assms(1-2), of 1] - using assms(3) - by auto + using has_integral_component_le[OF _ fg, of 1] le by auto lemma integral_le: fixes f :: "'n::euclidean_space \ real" @@ -5029,75 +4970,55 @@ lemma has_integral_alt': fixes f :: "'n::euclidean_space \ 'a::banach" - shows "(f has_integral i) s \ (\a b. (\x. if x \ s then f x else 0) integrable_on cbox a b) \ - (\e>0. \B>0. \a b. ball 0 B \ cbox a b \ - norm (integral (cbox a b) (\x. if x \ s then f x else 0) - i) < e)" + shows "(f has_integral i) s \ + (\a b. (\x. if x \ s then f x else 0) integrable_on cbox a b) \ + (\e>0. \B>0. \a b. ball 0 B \ cbox a b \ + norm (integral (cbox a b) (\x. if x \ s then f x else 0) - i) < e)" (is "?l = ?r") proof - assume ?r + assume rhs: ?r show ?l - apply (subst has_integral') - apply safe - proof goal_cases - case (1 e) - from \?r\[THEN conjunct2,rule_format,OF this] guess B..note B=conjunctD2[OF this] - show ?case - apply rule - apply rule - apply (rule B) - apply safe - apply (rule_tac x="integral (cbox a b) (\x. if x \ s then f x else 0)" in exI) - apply (drule B(2)[rule_format]) - using integrable_integral[OF \?r\[THEN conjunct1,rule_format]] - apply auto - done + proof (subst has_integral', intro allI impI) + fix e::real + assume "e > 0" + from rhs[THEN conjunct2,rule_format,OF this] + show "\B>0. \a b. ball 0 B \ cbox a b \ + (\z. ((\x. if x \ s then f x else 0) has_integral z) + (cbox a b) \ norm (z - i) < e)" + apply (rule ex_forward) + using rhs by blast qed next - assume ?l note as = this[unfolded has_integral'[of f],rule_format] + let ?\ = "\e a b. \z. ((\x. if x \ s then f x else 0) has_integral z) (cbox a b) \ norm (z - i) < e" + assume ?l + then have lhs: "\B>0. \a b. ball 0 B \ cbox a b \ ?\ e a b" if "e > 0" for e + using that has_integral'[of f] by auto let ?f = "\x. if x \ s then f x else 0" show ?r - proof safe + proof (intro conjI allI impI) fix a b :: 'n - from as[OF zero_less_one] guess B..note B=conjunctD2[OF this,rule_format] + from lhs[OF zero_less_one] + obtain B where "0 < B" and B: "\a b. ball 0 B \ cbox a b \ ?\ 1 a b" + by blast let ?a = "\i\Basis. min (a\i) (-B) *\<^sub>R i::'n" let ?b = "\i\Basis. max (b\i) B *\<^sub>R i::'n" show "?f integrable_on cbox a b" proof (rule integrable_subinterval[of _ ?a ?b]) - have "ball 0 B \ cbox ?a ?b" - apply (rule subsetI) - unfolding mem_ball mem_box dist_norm - proof (rule, goal_cases) - case (1 x i) - then show ?case using Basis_le_norm[of i x] - by (auto simp add:field_simps) - qed - from B(2)[OF this] guess z..note conjunct1[OF this] + 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) + then have "ball 0 B \ cbox ?a ?b" + by (auto simp: mem_box dist_norm) then show "?f integrable_on cbox ?a ?b" - unfolding integrable_on_def by auto + unfolding integrable_on_def using B by blast show "cbox a b \ cbox ?a ?b" - apply safe - unfolding mem_box - apply rule - apply (erule_tac x=i in ballE) - apply auto - done + by (force simp: mem_box) qed - + fix e :: real assume "e > 0" - from as[OF this] guess B..note B=conjunctD2[OF this,rule_format] - show "\B>0. \a b. ball 0 B \ cbox a b \ + with lhs show "\B>0. \a b. ball 0 B \ cbox a b \ norm (integral (cbox a b) (\x. if x \ s then f x else 0) - i) < e" - apply rule - apply rule - apply (rule B) - apply safe - proof goal_cases - case 1 - from B(2)[OF this] guess z..note z=conjunctD2[OF this] - from integral_unique[OF this(1)] show ?case - using z(2) by auto - qed + by (metis (no_types, lifting) has_integral_integrable_integral) qed qed @@ -5113,113 +5034,94 @@ integral (cbox c d) (\x. if x \ s then f x else 0)) < e)" (is "?l = ?r") proof + let ?F = "\x. if x \ s then f x else 0" assume ?l - then guess y unfolding integrable_on_def..note this[unfolded has_integral_alt'[of f]] - note y=conjunctD2[OF this,rule_format] + then obtain y where intF: "\a b. ?F integrable_on cbox a b" + and y: "\e. 0 < e \ + \B>0. \a b. ball 0 B \ cbox a b \ norm (integral (cbox a b) ?F - y) < e" + unfolding integrable_on_def has_integral_alt'[of f] by auto show ?r - apply safe - apply (rule y) - proof goal_cases - case (1 e) + proof (intro conjI allI impI intF) + fix e::real + assume "e > 0" then have "e/2 > 0" by auto - from y(2)[OF this] guess B..note B=conjunctD2[OF this,rule_format] - show ?case - apply rule - apply rule - apply (rule B) - apply safe - proof goal_cases - case prems: (1 a b c d) - show ?case - apply (rule norm_triangle_half_l) - using B(2)[OF prems(1)] B(2)[OF prems(2)] - apply auto - done + obtain B where "0 < B" + and B: "\a b. ball 0 B \ cbox a b \ norm (integral (cbox a b) ?F - y) < e/2" + using \0 < e/2\ y by blast + show "\B>0. \a b c d. ball 0 B \ cbox a b \ ball 0 B \ cbox c d \ + norm (integral (cbox a b) ?F - integral (cbox c d) ?F) < e" + proof (intro conjI exI impI allI, rule \0 < B\) + fix a b c d::'n + assume sub: "ball 0 B \ cbox a b \ ball 0 B \ cbox c d" + show "norm (integral (cbox a b) ?F - integral (cbox c d) ?F) < e" + using sub by (auto intro: norm_triangle_half_l dest: B) qed qed next - assume ?r - note as = conjunctD2[OF this,rule_format] + let ?F = "\x. if x \ s then f x else 0" + assume rhs: ?r let ?cube = "\n. cbox (\i\Basis. - real n *\<^sub>R i::'n) (\i\Basis. real n *\<^sub>R i)" - have "Cauchy (\n. integral (?cube n) (\x. if x \ s then f x else 0))" - proof (unfold Cauchy_def, safe, goal_cases) - case (1 e) - from as(2)[OF this] guess B..note B = conjunctD2[OF this,rule_format] - from real_arch_simple[of B] guess N..note N = this - { - fix n - assume n: "n \ N" - have "ball 0 B \ ?cube n" - apply (rule subsetI) - unfolding mem_ball mem_box dist_norm - proof (rule, goal_cases) - case (1 x i) - then show ?case - using Basis_le_norm[of i x] \i\Basis\ - using n N - by (auto simp add: field_simps sum_negf) - qed - } - then show ?case - apply - - apply (rule_tac x=N in exI) - apply safe - unfolding dist_norm - apply (rule B(2)) - apply auto - done + have "Cauchy (\n. integral (?cube n) ?F)" + unfolding Cauchy_def + proof (intro allI impI) + fix e::real + assume "e > 0" + with rhs obtain B where "0 < B" + and B: "\a b c d. ball 0 B \ cbox a b \ ball 0 B \ cbox c d + \ norm (integral (cbox a b) ?F - integral (cbox c d) ?F) < e" + by blast + obtain N where N: "B \ real N" + using real_arch_simple by blast + have "ball 0 B \ ?cube n" if n: "n \ N" for n + proof - + have "sum (op *\<^sub>R (- real n)) Basis \ i \ x \ i \ + x \ i \ sum (op *\<^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) + 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) qed - from this[unfolded convergent_eq_Cauchy[symmetric]] guess i .. - note i = this[THEN LIMSEQ_D] - - show ?l unfolding integrable_on_def has_integral_alt'[of f] - apply (rule_tac x=i in exI) - apply safe - apply (rule as(1)[unfolded integrable_on_def]) - proof goal_cases - case (1 e) - then have *: "e/2 > 0" by auto - from i[OF this] guess N..note N =this[rule_format] - from as(2)[OF *] guess B..note B=conjunctD2[OF this,rule_format] + then obtain i where i: "(\n. integral (?cube n) ?F) \ i" + using convergent_eq_Cauchy by blast + have "\B>0. \a b. ball 0 B \ cbox a b \ norm (integral (cbox a b) ?F - i) < e" + if "e > 0" for e + proof - + have *: "e/2 > 0" using that by auto + then obtain N where N: "\n. N \ n \ norm (i - integral (?cube n) ?F) < e / 2" + using i[THEN LIMSEQ_D, simplified norm_minus_commute] by meson + obtain B where "0 < B" + and B: "\a b c d. \ball 0 B \ cbox a b; ball 0 B \ cbox c d\ \ + norm (integral (cbox a b) ?F - integral (cbox c d) ?F) < e / 2" + using rhs * by meson let ?B = "max (real N) B" - show ?case - apply (rule_tac x="?B" in exI) - proof safe + show ?thesis + proof (intro exI conjI allI impI) show "0 < ?B" - using B(1) by auto + using \B > 0\ by auto fix a b :: 'n - assume ab: "ball 0 ?B \ cbox a b" - from real_arch_simple[of ?B] guess n..note n=this - show "norm (integral (cbox a b) (\x. if x \ s then f x else 0) - i) < e" - apply (rule norm_triangle_half_l) - apply (rule B(2)) - defer - apply (subst norm_minus_commute) - apply (rule N[of n]) - proof safe - show "N \ n" - using n by auto + assume "ball 0 ?B \ cbox a b" + moreover obtain n where n: "max (real N) B \ real n" + using real_arch_simple by blast + moreover have "ball 0 B \ ?cube n" + proof fix x :: 'n assume x: "x \ ball 0 B" - then have "x \ ball 0 ?B" - by auto - then show "x \ cbox a b" - using ab by blast - show "x \ ?cube n" - using x - unfolding mem_box mem_ball dist_norm - apply - - proof (rule, goal_cases) - case (1 i) - then show ?case - using Basis_le_norm[of i x] \i \ Basis\ - using n - by (auto simp add: field_simps sum_negf) - qed - qed + have "\norm (0 - x) < B; i \ Basis\ + \ sum (op *\<^sub>R (-n)) Basis \ i\ x \ i \ x \ i \ sum (op *\<^sub>R n) Basis \ i" for i + using Basis_le_norm[of i x] n by (auto simp add: field_simps sum_negf) + then show "x \ ?cube n" + using x by (auto simp: mem_box dist_norm) + qed + ultimately show "norm (integral (cbox a b) ?F - i) < e" + using norm_triangle_half_l [OF B N] by force qed qed + then show ?l unfolding integrable_on_def has_integral_alt'[of f] + using rhs by blast qed lemma integrable_altD: @@ -5232,15 +5134,15 @@ lemma integrable_on_subcbox: fixes f :: "'n::euclidean_space \ 'a::banach" - assumes "f integrable_on s" - and "cbox a b \ s" + assumes intf: "f integrable_on S" + and sub: "cbox a b \ S" shows "f integrable_on cbox a b" - apply (rule integrable_eq) - defer - apply (rule integrable_altD(1)[OF assms(1)]) - using assms(2) - apply auto - done +proof - + 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) +qed subsection \A straddling criterion for integrability\ @@ -5695,8 +5597,7 @@ and p: "p tagged_partial_division_of (cbox a b)" "d fine p" shows "norm (sum (\(x,K). content K *\<^sub>R f x - integral K f) p) \ e" (is "?x \ e") -proof - - { presume "\k. 0 ?x \ e + k" then show ?thesis by (blast intro: field_le_epsilon) } +proof (rule field_le_epsilon) fix k :: real assume k: "k > 0" note p' = tagged_partial_division_ofD[OF p(1)] @@ -6073,10 +5974,10 @@ by blast then have "abs (content K * (g x - f (m x) x)) \ content K * (e/(4 * content (cbox a b)))" by (metis m[OF x] mult_nonneg_nonneg abs_of_nonneg less_eq_real_def measure_nonneg mult_left_mono order_refl) - then show "\content K * g x - content K * f (m x) x\ \ content K * e / (4 * content (cbox a b))" + 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" by (metis False additive_content_tagged_division [OF ptag] nonzero_mult_divide_mult_cancel_right order_refl times_divide_eq_left) @@ -6150,7 +6051,7 @@ using that s xK f_le p'(3) by fastforce qed qed - moreover have "0 \ i - integral (cbox a b) (f r)" "i - integral (cbox a b) (f r) < e / 4" + moreover have "0 \ i - integral (cbox a b) (f r)" "i - integral (cbox a b) (f r) < e/4" using r by auto ultimately show "\(\(x,K)\\. integral K (f (m x))) - i\ < e/4" using comb i'[of s] by auto @@ -6365,7 +6266,7 @@ and le_g: "\x\S. norm (f x) \ g x" shows "norm (integral S f) \ integral S g" proof - - have norm: "norm \ < y + e" + have norm: "norm \ \ y + e" if "norm \ \ x" and "\x - y\ < e/2" and "norm (\ - \) < e/2" for e x y and \ \ :: 'a proof - @@ -6374,14 +6275,14 @@ moreover have "x \ y + e/2" using that(2) by linarith ultimately show ?thesis - using that(1) le_less_trans[OF norm_triangle_sub[of \ \]] by auto + using that(1) le_less_trans[OF norm_triangle_sub[of \ \]] by (auto simp: less_imp_le) qed have lem: "norm (integral(cbox a b) f) \ integral (cbox a b) g" if f: "f integrable_on cbox a b" and g: "g integrable_on cbox a b" and nle: "\x. x \ cbox a b \ norm (f x) \ g x" for f :: "'n \ 'a" and g a b - proof (rule eps_leI) + proof (rule field_le_epsilon) fix e :: real assume "e > 0" then have e: "e/2 > 0" @@ -6404,7 +6305,7 @@ by metis have "\ fine \" "\ fine \" using fine_Int p(2) by blast+ - show "norm (integral (cbox a b) f) < integral (cbox a b) g + e" + show "norm (integral (cbox a b) f) \ integral (cbox a b) g + e" proof (rule norm) have "norm (content K *\<^sub>R f x) \ content K *\<^sub>R g x" if "(x, K) \ \" for x K proof- @@ -6426,7 +6327,7 @@ qed qed show ?thesis - proof (rule eps_leI) + proof (rule field_le_epsilon) fix e :: real assume "e > 0" then have e: "e/2 > 0" @@ -6453,7 +6354,7 @@ using ab by auto with Bg obtain w where int_gw: "(?g has_integral w) (cbox a b)" and w: "norm (w - integral S g) < e/2" by meson - show "norm (integral S f) < integral S g + e" + show "norm (integral S f) \ integral S g + e" proof (rule norm) show "norm (integral (cbox a b) ?f) \ integral (cbox a b) ?g" by (simp add: le_g lem[OF f g, of a b]) @@ -7122,7 +7023,7 @@ proof (rule dense_eq0_I, simp) fix e :: real assume "0 < e" - with \content ?CBOX > 0\ have "0 < e / content ?CBOX" + with \content ?CBOX > 0\ have "0 < e/content ?CBOX" by simp have f_int_acbd: "f integrable_on ?CBOX" by (rule integrable_continuous [OF assms]) @@ -7130,8 +7031,8 @@ assume p: "p division_of ?CBOX" then have "finite p" by blast - define e' where "e' = e / content ?CBOX" - with \0 < e\ \0 < e / content ?CBOX\ + define e' where "e' = e/content ?CBOX" + with \0 < e\ \0 < e/content ?CBOX\ have "0 < e'" by simp interpret operative conj True @@ -7189,7 +7090,7 @@ \ e * content (cbox (u,w) (v,z)) / content ?CBOX / 2" apply (simp only: integral_diff [symmetric] f_int_uwvz integrable_const) apply (rule order_trans [OF integrable_bound [of "e/content ?CBOX / 2"]]) - using cbp \0 < e / content ?CBOX\ nf' + using cbp \0 < e/content ?CBOX\ nf' apply (auto simp: integrable_diff f_int_uwvz integrable_const) done have int_integrable: "(\x. integral (cbox w z) (\y. f (x, y))) integrable_on cbox u v" @@ -7200,14 +7101,14 @@ \ e * content (cbox w z) / content (cbox (a, c) (b, d)) / 2" apply (simp only: integral_diff [symmetric] f_int_uv integrable_const) apply (rule order_trans [OF integrable_bound [of "e/content ?CBOX / 2"]]) - using cbp \0 < e / content ?CBOX\ nf' + using cbp \0 < e/content ?CBOX\ nf' apply (auto simp: integrable_diff f_int_uv integrable_const) done have "norm (integral (cbox u v) (\x. integral (cbox w z) (\y. f (x,y)) - integral (cbox w z) (\y. f (t1,t2)))) \ e * content (cbox w z) / content ?CBOX / 2 * content (cbox u v)" apply (rule integrable_bound [OF _ _ normint_wz]) - using cbp \0 < e / content ?CBOX\ + using cbp \0 < e/content ?CBOX\ apply (auto simp: divide_simps content_pos_le integrable_diff int_integrable integrable_const) done also have "... \ e * content (cbox (u,w) (v,z)) / content ?CBOX / 2" diff -r 5df7a346f07b -r 65b6d48fc9a9 src/HOL/Analysis/Linear_Algebra.thy --- a/src/HOL/Analysis/Linear_Algebra.thy Fri Aug 25 08:59:54 2017 +0200 +++ b/src/HOL/Analysis/Linear_Algebra.thy Fri Aug 25 13:01:13 2017 +0100 @@ -1457,10 +1457,6 @@ shows "abs (x - x') < e" using assms by linarith -lemma eps_leI: - assumes "(\e::'a::linordered_idom. 0 < e \ x < y + e)" shows "x \ y" - by (metis add_diff_eq assms diff_diff_add diff_gt_0_iff_gt linorder_not_less order_less_irrefl) - lemma sum_clauses: shows "sum f {} = 0" and "finite S \ sum f (insert x S) = (if x \ S then sum f S else f x + sum f S)"