# HG changeset patch # User paulson # Date 1502100298 -7200 # Node ID d77a4ab4fe59e3704d778bfb83d55b5072fc93f9 # Parent af5c71cffec57e87fa0369f68fa2d6052ea24046 more Henstock_Kurzweil_Integration cleanup diff -r af5c71cffec5 -r d77a4ab4fe59 src/HOL/Analysis/Henstock_Kurzweil_Integration.thy --- a/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy Sun Aug 06 22:54:17 2017 +0200 +++ b/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy Mon Aug 07 12:04:58 2017 +0200 @@ -2470,53 +2470,39 @@ proof safe fix a b :: 'b show "\g. (\x\cbox a b. norm (f x - g x) \ e) \ g integrable_on cbox a b" - if "box a b = {}" + if "box a b = {}" for a b apply (rule_tac x=f in exI) - using assms that - apply (auto simp: content_eq_0_interior) - done + using assms that by (auto simp: content_eq_0_interior) { - fix c g - fix k :: 'b - assume as: "\x\cbox a b. norm (f x - g x) \ e" "g integrable_on cbox a b" + fix c g and k :: 'b + assume fg: "\x\cbox a b. norm (f x - g x) \ e" and g: "g integrable_on cbox a b" assume k: "k \ Basis" show "\g. (\x\cbox a b \ {x. x \ k \ c}. norm (f x - g x) \ e) \ g integrable_on cbox a b \ {x. x \ k \ c}" - "\g. (\x\cbox a b \ {x. c \ x \ k}. norm (f x - g x) \ e) \ g integrable_on cbox a b \ {x. c \ x \ k}" - apply (rule_tac[!] x=g in exI) - using as(1) integrable_split[OF as(2) k] - apply auto - done + "\g. (\x\cbox a b \ {x. c \ x \ k}. norm (f x - g x) \ e) \ g integrable_on cbox a b \ {x. c \ x \ k}" + apply (rule_tac[!] x=g in exI) + using fg integrable_split[OF g k] by auto } - fix c k g1 g2 - assume as: "\x\cbox a b \ {x. x \ k \ c}. norm (f x - g1 x) \ e" "g1 integrable_on cbox a b \ {x. x \ k \ c}" - "\x\cbox a b \ {x. c \ x \ k}. norm (f x - g2 x) \ e" "g2 integrable_on cbox a b \ {x. c \ x \ k}" - assume k: "k \ Basis" - let ?g = "\x. if x\k = c then f x else if x\k \ c then g1 x else g2 x" show "\g. (\x\cbox a b. norm (f x - g x) \ e) \ g integrable_on cbox a b" - apply (rule_tac x="?g" in exI) - apply safe - proof goal_cases - case (1 x) - then show ?case - apply - - apply (cases "x\k=c") - apply (case_tac "x\k < c") - using as assms - apply auto - done - next - case 2 - presume "?g integrable_on cbox a b \ {x. x \ k \ c}" - and "?g integrable_on cbox a b \ {x. x \ k \ c}" - then guess h1 h2 unfolding integrable_on_def by auto - from has_integral_split[OF this k] show ?case - unfolding integrable_on_def by auto - next - show "?g integrable_on cbox a b \ {x. x \ k \ c}" "?g integrable_on cbox a b \ {x. x \ k \ c}" - apply(rule_tac[!] integrable_spike[OF negligible_standard_hyperplane[of k c]]) - using k as(2,4) - apply auto - done + if fg1: "\x\cbox a b \ {x. x \ k \ c}. norm (f x - g1 x) \ e" + and g1: "g1 integrable_on cbox a b \ {x. x \ k \ c}" + and fg2: "\x\cbox a b \ {x. c \ x \ k}. norm (f x - g2 x) \ e" + and g2: "g2 integrable_on cbox a b \ {x. c \ x \ k}" + and k: "k \ Basis" + for c k g1 g2 + proof - + let ?g = "\x. if x\k = c then f x else if x\k \ c then g1 x else g2 x" + show "\g. (\x\cbox a b. norm (f x - g x) \ e) \ g integrable_on cbox a b" + proof (intro exI conjI ballI) + show "norm (f x - ?g x) \ e" if "x \ cbox a b" for x + by (auto simp: that assms fg1 fg2) + show "?g integrable_on cbox a b" + proof - + have "?g integrable_on cbox a b \ {x. x \ k \ c}" "?g integrable_on cbox a b \ {x. x \ k \ c}" + by(rule integrable_spike[OF negligible_standard_hyperplane[of k c]], use k g1 g2 in auto)+ + with has_integral_split[OF _ _ k] show ?thesis + unfolding integrable_on_def by blast + qed + qed qed qed @@ -2531,18 +2517,16 @@ lemma approximable_on_division: fixes f :: "'b::euclidean_space \ 'a::banach" assumes "0 \ e" - and "d division_of (cbox a b)" - and "\i\d. \g. (\x\i. norm (f x - g x) \ e) \ g integrable_on i" + and d: "d division_of (cbox a b)" + and f: "\i\d. \g. (\x\i. norm (f x - g x) \ e) \ g integrable_on i" obtains g where "\x\cbox a b. norm (f x - g x) \ e" "g integrable_on cbox a b" proof - - note * = comm_monoid_set.operative_division[OF comm_monoid_set_and operative_approximable[OF assms(1)] assms(2)] - from assms(3) this[unfolded comm_monoid_set_F_and, of f] division_of_finite[OF assms(2)] - guess g by auto - then show thesis - apply - - apply (rule that[of g]) - apply auto - done + note * = comm_monoid_set.operative_division + [OF comm_monoid_set_and operative_approximable[OF \0 \ e\] d] + have "finite d" + by (rule division_of_finite[OF d]) + with f *[unfolded comm_monoid_set_F_and, of f] that show thesis + by auto qed lemma integrable_continuous: @@ -3608,8 +3592,8 @@ lemma fundamental_theorem_of_calculus_interior: fixes f :: "real \ 'a::real_normed_vector" assumes "a \ b" - and "continuous_on {a .. b} f" - and "\x\{a <..< b}. (f has_vector_derivative f'(x)) (at x)" + and contf: "continuous_on {a .. b} f" + and derf: "\x. x \ {a <..< b} \ (f has_vector_derivative f'(x)) (at x)" shows "(f' has_integral (f b - f a)) {a .. b}" proof - { @@ -3637,22 +3621,22 @@ { presume "\e. e > 0 \ ?P e" then show ?thesis unfolding has_integral_factor_content_real by auto } fix e :: real assume e: "e > 0" - note assms(3)[unfolded has_vector_derivative_def has_derivative_at_alt ball_conj_distrib] - note conjunctD2[OF this] - note bounded=this(1) and this(2) - from this(2) have "\x\box a b. \d>0. \y. norm (y - x) < d \ - norm (f y - f x - (y - x) *\<^sub>R f' x) \ e/2 * norm (y - x)" - apply - - apply safe - apply (erule_tac x=x in ballE) - apply (erule_tac x="e/2" in allE) - using e - apply auto - done - note this[unfolded bgauge_existence_lemma] - from choice[OF this] guess d .. - note conjunctD2[OF this[rule_format]] - note d = this[rule_format] + note derf_exp = derf[unfolded has_vector_derivative_def has_derivative_at_alt] + have bounded: "\x. x \ {a<.. bounded_linear (\u. u *\<^sub>R f' x)" + using derf_exp by simp + have "\x \ box a b. \d>0. \y. norm (y - x) < d \ norm (f y - f x - (y - x) *\<^sub>R f' x) \ e/2 * norm (y - x)" + (is "\x \ box a b. ?Q x") + proof + fix x assume x: "x \ box a b" + show "?Q x" + apply (rule allE [where x="e/2", OF derf_exp [THEN conjunct2, of x]]) + using x e by auto + qed + 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)" + by metis have "bounded (f ` cbox a b)" apply (rule compact_imp_bounded compact_continuous_image)+ using compact_cbox assms @@ -3683,7 +3667,7 @@ apply (auto simp add: field_simps) done qed - then guess l .. note l = conjunctD2[OF this] + then obtain l where l: "0 < l" "norm (l *\<^sub>R f' a) \ e * (b - a) / 8" by metis show ?thesis apply (rule_tac x="min k l" in exI) apply safe @@ -3698,24 +3682,28 @@ by (rule norm_triangle_ineq4) also have "\ \ e * (b - a) / 8 + e * (b - a) / 8" proof (rule add_mono) - have "\c - a\ \ \l\" - using as' by auto - then show "norm ((c - a) *\<^sub>R f' a) \ e * (b - a) / 8" - apply - - apply (rule order_trans[OF _ l(2)]) + have "norm ((c - a) *\<^sub>R f' a) \ norm (l *\<^sub>R f' a)" unfolding norm_scaleR apply (rule mult_right_mono) - apply auto - done + using as' by auto + also have "... \ e * (b - a) / 8" + by (rule l) + finally show "norm ((c - a) *\<^sub>R f' a) \ e * (b - a) / 8" . next - show "norm (f c - f a) \ e * (b - a) / 8" - apply (rule less_imp_le) - apply (cases "a = c") - defer - apply (rule k(2)[unfolded dist_norm]) - using as' e ab - apply (auto simp add: field_simps) - done + have "norm (f c - f a) < e * (b - a) / 8" + proof (cases "a = c") + case True + then show ?thesis + using \0 < e * (b - a) / 8\ by auto + next + case False + show ?thesis + apply (rule k(2)[unfolded dist_norm]) + using as' False + apply (auto simp add: field_simps) + done + qed + then show "norm (f c - f a) \ e * (b - a) / 8" by simp qed finally show "norm (content {a .. c} *\<^sub>R f' a - (f c - f a)) \ e * (b - a) / 4" unfolding content_real[OF as(1)] by auto @@ -3804,7 +3792,7 @@ note p = tagged_division_ofD[OF as(1)] have pA: "p = (p \ ?A) \ (p - ?A)" "finite (p \ ?A)" "finite (p - ?A)" "(p \ ?A) \ (p - ?A) = {}" using as by auto - note * = additive_tagged_division_1'[OF assms(1) as(1), symmetric] + note * = additive_tagged_division_1[OF assms(1) as(1), symmetric] have **: "\n1 s1 n2 s2::real. n2 \ s2 / 2 \ n1 - s1 \ s2 / 2 \ n1 + n2 \ s1 + s2" by arith show ?case @@ -3964,7 +3952,8 @@ qed have pb: "\v. k = cbox v b \ b \ v" if "(b, k) \ p" for k proof - - guess u v using p(4)[OF that] by (elim exE) note uv=this + obtain u v where uv: "k = cbox u v" + using \(b, k) \ p\ p(4) by blast have *: "u \ v" using p(2)[OF that] unfolding uv by auto have u: "v = b" diff -r af5c71cffec5 -r d77a4ab4fe59 src/HOL/Analysis/Tagged_Division.thy --- a/src/HOL/Analysis/Tagged_Division.thy Sun Aug 06 22:54:17 2017 +0200 +++ b/src/HOL/Analysis/Tagged_Division.thy Mon Aug 07 12:04:58 2017 +0200 @@ -1836,15 +1836,6 @@ lemma bgauge_existence_lemma: "(\x\s. \d::real. 0 < d \ q d x) \ (\x. \d>0. x\s \ q d x)" by (meson zero_less_one) -lemma additive_tagged_division_1': - fixes f :: "real \ 'a::real_normed_vector" - assumes "a \ b" - and "p tagged_division_of {a..b}" - shows "sum (\(x,k). f (Sup k) - f(Inf k)) p = f b - f a" - using additive_tagged_division_1[OF _ assms(2), of f] - using assms(1) - by auto - subsection \Fine-ness of a partition w.r.t. a gauge.\ definition fine (infixr "fine" 46)