section‹Convex Sets and Functions on (Normed) Euclidean Spaces›
theory Convex_Euclidean_Space imports
Convex Topology_Euclidean_Space Line_Segment begin
subsection✐‹tag unimportant›‹Topological Properties of Convex Sets and Functions›
lemma aff_dim_cball: fixes a :: "'n::euclidean_space" assumes"e > 0" shows"aff_dim (cball a e) = int (DIM('n))" proof - have"(λx. a + x) ` (cball 0 e) ⊆ cball a e" unfolding cball_def dist_norm by auto thenhave"aff_dim (cball (0 :: 'n::euclidean_space) e) ≤ aff_dim (cball a e)" using aff_dim_translation_eq[of a "cball 0 e"]
aff_dim_subset[of "(+) a ` cball 0 e""cball a e"] by auto moreoverhave"aff_dim (cball (0 :: 'n::euclidean_space) e) = int (DIM('n))" using hull_inc[of "(0 :: 'n::euclidean_space)""cball 0 e"]
centre_in_cball[of "(0 :: 'n::euclidean_space)"] assms by (simp add: dim_cball[of e] aff_dim_zero[of "cball 0 e"]) ultimatelyshow ?thesis using aff_dim_le_DIM[of "cball a e"] by auto qed
lemma aff_dim_open: fixes S :: "'n::euclidean_space set" assumes"open S" and"S ≠ {}" shows"aff_dim S = int (DIM('n))" proof - obtain x where"x ∈ S" using assms by auto thenobtain e where e: "e > 0""cball x e ⊆ S" using open_contains_cball[of S] assms by auto thenhave"aff_dim (cball x e) ≤ aff_dim S" using aff_dim_subset by auto with e show ?thesis using aff_dim_cball[of e x] aff_dim_le_DIM[of S] by auto qed
lemma low_dim_interior: fixes S :: "'n::euclidean_space set" assumes"¬ aff_dim S = int (DIM('n))" shows"interior S = {}" proof - have"aff_dim(interior S) ≤ aff_dim S" using interior_subset aff_dim_subset[of "interior S" S] by auto thenshow ?thesis using aff_dim_open[of "interior S"] aff_dim_le_DIM[of S] assms by auto qed
corollary empty_interior_lowdim: fixes S :: "'n::euclidean_space set" shows"dim S < DIM ('n) ==> interior S = {}" by (metis low_dim_interior affine_hull_UNIV dim_affine_hull less_not_refl dim_UNIV)
corollary aff_dim_nonempty_interior: fixes S :: "'a::euclidean_space set" shows"interior S ≠ {} ==> aff_dim S = DIM('a)" by (metis low_dim_interior)
subsection‹Relative interior of a set›
definition✐‹tag important›"rel_interior S = {x. ∃T. openin (top_of_set (affine hull S)) T ∧ x ∈ T ∧ T ⊆ S}"
lemma rel_interior_maximal: "[T ⊆ S; openin(top_of_set (affine hull S)) T]==> T ⊆ (rel_interior S)" by (auto simp: rel_interior_def)
lemma rel_interior: "rel_interior S = {x ∈ S. ∃T. open T ∧ x ∈ T ∧ T ∩ affine hull S ⊆ S}"
(is"?lhs = ?rhs") proof show"?lhs ⊆ ?rhs" by (force simp add: rel_interior_def openin_open)
{ fix x T assume *: "x ∈ S""open T""x ∈ T""T ∩ affine hull S ⊆ S" thenhave **: "x ∈ T ∩ affine hull S" using hull_inc by auto with * have"∃Tb. (∃Ta. open Ta ∧ Tb = affine hull S ∩ Ta) ∧ x ∈ Tb ∧ Tb ⊆ S" by (rule_tac x = "T ∩ (affine hull S)"in exI) auto
} thenshow"?rhs ⊆ ?lhs" by (force simp add: rel_interior_def openin_open) qed
lemma mem_rel_interior: "x ∈ rel_interior S ⟷ (∃T. open T ∧ x ∈ T ∩ S ∧ T ∩ affine hull S ⊆ S)" by (auto simp: rel_interior)
lemma mem_rel_interior_ball: "x ∈ rel_interior S ⟷ x ∈ S ∧ (∃e. e > 0 ∧ ball x e ∩ affine hull S ⊆ S)"
(is"?lhs = ?rhs") proof assume ?rhs thenshow ?lhs by (simp add: rel_interior) (meson Elementary_Metric_Spaces.open_ball centre_in_ball) qed (force simp: rel_interior open_contains_ball)
lemma rel_interior_ball: "rel_interior S = {x ∈ S. ∃e. e > 0 ∧ ball x e ∩ affine hull S ⊆ S}" using mem_rel_interior_ball [of _ S] by auto
lemma mem_rel_interior_cball: "x ∈ rel_interior S ⟷ x ∈ S ∧ (∃e. e > 0 ∧ cball x e ∩ affine hull S ⊆ S)"
(is"?lhs = ?rhs") proof assume ?rhs thenobtain e where"x ∈ S""e > 0""cball x e ∩ affine hull S ⊆ S" by (auto simp: rel_interior) thenhave"ball x e ∩ affine hull S ⊆ S" by auto thenshow ?lhs using‹0 < e›‹x ∈ S› rel_interior_ball by auto qed (force simp: rel_interior open_contains_cball)
lemma rel_interior_cball: "rel_interior S = {x ∈ S. ∃e. e > 0 ∧ cball x e ∩ affine hull S ⊆ S}" using mem_rel_interior_cball [of _ S] by auto
lemma rel_interior_sing [simp]: fixes a :: "'n::euclidean_space"shows"rel_interior {a} = {a}" proof - have"∃x::real. 0 < x" using zero_less_one by blast thenshow ?thesis by (auto simp: rel_interior_ball) qed
lemma subset_rel_interior: fixes S T :: "'n::euclidean_space set" assumes"S ⊆ T" and"affine hull S = affine hull T" shows"rel_interior S ⊆ rel_interior T" using assms by (auto simp: rel_interior_def)
lemma rel_interior_subset: "rel_interior S ⊆ S" by (auto simp: rel_interior_def)
lemma rel_interior_subset_closure: "rel_interior S ⊆ closure S" using rel_interior_subset by (auto simp: closure_def)
lemma interior_subset_rel_interior: "interior S ⊆ rel_interior S" by (auto simp: rel_interior interior_def)
lemma interior_rel_interior: fixes S :: "'n::euclidean_space set" assumes"aff_dim S = int(DIM('n))" shows"rel_interior S = interior S" proof - have"affine hull S = UNIV" using assms affine_hull_UNIV[of S] by auto thenshow ?thesis unfolding rel_interior interior_def by auto qed
lemma rel_interior_interior: fixes S :: "'n::euclidean_space set" assumes"affine hull S = UNIV" shows"rel_interior S = interior S" using assms unfolding rel_interior interior_def by auto
lemma rel_interior_open: fixes S :: "'n::euclidean_space set" assumes"open S" shows"rel_interior S = S" by (metis assms interior_eq interior_subset_rel_interior rel_interior_subset set_eq_subset)
lemma interior_rel_interior_gen: fixes S :: "'n::euclidean_space set" shows"interior S = (if aff_dim S = int(DIM('n)) then rel_interior S else {})" by (metis interior_rel_interior low_dim_interior)
lemma rel_interior_nonempty_interior: fixes S :: "'n::euclidean_space set" shows"interior S ≠ {} ==> rel_interior S = interior S" by (metis interior_rel_interior_gen)
lemma affine_hull_nonempty_interior: fixes S :: "'n::euclidean_space set" shows"interior S ≠ {} ==> affine hull S = UNIV" by (metis affine_hull_UNIV interior_rel_interior_gen)
lemma rel_interior_affine_hull [simp]: fixes S :: "'n::euclidean_space set" shows"rel_interior (affine hull S) = affine hull S" proof - have *: "rel_interior (affine hull S) ⊆ affine hull S" using rel_interior_subset by auto
{ fix x assume x: "x ∈ affine hull S" define e :: real where"e = 1" thenhave"e > 0""ball x e ∩ affine hull (affine hull S) ⊆ affine hull S" using hull_hull[of _ S] by auto thenhave"x ∈ rel_interior (affine hull S)" using x rel_interior_ball[of "affine hull S"] by auto
} thenshow ?thesis using * by auto qed
lemma rel_interior_convex_shrink: fixes S :: "'a::euclidean_space set" assumes"convex S" and"c ∈ rel_interior S" and"x ∈ S" and"0 < e" and"e ≤ 1" shows"x - e *R (x - c) ∈ rel_interior S" proof - obtain d where"d > 0"and d: "ball c d ∩ affine hull S ⊆ S" using assms(2) unfolding mem_rel_interior_ball by auto
{ fix y assume as: "dist (x - e *R (x - c)) y < e * d""y ∈ affine hull S" have *: "y = (1 - (1 - e)) *R ((1 / e) *R y - ((1 - e) / e) *R x) + (1 - e) *R x" using‹e > 0›by (auto simp: scaleR_left_diff_distrib scaleR_right_diff_distrib) have"x ∈ affine hull S" using assms hull_subset[of S] by auto moreoverhave"1 / e + - ((1 - e) / e) = 1" using‹e > 0› left_diff_distrib[of "1""(1-e)""1/e"] by auto ultimatelyhave **: "(1 / e) *R y - ((1 - e) / e) *R x ∈ affine hull S" using as affine_affine_hull[of S] mem_affine[of "affine hull S" y x "(1 / e)""-((1 - e) / e)"] by (simp add: algebra_simps) have"c - ((1 / e) *R y - ((1 - e) / e) *R x) = (1 / e) *R (e *R c - y + (1 - e) *R x)" using‹e > 0› by (auto simp: euclidean_eq_iff[where 'a='a] field_simps inner_simps) thenhave"dist c ((1 / e) *R y - ((1 - e) / e) *R x) = ∣1/e∣ * norm (e *R c - y + (1 - e) *R x)" unfolding dist_norm norm_scaleR[symmetric] by auto alsohave"… = ∣1/e∣ * norm (x - e *R (x - c) - y)" by (auto intro!:arg_cong[where f=norm] simp add: algebra_simps) alsohave"… < d" using as[unfolded dist_norm] and‹e > 0› by (auto simp:pos_divide_less_eq[OF ‹e > 0›] mult.commute) finallyhave"(1 / e) *R y - ((1 - e) / e) *R x ∈ S" using"**" d by auto thenhave"y ∈ S" using * convexD [OF ‹convex S›] assms(3-5) by (metis diff_add_cancel diff_ge_0_iff_ge le_add_same_cancel1 less_eq_real_def)
} thenhave"ball (x - e *R (x - c)) (e*d) ∩ affine hull S ⊆ S" by auto moreoverhave"e * d > 0" using‹e > 0›‹d > 0›by simp moreoverhave c: "c ∈ S" using assms rel_interior_subset by auto moreoverfrom c have"x - e *R (x - c) ∈ S" using convexD_alt[of S x c e] assms by (metis diff_add_eq diff_diff_eq2 less_eq_real_def scaleR_diff_left scaleR_one scale_right_diff_distrib) ultimatelyshow ?thesis using mem_rel_interior_ball[of "x - e *R (x - c)" S] ‹e > 0›by auto qed
lemma interior_real_atLeast [simp]: fixes a :: real shows"interior {a..} = {a<..}" proof -
{ fix y have"ball y (y - a) ⊆ {a..}" by (auto simp: dist_norm) moreoverassume"a < y" ultimatelyhave"y ∈ interior {a..}" by (force simp add: mem_interior)
} moreover
{ fix y assume"y ∈ interior {a..}" thenobtain e where e: "e > 0""cball y e ⊆ {a..}" using mem_interior_cball[of y "{a..}"] by auto moreoverfrom e have"y - e ∈ cball y e" by (auto simp: cball_def dist_norm) ultimatelyhave"a ≤ y - e"by blast thenhave"a < y"using e by auto
} ultimatelyshow ?thesis by auto qed
lemma continuous_ge_on_Ioo: assumes"continuous_on {c..d} g""∧x. x ∈ {c<..<d} ==> g x ≥ a""c < d""x ∈ {c..d}" shows"g (x::real) ≥ (a::real)" proof- from assms(3) have"{c..d} = closure {c<..<d}"by (rule closure_greaterThanLessThan[symmetric]) alsofrom assms(2) have"{c<..<d} ⊆ (g -` {a..} ∩ {c..d})"by auto hence"closure {c<..<d} ⊆ closure (g -` {a..} ∩ {c..d})"by (rule closure_mono) alsofrom assms(1) have"closed (g -` {a..} ∩ {c..d})" by (auto simp: continuous_on_closed_vimage) hence"closure (g -` {a..} ∩ {c..d}) = g -` {a..} ∩ {c..d}"by simp finallyshow ?thesis using‹x ∈ {c..d}›by auto qed
lemma interior_real_atMost [simp]: fixes a :: real shows"interior {..a} = {..<a}" proof -
{ fix y have"ball y (a - y) ⊆ {..a}" by (auto simp: dist_norm) moreoverassume"a > y" ultimatelyhave"y ∈ interior {..a}" by (force simp add: mem_interior)
} moreover
{ fix y assume"y ∈ interior {..a}" thenobtain e where e: "e > 0""cball y e ⊆ {..a}" using mem_interior_cball[of y "{..a}"] by auto moreoverfrom e have"y + e ∈ cball y e" by (auto simp: cball_def dist_norm) ultimatelyhave"a ≥ y + e"by auto thenhave"a > y"using e by auto
} ultimatelyshow ?thesis by auto qed
lemma interior_atLeastAtMost_real [simp]: "interior {a..b} = {a<..<b :: real}" proof- have"{a..b} = {a..} ∩ {..b}"by auto alsohave"interior … = {a<..} ∩ {..<b}" by (simp) alsohave"… = {a<..<b}"by auto finallyshow ?thesis . qed
lemma rel_interior_real_box [simp]: fixes a b :: real assumes"a < b" shows"rel_interior {a .. b} = {a <..< b}" proof - have"box a b ≠ {}" using assms unfolding set_eq_iff by (auto intro!: exI[of _ "(a + b) / 2"] simp: box_def) thenshow ?thesis using interior_rel_interior_gen[of "cbox a b", symmetric] by (simp split: if_split_asm del: box_real add: box_real[symmetric]) qed
lemma rel_interior_real_semiline [simp]: fixes a :: real shows"rel_interior {a..} = {a<..}" proof - have *: "{a<..} ≠ {}" unfolding set_eq_iff by (auto intro!: exI[of _ "a + 1"]) thenshow ?thesis using interior_real_atLeast interior_rel_interior_gen[of "{a..}"] by (auto split: if_split_asm) qed
subsubsection‹Relative open sets›
definition✐‹tag important›"rel_open S ⟷ rel_interior S = S"
lemma rel_open: "rel_open S ⟷ openin (top_of_set (affine hull S)) S" (is"?lhs = ?rhs") proof assume ?lhs thenshow ?rhs unfolding rel_open_def rel_interior_def using openin_subopen[of "top_of_set (affine hull S)" S] by auto qed (auto simp: rel_open_def rel_interior_def)
lemma openin_rel_interior: "openin (top_of_set (affine hull S)) (rel_interior S)" using openin_subopen by (fastforce simp add: rel_interior_def)
lemma affine_rel_open: fixes S :: "'n::euclidean_space set" assumes"affine S" shows"rel_open S" unfolding rel_open_def using assms rel_interior_affine_hull[of S] affine_hull_eq[of S] by metis
lemma affine_closed: fixes S :: "'n::euclidean_space set" assumes"affine S" shows"closed S" proof -
{ assume"S ≠ {}" thenobtain L where L: "subspace L""affine_parallel S L" using assms affine_parallel_subspace[of S] by auto thenobtain a where a: "S = ((+) a ` L)" using affine_parallel_def[of L S] affine_parallel_commute by auto from L have"closed L"using closed_subspace by auto thenhave"closed S" using closed_translation a by auto
} thenshow ?thesis by auto qed
lemma closure_affine_hull: fixes S :: "'n::euclidean_space set" shows"closure S ⊆ affine hull S" by (intro closure_minimal hull_subset affine_closed affine_affine_hull)
lemma closed_affine_hull [iff]: fixes S :: "'n::euclidean_space set" shows"closed (affine hull S)" by (metis affine_affine_hull affine_closed)
lemma closure_same_affine_hull [simp]: fixes S :: "'n::euclidean_space set" shows"affine hull (closure S) = affine hull S" proof - have"affine hull (closure S) ⊆ affine hull S" using hull_mono[of "closure S""affine hull S""affine"]
closure_affine_hull[of S] hull_hull[of "affine" S] by auto moreoverhave"affine hull (closure S) ⊇ affine hull S" using hull_mono[of "S""closure S""affine"] closure_subset by auto ultimatelyshow ?thesis by auto qed
lemma closure_aff_dim [simp]: fixes S :: "'n::euclidean_space set" shows"aff_dim (closure S) = aff_dim S" proof - have"aff_dim S ≤ aff_dim (closure S)" using aff_dim_subset closure_subset by auto moreoverhave"aff_dim (closure S) ≤ aff_dim (affine hull S)" using aff_dim_subset closure_affine_hull by blast moreoverhave"aff_dim (affine hull S) = aff_dim S" using aff_dim_affine_hull by auto ultimatelyshow ?thesis by auto qed
lemma rel_interior_closure_convex_shrink: fixes S :: "_::euclidean_space set" assumes"convex S" and"c ∈ rel_interior S" and"x ∈ closure S" and"e > 0" and"e ≤ 1" shows"x - e *R (x - c) ∈ rel_interior S" proof - obtain d where"d > 0"and d: "ball c d ∩ affine hull S ⊆ S" using assms(2) unfolding mem_rel_interior_ball by auto have"∃y ∈ S. norm (y - x) * (1 - e) < e * d" proof (cases "x ∈ S") case True thenshow ?thesis using‹e > 0›‹d > 0›by force next case False thenhave x: "x islimpt S" using assms(3)[unfolded closure_def] by auto show ?thesis proof (cases "e = 1") case True obtain y where"y ∈ S""y ≠ x""dist y x < 1" using x[unfolded islimpt_approachable,THEN spec[where x=1]] by auto thenshow ?thesis unfolding True using‹d > 0›by (force simp add: ) next case False thenhave"0 < e * d / (1 - e)"and *: "1 - e > 0" using‹e ≤ 1›‹e > 0›‹d > 0›by auto thenobtain y where"y ∈ S""y ≠ x""dist y x < e * d / (1 - e)" using x[unfolded islimpt_approachable,THEN spec[where x="e*d / (1 - e)"]] by auto thenshow ?thesis unfolding dist_norm using pos_less_divide_eq[OF *] by force qed qed thenobtain y where"y ∈ S"and y: "norm (y - x) * (1 - e) < e * d" by auto define z where"z = c + ((1 - e) / e) *R (x - y)" have *: "x - e *R (x - c) = y - e *R (y - z)" unfolding z_def using‹e > 0› by (auto simp: scaleR_right_diff_distrib scaleR_right_distrib scaleR_left_diff_distrib) have zball: "z ∈ ball c d" using mem_ball z_def dist_norm[of c] using y and assms(4,5) by (simp add: norm_minus_commute) (simp add: field_simps) have"x ∈ affine hull S" using closure_affine_hull assms by auto moreoverhave"y ∈ affine hull S" using‹y ∈ S› hull_subset[of S] by auto moreoverhave"c ∈ affine hull S" using assms rel_interior_subset hull_subset[of S] by auto ultimatelyhave"z ∈ affine hull S" using z_def affine_affine_hull[of S]
mem_affine_3_minus [of "affine hull S" c x y "(1 - e) / e"]
assms by simp thenhave"z ∈ S"using d zball by auto obtain d1 where"d1 > 0"and d1: "ball z d1 ≤ ball c d" using zball open_ball[of c d] openE[of "ball c d" z] by auto thenhave"ball z d1 ∩ affine hull S ⊆ ball c d ∩ affine hull S" by auto thenhave"ball z d1 ∩ affine hull S ⊆ S" using d by auto thenhave"z ∈ rel_interior S" using mem_rel_interior_ball using‹d1 > 0›‹z ∈ S›by auto thenhave"y - e *R (y - z) ∈ rel_interior S" using rel_interior_convex_shrink[of S z y e] assms ‹y ∈ S›by auto thenshow ?thesis using * by auto qed
lemma rel_interior_eq: "rel_interior s = s ⟷ openin(top_of_set (affine hull s)) s" using rel_open rel_open_def by blast
lemma rel_interior_openin: "openin(top_of_set (affine hull s)) s ==> rel_interior s = s" by (simp add: rel_interior_eq)
lemma rel_interior_affine: fixes S :: "'n::euclidean_space set" shows"affine S ==> rel_interior S = S" using affine_rel_open rel_open_def by auto
lemma rel_interior_eq_closure: fixes S :: "'n::euclidean_space set" shows"rel_interior S = closure S ⟷ affine S" proof (cases "S = {}") case True thenshow ?thesis by auto next case False show ?thesis proof assume eq: "rel_interior S = closure S" have"openin (top_of_set (affine hull S)) S" by (metis eq closure_subset openin_rel_interior rel_interior_subset subset_antisym) moreoverhave"closedin (top_of_set (affine hull S)) S" by (metis closed_subset closure_subset_eq eq hull_subset rel_interior_subset) ultimatelyhave"S = {} ∨ S = affine hull S" using convex_connected connected_clopen convex_affine_hull by metis with False have"affine hull S = S" by auto thenshow"affine S" by (metis affine_hull_eq) next assume"affine S" thenshow"rel_interior S = closure S" by (simp add: rel_interior_affine affine_closed) qed qed
subsubsection✐‹tag unimportant›\<open>Relative interior preserves under linear transformations›
lemma rel_interior_translation_aux: fixes a :: "'n::euclidean_space" shows"((λx. a + x) ` rel_interior S) ⊆ rel_interior ((λx. a + x) ` S)" proof -
{ fix x assume x: "x ∈ rel_interior S" thenobtain T where"open T""x ∈ T ∩ S""T ∩ affine hull S ⊆ S" using mem_rel_interior[of x S] by auto thenhave"open ((λx. a + x) ` T)" and"a + x ∈ ((λx. a + x) ` T) ∩ ((λx. a + x) ` S)" and"((λx. a + x) ` T) ∩ affine hull ((λx. a + x) ` S) ⊆ (λx. a + x) ` S" using affine_hull_translation[of a S] open_translation[of T a] x by auto thenhave"a + x ∈ rel_interior ((λx. a + x) ` S)" using mem_rel_interior[of "a+x""((λx. a + x) ` S)"] by auto
} thenshow ?thesis by auto qed
lemma rel_interior_translation: fixes a :: "'n::euclidean_space" shows"rel_interior ((λx. a + x) ` S) = (λx. a + x) ` rel_interior S" proof - have"(λx. (-a) + x) ` rel_interior ((λx. a + x) ` S) ⊆ rel_interior S" using rel_interior_translation_aux[of "-a""(λx. a + x) ` S"]
translation_assoc[of "-a""a"] by auto thenhave"((λx. a + x) ` rel_interior S) ⊇ rel_interior ((λx. a + x) ` S)" using translation_inverse_subset[of a "rel_interior ((+) a ` S)""rel_interior S"] by auto thenshow ?thesis using rel_interior_translation_aux[of a S] by auto qed
lemma affine_hull_linear_image: assumes"bounded_linear f" shows"f ` (affine hull s) = affine hull f ` s" proof - interpret f: bounded_linear f by fact have"affine {x. f x ∈ affine hull f ` s}" unfolding affine_def by (auto simp: f.scaleR f.add affine_affine_hull[unfolded affine_def, rule_format]) moreoverhave"affine {x. x ∈ f ` (affine hull s)}" using affine_affine_hull[unfolded affine_def, of s] unfolding affine_def by (auto simp: f.scaleR [symmetric] f.add [symmetric]) ultimatelyshow ?thesis by (auto simp: hull_inc elim!: hull_induct) qed
lemma rel_interior_injective_on_span_linear_image: fixes f :: "'m::euclidean_space → 'n::euclidean_space" and S :: "'m::euclidean_space set" assumes"bounded_linear f" and"inj_on f (span S)" shows"rel_interior (f ` S) = f ` (rel_interior S)" proof -
{ fix z assume z: "z ∈ rel_interior (f ` S)" thenhave"z ∈ f ` S" using rel_interior_subset[of "f ` S"] by auto thenobtain x where x: "x ∈ S""f x = z"by auto obtain e2 where e2: "e2 > 0""cball z e2 ∩ affine hull (f ` S) ⊆ (f ` S)" using z rel_interior_cball[of "f ` S"] by auto obtain K where K: "K > 0""∧x. norm (f x) ≤ norm x * K" using assms Real_Vector_Spaces.bounded_linear.pos_bounded[of f] by auto define e1 where"e1 = 1 / K" thenhave e1: "e1 > 0""∧x. e1 * norm (f x) ≤ norm x" using K pos_le_divide_eq[of e1] by auto define e where"e = e1 * e2" thenhave"e > 0"using e1 e2 by auto
{ fix y assume y: "y ∈ cball x e ∩ affine hull S" thenhave h1: "f y ∈ affine hull (f ` S)" using affine_hull_linear_image[of f S] assms by auto from y have"norm (x-y) ≤ e1 * e2" using cball_def[of x e] dist_norm[of x y] e_def by auto moreoverhave"f x - f y = f (x - y)" using assms linear_diff[of f x y] linear_conv_bounded_linear[of f] by auto moreoverhave"e1 * norm (f (x-y)) ≤ norm (x - y)" using e1 by auto ultimatelyhave"e1 * norm ((f x)-(f y)) ≤ e1 * e2" by auto thenhave"f y ∈ cball z e2" using cball_def[of "f x" e2] dist_norm[of "f x""f y"] e1 x by auto thenhave"f y ∈ f ` S" using y e2 h1 by auto thenhave"y ∈ S" using assms y hull_subset[of S] affine_hull_subset_span
inj_on_image_mem_iff [OF ‹inj_on f (span S)›] by(metisInt_iffspan_supersetsubsetCE) } thenhave"z\<in>f`(rel_interiorS)" usingmem_rel_interior_cball[ofxS]\<open>e>0\<close>xbyauto } moreover { fixx assumex:"x\<in>rel_interiorS" thenobtaine2wheree2:"e2>0""cballxe2\<inter>affinehullS\<subseteq>S" usingrel_interior_cball[ofS]byauto have"x\<in>S"usingxrel_interior_subsetbyauto thenhave*:"fx\<in>f`S"byauto have"\<forall>x\<in>spanS.fx=0\<longrightarrow>x=0" usingassmssubspace_spanlinear_conv_bounded_linear[off] linear_injective_on_subspace_0[off"spanS"] byauto thenobtaine1wheree1:"e1>0""\<forall>x\<in>spanS.e1*normx\<le>norm(fx)" usingassmsinjective_imp_isometric[of"spanS"f] subspace_span[ofS]closed_subspace[of"spanS"] byauto defineewhere"e=e1*e2" hence"e>0"usinge1e2byauto { fixy assumey:"y\<in>cball(fx)e\<inter>affinehull(f`S)" thenhave"y\<in>f`(affinehullS)" usingaffine_hull_linear_image[offS]assmsbyauto thenobtainxywherexy:"xy\<in>affinehullS""fxy=y"byauto withyhave"norm(fx-fxy)\<le>e1*e2" usingcball_def[of"fx"e]dist_norm[of"fx"y]e_defbyauto moreoverhave"fx-fxy=f(x-xy)" usingassmslinear_diff[offxxy]linear_conv_bounded_linear[off]byauto moreoverhave*:"x-xy\<in>spanS" usingsubspace_diff[of"spanS"xxy]subspace_span\<open>x\<in>S\<close>xy affine_hull_subset_span[ofS]span_superset byauto moreoverfrom*have"e1*norm(x-xy)\<le>norm(f(x-xy))" usinge1byauto ultimatelyhave"e1*norm(x-xy)\<le>e1*e2" byauto thenhave"xy\<in>cballxe2" usingcball_def[ofxe2]dist_norm[ofxxy]e1byauto thenhave"y\<in>f`S" usingxye2byauto } thenhave"fx\<in>rel_interior(f`S)" usingmem_rel_interior_cball[of"(fx)""(f`S)"]*\<open>e>0\<close>byauto } ultimatelyshow?thesisbyauto qed
lemma convex_closure [intro,simp]: fixes S :: "'a::real_normed_vector set" assumes"convex S" shows"convex (closure S)" apply (rule convexI) unfolding closure_sequential apply (elim exE) subgoalfor x y u v f g by (rule_tac x="λn. u *R f n + v *R g n"in exI) (force intro: tendsto_intros dest: convexD [OF assms]) done
lemma convex_interior [intro,simp]: fixes S :: "'a::real_normed_vector set" assumes"convex S" shows"convex (interior S)" unfolding convex_alt Ball_def mem_interior proof clarify fix x y u assume u: "0 ≤ u""u ≤ (1::real)" fix e d assume ed: "ball x e ⊆ S""ball y d ⊆ S""0<d""0<e" show"∃e>0. ball ((1 - u) *R x + u *R y) e ⊆ S" proof (intro exI conjI subsetI) fix z assume z: "z ∈ ball ((1 - u) *R x + u *R y) (min d e)" have"(1- u) *R (z - u *R (y - x)) + u *R (z + (1 - u) *R (y - x)) ∈ S" proof (rule_tac assms[unfolded convex_alt, rule_format]) show"z - u *R (y - x) ∈ S""z + (1 - u) *R (y - x) ∈ S" using ed z u by (auto simp add: algebra_simps dist_norm) qed (use u in auto) thenshow"z ∈ S" using u by (auto simp: algebra_simps) qed(use u ed in auto) qed
lemma convex_hull_eq_empty[simp]: "convex hull S = {} ⟷ S = {}" using hull_subset[of S convex] convex_hull_empty by auto
subsection✐‹tag unimportant›‹Convex set as intersection of halfspaces›
lemma convex_halfspace_intersection: fixes S :: "('a::euclidean_space) set" assumes"closed S""convex S" shows"S = ∩{h. S ⊆ h ∧ (∃a b. h = {x. inner a x ≤ b})}" proof -
{ fix z assume"∀T. S ⊆ T ∧ (∃a b. T = {x. inner a x ≤ b}) ⟶ z ∈ T""z ∉ S" thenhave§: "∧a b. S ⊆ {x. inner a x ≤ b} ==> z ∈ {x. inner a x ≤ b}" by blast obtain a b where"inner a z < b""(∀x∈S. inner a x > b)" using‹z ∉ S› assms separating_hyperplane_closed_point by blast thenhave False using§ [of "-a""-b"] by fastforce
} thenshow ?thesis by force qed
subsection✐‹tag unimportant›‹Convexity of general and special intervals›
lemma is_interval_convex: fixes S :: "'a::euclidean_space set" assumes"is_interval S" shows"convex S" proof (rule convexI) fix x y and u v :: real assume"x ∈ S""y ∈ S"and uv: "0 ≤ u""0 ≤ v""u + v = 1" thenhave *: "u = 1 - v""1 - v ≥ 0"and **: "v = 1 - u""1 - u ≥ 0" by auto
{ fix a b assume"¬ b ≤ u * a + v * b" thenhave"u * a < (1 - v) * b" unfolding not_le using‹0 ≤ v›by (auto simp: field_simps) thenhave"a < b" using"*"(1) less_eq_real_def uv(1) by auto thenhave"a ≤ u * a + v * b" unfolding * using‹0 ≤ v› by (auto simp: field_simps intro!:mult_right_mono)
} moreover
{ fix a b assume"¬ u * a + v * b ≤ a" thenhave"v * b > (1 - u) * a" unfolding not_le using‹0 ≤ v›by (auto simp: field_simps) thenhave"a < b" unfolding * using‹0 ≤ v› by (rule_tac mult_left_less_imp_less) (auto simp: field_simps) thenhave"u * a + v * b ≤ b" unfolding ** using **(2) ‹0 ≤ u›by (auto simp: algebra_simps mult_right_mono)
} ultimatelyshow"u *R x + v *R y ∈ S" using DIM_positive[where 'a='a] by (intro mem_is_intervalI [OF assms ‹x ∈ S›‹y ∈ S›]) (auto simp: inner_simps) qed
lemma is_interval_connected: fixes S :: "'a::euclidean_space set" shows"is_interval S ==> connected S" using is_interval_convex convex_connected by auto
lemma convex_box [simp]: "convex (cbox a b)""convex (box a (b::'a::euclidean_space))" by (auto simp add: is_interval_convex)
text‹A non-singleton connected set is perfect (i.e. has no isolated points). › lemma connected_imp_perfect: fixes a :: "'a::metric_space" assumes"connected S""a ∈ S"and S: "∧x. S ≠ {x}" shows"a islimpt S" proof - have False if"a ∈ T""open T""∧y. [y ∈ S; y ∈ T]==> y = a"for T proof - obtain e where"e > 0"and e: "cball a e ⊆ T" using‹open T›‹a ∈ T›by (auto simp: open_contains_cball) have"openin (top_of_set S) {a}" unfolding openin_open using that ‹a ∈ S›by blast moreoverhave"closedin (top_of_set S) {a}" by (simp add: assms) ultimatelyshow"False" using‹connected S› connected_clopen S by blast qed thenshow ?thesis unfolding islimpt_def by blast qed
lemma islimpt_Ioc [simp]: fixes a :: real assumes"a<b" shows"x islimpt {a<..b} ⟷ x ∈ {a..b}" (is"?lhs = ?rhs") proof show"?lhs ==> ?rhs" by (metis assms closed_atLeastAtMost closed_limpt closure_greaterThanAtMost closure_subset islimpt_subset) next assume ?rhs thenhave"x ∈ closure {a<..<b}" using assms closure_greaterThanLessThan by blast thenshow ?lhs by (metis (no_types) Diff_empty Diff_insert0 interior_lessThanAtMost interior_limit_point interior_subset islimpt_in_closure islimpt_subset) qed
lemma islimpt_Ico [simp]: fixes a :: real assumes"a<b"shows"x islimpt {a..<b} ⟷ x ∈ {a..b}" by (metis assms closure_atLeastLessThan closure_greaterThanAtMost islimpt_Ioc limpt_of_closure)
lemma islimpt_Icc [simp]: fixes a :: real assumes"a<b"shows"x islimpt {a..b} ⟷ x ∈ {a..b}" by (metis assms closure_atLeastLessThan islimpt_Ico limpt_of_closure)
lemma connected_imp_perfect_aff_dim: "[connected S; aff_dim S ≠ 0; a ∈ S]==> a islimpt S" using aff_dim_sing connected_imp_perfect by blast
subsection✐‹tag unimportant›‹On ‹real›, ‹is_interval›, ‹convex› and ‹connected› are all equivalent›
lemma mem_is_interval_1_I: fixes a b c::real assumes"is_interval S" assumes"a ∈ S""c ∈ S" assumes"a ≤ b""b ≤ c" shows"b ∈ S" using assms is_interval_1 by blast
lemma is_interval_connected_1: fixes S :: "real set" shows"is_interval S ⟷ connected S" by (meson connected_iff_interval is_interval_1)
lemma is_interval_convex_1: fixes S :: "real set" shows"is_interval S ⟷ convex S" by (metis is_interval_convex convex_connected is_interval_connected_1)
lemma connected_compact_interval_1: "connected S ∧ compact S ⟷ (∃a b. S = {a..b::real})" by (auto simp: is_interval_connected_1 [symmetric] is_interval_compact)
lemma connected_convex_1: fixes S :: "real set" shows"connected S ⟷ convex S" by (metis is_interval_convex convex_connected is_interval_connected_1)
lemma connected_space_iff_is_interval_1 [iff]: fixes S :: "real set" shows"connected_space (top_of_set S) ⟷ is_interval S" using connectedin_topspace is_interval_connected_1 by force
lemma connected_convex_1_gen: fixes S :: "'a :: euclidean_space set" assumes"DIM('a) = 1" shows"connected S ⟷ convex S" proof - obtain f:: "'a → real"where linf: "linear f"and"inj f" using subspace_isomorphism[OF subspace_UNIV subspace_UNIV, where 'a='a and 'b=real] unfolding Euclidean_Space.dim_UNIV by (auto simp: assms) thenhave"f -` (f ` S) = S" by (simp add: inj_vimage_image_eq) thenshow ?thesis by (metis connected_convex_1 convex_linear_vimage linf convex_connected connected_linear_image) qed
lemma [simp]: fixes r s::real shows is_interval_io: "is_interval {..<r}" and is_interval_oi: "is_interval {r<..}" and is_interval_oo: "is_interval {r<..<s}" and is_interval_oc: "is_interval {r<..s}" and is_interval_co: "is_interval {r..<s}" by (simp_all add: is_interval_convex_1)
subsection✐‹tag unimportant›‹Another intermediate value theorem formulation›
lemma ivt_increasing_component_on_1: fixes f :: "real → 'a::euclidean_space" assumes"a ≤ b" and"continuous_on {a..b} f" and"(f a)∙k ≤ y""y ≤ (f b)∙k" shows"∃x∈{a..b}. (f x)∙k = y" proof - have"f a ∈ f ` cbox a b""f b ∈ f ` cbox a b" using‹a ≤ b›by auto thenshow ?thesis using connected_ivt_component[of "f ` cbox a b""f a""f b" k y] by (simp add: connected_continuous_image assms) qed
lemma ivt_increasing_component_1: fixes f :: "real → 'a::euclidean_space" shows"a ≤ b ==>∀x∈{a..b}. continuous (at x) f ==> f a∙k ≤ y ==> y ≤ f b∙k ==>∃x∈{a..b}. (f x)∙k = y" by (rule ivt_increasing_component_on_1) (auto simp: continuous_at_imp_continuous_on)
lemma ivt_decreasing_component_on_1: fixes f :: "real → 'a::euclidean_space" assumes"a ≤ b" and"continuous_on {a..b} f" and"(f b)∙k ≤ y" and"y ≤ (f a)∙k" shows"∃x∈{a..b}. (f x)∙k = y" using ivt_increasing_component_on_1[of a b "λx. - f x" k "- y"] neg_equal_iff_equal using assms continuous_on_minus by force
lemma ivt_decreasing_component_1: fixes f :: "real → 'a::euclidean_space" shows"a ≤ b ==>∀x∈{a..b}. continuous (at x) f ==> f b∙k ≤ y ==> y ≤ f a∙k ==>∃x∈{a..b}. (f x)∙k = y" by (rule ivt_decreasing_component_on_1) (auto simp: continuous_at_imp_continuous_on)
subsection✐‹tag unimportant›‹A bound within an interval›
lemma convex_hull_eq_real_cbox: fixes x y :: real assumes"x ≤ y" shows"convex hull {x, y} = cbox x y" proof (rule hull_unique) show"{x, y} ⊆ cbox x y"using‹x ≤ y›by auto show"convex (cbox x y)" by (rule convex_box) next fix S assume"{x, y} ⊆ S"and"convex S" thenshow"cbox x y ⊆ S" unfolding is_interval_convex_1 [symmetric] is_interval_def Basis_real_def by - (clarify, simp (no_asm_use), fast) qed
lemma unit_interval_convex_hull: "cbox (0::'a::euclidean_space) One = convex hull {x. ∀i∈Basis. (x∙i = 0) ∨ (x∙i = 1)}"
(is"?int = convex hull ?points") proof - have One[simp]: "∧i. i ∈ Basis ==> One ∙ i = 1" by (simp add: inner_sum_left sum.If_cases inner_Basis) have"?int = {x. ∀i∈Basis. x ∙ i ∈ cbox 0 1}" by (auto simp: cbox_def) alsohave"… = (∑i∈Basis. (λx. x *R i) ` cbox 0 1)" by (simp only: box_eq_set_sum_Basis) alsohave"… = (∑i∈Basis. (λx. x *R i) ` (convex hull {0, 1}))" by (simp only: convex_hull_eq_real_cbox zero_le_one) alsohave"… = (∑i∈Basis. convex hull ((λx. x *R i) ` {0, 1}))" by (simp add: convex_hull_linear_image) alsohave"… = convex hull (∑i∈Basis. (λx. x *R i) ` {0, 1})" by (simp only: convex_hull_set_sum) alsohave"… = convex hull {x. ∀i∈Basis. x∙i ∈ {0, 1}}" by (simp only: box_eq_set_sum_Basis) alsohave"convex hull {x. ∀i∈Basis. x∙i ∈ {0, 1}} = convex hull ?points" by simp finallyshow ?thesis . qed
text‹And this is a finite set of vertices.›
lemma unit_cube_convex_hull: obtains S :: "'a::euclidean_space set" where"finite S"and"cbox 0 (∑Basis) = convex hull S" proof show"finite {x::'a. ∀i∈Basis. x ∙ i = 0 ∨ x ∙ i = 1}" proof (rule finite_subset, clarify) show"finite ((λS. ∑i∈Basis. (if i ∈ S then 1 else 0) *R i) ` Pow Basis)" using finite_Basis by blast fix x :: 'a assume x: "∀i∈Basis. x ∙ i = 0 ∨ x ∙ i = 1" show"x ∈ (λS. ∑i∈Basis. (if i∈S then 1 else 0) *R i) ` Pow Basis" apply (rule image_eqI[where x="{i. i ∈ Basis ∧ x∙i = 1}"]) using x by (subst euclidean_eq_iff, auto) qed show"cbox 0 One = convex hull {x. ∀i∈Basis. x ∙ i = 0 ∨ x ∙ i = 1}" using unit_interval_convex_hull by blast qed
text‹Hence any cube (could do any nonempty interval).›
lemma cube_convex_hull: assumes"d > 0" obtains S :: "'a::euclidean_space set"where "finite S"and"cbox (x - (∑i∈Basis. d*Ri)) (x + (∑i∈Basis. d*Ri)) = convex hull S" proof - let ?d = "(∑i∈Basis. d *R i)::'a" have *: "cbox (x - ?d) (x + ?d) = (λy. x - ?d + (2 * d) *R y) ` cbox 0 (∑Basis)" proof (intro set_eqI iffI) fix y assume"y ∈ cbox (x - ?d) (x + ?d)" thenhave"inverse (2 * d) *R (y - (x - ?d)) ∈ cbox 0 (∑Basis)" using assms by (simp add: mem_box inner_simps) (simp add: field_simps) with‹0 < d›show"y ∈ (λy. x - sum ((*R) d) Basis + (2 * d) *R y) ` cbox 0 One" by (auto intro: image_eqI[where x= "inverse (2 * d) *R (y - (x - ?d))"]) next fix y assume"y ∈ (λy. x - ?d + (2 * d) *R y) ` cbox 0 One" thenobtain z where z: "z ∈ cbox 0 One""y = x - ?d + (2*d) *R z" by auto thenshow"y ∈ cbox (x - ?d) (x + ?d)" using z assms by (auto simp: mem_box inner_simps) qed obtain S where"finite S""cbox 0 (∑Basis::'a) = convex hull S" using unit_cube_convex_hull by auto thenshow ?thesis by (rule_tac that[of "(λy. x - ?d + (2 * d) *R y)` S"]) (auto simp: convex_hull_affinity *) qed
subsection✐‹tag unimportant›\<open>Representation of any interval as a finite convex hull›
lemma image_stretch_interval: "(λx. ∑k∈Basis. (m k * (x∙k)) *R k) ` cbox a (b::'a::euclidean_space) = (if (cbox a b) = {} then {} else cbox (∑k∈Basis. (min (m k * (a∙k)) (m k * (b∙k))) *R k::'a) (∑k∈Basis. (max (m k * (a∙k)) (m k * (b∙k))) *R k))" proof cases assume *: "cbox a b ≠ {}" show ?thesis unfolding box_ne_empty if_not_P[OF *] apply (simp add: cbox_def image_Collect set_eq_iff euclidean_eq_iff[where 'a='a] ball_conj_distrib[symmetric]) apply (subst choice_Basis_iff[symmetric]) proof (intro allI ball_cong refl) fix x i :: 'a assume"i ∈ Basis" with * have a_le_b: "a ∙ i ≤ b ∙ i" unfolding box_ne_empty by auto show"(∃xa. x ∙ i = m i * xa ∧ a ∙ i ≤ xa ∧ xa ≤ b ∙ i) ⟷ min (m i * (a ∙ i)) (m i * (b ∙ i)) ≤ x ∙ i ∧ x ∙ i ≤ max (m i * (a ∙ i)) (m i * (b ∙ i))" proof (cases "m i = 0") case True with a_le_b show ?thesis by auto next case False thenhave *: "∧a b. a = m i * b ⟷ b = a / m i" by (auto simp: field_simps) from False have "min (m i * (a ∙ i)) (m i * (b ∙ i)) = (if 0 < m i then m i * (a ∙ i) else m i * (b ∙ i))" "max (m i * (a ∙ i)) (m i * (b ∙ i)) = (if 0 < m i then m i * (b ∙ i) else m i * (a ∙ i))" using a_le_b by (auto simp: min_def max_def mult_le_cancel_left) with False show ?thesis using a_le_b * by (simp add: le_divide_eq divide_le_eq) (simp add: ac_simps) qed qed qed simp
lemma interval_image_stretch_interval: "∃u v. (λx. ∑k∈Basis. (m k * (x∙k))*R k) ` cbox a (b::'a::euclidean_space) = cbox u (v::'a::euclidean_space)" unfolding image_stretch_interval by auto
lemma cbox_translation: "cbox (c + a) (c + b) = image (λx. c + x) (cbox a b)" using image_affinity_cbox [of 1 c a b] using box_ne_empty [of "a+c""b+c"] box_ne_empty [of a b] by (auto simp: inner_left_distrib add.commute)
lemma cbox_image_unit_interval: fixes a :: "'a::euclidean_space" assumes"cbox a b ≠ {}" shows"cbox a b = (+) a ` (λx. ∑k∈Basis. ((b ∙ k - a ∙ k) * (x ∙ k)) *R k) ` cbox 0 One" using assms apply (simp add: box_ne_empty image_stretch_interval cbox_translation [symmetric]) apply (simp add: min_def max_def algebra_simps sum_subtractf euclidean_representation) done
lemma closed_interval_as_convex_hull: fixes a :: "'a::euclidean_space" obtains S where"finite S""cbox a b = convex hull S" proof (cases "cbox a b = {}") case True with convex_hull_empty that show ?thesis by blast next case False obtain S::"'a set"where"finite S"and eq: "cbox 0 One = convex hull S" by (blast intro: unit_cube_convex_hull) let ?S = "((+) a ` (λx. ∑k∈Basis. ((b ∙ k - a ∙ k) * (x ∙ k)) *R k) ` S)" show thesis proof show"finite ?S" by (simp add: ‹finite S›) havelin:"linear(\<lambda>x.\<Sum>k\<in>Basis.((b\<bullet>k-a\<bullet>k)*(x\<bullet>k))*\<^sub>Rk)" by(rulelinear_compose_sum)(autosimp:algebra_simpslinearI) show"cboxab=convexhull?S" usingconvex_hull_linear_image[OFlin] by(simpadd:convex_hull_translationeqcbox_image_unit_interval[OFFalse]) qed qed
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.172Bemerkung:
(vorverarbeitet am 2026-06-30)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.