diff -r 58bf18aaf8ec -r f8f4cf0fa42d src/HOL/Analysis/Henstock_Kurzweil_Integration.thy --- a/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy Sat Aug 12 09:19:48 2017 +0200 +++ b/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy Sat Aug 12 12:07:47 2017 +0200 @@ -577,19 +577,19 @@ then show ?thesis proof (subst has_integral_alt, clarsimp, goal_cases) case (1 e) - then have *: "e / 2 > 0" + then have *: "e/2 > 0" by auto from has_integral_altD[OF assms(1) as *] obtain B1 where B1: "0 < B1" "\a b. ball 0 B1 \ cbox a b \ - \z. ((\x. if x \ S then f x else 0) has_integral z) (cbox a b) \ norm (z - k) < e / 2" + \z. ((\x. if x \ S then f x else 0) has_integral z) (cbox a b) \ norm (z - k) < e/2" by blast from has_integral_altD[OF assms(2) as *] obtain B2 where B2: "0 < B2" "\a b. ball 0 B2 \ (cbox a b) \ - \z. ((\x. if x \ S then g x else 0) has_integral z) (cbox a b) \ norm (z - l) < e / 2" + \z. ((\x. if x \ S then g x else 0) has_integral z) (cbox a b) \ norm (z - l) < e/2" by blast show ?case proof (rule_tac x="max B1 B2" in exI, clarsimp simp add: max.strict_coboundedI1 B1) @@ -599,11 +599,11 @@ by auto obtain w where w: "((\x. if x \ S then f x else 0) has_integral w) (cbox a b)" - "norm (w - k) < e / 2" + "norm (w - k) < e/2" using B1(2)[OF *(1)] by blast obtain z where z: "((\x. if x \ S then g x else 0) has_integral z) (cbox a b)" - "norm (z - l) < e / 2" + "norm (z - l) < e/2" using B2(2)[OF *(2)] by blast have *: "\x. (if x \ S then f x + g x else 0) = (if x \ S then f x else 0) + (if x \ S then g x else 0)" @@ -937,7 +937,7 @@ have "e/2 > 0" using that by auto with y obtain \ where "gauge \" and \: "\p. p tagged_division_of cbox a b \ \ fine p \ - norm ((\(x,K)\p. content K *\<^sub>R f x) - y) < e / 2" + norm ((\(x,K)\p. content K *\<^sub>R f x) - y) < e/2" by meson show ?thesis apply (rule_tac x=\ in exI, clarsimp simp: \gauge \\) @@ -990,9 +990,9 @@ fix e :: real assume "e>0" then have e2: "e/2 > 0" by auto - then obtain N1::nat where N1: "N1 \ 0" "inverse (real N1) < e / 2" + then obtain N1::nat where N1: "N1 \ 0" "inverse (real N1) < e/2" using real_arch_inverse by blast - obtain N2::nat where N2: "\n. n \ N2 \ norm ((\(x,K) \ p n. content K *\<^sub>R f x) - y) < e / 2" + obtain N2::nat where N2: "\n. n \ N2 \ norm ((\(x,K) \ p n. content K *\<^sub>R f x) - y) < e/2" using y[OF e2] by metis show "\\. gauge \ \ (\p. p tagged_division_of (cbox a b) \ \ fine p \ @@ -1008,7 +1008,7 @@ by (rule \; simp add: dp p that) also have "... < e/2" using N1 \0 < e\ by (auto simp: field_simps intro: less_le_trans) - finally show "norm ((\(x,K) \ p (N1+N2). content K *\<^sub>R f x) - (\(x,K) \ q. content K *\<^sub>R f x)) < e / 2" . + finally show "norm ((\(x,K) \ p (N1+N2). content K *\<^sub>R f x) - (\(x,K) \ q. content K *\<^sub>R f x)) < e/2" . show "norm ((\(x,K) \ p (N1+N2). content K *\<^sub>R f x) - y) < e/2" using N2 le_add_same_cancel2 by blast qed @@ -1062,14 +1062,14 @@ obtain \1 where \1: "gauge \1" and \1norm: "\p. \p tagged_division_of cbox a b \ {x. x \ k \ c}; \1 fine p\ - \ norm ((\(x,K) \ p. content K *\<^sub>R f x) - i) < e / 2" + \ norm ((\(x,K) \ p. content K *\<^sub>R f x) - i) < e/2" apply (rule has_integralD[OF fi[unfolded interval_split[OF k]] e]) apply (simp add: interval_split[symmetric] k) done obtain \2 where \2: "gauge \2" and \2norm: "\p. \p tagged_division_of cbox a b \ {x. c \ x \ k}; \2 fine p\ - \ norm ((\(x, k) \ p. content k *\<^sub>R f x) - j) < e / 2" + \ norm ((\(x, k) \ p. content k *\<^sub>R f x) - j) < e/2" apply (rule has_integralD[OF fj[unfolded interval_split[OF k]] e]) apply (simp add: interval_split[symmetric] k) done @@ -2635,7 +2635,7 @@ { assume "\e>0. ?P (e * content (cbox a b)) op \" then show "?P e op <" - apply (erule_tac x="e / 2 / content (cbox a b)" in allE) + apply (erule_tac x="e/2 / content (cbox a b)" in allE) apply (erule impE) defer apply (erule exE,rule_tac x=d in exI) @@ -3624,7 +3624,7 @@ from this [unfolded bgauge_existence_lemma] obtain d where d: "\x. 0 < d x" "\x y. \x \ box a b; norm (y-x) < d x\ - \ norm (f y - f x - (y-x) *\<^sub>R f' x) \ e / 2 * norm (y-x)" + \ norm (f y - f x - (y-x) *\<^sub>R f' x) \ e/2 * norm (y-x)" by metis have "bounded (f ` cbox a b)" apply (rule compact_imp_bounded compact_continuous_image)+ @@ -3766,7 +3766,7 @@ then have "x \ box a b" using p(2) p(3) \x \ a\ \x \ b\ xk by fastforce with d have *: "\y. norm (y-x) < d x - \ norm (f y - f x - (y-x) *\<^sub>R f' x) \ e / 2 * norm (y-x)" + \ norm (f y - f x - (y-x) *\<^sub>R f' x) \ e/2 * norm (y-x)" by metis have xd: "norm (u - x) < d x" "norm (v - x) < d x" using fineD[OF fine xk] \x \ a\ \x \ b\ uv @@ -3774,9 +3774,9 @@ have "norm ((v - u) *\<^sub>R f' (x) - (f (v) - f (u))) = norm ((f (u) - f (x) - (u - x) *\<^sub>R f' (x)) - (f (v) - f (x) - (v - x) *\<^sub>R f' (x)))" by (rule arg_cong[where f=norm]) (auto simp: scaleR_left.diff) - also have "\ \ e / 2 * norm (u - x) + e / 2 * norm (v - x)" + also have "\ \ e/2 * norm (u - x) + e/2 * norm (v - x)" by (metis norm_triangle_le_sub add_mono * xd) - also have "\ \ e / 2 * norm (v - u)" + also have "\ \ e/2 * norm (v - u)" using p(2)[OF xk] by (auto simp add: field_simps k) also have "\ < norm ((v - u) *\<^sub>R f' x - (f v - f u))" using result by (simp add: \u \ v\) @@ -6081,7 +6081,7 @@ proof (safe, goal_cases) case e: (1 e) then have "\k. (\d. gauge d \ (\p. p tagged_division_of (cbox a b) \ d fine p \ - norm ((\(x, ka)\p. content ka *\<^sub>R f k x) - integral (cbox a b) (f k)) < e / 2 ^ (k + 2)))" + norm ((\(x, ka)\p. content ka *\<^sub>R f k x) - integral (cbox a b) (f k)) < e/2 ^ (k + 2)))" apply - apply rule apply (rule assms(1)[unfolded has_integral_integral has_integral,rule_format]) @@ -6134,7 +6134,7 @@ have "\a. \x\p. m (fst x) \ a" by (metis finite_imageI finite_nat_set_iff_bounded_le p'(1) rev_image_eqI) then guess s..note s=this - have *: "\a b c d. norm(a - b) \ e / 4 \ norm(b - c) < e / 2 \ + have *: "\a b c d. norm(a - b) \ e / 4 \ norm(b - c) < e/2 \ norm (c - d) < e / 4 \ norm (a - d) < e" proof (safe, goal_cases) case (1 a b c d) @@ -6187,11 +6187,11 @@ apply rule proof - show "norm (\j = 0..s. \(x, k)\{xk \ p. - m (fst xk) = j}. content k *\<^sub>R f (m x) x - integral k (f (m x))) < e / 2" - apply (rule le_less_trans[of _ "sum (\i. e / 2^(i+2)) {0..s}"]) + m (fst xk) = j}. content k *\<^sub>R f (m x) x - integral k (f (m x))) < e/2" + apply (rule le_less_trans[of _ "sum (\i. e/2^(i+2)) {0..s}"]) apply (rule sum_norm_le) proof - - show "(\i = 0..s. e / 2 ^ (i + 2)) < e / 2" + show "(\i = 0..s. e/2 ^ (i + 2)) < e/2" unfolding power_add divide_inverse inverse_mult_distrib unfolding sum_distrib_left[symmetric] sum_distrib_right[symmetric] unfolding power_inverse [symmetric] sum_gp @@ -6202,7 +6202,7 @@ fix t assume "t \ {0..s}" show "norm (\(x, k)\{xk \ p. m (fst xk) = t}. content k *\<^sub>R f (m x) x - - integral k (f (m x))) \ e / 2 ^ (t + 2)" + integral k (f (m x))) \ e/2 ^ (t + 2)" apply (rule order_trans [of _ "norm (sum (\(x,k). content k *\<^sub>R f t x - integral k (f t)) {xk \ p. m (fst xk) = t})"]) apply (rule eq_refl) @@ -6433,7 +6433,7 @@ apply (subst norm_minus_commute) apply auto done - have *: "\f1 f2 g. \f1 - i\ < e / 2 \ \f2 - g\ < e / 2 \ + have *: "\f1 f2 g. \f1 - i\ < e/2 \ \f2 - g\ < e/2 \ f1 \ f2 \ f2 \ i \ \g - i\ < e" unfolding real_inner_1_right by arith show "norm (integral (cbox a b) (\x. if x \ s then g x else 0) - i) < e" @@ -6601,25 +6601,22 @@ lemma integral_norm_bound_integral: fixes f :: "'n::euclidean_space \ 'a::banach" - assumes "f integrable_on s" - and "g integrable_on s" - and "\x\s. norm (f x) \ g x" - shows "norm (integral s f) \ integral s g" + assumes int_f: "f integrable_on S" + and int_g: "g integrable_on S" + and le_g: "\x\S. norm (f x) \ g x" + shows "norm (integral S f) \ integral S g" proof - - have norm: "norm ig < dia + e" - if "norm sg \ dsa" and "\dsa - dia\ < e / 2" and "norm (sg - ig) < e / 2" - for e dsa dia and sg ig :: 'a - apply (rule le_less_trans[OF norm_triangle_sub[of ig sg]]) - apply (subst real_sum_of_halves[of e,symmetric]) - unfolding add.assoc[symmetric] - apply (rule add_le_less_mono) - defer - apply (subst norm_minus_commute) - apply (rule that(3)) - apply (rule order_trans[OF that(1)]) - using that(2) - apply arith - done + have norm: "norm \ < y + e" + if "norm \ \ x" and "\x - y\ < e/2" and "norm (\ - \) < e/2" + for e x y and \ \ :: 'a + proof - + have "norm (\ - \) < e/2" + by (metis norm_minus_commute that(3)) + 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 + 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" @@ -6633,13 +6630,13 @@ with integrable_integral[OF f,unfolded has_integral[of f]] obtain \ where \: "gauge \" "\p. p tagged_division_of cbox a b \ \ fine p - \ norm ((\(x, k)\p. content k *\<^sub>R f x) - integral (cbox a b) f) < e / 2" + \ norm ((\(x, k)\p. content k *\<^sub>R f x) - integral (cbox a b) f) < e/2" by meson moreover from integrable_integral[OF g,unfolded has_integral[of g]] e obtain \ where \: "gauge \" "\p. p tagged_division_of cbox a b \ \ fine p - \ norm ((\(x, k)\p. content k *\<^sub>R g x) - integral (cbox a b) g) < e / 2" + \ norm ((\(x, k)\p. content k *\<^sub>R g x) - integral (cbox a b) g) < e/2" by meson ultimately have "gauge (\x. \ x \ \ x)" using gauge_Int by blast @@ -6663,47 +6660,52 @@ qed then show "norm (\(x, k)\p. content k *\<^sub>R f x) \ (\(x, k)\p. content k *\<^sub>R g x)" by (simp add: sum_norm_le split_def) - show "norm ((\(x, k)\p. content k *\<^sub>R f x) - integral (cbox a b) f) < e / 2" + show "norm ((\(x, k)\p. content k *\<^sub>R f x) - integral (cbox a b) f) < e/2" using \\ fine p\ \ p(1) by simp - show "\(\(x, k)\p. content k *\<^sub>R g x) - integral (cbox a b) g\ < e / 2" + show "\(\(x, k)\p. content k *\<^sub>R g x) - integral (cbox a b) g\ < e/2" using \\ fine p\ \ p(1) by simp qed qed - - { presume "\e. 0 < e \ norm (integral s f) < integral s g + e" - then show ?thesis by (rule eps_leI) auto } - fix e :: real - assume "e > 0" - then have e: "e/2 > 0" - by auto - note assms(1)[unfolded integrable_alt[of f]] note f=this[THEN conjunct1,rule_format] - note assms(2)[unfolded integrable_alt[of g]] note g=this[THEN conjunct1,rule_format] - from integrable_integral[OF assms(1),unfolded has_integral'[of f],rule_format,OF e] - guess B1..note B1=conjunctD2[OF this[rule_format],rule_format] - from integrable_integral[OF assms(2),unfolded has_integral'[of g],rule_format,OF e] - guess B2..note B2=conjunctD2[OF this[rule_format],rule_format] - from bounded_subset_cbox[OF bounded_ball, of "0::'n" "max B1 B2"] - guess a b by (elim exE) note ab=this[unfolded ball_max_Un] - - have "ball 0 B1 \ cbox a b" - using ab by auto - from B1(2)[OF this] guess z..note z=conjunctD2[OF this] - have "ball 0 B2 \ cbox a b" - using ab by auto - from B2(2)[OF this] guess w..note w=conjunctD2[OF this] - - show "norm (integral s f) < integral s g + e" - apply (rule norm) - apply (rule lem[OF f g, of a b]) - unfolding integral_unique[OF z(1)] integral_unique[OF w(1)] - defer - apply (rule w(2)[unfolded real_norm_def]) - apply (rule z(2)) - apply (case_tac "x \ s") - unfolding if_P - apply (rule assms(3)[rule_format]) - apply auto - done + show ?thesis + proof (rule eps_leI) + fix e :: real + assume "e > 0" + then have e: "e/2 > 0" + by auto + let ?f = "(\x. if x \ S then f x else 0)" + let ?g = "(\x. if x \ S then g x else 0)" + have f: "?f integrable_on cbox a b" and g: "?g integrable_on cbox a b" + for a b + using int_f int_g integrable_altD by auto + obtain Bf where "0 < Bf" + and Bf: "\a b. ball 0 Bf \ cbox a b \ + \z. (?f has_integral z) (cbox a b) \ norm (z - integral S f) < e/2" + using integrable_integral [OF int_f,unfolded has_integral'[of f]] e that by blast + obtain Bg where "0 < Bg" + and Bg: "\a b. ball 0 Bg \ cbox a b \ + \z. (?g has_integral z) (cbox a b) \ + norm (z - integral S g) < e/2" + using integrable_integral [OF int_g,unfolded has_integral'[of g]] e that by blast + obtain a b::'n where ab: "ball 0 Bf \ ball 0 Bg \ cbox a b" + using ball_max_Un bounded_subset_cbox[OF bounded_ball, of _ "max Bf Bg"] by blast + have "ball 0 Bf \ cbox a b" + using ab by auto + with Bf obtain z where int_fz: "(?f has_integral z) (cbox a b)" and z: "norm (z - integral S f) < e/2" + by meson + have "ball 0 Bg \ cbox a b" + 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" + 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]) + show "\integral (cbox a b) ?g - integral S g\ < e/2" + using int_gw integral_unique w by auto + show "norm (integral (cbox a b) ?f - integral S f) < e/2" + using int_fz integral_unique z by blast + qed + qed qed @@ -6983,7 +6985,7 @@ proof (rule tendstoI) fix e::real assume "e > 0" - define e' where "e' = e / 2" + define e' where "e' = e/2" with \e > 0\ have "e' > 0" by simp then have "\\<^sub>F n in F. \x\cbox a b. norm (f n x - g x) < e' / content (cbox a b)" using u content_nonzero by (auto simp: uniform_limit_iff dist_norm zero_less_measure_iff) @@ -7212,7 +7214,7 @@ by (simp add: assms compact_cbox compact_uniformly_continuous) { fix x::'a and e::real assume x: "x \ cbox a b" and e: "0 < e" - then have e2_gt: "0 < e / 2 / content (cbox c d)" and e2_less: "e / 2 / content (cbox c d) * content (cbox c d) < e" + then have e2_gt: "0 < e/2 / content (cbox c d)" and e2_less: "e/2 / content (cbox c d) * content (cbox c d) < e" by (auto simp: False content_lt_nz e) then obtain dd where dd: "\x x'. \x\cbox (a, c) (b, d); x'\cbox (a, c) (b, d); norm (x' - x) < dd\ @@ -7448,7 +7450,7 @@ show "norm (integral ?CBOX f - integral (cbox a b) (\x. integral (cbox c d) (\y. f (x,y)))) \ e" using compact_uniformly_continuous [OF assms compact_cbox] apply (simp add: uniformly_continuous_on_def dist_norm) - apply (drule_tac x="e / 2 / content?CBOX" in spec) + apply (drule_tac x="e/2 / content?CBOX" in spec) using cbp \0 < e\ apply (auto simp: zero_less_mult_iff) apply (rename_tac k)