# HG changeset patch # User paulson # Date 1503847044 -3600 # Node ID 0d8dab1f6903b4c59c4ef71577e880796885fab4 # Parent 5a1a2ac950c285125204fb38d354e87e4eedb6aa some tidying of division_of_nontrivial diff -r 5a1a2ac950c2 -r 0d8dab1f6903 src/HOL/Analysis/Henstock_Kurzweil_Integration.thy --- a/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy Sun Aug 27 13:50:23 2017 +0100 +++ b/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy Sun Aug 27 16:17:24 2017 +0100 @@ -2867,57 +2867,52 @@ subsection \Only need trivial subintervals if the interval itself is trivial.\ -lemma division_of_nontrivial: - fixes s :: "'a::euclidean_space set set" - assumes s: "s division_of (cbox a b)" - and "content (cbox a b) \ 0" - shows "{k. k \ s \ content k \ 0} division_of (cbox a b)" - using s -proof (induction "card s" arbitrary: s rule: less_induct) +proposition division_of_nontrivial: + fixes \ :: "'a::euclidean_space set set" + assumes sdiv: "\ division_of (cbox a b)" + and cont0: "content (cbox a b) \ 0" + shows "{k. k \ \ \ content k \ 0} division_of (cbox a b)" + using sdiv +proof (induction "card \" arbitrary: \ rule: less_induct) case less - note s = division_ofD[OF less.prems] + note \ = division_ofD[OF less.prems] { - presume *: "{k \ s. content k \ 0} \ s \ ?case" + presume *: "{k \ \. content k \ 0} \ \ \ ?case" then show ?case using less.prems by fastforce } - assume noteq: "{k \ s. content k \ 0} \ s" - then obtain k c d where "k \ s" and contk: "content k = 0" and keq: "k = cbox c d" - using s(4) by blast - then have "card s > 0" + assume noteq: "{k \ \. content k \ 0} \ \" + then obtain K c d where "K \ \" and contk: "content K = 0" and keq: "K = cbox c d" + using \(4) by blast + then have "card \ > 0" unfolding card_gt_0_iff using less by auto - then have card: "card (s - {k}) < card s" - using less \k \ s\ by (simp add: s(1)) - have closed: "closed (\(s - {k}))" + then have card: "card (\ - {K}) < card \" + using less \K \ \\ by (simp add: \(1)) + have closed: "closed (\(\ - {K}))" using less.prems by auto - have "k \ \(s - {k})" - apply safe - apply (rule closed[unfolded closed_limpt,rule_format]) + have "x islimpt \(\ - {K})" if "x \ K" for x unfolding islimpt_approachable - proof safe - fix x and e :: real - assume "x \ k" "e > 0" + proof (intro allI impI) + fix e::real + assume "e > 0" obtain i where i: "c\i = d\i" "i\Basis" - using contk s(3) [OF \k \ s\] unfolding box_ne_empty keq + using contk \(3) [OF \K \ \\] unfolding box_ne_empty keq by (meson content_eq_0 dual_order.antisym) then have xi: "x\i = d\i" - using \x \ k\ unfolding keq mem_box by (metis antisym) + using \x \ K\ unfolding keq mem_box by (metis antisym) define y where "y = (\j\Basis. (if j = i then if c\i \ (a\i + b\i) / 2 then c\i + min e (b\i - c\i) / 2 else c\i - min e (c\i - a\i) / 2 else x\j) *\<^sub>R j)" - show "\x'\\(s - {k}). x' \ x \ dist x' x < e" - apply (rule_tac x=y in bexI) - proof + show "\x'\\(\ - {K}). x' \ x \ dist x' x < e" + proof (intro bexI conjI) have "d \ cbox c d" - using s(3)[OF \k \ s\] by (simp add: box_ne_empty(1) keq mem_box(2)) + using \(3)[OF \K \ \\] by (simp add: box_ne_empty(1) keq mem_box(2)) then have "d \ cbox a b" - using s(2)[OF \k \ s\] - unfolding keq - by auto - note di = this[unfolded mem_box,THEN bspec[where x=i]] + using \(2)[OF \K \ \\] by (auto simp: keq) + then have di: "a \ i \ d \ i \ d \ i \ b \ i" + using \i \ Basis\ mem_box(2) by blast then have xyi: "y\i \ x\i" - unfolding y_def i xi - using \e > 0\ assms(2)[unfolded content_eq_0] i(2) - by (auto elim!: ballE[of _ _ i]) + unfolding y_def i xi using \e > 0\ cont0 \i \ Basis\ + by (auto simp: content_eq_0 elim!: ballE[of _ _ i]) then show "y \ x" unfolding euclidean_eq_iff[where 'a='a] using i by auto have "norm (y-x) \ (\b\Basis. \(y - x) \ b\)" @@ -2934,25 +2929,23 @@ finally have "norm (y-x) < e + sum (\i. 0) Basis" . then show "dist y x < e" unfolding dist_norm by auto - have "y \ k" + have "y \ K" unfolding keq mem_box using i(1) i(2) xi xyi by fastforce - moreover - have "y \ \s" - using subsetD[OF s(2)[OF \k \ s\] \x \ k\] \e > 0\ di i - unfolding s mem_box y_def - by (auto simp: field_simps elim!: ballE[of _ _ i]) - ultimately - show "y \ \(s - {k})" by auto + moreover have "y \ \\" + using subsetD[OF \(2)[OF \K \ \\] \x \ K\] \e > 0\ di i + by (auto simp: \ mem_box y_def field_simps elim!: ballE[of _ _ i]) + ultimately show "y \ \(\ - {K})" by auto qed qed - then have "\(s - {k}) = cbox a b" - unfolding s(6)[symmetric] by auto - then have "s - {k} division_of cbox a b" - by (metis Diff_subset less.prems division_of_subset s(6)) - then have "{ka \ s - {k}. content ka \ 0} division_of (cbox a b)" + then have "K \ \(\ - {K})" + using closed closed_limpt by blast + then have "\(\ - {K}) = cbox a b" + unfolding \(6)[symmetric] by auto + then have "\ - {K} division_of cbox a b" + by (metis Diff_subset less.prems division_of_subset \(6)) + then have "{ka \ \ - {K}. content ka \ 0} division_of (cbox a b)" using card less.hyps by blast - moreover - have "{ka \ s - {k}. content ka \ 0} = {k \ s. content k \ 0}" + moreover have "{ka \ \ - {K}. content ka \ 0} = {K \ \. content K \ 0}" using contk by auto ultimately show ?case by auto qed @@ -3003,7 +2996,7 @@ assumes "f integrable_on {a..b}" and "{c..d} \ {a..b}" shows "f integrable_on {c..d}" - by (metis assms(1) assms(2) box_real(2) integrable_subinterval) + by (metis assms box_real(2) integrable_subinterval) subsection \Combining adjacent intervals in 1 dimension.\ @@ -4159,11 +4152,9 @@ unfolding *(1) apply (subst *(2)) apply (rule norm_triangle_lt add_strict_mono)+ - unfolding norm_minus_cancel - apply (rule d1_fin[unfolded **]) - apply (rule d2_fin) + apply (metis "**" d1_fin norm_minus_cancel) + using d2_fin apply blast using w *** - unfolding norm_scaleR apply (auto simp add: field_simps) done qed