# HG changeset patch # User paulson # Date 1502366889 -7200 # Node ID abb7f0a71e74563302c400404d082fae88165c7e # Parent 8e614c2230007d4abbf9aae727b5836e623f0899 even more horrible proofs disentangled diff -r 8e614c223000 -r abb7f0a71e74 src/HOL/Analysis/Henstock_Kurzweil_Integration.thy --- a/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy Wed Aug 09 23:41:47 2017 +0200 +++ b/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy Thu Aug 10 14:08:09 2017 +0200 @@ -3749,20 +3749,20 @@ using ab \db > 0\ \da > 0\ d(1) by (auto intro: gauge_ball_dependent) next fix p - assume as: "p tagged_division_of {a..b}" "?d fine p" + assume ptag: "p tagged_division_of {a..b}" and fine: "?d fine p" let ?A = "{t. fst t \ {a, b}}" - note p = tagged_division_ofD[OF as(1)] + note p = tagged_division_ofD[OF ptag] 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] + using ptag fine by auto + note * = additive_tagged_division_1[OF assms(1) ptag, symmetric] have **: "\n1 s1 n2 s2::real. n2 \ s2 / 2 \ n1 - s1 \ s2 / 2 \ n1 + n2 \ s1 + s2" by arith - have XX: False if xk: "(x,k) \ p" - and less: "e * (Sup k - Inf k) / 2 < norm (content k *\<^sub>R f' x - (f (Sup k) - f (Inf k)))" + have XX: False if xk: "(x,K) \ p" + and less: "e * (Sup K - Inf K) / 2 < norm (content K *\<^sub>R f' x - (f (Sup K) - f (Inf K)))" and "x \ a" "x \ b" - for x k + for x K proof - - obtain u v where k: "k = cbox u v" + obtain u v where k: "K = cbox u v" using p(4) xk by blast then have "u \ v" and uv: "{u, v} \ cbox u v" using p(2)[OF xk] by auto @@ -3774,7 +3774,7 @@ \ 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 as(2) xk] \x \ a\ \x \ b\ uv + using fineD[OF fine xk] \x \ a\ \x \ b\ uv by (auto simp add: k subset_eq dist_commute dist_real_def) have "norm ((v - u) *\<^sub>R f' (x) - (f (v) - f (u))) = norm ((f (u) - f (x) - (u - x) *\<^sub>R f' (x)) - (f (v) - f (x) - (v - x) *\<^sub>R f' (x)))" @@ -3789,8 +3789,8 @@ using uv by auto then show False by auto qed - have "norm (\(x, k)\p - ?A. content k *\<^sub>R f' x - (f (Sup k) - f (Inf k))) - \ (\(x, k)\p - ?A. norm (content k *\<^sub>R f' x - (f (Sup k) - f (Inf k))))" + have "norm (\(x, K)\p - ?A. content K *\<^sub>R f' x - (f (Sup K) - f (Inf K))) + \ (\(x, K)\p - ?A. norm (content K *\<^sub>R f' x - (f (Sup K) - f (Inf K))))" by (auto intro: sum_norm_le) also have "... \ (\n\p - ?A. e * (case n of (x, k) \ Sup k - Inf k) / 2)" using XX by (force intro: sum_mono) @@ -3811,31 +3811,30 @@ then show "0 \ e * ((Sup k) - (Inf k))" unfolding uv using e by (auto simp add: field_simps) qed - have norm_le: "norm (\(x, k)\p \ {t. fst t \ {a, b}}. content k *\<^sub>R f' x - (f (Sup k) - f (Inf k))) \ e * (b-a) / 2" + let ?B = "\x. {t \ p. fst t = x \ content (snd t) \ 0}" + let ?C = "{t \ p. fst t \ {a, b} \ content (snd t) \ 0}" + have "norm (\(x, k)\p \ {t. fst t \ {a, b}}. content k *\<^sub>R f' x - (f (Sup k) - f (Inf k))) \ e * (b-a) / 2" proof - - have *: "\s f t e. sum f s = sum f t \ norm (sum f t) \ e \ norm (sum f s) \ e" + have *: "\s f e. sum f s = sum f (p \ ?C) \ norm (sum f (p \ ?C)) \ e \ norm (sum f s) \ e" by auto - - show "norm (\(x, k)\p \ ?A. content k *\<^sub>R f' x - - (f ((Sup k)) - f ((Inf k)))) \ e * (b - a) / 2" - apply (rule *[where t1="p \ {t. fst t \ {a, b} \ content(snd t) \ 0}"]) - apply (rule sum.mono_neutral_right[OF pA(2)]) - defer - apply rule - unfolding split_paired_all split_conv o_def - proof goal_cases - fix x k - assume "(x, k) \ p \ {t. fst t \ {a, b}} - p \ {t. fst t \ {a, b} \ content (snd t) \ 0}" - then have xk: "(x, k) \ p" and k0: "content k = 0" - by auto - then obtain u v where uv: "k = cbox u v" + have 1: "content K *\<^sub>R (f' (x)) - (f ((Sup K)) - f ((Inf K))) = 0" + if "(x,K) \ p \ {t. fst t \ {a, b}} - p \ ?C" for x K + proof - + have xk: "(x, K) \ p" and k0: "content K = 0" + using that by auto + then obtain u v where uv: "K = cbox u v" using p(4) by blast then have "u = v" using xk k0 p(2) by force - then show "content k *\<^sub>R (f' (x)) - (f ((Sup k)) - f ((Inf k))) = 0" + then show "content K *\<^sub>R (f' (x)) - (f ((Sup K)) - f ((Inf K))) = 0" using xk unfolding uv by auto - next + qed + have 2: "norm(\(x,k)\p \ ?C. content k *\<^sub>R f' x - (f (Sup k) - f (Inf k))) + \ e * (b - a) / 2" + proof - + have *: "p \ ?C = ?B a \ ?B b" + by blast have **: "norm (sum f s) \ e" if "\x y. x \ s \ y \ s \ x = y" "\x. x \ s \ norm (f x) \ e" "e > 0" for s f and e :: real @@ -3851,16 +3850,13 @@ then show ?thesis using \x \ s\ that(2) by auto qed - case 2 - let ?B = "\x. {t \ p. fst t = x \ content (snd t) \ 0}" - have *: "p \ {t. fst t \ {a, b} \ content(snd t) \ 0} = ?B a \ ?B b" - by blast - show ?case + show "norm (\(x,k)\p \ ?C. + content k *\<^sub>R f' x - (f (Sup k) - f (Inf k))) \ e * (b - a) / 2" apply (subst *) apply (subst sum.union_disjoint) - prefer 4 - apply (rule order_trans[of _ "e * (b - a)/4 + e * (b - a)/4"]) - apply (rule norm_triangle_le,rule add_mono) + prefer 4 + apply (rule order_trans[of _ "e * (b - a)/4 + e * (b - a)/4"]) + apply (rule norm_triangle_le,rule add_mono) apply (rule_tac[1-2] **) proof - @@ -3913,25 +3909,25 @@ show "\x y. x \ ?B b \ y \ ?B b \ x = y" proof (safe; clarsimp) - fix x k k' - assume k: "(b, k) \ p" "(b, k') \ p" "content k \ 0" "content k' \ 0" - obtain v where v: "k = cbox v b" "v \ b" + fix x K K' + assume k: "(b, K) \ p" "(b, K') \ p" "content K \ 0" "content K' \ 0" + obtain v where v: "K = cbox v b" "v \ b" using pb[OF k(1)] by blast - obtain v' where v': "k' = cbox v' b" "v' \ b" + obtain v' where v': "K' = cbox v' b" "v' \ b" using pb[OF k(2)] by blast let ?v = "max v v'" - have "box ?v b \ k \ k'" + have "box ?v b \ K \ K'" unfolding v v' by (auto simp: mem_box) - then have "interior (box (max v v') b) \ interior k \ interior k'" + then have "interior (box (max v v') b) \ interior K \ interior K'" using interior_Int interior_mono by blast moreover have " ((b + ?v)/2) \ box ?v b" using k(3-) unfolding v v' content_eq_0 not_le by (auto simp: mem_box) - ultimately have " ((b + ?v)/2) \ interior k \ interior k'" + ultimately have " ((b + ?v)/2) \ interior K \ interior K'" unfolding interior_open[OF open_box] by auto - then have eq: "k = k'" + then have eq: "K = K'" using p(5)[OF k(1-2)] by auto - { assume "x \ k" then show "x \ k'" unfolding eq . } - { assume "x \ k'" then show "x\k" unfolding eq . } + { assume "x \ K" then show "x \ K'" unfolding eq . } + { assume "x \ K'" then show "x \ K" unfolding eq . } qed have "norm (content c *\<^sub>R f' a - (f (Sup c) - f (Inf c))) \ e * (b - a) / 4" @@ -3968,21 +3964,24 @@ \ e * (b - a) / 4" by auto qed (insert p(1) ab e, auto simp add: field_simps) - qed auto - - + qed + show "norm (\(x, k)\p \ ?A. content k *\<^sub>R f' x - (f ((Sup k)) - f ((Inf k)))) \ e * (b - a) / 2" + apply (rule * [OF sum.mono_neutral_right[OF pA(2)]]) + using 1 2 by (auto simp: split_paired_all) qed + also have "... = (\n\p. e * (case n of (x, k) \ Sup k - Inf k)) / 2" + unfolding sum_distrib_left[symmetric] + apply (subst additive_tagged_division_1[OF \a \ b\ ptag]) + by auto + finally have norm_le: "norm (\(x, k)\p \ {t. fst t \ {a, b}}. content k *\<^sub>R f' x - (f (Sup k) - f (Inf k))) + \ (\n\p. e * (case n of (x, k) \ Sup k - Inf k)) / 2" . have *: "\x s1 s2::real. 0 \ s1 \ x \ (s1 + s2) / 2 \ x - s1 \ s2 / 2" by auto show ?thesis apply (rule * [OF sum_nonneg]) using ge0 apply force - unfolding sum.union_disjoint[OF pA(2-),symmetric] pA(1)[symmetric] - unfolding sum_distrib_left[symmetric] - apply (subst additive_tagged_division_1[OF _ as(1)]) - apply (rule assms) - apply (rule norm_le) - done + unfolding sum.union_disjoint[OF pA(2-), symmetric] pA(1)[symmetric] + by (metis norm_le) qed show "norm ((\(x, k)\p. content k *\<^sub>R f' x) - (f b - f a)) \ e * content {a..b}" unfolding content_real[OF assms(1)] and *[of "\x. x"] *[of f] sum_subtractf[symmetric] split_minus @@ -3990,8 +3989,7 @@ apply (subst(2) pA) apply (subst pA) unfolding sum.union_disjoint[OF pA(2-)] - using ** norm_triangle_le 1 2 - by blast + using ** norm_triangle_le 1 2 by blast qed qed