| author | Fabian Huch <huch@in.tum.de> | 
| Tue, 04 Jun 2024 09:02:36 +0200 | |
| changeset 80246 | 245dd5f82462 | 
| parent 80175 | 200107cdd3ac | 
| child 80914 | d97fdabd9e2b | 
| 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 | 
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 49 |   have *: "T = {} \<Longrightarrow> z \<notin> S"
 | 
| 66289 
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) | 
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 51 |   { fix x y
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 52 | 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 | 53 | 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 | 54 | 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 | 55 | 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 | 56 | 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 | 57 |     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 | 58 | using \<open>x \<in> closed_segment z y\<close> closed_segment_eq_open by blast | 
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 59 | ultimately have "x \<in> convex hull T" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 60 | 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 | 61 | using y z by blast | 
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 62 | } | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 63 | with * show "?lhs \<subseteq> ?rhs" | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 64 | by (auto simp add: convex_hull_insert_segments) | 
| 66289 
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" | 
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 167 | shows "open_segment a b \<subseteq> interior S" | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 168 | proof - | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 169 |   { fix u::real
 | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 170 | assume u: "0 < u" "u < 1" | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 171 | have "(1 - u) *\<^sub>R a + u *\<^sub>R b = b - (1 - u) *\<^sub>R (b - a)" | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 172 | by (simp add: algebra_simps) | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 173 | also have "... \<in> interior S" using mem_interior_closure_convex_shrink [OF assms] u | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 174 | by simp | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 175 | finally have "(1 - u) *\<^sub>R a + u *\<^sub>R b \<in> interior S" . | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 176 | } | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 177 | then show ?thesis | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 178 | by (clarsimp simp: in_segment) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 179 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 180 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 181 | lemma convex_closure_interior: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 182 | 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 | 183 |   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 | 184 | 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 | 185 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 186 | 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 | 187 | using int by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 188 | 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 | 189 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 190 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 191 | 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 | 192 | 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 | 193 | proof (cases "x=a") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 194 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 195 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 196 | 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 | 197 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 198 | case False | 
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 199 |       { fix e::real
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 200 | assume xnotS: "x \<notin> interior S" and "0 < e" | 
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 201 | have "\<exists>x'\<in>interior S. x' \<noteq> x \<and> dist x' x < e" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 202 | proof (intro bexI conjI) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 203 | 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 | 204 | 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 | 205 | 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 | 206 | 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 | 207 | show "x - min (e/2 / norm (x - a)) 1 *\<^sub>R (x - a) \<in> interior S" | 
| 72211 | 208 | using \<open>0 < e\<close> False | 
| 209 | 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 | 210 | qed | 
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 211 | } | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 212 | then show ?thesis | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 213 | by (auto simp add: closure_def islimpt_approachable) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 214 | qed | 
| 
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 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 217 | 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 | 218 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 219 | |
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 220 | lemma openin_subset_relative_interior: | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 221 | fixes S :: "'a::euclidean_space set" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 222 | shows "openin (top_of_set (affine hull T)) S \<Longrightarrow> (S \<subseteq> rel_interior T) = (S \<subseteq> T)" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 223 | by (meson order.trans rel_interior_maximal rel_interior_subset) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 224 | |
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 225 | lemma conic_hull_eq_span_affine_hull: | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 226 | fixes S :: "'a::euclidean_space set" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 227 | assumes "0 \<in> rel_interior S" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 228 | shows "conic hull S = span S \<and> conic hull S = affine hull S" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 229 | proof - | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 230 | obtain \<epsilon> where "\<epsilon>>0" and \<epsilon>: "cball 0 \<epsilon> \<inter> affine hull S \<subseteq> S" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 231 | using assms mem_rel_interior_cball by blast | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 232 | have *: "affine hull S = span S" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 233 | by (meson affine_hull_span_0 assms hull_inc mem_rel_interior_cball) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 234 | moreover | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 235 | have "conic hull S \<subseteq> span S" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 236 | by (simp add: hull_minimal span_superset) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 237 | moreover | 
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 238 |   { fix x
 | 
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 239 | assume "x \<in> affine hull S" | 
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 240 | have "x \<in> conic hull S" | 
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 241 | proof (cases "x=0") | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 242 | case True | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 243 | then show ?thesis | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 244 | using \<open>x \<in> affine hull S\<close> by auto | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 245 | next | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 246 | case False | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 247 | then have "(\<epsilon> / norm x) *\<^sub>R x \<in> cball 0 \<epsilon> \<inter> affine hull S" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 248 | using \<open>0 < \<epsilon>\<close> \<open>x \<in> affine hull S\<close> * span_mul by fastforce | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 249 | then have "(\<epsilon> / norm x) *\<^sub>R x \<in> S" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 250 | by (meson \<epsilon> subsetD) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 251 | then have "\<exists>c xa. x = c *\<^sub>R xa \<and> 0 \<le> c \<and> xa \<in> S" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 252 | by (smt (verit, del_insts) \<open>0 < \<epsilon>\<close> divide_nonneg_nonneg eq_vector_fraction_iff norm_eq_zero norm_ge_zero) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 253 | then show ?thesis | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 254 | by (simp add: conic_hull_explicit) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 255 | qed | 
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 256 | } | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 257 | then have "affine hull S \<subseteq> conic hull S" | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 258 | by auto | 
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 259 | ultimately show ?thesis | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 260 | by blast | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 261 | qed | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 262 | |
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 263 | lemma conic_hull_eq_span: | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 264 | fixes S :: "'a::euclidean_space set" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 265 | assumes "0 \<in> rel_interior S" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 266 | shows "conic hull S = span S" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 267 | by (simp add: assms conic_hull_eq_span_affine_hull) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 268 | |
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 269 | lemma conic_hull_eq_affine_hull: | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 270 | fixes S :: "'a::euclidean_space set" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 271 | assumes "0 \<in> rel_interior S" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 272 | shows "conic hull S = affine hull S" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 273 | using assms conic_hull_eq_span_affine_hull by blast | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 274 | |
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 275 | lemma conic_hull_eq_span_eq: | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 276 | fixes S :: "'a::euclidean_space set" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 277 | shows "0 \<in> rel_interior(conic hull S) \<longleftrightarrow> conic hull S = span S" (is "?lhs = ?rhs") | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 278 | proof | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 279 | show "?lhs \<Longrightarrow> ?rhs" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 280 | by (metis conic_hull_eq_span conic_span hull_hull hull_minimal hull_subset span_eq) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 281 | show "?rhs \<Longrightarrow> ?lhs" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 282 | by (metis rel_interior_affine subspace_affine subspace_span) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 283 | qed | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 284 | |
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 285 | lemma aff_dim_psubset: | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 286 | "(affine hull S) \<subset> (affine hull T) \<Longrightarrow> aff_dim S < aff_dim T" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 287 | by (metis aff_dim_affine_hull aff_dim_empty aff_dim_subset affine_affine_hull affine_dim_equal order_less_le) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 288 | |
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 289 | lemma aff_dim_eq_full_gen: | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 290 | "S \<subseteq> T \<Longrightarrow> (aff_dim S = aff_dim T \<longleftrightarrow> affine hull S = affine hull T)" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 291 | by (smt (verit, del_insts) aff_dim_affine_hull2 aff_dim_psubset hull_mono psubsetI) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 292 | |
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 293 | lemma aff_dim_eq_full: | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 294 | fixes S :: "'n::euclidean_space set" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 295 |   shows "aff_dim S = (DIM('n)) \<longleftrightarrow> affine hull S = UNIV"
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 296 | by (metis aff_dim_UNIV aff_dim_affine_hull affine_hull_UNIV) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 297 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 298 | 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 | 299 | 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 | 300 |   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 | 301 | 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 | 302 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 303 | 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 | 304 | 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 | 305 | 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 | 306 | 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 | 307 | 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 | 308 | finally show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 309 | 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 | 310 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 311 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 312 | |
| 70136 | 313 | 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 | 314 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 315 | lemma simplex: | 
| 68056 | 316 | assumes "finite S" | 
| 317 | and "0 \<notin> S" | |
| 318 |   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}"
 | |
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 319 | proof - | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 320 |   { fix x and u :: "'a \<Rightarrow> real"
 | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 321 | assume "\<forall>x\<in>S. 0 \<le> u x" "sum u S \<le> 1" | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 322 | then have "\<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)" | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 323 | 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) | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 324 | } | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 325 | then show ?thesis by (auto simp: convex_hull_finite set_eq_iff assms) | 
| 68056 | 326 | qed | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 327 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 328 | lemma substd_simplex: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 329 | 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 | 330 | 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 | 331 |     {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 | 332 | (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 | 333 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 334 | let ?D = d | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 335 | have "0 \<notin> ?p" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 336 | 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 | 337 | 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 | 338 | 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 | 339 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 340 | unfolding simplex[OF \<open>finite d\<close> \<open>0 \<notin> ?p\<close>] | 
| 68056 | 341 | proof (intro set_eqI; safe) | 
| 342 | fix u :: "'a \<Rightarrow> real" | |
| 343 | assume as: "\<forall>x\<in>?D. 0 \<le> u x" "sum u ?D \<le> 1" | |
| 344 | let ?x = "(\<Sum>x\<in>?D. u x *\<^sub>R x)" | |
| 345 | have ind: "\<forall>i\<in>Basis. i \<in> d \<longrightarrow> u i = ?x \<bullet> i" | |
| 346 | and notind: "(\<forall>i\<in>Basis. i \<notin> d \<longrightarrow> ?x \<bullet> i = 0)" | |
| 347 | using substdbasis_expansion_unique[OF assms] by blast+ | |
| 348 | then have **: "sum u ?D = sum ((\<bullet>) ?x) ?D" | |
| 349 | using assms by (auto intro!: sum.cong) | |
| 350 | show "0 \<le> ?x \<bullet> i" if "i \<in> Basis" for i | |
| 351 | using as(1) ind notind that by fastforce | |
| 352 | show "sum ((\<bullet>) ?x) ?D \<le> 1" | |
| 353 | using "**" as(2) by linarith | |
| 354 | show "?x \<bullet> i = 0" if "i \<in> Basis" "i \<notin> d" for i | |
| 355 | 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 | 356 | next | 
| 68056 | 357 | fix x | 
| 358 | 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)" | |
| 359 | 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" | |
| 360 | unfolding substdbasis_expansion_unique[OF assms] | |
| 361 | 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 | 362 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 363 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 364 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 365 | lemma std_simplex: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 366 | "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 | 367 |     {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 | 368 | 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 | 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: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 371 | "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 | 372 |     {x::'a::euclidean_space. (\<forall>i\<in>Basis. 0 < x\<bullet>i) \<and> sum (\<lambda>i. x\<bullet>i) Basis < 1}"
 | 
| 68056 | 373 | unfolding set_eq_iff mem_interior std_simplex | 
| 374 | 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 | 375 | fix x :: 'a | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 376 | fix e | 
| 68056 | 377 |   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}"
 | 
| 378 | show "(\<forall>i\<in>Basis. 0 < x \<bullet> i) \<and> sum ((\<bullet>) x) Basis < 1" | |
| 379 | proof safe | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 380 | fix i :: 'a | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 381 | 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 | 382 | then show "0 < x \<bullet> i" | 
| 72567 | 383 | using as[THEN subsetD[where c="x - (e/2) *\<^sub>R i"]] and \<open>e > 0\<close> | 
| 68056 | 384 | 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 | 385 | next | 
| 72567 | 386 | 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 | 387 | unfolding dist_norm | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 388 | by (auto intro!: mult_strict_left_mono simp: SOME_Basis) | 
| 72567 | 389 | 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 | 390 | 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 | 391 | by (auto simp: SOME_Basis inner_Basis inner_simps) | 
| 72567 | 392 | 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 | 393 | sum (\<lambda>i. x\<bullet>i + (if (SOME i. i\<in>Basis) = i then e/2 else 0)) Basis" | 
| 68056 | 394 | by (auto simp: intro!: sum.cong) | 
| 72567 | 395 | have "sum ((\<bullet>) x) Basis < sum ((\<bullet>) (x + (e/2) *\<^sub>R (SOME i. i\<in>Basis))) Basis" | 
| 68056 | 396 | 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 | 397 | also have "\<dots> \<le> 1" | 
| 68056 | 398 | using ** as by force | 
| 67399 | 399 | finally show "sum ((\<bullet>) x) Basis < 1" by auto | 
| 68056 | 400 | qed | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 401 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 402 | fix x :: 'a | 
| 67399 | 403 | 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 | 404 | obtain a :: 'b where "a \<in> UNIV" using UNIV_witness .. | 
| 67399 | 405 |   let ?d = "(1 - sum ((\<bullet>) x) Basis) / real (DIM('a))"
 | 
| 68056 | 406 |   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}"
 | 
| 407 | 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 | 408 | fix y | 
| 68056 | 409 | assume y: "y \<in> ball x (min (Min ((\<bullet>) x ` Basis)) ?d)" | 
| 67399 | 410 | 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 | 411 | proof (rule sum_mono) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 412 | fix i :: 'a | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 413 | assume i: "i \<in> Basis" | 
| 68056 | 414 | have "\<bar>y\<bullet>i - x\<bullet>i\<bar> \<le> norm (y - x)" | 
| 415 | by (metis Basis_le_norm i inner_commute inner_diff_right) | |
| 416 | also have "... < ?d" | |
| 417 | using y by (simp add: dist_norm norm_minus_commute) | |
| 418 | 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 | 419 | 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 | 420 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 421 | 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 | 422 | 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 | 423 | by (auto simp add: Suc_le_eq) | 
| 67399 | 424 | 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 | 425 | 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 | 426 | proof safe | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 427 | fix i :: 'a | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 428 | 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 | 429 | have "norm (x - y) < Min (((\<bullet>) x) ` Basis)" | 
| 68056 | 430 | using y by (auto simp: dist_norm less_eq_real_def) | 
| 431 | also have "... \<le> x\<bullet>i" | |
| 432 | using i by auto | |
| 433 | 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 | 434 | 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 | 435 | 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 | 436 | 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 | 437 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 438 | next | 
| 67399 | 439 | 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 | 440 | using as by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 441 | moreover have "?d > 0" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 442 | using as by (auto simp: Suc_le_eq) | 
| 67399 | 443 |     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 | 444 | by linarith | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 445 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 446 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 447 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 448 | 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 | 449 | 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 | 450 | "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 | 451 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 452 | 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 | 453 |   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 | 454 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 455 | fix i :: 'a | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 456 | 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 | 457 |     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 | 458 |       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 | 459 | (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 | 460 | note ** = this | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 461 | show ?thesis | 
| 72211 | 462 | proof | 
| 463 | show "?a \<in> interior(convex hull (insert 0 Basis))" | |
| 464 | unfolding interior_std_simplex mem_Collect_eq | |
| 465 | proof safe | |
| 466 | fix i :: 'a | |
| 467 | assume i: "i \<in> Basis" | |
| 468 | show "0 < ?a \<bullet> i" | |
| 469 | unfolding **[OF i] by (auto simp add: Suc_le_eq) | |
| 470 | next | |
| 471 |       have "sum ((\<bullet>) ?a) ?D = sum (\<lambda>i. inverse (2 * real DIM('a))) ?D"
 | |
| 472 | by (auto intro: sum.cong) | |
| 473 | also have "\<dots> < 1" | |
| 474 | unfolding sum_constant divide_inverse[symmetric] | |
| 475 | by (auto simp add: field_simps) | |
| 476 | finally show "sum ((\<bullet>) ?a) ?D < 1" by auto | |
| 477 | qed | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 478 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 479 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 480 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 481 | lemma rel_interior_substd_simplex: | 
| 68056 | 482 | assumes D: "D \<subseteq> Basis" | 
| 483 | shows "rel_interior (convex hull (insert 0 D)) = | |
| 72567 | 484 |          {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)}"
 | 
