# HG changeset patch # User hoelzl # Date 1470398402 -7200 # Node ID aca2659ebba79c21a255f0336878120247d81d2a # Parent bd218a9320b54363495253e9ce2706b08b8821ec clean up prove for inter_interior_unions_intervals diff -r bd218a9320b5 -r aca2659ebba7 src/HOL/Multivariate_Analysis/Henstock_Kurzweil_Integration.thy --- a/src/HOL/Multivariate_Analysis/Henstock_Kurzweil_Integration.thy Thu Aug 04 19:36:31 2016 +0200 +++ b/src/HOL/Multivariate_Analysis/Henstock_Kurzweil_Integration.thy Fri Aug 05 14:00:02 2016 +0200 @@ -168,178 +168,45 @@ by auto (metis IntI UnE empty_iff interior_maximal open_box subsetCE subsetI) qed -lemma inter_interior_unions_intervals: - fixes f::"('a::euclidean_space) set set" +lemma interior_Union_subset_cbox: assumes "finite f" - and "open s" - and "\t\f. \a b. t = cbox a b" - and "\t\f. s \ (interior t) = {}" - shows "s \ interior (\f) = {}" -proof (clarsimp simp only: all_not_in_conv [symmetric]) - fix x - assume x: "x \ s" "x \ interior (\f)" - have lem1: "\x e s U. ball x e \ s \ interior U \ ball x e \ s \ U" - using interior_subset - by auto (meson Topology_Euclidean_Space.open_ball contra_subsetD interior_maximal mem_ball) - have "\t\f. \x. \e>0. ball x e \ s \ t" - if "finite f" and "\t\f. \a b. t = cbox a b" and "\x. x \ s \ interior (\f)" for f - using that - proof (induct rule: finite_induct) - case empty - obtain x where "x \ s \ interior (\{})" - using empty(2) .. - then have False - unfolding Union_empty interior_empty by auto - then show ?case by auto - next - case (insert i f) - obtain x where x: "x \ s \ interior (\insert i f)" - using insert(5) .. - then obtain e where e: "0 < e \ ball x e \ s \ interior (\insert i f)" - unfolding open_contains_ball_eq[OF open_Int[OF assms(2) open_interior], rule_format] .. - obtain a where "\b. i = cbox a b" - using insert(4)[rule_format,OF insertI1] .. - then obtain b where ab: "i = cbox a b" .. - show ?case - proof (cases "x \ i") - case False - then have "x \ UNIV - cbox a b" - unfolding ab by auto - then obtain d where "0 < d \ ball x d \ UNIV - cbox a b" - unfolding open_contains_ball_eq[OF open_Diff[OF open_UNIV closed_cbox],rule_format] .. - then have "0 < d" "ball x (min d e) \ UNIV - i" - unfolding ab ball_min_Int by auto - then have "ball x (min d e) \ s \ interior (\f)" - using e unfolding lem1 unfolding ball_min_Int by auto - then have "x \ s \ interior (\f)" using \d>0\ e by auto - then have "\t\f. \x e. 0 < e \ ball x e \ s \ t" - using insert.hyps(3) insert.prems(1) by blast - then show ?thesis by auto - next - case True show ?thesis - proof (cases "x\box a b") - case True - then obtain d where "0 < d \ ball x d \ box a b" - unfolding open_contains_ball_eq[OF open_box,rule_format] .. - then show ?thesis - apply (rule_tac x=i in bexI, rule_tac x=x in exI, rule_tac x="min d e" in exI) - unfolding ab - using box_subset_cbox[of a b] and e - apply fastforce+ - done - next - case False - then obtain k where "x\k \ a\k \ x\k \ b\k" and k: "k \ Basis" - unfolding mem_box by (auto simp add: not_less) - then have "x\k = a\k \ x\k = b\k" - using True unfolding ab and mem_box - apply (erule_tac x = k in ballE) - apply auto - done - then have "\x. ball x (e/2) \ s \ (\f)" - proof (rule disjE) - let ?z = "x - (e/2) *\<^sub>R k" - assume as: "x\k = a\k" - have "ball ?z (e / 2) \ i = {}" - proof (clarsimp simp only: all_not_in_conv [symmetric]) - fix y - assume "y \ ball ?z (e / 2)" and yi: "y \ i" - then have "dist ?z y < e/2" by auto - then have "\(?z - y) \ k\ < e/2" - using Basis_le_norm[OF k, of "?z - y"] unfolding dist_norm by auto - then have "y\k < a\k" - using e k - by (auto simp add: field_simps abs_less_iff as inner_simps) - then have "y \ i" - unfolding ab mem_box by (auto intro!: bexI[OF _ k]) - then show False using yi by auto - qed - moreover - have "ball ?z (e/2) \ s \ (\insert i f)" - apply (rule order_trans[OF _ e[THEN conjunct2, unfolded lem1]]) - proof - fix y - assume as: "y \ ball ?z (e/2)" - have "norm (x - y) \ \e\ / 2 + norm (x - y - (e / 2) *\<^sub>R k)" - apply (rule order_trans,rule norm_triangle_sub[of "x - y" "(e/2) *\<^sub>R k"]) - unfolding norm_scaleR norm_Basis[OF k] - apply auto - done - also have "\ < \e\ / 2 + \e\ / 2" - apply (rule add_strict_left_mono) - using as e - apply (auto simp add: field_simps dist_norm) - done - finally show "y \ ball x e" - unfolding mem_ball dist_norm using e by (auto simp add:field_simps) - qed - ultimately show ?thesis - apply (rule_tac x="?z" in exI) - unfolding Union_insert - apply auto - done - next - let ?z = "x + (e/2) *\<^sub>R k" - assume as: "x\k = b\k" - have "ball ?z (e / 2) \ i = {}" - proof (clarsimp simp only: all_not_in_conv [symmetric]) - fix y - assume "y \ ball ?z (e / 2)" and yi: "y \ i" - then have "dist ?z y < e/2" - by auto - then have "\(?z - y) \ k\ < e/2" - using Basis_le_norm[OF k, of "?z - y"] - unfolding dist_norm by auto - then have "y\k > b\k" - using e k - by (auto simp add:field_simps inner_simps inner_Basis as) - then have "y \ i" - unfolding ab mem_box by (auto intro!: bexI[OF _ k]) - then show False using yi by auto - qed - moreover - have "ball ?z (e/2) \ s \ (\insert i f)" - apply (rule order_trans[OF _ e[THEN conjunct2, unfolded lem1]]) - proof - fix y - assume as: "y\ ball ?z (e/2)" - have "norm (x - y) \ \e\ / 2 + norm (x - y + (e / 2) *\<^sub>R k)" - apply (rule order_trans,rule norm_triangle_sub[of "x - y" "- (e/2) *\<^sub>R k"]) - unfolding norm_scaleR - apply (auto simp: k) - done - also have "\ < \e\ / 2 + \e\ / 2" - apply (rule add_strict_left_mono) - using as unfolding mem_ball dist_norm - using e apply (auto simp add: field_simps) - done - finally show "y \ ball x e" - unfolding mem_ball dist_norm using e by (auto simp add:field_simps) - qed - ultimately show ?thesis - apply (rule_tac x="?z" in exI) - unfolding Union_insert - apply auto - done - qed - then obtain x where "ball x (e / 2) \ s \ \f" .. - then have "x \ s \ interior (\f)" - unfolding lem1[where U="\f", symmetric] - using centre_in_ball e by auto - then show ?thesis - using insert.hyps(3) insert.prems(1) by blast - qed - qed - qed - from this[OF assms(1,3)] x - obtain t x e where "t \ f" "0 < e" "ball x e \ s \ t" - by blast - then have "x \ s" "x \ interior t" - using open_subset_interior[OF open_ball, of x e t] - by auto - then show False - using \t \ f\ assms(4) by auto -qed + assumes f: "\s. s \ f \ \a b. s = cbox a b" "\s. s \ f \ interior s \ t" + and t: "closed t" + shows "interior (\f) \ t" +proof - + have [simp]: "s \ f \ closed s" for s + using f by auto + define E where "E = {s\f. interior s = {}}" + then have "finite E" "E \ {s\f. interior s = {}}" + using \finite f\ by auto + then have "interior (\f) = interior (\(f - E))" + proof (induction E rule: finite_subset_induct') + case (insert s f') + have "interior (\(f - insert s f') \ s) = interior (\(f - insert s f'))" + using insert.hyps \finite f\ by (intro interior_closed_Un_empty_interior) auto + also have "\(f - insert s f') \ s = \(f - f')" + using insert.hyps by auto + finally show ?case + by (simp add: insert.IH) + qed simp + also have "\ \ \(f - E)" + by (rule interior_subset) + also have "\ \ t" + proof (rule Union_least) + fix s assume "s \ f - E" + with f[of s] obtain a b where s: "s \ f" "s = cbox a b" "box a b \ {}" + by (fastforce simp: E_def) + have "closure (interior s) \ closure t" + by (intro closure_mono f \s \ f\) + with s \closed t\ show "s \ t" + by (simp add: closure_box) + qed + finally show ?thesis . +qed + +lemma inter_interior_unions_intervals: + "finite f \ open s \ \t\f. \a b. t = cbox a b \ \t\f. s \ (interior t) = {} \ s \ interior (\f) = {}" + using interior_Union_subset_cbox[of f "UNIV - s"] by auto subsection \Bounds on intervals where they exist.\ @@ -827,7 +694,7 @@ fixes s1 s2 :: "'a::euclidean_space set" assumes "p1 division_of s1" and "p2 division_of s2" - shows "{k1 \ k2 | k1 k2 .k1 \ p1 \ k2 \ p2 \ k1 \ k2 \ {}} division_of (s1 \ s2)" + shows "{k1 \ k2 | k1 k2. k1 \ p1 \ k2 \ p2 \ k1 \ k2 \ {}} division_of (s1 \ s2)" (is "?A' division_of _") proof - let ?A = "{s. s \ (\(k1,k2). k1 \ k2) ` (p1 \ p2) \ s \ {}}"