6375 where "closed_segment a b = {(1 - u) *\<^sub>R a + u *\<^sub>R b | u::real. 0 \<le> u \<and> u \<le> 1}" |
6375 where "closed_segment a b = {(1 - u) *\<^sub>R a + u *\<^sub>R b | u::real. 0 \<le> u \<and> u \<le> 1}" |
6376 |
6376 |
6377 definition open_segment :: "'a::real_vector \<Rightarrow> 'a \<Rightarrow> 'a set" where |
6377 definition open_segment :: "'a::real_vector \<Rightarrow> 'a \<Rightarrow> 'a set" where |
6378 "open_segment a b \<equiv> closed_segment a b - {a,b}" |
6378 "open_segment a b \<equiv> closed_segment a b - {a,b}" |
6379 |
6379 |
|
6380 lemmas segment = open_segment_def closed_segment_def |
|
6381 |
6380 definition "between = (\<lambda>(a,b) x. x \<in> closed_segment a b)" |
6382 definition "between = (\<lambda>(a,b) x. x \<in> closed_segment a b)" |
6381 |
6383 |
6382 definition "starlike s \<longleftrightarrow> (\<exists>a\<in>s. \<forall>x\<in>s. closed_segment a x \<subseteq> s)" |
6384 definition "starlike s \<longleftrightarrow> (\<exists>a\<in>s. \<forall>x\<in>s. closed_segment a x \<subseteq> s)" |
6383 |
6385 |
6384 lemmas segment = open_segment_def closed_segment_def |
6386 lemma starlike_UNIV [simp]: "starlike UNIV" |
|
6387 by (simp add: starlike_def) |
6385 |
6388 |
6386 lemma midpoint_refl: "midpoint x x = x" |
6389 lemma midpoint_refl: "midpoint x x = x" |
6387 unfolding midpoint_def |
6390 unfolding midpoint_def |
6388 unfolding scaleR_right_distrib |
6391 unfolding scaleR_right_distrib |
6389 unfolding scaleR_left_distrib[symmetric] |
6392 unfolding scaleR_left_distrib[symmetric] |
6538 unfolding segment by (auto simp add: algebra_simps) |
6541 unfolding segment by (auto simp add: algebra_simps) |
6539 |
6542 |
6540 lemma open_segment_idem [simp]: "open_segment a a = {}" |
6543 lemma open_segment_idem [simp]: "open_segment a a = {}" |
6541 by (simp add: open_segment_def) |
6544 by (simp add: open_segment_def) |
6542 |
6545 |
|
6546 lemma closed_segment_eq_open: "closed_segment a b = open_segment a b \<union> {a,b}" |
|
6547 using open_segment_def by auto |
|
6548 |
6543 lemma closed_segment_eq_real_ivl: |
6549 lemma closed_segment_eq_real_ivl: |
6544 fixes a b::real |
6550 fixes a b::real |
6545 shows "closed_segment a b = (if a \<le> b then {a .. b} else {b .. a})" |
6551 shows "closed_segment a b = (if a \<le> b then {a .. b} else {b .. a})" |
6546 proof - |
6552 proof - |
6547 have "b \<le> a \<Longrightarrow> closed_segment b a = {b .. a}" |
6553 have "b \<le> a \<Longrightarrow> closed_segment b a = {b .. a}" |
7901 rel_interior_open_segment) |
7907 rel_interior_open_segment) |
7902 qed |
7908 qed |
7903 |
7909 |
7904 lemmas rel_interior_segment = rel_interior_closed_segment rel_interior_open_segment |
7910 lemmas rel_interior_segment = rel_interior_closed_segment rel_interior_open_segment |
7905 |
7911 |
|
7912 lemma starlike_convex_tweak_boundary_points: |
|
7913 fixes S :: "'a::euclidean_space set" |
|
7914 assumes "convex S" "S \<noteq> {}" and ST: "rel_interior S \<subseteq> T" and TS: "T \<subseteq> closure S" |
|
7915 shows "starlike T" |
|
7916 proof - |
|
7917 have "rel_interior S \<noteq> {}" |
|
7918 by (simp add: assms rel_interior_eq_empty) |
|
7919 then obtain a where a: "a \<in> rel_interior S" by blast |
|
7920 with ST have "a \<in> T" by blast |
|
7921 have *: "\<And>x. x \<in> T \<Longrightarrow> open_segment a x \<subseteq> rel_interior S" |
|
7922 apply (rule rel_interior_closure_convex_segment [OF \<open>convex S\<close> a]) |
|
7923 using assms by blast |
|
7924 show ?thesis |
|
7925 unfolding starlike_def |
|
7926 apply (rule bexI [OF _ \<open>a \<in> T\<close>]) |
|
7927 apply (simp add: closed_segment_eq_open) |
|
7928 apply (intro conjI ballI a \<open>a \<in> T\<close> rel_interior_closure_convex_segment [OF \<open>convex S\<close> a]) |
|
7929 apply (simp add: order_trans [OF * ST]) |
|
7930 done |
|
7931 qed |
|
7932 |
|
7933 subsection\<open>The relative frontier of a set\<close> |
7906 |
7934 |
7907 definition "rel_frontier S = closure S - rel_interior S" |
7935 definition "rel_frontier S = closure S - rel_interior S" |
7908 |
7936 |
7909 lemma closed_affine_hull: |
7937 lemma closed_affine_hull: |
7910 fixes S :: "'n::euclidean_space set" |
7938 fixes S :: "'n::euclidean_space set" |