| author | wenzelm | 
| Thu, 22 Jun 2023 14:29:05 +0200 | |
| changeset 78193 | 443a443bbe7b | 
| parent 78037 | 37894dff0111 | 
| child 78248 | 740b23f1138a | 
| permissions | -rw-r--r-- | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1 | (* Title: HOL/Analysis/Starlike.thy | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2 | Author: L C Paulson, University of Cambridge | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3 | Author: Robert Himmelmann, TU Muenchen | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4 | Author: Bogdan Grechuk, University of Edinburgh | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5 | Author: Armin Heller, TU Muenchen | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6 | Author: Johannes Hoelzl, TU Muenchen | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 7 | *) | 
| 69676 | 8 | chapter \<open>Unsorted\<close> | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 9 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 10 | theory Starlike | 
| 71028 
c2465b429e6e
Line_Segment is independent of Convex_Euclidean_Space
 immler parents: 
71026diff
changeset | 11 | imports | 
| 
c2465b429e6e
Line_Segment is independent of Convex_Euclidean_Space
 immler parents: 
71026diff
changeset | 12 | Convex_Euclidean_Space | 
| 
c2465b429e6e
Line_Segment is independent of Convex_Euclidean_Space
 immler parents: 
71026diff
changeset | 13 | Line_Segment | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 14 | begin | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 15 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 16 | lemma affine_hull_closed_segment [simp]: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 17 |      "affine hull (closed_segment a b) = affine hull {a,b}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 18 | by (simp add: segment_convex_hull) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 19 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 20 | lemma affine_hull_open_segment [simp]: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 21 | fixes a :: "'a::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 22 |     shows "affine hull (open_segment a b) = (if a = b then {} else affine hull {a,b})"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 23 | by (metis affine_hull_convex_hull affine_hull_empty closure_open_segment closure_same_affine_hull segment_convex_hull) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 24 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 25 | lemma rel_interior_closure_convex_segment: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 26 | fixes S :: "_::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 27 | assumes "convex S" "a \<in> rel_interior S" "b \<in> closure S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 28 | shows "open_segment a b \<subseteq> rel_interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 29 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 30 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 31 | have [simp]: "(1 - u) *\<^sub>R a + u *\<^sub>R b = b - (1 - u) *\<^sub>R (b - a)" for u | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 32 | by (simp add: algebra_simps) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 33 | assume "x \<in> open_segment a b" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 34 | then show "x \<in> rel_interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 35 | unfolding closed_segment_def open_segment_def using assms | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 36 | by (auto intro: rel_interior_closure_convex_shrink) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 37 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 38 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 39 | lemma convex_hull_insert_segments: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 40 | "convex hull (insert a S) = | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 41 |     (if S = {} then {a} else  \<Union>x \<in> convex hull S. closed_segment a x)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 42 | by (force simp add: convex_hull_insert_alt in_segment) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 43 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 44 | lemma Int_convex_hull_insert_rel_exterior: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 45 | fixes z :: "'a::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 46 | assumes "convex C" "T \<subseteq> C" and z: "z \<in> rel_interior C" and dis: "disjnt S (rel_interior C)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 47 | shows "S \<inter> (convex hull (insert z T)) = S \<inter> (convex hull T)" (is "?lhs = ?rhs") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 48 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 49 |   have "T = {} \<Longrightarrow> z \<notin> S"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 50 | using dis z by (auto simp add: disjnt_def) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 51 | then show "?lhs \<subseteq> ?rhs" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 52 | proof (clarsimp simp add: convex_hull_insert_segments) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 53 | fix x y | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 54 | assume "x \<in> S" and y: "y \<in> convex hull T" and "x \<in> closed_segment z y" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 55 | have "y \<in> closure C" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 56 | by (metis y \<open>convex C\<close> \<open>T \<subseteq> C\<close> closure_subset contra_subsetD convex_hull_eq hull_mono) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 57 | moreover have "x \<notin> rel_interior C" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 58 | by (meson \<open>x \<in> S\<close> dis disjnt_iff) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 59 |     moreover have "x \<in> open_segment z y \<union> {z, y}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 60 | using \<open>x \<in> closed_segment z y\<close> closed_segment_eq_open by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 61 | ultimately show "x \<in> convex hull T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 62 | using rel_interior_closure_convex_segment [OF \<open>convex C\<close> z] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 63 | using y z by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 64 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 65 | show "?rhs \<subseteq> ?lhs" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 66 | by (meson hull_mono inf_mono subset_insertI subset_refl) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 67 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 68 | |
| 70136 | 69 | subsection\<^marker>\<open>tag unimportant\<close> \<open>Shrinking towards the interior of a convex set\<close> | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 70 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 71 | lemma mem_interior_convex_shrink: | 
| 68056 | 72 | fixes S :: "'a::euclidean_space set" | 
| 73 | assumes "convex S" | |
| 74 | and "c \<in> interior S" | |
| 75 | and "x \<in> S" | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 76 | and "0 < e" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 77 | and "e \<le> 1" | 
| 68056 | 78 | shows "x - e *\<^sub>R (x - c) \<in> interior S" | 
| 79 | proof - | |
| 80 | obtain d where "d > 0" and d: "ball c d \<subseteq> S" | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 81 | using assms(2) unfolding mem_interior by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 82 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 83 | unfolding mem_interior | 
| 68056 | 84 | proof (intro exI subsetI conjI) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 85 | fix y | 
| 68056 | 86 | assume "y \<in> ball (x - e *\<^sub>R (x - c)) (e*d)" | 
| 87 | then have as: "dist (x - e *\<^sub>R (x - c)) y < e * d" | |
| 88 | by simp | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 89 | have *: "y = (1 - (1 - e)) *\<^sub>R ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) + (1 - e) *\<^sub>R x" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 90 | using \<open>e > 0\<close> by (auto simp add: scaleR_left_diff_distrib scaleR_right_diff_distrib) | 
| 72211 | 91 | have "c - ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) = (1 / e) *\<^sub>R (e *\<^sub>R c - y + (1 - e) *\<^sub>R x)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 92 | using \<open>e > 0\<close> | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 93 | by (auto simp add: euclidean_eq_iff[where 'a='a] field_simps inner_simps) | 
| 72211 | 94 | then have "dist c ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) = \<bar>1/e\<bar> * norm (e *\<^sub>R c - y + (1 - e) *\<^sub>R x)" | 
| 95 | by (simp add: dist_norm) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 96 | also have "\<dots> = \<bar>1/e\<bar> * norm (x - e *\<^sub>R (x - c) - y)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 97 | by (auto intro!:arg_cong[where f=norm] simp add: algebra_simps) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 98 | also have "\<dots> < d" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 99 | using as[unfolded dist_norm] and \<open>e > 0\<close> | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 100 | by (auto simp add:pos_divide_less_eq[OF \<open>e > 0\<close>] mult.commute) | 
| 72211 | 101 | finally have "(1 - (1 - e)) *\<^sub>R ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) + (1 - e) *\<^sub>R x \<in> S" | 
| 102 | using assms(3-5) d | |
| 72238 | 103 | by (intro convexD_alt [OF \<open>convex S\<close>]) (auto intro: convexD_alt [OF \<open>convex S\<close>]) | 
| 72211 | 104 | with \<open>e > 0\<close> show "y \<in> S" | 
| 105 | by (auto simp add: scaleR_left_diff_distrib scaleR_right_diff_distrib) | |
| 106 | qed (use \<open>e>0\<close> \<open>d>0\<close> in auto) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 107 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 108 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 109 | lemma mem_interior_closure_convex_shrink: | 
| 68056 | 110 | fixes S :: "'a::euclidean_space set" | 
| 111 | assumes "convex S" | |
| 112 | and "c \<in> interior S" | |
| 113 | and "x \<in> closure S" | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 114 | and "0 < e" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 115 | and "e \<le> 1" | 
| 68056 | 116 | shows "x - e *\<^sub>R (x - c) \<in> interior S" | 
| 117 | proof - | |
| 118 | obtain d where "d > 0" and d: "ball c d \<subseteq> S" | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 119 | using assms(2) unfolding mem_interior by auto | 
| 68056 | 120 | have "\<exists>y\<in>S. norm (y - x) * (1 - e) < e * d" | 
| 121 | proof (cases "x \<in> S") | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 122 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 123 | then show ?thesis | 
| 72211 | 124 | using \<open>e > 0\<close> \<open>d > 0\<close> by force | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 125 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 126 | case False | 
| 68056 | 127 | then have x: "x islimpt S" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 128 | using assms(3)[unfolded closure_def] by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 129 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 130 | proof (cases "e = 1") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 131 | case True | 
| 68056 | 132 | obtain y where "y \<in> S" "y \<noteq> x" "dist y x < 1" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 133 | using x[unfolded islimpt_approachable,THEN spec[where x=1]] by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 134 | then show ?thesis | 
| 72211 | 135 | using True \<open>0 < d\<close> by auto | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 136 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 137 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 138 | then have "0 < e * d / (1 - e)" and *: "1 - e > 0" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 139 | using \<open>e \<le> 1\<close> \<open>e > 0\<close> \<open>d > 0\<close> by auto | 
| 68056 | 140 | then obtain y where "y \<in> S" "y \<noteq> x" "dist y x < e * d / (1 - e)" | 
| 72211 | 141 | using islimpt_approachable x by blast | 
| 142 | then have "norm (y - x) * (1 - e) < e * d" | |
| 143 | by (metis "*" dist_norm mult_imp_div_pos_le not_less) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 144 | then show ?thesis | 
| 72211 | 145 | using \<open>y \<in> S\<close> by blast | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 146 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 147 | qed | 
| 68056 | 148 | then obtain y where "y \<in> S" and y: "norm (y - x) * (1 - e) < e * d" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 149 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 150 | define z where "z = c + ((1 - e) / e) *\<^sub>R (x - y)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 151 | have *: "x - e *\<^sub>R (x - c) = y - e *\<^sub>R (y - z)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 152 | unfolding z_def using \<open>e > 0\<close> | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 153 | by (auto simp add: scaleR_right_diff_distrib scaleR_right_distrib scaleR_left_diff_distrib) | 
| 72567 | 154 | have "(1 - e) * norm (x - y) / e < d" | 
| 155 | using y \<open>0 < e\<close> by (simp add: field_simps norm_minus_commute) | |
| 156 | then have "z \<in> interior (ball c d)" | |
| 157 | using \<open>0 < e\<close> \<open>e \<le> 1\<close> by (simp add: interior_open[OF open_ball] z_def dist_norm) | |
| 72211 | 158 | then have "z \<in> interior S" | 
| 159 | using d interiorI interior_ball by blast | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 160 | then show ?thesis | 
| 72567 | 161 | unfolding * using mem_interior_convex_shrink \<open>y \<in> S\<close> assms by blast | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 162 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 163 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 164 | lemma in_interior_closure_convex_segment: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 165 | fixes S :: "'a::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 166 | assumes "convex S" and a: "a \<in> interior S" and b: "b \<in> closure S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 167 | shows "open_segment a b \<subseteq> interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 168 | proof (clarsimp simp: in_segment) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 169 | fix u::real | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 170 | assume u: "0 < u" "u < 1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 171 | have "(1 - u) *\<^sub>R a + u *\<^sub>R b = b - (1 - u) *\<^sub>R (b - a)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 172 | by (simp add: algebra_simps) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 173 | also have "... \<in> interior S" using mem_interior_closure_convex_shrink [OF assms] u | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 174 | by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 175 | finally show "(1 - u) *\<^sub>R a + u *\<^sub>R b \<in> interior S" . | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 176 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 177 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 178 | lemma convex_closure_interior: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 179 | fixes S :: "'a::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 180 |   assumes "convex S" and int: "interior S \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 181 | shows "closure(interior S) = closure S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 182 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 183 | obtain a where a: "a \<in> interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 184 | using int by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 185 | have "closure S \<subseteq> closure(interior S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 186 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 187 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 188 | assume x: "x \<in> closure S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 189 | show "x \<in> closure (interior S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 190 | proof (cases "x=a") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 191 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 192 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 193 | using \<open>a \<in> interior S\<close> closure_subset by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 194 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 195 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 196 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 197 | proof (clarsimp simp add: closure_def islimpt_approachable) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 198 | fix e::real | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 199 | assume xnotS: "x \<notin> interior S" and "0 < e" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 200 | show "\<exists>x'\<in>interior S. x' \<noteq> x \<and> dist x' x < e" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 201 | proof (intro bexI conjI) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 202 | show "x - min (e/2 / norm (x - a)) 1 *\<^sub>R (x - a) \<noteq> x" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 203 | using False \<open>0 < e\<close> by (auto simp: algebra_simps min_def) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 204 | show "dist (x - min (e/2 / norm (x - a)) 1 *\<^sub>R (x - a)) x < e" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 205 | using \<open>0 < e\<close> by (auto simp: dist_norm min_def) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 206 | show "x - min (e/2 / norm (x - a)) 1 *\<^sub>R (x - a) \<in> interior S" | 
| 72211 | 207 | using \<open>0 < e\<close> False | 
| 208 | by (auto simp add: min_def a intro: mem_interior_closure_convex_shrink [OF \<open>convex S\<close> a x]) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 209 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 210 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 211 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 212 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 213 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 214 | by (simp add: closure_mono interior_subset subset_antisym) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 215 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 216 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 217 | lemma closure_convex_Int_superset: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 218 | fixes S :: "'a::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 219 |   assumes "convex S" "interior S \<noteq> {}" "interior S \<subseteq> closure T"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 220 | shows "closure(S \<inter> T) = closure S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 221 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 222 | have "closure S \<subseteq> closure(interior S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 223 | by (simp add: convex_closure_interior assms) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 224 | also have "... \<subseteq> closure (S \<inter> T)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 225 | using interior_subset [of S] assms | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 226 | by (metis (no_types, lifting) Int_assoc Int_lower2 closure_mono closure_open_Int_superset inf.orderE open_interior) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 227 | finally show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 228 | by (simp add: closure_mono dual_order.antisym) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 229 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 230 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 231 | |
| 70136 | 232 | subsection\<^marker>\<open>tag unimportant\<close> \<open>Some obvious but surprisingly hard simplex lemmas\<close> | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 233 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 234 | lemma simplex: | 
| 68056 | 235 | assumes "finite S" | 
| 236 | and "0 \<notin> S" | |
| 237 |   shows "convex hull (insert 0 S) = {y. \<exists>u. (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S \<le> 1 \<and> sum (\<lambda>x. u x *\<^sub>R x) S = y}"
 | |
| 238 | proof (simp add: convex_hull_finite set_eq_iff assms, safe) | |
| 239 | fix x and u :: "'a \<Rightarrow> real" | |
| 240 | assume "0 \<le> u 0" "\<forall>x\<in>S. 0 \<le> u x" "u 0 + sum u S = 1" | |
| 241 | then show "\<exists>v. (\<forall>x\<in>S. 0 \<le> v x) \<and> sum v S \<le> 1 \<and> (\<Sum>x\<in>S. v x *\<^sub>R x) = (\<Sum>x\<in>S. u x *\<^sub>R x)" | |
| 242 | by force | |
| 243 | next | |
| 244 | fix x and u :: "'a \<Rightarrow> real" | |
| 245 | assume "\<forall>x\<in>S. 0 \<le> u x" "sum u S \<le> 1" | |
| 246 | then show "\<exists>v. 0 \<le> v 0 \<and> (\<forall>x\<in>S. 0 \<le> v x) \<and> v 0 + sum v S = 1 \<and> (\<Sum>x\<in>S. v x *\<^sub>R x) = (\<Sum>x\<in>S. u x *\<^sub>R x)" | |
| 247 | by (rule_tac x="\<lambda>x. if x = 0 then 1 - sum u S else u x" in exI) (auto simp: sum_delta_notmem assms if_smult) | |
| 248 | qed | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 249 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 250 | lemma substd_simplex: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 251 | assumes d: "d \<subseteq> Basis" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 252 | shows "convex hull (insert 0 d) = | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 253 |     {x. (\<forall>i\<in>Basis. 0 \<le> x\<bullet>i) \<and> (\<Sum>i\<in>d. x\<bullet>i) \<le> 1 \<and> (\<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x\<bullet>i = 0)}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 254 | (is "convex hull (insert 0 ?p) = ?s") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 255 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 256 | let ?D = d | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 257 | have "0 \<notin> ?p" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 258 | using assms by (auto simp: image_def) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 259 | from d have "finite d" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 260 | by (blast intro: finite_subset finite_Basis) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 261 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 262 | unfolding simplex[OF \<open>finite d\<close> \<open>0 \<notin> ?p\<close>] | 
| 68056 | 263 | proof (intro set_eqI; safe) | 
| 264 | fix u :: "'a \<Rightarrow> real" | |
| 265 | assume as: "\<forall>x\<in>?D. 0 \<le> u x" "sum u ?D \<le> 1" | |
| 266 | let ?x = "(\<Sum>x\<in>?D. u x *\<^sub>R x)" | |
| 267 | have ind: "\<forall>i\<in>Basis. i \<in> d \<longrightarrow> u i = ?x \<bullet> i" | |
| 268 | and notind: "(\<forall>i\<in>Basis. i \<notin> d \<longrightarrow> ?x \<bullet> i = 0)" | |
| 269 | using substdbasis_expansion_unique[OF assms] by blast+ | |
| 270 | then have **: "sum u ?D = sum ((\<bullet>) ?x) ?D" | |
| 271 | using assms by (auto intro!: sum.cong) | |
| 272 | show "0 \<le> ?x \<bullet> i" if "i \<in> Basis" for i | |
| 273 | using as(1) ind notind that by fastforce | |
| 274 | show "sum ((\<bullet>) ?x) ?D \<le> 1" | |
| 275 | using "**" as(2) by linarith | |
| 276 | show "?x \<bullet> i = 0" if "i \<in> Basis" "i \<notin> d" for i | |
| 277 | using notind that by blast | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 278 | next | 
| 68056 | 279 | fix x | 
| 280 | assume "\<forall>i\<in>Basis. 0 \<le> x \<bullet> i" "sum ((\<bullet>) x) ?D \<le> 1" "(\<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x \<bullet> i = 0)" | |
| 281 | with d show "\<exists>u. (\<forall>x\<in>?D. 0 \<le> u x) \<and> sum u ?D \<le> 1 \<and> (\<Sum>x\<in>?D. u x *\<^sub>R x) = x" | |
| 282 | unfolding substdbasis_expansion_unique[OF assms] | |
| 283 | by (rule_tac x="inner x" in exI) auto | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 284 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 285 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 286 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 287 | lemma std_simplex: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 288 | "convex hull (insert 0 Basis) = | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 289 |     {x::'a::euclidean_space. (\<forall>i\<in>Basis. 0 \<le> x\<bullet>i) \<and> sum (\<lambda>i. x\<bullet>i) Basis \<le> 1}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 290 | using substd_simplex[of Basis] by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 291 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 292 | lemma interior_std_simplex: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 293 | "interior (convex hull (insert 0 Basis)) = | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 294 |     {x::'a::euclidean_space. (\<forall>i\<in>Basis. 0 < x\<bullet>i) \<and> sum (\<lambda>i. x\<bullet>i) Basis < 1}"
 | 
| 68056 | 295 | unfolding set_eq_iff mem_interior std_simplex | 
| 296 | proof (intro allI iffI CollectI; clarify) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 297 | fix x :: 'a | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 298 | fix e | 
| 68056 | 299 |   assume "e > 0" and as: "ball x e \<subseteq> {x. (\<forall>i\<in>Basis. 0 \<le> x \<bullet> i) \<and> sum ((\<bullet>) x) Basis \<le> 1}"
 | 
| 300 | show "(\<forall>i\<in>Basis. 0 < x \<bullet> i) \<and> sum ((\<bullet>) x) Basis < 1" | |
| 301 | proof safe | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 302 | fix i :: 'a | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 303 | assume i: "i \<in> Basis" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 304 | then show "0 < x \<bullet> i" | 
| 72567 | 305 | using as[THEN subsetD[where c="x - (e/2) *\<^sub>R i"]] and \<open>e > 0\<close> | 
| 68056 | 306 | by (force simp add: inner_simps) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 307 | next | 
| 72567 | 308 | have **: "dist x (x + (e/2) *\<^sub>R (SOME i. i\<in>Basis)) < e" using \<open>e > 0\<close> | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 309 | unfolding dist_norm | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 310 | by (auto intro!: mult_strict_left_mono simp: SOME_Basis) | 
| 72567 | 311 | have "\<And>i. i \<in> Basis \<Longrightarrow> (x + (e/2) *\<^sub>R (SOME i. i\<in>Basis)) \<bullet> i = | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 312 | x\<bullet>i + (if i = (SOME i. i\<in>Basis) then e/2 else 0)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 313 | by (auto simp: SOME_Basis inner_Basis inner_simps) | 
| 72567 | 314 | then have *: "sum ((\<bullet>) (x + (e/2) *\<^sub>R (SOME i. i\<in>Basis))) Basis = | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 315 | sum (\<lambda>i. x\<bullet>i + (if (SOME i. i\<in>Basis) = i then e/2 else 0)) Basis" | 
| 68056 | 316 | by (auto simp: intro!: sum.cong) | 
| 72567 | 317 | have "sum ((\<bullet>) x) Basis < sum ((\<bullet>) (x + (e/2) *\<^sub>R (SOME i. i\<in>Basis))) Basis" | 
| 68056 | 318 | using \<open>e > 0\<close> DIM_positive by (auto simp: SOME_Basis sum.distrib *) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 319 | also have "\<dots> \<le> 1" | 
| 68056 | 320 | using ** as by force | 
| 67399 | 321 | finally show "sum ((\<bullet>) x) Basis < 1" by auto | 
| 68056 | 322 | qed | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 323 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 324 | fix x :: 'a | 
| 67399 | 325 | assume as: "\<forall>i\<in>Basis. 0 < x \<bullet> i" "sum ((\<bullet>) x) Basis < 1" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 326 | obtain a :: 'b where "a \<in> UNIV" using UNIV_witness .. | 
| 67399 | 327 |   let ?d = "(1 - sum ((\<bullet>) x) Basis) / real (DIM('a))"
 | 
| 68056 | 328 |   show "\<exists>e>0. ball x e \<subseteq> {x. (\<forall>i\<in>Basis. 0 \<le> x \<bullet> i) \<and> sum ((\<bullet>) x) Basis \<le> 1}"
 | 
| 329 | proof (rule_tac x="min (Min (((\<bullet>) x) ` Basis)) D" for D in exI, intro conjI subsetI CollectI) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 330 | fix y | 
| 68056 | 331 | assume y: "y \<in> ball x (min (Min ((\<bullet>) x ` Basis)) ?d)" | 
| 67399 | 332 | have "sum ((\<bullet>) y) Basis \<le> sum (\<lambda>i. x\<bullet>i + ?d) Basis" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 333 | proof (rule sum_mono) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 334 | fix i :: 'a | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 335 | assume i: "i \<in> Basis" | 
| 68056 | 336 | have "\<bar>y\<bullet>i - x\<bullet>i\<bar> \<le> norm (y - x)" | 
| 337 | by (metis Basis_le_norm i inner_commute inner_diff_right) | |
| 338 | also have "... < ?d" | |
| 339 | using y by (simp add: dist_norm norm_minus_commute) | |
| 340 | finally have "\<bar>y\<bullet>i - x\<bullet>i\<bar> < ?d" . | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 341 | then show "y \<bullet> i \<le> x \<bullet> i + ?d" by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 342 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 343 | also have "\<dots> \<le> 1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 344 | unfolding sum.distrib sum_constant | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 345 | by (auto simp add: Suc_le_eq) | 
| 67399 | 346 | finally show "sum ((\<bullet>) y) Basis \<le> 1" . | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 347 | show "(\<forall>i\<in>Basis. 0 \<le> y \<bullet> i)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 348 | proof safe | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 349 | fix i :: 'a | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 350 | assume i: "i \<in> Basis" | 
| 68796 
9ca183045102
simplified syntax setup for big operators under image, retaining input abbreviations for backward compatibility
 haftmann parents: 
68607diff
changeset | 351 | have "norm (x - y) < Min (((\<bullet>) x) ` Basis)" | 
| 68056 | 352 | using y by (auto simp: dist_norm less_eq_real_def) | 
| 353 | also have "... \<le> x\<bullet>i" | |
| 354 | using i by auto | |
| 355 | finally have "norm (x - y) < x\<bullet>i" . | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 356 | then show "0 \<le> y\<bullet>i" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 357 | using Basis_le_norm[OF i, of "x - y"] and as(1)[rule_format, OF i] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 358 | by (auto simp: inner_simps) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 359 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 360 | next | 
| 67399 | 361 | have "Min (((\<bullet>) x) ` Basis) > 0" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 362 | using as by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 363 | moreover have "?d > 0" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 364 | using as by (auto simp: Suc_le_eq) | 
| 67399 | 365 |     ultimately show "0 < min (Min ((\<bullet>) x ` Basis)) ((1 - sum ((\<bullet>) x) Basis) / real DIM('a))"
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 366 | by linarith | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 367 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 368 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 369 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 370 | lemma interior_std_simplex_nonempty: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 371 | obtains a :: "'a::euclidean_space" where | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 372 | "a \<in> interior(convex hull (insert 0 Basis))" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 373 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 374 | let ?D = "Basis :: 'a set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 375 |   let ?a = "sum (\<lambda>b::'a. inverse (2 * real DIM('a)) *\<^sub>R b) Basis"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 376 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 377 | fix i :: 'a | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 378 | assume i: "i \<in> Basis" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 379 |     have "?a \<bullet> i = inverse (2 * real DIM('a))"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 380 |       by (rule trans[of _ "sum (\<lambda>j. if i = j then inverse (2 * real DIM('a)) else 0) ?D"])
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 381 | (simp_all add: sum.If_cases i) } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 382 | note ** = this | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 383 | show ?thesis | 
| 72211 | 384 | proof | 
| 385 | show "?a \<in> interior(convex hull (insert 0 Basis))" | |
| 386 | unfolding interior_std_simplex mem_Collect_eq | |
| 387 | proof safe | |
| 388 | fix i :: 'a | |
| 389 | assume i: "i \<in> Basis" | |
| 390 | show "0 < ?a \<bullet> i" | |
| 391 | unfolding **[OF i] by (auto simp add: Suc_le_eq) | |
| 392 | next | |
| 393 |       have "sum ((\<bullet>) ?a) ?D = sum (\<lambda>i. inverse (2 * real DIM('a))) ?D"
 | |
| 394 | by (auto intro: sum.cong) | |
| 395 | also have "\<dots> < 1" | |
| 396 | unfolding sum_constant divide_inverse[symmetric] | |
| 397 | by (auto simp add: field_simps) | |
| 398 | finally show "sum ((\<bullet>) ?a) ?D < 1" by auto | |
| 399 | qed | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 400 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 401 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 402 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 403 | lemma rel_interior_substd_simplex: | 
| 68056 | 404 | assumes D: "D \<subseteq> Basis" | 
| 405 | shows "rel_interior (convex hull (insert 0 D)) = | |
| 72567 | 406 |          {x::'a::euclidean_space. (\<forall>i\<in>D. 0 < x\<bullet>i) \<and> (\<Sum>i\<in>D. x\<bullet>i) < 1 \<and> (\<forall>i\<in>Basis. i \<notin> D \<longrightarrow> x\<bullet>i = 0)}"
 | 
| 407 | (is "_ = ?s") | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 408 | proof - | 
| 68056 | 409 | have "finite D" | 
| 410 | using D finite_Basis finite_subset by blast | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 411 | show ?thesis | 
| 68056 | 412 |   proof (cases "D = {}")
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 413 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 414 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 415 | using rel_interior_sing using euclidean_eq_iff[of _ 0] by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 416 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 417 | case False | 
| 72567 | 418 | have h0: "affine hull (convex hull (insert 0 D)) = | 
| 419 |               {x::'a::euclidean_space. (\<forall>i\<in>Basis. i \<notin> D \<longrightarrow> x\<bullet>i = 0)}"
 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 420 | using affine_hull_convex_hull affine_hull_substd_basis assms by auto | 
| 68056 | 421 | have aux: "\<And>x::'a. \<forall>i\<in>Basis. (\<forall>i\<in>D. 0 \<le> x\<bullet>i) \<and> (\<forall>i\<in>Basis. i \<notin> D \<longrightarrow> x\<bullet>i = 0) \<longrightarrow> 0 \<le> x\<bullet>i" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 422 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 423 |     {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 424 | fix x :: "'a::euclidean_space" | 
| 72567 | 425 | assume x: "x \<in> rel_interior (convex hull (insert 0 D))" | 
| 68056 | 426 | then obtain e where "e > 0" and | 
| 72567 | 427 |         "ball x e \<inter> {xa. (\<forall>i\<in>Basis. i \<notin> D \<longrightarrow> xa\<bullet>i = 0)} \<subseteq> convex hull (insert 0 D)"
 | 
| 428 | using mem_rel_interior_ball[of x "convex hull (insert 0 D)"] h0 by auto | |
| 429 | then have as: "\<And>y. \<lbrakk>dist x y < e \<and> (\<forall>i\<in>Basis. i \<notin> D \<longrightarrow> y\<bullet>i = 0)\<rbrakk> \<Longrightarrow> | |
| 430 | (\<forall>i\<in>D. 0 \<le> y \<bullet> i) \<and> sum ((\<bullet>) y) D \<le> 1" | |
| 431 | using assms by (force simp: substd_simplex) | |
| 68056 | 432 | have x0: "(\<forall>i\<in>Basis. i \<notin> D \<longrightarrow> x\<bullet>i = 0)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 433 | using x rel_interior_subset substd_simplex[OF assms] by auto | 
| 68056 | 434 | have "(\<forall>i\<in>D. 0 < x \<bullet> i) \<and> sum ((\<bullet>) x) D < 1 \<and> (\<forall>i\<in>Basis. i \<notin> D \<longrightarrow> x\<bullet>i = 0)" | 
| 435 | proof (intro conjI ballI) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 436 | fix i :: 'a | 
| 68056 | 437 | assume "i \<in> D" | 
| 72567 | 438 | then have "\<forall>j\<in>D. 0 \<le> (x - (e/2) *\<^sub>R i) \<bullet> j" | 
| 68056 | 439 | using D \<open>e > 0\<close> x0 | 
| 72567 | 440 | by (intro as[THEN conjunct1]) (force simp: dist_norm inner_simps inner_Basis) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 441 | then show "0 < x \<bullet> i" | 
| 68056 | 442 | using \<open>e > 0\<close> \<open>i \<in> D\<close> D by (force simp: inner_simps inner_Basis) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 443 | next | 
| 68056 | 444 | obtain a where a: "a \<in> D" | 
| 445 |           using \<open>D \<noteq> {}\<close> by auto
 | |
| 72567 | 446 | then have **: "dist x (x + (e/2) *\<^sub>R a) < e" | 
| 447 | using \<open>e > 0\<close> norm_Basis[of a] D by (auto simp: dist_norm) | |
| 448 | have "\<And>i. i \<in> Basis \<Longrightarrow> (x + (e/2) *\<^sub>R a) \<bullet> i = x\<bullet>i + (if i = a then e/2 else 0)" | |
| 68056 | 449 | using a D by (auto simp: inner_simps inner_Basis) | 
| 72567 | 450 | then have *: "sum ((\<bullet>) (x + (e/2) *\<^sub>R a)) D = sum (\<lambda>i. x\<bullet>i + (if a = i then e/2 else 0)) D" | 
| 68056 | 451 | using D by (intro sum.cong) auto | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 452 | have "a \<in> Basis" | 
| 68056 | 453 | using \<open>a \<in> D\<close> D by auto | 
| 72567 | 454 | then have h1: "(\<forall>i\<in>Basis. i \<notin> D \<longrightarrow> (x + (e/2) *\<^sub>R a) \<bullet> i = 0)" | 
| 68056 | 455 | using x0 D \<open>a\<in>D\<close> by (auto simp add: inner_add_left inner_Basis) | 
| 72567 | 456 | have "sum ((\<bullet>) x) D < sum ((\<bullet>) (x + (e/2) *\<^sub>R a)) D" | 
| 68056 | 457 | using \<open>e > 0\<close> \<open>a \<in> D\<close> \<open>finite D\<close> by (auto simp add: * sum.distrib) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 458 | also have "\<dots> \<le> 1" | 
| 72567 | 459 | using ** h1 as[rule_format, of "x + (e/2) *\<^sub>R a"] | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 460 | by auto | 
| 68056 | 461 | finally show "sum ((\<bullet>) x) D < 1" "\<And>i. i\<in>Basis \<Longrightarrow> i \<notin> D \<longrightarrow> x\<bullet>i = 0" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 462 | using x0 by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 463 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 464 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 465 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 466 |     {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 467 | fix x :: "'a::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 468 | assume as: "x \<in> ?s" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 469 | have "\<forall>i. 0 < x\<bullet>i \<or> 0 = x\<bullet>i \<longrightarrow> 0 \<le> x\<bullet>i" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 470 | by auto | 
| 68056 | 471 | moreover have "\<forall>i. i \<in> D \<or> i \<notin> D" by auto | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 472 | ultimately | 
| 68056 | 473 | have "\<forall>i. (\<forall>i\<in>D. 0 < x\<bullet>i) \<and> (\<forall>i. i \<notin> D \<longrightarrow> x\<bullet>i = 0) \<longrightarrow> 0 \<le> x\<bullet>i" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 474 | by metis | 
| 72567 | 475 | then have h2: "x \<in> convex hull (insert 0 D)" | 
| 476 | using as assms by (force simp add: substd_simplex) | |
| 68056 | 477 | obtain a where a: "a \<in> D" | 
| 478 |         using \<open>D \<noteq> {}\<close> by auto
 | |
| 72567 | 479 | define d where "d \<equiv> (1 - sum ((\<bullet>) x) D) / real (card D)" | 
| 480 |       have "\<exists>e>0. ball x e \<inter> {x. \<forall>i\<in>Basis. i \<notin> D \<longrightarrow> x \<bullet> i = 0} \<subseteq> convex hull insert 0 D"
 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 481 | unfolding substd_simplex[OF assms] | 
| 72567 | 482 | proof (intro exI; safe) | 
| 483 |         have "0 < card D" using \<open>D \<noteq> {}\<close> \<open>finite D\<close>
 | |
| 484 | by (simp add: card_gt_0_iff) | |
| 485 | have "Min (((\<bullet>) x) ` D) > 0" | |
| 486 |           using as \<open>D \<noteq> {}\<close> \<open>finite D\<close> by (simp)
 | |
| 487 | moreover have "d > 0" | |
| 488 | using as \<open>0 < card D\<close> by (auto simp: d_def) | |
| 489 | ultimately show "min (Min (((\<bullet>) x) ` D)) d > 0" | |
| 490 | by auto | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 491 | fix y :: 'a | 
| 68056 | 492 | assume y2: "\<forall>i\<in>Basis. i \<notin> D \<longrightarrow> y\<bullet>i = 0" | 
| 72567 | 493 | assume "y \<in> ball x (min (Min ((\<bullet>) x ` D)) d)" | 
| 494 | then have y: "dist x y < min (Min ((\<bullet>) x ` D)) d" | |
| 495 | by auto | |
| 496 | have "sum ((\<bullet>) y) D \<le> sum (\<lambda>i. x\<bullet>i + d) D" | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 497 | proof (rule sum_mono) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 498 | fix i | 
| 68056 | 499 | assume "i \<in> D" | 
| 500 | with D have i: "i \<in> Basis" | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 501 | by auto | 
| 68056 | 502 | have "\<bar>y\<bullet>i - x\<bullet>i\<bar> \<le> norm (y - x)" | 
| 503 | by (metis i inner_commute inner_diff_right norm_bound_Basis_le order_refl) | |
| 72567 | 504 | also have "... < d" | 
| 68056 | 505 | by (metis dist_norm min_less_iff_conj norm_minus_commute y) | 
| 72567 | 506 | finally have "\<bar>y\<bullet>i - x\<bullet>i\<bar> < d" . | 
| 507 | then show "y \<bullet> i \<le> x \<bullet> i + d" by auto | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 508 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 509 | also have "\<dots> \<le> 1" | 
| 72567 | 510 | unfolding sum.distrib sum_constant d_def using \<open>0 < card D\<close> | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 511 | by auto | 
| 68056 | 512 | finally show "sum ((\<bullet>) y) D \<le> 1" . | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 513 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 514 | fix i :: 'a | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 515 | assume i: "i \<in> Basis" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 516 | then show "0 \<le> y\<bullet>i" | 
| 68056 | 517 | proof (cases "i\<in>D") | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 518 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 519 | have "norm (x - y) < x\<bullet>i" | 
| 72567 | 520 | using y Min_gr_iff[of "(\<bullet>) x ` D" "norm (x - y)"] \<open>0 < card D\<close> \<open>i \<in> D\<close> | 
| 521 | by (simp add: dist_norm card_gt_0_iff) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 522 | then show "0 \<le> y\<bullet>i" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 523 | using Basis_le_norm[OF i, of "x - y"] and as(1)[rule_format] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 524 | by (auto simp: inner_simps) | 
| 72211 | 525 | qed (use y2 in auto) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 526 | qed | 
| 72567 | 527 | then have "x \<in> rel_interior (convex hull (insert 0 D))" | 
| 72211 | 528 | using h0 h2 rel_interior_ball by force | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 529 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 530 | ultimately have | 
| 68056 | 531 | "\<And>x. x \<in> rel_interior (convex hull insert 0 D) \<longleftrightarrow> | 
| 532 |         x \<in> {x. (\<forall>i\<in>D. 0 < x \<bullet> i) \<and> sum ((\<bullet>) x) D < 1 \<and> (\<forall>i\<in>Basis. i \<notin> D \<longrightarrow> x \<bullet> i = 0)}"
 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 533 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 534 | then show ?thesis by (rule set_eqI) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 535 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 536 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 537 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 538 | lemma rel_interior_substd_simplex_nonempty: | 
| 68056 | 539 |   assumes "D \<noteq> {}"
 | 
| 540 | and "D \<subseteq> Basis" | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 541 | obtains a :: "'a::euclidean_space" | 
| 68056 | 542 | where "a \<in> rel_interior (convex hull (insert 0 D))" | 
| 543 | proof - | |
| 72567 | 544 | let ?a = "sum (\<lambda>b::'a::euclidean_space. inverse (2 * real (card D)) *\<^sub>R b) D" | 
| 68056 | 545 | have "finite D" | 
| 72211 | 546 | using assms finite_Basis infinite_super by blast | 
| 68056 | 547 | then have d1: "0 < real (card D)" | 
| 548 |     using \<open>D \<noteq> {}\<close> by auto
 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 549 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 550 | fix i | 
| 68056 | 551 | assume "i \<in> D" | 
| 72567 | 552 | have "?a \<bullet> i = sum (\<lambda>j. if i = j then inverse (2 * real (card D)) else 0) D" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 553 | unfolding inner_sum_left | 
| 72211 | 554 | using \<open>i \<in> D\<close> by (auto simp: inner_Basis subsetD[OF assms(2)] intro: sum.cong) | 
| 555 | also have "... = inverse (2 * real (card D))" | |
| 556 | using \<open>i \<in> D\<close> \<open>finite D\<close> by auto | |
| 557 | finally have "?a \<bullet> i = inverse (2 * real (card D))" . | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 558 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 559 | note ** = this | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 560 | show ?thesis | 
| 72211 | 561 | proof | 
| 562 | show "?a \<in> rel_interior (convex hull (insert 0 D))" | |
| 563 | unfolding rel_interior_substd_simplex[OF assms(2)] | |
| 564 | proof safe | |
| 565 | fix i | |
| 566 | assume "i \<in> D" | |
| 567 | have "0 < inverse (2 * real (card D))" | |
| 568 | using d1 by auto | |
| 569 | also have "\<dots> = ?a \<bullet> i" using **[of i] \<open>i \<in> D\<close> | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 570 | by auto | 
| 72211 | 571 | finally show "0 < ?a \<bullet> i" by auto | 
| 572 | next | |
| 72567 | 573 | have "sum ((\<bullet>) ?a) D = sum (\<lambda>i. inverse (2 * real (card D))) D" | 
| 72211 | 574 | by (rule sum.cong) (rule refl, rule **) | 
| 575 | also have "\<dots> < 1" | |
| 576 | unfolding sum_constant divide_real_def[symmetric] | |
| 577 | by (auto simp add: field_simps) | |
| 72567 | 578 | finally show "sum ((\<bullet>) ?a) D < 1" by auto | 
| 72211 | 579 | next | 
| 580 | fix i | |
| 581 | assume "i \<in> Basis" and "i \<notin> D" | |
| 582 | have "?a \<in> span D" | |
| 583 | proof (rule span_sum[of D "(\<lambda>b. b /\<^sub>R (2 * real (card D)))" D]) | |
| 584 |         {
 | |
| 585 | fix x :: "'a::euclidean_space" | |
| 586 | assume "x \<in> D" | |
| 587 | then have "x \<in> span D" | |
| 588 | using span_base[of _ "D"] by auto | |
| 589 | then have "x /\<^sub>R (2 * real (card D)) \<in> span D" | |
| 590 | using span_mul[of x "D" "(inverse (real (card D)) / 2)"] by auto | |
| 591 | } | |
| 592 | then show "\<And>x. x\<in>D \<Longrightarrow> x /\<^sub>R (2 * real (card D)) \<in> span D" | |
| 593 | by auto | |
| 594 | qed | |
| 595 | then show "?a \<bullet> i = 0 " | |
| 596 | using \<open>i \<notin> D\<close> unfolding span_substd_basis[OF assms(2)] using \<open>i \<in> Basis\<close> by auto | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 597 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 598 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 599 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 600 | |
| 70136 | 601 | subsection\<^marker>\<open>tag unimportant\<close> \<open>Relative interior of convex set\<close> | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 602 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 603 | lemma rel_interior_convex_nonempty_aux: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 604 | fixes S :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 605 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 606 | and "0 \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 607 |   shows "rel_interior S \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 608 | proof (cases "S = {0}")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 609 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 610 | then show ?thesis using rel_interior_sing by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 611 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 612 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 613 | obtain B where B: "independent B \<and> B \<le> S \<and> S \<le> span B \<and> card B = dim S" | 
| 68069 
36209dfb981e
tidying up and using real induction methods
 paulson <lp15@cam.ac.uk> parents: 
68056diff
changeset | 614 | using basis_exists[of S] by metis | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 615 |   then have "B \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 616 |     using B assms \<open>S \<noteq> {0}\<close> span_empty by auto
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 617 | have "insert 0 B \<le> span B" | 
| 68072 
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
 immler parents: 
67990diff
changeset | 618 | using subspace_span[of B] subspace_0[of "span B"] | 
| 
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
 immler parents: 
67990diff
changeset | 619 | span_superset by auto | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 620 | then have "span (insert 0 B) \<le> span B" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 621 | using span_span[of B] span_mono[of "insert 0 B" "span B"] by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 622 | then have "convex hull insert 0 B \<le> span B" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 623 | using convex_hull_subset_span[of "insert 0 B"] by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 624 | then have "span (convex hull insert 0 B) \<le> span B" | 
| 68072 
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
 immler parents: 
67990diff
changeset | 625 | using span_span[of B] | 
| 
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
 immler parents: 
67990diff
changeset | 626 | span_mono[of "convex hull insert 0 B" "span B"] by blast | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 627 | then have *: "span (convex hull insert 0 B) = span B" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 628 | using span_mono[of B "convex hull insert 0 B"] hull_subset[of "insert 0 B"] by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 629 | then have "span (convex hull insert 0 B) = span S" | 
| 68072 
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
 immler parents: 
67990diff
changeset | 630 | using B span_mono[of B S] span_mono[of S "span B"] | 
| 
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
 immler parents: 
67990diff
changeset | 631 | span_span[of B] by auto | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 632 | moreover have "0 \<in> affine hull (convex hull insert 0 B)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 633 | using hull_subset[of "convex hull insert 0 B"] hull_subset[of "insert 0 B"] by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 634 | ultimately have **: "affine hull (convex hull insert 0 B) = affine hull S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 635 | using affine_hull_span_0[of "convex hull insert 0 B"] affine_hull_span_0[of "S"] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 636 | assms hull_subset[of S] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 637 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 638 | obtain d and f :: "'n \<Rightarrow> 'n" where | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 639 | fd: "card d = card B" "linear f" "f ` B = d" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 640 |       "f ` span B = {x. \<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x \<bullet> i = (0::real)} \<and> inj_on f (span B)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 641 | and d: "d \<subseteq> Basis" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 642 | using basis_to_substdbasis_subspace_isomorphism[of B,OF _ ] B by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 643 | then have "bounded_linear f" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 644 | using linear_conv_bounded_linear by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 645 |   have "d \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 646 |     using fd B \<open>B \<noteq> {}\<close> by auto
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 647 | have "insert 0 d = f ` (insert 0 B)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 648 | using fd linear_0 by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 649 | then have "(convex hull (insert 0 d)) = f ` (convex hull (insert 0 B))" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 650 | using convex_hull_linear_image[of f "(insert 0 d)"] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 651 | convex_hull_linear_image[of f "(insert 0 B)"] \<open>linear f\<close> | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 652 | by auto | 
| 72238 | 653 | moreover have "rel_interior (f ` (convex hull insert 0 B)) = f ` rel_interior (convex hull insert 0 B)" | 
| 654 | proof (rule rel_interior_injective_on_span_linear_image[OF \<open>bounded_linear f\<close>]) | |
| 655 | show "inj_on f (span (convex hull insert 0 B))" | |
| 656 | using fd * by auto | |
| 657 | qed | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 658 |   ultimately have "rel_interior (convex hull insert 0 B) \<noteq> {}"
 | 
| 72238 | 659 |     using rel_interior_substd_simplex_nonempty[OF \<open>d \<noteq> {}\<close> d] by fastforce
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 660 | moreover have "convex hull (insert 0 B) \<subseteq> S" | 
| 72238 | 661 | using B assms hull_mono[of "insert 0 B" "S" "convex"] convex_hull_eq by auto | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 662 | ultimately show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 663 | using subset_rel_interior[of "convex hull insert 0 B" S] ** by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 664 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 665 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 666 | lemma rel_interior_eq_empty: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 667 | fixes S :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 668 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 669 |   shows "rel_interior S = {} \<longleftrightarrow> S = {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 670 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 671 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 672 |     assume "S \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 673 | then obtain a where "a \<in> S" by auto | 
| 67399 | 674 | then have "0 \<in> (+) (-a) ` S" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 675 | using assms exI[of "(\<lambda>x. x \<in> S \<and> - a + x = 0)" a] by auto | 
| 67399 | 676 |     then have "rel_interior ((+) (-a) ` S) \<noteq> {}"
 | 
| 677 | using rel_interior_convex_nonempty_aux[of "(+) (-a) ` S"] | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 678 | convex_translation[of S "-a"] assms | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 679 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 680 |     then have "rel_interior S \<noteq> {}"
 | 
| 69661 | 681 | using rel_interior_translation [of "- a"] by simp | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 682 | } | 
| 71176 | 683 | then show ?thesis by auto | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 684 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 685 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 686 | lemma interior_simplex_nonempty: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 687 | fixes S :: "'N :: euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 688 |   assumes "independent S" "finite S" "card S = DIM('N)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 689 | obtains a where "a \<in> interior (convex hull (insert 0 S))" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 690 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 691 | have "affine hull (insert 0 S) = UNIV" | 
| 68072 
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
 immler parents: 
67990diff
changeset | 692 | by (simp add: hull_inc affine_hull_span_0 dim_eq_full[symmetric] | 
| 
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
 immler parents: 
67990diff
changeset | 693 | assms(1) assms(3) dim_eq_card_independent) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 694 |   moreover have "rel_interior (convex hull insert 0 S) \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 695 | using rel_interior_eq_empty [of "convex hull (insert 0 S)"] by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 696 |   ultimately have "interior (convex hull insert 0 S) \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 697 | by (simp add: rel_interior_interior) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 698 | with that show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 699 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 700 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 701 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 702 | lemma convex_rel_interior: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 703 | fixes S :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 704 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 705 | shows "convex (rel_interior S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 706 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 707 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 708 | fix x y and u :: real | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 709 | assume assm: "x \<in> rel_interior S" "y \<in> rel_interior S" "0 \<le> u" "u \<le> 1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 710 | then have "x \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 711 | using rel_interior_subset by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 712 | have "x - u *\<^sub>R (x-y) \<in> rel_interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 713 | proof (cases "0 = u") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 714 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 715 | then have "0 < u" using assm by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 716 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 717 | using assm rel_interior_convex_shrink[of S y x u] assms \<open>x \<in> S\<close> by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 718 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 719 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 720 | then show ?thesis using assm by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 721 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 722 | then have "(1 - u) *\<^sub>R x + u *\<^sub>R y \<in> rel_interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 723 | by (simp add: algebra_simps) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 724 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 725 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 726 | unfolding convex_alt by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 727 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 728 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 729 | lemma convex_closure_rel_interior: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 730 | fixes S :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 731 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 732 | shows "closure (rel_interior S) = closure S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 733 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 734 | have h1: "closure (rel_interior S) \<le> closure S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 735 | using closure_mono[of "rel_interior S" S] rel_interior_subset[of S] by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 736 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 737 |   proof (cases "S = {}")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 738 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 739 | then obtain a where a: "a \<in> rel_interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 740 | using rel_interior_eq_empty assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 741 |     { fix x
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 742 | assume x: "x \<in> closure S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 743 |       {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 744 | assume "x = a" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 745 | then have "x \<in> closure (rel_interior S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 746 | using a unfolding closure_def by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 747 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 748 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 749 |       {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 750 | assume "x \<noteq> a" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 751 |          {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 752 | fix e :: real | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 753 | assume "e > 0" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 754 | define e1 where "e1 = min 1 (e/norm (x - a))" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 755 | then have e1: "e1 > 0" "e1 \<le> 1" "e1 * norm (x - a) \<le> e" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 756 | using \<open>x \<noteq> a\<close> \<open>e > 0\<close> le_divide_eq[of e1 e "norm (x - a)"] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 757 | by simp_all | 
| 67613 | 758 | then have *: "x - e1 *\<^sub>R (x - a) \<in> rel_interior S" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 759 | using rel_interior_closure_convex_shrink[of S a x e1] assms x a e1_def | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 760 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 761 | have "\<exists>y. y \<in> rel_interior S \<and> y \<noteq> x \<and> dist y x \<le> e" | 
| 72567 | 762 | using "*" \<open>x \<noteq> a\<close> e1 by force | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 763 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 764 | then have "x islimpt rel_interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 765 | unfolding islimpt_approachable_le by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 766 | then have "x \<in> closure(rel_interior S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 767 | unfolding closure_def by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 768 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 769 | ultimately have "x \<in> closure(rel_interior S)" by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 770 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 771 | then show ?thesis using h1 by auto | 
| 72567 | 772 | qed auto | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 773 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 774 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 775 | lemma rel_interior_same_affine_hull: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 776 | fixes S :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 777 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 778 | shows "affine hull (rel_interior S) = affine hull S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 779 | by (metis assms closure_same_affine_hull convex_closure_rel_interior) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 780 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 781 | lemma rel_interior_aff_dim: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 782 | fixes S :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 783 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 784 | shows "aff_dim (rel_interior S) = aff_dim S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 785 | by (metis aff_dim_affine_hull2 assms rel_interior_same_affine_hull) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 786 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 787 | lemma rel_interior_rel_interior: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 788 | fixes S :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 789 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 790 | shows "rel_interior (rel_interior S) = rel_interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 791 | proof - | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 792 | have "openin (top_of_set (affine hull (rel_interior S))) (rel_interior S)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 793 | using openin_rel_interior[of S] rel_interior_same_affine_hull[of S] assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 794 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 795 | using rel_interior_def by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 796 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 797 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 798 | lemma rel_interior_rel_open: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 799 | fixes S :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 800 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 801 | shows "rel_open (rel_interior S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 802 | unfolding rel_open_def using rel_interior_rel_interior assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 803 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 804 | lemma convex_rel_interior_closure_aux: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 805 | fixes x y z :: "'n::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 806 | assumes "0 < a" "0 < b" "(a + b) *\<^sub>R z = a *\<^sub>R x + b *\<^sub>R y" | 
| 72567 | 807 | obtains e where "0 < e" "e < 1" "z = y - e *\<^sub>R (y - x)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 808 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 809 | define e where "e = a / (a + b)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 810 | have "z = (1 / (a + b)) *\<^sub>R ((a + b) *\<^sub>R z)" | 
| 68056 | 811 | using assms by (simp add: eq_vector_fraction_iff) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 812 | also have "\<dots> = (1 / (a + b)) *\<^sub>R (a *\<^sub>R x + b *\<^sub>R y)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 813 | using assms scaleR_cancel_left[of "1/(a+b)" "(a + b) *\<^sub>R z" "a *\<^sub>R x + b *\<^sub>R y"] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 814 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 815 | also have "\<dots> = y - e *\<^sub>R (y-x)" | 
| 72238 | 816 | using e_def assms | 
| 72567 | 817 | by (simp add: divide_simps vector_fraction_eq_iff) (simp add: algebra_simps) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 818 | finally have "z = y - e *\<^sub>R (y-x)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 819 | by auto | 
| 72567 | 820 | moreover have "e > 0" "e < 1" using e_def assms by auto | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 821 | ultimately show ?thesis using that[of e] by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 822 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 823 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 824 | lemma convex_rel_interior_closure: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 825 | fixes S :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 826 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 827 | shows "rel_interior (closure S) = rel_interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 828 | proof (cases "S = {}")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 829 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 830 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 831 | using assms rel_interior_eq_empty by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 832 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 833 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 834 | have "rel_interior (closure S) \<supseteq> rel_interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 835 | using subset_rel_interior[of S "closure S"] closure_same_affine_hull closure_subset | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 836 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 837 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 838 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 839 | fix z | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 840 | assume z: "z \<in> rel_interior (closure S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 841 | obtain x where x: "x \<in> rel_interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 842 |       using \<open>S \<noteq> {}\<close> assms rel_interior_eq_empty by auto
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 843 | have "z \<in> rel_interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 844 | proof (cases "x = z") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 845 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 846 | then show ?thesis using x by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 847 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 848 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 849 | obtain e where e: "e > 0" "cball z e \<inter> affine hull closure S \<le> closure S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 850 | using z rel_interior_cball[of "closure S"] by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 851 | hence *: "0 < e/norm(z-x)" using e False by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 852 | define y where "y = z + (e/norm(z-x)) *\<^sub>R (z-x)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 853 | have yball: "y \<in> cball z e" | 
| 71174 | 854 | using y_def dist_norm[of z y] e by auto | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 855 | have "x \<in> affine hull closure S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 856 | using x rel_interior_subset_closure hull_inc[of x "closure S"] by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 857 | moreover have "z \<in> affine hull closure S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 858 | using z rel_interior_subset hull_subset[of "closure S"] by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 859 | ultimately have "y \<in> affine hull closure S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 860 | using y_def affine_affine_hull[of "closure S"] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 861 | mem_affine_3_minus [of "affine hull closure S" z z x "e/norm(z-x)"] by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 862 | then have "y \<in> closure S" using e yball by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 863 | have "(1 + (e/norm(z-x))) *\<^sub>R z = (e/norm(z-x)) *\<^sub>R x + y" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 864 | using y_def by (simp add: algebra_simps) | 
| 72567 | 865 | then obtain e1 where "0 < e1" "e1 < 1" "z = y - e1 *\<^sub>R (y - x)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 866 | using * convex_rel_interior_closure_aux[of "e / norm (z - x)" 1 z x y] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 867 | by (auto simp add: algebra_simps) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 868 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 869 | using rel_interior_closure_convex_shrink assms x \<open>y \<in> closure S\<close> | 
| 72567 | 870 | by fastforce | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 871 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 872 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 873 | ultimately show ?thesis by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 874 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 875 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 876 | lemma convex_interior_closure: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 877 | fixes S :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 878 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 879 | shows "interior (closure S) = interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 880 | using closure_aff_dim[of S] interior_rel_interior_gen[of S] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 881 | interior_rel_interior_gen[of "closure S"] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 882 | convex_rel_interior_closure[of S] assms | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 883 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 884 | |
| 78037 
37894dff0111
More material from the HOL Light metric space library
 paulson <lp15@cam.ac.uk> parents: 
74729diff
changeset | 885 | lemma open_subset_closure_of_interval: | 
| 
37894dff0111
More material from the HOL Light metric space library
 paulson <lp15@cam.ac.uk> parents: 
74729diff
changeset | 886 | assumes "open U" "is_interval S" | 
| 
37894dff0111
More material from the HOL Light metric space library
 paulson <lp15@cam.ac.uk> parents: 
74729diff
changeset | 887 | shows "U \<subseteq> closure S \<longleftrightarrow> U \<subseteq> interior S" | 
| 
37894dff0111
More material from the HOL Light metric space library
 paulson <lp15@cam.ac.uk> parents: 
74729diff
changeset | 888 | by (metis assms convex_interior_closure is_interval_convex open_subset_interior) | 
| 
37894dff0111
More material from the HOL Light metric space library
 paulson <lp15@cam.ac.uk> parents: 
74729diff
changeset | 889 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 890 | lemma closure_eq_rel_interior_eq: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 891 | fixes S1 S2 :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 892 | assumes "convex S1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 893 | and "convex S2" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 894 | shows "closure S1 = closure S2 \<longleftrightarrow> rel_interior S1 = rel_interior S2" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 895 | by (metis convex_rel_interior_closure convex_closure_rel_interior assms) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 896 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 897 | lemma closure_eq_between: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 898 | fixes S1 S2 :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 899 | assumes "convex S1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 900 | and "convex S2" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 901 | shows "closure S1 = closure S2 \<longleftrightarrow> rel_interior S1 \<le> S2 \<and> S2 \<subseteq> closure S1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 902 | (is "?A \<longleftrightarrow> ?B") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 903 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 904 | assume ?A | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 905 | then show ?B | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 906 | by (metis assms closure_subset convex_rel_interior_closure rel_interior_subset) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 907 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 908 | assume ?B | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 909 | then have "closure S1 \<subseteq> closure S2" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 910 | by (metis assms(1) convex_closure_rel_interior closure_mono) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 911 | moreover from \<open>?B\<close> have "closure S1 \<supseteq> closure S2" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 912 | by (metis closed_closure closure_minimal) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 913 | ultimately show ?A .. | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 914 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 915 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 916 | lemma open_inter_closure_rel_interior: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 917 | fixes S A :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 918 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 919 | and "open A" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 920 |   shows "A \<inter> closure S = {} \<longleftrightarrow> A \<inter> rel_interior S = {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 921 | by (metis assms convex_closure_rel_interior open_Int_closure_eq_empty) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 922 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 923 | lemma rel_interior_open_segment: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 924 | fixes a :: "'a :: euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 925 | shows "rel_interior(open_segment a b) = open_segment a b" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 926 | proof (cases "a = b") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 927 | case True then show ?thesis by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 928 | next | 
| 72238 | 929 | case False then | 
| 930 |   have "open_segment a b = affine hull {a, b} \<inter> ball ((a + b) /\<^sub>R 2) (norm (b - a) / 2)"
 | |
| 931 | by (simp add: open_segment_as_ball) | |
| 932 | then show ?thesis | |
| 933 | unfolding rel_interior_eq openin_open | |
| 934 | by (metis Elementary_Metric_Spaces.open_ball False affine_hull_open_segment) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 935 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 936 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 937 | lemma rel_interior_closed_segment: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 938 | fixes a :: "'a :: euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 939 | shows "rel_interior(closed_segment a b) = | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 940 |          (if a = b then {a} else open_segment a b)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 941 | proof (cases "a = b") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 942 | case True then show ?thesis by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 943 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 944 | case False then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 945 | by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 946 | (metis closure_open_segment convex_open_segment convex_rel_interior_closure | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 947 | rel_interior_open_segment) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 948 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 949 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 950 | lemmas rel_interior_segment = rel_interior_closed_segment rel_interior_open_segment | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 951 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 952 | subsection\<open>The relative frontier of a set\<close> | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 953 | |
| 70136 | 954 | definition\<^marker>\<open>tag important\<close> "rel_frontier S = closure S - rel_interior S" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 955 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 956 | lemma rel_frontier_empty [simp]: "rel_frontier {} = {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 957 | by (simp add: rel_frontier_def) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 958 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 959 | lemma rel_frontier_eq_empty: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 960 | fixes S :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 961 |     shows "rel_frontier S = {} \<longleftrightarrow> affine S"
 | 
| 68056 | 962 | unfolding rel_frontier_def | 
| 963 | using rel_interior_subset_closure by (auto simp add: rel_interior_eq_closure [symmetric]) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 964 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 965 | lemma rel_frontier_sing [simp]: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 966 | fixes a :: "'n::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 967 |     shows "rel_frontier {a} = {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 968 | by (simp add: rel_frontier_def) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 969 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 970 | lemma rel_frontier_affine_hull: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 971 | fixes S :: "'a::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 972 | shows "rel_frontier S \<subseteq> affine hull S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 973 | using closure_affine_hull rel_frontier_def by fastforce | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 974 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 975 | lemma rel_frontier_cball [simp]: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 976 | fixes a :: "'n::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 977 |     shows "rel_frontier(cball a r) = (if r = 0 then {} else sphere a r)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 978 | proof (cases rule: linorder_cases [of r 0]) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 979 | case less then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 980 | by (force simp: sphere_def) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 981 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 982 | case equal then show ?thesis by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 983 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 984 | case greater then show ?thesis | 
| 72238 | 985 | by simp (metis centre_in_ball empty_iff frontier_cball frontier_def interior_cball interior_rel_interior_gen rel_frontier_def) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 986 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 987 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 988 | lemma rel_frontier_translation: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 989 | fixes a :: "'a::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 990 | shows "rel_frontier((\<lambda>x. a + x) ` S) = (\<lambda>x. a + x) ` (rel_frontier S)" | 
| 72238 | 991 | by (simp add: rel_frontier_def translation_diff rel_interior_translation closure_translation) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 992 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 993 | lemma rel_frontier_nonempty_interior: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 994 | fixes S :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 995 |   shows "interior S \<noteq> {} \<Longrightarrow> rel_frontier S = frontier S"
 | 
| 72238 | 996 | by (metis frontier_def interior_rel_interior_gen rel_frontier_def) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 997 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 998 | lemma rel_frontier_frontier: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 999 | fixes S :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1000 | shows "affine hull S = UNIV \<Longrightarrow> rel_frontier S = frontier S" | 
| 72238 | 1001 | by (simp add: frontier_def rel_frontier_def rel_interior_interior) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1002 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1003 | lemma closest_point_in_rel_frontier: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1004 |    "\<lbrakk>closed S; S \<noteq> {}; x \<in> affine hull S - rel_interior S\<rbrakk>
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1005 | \<Longrightarrow> closest_point S x \<in> rel_frontier S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1006 | by (simp add: closest_point_in_rel_interior closest_point_in_set rel_frontier_def) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1007 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1008 | lemma closed_rel_frontier [iff]: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1009 | fixes S :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1010 | shows "closed (rel_frontier S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1011 | proof - | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 1012 | have *: "closedin (top_of_set (affine hull S)) (closure S - rel_interior S)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1013 | by (simp add: closed_subset closedin_diff closure_affine_hull openin_rel_interior) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1014 | show ?thesis | 
| 72238 | 1015 | proof (rule closedin_closed_trans[of "affine hull S" "rel_frontier S"]) | 
| 1016 | show "closedin (top_of_set (affine hull S)) (rel_frontier S)" | |
| 1017 | by (simp add: "*" rel_frontier_def) | |
| 1018 | qed simp | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1019 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1020 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1021 | lemma closed_rel_boundary: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1022 | fixes S :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1023 | shows "closed S \<Longrightarrow> closed(S - rel_interior S)" | 
| 72238 | 1024 | by (metis closed_rel_frontier closure_closed rel_frontier_def) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1025 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1026 | lemma compact_rel_boundary: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1027 | fixes S :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1028 | shows "compact S \<Longrightarrow> compact(S - rel_interior S)" | 
| 72238 | 1029 | by (metis bounded_diff closed_rel_boundary closure_eq compact_closure compact_imp_closed) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1030 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1031 | lemma bounded_rel_frontier: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1032 | fixes S :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1033 | shows "bounded S \<Longrightarrow> bounded(rel_frontier S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1034 | by (simp add: bounded_closure bounded_diff rel_frontier_def) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1035 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1036 | lemma compact_rel_frontier_bounded: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1037 | fixes S :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1038 | shows "bounded S \<Longrightarrow> compact(rel_frontier S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1039 | using bounded_rel_frontier closed_rel_frontier compact_eq_bounded_closed by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1040 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1041 | lemma compact_rel_frontier: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1042 | fixes S :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1043 | shows "compact S \<Longrightarrow> compact(rel_frontier S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1044 | by (meson compact_eq_bounded_closed compact_rel_frontier_bounded) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1045 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1046 | lemma convex_same_rel_interior_closure: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1047 | fixes S :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1048 | shows "\<lbrakk>convex S; convex T\<rbrakk> | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1049 | \<Longrightarrow> rel_interior S = rel_interior T \<longleftrightarrow> closure S = closure T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1050 | by (simp add: closure_eq_rel_interior_eq) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1051 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1052 | lemma convex_same_rel_interior_closure_straddle: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1053 | fixes S :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1054 | shows "\<lbrakk>convex S; convex T\<rbrakk> | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1055 | \<Longrightarrow> rel_interior S = rel_interior T \<longleftrightarrow> | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1056 | rel_interior S \<subseteq> T \<and> T \<subseteq> closure S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1057 | by (simp add: closure_eq_between convex_same_rel_interior_closure) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1058 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1059 | lemma convex_rel_frontier_aff_dim: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1060 | fixes S1 S2 :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1061 | assumes "convex S1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1062 | and "convex S2" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1063 |     and "S2 \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1064 | and "S1 \<le> rel_frontier S2" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1065 | shows "aff_dim S1 < aff_dim S2" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1066 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1067 | have "S1 \<subseteq> closure S2" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1068 | using assms unfolding rel_frontier_def by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1069 | then have *: "affine hull S1 \<subseteq> affine hull S2" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1070 | using hull_mono[of "S1" "closure S2"] closure_same_affine_hull[of S2] by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1071 | then have "aff_dim S1 \<le> aff_dim S2" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1072 | using * aff_dim_affine_hull[of S1] aff_dim_affine_hull[of S2] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1073 | aff_dim_subset[of "affine hull S1" "affine hull S2"] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1074 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1075 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1076 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1077 | assume eq: "aff_dim S1 = aff_dim S2" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1078 |     then have "S1 \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1079 |       using aff_dim_empty[of S1] aff_dim_empty[of S2] \<open>S2 \<noteq> {}\<close> by auto
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1080 | have **: "affine hull S1 = affine hull S2" | 
| 72238 | 1081 |       by (simp_all add: * eq \<open>S1 \<noteq> {}\<close> affine_dim_equal)
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1082 | obtain a where a: "a \<in> rel_interior S1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1083 |       using \<open>S1 \<noteq> {}\<close> rel_interior_eq_empty assms by auto
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1084 | obtain T where T: "open T" "a \<in> T \<inter> S1" "T \<inter> affine hull S1 \<subseteq> S1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1085 | using mem_rel_interior[of a S1] a by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1086 | then have "a \<in> T \<inter> closure S2" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1087 | using a assms unfolding rel_frontier_def by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1088 | then obtain b where b: "b \<in> T \<inter> rel_interior S2" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1089 | using open_inter_closure_rel_interior[of S2 T] assms T by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1090 | then have "b \<in> affine hull S1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1091 | using rel_interior_subset hull_subset[of S2] ** by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1092 | then have "b \<in> S1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1093 | using T b by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1094 | then have False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1095 | using b assms unfolding rel_frontier_def by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1096 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1097 | ultimately show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1098 | using less_le by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1099 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1100 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1101 | lemma convex_rel_interior_if: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1102 | fixes S :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1103 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1104 | and "z \<in> rel_interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1105 | shows "\<forall>x\<in>affine hull S. \<exists>m. m > 1 \<and> (\<forall>e. e > 1 \<and> e \<le> m \<longrightarrow> (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1106 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1107 | obtain e1 where e1: "e1 > 0 \<and> cball z e1 \<inter> affine hull S \<subseteq> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1108 | using mem_rel_interior_cball[of z S] assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1109 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1110 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1111 | assume x: "x \<in> affine hull S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1112 |     {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1113 | assume "x \<noteq> z" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1114 | define m where "m = 1 + e1/norm(x-z)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1115 | hence "m > 1" using e1 \<open>x \<noteq> z\<close> by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1116 |       {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1117 | fix e | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1118 | assume e: "e > 1 \<and> e \<le> m" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1119 | have "z \<in> affine hull S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1120 | using assms rel_interior_subset hull_subset[of S] by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1121 | then have *: "(1 - e)*\<^sub>R x + e *\<^sub>R z \<in> affine hull S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1122 | using mem_affine[of "affine hull S" x z "(1-e)" e] affine_affine_hull[of S] x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1123 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1124 | have "norm (z + e *\<^sub>R x - (x + e *\<^sub>R z)) = norm ((e - 1) *\<^sub>R (x - z))" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1125 | by (simp add: algebra_simps) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1126 | also have "\<dots> = (e - 1) * norm (x-z)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1127 | using norm_scaleR e by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1128 | also have "\<dots> \<le> (m - 1) * norm (x - z)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1129 | using e mult_right_mono[of _ _ "norm(x-z)"] by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1130 | also have "\<dots> = (e1 / norm (x - z)) * norm (x - z)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1131 | using m_def by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1132 | also have "\<dots> = e1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1133 | using \<open>x \<noteq> z\<close> e1 by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1134 | finally have **: "norm (z + e *\<^sub>R x - (x + e *\<^sub>R z)) \<le> e1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1135 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1136 | have "(1 - e)*\<^sub>R x+ e *\<^sub>R z \<in> cball z e1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1137 | using m_def ** | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1138 | unfolding cball_def dist_norm | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1139 | by (auto simp add: algebra_simps) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1140 | then have "(1 - e) *\<^sub>R x+ e *\<^sub>R z \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1141 | using e * e1 by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1142 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1143 | then have "\<exists>m. m > 1 \<and> (\<forall>e. e > 1 \<and> e \<le> m \<longrightarrow> (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S )" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1144 | using \<open>m> 1 \<close> by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1145 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1146 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1147 |     {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1148 | assume "x = z" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1149 | define m where "m = 1 + e1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1150 | then have "m > 1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1151 | using e1 by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1152 |       {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1153 | fix e | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1154 | assume e: "e > 1 \<and> e \<le> m" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1155 | then have "(1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1156 | using e1 x \<open>x = z\<close> by (auto simp add: algebra_simps) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1157 | then have "(1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1158 | using e by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1159 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1160 | then have "\<exists>m. m > 1 \<and> (\<forall>e. e > 1 \<and> e \<le> m \<longrightarrow> (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1161 | using \<open>m > 1\<close> by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1162 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1163 | ultimately have "\<exists>m. m > 1 \<and> (\<forall>e. e > 1 \<and> e \<le> m \<longrightarrow> (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S )" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1164 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1165 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1166 | then show ?thesis by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1167 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1168 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1169 | lemma convex_rel_interior_if2: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1170 | fixes S :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1171 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1172 | assumes "z \<in> rel_interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1173 | shows "\<forall>x\<in>affine hull S. \<exists>e. e > 1 \<and> (1 - e)*\<^sub>R x + e *\<^sub>R z \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1174 | using convex_rel_interior_if[of S z] assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1175 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1176 | lemma convex_rel_interior_only_if: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1177 | fixes S :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1178 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1179 |     and "S \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1180 | assumes "\<forall>x\<in>S. \<exists>e. e > 1 \<and> (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1181 | shows "z \<in> rel_interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1182 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1183 | obtain x where x: "x \<in> rel_interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1184 | using rel_interior_eq_empty assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1185 | then have "x \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1186 | using rel_interior_subset by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1187 | then obtain e where e: "e > 1 \<and> (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1188 | using assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1189 | define y where [abs_def]: "y = (1 - e) *\<^sub>R x + e *\<^sub>R z" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1190 | then have "y \<in> S" using e by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1191 | define e1 where "e1 = 1/e" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1192 | then have "0 < e1 \<and> e1 < 1" using e by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1193 | then have "z =y - (1 - e1) *\<^sub>R (y - x)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1194 | using e1_def y_def by (auto simp add: algebra_simps) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1195 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1196 | using rel_interior_convex_shrink[of S x y "1-e1"] \<open>0 < e1 \<and> e1 < 1\<close> \<open>y \<in> S\<close> x assms | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1197 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1198 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1199 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1200 | lemma convex_rel_interior_iff: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1201 | fixes S :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1202 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1203 |     and "S \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1204 | shows "z \<in> rel_interior S \<longleftrightarrow> (\<forall>x\<in>S. \<exists>e. e > 1 \<and> (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1205 | using assms hull_subset[of S "affine"] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1206 | convex_rel_interior_if[of S z] convex_rel_interior_only_if[of S z] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1207 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1208 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1209 | lemma convex_rel_interior_iff2: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1210 | fixes S :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1211 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1212 |     and "S \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1213 | shows "z \<in> rel_interior S \<longleftrightarrow> (\<forall>x\<in>affine hull S. \<exists>e. e > 1 \<and> (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1214 | using assms hull_subset[of S] convex_rel_interior_if2[of S z] convex_rel_interior_only_if[of S z] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1215 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1216 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1217 | lemma convex_interior_iff: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1218 | fixes S :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1219 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1220 | shows "z \<in> interior S \<longleftrightarrow> (\<forall>x. \<exists>e. e > 0 \<and> z + e *\<^sub>R x \<in> S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1221 | proof (cases "aff_dim S = int DIM('n)")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1222 | case False | 
| 68056 | 1223 |   { assume "z \<in> interior S"
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1224 | then have False | 
| 68056 | 1225 | using False interior_rel_interior_gen[of S] by auto } | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1226 | moreover | 
| 68056 | 1227 |   { assume r: "\<forall>x. \<exists>e. e > 0 \<and> z + e *\<^sub>R x \<in> S"
 | 
| 1228 |     { fix x
 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1229 | obtain e1 where e1: "e1 > 0 \<and> z + e1 *\<^sub>R (x - z) \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1230 | using r by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1231 | obtain e2 where e2: "e2 > 0 \<and> z + e2 *\<^sub>R (z - x) \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1232 | using r by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1233 | define x1 where [abs_def]: "x1 = z + e1 *\<^sub>R (x - z)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1234 | then have x1: "x1 \<in> affine hull S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1235 | using e1 hull_subset[of S] by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1236 | define x2 where [abs_def]: "x2 = z + e2 *\<^sub>R (z - x)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1237 | then have x2: "x2 \<in> affine hull S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1238 | using e2 hull_subset[of S] by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1239 | have *: "e1/(e1+e2) + e2/(e1+e2) = 1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1240 | using add_divide_distrib[of e1 e2 "e1+e2"] e1 e2 by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1241 | then have "z = (e2/(e1+e2)) *\<^sub>R x1 + (e1/(e1+e2)) *\<^sub>R x2" | 
| 72567 | 1242 | by (simp add: x1_def x2_def algebra_simps) (simp add: "*" pth_8) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1243 | then have z: "z \<in> affine hull S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1244 | using mem_affine[of "affine hull S" x1 x2 "e2/(e1+e2)" "e1/(e1+e2)"] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1245 | x1 x2 affine_affine_hull[of S] * | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1246 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1247 | have "x1 - x2 = (e1 + e2) *\<^sub>R (x - z)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1248 | using x1_def x2_def by (auto simp add: algebra_simps) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1249 | then have "x = z+(1/(e1+e2)) *\<^sub>R (x1-x2)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1250 | using e1 e2 by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1251 | then have "x \<in> affine hull S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1252 | using mem_affine_3_minus[of "affine hull S" z x1 x2 "1/(e1+e2)"] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1253 | x1 x2 z affine_affine_hull[of S] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1254 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1255 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1256 | then have "affine hull S = UNIV" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1257 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1258 |     then have "aff_dim S = int DIM('n)"
 | 
| 71176 | 1259 | using aff_dim_affine_hull[of S] by (simp) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1260 | then have False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1261 | using False by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1262 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1263 | ultimately show ?thesis by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1264 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1265 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1266 |   then have "S \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1267 | using aff_dim_empty[of S] by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1268 | have *: "affine hull S = UNIV" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1269 | using True affine_hull_UNIV by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1270 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1271 | assume "z \<in> interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1272 | then have "z \<in> rel_interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1273 | using True interior_rel_interior_gen[of S] by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1274 | then have **: "\<forall>x. \<exists>e. e > 1 \<and> (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1275 |       using convex_rel_interior_iff2[of S z] assms \<open>S \<noteq> {}\<close> * by auto
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1276 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1277 | obtain e1 where e1: "e1 > 1" "(1 - e1) *\<^sub>R (z - x) + e1 *\<^sub>R z \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1278 | using **[rule_format, of "z-x"] by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1279 | define e where [abs_def]: "e = e1 - 1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1280 | then have "(1 - e1) *\<^sub>R (z - x) + e1 *\<^sub>R z = z + e *\<^sub>R x" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1281 | by (simp add: algebra_simps) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1282 | then have "e > 0" "z + e *\<^sub>R x \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1283 | using e1 e_def by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1284 | then have "\<exists>e. e > 0 \<and> z + e *\<^sub>R x \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1285 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1286 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1287 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1288 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1289 | assume r: "\<forall>x. \<exists>e. e > 0 \<and> z + e *\<^sub>R x \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1290 |     {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1291 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1292 | obtain e1 where e1: "e1 > 0" "z + e1 *\<^sub>R (z - x) \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1293 | using r[rule_format, of "z-x"] by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1294 | define e where "e = e1 + 1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1295 | then have "z + e1 *\<^sub>R (z - x) = (1 - e) *\<^sub>R x + e *\<^sub>R z" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1296 | by (simp add: algebra_simps) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1297 | then have "e > 1" "(1 - e)*\<^sub>R x + e *\<^sub>R z \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1298 | using e1 e_def by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1299 | then have "\<exists>e. e > 1 \<and> (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S" by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1300 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1301 | then have "z \<in> rel_interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1302 |       using convex_rel_interior_iff2[of S z] assms \<open>S \<noteq> {}\<close> by auto
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1303 | then have "z \<in> interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1304 | using True interior_rel_interior_gen[of S] by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1305 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1306 | ultimately show ?thesis by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1307 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1308 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1309 | |
| 70136 | 1310 | subsubsection\<^marker>\<open>tag unimportant\<close> \<open>Relative interior and closure under common operations\<close> | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1311 | |
| 67613 | 1312 | lemma rel_interior_inter_aux: "\<Inter>{rel_interior S |S. S \<in> I} \<subseteq> \<Inter>I"
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1313 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1314 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1315 | fix y | 
| 67613 | 1316 |     assume "y \<in> \<Inter>{rel_interior S |S. S \<in> I}"
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1317 | then have y: "\<forall>S \<in> I. y \<in> rel_interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1318 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1319 |     {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1320 | fix S | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1321 | assume "S \<in> I" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1322 | then have "y \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1323 | using rel_interior_subset y by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1324 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1325 | then have "y \<in> \<Inter>I" by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1326 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1327 | then show ?thesis by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1328 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1329 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1330 | lemma convex_closure_rel_interior_inter: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1331 | assumes "\<forall>S\<in>I. convex (S :: 'n::euclidean_space set)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1332 |     and "\<Inter>{rel_interior S |S. S \<in> I} \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1333 |   shows "\<Inter>{closure S |S. S \<in> I} \<le> closure (\<Inter>{rel_interior S |S. S \<in> I})"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1334 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1335 | obtain x where x: "\<forall>S\<in>I. x \<in> rel_interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1336 | using assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1337 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1338 | fix y | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1339 |     assume "y \<in> \<Inter>{closure S |S. S \<in> I}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1340 | then have y: "\<forall>S \<in> I. y \<in> closure S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1341 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1342 |     {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1343 | assume "y = x" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1344 |       then have "y \<in> closure (\<Inter>{rel_interior S |S. S \<in> I})"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1345 |         using x closure_subset[of "\<Inter>{rel_interior S |S. S \<in> I}"] by auto
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1346 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1347 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1348 |     {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1349 | assume "y \<noteq> x" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1350 |       { fix e :: real
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1351 | assume e: "e > 0" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1352 | define e1 where "e1 = min 1 (e/norm (y - x))" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1353 | then have e1: "e1 > 0" "e1 \<le> 1" "e1 * norm (y - x) \<le> e" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1354 | using \<open>y \<noteq> x\<close> \<open>e > 0\<close> le_divide_eq[of e1 e "norm (y - x)"] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1355 | by simp_all | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1356 | define z where "z = y - e1 *\<^sub>R (y - x)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1357 |         {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1358 | fix S | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1359 | assume "S \<in> I" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1360 | then have "z \<in> rel_interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1361 | using rel_interior_closure_convex_shrink[of S x y e1] assms x y e1 z_def | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1362 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1363 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1364 |         then have *: "z \<in> \<Inter>{rel_interior S |S. S \<in> I}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1365 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1366 |         have "\<exists>z. z \<in> \<Inter>{rel_interior S |S. S \<in> I} \<and> z \<noteq> y \<and> dist z y \<le> e"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1367 | using \<open>y \<noteq> x\<close> z_def * e1 e dist_norm[of z y] | 
| 72238 | 1368 | by (rule_tac x="z" in exI) auto | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1369 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1370 |       then have "y islimpt \<Inter>{rel_interior S |S. S \<in> I}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1371 | unfolding islimpt_approachable_le by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1372 |       then have "y \<in> closure (\<Inter>{rel_interior S |S. S \<in> I})"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1373 | unfolding closure_def by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1374 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1375 |     ultimately have "y \<in> closure (\<Inter>{rel_interior S |S. S \<in> I})"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1376 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1377 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1378 | then show ?thesis by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1379 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1380 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1381 | lemma convex_closure_inter: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1382 | assumes "\<forall>S\<in>I. convex (S :: 'n::euclidean_space set)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1383 |     and "\<Inter>{rel_interior S |S. S \<in> I} \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1384 |   shows "closure (\<Inter>I) = \<Inter>{closure S |S. S \<in> I}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1385 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1386 |   have "\<Inter>{closure S |S. S \<in> I} \<le> closure (\<Inter>{rel_interior S |S. S \<in> I})"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1387 | using convex_closure_rel_interior_inter assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1388 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1389 |   have "closure (\<Inter>{rel_interior S |S. S \<in> I}) \<le> closure (\<Inter>I)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1390 |     using rel_interior_inter_aux closure_mono[of "\<Inter>{rel_interior S |S. S \<in> I}" "\<Inter>I"]
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1391 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1392 | ultimately show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1393 | using closure_Int[of I] by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1394 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1395 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1396 | lemma convex_inter_rel_interior_same_closure: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1397 | assumes "\<forall>S\<in>I. convex (S :: 'n::euclidean_space set)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1398 |     and "\<Inter>{rel_interior S |S. S \<in> I} \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1399 |   shows "closure (\<Inter>{rel_interior S |S. S \<in> I}) = closure (\<Inter>I)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1400 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1401 |   have "\<Inter>{closure S |S. S \<in> I} \<le> closure (\<Inter>{rel_interior S |S. S \<in> I})"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1402 | using convex_closure_rel_interior_inter assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1403 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1404 |   have "closure (\<Inter>{rel_interior S |S. S \<in> I}) \<le> closure (\<Inter>I)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1405 |     using rel_interior_inter_aux closure_mono[of "\<Inter>{rel_interior S |S. S \<in> I}" "\<Inter>I"]
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1406 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1407 | ultimately show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1408 | using closure_Int[of I] by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1409 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1410 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1411 | lemma convex_rel_interior_inter: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1412 | assumes "\<forall>S\<in>I. convex (S :: 'n::euclidean_space set)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1413 |     and "\<Inter>{rel_interior S |S. S \<in> I} \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1414 |   shows "rel_interior (\<Inter>I) \<subseteq> \<Inter>{rel_interior S |S. S \<in> I}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1415 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1416 | have "convex (\<Inter>I)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1417 | using assms convex_Inter by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1418 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1419 |   have "convex (\<Inter>{rel_interior S |S. S \<in> I})"
 | 
| 72238 | 1420 | using assms convex_rel_interior by (force intro: convex_Inter) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1421 | ultimately | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1422 |   have "rel_interior (\<Inter>{rel_interior S |S. S \<in> I}) = rel_interior (\<Inter>I)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1423 | using convex_inter_rel_interior_same_closure assms | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1424 |       closure_eq_rel_interior_eq[of "\<Inter>{rel_interior S |S. S \<in> I}" "\<Inter>I"]
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1425 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1426 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1427 |     using rel_interior_subset[of "\<Inter>{rel_interior S |S. S \<in> I}"] by auto
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1428 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1429 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1430 | lemma convex_rel_interior_finite_inter: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1431 | assumes "\<forall>S\<in>I. convex (S :: 'n::euclidean_space set)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1432 |     and "\<Inter>{rel_interior S |S. S \<in> I} \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1433 | and "finite I" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1434 |   shows "rel_interior (\<Inter>I) = \<Inter>{rel_interior S |S. S \<in> I}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1435 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1436 |   have "\<Inter>I \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1437 | using assms rel_interior_inter_aux[of I] by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1438 | have "convex (\<Inter>I)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1439 | using convex_Inter assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1440 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1441 |   proof (cases "I = {}")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1442 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1443 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1444 | using Inter_empty rel_interior_UNIV by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1445 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1446 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1447 |     {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1448 | fix z | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1449 |       assume z: "z \<in> \<Inter>{rel_interior S |S. S \<in> I}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1450 |       {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1451 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1452 | assume x: "x \<in> \<Inter>I" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1453 |         {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1454 | fix S | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1455 | assume S: "S \<in> I" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1456 | then have "z \<in> rel_interior S" "x \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1457 | using z x by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1458 | then have "\<exists>m. m > 1 \<and> (\<forall>e. e > 1 \<and> e \<le> m \<longrightarrow> (1 - e)*\<^sub>R x + e *\<^sub>R z \<in> S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1459 | using convex_rel_interior_if[of S z] S assms hull_subset[of S] by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1460 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1461 | then obtain mS where | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1462 | mS: "\<forall>S\<in>I. mS S > 1 \<and> (\<forall>e. e > 1 \<and> e \<le> mS S \<longrightarrow> (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S)" by metis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1463 | define e where "e = Min (mS ` I)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1464 |         then have "e \<in> mS ` I" using assms \<open>I \<noteq> {}\<close> by simp
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1465 | then have "e > 1" using mS by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1466 | moreover have "\<forall>S\<in>I. e \<le> mS S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1467 | using e_def assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1468 | ultimately have "\<exists>e > 1. (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> \<Inter>I" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1469 | using mS by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1470 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1471 | then have "z \<in> rel_interior (\<Inter>I)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1472 |         using convex_rel_interior_iff[of "\<Inter>I" z] \<open>\<Inter>I \<noteq> {}\<close> \<open>convex (\<Inter>I)\<close> by auto
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1473 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1474 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1475 | using convex_rel_interior_inter[of I] assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1476 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1477 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1478 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1479 | lemma convex_closure_inter_two: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1480 | fixes S T :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1481 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1482 | and "convex T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1483 |   assumes "rel_interior S \<inter> rel_interior T \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1484 | shows "closure (S \<inter> T) = closure S \<inter> closure T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1485 |   using convex_closure_inter[of "{S,T}"] assms by auto
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1486 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1487 | lemma convex_rel_interior_inter_two: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1488 | fixes S T :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1489 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1490 | and "convex T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1491 |     and "rel_interior S \<inter> rel_interior T \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1492 | shows "rel_interior (S \<inter> T) = rel_interior S \<inter> rel_interior T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1493 |   using convex_rel_interior_finite_inter[of "{S,T}"] assms by auto
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1494 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1495 | lemma convex_affine_closure_Int: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1496 | fixes S T :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1497 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1498 | and "affine T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1499 |     and "rel_interior S \<inter> T \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1500 | shows "closure (S \<inter> T) = closure S \<inter> T" | 
| 74007 
df976eefcba0
A few new lemmas and simplifications
 paulson <lp15@cam.ac.uk> parents: 
73932diff
changeset | 1501 | by (metis affine_imp_convex assms convex_closure_inter_two rel_interior_affine rel_interior_eq_closure) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1502 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1503 | lemma connected_component_1_gen: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1504 | fixes S :: "'a :: euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1505 |   assumes "DIM('a) = 1"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1506 | shows "connected_component S a b \<longleftrightarrow> closed_segment a b \<subseteq> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1507 | unfolding connected_component_def | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1508 | by (metis (no_types, lifting) assms subsetD subsetI convex_contains_segment convex_segment(1) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1509 | ends_in_segment connected_convex_1_gen) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1510 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1511 | lemma connected_component_1: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1512 | fixes S :: "real set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1513 | shows "connected_component S a b \<longleftrightarrow> closed_segment a b \<subseteq> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1514 | by (simp add: connected_component_1_gen) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1515 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1516 | lemma convex_affine_rel_interior_Int: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1517 | fixes S T :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1518 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1519 | and "affine T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1520 |     and "rel_interior S \<inter> T \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1521 | shows "rel_interior (S \<inter> T) = rel_interior S \<inter> T" | 
| 74007 
df976eefcba0
A few new lemmas and simplifications
 paulson <lp15@cam.ac.uk> parents: 
73932diff
changeset | 1522 | by (simp add: affine_imp_convex assms convex_rel_interior_inter_two rel_interior_affine) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1523 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1524 | lemma convex_affine_rel_frontier_Int: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1525 | fixes S T :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1526 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1527 | and "affine T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1528 |     and "interior S \<inter> T \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1529 | shows "rel_frontier(S \<inter> T) = frontier S \<inter> T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1530 | using assms | 
| 72567 | 1531 | unfolding rel_frontier_def frontier_def | 
| 1532 | using convex_affine_closure_Int convex_affine_rel_interior_Int rel_interior_nonempty_interior by fastforce | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1533 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1534 | lemma rel_interior_convex_Int_affine: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1535 | fixes S :: "'a::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1536 |   assumes "convex S" "affine T" "interior S \<inter> T \<noteq> {}"
 | 
| 74007 
df976eefcba0
A few new lemmas and simplifications
 paulson <lp15@cam.ac.uk> parents: 
73932diff
changeset | 1537 | shows "rel_interior(S \<inter> T) = interior S \<inter> T" | 
| 
df976eefcba0
A few new lemmas and simplifications
 paulson <lp15@cam.ac.uk> parents: 
73932diff
changeset | 1538 | by (metis Int_emptyI assms convex_affine_rel_interior_Int empty_iff interior_rel_interior_gen) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1539 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1540 | lemma subset_rel_interior_convex: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1541 | fixes S T :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1542 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1543 | and "convex T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1544 | and "S \<le> closure T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1545 | and "\<not> S \<subseteq> rel_frontier T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1546 | shows "rel_interior S \<subseteq> rel_interior T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1547 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1548 | have *: "S \<inter> closure T = S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1549 | using assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1550 | have "\<not> rel_interior S \<subseteq> rel_frontier T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1551 | using closure_mono[of "rel_interior S" "rel_frontier T"] closed_rel_frontier[of T] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1552 | closure_closed[of S] convex_closure_rel_interior[of S] closure_subset[of S] assms | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1553 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1554 |   then have "rel_interior S \<inter> rel_interior (closure T) \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1555 | using assms rel_frontier_def[of T] rel_interior_subset convex_rel_interior_closure[of T] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1556 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1557 | then have "rel_interior S \<inter> rel_interior T = rel_interior (S \<inter> closure T)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1558 | using assms convex_closure convex_rel_interior_inter_two[of S "closure T"] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1559 | convex_rel_interior_closure[of T] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1560 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1561 | also have "\<dots> = rel_interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1562 | using * by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1563 | finally show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1564 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1565 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1566 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1567 | lemma rel_interior_convex_linear_image: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1568 | fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1569 | assumes "linear f" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1570 | and "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1571 | shows "f ` (rel_interior S) = rel_interior (f ` S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1572 | proof (cases "S = {}")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1573 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1574 | then show ?thesis | 
| 71176 | 1575 | using assms by auto | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1576 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1577 | case False | 
| 68072 
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
 immler parents: 
67990diff
changeset | 1578 | interpret linear f by fact | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1579 | have *: "f ` (rel_interior S) \<subseteq> f ` S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1580 | unfolding image_mono using rel_interior_subset by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1581 | have "f ` S \<subseteq> f ` (closure S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1582 | unfolding image_mono using closure_subset by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1583 | also have "\<dots> = f ` (closure (rel_interior S))" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1584 | using convex_closure_rel_interior assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1585 | also have "\<dots> \<subseteq> closure (f ` (rel_interior S))" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1586 | using closure_linear_image_subset assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1587 | finally have "closure (f ` S) = closure (f ` rel_interior S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1588 | using closure_mono[of "f ` S" "closure (f ` rel_interior S)"] closure_closure | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1589 | closure_mono[of "f ` rel_interior S" "f ` S"] * | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1590 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1591 | then have "rel_interior (f ` S) = rel_interior (f ` rel_interior S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1592 | using assms convex_rel_interior | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1593 | linear_conv_bounded_linear[of f] convex_linear_image[of _ S] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1594 | convex_linear_image[of _ "rel_interior S"] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1595 | closure_eq_rel_interior_eq[of "f ` S" "f ` rel_interior S"] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1596 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1597 | then have "rel_interior (f ` S) \<subseteq> f ` rel_interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1598 | using rel_interior_subset by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1599 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1600 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1601 | fix z | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1602 | assume "z \<in> f ` rel_interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1603 | then obtain z1 where z1: "z1 \<in> rel_interior S" "f z1 = z" by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1604 |     {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1605 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1606 | assume "x \<in> f ` S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1607 | then obtain x1 where x1: "x1 \<in> S" "f x1 = x" by auto | 
| 67613 | 1608 | then obtain e where e: "e > 1" "(1 - e) *\<^sub>R x1 + e *\<^sub>R z1 \<in> S" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1609 | using convex_rel_interior_iff[of S z1] \<open>convex S\<close> x1 z1 by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1610 | moreover have "f ((1 - e) *\<^sub>R x1 + e *\<^sub>R z1) = (1 - e) *\<^sub>R x + e *\<^sub>R z" | 
| 68072 
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
 immler parents: 
67990diff
changeset | 1611 | using x1 z1 by (simp add: linear_add linear_scale \<open>linear f\<close>) | 
| 67613 | 1612 | ultimately have "(1 - e) *\<^sub>R x + e *\<^sub>R z \<in> f ` S" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1613 | using imageI[of "(1 - e) *\<^sub>R x1 + e *\<^sub>R z1" S f] by auto | 
| 67613 | 1614 | then have "\<exists>e. e > 1 \<and> (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> f ` S" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1615 | using e by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1616 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1617 | then have "z \<in> rel_interior (f ` S)" | 
| 68072 
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
 immler parents: 
67990diff
changeset | 1618 | using convex_rel_interior_iff[of "f ` S" z] \<open>convex S\<close> \<open>linear f\<close> | 
| 
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
 immler parents: 
67990diff
changeset | 1619 |         \<open>S \<noteq> {}\<close> convex_linear_image[of f S]  linear_conv_bounded_linear[of f]
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1620 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1621 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1622 | ultimately show ?thesis by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1623 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1624 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1625 | lemma rel_interior_convex_linear_preimage: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1626 | fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1627 | assumes "linear f" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1628 | and "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1629 |     and "f -` (rel_interior S) \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1630 | shows "rel_interior (f -` S) = f -` (rel_interior S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1631 | proof - | 
| 68072 
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
 immler parents: 
67990diff
changeset | 1632 | interpret linear f by fact | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1633 |   have "S \<noteq> {}"
 | 
| 71176 | 1634 | using assms by auto | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1635 |   have nonemp: "f -` S \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1636 | by (metis assms(3) rel_interior_subset subset_empty vimage_mono) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1637 |   then have "S \<inter> (range f) \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1638 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1639 | have conv: "convex (f -` S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1640 | using convex_linear_vimage assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1641 | then have "convex (S \<inter> range f)" | 
| 68072 
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
 immler parents: 
67990diff
changeset | 1642 | by (simp add: assms(2) convex_Int convex_linear_image linear_axioms) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1643 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1644 | fix z | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1645 | assume "z \<in> f -` (rel_interior S)" | 
| 67613 | 1646 | then have z: "f z \<in> rel_interior S" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1647 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1648 |     {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1649 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1650 | assume "x \<in> f -` S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1651 | then have "f x \<in> S" by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1652 | then obtain e where e: "e > 1" "(1 - e) *\<^sub>R f x + e *\<^sub>R f z \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1653 |         using convex_rel_interior_iff[of S "f z"] z assms \<open>S \<noteq> {}\<close> by auto
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1654 | moreover have "(1 - e) *\<^sub>R f x + e *\<^sub>R f z = f ((1 - e) *\<^sub>R x + e *\<^sub>R z)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1655 | using \<open>linear f\<close> by (simp add: linear_iff) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1656 | ultimately have "\<exists>e. e > 1 \<and> (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> f -` S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1657 | using e by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1658 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1659 | then have "z \<in> rel_interior (f -` S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1660 | using convex_rel_interior_iff[of "f -` S" z] conv nonemp by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1661 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1662 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1663 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1664 | fix z | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1665 | assume z: "z \<in> rel_interior (f -` S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1666 |     {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1667 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1668 | assume "x \<in> S \<inter> range f" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1669 | then obtain y where y: "f y = x" "y \<in> f -` S" by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1670 | then obtain e where e: "e > 1" "(1 - e) *\<^sub>R y + e *\<^sub>R z \<in> f -` S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1671 | using convex_rel_interior_iff[of "f -` S" z] z conv by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1672 | moreover have "(1 - e) *\<^sub>R x + e *\<^sub>R f z = f ((1 - e) *\<^sub>R y + e *\<^sub>R z)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1673 | using \<open>linear f\<close> y by (simp add: linear_iff) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1674 | ultimately have "\<exists>e. e > 1 \<and> (1 - e) *\<^sub>R x + e *\<^sub>R f z \<in> S \<inter> range f" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1675 | using e by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1676 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1677 | then have "f z \<in> rel_interior (S \<inter> range f)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1678 |       using \<open>convex (S \<inter> (range f))\<close> \<open>S \<inter> range f \<noteq> {}\<close>
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1679 | convex_rel_interior_iff[of "S \<inter> (range f)" "f z"] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1680 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1681 | moreover have "affine (range f)" | 
| 68072 
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
 immler parents: 
67990diff
changeset | 1682 | by (simp add: linear_axioms linear_subspace_image subspace_imp_affine) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1683 | ultimately have "f z \<in> rel_interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1684 | using convex_affine_rel_interior_Int[of S "range f"] assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1685 | then have "z \<in> f -` (rel_interior S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1686 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1687 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1688 | ultimately show ?thesis by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1689 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1690 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1691 | lemma rel_interior_Times: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1692 | fixes S :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1693 | and T :: "'m::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1694 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1695 | and "convex T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1696 | shows "rel_interior (S \<times> T) = rel_interior S \<times> rel_interior T" | 
| 72238 | 1697 | proof (cases "S = {} \<or> T = {}")
 | 
| 1698 | case True | |
| 1699 | then show ?thesis | |
| 1700 | by auto | |
| 1701 | next | |
| 1702 | case False | |
| 1703 |   then have "S \<noteq> {}" "T \<noteq> {}"
 | |
| 1704 | by auto | |
| 1705 |   then have ri: "rel_interior S \<noteq> {}" "rel_interior T \<noteq> {}"
 | |
| 1706 | using rel_interior_eq_empty assms by auto | |
| 1707 |   then have "fst -` rel_interior S \<noteq> {}"
 | |
| 1708 | using fst_vimage_eq_Times[of "rel_interior S"] by auto | |
| 1709 | then have "rel_interior ((fst :: 'n * 'm \<Rightarrow> 'n) -` S) = fst -` rel_interior S" | |
| 1710 | using linear_fst \<open>convex S\<close> rel_interior_convex_linear_preimage[of fst S] by auto | |
| 1711 | then have s: "rel_interior (S \<times> (UNIV :: 'm set)) = rel_interior S \<times> UNIV" | |
| 1712 | by (simp add: fst_vimage_eq_Times) | |
| 1713 |   from ri have "snd -` rel_interior T \<noteq> {}"
 | |
| 1714 | using snd_vimage_eq_Times[of "rel_interior T"] by auto | |
| 1715 | then have "rel_interior ((snd :: 'n * 'm \<Rightarrow> 'm) -` T) = snd -` rel_interior T" | |
| 1716 | using linear_snd \<open>convex T\<close> rel_interior_convex_linear_preimage[of snd T] by auto | |
| 1717 | then have t: "rel_interior ((UNIV :: 'n set) \<times> T) = UNIV \<times> rel_interior T" | |
| 1718 | by (simp add: snd_vimage_eq_Times) | |
| 1719 | from s t have *: "rel_interior (S \<times> (UNIV :: 'm set)) \<inter> rel_interior ((UNIV :: 'n set) \<times> T) = | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1720 | rel_interior S \<times> rel_interior T" by auto | 
| 72238 | 1721 | have "S \<times> T = S \<times> (UNIV :: 'm set) \<inter> (UNIV :: 'n set) \<times> T" | 
| 1722 | by auto | |
| 1723 | then have "rel_interior (S \<times> T) = rel_interior ((S \<times> (UNIV :: 'm set)) \<inter> ((UNIV :: 'n set) \<times> T))" | |
| 1724 | by auto | |
| 1725 | also have "\<dots> = rel_interior (S \<times> (UNIV :: 'm set)) \<inter> rel_interior ((UNIV :: 'n set) \<times> T)" | |
| 1726 | using * ri assms convex_Times | |
| 1727 | by (subst convex_rel_interior_inter_two) auto | |
| 1728 | finally show ?thesis using * by auto | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1729 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1730 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1731 | lemma rel_interior_scaleR: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1732 | fixes S :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1733 | assumes "c \<noteq> 0" | 
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68796diff
changeset | 1734 | shows "((*\<^sub>R) c) ` (rel_interior S) = rel_interior (((*\<^sub>R) c) ` S)" | 
| 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68796diff
changeset | 1735 | using rel_interior_injective_linear_image[of "((*\<^sub>R) c)" S] | 
| 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68796diff
changeset | 1736 | linear_conv_bounded_linear[of "(*\<^sub>R) c"] linear_scaleR injective_scaleR[of c] assms | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1737 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1738 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1739 | lemma rel_interior_convex_scaleR: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1740 | fixes S :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1741 | assumes "convex S" | 
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68796diff
changeset | 1742 | shows "((*\<^sub>R) c) ` (rel_interior S) = rel_interior (((*\<^sub>R) c) ` S)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1743 | by (metis assms linear_scaleR rel_interior_convex_linear_image) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1744 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1745 | lemma convex_rel_open_scaleR: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1746 | fixes S :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1747 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1748 | and "rel_open S" | 
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68796diff
changeset | 1749 | shows "convex (((*\<^sub>R) c) ` S) \<and> rel_open (((*\<^sub>R) c) ` S)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1750 | by (metis assms convex_scaling rel_interior_convex_scaleR rel_open_def) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1751 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1752 | lemma convex_rel_open_finite_inter: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1753 | assumes "\<forall>S\<in>I. convex (S :: 'n::euclidean_space set) \<and> rel_open S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1754 | and "finite I" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1755 | shows "convex (\<Inter>I) \<and> rel_open (\<Inter>I)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1756 | proof (cases "\<Inter>{rel_interior S |S. S \<in> I} = {}")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1757 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1758 |   then have "\<Inter>I = {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1759 | using assms unfolding rel_open_def by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1760 | then show ?thesis | 
| 71176 | 1761 | unfolding rel_open_def by auto | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1762 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1763 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1764 | then have "rel_open (\<Inter>I)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1765 | using assms unfolding rel_open_def | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1766 | using convex_rel_interior_finite_inter[of I] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1767 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1768 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1769 | using convex_Inter assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1770 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1771 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1772 | lemma convex_rel_open_linear_image: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1773 | fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1774 | assumes "linear f" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1775 | and "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1776 | and "rel_open S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1777 | shows "convex (f ` S) \<and> rel_open (f ` S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1778 | by (metis assms convex_linear_image rel_interior_convex_linear_image rel_open_def) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1779 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1780 | lemma convex_rel_open_linear_preimage: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1781 | fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1782 | assumes "linear f" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1783 | and "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1784 | and "rel_open S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1785 | shows "convex (f -` S) \<and> rel_open (f -` S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1786 | proof (cases "f -` (rel_interior S) = {}")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1787 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1788 |   then have "f -` S = {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1789 | using assms unfolding rel_open_def by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1790 | then show ?thesis | 
| 71176 | 1791 | unfolding rel_open_def by auto | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1792 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1793 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1794 | then have "rel_open (f -` S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1795 | using assms unfolding rel_open_def | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1796 | using rel_interior_convex_linear_preimage[of f S] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1797 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1798 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1799 | using convex_linear_vimage assms | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1800 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1801 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1802 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1803 | lemma rel_interior_projection: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1804 |   fixes S :: "('m::euclidean_space \<times> 'n::euclidean_space) set"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1805 | and f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1806 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1807 |     and "f = (\<lambda>y. {z. (y, z) \<in> S})"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1808 |   shows "(y, z) \<in> rel_interior S \<longleftrightarrow> (y \<in> rel_interior {y. (f y \<noteq> {})} \<and> z \<in> rel_interior (f y))"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1809 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1810 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1811 | fix y | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1812 |     assume "y \<in> {y. f y \<noteq> {}}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1813 | then obtain z where "(y, z) \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1814 | using assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1815 | then have "\<exists>x. x \<in> S \<and> y = fst x" | 
| 72238 | 1816 | by auto | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1817 | then obtain x where "x \<in> S" "y = fst x" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1818 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1819 | then have "y \<in> fst ` S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1820 | unfolding image_def by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1821 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1822 |   then have "fst ` S = {y. f y \<noteq> {}}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1823 | unfolding fst_def using assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1824 |   then have h1: "fst ` rel_interior S = rel_interior {y. f y \<noteq> {}}"
 | 
| 71244 | 1825 | using rel_interior_convex_linear_image[of fst S] assms linear_fst by auto | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1826 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1827 | fix y | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1828 |     assume "y \<in> rel_interior {y. f y \<noteq> {}}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1829 | then have "y \<in> fst ` rel_interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1830 | using h1 by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1831 |     then have *: "rel_interior S \<inter> fst -` {y} \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1832 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1833 |     moreover have aff: "affine (fst -` {y})"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1834 | unfolding affine_alt by (simp add: algebra_simps) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1835 |     ultimately have **: "rel_interior (S \<inter> fst -` {y}) = rel_interior S \<inter> fst -` {y}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1836 |       using convex_affine_rel_interior_Int[of S "fst -` {y}"] assms by auto
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1837 |     have conv: "convex (S \<inter> fst -` {y})"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1838 | using convex_Int assms aff affine_imp_convex by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1839 |     {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1840 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1841 | assume "x \<in> f y" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1842 |       then have "(y, x) \<in> S \<inter> (fst -` {y})"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1843 | using assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1844 | moreover have "x = snd (y, x)" by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1845 |       ultimately have "x \<in> snd ` (S \<inter> fst -` {y})"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1846 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1847 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1848 |     then have "snd ` (S \<inter> fst -` {y}) = f y"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1849 | using assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1850 |     then have ***: "rel_interior (f y) = snd ` rel_interior (S \<inter> fst -` {y})"
 | 
| 71244 | 1851 |       using rel_interior_convex_linear_image[of snd "S \<inter> fst -` {y}"] linear_snd conv
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1852 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1853 |     {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1854 | fix z | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1855 | assume "z \<in> rel_interior (f y)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1856 |       then have "z \<in> snd ` rel_interior (S \<inter> fst -` {y})"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1857 | using *** by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1858 |       moreover have "{y} = fst ` rel_interior (S \<inter> fst -` {y})"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1859 | using * ** rel_interior_subset by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1860 |       ultimately have "(y, z) \<in> rel_interior (S \<inter> fst -` {y})"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1861 | by force | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1862 | then have "(y,z) \<in> rel_interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1863 | using ** by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1864 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1865 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1866 |     {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1867 | fix z | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1868 | assume "(y, z) \<in> rel_interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1869 |       then have "(y, z) \<in> rel_interior (S \<inter> fst -` {y})"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1870 | using ** by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1871 |       then have "z \<in> snd ` rel_interior (S \<inter> fst -` {y})"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1872 | by (metis Range_iff snd_eq_Range) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1873 | then have "z \<in> rel_interior (f y)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1874 | using *** by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1875 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1876 | ultimately have "\<And>z. (y, z) \<in> rel_interior S \<longleftrightarrow> z \<in> rel_interior (f y)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1877 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1878 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1879 |   then have h2: "\<And>y z. y \<in> rel_interior {t. f t \<noteq> {}} \<Longrightarrow>
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1880 | (y, z) \<in> rel_interior S \<longleftrightarrow> z \<in> rel_interior (f y)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1881 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1882 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1883 | fix y z | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1884 | assume asm: "(y, z) \<in> rel_interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1885 | then have "y \<in> fst ` rel_interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1886 | by (metis Domain_iff fst_eq_Domain) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1887 |     then have "y \<in> rel_interior {t. f t \<noteq> {}}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1888 | using h1 by auto | 
| 67613 | 1889 |     then have "y \<in> rel_interior {t. f t \<noteq> {}}" and "(z \<in> rel_interior (f y))"
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1890 | using h2 asm by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1891 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1892 | then show ?thesis using h2 by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1893 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1894 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1895 | lemma rel_frontier_Times: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1896 | fixes S :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1897 | and T :: "'m::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1898 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1899 | and "convex T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1900 | shows "rel_frontier S \<times> rel_frontier T \<subseteq> rel_frontier (S \<times> T)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1901 | by (force simp: rel_frontier_def rel_interior_Times assms closure_Times) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1902 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1903 | |
| 70136 | 1904 | subsubsection\<^marker>\<open>tag unimportant\<close> \<open>Relative interior of convex cone\<close> | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1905 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1906 | lemma cone_rel_interior: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1907 | fixes S :: "'m::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1908 | assumes "cone S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1909 |   shows "cone ({0} \<union> rel_interior S)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1910 | proof (cases "S = {}")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1911 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1912 | then show ?thesis | 
| 71176 | 1913 | by (simp add: cone_0) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1914 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1915 | case False | 
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68796diff
changeset | 1916 | then have *: "0 \<in> S \<and> (\<forall>c. c > 0 \<longrightarrow> (*\<^sub>R) c ` S = S)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1917 | using cone_iff[of S] assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1918 |   then have *: "0 \<in> ({0} \<union> rel_interior S)"
 | 
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68796diff
changeset | 1919 |     and "\<forall>c. c > 0 \<longrightarrow> (*\<^sub>R) c ` ({0} \<union> rel_interior S) = ({0} \<union> rel_interior S)"
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1920 | by (auto simp add: rel_interior_scaleR) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1921 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1922 |     using cone_iff[of "{0} \<union> rel_interior S"] by auto
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1923 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1924 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1925 | lemma rel_interior_convex_cone_aux: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1926 | fixes S :: "'m::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1927 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1928 |   shows "(c, x) \<in> rel_interior (cone hull ({(1 :: real)} \<times> S)) \<longleftrightarrow>
 | 
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68796diff
changeset | 1929 | c > 0 \<and> x \<in> (((*\<^sub>R) c) ` (rel_interior S))" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1930 | proof (cases "S = {}")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1931 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1932 | then show ?thesis | 
| 71176 | 1933 | by (simp add: cone_hull_empty) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1934 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1935 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1936 | then obtain s where "s \<in> S" by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1937 |   have conv: "convex ({(1 :: real)} \<times> S)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1938 |     using convex_Times[of "{(1 :: real)}" S] assms convex_singleton[of "1 :: real"]
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1939 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1940 |   define f where "f y = {z. (y, z) \<in> cone hull ({1 :: real} \<times> S)}" for y
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1941 |   then have *: "(c, x) \<in> rel_interior (cone hull ({(1 :: real)} \<times> S)) =
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1942 |     (c \<in> rel_interior {y. f y \<noteq> {}} \<and> x \<in> rel_interior (f c))"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1943 |     using convex_cone_hull[of "{(1 :: real)} \<times> S"] conv
 | 
| 72238 | 1944 | by (subst rel_interior_projection) auto | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1945 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1946 | fix y :: real | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1947 | assume "y \<ge> 0" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1948 |     then have "y *\<^sub>R (1,s) \<in> cone hull ({1 :: real} \<times> S)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1949 |       using cone_hull_expl[of "{(1 :: real)} \<times> S"] \<open>s \<in> S\<close> by auto
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1950 |     then have "f y \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1951 | using f_def by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1952 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1953 |   then have "{y. f y \<noteq> {}} = {0..}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1954 |     using f_def cone_hull_expl[of "{1 :: real} \<times> S"] by auto
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1955 |   then have **: "rel_interior {y. f y \<noteq> {}} = {0<..}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1956 | using rel_interior_real_semiline by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1957 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1958 | fix c :: real | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1959 | assume "c > 0" | 
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68796diff
changeset | 1960 | then have "f c = ((*\<^sub>R) c ` S)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1961 |       using f_def cone_hull_expl[of "{1 :: real} \<times> S"] by auto
 | 
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68796diff
changeset | 1962 | then have "rel_interior (f c) = (*\<^sub>R) c ` rel_interior S" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1963 | using rel_interior_convex_scaleR[of S c] assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1964 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1965 | then show ?thesis using * ** by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1966 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1967 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1968 | lemma rel_interior_convex_cone: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1969 | fixes S :: "'m::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1970 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1971 |   shows "rel_interior (cone hull ({1 :: real} \<times> S)) =
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1972 |     {(c, c *\<^sub>R x) | c x. c > 0 \<and> x \<in> rel_interior S}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1973 | (is "?lhs = ?rhs") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1974 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1975 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1976 | fix z | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1977 | assume "z \<in> ?lhs" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1978 | have *: "z = (fst z, snd z)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1979 | by auto | 
| 71004 | 1980 | then have "z \<in> ?rhs" | 
| 1981 | using rel_interior_convex_cone_aux[of S "fst z" "snd z"] assms \<open>z \<in> ?lhs\<close> by fastforce | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1982 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1983 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1984 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1985 | fix z | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1986 | assume "z \<in> ?rhs" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1987 | then have "z \<in> ?lhs" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1988 | using rel_interior_convex_cone_aux[of S "fst z" "snd z"] assms | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1989 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1990 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1991 | ultimately show ?thesis by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1992 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1993 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1994 | lemma convex_hull_finite_union: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1995 | assumes "finite I" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1996 |   assumes "\<forall>i\<in>I. convex (S i) \<and> (S i) \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1997 | shows "convex hull (\<Union>(S ` I)) = | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1998 |     {sum (\<lambda>i. c i *\<^sub>R s i) I | c s. (\<forall>i\<in>I. c i \<ge> 0) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> S i)}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1999 | (is "?lhs = ?rhs") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2000 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2001 | have "?lhs \<supseteq> ?rhs" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2002 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2003 | fix x | 
| 67613 | 2004 | assume "x \<in> ?rhs" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2005 | then obtain c s where *: "sum (\<lambda>i. c i *\<^sub>R s i) I = x" "sum c I = 1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2006 | "(\<forall>i\<in>I. c i \<ge> 0) \<and> (\<forall>i\<in>I. s i \<in> S i)" by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2007 | then have "\<forall>i\<in>I. s i \<in> convex hull (\<Union>(S ` I))" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2008 | using hull_subset[of "\<Union>(S ` I)" convex] by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2009 | then show "x \<in> ?lhs" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2010 | unfolding *(1)[symmetric] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2011 | using * assms convex_convex_hull | 
| 72238 | 2012 | by (subst convex_sum) auto | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2013 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2014 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2015 | fix i | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2016 | assume "i \<in> I" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2017 | with assms have "\<exists>p. p \<in> S i" by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2018 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2019 | then obtain p where p: "\<forall>i\<in>I. p i \<in> S i" by metis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2020 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2021 | fix i | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2022 | assume "i \<in> I" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2023 |     {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2024 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2025 | assume "x \<in> S i" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2026 | define c where "c j = (if j = i then 1::real else 0)" for j | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2027 | then have *: "sum c I = 1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2028 | using \<open>finite I\<close> \<open>i \<in> I\<close> sum.delta[of I i "\<lambda>j::'a. 1::real"] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2029 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2030 | define s where "s j = (if j = i then x else p j)" for j | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2031 | then have "\<forall>j. c j *\<^sub>R s j = (if j = i then x else 0)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2032 | using c_def by (auto simp add: algebra_simps) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2033 | then have "x = sum (\<lambda>i. c i *\<^sub>R s i) I" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2034 | using s_def c_def \<open>finite I\<close> \<open>i \<in> I\<close> sum.delta[of I i "\<lambda>j::'a. x"] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2035 | by auto | 
| 72567 | 2036 | moreover have "(\<forall>i\<in>I. 0 \<le> c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> S i)" | 
| 2037 | using * c_def s_def p \<open>x \<in> S i\<close> by auto | |
| 2038 | ultimately have "x \<in> ?rhs" | |
| 2039 | by force | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2040 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2041 | then have "?rhs \<supseteq> S i" by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2042 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2043 | then have *: "?rhs \<supseteq> \<Union>(S ` I)" by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2044 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2045 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2046 | fix u v :: real | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2047 | assume uv: "u \<ge> 0 \<and> v \<ge> 0 \<and> u + v = 1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2048 | fix x y | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2049 | assume xy: "x \<in> ?rhs \<and> y \<in> ?rhs" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2050 | from xy obtain c s where | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2051 | xc: "x = sum (\<lambda>i. c i *\<^sub>R s i) I \<and> (\<forall>i\<in>I. c i \<ge> 0) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> S i)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2052 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2053 | from xy obtain d t where | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2054 | yc: "y = sum (\<lambda>i. d i *\<^sub>R t i) I \<and> (\<forall>i\<in>I. d i \<ge> 0) \<and> sum d I = 1 \<and> (\<forall>i\<in>I. t i \<in> S i)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2055 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2056 | define e where "e i = u * c i + v * d i" for i | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2057 | have ge0: "\<forall>i\<in>I. e i \<ge> 0" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2058 | using e_def xc yc uv by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2059 | have "sum (\<lambda>i. u * c i) I = u * sum c I" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2060 | by (simp add: sum_distrib_left) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2061 | moreover have "sum (\<lambda>i. v * d i) I = v * sum d I" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2062 | by (simp add: sum_distrib_left) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2063 | ultimately have sum1: "sum e I = 1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2064 | using e_def xc yc uv by (simp add: sum.distrib) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2065 | define q where "q i = (if e i = 0 then p i else (u * c i / e i) *\<^sub>R s i + (v * d i / e i) *\<^sub>R t i)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2066 | for i | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2067 |     {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2068 | fix i | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2069 | assume i: "i \<in> I" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2070 | have "q i \<in> S i" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2071 | proof (cases "e i = 0") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2072 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2073 | then show ?thesis using i p q_def by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2074 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2075 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2076 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2077 | using mem_convex_alt[of "S i" "s i" "t i" "u * (c i)" "v * (d i)"] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2078 | mult_nonneg_nonneg[of u "c i"] mult_nonneg_nonneg[of v "d i"] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2079 | assms q_def e_def i False xc yc uv | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2080 | by (auto simp del: mult_nonneg_nonneg) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2081 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2082 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2083 | then have qs: "\<forall>i\<in>I. q i \<in> S i" by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2084 |     {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2085 | fix i | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2086 | assume i: "i \<in> I" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2087 | have "(u * c i) *\<^sub>R s i + (v * d i) *\<^sub>R t i = e i *\<^sub>R q i" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2088 | proof (cases "e i = 0") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2089 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2090 | have ge: "u * (c i) \<ge> 0 \<and> v * d i \<ge> 0" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2091 | using xc yc uv i by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2092 | moreover from ge have "u * c i \<le> 0 \<and> v * d i \<le> 0" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2093 | using True e_def i by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2094 | ultimately have "u * c i = 0 \<and> v * d i = 0" by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2095 | with True show ?thesis by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2096 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2097 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2098 | then have "(u * (c i)/(e i))*\<^sub>R (s i)+(v * (d i)/(e i))*\<^sub>R (t i) = q i" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2099 | using q_def by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2100 | then have "e i *\<^sub>R ((u * (c i)/(e i))*\<^sub>R (s i)+(v * (d i)/(e i))*\<^sub>R (t i)) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2101 | = (e i) *\<^sub>R (q i)" by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2102 | with False show ?thesis by (simp add: algebra_simps) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2103 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2104 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2105 | then have *: "\<forall>i\<in>I. (u * c i) *\<^sub>R s i + (v * d i) *\<^sub>R t i = e i *\<^sub>R q i" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2106 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2107 | have "u *\<^sub>R x + v *\<^sub>R y = sum (\<lambda>i. (u * c i) *\<^sub>R s i + (v * d i) *\<^sub>R t i) I" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2108 | using xc yc by (simp add: algebra_simps scaleR_right.sum sum.distrib) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2109 | also have "\<dots> = sum (\<lambda>i. e i *\<^sub>R q i) I" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2110 | using * by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2111 | finally have "u *\<^sub>R x + v *\<^sub>R y = sum (\<lambda>i. (e i) *\<^sub>R (q i)) I" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2112 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2113 | then have "u *\<^sub>R x + v *\<^sub>R y \<in> ?rhs" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2114 | using ge0 sum1 qs by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2115 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2116 | then have "convex ?rhs" unfolding convex_def by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2117 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2118 | using \<open>?lhs \<supseteq> ?rhs\<close> * hull_minimal[of "\<Union>(S ` I)" ?rhs convex] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2119 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2120 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2121 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2122 | lemma convex_hull_union_two: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2123 | fixes S T :: "'m::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2124 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2125 |     and "S \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2126 | and "convex T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2127 |     and "T \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2128 | shows "convex hull (S \<union> T) = | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2129 |     {u *\<^sub>R s + v *\<^sub>R t | u v s t. u \<ge> 0 \<and> v \<ge> 0 \<and> u + v = 1 \<and> s \<in> S \<and> t \<in> T}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2130 | (is "?lhs = ?rhs") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2131 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2132 |   define I :: "nat set" where "I = {1, 2}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2133 | define s where "s i = (if i = (1::nat) then S else T)" for i | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2134 | have "\<Union>(s ` I) = S \<union> T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2135 | using s_def I_def by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2136 | then have "convex hull (\<Union>(s ` I)) = convex hull (S \<union> T)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2137 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2138 | moreover have "convex hull \<Union>(s ` I) = | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2139 |     {\<Sum> i\<in>I. c i *\<^sub>R sa i | c sa. (\<forall>i\<in>I. 0 \<le> c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. sa i \<in> s i)}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2140 | using assms s_def I_def | 
| 72238 | 2141 | by (subst convex_hull_finite_union) auto | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2142 | moreover have | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2143 |     "{\<Sum>i\<in>I. c i *\<^sub>R sa i | c sa. (\<forall>i\<in>I. 0 \<le> c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. sa i \<in> s i)} \<le> ?rhs"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2144 | using s_def I_def by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2145 | ultimately show "?lhs \<subseteq> ?rhs" by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2146 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2147 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2148 | assume "x \<in> ?rhs" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2149 | then obtain u v s t where *: "x = u *\<^sub>R s + v *\<^sub>R t \<and> u \<ge> 0 \<and> v \<ge> 0 \<and> u + v = 1 \<and> s \<in> S \<and> t \<in> T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2150 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2151 |     then have "x \<in> convex hull {s, t}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2152 | using convex_hull_2[of s t] by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2153 | then have "x \<in> convex hull (S \<union> T)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2154 |       using * hull_mono[of "{s, t}" "S \<union> T"] by auto
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2155 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2156 | then show "?lhs \<supseteq> ?rhs" by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2157 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2158 | |
| 70620 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2159 | proposition ray_to_rel_frontier: | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2160 | fixes a :: "'a::real_inner" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2161 | assumes "bounded S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2162 | and a: "a \<in> rel_interior S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2163 | and aff: "(a + l) \<in> affine hull S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2164 | and "l \<noteq> 0" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2165 | obtains d where "0 < d" "(a + d *\<^sub>R l) \<in> rel_frontier S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2166 | "\<And>e. \<lbrakk>0 \<le> e; e < d\<rbrakk> \<Longrightarrow> (a + e *\<^sub>R l) \<in> rel_interior S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2167 | proof - | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2168 | have aaff: "a \<in> affine hull S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2169 | by (meson a hull_subset rel_interior_subset rev_subsetD) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2170 |   let ?D = "{d. 0 < d \<and> a + d *\<^sub>R l \<notin> rel_interior S}"
 | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2171 | obtain B where "B > 0" and B: "S \<subseteq> ball a B" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2172 | using bounded_subset_ballD [OF \<open>bounded S\<close>] by blast | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2173 | have "a + (B / norm l) *\<^sub>R l \<notin> ball a B" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2174 | by (simp add: dist_norm \<open>l \<noteq> 0\<close>) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2175 | with B have "a + (B / norm l) *\<^sub>R l \<notin> rel_interior S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2176 | using rel_interior_subset subsetCE by blast | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2177 |   with \<open>B > 0\<close> \<open>l \<noteq> 0\<close> have nonMT: "?D \<noteq> {}"
 | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2178 | using divide_pos_pos zero_less_norm_iff by fastforce | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2179 | have bdd: "bdd_below ?D" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2180 | by (metis (no_types, lifting) bdd_belowI le_less mem_Collect_eq) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2181 | have relin_Ex: "\<And>x. x \<in> rel_interior S \<Longrightarrow> | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2182 | \<exists>e>0. \<forall>x'\<in>affine hull S. dist x' x < e \<longrightarrow> x' \<in> rel_interior S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2183 | using openin_rel_interior [of S] by (simp add: openin_euclidean_subtopology_iff) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2184 | define d where "d = Inf ?D" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2185 | obtain \<epsilon> where "0 < \<epsilon>" and \<epsilon>: "\<And>\<eta>. \<lbrakk>0 \<le> \<eta>; \<eta> < \<epsilon>\<rbrakk> \<Longrightarrow> (a + \<eta> *\<^sub>R l) \<in> rel_interior S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2186 | proof - | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2187 | obtain e where "e>0" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2188 | and e: "\<And>x'. x' \<in> affine hull S \<Longrightarrow> dist x' a < e \<Longrightarrow> x' \<in> rel_interior S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2189 | using relin_Ex a by blast | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2190 | show thesis | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2191 | proof (rule_tac \<epsilon> = "e / norm l" in that) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2192 | show "0 < e / norm l" by (simp add: \<open>0 < e\<close> \<open>l \<noteq> 0\<close>) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2193 | next | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2194 | show "a + \<eta> *\<^sub>R l \<in> rel_interior S" if "0 \<le> \<eta>" "\<eta> < e / norm l" for \<eta> | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2195 | proof (rule e) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2196 | show "a + \<eta> *\<^sub>R l \<in> affine hull S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2197 | by (metis (no_types) add_diff_cancel_left' aff affine_affine_hull mem_affine_3_minus aaff) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2198 | show "dist (a + \<eta> *\<^sub>R l) a < e" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2199 | using that by (simp add: \<open>l \<noteq> 0\<close> dist_norm pos_less_divide_eq) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2200 | qed | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2201 | qed | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2202 | qed | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2203 | have inint: "\<And>e. \<lbrakk>0 \<le> e; e < d\<rbrakk> \<Longrightarrow> a + e *\<^sub>R l \<in> rel_interior S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2204 | unfolding d_def using cInf_lower [OF _ bdd] | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2205 | by (metis (no_types, lifting) a add.right_neutral le_less mem_Collect_eq not_less real_vector.scale_zero_left) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2206 | have "\<epsilon> \<le> d" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2207 | unfolding d_def | 
| 72238 | 2208 | using \<epsilon> dual_order.strict_implies_order le_less_linear | 
| 2209 | by (blast intro: cInf_greatest [OF nonMT]) | |
| 70620 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2210 | with \<open>0 < \<epsilon>\<close> have "0 < d" by simp | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2211 | have "a + d *\<^sub>R l \<notin> rel_interior S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2212 | proof | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2213 | assume adl: "a + d *\<^sub>R l \<in> rel_interior S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2214 | obtain e where "e > 0" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2215 | and e: "\<And>x'. x' \<in> affine hull S \<Longrightarrow> dist x' (a + d *\<^sub>R l) < e \<Longrightarrow> x' \<in> rel_interior S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2216 | using relin_Ex adl by blast | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2217 |     have "d + e / norm l \<le> Inf {d. 0 < d \<and> a + d *\<^sub>R l \<notin> rel_interior S}"
 | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2218 | proof (rule cInf_greatest [OF nonMT], clarsimp) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2219 | fix x::real | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2220 | assume "0 < x" and nonrel: "a + x *\<^sub>R l \<notin> rel_interior S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2221 | show "d + e / norm l \<le> x" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2222 | proof (cases "x < d") | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2223 | case True with inint nonrel \<open>0 < x\<close> | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2224 | show ?thesis by auto | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2225 | next | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2226 | case False | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2227 | then have dle: "x < d + e / norm l \<Longrightarrow> dist (a + x *\<^sub>R l) (a + d *\<^sub>R l) < e" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2228 | by (simp add: field_simps \<open>l \<noteq> 0\<close>) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2229 | have ain: "a + x *\<^sub>R l \<in> affine hull S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2230 | by (metis add_diff_cancel_left' aff affine_affine_hull mem_affine_3_minus aaff) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2231 | show ?thesis | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2232 | using e [OF ain] nonrel dle by force | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2233 | qed | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2234 | qed | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2235 | then show False | 
| 70817 
dd675800469d
dedicated fact collections for algebraic simplification rules potentially splitting goals
 haftmann parents: 
70802diff
changeset | 2236 | using \<open>0 < e\<close> \<open>l \<noteq> 0\<close> by (simp add: d_def [symmetric] field_simps) | 
| 70620 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2237 | qed | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2238 | moreover have "a + d *\<^sub>R l \<in> closure S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2239 | proof (clarsimp simp: closure_approachable) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2240 | fix \<eta>::real assume "0 < \<eta>" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2241 | have 1: "a + (d - min d (\<eta> / 2 / norm l)) *\<^sub>R l \<in> S" | 
| 72567 | 2242 | proof (rule subsetD [OF rel_interior_subset inint]) | 
| 2243 | show "d - min d (\<eta> / 2 / norm l) < d" | |
| 2244 | using \<open>l \<noteq> 0\<close> \<open>0 < d\<close> \<open>0 < \<eta>\<close> by auto | |
| 2245 | qed auto | |
| 70620 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2246 | have "norm l * min d (\<eta> / (norm l * 2)) \<le> norm l * (\<eta> / (norm l * 2))" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2247 | by (metis min_def mult_left_mono norm_ge_zero order_refl) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2248 | also have "... < \<eta>" | 
| 70817 
dd675800469d
dedicated fact collections for algebraic simplification rules potentially splitting goals
 haftmann parents: 
70802diff
changeset | 2249 | using \<open>l \<noteq> 0\<close> \<open>0 < \<eta>\<close> by (simp add: field_simps) | 
| 70620 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2250 | finally have 2: "norm l * min d (\<eta> / (norm l * 2)) < \<eta>" . | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2251 | show "\<exists>y\<in>S. dist y (a + d *\<^sub>R l) < \<eta>" | 
| 72567 | 2252 | using 1 2 \<open>0 < d\<close> \<open>0 < \<eta>\<close> | 
| 2253 | by (rule_tac x="a + (d - min d (\<eta> / 2 / norm l)) *\<^sub>R l" in bexI) (auto simp: algebra_simps) | |
| 70620 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2254 | qed | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2255 | ultimately have infront: "a + d *\<^sub>R l \<in> rel_frontier S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2256 | by (simp add: rel_frontier_def) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2257 | show ?thesis | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2258 | by (rule that [OF \<open>0 < d\<close> infront inint]) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2259 | qed | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2260 | |
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2261 | corollary ray_to_frontier: | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2262 | fixes a :: "'a::euclidean_space" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2263 | assumes "bounded S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2264 | and a: "a \<in> interior S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2265 | and "l \<noteq> 0" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2266 | obtains d where "0 < d" "(a + d *\<^sub>R l) \<in> frontier S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2267 | "\<And>e. \<lbrakk>0 \<le> e; e < d\<rbrakk> \<Longrightarrow> (a + e *\<^sub>R l) \<in> interior S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2268 | proof - | 
| 72567 | 2269 | have \<section>: "interior S = rel_interior S" | 
| 70620 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2270 | using a rel_interior_nonempty_interior by auto | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2271 | then have "a \<in> rel_interior S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2272 | using a by simp | 
| 72567 | 2273 | moreover have "a + l \<in> affine hull S" | 
| 2274 | using a affine_hull_nonempty_interior by blast | |
| 2275 | ultimately show thesis | |
| 2276 | by (metis \<section> \<open>bounded S\<close> \<open>l \<noteq> 0\<close> frontier_def ray_to_rel_frontier rel_frontier_def that) | |
| 70620 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2277 | qed | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2278 | |
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2279 | |
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2280 | lemma segment_to_rel_frontier_aux: | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2281 | fixes x :: "'a::euclidean_space" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2282 | assumes "convex S" "bounded S" and x: "x \<in> rel_interior S" and y: "y \<in> S" and xy: "x \<noteq> y" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2283 | obtains z where "z \<in> rel_frontier S" "y \<in> closed_segment x z" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2284 | "open_segment x z \<subseteq> rel_interior S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2285 | proof - | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2286 | have "x + (y - x) \<in> affine hull S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2287 | using hull_inc [OF y] by auto | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2288 | then obtain d where "0 < d" and df: "(x + d *\<^sub>R (y-x)) \<in> rel_frontier S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2289 | and di: "\<And>e. \<lbrakk>0 \<le> e; e < d\<rbrakk> \<Longrightarrow> (x + e *\<^sub>R (y-x)) \<in> rel_interior S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2290 | by (rule ray_to_rel_frontier [OF \<open>bounded S\<close> x]) (use xy in auto) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2291 | show ?thesis | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2292 | proof | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2293 | show "x + d *\<^sub>R (y - x) \<in> rel_frontier S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2294 | by (simp add: df) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2295 | next | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2296 | have "open_segment x y \<subseteq> rel_interior S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2297 | using rel_interior_closure_convex_segment [OF \<open>convex S\<close> x] closure_subset y by blast | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2298 | moreover have "x + d *\<^sub>R (y - x) \<in> open_segment x y" if "d < 1" | 
| 72238 | 2299 | using xy \<open>0 < d\<close> that by (force simp: in_segment algebra_simps) | 
| 70620 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2300 | ultimately have "1 \<le> d" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2301 | using df rel_frontier_def by fastforce | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2302 | moreover have "x = (1 / d) *\<^sub>R x + ((d - 1) / d) *\<^sub>R x" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2303 | by (metis \<open>0 < d\<close> add.commute add_divide_distrib diff_add_cancel divide_self_if less_irrefl scaleR_add_left scaleR_one) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2304 | ultimately show "y \<in> closed_segment x (x + d *\<^sub>R (y - x))" | 
| 72567 | 2305 | unfolding in_segment | 
| 2306 | by (rule_tac x="1/d" in exI) (auto simp: algebra_simps) | |
| 70620 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2307 | next | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2308 | show "open_segment x (x + d *\<^sub>R (y - x)) \<subseteq> rel_interior S" | 
| 72238 | 2309 | proof (rule rel_interior_closure_convex_segment [OF \<open>convex S\<close> x]) | 
| 2310 | show "x + d *\<^sub>R (y - x) \<in> closure S" | |
| 2311 | using df rel_frontier_def by auto | |
| 2312 | qed | |
| 70620 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2313 | qed | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2314 | qed | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2315 | |
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2316 | lemma segment_to_rel_frontier: | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2317 | fixes x :: "'a::euclidean_space" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2318 | assumes S: "convex S" "bounded S" and x: "x \<in> rel_interior S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2319 |       and y: "y \<in> S" and xy: "\<not>(x = y \<and> S = {x})"
 | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2320 | obtains z where "z \<in> rel_frontier S" "y \<in> closed_segment x z" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2321 | "open_segment x z \<subseteq> rel_interior S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2322 | proof (cases "x=y") | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2323 | case True | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2324 |   with xy have "S \<noteq> {x}"
 | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2325 | by blast | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2326 | with True show ?thesis | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2327 | by (metis Set.set_insert all_not_in_conv ends_in_segment(1) insert_iff segment_to_rel_frontier_aux[OF S x] that y) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2328 | next | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2329 | case False | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2330 | then show ?thesis | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2331 | using segment_to_rel_frontier_aux [OF S x y] that by blast | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2332 | qed | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2333 | |
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2334 | proposition rel_frontier_not_sing: | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2335 | fixes a :: "'a::euclidean_space" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2336 | assumes "bounded S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2337 |     shows "rel_frontier S \<noteq> {a}"
 | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2338 | proof (cases "S = {}")
 | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2339 | case True then show ?thesis by simp | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2340 | next | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2341 | case False | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2342 | then obtain z where "z \<in> S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2343 | by blast | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2344 | then show ?thesis | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2345 |   proof (cases "S = {z}")
 | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2346 | case True then show ?thesis by simp | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2347 | next | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2348 | case False | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2349 | then obtain w where "w \<in> S" "w \<noteq> z" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2350 | using \<open>z \<in> S\<close> by blast | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2351 | show ?thesis | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2352 | proof | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2353 |       assume "rel_frontier S = {a}"
 | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2354 | then consider "w \<notin> rel_frontier S" | "z \<notin> rel_frontier S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2355 | using \<open>w \<noteq> z\<close> by auto | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2356 | then show False | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2357 | proof cases | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2358 | case 1 | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2359 | then have w: "w \<in> rel_interior S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2360 | using \<open>w \<in> S\<close> closure_subset rel_frontier_def by fastforce | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2361 | have "w + (w - z) \<in> affine hull S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2362 | by (metis \<open>w \<in> S\<close> \<open>z \<in> S\<close> affine_affine_hull hull_inc mem_affine_3_minus scaleR_one) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2363 | then obtain e where "0 < e" "(w + e *\<^sub>R (w - z)) \<in> rel_frontier S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2364 | using \<open>w \<noteq> z\<close> \<open>z \<in> S\<close> by (metis assms ray_to_rel_frontier right_minus_eq w) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2365 | moreover obtain d where "0 < d" "(w + d *\<^sub>R (z - w)) \<in> rel_frontier S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2366 | using ray_to_rel_frontier [OF \<open>bounded S\<close> w, of "1 *\<^sub>R (z - w)"] \<open>w \<noteq> z\<close> \<open>z \<in> S\<close> | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2367 | by (metis add.commute add.right_neutral diff_add_cancel hull_inc scaleR_one) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2368 | ultimately have "d *\<^sub>R (z - w) = e *\<^sub>R (w - z)" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2369 |           using \<open>rel_frontier S = {a}\<close> by force
 | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2370 | moreover have "e \<noteq> -d " | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2371 | using \<open>0 < e\<close> \<open>0 < d\<close> by force | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2372 | ultimately show False | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2373 | by (metis (no_types, lifting) \<open>w \<noteq> z\<close> eq_iff_diff_eq_0 minus_diff_eq real_vector.scale_cancel_right real_vector.scale_minus_right scaleR_left.minus) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2374 | next | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2375 | case 2 | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2376 | then have z: "z \<in> rel_interior S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2377 | using \<open>z \<in> S\<close> closure_subset rel_frontier_def by fastforce | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2378 | have "z + (z - w) \<in> affine hull S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2379 | by (metis \<open>z \<in> S\<close> \<open>w \<in> S\<close> affine_affine_hull hull_inc mem_affine_3_minus scaleR_one) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2380 | then obtain e where "0 < e" "(z + e *\<^sub>R (z - w)) \<in> rel_frontier S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2381 | using \<open>w \<noteq> z\<close> \<open>w \<in> S\<close> by (metis assms ray_to_rel_frontier right_minus_eq z) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2382 | moreover obtain d where "0 < d" "(z + d *\<^sub>R (w - z)) \<in> rel_frontier S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2383 | using ray_to_rel_frontier [OF \<open>bounded S\<close> z, of "1 *\<^sub>R (w - z)"] \<open>w \<noteq> z\<close> \<open>w \<in> S\<close> | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2384 | by (metis add.commute add.right_neutral diff_add_cancel hull_inc scaleR_one) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2385 | ultimately have "d *\<^sub>R (w - z) = e *\<^sub>R (z - w)" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2386 |           using \<open>rel_frontier S = {a}\<close> by force
 | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2387 | moreover have "e \<noteq> -d " | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2388 | using \<open>0 < e\<close> \<open>0 < d\<close> by force | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2389 | ultimately show False | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2390 | by (metis (no_types, lifting) \<open>w \<noteq> z\<close> eq_iff_diff_eq_0 minus_diff_eq real_vector.scale_cancel_right real_vector.scale_minus_right scaleR_left.minus) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2391 | qed | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2392 | qed | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2393 | qed | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2394 | qed | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2395 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2396 | |
| 70136 | 2397 | subsection\<^marker>\<open>tag unimportant\<close> \<open>Convexity on direct sums\<close> | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2398 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2399 | lemma closure_sum: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2400 | fixes S T :: "'a::real_normed_vector set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2401 | shows "closure S + closure T \<subseteq> closure (S + T)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2402 | unfolding set_plus_image closure_Times [symmetric] split_def | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2403 | by (intro closure_bounded_linear_image_subset bounded_linear_add | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2404 | bounded_linear_fst bounded_linear_snd) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2405 | |
| 74729 
64b3d8d9bd10
new lemmas about convex, concave functions, + tidying
 paulson <lp15@cam.ac.uk> parents: 
74007diff
changeset | 2406 | lemma fst_snd_linear: "linear (\<lambda>(x,y). x + y)" | 
| 
64b3d8d9bd10
new lemmas about convex, concave functions, + tidying
 paulson <lp15@cam.ac.uk> parents: 
74007diff
changeset | 2407 | unfolding linear_iff by (simp add: algebra_simps) | 
| 
64b3d8d9bd10
new lemmas about convex, concave functions, + tidying
 paulson <lp15@cam.ac.uk> parents: 
74007diff
changeset | 2408 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2409 | lemma rel_interior_sum: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2410 | fixes S T :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2411 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2412 | and "convex T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2413 | shows "rel_interior (S + T) = rel_interior S + rel_interior T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2414 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2415 | have "rel_interior S + rel_interior T = (\<lambda>(x,y). x + y) ` (rel_interior S \<times> rel_interior T)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2416 | by (simp add: set_plus_image) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2417 | also have "\<dots> = (\<lambda>(x,y). x + y) ` rel_interior (S \<times> T)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2418 | using rel_interior_Times assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2419 | also have "\<dots> = rel_interior (S + T)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2420 | using fst_snd_linear convex_Times assms | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2421 | rel_interior_convex_linear_image[of "(\<lambda>(x,y). x + y)" "S \<times> T"] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2422 | by (auto simp add: set_plus_image) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2423 | finally show ?thesis .. | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2424 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2425 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2426 | lemma rel_interior_sum_gen: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2427 | fixes S :: "'a \<Rightarrow> 'n::euclidean_space set" | 
| 72238 | 2428 | assumes "\<And>i. i\<in>I \<Longrightarrow> convex (S i)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2429 | shows "rel_interior (sum S I) = sum (\<lambda>i. rel_interior (S i)) I" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2430 | using rel_interior_sum rel_interior_sing[of "0"] assms | 
| 72238 | 2431 | by (subst sum_set_cond_linear[of convex], auto simp add: convex_set_plus) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2432 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2433 | lemma convex_rel_open_direct_sum: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2434 | fixes S T :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2435 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2436 | and "rel_open S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2437 | and "convex T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2438 | and "rel_open T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2439 | shows "convex (S \<times> T) \<and> rel_open (S \<times> T)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2440 | by (metis assms convex_Times rel_interior_Times rel_open_def) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2441 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2442 | lemma convex_rel_open_sum: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2443 | fixes S T :: "'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2444 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2445 | and "rel_open S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2446 | and "convex T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2447 | and "rel_open T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2448 | shows "convex (S + T) \<and> rel_open (S + T)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2449 | by (metis assms convex_set_plus rel_interior_sum rel_open_def) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2450 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2451 | lemma convex_hull_finite_union_cones: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2452 | assumes "finite I" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2453 |     and "I \<noteq> {}"
 | 
| 72238 | 2454 |   assumes "\<And>i. i\<in>I \<Longrightarrow> convex (S i) \<and> cone (S i) \<and> S i \<noteq> {}"
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2455 | shows "convex hull (\<Union>(S ` I)) = sum S I" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2456 | (is "?lhs = ?rhs") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2457 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2458 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2459 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2460 | assume "x \<in> ?lhs" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2461 | then obtain c xs where | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2462 | x: "x = sum (\<lambda>i. c i *\<^sub>R xs i) I \<and> (\<forall>i\<in>I. c i \<ge> 0) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. xs i \<in> S i)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2463 | using convex_hull_finite_union[of I S] assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2464 | define s where "s i = c i *\<^sub>R xs i" for i | 
| 72238 | 2465 | have "\<forall>i\<in>I. s i \<in> S i" | 
| 2466 | using s_def x assms by (simp add: mem_cone) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2467 | moreover have "x = sum s I" using x s_def by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2468 | ultimately have "x \<in> ?rhs" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2469 | using set_sum_alt[of I S] assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2470 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2471 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2472 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2473 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2474 | assume "x \<in> ?rhs" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2475 | then obtain s where x: "x = sum s I \<and> (\<forall>i\<in>I. s i \<in> S i)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2476 | using set_sum_alt[of I S] assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2477 | define xs where "xs i = of_nat(card I) *\<^sub>R s i" for i | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2478 | then have "x = sum (\<lambda>i. ((1 :: real) / of_nat(card I)) *\<^sub>R xs i) I" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2479 | using x assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2480 | moreover have "\<forall>i\<in>I. xs i \<in> S i" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2481 | using x xs_def assms by (simp add: cone_def) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2482 | moreover have "\<forall>i\<in>I. (1 :: real) / of_nat (card I) \<ge> 0" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2483 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2484 | moreover have "sum (\<lambda>i. (1 :: real) / of_nat (card I)) I = 1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2485 | using assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2486 | ultimately have "x \<in> ?lhs" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2487 | using assms | 
| 72238 | 2488 | apply (simp add: convex_hull_finite_union[of I S]) | 
| 2489 | by (rule_tac x = "(\<lambda>i. 1 / (card I))" in exI) auto | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2490 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2491 | ultimately show ?thesis by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2492 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2493 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2494 | lemma convex_hull_union_cones_two: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2495 | fixes S T :: "'m::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2496 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2497 | and "cone S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2498 |     and "S \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2499 | assumes "convex T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2500 | and "cone T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2501 |     and "T \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2502 | shows "convex hull (S \<union> T) = S + T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2503 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2504 |   define I :: "nat set" where "I = {1, 2}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2505 | define A where "A i = (if i = (1::nat) then S else T)" for i | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2506 | have "\<Union>(A ` I) = S \<union> T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2507 | using A_def I_def by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2508 | then have "convex hull (\<Union>(A ` I)) = convex hull (S \<union> T)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2509 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2510 | moreover have "convex hull \<Union>(A ` I) = sum A I" | 
| 72238 | 2511 | using A_def I_def | 
| 2512 | by (metis assms convex_hull_finite_union_cones empty_iff finite.emptyI finite.insertI insertI1) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2513 | moreover have "sum A I = S + T" | 
| 72238 | 2514 | using A_def I_def by (force simp add: set_plus_def) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2515 | ultimately show ?thesis by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2516 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2517 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2518 | lemma rel_interior_convex_hull_union: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2519 | fixes S :: "'a \<Rightarrow> 'n::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2520 | assumes "finite I" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2521 |     and "\<forall>i\<in>I. convex (S i) \<and> S i \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2522 | shows "rel_interior (convex hull (\<Union>(S ` I))) = | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2523 |     {sum (\<lambda>i. c i *\<^sub>R s i) I | c s. (\<forall>i\<in>I. c i > 0) \<and> sum c I = 1 \<and>
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2524 | (\<forall>i\<in>I. s i \<in> rel_interior(S i))}" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2525 | (is "?lhs = ?rhs") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2526 | proof (cases "I = {}")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2527 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2528 | then show ?thesis | 
| 71176 | 2529 | using convex_hull_empty by auto | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2530 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2531 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2532 | define C0 where "C0 = convex hull (\<Union>(S ` I))" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2533 | have "\<forall>i\<in>I. C0 \<ge> S i" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2534 | unfolding C0_def using hull_subset[of "\<Union>(S ` I)"] by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2535 |   define K0 where "K0 = cone hull ({1 :: real} \<times> C0)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2536 |   define K where "K i = cone hull ({1 :: real} \<times> S i)" for i
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2537 |   have "\<forall>i\<in>I. K i \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2538 | unfolding K_def using assms | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2539 | by (simp add: cone_hull_empty_iff[symmetric]) | 
| 72238 | 2540 | have convK: "\<forall>i\<in>I. convex (K i)" | 
| 2541 | unfolding K_def | |
| 2542 | by (simp add: assms(2) convex_Times convex_cone_hull) | |
| 2543 | have "K0 \<supseteq> K i" if "i \<in> I" for i | |
| 2544 | unfolding K0_def K_def | |
| 2545 | by (simp add: Sigma_mono \<open>\<forall>i\<in>I. S i \<subseteq> C0\<close> hull_mono that) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2546 | then have "K0 \<supseteq> \<Union>(K ` I)" by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2547 | moreover have "convex K0" | 
| 72238 | 2548 | unfolding K0_def by (simp add: C0_def convex_Times convex_cone_hull) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2549 | ultimately have geq: "K0 \<supseteq> convex hull (\<Union>(K ` I))" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2550 | using hull_minimal[of _ "K0" "convex"] by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2551 |   have "\<forall>i\<in>I. K i \<supseteq> {1 :: real} \<times> S i"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2552 | using K_def by (simp add: hull_subset) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2553 |   then have "\<Union>(K ` I) \<supseteq> {1 :: real} \<times> \<Union>(S ` I)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2554 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2555 |   then have "convex hull \<Union>(K ` I) \<supseteq> convex hull ({1 :: real} \<times> \<Union>(S ` I))"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2556 | by (simp add: hull_mono) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2557 |   then have "convex hull \<Union>(K ` I) \<supseteq> {1 :: real} \<times> C0"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2558 | unfolding C0_def | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2559 |     using convex_hull_Times[of "{(1 :: real)}" "\<Union>(S ` I)"] convex_hull_singleton
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2560 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2561 | moreover have "cone (convex hull (\<Union>(K ` I)))" | 
| 72238 | 2562 | by (simp add: K_def cone_Union cone_cone_hull cone_convex_hull) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2563 | ultimately have "convex hull (\<Union>(K ` I)) \<supseteq> K0" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2564 | unfolding K0_def | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2565 | using hull_minimal[of _ "convex hull (\<Union>(K ` I))" "cone"] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2566 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2567 | then have "K0 = convex hull (\<Union>(K ` I))" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2568 | using geq by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2569 | also have "\<dots> = sum K I" | 
| 72238 | 2570 |     using assms False \<open>\<forall>i\<in>I. K i \<noteq> {}\<close> cone_hull_eq convK 
 | 
| 2571 | by (intro convex_hull_finite_union_cones; fastforce simp: K_def) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2572 | finally have "K0 = sum K I" by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2573 | then have *: "rel_interior K0 = sum (\<lambda>i. (rel_interior (K i))) I" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2574 | using rel_interior_sum_gen[of I K] convK by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2575 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2576 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2577 | assume "x \<in> ?lhs" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2578 | then have "(1::real, x) \<in> rel_interior K0" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2579 | using K0_def C0_def rel_interior_convex_cone_aux[of C0 "1::real" x] convex_convex_hull | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2580 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2581 | then obtain k where k: "(1::real, x) = sum k I \<and> (\<forall>i\<in>I. k i \<in> rel_interior (K i))" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2582 | using \<open>finite I\<close> * set_sum_alt[of I "\<lambda>i. rel_interior (K i)"] by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2583 |     {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2584 | fix i | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2585 | assume "i \<in> I" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2586 |       then have "convex (S i) \<and> k i \<in> rel_interior (cone hull {1} \<times> S i)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2587 | using k K_def assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2588 | then have "\<exists>ci si. k i = (ci, ci *\<^sub>R si) \<and> 0 < ci \<and> si \<in> rel_interior (S i)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2589 | using rel_interior_convex_cone[of "S i"] by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2590 | } | 
| 72238 | 2591 | then obtain c s where cs: "\<forall>i\<in>I. k i = (c i, c i *\<^sub>R s i) \<and> 0 < c i \<and> s i \<in> rel_interior (S i)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2592 | by metis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2593 | then have "x = (\<Sum>i\<in>I. c i *\<^sub>R s i) \<and> sum c I = 1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2594 | using k by (simp add: sum_prod) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2595 | then have "x \<in> ?rhs" | 
| 68056 | 2596 | using k cs by auto | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2597 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2598 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2599 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2600 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2601 | assume "x \<in> ?rhs" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2602 | then obtain c s where cs: "x = sum (\<lambda>i. c i *\<^sub>R s i) I \<and> | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2603 | (\<forall>i\<in>I. c i > 0) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2604 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2605 | define k where "k i = (c i, c i *\<^sub>R s i)" for i | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2606 |     {
 | 
| 67613 | 2607 | fix i assume "i \<in> I" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2608 | then have "k i \<in> rel_interior (K i)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2609 | using k_def K_def assms cs rel_interior_convex_cone[of "S i"] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2610 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2611 | } | 
| 72238 | 2612 | then have "(1, x) \<in> rel_interior K0" | 
| 72567 | 2613 | using * set_sum_alt[of I "(\<lambda>i. rel_interior (K i))"] assms cs | 
| 2614 | by (simp add: k_def) (metis (mono_tags, lifting) sum_prod) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2615 | then have "x \<in> ?lhs" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2616 | using K0_def C0_def rel_interior_convex_cone_aux[of C0 1 x] | 
| 68056 | 2617 | by auto | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2618 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2619 | ultimately show ?thesis by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2620 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2621 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2622 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2623 | lemma convex_le_Inf_differential: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2624 | fixes f :: "real \<Rightarrow> real" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2625 | assumes "convex_on I f" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2626 | and "x \<in> interior I" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2627 | and "y \<in> I" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2628 |   shows "f y \<ge> f x + Inf ((\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I)) * (y - x)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2629 | (is "_ \<ge> _ + Inf (?F x) * (y - x)") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2630 | proof (cases rule: linorder_cases) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2631 | assume "x < y" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2632 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2633 | have "open (interior I)" by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2634 | from openE[OF this \<open>x \<in> interior I\<close>] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2635 | obtain e where e: "0 < e" "ball x e \<subseteq> interior I" . | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2636 | moreover define t where "t = min (x + e / 2) ((x + y) / 2)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2637 | ultimately have "x < t" "t < y" "t \<in> ball x e" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2638 | by (auto simp: dist_real_def field_simps split: split_min) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2639 | with \<open>x \<in> interior I\<close> e interior_subset[of I] have "t \<in> I" "x \<in> I" by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2640 | |
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2641 | define K where "K = x - e / 2" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2642 | with \<open>0 < e\<close> have "K \<in> ball x e" "K < x" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2643 | by (auto simp: dist_real_def) | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2644 | then have "K \<in> I" | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2645 | using \<open>interior I \<subseteq> I\<close> e(2) by blast | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2646 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2647 | have "Inf (?F x) \<le> (f x - f y) / (x - y)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2648 | proof (intro bdd_belowI cInf_lower2) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2649 | show "(f x - f t) / (x - t) \<in> ?F x" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2650 | using \<open>t \<in> I\<close> \<open>x < t\<close> by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2651 | show "(f x - f t) / (x - t) \<le> (f x - f y) / (x - y)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2652 | using \<open>convex_on I f\<close> \<open>x \<in> I\<close> \<open>y \<in> I\<close> \<open>x < t\<close> \<open>t < y\<close> | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2653 | by (rule convex_on_diff) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2654 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2655 | fix y | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2656 | assume "y \<in> ?F x" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2657 | with order_trans[OF convex_on_diff[OF \<open>convex_on I f\<close> \<open>K \<in> I\<close> _ \<open>K < x\<close> _]] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2658 | show "(f K - f x) / (K - x) \<le> y" by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2659 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2660 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2661 | using \<open>x < y\<close> by (simp add: field_simps) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2662 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2663 | assume "y < x" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2664 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2665 | have "open (interior I)" by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2666 | from openE[OF this \<open>x \<in> interior I\<close>] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2667 | obtain e where e: "0 < e" "ball x e \<subseteq> interior I" . | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2668 | moreover define t where "t = x + e / 2" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2669 | ultimately have "x < t" "t \<in> ball x e" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2670 | by (auto simp: dist_real_def field_simps) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2671 | with \<open>x \<in> interior I\<close> e interior_subset[of I] have "t \<in> I" "x \<in> I" by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2672 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2673 | have "(f x - f y) / (x - y) \<le> Inf (?F x)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2674 | proof (rule cInf_greatest) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2675 | have "(f x - f y) / (x - y) = (f y - f x) / (y - x)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2676 | using \<open>y < x\<close> by (auto simp: field_simps) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2677 | also | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2678 | fix z | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2679 | assume "z \<in> ?F x" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2680 | with order_trans[OF convex_on_diff[OF \<open>convex_on I f\<close> \<open>y \<in> I\<close> _ \<open>y < x\<close>]] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2681 | have "(f y - f x) / (y - x) \<le> z" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2682 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2683 | finally show "(f x - f y) / (x - y) \<le> z" . | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2684 | next | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2685 | have "x + e / 2 \<in> ball x e" | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2686 | using e by (auto simp: dist_real_def) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2687 |     with e interior_subset[of I] have "x + e / 2 \<in> {x<..} \<inter> I"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2688 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2689 |     then show "?F x \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2690 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2691 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2692 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2693 | using \<open>y < x\<close> by (simp add: field_simps) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2694 | qed simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2695 | |
| 70136 | 2696 | subsection\<^marker>\<open>tag unimportant\<close>\<open>Explicit formulas for interior and relative interior of convex hull\<close> | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2697 | |
| 66765 
c1dfa973b269
new theorem at_within_cbox_finite
 paulson <lp15@cam.ac.uk> parents: 
66641diff
changeset | 2698 | lemma at_within_cbox_finite: | 
| 
c1dfa973b269
new theorem at_within_cbox_finite
 paulson <lp15@cam.ac.uk> parents: 
66641diff
changeset | 2699 | assumes "x \<in> box a b" "x \<notin> S" "finite S" | 
| 
c1dfa973b269
new theorem at_within_cbox_finite
 paulson <lp15@cam.ac.uk> parents: 
66641diff
changeset | 2700 | shows "(at x within cbox a b - S) = at x" | 
| 
c1dfa973b269
new theorem at_within_cbox_finite
 paulson <lp15@cam.ac.uk> parents: 
66641diff
changeset | 2701 | proof - | 
| 
c1dfa973b269
new theorem at_within_cbox_finite
 paulson <lp15@cam.ac.uk> parents: 
66641diff
changeset | 2702 | have "interior (cbox a b - S) = box a b - S" | 
| 
c1dfa973b269
new theorem at_within_cbox_finite
 paulson <lp15@cam.ac.uk> parents: 
66641diff
changeset | 2703 | using \<open>finite S\<close> by (simp add: interior_diff finite_imp_closed) | 
| 
c1dfa973b269
new theorem at_within_cbox_finite
 paulson <lp15@cam.ac.uk> parents: 
66641diff
changeset | 2704 | then show ?thesis | 
| 
c1dfa973b269
new theorem at_within_cbox_finite
 paulson <lp15@cam.ac.uk> parents: 
66641diff
changeset | 2705 | using at_within_interior assms by fastforce | 
| 
c1dfa973b269
new theorem at_within_cbox_finite
 paulson <lp15@cam.ac.uk> parents: 
66641diff
changeset | 2706 | qed | 
| 
c1dfa973b269
new theorem at_within_cbox_finite
 paulson <lp15@cam.ac.uk> parents: 
66641diff
changeset | 2707 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2708 | lemma affine_independent_convex_affine_hull: | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2709 | fixes S :: "'a::euclidean_space set" | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2710 | assumes "\<not> affine_dependent S" "T \<subseteq> S" | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2711 | shows "convex hull T = affine hull T \<inter> convex hull S" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2712 | proof - | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2713 | have fin: "finite S" "finite T" using assms aff_independent_finite finite_subset by auto | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2714 | have "convex hull T \<subseteq> affine hull T" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2715 | using convex_hull_subset_affine_hull by blast | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2716 | moreover have "convex hull T \<subseteq> convex hull S" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2717 | using assms hull_mono by blast | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2718 | moreover have "affine hull T \<inter> convex hull S \<subseteq> convex hull T" | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2719 | proof - | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2720 | have 0: "\<And>u. sum u S = 0 \<Longrightarrow> (\<forall>v\<in>S. u v = 0) \<or> (\<Sum>v\<in>S. u v *\<^sub>R v) \<noteq> 0" | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2721 | using affine_dependent_explicit_finite assms(1) fin(1) by auto | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2722 | show ?thesis | 
| 72567 | 2723 | proof (clarsimp simp add: affine_hull_finite fin) | 
| 2724 | fix u | |
| 2725 | assume S: "(\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull S" | |
| 2726 | and T1: "sum u T = 1" | |
| 2727 | then obtain v where v: "\<forall>x\<in>S. 0 \<le> v x" "sum v S = 1" "(\<Sum>x\<in>S. v x *\<^sub>R x) = (\<Sum>v\<in>T. u v *\<^sub>R v)" | |
| 2728 | by (auto simp add: convex_hull_finite fin) | |
| 2729 |       { fix x
 | |
| 2730 | assume"x \<in> T" | |
| 2731 | then have S: "S = (S - T) \<union> T" \<comment> \<open>split into separate cases\<close> | |
| 2732 | using assms by auto | |
| 2733 | have [simp]: "(\<Sum>x\<in>T. v x *\<^sub>R x) + (\<Sum>x\<in>S - T. v x *\<^sub>R x) = (\<Sum>x\<in>T. u x *\<^sub>R x)" | |
| 2734 | "sum v T + sum v (S - T) = 1" | |
| 2735 | using v fin S | |
| 2736 | by (auto simp: sum.union_disjoint [symmetric] Un_commute) | |
| 2737 | have "(\<Sum>x\<in>S. if x \<in> T then v x - u x else v x) = 0" | |
| 2738 | "(\<Sum>x\<in>S. (if x \<in> T then v x - u x else v x) *\<^sub>R x) = 0" | |
| 2739 | using v fin T1 | |
| 2740 | by (subst S, subst sum.union_disjoint, auto simp: algebra_simps sum_subtractf)+ | |
| 2741 | } note [simp] = this | |
| 2742 | have "(\<forall>x\<in>T. 0 \<le> u x)" | |
| 2743 | using 0 [of "\<lambda>x. if x \<in> T then v x - u x else v x"] \<open>T \<subseteq> S\<close> v(1) by fastforce | |
| 2744 | then show "(\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull T" | |
| 2745 | using 0 [of "\<lambda>x. if x \<in> T then v x - u x else v x"] \<open>T \<subseteq> S\<close> T1 | |
| 2746 | by (fastforce simp add: convex_hull_finite fin) | |
| 2747 | qed | |
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2748 | qed | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2749 | ultimately show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2750 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2751 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2752 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2753 | lemma affine_independent_span_eq: | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2754 | fixes S :: "'a::euclidean_space set" | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2755 |   assumes "\<not> affine_dependent S" "card S = Suc (DIM ('a))"
 | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2756 | shows "affine hull S = UNIV" | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2757 | proof (cases "S = {}")
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2758 | case True then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2759 | using assms by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2760 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2761 | case False | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2762 | then obtain a T where T: "a \<notin> T" "S = insert a T" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2763 | by blast | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2764 | then have fin: "finite T" using assms | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2765 | by (metis finite_insert aff_independent_finite) | 
| 72567 | 2766 | have "UNIV \<subseteq> (+) a ` span ((\<lambda>x. x - a) ` T)" | 
| 2767 | proof (intro card_ge_dim_independent Fun.vimage_subsetD) | |
| 2768 | show "independent ((\<lambda>x. x - a) ` T)" | |
| 2769 | using T affine_dependent_iff_dependent assms(1) by auto | |
| 2770 | show "dim ((+) a -` UNIV) \<le> card ((\<lambda>x. x - a) ` T)" | |
| 2771 | using assms T fin by (auto simp: card_image inj_on_def) | |
| 2772 | qed (use surj_plus in auto) | |
| 72238 | 2773 | then show ?thesis | 
| 2774 | using T(2) affine_hull_insert_span_gen equalityI by fastforce | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2775 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2776 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2777 | lemma affine_independent_span_gt: | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2778 | fixes S :: "'a::euclidean_space set" | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2779 |   assumes ind: "\<not> affine_dependent S" and dim: "DIM ('a) < card S"
 | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2780 | shows "affine hull S = UNIV" | 
| 72238 | 2781 | proof (intro affine_independent_span_eq [OF ind] antisym) | 
| 2782 |   show "card S \<le> Suc DIM('a)"
 | |
| 2783 | using aff_independent_finite affine_dependent_biggerset ind by fastforce | |
| 2784 |   show "Suc DIM('a) \<le> card S"
 | |
| 2785 | using Suc_leI dim by blast | |
| 2786 | qed | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2787 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2788 | lemma empty_interior_affine_hull: | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2789 | fixes S :: "'a::euclidean_space set" | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2790 |   assumes "finite S" and dim: "card S \<le> DIM ('a)"
 | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2791 |     shows "interior(affine hull S) = {}"
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2792 | using assms | 
| 72238 | 2793 | proof (induct S rule: finite_induct) | 
| 2794 | case (insert x S) | |
| 2795 |   then have "dim (span ((\<lambda>y. y - x) ` S)) < DIM('a)"
 | |
| 2796 | by (auto simp: Suc_le_lessD card_image_le dual_order.trans intro!: dim_le_card'[THEN le_less_trans]) | |
| 2797 | then show ?case | |
| 2798 | by (simp add: empty_interior_lowdim affine_hull_insert_span_gen interior_translation) | |
| 2799 | qed auto | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2800 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2801 | lemma empty_interior_convex_hull: | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2802 | fixes S :: "'a::euclidean_space set" | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2803 |   assumes "finite S" and dim: "card S \<le> DIM ('a)"
 | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2804 |     shows "interior(convex hull S) = {}"
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2805 | by (metis Diff_empty Diff_eq_empty_iff convex_hull_subset_affine_hull | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2806 | interior_mono empty_interior_affine_hull [OF assms]) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2807 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2808 | lemma explicit_subset_rel_interior_convex_hull: | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2809 | fixes S :: "'a::euclidean_space set" | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2810 | shows "finite S | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2811 |          \<Longrightarrow> {y. \<exists>u. (\<forall>x \<in> S. 0 < u x \<and> u x < 1) \<and> sum u S = 1 \<and> sum (\<lambda>x. u x *\<^sub>R x) S = y}
 | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2812 | \<subseteq> rel_interior (convex hull S)" | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2813 |   by (force simp add:  rel_interior_convex_hull_union [where S="\<lambda>x. {x}" and I=S, simplified])
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2814 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2815 | lemma explicit_subset_rel_interior_convex_hull_minimal: | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2816 | fixes S :: "'a::euclidean_space set" | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2817 | shows "finite S | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2818 |          \<Longrightarrow> {y. \<exists>u. (\<forall>x \<in> S. 0 < u x) \<and> sum u S = 1 \<and> sum (\<lambda>x. u x *\<^sub>R x) S = y}
 | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2819 | \<subseteq> rel_interior (convex hull S)" | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2820 |   by (force simp add:  rel_interior_convex_hull_union [where S="\<lambda>x. {x}" and I=S, simplified])
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2821 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2822 | lemma rel_interior_convex_hull_explicit: | 
| 72567 | 2823 | fixes S :: "'a::euclidean_space set" | 
| 2824 | assumes "\<not> affine_dependent S" | |
| 2825 | shows "rel_interior(convex hull S) = | |
| 2826 |          {y. \<exists>u. (\<forall>x \<in> S. 0 < u x) \<and> sum u S = 1 \<and> sum (\<lambda>x. u x *\<^sub>R x) S = y}"
 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2827 | (is "?lhs = ?rhs") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2828 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2829 | show "?rhs \<le> ?lhs" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2830 | by (simp add: aff_independent_finite explicit_subset_rel_interior_convex_hull_minimal assms) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2831 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2832 | show "?lhs \<le> ?rhs" | 
| 72567 | 2833 |   proof (cases "\<exists>a. S = {a}")
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2834 | case True then show "?lhs \<le> ?rhs" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2835 | by force | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2836 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2837 | case False | 
| 72567 | 2838 | have fs: "finite S" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2839 | using assms by (simp add: aff_independent_finite) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2840 |     { fix a b and d::real
 | 
| 72567 | 2841 | assume ab: "a \<in> S" "b \<in> S" "a \<noteq> b" | 
| 2842 |       then have S: "S = (S - {a,b}) \<union> {a,b}" \<comment> \<open>split into separate cases\<close>
 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2843 | by auto | 
| 72567 | 2844 | have "(\<Sum>x\<in>S. if x = a then - d else if x = b then d else 0) = 0" | 
| 2845 | "(\<Sum>x\<in>S. (if x = a then - d else if x = b then d else 0) *\<^sub>R x) = d *\<^sub>R b - d *\<^sub>R a" | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2846 | using ab fs | 
| 72567 | 2847 | by (subst S, subst sum.union_disjoint, auto)+ | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2848 | } note [simp] = this | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2849 |     { fix y
 | 
| 72567 | 2850 | assume y: "y \<in> convex hull S" "y \<notin> ?rhs" | 
| 2851 | have *: False if | |
| 2852 | ua: "\<forall>x\<in>S. 0 \<le> u x" "sum u S = 1" "\<not> 0 < u a" "a \<in> S" | |
| 2853 | and yT: "y = (\<Sum>x\<in>S. u x *\<^sub>R x)" "y \<in> T" "open T" | |
| 2854 |         and sb: "T \<inter> affine hull S \<subseteq> {w. \<exists>u. (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>x\<in>S. u x *\<^sub>R x) = w}"
 | |
| 2855 | for u T a | |
| 2856 | proof - | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2857 | have ua0: "u a = 0" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2858 | using ua by auto | 
| 72567 | 2859 | obtain b where b: "b\<in>S" "a \<noteq> b" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2860 | using ua False by auto | 
| 72567 | 2861 | obtain e where e: "0 < e" "ball (\<Sum>x\<in>S. u x *\<^sub>R x) e \<subseteq> T" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2862 | using yT by (auto elim: openE) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2863 | with b obtain d where d: "0 < d" "norm(d *\<^sub>R (a-b)) < e" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2864 | by (auto intro: that [of "e / 2 / norm(a-b)"]) | 
| 72567 | 2865 | have "(\<Sum>x\<in>S. u x *\<^sub>R x) \<in> affine hull S" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2866 | using yT y by (metis affine_hull_convex_hull hull_redundant_eq) | 
| 72567 | 2867 | then have "(\<Sum>x\<in>S. u x *\<^sub>R x) - d *\<^sub>R (a - b) \<in> affine hull S" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2868 | using ua b by (auto simp: hull_inc intro: mem_affine_3_minus2) | 
| 72567 | 2869 | then have "y - d *\<^sub>R (a - b) \<in> T \<inter> affine hull S" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2870 | using d e yT by auto | 
| 72567 | 2871 | then obtain v where v: "\<forall>x\<in>S. 0 \<le> v x" | 
| 2872 | "sum v S = 1" | |
| 2873 | "(\<Sum>x\<in>S. v x *\<^sub>R x) = (\<Sum>x\<in>S. u x *\<^sub>R x) - d *\<^sub>R (a - b)" | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2874 | using subsetD [OF sb] yT | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2875 | by auto | 
| 72567 | 2876 | have aff: "\<And>u. sum u S = 0 \<Longrightarrow> (\<forall>v\<in>S. u v = 0) \<or> (\<Sum>v\<in>S. u v *\<^sub>R v) \<noteq> 0" | 
| 2877 | using assms by (simp add: affine_dependent_explicit_finite fs) | |
| 2878 | show False | |
| 2879 | using ua b d v aff [of "\<lambda>x. (v x - u x) - (if x = a then -d else if x = b then d else 0)"] | |
| 2880 | by (auto simp: algebra_simps sum_subtractf sum.distrib) | |
| 2881 | qed | |
| 2882 | have "y \<notin> rel_interior (convex hull S)" | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2883 | using y | 
| 71176 | 2884 | apply (simp add: mem_rel_interior) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2885 | apply (auto simp: convex_hull_finite [OF fs]) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2886 | apply (drule_tac x=u in spec) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2887 | apply (auto intro: *) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2888 | done | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2889 | } with rel_interior_subset show "?lhs \<le> ?rhs" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2890 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2891 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2892 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2893 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2894 | lemma interior_convex_hull_explicit_minimal: | 
| 72567 | 2895 | fixes S :: "'a::euclidean_space set" | 
| 2896 | assumes "\<not> affine_dependent S" | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2897 | shows | 
| 72567 | 2898 | "interior(convex hull S) = | 
| 2899 |              (if card(S) \<le> DIM('a) then {}
 | |
| 2900 |               else {y. \<exists>u. (\<forall>x \<in> S. 0 < u x) \<and> sum u S = 1 \<and> (\<Sum>x\<in>S. u x *\<^sub>R x) = y})"  
 | |
| 2901 | (is "_ = (if _ then _ else ?rhs)") | |
| 2902 | proof (clarsimp simp: aff_independent_finite empty_interior_convex_hull assms) | |
| 2903 |   assume S: "\<not> card S \<le> DIM('a)"
 | |
| 2904 | have "interior (convex hull S) = rel_interior(convex hull S)" | |
| 2905 | using assms S by (simp add: affine_independent_span_gt rel_interior_interior) | |
| 2906 | then show "interior(convex hull S) = ?rhs" | |
| 2907 | by (simp add: assms S rel_interior_convex_hull_explicit) | |
| 2908 | qed | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2909 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2910 | lemma interior_convex_hull_explicit: | 
| 72567 | 2911 | fixes S :: "'a::euclidean_space set" | 
| 2912 | assumes "\<not> affine_dependent S" | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2913 | shows | 
| 72567 | 2914 | "interior(convex hull S) = | 
| 2915 |              (if card(S) \<le> DIM('a) then {}
 | |
| 2916 |               else {y. \<exists>u. (\<forall>x \<in> S. 0 < u x \<and> u x < 1) \<and> sum u S = 1 \<and> (\<Sum>x\<in>S. u x *\<^sub>R x) = y})"
 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2917 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2918 |   { fix u :: "'a \<Rightarrow> real" and a
 | 
| 72567 | 2919 | assume "card Basis < card S" and u: "\<And>x. x\<in>S \<Longrightarrow> 0 < u x" "sum u S = 1" and a: "a \<in> S" | 
| 2920 | then have cs: "Suc 0 < card S" | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2921 | by (metis DIM_positive less_trans_Suc) | 
| 72567 | 2922 | obtain b where b: "b \<in> S" "a \<noteq> b" | 
| 2923 |     proof (cases "S \<le> {a}")
 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2924 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2925 | then show thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2926 | using cs subset_singletonD by fastforce | 
| 72238 | 2927 | qed blast | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2928 |     have "u a + u b \<le> sum u {a,b}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2929 | using a b by simp | 
| 72567 | 2930 | also have "... \<le> sum u S" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2931 | using a b u | 
| 72238 | 2932 | by (intro Groups_Big.sum_mono2) (auto simp: less_imp_le aff_independent_finite assms) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2933 | finally have "u a < 1" | 
| 72567 | 2934 | using \<open>b \<in> S\<close> u by fastforce | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2935 | } note [simp] = this | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2936 | show ?thesis | 
| 72238 | 2937 | using assms by (force simp add: not_le interior_convex_hull_explicit_minimal) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2938 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2939 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2940 | lemma interior_closed_segment_ge2: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2941 | fixes a :: "'a::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2942 |   assumes "2 \<le> DIM('a)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2943 |     shows  "interior(closed_segment a b) = {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2944 | using assms unfolding segment_convex_hull | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2945 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2946 |   have "card {a, b} \<le> DIM('a)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2947 | using assms | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2948 | by (simp add: card_insert_if linear not_less_eq_eq numeral_2_eq_2) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2949 |   then show "interior (convex hull {a, b}) = {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2950 | by (metis empty_interior_convex_hull finite.insertI finite.emptyI) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2951 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2952 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2953 | lemma interior_open_segment: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2954 | fixes a :: "'a::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2955 | shows "interior(open_segment a b) = | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2956 |                  (if 2 \<le> DIM('a) then {} else open_segment a b)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2957 | proof (simp add: not_le, intro conjI impI) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2958 |   assume "2 \<le> DIM('a)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2959 |   then show "interior (open_segment a b) = {}"
 | 
| 72238 | 2960 | using interior_closed_segment_ge2 interior_mono segment_open_subset_closed by blast | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2961 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2962 |   assume le2: "DIM('a) < 2"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2963 | show "interior (open_segment a b) = open_segment a b" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2964 | proof (cases "a = b") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2965 | case True then show ?thesis by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2966 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2967 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2968 | with le2 have "affine hull (open_segment a b) = UNIV" | 
| 72238 | 2969 | by (simp add: False affine_independent_span_gt) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2970 | then show "interior (open_segment a b) = open_segment a b" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2971 | using rel_interior_interior rel_interior_open_segment by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2972 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2973 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2974 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2975 | lemma interior_closed_segment: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2976 | fixes a :: "'a::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2977 | shows "interior(closed_segment a b) = | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2978 |                  (if 2 \<le> DIM('a) then {} else open_segment a b)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2979 | proof (cases "a = b") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2980 | case True then show ?thesis by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2981 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2982 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2983 | then have "closure (open_segment a b) = closed_segment a b" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2984 | by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2985 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2986 | by (metis (no_types) convex_interior_closure convex_open_segment interior_open_segment) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2987 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2988 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2989 | lemmas interior_segment = interior_closed_segment interior_open_segment | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2990 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2991 | lemma closed_segment_eq [simp]: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2992 | fixes a :: "'a::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2993 |   shows "closed_segment a b = closed_segment c d \<longleftrightarrow> {a,b} = {c,d}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2994 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2995 | assume abcd: "closed_segment a b = closed_segment c d" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2996 |   show "{a,b} = {c,d}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2997 | proof (cases "a=b \<or> c=d") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2998 | case True with abcd show ?thesis by force | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2999 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3000 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3001 | then have neq: "a \<noteq> b \<and> c \<noteq> d" by force | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3002 |     have *: "closed_segment c d - {a, b} = rel_interior (closed_segment c d)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3003 | using neq abcd by (metis (no_types) open_segment_def rel_interior_closed_segment) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3004 |     have "b \<in> {c, d}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3005 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3006 | have "insert b (closed_segment c d) = closed_segment c d" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3007 | using abcd by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3008 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3009 | by (metis DiffD2 Diff_insert2 False * insertI1 insert_Diff_if open_segment_def rel_interior_closed_segment) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3010 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3011 |     moreover have "a \<in> {c, d}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3012 | by (metis Diff_iff False * abcd ends_in_segment(1) insertI1 open_segment_def rel_interior_closed_segment) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3013 |     ultimately show "{a, b} = {c, d}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3014 | using neq by fastforce | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3015 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3016 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3017 |   assume "{a,b} = {c,d}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3018 | then show "closed_segment a b = closed_segment c d" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3019 | by (simp add: segment_convex_hull) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3020 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3021 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3022 | lemma closed_open_segment_eq [simp]: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3023 | fixes a :: "'a::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3024 | shows "closed_segment a b \<noteq> open_segment c d" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3025 | by (metis DiffE closed_segment_neq_empty closure_closed_segment closure_open_segment ends_in_segment(1) insertI1 open_segment_def) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3026 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3027 | lemma open_closed_segment_eq [simp]: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3028 | fixes a :: "'a::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3029 | shows "open_segment a b \<noteq> closed_segment c d" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3030 | using closed_open_segment_eq by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3031 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3032 | lemma open_segment_eq [simp]: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3033 | fixes a :: "'a::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3034 |   shows "open_segment a b = open_segment c d \<longleftrightarrow> a = b \<and> c = d \<or> {a,b} = {c,d}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3035 | (is "?lhs = ?rhs") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3036 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3037 | assume abcd: ?lhs | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3038 | show ?rhs | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3039 | proof (cases "a=b \<or> c=d") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3040 | case True with abcd show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3041 | using finite_open_segment by fastforce | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3042 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3043 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3044 | then have a2: "a \<noteq> b \<and> c \<noteq> d" by force | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3045 | with abcd show ?rhs | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3046 | unfolding open_segment_def | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3047 | by (metis (no_types) abcd closed_segment_eq closure_open_segment) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3048 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3049 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3050 | assume ?rhs | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3051 | then show ?lhs | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3052 | by (metis Diff_cancel convex_hull_singleton insert_absorb2 open_segment_def segment_convex_hull) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3053 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3054 | |
| 70136 | 3055 | subsection\<^marker>\<open>tag unimportant\<close>\<open>Similar results for closure and (relative or absolute) frontier\<close> | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3056 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3057 | lemma closure_convex_hull [simp]: | 
| 72238 | 3058 | fixes S :: "'a::euclidean_space set" | 
| 3059 | shows "compact S ==> closure(convex hull S) = convex hull S" | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3060 | by (simp add: compact_imp_closed compact_convex_hull) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3061 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3062 | lemma rel_frontier_convex_hull_explicit: | 
| 72238 | 3063 | fixes S :: "'a::euclidean_space set" | 
| 3064 | assumes "\<not> affine_dependent S" | |
| 3065 | shows "rel_frontier(convex hull S) = | |
| 3066 |          {y. \<exists>u. (\<forall>x \<in> S. 0 \<le> u x) \<and> (\<exists>x \<in> S. u x = 0) \<and> sum u S = 1 \<and> sum (\<lambda>x. u x *\<^sub>R x) S = y}"
 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3067 | proof - | 
| 72238 | 3068 | have fs: "finite S" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3069 | using assms by (simp add: aff_independent_finite) | 
| 72567 | 3070 | have "\<And>u y v. | 
| 3071 | \<lbrakk>y \<in> S; u y = 0; sum u S = 1; \<forall>x\<in>S. 0 < v x; | |
| 3072 | sum v S = 1; (\<Sum>x\<in>S. v x *\<^sub>R x) = (\<Sum>x\<in>S. u x *\<^sub>R x)\<rbrakk> | |
| 72238 | 3073 | \<Longrightarrow> \<exists>u. sum u S = 0 \<and> (\<exists>v\<in>S. u v \<noteq> 0) \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = 0" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3074 | apply (rule_tac x = "\<lambda>x. u x - v x" in exI) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3075 | apply (force simp: sum_subtractf scaleR_diff_left) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3076 | done | 
| 72238 | 3077 | then show ?thesis | 
| 3078 | using fs assms | |
| 3079 | apply (simp add: rel_frontier_def finite_imp_compact rel_interior_convex_hull_explicit) | |
| 3080 | apply (auto simp: convex_hull_finite) | |
| 72567 | 3081 | apply (metis less_eq_real_def) | 
| 3082 | by (simp add: affine_dependent_explicit_finite) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3083 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3084 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3085 | lemma frontier_convex_hull_explicit: | 
| 72238 | 3086 | fixes S :: "'a::euclidean_space set" | 
| 3087 | assumes "\<not> affine_dependent S" | |
| 3088 | shows "frontier(convex hull S) = | |
| 3089 |          {y. \<exists>u. (\<forall>x \<in> S. 0 \<le> u x) \<and> (DIM ('a) < card S \<longrightarrow> (\<exists>x \<in> S. u x = 0)) \<and>
 | |
| 3090 | sum u S = 1 \<and> sum (\<lambda>x. u x *\<^sub>R x) S = y}" | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3091 | proof - | 
| 72238 | 3092 | have fs: "finite S" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3093 | using assms by (simp add: aff_independent_finite) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3094 | show ?thesis | 
| 72238 | 3095 |   proof (cases "DIM ('a) < card S")
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3096 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3097 | with assms fs show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3098 | by (simp add: rel_frontier_def frontier_def rel_frontier_convex_hull_explicit [symmetric] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3099 | interior_convex_hull_explicit_minimal rel_interior_convex_hull_explicit) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3100 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3101 | case False | 
| 72238 | 3102 |     then have "card S \<le> DIM ('a)"
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3103 | by linarith | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3104 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3105 | using assms fs | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3106 | apply (simp add: frontier_def interior_convex_hull_explicit finite_imp_compact) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3107 | apply (simp add: convex_hull_finite) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3108 | done | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3109 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3110 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3111 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3112 | lemma rel_frontier_convex_hull_cases: | 
| 72238 | 3113 | fixes S :: "'a::euclidean_space set" | 
| 3114 | assumes "\<not> affine_dependent S" | |
| 3115 |   shows "rel_frontier(convex hull S) = \<Union>{convex hull (S - {x}) |x. x \<in> S}"
 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3116 | proof - | 
| 72238 | 3117 | have fs: "finite S" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3118 | using assms by (simp add: aff_independent_finite) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3119 |   { fix u a
 | 
| 72238 | 3120 | have "\<forall>x\<in>S. 0 \<le> u x \<Longrightarrow> a \<in> S \<Longrightarrow> u a = 0 \<Longrightarrow> sum u S = 1 \<Longrightarrow> | 
| 3121 | \<exists>x v. x \<in> S \<and> | |
| 3122 |                   (\<forall>x\<in>S - {x}. 0 \<le> v x) \<and>
 | |
| 3123 |                       sum v (S - {x}) = 1 \<and> (\<Sum>x\<in>S - {x}. v x *\<^sub>R x) = (\<Sum>x\<in>S. u x *\<^sub>R x)"
 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3124 | apply (rule_tac x=a in exI) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3125 | apply (rule_tac x=u in exI) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3126 | apply (simp add: Groups_Big.sum_diff1 fs) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3127 | done } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3128 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3129 |   { fix a u
 | 
| 72238 | 3130 |     have "a \<in> S \<Longrightarrow> \<forall>x\<in>S - {a}. 0 \<le> u x \<Longrightarrow> sum u (S - {a}) = 1 \<Longrightarrow>
 | 
| 3131 | \<exists>v. (\<forall>x\<in>S. 0 \<le> v x) \<and> | |
| 3132 |                  (\<exists>x\<in>S. v x = 0) \<and> sum v S = 1 \<and> (\<Sum>x\<in>S. v x *\<^sub>R x) = (\<Sum>x\<in>S - {a}. u x *\<^sub>R x)"
 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3133 | apply (rule_tac x="\<lambda>x. if x = a then 0 else u x" in exI) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3134 | apply (auto simp: sum.If_cases Diff_eq if_smult fs) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3135 | done } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3136 | ultimately show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3137 | using assms | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3138 | apply (simp add: rel_frontier_convex_hull_explicit) | 
| 72567 | 3139 | apply (auto simp add: convex_hull_finite fs Union_SetCompr_eq) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3140 | done | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3141 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3142 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3143 | lemma frontier_convex_hull_eq_rel_frontier: | 
| 72238 | 3144 | fixes S :: "'a::euclidean_space set" | 
| 3145 | assumes "\<not> affine_dependent S" | |
| 3146 | shows "frontier(convex hull S) = | |
| 3147 |            (if card S \<le> DIM ('a) then convex hull S else rel_frontier(convex hull S))"
 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3148 | using assms | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3149 | unfolding rel_frontier_def frontier_def | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3150 | by (simp add: affine_independent_span_gt rel_interior_interior | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3151 | finite_imp_compact empty_interior_convex_hull aff_independent_finite) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3152 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3153 | lemma frontier_convex_hull_cases: | 
| 72238 | 3154 | fixes S :: "'a::euclidean_space set" | 
| 3155 | assumes "\<not> affine_dependent S" | |
| 3156 | shows "frontier(convex hull S) = | |
| 3157 |            (if card S \<le> DIM ('a) then convex hull S else \<Union>{convex hull (S - {x}) |x. x \<in> S})"
 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3158 | by (simp add: assms frontier_convex_hull_eq_rel_frontier rel_frontier_convex_hull_cases) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3159 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3160 | lemma in_frontier_convex_hull: | 
| 72238 | 3161 | fixes S :: "'a::euclidean_space set" | 
| 3162 |   assumes "finite S" "card S \<le> Suc (DIM ('a))" "x \<in> S"
 | |
| 3163 | shows "x \<in> frontier(convex hull S)" | |
| 3164 | proof (cases "affine_dependent S") | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3165 | case True | 
| 72567 | 3166 |   with assms obtain y where "y \<in> S" and y: "y \<in> affine hull (S - {y})"
 | 
| 3167 | by (auto simp: affine_dependent_def) | |
| 3168 | moreover have "x \<in> closure (convex hull S)" | |
| 3169 | by (meson closure_subset hull_inc subset_eq \<open>x \<in> S\<close>) | |
| 3170 | moreover have "x \<notin> interior (convex hull S)" | |
| 3171 | using assms | |
| 3172 | by (metis Suc_mono affine_hull_convex_hull affine_hull_nonempty_interior \<open>y \<in> S\<close> y card.remove empty_iff empty_interior_affine_hull finite_Diff hull_redundant insert_Diff interior_UNIV not_less) | |
| 3173 | ultimately show ?thesis | |
| 3174 | unfolding frontier_def by blast | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3175 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3176 | case False | 
| 72238 | 3177 |   { assume "card S = Suc (card Basis)"
 | 
| 3178 | then have cs: "Suc 0 < card S" | |
| 71172 | 3179 | by (simp) | 
| 72238 | 3180 | with subset_singletonD have "\<exists>y \<in> S. y \<noteq> x" | 
| 3181 |       by (cases "S \<le> {x}") fastforce+
 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3182 | } note [dest!] = this | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3183 | show ?thesis using assms | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3184 | unfolding frontier_convex_hull_cases [OF False] Union_SetCompr_eq | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3185 | by (auto simp: le_Suc_eq hull_inc) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3186 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3187 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3188 | lemma not_in_interior_convex_hull: | 
| 72238 | 3189 | fixes S :: "'a::euclidean_space set" | 
| 3190 |   assumes "finite S" "card S \<le> Suc (DIM ('a))" "x \<in> S"
 | |
| 3191 | shows "x \<notin> interior(convex hull S)" | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3192 | using in_frontier_convex_hull [OF assms] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3193 | by (metis Diff_iff frontier_def) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3194 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3195 | lemma interior_convex_hull_eq_empty: | 
| 72238 | 3196 | fixes S :: "'a::euclidean_space set" | 
| 3197 |   assumes "card S = Suc (DIM ('a))"
 | |
| 3198 |   shows   "interior(convex hull S) = {} \<longleftrightarrow> affine_dependent S"
 | |
| 3199 | proof | |
| 3200 |   show "affine_dependent S \<Longrightarrow> interior (convex hull S) = {}"
 | |
| 3201 | proof (clarsimp simp: affine_dependent_def) | |
| 3202 | fix a b | |
| 3203 |     assume "b \<in> S" "b \<in> affine hull (S - {b})"
 | |
| 3204 |     then have "interior(affine hull S) = {}" using assms
 | |
| 72302 
d7d90ed4c74e
fixed some remarkably ugly proofs
 paulson <lp15@cam.ac.uk> parents: 
72238diff
changeset | 3205 | by (metis DIM_positive One_nat_def Suc_mono card.remove card.infinite empty_interior_affine_hull eq_iff hull_redundant insert_Diff not_less zero_le_one) | 
| 72238 | 3206 |     then show "interior (convex hull S) = {}" 
 | 
| 3207 | using affine_hull_nonempty_interior by fastforce | |
| 3208 | qed | |
| 3209 | next | |
| 3210 |   show "interior (convex hull S) = {} \<Longrightarrow> affine_dependent S"
 | |
| 3211 | by (metis affine_hull_convex_hull affine_hull_empty affine_independent_span_eq assms convex_convex_hull empty_not_UNIV rel_interior_eq_empty rel_interior_interior) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3212 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3213 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3214 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3215 | subsection \<open>Coplanarity, and collinearity in terms of affine hull\<close> | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3216 | |
| 70136 | 3217 | definition\<^marker>\<open>tag important\<close> coplanar where | 
| 72238 | 3218 |    "coplanar S \<equiv> \<exists>u v w. S \<subseteq> affine hull {u,v,w}"
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3219 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3220 | lemma collinear_affine_hull: | 
| 72238 | 3221 |   "collinear S \<longleftrightarrow> (\<exists>u v. S \<subseteq> affine hull {u,v})"
 | 
| 3222 | proof (cases "S={}")
 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3223 | case True then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3224 | by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3225 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3226 | case False | 
| 72238 | 3227 | then obtain x where x: "x \<in> S" by auto | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3228 |   { fix u
 | 
| 72238 | 3229 | assume *: "\<And>x y. \<lbrakk>x\<in>S; y\<in>S\<rbrakk> \<Longrightarrow> \<exists>c. x - y = c *\<^sub>R u" | 
| 3230 | have "\<And>y c. x - y = c *\<^sub>R u \<Longrightarrow> \<exists>a b. y = a *\<^sub>R x + b *\<^sub>R (x + u) \<and> a + b = 1" | |
| 3231 | by (rule_tac x="1+c" in exI, rule_tac x="-c" in exI, simp add: algebra_simps) | |
| 3232 |     then have "\<exists>u v. S \<subseteq> {a *\<^sub>R u + b *\<^sub>R v |a b. a + b = 1}"
 | |
| 3233 | using * [OF x] by (rule_tac x=x in exI, rule_tac x="x+u" in exI, force) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3234 | } moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3235 |   { fix u v x y
 | 
| 72238 | 3236 |     assume *: "S \<subseteq> {a *\<^sub>R u + b *\<^sub>R v |a b. a + b = 1}"
 | 
| 3237 | have "\<exists>c. x - y = c *\<^sub>R (v-u)" if "x\<in>S" "y\<in>S" | |
| 3238 | proof - | |
| 3239 | obtain a r where "a + r = 1" "x = a *\<^sub>R u + r *\<^sub>R v" | |
| 3240 | using "*" \<open>x \<in> S\<close> by blast | |
| 3241 | moreover | |
| 3242 | obtain b s where "b + s = 1" "y = b *\<^sub>R u + s *\<^sub>R v" | |
| 3243 | using "*" \<open>y \<in> S\<close> by blast | |
| 3244 | ultimately have "x - y = (r-s) *\<^sub>R (v-u)" | |
| 3245 | by (simp add: algebra_simps) (metis scaleR_left.add) | |
| 3246 | then show ?thesis | |
| 3247 | by blast | |
| 3248 | qed | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3249 | } ultimately | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3250 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3251 | unfolding collinear_def affine_hull_2 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3252 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3253 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3254 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3255 | lemma collinear_closed_segment [simp]: "collinear (closed_segment a b)" | 
| 72238 | 3256 | by (metis affine_hull_convex_hull collinear_affine_hull hull_subset segment_convex_hull) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3257 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3258 | lemma collinear_open_segment [simp]: "collinear (open_segment a b)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3259 | unfolding open_segment_def | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3260 | by (metis convex_hull_subset_affine_hull segment_convex_hull dual_order.trans | 
| 72238 | 3261 | convex_hull_subset_affine_hull Diff_subset collinear_affine_hull) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3262 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3263 | lemma collinear_between_cases: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3264 | fixes c :: "'a::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3265 |   shows "collinear {a,b,c} \<longleftrightarrow> between (b,c) a \<or> between (c,a) b \<or> between (a,b) c"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3266 | (is "?lhs = ?rhs") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3267 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3268 | assume ?lhs | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3269 |   then obtain u v where uv: "\<And>x. x \<in> {a, b, c} \<Longrightarrow> \<exists>c. x = u + c *\<^sub>R v"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3270 | by (auto simp: collinear_alt) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3271 | show ?rhs | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3272 | using uv [of a] uv [of b] uv [of c] by (auto simp: between_1) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3273 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3274 | assume ?rhs | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3275 | then show ?lhs | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3276 | unfolding between_mem_convex_hull | 
| 73932 
fd21b4a93043
added opaque_combs and renamed hide_lams to opaque_lifting
 desharna parents: 
72569diff
changeset | 3277 | by (metis (no_types, opaque_lifting) collinear_closed_segment collinear_subset hull_redundant hull_subset insert_commute segment_convex_hull) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3278 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3279 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3280 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3281 | lemma subset_continuous_image_segment_1: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3282 | fixes f :: "'a::euclidean_space \<Rightarrow> real" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3283 | assumes "continuous_on (closed_segment a b) f" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3284 | shows "closed_segment (f a) (f b) \<subseteq> image f (closed_segment a b)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3285 | by (metis connected_segment convex_contains_segment ends_in_segment imageI | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3286 | is_interval_connected_1 is_interval_convex connected_continuous_image [OF assms]) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3287 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3288 | lemma continuous_injective_image_segment_1: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3289 | fixes f :: "'a::euclidean_space \<Rightarrow> real" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3290 | assumes contf: "continuous_on (closed_segment a b) f" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3291 | and injf: "inj_on f (closed_segment a b)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3292 | shows "f ` (closed_segment a b) = closed_segment (f a) (f b)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3293 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3294 | show "closed_segment (f a) (f b) \<subseteq> f ` closed_segment a b" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3295 | by (metis subset_continuous_image_segment_1 contf) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3296 | show "f ` closed_segment a b \<subseteq> closed_segment (f a) (f b)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3297 | proof (cases "a = b") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3298 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3299 | then show ?thesis by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3300 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3301 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3302 | then have fnot: "f a \<noteq> f b" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3303 | using inj_onD injf by fastforce | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3304 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3305 | have "f a \<notin> open_segment (f c) (f b)" if c: "c \<in> closed_segment a b" for c | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3306 | proof (clarsimp simp add: open_segment_def) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3307 | assume fa: "f a \<in> closed_segment (f c) (f b)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3308 | moreover have "closed_segment (f c) (f b) \<subseteq> f ` closed_segment c b" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3309 | by (meson closed_segment_subset contf continuous_on_subset convex_closed_segment ends_in_segment(2) subset_continuous_image_segment_1 that) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3310 | ultimately have "f a \<in> f ` closed_segment c b" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3311 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3312 | then have a: "a \<in> closed_segment c b" | 
| 71857 
d73955442df5
a few new lemmas about functions
 paulson <lp15@cam.ac.uk> parents: 
71633diff
changeset | 3313 | by (meson ends_in_segment inj_on_image_mem_iff injf subset_closed_segment that) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3314 | have cb: "closed_segment c b \<subseteq> closed_segment a b" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3315 | by (simp add: closed_segment_subset that) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3316 | show "f a = f c" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3317 | proof (rule between_antisym) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3318 | show "between (f c, f b) (f a)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3319 | by (simp add: between_mem_segment fa) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3320 | show "between (f a, f b) (f c)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3321 | by (metis a cb between_antisym between_mem_segment between_triv1 subset_iff) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3322 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3323 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3324 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3325 | have "f b \<notin> open_segment (f a) (f c)" if c: "c \<in> closed_segment a b" for c | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3326 | proof (clarsimp simp add: open_segment_def fnot eq_commute) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3327 | assume fb: "f b \<in> closed_segment (f a) (f c)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3328 | moreover have "closed_segment (f a) (f c) \<subseteq> f ` closed_segment a c" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3329 | by (meson contf continuous_on_subset ends_in_segment(1) subset_closed_segment subset_continuous_image_segment_1 that) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3330 | ultimately have "f b \<in> f ` closed_segment a c" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3331 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3332 | then have b: "b \<in> closed_segment a c" | 
| 71857 
d73955442df5
a few new lemmas about functions
 paulson <lp15@cam.ac.uk> parents: 
71633diff
changeset | 3333 | by (meson ends_in_segment inj_on_image_mem_iff injf subset_closed_segment that) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3334 | have ca: "closed_segment a c \<subseteq> closed_segment a b" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3335 | by (simp add: closed_segment_subset that) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3336 | show "f b = f c" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3337 | proof (rule between_antisym) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3338 | show "between (f c, f a) (f b)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3339 | by (simp add: between_commute between_mem_segment fb) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3340 | show "between (f b, f a) (f c)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3341 | by (metis b between_antisym between_commute between_mem_segment between_triv2 that) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3342 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3343 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3344 | ultimately show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3345 | by (force simp: closed_segment_eq_real_ivl open_segment_eq_real_ivl split: if_split_asm) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3346 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3347 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3348 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3349 | lemma continuous_injective_image_open_segment_1: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3350 | fixes f :: "'a::euclidean_space \<Rightarrow> real" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3351 | assumes contf: "continuous_on (closed_segment a b) f" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3352 | and injf: "inj_on f (closed_segment a b)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3353 | shows "f ` (open_segment a b) = open_segment (f a) (f b)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3354 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3355 |   have "f ` (open_segment a b) = f ` (closed_segment a b) - {f a, f b}"
 | 
| 73932 
fd21b4a93043
added opaque_combs and renamed hide_lams to opaque_lifting
 desharna parents: 
72569diff
changeset | 3356 | by (metis (no_types, opaque_lifting) empty_subsetI ends_in_segment image_insert image_is_empty inj_on_image_set_diff injf insert_subset open_segment_def segment_open_subset_closed) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3357 | also have "... = open_segment (f a) (f b)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3358 | using continuous_injective_image_segment_1 [OF assms] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3359 | by (simp add: open_segment_def inj_on_image_set_diff [OF injf]) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3360 | finally show ?thesis . | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3361 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3362 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3363 | lemma collinear_imp_coplanar: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3364 | "collinear s ==> coplanar s" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3365 | by (metis collinear_affine_hull coplanar_def insert_absorb2) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3366 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3367 | lemma collinear_small: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3368 | assumes "finite s" "card s \<le> 2" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3369 | shows "collinear s" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3370 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3371 | have "card s = 0 \<or> card s = 1 \<or> card s = 2" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3372 | using assms by linarith | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3373 | then show ?thesis using assms | 
| 71258 
d67924987c34
a few new and tidier proofs (mostly about finite sets)
 paulson <lp15@cam.ac.uk> parents: 
71244diff
changeset | 3374 | using card_eq_SucD numeral_2_eq_2 by (force simp: card_1_singleton_iff) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3375 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3376 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3377 | lemma coplanar_small: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3378 | assumes "finite s" "card s \<le> 3" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3379 | shows "coplanar s" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3380 | proof - | 
| 71258 
d67924987c34
a few new and tidier proofs (mostly about finite sets)
 paulson <lp15@cam.ac.uk> parents: 
71244diff
changeset | 3381 | consider "card s \<le> 2" | "card s = Suc (Suc (Suc 0))" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3382 | using assms by linarith | 
| 71258 
d67924987c34
a few new and tidier proofs (mostly about finite sets)
 paulson <lp15@cam.ac.uk> parents: 
71244diff
changeset | 3383 | then show ?thesis | 
| 
d67924987c34
a few new and tidier proofs (mostly about finite sets)
 paulson <lp15@cam.ac.uk> parents: 
71244diff
changeset | 3384 | proof cases | 
| 
d67924987c34
a few new and tidier proofs (mostly about finite sets)
 paulson <lp15@cam.ac.uk> parents: 
71244diff
changeset | 3385 | case 1 | 
| 
d67924987c34
a few new and tidier proofs (mostly about finite sets)
 paulson <lp15@cam.ac.uk> parents: 
71244diff
changeset | 3386 | then show ?thesis | 
| 
d67924987c34
a few new and tidier proofs (mostly about finite sets)
 paulson <lp15@cam.ac.uk> parents: 
71244diff
changeset | 3387 | by (simp add: \<open>finite s\<close> collinear_imp_coplanar collinear_small) | 
| 
d67924987c34
a few new and tidier proofs (mostly about finite sets)
 paulson <lp15@cam.ac.uk> parents: 
71244diff
changeset | 3388 | next | 
| 
d67924987c34
a few new and tidier proofs (mostly about finite sets)
 paulson <lp15@cam.ac.uk> parents: 
71244diff
changeset | 3389 | case 2 | 
| 
d67924987c34
a few new and tidier proofs (mostly about finite sets)
 paulson <lp15@cam.ac.uk> parents: 
71244diff
changeset | 3390 | then show ?thesis | 
| 
d67924987c34
a few new and tidier proofs (mostly about finite sets)
 paulson <lp15@cam.ac.uk> parents: 
71244diff
changeset | 3391 |       using hull_subset [of "{_,_,_}"]
 | 
| 
d67924987c34
a few new and tidier proofs (mostly about finite sets)
 paulson <lp15@cam.ac.uk> parents: 
71244diff
changeset | 3392 | by (fastforce simp: coplanar_def dest!: card_eq_SucD) | 
| 
d67924987c34
a few new and tidier proofs (mostly about finite sets)
 paulson <lp15@cam.ac.uk> parents: 
71244diff
changeset | 3393 | qed | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3394 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3395 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3396 | lemma coplanar_empty: "coplanar {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3397 | by (simp add: coplanar_small) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3398 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3399 | lemma coplanar_sing: "coplanar {a}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3400 | by (simp add: coplanar_small) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3401 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3402 | lemma coplanar_2: "coplanar {a,b}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3403 | by (auto simp: card_insert_if coplanar_small) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3404 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3405 | lemma coplanar_3: "coplanar {a,b,c}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3406 | by (auto simp: card_insert_if coplanar_small) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3407 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3408 | lemma collinear_affine_hull_collinear: "collinear(affine hull s) \<longleftrightarrow> collinear s" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3409 | unfolding collinear_affine_hull | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3410 | by (metis affine_affine_hull subset_hull hull_hull hull_mono) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3411 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3412 | lemma coplanar_affine_hull_coplanar: "coplanar(affine hull s) \<longleftrightarrow> coplanar s" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3413 | unfolding coplanar_def | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3414 | by (metis affine_affine_hull subset_hull hull_hull hull_mono) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3415 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3416 | lemma coplanar_linear_image: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3417 | fixes f :: "'a::euclidean_space \<Rightarrow> 'b::real_normed_vector" | 
| 72567 | 3418 | assumes "coplanar S" "linear f" shows "coplanar(f ` S)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3419 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3420 |   { fix u v w
 | 
| 72567 | 3421 |     assume "S \<subseteq> affine hull {u, v, w}"
 | 
| 3422 |     then have "f ` S \<subseteq> f ` (affine hull {u, v, w})"
 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3423 | by (simp add: image_mono) | 
| 72567 | 3424 |     then have "f ` S \<subseteq> affine hull (f ` {u, v, w})"
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3425 | by (metis assms(2) linear_conv_bounded_linear affine_hull_linear_image) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3426 | } then | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3427 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3428 | by auto (meson assms(1) coplanar_def) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3429 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3430 | |
| 72567 | 3431 | lemma coplanar_translation_imp: | 
| 3432 | assumes "coplanar S" shows "coplanar ((\<lambda>x. a + x) ` S)" | |
| 3433 | proof - | |
| 3434 |   obtain u v w where "S \<subseteq> affine hull {u,v,w}"
 | |
| 3435 | by (meson assms coplanar_def) | |
| 3436 |   then have "(+) a ` S \<subseteq> affine hull {u + a, v + a, w + a}"
 | |
| 3437 |     using affine_hull_translation [of a "{u,v,w}" for u v w]
 | |
| 3438 | by (force simp: add.commute) | |
| 3439 | then show ?thesis | |
| 3440 | unfolding coplanar_def by blast | |
| 3441 | qed | |
| 3442 | ||
| 3443 | lemma coplanar_translation_eq: "coplanar((\<lambda>x. a + x) ` S) \<longleftrightarrow> coplanar S" | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3444 | by (metis (no_types) coplanar_translation_imp translation_galois) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3445 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3446 | lemma coplanar_linear_image_eq: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3447 | fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" | 
| 72567 | 3448 | assumes "linear f" "inj f" shows "coplanar(f ` S) = coplanar S" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3449 | proof | 
| 72567 | 3450 | assume "coplanar S" | 
| 3451 | then show "coplanar (f ` S)" | |
| 3452 | using assms(1) coplanar_linear_image by blast | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3453 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3454 | obtain g where g: "linear g" "g \<circ> f = id" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3455 | using linear_injective_left_inverse [OF assms] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3456 | by blast | 
| 72567 | 3457 | assume "coplanar (f ` S)" | 
| 3458 | then show "coplanar S" | |
| 3459 | by (metis coplanar_linear_image g(1) g(2) id_apply image_comp image_id) | |
| 3460 | qed | |
| 3461 | ||
| 3462 | lemma coplanar_subset: "\<lbrakk>coplanar t; S \<subseteq> t\<rbrakk> \<Longrightarrow> coplanar S" | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3463 | by (meson coplanar_def order_trans) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3464 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3465 | lemma affine_hull_3_imp_collinear: "c \<in> affine hull {a,b} \<Longrightarrow> collinear {a,b,c}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3466 | by (metis collinear_2 collinear_affine_hull_collinear hull_redundant insert_commute) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3467 | |
| 72238 | 3468 | lemma collinear_3_imp_in_affine_hull: | 
| 3469 |   assumes "collinear {a,b,c}" "a \<noteq> b" shows "c \<in> affine hull {a,b}"
 | |
| 3470 | proof - | |
| 3471 | obtain u x y where "b - a = y *\<^sub>R u" "c - a = x *\<^sub>R u" | |
| 3472 | using assms unfolding collinear_def by auto | |
| 72567 | 3473 | with \<open>a \<noteq> b\<close> have "\<exists>v. c = (1 - x / y) *\<^sub>R a + v *\<^sub>R b \<and> 1 - x / y + v = 1" | 
| 3474 | by (simp add: algebra_simps) | |
| 3475 | then show ?thesis | |
| 3476 | by (simp add: hull_inc mem_affine) | |
| 72238 | 3477 | qed | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3478 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3479 | lemma collinear_3_affine_hull: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3480 | assumes "a \<noteq> b" | 
| 72238 | 3481 |   shows "collinear {a,b,c} \<longleftrightarrow> c \<in> affine hull {a,b}"
 | 
| 3482 | using affine_hull_3_imp_collinear assms collinear_3_imp_in_affine_hull by blast | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3483 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3484 | lemma collinear_3_eq_affine_dependent: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3485 |   "collinear{a,b,c} \<longleftrightarrow> a = b \<or> a = c \<or> b = c \<or> affine_dependent {a,b,c}"
 | 
| 72238 | 3486 | proof (cases "a = b \<or> a = c \<or> b = c") | 
| 3487 | case True | |
| 3488 | then show ?thesis | |
| 3489 | by (auto simp: insert_commute) | |
| 3490 | next | |
| 3491 | case False | |
| 72567 | 3492 |   then have "collinear{a,b,c}" if "affine_dependent {a,b,c}"
 | 
| 3493 | using that unfolding affine_dependent_def | |
| 3494 | by (auto simp: insert_Diff_if; metis affine_hull_3_imp_collinear insert_commute) | |
| 3495 | moreover | |
| 3496 |   have "affine_dependent {a,b,c}" if "collinear{a,b,c}"
 | |
| 3497 | using False that by (auto simp: affine_dependent_def collinear_3_affine_hull insert_Diff_if) | |
| 3498 | ultimately | |
| 3499 | show ?thesis | |
| 3500 | using False by blast | |
| 72238 | 3501 | qed | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3502 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3503 | lemma affine_dependent_imp_collinear_3: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3504 |   "affine_dependent {a,b,c} \<Longrightarrow> collinear{a,b,c}"
 | 
| 72238 | 3505 | by (simp add: collinear_3_eq_affine_dependent) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3506 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3507 | lemma collinear_3: "NO_MATCH 0 x \<Longrightarrow> collinear {x,y,z} \<longleftrightarrow> collinear {0, x-y, z-y}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3508 | by (auto simp add: collinear_def) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3509 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3510 | lemma collinear_3_expand: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3511 |    "collinear{a,b,c} \<longleftrightarrow> a = c \<or> (\<exists>u. b = u *\<^sub>R a + (1 - u) *\<^sub>R c)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3512 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3513 |   have "collinear{a,b,c} = collinear{a,c,b}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3514 | by (simp add: insert_commute) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3515 |   also have "... = collinear {0, a - c, b - c}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3516 | by (simp add: collinear_3) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3517 | also have "... \<longleftrightarrow> (a = c \<or> b = c \<or> (\<exists>ca. b - c = ca *\<^sub>R (a - c)))" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3518 | by (simp add: collinear_lemma) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3519 | also have "... \<longleftrightarrow> a = c \<or> (\<exists>u. b = u *\<^sub>R a + (1 - u) *\<^sub>R c)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3520 | by (cases "a = c \<or> b = c") (auto simp: algebra_simps) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3521 | finally show ?thesis . | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3522 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3523 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3524 | lemma collinear_aff_dim: "collinear S \<longleftrightarrow> aff_dim S \<le> 1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3525 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3526 | assume "collinear S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3527 |   then obtain u and v :: "'a" where "aff_dim S \<le> aff_dim {u,v}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3528 | by (metis \<open>collinear S\<close> aff_dim_affine_hull aff_dim_subset collinear_affine_hull) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3529 | then show "aff_dim S \<le> 1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3530 | using order_trans by fastforce | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3531 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3532 | assume "aff_dim S \<le> 1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3533 | then have le1: "aff_dim (affine hull S) \<le> 1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3534 | by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3535 | obtain B where "B \<subseteq> S" and B: "\<not> affine_dependent B" "affine hull S = affine hull B" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3536 | using affine_basis_exists [of S] by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3537 | then have "finite B" "card B \<le> 2" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3538 | using B le1 by (auto simp: affine_independent_iff_card) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3539 | then have "collinear B" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3540 | by (rule collinear_small) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3541 | then show "collinear S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3542 | by (metis \<open>affine hull S = affine hull B\<close> collinear_affine_hull_collinear) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3543 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3544 | |
| 72567 | 3545 | lemma collinear_midpoint: "collinear{a, midpoint a b, b}"
 | 
| 3546 | proof - | |
| 3547 | have \<section>: "\<lbrakk>a \<noteq> midpoint a b; b - midpoint a b \<noteq> - 1 *\<^sub>R (a - midpoint a b)\<rbrakk> \<Longrightarrow> b = midpoint a b" | |
| 3548 | by (simp add: algebra_simps) | |
| 3549 | show ?thesis | |
| 3550 | by (auto simp: collinear_3 collinear_lemma intro: \<section>) | |
| 3551 | qed | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3552 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3553 | lemma midpoint_collinear: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3554 | fixes a b c :: "'a::real_normed_vector" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3555 | assumes "a \<noteq> c" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3556 |     shows "b = midpoint a c \<longleftrightarrow> collinear{a,b,c} \<and> dist a b = dist b c"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3557 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3558 | have *: "a - (u *\<^sub>R a + (1 - u) *\<^sub>R c) = (1 - u) *\<^sub>R (a - c)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3559 | "u *\<^sub>R a + (1 - u) *\<^sub>R c - c = u *\<^sub>R (a - c)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3560 | "\<bar>1 - u\<bar> = \<bar>u\<bar> \<longleftrightarrow> u = 1/2" for u::real | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3561 | by (auto simp: algebra_simps) | 
| 72567 | 3562 |   have "b = midpoint a c \<Longrightarrow> collinear{a,b,c}"
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3563 | using collinear_midpoint by blast | 
| 72567 | 3564 |   moreover have "b = midpoint a c \<longleftrightarrow> dist a b = dist b c" if "collinear{a,b,c}"
 | 
| 3565 | proof - | |
| 3566 | consider "a = c" | u where "b = u *\<^sub>R a + (1 - u) *\<^sub>R c" | |
| 3567 |       using \<open>collinear {a,b,c}\<close> unfolding collinear_3_expand by blast
 | |
| 3568 | then show ?thesis | |
| 3569 | proof cases | |
| 3570 | case 2 | |
| 3571 | with assms have "dist a b = dist b c \<Longrightarrow> b = midpoint a c" | |
| 3572 | by (simp add: dist_norm * midpoint_def scaleR_add_right del: divide_const_simps) | |
| 3573 | then show ?thesis | |
| 3574 | by (auto simp: dist_midpoint) | |
| 3575 | qed (use assms in auto) | |
| 3576 | qed | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3577 | ultimately show ?thesis by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3578 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3579 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3580 | lemma between_imp_collinear: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3581 | fixes x :: "'a :: euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3582 | assumes "between (a,b) x" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3583 |     shows "collinear {a,x,b}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3584 | proof (cases "x = a \<or> x = b \<or> a = b") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3585 | case True with assms show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3586 | by (auto simp: dist_commute) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3587 | next | 
| 72567 | 3588 | case False | 
| 3589 | then have False if "\<And>c. b - x \<noteq> c *\<^sub>R (a - x)" | |
| 3590 | using that [of "-(norm(b - x) / norm(x - a))"] assms | |
| 3591 | by (simp add: between_norm vector_add_divide_simps flip: real_vector.scale_minus_right) | |
| 3592 | then show ?thesis | |
| 3593 | by (auto simp: collinear_3 collinear_lemma) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3594 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3595 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3596 | lemma midpoint_between: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3597 | fixes a b :: "'a::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3598 | shows "b = midpoint a c \<longleftrightarrow> between (a,c) b \<and> dist a b = dist b c" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3599 | proof (cases "a = c") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3600 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3601 | show ?thesis | 
| 72238 | 3602 | using False between_imp_collinear between_midpoint(1) midpoint_collinear by blast | 
| 72567 | 3603 | qed (auto simp: dist_commute) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3604 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3605 | lemma collinear_triples: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3606 | assumes "a \<noteq> b" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3607 |     shows "collinear(insert a (insert b S)) \<longleftrightarrow> (\<forall>x \<in> S. collinear{a,b,x})"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3608 | (is "?lhs = ?rhs") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3609 | proof safe | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3610 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3611 | assume ?lhs and "x \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3612 |   then show "collinear {a, b, x}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3613 | using collinear_subset by force | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3614 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3615 | assume ?rhs | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3616 |   then have "\<forall>x \<in> S. collinear{a,x,b}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3617 | by (simp add: insert_commute) | 
| 72567 | 3618 | then have *: "\<exists>u. x = u *\<^sub>R a + (1 - u) *\<^sub>R b" if "x \<in> insert a (insert b S)" for x | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3619 | using that assms collinear_3_expand by fastforce+ | 
| 72567 | 3620 | have "\<exists>c. x - y = c *\<^sub>R (b - a)" | 
| 3621 | if x: "x \<in> insert a (insert b S)" and y: "y \<in> insert a (insert b S)" for x y | |
| 3622 | proof - | |
| 3623 | obtain u v where "x = u *\<^sub>R a + (1 - u) *\<^sub>R b" "y = v *\<^sub>R a + (1 - v) *\<^sub>R b" | |
| 3624 | using "*" x y by presburger | |
| 3625 | then have "x - y = (v - u) *\<^sub>R (b - a)" | |
| 3626 | by (simp add: scale_left_diff_distrib scale_right_diff_distrib) | |
| 3627 | then show ?thesis .. | |
| 3628 | qed | |
| 3629 | then show ?lhs | |
| 3630 | unfolding collinear_def by metis | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3631 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3632 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3633 | lemma collinear_4_3: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3634 | assumes "a \<noteq> b" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3635 |     shows "collinear {a,b,c,d} \<longleftrightarrow> collinear{a,b,c} \<and> collinear{a,b,d}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3636 |   using collinear_triples [OF assms, of "{c,d}"] by (force simp:)
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3637 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3638 | lemma collinear_3_trans: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3639 |   assumes "collinear{a,b,c}" "collinear{b,c,d}" "b \<noteq> c"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3640 |     shows "collinear{a,b,d}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3641 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3642 |   have "collinear{b,c,a,d}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3643 | by (metis (full_types) assms collinear_4_3 insert_commute) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3644 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3645 | by (simp add: collinear_subset) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3646 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3647 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3648 | lemma affine_hull_2_alt: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3649 | fixes a b :: "'a::real_vector" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3650 |   shows "affine hull {a,b} = range (\<lambda>u. a + u *\<^sub>R (b - a))"
 | 
| 72567 | 3651 | proof - | 
| 3652 | have 1: "u *\<^sub>R a + v *\<^sub>R b = a + v *\<^sub>R (b - a)" if "u + v = 1" for u v | |
| 3653 | using that | |
| 3654 | by (simp add: algebra_simps flip: scaleR_add_left) | |
| 3655 | have 2: "a + u *\<^sub>R (b - a) = (1 - u) *\<^sub>R a + u *\<^sub>R b" for u | |
| 3656 | by (auto simp: algebra_simps) | |
| 3657 | show ?thesis | |
| 3658 | by (force simp add: affine_hull_2 dest: 1 intro!: 2) | |
| 3659 | qed | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3660 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3661 | lemma interior_convex_hull_3_minimal: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3662 | fixes a :: "'a::euclidean_space" | 
| 72567 | 3663 |   assumes "\<not> collinear{a,b,c}" and 2: "DIM('a) = 2"
 | 
| 3664 |   shows "interior(convex hull {a,b,c}) =
 | |
| 3665 |          {v. \<exists>x y z. 0 < x \<and> 0 < y \<and> 0 < z \<and> x + y + z = 1 \<and> x *\<^sub>R a + y *\<^sub>R b + z *\<^sub>R c = v}"
 | |
| 3666 | (is "?lhs = ?rhs") | |
| 3667 | proof | |
| 3668 |   have abc: "a \<noteq> b" "a \<noteq> c" "b \<noteq> c" "\<not> affine_dependent {a, b, c}"
 | |
| 3669 | using assms by (auto simp: collinear_3_eq_affine_dependent) | |
| 3670 | with 2 show "?lhs \<subseteq> ?rhs" | |
| 3671 | by (fastforce simp add: interior_convex_hull_explicit_minimal) | |
| 3672 | show "?rhs \<subseteq> ?lhs" | |
| 3673 | using abc 2 | |
| 3674 | apply (clarsimp simp add: interior_convex_hull_explicit_minimal) | |
| 3675 | subgoal for x y z | |
| 3676 | by (rule_tac x="\<lambda>r. (if r=a then x else if r=b then y else if r=c then z else 0)" in exI) auto | |
| 3677 | done | |
| 3678 | qed | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3679 | |
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66793diff
changeset | 3680 | |
| 70136 | 3681 | subsection\<^marker>\<open>tag unimportant\<close>\<open>Basic lemmas about hyperplanes and halfspaces\<close> | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3682 | |
| 69516 
09bb8f470959
most of Topology_Euclidean_Space (now Elementary_Topology) requires fewer dependencies
 immler parents: 
69508diff
changeset | 3683 | lemma halfspace_Int_eq: | 
| 
09bb8f470959
most of Topology_Euclidean_Space (now Elementary_Topology) requires fewer dependencies
 immler parents: 
69508diff
changeset | 3684 |      "{x. a \<bullet> x \<le> b} \<inter> {x. b \<le> a \<bullet> x} = {x. a \<bullet> x = b}"
 | 
| 
09bb8f470959
most of Topology_Euclidean_Space (now Elementary_Topology) requires fewer dependencies
 immler parents: 
69508diff
changeset | 3685 |      "{x. b \<le> a \<bullet> x} \<inter> {x. a \<bullet> x \<le> b} = {x. a \<bullet> x = b}"
 | 
| 
09bb8f470959
most of Topology_Euclidean_Space (now Elementary_Topology) requires fewer dependencies
 immler parents: 
69508diff
changeset | 3686 | by auto | 
| 
09bb8f470959
most of Topology_Euclidean_Space (now Elementary_Topology) requires fewer dependencies
 immler parents: 
69508diff
changeset | 3687 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3688 | lemma hyperplane_eq_Ex: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3689 | assumes "a \<noteq> 0" obtains x where "a \<bullet> x = b" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3690 | by (rule_tac x = "(b / (a \<bullet> a)) *\<^sub>R a" in that) (simp add: assms) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3691 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3692 | lemma hyperplane_eq_empty: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3693 |      "{x. a \<bullet> x = b} = {} \<longleftrightarrow> a = 0 \<and> b \<noteq> 0"
 | 
| 72238 | 3694 | using hyperplane_eq_Ex | 
| 3695 | by (metis (mono_tags, lifting) empty_Collect_eq inner_zero_left) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3696 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3697 | lemma hyperplane_eq_UNIV: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3698 |    "{x. a \<bullet> x = b} = UNIV \<longleftrightarrow> a = 0 \<and> b = 0"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3699 | proof - | 
| 72238 | 3700 |   have "a = 0 \<and> b = 0" if "UNIV \<subseteq> {x. a \<bullet> x = b}"
 | 
| 3701 | using subsetD [OF that, where c = "((b+1) / (a \<bullet> a)) *\<^sub>R a"] | |
| 3702 | by (simp add: field_split_simps split: if_split_asm) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3703 | then show ?thesis by force | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3704 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3705 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3706 | lemma halfspace_eq_empty_lt: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3707 |    "{x. a \<bullet> x < b} = {} \<longleftrightarrow> a = 0 \<and> b \<le> 0"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3708 | proof - | 
| 72238 | 3709 |   have "a = 0 \<and> b \<le> 0" if "{x. a \<bullet> x < b} \<subseteq> {}"
 | 
| 3710 | using subsetD [OF that, where c = "((b-1) / (a \<bullet> a)) *\<^sub>R a"] | |
| 3711 | by (force simp add: field_split_simps split: if_split_asm) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3712 | then show ?thesis by force | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3713 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3714 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3715 | lemma halfspace_eq_empty_gt: | 
| 72238 | 3716 |   "{x. a \<bullet> x > b} = {} \<longleftrightarrow> a = 0 \<and> b \<ge> 0"
 | 
| 3717 | using halfspace_eq_empty_lt [of "-a" "-b"] | |
| 3718 | by simp | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3719 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3720 | lemma halfspace_eq_empty_le: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3721 |    "{x. a \<bullet> x \<le> b} = {} \<longleftrightarrow> a = 0 \<and> b < 0"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3722 | proof - | 
| 72238 | 3723 |   have "a = 0 \<and> b < 0" if "{x. a \<bullet> x \<le> b} \<subseteq> {}"
 | 
| 3724 | using subsetD [OF that, where c = "((b-1) / (a \<bullet> a)) *\<^sub>R a"] | |
| 3725 | by (force simp add: field_split_simps split: if_split_asm) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3726 | then show ?thesis by force | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3727 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3728 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3729 | lemma halfspace_eq_empty_ge: | 
| 72238 | 3730 |   "{x. a \<bullet> x \<ge> b} = {} \<longleftrightarrow> a = 0 \<and> b > 0"
 | 
| 3731 | using halfspace_eq_empty_le [of "-a" "-b"] by simp | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3732 | |
| 70136 | 3733 | subsection\<^marker>\<open>tag unimportant\<close>\<open>Use set distance for an easy proof of separation properties\<close> | 
| 3734 | ||
| 3735 | proposition\<^marker>\<open>tag unimportant\<close> separation_closures: | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3736 | fixes S :: "'a::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3737 |   assumes "S \<inter> closure T = {}" "T \<inter> closure S = {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3738 |   obtains U V where "U \<inter> V = {}" "open U" "open V" "S \<subseteq> U" "T \<subseteq> V"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3739 | proof (cases "S = {} \<or> T = {}")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3740 | case True with that show ?thesis by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3741 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3742 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3743 |   define f where "f \<equiv> \<lambda>x. setdist {x} T - setdist {x} S"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3744 | have contf: "continuous_on UNIV f" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3745 | unfolding f_def by (intro continuous_intros continuous_on_setdist) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3746 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3747 |   proof (rule_tac U = "{x. f x > 0}" and V = "{x. f x < 0}" in that)
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3748 |     show "{x. 0 < f x} \<inter> {x. f x < 0} = {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3749 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3750 |     show "open {x. 0 < f x}"
 | 
| 71172 | 3751 | by (simp add: open_Collect_less contf) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3752 |     show "open {x. f x < 0}"
 | 
| 71172 | 3753 | by (simp add: open_Collect_less contf) | 
| 72238 | 3754 |     have "\<And>x. x \<in> S \<Longrightarrow> setdist {x} T \<noteq> 0" "\<And>x. x \<in> T \<Longrightarrow> setdist {x} S \<noteq> 0"
 | 
| 3755 | by (meson False assms disjoint_iff setdist_eq_0_sing_1)+ | |
| 3756 |     then show "S \<subseteq> {x. 0 < f x}" "T \<subseteq> {x. f x < 0}"
 | |
| 3757 | using less_eq_real_def by (fastforce simp add: f_def setdist_sing_in_set)+ | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3758 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3759 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3760 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3761 | lemma separation_normal: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3762 | fixes S :: "'a::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3763 |   assumes "closed S" "closed T" "S \<inter> T = {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3764 |   obtains U V where "open U" "open V" "S \<subseteq> U" "T \<subseteq> V" "U \<inter> V = {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3765 | using separation_closures [of S T] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3766 | by (metis assms closure_closed disjnt_def inf_commute) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3767 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3768 | lemma separation_normal_local: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3769 | fixes S :: "'a::euclidean_space set" | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 3770 | assumes US: "closedin (top_of_set U) S" | 
| 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 3771 | and UT: "closedin (top_of_set U) T" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3772 |       and "S \<inter> T = {}"
 | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 3773 | obtains S' T' where "openin (top_of_set U) S'" | 
| 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 3774 | "openin (top_of_set U) T'" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3775 |                       "S \<subseteq> S'"  "T \<subseteq> T'"  "S' \<inter> T' = {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3776 | proof (cases "S = {} \<or> T = {}")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3777 | case True with that show ?thesis | 
| 68056 | 3778 | using UT US by (blast dest: closedin_subset) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3779 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3780 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3781 |   define f where "f \<equiv> \<lambda>x. setdist {x} T - setdist {x} S"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3782 | have contf: "continuous_on U f" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3783 | unfolding f_def by (intro continuous_intros) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3784 | show ?thesis | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66793diff
changeset | 3785 |   proof (rule_tac S' = "(U \<inter> f -` {0<..})" and T' = "(U \<inter> f -` {..<0})" in that)
 | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66793diff
changeset | 3786 |     show "(U \<inter> f -` {0<..}) \<inter> (U \<inter> f -` {..<0}) = {}"
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3787 | by auto | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 3788 |     show "openin (top_of_set U) (U \<inter> f -` {0<..})"
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3789 | by (rule continuous_openin_preimage [where T=UNIV]) (simp_all add: contf) | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66793diff
changeset | 3790 | next | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 3791 |     show "openin (top_of_set U) (U \<inter> f -` {..<0})"
 | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66793diff
changeset | 3792 | by (rule continuous_openin_preimage [where T=UNIV]) (simp_all add: contf) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3793 | next | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66793diff
changeset | 3794 | have "S \<subseteq> U" "T \<subseteq> U" | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66793diff
changeset | 3795 | using closedin_imp_subset assms by blast+ | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66793diff
changeset | 3796 |     then show "S \<subseteq> U \<inter> f -` {0<..}" "T \<subseteq> U \<inter> f -` {..<0}"
 | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66793diff
changeset | 3797 | using assms False by (force simp add: f_def setdist_sing_in_set intro!: setdist_gt_0_closedin)+ | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3798 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3799 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3800 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3801 | lemma separation_normal_compact: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3802 | fixes S :: "'a::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3803 |   assumes "compact S" "closed T" "S \<inter> T = {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3804 |   obtains U V where "open U" "compact(closure U)" "open V" "S \<subseteq> U" "T \<subseteq> V" "U \<inter> V = {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3805 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3806 | have "closed S" "bounded S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3807 | using assms by (auto simp: compact_eq_bounded_closed) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3808 | then obtain r where "r>0" and r: "S \<subseteq> ball 0 r" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3809 | by (auto dest!: bounded_subset_ballD) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3810 |   have **: "closed (T \<union> - ball 0 r)" "S \<inter> (T \<union> - ball 0 r) = {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3811 | using assms r by blast+ | 
| 72238 | 3812 |   then obtain U V where UV: "open U" "open V" "S \<subseteq> U" "T \<union> - ball 0 r \<subseteq> V" "U \<inter> V = {}"
 | 
| 3813 | by (meson \<open>closed S\<close> separation_normal) | |
| 3814 | then have "compact(closure U)" | |
| 3815 | by (meson bounded_ball bounded_subset compact_closure compl_le_swap2 disjoint_eq_subset_Compl le_sup_iff) | |
| 3816 | with UV show thesis | |
| 3817 | using that by auto | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3818 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3819 | |
| 66793 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3820 | subsection\<open>Connectedness of the intersection of a chain\<close> | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3821 | |
| 68607 
67bb59e49834
make theorem, corollary, and proposition %important for HOL-Analysis manual
 immler parents: 
68527diff
changeset | 3822 | proposition connected_chain: | 
| 66793 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3823 | fixes \<F> :: "'a :: euclidean_space set set" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3824 | assumes cc: "\<And>S. S \<in> \<F> \<Longrightarrow> compact S \<and> connected S" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3825 | and linear: "\<And>S T. S \<in> \<F> \<and> T \<in> \<F> \<Longrightarrow> S \<subseteq> T \<or> T \<subseteq> S" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3826 | shows "connected(\<Inter>\<F>)" | 
| 68607 
67bb59e49834
make theorem, corollary, and proposition %important for HOL-Analysis manual
 immler parents: 
68527diff
changeset | 3827 | proof (cases "\<F> = {}")
 | 
| 66793 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3828 | case True then show ?thesis | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3829 | by auto | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3830 | next | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3831 | case False | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3832 | then have cf: "compact(\<Inter>\<F>)" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3833 | by (simp add: cc compact_Inter) | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3834 |   have False if AB: "closed A" "closed B" "A \<inter> B = {}"
 | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3835 |                 and ABeq: "A \<union> B = \<Inter>\<F>" and "A \<noteq> {}" "B \<noteq> {}" for A B
 | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3836 | proof - | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3837 |     obtain U V where "open U" "open V" "A \<subseteq> U" "B \<subseteq> V" "U \<inter> V = {}"
 | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3838 | using separation_normal [OF AB] by metis | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3839 | obtain K where "K \<in> \<F>" "compact K" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3840 | using cc False by blast | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3841 | then obtain N where "open N" and "K \<subseteq> N" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3842 | by blast | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3843 | let ?\<C> = "insert (U \<union> V) ((\<lambda>S. N - S) ` \<F>)" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3844 | obtain \<D> where "\<D> \<subseteq> ?\<C>" "finite \<D>" "K \<subseteq> \<Union>\<D>" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3845 | proof (rule compactE [OF \<open>compact K\<close>]) | 
| 69745 | 3846 | show "K \<subseteq> \<Union>(insert (U \<union> V) ((-) N ` \<F>))" | 
| 66793 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3847 | using \<open>K \<subseteq> N\<close> ABeq \<open>A \<subseteq> U\<close> \<open>B \<subseteq> V\<close> by auto | 
| 67399 | 3848 | show "\<And>B. B \<in> insert (U \<union> V) ((-) N ` \<F>) \<Longrightarrow> open B" | 
| 66793 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3849 | by (auto simp: \<open>open U\<close> \<open>open V\<close> open_Un \<open>open N\<close> cc compact_imp_closed open_Diff) | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3850 | qed | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3851 |     then have "finite(\<D> - {U \<union> V})"
 | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3852 | by blast | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3853 |     moreover have "\<D> - {U \<union> V} \<subseteq> (\<lambda>S. N - S) ` \<F>"
 | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3854 | using \<open>\<D> \<subseteq> ?\<C>\<close> by blast | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3855 |     ultimately obtain \<G> where "\<G> \<subseteq> \<F>" "finite \<G>" and Deq: "\<D> - {U \<union> V} = (\<lambda>S. N-S) ` \<G>"
 | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3856 | using finite_subset_image by metis | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3857 | obtain J where "J \<in> \<F>" and J: "(\<Union>S\<in>\<G>. N - S) \<subseteq> N - J" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3858 |     proof (cases "\<G> = {}")
 | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3859 | case True | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3860 |       with \<open>\<F> \<noteq> {}\<close> that show ?thesis
 | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3861 | by auto | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3862 | next | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3863 | case False | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3864 | have "\<And>S T. \<lbrakk>S \<in> \<G>; T \<in> \<G>\<rbrakk> \<Longrightarrow> S \<subseteq> T \<or> T \<subseteq> S" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3865 | by (meson \<open>\<G> \<subseteq> \<F>\<close> in_mono local.linear) | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3866 |       with \<open>finite \<G>\<close> \<open>\<G> \<noteq> {}\<close>
 | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3867 | have "\<exists>J \<in> \<G>. (\<Union>S\<in>\<G>. N - S) \<subseteq> N - J" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3868 | proof induction | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3869 | case (insert X \<H>) | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3870 | show ?case | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3871 |         proof (cases "\<H> = {}")
 | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3872 | case True then show ?thesis by auto | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3873 | next | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3874 | case False | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3875 | then have "\<And>S T. \<lbrakk>S \<in> \<H>; T \<in> \<H>\<rbrakk> \<Longrightarrow> S \<subseteq> T \<or> T \<subseteq> S" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3876 | by (simp add: insert.prems) | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3877 | with insert.IH False obtain J where "J \<in> \<H>" and J: "(\<Union>Y\<in>\<H>. N - Y) \<subseteq> N - J" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3878 | by metis | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3879 | have "N - J \<subseteq> N - X \<or> N - X \<subseteq> N - J" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3880 | by (meson Diff_mono \<open>J \<in> \<H>\<close> insert.prems(2) insert_iff order_refl) | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3881 | then show ?thesis | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3882 | proof | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3883 | assume "N - J \<subseteq> N - X" with J show ?thesis | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3884 | by auto | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3885 | next | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3886 | assume "N - X \<subseteq> N - J" | 
| 69325 | 3887 | with J have "N - X \<union> \<Union> ((-) N ` \<H>) \<subseteq> N - J" | 
| 66793 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3888 | by auto | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3889 | with \<open>J \<in> \<H>\<close> show ?thesis | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3890 | by blast | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3891 | qed | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3892 | qed | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3893 | qed simp | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3894 | with \<open>\<G> \<subseteq> \<F>\<close> show ?thesis by (blast intro: that) | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3895 | qed | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3896 |     have "K \<subseteq> \<Union>(insert (U \<union> V) (\<D> - {U \<union> V}))"
 | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3897 | using \<open>K \<subseteq> \<Union>\<D>\<close> by auto | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3898 | also have "... \<subseteq> (U \<union> V) \<union> (N - J)" | 
| 73932 
fd21b4a93043
added opaque_combs and renamed hide_lams to opaque_lifting
 desharna parents: 
72569diff
changeset | 3899 | by (metis (no_types, opaque_lifting) Deq Un_subset_iff Un_upper2 J Union_insert order_trans sup_ge1) | 
| 66793 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3900 | finally have "J \<inter> K \<subseteq> U \<union> V" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3901 | by blast | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3902 | moreover have "connected(J \<inter> K)" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3903 | by (metis Int_absorb1 \<open>J \<in> \<F>\<close> \<open>K \<in> \<F>\<close> cc inf.orderE local.linear) | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3904 |     moreover have "U \<inter> (J \<inter> K) \<noteq> {}"
 | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3905 |       using ABeq \<open>J \<in> \<F>\<close> \<open>K \<in> \<F>\<close> \<open>A \<noteq> {}\<close> \<open>A \<subseteq> U\<close> by blast
 | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3906 |     moreover have "V \<inter> (J \<inter> K) \<noteq> {}"
 | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3907 |       using ABeq \<open>J \<in> \<F>\<close> \<open>K \<in> \<F>\<close> \<open>B \<noteq> {}\<close> \<open>B \<subseteq> V\<close> by blast
 | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3908 | ultimately show False | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3909 |         using connectedD [of "J \<inter> K" U V] \<open>open U\<close> \<open>open V\<close> \<open>U \<inter> V = {}\<close>  by auto
 | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3910 | qed | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3911 | with cf show ?thesis | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3912 | by (auto simp: connected_closed_set compact_imp_closed) | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3913 | qed | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3914 | |
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3915 | lemma connected_chain_gen: | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3916 | fixes \<F> :: "'a :: euclidean_space set set" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3917 | assumes X: "X \<in> \<F>" "compact X" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3918 | and cc: "\<And>T. T \<in> \<F> \<Longrightarrow> closed T \<and> connected T" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3919 | and linear: "\<And>S T. S \<in> \<F> \<and> T \<in> \<F> \<Longrightarrow> S \<subseteq> T \<or> T \<subseteq> S" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3920 | shows "connected(\<Inter>\<F>)" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3921 | proof - | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3922 | have "\<Inter>\<F> = (\<Inter>T\<in>\<F>. X \<inter> T)" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3923 | using X by blast | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3924 | moreover have "connected (\<Inter>T\<in>\<F>. X \<inter> T)" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3925 | proof (rule connected_chain) | 
| 67399 | 3926 | show "\<And>T. T \<in> (\<inter>) X ` \<F> \<Longrightarrow> compact T \<and> connected T" | 
| 66793 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3927 | using cc X by auto (metis inf.absorb2 inf.orderE local.linear) | 
| 67399 | 3928 | show "\<And>S T. S \<in> (\<inter>) X ` \<F> \<and> T \<in> (\<inter>) X ` \<F> \<Longrightarrow> S \<subseteq> T \<or> T \<subseteq> S" | 
| 66793 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3929 | using local.linear by blast | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3930 | qed | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3931 | ultimately show ?thesis | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3932 | by metis | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3933 | qed | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3934 | |
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3935 | lemma connected_nest: | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3936 | fixes S :: "'a::linorder \<Rightarrow> 'b::euclidean_space set" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3937 | assumes S: "\<And>n. compact(S n)" "\<And>n. connected(S n)" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3938 | and nest: "\<And>m n. m \<le> n \<Longrightarrow> S n \<subseteq> S m" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3939 | shows "connected(\<Inter> (range S))" | 
| 72567 | 3940 | proof (rule connected_chain) | 
| 3941 | show "\<And>A T. A \<in> range S \<and> T \<in> range S \<Longrightarrow> A \<subseteq> T \<or> T \<subseteq> A" | |
| 66793 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3942 | by (metis image_iff le_cases nest) | 
| 72567 | 3943 | qed (use S in blast) | 
| 66793 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3944 | |
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3945 | lemma connected_nest_gen: | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3946 | fixes S :: "'a::linorder \<Rightarrow> 'b::euclidean_space set" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3947 | assumes S: "\<And>n. closed(S n)" "\<And>n. connected(S n)" "compact(S k)" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3948 | and nest: "\<And>m n. m \<le> n \<Longrightarrow> S n \<subseteq> S m" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3949 | shows "connected(\<Inter> (range S))" | 
| 72567 | 3950 | proof (rule connected_chain_gen [of "S k"]) | 
| 3951 | show "\<And>A T. A \<in> range S \<and> T \<in> range S \<Longrightarrow> A \<subseteq> T \<or> T \<subseteq> A" | |
| 3952 | by (metis imageE le_cases nest) | |
| 3953 | qed (use S in auto) | |
| 66793 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3954 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3955 | subsection\<open>Proper maps, including projections out of compact sets\<close> | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3956 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3957 | lemma finite_indexed_bound: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3958 | assumes A: "finite A" "\<And>x. x \<in> A \<Longrightarrow> \<exists>n::'a::linorder. P x n" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3959 | shows "\<exists>m. \<forall>x \<in> A. \<exists>k\<le>m. P x k" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3960 | using A | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3961 | proof (induction A) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3962 | case empty then show ?case by force | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3963 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3964 | case (insert a A) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3965 | then obtain m n where "\<forall>x \<in> A. \<exists>k\<le>m. P x k" "P a n" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3966 | by force | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3967 | then show ?case | 
| 72238 | 3968 | by (metis dual_order.trans insert_iff le_cases) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3969 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3970 | |
| 68607 
67bb59e49834
make theorem, corollary, and proposition %important for HOL-Analysis manual
 immler parents: 
68527diff
changeset | 3971 | proposition proper_map: | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3972 | fixes f :: "'a::heine_borel \<Rightarrow> 'b::heine_borel" | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 3973 | assumes "closedin (top_of_set S) K" | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66793diff
changeset | 3974 | and com: "\<And>U. \<lbrakk>U \<subseteq> T; compact U\<rbrakk> \<Longrightarrow> compact (S \<inter> f -` U)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3975 | and "f ` S \<subseteq> T" | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 3976 | shows "closedin (top_of_set T) (f ` K)" | 
| 68607 
67bb59e49834
make theorem, corollary, and proposition %important for HOL-Analysis manual
 immler parents: 
68527diff
changeset | 3977 | proof - | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3978 | have "K \<subseteq> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3979 | using assms closedin_imp_subset by metis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3980 | obtain C where "closed C" and Keq: "K = S \<inter> C" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3981 | using assms by (auto simp: closedin_closed) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3982 | have *: "y \<in> f ` K" if "y \<in> T" and y: "y islimpt f ` K" for y | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3983 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3984 | obtain h where "\<forall>n. (\<exists>x\<in>K. h n = f x) \<and> h n \<noteq> y" "inj h" and hlim: "(h \<longlongrightarrow> y) sequentially" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3985 | using \<open>y \<in> T\<close> y by (force simp: limpt_sequential_inj) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3986 | then obtain X where X: "\<And>n. X n \<in> K \<and> h n = f (X n) \<and> h n \<noteq> y" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3987 | by metis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3988 | then have fX: "\<And>n. f (X n) = h n" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3989 | by metis | 
| 72567 | 3990 |     define \<Psi> where "\<Psi> \<equiv> \<lambda>n. {a \<in> K. f a \<in> insert y (range (\<lambda>i. f (X (n + i))))}"
 | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66793diff
changeset | 3991 | have "compact (C \<inter> (S \<inter> f -` insert y (range (\<lambda>i. f(X(n + i))))))" for n | 
| 72238 | 3992 | proof (intro closed_Int_compact [OF \<open>closed C\<close> com] compact_sequence_with_limit) | 
| 3993 | show "insert y (range (\<lambda>i. f (X (n + i)))) \<subseteq> T" | |
| 3994 | using X \<open>K \<subseteq> S\<close> \<open>f ` S \<subseteq> T\<close> \<open>y \<in> T\<close> by blast | |
| 3995 | show "(\<lambda>i. f (X (n + i))) \<longlonglongrightarrow> y" | |
| 3996 | by (simp add: fX add.commute [of n] LIMSEQ_ignore_initial_segment [OF hlim]) | |
| 3997 | qed | |
| 72567 | 3998 | then have comf: "compact (\<Psi> n)" for n | 
| 3999 | by (simp add: Keq Int_def \<Psi>_def conj_commute) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4000 |     have ne: "\<Inter>\<F> \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4001 | if "finite \<F>" | 
| 72567 | 4002 | and \<F>: "\<And>t. t \<in> \<F> \<Longrightarrow> (\<exists>n. t = \<Psi> n)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4003 | for \<F> | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4004 | proof - | 
| 72567 | 4005 | obtain m where m: "\<And>t. t \<in> \<F> \<Longrightarrow> \<exists>k\<le>m. t = \<Psi> k" | 
| 72238 | 4006 | by (rule exE [OF finite_indexed_bound [OF \<open>finite \<F>\<close> \<F>]], force+) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4007 | have "X m \<in> \<Inter>\<F>" | 
| 72567 | 4008 | using X le_Suc_ex by (fastforce simp: \<Psi>_def dest: m) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4009 | then show ?thesis by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4010 | qed | 
| 72567 | 4011 |     have "(\<Inter>n. \<Psi> n) \<noteq> {}"
 | 
| 4012 | proof (rule compact_fip_Heine_Borel) | |
| 4013 |       show "\<And>\<F>'. \<lbrakk>finite \<F>'; \<F>' \<subseteq> range \<Psi>\<rbrakk> \<Longrightarrow> \<Inter> \<F>' \<noteq> {}"
 | |
| 4014 | by (meson ne rangeE subset_eq) | |
| 4015 | qed (use comf in blast) | |
| 4016 | then obtain x where "x \<in> K" "\<And>n. (f x = y \<or> (\<exists>u. f x = h (n + u)))" | |
| 4017 | by (force simp add: \<Psi>_def fX) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4018 | then show ?thesis | 
| 72567 | 4019 | unfolding image_iff by (metis \<open>inj h\<close> le_add1 not_less_eq_eq rangeI range_ex1_eq) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4020 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4021 | with assms closedin_subset show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4022 | by (force simp: closedin_limpt) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4023 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4024 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4025 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4026 | lemma compact_continuous_image_eq: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4027 | fixes f :: "'a::heine_borel \<Rightarrow> 'b::heine_borel" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4028 | assumes f: "inj_on f S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4029 | shows "continuous_on S f \<longleftrightarrow> (\<forall>T. compact T \<and> T \<subseteq> S \<longrightarrow> compact(f ` T))" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4030 | (is "?lhs = ?rhs") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4031 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4032 | assume ?lhs then show ?rhs | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4033 | by (metis continuous_on_subset compact_continuous_image) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4034 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4035 | assume RHS: ?rhs | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4036 | obtain g where gf: "\<And>x. x \<in> S \<Longrightarrow> g (f x) = x" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4037 | by (metis inv_into_f_f f) | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66793diff
changeset | 4038 | then have *: "(S \<inter> f -` U) = g ` U" if "U \<subseteq> f ` S" for U | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4039 | using that by fastforce | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4040 | have gfim: "g ` f ` S \<subseteq> S" using gf by auto | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66793diff
changeset | 4041 | have **: "compact (f ` S \<inter> g -` C)" if C: "C \<subseteq> S" "compact C" for C | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4042 | proof - | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66793diff
changeset | 4043 | obtain h where "h C \<in> C \<and> h C \<notin> S \<or> compact (f ` C)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4044 | by (force simp: C RHS) | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66793diff
changeset | 4045 | moreover have "f ` C = (f ` S \<inter> g -` C)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4046 | using C gf by auto | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66793diff
changeset | 4047 | ultimately show ?thesis | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4048 | using C by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4049 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4050 | show ?lhs | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4051 | using proper_map [OF _ _ gfim] ** | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4052 | by (simp add: continuous_on_closed * closedin_imp_subset) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4053 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4054 | |
| 70136 | 4055 | subsection\<^marker>\<open>tag unimportant\<close>\<open>Trivial fact: convexity equals connectedness for collinear sets\<close> | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4056 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4057 | lemma convex_connected_collinear: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4058 | fixes S :: "'a::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4059 | assumes "collinear S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4060 | shows "convex S \<longleftrightarrow> connected S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4061 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4062 | assume "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4063 | then show "connected S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4064 | using convex_connected by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4065 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4066 | assume S: "connected S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4067 | show "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4068 |   proof (cases "S = {}")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4069 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4070 | then show ?thesis by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4071 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4072 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4073 | then obtain a where "a \<in> S" by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4074 | have "collinear (affine hull S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4075 | by (simp add: assms collinear_affine_hull_collinear) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4076 | then obtain z where "z \<noteq> 0" "\<And>x. x \<in> affine hull S \<Longrightarrow> \<exists>c. x - a = c *\<^sub>R z" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4077 | by (meson \<open>a \<in> S\<close> collinear hull_inc) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4078 | then obtain f where f: "\<And>x. x \<in> affine hull S \<Longrightarrow> x - a = f x *\<^sub>R z" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4079 | by metis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4080 | then have inj_f: "inj_on f (affine hull S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4081 | by (metis diff_add_cancel inj_onI) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4082 | have diff: "x - y = (f x - f y) *\<^sub>R z" if x: "x \<in> affine hull S" and y: "y \<in> affine hull S" for x y | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4083 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4084 | have "f x *\<^sub>R z = x - a" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4085 | by (simp add: f hull_inc x) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4086 | moreover have "f y *\<^sub>R z = y - a" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4087 | by (simp add: f hull_inc y) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4088 | ultimately show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4089 | by (simp add: scaleR_left.diff) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4090 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4091 | have cont_f: "continuous_on (affine hull S) f" | 
| 72567 | 4092 | proof (clarsimp simp: dist_norm continuous_on_iff diff) | 
| 4093 | show "\<And>x e. 0 < e \<Longrightarrow> \<exists>d>0. \<forall>y \<in> affine hull S. \<bar>f y - f x\<bar> * norm z < d \<longrightarrow> \<bar>f y - f x\<bar> < e" | |
| 72569 
d56e4eeae967
mult_le_cancel_iff1, mult_le_cancel_iff2, mult_less_iff1 generalised from the real_ versions
 paulson <lp15@cam.ac.uk> parents: 
72567diff
changeset | 4094 | by (metis \<open>z \<noteq> 0\<close> mult_pos_pos mult_less_iff1 zero_less_norm_iff) | 
| 72567 | 4095 | qed | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4096 | then have conn_fS: "connected (f ` S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4097 | by (meson S connected_continuous_image continuous_on_subset hull_subset) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4098 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4099 | proof (clarsimp simp: convex_contains_segment) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4100 | fix x y z | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4101 | assume "x \<in> S" "y \<in> S" "z \<in> closed_segment x y" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4102 | have False if "z \<notin> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4103 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4104 | have "f ` (closed_segment x y) = closed_segment (f x) (f y)" | 
| 72238 | 4105 | proof (rule continuous_injective_image_segment_1) | 
| 4106 | show "continuous_on (closed_segment x y) f" | |
| 4107 | by (meson \<open>x \<in> S\<close> \<open>y \<in> S\<close> convex_affine_hull convex_contains_segment hull_inc continuous_on_subset [OF cont_f]) | |
| 4108 | show "inj_on f (closed_segment x y)" | |
| 4109 | by (meson \<open>x \<in> S\<close> \<open>y \<in> S\<close> convex_affine_hull convex_contains_segment hull_inc inj_on_subset [OF inj_f]) | |
| 4110 | qed | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4111 | then have fz: "f z \<in> closed_segment (f x) (f y)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4112 | using \<open>z \<in> closed_segment x y\<close> by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4113 | have "z \<in> affine hull S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4114 | by (meson \<open>x \<in> S\<close> \<open>y \<in> S\<close> \<open>z \<in> closed_segment x y\<close> convex_affine_hull convex_contains_segment hull_inc subset_eq) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4115 | then have fz_notin: "f z \<notin> f ` S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4116 | using hull_subset inj_f inj_onD that by fastforce | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4117 |         moreover have "{..<f z} \<inter> f ` S \<noteq> {}" "{f z<..} \<inter> f ` S \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4118 | proof - | 
| 72567 | 4119 | consider "f x \<le> f z \<and> f z \<le> f y" | "f y \<le> f z \<and> f z \<le> f x" | 
| 4120 | using fz | |
| 4121 | by (auto simp add: closed_segment_eq_real_ivl split: if_split_asm) | |
| 4122 |           then have "{..<f z} \<inter> f ` {x,y} \<noteq> {} \<and> {f z<..} \<inter> f ` {x,y} \<noteq> {}"
 | |
| 4123 | by cases (use fz_notin \<open>x \<in> S\<close> \<open>y \<in> S\<close> in \<open>auto simp: image_iff\<close>) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4124 |           then show "{..<f z} \<inter> f ` S \<noteq> {}" "{f z<..} \<inter> f ` S \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4125 | using \<open>x \<in> S\<close> \<open>y \<in> S\<close> by blast+ | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4126 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4127 | ultimately show False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4128 |           using connectedD [OF conn_fS, of "{..<f z}" "{f z<..}"] by force
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4129 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4130 | then show "z \<in> S" by meson | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4131 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4132 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4133 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4134 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4135 | lemma compact_convex_collinear_segment_alt: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4136 | fixes S :: "'a::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4137 |   assumes "S \<noteq> {}" "compact S" "connected S" "collinear S"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4138 | obtains a b where "S = closed_segment a b" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4139 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4140 |   obtain \<xi> where "\<xi> \<in> S" using \<open>S \<noteq> {}\<close> by auto
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4141 | have "collinear (affine hull S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4142 | by (simp add: assms collinear_affine_hull_collinear) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4143 | then obtain z where "z \<noteq> 0" "\<And>x. x \<in> affine hull S \<Longrightarrow> \<exists>c. x - \<xi> = c *\<^sub>R z" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4144 | by (meson \<open>\<xi> \<in> S\<close> collinear hull_inc) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4145 | then obtain f where f: "\<And>x. x \<in> affine hull S \<Longrightarrow> x - \<xi> = f x *\<^sub>R z" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4146 | by metis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4147 | let ?g = "\<lambda>r. r *\<^sub>R z + \<xi>" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4148 | have gf: "?g (f x) = x" if "x \<in> affine hull S" for x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4149 | by (metis diff_add_cancel f that) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4150 | then have inj_f: "inj_on f (affine hull S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4151 | by (metis inj_onI) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4152 | have diff: "x - y = (f x - f y) *\<^sub>R z" if x: "x \<in> affine hull S" and y: "y \<in> affine hull S" for x y | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4153 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4154 | have "f x *\<^sub>R z = x - \<xi>" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4155 | by (simp add: f hull_inc x) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4156 | moreover have "f y *\<^sub>R z = y - \<xi>" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4157 | by (simp add: f hull_inc y) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4158 | ultimately show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4159 | by (simp add: scaleR_left.diff) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4160 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4161 | have cont_f: "continuous_on (affine hull S) f" | 
| 72567 | 4162 | proof (clarsimp simp: dist_norm continuous_on_iff diff) | 
| 4163 | show "\<And>x e. 0 < e \<Longrightarrow> \<exists>d>0. \<forall>y \<in> affine hull S. \<bar>f y - f x\<bar> * norm z < d \<longrightarrow> \<bar>f y - f x\<bar> < e" | |
| 72569 
d56e4eeae967
mult_le_cancel_iff1, mult_le_cancel_iff2, mult_less_iff1 generalised from the real_ versions
 paulson <lp15@cam.ac.uk> parents: 
72567diff
changeset | 4164 | by (metis \<open>z \<noteq> 0\<close> mult_pos_pos mult_less_iff1 zero_less_norm_iff) | 
| 72567 | 4165 | qed | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4166 | then have "connected (f ` S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4167 | by (meson \<open>connected S\<close> connected_continuous_image continuous_on_subset hull_subset) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4168 | moreover have "compact (f ` S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4169 | by (meson \<open>compact S\<close> compact_continuous_image_eq cont_f hull_subset inj_f) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4170 |   ultimately obtain x y where "f ` S = {x..y}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4171 | by (meson connected_compact_interval_1) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4172 | then have fS_eq: "f ` S = closed_segment x y" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4173 |     using \<open>S \<noteq> {}\<close> closed_segment_eq_real_ivl by auto
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4174 | obtain a b where "a \<in> S" "f a = x" "b \<in> S" "f b = y" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4175 | by (metis (full_types) ends_in_segment fS_eq imageE) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4176 | have "f ` (closed_segment a b) = closed_segment (f a) (f b)" | 
| 72238 | 4177 | proof (rule continuous_injective_image_segment_1) | 
| 4178 | show "continuous_on (closed_segment a b) f" | |
| 4179 | by (meson \<open>a \<in> S\<close> \<open>b \<in> S\<close> convex_affine_hull convex_contains_segment hull_inc continuous_on_subset [OF cont_f]) | |
| 4180 | show "inj_on f (closed_segment a b)" | |
| 4181 | by (meson \<open>a \<in> S\<close> \<open>b \<in> S\<close> convex_affine_hull convex_contains_segment hull_inc inj_on_subset [OF inj_f]) | |
| 4182 | qed | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4183 | then have "f ` (closed_segment a b) = f ` S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4184 | by (simp add: \<open>f a = x\<close> \<open>f b = y\<close> fS_eq) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4185 | then have "?g ` f ` (closed_segment a b) = ?g ` f ` S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4186 | by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4187 | moreover have "(\<lambda>x. f x *\<^sub>R z + \<xi>) ` closed_segment a b = closed_segment a b" | 
| 72567 | 4188 | unfolding image_def using \<open>a \<in> S\<close> \<open>b \<in> S\<close> | 
| 4189 | by (safe; metis (mono_tags, lifting) convex_affine_hull convex_contains_segment gf hull_subset subsetCE) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4190 | ultimately have "closed_segment a b = S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4191 | using gf by (simp add: image_comp o_def hull_inc cong: image_cong) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4192 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4193 | using that by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4194 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4195 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4196 | lemma compact_convex_collinear_segment: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4197 | fixes S :: "'a::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4198 |   assumes "S \<noteq> {}" "compact S" "convex S" "collinear S"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4199 | obtains a b where "S = closed_segment a b" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4200 | using assms convex_connected_collinear compact_convex_collinear_segment_alt by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4201 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4202 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4203 | lemma proper_map_from_compact: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4204 | fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4205 | assumes contf: "continuous_on S f" and imf: "f ` S \<subseteq> T" and "compact S" | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 4206 | "closedin (top_of_set T) K" | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66793diff
changeset | 4207 | shows "compact (S \<inter> f -` K)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4208 | by (rule closedin_compact [OF \<open>compact S\<close>] continuous_closedin_preimage_gen assms)+ | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4209 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4210 | lemma proper_map_fst: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4211 | assumes "compact T" "K \<subseteq> S" "compact K" | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66793diff
changeset | 4212 | shows "compact (S \<times> T \<inter> fst -` K)" | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66793diff
changeset | 4213 | proof - | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66793diff
changeset | 4214 | have "(S \<times> T \<inter> fst -` K) = K \<times> T" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4215 | using assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4216 | then show ?thesis by (simp add: assms compact_Times) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4217 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4218 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4219 | lemma closed_map_fst: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4220 | fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set" | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 4221 | assumes "compact T" "closedin (top_of_set (S \<times> T)) c" | 
| 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 4222 | shows "closedin (top_of_set S) (fst ` c)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4223 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4224 | have *: "fst ` (S \<times> T) \<subseteq> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4225 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4226 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4227 | using proper_map [OF _ _ *] by (simp add: proper_map_fst assms) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4228 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4229 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4230 | lemma proper_map_snd: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4231 | assumes "compact S" "K \<subseteq> T" "compact K" | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66793diff
changeset | 4232 | shows "compact (S \<times> T \<inter> snd -` K)" | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66793diff
changeset | 4233 | proof - | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66793diff
changeset | 4234 | have "(S \<times> T \<inter> snd -` K) = S \<times> K" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4235 | using assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4236 | then show ?thesis by (simp add: assms compact_Times) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4237 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4238 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4239 | lemma closed_map_snd: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4240 | fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set" | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 4241 | assumes "compact S" "closedin (top_of_set (S \<times> T)) c" | 
| 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 4242 | shows "closedin (top_of_set T) (snd ` c)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4243 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4244 | have *: "snd ` (S \<times> T) \<subseteq> T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4245 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4246 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4247 | using proper_map [OF _ _ *] by (simp add: proper_map_snd assms) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4248 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4249 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4250 | lemma closedin_compact_projection: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4251 | fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set" | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 4252 | assumes "compact S" and clo: "closedin (top_of_set (S \<times> T)) U" | 
| 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 4253 |     shows "closedin (top_of_set T) {y. \<exists>x. x \<in> S \<and> (x, y) \<in> U}"
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4254 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4255 | have "U \<subseteq> S \<times> T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4256 | by (metis clo closedin_imp_subset) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4257 |   then have "{y. \<exists>x. x \<in> S \<and> (x, y) \<in> U} = snd ` U"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4258 | by force | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 4259 | moreover have "closedin (top_of_set T) (snd ` U)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4260 | by (rule closed_map_snd [OF assms]) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4261 | ultimately show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4262 | by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4263 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4264 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4265 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4266 | lemma closed_compact_projection: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4267 | fixes S :: "'a::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4268 |     and T :: "('a * 'b::euclidean_space) set"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4269 | assumes "compact S" and clo: "closed T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4270 |     shows "closed {y. \<exists>x. x \<in> S \<and> (x, y) \<in> T}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4271 | proof - | 
| 72238 | 4272 |   have *: "{y. \<exists>x. x \<in> S \<and> Pair x y \<in> T} = {y. \<exists>x. x \<in> S \<and> Pair x y \<in> ((S \<times> UNIV) \<inter> T)}"
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4273 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4274 | show ?thesis | 
| 72238 | 4275 | unfolding * | 
| 4276 | by (intro clo closedin_closed_Int closedin_closed_trans [OF _ closed_UNIV] closedin_compact_projection [OF \<open>compact S\<close>]) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4277 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4278 | |
| 70136 | 4279 | subsubsection\<^marker>\<open>tag unimportant\<close>\<open>Representing affine hull as a finite intersection of hyperplanes\<close> | 
| 4280 | ||
| 4281 | proposition\<^marker>\<open>tag unimportant\<close> affine_hull_convex_Int_nonempty_interior: | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4282 | fixes S :: "'a::real_normed_vector set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4283 |   assumes "convex S" "S \<inter> interior T \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4284 | shows "affine hull (S \<inter> T) = affine hull S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4285 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4286 | show "affine hull (S \<inter> T) \<subseteq> affine hull S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4287 | by (simp add: hull_mono) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4288 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4289 | obtain a where "a \<in> S" "a \<in> T" and at: "a \<in> interior T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4290 | using assms interior_subset by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4291 | then obtain e where "e > 0" and e: "cball a e \<subseteq> T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4292 | using mem_interior_cball by blast | 
| 67399 | 4293 | have *: "x \<in> (+) a ` span ((\<lambda>x. x - a) ` (S \<inter> T))" if "x \<in> S" for x | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4294 | proof (cases "x = a") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4295 | case True with that span_0 eq_add_iff image_def mem_Collect_eq show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4296 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4297 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4298 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4299 | define k where "k = min (1/2) (e / norm (x-a))" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4300 | have k: "0 < k" "k < 1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4301 | using \<open>e > 0\<close> False by (auto simp: k_def) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4302 | then have xa: "(x-a) = inverse k *\<^sub>R k *\<^sub>R (x-a)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4303 | by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4304 | have "e / norm (x - a) \<ge> k" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4305 | using k_def by linarith | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4306 | then have "a + k *\<^sub>R (x - a) \<in> cball a e" | 
| 70802 
160eaf566bcb
formally augmented corresponding rules for field_simps
 haftmann parents: 
70620diff
changeset | 4307 | using \<open>0 < k\<close> False | 
| 
160eaf566bcb
formally augmented corresponding rules for field_simps
 haftmann parents: 
70620diff
changeset | 4308 | by (simp add: dist_norm) (simp add: field_simps) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4309 | then have T: "a + k *\<^sub>R (x - a) \<in> T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4310 | using e by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4311 | have S: "a + k *\<^sub>R (x - a) \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4312 | using k \<open>a \<in> S\<close> convexD [OF \<open>convex S\<close> \<open>a \<in> S\<close> \<open>x \<in> S\<close>, of "1-k" k] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4313 | by (simp add: algebra_simps) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4314 | have "inverse k *\<^sub>R k *\<^sub>R (x-a) \<in> span ((\<lambda>x. x - a) ` (S \<inter> T))" | 
| 72238 | 4315 | by (intro span_mul [OF span_base] image_eqI [where x = "a + k *\<^sub>R (x - a)"]) (auto simp: S T) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4316 | with xa image_iff show ?thesis by fastforce | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4317 | qed | 
| 72238 | 4318 | have "S \<subseteq> affine hull (S \<inter> T)" | 
| 4319 | by (force simp: * \<open>a \<in> S\<close> \<open>a \<in> T\<close> hull_inc affine_hull_span_gen [of a]) | |
| 4320 | then show "affine hull S \<subseteq> affine hull (S \<inter> T)" | |
| 4321 | by (simp add: subset_hull) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4322 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4323 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4324 | corollary affine_hull_convex_Int_open: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4325 | fixes S :: "'a::real_normed_vector set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4326 |   assumes "convex S" "open T" "S \<inter> T \<noteq> {}"
 | 
| 72238 | 4327 | shows "affine hull (S \<inter> T) = affine hull S" | 
| 4328 | using affine_hull_convex_Int_nonempty_interior assms interior_eq by blast | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4329 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4330 | corollary affine_hull_affine_Int_nonempty_interior: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4331 | fixes S :: "'a::real_normed_vector set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4332 |   assumes "affine S" "S \<inter> interior T \<noteq> {}"
 | 
| 72238 | 4333 | shows "affine hull (S \<inter> T) = affine hull S" | 
| 4334 | by (simp add: affine_hull_convex_Int_nonempty_interior affine_imp_convex assms) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4335 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4336 | corollary affine_hull_affine_Int_open: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4337 | fixes S :: "'a::real_normed_vector set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4338 |   assumes "affine S" "open T" "S \<inter> T \<noteq> {}"
 | 
| 72238 | 4339 | shows "affine hull (S \<inter> T) = affine hull S" | 
| 4340 | by (simp add: affine_hull_convex_Int_open affine_imp_convex assms) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4341 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4342 | corollary affine_hull_convex_Int_openin: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4343 | fixes S :: "'a::real_normed_vector set" | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 4344 |   assumes "convex S" "openin (top_of_set (affine hull S)) T" "S \<inter> T \<noteq> {}"
 | 
| 72238 | 4345 | shows "affine hull (S \<inter> T) = affine hull S" | 
| 4346 | using assms unfolding openin_open | |
| 4347 | by (metis affine_hull_convex_Int_open hull_subset inf.orderE inf_assoc) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4348 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4349 | corollary affine_hull_openin: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4350 | fixes S :: "'a::real_normed_vector set" | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 4351 |   assumes "openin (top_of_set (affine hull T)) S" "S \<noteq> {}"
 | 
| 72238 | 4352 | shows "affine hull S = affine hull T" | 
| 4353 | using assms unfolding openin_open | |
| 4354 | by (metis affine_affine_hull affine_hull_affine_Int_open hull_hull) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4355 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4356 | corollary affine_hull_open: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4357 | fixes S :: "'a::real_normed_vector set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4358 |   assumes "open S" "S \<noteq> {}"
 | 
| 72238 | 4359 | shows "affine hull S = UNIV" | 
| 4360 | by (metis affine_hull_convex_Int_nonempty_interior assms convex_UNIV hull_UNIV inf_top.left_neutral interior_open) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4361 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4362 | lemma aff_dim_convex_Int_nonempty_interior: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4363 | fixes S :: "'a::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4364 |   shows "\<lbrakk>convex S; S \<inter> interior T \<noteq> {}\<rbrakk> \<Longrightarrow> aff_dim(S \<inter> T) = aff_dim S"
 | 
| 72238 | 4365 | using aff_dim_affine_hull2 affine_hull_convex_Int_nonempty_interior by blast | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4366 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4367 | lemma aff_dim_convex_Int_open: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4368 | fixes S :: "'a::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4369 |   shows "\<lbrakk>convex S; open T; S \<inter> T \<noteq> {}\<rbrakk> \<Longrightarrow>  aff_dim(S \<inter> T) = aff_dim S"
 | 
| 72238 | 4370 | using aff_dim_convex_Int_nonempty_interior interior_eq by blast | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4371 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4372 | lemma affine_hull_Diff: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4373 | fixes S:: "'a::real_normed_vector set" | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 4374 | assumes ope: "openin (top_of_set (affine hull S)) S" and "finite F" "F \<subset> S" | 
| 72238 | 4375 | shows "affine hull (S - F) = affine hull S" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4376 | proof - | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 4377 | have clo: "closedin (top_of_set S) F" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4378 | using assms finite_imp_closedin by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4379 |   moreover have "S - F \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4380 | using assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4381 | ultimately show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4382 | by (metis ope closedin_def topspace_euclidean_subtopology affine_hull_openin openin_trans) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4383 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4384 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4385 | lemma affine_hull_halfspace_lt: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4386 | fixes a :: "'a::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4387 |   shows "affine hull {x. a \<bullet> x < r} = (if a = 0 \<and> r \<le> 0 then {} else UNIV)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4388 | using halfspace_eq_empty_lt [of a r] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4389 | by (simp add: open_halfspace_lt affine_hull_open) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4390 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4391 | lemma affine_hull_halfspace_le: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4392 | fixes a :: "'a::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4393 |   shows "affine hull {x. a \<bullet> x \<le> r} = (if a = 0 \<and> r < 0 then {} else UNIV)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4394 | proof (cases "a = 0") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4395 | case True then show ?thesis by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4396 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4397 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4398 |   then have "affine hull closure {x. a \<bullet> x < r} = UNIV"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4399 | using affine_hull_halfspace_lt closure_same_affine_hull by fastforce | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4400 |   moreover have "{x. a \<bullet> x < r} \<subseteq> {x. a \<bullet> x \<le> r}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4401 | by (simp add: Collect_mono) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4402 | ultimately show ?thesis using False antisym_conv hull_mono top_greatest | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4403 | by (metis affine_hull_halfspace_lt) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4404 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4405 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4406 | lemma affine_hull_halfspace_gt: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4407 | fixes a :: "'a::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4408 |   shows "affine hull {x. a \<bullet> x > r} = (if a = 0 \<and> r \<ge> 0 then {} else UNIV)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4409 | using halfspace_eq_empty_gt [of r a] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4410 | by (simp add: open_halfspace_gt affine_hull_open) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4411 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4412 | lemma affine_hull_halfspace_ge: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4413 | fixes a :: "'a::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4414 |   shows "affine hull {x. a \<bullet> x \<ge> r} = (if a = 0 \<and> r > 0 then {} else UNIV)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4415 | using affine_hull_halfspace_le [of "-a" "-r"] by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4416 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4417 | lemma aff_dim_halfspace_lt: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4418 | fixes a :: "'a::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4419 |   shows "aff_dim {x. a \<bullet> x < r} =
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4420 |         (if a = 0 \<and> r \<le> 0 then -1 else DIM('a))"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4421 | by simp (metis aff_dim_open halfspace_eq_empty_lt open_halfspace_lt) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4422 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4423 | lemma aff_dim_halfspace_le: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4424 | fixes a :: "'a::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4425 |   shows "aff_dim {x. a \<bullet> x \<le> r} =
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4426 |         (if a = 0 \<and> r < 0 then -1 else DIM('a))"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4427 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4428 |   have "int (DIM('a)) = aff_dim (UNIV::'a set)"
 | 
| 71176 | 4429 | by (simp) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4430 |   then have "aff_dim (affine hull {x. a \<bullet> x \<le> r}) = DIM('a)" if "(a = 0 \<longrightarrow> r \<ge> 0)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4431 | using that by (simp add: affine_hull_halfspace_le not_less) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4432 | then show ?thesis | 
| 71176 | 4433 | by (force) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4434 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4435 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4436 | lemma aff_dim_halfspace_gt: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4437 | fixes a :: "'a::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4438 |   shows "aff_dim {x. a \<bullet> x > r} =
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4439 |         (if a = 0 \<and> r \<ge> 0 then -1 else DIM('a))"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4440 | by simp (metis aff_dim_open halfspace_eq_empty_gt open_halfspace_gt) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4441 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4442 | lemma aff_dim_halfspace_ge: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4443 | fixes a :: "'a::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4444 |   shows "aff_dim {x. a \<bullet> x \<ge> r} =
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4445 |         (if a = 0 \<and> r > 0 then -1 else DIM('a))"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4446 | using aff_dim_halfspace_le [of "-a" "-r"] by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4447 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4448 | proposition aff_dim_eq_hyperplane: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4449 | fixes S :: "'a::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4450 |   shows "aff_dim S = DIM('a) - 1 \<longleftrightarrow> (\<exists>a b. a \<noteq> 0 \<and> affine hull S = {x. a \<bullet> x = b})"
 | 
| 72567 | 4451 | (is "?lhs = ?rhs") | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4452 | proof (cases "S = {}")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4453 | case True then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4454 | by (auto simp: dest: hyperplane_eq_Ex) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4455 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4456 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4457 | then obtain c where "c \<in> S" by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4458 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4459 | proof (cases "c = 0") | 
| 72567 | 4460 | case True | 
| 4461 |     have "?lhs \<longleftrightarrow> (\<exists>a. a \<noteq> 0 \<and> span ((\<lambda>x. x - c) ` S) = {x. a \<bullet> x = 0})"
 | |
| 4462 | by (simp add: aff_dim_eq_dim [of c] \<open>c \<in> S\<close> hull_inc dim_eq_hyperplane del: One_nat_def) | |
| 4463 | also have "... \<longleftrightarrow> ?rhs" | |
| 4464 | using span_zero [of S] True \<open>c \<in> S\<close> affine_hull_span_0 hull_inc | |
| 4465 | by (fastforce simp add: affine_hull_span_gen [of c] \<open>c = 0\<close>) | |
| 4466 | finally show ?thesis . | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4467 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4468 | case False | 
| 67399 | 4469 |     have xc_im: "x \<in> (+) c ` {y. a \<bullet> y = 0}" if "a \<bullet> x = a \<bullet> c" for a x
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4470 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4471 | have "\<exists>y. a \<bullet> y = 0 \<and> c + y = x" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4472 | by (metis that add.commute diff_add_cancel inner_commute inner_diff_left right_minus_eq) | 
| 67399 | 4473 |       then show "x \<in> (+) c ` {y. a \<bullet> y = 0}"
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4474 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4475 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4476 |     have 2: "span ((\<lambda>x. x - c) ` S) = {x. a \<bullet> x = 0}"
 | 
| 67399 | 4477 |          if "(+) c ` span ((\<lambda>x. x - c) ` S) = {x. a \<bullet> x = b}" for a b
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4478 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4479 | have "b = a \<bullet> c" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4480 | using span_0 that by fastforce | 
| 67399 | 4481 |       with that have "(+) c ` span ((\<lambda>x. x - c) ` S) = {x. a \<bullet> x = a \<bullet> c}"
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4482 | by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4483 |       then have "span ((\<lambda>x. x - c) ` S) = (\<lambda>x. x - c) ` {x. a \<bullet> x = a \<bullet> c}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4484 | by (metis (no_types) image_cong translation_galois uminus_add_conv_diff) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4485 |       also have "... = {x. a \<bullet> x = 0}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4486 | by (force simp: inner_distrib inner_diff_right | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4487 | intro: image_eqI [where x="x+c" for x]) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4488 | finally show ?thesis . | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4489 | qed | 
| 72567 | 4490 |     have "?lhs = (\<exists>a. a \<noteq> 0 \<and> span ((\<lambda>x. x - c) ` S) = {x. a \<bullet> x = 0})"
 | 
| 4491 | by (simp add: aff_dim_eq_dim [of c] \<open>c \<in> S\<close> hull_inc dim_eq_hyperplane del: One_nat_def) | |
| 4492 | also have "... = ?rhs" | |
| 4493 | by (fastforce simp add: affine_hull_span_gen [of c] \<open>c \<in> S\<close> hull_inc inner_distrib intro: xc_im intro!: 2) | |
| 4494 | finally show ?thesis . | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4495 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4496 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4497 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4498 | corollary aff_dim_hyperplane [simp]: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4499 | fixes a :: "'a::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4500 |   shows "a \<noteq> 0 \<Longrightarrow> aff_dim {x. a \<bullet> x = r} = DIM('a) - 1"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4501 | by (metis aff_dim_eq_hyperplane affine_hull_eq affine_hyperplane) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4502 | |
| 70136 | 4503 | subsection\<^marker>\<open>tag unimportant\<close>\<open>Some stepping theorems\<close> | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4504 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4505 | lemma aff_dim_insert: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4506 | fixes a :: "'a::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4507 | shows "aff_dim (insert a S) = (if a \<in> affine hull S then aff_dim S else aff_dim S + 1)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4508 | proof (cases "S = {}")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4509 | case True then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4510 | by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4511 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4512 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4513 | then obtain x s' where S: "S = insert x s'" "x \<notin> s'" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4514 | by (meson Set.set_insert all_not_in_conv) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4515 | show ?thesis using S | 
| 72238 | 4516 | by (force simp add: affine_hull_insert_span_gen span_zero insert_commute [of a] aff_dim_eq_dim [of x] dim_insert) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4517 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4518 | |
| 66297 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4519 | lemma affine_dependent_choose: | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4520 | fixes a :: "'a :: euclidean_space" | 
| 69508 | 4521 | assumes "\<not>(affine_dependent S)" | 
| 66297 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4522 | shows "affine_dependent(insert a S) \<longleftrightarrow> a \<notin> S \<and> a \<in> affine hull S" | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4523 | (is "?lhs = ?rhs") | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4524 | proof safe | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4525 | assume "affine_dependent (insert a S)" and "a \<in> S" | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4526 | then show "False" | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4527 | using \<open>a \<in> S\<close> assms insert_absorb by fastforce | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4528 | next | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4529 | assume lhs: "affine_dependent (insert a S)" | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4530 | then have "a \<notin> S" | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4531 | by (metis (no_types) assms insert_absorb) | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4532 | moreover have "finite S" | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4533 | using affine_independent_iff_card assms by blast | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4534 | moreover have "aff_dim (insert a S) \<noteq> int (card S)" | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4535 | using \<open>finite S\<close> affine_independent_iff_card \<open>a \<notin> S\<close> lhs by fastforce | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4536 | ultimately show "a \<in> affine hull S" | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4537 | by (metis aff_dim_affine_independent aff_dim_insert assms) | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4538 | next | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4539 | assume "a \<notin> S" and "a \<in> affine hull S" | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4540 | show "affine_dependent (insert a S)" | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4541 | by (simp add: \<open>a \<in> affine hull S\<close> \<open>a \<notin> S\<close> affine_dependent_def) | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4542 | qed | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4543 | |
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4544 | lemma affine_independent_insert: | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4545 | fixes a :: "'a :: euclidean_space" | 
| 69508 | 4546 | shows "\<lbrakk>\<not> affine_dependent S; a \<notin> affine hull S\<rbrakk> \<Longrightarrow> \<not> affine_dependent(insert a S)" | 
| 66297 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4547 | by (simp add: affine_dependent_choose) | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4548 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4549 | lemma subspace_bounded_eq_trivial: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4550 | fixes S :: "'a::real_normed_vector set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4551 | assumes "subspace S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4552 |     shows "bounded S \<longleftrightarrow> S = {0}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4553 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4554 | have "False" if "bounded S" "x \<in> S" "x \<noteq> 0" for x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4555 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4556 | obtain B where B: "\<And>y. y \<in> S \<Longrightarrow> norm y < B" "B > 0" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4557 | using \<open>bounded S\<close> by (force simp: bounded_pos_less) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4558 | have "(B / norm x) *\<^sub>R x \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4559 | using assms subspace_mul \<open>x \<in> S\<close> by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4560 | moreover have "norm ((B / norm x) *\<^sub>R x) = B" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4561 | using that B by (simp add: algebra_simps) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4562 | ultimately show False using B by force | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4563 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4564 |   then have "bounded S \<Longrightarrow> S = {0}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4565 | using assms subspace_0 by fastforce | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4566 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4567 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4568 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4569 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4570 | lemma affine_bounded_eq_trivial: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4571 | fixes S :: "'a::real_normed_vector set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4572 | assumes "affine S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4573 |     shows "bounded S \<longleftrightarrow> S = {} \<or> (\<exists>a. S = {a})"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4574 | proof (cases "S = {}")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4575 | case True then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4576 | by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4577 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4578 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4579 | then obtain b where "b \<in> S" by blast | 
| 72238 | 4580 | with False assms | 
| 4581 |   have "bounded S \<Longrightarrow> S = {b}"
 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4582 | using affine_diffs_subspace [OF assms \<open>b \<in> S\<close>] | 
| 72238 | 4583 | by (metis (no_types, lifting) ab_group_add_class.ab_left_minus bounded_translation image_empty image_insert subspace_bounded_eq_trivial translation_invert) | 
| 4584 | then show ?thesis by auto | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4585 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4586 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4587 | lemma affine_bounded_eq_lowdim: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4588 | fixes S :: "'a::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4589 | assumes "affine S" | 
| 72238 | 4590 | shows "bounded S \<longleftrightarrow> aff_dim S \<le> 0" | 
| 4591 | proof | |
| 4592 | show "aff_dim S \<le> 0 \<Longrightarrow> bounded S" | |
| 4593 | by (metis aff_dim_sing aff_dim_subset affine_dim_equal affine_sing all_not_in_conv assms bounded_empty bounded_insert dual_order.antisym empty_subsetI insert_subset) | |
| 4594 | qed (use affine_bounded_eq_trivial assms in fastforce) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4595 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4596 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4597 | lemma bounded_hyperplane_eq_trivial_0: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4598 | fixes a :: "'a::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4599 | assumes "a \<noteq> 0" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4600 |   shows "bounded {x. a \<bullet> x = 0} \<longleftrightarrow> DIM('a) = 1"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4601 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4602 |   assume "bounded {x. a \<bullet> x = 0}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4603 |   then have "aff_dim {x. a \<bullet> x = 0} \<le> 0"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4604 | by (simp add: affine_bounded_eq_lowdim affine_hyperplane) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4605 |   with assms show "DIM('a) = 1"
 | 
| 71176 | 4606 | by (simp add: le_Suc_eq) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4607 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4608 |   assume "DIM('a) = 1"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4609 |   then show "bounded {x. a \<bullet> x = 0}"
 | 
| 71176 | 4610 | by (simp add: affine_bounded_eq_lowdim affine_hyperplane assms) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4611 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4612 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4613 | lemma bounded_hyperplane_eq_trivial: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4614 | fixes a :: "'a::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4615 |   shows "bounded {x. a \<bullet> x = r} \<longleftrightarrow> (if a = 0 then r \<noteq> 0 else DIM('a) = 1)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4616 | proof (simp add: bounded_hyperplane_eq_trivial_0, clarify) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4617 | assume "r \<noteq> 0" "a \<noteq> 0" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4618 |   have "aff_dim {x. y \<bullet> x = 0} = aff_dim {x. a \<bullet> x = r}" if "y \<noteq> 0" for y::'a
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4619 | by (metis that \<open>a \<noteq> 0\<close> aff_dim_hyperplane) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4620 |   then show "bounded {x. a \<bullet> x = r} = (DIM('a) = Suc 0)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4621 | by (metis One_nat_def \<open>a \<noteq> 0\<close> affine_bounded_eq_lowdim affine_hyperplane bounded_hyperplane_eq_trivial_0) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4622 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4623 | |
| 70136 | 4624 | subsection\<^marker>\<open>tag unimportant\<close>\<open>General case without assuming closure and getting non-strict separation\<close> | 
| 4625 | ||
| 4626 | proposition\<^marker>\<open>tag unimportant\<close> separating_hyperplane_closed_point_inset: | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4627 | fixes S :: "'a::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4628 |   assumes "convex S" "closed S" "S \<noteq> {}" "z \<notin> S"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4629 | obtains a b where "a \<in> S" "(a - z) \<bullet> z < b" "\<And>x. x \<in> S \<Longrightarrow> b < (a - z) \<bullet> x" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4630 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4631 | obtain y where "y \<in> S" and y: "\<And>u. u \<in> S \<Longrightarrow> dist z y \<le> dist z u" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4632 | using distance_attains_inf [of S z] assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4633 | then have *: "(y - z) \<bullet> z < (y - z) \<bullet> z + (norm (y - z))\<^sup>2 / 2" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4634 | using \<open>y \<in> S\<close> \<open>z \<notin> S\<close> by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4635 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4636 | proof (rule that [OF \<open>y \<in> S\<close> *]) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4637 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4638 | assume "x \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4639 | have yz: "0 < (y - z) \<bullet> (y - z)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4640 | using \<open>y \<in> S\<close> \<open>z \<notin> S\<close> by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4641 |     { assume 0: "0 < ((z - y) \<bullet> (x - y))"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4642 | with any_closest_point_dot [OF \<open>convex S\<close> \<open>closed S\<close>] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4643 | have False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4644 | using y \<open>x \<in> S\<close> \<open>y \<in> S\<close> not_less by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4645 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4646 | then have "0 \<le> ((y - z) \<bullet> (x - y))" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4647 | by (force simp: not_less inner_diff_left) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4648 | with yz have "0 < 2 * ((y - z) \<bullet> (x - y)) + (y - z) \<bullet> (y - z)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4649 | by (simp add: algebra_simps) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4650 | then show "(y - z) \<bullet> z + (norm (y - z))\<^sup>2 / 2 < (y - z) \<bullet> x" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4651 | by (simp add: field_simps inner_diff_left inner_diff_right dot_square_norm [symmetric]) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4652 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4653 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4654 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4655 | lemma separating_hyperplane_closed_0_inset: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4656 | fixes S :: "'a::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4657 |   assumes "convex S" "closed S" "S \<noteq> {}" "0 \<notin> S"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4658 | obtains a b where "a \<in> S" "a \<noteq> 0" "0 < b" "\<And>x. x \<in> S \<Longrightarrow> a \<bullet> x > b" | 
| 72238 | 4659 | using separating_hyperplane_closed_point_inset [OF assms] by simp (metis \<open>0 \<notin> S\<close>) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4660 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4661 | |
| 70136 | 4662 | proposition\<^marker>\<open>tag unimportant\<close> separating_hyperplane_set_0_inspan: | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4663 | fixes S :: "'a::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4664 |   assumes "convex S" "S \<noteq> {}" "0 \<notin> S"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4665 | obtains a where "a \<in> span S" "a \<noteq> 0" "\<And>x. x \<in> S \<Longrightarrow> 0 \<le> a \<bullet> x" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4666 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4667 |   define k where [abs_def]: "k c = {x. 0 \<le> c \<bullet> x}" for c :: 'a
 | 
| 72238 | 4668 |   have "span S \<inter> frontier (cball 0 1) \<inter> \<Inter>f' \<noteq> {}"
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4669 | if f': "finite f'" "f' \<subseteq> k ` S" for f' | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4670 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4671 | obtain C where "C \<subseteq> S" "finite C" and C: "f' = k ` C" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4672 | using finite_subset_image [OF f'] by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4673 | obtain a where "a \<in> S" "a \<noteq> 0" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4674 |       using \<open>S \<noteq> {}\<close> \<open>0 \<notin> S\<close> ex_in_conv by blast
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4675 | then have "norm (a /\<^sub>R (norm a)) = 1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4676 | by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4677 | moreover have "a /\<^sub>R (norm a) \<in> span S" | 
| 68072 
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
 immler parents: 
67990diff
changeset | 4678 | by (simp add: \<open>a \<in> S\<close> span_scale span_base) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4679 | ultimately have ass: "a /\<^sub>R (norm a) \<in> span S \<inter> sphere 0 1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4680 | by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4681 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4682 |     proof (cases "C = {}")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4683 | case True with C ass show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4684 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4685 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4686 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4687 | have "closed (convex hull C)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4688 | using \<open>finite C\<close> compact_eq_bounded_closed finite_imp_compact_convex_hull by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4689 |       moreover have "convex hull C \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4690 | by (simp add: False) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4691 | moreover have "0 \<notin> convex hull C" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4692 | by (metis \<open>C \<subseteq> S\<close> \<open>convex S\<close> \<open>0 \<notin> S\<close> convex_hull_subset hull_same insert_absorb insert_subset) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4693 | ultimately obtain a b | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4694 | where "a \<in> convex hull C" "a \<noteq> 0" "0 < b" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4695 | and ab: "\<And>x. x \<in> convex hull C \<Longrightarrow> a \<bullet> x > b" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4696 | using separating_hyperplane_closed_0_inset by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4697 | then have "a \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4698 | by (metis \<open>C \<subseteq> S\<close> assms(1) subsetCE subset_hull) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4699 | moreover have "norm (a /\<^sub>R (norm a)) = 1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4700 | using \<open>a \<noteq> 0\<close> by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4701 | moreover have "a /\<^sub>R (norm a) \<in> span S" | 
| 68072 
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
 immler parents: 
67990diff
changeset | 4702 | by (simp add: \<open>a \<in> S\<close> span_scale span_base) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4703 | ultimately have ass: "a /\<^sub>R (norm a) \<in> span S \<inter> sphere 0 1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4704 | by simp | 
| 72238 | 4705 | have "\<And>x. \<lbrakk>a \<noteq> 0; x \<in> C\<rbrakk> \<Longrightarrow> 0 \<le> x \<bullet> a" | 
| 4706 | using ab \<open>0 < b\<close> by (metis hull_inc inner_commute less_eq_real_def less_trans) | |
| 4707 |       then have aa: "a /\<^sub>R (norm a) \<in> (\<Inter>c\<in>C. {x. 0 \<le> c \<bullet> x})"
 | |
| 4708 | by (auto simp add: field_split_simps) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4709 | show ?thesis | 
| 72238 | 4710 | unfolding C k_def | 
| 4711 | using ass aa Int_iff empty_iff by force | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4712 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4713 | qed | 
| 72238 | 4714 | moreover have "\<And>T. T \<in> k ` S \<Longrightarrow> closed T" | 
| 4715 | using closed_halfspace_ge k_def by blast | |
| 4716 |   ultimately have "(span S \<inter> frontier(cball 0 1)) \<inter> (\<Inter> (k ` S)) \<noteq> {}"
 | |
| 4717 | by (metis compact_imp_fip closed_Int_compact closed_span compact_cball compact_frontier) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4718 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4719 | unfolding set_eq_iff k_def | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4720 | by simp (metis inner_commute norm_eq_zero that zero_neq_one) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4721 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4722 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4723 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4724 | lemma separating_hyperplane_set_point_inaff: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4725 | fixes S :: "'a::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4726 |   assumes "convex S" "S \<noteq> {}" and zno: "z \<notin> S"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4727 | obtains a b where "(z + a) \<in> affine hull (insert z S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4728 | and "a \<noteq> 0" and "a \<bullet> z \<le> b" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4729 | and "\<And>x. x \<in> S \<Longrightarrow> a \<bullet> x \<ge> b" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4730 | proof - | 
| 69661 | 4731 | from separating_hyperplane_set_0_inspan [of "image (\<lambda>x. -z + x) S"] | 
| 67399 | 4732 | have "convex ((+) (- z) ` S)" | 
| 69661 | 4733 | using \<open>convex S\<close> by simp | 
| 67399 | 4734 |   moreover have "(+) (- z) ` S \<noteq> {}"
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4735 |     by (simp add: \<open>S \<noteq> {}\<close>)
 | 
| 67399 | 4736 | moreover have "0 \<notin> (+) (- z) ` S" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4737 | using zno by auto | 
| 67399 | 4738 | ultimately obtain a where "a \<in> span ((+) (- z) ` S)" "a \<noteq> 0" | 
| 4739 | and a: "\<And>x. x \<in> ((+) (- z) ` S) \<Longrightarrow> 0 \<le> a \<bullet> x" | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4740 | using separating_hyperplane_set_0_inspan [of "image (\<lambda>x. -z + x) S"] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4741 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4742 | then have szx: "\<And>x. x \<in> S \<Longrightarrow> a \<bullet> z \<le> a \<bullet> x" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4743 | by (metis (no_types, lifting) imageI inner_minus_right inner_right_distrib minus_add neg_le_0_iff_le neg_le_iff_le real_add_le_0_iff) | 
| 72238 | 4744 | moreover | 
| 4745 | have "z + a \<in> affine hull insert z S" | |
| 4746 | using \<open>a \<in> span ((+) (- z) ` S)\<close> affine_hull_insert_span_gen by blast | |
| 4747 | ultimately show ?thesis | |
| 4748 | using \<open>a \<noteq> 0\<close> szx that by auto | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4749 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4750 | |
| 70136 | 4751 | proposition\<^marker>\<open>tag unimportant\<close> supporting_hyperplane_rel_boundary: | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4752 | fixes S :: "'a::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4753 | assumes "convex S" "x \<in> S" and xno: "x \<notin> rel_interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4754 | obtains a where "a \<noteq> 0" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4755 | and "\<And>y. y \<in> S \<Longrightarrow> a \<bullet> x \<le> a \<bullet> y" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4756 | and "\<And>y. y \<in> rel_interior S \<Longrightarrow> a \<bullet> x < a \<bullet> y" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4757 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4758 | obtain a b where aff: "(x + a) \<in> affine hull (insert x (rel_interior S))" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4759 | and "a \<noteq> 0" and "a \<bullet> x \<le> b" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4760 | and ageb: "\<And>u. u \<in> (rel_interior S) \<Longrightarrow> a \<bullet> u \<ge> b" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4761 | using separating_hyperplane_set_point_inaff [of "rel_interior S" x] assms | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4762 | by (auto simp: rel_interior_eq_empty convex_rel_interior) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4763 | have le_ay: "a \<bullet> x \<le> a \<bullet> y" if "y \<in> S" for y | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4764 | proof - | 
| 67399 | 4765 | have con: "continuous_on (closure (rel_interior S)) ((\<bullet>) a)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4766 | by (rule continuous_intros continuous_on_subset | blast)+ | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4767 | have y: "y \<in> closure (rel_interior S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4768 | using \<open>convex S\<close> closure_def convex_closure_rel_interior \<open>y \<in> S\<close> | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4769 | by fastforce | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4770 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4771 | using continuous_ge_on_closure [OF con y] ageb \<open>a \<bullet> x \<le> b\<close> | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4772 | by fastforce | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4773 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4774 | have 3: "a \<bullet> x < a \<bullet> y" if "y \<in> rel_interior S" for y | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4775 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4776 | obtain e where "0 < e" "y \<in> S" and e: "cball y e \<inter> affine hull S \<subseteq> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4777 | using \<open>y \<in> rel_interior S\<close> by (force simp: rel_interior_cball) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4778 | define y' where "y' = y - (e / norm a) *\<^sub>R ((x + a) - x)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4779 | have "y' \<in> cball y e" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4780 | unfolding y'_def using \<open>0 < e\<close> by force | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4781 | moreover have "y' \<in> affine hull S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4782 | unfolding y'_def | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4783 | by (metis \<open>x \<in> S\<close> \<open>y \<in> S\<close> \<open>convex S\<close> aff affine_affine_hull hull_redundant | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4784 | rel_interior_same_affine_hull hull_inc mem_affine_3_minus2) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4785 | ultimately have "y' \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4786 | using e by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4787 | have "a \<bullet> x \<le> a \<bullet> y" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4788 | using le_ay \<open>a \<noteq> 0\<close> \<open>y \<in> S\<close> by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4789 | moreover have "a \<bullet> x \<noteq> a \<bullet> y" | 
| 72238 | 4790 | using le_ay [OF \<open>y' \<in> S\<close>] \<open>a \<noteq> 0\<close> \<open>0 < e\<close> not_le | 
| 4791 | by (fastforce simp add: y'_def inner_diff dot_square_norm power2_eq_square) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4792 | ultimately show ?thesis by force | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4793 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4794 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4795 | by (rule that [OF \<open>a \<noteq> 0\<close> le_ay 3]) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4796 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4797 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4798 | lemma supporting_hyperplane_relative_frontier: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4799 | fixes S :: "'a::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4800 | assumes "convex S" "x \<in> closure S" "x \<notin> rel_interior S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4801 | obtains a where "a \<noteq> 0" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4802 | and "\<And>y. y \<in> closure S \<Longrightarrow> a \<bullet> x \<le> a \<bullet> y" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4803 | and "\<And>y. y \<in> rel_interior S \<Longrightarrow> a \<bullet> x < a \<bullet> y" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4804 | using supporting_hyperplane_rel_boundary [of "closure S" x] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4805 | by (metis assms convex_closure convex_rel_interior_closure) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4806 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4807 | |
| 70136 | 4808 | subsection\<^marker>\<open>tag unimportant\<close>\<open> Some results on decomposing convex hulls: intersections, simplicial subdivision\<close> | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4809 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4810 | lemma | 
| 72567 | 4811 | fixes S :: "'a::euclidean_space set" | 
| 4812 | assumes "\<not> affine_dependent(S \<union> T)" | |
| 4813 | shows convex_hull_Int_subset: "convex hull S \<inter> convex hull T \<subseteq> convex hull (S \<inter> T)" (is ?C) | |
| 4814 | and affine_hull_Int_subset: "affine hull S \<inter> affine hull T \<subseteq> affine hull (S \<inter> T)" (is ?A) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4815 | proof - | 
| 72567 | 4816 | have [simp]: "finite S" "finite T" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4817 | using aff_independent_finite assms by blast+ | 
| 72567 | 4818 | have "sum u (S \<inter> T) = 1 \<and> | 
| 4819 | (\<Sum>v\<in>S \<inter> T. u v *\<^sub>R v) = (\<Sum>v\<in>S. u v *\<^sub>R v)" | |
| 4820 | if [simp]: "sum u S = 1" | |
| 4821 | "sum v T = 1" | |
| 4822 | and eq: "(\<Sum>x\<in>T. v x *\<^sub>R x) = (\<Sum>x\<in>S. u x *\<^sub>R x)" for u v | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4823 | proof - | 
| 72567 | 4824 | define f where "f x = (if x \<in> S then u x else 0) - (if x \<in> T then v x else 0)" for x | 
| 4825 | have "sum f (S \<union> T) = 0" | |
| 4826 | by (simp add: f_def sum_Un sum_subtractf flip: sum.inter_restrict) | |
| 4827 | moreover have "(\<Sum>x\<in>(S \<union> T). f x *\<^sub>R x) = 0" | |
| 4828 | by (simp add: eq f_def sum_Un scaleR_left_diff_distrib sum_subtractf if_smult flip: sum.inter_restrict cong: if_cong) | |
| 4829 | ultimately have "\<And>v. v \<in> S \<union> T \<Longrightarrow> f v = 0" | |
| 4830 | using aff_independent_finite assms unfolding affine_dependent_explicit | |
| 4831 | by blast | |
| 4832 | then have u [simp]: "\<And>x. x \<in> S \<Longrightarrow> u x = (if x \<in> T then v x else 0)" | |
| 4833 | by (simp add: f_def) presburger | |
| 4834 | have "sum u (S \<inter> T) = sum u S" | |
| 4835 | by (simp add: sum.inter_restrict) | |
| 4836 | then have "sum u (S \<inter> T) = 1" | |
| 4837 | using that by linarith | |
| 4838 | moreover have "(\<Sum>v\<in>S \<inter> T. u v *\<^sub>R v) = (\<Sum>v\<in>S. u v *\<^sub>R v)" | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4839 | by (auto simp: if_smult sum.inter_restrict intro: sum.cong) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4840 | ultimately show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4841 | by force | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4842 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4843 | then show ?A ?C | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4844 | by (auto simp: convex_hull_finite affine_hull_finite) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4845 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4846 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4847 | |
| 70136 | 4848 | proposition\<^marker>\<open>tag unimportant\<close> affine_hull_Int: | 
| 72567 | 4849 | fixes S :: "'a::euclidean_space set" | 
| 4850 | assumes "\<not> affine_dependent(S \<union> T)" | |
| 4851 | shows "affine hull (S \<inter> T) = affine hull S \<inter> affine hull T" | |
| 72238 | 4852 | by (simp add: affine_hull_Int_subset assms hull_mono subset_antisym) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4853 | |
| 70136 | 4854 | proposition\<^marker>\<open>tag unimportant\<close> convex_hull_Int: | 
| 72567 | 4855 | fixes S :: "'a::euclidean_space set" | 
| 4856 | assumes "\<not> affine_dependent(S \<union> T)" | |
| 4857 | shows "convex hull (S \<inter> T) = convex hull S \<inter> convex hull T" | |
| 72238 | 4858 | by (simp add: convex_hull_Int_subset assms hull_mono subset_antisym) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4859 | |
| 70136 | 4860 | proposition\<^marker>\<open>tag unimportant\<close> | 
| 72567 | 4861 | fixes S :: "'a::euclidean_space set set" | 
| 4862 | assumes "\<not> affine_dependent (\<Union>S)" | |
| 4863 | shows affine_hull_Inter: "affine hull (\<Inter>S) = (\<Inter>T\<in>S. affine hull T)" (is "?A") | |
| 4864 | and convex_hull_Inter: "convex hull (\<Inter>S) = (\<Inter>T\<in>S. convex hull T)" (is "?C") | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4865 | proof - | 
| 72567 | 4866 | have "finite S" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4867 | using aff_independent_finite assms finite_UnionD by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4868 | then have "?A \<and> ?C" using assms | 
| 72567 | 4869 | proof (induction S rule: finite_induct) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4870 | case empty then show ?case by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4871 | next | 
| 72567 | 4872 | case (insert T F) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4873 | then show ?case | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4874 |     proof (cases "F={}")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4875 | case True then show ?thesis by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4876 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4877 | case False | 
| 72567 | 4878 | with "insert.prems" have [simp]: "\<not> affine_dependent (T \<union> \<Inter>F)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4879 | by (auto intro: affine_dependent_subset) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4880 | have [simp]: "\<not> affine_dependent (\<Union>F)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4881 | using affine_independent_subset insert.prems by fastforce | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4882 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4883 | by (simp add: affine_hull_Int convex_hull_Int insert.IH) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4884 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4885 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4886 | then show "?A" "?C" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4887 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4888 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4889 | |
| 70136 | 4890 | proposition\<^marker>\<open>tag unimportant\<close> in_convex_hull_exchange_unique: | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4891 | fixes S :: "'a::euclidean_space set" | 
| 69508 | 4892 | assumes naff: "\<not> affine_dependent S" and a: "a \<in> convex hull S" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4893 | and S: "T \<subseteq> S" "T' \<subseteq> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4894 | and x: "x \<in> convex hull (insert a T)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4895 | and x': "x \<in> convex hull (insert a T')" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4896 | shows "x \<in> convex hull (insert a (T \<inter> T'))" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4897 | proof (cases "a \<in> S") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4898 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4899 | then have "\<not> affine_dependent (insert a T \<union> insert a T')" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4900 | using affine_dependent_subset assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4901 | then have "x \<in> convex hull (insert a T \<inter> insert a T')" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4902 | by (metis IntI convex_hull_Int x x') | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4903 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4904 | by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4905 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4906 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4907 | then have anot: "a \<notin> T" "a \<notin> T'" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4908 | using assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4909 | have [simp]: "finite S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4910 | by (simp add: aff_independent_finite assms) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4911 | then obtain b where b0: "\<And>s. s \<in> S \<Longrightarrow> 0 \<le> b s" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4912 | and b1: "sum b S = 1" and aeq: "a = (\<Sum>s\<in>S. b s *\<^sub>R s)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4913 | using a by (auto simp: convex_hull_finite) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4914 | have fin [simp]: "finite T" "finite T'" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4915 | using assms infinite_super \<open>finite S\<close> by blast+ | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4916 | then obtain c c' where c0: "\<And>t. t \<in> insert a T \<Longrightarrow> 0 \<le> c t" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4917 | and c1: "sum c (insert a T) = 1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4918 | and xeq: "x = (\<Sum>t \<in> insert a T. c t *\<^sub>R t)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4919 | and c'0: "\<And>t. t \<in> insert a T' \<Longrightarrow> 0 \<le> c' t" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4920 | and c'1: "sum c' (insert a T') = 1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4921 | and x'eq: "x = (\<Sum>t \<in> insert a T'. c' t *\<^sub>R t)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4922 | using x x' by (auto simp: convex_hull_finite) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4923 | with fin anot | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4924 | have sumTT': "sum c T = 1 - c a" "sum c' T' = 1 - c' a" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4925 | and wsumT: "(\<Sum>t \<in> T. c t *\<^sub>R t) = x - c a *\<^sub>R a" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4926 | by simp_all | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4927 | have wsumT': "(\<Sum>t \<in> T'. c' t *\<^sub>R t) = x - c' a *\<^sub>R a" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4928 | using x'eq fin anot by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4929 | define cc where "cc \<equiv> \<lambda>x. if x \<in> T then c x else 0" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4930 | define cc' where "cc' \<equiv> \<lambda>x. if x \<in> T' then c' x else 0" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4931 | define dd where "dd \<equiv> \<lambda>x. cc x - cc' x + (c a - c' a) * b x" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4932 | have sumSS': "sum cc S = 1 - c a" "sum cc' S = 1 - c' a" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4933 | unfolding cc_def cc'_def using S | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4934 | by (simp_all add: Int_absorb1 Int_absorb2 sum_subtractf sum.inter_restrict [symmetric] sumTT') | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4935 | have wsumSS: "(\<Sum>t \<in> S. cc t *\<^sub>R t) = x - c a *\<^sub>R a" "(\<Sum>t \<in> S. cc' t *\<^sub>R t) = x - c' a *\<^sub>R a" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4936 | unfolding cc_def cc'_def using S | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4937 | by (simp_all add: Int_absorb1 Int_absorb2 if_smult sum.inter_restrict [symmetric] wsumT wsumT' cong: if_cong) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4938 | have sum_dd0: "sum dd S = 0" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4939 | unfolding dd_def using S | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4940 | by (simp add: sumSS' comm_monoid_add_class.sum.distrib sum_subtractf | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4941 | algebra_simps sum_distrib_right [symmetric] b1) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4942 | have "(\<Sum>v\<in>S. (b v * x) *\<^sub>R v) = x *\<^sub>R (\<Sum>v\<in>S. b v *\<^sub>R v)" for x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4943 | by (simp add: pth_5 real_vector.scale_sum_right mult.commute) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4944 | then have *: "(\<Sum>v\<in>S. (b v * x) *\<^sub>R v) = x *\<^sub>R a" for x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4945 | using aeq by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4946 | have "(\<Sum>v \<in> S. dd v *\<^sub>R v) = 0" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4947 | unfolding dd_def using S | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4948 | by (simp add: * wsumSS sum.distrib sum_subtractf algebra_simps) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4949 | then have dd0: "dd v = 0" if "v \<in> S" for v | 
| 72238 | 4950 | using naff [unfolded affine_dependent_explicit not_ex, rule_format, of S dd] | 
| 4951 | using that sum_dd0 by force | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4952 | consider "c' a \<le> c a" | "c a \<le> c' a" by linarith | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4953 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4954 | proof cases | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4955 | case 1 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4956 | then have "sum cc S \<le> sum cc' S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4957 | by (simp add: sumSS') | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4958 | then have le: "cc x \<le> cc' x" if "x \<in> S" for x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4959 | using dd0 [OF that] 1 b0 mult_left_mono that | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4960 | by (fastforce simp add: dd_def algebra_simps) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4961 | have cc0: "cc x = 0" if "x \<in> S" "x \<notin> T \<inter> T'" for x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4962 | using le [OF \<open>x \<in> S\<close>] that c0 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4963 | by (force simp: cc_def cc'_def split: if_split_asm) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4964 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4965 | proof (simp add: convex_hull_finite, intro exI conjI) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4966 | show "\<forall>x\<in>T \<inter> T'. 0 \<le> (cc(a := c a)) x" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4967 | by (simp add: c0 cc_def) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4968 | show "0 \<le> (cc(a := c a)) a" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4969 | by (simp add: c0) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4970 | have "sum (cc(a := c a)) (insert a (T \<inter> T')) = c a + sum (cc(a := c a)) (T \<inter> T')" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4971 | by (simp add: anot) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4972 | also have "... = c a + sum (cc(a := c a)) S" | 
| 72238 | 4973 | using \<open>T \<subseteq> S\<close> False cc0 cc_def \<open>a \<notin> S\<close> by (fastforce intro!: sum.mono_neutral_left split: if_split_asm) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4974 | also have "... = c a + (1 - c a)" | 
| 71633 | 4975 | by (metis \<open>a \<notin> S\<close> fun_upd_other sum.cong sumSS'(1)) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4976 | finally show "sum (cc(a := c a)) (insert a (T \<inter> T')) = 1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4977 | by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4978 | have "(\<Sum>x\<in>insert a (T \<inter> T'). (cc(a := c a)) x *\<^sub>R x) = c a *\<^sub>R a + (\<Sum>x \<in> T \<inter> T'. (cc(a := c a)) x *\<^sub>R x)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4979 | by (simp add: anot) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4980 | also have "... = c a *\<^sub>R a + (\<Sum>x \<in> S. (cc(a := c a)) x *\<^sub>R x)" | 
| 72238 | 4981 | using \<open>T \<subseteq> S\<close> False cc0 by (fastforce intro!: sum.mono_neutral_left split: if_split_asm) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4982 | also have "... = c a *\<^sub>R a + x - c a *\<^sub>R a" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4983 | by (simp add: wsumSS \<open>a \<notin> S\<close> if_smult sum_delta_notmem) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4984 | finally show "(\<Sum>x\<in>insert a (T \<inter> T'). (cc(a := c a)) x *\<^sub>R x) = x" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4985 | by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4986 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4987 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4988 | case 2 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4989 | then have "sum cc' S \<le> sum cc S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4990 | by (simp add: sumSS') | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4991 | then have le: "cc' x \<le> cc x" if "x \<in> S" for x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4992 | using dd0 [OF that] 2 b0 mult_left_mono that | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4993 | by (fastforce simp add: dd_def algebra_simps) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4994 | have cc0: "cc' x = 0" if "x \<in> S" "x \<notin> T \<inter> T'" for x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4995 | using le [OF \<open>x \<in> S\<close>] that c'0 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4996 | by (force simp: cc_def cc'_def split: if_split_asm) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4997 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4998 | proof (simp add: convex_hull_finite, intro exI conjI) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4999 | show "\<forall>x\<in>T \<inter> T'. 0 \<le> (cc'(a := c' a)) x" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5000 | by (simp add: c'0 cc'_def) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5001 | show "0 \<le> (cc'(a := c' a)) a" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5002 | by (simp add: c'0) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5003 | have "sum (cc'(a := c' a)) (insert a (T \<inter> T')) = c' a + sum (cc'(a := c' a)) (T \<inter> T')" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5004 | by (simp add: anot) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5005 | also have "... = c' a + sum (cc'(a := c' a)) S" | 
| 72238 | 5006 | using \<open>T \<subseteq> S\<close> False cc0 by (fastforce intro!: sum.mono_neutral_left split: if_split_asm) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5007 | also have "... = c' a + (1 - c' a)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5008 | by (metis \<open>a \<notin> S\<close> fun_upd_other sum.cong sumSS') | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5009 | finally show "sum (cc'(a := c' a)) (insert a (T \<inter> T')) = 1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5010 | by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5011 | have "(\<Sum>x\<in>insert a (T \<inter> T'). (cc'(a := c' a)) x *\<^sub>R x) = c' a *\<^sub>R a + (\<Sum>x \<in> T \<inter> T'. (cc'(a := c' a)) x *\<^sub>R x)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5012 | by (simp add: anot) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5013 | also have "... = c' a *\<^sub>R a + (\<Sum>x \<in> S. (cc'(a := c' a)) x *\<^sub>R x)" | 
| 72238 | 5014 | using \<open>T \<subseteq> S\<close> False cc0 by (fastforce intro!: sum.mono_neutral_left split: if_split_asm) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5015 | also have "... = c a *\<^sub>R a + x - c a *\<^sub>R a" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5016 | by (simp add: wsumSS \<open>a \<notin> S\<close> if_smult sum_delta_notmem) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5017 | finally show "(\<Sum>x\<in>insert a (T \<inter> T'). (cc'(a := c' a)) x *\<^sub>R x) = x" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5018 | by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5019 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5020 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5021 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5022 | |
| 70136 | 5023 | corollary\<^marker>\<open>tag unimportant\<close> convex_hull_exchange_Int: | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5024 | fixes a :: "'a::euclidean_space" | 
| 69508 | 5025 | assumes "\<not> affine_dependent S" "a \<in> convex hull S" "T \<subseteq> S" "T' \<subseteq> S" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5026 | shows "(convex hull (insert a T)) \<inter> (convex hull (insert a T')) = | 
| 72238 | 5027 | convex hull (insert a (T \<inter> T'))" (is "?lhs = ?rhs") | 
| 5028 | proof (rule subset_antisym) | |
| 5029 | show "?lhs \<subseteq> ?rhs" | |
| 5030 | using in_convex_hull_exchange_unique assms by blast | |
| 5031 | show "?rhs \<subseteq> ?lhs" | |
| 5032 | by (metis hull_mono inf_le1 inf_le2 insert_inter_insert le_inf_iff) | |
| 5033 | qed | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5034 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5035 | lemma Int_closed_segment: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5036 | fixes b :: "'a::euclidean_space" | 
| 69508 | 5037 |   assumes "b \<in> closed_segment a c \<or> \<not> collinear{a,b,c}"
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5038 |     shows "closed_segment a b \<inter> closed_segment b c = {b}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5039 | proof (cases "c = a") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5040 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5041 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5042 | using assms collinear_3_eq_affine_dependent by fastforce | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5043 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5044 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5045 | from assms show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5046 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5047 | assume "b \<in> closed_segment a c" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5048 |     moreover have "\<not> affine_dependent {a, c}"
 | 
| 71176 | 5049 | by (simp) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5050 | ultimately show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5051 |       using False convex_hull_exchange_Int [of "{a,c}" b "{a}" "{c}"]
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5052 | by (simp add: segment_convex_hull insert_commute) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5053 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5054 |     assume ncoll: "\<not> collinear {a, b, c}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5055 |     have False if "closed_segment a b \<inter> closed_segment b c \<noteq> {b}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5056 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5057 | have "b \<in> closed_segment a b" and "b \<in> closed_segment b c" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5058 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5059 | with that obtain d where "b \<noteq> d" "d \<in> closed_segment a b" "d \<in> closed_segment b c" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5060 | by force | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5061 |       then have d: "collinear {a, d, b}"  "collinear {b, d, c}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5062 | by (auto simp: between_mem_segment between_imp_collinear) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5063 |       have "collinear {a, b, c}"
 | 
| 72238 | 5064 | by (metis (full_types) \<open>b \<noteq> d\<close> collinear_3_trans d insert_commute) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5065 | with ncoll show False .. | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5066 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5067 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5068 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5069 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5070 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5071 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5072 | lemma affine_hull_finite_intersection_hyperplanes: | 
| 72238 | 5073 | fixes S :: "'a::euclidean_space set" | 
| 5074 | obtains \<F> where | |
| 5075 | "finite \<F>" | |
| 5076 |      "of_nat (card \<F>) + aff_dim S = DIM('a)"
 | |
| 5077 | "affine hull S = \<Inter>\<F>" | |
| 5078 |      "\<And>h. h \<in> \<F> \<Longrightarrow> \<exists>a b. a \<noteq> 0 \<and> h = {x. a \<bullet> x = b}"
 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5079 | proof - | 
| 72238 | 5080 | obtain b where "b \<subseteq> S" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5081 | and indb: "\<not> affine_dependent b" | 
| 72238 | 5082 | and eq: "affine hull S = affine hull b" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5083 | using affine_basis_exists by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5084 | obtain c where indc: "\<not> affine_dependent c" and "b \<subseteq> c" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5085 | and affc: "affine hull c = UNIV" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5086 | by (metis extend_to_affine_basis affine_UNIV hull_same indb subset_UNIV) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5087 | then have "finite c" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5088 | by (simp add: aff_independent_finite) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5089 | then have fbc: "finite b" "card b \<le> card c" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5090 | using \<open>b \<subseteq> c\<close> infinite_super by (auto simp: card_mono) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5091 |   have imeq: "(\<lambda>x. affine hull x) ` ((\<lambda>a. c - {a}) ` (c - b)) = ((\<lambda>a. affine hull (c - {a})) ` (c - b))"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5092 | by blast | 
| 72238 | 5093 |   have card_cb: "(card (c - b)) + aff_dim S = DIM('a)"
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5094 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5095 | have aff: "aff_dim (UNIV::'a set) = aff_dim c" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5096 | by (metis aff_dim_affine_hull affc) | 
| 72238 | 5097 | have "aff_dim b = aff_dim S" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5098 | by (metis (no_types) aff_dim_affine_hull eq) | 
| 72238 | 5099 | then have "int (card b) = 1 + aff_dim S" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5100 | by (simp add: aff_dim_affine_independent indb) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5101 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5102 | using fbc aff | 
| 71176 | 5103 | by (simp add: \<open>\<not> affine_dependent c\<close> \<open>b \<subseteq> c\<close> aff_dim_affine_independent card_Diff_subset of_nat_diff) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5104 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5105 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5106 | proof (cases "c = b") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5107 | case True show ?thesis | 
| 72238 | 5108 | proof | 
| 5109 |       show "int (card {}) + aff_dim S = int DIM('a)"
 | |
| 5110 | using True card_cb by auto | |
| 5111 |       show "affine hull S = \<Inter> {}"
 | |
| 5112 | using True affc eq by blast | |
| 5113 | qed auto | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5114 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5115 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5116 |     have ind: "\<not> affine_dependent (\<Union>a\<in>c - b. c - {a})"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5117 | by (rule affine_independent_subset [OF indc]) auto | 
| 72238 | 5118 |     have *: "1 + aff_dim (c - {t}) = int (DIM('a))" if t: "t \<in> c" for t
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5119 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5120 | have "insert t c = c" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5121 | using t by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5122 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5123 | by (metis (full_types) add.commute aff_dim_affine_hull aff_dim_insert aff_dim_UNIV affc affine_dependent_def indc insert_Diff_single t) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5124 | qed | 
| 72238 | 5125 |     let ?\<F> = "(\<lambda>x. affine hull x) ` ((\<lambda>a. c - {a}) ` (c - b))"
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5126 | show ?thesis | 
| 72238 | 5127 | proof | 
| 5128 |       have "card ((\<lambda>a. affine hull (c - {a})) ` (c - b)) = card (c - b)"
 | |
| 72567 | 5129 | proof (rule card_image) | 
| 5130 |         show "inj_on (\<lambda>a. affine hull (c - {a})) (c - b)"
 | |
| 5131 | unfolding inj_on_def | |
| 5132 | by (metis Diff_eq_empty_iff Diff_iff indc affine_dependent_def hull_subset insert_iff) | |
| 5133 | qed | |
| 72238 | 5134 |       then show "int (card ?\<F>) + aff_dim S = int DIM('a)"
 | 
| 5135 | by (simp add: imeq card_cb) | |
| 5136 | show "affine hull S = \<Inter> ?\<F>" | |
| 72567 | 5137 | by (metis Diff_eq_empty_iff INT_simps(4) UN_singleton order_refl \<open>b \<subseteq> c\<close> False eq double_diff affine_hull_Inter [OF ind]) | 
| 5138 |       have "\<And>a. \<lbrakk>a \<in> c; a \<notin> b\<rbrakk> \<Longrightarrow> aff_dim (c - {a}) = int (DIM('a) - Suc 0)"
 | |
| 5139 | by (metis "*" DIM_ge_Suc0 One_nat_def add_diff_cancel_left' int_ops(2) of_nat_diff) | |
| 5140 |       then show "\<And>h. h \<in> ?\<F> \<Longrightarrow> \<exists>a b. a \<noteq> 0 \<and> h = {x. a \<bullet> x = b}"
 | |
| 5141 | by (auto simp only: One_nat_def aff_dim_eq_hyperplane [symmetric]) | |
| 72238 | 5142 | qed (use \<open>finite c\<close> in auto) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5143 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5144 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5145 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5146 | lemma affine_hyperplane_sums_eq_UNIV_0: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5147 | fixes S :: "'a :: euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5148 | assumes "affine S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5149 | and "0 \<in> S" and "w \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5150 | and "a \<bullet> w \<noteq> 0" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5151 |    shows "{x + y| x y. x \<in> S \<and> a \<bullet> y = 0} = UNIV"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5152 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5153 | have "subspace S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5154 | by (simp add: assms subspace_affine) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5155 |   have span1: "span {y. a \<bullet> y = 0} \<subseteq> span {x + y |x y. x \<in> S \<and> a \<bullet> y = 0}"
 | 
| 72238 | 5156 | using \<open>0 \<in> S\<close> add.left_neutral by (intro span_mono) force | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5157 |   have "w \<notin> span {y. a \<bullet> y = 0}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5158 | using \<open>a \<bullet> w \<noteq> 0\<close> span_induct subspace_hyperplane by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5159 |   moreover have "w \<in> span {x + y |x y. x \<in> S \<and> a \<bullet> y = 0}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5160 | using \<open>w \<in> S\<close> | 
| 68072 
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
 immler parents: 
67990diff
changeset | 5161 | by (metis (mono_tags, lifting) inner_zero_right mem_Collect_eq pth_d span_base) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5162 |   ultimately have span2: "span {y. a \<bullet> y = 0} \<noteq> span {x + y |x y. x \<in> S \<and> a \<bullet> y = 0}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5163 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5164 | have "a \<noteq> 0" using assms inner_zero_left by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5165 |   then have "DIM('a) - 1 = dim {y. a \<bullet> y = 0}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5166 | by (simp add: dim_hyperplane) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5167 |   also have "... < dim {x + y |x y. x \<in> S \<and> a \<bullet> y = 0}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5168 | using span1 span2 by (blast intro: dim_psubset) | 
| 72238 | 5169 |   finally have "DIM('a) - 1 < dim {x + y |x y. x \<in> S \<and> a \<bullet> y = 0}" .
 | 
| 5170 |   then have DD: "dim {x + y |x y. x \<in> S \<and> a \<bullet> y = 0} = DIM('a)"
 | |
| 5171 | using antisym dim_subset_UNIV lowdim_subset_hyperplane not_le by fastforce | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5172 |   have subs: "subspace {x + y| x y. x \<in> S \<and> a \<bullet> y = 0}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5173 | using subspace_sums [OF \<open>subspace S\<close> subspace_hyperplane] by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5174 |   moreover have "span {x + y| x y. x \<in> S \<and> a \<bullet> y = 0} = UNIV"
 | 
| 72238 | 5175 | using DD dim_eq_full by blast | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5176 | ultimately show ?thesis | 
| 68072 
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
 immler parents: 
67990diff
changeset | 5177 | by (simp add: subs) (metis (lifting) span_eq_iff subs) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5178 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5179 | |
| 70136 | 5180 | proposition\<^marker>\<open>tag unimportant\<close> affine_hyperplane_sums_eq_UNIV: | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5181 | fixes S :: "'a :: euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5182 | assumes "affine S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5183 |       and "S \<inter> {v. a \<bullet> v = b} \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5184 |       and "S - {v. a \<bullet> v = b} \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5185 |     shows "{x + y| x y. x \<in> S \<and> a \<bullet> y = b} = UNIV"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5186 | proof (cases "a = 0") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5187 | case True with assms show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5188 | by (auto simp: if_splits) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5189 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5190 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5191 | obtain c where "c \<in> S" and c: "a \<bullet> c = b" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5192 | using assms by force | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5193 | with affine_diffs_subspace [OF \<open>affine S\<close>] | 
| 67399 | 5194 | have "subspace ((+) (- c) ` S)" by blast | 
| 5195 | then have aff: "affine ((+) (- c) ` S)" | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5196 | by (simp add: subspace_imp_affine) | 
| 67399 | 5197 | have 0: "0 \<in> (+) (- c) ` S" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5198 | by (simp add: \<open>c \<in> S\<close>) | 
| 67399 | 5199 | obtain d where "d \<in> S" and "a \<bullet> d \<noteq> b" and dc: "d-c \<in> (+) (- c) ` S" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5200 | using assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5201 | then have adc: "a \<bullet> (d - c) \<noteq> 0" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5202 | by (simp add: c inner_diff_right) | 
| 72567 | 5203 |   define U where "U \<equiv> {x + y |x y. x \<in> (+) (- c) ` S \<and> a \<bullet> y = 0}"
 | 
| 5204 | have "u + v \<in> (+) (c+c) ` U" | |
| 5205 | if "u \<in> S" "b = a \<bullet> v" for u v | |
| 5206 | proof | |
| 5207 | show "u + v = c + c + (u + v - c - c)" | |
| 5208 | by (simp add: algebra_simps) | |
| 5209 | have "\<exists>x y. u + v - c - c = x + y \<and> (\<exists>xa\<in>S. x = xa - c) \<and> a \<bullet> y = 0" | |
| 5210 | proof (intro exI conjI) | |
| 5211 | show "u + v - c - c = (u-c) + (v-c)" "a \<bullet> (v - c) = 0" | |
| 5212 | by (simp_all add: algebra_simps c that) | |
| 5213 | qed (use that in auto) | |
| 5214 | then show "u + v - c - c \<in> U" | |
| 5215 | by (auto simp: U_def image_def) | |
| 5216 | qed | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5217 | moreover have "\<lbrakk>a \<bullet> v = 0; u \<in> S\<rbrakk> | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5218 | \<Longrightarrow> \<exists>x ya. v + (u + c) = x + ya \<and> x \<in> S \<and> a \<bullet> ya = b" for v u | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5219 | by (metis add.left_commute c inner_right_distrib pth_d) | 
| 72567 | 5220 |   ultimately have "{x + y |x y. x \<in> S \<and> a \<bullet> y = b} = (+) (c+c) ` U"
 | 
| 5221 | by (fastforce simp: algebra_simps U_def) | |
| 69661 | 5222 | also have "... = range ((+) (c + c))" | 
| 72567 | 5223 | by (simp only: U_def affine_hyperplane_sums_eq_UNIV_0 [OF aff 0 dc adc]) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5224 | also have "... = UNIV" | 
| 69661 | 5225 | by simp | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5226 | finally show ?thesis . | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5227 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5228 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5229 | lemma aff_dim_sums_Int_0: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5230 | assumes "affine S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5231 | and "affine T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5232 | and "0 \<in> S" "0 \<in> T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5233 |     shows "aff_dim {x + y| x y. x \<in> S \<and> y \<in> T} = (aff_dim S + aff_dim T) - aff_dim(S \<inter> T)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5234 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5235 |   have "0 \<in> {x + y |x y. x \<in> S \<and> y \<in> T}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5236 | using assms by force | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5237 |   then have 0: "0 \<in> affine hull {x + y |x y. x \<in> S \<and> y \<in> T}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5238 | by (metis (lifting) hull_inc) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5239 | have sub: "subspace S" "subspace T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5240 | using assms by (auto simp: subspace_affine) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5241 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5242 | using dim_sums_Int [OF sub] by (simp add: aff_dim_zero assms 0 hull_inc) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5243 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5244 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5245 | proposition aff_dim_sums_Int: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5246 | assumes "affine S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5247 | and "affine T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5248 |       and "S \<inter> T \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5249 |     shows "aff_dim {x + y| x y. x \<in> S \<and> y \<in> T} = (aff_dim S + aff_dim T) - aff_dim(S \<inter> T)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5250 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5251 | obtain a where a: "a \<in> S" "a \<in> T" using assms by force | 
| 67399 | 5252 | have aff: "affine ((+) (-a) ` S)" "affine ((+) (-a) ` T)" | 
| 69661 | 5253 | using affine_translation [symmetric, of "- a"] assms by (simp_all cong: image_cong_simp) | 
| 67399 | 5254 | have zero: "0 \<in> ((+) (-a) ` S)" "0 \<in> ((+) (-a) ` T)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5255 | using a assms by auto | 
| 69661 | 5256 |   have "{x + y |x y. x \<in> (+) (- a) ` S \<and> y \<in> (+) (- a) ` T} =
 | 
| 5257 |       (+) (- 2 *\<^sub>R a) ` {x + y| x y. x \<in> S \<and> y \<in> T}"
 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5258 | by (force simp: algebra_simps scaleR_2) | 
| 69661 | 5259 | moreover have "(+) (- a) ` S \<inter> (+) (- a) ` T = (+) (- a) ` (S \<inter> T)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5260 | by auto | 
| 69661 | 5261 | ultimately show ?thesis | 
| 5262 | using aff_dim_sums_Int_0 [OF aff zero] aff_dim_translation_eq | |
| 5263 | by (metis (lifting)) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5264 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5265 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5266 | lemma aff_dim_affine_Int_hyperplane: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5267 | fixes a :: "'a::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5268 | assumes "affine S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5269 |     shows "aff_dim(S \<inter> {x. a \<bullet> x = b}) =
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5270 |              (if S \<inter> {v. a \<bullet> v = b} = {} then - 1
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5271 |               else if S \<subseteq> {v. a \<bullet> v = b} then aff_dim S
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5272 | else aff_dim S - 1)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5273 | proof (cases "a = 0") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5274 | case True with assms show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5275 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5276 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5277 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5278 |   then have "aff_dim (S \<inter> {x. a \<bullet> x = b}) = aff_dim S - 1"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5279 |             if "x \<in> S" "a \<bullet> x \<noteq> b" and non: "S \<inter> {v. a \<bullet> v = b} \<noteq> {}" for x
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5280 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5281 |     have [simp]: "{x + y| x y. x \<in> S \<and> a \<bullet> y = b} = UNIV"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5282 | using affine_hyperplane_sums_eq_UNIV [OF assms non] that by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5283 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5284 | using aff_dim_sums_Int [OF assms affine_hyperplane non] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5285 | by (simp add: of_nat_diff False) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5286 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5287 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5288 | by (metis (mono_tags, lifting) inf.orderE aff_dim_empty_eq mem_Collect_eq subsetI) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5289 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5290 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5291 | lemma aff_dim_lt_full: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5292 | fixes S :: "'a::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5293 |   shows "aff_dim S < DIM('a) \<longleftrightarrow> (affine hull S \<noteq> UNIV)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5294 | by (metis (no_types) aff_dim_affine_hull aff_dim_le_DIM aff_dim_UNIV affine_hull_UNIV less_le) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5295 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5296 | lemma aff_dim_openin: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5297 | fixes S :: "'a::euclidean_space set" | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 5298 |   assumes ope: "openin (top_of_set T) S" and "affine T" "S \<noteq> {}"
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5299 | shows "aff_dim S = aff_dim T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5300 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5301 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5302 | proof (rule order_antisym) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5303 | show "aff_dim S \<le> aff_dim T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5304 | by (blast intro: aff_dim_subset [OF openin_imp_subset] ope) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5305 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5306 | obtain a where "a \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5307 |       using \<open>S \<noteq> {}\<close> by blast
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5308 | have "S \<subseteq> T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5309 | using ope openin_imp_subset by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5310 | then have "a \<in> T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5311 | using \<open>a \<in> S\<close> by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5312 | then have subT': "subspace ((\<lambda>x. - a + x) ` T)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5313 | using affine_diffs_subspace \<open>affine T\<close> by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5314 | then obtain B where Bsub: "B \<subseteq> ((\<lambda>x. - a + x) ` T)" and po: "pairwise orthogonal B" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5315 | and eq1: "\<And>x. x \<in> B \<Longrightarrow> norm x = 1" and "independent B" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5316 | and cardB: "card B = dim ((\<lambda>x. - a + x) ` T)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5317 | and spanB: "span B = ((\<lambda>x. - a + x) ` T)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5318 | by (rule orthonormal_basis_subspace) auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5319 | obtain e where "0 < e" and e: "cball a e \<inter> T \<subseteq> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5320 | by (meson \<open>a \<in> S\<close> openin_contains_cball ope) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5321 | have "aff_dim T = aff_dim ((\<lambda>x. - a + x) ` T)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5322 | by (metis aff_dim_translation_eq) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5323 | also have "... = dim ((\<lambda>x. - a + x) ` T)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5324 | using aff_dim_subspace subT' by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5325 | also have "... = card B" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5326 | by (simp add: cardB) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5327 | also have "... = card ((\<lambda>x. e *\<^sub>R x) ` B)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5328 | using \<open>0 < e\<close> by (force simp: inj_on_def card_image) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5329 | also have "... \<le> dim ((\<lambda>x. - a + x) ` S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5330 | proof (simp, rule independent_card_le_dim) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5331 | have e': "cball 0 e \<inter> (\<lambda>x. x - a) ` T \<subseteq> (\<lambda>x. x - a) ` S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5332 | using e by (auto simp: dist_norm norm_minus_commute subset_eq) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5333 | have "(\<lambda>x. e *\<^sub>R x) ` B \<subseteq> cball 0 e \<inter> (\<lambda>x. x - a) ` T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5334 | using Bsub \<open>0 < e\<close> eq1 subT' \<open>a \<in> T\<close> by (auto simp: subspace_def) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5335 | then show "(\<lambda>x. e *\<^sub>R x) ` B \<subseteq> (\<lambda>x. x - a) ` S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5336 | using e' by blast | 
| 72238 | 5337 | have "inj_on ((*\<^sub>R) e) (span B)" | 
| 68072 
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
 immler parents: 
67990diff
changeset | 5338 | using \<open>0 < e\<close> inj_on_def by fastforce | 
| 72238 | 5339 | then show "independent ((\<lambda>x. e *\<^sub>R x) ` B)" | 
| 5340 | using linear_scale_self \<open>independent B\<close> linear_dependent_inj_imageD by blast | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5341 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5342 | also have "... = aff_dim S" | 
| 69661 | 5343 | using \<open>a \<in> S\<close> aff_dim_eq_dim hull_inc by (force cong: image_cong_simp) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5344 | finally show "aff_dim T \<le> aff_dim S" . | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5345 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5346 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5347 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5348 | lemma dim_openin: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5349 | fixes S :: "'a::euclidean_space set" | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 5350 |   assumes ope: "openin (top_of_set T) S" and "subspace T" "S \<noteq> {}"
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5351 | shows "dim S = dim T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5352 | proof (rule order_antisym) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5353 | show "dim S \<le> dim T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5354 | by (metis ope dim_subset openin_subset topspace_euclidean_subtopology) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5355 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5356 | have "dim T = aff_dim S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5357 | using aff_dim_openin | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5358 |     by (metis aff_dim_subspace \<open>subspace T\<close> \<open>S \<noteq> {}\<close> ope subspace_affine)
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5359 | also have "... \<le> dim S" | 
| 68072 
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
 immler parents: 
67990diff
changeset | 5360 | by (metis aff_dim_subset aff_dim_subspace dim_span span_superset | 
| 
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
 immler parents: 
67990diff
changeset | 5361 | subspace_span) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5362 | finally show "dim T \<le> dim S" by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5363 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5364 | |
| 67968 | 5365 | subsection\<open>Lower-dimensional affine subsets are nowhere dense\<close> | 
| 66641 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5366 | |
| 68607 
67bb59e49834
make theorem, corollary, and proposition %important for HOL-Analysis manual
 immler parents: 
68527diff
changeset | 5367 | proposition dense_complement_subspace: | 
| 66641 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5368 | fixes S :: "'a :: euclidean_space set" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5369 | assumes dim_less: "dim T < dim S" and "subspace S" shows "closure(S - T) = S" | 
| 68607 
67bb59e49834
make theorem, corollary, and proposition %important for HOL-Analysis manual
 immler parents: 
68527diff
changeset | 5370 | proof - | 
| 66641 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5371 | have "closure(S - U) = S" if "dim U < dim S" "U \<subseteq> S" for U | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5372 | proof - | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5373 | have "span U \<subset> span S" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5374 | by (metis neq_iff psubsetI span_eq_dim span_mono that) | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5375 | then obtain a where "a \<noteq> 0" "a \<in> span S" and a: "\<And>y. y \<in> span U \<Longrightarrow> orthogonal a y" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5376 | using orthogonal_to_subspace_exists_gen by metis | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5377 | show ?thesis | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5378 | proof | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5379 | have "closed S" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5380 | by (simp add: \<open>subspace S\<close> closed_subspace) | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5381 | then show "closure (S - U) \<subseteq> S" | 
| 69286 | 5382 | by (simp add: closure_minimal) | 
| 66641 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5383 | show "S \<subseteq> closure (S - U)" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5384 | proof (clarsimp simp: closure_approachable) | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5385 | fix x and e::real | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5386 | assume "x \<in> S" "0 < e" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5387 | show "\<exists>y\<in>S - U. dist y x < e" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5388 | proof (cases "x \<in> U") | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5389 | case True | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5390 | let ?y = "x + (e/2 / norm a) *\<^sub>R a" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5391 | show ?thesis | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5392 | proof | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5393 | show "dist ?y x < e" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5394 | using \<open>0 < e\<close> by (simp add: dist_norm) | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5395 | next | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5396 | have "?y \<in> S" | 
| 68072 
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
 immler parents: 
67990diff
changeset | 5397 | by (metis \<open>a \<in> span S\<close> \<open>x \<in> S\<close> assms(2) span_eq_iff subspace_add subspace_scale) | 
| 66641 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5398 | moreover have "?y \<notin> U" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5399 | proof - | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5400 | have "e/2 / norm a \<noteq> 0" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5401 | using \<open>0 < e\<close> \<open>a \<noteq> 0\<close> by auto | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5402 | then show ?thesis | 
| 68074 | 5403 | by (metis True \<open>a \<noteq> 0\<close> a orthogonal_scaleR orthogonal_self real_vector.scale_eq_0_iff span_add_eq span_base) | 
| 66641 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5404 | qed | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5405 | ultimately show "?y \<in> S - U" by blast | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5406 | qed | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5407 | next | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5408 | case False | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5409 | with \<open>0 < e\<close> \<open>x \<in> S\<close> show ?thesis by force | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5410 | qed | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5411 | qed | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5412 | qed | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5413 | qed | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5414 | moreover have "S - S \<inter> T = S-T" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5415 | by blast | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5416 | moreover have "dim (S \<inter> T) < dim S" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5417 | by (metis dim_less dim_subset inf.cobounded2 inf.orderE inf.strict_boundedE not_le) | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5418 | ultimately show ?thesis | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5419 | by force | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5420 | qed | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5421 | |
| 70136 | 5422 | corollary\<^marker>\<open>tag unimportant\<close> dense_complement_affine: | 
| 66641 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5423 | fixes S :: "'a :: euclidean_space set" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5424 | assumes less: "aff_dim T < aff_dim S" and "affine S" shows "closure(S - T) = S" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5425 | proof (cases "S \<inter> T = {}")
 | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5426 | case True | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5427 | then show ?thesis | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5428 | by (metis Diff_triv affine_hull_eq \<open>affine S\<close> closure_same_affine_hull closure_subset hull_subset subset_antisym) | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5429 | next | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5430 | case False | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5431 | then obtain z where z: "z \<in> S \<inter> T" by blast | 
| 67399 | 5432 | then have "subspace ((+) (- z) ` S)" | 
| 66641 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5433 | by (meson IntD1 affine_diffs_subspace \<open>affine S\<close>) | 
| 67399 | 5434 | moreover have "int (dim ((+) (- z) ` T)) < int (dim ((+) (- z) ` S))" | 
| 69661 | 5435 | thm aff_dim_eq_dim | 
| 5436 | using z less by (simp add: aff_dim_eq_dim_subtract [of z] hull_inc cong: image_cong_simp) | |
| 67399 | 5437 | ultimately have "closure(((+) (- z) ` S) - ((+) (- z) ` T)) = ((+) (- z) ` S)" | 
| 66641 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5438 | by (simp add: dense_complement_subspace) | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5439 | then show ?thesis | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5440 | by (metis closure_translation translation_diff translation_invert) | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5441 | qed | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5442 | |
| 70136 | 5443 | corollary\<^marker>\<open>tag unimportant\<close> dense_complement_openin_affine_hull: | 
| 66641 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5444 | fixes S :: "'a :: euclidean_space set" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5445 | assumes less: "aff_dim T < aff_dim S" | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 5446 | and ope: "openin (top_of_set (affine hull S)) S" | 
| 66641 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5447 | shows "closure(S - T) = closure S" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5448 | proof - | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5449 | have "affine hull S - T \<subseteq> affine hull S" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5450 | by blast | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5451 | then have "closure (S \<inter> closure (affine hull S - T)) = closure (S \<inter> (affine hull S - T))" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5452 | by (rule closure_openin_Int_closure [OF ope]) | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5453 | then show ?thesis | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5454 | by (metis Int_Diff aff_dim_affine_hull affine_affine_hull dense_complement_affine hull_subset inf.orderE less) | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5455 | qed | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5456 | |
| 70136 | 5457 | corollary\<^marker>\<open>tag unimportant\<close> dense_complement_convex: | 
| 66641 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5458 | fixes S :: "'a :: euclidean_space set" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5459 | assumes "aff_dim T < aff_dim S" "convex S" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5460 | shows "closure(S - T) = closure S" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5461 | proof | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5462 | show "closure (S - T) \<subseteq> closure S" | 
| 69286 | 5463 | by (simp add: closure_mono) | 
| 66641 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5464 | have "closure (rel_interior S - T) = closure (rel_interior S)" | 
| 72238 | 5465 | by (simp add: assms dense_complement_openin_affine_hull openin_rel_interior rel_interior_aff_dim rel_interior_same_affine_hull) | 
| 66641 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5466 | then show "closure S \<subseteq> closure (S - T)" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5467 | by (metis Diff_mono \<open>convex S\<close> closure_mono convex_closure_rel_interior order_refl rel_interior_subset) | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5468 | qed | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5469 | |
| 70136 | 5470 | corollary\<^marker>\<open>tag unimportant\<close> dense_complement_convex_closed: | 
| 66641 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5471 | fixes S :: "'a :: euclidean_space set" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5472 | assumes "aff_dim T < aff_dim S" "convex S" "closed S" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5473 | shows "closure(S - T) = S" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5474 | by (simp add: assms dense_complement_convex) | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5475 | |
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5476 | |
| 70136 | 5477 | subsection\<^marker>\<open>tag unimportant\<close>\<open>Parallel slices, etc\<close> | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5478 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5479 | text\<open> If we take a slice out of a set, we can do it perpendicularly, | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5480 | with the normal vector to the slice parallel to the affine hull.\<close> | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5481 | |
| 70136 | 5482 | proposition\<^marker>\<open>tag unimportant\<close> affine_parallel_slice: | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5483 | fixes S :: "'a :: euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5484 | assumes "affine S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5485 |       and "S \<inter> {x. a \<bullet> x \<le> b} \<noteq> {}"
 | 
| 69508 | 5486 |       and "\<not> (S \<subseteq> {x. a \<bullet> x \<le> b})"
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5487 | obtains a' b' where "a' \<noteq> 0" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5488 |                    "S \<inter> {x. a' \<bullet> x \<le> b'} = S \<inter> {x. a \<bullet> x \<le> b}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5489 |                    "S \<inter> {x. a' \<bullet> x = b'} = S \<inter> {x. a \<bullet> x = b}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5490 | "\<And>w. w \<in> S \<Longrightarrow> (w + a') \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5491 | proof (cases "S \<inter> {x. a \<bullet> x = b} = {}")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5492 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5493 | then obtain u v where "u \<in> S" "v \<in> S" "a \<bullet> u \<le> b" "a \<bullet> v > b" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5494 | using assms by (auto simp: not_le) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5495 | define \<eta> where "\<eta> = u + ((b - a \<bullet> u) / (a \<bullet> v - a \<bullet> u)) *\<^sub>R (v - u)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5496 | have "\<eta> \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5497 | by (simp add: \<eta>_def \<open>u \<in> S\<close> \<open>v \<in> S\<close> \<open>affine S\<close> mem_affine_3_minus) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5498 | moreover have "a \<bullet> \<eta> = b" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5499 | using \<open>a \<bullet> u \<le> b\<close> \<open>b < a \<bullet> v\<close> | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5500 | by (simp add: \<eta>_def algebra_simps) (simp add: field_simps) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5501 | ultimately have False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5502 | using True by force | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5503 | then show ?thesis .. | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5504 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5505 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5506 | then obtain z where "z \<in> S" and z: "a \<bullet> z = b" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5507 | using assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5508 | with affine_diffs_subspace [OF \<open>affine S\<close>] | 
| 67399 | 5509 | have sub: "subspace ((+) (- z) ` S)" by blast | 
| 5510 | then have aff: "affine ((+) (- z) ` S)" and span: "span ((+) (- z) ` S) = ((+) (- z) ` S)" | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5511 | by (auto simp: subspace_imp_affine) | 
| 67399 | 5512 | obtain a' a'' where a': "a' \<in> span ((+) (- z) ` S)" and a: "a = a' + a''" | 
| 5513 | and "\<And>w. w \<in> span ((+) (- z) ` S) \<Longrightarrow> orthogonal a'' w" | |
| 69661 | 5514 | using orthogonal_subspace_decomp_exists [of "(+) (- z) ` S" "a"] by metis | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5515 | then have "\<And>w. w \<in> S \<Longrightarrow> a'' \<bullet> (w-z) = 0" | 
| 69661 | 5516 | by (simp add: span_base orthogonal_def) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5517 | then have a'': "\<And>w. w \<in> S \<Longrightarrow> a'' \<bullet> w = (a - a') \<bullet> z" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5518 | by (simp add: a inner_diff_right) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5519 | then have ba'': "\<And>w. w \<in> S \<Longrightarrow> a'' \<bullet> w = b - a' \<bullet> z" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5520 | by (simp add: inner_diff_left z) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5521 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5522 | proof (cases "a' = 0") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5523 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5524 | with a assms True a'' diff_zero less_irrefl show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5525 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5526 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5527 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5528 | show ?thesis | 
| 72567 | 5529 | proof | 
| 5530 |       show "S \<inter> {x. a' \<bullet> x \<le> a' \<bullet> z} = S \<inter> {x. a \<bullet> x \<le> b}"
 | |
| 5531 |         "S \<inter> {x. a' \<bullet> x = a' \<bullet> z} = S \<inter> {x. a \<bullet> x = b}"
 | |
| 5532 | by (auto simp: a ba'' inner_left_distrib) | |
| 5533 | have "\<And>w. w \<in> (+) (- z) ` S \<Longrightarrow> (w + a') \<in> (+) (- z) ` S" | |
| 5534 | by (metis subspace_add a' span_eq_iff sub) | |
| 5535 | then show "\<And>w. w \<in> S \<Longrightarrow> (w + a') \<in> S" | |
| 5536 | by fastforce | |
| 5537 | qed (use False in auto) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5538 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5539 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5540 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5541 | lemma diffs_affine_hull_span: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5542 | assumes "a \<in> S" | 
| 72567 | 5543 | shows "(\<lambda>x. x - a) ` (affine hull S) = span ((\<lambda>x. x - a) ` S)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5544 | proof - | 
| 72567 | 5545 |   have *: "((\<lambda>x. x - a) ` (S - {a})) = ((\<lambda>x. x - a) ` S) - {0}"
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5546 | by (auto simp: algebra_simps) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5547 | show ?thesis | 
| 72238 | 5548 | by (auto simp add: algebra_simps affine_hull_span2 [OF assms] *) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5549 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5550 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5551 | lemma aff_dim_dim_affine_diffs: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5552 | fixes S :: "'a :: euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5553 | assumes "affine S" "a \<in> S" | 
| 72567 | 5554 | shows "aff_dim S = dim ((\<lambda>x. x - a) ` S)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5555 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5556 | obtain B where aff: "affine hull B = affine hull S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5557 | and ind: "\<not> affine_dependent B" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5558 | and card: "of_nat (card B) = aff_dim S + 1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5559 | using aff_dim_basis_exists by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5560 |   then have "B \<noteq> {}" using assms
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5561 | by (metis affine_hull_eq_empty ex_in_conv) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5562 | then obtain c where "c \<in> B" by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5563 | then have "c \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5564 | by (metis aff affine_hull_eq \<open>affine S\<close> hull_inc) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5565 | have xy: "x - c = y - a \<longleftrightarrow> y = x + 1 *\<^sub>R (a - c)" for x y c and a::'a | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5566 | by (auto simp: algebra_simps) | 
| 72567 | 5567 | have *: "(\<lambda>x. x - c) ` S = (\<lambda>x. x - a) ` S" | 
| 5568 | using assms \<open>c \<in> S\<close> | |
| 5569 | by (auto simp: image_iff xy; metis mem_affine_3_minus pth_1) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5570 | have affS: "affine hull S = S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5571 | by (simp add: \<open>affine S\<close>) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5572 | have "aff_dim S = of_nat (card B) - 1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5573 | using card by simp | 
| 72567 | 5574 | also have "... = dim ((\<lambda>x. x - c) ` B)" | 
| 5575 | using affine_independent_card_dim_diffs [OF ind \<open>c \<in> B\<close>] | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5576 | by (simp add: affine_independent_card_dim_diffs [OF ind \<open>c \<in> B\<close>]) | 
| 72567 | 5577 | also have "... = dim ((\<lambda>x. x - c) ` (affine hull B))" | 
| 5578 | by (simp add: diffs_affine_hull_span \<open>c \<in> B\<close>) | |
| 5579 | also have "... = dim ((\<lambda>x. x - a) ` S)" | |
| 5580 | by (simp add: affS aff *) | |
| 5581 | finally show ?thesis . | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5582 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5583 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5584 | lemma aff_dim_linear_image_le: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5585 | assumes "linear f" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5586 | shows "aff_dim(f ` S) \<le> aff_dim S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5587 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5588 | have "aff_dim (f ` T) \<le> aff_dim T" if "affine T" for T | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5589 |   proof (cases "T = {}")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5590 | case True then show ?thesis by (simp add: aff_dim_geq) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5591 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5592 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5593 | then obtain a where "a \<in> T" by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5594 |     have 1: "((\<lambda>x. x - f a) ` f ` T) = {x - f a |x. x \<in> f ` T}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5595 | by auto | 
| 72567 | 5596 |     have 2: "{x - f a| x. x \<in> f ` T} = f ` ((\<lambda>x. x - a) ` T)"
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5597 | by (force simp: linear_diff [OF assms]) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5598 |     have "aff_dim (f ` T) = int (dim {x - f a |x. x \<in> f ` T})"
 | 
| 69661 | 5599 | by (simp add: \<open>a \<in> T\<close> hull_inc aff_dim_eq_dim [of "f a"] 1 cong: image_cong_simp) | 
| 72567 | 5600 | also have "... = int (dim (f ` ((\<lambda>x. x - a) ` T)))" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5601 | by (force simp: linear_diff [OF assms] 2) | 
| 72567 | 5602 | also have "... \<le> int (dim ((\<lambda>x. x - a) ` T))" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5603 | by (simp add: dim_image_le [OF assms]) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5604 | also have "... \<le> aff_dim T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5605 | by (simp add: aff_dim_dim_affine_diffs [symmetric] \<open>a \<in> T\<close> \<open>affine T\<close>) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5606 | finally show ?thesis . | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5607 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5608 | then | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5609 | have "aff_dim (f ` (affine hull S)) \<le> aff_dim (affine hull S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5610 | using affine_affine_hull [of S] by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5611 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5612 | using affine_hull_linear_image assms linear_conv_bounded_linear by fastforce | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5613 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5614 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5615 | lemma aff_dim_injective_linear_image [simp]: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5616 | assumes "linear f" "inj f" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5617 | shows "aff_dim (f ` S) = aff_dim S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5618 | proof (rule antisym) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5619 | show "aff_dim (f ` S) \<le> aff_dim S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5620 | by (simp add: aff_dim_linear_image_le assms(1)) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5621 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5622 | obtain g where "linear g" "g \<circ> f = id" | 
| 68072 
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
 immler parents: 
67990diff
changeset | 5623 | using assms(1) assms(2) linear_injective_left_inverse by blast | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5624 | then have "aff_dim S \<le> aff_dim(g ` f ` S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5625 | by (simp add: image_comp) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5626 | also have "... \<le> aff_dim (f ` S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5627 | by (simp add: \<open>linear g\<close> aff_dim_linear_image_le) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5628 | finally show "aff_dim S \<le> aff_dim (f ` S)" . | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5629 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5630 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5631 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5632 | lemma choose_affine_subset: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5633 | assumes "affine S" "-1 \<le> d" and dle: "d \<le> aff_dim S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5634 | obtains T where "affine T" "T \<subseteq> S" "aff_dim T = d" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5635 | proof (cases "d = -1 \<or> S={}")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5636 | case True with assms show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5637 | by (metis aff_dim_empty affine_empty bot.extremum that eq_iff) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5638 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5639 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5640 | with assms obtain a where "a \<in> S" "0 \<le> d" by auto | 
| 67399 | 5641 | with assms have ss: "subspace ((+) (- a) ` S)" | 
| 69661 | 5642 | by (simp add: affine_diffs_subspace_subtract cong: image_cong_simp) | 
| 67399 | 5643 | have "nat d \<le> dim ((+) (- a) ` S)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5644 | by (metis aff_dim_subspace aff_dim_translation_eq dle nat_int nat_mono ss) | 
| 67399 | 5645 | then obtain T where "subspace T" and Tsb: "T \<subseteq> span ((+) (- a) ` S)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5646 | and Tdim: "dim T = nat d" | 
| 67399 | 5647 | using choose_subspace_of_subspace [of "nat d" "(+) (- a) ` S"] by blast | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5648 | then have "affine T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5649 | using subspace_affine by blast | 
| 67399 | 5650 | then have "affine ((+) a ` T)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5651 | by (metis affine_hull_eq affine_hull_translation) | 
| 67399 | 5652 | moreover have "(+) a ` T \<subseteq> S" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5653 | proof - | 
| 67399 | 5654 | have "T \<subseteq> (+) (- a) ` S" | 
| 68072 
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
 immler parents: 
67990diff
changeset | 5655 | by (metis (no_types) span_eq_iff Tsb ss) | 
| 67399 | 5656 | then show "(+) a ` T \<subseteq> S" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5657 | using add_ac by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5658 | qed | 
| 67399 | 5659 | moreover have "aff_dim ((+) a ` T) = d" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5660 | by (simp add: aff_dim_subspace Tdim \<open>0 \<le> d\<close> \<open>subspace T\<close> aff_dim_translation_eq) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5661 | ultimately show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5662 | by (rule that) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5663 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5664 | |
| 69541 | 5665 | subsection\<open>Paracompactness\<close> | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5666 | |
| 68607 
67bb59e49834
make theorem, corollary, and proposition %important for HOL-Analysis manual
 immler parents: 
68527diff
changeset | 5667 | proposition paracompact: | 
| 69918 
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
 paulson <lp15@cam.ac.uk> parents: 
69745diff
changeset | 5668 |   fixes S :: "'a :: {metric_space,second_countable_topology} set"
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5669 | assumes "S \<subseteq> \<Union>\<C>" and opC: "\<And>T. T \<in> \<C> \<Longrightarrow> open T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5670 | obtains \<C>' where "S \<subseteq> \<Union> \<C>'" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5671 | and "\<And>U. U \<in> \<C>' \<Longrightarrow> open U \<and> (\<exists>T. T \<in> \<C> \<and> U \<subseteq> T)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5672 | and "\<And>x. x \<in> S | 
| 69918 
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
 paulson <lp15@cam.ac.uk> parents: 
69745diff
changeset | 5673 |                        \<Longrightarrow> \<exists>V. open V \<and> x \<in> V \<and> finite {U. U \<in> \<C>' \<and> (U \<inter> V \<noteq> {})}"
 | 
| 68607 
67bb59e49834
make theorem, corollary, and proposition %important for HOL-Analysis manual
 immler parents: 
68527diff
changeset | 5674 | proof (cases "S = {}")
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5675 | case True with that show ?thesis by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5676 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5677 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5678 | have "\<exists>T U. x \<in> U \<and> open U \<and> closure U \<subseteq> T \<and> T \<in> \<C>" if "x \<in> S" for x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5679 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5680 | obtain T where "x \<in> T" "T \<in> \<C>" "open T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5681 | using assms \<open>x \<in> S\<close> by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5682 | then obtain e where "e > 0" "cball x e \<subseteq> T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5683 | by (force simp: open_contains_cball) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5684 | then show ?thesis | 
| 72238 | 5685 | by (meson open_ball \<open>T \<in> \<C>\<close> ball_subset_cball centre_in_ball closed_cball closure_minimal dual_order.trans) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5686 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5687 | then obtain F G where Gin: "x \<in> G x" and oG: "open (G x)" | 
| 72238 | 5688 | and clos: "closure (G x) \<subseteq> F x" and Fin: "F x \<in> \<C>" | 
| 5689 | if "x \<in> S" for x | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5690 | by metis | 
| 69313 | 5691 | then obtain \<F> where "\<F> \<subseteq> G ` S" "countable \<F>" "\<Union>\<F> = \<Union>(G ` S)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5692 | using Lindelof [of "G ` S"] by (metis image_iff) | 
| 69313 | 5693 | then obtain K where K: "K \<subseteq> S" "countable K" and eq: "\<Union>(G ` K) = \<Union>(G ` S)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5694 | by (metis countable_subset_image) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5695 |   with False Gin have "K \<noteq> {}" by force
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5696 | then obtain a :: "nat \<Rightarrow> 'a" where "range a = K" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5697 | by (metis range_from_nat_into \<open>countable K\<close>) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5698 |   then have odif: "\<And>n. open (F (a n) - \<Union>{closure (G (a m)) |m. m < n})"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5699 | using \<open>K \<subseteq> S\<close> Fin opC by (fastforce simp add:) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5700 |   let ?C = "range (\<lambda>n. F(a n) - \<Union>{closure(G(a m)) |m. m < n})"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5701 | have enum_S: "\<exists>n. x \<in> F(a n) \<and> x \<in> G(a n)" if "x \<in> S" for x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5702 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5703 | have "\<exists>y \<in> K. x \<in> G y" using eq that Gin by fastforce | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5704 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5705 | using clos K \<open>range a = K\<close> closure_subset by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5706 | qed | 
| 72238 | 5707 | show ?thesis | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5708 | proof | 
| 72238 | 5709 | show "S \<subseteq> Union ?C" | 
| 5710 | proof | |
| 5711 | fix x assume "x \<in> S" | |
| 5712 | define n where "n \<equiv> LEAST n. x \<in> F(a n)" | |
| 5713 | have n: "x \<in> F(a n)" | |
| 5714 | using enum_S [OF \<open>x \<in> S\<close>] by (force simp: n_def intro: LeastI) | |
| 5715 | have notn: "x \<notin> F(a m)" if "m < n" for m | |
| 5716 | using that not_less_Least by (force simp: n_def) | |
| 5717 |       then have "x \<notin> \<Union>{closure (G (a m)) |m. m < n}"
 | |
| 5718 | using n \<open>K \<subseteq> S\<close> \<open>range a = K\<close> clos notn by fastforce | |
| 5719 | with n show "x \<in> Union ?C" | |
| 5720 | by blast | |
| 5721 | qed | |
| 5722 | show "\<And>U. U \<in> ?C \<Longrightarrow> open U \<and> (\<exists>T. T \<in> \<C> \<and> U \<subseteq> T)" | |
| 5723 | using Fin \<open>K \<subseteq> S\<close> \<open>range a = K\<close> by (auto simp: odif) | |
| 5724 |     show "\<exists>V. open V \<and> x \<in> V \<and> finite {U. U \<in> ?C \<and> (U \<inter> V \<noteq> {})}" if "x \<in> S" for x
 | |
| 5725 | proof - | |
| 5726 | obtain n where n: "x \<in> F(a n)" "x \<in> G(a n)" | |
| 5727 | using \<open>x \<in> S\<close> enum_S by auto | |
| 5728 |       have "{U \<in> ?C. U \<inter> G (a n) \<noteq> {}} \<subseteq> (\<lambda>n. F(a n) - \<Union>{closure(G(a m)) |m. m < n}) ` atMost n"
 | |
| 5729 | proof clarsimp | |
| 5730 |         fix k  assume "(F (a k) - \<Union>{closure (G (a m)) |m. m < k}) \<inter> G (a n) \<noteq> {}"
 | |
| 5731 | then have "k \<le> n" | |
| 5732 | by auto (metis closure_subset not_le subsetCE) | |
| 5733 |         then show "F (a k) - \<Union>{closure (G (a m)) |m. m < k}
 | |
| 5734 |                  \<in> (\<lambda>n. F (a n) - \<Union>{closure (G (a m)) |m. m < n}) ` {..n}"
 | |
| 5735 | by force | |
| 5736 | qed | |
| 5737 |       moreover have "finite ((\<lambda>n. F(a n) - \<Union>{closure(G(a m)) |m. m < n}) ` atMost n)"
 | |
| 5738 | by force | |
| 5739 |       ultimately have *: "finite {U \<in> ?C. U \<inter> G (a n) \<noteq> {}}"
 | |
| 5740 | using finite_subset by blast | |
| 5741 | have "a n \<in> S" | |
| 5742 | using \<open>K \<subseteq> S\<close> \<open>range a = K\<close> by blast | |
| 5743 | then show ?thesis | |
| 5744 | by (blast intro: oG n *) | |
| 5745 | qed | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5746 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5747 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5748 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5749 | corollary paracompact_closedin: | 
| 69918 
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
 paulson <lp15@cam.ac.uk> parents: 
69745diff
changeset | 5750 |   fixes S :: "'a :: {metric_space,second_countable_topology} set"
 | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 5751 | assumes cin: "closedin (top_of_set U) S" | 
| 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 5752 | and oin: "\<And>T. T \<in> \<C> \<Longrightarrow> openin (top_of_set U) T" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5753 | and "S \<subseteq> \<Union>\<C>" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5754 | obtains \<C>' where "S \<subseteq> \<Union> \<C>'" | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 5755 | and "\<And>V. V \<in> \<C>' \<Longrightarrow> openin (top_of_set U) V \<and> (\<exists>T. T \<in> \<C> \<and> V \<subseteq> T)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5756 | and "\<And>x. x \<in> U | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 5757 | \<Longrightarrow> \<exists>V. openin (top_of_set U) V \<and> x \<in> V \<and> | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5758 |                                finite {X. X \<in> \<C>' \<and> (X \<inter> V \<noteq> {})}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5759 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5760 | have "\<exists>Z. open Z \<and> (T = U \<inter> Z)" if "T \<in> \<C>" for T | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5761 | using oin [OF that] by (auto simp: openin_open) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5762 | then obtain F where opF: "open (F T)" and intF: "U \<inter> F T = T" if "T \<in> \<C>" for T | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5763 | by metis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5764 | obtain K where K: "closed K" "U \<inter> K = S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5765 | using cin by (auto simp: closedin_closed) | 
| 69745 | 5766 | have 1: "U \<subseteq> \<Union>(insert (- K) (F ` \<C>))" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5767 | by clarsimp (metis Int_iff Union_iff \<open>U \<inter> K = S\<close> \<open>S \<subseteq> \<Union>\<C>\<close> subsetD intF) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5768 | have 2: "\<And>T. T \<in> insert (- K) (F ` \<C>) \<Longrightarrow> open T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5769 | using \<open>closed K\<close> by (auto simp: opF) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5770 | obtain \<D> where "U \<subseteq> \<Union>\<D>" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5771 | and D1: "\<And>U. U \<in> \<D> \<Longrightarrow> open U \<and> (\<exists>T. T \<in> insert (- K) (F ` \<C>) \<and> U \<subseteq> T)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5772 |              and D2: "\<And>x. x \<in> U \<Longrightarrow> \<exists>V. open V \<and> x \<in> V \<and> finite {U \<in> \<D>. U \<inter> V \<noteq> {}}"
 | 
| 69918 
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
 paulson <lp15@cam.ac.uk> parents: 
69745diff
changeset | 5773 | by (blast intro: paracompact [OF 1 2]) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5774 |   let ?C = "{U \<inter> V |V. V \<in> \<D> \<and> (V \<inter> K \<noteq> {})}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5775 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5776 |   proof (rule_tac \<C>' = "{U \<inter> V |V. V \<in> \<D> \<and> (V \<inter> K \<noteq> {})}" in that)
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5777 | show "S \<subseteq> \<Union>?C" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5778 | using \<open>U \<inter> K = S\<close> \<open>U \<subseteq> \<Union>\<D>\<close> K by (blast dest!: subsetD) | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 5779 | show "\<And>V. V \<in> ?C \<Longrightarrow> openin (top_of_set U) V \<and> (\<exists>T. T \<in> \<C> \<and> V \<subseteq> T)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5780 | using D1 intF by fastforce | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5781 |     have *: "{X. (\<exists>V. X = U \<inter> V \<and> V \<in> \<D> \<and> V \<inter> K \<noteq> {}) \<and> X \<inter> (U \<inter> V) \<noteq> {}} \<subseteq>
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5782 |              (\<lambda>x. U \<inter> x) ` {U \<in> \<D>. U \<inter> V \<noteq> {}}" for V
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5783 | by blast | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 5784 |     show "\<exists>V. openin (top_of_set U) V \<and> x \<in> V \<and> finite {X \<in> ?C. X \<inter> V \<noteq> {}}"
 | 
| 72238 | 5785 | if "x \<in> U" for x | 
| 5786 | proof - | |
| 5787 |       from D2 [OF that] obtain V where "open V" "x \<in> V" "finite {U \<in> \<D>. U \<inter> V \<noteq> {}}"
 | |
| 5788 | by auto | |
| 5789 | with * show ?thesis | |
| 5790 | by (rule_tac x="U \<inter> V" in exI) (auto intro: that finite_subset [OF *]) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5791 | qed | 
| 72238 | 5792 | qed | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5793 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5794 | |
| 70136 | 5795 | corollary\<^marker>\<open>tag unimportant\<close> paracompact_closed: | 
| 69918 
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
 paulson <lp15@cam.ac.uk> parents: 
69745diff
changeset | 5796 |   fixes S :: "'a :: {metric_space,second_countable_topology} set"
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5797 | assumes "closed S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5798 | and opC: "\<And>T. T \<in> \<C> \<Longrightarrow> open T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5799 | and "S \<subseteq> \<Union>\<C>" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5800 | obtains \<C>' where "S \<subseteq> \<Union>\<C>'" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5801 | and "\<And>U. U \<in> \<C>' \<Longrightarrow> open U \<and> (\<exists>T. T \<in> \<C> \<and> U \<subseteq> T)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5802 | and "\<And>x. \<exists>V. open V \<and> x \<in> V \<and> | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5803 |                                finite {U. U \<in> \<C>' \<and> (U \<inter> V \<noteq> {})}"
 | 
| 69918 
eddcc7c726f3
new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
 paulson <lp15@cam.ac.uk> parents: 
69745diff
changeset | 5804 | by (rule paracompact_closedin [of UNIV S \<C>]) (auto simp: assms) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5805 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5806 | |
| 70136 | 5807 | subsection\<^marker>\<open>tag unimportant\<close>\<open>Closed-graph characterization of continuity\<close> | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5808 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5809 | lemma continuous_closed_graph_gen: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5810 | fixes T :: "'b::real_normed_vector set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5811 | assumes contf: "continuous_on S f" and fim: "f ` S \<subseteq> T" | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 5812 | shows "closedin (top_of_set (S \<times> T)) ((\<lambda>x. Pair x (f x)) ` S)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5813 | proof - | 
| 72238 | 5814 |   have eq: "((\<lambda>x. Pair x (f x)) ` S) = (S \<times> T \<inter> (\<lambda>z. (f \<circ> fst)z - snd z) -` {0})"
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5815 | using fim by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5816 | show ?thesis | 
| 72567 | 5817 | unfolding eq | 
| 5818 | by (intro continuous_intros continuous_closedin_preimage continuous_on_subset [OF contf]) auto | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5819 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5820 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5821 | lemma continuous_closed_graph_eq: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5822 | fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5823 | assumes "compact T" and fim: "f ` S \<subseteq> T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5824 | shows "continuous_on S f \<longleftrightarrow> | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 5825 | closedin (top_of_set (S \<times> T)) ((\<lambda>x. Pair x (f x)) ` S)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5826 | (is "?lhs = ?rhs") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5827 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5828 | have "?lhs" if ?rhs | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5829 | proof (clarsimp simp add: continuous_on_closed_gen [OF fim]) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5830 | fix U | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 5831 | assume U: "closedin (top_of_set T) U" | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66793diff
changeset | 5832 | have eq: "(S \<inter> f -` U) = fst ` (((\<lambda>x. Pair x (f x)) ` S) \<inter> (S \<times> U))" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5833 | by (force simp: image_iff) | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 5834 | show "closedin (top_of_set S) (S \<inter> f -` U)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5835 | by (simp add: U closedin_Int closedin_Times closed_map_fst [OF \<open>compact T\<close>] that eq) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5836 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5837 | with continuous_closed_graph_gen assms show ?thesis by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5838 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5839 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5840 | lemma continuous_closed_graph: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5841 | fixes f :: "'a::topological_space \<Rightarrow> 'b::real_normed_vector" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5842 | assumes "closed S" and contf: "continuous_on S f" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5843 | shows "closed ((\<lambda>x. Pair x (f x)) ` S)" | 
| 72238 | 5844 | proof (rule closedin_closed_trans) | 
| 5845 | show "closedin (top_of_set (S \<times> UNIV)) ((\<lambda>x. (x, f x)) ` S)" | |
| 5846 | by (rule continuous_closed_graph_gen [OF contf subset_UNIV]) | |
| 5847 | qed (simp add: \<open>closed S\<close> closed_Times) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5848 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5849 | lemma continuous_from_closed_graph: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5850 | fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5851 | assumes "compact T" and fim: "f ` S \<subseteq> T" and clo: "closed ((\<lambda>x. Pair x (f x)) ` S)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5852 | shows "continuous_on S f" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5853 | using fim clo | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5854 | by (auto intro: closed_subset simp: continuous_closed_graph_eq [OF \<open>compact T\<close> fim]) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5855 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5856 | lemma continuous_on_Un_local_open: | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 5857 | assumes opS: "openin (top_of_set (S \<union> T)) S" | 
| 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 5858 | and opT: "openin (top_of_set (S \<union> T)) T" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5859 | and contf: "continuous_on S f" and contg: "continuous_on T f" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5860 | shows "continuous_on (S \<union> T) f" | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 5861 |   using pasting_lemma [of "{S,T}" "top_of_set (S \<union> T)" id euclidean "\<lambda>i. f" f] contf contg opS opT
 | 
| 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 5862 | by (simp add: subtopology_subtopology) (metis inf.absorb2 openin_imp_subset) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5863 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5864 | lemma continuous_on_cases_local_open: | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 5865 | assumes opS: "openin (top_of_set (S \<union> T)) S" | 
| 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 5866 | and opT: "openin (top_of_set (S \<union> T)) T" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5867 | and contf: "continuous_on S f" and contg: "continuous_on T g" | 
| 69508 | 5868 | and fg: "\<And>x. x \<in> S \<and> \<not>P x \<or> x \<in> T \<and> P x \<Longrightarrow> f x = g x" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5869 | shows "continuous_on (S \<union> T) (\<lambda>x. if P x then f x else g x)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5870 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5871 | have "\<And>x. x \<in> S \<Longrightarrow> (if P x then f x else g x) = f x" "\<And>x. x \<in> T \<Longrightarrow> (if P x then f x else g x) = g x" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5872 | by (simp_all add: fg) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5873 | then have "continuous_on S (\<lambda>x. if P x then f x else g x)" "continuous_on T (\<lambda>x. if P x then f x else g x)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5874 | by (simp_all add: contf contg cong: continuous_on_cong) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5875 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5876 | by (rule continuous_on_Un_local_open [OF opS opT]) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5877 | qed | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 5878 | |
| 70136 | 5879 | subsection\<^marker>\<open>tag unimportant\<close>\<open>The union of two collinear segments is another segment\<close> | 
| 5880 | ||
| 5881 | proposition\<^marker>\<open>tag unimportant\<close> in_convex_hull_exchange: | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5882 | fixes a :: "'a::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5883 | assumes a: "a \<in> convex hull S" and xS: "x \<in> convex hull S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5884 |   obtains b where "b \<in> S" "x \<in> convex hull (insert a (S - {b}))"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5885 | proof (cases "a \<in> S") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5886 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5887 | with xS insert_Diff that show ?thesis by fastforce | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5888 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5889 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5890 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5891 |   proof (cases "finite S \<and> card S \<le> Suc (DIM('a))")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5892 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5893 | then obtain u where u0: "\<And>i. i \<in> S \<Longrightarrow> 0 \<le> u i" and u1: "sum u S = 1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5894 | and ua: "(\<Sum>i\<in>S. u i *\<^sub>R i) = a" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5895 | using a by (auto simp: convex_hull_finite) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5896 | obtain v where v0: "\<And>i. i \<in> S \<Longrightarrow> 0 \<le> v i" and v1: "sum v S = 1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5897 | and vx: "(\<Sum>i\<in>S. v i *\<^sub>R i) = x" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5898 | using True xS by (auto simp: convex_hull_finite) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5899 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5900 | proof (cases "\<exists>b. b \<in> S \<and> v b = 0") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5901 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5902 | then obtain b where b: "b \<in> S" "v b = 0" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5903 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5904 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5905 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5906 |         have fin: "finite (insert a (S - {b}))"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5907 | using sum.infinite v1 by fastforce | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5908 |         show "x \<in> convex hull insert a (S - {b})"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5909 | unfolding convex_hull_finite [OF fin] mem_Collect_eq | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5910 | proof (intro conjI exI ballI) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5911 |           have "(\<Sum>x \<in> insert a (S - {b}). if x = a then 0 else v x) =
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5912 |                 (\<Sum>x \<in> S - {b}. if x = a then 0 else v x)"
 | 
| 72238 | 5913 | using fin by (force intro: sum.mono_neutral_right) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5914 |           also have "... = (\<Sum>x \<in> S - {b}. v x)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5915 | using b False by (auto intro!: sum.cong split: if_split_asm) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5916 | also have "... = (\<Sum>x\<in>S. v x)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5917 | by (metis \<open>v b = 0\<close> diff_zero sum.infinite sum_diff1 u1 zero_neq_one) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5918 |           finally show "(\<Sum>x\<in>insert a (S - {b}). if x = a then 0 else v x) = 1"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5919 | by (simp add: v1) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5920 |           show "\<And>x. x \<in> insert a (S - {b}) \<Longrightarrow> 0 \<le> (if x = a then 0 else v x)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5921 | by (auto simp: v0) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5922 |           have "(\<Sum>x \<in> insert a (S - {b}). (if x = a then 0 else v x) *\<^sub>R x) =
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5923 |                 (\<Sum>x \<in> S - {b}. (if x = a then 0 else v x) *\<^sub>R x)"
 | 
| 72238 | 5924 | using fin by (force intro: sum.mono_neutral_right) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5925 |           also have "... = (\<Sum>x \<in> S - {b}. v x *\<^sub>R x)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5926 | using b False by (auto intro!: sum.cong split: if_split_asm) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5927 | also have "... = (\<Sum>x\<in>S. v x *\<^sub>R x)" | 
| 68072 
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
 immler parents: 
67990diff
changeset | 5928 | by (metis (no_types, lifting) b(2) diff_zero fin finite.emptyI finite_Diff2 finite_insert scale_eq_0_iff sum_diff1) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5929 |           finally show "(\<Sum>x\<in>insert a (S - {b}). (if x = a then 0 else v x) *\<^sub>R x) = x"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5930 | by (simp add: vx) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5931 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5932 | qed (rule \<open>b \<in> S\<close>) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5933 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5934 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5935 | have le_Max: "u i / v i \<le> Max ((\<lambda>i. u i / v i) ` S)" if "i \<in> S" for i | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5936 | by (simp add: True that) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5937 | have "Max ((\<lambda>i. u i / v i) ` S) \<in> (\<lambda>i. u i / v i) ` S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5938 | using True v1 by (auto intro: Max_in) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5939 | then obtain b where "b \<in> S" and beq: "Max ((\<lambda>b. u b / v b) ` S) = u b / v b" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5940 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5941 | then have "0 \<noteq> u b / v b" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5942 | using le_Max beq divide_le_0_iff le_numeral_extra(2) sum_nonpos u1 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5943 | by (metis False eq_iff v0) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5944 | then have "0 < u b" "0 < v b" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5945 | using False \<open>b \<in> S\<close> u0 v0 by force+ | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5946 |       have fin: "finite (insert a (S - {b}))"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5947 | using sum.infinite v1 by fastforce | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5948 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5949 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5950 |         show "x \<in> convex hull insert a (S - {b})"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5951 | unfolding convex_hull_finite [OF fin] mem_Collect_eq | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5952 | proof (intro conjI exI ballI) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5953 |           have "(\<Sum>x \<in> insert a (S - {b}). if x=a then v b / u b else v x - (v b / u b) * u x) =
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5954 |                 v b / u b + (\<Sum>x \<in> S - {b}. v x - (v b / u b) * u x)"
 | 
| 72238 | 5955 | using \<open>a \<notin> S\<close> \<open>b \<in> S\<close> True | 
| 5956 | by (auto intro!: sum.cong split: if_split_asm) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5957 |           also have "... = v b / u b + (\<Sum>x \<in> S - {b}. v x) - (v b / u b) * (\<Sum>x \<in> S - {b}. u x)"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5958 | by (simp add: Groups_Big.sum_subtractf sum_distrib_left) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5959 | also have "... = (\<Sum>x\<in>S. v x)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5960 | using \<open>0 < u b\<close> True by (simp add: Groups_Big.sum_diff1 u1 field_simps) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5961 |           finally show "sum (\<lambda>x. if x=a then v b / u b else v x - (v b / u b) * u x) (insert a (S - {b})) = 1"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5962 | by (simp add: v1) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5963 | show "0 \<le> (if i = a then v b / u b else v i - v b / u b * u i)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5964 |             if "i \<in> insert a (S - {b})" for i
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5965 | using \<open>0 < u b\<close> \<open>0 < v b\<close> v0 [of i] le_Max [of i] beq that False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5966 | by (auto simp: field_simps split: if_split_asm) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5967 |           have "(\<Sum>x\<in>insert a (S - {b}). (if x=a then v b / u b else v x - v b / u b * u x) *\<^sub>R x) =
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5968 |                 (v b / u b) *\<^sub>R a + (\<Sum>x\<in>S - {b}. (v x - v b / u b * u x) *\<^sub>R x)"
 | 
| 72238 | 5969 | using \<open>a \<notin> S\<close> \<open>b \<in> S\<close> True by (auto intro!: sum.cong split: if_split_asm) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5970 |           also have "... = (v b / u b) *\<^sub>R a + (\<Sum>x \<in> S - {b}. v x *\<^sub>R x) - (v b / u b) *\<^sub>R (\<Sum>x \<in> S - {b}. u x *\<^sub>R x)"
 | 
| 68072 
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
 immler parents: 
67990diff
changeset | 5971 | by (simp add: Groups_Big.sum_subtractf scaleR_left_diff_distrib sum_distrib_left scale_sum_right) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5972 | also have "... = (\<Sum>x\<in>S. v x *\<^sub>R x)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5973 | using \<open>0 < u b\<close> True by (simp add: ua vx Groups_Big.sum_diff1 algebra_simps) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5974 | finally | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5975 |           show "(\<Sum>x\<in>insert a (S - {b}). (if x=a then v b / u b else v x - v b / u b * u x) *\<^sub>R x) = x"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5976 | by (simp add: vx) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5977 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5978 | qed (rule \<open>b \<in> S\<close>) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5979 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5980 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5981 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5982 |     obtain T where "finite T" "T \<subseteq> S" and caT: "card T \<le> Suc (DIM('a))" and xT: "x \<in> convex hull T"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5983 | using xS by (auto simp: caratheodory [of S]) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5984 | with False obtain b where b: "b \<in> S" "b \<notin> T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5985 | by (metis antisym subsetI) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5986 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5987 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5988 |       show "x \<in> convex hull insert a (S - {b})"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5989 | using \<open>T \<subseteq> S\<close> b by (blast intro: subsetD [OF hull_mono xT]) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5990 | qed (rule \<open>b \<in> S\<close>) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5991 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5992 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5993 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5994 | lemma convex_hull_exchange_Union: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5995 | fixes a :: "'a::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5996 | assumes "a \<in> convex hull S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5997 |   shows "convex hull S = (\<Union>b \<in> S. convex hull (insert a (S - {b})))" (is "?lhs = ?rhs")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5998 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5999 | show "?lhs \<subseteq> ?rhs" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6000 | by (blast intro: in_convex_hull_exchange [OF assms]) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6001 | show "?rhs \<subseteq> ?lhs" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6002 | proof clarify | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6003 | fix x b | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6004 |     assume"b \<in> S" "x \<in> convex hull insert a (S - {b})"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6005 | then show "x \<in> convex hull S" if "b \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6006 | by (metis (no_types) that assms order_refl hull_mono hull_redundant insert_Diff_single insert_subset subsetCE) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6007 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6008 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6009 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6010 | lemma Un_closed_segment: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6011 | fixes a :: "'a::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6012 | assumes "b \<in> closed_segment a c" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6013 | shows "closed_segment a b \<union> closed_segment b c = closed_segment a c" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6014 | proof (cases "c = a") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6015 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6016 | with assms show ?thesis by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6017 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6018 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6019 |   with assms have "convex hull {a, b} \<union> convex hull {b, c} = (\<Union>ba\<in>{a, c}. convex hull insert b ({a, c} - {ba}))"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6020 | by (auto simp: insert_Diff_if insert_commute) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6021 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6022 | using convex_hull_exchange_Union | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6023 | by (metis assms segment_convex_hull) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6024 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6025 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6026 | lemma Un_open_segment: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6027 | fixes a :: "'a::euclidean_space" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6028 | assumes "b \<in> open_segment a c" | 
| 72567 | 6029 |   shows "open_segment a b \<union> {b} \<union> open_segment b c = open_segment a c" (is "?lhs = ?rhs")
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6030 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6031 | have b: "b \<in> closed_segment a c" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6032 | by (simp add: assms open_closed_segment) | 
| 72567 | 6033 | have *: "?rhs \<subseteq> insert b (open_segment a b \<union> open_segment b c)" | 
| 6034 |           if "{b,c,a} \<union> open_segment a b \<union> open_segment b c = {c,a} \<union> ?rhs"
 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6035 | proof - | 
| 72567 | 6036 | have "insert a (insert c (insert b (open_segment a b \<union> open_segment b c))) = insert a (insert c (?rhs))" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6037 | using that by (simp add: insert_commute) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6038 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6039 | by (metis (no_types) Diff_cancel Diff_eq_empty_iff Diff_insert2 open_segment_def) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6040 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6041 | show ?thesis | 
| 72567 | 6042 | proof | 
| 6043 | show "?lhs \<subseteq> ?rhs" | |
| 6044 | by (simp add: assms b subset_open_segment) | |
| 6045 | show "?rhs \<subseteq> ?lhs" | |
| 6046 | using Un_closed_segment [OF b] * | |
| 6047 | by (simp add: closed_segment_eq_open insert_commute) | |
| 6048 | qed | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6049 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6050 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6051 | subsection\<open>Covering an open set by a countable chain of compact sets\<close> | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6052 | |
| 68607 
67bb59e49834
make theorem, corollary, and proposition %important for HOL-Analysis manual
 immler parents: 
68527diff
changeset | 6053 | proposition open_Union_compact_subsets: | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6054 | fixes S :: "'a::euclidean_space set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6055 | assumes "open S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6056 | obtains C where "\<And>n. compact(C n)" "\<And>n. C n \<subseteq> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6057 | "\<And>n. C n \<subseteq> interior(C(Suc n))" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6058 | "\<Union>(range C) = S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6059 | "\<And>K. \<lbrakk>compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> (C n)" | 
| 68607 
67bb59e49834
make theorem, corollary, and proposition %important for HOL-Analysis manual
 immler parents: 
68527diff
changeset | 6060 | proof (cases "S = {}")
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6061 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6062 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6063 |     by (rule_tac C = "\<lambda>n. {}" in that) auto
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6064 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6065 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6066 | then obtain a where "a \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6067 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6068 |   let ?C = "\<lambda>n. cball a (real n) - (\<Union>x \<in> -S. \<Union>e \<in> ball 0 (1 / real(Suc n)). {x + e})"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6069 | have "\<exists>N. \<forall>n\<ge>N. K \<subseteq> (f n)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6070 | if "\<And>n. compact(f n)" and sub_int: "\<And>n. f n \<subseteq> interior (f(Suc n))" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6071 | and eq: "\<Union>(range f) = S" and "compact K" "K \<subseteq> S" for f K | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6072 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6073 | have *: "\<forall>n. f n \<subseteq> (\<Union>n. interior (f n))" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6074 | by (meson Sup_upper2 UNIV_I \<open>\<And>n. f n \<subseteq> interior (f (Suc n))\<close> image_iff) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6075 | have mono: "\<And>m n. m \<le> n \<Longrightarrow>f m \<subseteq> f n" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6076 | by (meson dual_order.trans interior_subset lift_Suc_mono_le sub_int) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6077 | obtain I where "finite I" and I: "K \<subseteq> (\<Union>i\<in>I. interior (f i))" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6078 | proof (rule compactE_image [OF \<open>compact K\<close>]) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6079 | show "K \<subseteq> (\<Union>n. interior (f n))" | 
| 69313 | 6080 | using \<open>K \<subseteq> S\<close> \<open>\<Union>(f ` UNIV) = S\<close> * by blast | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6081 | qed auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6082 |     { fix n
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6083 | assume n: "Max I \<le> n" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6084 | have "(\<Union>i\<in>I. interior (f i)) \<subseteq> f n" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6085 | by (rule UN_least) (meson dual_order.trans interior_subset mono I Max_ge [OF \<open>finite I\<close>] n) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6086 | then have "K \<subseteq> f n" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6087 | using I by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6088 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6089 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6090 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6091 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6092 | moreover have "\<exists>f. (\<forall>n. compact(f n)) \<and> (\<forall>n. (f n) \<subseteq> S) \<and> (\<forall>n. (f n) \<subseteq> interior(f(Suc n))) \<and> | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6093 | ((\<Union>(range f) = S))" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6094 | proof (intro exI conjI allI) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6095 | show "\<And>n. compact (?C n)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6096 | by (auto simp: compact_diff open_sums) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6097 | show "\<And>n. ?C n \<subseteq> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6098 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6099 | show "?C n \<subseteq> interior (?C (Suc n))" for n | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6100 | proof (simp add: interior_diff, rule Diff_mono) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6101 | show "cball a (real n) \<subseteq> ball a (1 + real n)" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6102 | by (simp add: cball_subset_ball_iff) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6103 |       have cl: "closed (\<Union>x\<in>- S. \<Union>e\<in>cball 0 (1 / (2 + real n)). {x + e})"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6104 | using assms by (auto intro: closed_compact_sums) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6105 |       have "closure (\<Union>x\<in>- S. \<Union>y\<in>ball 0 (1 / (2 + real n)). {x + y})
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6106 |             \<subseteq> (\<Union>x \<in> -S. \<Union>e \<in> cball 0 (1 / (2 + real n)). {x + e})"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6107 | by (intro closure_minimal UN_mono ball_subset_cball order_refl cl) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6108 |       also have "... \<subseteq> (\<Union>x \<in> -S. \<Union>y\<in>ball 0 (1 / (1 + real n)). {x + y})"
 | 
| 72567 | 6109 | by (simp add: cball_subset_ball_iff field_split_simps UN_mono) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6110 |       finally show "closure (\<Union>x\<in>- S. \<Union>y\<in>ball 0 (1 / (2 + real n)). {x + y})
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6111 |                     \<subseteq> (\<Union>x \<in> -S. \<Union>y\<in>ball 0 (1 / (1 + real n)). {x + y})" .
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6112 | qed | 
| 69325 | 6113 | have "S \<subseteq> \<Union> (range ?C)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6114 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6115 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6116 | assume x: "x \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6117 | then obtain e where "e > 0" and e: "ball x e \<subseteq> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6118 | using assms open_contains_ball by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6119 | then obtain N1 where "N1 > 0" and N1: "real N1 > 1/e" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6120 | using reals_Archimedean2 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6121 | by (metis divide_less_0_iff less_eq_real_def neq0_conv not_le of_nat_0 of_nat_1 of_nat_less_0_iff) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6122 | obtain N2 where N2: "norm(x - a) \<le> real N2" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6123 | by (meson real_arch_simple) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6124 | have N12: "inverse((N1 + N2) + 1) \<le> inverse(N1)" | 
| 70817 
dd675800469d
dedicated fact collections for algebraic simplification rules potentially splitting goals
 haftmann parents: 
70802diff
changeset | 6125 | using \<open>N1 > 0\<close> by (auto simp: field_split_simps) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6126 | have "x \<noteq> y + z" if "y \<notin> S" "norm z < 1 / (1 + (real N1 + real N2))" for y z | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6127 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6128 | have "e * real N1 < e * (1 + (real N1 + real N2))" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6129 | by (simp add: \<open>0 < e\<close>) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6130 | then have "1 / (1 + (real N1 + real N2)) < e" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6131 | using N1 \<open>e > 0\<close> | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6132 | by (metis divide_less_eq less_trans mult.commute of_nat_add of_nat_less_0_iff of_nat_Suc) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6133 | then have "x - z \<in> ball x e" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6134 | using that by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6135 | then have "x - z \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6136 | using e by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6137 | with that show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6138 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6139 | qed | 
| 69325 | 6140 | with N2 show "x \<in> \<Union> (range ?C)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6141 | by (rule_tac a = "N1+N2" in UN_I) (auto simp: dist_norm norm_minus_commute) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6142 | qed | 
| 69325 | 6143 | then show "\<Union> (range ?C) = S" by auto | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6144 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6145 | ultimately show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6146 | using that by metis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6147 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6148 | |
| 67986 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6149 | |
| 69272 | 6150 | subsection\<open>Orthogonal complement\<close> | 
| 67986 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6151 | |
| 70136 | 6152 | definition\<^marker>\<open>tag important\<close> orthogonal_comp ("_\<^sup>\<bottom>" [80] 80)
 | 
| 67986 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6153 |   where "orthogonal_comp W \<equiv> {x. \<forall>y \<in> W. orthogonal y x}"
 | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6154 | |
| 69541 | 6155 | proposition subspace_orthogonal_comp: "subspace (W\<^sup>\<bottom>)" | 
| 67986 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6156 | unfolding subspace_def orthogonal_comp_def orthogonal_def | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6157 | by (auto simp: inner_right_distrib) | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6158 | |
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6159 | lemma orthogonal_comp_anti_mono: | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6160 | assumes "A \<subseteq> B" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6161 | shows "B\<^sup>\<bottom> \<subseteq> A\<^sup>\<bottom>" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6162 | proof | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6163 | fix x assume x: "x \<in> B\<^sup>\<bottom>" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6164 | show "x \<in> orthogonal_comp A" using x unfolding orthogonal_comp_def | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6165 | by (simp add: orthogonal_def, metis assms in_mono) | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6166 | qed | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6167 | |
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6168 | lemma orthogonal_comp_null [simp]: "{0}\<^sup>\<bottom> = UNIV"
 | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6169 | by (auto simp: orthogonal_comp_def orthogonal_def) | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6170 | |
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6171 | lemma orthogonal_comp_UNIV [simp]: "UNIV\<^sup>\<bottom> = {0}"
 | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6172 | unfolding orthogonal_comp_def orthogonal_def | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6173 | by auto (use inner_eq_zero_iff in blast) | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6174 | |
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6175 | lemma orthogonal_comp_subset: "U \<subseteq> U\<^sup>\<bottom>\<^sup>\<bottom>" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6176 | by (auto simp: orthogonal_comp_def orthogonal_def inner_commute) | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6177 | |
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6178 | lemma subspace_sum_minimal: | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6179 | assumes "S \<subseteq> U" "T \<subseteq> U" "subspace U" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6180 | shows "S + T \<subseteq> U" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6181 | proof | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6182 | fix x | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6183 | assume "x \<in> S + T" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6184 | then obtain xs xt where "xs \<in> S" "xt \<in> T" "x = xs+xt" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6185 | by (meson set_plus_elim) | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6186 | then show "x \<in> U" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6187 | by (meson assms subsetCE subspace_add) | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6188 | qed | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6189 | |
| 69541 | 6190 | proposition subspace_sum_orthogonal_comp: | 
| 67986 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6191 | fixes U :: "'a :: euclidean_space set" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6192 | assumes "subspace U" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6193 | shows "U + U\<^sup>\<bottom> = UNIV" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6194 | proof - | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6195 | obtain B where "B \<subseteq> U" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6196 | and ortho: "pairwise orthogonal B" "\<And>x. x \<in> B \<Longrightarrow> norm x = 1" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6197 | and "independent B" "card B = dim U" "span B = U" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6198 | using orthonormal_basis_subspace [OF assms] by metis | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6199 | then have "finite B" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6200 | by (simp add: indep_card_eq_dim_span) | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6201 | have *: "\<forall>x\<in>B. \<forall>y\<in>B. x \<bullet> y = (if x=y then 1 else 0)" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6202 | using ortho norm_eq_1 by (auto simp: orthogonal_def pairwise_def) | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6203 |   { fix v
 | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6204 | let ?u = "\<Sum>b\<in>B. (v \<bullet> b) *\<^sub>R b" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6205 | have "v = ?u + (v - ?u)" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6206 | by simp | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6207 | moreover have "?u \<in> U" | 
| 68074 | 6208 | by (metis (no_types, lifting) \<open>span B = U\<close> assms subspace_sum span_base span_mul) | 
| 67986 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6209 | moreover have "(v - ?u) \<in> U\<^sup>\<bottom>" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6210 | proof (clarsimp simp: orthogonal_comp_def orthogonal_def) | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6211 | fix y | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6212 | assume "y \<in> U" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6213 | with \<open>span B = U\<close> span_finite [OF \<open>finite B\<close>] | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6214 | obtain u where u: "y = (\<Sum>b\<in>B. u b *\<^sub>R b)" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6215 | by auto | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6216 | have "b \<bullet> (v - ?u) = 0" if "b \<in> B" for b | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6217 | using that \<open>finite B\<close> | 
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68796diff
changeset | 6218 | by (simp add: * algebra_simps inner_sum_right if_distrib [of "(*)v" for v] inner_commute cong: if_cong) | 
| 67986 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6219 | then show "y \<bullet> (v - ?u) = 0" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6220 | by (simp add: u inner_sum_left) | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6221 | qed | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6222 | ultimately have "v \<in> U + U\<^sup>\<bottom>" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6223 | using set_plus_intro by fastforce | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6224 | } then show ?thesis | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6225 | by auto | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6226 | qed | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6227 | |
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6228 | lemma orthogonal_Int_0: | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6229 | assumes "subspace U" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6230 |   shows "U \<inter> U\<^sup>\<bottom> = {0}"
 | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6231 | using orthogonal_comp_def orthogonal_self | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6232 | by (force simp: assms subspace_0 subspace_orthogonal_comp) | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6233 | |
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6234 | lemma orthogonal_comp_self: | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6235 | fixes U :: "'a :: euclidean_space set" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6236 | assumes "subspace U" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6237 | shows "U\<^sup>\<bottom>\<^sup>\<bottom> = U" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6238 | proof | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6239 | have ssU': "subspace (U\<^sup>\<bottom>)" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6240 | by (simp add: subspace_orthogonal_comp) | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6241 | have "u \<in> U" if "u \<in> U\<^sup>\<bottom>\<^sup>\<bottom>" for u | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6242 | proof - | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6243 | obtain v w where "u = v+w" "v \<in> U" "w \<in> U\<^sup>\<bottom>" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6244 | using subspace_sum_orthogonal_comp [OF assms] set_plus_elim by blast | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6245 | then have "u-v \<in> U\<^sup>\<bottom>" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6246 | by simp | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6247 | moreover have "v \<in> U\<^sup>\<bottom>\<^sup>\<bottom>" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6248 | using \<open>v \<in> U\<close> orthogonal_comp_subset by blast | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6249 | then have "u-v \<in> U\<^sup>\<bottom>\<^sup>\<bottom>" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6250 | by (simp add: subspace_diff subspace_orthogonal_comp that) | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6251 | ultimately have "u-v = 0" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6252 | using orthogonal_Int_0 ssU' by blast | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6253 | with \<open>v \<in> U\<close> show ?thesis | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6254 | by auto | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6255 | qed | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6256 | then show "U\<^sup>\<bottom>\<^sup>\<bottom> \<subseteq> U" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6257 | by auto | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6258 | qed (use orthogonal_comp_subset in auto) | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6259 | |
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6260 | lemma ker_orthogonal_comp_adjoint: | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6261 | fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space" | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6262 | assumes "linear f" | 
| 72238 | 6263 |   shows "f -` {0} = (range (adjoint f))\<^sup>\<bottom>"
 | 
| 72567 | 6264 | proof - | 
| 6265 | have "\<And>x. \<lbrakk>\<forall>y. y \<bullet> f x = 0\<rbrakk> \<Longrightarrow> f x = 0" | |
| 6266 | using assms inner_commute all_zero_iff by metis | |
| 6267 | then show ?thesis | |
| 6268 | using assms | |
| 6269 | by (auto simp: orthogonal_comp_def orthogonal_def adjoint_works inner_commute) | |
| 6270 | qed | |
| 67986 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6271 | |
| 70136 | 6272 | subsection\<^marker>\<open>tag unimportant\<close> \<open>A non-injective linear function maps into a hyperplane.\<close> | 
| 67989 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6273 | |
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6274 | lemma linear_surj_adj_imp_inj: | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6275 | fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6276 | assumes "linear f" "surj (adjoint f)" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6277 | shows "inj f" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6278 | proof - | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6279 | have "\<exists>x. y = adjoint f x" for y | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6280 | using assms by (simp add: surjD) | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6281 | then show "inj f" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6282 | using assms unfolding inj_on_def image_def | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6283 | by (metis (no_types) adjoint_works euclidean_eqI) | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6284 | qed | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6285 | |
| 70138 | 6286 | \<comment> \<open>\<^url>\<open>https://mathonline.wikidot.com/injectivity-and-surjectivity-of-the-adjoint-of-a-linear-map\<close>\<close> | 
| 67989 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6287 | lemma surj_adjoint_iff_inj [simp]: | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6288 | fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6289 | assumes "linear f" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6290 | shows "surj (adjoint f) \<longleftrightarrow> inj f" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6291 | proof | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6292 | assume "surj (adjoint f)" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6293 | then show "inj f" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6294 | by (simp add: assms linear_surj_adj_imp_inj) | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6295 | next | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6296 | assume "inj f" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6297 |   have "f -` {0} = {0}"
 | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6298 | using assms \<open>inj f\<close> linear_0 linear_injective_0 by fastforce | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6299 |   moreover have "f -` {0} = range (adjoint f)\<^sup>\<bottom>"
 | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6300 | by (intro ker_orthogonal_comp_adjoint assms) | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6301 | ultimately have "range (adjoint f)\<^sup>\<bottom>\<^sup>\<bottom> = UNIV" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6302 | by (metis orthogonal_comp_null) | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6303 | then show "surj (adjoint f)" | 
| 68072 
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
 immler parents: 
67990diff
changeset | 6304 | using adjoint_linear \<open>linear f\<close> | 
| 
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
 immler parents: 
67990diff
changeset | 6305 | by (subst (asm) orthogonal_comp_self) | 
| 
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
 immler parents: 
67990diff
changeset | 6306 | (simp add: adjoint_linear linear_subspace_image) | 
| 67989 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6307 | qed | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6308 | |
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6309 | lemma inj_adjoint_iff_surj [simp]: | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6310 | fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6311 | assumes "linear f" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6312 | shows "inj (adjoint f) \<longleftrightarrow> surj f" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6313 | proof | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6314 | assume "inj (adjoint f)" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6315 |   have "(adjoint f) -` {0} = {0}"
 | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6316 | by (metis \<open>inj (adjoint f)\<close> adjoint_linear assms surj_adjoint_iff_inj ker_orthogonal_comp_adjoint orthogonal_comp_UNIV) | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6317 |   then have "(range(f))\<^sup>\<bottom> = {0}"
 | 
| 73932 
fd21b4a93043
added opaque_combs and renamed hide_lams to opaque_lifting
 desharna parents: 
72569diff
changeset | 6318 | by (metis (no_types, opaque_lifting) adjoint_adjoint adjoint_linear assms ker_orthogonal_comp_adjoint set_zero) | 
| 67989 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6319 | then show "surj f" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6320 | by (metis \<open>inj (adjoint f)\<close> adjoint_adjoint adjoint_linear assms surj_adjoint_iff_inj) | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6321 | next | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6322 | assume "surj f" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6323 |   then have "range f = (adjoint f -` {0})\<^sup>\<bottom>"
 | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6324 | by (simp add: adjoint_adjoint adjoint_linear assms ker_orthogonal_comp_adjoint) | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6325 |   then have "{0} = adjoint f -` {0}"
 | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6326 | using \<open>surj f\<close> adjoint_adjoint adjoint_linear assms ker_orthogonal_comp_adjoint by force | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6327 | then show "inj (adjoint f)" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6328 | by (simp add: \<open>surj f\<close> adjoint_adjoint adjoint_linear assms linear_surj_adj_imp_inj) | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6329 | qed | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6330 | |
| 69541 | 6331 | lemma linear_singular_into_hyperplane: | 
| 67989 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6332 | fixes f :: "'n::euclidean_space \<Rightarrow> 'n" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6333 | assumes "linear f" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6334 | shows "\<not> inj f \<longleftrightarrow> (\<exists>a. a \<noteq> 0 \<and> (\<forall>x. a \<bullet> f x = 0))" (is "_ = ?rhs") | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6335 | proof | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6336 | assume "\<not>inj f" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6337 | then show ?rhs | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6338 | using all_zero_iff | 
| 73932 
fd21b4a93043
added opaque_combs and renamed hide_lams to opaque_lifting
 desharna parents: 
72569diff
changeset | 6339 | by (metis (no_types, opaque_lifting) adjoint_clauses(2) adjoint_linear assms | 
| 68072 
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
 immler parents: 
67990diff
changeset | 6340 | linear_injective_0 linear_injective_imp_surjective linear_surj_adj_imp_inj) | 
| 67989 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6341 | next | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6342 | assume ?rhs | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6343 | then show "\<not>inj f" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6344 | by (metis assms linear_injective_isomorphism all_zero_iff) | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6345 | qed | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6346 | |
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6347 | lemma linear_singular_image_hyperplane: | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6348 | fixes f :: "'n::euclidean_space \<Rightarrow> 'n" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6349 | assumes "linear f" "\<not>inj f" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6350 |   obtains a where "a \<noteq> 0" "\<And>S. f ` S \<subseteq> {x. a \<bullet> x = 0}"
 | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6351 | using assms by (fastforce simp add: linear_singular_into_hyperplane) | 
| 67986 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6352 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6353 | end |