# HG changeset patch # User paulson # Date 1598818864 -3600 # Node ID 0881bc2c607d51e3b2d30e207b0c8a69ee578126 # Parent 0f3d24dc197f144741b49d51719e3e5c7ad035c4# Parent aa7cb84983e97a83a71502c186c0b1547cb4b234 merged diff -r 0f3d24dc197f -r 0881bc2c607d src/HOL/Analysis/Connected.thy --- a/src/HOL/Analysis/Connected.thy Sun Aug 30 15:15:28 2020 +0000 +++ b/src/HOL/Analysis/Connected.thy Sun Aug 30 21:21:04 2020 +0100 @@ -68,94 +68,94 @@ subsection \Connected components, considered as a connectedness relation or a set\ -definition\<^marker>\tag important\ "connected_component s x y \ \t. connected t \ t \ s \ x \ t \ y \ t" +definition\<^marker>\tag important\ "connected_component S x y \ \T. connected T \ T \ S \ x \ T \ y \ T" -abbreviation "connected_component_set s x \ Collect (connected_component s x)" +abbreviation "connected_component_set S x \ Collect (connected_component S x)" lemma connected_componentI: - "connected t \ t \ s \ x \ t \ y \ t \ connected_component s x y" + "connected T \ T \ S \ x \ T \ y \ T \ connected_component S x y" by (auto simp: connected_component_def) -lemma connected_component_in: "connected_component s x y \ x \ s \ y \ s" +lemma connected_component_in: "connected_component S x y \ x \ S \ y \ S" by (auto simp: connected_component_def) -lemma connected_component_refl: "x \ s \ connected_component s x x" +lemma connected_component_refl: "x \ S \ connected_component S x x" by (auto simp: connected_component_def) (use connected_sing in blast) -lemma connected_component_refl_eq [simp]: "connected_component s x x \ x \ s" +lemma connected_component_refl_eq [simp]: "connected_component S x x \ x \ S" by (auto simp: connected_component_refl) (auto simp: connected_component_def) -lemma connected_component_sym: "connected_component s x y \ connected_component s y x" +lemma connected_component_sym: "connected_component S x y \ connected_component S y x" by (auto simp: connected_component_def) lemma connected_component_trans: - "connected_component s x y \ connected_component s y z \ connected_component s x z" + "connected_component S x y \ connected_component S y z \ connected_component S x z" unfolding connected_component_def by (metis Int_iff Un_iff Un_subset_iff equals0D connected_Un) lemma connected_component_of_subset: - "connected_component s x y \ s \ t \ connected_component t x y" + "connected_component S x y \ S \ T \ connected_component T x y" by (auto simp: connected_component_def) -lemma connected_component_Union: "connected_component_set s x = \{t. connected t \ x \ t \ t \ s}" +lemma connected_component_Union: "connected_component_set S x = \{T. connected T \ x \ T \ T \ S}" by (auto simp: connected_component_def) -lemma connected_connected_component [iff]: "connected (connected_component_set s x)" +lemma connected_connected_component [iff]: "connected (connected_component_set S x)" by (auto simp: connected_component_Union intro: connected_Union) lemma connected_iff_eq_connected_component_set: - "connected s \ (\x \ s. connected_component_set s x = s)" -proof (cases "s = {}") + "connected S \ (\x \ S. connected_component_set S x = S)" +proof (cases "S = {}") case True then show ?thesis by simp next case False - then obtain x where "x \ s" by auto + then obtain x where "x \ S" by auto show ?thesis proof - assume "connected s" - then show "\x \ s. connected_component_set s x = s" + assume "connected S" + then show "\x \ S. connected_component_set S x = S" by (force simp: connected_component_def) next - assume "\x \ s. connected_component_set s x = s" - then show "connected s" - by (metis \x \ s\ connected_connected_component) + assume "\x \ S. connected_component_set S x = S" + then show "connected S" + by (metis \x \ S\ connected_connected_component) qed qed -lemma connected_component_subset: "connected_component_set s x \ s" +lemma connected_component_subset: "connected_component_set S x \ S" using connected_component_in by blast -lemma connected_component_eq_self: "connected s \ x \ s \ connected_component_set s x = s" +lemma connected_component_eq_self: "connected S \ x \ S \ connected_component_set S x = S" by (simp add: connected_iff_eq_connected_component_set) lemma connected_iff_connected_component: - "connected s \ (\x \ s. \y \ s. connected_component s x y)" + "connected S \ (\x \ S. \y \ S. connected_component S x y)" using connected_component_in by (auto simp: connected_iff_eq_connected_component_set) lemma connected_component_maximal: - "x \ t \ connected t \ t \ s \ t \ (connected_component_set s x)" + "x \ T \ connected T \ T \ S \ T \ (connected_component_set S x)" using connected_component_eq_self connected_component_of_subset by blast lemma connected_component_mono: - "s \ t \ connected_component_set s x \ connected_component_set t x" + "S \ T \ connected_component_set S x \ connected_component_set T x" by (simp add: Collect_mono connected_component_of_subset) -lemma connected_component_eq_empty [simp]: "connected_component_set s x = {} \ x \ s" +lemma connected_component_eq_empty [simp]: "connected_component_set S x = {} \ x \ S" using connected_component_refl by (fastforce simp: connected_component_in) lemma connected_component_set_empty [simp]: "connected_component_set {} x = {}" using connected_component_eq_empty by blast lemma connected_component_eq: - "y \ connected_component_set s x \ (connected_component_set s y = connected_component_set s x)" + "y \ connected_component_set S x \ (connected_component_set S y = connected_component_set S x)" by (metis (no_types, lifting) Collect_cong connected_component_sym connected_component_trans mem_Collect_eq) lemma closed_connected_component: - assumes s: "closed s" - shows "closed (connected_component_set s x)" -proof (cases "x \ s") + assumes S: "closed S" + shows "closed (connected_component_set S x)" +proof (cases "x \ S") case False then show ?thesis by (metis connected_component_eq_empty closed_empty) @@ -164,29 +164,29 @@ show ?thesis unfolding closure_eq [symmetric] proof - show "closure (connected_component_set s x) \ connected_component_set s x" + show "closure (connected_component_set S x) \ connected_component_set S x" apply (rule connected_component_maximal) apply (simp add: closure_def True) apply (simp add: connected_imp_connected_closure) - apply (simp add: s closure_minimal connected_component_subset) + apply (simp add: S closure_minimal connected_component_subset) done next - show "connected_component_set s x \ closure (connected_component_set s x)" + show "connected_component_set S x \ closure (connected_component_set S x)" by (simp add: closure_subset) qed qed lemma connected_component_disjoint: - "connected_component_set s a \ connected_component_set s b = {} \ - a \ connected_component_set s b" + "connected_component_set S a \ connected_component_set S b = {} \ + a \ connected_component_set S b" apply (auto simp: connected_component_eq) using connected_component_eq connected_component_sym apply blast done lemma connected_component_nonoverlap: - "connected_component_set s a \ connected_component_set s b = {} \ - a \ s \ b \ s \ connected_component_set s a \ connected_component_set s b" + "connected_component_set S a \ connected_component_set S b = {} \ + a \ S \ b \ S \ connected_component_set S a \ connected_component_set S b" apply (auto simp: connected_component_in) using connected_component_refl_eq apply blast @@ -195,30 +195,30 @@ done lemma connected_component_overlap: - "connected_component_set s a \ connected_component_set s b \ {} \ - a \ s \ b \ s \ connected_component_set s a = connected_component_set s b" + "connected_component_set S a \ connected_component_set S b \ {} \ + a \ S \ b \ S \ connected_component_set S a = connected_component_set S b" by (auto simp: connected_component_nonoverlap) -lemma connected_component_sym_eq: "connected_component s x y \ connected_component s y x" +lemma connected_component_sym_eq: "connected_component S x y \ connected_component S y x" using connected_component_sym by blast lemma connected_component_eq_eq: - "connected_component_set s x = connected_component_set s y \ - x \ s \ y \ s \ x \ s \ y \ s \ connected_component s x y" - apply (cases "y \ s", simp) + "connected_component_set S x = connected_component_set S y \ + x \ S \ y \ S \ x \ S \ y \ S \ connected_component S x y" + apply (cases "y \ S", simp) apply (metis connected_component_eq connected_component_eq_empty connected_component_refl_eq mem_Collect_eq) - apply (cases "x \ s", simp) + apply (cases "x \ S", simp) apply (metis connected_component_eq_empty) using connected_component_eq_empty apply blast done lemma connected_iff_connected_component_eq: - "connected s \ (\x \ s. \y \ s. connected_component_set s x = connected_component_set s y)" + "connected S \ (\x \ S. \y \ S. connected_component_set S x = connected_component_set S y)" by (simp add: connected_component_eq_eq connected_iff_connected_component) lemma connected_component_idemp: - "connected_component_set (connected_component_set s x) x = connected_component_set s x" + "connected_component_set (connected_component_set S x) x = connected_component_set S x" apply (rule subset_antisym) apply (simp add: connected_component_subset) apply (metis connected_component_eq_empty connected_component_maximal @@ -226,25 +226,24 @@ done lemma connected_component_unique: - "\x \ c; c \ s; connected c; - \c'. x \ c' \ c' \ s \ connected c' - \ c' \ c\ - \ connected_component_set s x = c" -apply (rule subset_antisym) -apply (meson connected_component_maximal connected_component_subset connected_connected_component contra_subsetD) -by (simp add: connected_component_maximal) + "\x \ c; c \ S; connected c; + \c'. \x \ c'; c' \ S; connected c'\ \ c' \ c\ + \ connected_component_set S x = c" + apply (rule subset_antisym) + apply (meson connected_component_maximal connected_component_subset connected_connected_component contra_subsetD) + by (simp add: connected_component_maximal) lemma joinable_connected_component_eq: - "\connected t; t \ s; - connected_component_set s x \ t \ {}; - connected_component_set s y \ t \ {}\ - \ connected_component_set s x = connected_component_set s y" + "\connected T; T \ S; + connected_component_set S x \ T \ {}; + connected_component_set S y \ T \ {}\ + \ connected_component_set S x = connected_component_set S y" apply (simp add: ex_in_conv [symmetric]) apply (rule connected_component_eq) by (metis (no_types, hide_lams) connected_component_eq_eq connected_component_in connected_component_maximal subsetD mem_Collect_eq) -lemma Union_connected_component: "\(connected_component_set s ` s) = s" +lemma Union_connected_component: "\(connected_component_set S ` S) = S" apply (rule subset_antisym) apply (simp add: SUP_least connected_component_subset) using connected_component_refl_eq @@ -252,16 +251,16 @@ lemma complement_connected_component_unions: - "s - connected_component_set s x = - \(connected_component_set s ` s - {connected_component_set s x})" + "S - connected_component_set S x = + \(connected_component_set S ` S - {connected_component_set S x})" apply (subst Union_connected_component [symmetric], auto) apply (metis connected_component_eq_eq connected_component_in) by (metis connected_component_eq mem_Collect_eq) lemma connected_component_intermediate_subset: - "\connected_component_set u a \ t; t \ u\ - \ connected_component_set t a = connected_component_set u a" - apply (case_tac "a \ u") + "\connected_component_set U a \ T; T \ U\ + \ connected_component_set T a = connected_component_set U a" + apply (case_tac "a \ U") apply (simp add: connected_component_maximal connected_component_mono subset_antisym) using connected_component_eq_empty by blast @@ -269,17 +268,17 @@ subsection \The set of connected components of a set\ definition\<^marker>\tag important\ components:: "'a::topological_space set \ 'a set set" - where "components s \ connected_component_set s ` s" + where "components S \ connected_component_set S ` S" -lemma components_iff: "s \ components u \ (\x. x \ u \ s = connected_component_set u x)" +lemma components_iff: "S \ components U \ (\x. x \ U \ S = connected_component_set U x)" by (auto simp: components_def) -lemma componentsI: "x \ u \ connected_component_set u x \ components u" +lemma componentsI: "x \ U \ connected_component_set U x \ components U" by (auto simp: components_def) lemma componentsE: - assumes "s \ components u" - obtains x where "x \ u" "s = connected_component_set u x" + assumes "S \ components U" + obtains x where "x \ U" "S = connected_component_set U x" using assms by (auto simp: components_def) lemma Union_components [simp]: "\(components u) = u" diff -r 0f3d24dc197f -r 0881bc2c607d src/HOL/Analysis/Elementary_Metric_Spaces.thy --- a/src/HOL/Analysis/Elementary_Metric_Spaces.thy Sun Aug 30 15:15:28 2020 +0000 +++ b/src/HOL/Analysis/Elementary_Metric_Spaces.thy Sun Aug 30 21:21:04 2020 +0100 @@ -61,7 +61,7 @@ by (simp add: subset_eq) lemma mem_ball_imp_mem_cball: "x \ ball y e \ x \ cball y e" - by (auto) + by auto lemma sphere_cball [simp,intro]: "sphere z r \ cball z r" by force @@ -70,34 +70,34 @@ by auto lemma subset_ball[intro]: "d \ e \ ball x d \ ball x e" - by (simp add: subset_eq) + by auto lemma subset_cball[intro]: "d \ e \ cball x d \ cball x e" - by (simp add: subset_eq) + by auto lemma mem_ball_leI: "x \ ball y e \ e \ f \ x \ ball y f" - by (auto) + by auto lemma mem_cball_leI: "x \ cball y e \ e \ f \ x \ cball y f" - by (auto) + by auto lemma cball_trans: "y \ cball z b \ x \ cball y a \ x \ cball z (b + a)" by metric lemma ball_max_Un: "ball a (max r s) = ball a r \ ball a s" - by (simp add: set_eq_iff) arith + by auto lemma ball_min_Int: "ball a (min r s) = ball a r \ ball a s" - by (simp add: set_eq_iff) + by auto lemma cball_max_Un: "cball a (max r s) = cball a r \ cball a s" - by (simp add: set_eq_iff) arith + by auto lemma cball_min_Int: "cball a (min r s) = cball a r \ cball a s" - by (simp add: set_eq_iff) + by auto lemma cball_diff_eq_sphere: "cball a r - ball a r = sphere a r" - by (auto simp: cball_def ball_def dist_commute) + by auto lemma open_ball [intro, simp]: "open (ball x e)" proof - @@ -126,7 +126,8 @@ unfolding mem_ball set_eq_iff by (simp add: not_less) metric -lemma ball_empty: "e \ 0 \ ball x e = {}" by simp +lemma ball_empty: "e \ 0 \ ball x e = {}" + by simp lemma closed_cball [iff]: "closed (cball x e)" proof - @@ -142,16 +143,15 @@ { fix x and e::real assume "x\S" "e>0" "ball x e \ S" - then have "\d>0. cball x d \ S" unfolding subset_eq by (rule_tac x="e/2" in exI, auto) + then have "\d>0. cball x d \ S" + unfolding subset_eq by (rule_tac x="e/2" in exI, auto) } moreover { fix x and e::real assume "x\S" "e>0" "cball x e \ S" then have "\d>0. ball x d \ S" - unfolding subset_eq - apply (rule_tac x="e/2" in exI, auto) - done + using mem_ball_imp_mem_cball by blast } ultimately show ?thesis unfolding open_contains_ball by auto @@ -206,24 +206,17 @@ lemma cball_sing: fixes x :: "'a::metric_space" shows "e = 0 \ cball x e = {x}" - by (auto simp: set_eq_iff) + by simp lemma ball_divide_subset: "d \ 1 \ ball x (e/d) \ ball x e" - apply (cases "e \ 0") - apply (simp add: ball_empty field_split_simps) - apply (rule subset_ball) - apply (simp add: field_split_simps) - done + by (metis ball_eq_empty div_by_1 frac_le linear subset_ball zero_less_one) lemma ball_divide_subset_numeral: "ball x (e / numeral w) \ ball x e" using ball_divide_subset one_le_numeral by blast lemma cball_divide_subset: "d \ 1 \ cball x (e/d) \ cball x e" - apply (cases "e < 0") - apply (simp add: field_split_simps) - apply (rule subset_cball) - apply (metis div_by_1 frac_le not_le order_refl zero_less_one) - done + apply (cases "e < 0", simp add: field_split_simps) + by (metis div_by_1 frac_le less_numeral_extra(1) not_le order_refl subset_cball) lemma cball_divide_subset_numeral: "cball x (e / numeral w) \ cball x e" using cball_divide_subset one_le_numeral by blast @@ -2141,7 +2134,7 @@ then have D: "T \ V" unfolding V_def by auto have "(ball x ((infdist x T)/2)) \ (ball y ((infdist y S)/2)) = {}" if "x \ S" "y \ T" for x y - proof (auto) + proof auto fix z assume H: "dist x z * 2 < infdist x T" "dist y z * 2 < infdist y S" have "2 * dist x y \ 2 * dist x z + 2 * dist y z" by metric @@ -2728,8 +2721,8 @@ subsection \With Abstract Topology (TODO: move and remove dependency?)\ lemma openin_contains_ball: - "openin (top_of_set t) s \ - s \ t \ (\x \ s. \e. 0 < e \ ball x e \ t \ s)" + "openin (top_of_set T) S \ + S \ T \ (\x \ S. \e. 0 < e \ ball x e \ T \ S)" (is "?lhs = ?rhs") proof assume ?lhs @@ -2745,14 +2738,18 @@ qed lemma openin_contains_cball: - "openin (top_of_set t) s \ - s \ t \ - (\x \ s. \e. 0 < e \ cball x e \ t \ s)" - apply (simp add: openin_contains_ball) - apply (rule iffI) - apply (auto dest!: bspec) - apply (rule_tac x="e/2" in exI, force+) - done + "openin (top_of_set T) S \ + S \ T \ (\x \ S. \e. 0 < e \ cball x e \ T \ S)" + (is "?lhs = ?rhs") +proof + assume ?lhs + then show ?rhs + by (force simp add: openin_contains_ball intro: exI [where x="_/2"]) +next + assume ?rhs + then show ?lhs + by (force simp add: openin_contains_ball) +qed subsection \Closed Nest\ @@ -3086,9 +3083,9 @@ by (auto intro!: bdd_belowI [where m=0] cInf_lower) lemma le_setdist_iff: - "d \ setdist s t \ - (\x \ s. \y \ t. d \ dist x y) \ (s = {} \ t = {} \ d \ 0)" - apply (cases "s = {} \ t = {}") + "d \ setdist S T \ + (\x \ S. \y \ T. d \ dist x y) \ (S = {} \ T = {} \ d \ 0)" + apply (cases "S = {} \ T = {}") apply (force simp add: setdist_def) apply (intro iffI conjI) using setdist_le_dist apply fastforce @@ -3096,34 +3093,33 @@ done lemma setdist_ltE: - assumes "setdist s t < b" "s \ {}" "t \ {}" - obtains x y where "x \ s" "y \ t" "dist x y < b" + assumes "setdist S T < b" "S \ {}" "T \ {}" + obtains x y where "x \ S" "y \ T" "dist x y < b" using assms by (auto simp: not_le [symmetric] le_setdist_iff) -lemma setdist_refl: "setdist s s = 0" - apply (cases "s = {}") +lemma setdist_refl: "setdist S S = 0" + apply (cases "S = {}") apply (force simp add: setdist_def) apply (rule antisym [OF _ setdist_pos_le]) apply (metis all_not_in_conv dist_self setdist_le_dist) done -lemma setdist_sym: "setdist s t = setdist t s" +lemma setdist_sym: "setdist S T = setdist T S" by (force simp: setdist_def dist_commute intro!: arg_cong [where f=Inf]) -lemma setdist_triangle: "setdist s t \ setdist s {a} + setdist {a} t" -proof (cases "s = {} \ t = {}") +lemma setdist_triangle: "setdist S T \ setdist S {a} + setdist {a} T" +proof (cases "S = {} \ T = {}") case True then show ?thesis using setdist_pos_le by fastforce next case False - have "\x. x \ s \ setdist s t - dist x a \ setdist {a} t" - apply (rule le_setdistI, blast) - using False apply (fastforce intro: le_setdistI) - apply (simp add: algebra_simps) + then have "\x. x \ S \ setdist S T - dist x a \ setdist {a} T" + apply (intro le_setdistI) + apply (simp_all add: algebra_simps) apply (metis dist_commute dist_triangle3 order_trans [OF setdist_le_dist]) done - then have "setdist s t - setdist {a} t \ setdist s {a}" + then have "setdist S T - setdist {a} T \ setdist S {a}" using False by (fastforce intro: le_setdistI) then show ?thesis by (simp add: algebra_simps) @@ -3132,52 +3128,48 @@ lemma setdist_singletons [simp]: "setdist {x} {y} = dist x y" by (simp add: setdist_def) -lemma setdist_Lipschitz: "\setdist {x} s - setdist {y} s\ \ dist x y" +lemma setdist_Lipschitz: "\setdist {x} S - setdist {y} S\ \ dist x y" apply (subst setdist_singletons [symmetric]) by (metis abs_diff_le_iff diff_le_eq setdist_triangle setdist_sym) -lemma continuous_at_setdist [continuous_intros]: "continuous (at x) (\y. (setdist {y} s))" +lemma continuous_at_setdist [continuous_intros]: "continuous (at x) (\y. (setdist {y} S))" by (force simp: continuous_at_eps_delta dist_real_def intro: le_less_trans [OF setdist_Lipschitz]) -lemma continuous_on_setdist [continuous_intros]: "continuous_on t (\y. (setdist {y} s))" +lemma continuous_on_setdist [continuous_intros]: "continuous_on T (\y. (setdist {y} S))" by (metis continuous_at_setdist continuous_at_imp_continuous_on) -lemma uniformly_continuous_on_setdist: "uniformly_continuous_on t (\y. (setdist {y} s))" +lemma uniformly_continuous_on_setdist: "uniformly_continuous_on T (\y. (setdist {y} S))" by (force simp: uniformly_continuous_on_def dist_real_def intro: le_less_trans [OF setdist_Lipschitz]) -lemma setdist_subset_right: "\t \ {}; t \ u\ \ setdist s u \ setdist s t" - apply (cases "s = {} \ u = {}", force) +lemma setdist_subset_right: "\T \ {}; T \ u\ \ setdist S u \ setdist S T" + apply (cases "S = {} \ u = {}", force) apply (auto simp: setdist_def intro!: bdd_belowI [where m=0] cInf_superset_mono) done -lemma setdist_subset_left: "\s \ {}; s \ t\ \ setdist t u \ setdist s u" +lemma setdist_subset_left: "\S \ {}; S \ T\ \ setdist T u \ setdist S u" by (metis setdist_subset_right setdist_sym) -lemma setdist_closure_1 [simp]: "setdist (closure s) t = setdist s t" -proof (cases "s = {} \ t = {}") +lemma setdist_closure_1 [simp]: "setdist (closure S) T = setdist S T" +proof (cases "S = {} \ T = {}") case True then show ?thesis by force next case False { fix y - assume "y \ t" - have "continuous_on (closure s) (\a. dist a y)" + assume "y \ T" + have "continuous_on (closure S) (\a. dist a y)" by (auto simp: continuous_intros dist_norm) - then have *: "\x. x \ closure s \ setdist s t \ dist x y" - apply (rule continuous_ge_on_closure) - apply assumption - apply (blast intro: setdist_le_dist \y \ t\ ) - done + then have *: "\x. x \ closure S \ setdist S T \ dist x y" + by (fast intro: setdist_le_dist \y \ T\ continuous_ge_on_closure) } note * = this show ?thesis apply (rule antisym) using False closure_subset apply (blast intro: setdist_subset_left) - using False * - apply (force intro!: le_setdistI) + using False * apply (force intro!: le_setdistI) done qed -lemma setdist_closure_2 [simp]: "setdist t (closure s) = setdist t s" -by (metis setdist_closure_1 setdist_sym) +lemma setdist_closure_2 [simp]: "setdist T (closure S) = setdist T S" + by (metis setdist_closure_1 setdist_sym) lemma setdist_eq_0I: "\x \ S; x \ T\ \ setdist S T = 0" by (metis antisym dist_self setdist_le_dist setdist_pos_le) diff -r 0f3d24dc197f -r 0881bc2c607d src/HOL/Analysis/Elementary_Topology.thy --- a/src/HOL/Analysis/Elementary_Topology.thy Sun Aug 30 15:15:28 2020 +0000 +++ b/src/HOL/Analysis/Elementary_Topology.thy Sun Aug 30 21:21:04 2020 +0100 @@ -482,7 +482,8 @@ define U where "U = {x<.. U" using z U_def by simp - ultimately obtain V where "V \ A" "z \ V" "V \ U" using topological_basisE[OF \topological_basis A\] by auto + ultimately obtain V where "V \ A" "z \ V" "V \ U" + using topological_basisE[OF \topological_basis A\] by auto define w where "w = (SOME x. x \ V)" then have "w \ V" using \z \ V\ by (metis someI2) then have "x < w \ w \ y" using \w \ V\ \V \ U\ U_def by fastforce @@ -494,7 +495,8 @@ define U where "U = {x<..}" then have "open U" by simp moreover have "y \ U" using \x < y\ U_def by simp - ultimately obtain "V" where "V \ A" "y \ V" "V \ U" using topological_basisE[OF \topological_basis A\] by auto + ultimately obtain "V" where "V \ A" "y \ V" "V \ U" + using topological_basisE[OF \topological_basis A\] by auto have "U = {y..}" unfolding U_def using * \x < y\ by auto then have "V \ {y..}" using \V \ U\ by simp then have "(LEAST w. w \ V) = y" using \y \ V\ by (meson Least_equality atLeast_iff subsetCE) @@ -521,7 +523,8 @@ define U where "U = {x<.. U" using z U_def by simp - ultimately obtain "V" where "V \ A" "z \ V" "V \ U" using topological_basisE[OF \topological_basis A\] by auto + ultimately obtain "V" where "V \ A" "z \ V" "V \ U" + using topological_basisE[OF \topological_basis A\] by auto define w where "w = (SOME x. x \ V)" then have "w \ V" using \z \ V\ by (metis someI2) then have "x \ w \ w < y" using \w \ V\ \V \ U\ U_def by fastforce @@ -533,7 +536,8 @@ define U where "U = {.. U" using \x < y\ U_def by simp - ultimately obtain "V" where "V \ A" "x \ V" "V \ U" using topological_basisE[OF \topological_basis A\] by auto + ultimately obtain "V" where "V \ A" "x \ V" "V \ U" + using topological_basisE[OF \topological_basis A\] by auto have "U = {..x}" unfolding U_def using * \x < y\ by auto then have "V \ {..x}" using \V \ U\ by simp then have "(GREATEST x. x \ V) = x" using \x \ V\ by (meson Greatest_equality atMost_iff subsetCE) @@ -1556,18 +1560,12 @@ shows "infinite (range f)" proof assume "finite (range f)" - then have "closed (range f)" - by (rule finite_imp_closed) - then have "open (- range f)" - by (rule open_Compl) - from assms(1) have "l \ - range f" - by auto - from assms(2) have "eventually (\n. f n \ - range f) sequentially" - using \open (- range f)\ \l \ - range f\ - by (rule topological_tendstoD) + then have "l \ range f \ closed (range f)" + using \finite (range f)\ assms(1) finite_imp_closed by blast + then have "eventually (\n. f n \ - range f) sequentially" + by (metis Compl_iff assms(2) open_Compl topological_tendstoD) then show False - unfolding eventually_sequentially - by auto + unfolding eventually_sequentially by auto qed lemma Bolzano_Weierstrass_imp_closed: diff -r 0f3d24dc197f -r 0881bc2c607d src/HOL/Analysis/Path_Connected.thy --- a/src/HOL/Analysis/Path_Connected.thy Sun Aug 30 15:15:28 2020 +0000 +++ b/src/HOL/Analysis/Path_Connected.thy Sun Aug 30 21:21:04 2020 +0100 @@ -1629,8 +1629,7 @@ then have "y \ S" by (simp add: path_component_mem(2)) then obtain e where e: "e > 0" "ball y e \ S" - using assms[unfolded open_contains_ball] - by auto + using assms openE by blast have "\u. dist y u < e \ path_component S x u" by (metis (full_types) as centre_in_ball convex_ball convex_imp_path_connected e mem_Collect_eq mem_ball path_component_eq path_component_of_subset path_connected_component) then show "\e > 0. ball y e \ path_component_set S x" @@ -2863,30 +2862,33 @@ subsection\<^marker>\tag unimportant\\Relations between components and path components\ lemma open_connected_component: - fixes s :: "'a::real_normed_vector set" - shows "open s \ open (connected_component_set s x)" - apply (simp add: open_contains_ball, clarify) - apply (rename_tac y) - apply (drule_tac x=y in bspec) - apply (simp add: connected_component_in, clarify) - apply (rule_tac x=e in exI) - by (metis mem_Collect_eq connected_component_eq connected_component_maximal centre_in_ball connected_ball) + fixes S :: "'a::real_normed_vector set" + assumes "open S" + shows "open (connected_component_set S x)" +proof (clarsimp simp: open_contains_ball) + fix y + assume xy: "connected_component S x y" + then obtain e where "e>0" "ball y e \ S" + using assms connected_component_in openE by blast + then show "\e>0. ball y e \ connected_component_set S x" + by (metis xy centre_in_ball connected_ball connected_component_eq_eq connected_component_in connected_component_maximal) +qed corollary open_components: - fixes s :: "'a::real_normed_vector set" - shows "\open u; s \ components u\ \ open s" + fixes S :: "'a::real_normed_vector set" + shows "\open u; S \ components u\ \ open S" by (simp add: components_iff) (metis open_connected_component) lemma in_closure_connected_component: - fixes s :: "'a::real_normed_vector set" - assumes x: "x \ s" and s: "open s" - shows "x \ closure (connected_component_set s y) \ x \ connected_component_set s y" + fixes S :: "'a::real_normed_vector set" + assumes x: "x \ S" and S: "open S" + shows "x \ closure (connected_component_set S y) \ x \ connected_component_set S y" proof - - { assume "x \ closure (connected_component_set s y)" - moreover have "x \ connected_component_set s x" + { assume "x \ closure (connected_component_set S y)" + moreover have "x \ connected_component_set S x" using x by simp - ultimately have "x \ connected_component_set s y" - using s by (meson Compl_disjoint closure_iff_nhds_not_empty connected_component_disjoint disjoint_eq_subset_Compl open_connected_component) + ultimately have "x \ connected_component_set S y" + using S by (meson Compl_disjoint closure_iff_nhds_not_empty connected_component_disjoint disjoint_eq_subset_Compl open_connected_component) } then show ?thesis by (auto simp: closure_def) @@ -2957,76 +2959,72 @@ proof - have "open S" using assms by blast show ?thesis - apply (rule connected_disjoint_Union_open_unique) - apply (simp add: components_eq disjnt_def pairwise_def) - using \open S\ - apply (simp_all add: assms open_components in_components_connected in_components_nonempty) - done + proof (rule connected_disjoint_Union_open_unique) + show "disjoint (components S)" + by (simp add: components_eq disjnt_def pairwise_def) + qed (use \open S\ in \simp_all add: assms open_components in_components_connected in_components_nonempty\) qed subsection\<^marker>\tag unimportant\\Existence of unbounded components\ lemma cobounded_unbounded_component: - fixes s :: "'a :: euclidean_space set" - assumes "bounded (-s)" - shows "\x. x \ s \ \ bounded (connected_component_set s x)" + fixes S :: "'a :: euclidean_space set" + assumes "bounded (-S)" + shows "\x. x \ S \ \ bounded (connected_component_set S x)" proof - obtain i::'a where i: "i \ Basis" using nonempty_Basis by blast - obtain B where B: "B>0" "-s \ ball 0 B" + obtain B where B: "B>0" "-S \ ball 0 B" using bounded_subset_ballD [OF assms, of 0] by auto - then have *: "\x. B \ norm x \ x \ s" + then have *: "\x. B \ norm x \ x \ S" by (force simp: ball_def dist_norm) have unbounded_inner: "\ bounded {x. inner i x \ B}" - apply (auto simp: bounded_def dist_norm) + proof (clarsimp simp: bounded_def dist_norm) + fix e x + show "\y. B \ i \ y \ \ norm (x - y) \ e" apply (rule_tac x="x + (max B e + 1 + \i \ x\) *\<^sub>R i" in exI) - apply simp - using i - apply (auto simp: algebra_simps) - done - have **: "{x. B \ i \ x} \ connected_component_set s (B *\<^sub>R i)" + using i by (auto simp: inner_right_distrib) + qed + have \
: "\x. B \ i \ x \ x \ S" + using * Basis_le_norm [OF i] by (metis abs_ge_self inner_commute order_trans) + have "{x. B \ i \ x} \ connected_component_set S (B *\<^sub>R i)" apply (rule connected_component_maximal) - apply (auto simp: i intro: convex_connected convex_halfspace_ge [of B]) - apply (rule *) - apply (rule order_trans [OF _ Basis_le_norm [OF i]]) - by (simp add: inner_commute) - have "B *\<^sub>R i \ s" + apply (auto simp: i intro: convex_connected convex_halfspace_ge [of B] \
) + done + then have "\ bounded (connected_component_set S (B *\<^sub>R i))" + using bounded_subset unbounded_inner by blast + moreover have "B *\<^sub>R i \ S" by (rule *) (simp add: norm_Basis [OF i]) - then show ?thesis - apply (rule_tac x="B *\<^sub>R i" in exI, clarify) - apply (frule bounded_subset [of _ "{x. B \ i \ x}", OF _ **]) - using unbounded_inner apply blast - done + ultimately show ?thesis + by blast qed lemma cobounded_unique_unbounded_component: - fixes s :: "'a :: euclidean_space set" - assumes bs: "bounded (-s)" and "2 \ DIM('a)" - and bo: "\ bounded(connected_component_set s x)" - "\ bounded(connected_component_set s y)" - shows "connected_component_set s x = connected_component_set s y" + fixes S :: "'a :: euclidean_space set" + assumes bs: "bounded (-S)" and "2 \ DIM('a)" + and bo: "\ bounded(connected_component_set S x)" + "\ bounded(connected_component_set S y)" + shows "connected_component_set S x = connected_component_set S y" proof - obtain i::'a where i: "i \ Basis" using nonempty_Basis by blast - obtain B where B: "B>0" "-s \ ball 0 B" + obtain B where B: "B>0" "-S \ ball 0 B" using bounded_subset_ballD [OF bs, of 0] by auto - then have *: "\x. B \ norm x \ x \ s" + then have *: "\x. B \ norm x \ x \ S" by (force simp: ball_def dist_norm) - have ccb: "connected (- ball 0 B :: 'a set)" - using assms by (auto intro: connected_complement_bounded_convex) - obtain x' where x': "connected_component s x x'" "norm x' > B" + obtain x' where x': "connected_component S x x'" "norm x' > B" using bo [unfolded bounded_def dist_norm, simplified, rule_format] by (metis diff_zero norm_minus_commute not_less) - obtain y' where y': "connected_component s y y'" "norm y' > B" + obtain y' where y': "connected_component S y y'" "norm y' > B" using bo [unfolded bounded_def dist_norm, simplified, rule_format] by (metis diff_zero norm_minus_commute not_less) - have x'y': "connected_component s x' y'" - apply (simp add: connected_component_def) - apply (rule_tac x="- ball 0 B" in exI) - using x' y' - apply (auto simp: ccb dist_norm *) - done + have x'y': "connected_component S x' y'" + unfolding connected_component_def + proof (intro exI conjI) + show "connected (- ball 0 B :: 'a set)" + using assms by (auto intro: connected_complement_bounded_convex) + qed (use x' y' dist_norm * in auto) show ?thesis apply (rule connected_component_eq) using x' y' x'y' @@ -3034,13 +3032,13 @@ qed lemma cobounded_unbounded_components: - fixes s :: "'a :: euclidean_space set" - shows "bounded (-s) \ \c. c \ components s \ \bounded c" + fixes S :: "'a :: euclidean_space set" + shows "bounded (-S) \ \c. c \ components S \ \bounded c" by (metis cobounded_unbounded_component components_def imageI) lemma cobounded_unique_unbounded_components: - fixes s :: "'a :: euclidean_space set" - shows "\bounded (- s); c \ components s; \ bounded c; c' \ components s; \ bounded c'; 2 \ DIM('a)\ \ c' = c" + fixes S :: "'a :: euclidean_space set" + shows "\bounded (- S); c \ components S; \ bounded c; c' \ components S; \ bounded c'; 2 \ DIM('a)\ \ c' = c" unfolding components_iff by (metis cobounded_unique_unbounded_component) @@ -3169,25 +3167,23 @@ assumes "bounded S" "2 \ DIM('a)" shows "connected(outside S)" apply (clarsimp simp add: connected_iff_connected_component outside) - apply (rule_tac s="connected_component_set (- S) x" in connected_component_of_subset) + apply (rule_tac S="connected_component_set (- S) x" in connected_component_of_subset) apply (metis (no_types) assms cobounded_unbounded_component cobounded_unique_unbounded_component connected_component_eq_eq connected_component_idemp double_complement mem_Collect_eq) apply clarify apply (metis connected_component_eq_eq connected_component_in) done lemma outside_connected_component_lt: - "outside S = {x. \B. \y. B < norm(y) \ connected_component (- S) x y}" -apply (auto simp: outside bounded_def dist_norm) -apply (metis diff_0 norm_minus_cancel not_less) -by (metis less_diff_eq norm_minus_commute norm_triangle_ineq2 order.trans pinf(6)) + "outside S = {x. \B. \y. B < norm(y) \ connected_component (- S) x y}" + apply (auto simp: outside bounded_def dist_norm) + apply (metis diff_0 norm_minus_cancel not_less) + by (metis less_diff_eq norm_minus_commute norm_triangle_ineq2 order.trans pinf(6)) lemma outside_connected_component_le: - "outside S = - {x. \B. \y. B \ norm(y) \ - connected_component (- S) x y}" -apply (simp add: outside_connected_component_lt) -apply (simp add: Set.set_eq_iff) -by (meson gt_ex leD le_less_linear less_imp_le order.trans) + "outside S = + {x. \B. \y. B \ norm(y) \ connected_component (- S) x y}" + apply (simp add: outside_connected_component_lt Set.set_eq_iff) + by (meson gt_ex leD le_less_linear less_imp_le order.trans) lemma not_outside_connected_component_lt: fixes S :: "'a::euclidean_space set" @@ -3199,28 +3195,23 @@ { fix y::'a and z::'a assume yz: "B < norm z" "B < norm y" have "connected_component (- cball 0 B) y z" - apply (rule connected_componentI [OF _ subset_refl]) - apply (rule connected_complement_bounded_convex) - using assms yz - by (auto simp: dist_norm) + apply (intro connected_componentI [OF _ subset_refl] connected_complement_bounded_convex) + using assms yz by (auto simp: dist_norm) then have "connected_component (- S) y z" - apply (rule connected_component_of_subset) - apply (metis Bno Compl_anti_mono mem_cball_0 subset_iff) - done + by (metis connected_component_of_subset Bno Compl_anti_mono mem_cball_0 subset_iff) } note cyz = this show ?thesis - apply (auto simp: outside) + apply (auto simp: outside bounded_pos) apply (metis Compl_iff bounded_iff cobounded_imp_unbounded mem_Collect_eq not_le) - apply (simp add: bounded_pos) by (metis B connected_component_trans cyz not_le) qed lemma not_outside_connected_component_le: - fixes S :: "'a::euclidean_space set" - assumes S: "bounded S" "2 \ DIM('a)" - shows "- (outside S) = {x. \B. \y. B \ norm(y) \ \ connected_component (- S) x y}" -apply (auto intro: less_imp_le simp: not_outside_connected_component_lt [OF assms]) -by (meson gt_ex less_le_trans) + fixes S :: "'a::euclidean_space set" + assumes S: "bounded S" "2 \ DIM('a)" + shows "- (outside S) = {x. \B. \y. B \ norm(y) \ \ connected_component (- S) x y}" + apply (auto intro: less_imp_le simp: not_outside_connected_component_lt [OF assms]) + by (meson gt_ex less_le_trans) lemma inside_connected_component_lt: fixes S :: "'a::euclidean_space set" @@ -3237,9 +3228,9 @@ lemma inside_subset: assumes "connected U" and "\ bounded U" and "T \ U = - S" shows "inside S \ T" -apply (auto simp: inside_def) -by (metis bounded_subset [of "connected_component_set (- S) _"] connected_component_maximal - Compl_iff Un_iff assms subsetI) + apply (auto simp: inside_def) + by (metis bounded_subset [of "connected_component_set (- S) _"] connected_component_maximal + Compl_iff Un_iff assms subsetI) lemma frontier_not_empty: fixes S :: "'a :: real_normed_vector set" @@ -3384,10 +3375,9 @@ assume x: "x \ interior s" and y: "y \ s" and cc: "connected_component (- frontier s) x y" have "connected_component_set (- frontier s) x \ frontier s \ {}" - apply (rule connected_Int_frontier, simp) - apply (metis IntI cc connected_component_in connected_component_refl empty_iff interiorE mem_Collect_eq rev_subsetD x) - using y cc - by blast + apply (rule connected_Int_frontier; simp add: set_eq_iff) + apply (meson cc connected_component_in connected_component_refl_eq interior_subset subsetD x) + using y cc by blast then have "bounded (connected_component_set (- frontier s) x)" using connected_component_in by auto } @@ -3402,29 +3392,29 @@ by (simp add: inside_def) lemma outside_empty [simp]: "outside {} = (UNIV :: 'a :: {real_normed_vector, perfect_space} set)" -using inside_empty inside_Un_outside by blast + using inside_empty inside_Un_outside by blast lemma inside_same_component: - "\connected_component (- s) x y; x \ inside s\ \ y \ inside s" + "\connected_component (- S) x y; x \ inside S\ \ y \ inside S" using connected_component_eq connected_component_in by (fastforce simp add: inside_def) lemma outside_same_component: - "\connected_component (- s) x y; x \ outside s\ \ y \ outside s" + "\connected_component (- S) x y; x \ outside S\ \ y \ outside S" using connected_component_eq connected_component_in by (fastforce simp add: outside_def) lemma convex_in_outside: - fixes s :: "'a :: {real_normed_vector, perfect_space} set" - assumes s: "convex s" and z: "z \ s" - shows "z \ outside s" -proof (cases "s={}") + fixes S :: "'a :: {real_normed_vector, perfect_space} set" + assumes S: "convex S" and z: "z \ S" + shows "z \ outside S" +proof (cases "S={}") case True then show ?thesis by simp next - case False then obtain a where "a \ s" by blast + case False then obtain a where "a \ S" by blast with z have zna: "z \ a" by auto - { assume "bounded (connected_component_set (- s) z)" - with bounded_pos_less obtain B where "B>0" and B: "\x. connected_component (- s) z x \ norm x < B" + { assume "bounded (connected_component_set (- S) z)" + with bounded_pos_less obtain B where "B>0" and B: "\x. connected_component (- S) z x \ norm x < B" by (metis mem_Collect_eq) define C where "C = (B + 1 + norm z) / norm (z-a)" have "C > 0" @@ -3435,16 +3425,16 @@ using zna \B>0\ by (simp add: C_def le_max_iff_disj) ultimately have C: "norm (z + C *\<^sub>R (z-a)) > B" by linarith { fix u::real - assume u: "0\u" "u\1" and ins: "(1 - u) *\<^sub>R z + u *\<^sub>R (z + C *\<^sub>R (z - a)) \ s" + assume u: "0\u" "u\1" and ins: "(1 - u) *\<^sub>R z + u *\<^sub>R (z + C *\<^sub>R (z - a)) \ S" then have Cpos: "1 + u * C > 0" by (meson \0 < C\ add_pos_nonneg less_eq_real_def zero_le_mult_iff zero_less_one) then have *: "(1 / (1 + u * C)) *\<^sub>R z + (u * C / (1 + u * C)) *\<^sub>R z = z" by (simp add: scaleR_add_left [symmetric] field_split_simps) then have False - using convexD_alt [OF s \a \ s\ ins, of "1/(u*C + 1)"] \C>0\ \z \ s\ Cpos u + using convexD_alt [OF S \a \ S\ ins, of "1/(u*C + 1)"] \C>0\ \z \ S\ Cpos u by (simp add: * field_split_simps) } note contra = this - have "connected_component (- s) z (z + C *\<^sub>R (z-a))" + have "connected_component (- S) z (z + C *\<^sub>R (z-a))" apply (rule connected_componentI [OF connected_segment [of z "z + C *\<^sub>R (z-a)"]]) apply (simp add: closed_segment_def) using contra @@ -3459,9 +3449,9 @@ qed lemma outside_convex: - fixes s :: "'a :: {real_normed_vector, perfect_space} set" - assumes "convex s" - shows "outside s = - s" + fixes S :: "'a :: {real_normed_vector, perfect_space} set" + assumes "convex S" + shows "outside S = - S" by (metis ComplD assms convex_in_outside equalityI inside_Un_outside subsetI sup.cobounded2) lemma outside_singleton [simp]: @@ -3470,8 +3460,8 @@ by (auto simp: outside_convex) lemma inside_convex: - fixes s :: "'a :: {real_normed_vector, perfect_space} set" - shows "convex s \ inside s = {}" + fixes S :: "'a :: {real_normed_vector, perfect_space} set" + shows "convex S \ inside S = {}" by (simp add: inside_outside outside_convex) lemma inside_singleton [simp]: @@ -3480,8 +3470,8 @@ by (auto simp: inside_convex) lemma outside_subset_convex: - fixes s :: "'a :: {real_normed_vector, perfect_space} set" - shows "\convex t; s \ t\ \ - t \ outside s" + fixes S :: "'a :: {real_normed_vector, perfect_space} set" + shows "\convex T; S \ T\ \ - T \ outside S" using outside_convex outside_mono by blast lemma outside_Un_outside_Un: @@ -3505,49 +3495,49 @@ qed lemma outside_frontier_misses_closure: - fixes s :: "'a::real_normed_vector set" - assumes "bounded s" - shows "outside(frontier s) \ - closure s" + fixes S :: "'a::real_normed_vector set" + assumes "bounded S" + shows "outside(frontier S) \ - closure S" unfolding outside_inside Lattices.boolean_algebra_class.compl_le_compl_iff proof - - { assume "interior s \ inside (frontier s)" - hence "interior s \ inside (frontier s) = inside (frontier s)" + { assume "interior S \ inside (frontier S)" + hence "interior S \ inside (frontier S) = inside (frontier S)" by (simp add: subset_Un_eq) - then have "closure s \ frontier s \ inside (frontier s)" + then have "closure S \ frontier S \ inside (frontier S)" using frontier_def by auto } - then show "closure s \ frontier s \ inside (frontier s)" + then show "closure S \ frontier S \ inside (frontier S)" using interior_inside_frontier [OF assms] by blast qed lemma outside_frontier_eq_complement_closure: - fixes s :: "'a :: {real_normed_vector, perfect_space} set" - assumes "bounded s" "convex s" - shows "outside(frontier s) = - closure s" + fixes S :: "'a :: {real_normed_vector, perfect_space} set" + assumes "bounded S" "convex S" + shows "outside(frontier S) = - closure S" by (metis Diff_subset assms convex_closure frontier_def outside_frontier_misses_closure outside_subset_convex subset_antisym) lemma inside_frontier_eq_interior: - fixes s :: "'a :: {real_normed_vector, perfect_space} set" - shows "\bounded s; convex s\ \ inside(frontier s) = interior s" + fixes S :: "'a :: {real_normed_vector, perfect_space} set" + shows "\bounded S; convex S\ \ inside(frontier S) = interior S" apply (simp add: inside_outside outside_frontier_eq_complement_closure) using closure_subset interior_subset apply (auto simp: frontier_def) done lemma open_inside: - fixes s :: "'a::real_normed_vector set" - assumes "closed s" - shows "open (inside s)" + fixes S :: "'a::real_normed_vector set" + assumes "closed S" + shows "open (inside S)" proof - - { fix x assume x: "x \ inside s" - have "open (connected_component_set (- s) x)" + { fix x assume x: "x \ inside S" + have "open (connected_component_set (- S) x)" using assms open_connected_component by blast - then obtain e where e: "e>0" and e: "\y. dist y x < e \ connected_component (- s) x y" + then obtain e where e: "e>0" and e: "\y. dist y x < e \ connected_component (- S) x y" using dist_not_less_zero apply (simp add: open_dist) by (metis (no_types, lifting) Compl_iff connected_component_refl_eq inside_def mem_Collect_eq x) - then have "\e>0. ball x e \ inside s" + then have "\e>0. ball x e \ inside S" by (metis e dist_commute inside_same_component mem_ball subsetI x) } then show ?thesis @@ -3555,18 +3545,18 @@ qed lemma open_outside: - fixes s :: "'a::real_normed_vector set" - assumes "closed s" - shows "open (outside s)" + fixes S :: "'a::real_normed_vector set" + assumes "closed S" + shows "open (outside S)" proof - - { fix x assume x: "x \ outside s" - have "open (connected_component_set (- s) x)" + { fix x assume x: "x \ outside S" + have "open (connected_component_set (- S) x)" using assms open_connected_component by blast - then obtain e where e: "e>0" and e: "\y. dist y x < e \ connected_component (- s) x y" + then obtain e where e: "e>0" and e: "\y. dist y x < e \ connected_component (- S) x y" using dist_not_less_zero apply (simp add: open_dist) by (metis Int_iff outside_def connected_component_refl_eq x) - then have "\e>0. ball x e \ outside s" + then have "\e>0. ball x e \ outside S" by (metis e dist_commute outside_same_component mem_ball subsetI x) } then show ?thesis @@ -3574,61 +3564,61 @@ qed lemma closure_inside_subset: - fixes s :: "'a::real_normed_vector set" - assumes "closed s" - shows "closure(inside s) \ s \ inside s" + fixes S :: "'a::real_normed_vector set" + assumes "closed S" + shows "closure(inside S) \ S \ inside S" by (metis assms closure_minimal open_closed open_outside sup.cobounded2 union_with_inside) lemma frontier_inside_subset: - fixes s :: "'a::real_normed_vector set" - assumes "closed s" - shows "frontier(inside s) \ s" + fixes S :: "'a::real_normed_vector set" + assumes "closed S" + shows "frontier(inside S) \ S" proof - - have "closure (inside s) \ - inside s = closure (inside s) - interior (inside s)" + have "closure (inside S) \ - inside S = closure (inside S) - interior (inside S)" by (metis (no_types) Diff_Compl assms closure_closed interior_closure open_closed open_inside) - moreover have "- inside s \ - outside s = s" + moreover have "- inside S \ - outside S = S" by (metis (no_types) compl_sup double_compl inside_Un_outside) - moreover have "closure (inside s) \ - outside s" + moreover have "closure (inside S) \ - outside S" by (metis (no_types) assms closure_inside_subset union_with_inside) - ultimately have "closure (inside s) - interior (inside s) \ s" + ultimately have "closure (inside S) - interior (inside S) \ S" by blast then show ?thesis by (simp add: frontier_def open_inside interior_open) qed lemma closure_outside_subset: - fixes s :: "'a::real_normed_vector set" - assumes "closed s" - shows "closure(outside s) \ s \ outside s" + fixes S :: "'a::real_normed_vector set" + assumes "closed S" + shows "closure(outside S) \ S \ outside S" apply (rule closure_minimal, simp) by (metis assms closed_open inside_outside open_inside) lemma frontier_outside_subset: - fixes s :: "'a::real_normed_vector set" - assumes "closed s" - shows "frontier(outside s) \ s" + fixes S :: "'a::real_normed_vector set" + assumes "closed S" + shows "frontier(outside S) \ S" apply (simp add: frontier_def open_outside interior_open) by (metis Diff_subset_conv assms closure_outside_subset interior_eq open_outside sup.commute) lemma inside_complement_unbounded_connected_empty: - "\connected (- s); \ bounded (- s)\ \ inside s = {}" + "\connected (- S); \ bounded (- S)\ \ inside S = {}" apply (simp add: inside_def) by (meson Compl_iff bounded_subset connected_component_maximal order_refl) lemma inside_bounded_complement_connected_empty: - fixes s :: "'a::{real_normed_vector, perfect_space} set" - shows "\connected (- s); bounded s\ \ inside s = {}" + fixes S :: "'a::{real_normed_vector, perfect_space} set" + shows "\connected (- S); bounded S\ \ inside S = {}" by (metis inside_complement_unbounded_connected_empty cobounded_imp_unbounded) lemma inside_inside: - assumes "s \ inside t" - shows "inside s - t \ inside t" + assumes "S \ inside T" + shows "inside S - T \ inside T" unfolding inside_def proof clarify fix x - assume x: "x \ t" "x \ s" and bo: "bounded (connected_component_set (- s) x)" - show "bounded (connected_component_set (- t) x)" - proof (cases "s \ connected_component_set (- t) x = {}") + assume x: "x \ T" "x \ S" and bo: "bounded (connected_component_set (- S) x)" + show "bounded (connected_component_set (- T) x)" + proof (cases "S \ connected_component_set (- T) x = {}") case True show ?thesis apply (rule bounded_subset [OF bo]) apply (rule connected_component_maximal) @@ -3643,68 +3633,68 @@ qed qed -lemma inside_inside_subset: "inside(inside s) \ s" +lemma inside_inside_subset: "inside(inside S) \ S" using inside_inside union_with_outside by fastforce lemma inside_outside_intersect_connected: - "\connected t; inside s \ t \ {}; outside s \ t \ {}\ \ s \ t \ {}" + "\connected T; inside S \ T \ {}; outside S \ T \ {}\ \ S \ T \ {}" apply (simp add: inside_def outside_def ex_in_conv [symmetric] disjoint_eq_subset_Compl, clarify) by (metis (no_types, hide_lams) Compl_anti_mono connected_component_eq connected_component_maximal contra_subsetD double_compl) lemma outside_bounded_nonempty: - fixes s :: "'a :: {real_normed_vector, perfect_space} set" - assumes "bounded s" shows "outside s \ {}" + fixes S :: "'a :: {real_normed_vector, perfect_space} set" + assumes "bounded S" shows "outside S \ {}" by (metis (no_types, lifting) Collect_empty_eq Collect_mem_eq Compl_eq_Diff_UNIV Diff_cancel Diff_disjoint UNIV_I assms ball_eq_empty bounded_diff cobounded_outside convex_ball double_complement order_refl outside_convex outside_def) lemma outside_compact_in_open: - fixes s :: "'a :: {real_normed_vector,perfect_space} set" - assumes s: "compact s" and t: "open t" and "s \ t" "t \ {}" - shows "outside s \ t \ {}" + fixes S :: "'a :: {real_normed_vector,perfect_space} set" + assumes S: "compact S" and T: "open T" and "S \ T" "T \ {}" + shows "outside S \ T \ {}" proof - - have "outside s \ {}" - by (simp add: compact_imp_bounded outside_bounded_nonempty s) - with assms obtain a b where a: "a \ outside s" and b: "b \ t" by auto + have "outside S \ {}" + by (simp add: compact_imp_bounded outside_bounded_nonempty S) + with assms obtain a b where a: "a \ outside S" and b: "b \ T" by auto show ?thesis - proof (cases "a \ t") + proof (cases "a \ T") case True with a show ?thesis by blast next case False - have front: "frontier t \ - s" - using \s \ t\ frontier_disjoint_eq t by auto + have front: "frontier T \ - S" + using \S \ T\ frontier_disjoint_eq T by auto { fix \ - assume "path \" and pimg_sbs: "path_image \ - {pathfinish \} \ interior (- t)" - and pf: "pathfinish \ \ frontier t" and ps: "pathstart \ = a" + assume "path \" and pimg_sbs: "path_image \ - {pathfinish \} \ interior (- T)" + and pf: "pathfinish \ \ frontier T" and ps: "pathstart \ = a" define c where "c = pathfinish \" - have "c \ -s" unfolding c_def using front pf by blast - moreover have "open (-s)" using s compact_imp_closed by blast - ultimately obtain \::real where "\ > 0" and \: "cball c \ \ -s" - using open_contains_cball[of "-s"] s by blast - then obtain d where "d \ t" and d: "dist d c < \" - using closure_approachable [of c t] pf unfolding c_def + have "c \ -S" unfolding c_def using front pf by blast + moreover have "open (-S)" using S compact_imp_closed by blast + ultimately obtain \::real where "\ > 0" and \: "cball c \ \ -S" + using open_contains_cball[of "-S"] S by blast + then obtain d where "d \ T" and d: "dist d c < \" + using closure_approachable [of c T] pf unfolding c_def by (metis Diff_iff frontier_def) - then have "d \ -s" using \ + then have "d \ -S" using \ using dist_commute by (metis contra_subsetD mem_cball not_le not_less_iff_gr_or_eq) - have pimg_sbs_cos: "path_image \ \ -s" + have pimg_sbs_cos: "path_image \ \ -S" using pimg_sbs apply (auto simp: path_image_def) apply (drule subsetD) - using \c \ - s\ \s \ t\ interior_subset apply (auto simp: c_def) + using \c \ - S\ \S \ T\ interior_subset apply (auto simp: c_def) done have "closed_segment c d \ cball c \" apply (simp add: segment_convex_hull) apply (rule hull_minimal) using \\ > 0\ d apply (auto simp: dist_commute) done - with \ have "closed_segment c d \ -s" by blast + with \ have "closed_segment c d \ -S" by blast moreover have con_gcd: "connected (path_image \ \ closed_segment c d)" by (rule connected_Un) (auto simp: c_def \path \\ connected_path_image) - ultimately have "connected_component (- s) a d" + ultimately have "connected_component (- S) a d" unfolding connected_component_def using pimg_sbs_cos ps by blast - then have "outside s \ t \ {}" - using outside_same_component [OF _ a] by (metis IntI \d \ t\ empty_iff) + then have "outside S \ T \ {}" + using outside_same_component [OF _ a] by (metis IntI \d \ T\ empty_iff) } note * = this - have pal: "pathstart (linepath a b) \ closure (- t)" + have pal: "pathstart (linepath a b) \ closure (- T)" by (auto simp: False closure_def) show ?thesis by (rule exists_path_subpath_to_frontier [OF path_linepath pal _ *]) (auto simp: b) @@ -3712,10 +3702,10 @@ qed lemma inside_inside_compact_connected: - fixes s :: "'a :: euclidean_space set" - assumes s: "closed s" and t: "compact t" and "connected t" "s \ inside t" - shows "inside s \ inside t" -proof (cases "inside t = {}") + fixes S :: "'a :: euclidean_space set" + assumes S: "closed S" and T: "compact T" and "connected T" "S \ inside T" + shows "inside S \ inside T" +proof (cases "inside T = {}") case True with assms show ?thesis by auto next case False @@ -3727,120 +3717,120 @@ using connected_convex_1_gen assms False inside_convex by blast next case 2 - have coms: "compact s" - using assms apply (simp add: s compact_eq_bounded_closed) + have coms: "compact S" + using assms apply (simp add: S compact_eq_bounded_closed) by (meson bounded_inside bounded_subset compact_imp_bounded) - then have bst: "bounded (s \ t)" - by (simp add: compact_imp_bounded t) - then obtain r where "0 < r" and r: "s \ t \ ball 0 r" + then have bst: "bounded (S \ T)" + by (simp add: compact_imp_bounded T) + then obtain r where "0 < r" and r: "S \ T \ ball 0 r" using bounded_subset_ballD by blast - have outst: "outside s \ outside t \ {}" + have outst: "outside S \ outside T \ {}" proof - - have "- ball 0 r \ outside s" + have "- ball 0 r \ outside S" apply (rule outside_subset_convex) using r by auto - moreover have "- ball 0 r \ outside t" + moreover have "- ball 0 r \ outside T" apply (rule outside_subset_convex) using r by auto ultimately show ?thesis by (metis Compl_subset_Compl_iff Int_subset_iff bounded_ball inf.orderE outside_bounded_nonempty outside_no_overlap) qed - have "s \ t = {}" using assms + have "S \ T = {}" using assms by (metis disjoint_iff_not_equal inside_no_overlap subsetCE) - moreover have "outside s \ inside t \ {}" - by (meson False assms(4) compact_eq_bounded_closed coms open_inside outside_compact_in_open t) - ultimately have "inside s \ t = {}" - using inside_outside_intersect_connected [OF \connected t\, of s] + moreover have "outside S \ inside T \ {}" + by (meson False assms(4) compact_eq_bounded_closed coms open_inside outside_compact_in_open T) + ultimately have "inside S \ T = {}" + using inside_outside_intersect_connected [OF \connected T\, of S] by (metis "2" compact_eq_bounded_closed coms connected_outside inf.commute inside_outside_intersect_connected outst) then show ?thesis - using inside_inside [OF \s \ inside t\] by blast + using inside_inside [OF \S \ inside T\] by blast qed qed lemma connected_with_inside: - fixes s :: "'a :: real_normed_vector set" - assumes s: "closed s" and cons: "connected s" - shows "connected(s \ inside s)" -proof (cases "s \ inside s = UNIV") + fixes S :: "'a :: real_normed_vector set" + assumes S: "closed S" and cons: "connected S" + shows "connected(S \ inside S)" +proof (cases "S \ inside S = UNIV") case True with assms show ?thesis by auto next case False - then obtain b where b: "b \ s" "b \ inside s" by blast - have *: "\y t. y \ s \ connected t \ a \ t \ y \ t \ t \ (s \ inside s)" if "a \ (s \ inside s)" for a + then obtain b where b: "b \ S" "b \ inside S" by blast + have *: "\y T. y \ S \ connected T \ a \ T \ y \ T \ T \ (S \ inside S)" if "a \ (S \ inside S)" for a using that proof - assume "a \ s" then show ?thesis + assume "a \ S" then show ?thesis apply (rule_tac x=a in exI) apply (rule_tac x="{a}" in exI, simp) done next - assume a: "a \ inside s" + assume a: "a \ inside S" show ?thesis - apply (rule exists_path_subpath_to_frontier [OF path_linepath [of a b], of "inside s"]) + apply (rule exists_path_subpath_to_frontier [OF path_linepath [of a b], of "inside S"]) using a apply (simp add: closure_def) apply (simp add: b) apply (rule_tac x="pathfinish h" in exI) apply (rule_tac x="path_image h" in exI) apply (simp add: pathfinish_in_path_image connected_path_image, auto) - using frontier_inside_subset s apply fastforce - by (metis (no_types, lifting) frontier_inside_subset insertE insert_Diff interior_eq open_inside pathfinish_in_path_image s subsetCE) + using frontier_inside_subset S apply fastforce + by (metis (no_types, lifting) frontier_inside_subset insertE insert_Diff interior_eq open_inside pathfinish_in_path_image S subsetCE) qed show ?thesis apply (simp add: connected_iff_connected_component) apply (simp add: connected_component_def) apply (clarify dest!: *) - apply (rename_tac u u' t t') - apply (rule_tac x="(s \ t \ t')" in exI) - apply (auto simp: intro!: connected_Un cons) + apply (rename_tac u u' T t') + apply (rule_tac x="(S \ T \ t')" in exI) + apply (auto intro!: connected_Un cons) done qed text\The proof is virtually the same as that above.\ lemma connected_with_outside: - fixes s :: "'a :: real_normed_vector set" - assumes s: "closed s" and cons: "connected s" - shows "connected(s \ outside s)" -proof (cases "s \ outside s = UNIV") + fixes S :: "'a :: real_normed_vector set" + assumes S: "closed S" and cons: "connected S" + shows "connected(S \ outside S)" +proof (cases "S \ outside S = UNIV") case True with assms show ?thesis by auto next case False - then obtain b where b: "b \ s" "b \ outside s" by blast - have *: "\y t. y \ s \ connected t \ a \ t \ y \ t \ t \ (s \ outside s)" if "a \ (s \ outside s)" for a + then obtain b where b: "b \ S" "b \ outside S" by blast + have *: "\y T. y \ S \ connected T \ a \ T \ y \ T \ T \ (S \ outside S)" if "a \ (S \ outside S)" for a using that proof - assume "a \ s" then show ?thesis + assume "a \ S" then show ?thesis apply (rule_tac x=a in exI) apply (rule_tac x="{a}" in exI, simp) done next - assume a: "a \ outside s" + assume a: "a \ outside S" show ?thesis - apply (rule exists_path_subpath_to_frontier [OF path_linepath [of a b], of "outside s"]) + apply (rule exists_path_subpath_to_frontier [OF path_linepath [of a b], of "outside S"]) using a apply (simp add: closure_def) apply (simp add: b) apply (rule_tac x="pathfinish h" in exI) apply (rule_tac x="path_image h" in exI) apply (simp add: pathfinish_in_path_image connected_path_image, auto) - using frontier_outside_subset s apply fastforce - by (metis (no_types, lifting) frontier_outside_subset insertE insert_Diff interior_eq open_outside pathfinish_in_path_image s subsetCE) + using frontier_outside_subset S apply fastforce + by (metis (no_types, lifting) frontier_outside_subset insertE insert_Diff interior_eq open_outside pathfinish_in_path_image S subsetCE) qed show ?thesis apply (simp add: connected_iff_connected_component) apply (simp add: connected_component_def) apply (clarify dest!: *) - apply (rename_tac u u' t t') - apply (rule_tac x="(s \ t \ t')" in exI) + apply (rename_tac u u' T t') + apply (rule_tac x="(S \ T \ t')" in exI) apply (auto simp: intro!: connected_Un cons) done qed lemma inside_inside_eq_empty [simp]: - fixes s :: "'a :: {real_normed_vector, perfect_space} set" - assumes s: "closed s" and cons: "connected s" - shows "inside (inside s) = {}" + fixes S :: "'a :: {real_normed_vector, perfect_space} set" + assumes S: "closed S" and cons: "connected S" + shows "inside (inside S) = {}" by (metis (no_types) unbounded_outside connected_with_outside [OF assms] bounded_Un inside_complement_unbounded_connected_empty unbounded_outside union_with_outside) lemma inside_in_components: - "inside s \ components (- s) \ connected(inside s) \ inside s \ {}" + "inside S \ components (- S) \ connected(inside S) \ inside S \ {}" apply (simp add: in_components_maximal) apply (auto intro: inside_same_component connected_componentI) apply (metis IntI empty_iff inside_no_overlap) @@ -3848,15 +3838,15 @@ text\The proof is virtually the same as that above.\ lemma outside_in_components: - "outside s \ components (- s) \ connected(outside s) \ outside s \ {}" + "outside S \ components (- S) \ connected(outside S) \ outside S \ {}" apply (simp add: in_components_maximal) apply (auto intro: outside_same_component connected_componentI) apply (metis IntI empty_iff outside_no_overlap) done lemma bounded_unique_outside: - fixes s :: "'a :: euclidean_space set" - shows "\bounded s; DIM('a) \ 2\ \ (c \ components (- s) \ \ bounded c \ c = outside s)" + fixes S :: "'a :: euclidean_space set" + shows "\bounded S; DIM('a) \ 2\ \ (c \ components (- S) \ \ bounded c \ c = outside S)" apply (rule iffI) apply (metis cobounded_unique_unbounded_components connected_outside double_compl outside_bounded_nonempty outside_in_components unbounded_outside) by (simp add: connected_outside outside_bounded_nonempty outside_in_components unbounded_outside) @@ -3900,19 +3890,22 @@ by (metis (no_types) Klim zKs y contf comp_assoc continuous_on_closure_sequentially) with fz have wy: "w = f y" using fz LIMSEQ_unique ftendsw by auto have rle: "r \ norm (f y - f a)" - apply (rule le_no) - using w wy oint - by (force simp: imageI image_mono interiorI interior_subset frontier_def y) + proof (rule le_no) + show "y \ frontier S" + using w wy oint by (force simp: imageI image_mono interiorI interior_subset frontier_def y) + qed have **: "(b \ (- S) \ {} \ b - (- S) \ {} \ b \ f \ {}) - \ (b \ S \ {}) \ b \ f = {} \ - b \ S" for b f and S :: "'b set" + \ (b \ S \ {}) \ b \ f = {} \ b \ S" + for b f and S :: "'b set" by blast + have \
: "\y. \norm (f a - y) < r; y \ frontier (f ` S)\ \ False" + by (metis dw_le norm_minus_commute not_less order_trans rle wy) show ?thesis apply (rule **) (*such a horrible mess*) apply (rule connected_Int_frontier [where t = "f`S", OF connected_ball]) using \a \ S\ \0 < r\ - apply (auto simp: disjoint_iff_not_equal dist_norm) - by (metis dw_le norm_minus_commute not_less order_trans rle wy) + apply (auto simp: disjoint_iff_not_equal dist_norm dest: \
) + done qed diff -r 0f3d24dc197f -r 0881bc2c607d src/HOL/Analysis/Starlike.thy --- a/src/HOL/Analysis/Starlike.thy Sun Aug 30 15:15:28 2020 +0000 +++ b/src/HOL/Analysis/Starlike.thy Sun Aug 30 21:21:04 2020 +0100 @@ -2823,14 +2823,11 @@ by (auto simp: dist_real_def field_simps split: split_min) with \x \ interior I\ e interior_subset[of I] have "t \ I" "x \ I" by auto - have "open (interior I)" by auto - from openE[OF this \x \ interior I\] - obtain e where "0 < e" "ball x e \ interior I" . - moreover define K where "K = x - e / 2" + define K where "K = x - e / 2" with \0 < e\ have "K \ ball x e" "K < x" by (auto simp: dist_real_def) - ultimately have "K \ I" "K < x" "x \ I" - using interior_subset[of I] \x \ interior I\ by auto + then have "K \ I" + using \interior I \ I\ e(2) by blast have "Inf (?F x) \ (f x - f y) / (x - y)" proof (intro bdd_belowI cInf_lower2) @@ -2870,11 +2867,8 @@ by auto finally show "(f x - f y) / (x - y) \ z" . next - have "open (interior I)" by auto - from openE[OF this \x \ interior I\] - obtain e where e: "0 < e" "ball x e \ interior I" . - then have "x + e / 2 \ ball x e" - by (auto simp: dist_real_def) + have "x + e / 2 \ ball x e" + using e by (auto simp: dist_real_def) with e interior_subset[of I] have "x + e / 2 \ {x<..} \ I" by auto then show "?F x \ {}" @@ -2897,58 +2891,59 @@ qed lemma affine_independent_convex_affine_hull: - fixes s :: "'a::euclidean_space set" - assumes "\ affine_dependent s" "t \ s" - shows "convex hull t = affine hull t \ convex hull s" + fixes S :: "'a::euclidean_space set" + assumes "\ affine_dependent S" "T \ S" + shows "convex hull T = affine hull T \ convex hull S" proof - - have fin: "finite s" "finite t" using assms aff_independent_finite finite_subset by auto + have fin: "finite S" "finite T" using assms aff_independent_finite finite_subset by auto { fix u v x - assume uv: "sum u t = 1" "\x\s. 0 \ v x" "sum v s = 1" - "(\x\s. v x *\<^sub>R x) = (\v\t. u v *\<^sub>R v)" "x \ t" - then have s: "s = (s - t) \ t" \ \split into separate cases\ + assume uv: "sum u T = 1" "\x\S. 0 \ v x" "sum v S = 1" + "(\x\S. v x *\<^sub>R x) = (\v\T. u v *\<^sub>R v)" "x \ T" + then have S: "S = (S - T) \ T" \ \split into separate cases\ using assms by auto - have [simp]: "(\x\t. v x *\<^sub>R x) + (\x\s - t. v x *\<^sub>R x) = (\x\t. u x *\<^sub>R x)" - "sum v t + sum v (s - t) = 1" - using uv fin s + have [simp]: "(\x\T. v x *\<^sub>R x) + (\x\S - T. v x *\<^sub>R x) = (\x\T. u x *\<^sub>R x)" + "sum v T + sum v (S - T) = 1" + using uv fin S by (auto simp: sum.union_disjoint [symmetric] Un_commute) - have "(\x\s. if x \ t then v x - u x else v x) = 0" - "(\x\s. (if x \ t then v x - u x else v x) *\<^sub>R x) = 0" + have "(\x\S. if x \ T then v x - u x else v x) = 0" + "(\x\S. (if x \ T then v x - u x else v x) *\<^sub>R x) = 0" using uv fin - by (subst s, subst sum.union_disjoint, auto simp: algebra_simps sum_subtractf)+ + by (subst S, subst sum.union_disjoint, auto simp: algebra_simps sum_subtractf)+ } note [simp] = this - have "convex hull t \ affine hull t" + have "convex hull T \ affine hull T" using convex_hull_subset_affine_hull by blast - moreover have "convex hull t \ convex hull s" + moreover have "convex hull T \ convex hull S" using assms hull_mono by blast - moreover have "affine hull t \ convex hull s \ convex hull t" - using assms - apply (simp add: convex_hull_finite affine_hull_finite fin affine_dependent_explicit) - apply (drule_tac x=s in spec) - apply (auto simp: fin) - apply (rule_tac x=u in exI) - apply (rename_tac v) - apply (drule_tac x="\x. if x \ t then v x - u x else v x" in spec) - apply (force)+ - done + moreover have "affine hull T \ convex hull S \ convex hull T" + proof - + have 0: "\u. sum u S = 0 \ (\v\S. u v = 0) \ (\v\S. u v *\<^sub>R v) \ 0" + using affine_dependent_explicit_finite assms(1) fin(1) by auto + show ?thesis + apply (clarsimp simp add: convex_hull_finite affine_hull_finite fin ) + apply (rule_tac x=u in exI) + subgoal for u v + using 0 [of "\x. if x \ T then v x - u x else v x"] \T \ S\ by force + done + qed ultimately show ?thesis by blast qed lemma affine_independent_span_eq: - fixes s :: "'a::euclidean_space set" - assumes "\ affine_dependent s" "card s = Suc (DIM ('a))" - shows "affine hull s = UNIV" -proof (cases "s = {}") + fixes S :: "'a::euclidean_space set" + assumes "\ affine_dependent S" "card S = Suc (DIM ('a))" + shows "affine hull S = UNIV" +proof (cases "S = {}") case True then show ?thesis using assms by simp next case False - then obtain a t where t: "a \ t" "s = insert a t" + then obtain a T where T: "a \ T" "S = insert a T" by blast - then have fin: "finite t" using assms + then have fin: "finite T" using assms by (metis finite_insert aff_independent_finite) show ?thesis - using assms t fin + using assms T fin apply (simp add: affine_dependent_iff_dependent affine_hull_insert_span_gen) apply (rule subset_antisym) apply force @@ -2960,9 +2955,9 @@ qed lemma affine_independent_span_gt: - fixes s :: "'a::euclidean_space set" - assumes ind: "\ affine_dependent s" and dim: "DIM ('a) < card s" - shows "affine hull s = UNIV" + fixes S :: "'a::euclidean_space set" + assumes ind: "\ affine_dependent S" and dim: "DIM ('a) < card S" + shows "affine hull S = UNIV" apply (rule affine_independent_span_eq [OF ind]) apply (rule antisym) using assms @@ -2971,35 +2966,35 @@ done lemma empty_interior_affine_hull: - fixes s :: "'a::euclidean_space set" - assumes "finite s" and dim: "card s \ DIM ('a)" - shows "interior(affine hull s) = {}" + fixes S :: "'a::euclidean_space set" + assumes "finite S" and dim: "card S \ DIM ('a)" + shows "interior(affine hull S) = {}" using assms - apply (induct s rule: finite_induct) + apply (induct S rule: finite_induct) apply (simp_all add: affine_dependent_iff_dependent affine_hull_insert_span_gen interior_translation) apply (rule empty_interior_lowdim) by (auto simp: Suc_le_lessD card_image_le dual_order.trans intro!: dim_le_card'[THEN le_less_trans]) lemma empty_interior_convex_hull: - fixes s :: "'a::euclidean_space set" - assumes "finite s" and dim: "card s \ DIM ('a)" - shows "interior(convex hull s) = {}" + fixes S :: "'a::euclidean_space set" + assumes "finite S" and dim: "card S \ DIM ('a)" + shows "interior(convex hull S) = {}" by (metis Diff_empty Diff_eq_empty_iff convex_hull_subset_affine_hull interior_mono empty_interior_affine_hull [OF assms]) lemma explicit_subset_rel_interior_convex_hull: - fixes s :: "'a::euclidean_space set" - shows "finite s - \ {y. \u. (\x \ s. 0 < u x \ u x < 1) \ sum u s = 1 \ sum (\x. u x *\<^sub>R x) s = y} - \ rel_interior (convex hull s)" - by (force simp add: rel_interior_convex_hull_union [where S="\x. {x}" and I=s, simplified]) + fixes S :: "'a::euclidean_space set" + shows "finite S + \ {y. \u. (\x \ S. 0 < u x \ u x < 1) \ sum u S = 1 \ sum (\x. u x *\<^sub>R x) S = y} + \ rel_interior (convex hull S)" + by (force simp add: rel_interior_convex_hull_union [where S="\x. {x}" and I=S, simplified]) lemma explicit_subset_rel_interior_convex_hull_minimal: - fixes s :: "'a::euclidean_space set" - shows "finite s - \ {y. \u. (\x \ s. 0 < u x) \ sum u s = 1 \ sum (\x. u x *\<^sub>R x) s = y} - \ rel_interior (convex hull s)" - by (force simp add: rel_interior_convex_hull_union [where S="\x. {x}" and I=s, simplified]) + fixes S :: "'a::euclidean_space set" + shows "finite S + \ {y. \u. (\x \ S. 0 < u x) \ sum u S = 1 \ sum (\x. u x *\<^sub>R x) S = y} + \ rel_interior (convex hull S)" + by (force simp add: rel_interior_convex_hull_union [where S="\x. {x}" and I=S, simplified]) lemma rel_interior_convex_hull_explicit: fixes s :: "'a::euclidean_space set" diff -r 0f3d24dc197f -r 0881bc2c607d src/HOL/Complex_Analysis/Conformal_Mappings.thy --- a/src/HOL/Complex_Analysis/Conformal_Mappings.thy Sun Aug 30 15:15:28 2020 +0000 +++ b/src/HOL/Complex_Analysis/Conformal_Mappings.thy Sun Aug 30 21:21:04 2020 +0100 @@ -1024,12 +1024,9 @@ by (meson open_ball centre_in_ball) define U where "U = (\w. (w - \) * g w) ` T" have "open U" by (metis oimT U_def) - have "0 \ U" - apply (auto simp: U_def) - apply (rule image_eqI [where x = \]) - apply (auto simp: \\ \ T\) - done - then obtain \ where "\>0" and \: "cball 0 \ \ U" + moreover have "0 \ U" + using \\ \ T\ by (auto simp: U_def intro: image_eqI [where x = \]) + ultimately obtain \ where "\>0" and \: "cball 0 \ \ U" using \open U\ open_contains_cball by blast then have "\ * exp(2 * of_real pi * \ * (0/n)) \ cball 0 \" "\ * exp(2 * of_real pi * \ * (1/n)) \ cball 0 \"