| 485 | (is "_ = ?s") | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 486 | proof - | 
| 68056 | 487 | have "finite D" | 
| 488 | 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 | 489 | show ?thesis | 
| 68056 | 490 |   proof (cases "D = {}")
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 491 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 492 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 493 | 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 | 494 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 495 | case False | 
| 72567 | 496 | have h0: "affine hull (convex hull (insert 0 D)) = | 
| 497 |               {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 | 498 | using affine_hull_convex_hull affine_hull_substd_basis assms by auto | 
| 68056 | 499 | 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 | 500 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 501 |     {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 502 | fix x :: "'a::euclidean_space" | 
| 72567 | 503 | assume x: "x \<in> rel_interior (convex hull (insert 0 D))" | 
| 68056 | 504 | then obtain e where "e > 0" and | 
| 72567 | 505 |         "ball x e \<inter> {xa. (\<forall>i\<in>Basis. i \<notin> D \<longrightarrow> xa\<bullet>i = 0)} \<subseteq> convex hull (insert 0 D)"
 | 
| 506 | using mem_rel_interior_ball[of x "convex hull (insert 0 D)"] h0 by auto | |
| 507 | 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> | |
| 508 | (\<forall>i\<in>D. 0 \<le> y \<bullet> i) \<and> sum ((\<bullet>) y) D \<le> 1" | |
| 509 | using assms by (force simp: substd_simplex) | |
| 68056 | 510 | 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 | 511 | using x rel_interior_subset substd_simplex[OF assms] by auto | 
| 68056 | 512 | 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)" | 
| 513 | 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 | 514 | fix i :: 'a | 
| 68056 | 515 | assume "i \<in> D" | 
| 72567 | 516 | then have "\<forall>j\<in>D. 0 \<le> (x - (e/2) *\<^sub>R i) \<bullet> j" | 
| 68056 | 517 | using D \<open>e > 0\<close> x0 | 
| 72567 | 518 | 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 | 519 | then show "0 < x \<bullet> i" | 
| 68056 | 520 | 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 | 521 | next | 
| 68056 | 522 | obtain a where a: "a \<in> D" | 
| 523 |           using \<open>D \<noteq> {}\<close> by auto
 | |
| 72567 | 524 | then have **: "dist x (x + (e/2) *\<^sub>R a) < e" | 
| 525 | using \<open>e > 0\<close> norm_Basis[of a] D by (auto simp: dist_norm) | |
| 526 | 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 | 527 | using a D by (auto simp: inner_simps inner_Basis) | 
| 72567 | 528 | 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 | 529 | 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 | 530 | have "a \<in> Basis" | 
| 68056 | 531 | using \<open>a \<in> D\<close> D by auto | 
| 72567 | 532 | then have h1: "(\<forall>i\<in>Basis. i \<notin> D \<longrightarrow> (x + (e/2) *\<^sub>R a) \<bullet> i = 0)" | 
| 68056 | 533 | using x0 D \<open>a\<in>D\<close> by (auto simp add: inner_add_left inner_Basis) | 
| 72567 | 534 | have "sum ((\<bullet>) x) D < sum ((\<bullet>) (x + (e/2) *\<^sub>R a)) D" | 
| 68056 | 535 | 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 | 536 | also have "\<dots> \<le> 1" | 
| 72567 | 537 | 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 | 538 | by auto | 
| 68056 | 539 | 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 | 540 | using x0 by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 541 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 542 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 543 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 544 |     {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 545 | 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 | 546 | 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 | 547 | 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 | 548 | by auto | 
| 68056 | 549 | 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 | 550 | ultimately | 
| 68056 | 551 | 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 | 552 | by metis | 
| 72567 | 553 | then have h2: "x \<in> convex hull (insert 0 D)" | 
| 554 | using as assms by (force simp add: substd_simplex) | |
| 68056 | 555 | obtain a where a: "a \<in> D" | 
| 556 |         using \<open>D \<noteq> {}\<close> by auto
 | |
| 72567 | 557 | define d where "d \<equiv> (1 - sum ((\<bullet>) x) D) / real (card D)" | 
| 558 |       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 | 559 | unfolding substd_simplex[OF assms] | 
| 72567 | 560 | proof (intro exI; safe) | 
| 561 |         have "0 < card D" using \<open>D \<noteq> {}\<close> \<open>finite D\<close>
 | |
| 562 | by (simp add: card_gt_0_iff) | |
| 563 | have "Min (((\<bullet>) x) ` D) > 0" | |
| 564 |           using as \<open>D \<noteq> {}\<close> \<open>finite D\<close> by (simp)
 | |
| 565 | moreover have "d > 0" | |
| 566 | using as \<open>0 < card D\<close> by (auto simp: d_def) | |
| 567 | ultimately show "min (Min (((\<bullet>) x) ` D)) d > 0" | |
| 568 | by auto | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 569 | fix y :: 'a | 
| 68056 | 570 | assume y2: "\<forall>i\<in>Basis. i \<notin> D \<longrightarrow> y\<bullet>i = 0" | 
| 72567 | 571 | assume "y \<in> ball x (min (Min ((\<bullet>) x ` D)) d)" | 
| 572 | then have y: "dist x y < min (Min ((\<bullet>) x ` D)) d" | |
| 573 | by auto | |
| 574 | 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 | 575 | proof (rule sum_mono) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 576 | fix i | 
| 68056 | 577 | assume "i \<in> D" | 
| 578 | 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 | 579 | by auto | 
| 68056 | 580 | have "\<bar>y\<bullet>i - x\<bullet>i\<bar> \<le> norm (y - x)" | 
| 581 | by (metis i inner_commute inner_diff_right norm_bound_Basis_le order_refl) | |
| 72567 | 582 | also have "... < d" | 
| 68056 | 583 | by (metis dist_norm min_less_iff_conj norm_minus_commute y) | 
| 72567 | 584 | finally have "\<bar>y\<bullet>i - x\<bullet>i\<bar> < d" . | 
| 585 | 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 | 586 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 587 | also have "\<dots> \<le> 1" | 
| 72567 | 588 | 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 | 589 | by auto | 
| 68056 | 590 | 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 | 591 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 592 | fix i :: 'a | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 593 | 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 | 594 | then show "0 \<le> y\<bullet>i" | 
| 68056 | 595 | 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 | 596 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 597 | have "norm (x - y) < x\<bullet>i" | 
| 72567 | 598 | using y Min_gr_iff[of "(\<bullet>) x ` D" "norm (x - y)"] \<open>0 < card D\<close> \<open>i \<in> D\<close> | 
| 599 | 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 | 600 | 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 | 601 | 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 | 602 | by (auto simp: inner_simps) | 
| 72211 | 603 | 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 | 604 | qed | 
| 72567 | 605 | then have "x \<in> rel_interior (convex hull (insert 0 D))" | 
| 72211 | 606 | 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 | 607 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 608 | ultimately have | 
| 68056 | 609 | "\<And>x. x \<in> rel_interior (convex hull insert 0 D) \<longleftrightarrow> | 
| 610 |         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 | 611 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 612 | 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 | 613 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 614 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 615 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 616 | lemma rel_interior_substd_simplex_nonempty: | 
| 68056 | 617 |   assumes "D \<noteq> {}"
 | 
| 618 | 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 | 619 | obtains a :: "'a::euclidean_space" | 
| 68056 | 620 | where "a \<in> rel_interior (convex hull (insert 0 D))" | 
| 621 | proof - | |
| 72567 | 622 | let ?a = "sum (\<lambda>b::'a::euclidean_space. inverse (2 * real (card D)) *\<^sub>R b) D" | 
| 68056 | 623 | have "finite D" | 
| 72211 | 624 | using assms finite_Basis infinite_super by blast | 
| 68056 | 625 | then have d1: "0 < real (card D)" | 
| 626 |     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 | 627 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 628 | fix i | 
| 68056 | 629 | assume "i \<in> D" | 
| 72567 | 630 | 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 | 631 | unfolding inner_sum_left | 
| 72211 | 632 | using \<open>i \<in> D\<close> by (auto simp: inner_Basis subsetD[OF assms(2)] intro: sum.cong) | 
| 633 | also have "... = inverse (2 * real (card D))" | |
| 634 | using \<open>i \<in> D\<close> \<open>finite D\<close> by auto | |
| 635 | 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 | 636 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 637 | note ** = this | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 638 | show ?thesis | 
| 72211 | 639 | proof | 
| 640 | show "?a \<in> rel_interior (convex hull (insert 0 D))" | |
| 641 | unfolding rel_interior_substd_simplex[OF assms(2)] | |
| 642 | proof safe | |
| 643 | fix i | |
| 644 | assume "i \<in> D" | |
| 645 | have "0 < inverse (2 * real (card D))" | |
| 646 | using d1 by auto | |
| 647 | 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 | 648 | by auto | 
| 72211 | 649 | finally show "0 < ?a \<bullet> i" by auto | 
| 650 | next | |
| 72567 | 651 | have "sum ((\<bullet>) ?a) D = sum (\<lambda>i. inverse (2 * real (card D))) D" | 
| 72211 | 652 | by (rule sum.cong) (rule refl, rule **) | 
| 653 | also have "\<dots> < 1" | |
| 654 | unfolding sum_constant divide_real_def[symmetric] | |
| 655 | by (auto simp add: field_simps) | |
| 72567 | 656 | finally show "sum ((\<bullet>) ?a) D < 1" by auto | 
| 72211 | 657 | next | 
| 658 | fix i | |
| 659 | assume "i \<in> Basis" and "i \<notin> D" | |
| 660 | have "?a \<in> span D" | |
| 661 | proof (rule span_sum[of D "(\<lambda>b. b /\<^sub>R (2 * real (card D)))" D]) | |
| 662 |         {
 | |
| 663 | fix x :: "'a::euclidean_space" | |
| 664 | assume "x \<in> D" | |
| 665 | then have "x \<in> span D" | |
| 666 | using span_base[of _ "D"] by auto | |
| 667 | then have "x /\<^sub>R (2 * real (card D)) \<in> span D" | |
| 668 | using span_mul[of x "D" "(inverse (real (card D)) / 2)"] by auto | |
| 669 | } | |
| 670 | then show "\<And>x. x\<in>D \<Longrightarrow> x /\<^sub>R (2 * real (card D)) \<in> span D" | |
| 671 | by auto | |
| 672 | qed | |
| 673 | then show "?a \<bullet> i = 0 " | |
| 674 | 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 | 675 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 676 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 677 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 678 | |
| 70136 | 679 | 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 | 680 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 681 | 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 | 682 | 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 | 683 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 684 | and "0 \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 685 |   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 | 686 | proof (cases "S = {0}")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 687 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 688 | 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 | 689 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 690 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 691 | 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 | 692 | 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 | 693 |   then have "B \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 694 |     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 | 695 | 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 | 696 | 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 | 697 | 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 | 698 | 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 | 699 | 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 | 700 | 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 | 701 | 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 | 702 | 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 | 703 | 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 | 704 | 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 | 705 | 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 | 706 | 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 | 707 | 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 | 708 | 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 | 709 | 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 | 710 | 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 | 711 | 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 | 712 | 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 | 713 | 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 | 714 | 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 | 715 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 716 | 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 | 717 | 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 | 718 |       "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 | 719 | 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 | 720 | 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 | 721 | 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 | 722 | 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 | 723 |   have "d \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 724 |     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 | 725 | 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 | 726 | 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 | 727 | 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 | 728 | 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 | 729 | 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 | 730 | by auto | 
| 72238 | 731 | moreover have "rel_interior (f ` (convex hull insert 0 B)) = f ` rel_interior (convex hull insert 0 B)" | 
| 732 | proof (rule rel_interior_injective_on_span_linear_image[OF \<open>bounded_linear f\<close>]) | |
| 733 | show "inj_on f (span (convex hull insert 0 B))" | |
| 734 | using fd * by auto | |
| 735 | qed | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 736 |   ultimately have "rel_interior (convex hull insert 0 B) \<noteq> {}"
 | 
| 72238 | 737 |     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 | 738 | moreover have "convex hull (insert 0 B) \<subseteq> S" | 
| 72238 | 739 | 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 | 740 | ultimately show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 741 | 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 | 742 | qed | 
| 
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 | 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 | 745 | 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 | 746 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 747 |   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 | 748 | proof - | 
| 
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 "S \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 751 | then obtain a where "a \<in> S" by auto | 
| 67399 | 752 | 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 | 753 | using assms exI[of "(\<lambda>x. x \<in> S \<and> - a + x = 0)" a] by auto | 
| 67399 | 754 |     then have "rel_interior ((+) (-a) ` S) \<noteq> {}"
 | 
| 755 | 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 | 756 | 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 | 757 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 758 |     then have "rel_interior S \<noteq> {}"
 | 
| 69661 | 759 | 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 | 760 | } | 
| 71176 | 761 | 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 | 762 | qed | 
| 
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 | lemma interior_simplex_nonempty: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 765 | 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 | 766 |   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 | 767 | 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 | 768 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 769 | 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 | 770 | 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 | 771 | 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 | 772 |   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 | 773 | 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 | 774 |   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 | 775 | 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 | 776 | with that show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 777 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 778 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 779 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 780 | lemma convex_rel_interior: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 781 | 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 | 782 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 783 | 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 | 784 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 785 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 786 | 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 | 787 | 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 | 788 | 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 | 789 | 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 | 790 | 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 | 791 | proof (cases "0 = u") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 792 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 793 | 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 | 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 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 | 796 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 797 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 798 | 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 | 799 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 800 | 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 | 801 | 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 | 802 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 803 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 804 | 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 | 805 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 806 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 807 | 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 | 808 | 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 | 809 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 810 | 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 | 811 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 812 | 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 | 813 | 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 | 814 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 815 |   proof (cases "S = {}")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 816 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 817 | 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 | 818 | 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 | 819 |     { fix x
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 820 | 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 | 821 |       {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 822 | assume "x = a" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 823 | 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 | 824 | 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 | 825 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 826 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 827 |       {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 828 | assume "x \<noteq> a" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 829 |          {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 830 | fix e :: real | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 831 | assume "e > 0" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 832 | 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 | 833 | 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 | 834 | 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 | 835 | by simp_all | 
| 67613 | 836 | 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 | 837 | 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 | 838 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 839 | have "\<exists>y. y \<in> rel_interior S \<and> y \<noteq> x \<and> dist y x \<le> e" | 
| 72567 | 840 | 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 | 841 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 842 | 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 | 843 | 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 | 844 | 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 | 845 | 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 | 846 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 847 | 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 | 848 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 849 | then show ?thesis using h1 by auto | 
| 72567 | 850 | qed auto | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 851 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 852 | |
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 853 | lemma empty_interior_subset_hyperplane_aux: | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 854 | fixes S :: "'a::euclidean_space set" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 855 |   assumes "convex S" "0 \<in> S" and empty_int: "interior S = {}"
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 856 |   shows "\<exists>a b. a\<noteq>0 \<and> S \<subseteq> {x. a \<bullet> x = b}"
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 857 | proof - | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 858 | have False if "\<And>a. a = 0 \<or> (\<forall>b. \<exists>T \<in> S. a \<bullet> T \<noteq> b)" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 859 | proof - | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 860 |     have rel_int: "rel_interior S \<noteq> {}"
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 861 | using assms rel_interior_eq_empty by auto | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 862 | moreover | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 863 | have "dim S \<noteq> dim (UNIV::'a set)" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 864 | by (metis aff_dim_zero affine_hull_UNIV \<open>0 \<in> S\<close> dim_UNIV empty_int hull_inc rel_int rel_interior_interior) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 865 |     then obtain a where "a \<noteq> 0" and a: "span S \<subseteq> {x. a \<bullet> x = 0}"
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 866 | using lowdim_subset_hyperplane | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 867 | by (metis dim_UNIV dim_subset_UNIV order_less_le) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 868 | have "span UNIV = span S" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 869 | by (metis span_base span_not_UNIV_orthogonal that) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 870 | then have "UNIV \<subseteq> affine hull S" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 871 | by (simp add: \<open>0 \<in> S\<close> hull_inc affine_hull_span_0) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 872 | ultimately show False | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 873 |       using \<open>rel_interior S \<noteq> {}\<close> empty_int rel_interior_interior by blast
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 874 | qed | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 875 | then show ?thesis | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 876 | by blast | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 877 | qed | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 878 | |
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 879 | lemma empty_interior_subset_hyperplane: | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 880 | fixes S :: "'a::euclidean_space set" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 881 |   assumes "convex S" and int: "interior S = {}"
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 882 |   obtains a b where "a \<noteq> 0" "S \<subseteq> {x. a \<bullet> x = b}"
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 883 | proof (cases "S = {}")
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 884 | case True | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 885 | then show ?thesis | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 886 | using that by blast | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 887 | next | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 888 | case False | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 889 | then obtain u where "u \<in> S" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 890 | by blast | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 891 |   have "\<exists>a b. a \<noteq> 0 \<and> (\<lambda>x. x - u) ` S \<subseteq> {x. a \<bullet> x = b}"
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 892 | proof (rule empty_interior_subset_hyperplane_aux) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 893 | show "convex ((\<lambda>x. x - u) ` S)" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 894 | using \<open>convex S\<close> by force | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 895 | show "0 \<in> (\<lambda>x. x - u) ` S" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 896 | by (simp add: \<open>u \<in> S\<close>) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 897 |     show "interior ((\<lambda>x. x - u) ` S) = {}"
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 898 | by (simp add: int interior_translation_subtract) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 899 | qed | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 900 |   then obtain a b where "a \<noteq> 0" and ab: "(\<lambda>x. x - u) ` S \<subseteq> {x. a \<bullet> x = b}"
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 901 | by metis | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 902 |   then have "S \<subseteq> {x. a \<bullet> x = b + (a \<bullet> u)}"
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 903 | using ab by (auto simp: algebra_simps) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 904 | then show ?thesis | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 905 | using \<open>a \<noteq> 0\<close> that by auto | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 906 | qed | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 907 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 908 | 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 | 909 | 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 | 910 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 911 | 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 | 912 | 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 | 913 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 914 | 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 | 915 | 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 | 916 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 917 | 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 | 918 | 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 | 919 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 920 | 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 | 921 | 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 | 922 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 923 | 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 | 924 | proof - | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 925 | 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 | 926 | 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 | 927 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 928 | 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 | 929 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 930 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 931 | 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 | 932 | 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 | 933 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 934 | 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 | 935 | 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 | 936 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 937 | 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 | 938 | 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 | 939 | assumes "0 < a" "0 < b" "(a + b) *\<^sub>R z = a *\<^sub>R x + b *\<^sub>R y" | 
| 72567 | 940 | 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 | 941 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 942 | 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 | 943 | have "z = (1 / (a + b)) *\<^sub>R ((a + b) *\<^sub>R z)" | 
| 68056 | 944 | 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 | 945 | 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 | 946 | 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 | 947 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 948 | also have "\<dots> = y - e *\<^sub>R (y-x)" | 
| 72238 | 949 | using e_def assms | 
| 72567 | 950 | 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 | 951 | 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 | 952 | by auto | 
| 72567 | 953 | 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 | 954 | 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 | 955 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 956 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 957 | 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 | 958 | 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 | 959 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 960 | 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 | 961 | proof (cases "S = {}")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 962 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 963 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 964 | 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 | 965 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 966 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 967 | 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 | 968 | 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 | 969 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 970 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 971 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 972 | fix z | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 973 | 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 | 974 | 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 | 975 |       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 | 976 | 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 | 977 | proof (cases "x = z") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 978 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 979 | 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 | 980 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 981 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 982 | 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 | 983 | 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 | 984 | 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 | 985 | 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 | 986 | have yball: "y \<in> cball z e" | 
| 71174 | 987 | 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 | 988 | 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 | 989 | 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 | 990 | 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 | 991 | 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 | 992 | 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 | 993 | 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 | 994 | 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 | 995 | 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 | 996 | 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 | 997 | using y_def by (simp add: algebra_simps) | 
| 72567 | 998 | 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 | 999 | 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 | 1000 | 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 | 1001 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1002 | using rel_interior_closure_convex_shrink assms x \<open>y \<in> closure S\<close> | 
| 72567 | 1003 | by fastforce | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1004 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1005 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1006 | 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 | 1007 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1008 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1009 | lemma convex_interior_closure: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1010 | 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 | 1011 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1012 | 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 | 1013 | 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 | 1014 | 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 | 1015 | 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 | 1016 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1017 | |
| 78037 
37894dff0111
More material from the HOL Light metric space library
 paulson <lp15@cam.ac.uk> parents: 
74729diff
changeset | 1018 | lemma open_subset_closure_of_interval: | 
| 
37894dff0111
More material from the HOL Light metric space library
 paulson <lp15@cam.ac.uk> parents: 
74729diff
changeset | 1019 | assumes "open U" "is_interval S" | 
| 
37894dff0111
More material from the HOL Light metric space library
 paulson <lp15@cam.ac.uk> parents: 
74729diff
changeset | 1020 | 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 | 1021 | 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 | 1022 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1023 | 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 | 1024 | 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 | 1025 | assumes "convex S1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1026 | and "convex S2" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1027 | 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 | 1028 | 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 | 1029 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1030 | lemma closure_eq_between: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1031 | 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 | 1032 | assumes "convex S1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1033 | and "convex S2" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1034 | 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 | 1035 | (is "?A \<longleftrightarrow> ?B") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1036 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1037 | assume ?A | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1038 | then show ?B | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1039 | 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 | 1040 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1041 | assume ?B | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1042 | 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 | 1043 | 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 | 1044 | 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 | 1045 | 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 | 1046 | ultimately show ?A .. | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1047 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1048 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1049 | 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 | 1050 | 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 | 1051 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1052 | and "open A" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1053 |   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 | 1054 | 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 | 1055 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1056 | 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 | 1057 | 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 | 1058 | 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 | 1059 | proof (cases "a = b") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1060 | 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 | 1061 | next | 
| 72238 | 1062 | case False then | 
| 1063 |   have "open_segment a b = affine hull {a, b} \<inter> ball ((a + b) /\<^sub>R 2) (norm (b - a) / 2)"
 | |
| 1064 | by (simp add: open_segment_as_ball) | |
| 1065 | then show ?thesis | |
| 1066 | unfolding rel_interior_eq openin_open | |
| 1067 | 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 | 1068 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1069 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1070 | 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 | 1071 | 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 | 1072 | 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 | 1073 |          (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 | 1074 | proof (cases "a = b") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1075 | 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 | 1076 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1077 | 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 | 1078 | by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1079 | (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 | 1080 | rel_interior_open_segment) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1081 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1082 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1083 | 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 | 1084 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1085 | 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 | 1086 | |
| 70136 | 1087 | 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 | 1088 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1089 | 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 | 1090 | 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 | 1091 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1092 | 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 | 1093 | 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 | 1094 |     shows "rel_frontier S = {} \<longleftrightarrow> affine S"
 | 
| 68056 | 1095 | unfolding rel_frontier_def | 
| 1096 | 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 | 1097 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1098 | 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 | 1099 | 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 | 1100 |     shows "rel_frontier {a} = {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1101 | 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 | 1102 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1103 | 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 | 1104 | 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 | 1105 | 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 | 1106 | 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 | 1107 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1108 | 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 | 1109 | 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 | 1110 |     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 | 1111 | 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 | 1112 | 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 | 1113 | 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 | 1114 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1115 | 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 | 1116 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1117 | case greater then show ?thesis | 
| 72238 | 1118 | 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 | 1119 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1120 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1121 | lemma rel_frontier_translation: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1122 | 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 | 1123 | shows "rel_frontier((\<lambda>x. a + x) ` S) = (\<lambda>x. a + x) ` (rel_frontier S)" | 
| 72238 | 1124 | 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 | 1125 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1126 | 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 | 1127 | 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 | 1128 |   shows "interior S \<noteq> {} \<Longrightarrow> rel_frontier S = frontier S"
 | 
| 72238 | 1129 | 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 | 1130 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1131 | lemma rel_frontier_frontier: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1132 | 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 | 1133 | shows "affine hull S = UNIV \<Longrightarrow> rel_frontier S = frontier S" | 
| 72238 | 1134 | 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 | 1135 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1136 | 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 | 1137 |    "\<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 | 1138 | \<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 | 1139 | 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 | 1140 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1141 | 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 | 1142 | 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 | 1143 | 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 | 1144 | proof - | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 1145 | 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 | 1146 | 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 | 1147 | show ?thesis | 
| 72238 | 1148 | proof (rule closedin_closed_trans[of "affine hull S" "rel_frontier S"]) | 
| 1149 | show "closedin (top_of_set (affine hull S)) (rel_frontier S)" | |
| 1150 | by (simp add: "*" rel_frontier_def) | |
| 1151 | qed simp | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1152 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1153 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1154 | lemma closed_rel_boundary: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1155 | 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 | 1156 | shows "closed S \<Longrightarrow> closed(S - rel_interior S)" | 
| 72238 | 1157 | 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 | 1158 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1159 | lemma compact_rel_boundary: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1160 | 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 | 1161 | shows "compact S \<Longrightarrow> compact(S - rel_interior S)" | 
| 72238 | 1162 | 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 | 1163 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1164 | lemma bounded_rel_frontier: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1165 | 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 | 1166 | 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 | 1167 | 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 | 1168 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1169 | 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 | 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 | 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 | 1172 | 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 | 1173 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1174 | lemma compact_rel_frontier: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1175 | 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 | 1176 | 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 | 1177 | 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 | 1178 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1179 | 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 | 1180 | 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 | 1181 | 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 | 1182 | \<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 | 1183 | 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 | 1184 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1185 | 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 | 1186 | 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 | 1187 | 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 | 1188 | \<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 | 1189 | 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 | 1190 | 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 | 1191 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1192 | 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 | 1193 | 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 | 1194 | assumes "convex S1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1195 | and "convex S2" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1196 |     and "S2 \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1197 | 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 | 1198 | 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 | 1199 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1200 | 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 | 1201 | 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 | 1202 | 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 | 1203 | 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 | 1204 | 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 | 1205 | 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 | 1206 | 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 | 1207 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1208 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1209 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1210 | 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 | 1211 |     then have "S1 \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1212 |       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 | 1213 | have **: "affine hull S1 = affine hull S2" | 
| 72238 | 1214 |       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 | 1215 | 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 | 1216 |       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 | 1217 | 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 | 1218 | 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 | 1219 | 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 | 1220 | 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 | 1221 | 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 | 1222 | 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 | 1223 | 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 | 1224 | 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 | 1225 | 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 | 1226 | 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 | 1227 | then have False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1228 | 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 | 1229 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1230 | ultimately show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1231 | 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 | 1232 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1233 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1234 | 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 | 1235 | 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 | 1236 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1237 | 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 | 1238 | 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 | 1239 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1240 | 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 | 1241 | 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 | 1242 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1243 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1244 | 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 | 1245 |     {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1246 | assume "x \<noteq> z" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1247 | 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 | 1248 | 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 | 1249 |       {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1250 | fix e | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1251 | 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 | 1252 | 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 | 1253 | 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 | 1254 | 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 | 1255 | 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 | 1256 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1257 | 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 | 1258 | 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 | 1259 | 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 | 1260 | 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 | 1261 | 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 | 1262 | 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 | 1263 | 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 | 1264 | 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 | 1265 | also have "\<dots> = e1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1266 | 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 | 1267 | 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 | 1268 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1269 | 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 | 1270 | using m_def ** | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1271 | 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 | 1272 | 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 | 1273 | 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 | 1274 | 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 | 1275 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1276 | 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 | 1277 | 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 | 1278 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1279 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1280 |     {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1281 | assume "x = z" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1282 | 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 | 1283 | then have "m > 1" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1284 | using e1 by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1285 |       {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1286 | fix e | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1287 | 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 | 1288 | 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 | 1289 | 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 | 1290 | 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 | 1291 | using e by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1292 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1293 | 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 | 1294 | 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 | 1295 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1296 | 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 | 1297 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1298 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1299 | 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 | 1300 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1301 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1302 | 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 | 1303 | 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 | 1304 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1305 | 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 | 1306 | 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 | 1307 | 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 | 1308 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1309 | 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 | 1310 | 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 | 1311 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1312 |     and "S \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1313 | 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 | 1314 | 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 | 1315 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1316 | 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 | 1317 | 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 | 1318 | 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 | 1319 | 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 | 1320 | 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 | 1321 | using assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1322 | 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 | 1323 | 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 | 1324 | 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 | 1325 | 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 | 1326 | 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 | 1327 | 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 | 1328 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1329 | 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 | 1330 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1331 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1332 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1333 | 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 | 1334 | 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 | 1335 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1336 |     and "S \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1337 | 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 | 1338 | 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 | 1339 | 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 | 1340 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1341 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1342 | 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 | 1343 | 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 | 1344 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1345 |     and "S \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1346 | 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 | 1347 | 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 | 1348 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1349 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1350 | lemma convex_interior_iff: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1351 | 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 | 1352 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1353 | 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 | 1354 | 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 | 1355 | case False | 
| 68056 | 1356 |   { 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 | 1357 | then have False | 
| 68056 | 1358 | 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 | 1359 | moreover | 
| 68056 | 1360 |   { assume r: "\<forall>x. \<exists>e. e > 0 \<and> z + e *\<^sub>R x \<in> S"
 | 
| 1361 |     { fix x
 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1362 | 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 | 1363 | using r by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1364 | 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 | 1365 | using r by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1366 | 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 | 1367 | 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 | 1368 | 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 | 1369 | 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 | 1370 | 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 | 1371 | 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 | 1372 | 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 | 1373 | 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 | 1374 | then have "z = (e2/(e1+e2)) *\<^sub>R x1 + (e1/(e1+e2)) *\<^sub>R x2" | 
| 72567 | 1375 | 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 | 1376 | 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 | 1377 | 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 | 1378 | 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 | 1379 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1380 | 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 | 1381 | 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 | 1382 | 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 | 1383 | 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 | 1384 | 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 | 1385 | 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 | 1386 | 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 | 1387 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1388 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1389 | 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 | 1390 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1391 |     then have "aff_dim S = int DIM('n)"
 | 
| 71176 | 1392 | 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 | 1393 | then have False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1394 | using False by auto | 
| 
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 | 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 | 1397 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1398 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1399 |   then have "S \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1400 | 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 | 1401 | 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 | 1402 | 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 | 1403 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1404 | 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 | 1405 | 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 | 1406 | 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 | 1407 | 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 | 1408 |       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 | 1409 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1410 | 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 | 1411 | 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 | 1412 | 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 | 1413 | 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 | 1414 | 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 | 1415 | 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 | 1416 | 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 | 1417 | 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 | 1418 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1419 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1420 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1421 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1422 | 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 | 1423 |     {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1424 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1425 | 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 | 1426 | 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 | 1427 | 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 | 1428 | 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 | 1429 | 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 | 1430 | 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 | 1431 | 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 | 1432 | 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 | 1433 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1434 | 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 | 1435 |       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 | 1436 | 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 | 1437 | 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 | 1438 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1439 | 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 | 1440 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1441 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1442 | |
| 70136 | 1443 | 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 | 1444 | |
| 67613 | 1445 | 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 | 1446 | proof - | 
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 1447 |   { fix y
 | 
| 67613 | 1448 |     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 | 1449 | 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 | 1450 | by auto | 
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 1451 |     { fix S
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1452 | assume "S \<in> I" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1453 | 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 | 1454 | 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 | 1455 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1456 | 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 | 1457 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1458 | 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 | 1459 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1460 | |
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1461 | lemma convex_closure_rel_interior_Int: | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1462 | assumes "\<And>S. S\<in>\<F> \<Longrightarrow> convex (S :: 'n::euclidean_space set)" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1463 |     and "\<Inter>(rel_interior ` \<F>) \<noteq> {}"
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1464 | shows "\<Inter>(closure ` \<F>) \<subseteq> closure (\<Inter>(rel_interior ` \<F>))" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1465 | proof - | 
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1466 | obtain x where x: "\<forall>S\<in>\<F>. x \<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 | 1467 | using assms by auto | 
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1468 | show ?thesis | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1469 | proof | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1470 | fix y | 
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1471 | assume y: "y \<in> \<Inter> (closure ` \<F>)" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1472 | show "y \<in> closure (\<Inter>(rel_interior ` \<F>))" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1473 | proof (cases "y=x") | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1474 | case True | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1475 | with closure_subset x show ?thesis | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1476 | by fastforce | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1477 | next | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1478 | case False | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1479 | show ?thesis | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1480 | proof (clarsimp simp: closure_approachable_le) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1481 | fix \<epsilon> :: real | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1482 | assume e: "\<epsilon> > 0" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1483 | define e1 where "e1 = min 1 (\<epsilon>/norm (y - x))" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1484 | then have e1: "e1 > 0" "e1 \<le> 1" "e1 * norm (y - x) \<le> \<epsilon>" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1485 | using \<open>y \<noteq> x\<close> \<open>\<epsilon> > 0\<close> le_divide_eq[of e1 \<epsilon> "norm (y - x)"] | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1486 | by simp_all | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1487 | 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 | 1488 |         {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1489 | fix S | 
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1490 | assume "S \<in> \<F>" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1491 | 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 | 1492 | 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 | 1493 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1494 | } | 
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1495 | then have *: "z \<in> \<Inter>(rel_interior ` \<F>)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1496 | by auto | 
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1497 | show "\<exists>x\<in>\<Inter> (rel_interior ` \<F>). dist x y \<le> \<epsilon>" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1498 | using \<open>y \<noteq> x\<close> z_def * e1 e dist_norm[of z y] | 
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1499 | by force | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1500 | qed | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1501 | qed | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1502 | qed | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1503 | qed | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1504 | |
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1505 | |
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1506 | lemma closure_Inter_convex: | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1507 | fixes \<F> :: "'n::euclidean_space set set" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1508 |   assumes "\<And>S. S \<in> \<F> \<Longrightarrow> convex S" and "\<Inter>(rel_interior ` \<F>) \<noteq> {}"
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1509 | shows "closure(\<Inter>\<F>) = \<Inter>(closure ` \<F>)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1510 | proof - | 
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1511 | have "\<Inter>(closure ` \<F>) \<le> closure (\<Inter>(rel_interior ` \<F>))" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1512 | by (meson assms convex_closure_rel_interior_Int) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1513 | moreover | 
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1514 | have "closure (\<Inter>(rel_interior ` \<F>)) \<subseteq> closure (\<Inter>\<F>)" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1515 | using rel_interior_inter_aux closure_mono[of "\<Inter>(rel_interior ` \<F>)" "\<Inter>\<F>"] | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1516 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1517 | ultimately show ?thesis | 
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1518 | using closure_Int[of \<F>] by blast | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1519 | qed | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1520 | |
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1521 | lemma closure_Inter_convex_open: | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1522 | "(\<And>S::'n::euclidean_space set. S \<in> \<F> \<Longrightarrow> convex S \<and> open S) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1523 |         \<Longrightarrow> closure(\<Inter>\<F>) = (if \<Inter>\<F> = {} then {} else \<Inter>(closure ` \<F>))"
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1524 | by (simp add: closure_Inter_convex rel_interior_open) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1525 | |
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1526 | lemma convex_Inter_rel_interior_same_closure: | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1527 | fixes \<F> :: "'n::euclidean_space set set" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1528 | assumes "\<And>S. S \<in> \<F> \<Longrightarrow> convex S" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1529 |     and "\<Inter>(rel_interior ` \<F>) \<noteq> {}"
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1530 | shows "closure (\<Inter>(rel_interior ` \<F>)) = closure (\<Inter>\<F>)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1531 | proof - | 
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1532 | have "\<Inter>(closure ` \<F>) \<subseteq> closure (\<Inter>(rel_interior ` \<F>))" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1533 | by (meson assms convex_closure_rel_interior_Int) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1534 | moreover | 
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1535 | have "closure (\<Inter>(rel_interior ` \<F>)) \<subseteq> closure (\<Inter>\<F>)" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1536 | by (metis Setcompr_eq_image closure_mono rel_interior_inter_aux) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1537 | ultimately show ?thesis | 
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1538 | by (simp add: assms closure_Inter_convex) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1539 | qed | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1540 | |
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1541 | lemma convex_rel_interior_Inter: | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1542 | fixes \<F> :: "'n::euclidean_space set set" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1543 | assumes "\<And>S. S \<in> \<F> \<Longrightarrow> convex S" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1544 |     and "\<Inter>(rel_interior ` \<F>) \<noteq> {}"
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1545 | shows "rel_interior (\<Inter>\<F>) \<subseteq> \<Inter>(rel_interior ` \<F>)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1546 | proof - | 
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1547 | have "convex (\<Inter>\<F>)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1548 | 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 | 1549 | moreover | 
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1550 | have "convex (\<Inter>(rel_interior ` \<F>))" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1551 | using assms by (metis convex_rel_interior convex_INT) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1552 | ultimately | 
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1553 | have "rel_interior (\<Inter>(rel_interior ` \<F>)) = rel_interior (\<Inter>\<F>)" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1554 | using convex_Inter_rel_interior_same_closure assms | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1555 | closure_eq_rel_interior_eq[of "\<Inter>(rel_interior ` \<F>)" "\<Inter>\<F>"] | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1556 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1557 | then show ?thesis | 
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1558 | using rel_interior_subset[of "\<Inter>(rel_interior ` \<F>)"] by auto | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1559 | qed | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1560 | |
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1561 | lemma convex_rel_interior_finite_Inter: | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1562 | fixes \<F> :: "'n::euclidean_space set set" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1563 | assumes "\<And>S. S \<in> \<F> \<Longrightarrow> convex S" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1564 |     and "\<Inter>(rel_interior ` \<F>) \<noteq> {}"
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1565 | and "finite \<F>" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1566 | shows "rel_interior (\<Inter>\<F>) = \<Inter>(rel_interior ` \<F>)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1567 | proof - | 
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1568 |   have "\<Inter>\<F> \<noteq> {}"
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1569 | using assms rel_interior_inter_aux[of \<F>] by auto | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1570 | have "convex (\<Inter>\<F>)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1571 | 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 | 1572 | show ?thesis | 
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1573 |   proof (cases "\<F> = {}")
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1574 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1575 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1576 | 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 | 1577 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1578 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1579 |     {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1580 | fix z | 
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1581 | assume z: "z \<in> \<Inter>(rel_interior ` \<F>)" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1582 |       {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1583 | fix x | 
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1584 | assume x: "x \<in> \<Inter>\<F>" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1585 |         {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1586 | fix S | 
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1587 | assume S: "S \<in> \<F>" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1588 | 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 | 1589 | 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 | 1590 | 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 | 1591 | 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 | 1592 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1593 | then obtain mS where | 
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1594 | mS: "\<forall>S\<in>\<F>. 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 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1595 | define e where "e = Min (mS ` \<F>)" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1596 |         then have "e \<in> mS ` \<F>" using assms \<open>\<F> \<noteq> {}\<close> by simp
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1597 | then have "e > 1" using mS by auto | 
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1598 | moreover have "\<forall>S\<in>\<F>. e \<le> mS S" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1599 | using e_def assms by auto | 
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1600 | ultimately have "\<exists>e > 1. (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> \<Inter>\<F>" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1601 | using mS by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1602 | } | 
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1603 | then have "z \<in> rel_interior (\<Inter>\<F>)" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1604 |         using convex_rel_interior_iff[of "\<Inter>\<F>" z] \<open>\<Inter>\<F> \<noteq> {}\<close> \<open>convex (\<Inter>\<F>)\<close> by auto
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1605 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1606 | then show ?thesis | 
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1607 | using convex_rel_interior_Inter[of \<F>] assms by auto | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1608 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1609 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1610 | |
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1611 | lemma closure_Int_convex: | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1612 | 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 | 1613 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1614 | and "convex T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1615 |   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 | 1616 | shows "closure (S \<inter> T) = closure S \<inter> closure T" | 
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1617 |   using closure_Inter_convex[of "{S,T}"] assms by auto
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1618 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1619 | 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 | 1620 | 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 | 1621 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1622 | and "convex T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1623 |     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 | 1624 | shows "rel_interior (S \<inter> T) = rel_interior S \<inter> rel_interior T" | 
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1625 |   using convex_rel_interior_finite_Inter[of "{S,T}"] assms by auto
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1626 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1627 | 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 | 1628 | 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 | 1629 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1630 | and "affine T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1631 |     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 | 1632 | shows "closure (S \<inter> T) = closure S \<inter> T" | 
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1633 | by (metis affine_imp_convex assms closure_Int_convex 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 | 1634 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1635 | 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 | 1636 | 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 | 1637 |   assumes "DIM('a) = 1"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1638 | 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 | 1639 | unfolding connected_component_def | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1640 | 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 | 1641 | 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 | 1642 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1643 | lemma connected_component_1: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1644 | fixes S :: "real set" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1645 | 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 | 1646 | 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 | 1647 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1648 | 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 | 1649 | 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 | 1650 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1651 | and "affine T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1652 |     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 | 1653 | 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 | 1654 | 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 | 1655 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1656 | 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 | 1657 | 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 | 1658 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1659 | and "affine T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1660 |     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 | 1661 | 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 | 1662 | using assms | 
| 72567 | 1663 | unfolding rel_frontier_def frontier_def | 
| 1664 | 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 | 1665 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1666 | 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 | 1667 | 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 | 1668 |   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 | 1669 | 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 | 1670 | 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 | 1671 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1672 | 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 | 1673 | 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 | 1674 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1675 | and "convex T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1676 | 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 | 1677 | 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 | 1678 | 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 | 1679 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1680 | 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 | 1681 | using assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1682 | 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 | 1683 | 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 | 1684 | 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 | 1685 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1686 |   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 | 1687 | 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 | 1688 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1689 | 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 | 1690 | 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 | 1691 | 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 | 1692 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1693 | 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 | 1694 | using * by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1695 | finally show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1696 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1697 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1698 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1699 | 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 | 1700 | 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 | 1701 | assumes "linear f" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1702 | and "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1703 | 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 | 1704 | proof (cases "S = {}")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1705 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1706 | then show ?thesis | 
| 71176 | 1707 | 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 | 1708 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1709 | case False | 
| 68072 
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
 immler parents: 
67990diff
changeset | 1710 | 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 | 1711 | 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 | 1712 | 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 | 1713 | 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 | 1714 | 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 | 1715 | 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 | 1716 | 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 | 1717 | 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 | 1718 | 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 | 1719 | 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 | 1720 | 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 | 1721 | 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 | 1722 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1723 | 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 | 1724 | 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 | 1725 | 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 | 1726 | 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 | 1727 | 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 | 1728 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1729 | 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 | 1730 | 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 | 1731 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1732 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1733 | fix z | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1734 | 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 | 1735 | 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 | 1736 |     {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1737 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1738 | 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 | 1739 | then obtain x1 where x1: "x1 \<in> S" "f x1 = x" by auto | 
| 67613 | 1740 | 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 | 1741 | 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 | 1742 | 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 | 1743 | using x1 z1 by (simp add: linear_add linear_scale \<open>linear f\<close>) | 
| 67613 | 1744 | 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 | 1745 | using imageI[of "(1 - e) *\<^sub>R x1 + e *\<^sub>R z1" S f] by auto | 
| 67613 | 1746 | 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 | 1747 | using e by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1748 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1749 | 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 | 1750 | 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 | 1751 |         \<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 | 1752 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1753 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1754 | 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 | 1755 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1756 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1757 | 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 | 1758 | 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 | 1759 | assumes "linear f" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1760 | and "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1761 |     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 | 1762 | 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 | 1763 | proof - | 
| 68072 
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
 immler parents: 
67990diff
changeset | 1764 | 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 | 1765 |   have "S \<noteq> {}"
 | 
| 71176 | 1766 | 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 | 1767 |   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 | 1768 | 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 | 1769 |   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 | 1770 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1771 | 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 | 1772 | 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 | 1773 | 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 | 1774 | 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 | 1775 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1776 | fix z | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1777 | assume "z \<in> f -` (rel_interior S)" | 
| 67613 | 1778 | 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 | 1779 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1780 |     {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1781 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1782 | 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 | 1783 | 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 | 1784 | 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 | 1785 |         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 | 1786 | 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 | 1787 | 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 | 1788 | 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 | 1789 | using e by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1790 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1791 | 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 | 1792 | 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 | 1793 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1794 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1795 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1796 | fix z | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1797 | 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 | 1798 |     {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1799 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1800 | 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 | 1801 | 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 | 1802 | 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 | 1803 | 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 | 1804 | 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 | 1805 | 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 | 1806 | 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 | 1807 | using e by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1808 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1809 | 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 | 1810 |       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 | 1811 | 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 | 1812 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1813 | 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 | 1814 | 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 | 1815 | 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 | 1816 | 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 | 1817 | 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 | 1818 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1819 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1820 | 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 | 1821 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1822 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1823 | lemma rel_interior_Times: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1824 | 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 | 1825 | 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 | 1826 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1827 | and "convex T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1828 | shows "rel_interior (S \<times> T) = rel_interior S \<times> rel_interior T" | 
| 72238 | 1829 | proof (cases "S = {} \<or> T = {}")
 | 
| 1830 | case True | |
| 1831 | then show ?thesis | |
| 1832 | by auto | |
| 1833 | next | |
| 1834 | case False | |
| 1835 |   then have "S \<noteq> {}" "T \<noteq> {}"
 | |
| 1836 | by auto | |
| 1837 |   then have ri: "rel_interior S \<noteq> {}" "rel_interior T \<noteq> {}"
 | |
| 1838 | using rel_interior_eq_empty assms by auto | |
| 1839 |   then have "fst -` rel_interior S \<noteq> {}"
 | |
| 1840 | using fst_vimage_eq_Times[of "rel_interior S"] by auto | |
| 1841 | then have "rel_interior ((fst :: 'n * 'm \<Rightarrow> 'n) -` S) = fst -` rel_interior S" | |
| 1842 | using linear_fst \<open>convex S\<close> rel_interior_convex_linear_preimage[of fst S] by auto | |
| 1843 | then have s: "rel_interior (S \<times> (UNIV :: 'm set)) = rel_interior S \<times> UNIV" | |
| 1844 | by (simp add: fst_vimage_eq_Times) | |
| 1845 |   from ri have "snd -` rel_interior T \<noteq> {}"
 | |
| 1846 | using snd_vimage_eq_Times[of "rel_interior T"] by auto | |
| 1847 | then have "rel_interior ((snd :: 'n * 'm \<Rightarrow> 'm) -` T) = snd -` rel_interior T" | |
| 1848 | using linear_snd \<open>convex T\<close> rel_interior_convex_linear_preimage[of snd T] by auto | |
| 1849 | then have t: "rel_interior ((UNIV :: 'n set) \<times> T) = UNIV \<times> rel_interior T" | |
| 1850 | by (simp add: snd_vimage_eq_Times) | |
| 1851 | 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 | 1852 | rel_interior S \<times> rel_interior T" by auto | 
| 72238 | 1853 | have "S \<times> T = S \<times> (UNIV :: 'm set) \<inter> (UNIV :: 'n set) \<times> T" | 
| 1854 | by auto | |
| 1855 | then have "rel_interior (S \<times> T) = rel_interior ((S \<times> (UNIV :: 'm set)) \<inter> ((UNIV :: 'n set) \<times> T))" | |
| 1856 | by auto | |
| 1857 | also have "\<dots> = rel_interior (S \<times> (UNIV :: 'm set)) \<inter> rel_interior ((UNIV :: 'n set) \<times> T)" | |
| 1858 | using * ri assms convex_Times | |
| 1859 | by (subst convex_rel_interior_inter_two) auto | |
| 1860 | 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 | 1861 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1862 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1863 | lemma rel_interior_scaleR: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1864 | 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 | 1865 | assumes "c \<noteq> 0" | 
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68796diff
changeset | 1866 | 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 | 1867 | 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 | 1868 | 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 | 1869 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1870 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1871 | 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 | 1872 | 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 | 1873 | assumes "convex S" | 
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68796diff
changeset | 1874 | 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 | 1875 | 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 | 1876 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1877 | 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 | 1878 | 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 | 1879 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1880 | and "rel_open S" | 
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68796diff
changeset | 1881 | 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 | 1882 | 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 | 1883 | |
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1884 | lemma convex_rel_open_finite_Inter: | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1885 | fixes \<F> :: "'n::euclidean_space set set" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1886 | assumes "\<And>S. S \<in> \<F> \<Longrightarrow> convex S \<and> rel_open S" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1887 | and "finite \<F>" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1888 | shows "convex (\<Inter>\<F>) \<and> rel_open (\<Inter>\<F>)" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1889 | proof (cases "\<Inter>{rel_interior S |S. S \<in> \<F>} = {}")
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1890 | case True | 
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1891 |   then have "\<Inter>\<F> = {}"
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1892 | 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 | 1893 | then show ?thesis | 
| 71176 | 1894 | 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 | 1895 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1896 | case False | 
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1897 | then have "rel_open (\<Inter>\<F>)" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 1898 | using assms convex_rel_interior_finite_Inter[of \<F>] by (force simp: rel_open_def) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1899 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1900 | 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 | 1901 | qed | 
| 
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 | 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 | 1904 | 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 | 1905 | assumes "linear f" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1906 | and "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1907 | and "rel_open S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1908 | 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 | 1909 | 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 | 1910 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1911 | 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 | 1912 | 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 | 1913 | assumes "linear f" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1914 | and "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1915 | and "rel_open S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1916 | 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 | 1917 | 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 | 1918 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1919 |   then have "f -` S = {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1920 | 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 | 1921 | then show ?thesis | 
| 71176 | 1922 | 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 | 1923 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1924 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1925 | 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 | 1926 | 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 | 1927 | 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 | 1928 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1929 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1930 | 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 | 1931 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1932 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1933 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1934 | lemma rel_interior_projection: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1935 |   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 | 1936 | 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 | 1937 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1938 |     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 | 1939 |   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 | 1940 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1941 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1942 | fix y | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1943 |     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 | 1944 | 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 | 1945 | using assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1946 | then have "\<exists>x. x \<in> S \<and> y = fst x" | 
| 72238 | 1947 | by auto | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1948 | 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 | 1949 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1950 | 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 | 1951 | 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 | 1952 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1953 |   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 | 1954 | 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 | 1955 |   then have h1: "fst ` rel_interior S = rel_interior {y. f y \<noteq> {}}"
 | 
| 71244 | 1956 | 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 | 1957 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1958 | fix y | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1959 |     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 | 1960 | 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 | 1961 | using h1 by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1962 |     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 | 1963 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1964 |     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 | 1965 | 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 | 1966 |     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 | 1967 |       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 | 1968 |     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 | 1969 | 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 | 1970 |     {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1971 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1972 | 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 | 1973 |       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 | 1974 | using assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1975 | 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 | 1976 |       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 | 1977 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1978 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1979 |     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 | 1980 | using assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1981 |     then have ***: "rel_interior (f y) = snd ` rel_interior (S \<inter> fst -` {y})"
 | 
| 71244 | 1982 |       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 | 1983 | by auto | 
| 
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> rel_interior (f y)" | 
| 
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> 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 | 1988 | using *** by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1989 |       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 | 1990 | 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 | 1991 |       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 | 1992 | by force | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1993 | 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 | 1994 | using ** by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1995 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1996 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1997 |     {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1998 | fix z | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1999 | 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 | 2000 |       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 | 2001 | using ** by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2002 |       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 | 2003 | 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 | 2004 | 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 | 2005 | using *** by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2006 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2007 | 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 | 2008 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2009 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2010 |   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 | 2011 | (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 | 2012 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2013 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2014 | fix y z | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2015 | 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 | 2016 | 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 | 2017 | 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 | 2018 |     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 | 2019 | using h1 by auto | 
| 67613 | 2020 |     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 | 2021 | 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 | 2022 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2023 | 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 | 2024 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2025 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2026 | lemma rel_frontier_Times: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2027 | 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 | 2028 | 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 | 2029 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2030 | and "convex T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2031 | 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 | 2032 | 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 | 2033 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2034 | |
| 70136 | 2035 | 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 | 2036 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2037 | lemma cone_rel_interior: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2038 | 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 | 2039 | assumes "cone S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2040 |   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 | 2041 | proof (cases "S = {}")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2042 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2043 | then show ?thesis | 
| 71176 | 2044 | 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 | 2045 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2046 | case False | 
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68796diff
changeset | 2047 | 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 | 2048 | 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 | 2049 |   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 | 2050 |     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 | 2051 | 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 | 2052 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2053 |     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 | 2054 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2055 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2056 | 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 | 2057 | 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 | 2058 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2059 |   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 | 2060 | 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 | 2061 | proof (cases "S = {}")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2062 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2063 | then show ?thesis | 
| 71176 | 2064 | 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 | 2065 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2066 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2067 | 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 | 2068 |   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 | 2069 |     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 | 2070 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2071 |   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 | 2072 |   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 | 2073 |     (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 | 2074 |     using convex_cone_hull[of "{(1 :: real)} \<times> S"] conv
 | 
| 72238 | 2075 | 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 | 2076 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2077 | fix y :: real | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2078 | assume "y \<ge> 0" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2079 |     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 | 2080 |       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 | 2081 |     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 | 2082 | 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 | 2083 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2084 |   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 | 2085 |     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 | 2086 |   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 | 2087 | 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 | 2088 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2089 | fix c :: real | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2090 | assume "c > 0" | 
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68796diff
changeset | 2091 | 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 | 2092 |       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 | 2093 | 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 | 2094 | 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 | 2095 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2096 | 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 | 2097 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2098 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2099 | 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 | 2100 | 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 | 2101 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2102 |   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 | 2103 |     {(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 | 2104 | (is "?lhs = ?rhs") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2105 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2106 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2107 | fix z | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2108 | assume "z \<in> ?lhs" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2109 | 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 | 2110 | by auto | 
| 71004 | 2111 | then have "z \<in> ?rhs" | 
| 2112 | 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 | 2113 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2114 | moreover | 
| 
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 | fix z | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2117 | assume "z \<in> ?rhs" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2118 | 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 | 2119 | 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 | 2120 | by auto | 
| 
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 | 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 | 2123 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2124 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2125 | 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 | 2126 | assumes "finite I" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2127 |   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 | 2128 | 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 | 2129 |     {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 | 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 | have "?lhs \<supseteq> ?rhs" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2133 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2134 | fix x | 
| 67613 | 2135 | 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 | 2136 | 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 | 2137 | "(\<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 | 2138 | 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 | 2139 | 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 | 2140 | 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 | 2141 | unfolding *(1)[symmetric] | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2142 | using * assms convex_convex_hull | 
| 72238 | 2143 | 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 | 2144 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2145 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2146 | fix i | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2147 | assume "i \<in> I" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2148 | 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 | 2149 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2150 | 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 | 2151 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2152 | fix i | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2153 | assume "i \<in> I" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2154 |     {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2155 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2156 | 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 | 2157 | 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 | 2158 | 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 | 2159 | 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 | 2160 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2161 | 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 | 2162 | 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 | 2163 | 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 | 2164 | 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 | 2165 | 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 | 2166 | by auto | 
| 72567 | 2167 | 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)" | 
| 2168 | using * c_def s_def p \<open>x \<in> S i\<close> by auto | |
| 2169 | ultimately have "x \<in> ?rhs" | |
| 2170 | by force | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2171 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2172 | 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 | 2173 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2174 | 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 | 2175 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2176 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2177 | fix u v :: real | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2178 | 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 | 2179 | fix x y | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2180 | 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 | 2181 | 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 | 2182 | 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 | 2183 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2184 | 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 | 2185 | 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 | 2186 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2187 | 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 | 2188 | 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 | 2189 | 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 | 2190 | 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 | 2191 | 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 | 2192 | 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 | 2193 | 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 | 2194 | 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 | 2195 | 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 | 2196 | 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 | 2197 | for i | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2198 |     {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2199 | fix i | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2200 | 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 | 2201 | 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 | 2202 | 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 | 2203 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2204 | 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 | 2205 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2206 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2207 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2208 | 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 | 2209 | 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 | 2210 | 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 | 2211 | 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 | 2212 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2213 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2214 | 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 | 2215 |     {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2216 | fix i | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2217 | 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 | 2218 | 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 | 2219 | 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 | 2220 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2221 | 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 | 2222 | 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 | 2223 | 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 | 2224 | 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 | 2225 | 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 | 2226 | 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 | 2227 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2228 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2229 | 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 | 2230 | 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 | 2231 | 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 | 2232 | = (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 | 2233 | 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 | 2234 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2235 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2236 | 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 | 2237 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2238 | 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 | 2239 | 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 | 2240 | 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 | 2241 | using * by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2242 | 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 | 2243 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2244 | 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 | 2245 | 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 | 2246 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2247 | 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 | 2248 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2249 | 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 | 2250 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2251 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2252 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2253 | 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 | 2254 | 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 | 2255 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2256 |     and "S \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2257 | and "convex T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2258 |     and "T \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2259 | 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 | 2260 |     {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 | 2261 | (is "?lhs = ?rhs") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2262 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2263 |   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 | 2264 | 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 | 2265 | 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 | 2266 | 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 | 2267 | 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 | 2268 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2269 | 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 | 2270 |     {\<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 | 2271 | using assms s_def I_def | 
| 72238 | 2272 | 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 | 2273 | moreover have | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2274 |     "{\<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 | 2275 | 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 | 2276 | 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 | 2277 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2278 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2279 | assume "x \<in> ?rhs" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2280 | 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 | 2281 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2282 |     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 | 2283 | 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 | 2284 | 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 | 2285 |       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 | 2286 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2287 | 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 | 2288 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2289 | |
| 70620 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2290 | proposition ray_to_rel_frontier: | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2291 | fixes a :: "'a::real_inner" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2292 | assumes "bounded S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2293 | and a: "a \<in> rel_interior S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2294 | and aff: "(a + l) \<in> affine hull S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2295 | and "l \<noteq> 0" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2296 | 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 | 2297 | "\<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 | 2298 | proof - | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2299 | have aaff: "a \<in> affine hull S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2300 | by (meson a hull_subset rel_interior_subset rev_subsetD) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2301 |   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 | 2302 | obtain B where "B > 0" and B: "S \<subseteq> ball a B" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2303 | using bounded_subset_ballD [OF \<open>bounded S\<close>] by blast | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2304 | have "a + (B / norm l) *\<^sub>R l \<notin> ball a B" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2305 | by (simp add: dist_norm \<open>l \<noteq> 0\<close>) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2306 | 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 | 2307 | using rel_interior_subset subsetCE by blast | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2308 |   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 | 2309 | using divide_pos_pos zero_less_norm_iff by fastforce | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2310 | have bdd: "bdd_below ?D" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2311 | by (metis (no_types, lifting) bdd_belowI le_less mem_Collect_eq) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2312 | have relin_Ex: "\<And>x. x \<in> rel_interior S \<Longrightarrow> | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2313 | \<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 | 2314 | 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 | 2315 | define d where "d = Inf ?D" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2316 | 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 | 2317 | proof - | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2318 | obtain e where "e>0" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2319 | 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 | 2320 | using relin_Ex a by blast | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2321 | show thesis | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2322 | proof (rule_tac \<epsilon> = "e / norm l" in that) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2323 | 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 | 2324 | next | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2325 | 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 | 2326 | proof (rule e) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2327 | show "a + \<eta> *\<^sub>R l \<in> affine hull S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2328 | 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 | 2329 | show "dist (a + \<eta> *\<^sub>R l) a < e" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2330 | 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 | 2331 | qed | 
| 
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 | qed | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2334 | 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 | 2335 | unfolding d_def using cInf_lower [OF _ bdd] | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2336 | 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 | 2337 | have "\<epsilon> \<le> d" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2338 | unfolding d_def | 
| 72238 | 2339 | using \<epsilon> dual_order.strict_implies_order le_less_linear | 
| 2340 | by (blast intro: cInf_greatest [OF nonMT]) | |
| 70620 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2341 | with \<open>0 < \<epsilon>\<close> have "0 < d" by simp | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2342 | have "a + d *\<^sub>R l \<notin> rel_interior S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2343 | proof | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2344 | assume adl: "a + d *\<^sub>R l \<in> rel_interior S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2345 | obtain e where "e > 0" | 
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 2346 | and e: "\<And>x'. x' \<in> affine hull S \<Longrightarrow> dist x' (a + d *\<^sub>R l) < e \<Longrightarrow> x' \<in> rel_interior S" | 
| 70620 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2347 | using relin_Ex adl by blast | 
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 2348 | have "d + e / norm l \<le> x" | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 2349 | if "0 < x" and nonrel: "a + x *\<^sub>R l \<notin> rel_interior S" for x | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 2350 | proof (cases "x < d") | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 2351 | case True with inint nonrel \<open>0 < x\<close> | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 2352 | show ?thesis by auto | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 2353 | next | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 2354 | case False | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 2355 | then have dle: "x < d + e / norm l \<Longrightarrow> dist (a + x *\<^sub>R l) (a + d *\<^sub>R l) < e" | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 2356 | by (simp add: field_simps \<open>l \<noteq> 0\<close>) | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 2357 | have ain: "a + x *\<^sub>R l \<in> affine hull S" | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 2358 | by (metis add_diff_cancel_left' aff affine_affine_hull mem_affine_3_minus aaff) | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 2359 | show ?thesis | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 2360 | using e [OF ain] nonrel dle by force | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 2361 | qed | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 2362 | then | 
| 70620 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2363 |     have "d + e / norm l \<le> Inf {d. 0 < d \<and> a + d *\<^sub>R l \<notin> rel_interior S}"
 | 
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 2364 | by (force simp add: intro: cInf_greatest [OF nonMT]) | 
| 70620 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2365 | then show False | 
| 70817 
dd675800469d
dedicated fact collections for algebraic simplification rules potentially splitting goals
 haftmann parents: 
70802diff
changeset | 2366 | 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 | 2367 | qed | 
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 2368 | moreover | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 2369 | have "\<exists>y\<in>S. dist y (a + d *\<^sub>R l) < \<eta>" if "0 < \<eta>" for \<eta>::real | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 2370 | proof - | 
| 70620 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2371 | have 1: "a + (d - min d (\<eta> / 2 / norm l)) *\<^sub>R l \<in> S" | 
| 72567 | 2372 | proof (rule subsetD [OF rel_interior_subset inint]) | 
| 2373 | show "d - min d (\<eta> / 2 / norm l) < d" | |
| 2374 | using \<open>l \<noteq> 0\<close> \<open>0 < d\<close> \<open>0 < \<eta>\<close> by auto | |
| 2375 | qed auto | |
| 70620 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2376 | 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 | 2377 | by (metis min_def mult_left_mono norm_ge_zero order_refl) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2378 | also have "... < \<eta>" | 
| 70817 
dd675800469d
dedicated fact collections for algebraic simplification rules potentially splitting goals
 haftmann parents: 
70802diff
changeset | 2379 | 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 | 2380 | finally have 2: "norm l * min d (\<eta> / (norm l * 2)) < \<eta>" . | 
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 2381 | show ?thesis | 
| 72567 | 2382 | using 1 2 \<open>0 < d\<close> \<open>0 < \<eta>\<close> | 
| 2383 | 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 | 2384 | qed | 
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 2385 | then have "a + d *\<^sub>R l \<in> closure S" | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 2386 | by (auto simp: closure_approachable) | 
| 70620 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2387 | ultimately have infront: "a + d *\<^sub>R l \<in> rel_frontier S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2388 | by (simp add: rel_frontier_def) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2389 | show ?thesis | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2390 | by (rule that [OF \<open>0 < d\<close> infront inint]) | 
| 
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 | |
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2393 | corollary ray_to_frontier: | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2394 | fixes a :: "'a::euclidean_space" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2395 | assumes "bounded S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2396 | and a: "a \<in> interior S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2397 | and "l \<noteq> 0" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2398 | 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 | 2399 | "\<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 | 2400 | proof - | 
| 72567 | 2401 | have \<section>: "interior S = rel_interior S" | 
| 70620 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2402 | using a rel_interior_nonempty_interior by auto | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2403 | then have "a \<in> rel_interior S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2404 | using a by simp | 
| 72567 | 2405 | moreover have "a + l \<in> affine hull S" | 
| 2406 | using a affine_hull_nonempty_interior by blast | |
| 2407 | ultimately show thesis | |
| 2408 | 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 | 2409 | qed | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2410 | |
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2411 | |
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2412 | lemma segment_to_rel_frontier_aux: | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2413 | fixes x :: "'a::euclidean_space" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2414 | 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 | 2415 | 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 | 2416 | "open_segment x z \<subseteq> rel_interior S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2417 | proof - | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2418 | have "x + (y - x) \<in> affine hull S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2419 | using hull_inc [OF y] by auto | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2420 | 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 | 2421 | 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 | 2422 | 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 | 2423 | show ?thesis | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2424 | proof | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2425 | show "x + d *\<^sub>R (y - x) \<in> rel_frontier S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2426 | by (simp add: df) | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2427 | next | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2428 | have "open_segment x y \<subseteq> rel_interior S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2429 | 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 | 2430 | moreover have "x + d *\<^sub>R (y - x) \<in> open_segment x y" if "d < 1" | 
| 72238 | 2431 | 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 | 2432 | ultimately have "1 \<le> d" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2433 | using df rel_frontier_def by fastforce | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2434 | 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 | 2435 | 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 | 2436 | ultimately show "y \<in> closed_segment x (x + d *\<^sub>R (y - x))" | 
| 72567 | 2437 | unfolding in_segment | 
| 2438 | 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 | 2439 | next | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2440 | show "open_segment x (x + d *\<^sub>R (y - x)) \<subseteq> rel_interior S" | 
| 72238 | 2441 | proof (rule rel_interior_closure_convex_segment [OF \<open>convex S\<close> x]) | 
| 2442 | show "x + d *\<^sub>R (y - x) \<in> closure S" | |
| 2443 | using df rel_frontier_def by auto | |
| 2444 | qed | |
| 70620 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2445 | qed | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2446 | qed | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2447 | |
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2448 | lemma segment_to_rel_frontier: | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2449 | fixes x :: "'a::euclidean_space" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2450 | 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 | 2451 |       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 | 2452 | 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 | 2453 | "open_segment x z \<subseteq> rel_interior S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2454 | proof (cases "x=y") | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2455 | case True | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2456 |   with xy have "S \<noteq> {x}"
 | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2457 | by blast | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2458 | with True show ?thesis | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2459 | 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 | 2460 | next | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2461 | case False | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2462 | then show ?thesis | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2463 | 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 | 2464 | qed | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2465 | |
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2466 | proposition rel_frontier_not_sing: | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2467 | fixes a :: "'a::euclidean_space" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2468 | assumes "bounded S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2469 |     shows "rel_frontier S \<noteq> {a}"
 | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2470 | proof (cases "S = {}")
 | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2471 | case True then show ?thesis by simp | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2472 | next | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2473 | case False | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2474 | then obtain z where "z \<in> S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2475 | by blast | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2476 | then show ?thesis | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2477 |   proof (cases "S = {z}")
 | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2478 | case True then show ?thesis by simp | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2479 | next | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2480 | case False | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2481 | then obtain w where "w \<in> S" "w \<noteq> z" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2482 | using \<open>z \<in> S\<close> by blast | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2483 | show ?thesis | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2484 | proof | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2485 |       assume "rel_frontier S = {a}"
 | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2486 | then consider "w \<notin> rel_frontier S" | "z \<notin> rel_frontier S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2487 | using \<open>w \<noteq> z\<close> by auto | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2488 | then show False | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2489 | proof cases | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2490 | case 1 | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2491 | then have w: "w \<in> rel_interior S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2492 | 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 | 2493 | have "w + (w - z) \<in> affine hull S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2494 | 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 | 2495 | 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 | 2496 | 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 | 2497 | 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 | 2498 | 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 | 2499 | 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 | 2500 | ultimately have "d *\<^sub>R (z - w) = e *\<^sub>R (w - z)" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2501 |           using \<open>rel_frontier S = {a}\<close> by force
 | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2502 | moreover have "e \<noteq> -d " | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2503 | using \<open>0 < e\<close> \<open>0 < d\<close> by force | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2504 | ultimately show False | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2505 | 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 | 2506 | next | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2507 | case 2 | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2508 | then have z: "z \<in> rel_interior S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2509 | 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 | 2510 | have "z + (z - w) \<in> affine hull S" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2511 | 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 | 2512 | 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 | 2513 | 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 | 2514 | 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 | 2515 | 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 | 2516 | 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 | 2517 | ultimately have "d *\<^sub>R (w - z) = e *\<^sub>R (z - w)" | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2518 |           using \<open>rel_frontier S = {a}\<close> by force
 | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2519 | moreover have "e \<noteq> -d " | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2520 | using \<open>0 < e\<close> \<open>0 < d\<close> by force | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2521 | ultimately show False | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2522 | 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 | 2523 | qed | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2524 | qed | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2525 | qed | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2526 | qed | 
| 
f95193669ad7
removed Brouwer_Fixpoint from imports of Derivative
 immler parents: 
70138diff
changeset | 2527 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2528 | |
| 70136 | 2529 | 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 | 2530 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2531 | lemma closure_sum: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2532 | 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 | 2533 | 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 | 2534 | 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 | 2535 | 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 | 2536 | 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 | 2537 | |
| 74729 
64b3d8d9bd10
new lemmas about convex, concave functions, + tidying
 paulson <lp15@cam.ac.uk> parents: 
74007diff
changeset | 2538 | 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 | 2539 | unfolding linear_iff by (simp add: algebra_simps) | 
| 
64b3d8d9bd10
new lemmas about convex, concave functions, + tidying
 paulson <lp15@cam.ac.uk> parents: 
74007diff
changeset | 2540 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2541 | lemma rel_interior_sum: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2542 | 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 | 2543 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2544 | and "convex T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2545 | 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 | 2546 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2547 | 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 | 2548 | 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 | 2549 | 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 | 2550 | 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 | 2551 | 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 | 2552 | 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 | 2553 | 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 | 2554 | 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 | 2555 | finally show ?thesis .. | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2556 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2557 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2558 | 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 | 2559 | fixes S :: "'a \<Rightarrow> 'n::euclidean_space set" | 
| 72238 | 2560 | 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 | 2561 | 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 | 2562 | using rel_interior_sum rel_interior_sing[of "0"] assms | 
| 72238 | 2563 | 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 | 2564 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2565 | 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 | 2566 | 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 | 2567 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2568 | and "rel_open S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2569 | and "convex T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2570 | and "rel_open T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2571 | 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 | 2572 | 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 | 2573 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2574 | 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 | 2575 | 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 | 2576 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2577 | and "rel_open S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2578 | and "convex T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2579 | and "rel_open T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2580 | 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 | 2581 | 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 | 2582 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2583 | 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 | 2584 | assumes "finite I" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2585 |     and "I \<noteq> {}"
 | 
| 72238 | 2586 |   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 | 2587 | 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 | 2588 | (is "?lhs = ?rhs") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2589 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2590 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2591 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2592 | assume "x \<in> ?lhs" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2593 | 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 | 2594 | 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 | 2595 | 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 | 2596 | define s where "s i = c i *\<^sub>R xs i" for i | 
| 72238 | 2597 | have "\<forall>i\<in>I. s i \<in> S i" | 
| 2598 | 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 | 2599 | 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 | 2600 | 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 | 2601 | 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 | 2602 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2603 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2604 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2605 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2606 | assume "x \<in> ?rhs" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2607 | 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 | 2608 | 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 | 2609 | 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 | 2610 | 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 | 2611 | 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 | 2612 | 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 | 2613 | 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 | 2614 | 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 | 2615 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2616 | 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 | 2617 | using assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2618 | 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 | 2619 | using assms | 
| 72238 | 2620 | apply (simp add: convex_hull_finite_union[of I S]) | 
| 2621 | 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 | 2622 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2623 | 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 | 2624 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2625 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2626 | 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 | 2627 | 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 | 2628 | assumes "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2629 | and "cone S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2630 |     and "S \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2631 | assumes "convex T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2632 | and "cone T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2633 |     and "T \<noteq> {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2634 | 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 | 2635 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2636 |   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 | 2637 | 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 | 2638 | 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 | 2639 | 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 | 2640 | 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 | 2641 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2642 | moreover have "convex hull \<Union>(A ` I) = sum A I" | 
| 72238 | 2643 | using A_def I_def | 
| 2644 | 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 | 2645 | moreover have "sum A I = S + T" | 
| 72238 | 2646 | 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 | 2647 | 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 | 2648 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2649 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2650 | 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 | 2651 | 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 | 2652 | assumes "finite I" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2653 |     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 | 2654 | 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 | 2655 |     {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 | 2656 | (\<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 | 2657 | (is "?lhs = ?rhs") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2658 | proof (cases "I = {}")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2659 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2660 | then show ?thesis | 
| 71176 | 2661 | 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 | 2662 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2663 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2664 | 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 | 2665 | 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 | 2666 | 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 | 2667 |   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 | 2668 |   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 | 2669 |   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 | 2670 | 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 | 2671 | by (simp add: cone_hull_empty_iff[symmetric]) | 
| 72238 | 2672 | have convK: "\<forall>i\<in>I. convex (K i)" | 
| 2673 | unfolding K_def | |
| 2674 | by (simp add: assms(2) convex_Times convex_cone_hull) | |
| 2675 | have "K0 \<supseteq> K i" if "i \<in> I" for i | |
| 2676 | unfolding K0_def K_def | |
| 2677 | 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 | 2678 | 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 | 2679 | moreover have "convex K0" | 
| 72238 | 2680 | 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 | 2681 | 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 | 2682 | 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 | 2683 |   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 | 2684 | 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 | 2685 |   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 | 2686 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2687 |   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 | 2688 | 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 | 2689 |   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 | 2690 | unfolding C0_def | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2691 |     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 | 2692 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2693 | moreover have "cone (convex hull (\<Union>(K ` I)))" | 
| 72238 | 2694 | 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 | 2695 | 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 | 2696 | unfolding K0_def | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2697 | 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 | 2698 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2699 | 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 | 2700 | using geq by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2701 | also have "\<dots> = sum K I" | 
| 72238 | 2702 |     using assms False \<open>\<forall>i\<in>I. K i \<noteq> {}\<close> cone_hull_eq convK 
 | 
| 2703 | 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 | 2704 | 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 | 2705 | 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 | 2706 | 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 | 2707 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2708 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2709 | assume "x \<in> ?lhs" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2710 | 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 | 2711 | 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 | 2712 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2713 | 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 | 2714 | 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 | 2715 |     {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2716 | fix i | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2717 | assume "i \<in> I" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2718 |       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 | 2719 | 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 | 2720 | 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 | 2721 | 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 | 2722 | } | 
| 72238 | 2723 | 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 | 2724 | by metis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2725 | 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 | 2726 | 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 | 2727 | then have "x \<in> ?rhs" | 
| 68056 | 2728 | 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 | 2729 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2730 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2731 |   {
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2732 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2733 | assume "x \<in> ?rhs" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2734 | 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 | 2735 | (\<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 | 2736 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2737 | 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 | 2738 |     {
 | 
| 67613 | 2739 | 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 | 2740 | 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 | 2741 | 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 | 2742 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2743 | } | 
| 72238 | 2744 | then have "(1, x) \<in> rel_interior K0" | 
| 72567 | 2745 | using * set_sum_alt[of I "(\<lambda>i. rel_interior (K i))"] assms cs | 
| 2746 | 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 | 2747 | 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 | 2748 | using K0_def C0_def rel_interior_convex_cone_aux[of C0 1 x] | 
| 68056 | 2749 | by auto | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2750 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2751 | 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 | 2752 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2753 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2754 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2755 | 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 | 2756 | 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 | 2757 | 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 | 2758 | 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 | 2759 | and "y \<in> I" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2760 |   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 | 2761 | (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 | 2762 | 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 | 2763 | assume "x < y" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2764 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2765 | 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 | 2766 | 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 | 2767 | 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 | 2768 | 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 | 2769 | 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 | 2770 | 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 | 2771 | 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 | 2772 | |
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2773 | 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 | 2774 | 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 | 2775 | by (auto simp: dist_real_def) | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2776 | then have "K \<in> I" | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2777 | 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 | 2778 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2779 | 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 | 2780 | 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 | 2781 | 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 | 2782 | 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 | 2783 | 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 | 2784 | 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> | 
| 79583 
a521c241e946
Further lemmas concerning complexity and measures
 paulson <lp15@cam.ac.uk> parents: 
79566diff
changeset | 2785 | by (rule convex_on_slope_le) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2786 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2787 | fix y | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2788 | assume "y \<in> ?F x" | 
| 79583 
a521c241e946
Further lemmas concerning complexity and measures
 paulson <lp15@cam.ac.uk> parents: 
79566diff
changeset | 2789 | with order_trans[OF convex_on_slope_le[OF \<open>convex_on I f\<close> \<open>K \<in> I\<close> _ \<open>K < x\<close> _]] | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2790 | 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 | 2791 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2792 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2793 | 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 | 2794 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2795 | assume "y < x" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2796 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2797 | 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 | 2798 | 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 | 2799 | 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 | 2800 | 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 | 2801 | 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 | 2802 | 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 | 2803 | 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 | 2804 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2805 | 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 | 2806 | proof (rule cInf_greatest) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2807 | 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 | 2808 | 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 | 2809 | also | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2810 | fix z | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2811 | assume "z \<in> ?F x" | 
| 79583 
a521c241e946
Further lemmas concerning complexity and measures
 paulson <lp15@cam.ac.uk> parents: 
79566diff
changeset | 2812 | with order_trans[OF convex_on_slope_le[OF \<open>convex_on I f\<close> \<open>y \<in> I\<close> _ \<open>y < x\<close>]] | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2813 | 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 | 2814 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2815 | 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 | 2816 | next | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2817 | 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 | 2818 | 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 | 2819 |     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 | 2820 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2821 |     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 | 2822 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2823 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2824 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2825 | 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 | 2826 | qed simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2827 | |
| 70136 | 2828 | 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 | 2829 | |
| 66765 
c1dfa973b269
new theorem at_within_cbox_finite
 paulson <lp15@cam.ac.uk> parents: 
66641diff
changeset | 2830 | lemma at_within_cbox_finite: | 
| 
c1dfa973b269
new theorem at_within_cbox_finite
 paulson <lp15@cam.ac.uk> parents: 
66641diff
changeset | 2831 | 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 | 2832 | 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 | 2833 | proof - | 
| 
c1dfa973b269
new theorem at_within_cbox_finite
 paulson <lp15@cam.ac.uk> parents: 
66641diff
changeset | 2834 | 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 | 2835 | 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 | 2836 | then show ?thesis | 
| 
c1dfa973b269
new theorem at_within_cbox_finite
 paulson <lp15@cam.ac.uk> parents: 
66641diff
changeset | 2837 | using at_within_interior assms by fastforce | 
| 
c1dfa973b269
new theorem at_within_cbox_finite
 paulson <lp15@cam.ac.uk> parents: 
66641diff
changeset | 2838 | qed | 
| 
c1dfa973b269
new theorem at_within_cbox_finite
 paulson <lp15@cam.ac.uk> parents: 
66641diff
changeset | 2839 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2840 | lemma affine_independent_convex_affine_hull: | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2841 | fixes S :: "'a::euclidean_space set" | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2842 | 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 | 2843 | 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 | 2844 | proof - | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2845 | 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 | 2846 | 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 | 2847 | 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 | 2848 | 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 | 2849 | using assms hull_mono by blast | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2850 | 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 | 2851 | proof - | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2852 | 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 | 2853 | 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 | 2854 | show ?thesis | 
| 72567 | 2855 | proof (clarsimp simp add: affine_hull_finite fin) | 
| 2856 | fix u | |
| 2857 | assume S: "(\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull S" | |
| 2858 | and T1: "sum u T = 1" | |
| 2859 | 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)" | |
| 2860 | by (auto simp add: convex_hull_finite fin) | |
| 2861 |       { fix x
 | |
| 2862 | assume"x \<in> T" | |
| 2863 | then have S: "S = (S - T) \<union> T" \<comment> \<open>split into separate cases\<close> | |
| 2864 | using assms by auto | |
| 2865 | 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)" | |
| 2866 | "sum v T + sum v (S - T) = 1" | |
| 2867 | using v fin S | |
| 2868 | by (auto simp: sum.union_disjoint [symmetric] Un_commute) | |
| 2869 | have "(\<Sum>x\<in>S. if x \<in> T then v x - u x else v x) = 0" | |
| 2870 | "(\<Sum>x\<in>S. (if x \<in> T then v x - u x else v x) *\<^sub>R x) = 0" | |
| 2871 | using v fin T1 | |
| 2872 | by (subst S, subst sum.union_disjoint, auto simp: algebra_simps sum_subtractf)+ | |
| 2873 | } note [simp] = this | |
| 2874 | have "(\<forall>x\<in>T. 0 \<le> u x)" | |
| 2875 | 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 | |
| 2876 | then show "(\<Sum>v\<in>T. u v *\<^sub>R v) \<in> convex hull T" | |
| 2877 | using 0 [of "\<lambda>x. if x \<in> T then v x - u x else v x"] \<open>T \<subseteq> S\<close> T1 | |
| 2878 | by (fastforce simp add: convex_hull_finite fin) | |
| 2879 | qed | |
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2880 | qed | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2881 | ultimately show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2882 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2883 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2884 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2885 | lemma affine_independent_span_eq: | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2886 | fixes S :: "'a::euclidean_space set" | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2887 |   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 | 2888 | shows "affine hull S = UNIV" | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2889 | proof (cases "S = {}")
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2890 | 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 | 2891 | using assms by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2892 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2893 | case False | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2894 | 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 | 2895 | by blast | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2896 | 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 | 2897 | by (metis finite_insert aff_independent_finite) | 
| 72567 | 2898 | have "UNIV \<subseteq> (+) a ` span ((\<lambda>x. x - a) ` T)" | 
| 2899 | proof (intro card_ge_dim_independent Fun.vimage_subsetD) | |
| 2900 | show "independent ((\<lambda>x. x - a) ` T)" | |
| 2901 | using T affine_dependent_iff_dependent assms(1) by auto | |
| 2902 | show "dim ((+) a -` UNIV) \<le> card ((\<lambda>x. x - a) ` T)" | |
| 2903 | using assms T fin by (auto simp: card_image inj_on_def) | |
| 2904 | qed (use surj_plus in auto) | |
| 72238 | 2905 | then show ?thesis | 
| 2906 | 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 | 2907 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2908 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2909 | lemma affine_independent_span_gt: | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2910 | fixes S :: "'a::euclidean_space set" | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2911 |   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 | 2912 | shows "affine hull S = UNIV" | 
| 72238 | 2913 | proof (intro affine_independent_span_eq [OF ind] antisym) | 
| 2914 |   show "card S \<le> Suc DIM('a)"
 | |
| 2915 | using aff_independent_finite affine_dependent_biggerset ind by fastforce | |
| 2916 |   show "Suc DIM('a) \<le> card S"
 | |
| 2917 | using Suc_leI dim by blast | |
| 2918 | qed | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2919 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2920 | lemma empty_interior_affine_hull: | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2921 | fixes S :: "'a::euclidean_space set" | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2922 |   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 | 2923 |     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 | 2924 | using assms | 
| 72238 | 2925 | proof (induct S rule: finite_induct) | 
| 2926 | case (insert x S) | |
| 2927 |   then have "dim (span ((\<lambda>y. y - x) ` S)) < DIM('a)"
 | |
| 2928 | by (auto simp: Suc_le_lessD card_image_le dual_order.trans intro!: dim_le_card'[THEN le_less_trans]) | |
| 2929 | then show ?case | |
| 2930 | by (simp add: empty_interior_lowdim affine_hull_insert_span_gen interior_translation) | |
| 2931 | qed auto | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2932 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2933 | lemma empty_interior_convex_hull: | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2934 | fixes S :: "'a::euclidean_space set" | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2935 |   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 | 2936 |     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 | 2937 | 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 | 2938 | 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 | 2939 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2940 | 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 | 2941 | fixes S :: "'a::euclidean_space set" | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2942 | shows "finite S | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2943 |          \<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 | 2944 | \<subseteq> rel_interior (convex hull S)" | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2945 |   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 | 2946 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2947 | 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 | 2948 | fixes S :: "'a::euclidean_space set" | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2949 | shows "finite S | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2950 |          \<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 | 2951 | \<subseteq> rel_interior (convex hull S)" | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
72211diff
changeset | 2952 |   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 | 2953 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2954 | lemma rel_interior_convex_hull_explicit: | 
| 72567 | 2955 | fixes S :: "'a::euclidean_space set" | 
| 2956 | assumes "\<not> affine_dependent S" | |
| 2957 | shows "rel_interior(convex hull S) = | |
| 2958 |          {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 | 2959 | (is "?lhs = ?rhs") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2960 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2961 | show "?rhs \<le> ?lhs" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2962 | 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 | 2963 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2964 | show "?lhs \<le> ?rhs" | 
| 72567 | 2965 |   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 | 2966 | 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 | 2967 | by force | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2968 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2969 | case False | 
| 72567 | 2970 | 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 | 2971 | 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 | 2972 |     { fix a b and d::real
 | 
| 72567 | 2973 | assume ab: "a \<in> S" "b \<in> S" "a \<noteq> b" | 
| 2974 |       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 | 2975 | by auto | 
| 72567 | 2976 | have "(\<Sum>x\<in>S. if x = a then - d else if x = b then d else 0) = 0" | 
| 2977 | "(\<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 | 2978 | using ab fs | 
| 72567 | 2979 | 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 | 2980 | } note [simp] = this | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2981 |     { fix y
 | 
| 72567 | 2982 | assume y: "y \<in> convex hull S" "y \<notin> ?rhs" | 
| 2983 | have *: False if | |
| 2984 | ua: "\<forall>x\<in>S. 0 \<le> u x" "sum u S = 1" "\<not> 0 < u a" "a \<in> S" | |
| 2985 | and yT: "y = (\<Sum>x\<in>S. u x *\<^sub>R x)" "y \<in> T" "open T" | |
| 2986 |         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}"
 | |
| 2987 | for u T a | |
| 2988 | proof - | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2989 | 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 | 2990 | using ua by auto | 
| 72567 | 2991 | 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 | 2992 | using ua False by auto | 
| 72567 | 2993 | 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 | 2994 | 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 | 2995 | 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 | 2996 | by (auto intro: that [of "e / 2 / norm(a-b)"]) | 
| 72567 | 2997 | 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 | 2998 | using yT y by (metis affine_hull_convex_hull hull_redundant_eq) | 
| 72567 | 2999 | 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 | 3000 | using ua b by (auto simp: hull_inc intro: mem_affine_3_minus2) | 
| 72567 | 3001 | 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 | 3002 | using d e yT by auto | 
| 72567 | 3003 | then obtain v where v: "\<forall>x\<in>S. 0 \<le> v x" | 
| 3004 | "sum v S = 1" | |
| 3005 | "(\<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 | 3006 | 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 | 3007 | by auto | 
| 72567 | 3008 | 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" | 
| 3009 | using assms by (simp add: affine_dependent_explicit_finite fs) | |
| 3010 | show False | |
| 3011 | 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)"] | |
| 3012 | by (auto simp: algebra_simps sum_subtractf sum.distrib) | |
| 3013 | qed | |
| 3014 | have "y \<notin> rel_interior (convex hull S)" | |
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 3015 | using y convex_hull_finite [OF fs] * | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 3016 | apply simp | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 3017 | by (metis (no_types, lifting) IntD1 affine_hull_convex_hull mem_rel_interior) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3018 | } 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 | 3019 | by blast | 
| 
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 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3022 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3023 | lemma interior_convex_hull_explicit_minimal: | 
| 72567 | 3024 | fixes S :: "'a::euclidean_space set" | 
| 3025 | 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 | 3026 | shows | 
| 72567 | 3027 | "interior(convex hull S) = | 
| 3028 |              (if card(S) \<le> DIM('a) then {}
 | |
| 3029 |               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})"  
 | |
| 3030 | (is "_ = (if _ then _ else ?rhs)") | |
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 3031 | proof - | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 3032 |   { assume S: "\<not> card S \<le> DIM('a)"
 | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 3033 | have "interior (convex hull S) = rel_interior(convex hull S)" | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 3034 | using assms S by (simp add: affine_independent_span_gt rel_interior_interior) | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 3035 | then have "interior(convex hull S) = ?rhs" | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 3036 | by (simp add: assms S rel_interior_convex_hull_explicit) | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 3037 | } | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 3038 | then show ?thesis | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 3039 | by (auto simp: aff_independent_finite empty_interior_convex_hull assms) | 
| 72567 | 3040 | qed | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3041 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3042 | lemma interior_convex_hull_explicit: | 
| 72567 | 3043 | fixes S :: "'a::euclidean_space set" | 
| 3044 | 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 | 3045 | shows | 
| 72567 | 3046 | "interior(convex hull S) = | 
| 3047 |              (if card(S) \<le> DIM('a) then {}
 | |
| 3048 |               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 | 3049 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3050 |   { fix u :: "'a \<Rightarrow> real" and a
 | 
| 72567 | 3051 | 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" | 
| 3052 | 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 | 3053 | by (metis DIM_positive less_trans_Suc) | 
| 72567 | 3054 | obtain b where b: "b \<in> S" "a \<noteq> b" | 
| 3055 |     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 | 3056 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3057 | then show thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3058 | using cs subset_singletonD by fastforce | 
| 72238 | 3059 | qed blast | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3060 |     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 | 3061 | using a b by simp | 
| 72567 | 3062 | 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 | 3063 | using a b u | 
| 72238 | 3064 | 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 | 3065 | finally have "u a < 1" | 
| 72567 | 3066 | 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 | 3067 | } note [simp] = this | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3068 | show ?thesis | 
| 72238 | 3069 | 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 | 3070 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3071 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3072 | 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 | 3073 | 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 | 3074 |   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 | 3075 |     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 | 3076 | 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 | 3077 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3078 |   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 | 3079 | using assms | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3080 | 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 | 3081 |   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 | 3082 | 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 | 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 interior_open_segment: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3086 | 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 | 3087 | 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 | 3088 |                  (if 2 \<le> DIM('a) then {} else open_segment a b)"
 | 
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 3089 | proof (cases "2 \<le> DIM('a)")
 | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 3090 | case True | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 3091 |   then have "interior (open_segment a b) = {}"
 | 
| 72238 | 3092 | using interior_closed_segment_ge2 interior_mono segment_open_subset_closed by blast | 
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 3093 | with True show ?thesis | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 3094 | by auto | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3095 | next | 
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 3096 | case ge2: False | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 3097 | have "interior (open_segment a b) = open_segment a b" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3098 | proof (cases "a = b") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3099 | 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 | 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 | 
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 3102 | with ge2 have "affine hull (open_segment a b) = UNIV" | 
| 72238 | 3103 | 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 | 3104 | 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 | 3105 | 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 | 3106 | qed | 
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 3107 | with ge2 show ?thesis | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 3108 | by auto | 
| 66289 
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 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3111 | lemma interior_closed_segment: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3112 | 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 | 3113 | 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 | 3114 |                  (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 | 3115 | proof (cases "a = b") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3116 | 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 | 3117 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3118 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3119 | 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 | 3120 | by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3121 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3122 | 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 | 3123 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3124 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3125 | 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 | 3126 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3127 | 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 | 3128 | 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 | 3129 |   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 | 3130 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3131 | 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 | 3132 |   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 | 3133 | 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 | 3134 | 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 | 3135 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3136 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3137 | 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 | 3138 |     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 | 3139 | 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 | 3140 |     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 | 3141 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3142 | 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 | 3143 | using abcd by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3144 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3145 | 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 | 3146 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3147 |     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 | 3148 | 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 | 3149 |     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 | 3150 | using neq by fastforce | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3151 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3152 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3153 |   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 | 3154 | 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 | 3155 | 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 | 3156 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3157 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3158 | 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 | 3159 | 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 | 3160 | 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 | 3161 | 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 | 3162 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3163 | 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 | 3164 | 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 | 3165 | 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 | 3166 | 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 | 3167 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3168 | 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 | 3169 | 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 | 3170 |   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 | 3171 | (is "?lhs = ?rhs") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3172 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3173 | assume abcd: ?lhs | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3174 | show ?rhs | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3175 | 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 | 3176 | 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 | 3177 | 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 | 3178 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3179 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3180 | 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 | 3181 | with abcd show ?rhs | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3182 | unfolding open_segment_def | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3183 | 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 | 3184 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3185 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3186 | assume ?rhs | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3187 | then show ?lhs | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3188 | 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 | 3189 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3190 | |
| 70136 | 3191 | 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 | 3192 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3193 | lemma closure_convex_hull [simp]: | 
| 72238 | 3194 | fixes S :: "'a::euclidean_space set" | 
| 3195 | 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 | 3196 | 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 | 3197 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3198 | lemma rel_frontier_convex_hull_explicit: | 
| 72238 | 3199 | fixes S :: "'a::euclidean_space set" | 
| 3200 | assumes "\<not> affine_dependent S" | |
| 3201 | shows "rel_frontier(convex hull S) = | |
| 3202 |          {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 | 3203 | proof - | 
| 72238 | 3204 | 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 | 3205 | using assms by (simp add: aff_independent_finite) | 
| 72567 | 3206 | have "\<And>u y v. | 
| 3207 | \<lbrakk>y \<in> S; u y = 0; sum u S = 1; \<forall>x\<in>S. 0 < v x; | |
| 3208 | sum v S = 1; (\<Sum>x\<in>S. v x *\<^sub>R x) = (\<Sum>x\<in>S. u x *\<^sub>R x)\<rbrakk> | |
| 72238 | 3209 | \<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 | 3210 | 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 | 3211 | 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 | 3212 | done | 
| 72238 | 3213 | then show ?thesis | 
| 3214 | using fs assms | |
| 3215 | apply (simp add: rel_frontier_def finite_imp_compact rel_interior_convex_hull_explicit) | |
| 3216 | apply (auto simp: convex_hull_finite) | |
| 72567 | 3217 | apply (metis less_eq_real_def) | 
| 3218 | 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 | 3219 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3220 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3221 | lemma frontier_convex_hull_explicit: | 
| 72238 | 3222 | fixes S :: "'a::euclidean_space set" | 
| 3223 | assumes "\<not> affine_dependent S" | |
| 3224 | shows "frontier(convex hull S) = | |
| 3225 |          {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>
 | |
| 3226 | 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 | 3227 | proof - | 
| 72238 | 3228 | 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 | 3229 | 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 | 3230 | show ?thesis | 
| 72238 | 3231 |   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 | 3232 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3233 | 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 | 3234 | 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 | 3235 | 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 | 3236 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3237 | case False | 
| 72238 | 3238 |     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 | 3239 | by linarith | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3240 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3241 | using assms fs | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3242 | 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 | 3243 | 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 | 3244 | done | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3245 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3246 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3247 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3248 | lemma rel_frontier_convex_hull_cases: | 
| 72238 | 3249 | fixes S :: "'a::euclidean_space set" | 
| 3250 | assumes "\<not> affine_dependent S" | |
| 3251 |   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 | 3252 | proof - | 
| 72238 | 3253 | 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 | 3254 | 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 | 3255 |   { fix u a
 | 
| 72238 | 3256 | have "\<forall>x\<in>S. 0 \<le> u x \<Longrightarrow> a \<in> S \<Longrightarrow> u a = 0 \<Longrightarrow> sum u S = 1 \<Longrightarrow> | 
| 3257 | \<exists>x v. x \<in> S \<and> | |
| 3258 |                   (\<forall>x\<in>S - {x}. 0 \<le> v x) \<and>
 | |
| 3259 |                       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 | 3260 | 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 | 3261 | 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 | 3262 | 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 | 3263 | done } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3264 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3265 |   { fix a u
 | 
| 72238 | 3266 |     have "a \<in> S \<Longrightarrow> \<forall>x\<in>S - {a}. 0 \<le> u x \<Longrightarrow> sum u (S - {a}) = 1 \<Longrightarrow>
 | 
| 3267 | \<exists>v. (\<forall>x\<in>S. 0 \<le> v x) \<and> | |
| 3268 |                  (\<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 | 3269 | 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 | 3270 | 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 | 3271 | done } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3272 | ultimately show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3273 | using assms | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3274 | apply (simp add: rel_frontier_convex_hull_explicit) | 
| 72567 | 3275 | 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 | 3276 | done | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3277 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3278 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3279 | lemma frontier_convex_hull_eq_rel_frontier: | 
| 72238 | 3280 | fixes S :: "'a::euclidean_space set" | 
| 3281 | assumes "\<not> affine_dependent S" | |
| 3282 | shows "frontier(convex hull S) = | |
| 3283 |            (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 | 3284 | using assms | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3285 | 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 | 3286 | 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 | 3287 | 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 | 3288 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3289 | lemma frontier_convex_hull_cases: | 
| 72238 | 3290 | fixes S :: "'a::euclidean_space set" | 
| 3291 | assumes "\<not> affine_dependent S" | |
| 3292 | shows "frontier(convex hull S) = | |
| 3293 |            (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 | 3294 | 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 | 3295 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3296 | lemma in_frontier_convex_hull: | 
| 72238 | 3297 | fixes S :: "'a::euclidean_space set" | 
| 3298 |   assumes "finite S" "card S \<le> Suc (DIM ('a))" "x \<in> S"
 | |
| 3299 | shows "x \<in> frontier(convex hull S)" | |
| 3300 | 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 | 3301 | case True | 
| 72567 | 3302 |   with assms obtain y where "y \<in> S" and y: "y \<in> affine hull (S - {y})"
 | 
| 3303 | by (auto simp: affine_dependent_def) | |
| 3304 | moreover have "x \<in> closure (convex hull S)" | |
| 3305 | by (meson closure_subset hull_inc subset_eq \<open>x \<in> S\<close>) | |
| 3306 | moreover have "x \<notin> interior (convex hull S)" | |
| 3307 | using assms | |
| 3308 | 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) | |
| 3309 | ultimately show ?thesis | |
| 3310 | 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 | 3311 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3312 | case False | 
| 72238 | 3313 |   { assume "card S = Suc (card Basis)"
 | 
| 3314 | then have cs: "Suc 0 < card S" | |
| 71172 | 3315 | by (simp) | 
| 72238 | 3316 | with subset_singletonD have "\<exists>y \<in> S. y \<noteq> x" | 
| 3317 |       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 | 3318 | } note [dest!] = this | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3319 | show ?thesis using assms | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3320 | 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 | 3321 | 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 | 3322 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3323 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3324 | lemma not_in_interior_convex_hull: | 
| 72238 | 3325 | fixes S :: "'a::euclidean_space set" | 
| 3326 |   assumes "finite S" "card S \<le> Suc (DIM ('a))" "x \<in> S"
 | |
| 3327 | 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 | 3328 | 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 | 3329 | 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 | 3330 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3331 | lemma interior_convex_hull_eq_empty: | 
| 72238 | 3332 | fixes S :: "'a::euclidean_space set" | 
| 3333 |   assumes "card S = Suc (DIM ('a))"
 | |
| 3334 |   shows   "interior(convex hull S) = {} \<longleftrightarrow> affine_dependent S"
 | |
| 3335 | proof | |
| 3336 |   show "affine_dependent S \<Longrightarrow> interior (convex hull S) = {}"
 | |
| 3337 | proof (clarsimp simp: affine_dependent_def) | |
| 3338 | fix a b | |
| 3339 |     assume "b \<in> S" "b \<in> affine hull (S - {b})"
 | |
| 3340 |     then have "interior(affine hull S) = {}" using assms
 | |
| 72302 
d7d90ed4c74e
fixed some remarkably ugly proofs
 paulson <lp15@cam.ac.uk> parents: 
72238diff
changeset | 3341 | 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 | 3342 |     then show "interior (convex hull S) = {}" 
 | 
| 3343 | using affine_hull_nonempty_interior by fastforce | |
| 3344 | qed | |
| 3345 | next | |
| 3346 |   show "interior (convex hull S) = {} \<Longrightarrow> affine_dependent S"
 | |
| 3347 | 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 | 3348 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3349 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3350 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3351 | 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 | 3352 | |
| 70136 | 3353 | definition\<^marker>\<open>tag important\<close> coplanar where | 
| 72238 | 3354 |    "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 | 3355 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3356 | lemma collinear_affine_hull: | 
| 72238 | 3357 |   "collinear S \<longleftrightarrow> (\<exists>u v. S \<subseteq> affine hull {u,v})"
 | 
| 3358 | proof (cases "S={}")
 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3359 | 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 | 3360 | by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3361 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3362 | case False | 
| 72238 | 3363 | 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 | 3364 |   { fix u
 | 
| 72238 | 3365 | assume *: "\<And>x y. \<lbrakk>x\<in>S; y\<in>S\<rbrakk> \<Longrightarrow> \<exists>c. x - y = c *\<^sub>R u" | 
| 3366 | 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" | |
| 3367 | by (rule_tac x="1+c" in exI, rule_tac x="-c" in exI, simp add: algebra_simps) | |
| 3368 |     then have "\<exists>u v. S \<subseteq> {a *\<^sub>R u + b *\<^sub>R v |a b. a + b = 1}"
 | |
| 3369 | 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 | 3370 | } moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3371 |   { fix u v x y
 | 
| 72238 | 3372 |     assume *: "S \<subseteq> {a *\<^sub>R u + b *\<^sub>R v |a b. a + b = 1}"
 | 
| 3373 | have "\<exists>c. x - y = c *\<^sub>R (v-u)" if "x\<in>S" "y\<in>S" | |
| 3374 | proof - | |
| 3375 | obtain a r where "a + r = 1" "x = a *\<^sub>R u + r *\<^sub>R v" | |
| 3376 | using "*" \<open>x \<in> S\<close> by blast | |
| 3377 | moreover | |
| 3378 | obtain b s where "b + s = 1" "y = b *\<^sub>R u + s *\<^sub>R v" | |
| 3379 | using "*" \<open>y \<in> S\<close> by blast | |
| 3380 | ultimately have "x - y = (r-s) *\<^sub>R (v-u)" | |
| 3381 | by (simp add: algebra_simps) (metis scaleR_left.add) | |
| 3382 | then show ?thesis | |
| 3383 | by blast | |
| 3384 | qed | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3385 | } ultimately | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3386 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3387 | 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 | 3388 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3389 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3390 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3391 | lemma collinear_closed_segment [simp]: "collinear (closed_segment a b)" | 
| 72238 | 3392 | 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 | 3393 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3394 | 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 | 3395 | unfolding open_segment_def | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3396 | by (metis convex_hull_subset_affine_hull segment_convex_hull dual_order.trans | 
| 72238 | 3397 | 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 | 3398 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3399 | lemma collinear_between_cases: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3400 | 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 | 3401 |   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 | 3402 | (is "?lhs = ?rhs") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3403 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3404 | assume ?lhs | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3405 |   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 | 3406 | 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 | 3407 | show ?rhs | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3408 | 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 | 3409 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3410 | assume ?rhs | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3411 | then show ?lhs | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3412 | unfolding between_mem_convex_hull | 
| 73932 
fd21b4a93043
added opaque_combs and renamed hide_lams to opaque_lifting
 desharna parents: 
72569diff
changeset | 3413 | 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 | 3414 | qed | 
| 
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 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3417 | 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 | 3418 | 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 | 3419 | 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 | 3420 | 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 | 3421 | 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 | 3422 | 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 | 3423 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3424 | 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 | 3425 | 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 | 3426 | 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 | 3427 | 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 | 3428 | 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 | 3429 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3430 | 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 | 3431 | 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 | 3432 | 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 | 3433 | proof (cases "a = b") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3434 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3435 | 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 | 3436 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3437 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3438 | 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 | 3439 | 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 | 3440 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3441 | 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 | 3442 | 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 | 3443 | 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 | 3444 | 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 | 3445 | 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 | 3446 | 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 | 3447 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3448 | 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 | 3449 | 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 | 3450 | 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 | 3451 | 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 | 3452 | 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 | 3453 | proof (rule between_antisym) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3454 | 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 | 3455 | 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 | 3456 | 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 | 3457 | 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 | 3458 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3459 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3460 | moreover | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3461 | 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 | 3462 | 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 | 3463 | 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 | 3464 | 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 | 3465 | 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 | 3466 | 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 | 3467 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3468 | 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 | 3469 | 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 | 3470 | 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 | 3471 | 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 | 3472 | 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 | 3473 | proof (rule between_antisym) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3474 | 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 | 3475 | 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 | 3476 | 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 | 3477 | 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 | 3478 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3479 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3480 | ultimately show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3481 | 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 | 3482 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3483 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3484 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3485 | 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 | 3486 | 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 | 3487 | 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 | 3488 | 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 | 3489 | 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 | 3490 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3491 |   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 | 3492 | 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 | 3493 | 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 | 3494 | 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 | 3495 | 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 | 3496 | finally show ?thesis . | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3497 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3498 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3499 | lemma collinear_imp_coplanar: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3500 | "collinear s ==> coplanar s" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3501 | 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 | 3502 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3503 | lemma collinear_small: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3504 | 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 | 3505 | shows "collinear s" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3506 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3507 | 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 | 3508 | using assms by linarith | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3509 | 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 | 3510 | 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 | 3511 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3512 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3513 | lemma coplanar_small: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3514 | 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 | 3515 | shows "coplanar s" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3516 | proof - | 
| 71258 
d67924987c34
a few new and tidier proofs (mostly about finite sets)
 paulson <lp15@cam.ac.uk> parents: 
71244diff
changeset | 3517 | 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 | 3518 | using assms by linarith | 
| 71258 
d67924987c34
a few new and tidier proofs (mostly about finite sets)
 paulson <lp15@cam.ac.uk> parents: 
71244diff
changeset | 3519 | then show ?thesis | 
| 
d67924987c34
a few new and tidier proofs (mostly about finite sets)
 paulson <lp15@cam.ac.uk> parents: 
71244diff
changeset | 3520 | proof cases | 
| 
d67924987c34
a few new and tidier proofs (mostly about finite sets)
 paulson <lp15@cam.ac.uk> parents: 
71244diff
changeset | 3521 | case 1 | 
| 
d67924987c34
a few new and tidier proofs (mostly about finite sets)
 paulson <lp15@cam.ac.uk> parents: 
71244diff
changeset | 3522 | then show ?thesis | 
| 
d67924987c34
a few new and tidier proofs (mostly about finite sets)
 paulson <lp15@cam.ac.uk> parents: 
71244diff
changeset | 3523 | 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 | 3524 | next | 
| 
d67924987c34
a few new and tidier proofs (mostly about finite sets)
 paulson <lp15@cam.ac.uk> parents: 
71244diff
changeset | 3525 | case 2 | 
| 
d67924987c34
a few new and tidier proofs (mostly about finite sets)
 paulson <lp15@cam.ac.uk> parents: 
71244diff
changeset | 3526 | then show ?thesis | 
| 
d67924987c34
a few new and tidier proofs (mostly about finite sets)
 paulson <lp15@cam.ac.uk> parents: 
71244diff
changeset | 3527 |       using hull_subset [of "{_,_,_}"]
 | 
| 
d67924987c34
a few new and tidier proofs (mostly about finite sets)
 paulson <lp15@cam.ac.uk> parents: 
71244diff
changeset | 3528 | 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 | 3529 | qed | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3530 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3531 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3532 | lemma coplanar_empty: "coplanar {}"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3533 | 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 | 3534 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3535 | 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 | 3536 | 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 | 3537 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3538 | 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 | 3539 | 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 | 3540 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3541 | 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 | 3542 | 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 | 3543 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3544 | 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 | 3545 | unfolding collinear_affine_hull | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3546 | 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 | 3547 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3548 | 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 | 3549 | unfolding coplanar_def | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3550 | 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 | 3551 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3552 | lemma coplanar_linear_image: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3553 | fixes f :: "'a::euclidean_space \<Rightarrow> 'b::real_normed_vector" | 
| 72567 | 3554 | 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 | 3555 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3556 |   { fix u v w
 | 
| 72567 | 3557 |     assume "S \<subseteq> affine hull {u, v, w}"
 | 
| 3558 |     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 | 3559 | by (simp add: image_mono) | 
| 72567 | 3560 |     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 | 3561 | 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 | 3562 | } then | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3563 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3564 | 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 | 3565 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3566 | |
| 72567 | 3567 | lemma coplanar_translation_imp: | 
| 3568 | assumes "coplanar S" shows "coplanar ((\<lambda>x. a + x) ` S)" | |
| 3569 | proof - | |
| 3570 |   obtain u v w where "S \<subseteq> affine hull {u,v,w}"
 | |
| 3571 | by (meson assms coplanar_def) | |
| 3572 |   then have "(+) a ` S \<subseteq> affine hull {u + a, v + a, w + a}"
 | |
| 3573 |     using affine_hull_translation [of a "{u,v,w}" for u v w]
 | |
| 3574 | by (force simp: add.commute) | |
| 3575 | then show ?thesis | |
| 3576 | unfolding coplanar_def by blast | |
| 3577 | qed | |
| 3578 | ||
| 3579 | 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 | 3580 | 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 | 3581 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3582 | 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 | 3583 | fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" | 
| 72567 | 3584 | 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 | 3585 | proof | 
| 72567 | 3586 | assume "coplanar S" | 
| 3587 | then show "coplanar (f ` S)" | |
| 3588 | 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 | 3589 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3590 | 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 | 3591 | 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 | 3592 | by blast | 
| 72567 | 3593 | assume "coplanar (f ` S)" | 
| 3594 | then show "coplanar S" | |
| 3595 | by (metis coplanar_linear_image g(1) g(2) id_apply image_comp image_id) | |
| 3596 | qed | |
| 3597 | ||
| 3598 | 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 | 3599 | 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 | 3600 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3601 | 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 | 3602 | 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 | 3603 | |
| 72238 | 3604 | lemma collinear_3_imp_in_affine_hull: | 
| 3605 |   assumes "collinear {a,b,c}" "a \<noteq> b" shows "c \<in> affine hull {a,b}"
 | |
| 3606 | proof - | |
| 3607 | obtain u x y where "b - a = y *\<^sub>R u" "c - a = x *\<^sub>R u" | |
| 3608 | using assms unfolding collinear_def by auto | |
| 72567 | 3609 | 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" | 
| 3610 | by (simp add: algebra_simps) | |
| 3611 | then show ?thesis | |
| 3612 | by (simp add: hull_inc mem_affine) | |
| 72238 | 3613 | qed | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3614 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3615 | 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 | 3616 | assumes "a \<noteq> b" | 
| 72238 | 3617 |   shows "collinear {a,b,c} \<longleftrightarrow> c \<in> affine hull {a,b}"
 | 
| 3618 | 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 | 3619 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3620 | 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 | 3621 |   "collinear{a,b,c} \<longleftrightarrow> a = b \<or> a = c \<or> b = c \<or> affine_dependent {a,b,c}"
 | 
| 72238 | 3622 | proof (cases "a = b \<or> a = c \<or> b = c") | 
| 3623 | case True | |
| 3624 | then show ?thesis | |
| 3625 | by (auto simp: insert_commute) | |
| 3626 | next | |
| 3627 | case False | |
| 72567 | 3628 |   then have "collinear{a,b,c}" if "affine_dependent {a,b,c}"
 | 
| 3629 | using that unfolding affine_dependent_def | |
| 3630 | by (auto simp: insert_Diff_if; metis affine_hull_3_imp_collinear insert_commute) | |
| 3631 | moreover | |
| 3632 |   have "affine_dependent {a,b,c}" if "collinear{a,b,c}"
 | |
| 3633 | using False that by (auto simp: affine_dependent_def collinear_3_affine_hull insert_Diff_if) | |
| 3634 | ultimately | |
| 3635 | show ?thesis | |
| 3636 | using False by blast | |
| 72238 | 3637 | qed | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3638 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3639 | 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 | 3640 |   "affine_dependent {a,b,c} \<Longrightarrow> collinear{a,b,c}"
 | 
| 72238 | 3641 | 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 | 3642 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3643 | 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 | 3644 | 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 | 3645 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3646 | lemma collinear_3_expand: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3647 |    "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 | 3648 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3649 |   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 | 3650 | 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 | 3651 |   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 | 3652 | 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 | 3653 | 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 | 3654 | 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 | 3655 | 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 | 3656 | 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 | 3657 | finally show ?thesis . | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3658 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3659 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3660 | 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 | 3661 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3662 | assume "collinear S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3663 |   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 | 3664 | 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 | 3665 | 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 | 3666 | 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 | 3667 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3668 | 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 | 3669 | 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 | 3670 | by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3671 | 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 | 3672 | 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 | 3673 | 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 | 3674 | 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 | 3675 | then have "collinear B" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3676 | by (rule collinear_small) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3677 | then show "collinear S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3678 | 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 | 3679 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3680 | |
| 72567 | 3681 | lemma collinear_midpoint: "collinear{a, midpoint a b, b}"
 | 
| 3682 | proof - | |
| 3683 | 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" | |
| 3684 | by (simp add: algebra_simps) | |
| 3685 | show ?thesis | |
| 3686 | by (auto simp: collinear_3 collinear_lemma intro: \<section>) | |
| 3687 | qed | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3688 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3689 | lemma midpoint_collinear: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3690 | 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 | 3691 | assumes "a \<noteq> c" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3692 |     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 | 3693 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3694 | 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 | 3695 | "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 | 3696 | "\<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 | 3697 | by (auto simp: algebra_simps) | 
| 72567 | 3698 |   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 | 3699 | using collinear_midpoint by blast | 
| 72567 | 3700 |   moreover have "b = midpoint a c \<longleftrightarrow> dist a b = dist b c" if "collinear{a,b,c}"
 | 
| 3701 | proof - | |
| 3702 | consider "a = c" | u where "b = u *\<^sub>R a + (1 - u) *\<^sub>R c" | |
| 3703 |       using \<open>collinear {a,b,c}\<close> unfolding collinear_3_expand by blast
 | |
| 3704 | then show ?thesis | |
| 3705 | proof cases | |
| 3706 | case 2 | |
| 3707 | with assms have "dist a b = dist b c \<Longrightarrow> b = midpoint a c" | |
| 3708 | by (simp add: dist_norm * midpoint_def scaleR_add_right del: divide_const_simps) | |
| 3709 | then show ?thesis | |
| 3710 | by (auto simp: dist_midpoint) | |
| 3711 | qed (use assms in auto) | |
| 3712 | qed | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3713 | 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 | 3714 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3715 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3716 | lemma between_imp_collinear: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3717 | 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 | 3718 | 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 | 3719 |     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 | 3720 | 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 | 3721 | 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 | 3722 | 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 | 3723 | next | 
| 72567 | 3724 | case False | 
| 3725 | then have False if "\<And>c. b - x \<noteq> c *\<^sub>R (a - x)" | |
| 3726 | using that [of "-(norm(b - x) / norm(x - a))"] assms | |
| 3727 | by (simp add: between_norm vector_add_divide_simps flip: real_vector.scale_minus_right) | |
| 3728 | then show ?thesis | |
| 3729 | 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 | 3730 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3731 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3732 | lemma midpoint_between: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3733 | 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 | 3734 | 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 | 3735 | proof (cases "a = c") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3736 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3737 | show ?thesis | 
| 72238 | 3738 | using False between_imp_collinear between_midpoint(1) midpoint_collinear by blast | 
| 72567 | 3739 | 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 | 3740 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3741 | lemma collinear_triples: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3742 | assumes "a \<noteq> b" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3743 |     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 | 3744 | (is "?lhs = ?rhs") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3745 | proof safe | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3746 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3747 | 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 | 3748 |   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 | 3749 | 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 | 3750 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3751 | assume ?rhs | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3752 |   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 | 3753 | by (simp add: insert_commute) | 
| 72567 | 3754 | 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 | 3755 | using that assms collinear_3_expand by fastforce+ | 
| 72567 | 3756 | have "\<exists>c. x - y = c *\<^sub>R (b - a)" | 
| 3757 | if x: "x \<in> insert a (insert b S)" and y: "y \<in> insert a (insert b S)" for x y | |
| 3758 | proof - | |
| 3759 | obtain u v where "x = u *\<^sub>R a + (1 - u) *\<^sub>R b" "y = v *\<^sub>R a + (1 - v) *\<^sub>R b" | |
| 3760 | using "*" x y by presburger | |
| 3761 | then have "x - y = (v - u) *\<^sub>R (b - a)" | |
| 3762 | by (simp add: scale_left_diff_distrib scale_right_diff_distrib) | |
| 3763 | then show ?thesis .. | |
| 3764 | qed | |
| 3765 | then show ?lhs | |
| 3766 | 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 | 3767 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3768 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3769 | lemma collinear_4_3: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3770 | assumes "a \<noteq> b" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3771 |     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 | 3772 |   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 | 3773 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3774 | lemma collinear_3_trans: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3775 |   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 | 3776 |     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 | 3777 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3778 |   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 | 3779 | 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 | 3780 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3781 | 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 | 3782 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3783 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3784 | 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 | 3785 | 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 | 3786 |   shows "affine hull {a,b} = range (\<lambda>u. a + u *\<^sub>R (b - a))"
 | 
| 72567 | 3787 | proof - | 
| 3788 | have 1: "u *\<^sub>R a + v *\<^sub>R b = a + v *\<^sub>R (b - a)" if "u + v = 1" for u v | |
| 3789 | using that | |
| 3790 | by (simp add: algebra_simps flip: scaleR_add_left) | |
| 3791 | have 2: "a + u *\<^sub>R (b - a) = (1 - u) *\<^sub>R a + u *\<^sub>R b" for u | |
| 3792 | by (auto simp: algebra_simps) | |
| 3793 | show ?thesis | |
| 3794 | by (force simp add: affine_hull_2 dest: 1 intro!: 2) | |
| 3795 | qed | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3796 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3797 | 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 | 3798 | fixes a :: "'a::euclidean_space" | 
| 72567 | 3799 |   assumes "\<not> collinear{a,b,c}" and 2: "DIM('a) = 2"
 | 
| 3800 |   shows "interior(convex hull {a,b,c}) =
 | |
| 3801 |          {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}"
 | |
| 3802 | (is "?lhs = ?rhs") | |
| 3803 | proof | |
| 3804 |   have abc: "a \<noteq> b" "a \<noteq> c" "b \<noteq> c" "\<not> affine_dependent {a, b, c}"
 | |
| 3805 | using assms by (auto simp: collinear_3_eq_affine_dependent) | |
| 3806 | with 2 show "?lhs \<subseteq> ?rhs" | |
| 3807 | by (fastforce simp add: interior_convex_hull_explicit_minimal) | |
| 3808 | show "?rhs \<subseteq> ?lhs" | |
| 3809 | using abc 2 | |
| 3810 | apply (clarsimp simp add: interior_convex_hull_explicit_minimal) | |
| 3811 | subgoal for x y z | |
| 3812 | 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 | |
| 3813 | done | |
| 3814 | qed | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3815 | |
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66793diff
changeset | 3816 | |
| 70136 | 3817 | 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 | 3818 | |
| 69516 
09bb8f470959
most of Topology_Euclidean_Space (now Elementary_Topology) requires fewer dependencies
 immler parents: 
69508diff
changeset | 3819 | lemma halfspace_Int_eq: | 
| 
09bb8f470959
most of Topology_Euclidean_Space (now Elementary_Topology) requires fewer dependencies
 immler parents: 
69508diff
changeset | 3820 |      "{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 | 3821 |      "{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 | 3822 | by auto | 
| 
09bb8f470959
most of Topology_Euclidean_Space (now Elementary_Topology) requires fewer dependencies
 immler parents: 
69508diff
changeset | 3823 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3824 | lemma hyperplane_eq_Ex: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3825 | 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 | 3826 | 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 | 3827 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3828 | lemma hyperplane_eq_empty: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3829 |      "{x. a \<bullet> x = b} = {} \<longleftrightarrow> a = 0 \<and> b \<noteq> 0"
 | 
| 72238 | 3830 | using hyperplane_eq_Ex | 
| 3831 | 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 | 3832 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3833 | lemma hyperplane_eq_UNIV: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3834 |    "{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 | 3835 | proof - | 
| 72238 | 3836 |   have "a = 0 \<and> b = 0" if "UNIV \<subseteq> {x. a \<bullet> x = b}"
 | 
| 3837 | using subsetD [OF that, where c = "((b+1) / (a \<bullet> a)) *\<^sub>R a"] | |
| 3838 | 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 | 3839 | 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 | 3840 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3841 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3842 | 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 | 3843 |    "{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 | 3844 | proof - | 
| 72238 | 3845 |   have "a = 0 \<and> b \<le> 0" if "{x. a \<bullet> x < b} \<subseteq> {}"
 | 
| 3846 | using subsetD [OF that, where c = "((b-1) / (a \<bullet> a)) *\<^sub>R a"] | |
| 3847 | 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 | 3848 | 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 | 3849 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3850 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3851 | lemma halfspace_eq_empty_gt: | 
| 72238 | 3852 |   "{x. a \<bullet> x > b} = {} \<longleftrightarrow> a = 0 \<and> b \<ge> 0"
 | 
| 3853 | using halfspace_eq_empty_lt [of "-a" "-b"] | |
| 3854 | by simp | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3855 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3856 | 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 | 3857 |    "{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 | 3858 | proof - | 
| 72238 | 3859 |   have "a = 0 \<and> b < 0" if "{x. a \<bullet> x \<le> b} \<subseteq> {}"
 | 
| 3860 | using subsetD [OF that, where c = "((b-1) / (a \<bullet> a)) *\<^sub>R a"] | |
| 3861 | 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 | 3862 | 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 | 3863 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3864 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3865 | lemma halfspace_eq_empty_ge: | 
| 72238 | 3866 |   "{x. a \<bullet> x \<ge> b} = {} \<longleftrightarrow> a = 0 \<and> b > 0"
 | 
| 3867 | 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 | 3868 | |
| 70136 | 3869 | subsection\<^marker>\<open>tag unimportant\<close>\<open>Use set distance for an easy proof of separation properties\<close> | 
| 3870 | ||
| 3871 | 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 | 3872 | 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 | 3873 |   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 | 3874 |   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 | 3875 | 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 | 3876 | 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 | 3877 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3878 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3879 |   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 | 3880 | 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 | 3881 | 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 | 3882 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3883 |   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 | 3884 |     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 | 3885 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3886 |     show "open {x. 0 < f x}"
 | 
| 71172 | 3887 | 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 | 3888 |     show "open {x. f x < 0}"
 | 
| 71172 | 3889 | by (simp add: open_Collect_less contf) | 
| 72238 | 3890 |     have "\<And>x. x \<in> S \<Longrightarrow> setdist {x} T \<noteq> 0" "\<And>x. x \<in> T \<Longrightarrow> setdist {x} S \<noteq> 0"
 | 
| 3891 | by (meson False assms disjoint_iff setdist_eq_0_sing_1)+ | |
| 3892 |     then show "S \<subseteq> {x. 0 < f x}" "T \<subseteq> {x. f x < 0}"
 | |
| 3893 | 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 | 3894 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3895 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3896 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3897 | lemma separation_normal: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3898 | 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 | 3899 |   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 | 3900 |   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 | 3901 | 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 | 3902 | 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 | 3903 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3904 | lemma separation_normal_local: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3905 | 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 | 3906 | 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 | 3907 | 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 | 3908 |       and "S \<inter> T = {}"
 | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 3909 | 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 | 3910 | "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 | 3911 |                       "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 | 3912 | 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 | 3913 | case True with that show ?thesis | 
| 68056 | 3914 | 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 | 3915 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3916 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3917 |   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 | 3918 | 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 | 3919 | 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 | 3920 | show ?thesis | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66793diff
changeset | 3921 |   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 | 3922 |     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 | 3923 | by auto | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 3924 |     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 | 3925 | 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 | 3926 | next | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 3927 |     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 | 3928 | 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 | 3929 | next | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66793diff
changeset | 3930 | 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 | 3931 | 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 | 3932 |     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 | 3933 | 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 | 3934 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3935 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3936 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3937 | lemma separation_normal_compact: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3938 | 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 | 3939 |   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 | 3940 |   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 | 3941 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3942 | 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 | 3943 | 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 | 3944 | 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 | 3945 | 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 | 3946 |   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 | 3947 | using assms r by blast+ | 
| 72238 | 3948 |   then obtain U V where UV: "open U" "open V" "S \<subseteq> U" "T \<union> - ball 0 r \<subseteq> V" "U \<inter> V = {}"
 | 
| 3949 | by (meson \<open>closed S\<close> separation_normal) | |
| 3950 | then have "compact(closure U)" | |
| 3951 | by (meson bounded_ball bounded_subset compact_closure compl_le_swap2 disjoint_eq_subset_Compl le_sup_iff) | |
| 3952 | with UV show thesis | |
| 3953 | 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 | 3954 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3955 | |
| 66793 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3956 | subsection\<open>Connectedness of the intersection of a chain\<close> | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3957 | |
| 68607 
67bb59e49834
make theorem, corollary, and proposition %important for HOL-Analysis manual
 immler parents: 
68527diff
changeset | 3958 | proposition connected_chain: | 
| 66793 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3959 | fixes \<F> :: "'a :: euclidean_space set set" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3960 | 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 | 3961 | 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 | 3962 | shows "connected(\<Inter>\<F>)" | 
| 68607 
67bb59e49834
make theorem, corollary, and proposition %important for HOL-Analysis manual
 immler parents: 
68527diff
changeset | 3963 | proof (cases "\<F> = {}")
 | 
| 66793 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3964 | case True then show ?thesis | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3965 | by auto | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3966 | next | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3967 | case False | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3968 | then have cf: "compact(\<Inter>\<F>)" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3969 | by (simp add: cc compact_Inter) | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3970 |   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 | 3971 |                 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 | 3972 | proof - | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3973 |     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 | 3974 | using separation_normal [OF AB] by metis | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3975 | obtain K where "K \<in> \<F>" "compact K" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3976 | using cc False by blast | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3977 | then obtain N where "open N" and "K \<subseteq> N" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3978 | by blast | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3979 | 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 | 3980 | 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 | 3981 | proof (rule compactE [OF \<open>compact K\<close>]) | 
| 69745 | 3982 | 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 | 3983 | using \<open>K \<subseteq> N\<close> ABeq \<open>A \<subseteq> U\<close> \<open>B \<subseteq> V\<close> by auto | 
| 67399 | 3984 | 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 | 3985 | 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 | 3986 | qed | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3987 |     then have "finite(\<D> - {U \<union> V})"
 | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3988 | by blast | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3989 |     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 | 3990 | using \<open>\<D> \<subseteq> ?\<C>\<close> by blast | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3991 |     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 | 3992 | using finite_subset_image by metis | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3993 | 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 | 3994 |     proof (cases "\<G> = {}")
 | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3995 | case True | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3996 |       with \<open>\<F> \<noteq> {}\<close> that show ?thesis
 | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3997 | by auto | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3998 | next | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 3999 | case False | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4000 | 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 | 4001 | 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 | 4002 |       with \<open>finite \<G>\<close> \<open>\<G> \<noteq> {}\<close>
 | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4003 | 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 | 4004 | proof induction | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4005 | case (insert X \<H>) | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4006 | show ?case | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4007 |         proof (cases "\<H> = {}")
 | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4008 | case True then show ?thesis by auto | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4009 | next | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4010 | case False | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4011 | 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 | 4012 | by (simp add: insert.prems) | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4013 | 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 | 4014 | by metis | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4015 | 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 | 4016 | 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 | 4017 | then show ?thesis | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4018 | proof | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4019 | assume "N - J \<subseteq> N - X" with J show ?thesis | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4020 | by auto | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4021 | next | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4022 | assume "N - X \<subseteq> N - J" | 
| 69325 | 4023 | 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 | 4024 | by auto | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4025 | with \<open>J \<in> \<H>\<close> show ?thesis | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4026 | by blast | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4027 | qed | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4028 | qed | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4029 | qed simp | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4030 | 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 | 4031 | qed | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4032 |     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 | 4033 | using \<open>K \<subseteq> \<Union>\<D>\<close> by auto | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4034 | 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 | 4035 | 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 | 4036 | finally have "J \<inter> K \<subseteq> U \<union> V" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4037 | by blast | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4038 | moreover have "connected(J \<inter> K)" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4039 | 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 | 4040 |     moreover have "U \<inter> (J \<inter> K) \<noteq> {}"
 | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4041 |       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 | 4042 |     moreover have "V \<inter> (J \<inter> K) \<noteq> {}"
 | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4043 |       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 | 4044 | ultimately show False | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4045 |         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 | 4046 | qed | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4047 | with cf show ?thesis | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4048 | by (auto simp: connected_closed_set compact_imp_closed) | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4049 | qed | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4050 | |
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4051 | lemma connected_chain_gen: | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4052 | fixes \<F> :: "'a :: euclidean_space set set" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4053 | assumes X: "X \<in> \<F>" "compact X" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4054 | 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 | 4055 | 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 | 4056 | shows "connected(\<Inter>\<F>)" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4057 | proof - | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4058 | have "\<Inter>\<F> = (\<Inter>T\<in>\<F>. X \<inter> T)" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4059 | using X by blast | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4060 | moreover have "connected (\<Inter>T\<in>\<F>. X \<inter> T)" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4061 | proof (rule connected_chain) | 
| 67399 | 4062 | 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 | 4063 | using cc X by auto (metis inf.absorb2 inf.orderE local.linear) | 
| 67399 | 4064 | 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 | 4065 | using local.linear by blast | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4066 | qed | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4067 | ultimately show ?thesis | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4068 | by metis | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4069 | qed | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4070 | |
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4071 | lemma connected_nest: | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4072 | fixes S :: "'a::linorder \<Rightarrow> 'b::euclidean_space set" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4073 | 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 | 4074 | 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 | 4075 | shows "connected(\<Inter> (range S))" | 
| 72567 | 4076 | proof (rule connected_chain) | 
| 4077 | 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 | 4078 | by (metis image_iff le_cases nest) | 
| 72567 | 4079 | qed (use S in blast) | 
| 66793 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4080 | |
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4081 | lemma connected_nest_gen: | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4082 | fixes S :: "'a::linorder \<Rightarrow> 'b::euclidean_space set" | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4083 | 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 | 4084 | 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 | 4085 | shows "connected(\<Inter> (range S))" | 
| 72567 | 4086 | proof (rule connected_chain_gen [of "S k"]) | 
| 4087 | show "\<And>A T. A \<in> range S \<and> T \<in> range S \<Longrightarrow> A \<subseteq> T \<or> T \<subseteq> A" | |
| 4088 | by (metis imageE le_cases nest) | |
| 4089 | qed (use S in auto) | |
| 66793 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66765diff
changeset | 4090 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4091 | 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 | 4092 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4093 | lemma finite_indexed_bound: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4094 | 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 | 4095 | 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 | 4096 | using A | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4097 | proof (induction A) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4098 | 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 | 4099 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4100 | case (insert a A) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4101 | 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 | 4102 | by force | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4103 | then show ?case | 
| 72238 | 4104 | 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 | 4105 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4106 | |
| 68607 
67bb59e49834
make theorem, corollary, and proposition %important for HOL-Analysis manual
 immler parents: 
68527diff
changeset | 4107 | proposition proper_map: | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4108 | 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 | 4109 | 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 | 4110 | 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 | 4111 | 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 | 4112 | shows "closedin (top_of_set T) (f ` K)" | 
| 68607 
67bb59e49834
make theorem, corollary, and proposition %important for HOL-Analysis manual
 immler parents: 
68527diff
changeset | 4113 | proof - | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4114 | have "K \<subseteq> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4115 | 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 | 4116 | 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 | 4117 | 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 | 4118 | 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 | 4119 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4120 | 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 | 4121 | 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 | 4122 | 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 | 4123 | by metis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4124 | 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 | 4125 | by metis | 
| 72567 | 4126 |     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 | 4127 | have "compact (C \<inter> (S \<inter> f -` insert y (range (\<lambda>i. f(X(n + i))))))" for n | 
| 72238 | 4128 | proof (intro closed_Int_compact [OF \<open>closed C\<close> com] compact_sequence_with_limit) | 
| 4129 | show "insert y (range (\<lambda>i. f (X (n + i)))) \<subseteq> T" | |
| 4130 | using X \<open>K \<subseteq> S\<close> \<open>f ` S \<subseteq> T\<close> \<open>y \<in> T\<close> by blast | |
| 4131 | show "(\<lambda>i. f (X (n + i))) \<longlonglongrightarrow> y" | |
| 4132 | by (simp add: fX add.commute [of n] LIMSEQ_ignore_initial_segment [OF hlim]) | |
| 4133 | qed | |
| 72567 | 4134 | then have comf: "compact (\<Psi> n)" for n | 
| 4135 | 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 | 4136 |     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 | 4137 | if "finite \<F>" | 
| 72567 | 4138 | 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 | 4139 | for \<F> | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4140 | proof - | 
| 72567 | 4141 | obtain m where m: "\<And>t. t \<in> \<F> \<Longrightarrow> \<exists>k\<le>m. t = \<Psi> k" | 
| 72238 | 4142 | 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 | 4143 | have "X m \<in> \<Inter>\<F>" | 
| 72567 | 4144 | 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 | 4145 | 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 | 4146 | qed | 
| 72567 | 4147 |     have "(\<Inter>n. \<Psi> n) \<noteq> {}"
 | 
| 4148 | proof (rule compact_fip_Heine_Borel) | |
| 4149 |       show "\<And>\<F>'. \<lbrakk>finite \<F>'; \<F>' \<subseteq> range \<Psi>\<rbrakk> \<Longrightarrow> \<Inter> \<F>' \<noteq> {}"
 | |
| 4150 | by (meson ne rangeE subset_eq) | |
| 4151 | qed (use comf in blast) | |
| 4152 | then obtain x where "x \<in> K" "\<And>n. (f x = y \<or> (\<exists>u. f x = h (n + u)))" | |
| 4153 | 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 | 4154 | then show ?thesis | 
| 72567 | 4155 | 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 | 4156 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4157 | 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 | 4158 | 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 | 4159 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4160 | |
| 78656 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4161 | subsection \<open>Closure of conic hulls\<close> | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4162 | proposition closedin_conic_hull: | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4163 | fixes S :: "'a::euclidean_space set" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4164 | assumes "compact T" "0 \<notin> T" "T \<subseteq> S" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4165 | shows "closedin (top_of_set (conic hull S)) (conic hull T)" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4166 | proof - | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4167 |   have **: "compact ({0..} \<times> T \<inter> (\<lambda>z. fst z *\<^sub>R snd z) -` K)" (is "compact ?L")
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4168 |     if "K \<subseteq> (\<lambda>z. (fst z) *\<^sub>R snd z) ` ({0..} \<times> S)" "compact K" for K
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4169 | proof - | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4170 | obtain r where "r > 0" and r: "\<And>x. x \<in> K \<Longrightarrow> norm x \<le> r" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4171 | by (metis \<open>compact K\<close> bounded_normE compact_imp_bounded) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4172 | show ?thesis | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4173 | unfolding compact_eq_bounded_closed | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4174 | proof | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4175 |       have "bounded ({0..r / setdist{0}T} \<times> T)"
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4176 | by (simp add: assms(1) bounded_Times compact_imp_bounded) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4177 |       moreover have "?L \<subseteq> ({0..r / setdist{0}T} \<times> T)"
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4178 | proof clarsimp | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4179 | fix a b | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4180 | assume "a *\<^sub>R b \<in> K" and "b \<in> T" and "0 \<le> a" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4181 |         have "setdist {0} T \<noteq> 0"
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4182 | using \<open>b \<in> T\<close> assms compact_imp_closed setdist_eq_0_closed by auto | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4183 |         then have T0: "setdist {0} T > 0"
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4184 | using less_eq_real_def by fastforce | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4185 |         then have "a * setdist {0} T \<le> r"
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4186 | by (smt (verit, ccfv_SIG) \<open>0 \<le> a\<close> \<open>a *\<^sub>R b \<in> K\<close> \<open>b \<in> T\<close> dist_0_norm mult_mono' norm_scaleR r setdist_le_dist singletonI) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4187 |         with T0 \<open>r>0\<close> show "a \<le> r / setdist {0} T"
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4188 | by (simp add: divide_simps) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4189 | qed | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4190 | ultimately show "bounded ?L" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4191 | by (meson bounded_subset) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4192 | show "closed ?L" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4193 | proof (rule continuous_closed_preimage) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4194 |         show "continuous_on ({0..} \<times> T) (\<lambda>z. fst z *\<^sub>R snd z)"
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4195 | by (intro continuous_intros) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4196 |         show "closed ({0::real..} \<times> T)"
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4197 | by (simp add: assms(1) closed_Times compact_imp_closed) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4198 | show "closed K" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4199 | by (simp add: compact_imp_closed that(2)) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4200 | qed | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4201 | qed | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4202 | qed | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4203 | show ?thesis | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4204 | unfolding conic_hull_as_image | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4205 | proof (rule proper_map) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4206 |     show  "compact ({0..} \<times> T \<inter> (\<lambda>z. fst z *\<^sub>R snd z) -` K)" (is "compact ?L")
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4207 |       if "K \<subseteq> (\<lambda>z. (fst z) *\<^sub>R snd z) ` ({0..} \<times> S)" "compact K" for K
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4208 | proof - | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4209 | obtain r where "r > 0" and r: "\<And>x. x \<in> K \<Longrightarrow> norm x \<le> r" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4210 | by (metis \<open>compact K\<close> bounded_normE compact_imp_bounded) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4211 | show ?thesis | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4212 | unfolding compact_eq_bounded_closed | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4213 | proof | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4214 |         have "bounded ({0..r / setdist{0}T} \<times> T)"
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4215 | by (simp add: assms(1) bounded_Times compact_imp_bounded) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4216 |         moreover have "?L \<subseteq> ({0..r / setdist{0}T} \<times> T)"
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4217 | proof clarsimp | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4218 | fix a b | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4219 | assume "a *\<^sub>R b \<in> K" and "b \<in> T" and "0 \<le> a" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4220 |           have "setdist {0} T \<noteq> 0"
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4221 | using \<open>b \<in> T\<close> assms compact_imp_closed setdist_eq_0_closed by auto | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4222 |           then have T0: "setdist {0} T > 0"
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4223 | using less_eq_real_def by fastforce | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4224 |           then have "a * setdist {0} T \<le> r"
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4225 | by (smt (verit, ccfv_SIG) \<open>0 \<le> a\<close> \<open>a *\<^sub>R b \<in> K\<close> \<open>b \<in> T\<close> dist_0_norm mult_mono' norm_scaleR r setdist_le_dist singletonI) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4226 |           with T0 \<open>r>0\<close> show "a \<le> r / setdist {0} T"
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4227 | by (simp add: divide_simps) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4228 | qed | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4229 | ultimately show "bounded ?L" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4230 | by (meson bounded_subset) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4231 | show "closed ?L" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4232 | proof (rule continuous_closed_preimage) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4233 |           show "continuous_on ({0..} \<times> T) (\<lambda>z. fst z *\<^sub>R snd z)"
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4234 | by (intro continuous_intros) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4235 |           show "closed ({0::real..} \<times> T)"
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4236 | by (simp add: assms(1) closed_Times compact_imp_closed) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4237 | show "closed K" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4238 | by (simp add: compact_imp_closed that(2)) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4239 | qed | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4240 | qed | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4241 | qed | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4242 |     show "(\<lambda>z. fst z *\<^sub>R snd z) ` ({0::real..} \<times> T) \<subseteq> (\<lambda>z. fst z *\<^sub>R snd z) ` ({0..} \<times> S)"
 | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4243 | using \<open>T \<subseteq> S\<close> by force | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4244 | qed auto | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4245 | qed | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4246 | |
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4247 | lemma closed_conic_hull: | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4248 | fixes S :: "'a::euclidean_space set" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4249 | assumes "0 \<in> rel_interior S \<or> compact S \<and> 0 \<notin> S" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4250 | shows "closed(conic hull S)" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4251 | using assms | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4252 | proof | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4253 | assume "0 \<in> rel_interior S" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4254 | then show "closed (conic hull S)" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4255 | by (simp add: conic_hull_eq_span) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4256 | next | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4257 | assume "compact S \<and> 0 \<notin> S" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4258 | then have "closedin (top_of_set UNIV) (conic hull S)" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4259 | using closedin_conic_hull by force | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4260 | then show "closed (conic hull S)" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4261 | by simp | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4262 | qed | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4263 | |
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4264 | lemma conic_closure: | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4265 | fixes S :: "'a::euclidean_space set" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4266 | shows "conic S \<Longrightarrow> conic(closure S)" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4267 | by (meson Convex.cone_def cone_closure conic_def) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4268 | |
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4269 | lemma closure_conic_hull: | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4270 | fixes S :: "'a::euclidean_space set" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4271 | assumes "0 \<in> rel_interior S \<or> bounded S \<and> ~(0 \<in> closure S)" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4272 | shows "closure(conic hull S) = conic hull (closure S)" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4273 | using assms | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4274 | proof | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4275 | assume "0 \<in> rel_interior S" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4276 | then show "closure (conic hull S) = conic hull closure S" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4277 | by (metis closed_affine_hull closure_closed closure_same_affine_hull closure_subset conic_hull_eq_affine_hull subsetD subset_rel_interior) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4278 | next | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4279 | have "\<And>x. x \<in> conic hull closure S \<Longrightarrow> x \<in> closure (conic hull S)" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4280 | by (metis (no_types, opaque_lifting) closure_mono conic_closure conic_conic_hull subset_eq subset_hull) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4281 | moreover | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4282 | assume "bounded S \<and> 0 \<notin> closure S" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4283 | then have "\<And>x. x \<in> closure (conic hull S) \<Longrightarrow> x \<in> conic hull closure S" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4284 | by (metis closed_conic_hull closure_Un_frontier closure_closed closure_mono compact_closure hull_Un_subset le_sup_iff subsetD) | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4285 | ultimately show "closure (conic hull S) = conic hull closure S" | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4286 | by blast | 
| 
4da1e18a9633
Loads of new material related to porting the Euler Polyhedron Formula from HOL Light
 paulson <lp15@cam.ac.uk> parents: 
78248diff
changeset | 4287 | qed | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4288 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4289 | 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 | 4290 | 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 | 4291 | 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 | 4292 | 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 | 4293 | (is "?lhs = ?rhs") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4294 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4295 | 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 | 4296 | 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 | 4297 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4298 | assume RHS: ?rhs | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4299 | 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 | 4300 | 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 | 4301 | 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 | 4302 | using that by fastforce | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4303 | 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 | 4304 | 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 | 4305 | proof - | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66793diff
changeset | 4306 | 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 | 4307 | 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 | 4308 | 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 | 4309 | 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 | 4310 | ultimately show ?thesis | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4311 | using C by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4312 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4313 | show ?lhs | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4314 | 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 | 4315 | 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 | 4316 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4317 | |
| 70136 | 4318 | 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 | 4319 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4320 | lemma convex_connected_collinear: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4321 | 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 | 4322 | assumes "collinear S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4323 | 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 | 4324 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4325 | assume "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4326 | then show "connected S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4327 | 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 | 4328 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4329 | assume S: "connected S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4330 | show "convex S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4331 |   proof (cases "S = {}")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4332 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4333 | 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 | 4334 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4335 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4336 | 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 | 4337 | 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 | 4338 | 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 | 4339 | 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 | 4340 | 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 | 4341 | 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 | 4342 | by metis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4343 | 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 | 4344 | 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 | 4345 | 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 | 4346 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4347 | 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 | 4348 | 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 | 4349 | 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 | 4350 | 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 | 4351 | ultimately show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4352 | 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 | 4353 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4354 | have cont_f: "continuous_on (affine hull S) f" | 
| 72567 | 4355 | proof (clarsimp simp: dist_norm continuous_on_iff diff) | 
| 4356 | 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" | |
| 79566 | 4357 | by (metis \<open>z \<noteq> 0\<close> mult_pos_pos mult_less_cancel_right_pos zero_less_norm_iff) | 
| 72567 | 4358 | qed | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4359 | 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 | 4360 | 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 | 4361 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4362 | 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 | 4363 | fix x y z | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4364 | 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 | 4365 | 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 | 4366 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4367 | have "f ` (closed_segment x y) = closed_segment (f x) (f y)" | 
| 72238 | 4368 | proof (rule continuous_injective_image_segment_1) | 
| 4369 | show "continuous_on (closed_segment x y) f" | |
| 4370 | 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]) | |
| 4371 | show "inj_on f (closed_segment x y)" | |
| 4372 | 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]) | |
| 4373 | qed | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4374 | 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 | 4375 | 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 | 4376 | 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 | 4377 | 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 | 4378 | 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 | 4379 | 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 | 4380 |         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 | 4381 | proof - | 
| 72567 | 4382 | consider "f x \<le> f z \<and> f z \<le> f y" | "f y \<le> f z \<and> f z \<le> f x" | 
| 4383 | using fz | |
| 4384 | by (auto simp add: closed_segment_eq_real_ivl split: if_split_asm) | |
| 4385 |           then have "{..<f z} \<inter> f ` {x,y} \<noteq> {} \<and> {f z<..} \<inter> f ` {x,y} \<noteq> {}"
 | |
| 4386 | 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 | 4387 |           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 | 4388 | 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 | 4389 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4390 | ultimately show False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4391 |           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 | 4392 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4393 | 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 | 4394 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4395 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4396 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4397 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4398 | 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 | 4399 | 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 | 4400 |   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 | 4401 | 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 | 4402 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4403 |   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 | 4404 | 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 | 4405 | 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 | 4406 | 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 | 4407 | 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 | 4408 | 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 | 4409 | by metis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4410 | 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 | 4411 | 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 | 4412 | 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 | 4413 | 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 | 4414 | by (metis inj_onI) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4415 | 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 | 4416 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4417 | 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 | 4418 | 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 | 4419 | 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 | 4420 | 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 | 4421 | ultimately show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4422 | 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 | 4423 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4424 | have cont_f: "continuous_on (affine hull S) f" | 
| 72567 | 4425 | proof (clarsimp simp: dist_norm continuous_on_iff diff) | 
| 4426 | 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" | |
| 79566 | 4427 | by (metis \<open>z \<noteq> 0\<close> mult_pos_pos mult_less_cancel_right_pos zero_less_norm_iff) | 
| 72567 | 4428 | qed | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4429 | 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 | 4430 | 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 | 4431 | 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 | 4432 | 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 | 4433 |   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 | 4434 | 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 | 4435 | 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 | 4436 |     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 | 4437 | 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 | 4438 | 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 | 4439 | have "f ` (closed_segment a b) = closed_segment (f a) (f b)" | 
| 72238 | 4440 | proof (rule continuous_injective_image_segment_1) | 
| 4441 | show "continuous_on (closed_segment a b) f" | |
| 4442 | 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]) | |
| 4443 | show "inj_on f (closed_segment a b)" | |
| 4444 | 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]) | |
| 4445 | qed | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4446 | 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 | 4447 | 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 | 4448 | 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 | 4449 | by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4450 | moreover have "(\<lambda>x. f x *\<^sub>R z + \<xi>) ` closed_segment a b = closed_segment a b" | 
| 72567 | 4451 | unfolding image_def using \<open>a \<in> S\<close> \<open>b \<in> S\<close> | 
| 4452 | 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 | 4453 | 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 | 4454 | 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 | 4455 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4456 | using that by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4457 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4458 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4459 | 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 | 4460 | 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 | 4461 |   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 | 4462 | 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 | 4463 | 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 | 4464 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4465 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4466 | 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 | 4467 | fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" | 
| 78248 
740b23f1138a
EXPERIMENTAL replacement of f ` A <= B by f : A -> B in Analysis
 paulson <lp15@cam.ac.uk> parents: 
78037diff
changeset | 4468 | assumes contf: "continuous_on S f" and imf: "f \<in> S \<rightarrow> T" and "compact S" | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 4469 | "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 | 4470 | 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 | 4471 | 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 | 4472 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4473 | lemma proper_map_fst: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4474 | 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 | 4475 | 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 | 4476 | proof - | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66793diff
changeset | 4477 | 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 | 4478 | using assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4479 | 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 | 4480 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4481 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4482 | lemma closed_map_fst: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4483 | 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 | 4484 | 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 | 4485 | 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 | 4486 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4487 | 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 | 4488 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4489 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4490 | 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 | 4491 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4492 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4493 | lemma proper_map_snd: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4494 | 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 | 4495 | 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 | 4496 | proof - | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66793diff
changeset | 4497 | 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 | 4498 | using assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4499 | 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 | 4500 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4501 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4502 | lemma closed_map_snd: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4503 | 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 | 4504 | 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 | 4505 | 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 | 4506 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4507 | 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 | 4508 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4509 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4510 | 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 | 4511 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4512 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4513 | lemma closedin_compact_projection: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4514 | 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 | 4515 | 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 | 4516 |     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 | 4517 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4518 | 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 | 4519 | 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 | 4520 |   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 | 4521 | by force | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 4522 | 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 | 4523 | 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 | 4524 | ultimately show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4525 | by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4526 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4527 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4528 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4529 | lemma closed_compact_projection: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4530 | 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 | 4531 |     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 | 4532 | 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 | 4533 |     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 | 4534 | proof - | 
| 72238 | 4535 |   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 | 4536 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4537 | show ?thesis | 
| 72238 | 4538 | unfolding * | 
| 4539 | 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 | 4540 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4541 | |
| 70136 | 4542 | subsubsection\<^marker>\<open>tag unimportant\<close>\<open>Representing affine hull as a finite intersection of hyperplanes\<close> | 
| 4543 | ||
| 4544 | 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 | 4545 | 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 | 4546 |   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 | 4547 | 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 | 4548 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4549 | 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 | 4550 | 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 | 4551 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4552 | 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 | 4553 | 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 | 4554 | 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 | 4555 | using mem_interior_cball by blast | 
| 67399 | 4556 | 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 | 4557 | proof (cases "x = a") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4558 | 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 | 4559 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4560 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4561 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4562 | 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 | 4563 | 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 | 4564 | 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 | 4565 | 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 | 4566 | by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4567 | 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 | 4568 | 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 | 4569 | 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 | 4570 | using \<open>0 < k\<close> False | 
| 
160eaf566bcb
formally augmented corresponding rules for field_simps
 haftmann parents: 
70620diff
changeset | 4571 | 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 | 4572 | 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 | 4573 | using e by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4574 | 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 | 4575 | 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 | 4576 | 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 | 4577 | have "inverse k *\<^sub>R k *\<^sub>R (x-a) \<in> span ((\<lambda>x. x - a) ` (S \<inter> T))" | 
| 72238 | 4578 | 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 | 4579 | 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 | 4580 | qed | 
| 72238 | 4581 | have "S \<subseteq> affine hull (S \<inter> T)" | 
| 4582 | by (force simp: * \<open>a \<in> S\<close> \<open>a \<in> T\<close> hull_inc affine_hull_span_gen [of a]) | |
| 4583 | then show "affine hull S \<subseteq> affine hull (S \<inter> T)" | |
| 4584 | 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 | 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 | 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 | 4588 | 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 | 4589 |   assumes "convex S" "open T" "S \<inter> T \<noteq> {}"
 | 
| 72238 | 4590 | shows "affine hull (S \<inter> T) = affine hull S" | 
| 4591 | 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 | 4592 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4593 | 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 | 4594 | 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 | 4595 |   assumes "affine S" "S \<inter> interior T \<noteq> {}"
 | 
| 72238 | 4596 | shows "affine hull (S \<inter> T) = affine hull S" | 
| 4597 | 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 | 4598 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4599 | 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 | 4600 | 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 | 4601 |   assumes "affine S" "open T" "S \<inter> T \<noteq> {}"
 | 
| 72238 | 4602 | shows "affine hull (S \<inter> T) = affine hull S" | 
| 4603 | 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 | 4604 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4605 | 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 | 4606 | 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 | 4607 |   assumes "convex S" "openin (top_of_set (affine hull S)) T" "S \<inter> T \<noteq> {}"
 | 
| 72238 | 4608 | shows "affine hull (S \<inter> T) = affine hull S" | 
| 4609 | using assms unfolding openin_open | |
| 4610 | 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 | 4611 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4612 | corollary affine_hull_openin: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4613 | 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 | 4614 |   assumes "openin (top_of_set (affine hull T)) S" "S \<noteq> {}"
 | 
| 72238 | 4615 | shows "affine hull S = affine hull T" | 
| 4616 | using assms unfolding openin_open | |
| 4617 | 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 | 4618 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4619 | corollary affine_hull_open: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4620 | 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 | 4621 |   assumes "open S" "S \<noteq> {}"
 | 
| 72238 | 4622 | shows "affine hull S = UNIV" | 
| 4623 | 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 | 4624 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4625 | 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 | 4626 | 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 | 4627 |   shows "\<lbrakk>convex S; S \<inter> interior T \<noteq> {}\<rbrakk> \<Longrightarrow> aff_dim(S \<inter> T) = aff_dim S"
 | 
| 72238 | 4628 | 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 | 4629 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4630 | 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 | 4631 | 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 | 4632 |   shows "\<lbrakk>convex S; open T; S \<inter> T \<noteq> {}\<rbrakk> \<Longrightarrow>  aff_dim(S \<inter> T) = aff_dim S"
 | 
| 72238 | 4633 | 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 | 4634 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4635 | lemma affine_hull_Diff: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4636 | 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 | 4637 | assumes ope: "openin (top_of_set (affine hull S)) S" and "finite F" "F \<subset> S" | 
| 72238 | 4638 | 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 | 4639 | proof - | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 4640 | 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 | 4641 | 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 | 4642 |   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 | 4643 | using assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4644 | ultimately show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4645 | 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 | 4646 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4647 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4648 | 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 | 4649 | 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 | 4650 |   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 | 4651 | 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 | 4652 | 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 | 4653 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4654 | 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 | 4655 | 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 | 4656 |   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 | 4657 | proof (cases "a = 0") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4658 | 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 | 4659 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4660 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4661 |   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 | 4662 | 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 | 4663 |   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 | 4664 | 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 | 4665 | 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 | 4666 | 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 | 4667 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4668 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4669 | 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 | 4670 | 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 | 4671 |   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 | 4672 | 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 | 4673 | 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 | 4674 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4675 | 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 | 4676 | 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 | 4677 |   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 | 4678 | 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 | 4679 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4680 | 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 | 4681 | 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 | 4682 |   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 | 4683 |         (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 | 4684 | 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 | 4685 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4686 | 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 | 4687 | 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 | 4688 |   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 | 4689 |         (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 | 4690 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4691 |   have "int (DIM('a)) = aff_dim (UNIV::'a set)"
 | 
| 71176 | 4692 | by (simp) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4693 |   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 | 4694 | 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 | 4695 | then show ?thesis | 
| 71176 | 4696 | by (force) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4697 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4698 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4699 | 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 | 4700 | 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 | 4701 |   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 | 4702 |         (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 | 4703 | 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 | 4704 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4705 | 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 | 4706 | 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 | 4707 |   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 | 4708 |         (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 | 4709 | 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 | 4710 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4711 | 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 | 4712 | 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 | 4713 |   shows "aff_dim S = DIM('a) - 1 \<longleftrightarrow> (\<exists>a b. a \<noteq> 0 \<and> affine hull S = {x. a \<bullet> x = b})"
 | 
| 72567 | 4714 | (is "?lhs = ?rhs") | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4715 | proof (cases "S = {}")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4716 | 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 | 4717 | 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 | 4718 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4719 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4720 | 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 | 4721 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4722 | proof (cases "c = 0") | 
| 72567 | 4723 | case True | 
| 4724 |     have "?lhs \<longleftrightarrow> (\<exists>a. a \<noteq> 0 \<and> span ((\<lambda>x. x - c) ` S) = {x. a \<bullet> x = 0})"
 | |
| 4725 | by (simp add: aff_dim_eq_dim [of c] \<open>c \<in> S\<close> hull_inc dim_eq_hyperplane del: One_nat_def) | |
| 4726 | also have "... \<longleftrightarrow> ?rhs" | |
| 4727 | using span_zero [of S] True \<open>c \<in> S\<close> affine_hull_span_0 hull_inc | |
| 4728 | by (fastforce simp add: affine_hull_span_gen [of c] \<open>c = 0\<close>) | |
| 4729 | finally show ?thesis . | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4730 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4731 | case False | 
| 67399 | 4732 |     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 | 4733 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4734 | 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 | 4735 | by (metis that add.commute diff_add_cancel inner_commute inner_diff_left right_minus_eq) | 
| 67399 | 4736 |       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 | 4737 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4738 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4739 |     have 2: "span ((\<lambda>x. x - c) ` S) = {x. a \<bullet> x = 0}"
 | 
| 67399 | 4740 |          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 | 4741 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4742 | 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 | 4743 | using span_0 that by fastforce | 
| 67399 | 4744 |       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 | 4745 | by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4746 |       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 | 4747 | 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 | 4748 |       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 | 4749 | 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 | 4750 | 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 | 4751 | finally show ?thesis . | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4752 | qed | 
| 72567 | 4753 |     have "?lhs = (\<exists>a. a \<noteq> 0 \<and> span ((\<lambda>x. x - c) ` S) = {x. a \<bullet> x = 0})"
 | 
| 4754 | by (simp add: aff_dim_eq_dim [of c] \<open>c \<in> S\<close> hull_inc dim_eq_hyperplane del: One_nat_def) | |
| 4755 | also have "... = ?rhs" | |
| 4756 | by (fastforce simp add: affine_hull_span_gen [of c] \<open>c \<in> S\<close> hull_inc inner_distrib intro: xc_im intro!: 2) | |
| 4757 | finally show ?thesis . | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4758 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4759 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4760 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4761 | 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 | 4762 | 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 | 4763 |   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 | 4764 | 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 | 4765 | |
| 70136 | 4766 | 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 | 4767 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4768 | lemma aff_dim_insert: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4769 | 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 | 4770 | 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 | 4771 | proof (cases "S = {}")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4772 | 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 | 4773 | by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4774 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4775 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4776 | 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 | 4777 | 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 | 4778 | show ?thesis using S | 
| 72238 | 4779 | 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 | 4780 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4781 | |
| 66297 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4782 | lemma affine_dependent_choose: | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4783 | fixes a :: "'a :: euclidean_space" | 
| 69508 | 4784 | assumes "\<not>(affine_dependent S)" | 
| 66297 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4785 | 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 | 4786 | (is "?lhs = ?rhs") | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4787 | proof safe | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4788 | assume "affine_dependent (insert a S)" and "a \<in> S" | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4789 | then show "False" | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4790 | using \<open>a \<in> S\<close> assms insert_absorb by fastforce | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4791 | next | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4792 | assume lhs: "affine_dependent (insert a S)" | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4793 | then have "a \<notin> S" | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4794 | by (metis (no_types) assms insert_absorb) | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4795 | moreover have "finite S" | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4796 | using affine_independent_iff_card assms by blast | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4797 | moreover have "aff_dim (insert a S) \<noteq> int (card S)" | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4798 | 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 | 4799 | ultimately show "a \<in> affine hull S" | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4800 | by (metis aff_dim_affine_independent aff_dim_insert assms) | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4801 | next | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4802 | assume "a \<notin> S" and "a \<in> affine hull S" | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4803 | show "affine_dependent (insert a S)" | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4804 | 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 | 4805 | qed | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4806 | |
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4807 | lemma affine_independent_insert: | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4808 | fixes a :: "'a :: euclidean_space" | 
| 69508 | 4809 | 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 | 4810 | by (simp add: affine_dependent_choose) | 
| 
d425bdf419f5
polytopes: simplical subdivisions, etc.
 paulson <lp15@cam.ac.uk> parents: 
66289diff
changeset | 4811 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4812 | 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 | 4813 | 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 | 4814 | assumes "subspace S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4815 |     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 | 4816 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4817 | 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 | 4818 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4819 | 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 | 4820 | 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 | 4821 | 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 | 4822 | 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 | 4823 | 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 | 4824 | 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 | 4825 | 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 | 4826 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4827 |   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 | 4828 | 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 | 4829 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4830 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4831 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4832 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4833 | 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 | 4834 | 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 | 4835 | assumes "affine S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4836 |     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 | 4837 | proof (cases "S = {}")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4838 | 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 | 4839 | by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4840 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4841 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4842 | then obtain b where "b \<in> S" by blast | 
| 72238 | 4843 | with False assms | 
| 4844 |   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 | 4845 | using affine_diffs_subspace [OF assms \<open>b \<in> S\<close>] | 
| 72238 | 4846 | by (metis (no_types, lifting) ab_group_add_class.ab_left_minus bounded_translation image_empty image_insert subspace_bounded_eq_trivial translation_invert) | 
| 4847 | 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 | 4848 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4849 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4850 | 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 | 4851 | 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 | 4852 | assumes "affine S" | 
| 72238 | 4853 | shows "bounded S \<longleftrightarrow> aff_dim S \<le> 0" | 
| 4854 | proof | |
| 4855 | show "aff_dim S \<le> 0 \<Longrightarrow> bounded S" | |
| 4856 | 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) | |
| 4857 | 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 | 4858 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4859 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4860 | 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 | 4861 | 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 | 4862 | assumes "a \<noteq> 0" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4863 |   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 | 4864 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4865 |   assume "bounded {x. a \<bullet> x = 0}"
 | 
| 80175 
200107cdd3ac
Some new simprules – and patches for proofs
 paulson <lp15@cam.ac.uk> parents: 
79583diff
changeset | 4866 |   then have 0: "aff_dim {x. a \<bullet> x = 0} \<le> 0"
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4867 | by (simp add: affine_bounded_eq_lowdim affine_hyperplane) | 
| 80175 
200107cdd3ac
Some new simprules – and patches for proofs
 paulson <lp15@cam.ac.uk> parents: 
79583diff
changeset | 4868 | with assms 0 | 
| 
200107cdd3ac
Some new simprules – and patches for proofs
 paulson <lp15@cam.ac.uk> parents: 
79583diff
changeset | 4869 |   have "int DIM('a) = 1"
 | 
| 
200107cdd3ac
Some new simprules – and patches for proofs
 paulson <lp15@cam.ac.uk> parents: 
79583diff
changeset | 4870 | using order_neq_le_trans by fastforce | 
| 
200107cdd3ac
Some new simprules – and patches for proofs
 paulson <lp15@cam.ac.uk> parents: 
79583diff
changeset | 4871 |   then show "DIM('a) = 1" by auto
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4872 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4873 |   assume "DIM('a) = 1"
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4874 |   then show "bounded {x. a \<bullet> x = 0}"
 | 
| 71176 | 4875 | 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 | 4876 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4877 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4878 | 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 | 4879 | 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 | 4880 |   shows "bounded {x. a \<bullet> x = r} \<longleftrightarrow> (if a = 0 then r \<noteq> 0 else DIM('a) = 1)"
 | 
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 4881 | proof - | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 4882 |   { assume "r \<noteq> 0" "a \<noteq> 0"
 | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 4883 |     have "aff_dim {x. y \<bullet> x = 0} = aff_dim {x. a \<bullet> x = r}" if "y \<noteq> 0" for y::'a
 | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 4884 | by (metis that \<open>a \<noteq> 0\<close> aff_dim_hyperplane) | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 4885 |     then have "bounded {x. a \<bullet> x = r} = (DIM('a) = Suc 0)"
 | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 4886 | by (metis One_nat_def \<open>a \<noteq> 0\<close> affine_bounded_eq_lowdim affine_hyperplane bounded_hyperplane_eq_trivial_0) | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 4887 | } | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 4888 | then show ?thesis | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 4889 | by (auto simp: bounded_hyperplane_eq_trivial_0) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4890 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4891 | |
| 70136 | 4892 | subsection\<^marker>\<open>tag unimportant\<close>\<open>General case without assuming closure and getting non-strict separation\<close> | 
| 4893 | ||
| 4894 | 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 | 4895 | 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 | 4896 |   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 | 4897 | 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 | 4898 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4899 | 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 | 4900 | 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 | 4901 | 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 | 4902 | 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 | 4903 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4904 | 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 | 4905 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4906 | assume "x \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4907 | 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 | 4908 | 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 | 4909 |     { 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 | 4910 | 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 | 4911 | have False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4912 | 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 | 4913 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4914 | 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 | 4915 | 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 | 4916 | 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 | 4917 | 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 | 4918 | 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 | 4919 | 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 | 4920 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4921 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4922 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4923 | 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 | 4924 | 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 | 4925 |   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 | 4926 | obtains a b where "a \<in> S" "a \<noteq> 0" "0 < b" "\<And>x. x \<in> S \<Longrightarrow> a \<bullet> x > b" | 
| 72238 | 4927 | 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 | 4928 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4929 | |
| 70136 | 4930 | 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 | 4931 | 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 | 4932 |   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 | 4933 | 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 | 4934 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4935 |   define k where [abs_def]: "k c = {x. 0 \<le> c \<bullet> x}" for c :: 'a
 | 
| 72238 | 4936 |   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 | 4937 | 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 | 4938 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4939 | 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 | 4940 | 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 | 4941 | 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 | 4942 |       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 | 4943 | 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 | 4944 | by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4945 | 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 | 4946 | 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 | 4947 | 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 | 4948 | by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4949 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4950 |     proof (cases "C = {}")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4951 | 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 | 4952 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4953 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4954 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4955 | 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 | 4956 | 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 | 4957 |       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 | 4958 | by (simp add: False) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4959 | 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 | 4960 | 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 | 4961 | ultimately obtain a b | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4962 | 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 | 4963 | 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 | 4964 | 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 | 4965 | 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 | 4966 | 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 | 4967 | 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 | 4968 | 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 | 4969 | 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 | 4970 | 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 | 4971 | 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 | 4972 | by simp | 
| 72238 | 4973 | have "\<And>x. \<lbrakk>a \<noteq> 0; x \<in> C\<rbrakk> \<Longrightarrow> 0 \<le> x \<bullet> a" | 
| 4974 | using ab \<open>0 < b\<close> by (metis hull_inc inner_commute less_eq_real_def less_trans) | |
| 4975 |       then have aa: "a /\<^sub>R (norm a) \<in> (\<Inter>c\<in>C. {x. 0 \<le> c \<bullet> x})"
 | |
| 4976 | 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 | 4977 | show ?thesis | 
| 72238 | 4978 | unfolding C k_def | 
| 4979 | 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 | 4980 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4981 | qed | 
| 72238 | 4982 | moreover have "\<And>T. T \<in> k ` S \<Longrightarrow> closed T" | 
| 4983 | using closed_halfspace_ge k_def by blast | |
| 4984 |   ultimately have "(span S \<inter> frontier(cball 0 1)) \<inter> (\<Inter> (k ` S)) \<noteq> {}"
 | |
| 4985 | 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 | 4986 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4987 | 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 | 4988 | 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 | 4989 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4990 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4991 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4992 | 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 | 4993 | 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 | 4994 |   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 | 4995 | 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 | 4996 | 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 | 4997 | 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 | 4998 | proof - | 
| 69661 | 4999 | from separating_hyperplane_set_0_inspan [of "image (\<lambda>x. -z + x) S"] | 
| 67399 | 5000 | have "convex ((+) (- z) ` S)" | 
| 69661 | 5001 | using \<open>convex S\<close> by simp | 
| 67399 | 5002 |   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 | 5003 |     by (simp add: \<open>S \<noteq> {}\<close>)
 | 
| 67399 | 5004 | 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 | 5005 | using zno by auto | 
| 67399 | 5006 | ultimately obtain a where "a \<in> span ((+) (- z) ` S)" "a \<noteq> 0" | 
| 5007 | 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 | 5008 | 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 | 5009 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5010 | 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 | 5011 | 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 | 5012 | moreover | 
| 5013 | have "z + a \<in> affine hull insert z S" | |
| 5014 | using \<open>a \<in> span ((+) (- z) ` S)\<close> affine_hull_insert_span_gen by blast | |
| 5015 | ultimately show ?thesis | |
| 5016 | 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 | 5017 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5018 | |
| 70136 | 5019 | 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 | 5020 | 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 | 5021 | 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 | 5022 | 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 | 5023 | 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 | 5024 | 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 | 5025 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5026 | 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 | 5027 | 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 | 5028 | 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 | 5029 | 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 | 5030 | 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 | 5031 | 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 | 5032 | proof - | 
| 67399 | 5033 | 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 | 5034 | 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 | 5035 | 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 | 5036 | 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 | 5037 | by fastforce | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5038 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5039 | 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 | 5040 | by fastforce | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5041 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5042 | 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 | 5043 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5044 | 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 | 5045 | 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 | 5046 | 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 | 5047 | 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 | 5048 | 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 | 5049 | 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 | 5050 | unfolding y'_def | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5051 | 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 | 5052 | 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 | 5053 | 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 | 5054 | using e by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5055 | 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 | 5056 | 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 | 5057 | moreover have "a \<bullet> x \<noteq> a \<bullet> y" | 
| 72238 | 5058 | using le_ay [OF \<open>y' \<in> S\<close>] \<open>a \<noteq> 0\<close> \<open>0 < e\<close> not_le | 
| 5059 | 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 | 5060 | 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 | 5061 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5062 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5063 | 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 | 5064 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5065 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5066 | 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 | 5067 | 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 | 5068 | 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 | 5069 | 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 | 5070 | 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 | 5071 | 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 | 5072 | 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 | 5073 | 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 | 5074 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5075 | |
| 70136 | 5076 | 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 | 5077 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5078 | lemma | 
| 72567 | 5079 | fixes S :: "'a::euclidean_space set" | 
| 5080 | assumes "\<not> affine_dependent(S \<union> T)" | |
| 5081 | shows convex_hull_Int_subset: "convex hull S \<inter> convex hull T \<subseteq> convex hull (S \<inter> T)" (is ?C) | |
| 5082 | 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 | 5083 | proof - | 
| 72567 | 5084 | 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 | 5085 | using aff_independent_finite assms by blast+ | 
| 72567 | 5086 | have "sum u (S \<inter> T) = 1 \<and> | 
| 5087 | (\<Sum>v\<in>S \<inter> T. u v *\<^sub>R v) = (\<Sum>v\<in>S. u v *\<^sub>R v)" | |
| 5088 | if [simp]: "sum u S = 1" | |
| 5089 | "sum v T = 1" | |
| 5090 | 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 | 5091 | proof - | 
| 72567 | 5092 | 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 | 
| 5093 | have "sum f (S \<union> T) = 0" | |
| 5094 | by (simp add: f_def sum_Un sum_subtractf flip: sum.inter_restrict) | |
| 5095 | moreover have "(\<Sum>x\<in>(S \<union> T). f x *\<^sub>R x) = 0" | |
| 5096 | by (simp add: eq f_def sum_Un scaleR_left_diff_distrib sum_subtractf if_smult flip: sum.inter_restrict cong: if_cong) | |
| 5097 | ultimately have "\<And>v. v \<in> S \<union> T \<Longrightarrow> f v = 0" | |
| 5098 | using aff_independent_finite assms unfolding affine_dependent_explicit | |
| 5099 | by blast | |
| 5100 | then have u [simp]: "\<And>x. x \<in> S \<Longrightarrow> u x = (if x \<in> T then v x else 0)" | |
| 5101 | by (simp add: f_def) presburger | |
| 5102 | have "sum u (S \<inter> T) = sum u S" | |
| 5103 | by (simp add: sum.inter_restrict) | |
| 5104 | then have "sum u (S \<inter> T) = 1" | |
| 5105 | using that by linarith | |
| 5106 | 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 | 5107 | 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 | 5108 | ultimately show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5109 | by force | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5110 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5111 | then show ?A ?C | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5112 | 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 | 5113 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5114 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5115 | |
| 70136 | 5116 | proposition\<^marker>\<open>tag unimportant\<close> affine_hull_Int: | 
| 72567 | 5117 | fixes S :: "'a::euclidean_space set" | 
| 5118 | assumes "\<not> affine_dependent(S \<union> T)" | |
| 5119 | shows "affine hull (S \<inter> T) = affine hull S \<inter> affine hull T" | |
| 72238 | 5120 | 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 | 5121 | |
| 70136 | 5122 | proposition\<^marker>\<open>tag unimportant\<close> convex_hull_Int: | 
| 72567 | 5123 | fixes S :: "'a::euclidean_space set" | 
| 5124 | assumes "\<not> affine_dependent(S \<union> T)" | |
| 5125 | shows "convex hull (S \<inter> T) = convex hull S \<inter> convex hull T" | |
| 72238 | 5126 | 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 | 5127 | |
| 70136 | 5128 | proposition\<^marker>\<open>tag unimportant\<close> | 
| 72567 | 5129 | fixes S :: "'a::euclidean_space set set" | 
| 5130 | assumes "\<not> affine_dependent (\<Union>S)" | |
| 5131 | shows affine_hull_Inter: "affine hull (\<Inter>S) = (\<Inter>T\<in>S. affine hull T)" (is "?A") | |
| 5132 | 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 | 5133 | proof - | 
| 72567 | 5134 | have "finite S" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5135 | 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 | 5136 | then have "?A \<and> ?C" using assms | 
| 72567 | 5137 | 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 | 5138 | 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 | 5139 | next | 
| 72567 | 5140 | 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 | 5141 | then show ?case | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5142 |     proof (cases "F={}")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5143 | 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 | 5144 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5145 | case False | 
| 72567 | 5146 | 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 | 5147 | 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 | 5148 | 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 | 5149 | 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 | 5150 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5151 | 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 | 5152 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5153 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5154 | then show "?A" "?C" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5155 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5156 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5157 | |
| 70136 | 5158 | 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 | 5159 | fixes S :: "'a::euclidean_space set" | 
| 69508 | 5160 | 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 | 5161 | 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 | 5162 | 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 | 5163 | 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 | 5164 | 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 | 5165 | 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 | 5166 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5167 | 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 | 5168 | 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 | 5169 | 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 | 5170 | 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 | 5171 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5172 | by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5173 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5174 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5175 | 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 | 5176 | using assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5177 | have [simp]: "finite S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5178 | 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 | 5179 | 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 | 5180 | 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 | 5181 | 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 | 5182 | 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 | 5183 | 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 | 5184 | 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 | 5185 | 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 | 5186 | 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 | 5187 | 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 | 5188 | 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 | 5189 | 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 | 5190 | 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 | 5191 | with fin anot | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5192 | 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 | 5193 | 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 | 5194 | by simp_all | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5195 | 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 | 5196 | 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 | 5197 | 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 | 5198 | 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 | 5199 | 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 | 5200 | 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 | 5201 | 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 | 5202 | 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 | 5203 | 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 | 5204 | 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 | 5205 | 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 | 5206 | 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 | 5207 | 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 | 5208 | 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 | 5209 | 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 | 5210 | 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 | 5211 | 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 | 5212 | 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 | 5213 | using aeq by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5214 | 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 | 5215 | 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 | 5216 | 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 | 5217 | then have dd0: "dd v = 0" if "v \<in> S" for v | 
| 72238 | 5218 | using naff [unfolded affine_dependent_explicit not_ex, rule_format, of S dd] | 
| 5219 | 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 | 5220 | 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 | 5221 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5222 | proof cases | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5223 | case 1 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5224 | 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 | 5225 | by (simp add: sumSS') | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5226 | 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 | 5227 | 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 | 5228 | 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 | 5229 | 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 | 5230 | 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 | 5231 | by (force simp: cc_def cc'_def split: if_split_asm) | 
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5232 | have ge0: "\<forall>x\<in>T \<inter> T'. 0 \<le> (cc(a := c a)) x" | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5233 | by (simp add: c0 cc_def) | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5234 | have "sum (cc(a := c a)) (insert a (T \<inter> T')) = c a + sum (cc(a := c a)) (T \<inter> T')" | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5235 | by (simp add: anot) | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5236 | also have "... = c a + sum (cc(a := c a)) S" | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5237 | 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) | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5238 | also have "... = c a + (1 - c a)" | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5239 | by (metis \<open>a \<notin> S\<close> fun_upd_other sum.cong sumSS'(1)) | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5240 | finally have 1: "sum (cc(a := c a)) (insert a (T \<inter> T')) = 1" | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5241 | by simp | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5242 | 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)" | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5243 | by (simp add: anot) | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5244 | also have "... = c a *\<^sub>R a + (\<Sum>x \<in> S. (cc(a := c a)) x *\<^sub>R x)" | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5245 | using \<open>T \<subseteq> S\<close> False cc0 by (fastforce intro!: sum.mono_neutral_left split: if_split_asm) | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5246 | also have "... = c a *\<^sub>R a + x - c a *\<^sub>R a" | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5247 | by (simp add: wsumSS \<open>a \<notin> S\<close> if_smult sum_delta_notmem) | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5248 | finally have self: "(\<Sum>x\<in>insert a (T \<inter> T'). (cc(a := c a)) x *\<^sub>R x) = x" | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5249 | by simp | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5250 | show ?thesis | 
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5251 | by (force simp: convex_hull_finite c0 intro!: ge0 1 self exI [where x = "cc(a := c a)"]) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5252 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5253 | case 2 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5254 | 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 | 5255 | by (simp add: sumSS') | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5256 | 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 | 5257 | 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 | 5258 | 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 | 5259 | 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 | 5260 | 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 | 5261 | by (force simp: cc_def cc'_def split: if_split_asm) | 
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5262 | have ge0: "\<forall>x\<in>T \<inter> T'. 0 \<le> (cc'(a := c' a)) x" | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5263 | by (simp add: c'0 cc'_def) | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5264 | have "sum (cc'(a := c' a)) (insert a (T \<inter> T')) = c' a + sum (cc'(a := c' a)) (T \<inter> T')" | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5265 | by (simp add: anot) | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5266 | also have "... = c' a + sum (cc'(a := c' a)) S" | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5267 | using \<open>T \<subseteq> S\<close> False cc0 by (fastforce intro!: sum.mono_neutral_left split: if_split_asm) | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5268 | also have "... = c' a + (1 - c' a)" | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5269 | by (metis \<open>a \<notin> S\<close> fun_upd_other sum.cong sumSS') | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5270 | finally have 1: "sum (cc'(a := c' a)) (insert a (T \<inter> T')) = 1" | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5271 | by simp | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5272 | 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)" | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5273 | by (simp add: anot) | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5274 | also have "... = c' a *\<^sub>R a + (\<Sum>x \<in> S. (cc'(a := c' a)) x *\<^sub>R x)" | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5275 | using \<open>T \<subseteq> S\<close> False cc0 by (fastforce intro!: sum.mono_neutral_left split: if_split_asm) | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5276 | also have "... = c a *\<^sub>R a + x - c a *\<^sub>R a" | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5277 | by (simp add: wsumSS \<open>a \<notin> S\<close> if_smult sum_delta_notmem) | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5278 | finally have self: "(\<Sum>x\<in>insert a (T \<inter> T'). (cc'(a := c' a)) x *\<^sub>R x) = x" | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5279 | by simp | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5280 | show ?thesis | 
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5281 | by (force simp: convex_hull_finite c'0 intro!: ge0 1 self exI [where x = "cc'(a := c' a)"]) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5282 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5283 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5284 | |
| 70136 | 5285 | 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 | 5286 | fixes a :: "'a::euclidean_space" | 
| 69508 | 5287 | 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 | 5288 | shows "(convex hull (insert a T)) \<inter> (convex hull (insert a T')) = | 
| 72238 | 5289 | convex hull (insert a (T \<inter> T'))" (is "?lhs = ?rhs") | 
| 5290 | proof (rule subset_antisym) | |
| 5291 | show "?lhs \<subseteq> ?rhs" | |
| 5292 | using in_convex_hull_exchange_unique assms by blast | |
| 5293 | show "?rhs \<subseteq> ?lhs" | |
| 5294 | by (metis hull_mono inf_le1 inf_le2 insert_inter_insert le_inf_iff) | |
| 5295 | qed | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5296 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5297 | lemma Int_closed_segment: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5298 | fixes b :: "'a::euclidean_space" | 
| 69508 | 5299 |   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 | 5300 |     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 | 5301 | proof (cases "c = a") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5302 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5303 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5304 | 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 | 5305 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5306 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5307 | from assms show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5308 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5309 | 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 | 5310 |     moreover have "\<not> affine_dependent {a, c}"
 | 
| 71176 | 5311 | by (simp) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5312 | ultimately show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5313 |       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 | 5314 | 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 | 5315 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5316 |     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 | 5317 |     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 | 5318 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5319 | 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 | 5320 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5321 | 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 | 5322 | by force | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5323 |       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 | 5324 | 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 | 5325 |       have "collinear {a, b, c}"
 | 
| 72238 | 5326 | 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 | 5327 | with ncoll show False .. | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5328 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5329 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5330 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5331 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5332 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5333 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5334 | lemma affine_hull_finite_intersection_hyperplanes: | 
| 72238 | 5335 | fixes S :: "'a::euclidean_space set" | 
| 5336 | obtains \<F> where | |
| 5337 | "finite \<F>" | |
| 5338 |      "of_nat (card \<F>) + aff_dim S = DIM('a)"
 | |
| 5339 | "affine hull S = \<Inter>\<F>" | |
| 5340 |      "\<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 | 5341 | proof - | 
| 72238 | 5342 | 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 | 5343 | and indb: "\<not> affine_dependent b" | 
| 72238 | 5344 | 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 | 5345 | 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 | 5346 | 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 | 5347 | 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 | 5348 | 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 | 5349 | then have "finite c" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5350 | 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 | 5351 | 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 | 5352 | 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 | 5353 |   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 | 5354 | by blast | 
| 72238 | 5355 |   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 | 5356 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5357 | 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 | 5358 | by (metis aff_dim_affine_hull affc) | 
| 72238 | 5359 | 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 | 5360 | by (metis (no_types) aff_dim_affine_hull eq) | 
| 72238 | 5361 | 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 | 5362 | 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 | 5363 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5364 | using fbc aff | 
| 71176 | 5365 | 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 | 5366 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5367 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5368 | proof (cases "c = b") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5369 | case True show ?thesis | 
| 72238 | 5370 | proof | 
| 5371 |       show "int (card {}) + aff_dim S = int DIM('a)"
 | |
| 5372 | using True card_cb by auto | |
| 5373 |       show "affine hull S = \<Inter> {}"
 | |
| 5374 | using True affc eq by blast | |
| 5375 | qed auto | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5376 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5377 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5378 |     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 | 5379 | by (rule affine_independent_subset [OF indc]) auto | 
| 72238 | 5380 |     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 | 5381 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5382 | 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 | 5383 | using t by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5384 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5385 | 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 | 5386 | qed | 
| 72238 | 5387 |     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 | 5388 | show ?thesis | 
| 72238 | 5389 | proof | 
| 5390 |       have "card ((\<lambda>a. affine hull (c - {a})) ` (c - b)) = card (c - b)"
 | |
| 72567 | 5391 | proof (rule card_image) | 
| 5392 |         show "inj_on (\<lambda>a. affine hull (c - {a})) (c - b)"
 | |
| 5393 | unfolding inj_on_def | |
| 5394 | by (metis Diff_eq_empty_iff Diff_iff indc affine_dependent_def hull_subset insert_iff) | |
| 5395 | qed | |
| 72238 | 5396 |       then show "int (card ?\<F>) + aff_dim S = int DIM('a)"
 | 
| 5397 | by (simp add: imeq card_cb) | |
| 5398 | show "affine hull S = \<Inter> ?\<F>" | |
| 72567 | 5399 | 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]) | 
| 5400 |       have "\<And>a. \<lbrakk>a \<in> c; a \<notin> b\<rbrakk> \<Longrightarrow> aff_dim (c - {a}) = int (DIM('a) - Suc 0)"
 | |
| 5401 | by (metis "*" DIM_ge_Suc0 One_nat_def add_diff_cancel_left' int_ops(2) of_nat_diff) | |
| 5402 |       then show "\<And>h. h \<in> ?\<F> \<Longrightarrow> \<exists>a b. a \<noteq> 0 \<and> h = {x. a \<bullet> x = b}"
 | |
| 5403 | by (auto simp only: One_nat_def aff_dim_eq_hyperplane [symmetric]) | |
| 72238 | 5404 | 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 | 5405 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5406 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5407 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5408 | 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 | 5409 | 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 | 5410 | assumes "affine S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5411 | 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 | 5412 | 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 | 5413 |    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 | 5414 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5415 | have "subspace S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5416 | 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 | 5417 |   have span1: "span {y. a \<bullet> y = 0} \<subseteq> span {x + y |x y. x \<in> S \<and> a \<bullet> y = 0}"
 | 
| 72238 | 5418 | 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 | 5419 |   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 | 5420 | 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 | 5421 |   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 | 5422 | 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 | 5423 | 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 | 5424 |   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 | 5425 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5426 | 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 | 5427 |   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 | 5428 | 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 | 5429 |   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 | 5430 | using span1 span2 by (blast intro: dim_psubset) | 
| 72238 | 5431 |   finally have "DIM('a) - 1 < dim {x + y |x y. x \<in> S \<and> a \<bullet> y = 0}" .
 | 
| 5432 |   then have DD: "dim {x + y |x y. x \<in> S \<and> a \<bullet> y = 0} = DIM('a)"
 | |
| 5433 | 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 | 5434 |   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 | 5435 | 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 | 5436 |   moreover have "span {x + y| x y. x \<in> S \<and> a \<bullet> y = 0} = UNIV"
 | 
| 72238 | 5437 | 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 | 5438 | ultimately show ?thesis | 
| 68072 
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
 immler parents: 
67990diff
changeset | 5439 | 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 | 5440 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5441 | |
| 70136 | 5442 | 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 | 5443 | 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 | 5444 | assumes "affine S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5445 |       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 | 5446 |       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 | 5447 |     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 | 5448 | proof (cases "a = 0") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5449 | 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 | 5450 | 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 | 5451 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5452 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5453 | 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 | 5454 | using assms by force | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5455 | with affine_diffs_subspace [OF \<open>affine S\<close>] | 
| 67399 | 5456 | have "subspace ((+) (- c) ` S)" by blast | 
| 5457 | 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 | 5458 | by (simp add: subspace_imp_affine) | 
| 67399 | 5459 | 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 | 5460 | by (simp add: \<open>c \<in> S\<close>) | 
| 67399 | 5461 | 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 | 5462 | using assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5463 | 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 | 5464 | by (simp add: c inner_diff_right) | 
| 72567 | 5465 |   define U where "U \<equiv> {x + y |x y. x \<in> (+) (- c) ` S \<and> a \<bullet> y = 0}"
 | 
| 5466 | have "u + v \<in> (+) (c+c) ` U" | |
| 5467 | if "u \<in> S" "b = a \<bullet> v" for u v | |
| 5468 | proof | |
| 5469 | show "u + v = c + c + (u + v - c - c)" | |
| 5470 | by (simp add: algebra_simps) | |
| 5471 | have "\<exists>x y. u + v - c - c = x + y \<and> (\<exists>xa\<in>S. x = xa - c) \<and> a \<bullet> y = 0" | |
| 5472 | proof (intro exI conjI) | |
| 5473 | show "u + v - c - c = (u-c) + (v-c)" "a \<bullet> (v - c) = 0" | |
| 5474 | by (simp_all add: algebra_simps c that) | |
| 5475 | qed (use that in auto) | |
| 5476 | then show "u + v - c - c \<in> U" | |
| 5477 | by (auto simp: U_def image_def) | |
| 5478 | qed | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5479 | 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 | 5480 | \<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 | 5481 | by (metis add.left_commute c inner_right_distrib pth_d) | 
| 72567 | 5482 |   ultimately have "{x + y |x y. x \<in> S \<and> a \<bullet> y = b} = (+) (c+c) ` U"
 | 
| 5483 | by (fastforce simp: algebra_simps U_def) | |
| 69661 | 5484 | also have "... = range ((+) (c + c))" | 
| 72567 | 5485 | 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 | 5486 | also have "... = UNIV" | 
| 69661 | 5487 | by simp | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5488 | finally show ?thesis . | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5489 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5490 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5491 | 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 | 5492 | assumes "affine S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5493 | and "affine T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5494 | 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 | 5495 |     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 | 5496 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5497 |   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 | 5498 | using assms by force | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5499 |   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 | 5500 | 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 | 5501 | 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 | 5502 | 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 | 5503 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5504 | 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 | 5505 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5506 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5507 | 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 | 5508 | assumes "affine S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5509 | and "affine T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5510 |       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 | 5511 |     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 | 5512 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5513 | obtain a where a: "a \<in> S" "a \<in> T" using assms by force | 
| 67399 | 5514 | have aff: "affine ((+) (-a) ` S)" "affine ((+) (-a) ` T)" | 
| 69661 | 5515 | using affine_translation [symmetric, of "- a"] assms by (simp_all cong: image_cong_simp) | 
| 67399 | 5516 | 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 | 5517 | using a assms by auto | 
| 69661 | 5518 |   have "{x + y |x y. x \<in> (+) (- a) ` S \<and> y \<in> (+) (- a) ` T} =
 | 
| 5519 |       (+) (- 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 | 5520 | by (force simp: algebra_simps scaleR_2) | 
| 69661 | 5521 | 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 | 5522 | by auto | 
| 69661 | 5523 | ultimately show ?thesis | 
| 5524 | using aff_dim_sums_Int_0 [OF aff zero] aff_dim_translation_eq | |
| 5525 | by (metis (lifting)) | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5526 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5527 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5528 | 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 | 5529 | 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 | 5530 | assumes "affine S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5531 |     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 | 5532 |              (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 | 5533 |               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 | 5534 | 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 | 5535 | proof (cases "a = 0") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5536 | 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 | 5537 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5538 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5539 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5540 |   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 | 5541 |             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 | 5542 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5543 |     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 | 5544 | 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 | 5545 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5546 | 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 | 5547 | 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 | 5548 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5549 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5550 | 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 | 5551 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5552 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5553 | 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 | 5554 | 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 | 5555 |   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 | 5556 | 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 | 5557 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5558 | lemma aff_dim_openin: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5559 | 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 | 5560 |   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 | 5561 | 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 | 5562 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5563 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5564 | proof (rule order_antisym) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5565 | 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 | 5566 | 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 | 5567 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5568 | 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 | 5569 |       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 | 5570 | have "S \<subseteq> T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5571 | 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 | 5572 | 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 | 5573 | 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 | 5574 | 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 | 5575 | 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 | 5576 | 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 | 5577 | 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 | 5578 | 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 | 5579 | 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 | 5580 | 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 | 5581 | 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 | 5582 | 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 | 5583 | 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 | 5584 | 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 | 5585 | 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 | 5586 | 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 | 5587 | also have "... = card B" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5588 | by (simp add: cardB) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5589 | 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 | 5590 | 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 | 5591 | also have "... \<le> dim ((\<lambda>x. - a + x) ` S)" | 
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5592 | proof - | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5593 | 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 | 5594 | 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 | 5595 | 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 | 5596 | using Bsub \<open>0 < e\<close> eq1 subT' \<open>a \<in> T\<close> by (auto simp: subspace_def) | 
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5597 | then have "(\<lambda>x. e *\<^sub>R x) ` B \<subseteq> (\<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 | 5598 | using e' by blast | 
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5599 | moreover | 
| 72238 | 5600 | 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 | 5601 | using \<open>0 < e\<close> inj_on_def by fastforce | 
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5602 | then have "independent ((\<lambda>x. e *\<^sub>R x) ` B)" | 
| 72238 | 5603 | using linear_scale_self \<open>independent B\<close> linear_dependent_inj_imageD by blast | 
| 78670 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5604 | ultimately show ?thesis | 
| 
f8595f6d39a5
(pointlessly) get rid of some simp calls within "proof"
 paulson <lp15@cam.ac.uk> parents: 
78656diff
changeset | 5605 | by (auto simp: intro!: independent_card_le_dim) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5606 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5607 | also have "... = aff_dim S" | 
| 69661 | 5608 | 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 | 5609 | 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 | 5610 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5611 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5612 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5613 | lemma dim_openin: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5614 | 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 | 5615 |   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 | 5616 | 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 | 5617 | proof (rule order_antisym) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5618 | 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 | 5619 | 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 | 5620 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5621 | 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 | 5622 | using aff_dim_openin | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5623 |     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 | 5624 | 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 | 5625 | 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 | 5626 | subspace_span) | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5627 | 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 | 5628 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5629 | |
| 67968 | 5630 | 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 | 5631 | |
| 68607 
67bb59e49834
make theorem, corollary, and proposition %important for HOL-Analysis manual
 immler parents: 
68527diff
changeset | 5632 | proposition dense_complement_subspace: | 
| 66641 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5633 | fixes S :: "'a :: euclidean_space set" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5634 | 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 | 5635 | proof - | 
| 66641 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5636 | 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 | 5637 | proof - | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5638 | have "span U \<subset> span S" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5639 | 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 | 5640 | 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 | 5641 | using orthogonal_to_subspace_exists_gen by metis | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5642 | show ?thesis | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5643 | proof | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5644 | have "closed S" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5645 | 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 | 5646 | then show "closure (S - U) \<subseteq> S" | 
| 69286 | 5647 | by (simp add: closure_minimal) | 
| 66641 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5648 | show "S \<subseteq> closure (S - U)" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5649 | proof (clarsimp simp: closure_approachable) | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5650 | fix x and e::real | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5651 | assume "x \<in> S" "0 < e" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5652 | 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 | 5653 | proof (cases "x \<in> U") | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5654 | case True | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5655 | 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 | 5656 | show ?thesis | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5657 | proof | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5658 | show "dist ?y x < e" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5659 | 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 | 5660 | next | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5661 | 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 | 5662 | 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 | 5663 | moreover have "?y \<notin> U" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5664 | proof - | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5665 | have "e/2 / norm a \<noteq> 0" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5666 | 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 | 5667 | then show ?thesis | 
| 68074 | 5668 | 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 | 5669 | qed | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5670 | ultimately show "?y \<in> S - U" by blast | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5671 | qed | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5672 | next | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5673 | case False | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5674 | 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 | 5675 | qed | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5676 | qed | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5677 | qed | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5678 | qed | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5679 | moreover have "S - S \<inter> T = S-T" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5680 | by blast | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5681 | moreover have "dim (S \<inter> T) < dim S" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5682 | 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 | 5683 | ultimately show ?thesis | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5684 | by force | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5685 | qed | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5686 | |
| 70136 | 5687 | 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 | 5688 | fixes S :: "'a :: euclidean_space set" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5689 | 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 | 5690 | proof (cases "S \<inter> T = {}")
 | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5691 | case True | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5692 | then show ?thesis | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5693 | 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 | 5694 | next | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5695 | case False | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5696 | then obtain z where z: "z \<in> S \<inter> T" by blast | 
| 67399 | 5697 | then have "subspace ((+) (- z) ` S)" | 
| 66641 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5698 | by (meson IntD1 affine_diffs_subspace \<open>affine S\<close>) | 
| 67399 | 5699 | moreover have "int (dim ((+) (- z) ` T)) < int (dim ((+) (- z) ` S))" | 
| 69661 | 5700 | thm aff_dim_eq_dim | 
| 5701 | using z less by (simp add: aff_dim_eq_dim_subtract [of z] hull_inc cong: image_cong_simp) | |
| 67399 | 5702 | 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 | 5703 | by (simp add: dense_complement_subspace) | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5704 | then show ?thesis | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5705 | by (metis closure_translation translation_diff translation_invert) | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5706 | qed | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5707 | |
| 70136 | 5708 | 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 | 5709 | fixes S :: "'a :: euclidean_space set" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5710 | 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 | 5711 | 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 | 5712 | shows "closure(S - T) = closure S" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5713 | proof - | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5714 | 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 | 5715 | by blast | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5716 | 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 | 5717 | by (rule closure_openin_Int_closure [OF ope]) | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5718 | then show ?thesis | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5719 | 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 | 5720 | qed | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5721 | |
| 70136 | 5722 | 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 | 5723 | fixes S :: "'a :: euclidean_space set" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5724 | 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 | 5725 | shows "closure(S - T) = closure S" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5726 | proof | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5727 | show "closure (S - T) \<subseteq> closure S" | 
| 69286 | 5728 | by (simp add: closure_mono) | 
| 66641 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5729 | have "closure (rel_interior S - T) = closure (rel_interior S)" | 
| 72238 | 5730 | 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 | 5731 | then show "closure S \<subseteq> closure (S - T)" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5732 | 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 | 5733 | qed | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5734 | |
| 70136 | 5735 | 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 | 5736 | fixes S :: "'a :: euclidean_space set" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5737 | 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 | 5738 | shows "closure(S - T) = S" | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5739 | by (simp add: assms dense_complement_convex) | 
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5740 | |
| 
ff2e0115fea4
Simplicial complexes and triangulations; Baire Category Theorem
 paulson <lp15@cam.ac.uk> parents: 
66297diff
changeset | 5741 | |
| 70136 | 5742 | 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 | 5743 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5744 | 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 | 5745 | 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 | 5746 | |
| 70136 | 5747 | 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 | 5748 | 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 | 5749 | assumes "affine S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5750 |       and "S \<inter> {x. a \<bullet> x \<le> b} \<noteq> {}"
 | 
| 69508 | 5751 |       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 | 5752 | 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 | 5753 |                    "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 | 5754 |                    "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 | 5755 | "\<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 | 5756 | 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 | 5757 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5758 | 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 | 5759 | 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 | 5760 | 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 | 5761 | have "\<eta> \<in> S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5762 | 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 | 5763 | 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 | 5764 | 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 | 5765 | 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 | 5766 | ultimately have False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5767 | using True by force | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5768 | then show ?thesis .. | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5769 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5770 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5771 | 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 | 5772 | using assms by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5773 | with affine_diffs_subspace [OF \<open>affine S\<close>] | 
| 67399 | 5774 | have sub: "subspace ((+) (- z) ` S)" by blast | 
| 5775 | 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 | 5776 | by (auto simp: subspace_imp_affine) | 
| 67399 | 5777 | obtain a' a'' where a': "a' \<in> span ((+) (- z) ` S)" and a: "a = a' + a''" | 
| 5778 | and "\<And>w. w \<in> span ((+) (- z) ` S) \<Longrightarrow> orthogonal a'' w" | |
| 69661 | 5779 | 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 | 5780 | then have "\<And>w. w \<in> S \<Longrightarrow> a'' \<bullet> (w-z) = 0" | 
| 69661 | 5781 | 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 | 5782 | 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 | 5783 | 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 | 5784 | 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 | 5785 | 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 | 5786 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5787 | proof (cases "a' = 0") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5788 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5789 | 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 | 5790 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5791 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5792 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5793 | show ?thesis | 
| 72567 | 5794 | proof | 
| 5795 |       show "S \<inter> {x. a' \<bullet> x \<le> a' \<bullet> z} = S \<inter> {x. a \<bullet> x \<le> b}"
 | |
| 5796 |         "S \<inter> {x. a' \<bullet> x = a' \<bullet> z} = S \<inter> {x. a \<bullet> x = b}"
 | |
| 5797 | by (auto simp: a ba'' inner_left_distrib) | |
| 5798 | have "\<And>w. w \<in> (+) (- z) ` S \<Longrightarrow> (w + a') \<in> (+) (- z) ` S" | |
| 5799 | by (metis subspace_add a' span_eq_iff sub) | |
| 5800 | then show "\<And>w. w \<in> S \<Longrightarrow> (w + a') \<in> S" | |
| 5801 | by fastforce | |
| 5802 | 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 | 5803 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5804 | qed | 
| 
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 | 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 | 5807 | assumes "a \<in> S" | 
| 72567 | 5808 | 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 | 5809 | proof - | 
| 72567 | 5810 |   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 | 5811 | 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 | 5812 | show ?thesis | 
| 72238 | 5813 | 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 | 5814 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5815 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5816 | 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 | 5817 | 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 | 5818 | assumes "affine S" "a \<in> S" | 
| 72567 | 5819 | 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 | 5820 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5821 | 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 | 5822 | 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 | 5823 | 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 | 5824 | 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 | 5825 |   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 | 5826 | 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 | 5827 | 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 | 5828 | 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 | 5829 | 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 | 5830 | 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 | 5831 | by (auto simp: algebra_simps) | 
| 72567 | 5832 | have *: "(\<lambda>x. x - c) ` S = (\<lambda>x. x - a) ` S" | 
| 5833 | using assms \<open>c \<in> S\<close> | |
| 5834 | 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 | 5835 | 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 | 5836 | 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 | 5837 | 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 | 5838 | using card by simp | 
| 72567 | 5839 | also have "... = dim ((\<lambda>x. x - c) ` B)" | 
| 5840 | 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 | 5841 | by (simp add: affine_independent_card_dim_diffs [OF ind \<open>c \<in> B\<close>]) | 
| 72567 | 5842 | also have "... = dim ((\<lambda>x. x - c) ` (affine hull B))" | 
| 5843 | by (simp add: diffs_affine_hull_span \<open>c \<in> B\<close>) | |
| 5844 | also have "... = dim ((\<lambda>x. x - a) ` S)" | |
| 5845 | by (simp add: affS aff *) | |
| 5846 | finally show ?thesis . | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5847 | qed | 
| 
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 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 | 5850 | assumes "linear f" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5851 | 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 | 5852 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5853 | 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 | 5854 |   proof (cases "T = {}")
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5855 | 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 | 5856 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5857 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5858 | 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 | 5859 |     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 | 5860 | by auto | 
| 72567 | 5861 |     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 | 5862 | 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 | 5863 |     have "aff_dim (f ` T) = int (dim {x - f a |x. x \<in> f ` T})"
 | 
| 69661 | 5864 | by (simp add: \<open>a \<in> T\<close> hull_inc aff_dim_eq_dim [of "f a"] 1 cong: image_cong_simp) | 
| 72567 | 5865 | 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 | 5866 | by (force simp: linear_diff [OF assms] 2) | 
| 72567 | 5867 | 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 | 5868 | 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 | 5869 | 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 | 5870 | 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 | 5871 | finally show ?thesis . | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5872 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5873 | then | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5874 | 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 | 5875 | 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 | 5876 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5877 | 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 | 5878 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5879 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5880 | 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 | 5881 | 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 | 5882 | 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 | 5883 | proof (rule antisym) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5884 | 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 | 5885 | 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 | 5886 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5887 | 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 | 5888 | 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 | 5889 | 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 | 5890 | 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 | 5891 | 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 | 5892 | 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 | 5893 | 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 | 5894 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5895 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5896 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5897 | lemma choose_affine_subset: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5898 | 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 | 5899 | 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 | 5900 | 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 | 5901 | 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 | 5902 | 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 | 5903 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5904 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5905 | with assms obtain a where "a \<in> S" "0 \<le> d" by auto | 
| 67399 | 5906 | with assms have ss: "subspace ((+) (- a) ` S)" | 
| 69661 | 5907 | by (simp add: affine_diffs_subspace_subtract cong: image_cong_simp) | 
| 67399 | 5908 | 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 | 5909 | by (metis aff_dim_subspace aff_dim_translation_eq dle nat_int nat_mono ss) | 
| 67399 | 5910 | 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 | 5911 | and Tdim: "dim T = nat d" | 
| 67399 | 5912 | 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 | 5913 | then have "affine T" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5914 | using subspace_affine by blast | 
| 67399 | 5915 | 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 | 5916 | by (metis affine_hull_eq affine_hull_translation) | 
| 67399 | 5917 | 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 | 5918 | proof - | 
| 67399 | 5919 | 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 | 5920 | by (metis (no_types) span_eq_iff Tsb ss) | 
| 67399 | 5921 | 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 | 5922 | 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 | 5923 | qed | 
| 67399 | 5924 | 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 | 5925 | 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 | 5926 | ultimately show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5927 | by (rule that) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5928 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5929 | |
| 69541 | 5930 | 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 | 5931 | |
| 68607 
67bb59e49834
make theorem, corollary, and proposition %important for HOL-Analysis manual
 immler parents: 
68527diff
changeset | 5932 | 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 | 5933 |   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 | 5934 | 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 | 5935 | 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 | 5936 | 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 | 5937 | 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 | 5938 |                        \<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 | 5939 | proof (cases "S = {}")
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5940 | 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 | 5941 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5942 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5943 | 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 | 5944 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5945 | 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 | 5946 | 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 | 5947 | 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 | 5948 | 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 | 5949 | then show ?thesis | 
| 72238 | 5950 | 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 | 5951 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5952 | then obtain F G where Gin: "x \<in> G x" and oG: "open (G x)" | 
| 72238 | 5953 | and clos: "closure (G x) \<subseteq> F x" and Fin: "F x \<in> \<C>" | 
| 5954 | 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 | 5955 | by metis | 
| 69313 | 5956 | 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 | 5957 | using Lindelof [of "G ` S"] by (metis image_iff) | 
| 69313 | 5958 | 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 | 5959 | 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 | 5960 |   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 | 5961 | 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 | 5962 | 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 | 5963 |   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 | 5964 | 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 | 5965 |   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 | 5966 | 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 | 5967 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5968 | 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 | 5969 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5970 | 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 | 5971 | qed | 
| 72238 | 5972 | show ?thesis | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5973 | proof | 
| 72238 | 5974 | show "S \<subseteq> Union ?C" | 
| 5975 | proof | |
| 5976 | fix x assume "x \<in> S" | |
| 5977 | define n where "n \<equiv> LEAST n. x \<in> F(a n)" | |
| 5978 | have n: "x \<in> F(a n)" | |
| 5979 | using enum_S [OF \<open>x \<in> S\<close>] by (force simp: n_def intro: LeastI) | |
| 5980 | have notn: "x \<notin> F(a m)" if "m < n" for m | |
| 5981 | using that not_less_Least by (force simp: n_def) | |
| 5982 |       then have "x \<notin> \<Union>{closure (G (a m)) |m. m < n}"
 | |
| 5983 | using n \<open>K \<subseteq> S\<close> \<open>range a = K\<close> clos notn by fastforce | |
| 5984 | with n show "x \<in> Union ?C" | |
| 5985 | by blast | |
| 5986 | qed | |
| 5987 | show "\<And>U. U \<in> ?C \<Longrightarrow> open U \<and> (\<exists>T. T \<in> \<C> \<and> U \<subseteq> T)" | |
| 5988 | using Fin \<open>K \<subseteq> S\<close> \<open>range a = K\<close> by (auto simp: odif) | |
| 5989 |     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
 | |
| 5990 | proof - | |
| 5991 | obtain n where n: "x \<in> F(a n)" "x \<in> G(a n)" | |
| 5992 | using \<open>x \<in> S\<close> enum_S by auto | |
| 5993 |       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"
 | |
| 5994 | proof clarsimp | |
| 5995 |         fix k  assume "(F (a k) - \<Union>{closure (G (a m)) |m. m < k}) \<inter> G (a n) \<noteq> {}"
 | |
| 5996 | then have "k \<le> n" | |
| 5997 | by auto (metis closure_subset not_le subsetCE) | |
| 5998 |         then show "F (a k) - \<Union>{closure (G (a m)) |m. m < k}
 | |
| 5999 |                  \<in> (\<lambda>n. F (a n) - \<Union>{closure (G (a m)) |m. m < n}) ` {..n}"
 | |
| 6000 | by force | |
| 6001 | qed | |
| 6002 |       moreover have "finite ((\<lambda>n. F(a n) - \<Union>{closure(G(a m)) |m. m < n}) ` atMost n)"
 | |
| 6003 | by force | |
| 6004 |       ultimately have *: "finite {U \<in> ?C. U \<inter> G (a n) \<noteq> {}}"
 | |
| 6005 | using finite_subset by blast | |
| 6006 | have "a n \<in> S" | |
| 6007 | using \<open>K \<subseteq> S\<close> \<open>range a = K\<close> by blast | |
| 6008 | then show ?thesis | |
| 6009 | by (blast intro: oG n *) | |
| 6010 | qed | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6011 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6012 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6013 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6014 | 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 | 6015 |   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 | 6016 | 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 | 6017 | 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 | 6018 | 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 | 6019 | 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 | 6020 | 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 | 6021 | 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 | 6022 | \<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 | 6023 |                                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 | 6024 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6025 | 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 | 6026 | 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 | 6027 | 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 | 6028 | by metis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6029 | 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 | 6030 | using cin by (auto simp: closedin_closed) | 
| 69745 | 6031 | 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 | 6032 | 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 | 6033 | 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 | 6034 | 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 | 6035 | 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 | 6036 | 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 | 6037 |              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 | 6038 | 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 | 6039 |   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 | 6040 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6041 |   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 | 6042 | 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 | 6043 | 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 | 6044 | 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 | 6045 | 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 | 6046 |     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 | 6047 |              (\<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 | 6048 | by blast | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 6049 |     show "\<exists>V. openin (top_of_set U) V \<and> x \<in> V \<and> finite {X \<in> ?C. X \<inter> V \<noteq> {}}"
 | 
| 72238 | 6050 | if "x \<in> U" for x | 
| 6051 | proof - | |
| 6052 |       from D2 [OF that] obtain V where "open V" "x \<in> V" "finite {U \<in> \<D>. U \<inter> V \<noteq> {}}"
 | |
| 6053 | by auto | |
| 6054 | with * show ?thesis | |
| 6055 | 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 | 6056 | qed | 
| 72238 | 6057 | qed | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6058 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6059 | |
| 70136 | 6060 | 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 | 6061 |   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 | 6062 | assumes "closed S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6063 | 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 | 6064 | 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 | 6065 | 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 | 6066 | 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 | 6067 | 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 | 6068 |                                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 | 6069 | 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 | 6070 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6071 | |
| 70136 | 6072 | 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 | 6073 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6074 | 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 | 6075 | 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 | 6076 | 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 | 6077 | 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 | 6078 | proof - | 
| 72238 | 6079 |   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 | 6080 | using fim by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6081 | show ?thesis | 
| 72567 | 6082 | unfolding eq | 
| 6083 | 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 | 6084 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6085 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6086 | 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 | 6087 | fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" | 
| 78248 
740b23f1138a
EXPERIMENTAL replacement of f ` A <= B by f : A -> B in Analysis
 paulson <lp15@cam.ac.uk> parents: 
78037diff
changeset | 6088 | assumes "compact T" and fim: "f \<in> S \<rightarrow> T" | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6089 | 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 | 6090 | 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 | 6091 | (is "?lhs = ?rhs") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6092 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6093 | have "?lhs" if ?rhs | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6094 | 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 | 6095 | fix U | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 6096 | 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 | 6097 | 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 | 6098 | 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 | 6099 | 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 | 6100 | 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 | 6101 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6102 | 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 | 6103 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6104 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6105 | lemma continuous_closed_graph: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6106 | 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 | 6107 | 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 | 6108 | shows "closed ((\<lambda>x. Pair x (f x)) ` S)" | 
| 72238 | 6109 | proof (rule closedin_closed_trans) | 
| 6110 | show "closedin (top_of_set (S \<times> UNIV)) ((\<lambda>x. (x, f x)) ` S)" | |
| 6111 | by (rule continuous_closed_graph_gen [OF contf subset_UNIV]) | |
| 6112 | 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 | 6113 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6114 | 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 | 6115 | fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" | 
| 78248 
740b23f1138a
EXPERIMENTAL replacement of f ` A <= B by f : A -> B in Analysis
 paulson <lp15@cam.ac.uk> parents: 
78037diff
changeset | 6116 | assumes "compact T" and fim: "f \<in> S \<rightarrow> T" and clo: "closed ((\<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 | 6117 | 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 | 6118 | using fim clo | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6119 | 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 | 6120 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6121 | 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 | 6122 | 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 | 6123 | 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 | 6124 | 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 | 6125 | 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 | 6126 |   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 | 6127 | 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 | 6128 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6129 | 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 | 6130 | 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 | 6131 | 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 | 6132 | and contf: "continuous_on S f" and contg: "continuous_on T g" | 
| 69508 | 6133 | 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 | 6134 | 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 | 6135 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6136 | 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 | 6137 | 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 | 6138 | 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 | 6139 | 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 | 6140 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6141 | 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 | 6142 | qed | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69918diff
changeset | 6143 | |
| 70136 | 6144 | subsection\<^marker>\<open>tag unimportant\<close>\<open>The union of two collinear segments is another segment\<close> | 
| 6145 | ||
| 6146 | 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 | 6147 | 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 | 6148 | 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 | 6149 |   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 | 6150 | 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 | 6151 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6152 | 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 | 6153 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6154 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6155 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6156 |   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 | 6157 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6158 | 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 | 6159 | 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 | 6160 | 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 | 6161 | 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 | 6162 | 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 | 6163 | 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 | 6164 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6165 | 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 | 6166 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6167 | 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 | 6168 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6169 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6170 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6171 |         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 | 6172 | 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 | 6173 |         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 | 6174 | 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 | 6175 | 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 | 6176 |           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 | 6177 |                 (\<Sum>x \<in> S - {b}. if x = a then 0 else v x)"
 | 
| 72238 | 6178 | 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 | 6179 |           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 | 6180 | 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 | 6181 | 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 | 6182 | 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 | 6183 |           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 | 6184 | by (simp add: v1) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6185 |           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 | 6186 | by (auto simp: v0) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6187 |           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 | 6188 |                 (\<Sum>x \<in> S - {b}. (if x = a then 0 else v x) *\<^sub>R x)"
 | 
| 72238 | 6189 | 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 | 6190 |           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 | 6191 | 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 | 6192 | 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 | 6193 | 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 | 6194 |           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 | 6195 | by (simp add: vx) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6196 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6197 | 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 | 6198 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6199 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6200 | 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 | 6201 | 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 | 6202 | 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 | 6203 | 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 | 6204 | 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 | 6205 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6206 | 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 | 6207 | 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 | 6208 | 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 | 6209 | 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 | 6210 | 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 | 6211 |       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 | 6212 | 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 | 6213 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6214 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6215 |         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 | 6216 | 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 | 6217 | 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 | 6218 |           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 | 6219 |                 v b / u b + (\<Sum>x \<in> S - {b}. v x - (v b / u b) * u x)"
 | 
| 72238 | 6220 | using \<open>a \<notin> S\<close> \<open>b \<in> S\<close> True | 
| 6221 | 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 | 6222 |           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 | 6223 | 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 | 6224 | 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 | 6225 | 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 | 6226 |           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 | 6227 | by (simp add: v1) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6228 | 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 | 6229 |             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 | 6230 | 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 | 6231 | 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 | 6232 |           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 | 6233 |                 (v b / u b) *\<^sub>R a + (\<Sum>x\<in>S - {b}. (v x - v b / u b * u x) *\<^sub>R x)"
 | 
| 72238 | 6234 | 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 | 6235 |           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 | 6236 | 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 | 6237 | 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 | 6238 | 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 | 6239 | finally | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6240 |           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 | 6241 | by (simp add: vx) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6242 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6243 | 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 | 6244 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6245 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6246 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6247 |     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 | 6248 | 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 | 6249 | 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 | 6250 | by (metis antisym subsetI) | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6251 | show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6252 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6253 |       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 | 6254 | 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 | 6255 | 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 | 6256 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6257 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6258 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6259 | 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 | 6260 | 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 | 6261 | 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 | 6262 |   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 | 6263 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6264 | show "?lhs \<subseteq> ?rhs" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6265 | 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 | 6266 | show "?rhs \<subseteq> ?lhs" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6267 | proof clarify | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6268 | fix x b | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6269 |     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 | 6270 | 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 | 6271 | 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 | 6272 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6273 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6274 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6275 | lemma Un_closed_segment: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6276 | 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 | 6277 | 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 | 6278 | 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 | 6279 | proof (cases "c = a") | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6280 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6281 | 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 | 6282 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6283 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6284 |   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 | 6285 | 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 | 6286 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6287 | 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 | 6288 | 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 | 6289 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6290 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6291 | lemma Un_open_segment: | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6292 | 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 | 6293 | assumes "b \<in> open_segment a c" | 
| 72567 | 6294 |   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 | 6295 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6296 | 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 | 6297 | by (simp add: assms open_closed_segment) | 
| 72567 | 6298 | have *: "?rhs \<subseteq> insert b (open_segment a b \<union> open_segment b c)" | 
| 6299 |           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 | 6300 | proof - | 
| 72567 | 6301 | 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 | 6302 | 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 | 6303 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6304 | 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 | 6305 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6306 | show ?thesis | 
| 72567 | 6307 | proof | 
| 6308 | show "?lhs \<subseteq> ?rhs" | |
| 6309 | by (simp add: assms b subset_open_segment) | |
| 6310 | show "?rhs \<subseteq> ?lhs" | |
| 6311 | using Un_closed_segment [OF b] * | |
| 6312 | by (simp add: closed_segment_eq_open insert_commute) | |
| 6313 | qed | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6314 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6315 | |
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6316 | 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 | 6317 | |
| 68607 
67bb59e49834
make theorem, corollary, and proposition %important for HOL-Analysis manual
 immler parents: 
68527diff
changeset | 6318 | 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 | 6319 | 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 | 6320 | assumes "open S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6321 | 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 | 6322 | "\<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 | 6323 | "\<Union>(range C) = S" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6324 | "\<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 | 6325 | proof (cases "S = {}")
 | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6326 | case True | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6327 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6328 |     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 | 6329 | next | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6330 | case False | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6331 | 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 | 6332 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6333 |   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 | 6334 | 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 | 6335 | 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 | 6336 | 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 | 6337 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6338 | 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 | 6339 | 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 | 6340 | 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 | 6341 | 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 | 6342 | 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 | 6343 | 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 | 6344 | show "K \<subseteq> (\<Union>n. interior (f n))" | 
| 69313 | 6345 | 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 | 6346 | qed auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6347 |     { fix n
 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6348 | 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 | 6349 | 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 | 6350 | 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 | 6351 | 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 | 6352 | using I by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6353 | } | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6354 | then show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6355 | by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6356 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6357 | 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 | 6358 | ((\<Union>(range f) = S))" | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6359 | 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 | 6360 | 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 | 6361 | 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 | 6362 | 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 | 6363 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6364 | 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 | 6365 | 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 | 6366 | 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 | 6367 | 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 | 6368 |       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 | 6369 | 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 | 6370 |       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 | 6371 |             \<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 | 6372 | 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 | 6373 |       also have "... \<subseteq> (\<Union>x \<in> -S. \<Union>y\<in>ball 0 (1 / (1 + real n)). {x + y})"
 | 
| 72567 | 6374 | 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 | 6375 |       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 | 6376 |                     \<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 | 6377 | qed | 
| 69325 | 6378 | 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 | 6379 | proof | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6380 | fix x | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6381 | 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 | 6382 | 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 | 6383 | 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 | 6384 | 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 | 6385 | using reals_Archimedean2 | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6386 | 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 | 6387 | 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 | 6388 | 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 | 6389 | 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 | 6390 | 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 | 6391 | 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 | 6392 | proof - | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6393 | 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 | 6394 | 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 | 6395 | 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 | 6396 | 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 | 6397 | 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 | 6398 | 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 | 6399 | using that by simp | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6400 | 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 | 6401 | using e by blast | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6402 | with that show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6403 | by auto | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6404 | qed | 
| 69325 | 6405 | 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 | 6406 | 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 | 6407 | qed | 
| 69325 | 6408 | 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 | 6409 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6410 | ultimately show ?thesis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6411 | using that by metis | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6412 | qed | 
| 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6413 | |
| 67986 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6414 | |
| 69272 | 6415 | 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 | 6416 | |
| 70136 | 6417 | 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 | 6418 |   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 | 6419 | |
| 69541 | 6420 | 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 | 6421 | 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 | 6422 | 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 | 6423 | |
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6424 | 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 | 6425 | 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 | 6426 | 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 | 6427 | proof | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6428 | 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 | 6429 | 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 | 6430 | 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 | 6431 | qed | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6432 | |
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6433 | 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 | 6434 | 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 | 6435 | |
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6436 | 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 | 6437 | 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 | 6438 | 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 | 6439 | |
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6440 | 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 | 6441 | 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 | 6442 | |
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6443 | 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 | 6444 | 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 | 6445 | 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 | 6446 | proof | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6447 | 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 | 6448 | 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 | 6449 | 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 | 6450 | 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 | 6451 | 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 | 6452 | 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 | 6453 | qed | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6454 | |
| 69541 | 6455 | 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 | 6456 | 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 | 6457 | 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 | 6458 | 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 | 6459 | proof - | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6460 | 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 | 6461 | 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 | 6462 | 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 | 6463 | 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 | 6464 | 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 | 6465 | 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 | 6466 | 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 | 6467 | 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 | 6468 |   { 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 | 6469 | 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 | 6470 | 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 | 6471 | 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 | 6472 | moreover have "?u \<in> U" | 
| 68074 | 6473 | 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 | 6474 | 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 | 6475 | 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 | 6476 | 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 | 6477 | 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 | 6478 | 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 | 6479 | 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 | 6480 | 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 | 6481 | 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 | 6482 | 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 | 6483 | 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 | 6484 | 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 | 6485 | 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 | 6486 | qed | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6487 | 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 | 6488 | 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 | 6489 | } 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 | 6490 | 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 | 6491 | qed | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6492 | |
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6493 | 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 | 6494 | 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 | 6495 |   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 | 6496 | 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 | 6497 | 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 | 6498 | |
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6499 | 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 | 6500 | 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 | 6501 | 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 | 6502 | 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 | 6503 | proof | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6504 | 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 | 6505 | 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 | 6506 | 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 | 6507 | proof - | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6508 | 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 | 6509 | 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 | 6510 | 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 | 6511 | 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 | 6512 | 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 | 6513 | 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 | 6514 | 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 | 6515 | 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 | 6516 | 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 | 6517 | 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 | 6518 | 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 | 6519 | 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 | 6520 | qed | 
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6521 | 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 | 6522 | 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 | 6523 | 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 | 6524 | |
| 
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 6525 | 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 | 6526 | 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 | 6527 | assumes "linear f" | 
| 72238 | 6528 |   shows "f -` {0} = (range (adjoint f))\<^sup>\<bottom>"
 | 
| 72567 | 6529 | proof - | 
| 6530 | have "\<And>x. \<lbrakk>\<forall>y. y \<bullet> f x = 0\<rbrakk> \<Longrightarrow> f x = 0" | |
| 6531 | using assms inner_commute all_zero_iff by metis | |
| 6532 | then show ?thesis | |
| 6533 | using assms | |
| 6534 | by (auto simp: orthogonal_comp_def orthogonal_def adjoint_works inner_commute) | |
| 6535 | 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 | 6536 | |
| 70136 | 6537 | 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 | 6538 | |
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6539 | lemma linear_surj_adj_imp_inj: | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6540 | fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6541 | assumes "linear f" "surj (adjoint f)" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6542 | shows "inj f" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6543 | proof - | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6544 | have "\<exists>x. y = adjoint f x" for y | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6545 | using assms by (simp add: surjD) | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6546 | then show "inj f" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6547 | using assms unfolding inj_on_def image_def | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6548 | by (metis (no_types) adjoint_works euclidean_eqI) | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6549 | qed | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6550 | |
| 70138 | 6551 | \<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 | 6552 | lemma surj_adjoint_iff_inj [simp]: | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6553 | fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6554 | assumes "linear f" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6555 | shows "surj (adjoint f) \<longleftrightarrow> inj f" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6556 | proof | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6557 | assume "surj (adjoint f)" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6558 | then show "inj f" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6559 | by (simp add: assms linear_surj_adj_imp_inj) | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6560 | next | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6561 | assume "inj f" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6562 |   have "f -` {0} = {0}"
 | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6563 | 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 | 6564 |   moreover have "f -` {0} = range (adjoint f)\<^sup>\<bottom>"
 | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6565 | by (intro ker_orthogonal_comp_adjoint assms) | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6566 | 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 | 6567 | by (metis orthogonal_comp_null) | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6568 | 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 | 6569 | 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 | 6570 | 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 | 6571 | (simp add: adjoint_linear linear_subspace_image) | 
| 67989 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6572 | qed | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6573 | |
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6574 | lemma inj_adjoint_iff_surj [simp]: | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6575 | fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6576 | assumes "linear f" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6577 | shows "inj (adjoint f) \<longleftrightarrow> surj f" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6578 | proof | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6579 | assume "inj (adjoint f)" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6580 |   have "(adjoint f) -` {0} = {0}"
 | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6581 | 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 | 6582 |   then have "(range(f))\<^sup>\<bottom> = {0}"
 | 
| 73932 
fd21b4a93043
added opaque_combs and renamed hide_lams to opaque_lifting
 desharna parents: 
72569diff
changeset | 6583 | 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 | 6584 | then show "surj f" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6585 | 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 | 6586 | next | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6587 | assume "surj f" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6588 |   then have "range f = (adjoint f -` {0})\<^sup>\<bottom>"
 | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6589 | 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 | 6590 |   then have "{0} = adjoint f -` {0}"
 | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6591 | 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 | 6592 | then show "inj (adjoint f)" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6593 | 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 | 6594 | qed | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6595 | |
| 69541 | 6596 | lemma linear_singular_into_hyperplane: | 
| 67989 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6597 | fixes f :: "'n::euclidean_space \<Rightarrow> 'n" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6598 | assumes "linear f" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6599 | 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 | 6600 | proof | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6601 | assume "\<not>inj f" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6602 | then show ?rhs | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6603 | using all_zero_iff | 
| 73932 
fd21b4a93043
added opaque_combs and renamed hide_lams to opaque_lifting
 desharna parents: 
72569diff
changeset | 6604 | 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 | 6605 | 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 | 6606 | next | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6607 | assume ?rhs | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6608 | then show "\<not>inj f" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6609 | by (metis assms linear_injective_isomorphism all_zero_iff) | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6610 | qed | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6611 | |
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6612 | lemma linear_singular_image_hyperplane: | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6613 | fixes f :: "'n::euclidean_space \<Rightarrow> 'n" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6614 | assumes "linear f" "\<not>inj f" | 
| 
706f86afff43
more results about measure and negligibility
 paulson <lp15@cam.ac.uk> parents: 
67986diff
changeset | 6615 |   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 | 6616 | 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 | 6617 | |
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6618 | end |