author | paulson <lp15@cam.ac.uk> |
Tue, 10 Nov 2015 14:18:41 +0000 | |
changeset 61609 | 77b453bd616f |
parent 61531 | ab2e862263e7 |
child 61694 | 6571c78c9667 |
permissions | -rw-r--r-- |
41959 | 1 |
(* Title: HOL/Multivariate_Analysis/Convex_Euclidean_Space.thy |
33175 | 2 |
Author: Robert Himmelmann, TU Muenchen |
40887
ee8d0548c148
Prove rel_interior_convex_hull_union (by Grechuck Bogdan).
hoelzl
parents:
40719
diff
changeset
|
3 |
Author: Bogdan Grechuk, University of Edinburgh |
33175 | 4 |
*) |
5 |
||
60420 | 6 |
section \<open>Convex sets, functions and related things.\<close> |
33175 | 7 |
|
8 |
theory Convex_Euclidean_Space |
|
44132 | 9 |
imports |
56189
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
10 |
Topology_Euclidean_Space |
44132 | 11 |
"~~/src/HOL/Library/Convex" |
12 |
"~~/src/HOL/Library/Set_Algebras" |
|
33175 | 13 |
begin |
14 |
||
40377 | 15 |
lemma independent_injective_on_span_image: |
49531 | 16 |
assumes iS: "independent S" |
53302 | 17 |
and lf: "linear f" |
18 |
and fi: "inj_on f (span S)" |
|
40377 | 19 |
shows "independent (f ` S)" |
49529 | 20 |
proof - |
21 |
{ |
|
22 |
fix a |
|
53339 | 23 |
assume a: "a \<in> S" "f a \<in> span (f ` S - {f a})" |
49529 | 24 |
have eq: "f ` S - {f a} = f ` (S - {a})" |
25 |
using fi a span_inc by (auto simp add: inj_on_def) |
|
53339 | 26 |
from a have "f a \<in> f ` span (S -{a})" |
27 |
unfolding eq span_linear_image [OF lf, of "S - {a}"] by blast |
|
28 |
moreover have "span (S - {a}) \<subseteq> span S" |
|
29 |
using span_mono[of "S - {a}" S] by auto |
|
30 |
ultimately have "a \<in> span (S - {a})" |
|
53333 | 31 |
using fi a span_inc by (auto simp add: inj_on_def) |
32 |
with a(1) iS have False |
|
33 |
by (simp add: dependent_def) |
|
49529 | 34 |
} |
53333 | 35 |
then show ?thesis |
36 |
unfolding dependent_def by blast |
|
40377 | 37 |
qed |
38 |
||
39 |
lemma dim_image_eq: |
|
53339 | 40 |
fixes f :: "'n::euclidean_space \<Rightarrow> 'm::euclidean_space" |
53333 | 41 |
assumes lf: "linear f" |
42 |
and fi: "inj_on f (span S)" |
|
53406 | 43 |
shows "dim (f ` S) = dim (S::'n::euclidean_space set)" |
44 |
proof - |
|
45 |
obtain B where B: "B \<subseteq> S" "independent B" "S \<subseteq> span B" "card B = dim S" |
|
49529 | 46 |
using basis_exists[of S] by auto |
47 |
then have "span S = span B" |
|
48 |
using span_mono[of B S] span_mono[of S "span B"] span_span[of B] by auto |
|
49 |
then have "independent (f ` B)" |
|
53406 | 50 |
using independent_injective_on_span_image[of B f] B assms by auto |
49529 | 51 |
moreover have "card (f ` B) = card B" |
53406 | 52 |
using assms card_image[of f B] subset_inj_on[of f "span S" B] B span_inc by auto |
53333 | 53 |
moreover have "(f ` B) \<subseteq> (f ` S)" |
53406 | 54 |
using B by auto |
53302 | 55 |
ultimately have "dim (f ` S) \<ge> dim S" |
53406 | 56 |
using independent_card_le_dim[of "f ` B" "f ` S"] B by auto |
53333 | 57 |
then show ?thesis |
58 |
using dim_image_le[of f S] assms by auto |
|
40377 | 59 |
qed |
60 |
||
61 |
lemma linear_injective_on_subspace_0: |
|
53302 | 62 |
assumes lf: "linear f" |
63 |
and "subspace S" |
|
64 |
shows "inj_on f S \<longleftrightarrow> (\<forall>x \<in> S. f x = 0 \<longrightarrow> x = 0)" |
|
49529 | 65 |
proof - |
53302 | 66 |
have "inj_on f S \<longleftrightarrow> (\<forall>x \<in> S. \<forall>y \<in> S. f x = f y \<longrightarrow> x = y)" |
67 |
by (simp add: inj_on_def) |
|
68 |
also have "\<dots> \<longleftrightarrow> (\<forall>x \<in> S. \<forall>y \<in> S. f x - f y = 0 \<longrightarrow> x - y = 0)" |
|
69 |
by simp |
|
70 |
also have "\<dots> \<longleftrightarrow> (\<forall>x \<in> S. \<forall>y \<in> S. f (x - y) = 0 \<longrightarrow> x - y = 0)" |
|
40377 | 71 |
by (simp add: linear_sub[OF lf]) |
53302 | 72 |
also have "\<dots> \<longleftrightarrow> (\<forall>x \<in> S. f x = 0 \<longrightarrow> x = 0)" |
60420 | 73 |
using \<open>subspace S\<close> subspace_def[of S] subspace_sub[of S] by auto |
40377 | 74 |
finally show ?thesis . |
75 |
qed |
|
76 |
||
53302 | 77 |
lemma subspace_Inter: "\<forall>s \<in> f. subspace s \<Longrightarrow> subspace (Inter f)" |
49531 | 78 |
unfolding subspace_def by auto |
40377 | 79 |
|
53302 | 80 |
lemma span_eq[simp]: "span s = s \<longleftrightarrow> subspace s" |
81 |
unfolding span_def by (rule hull_eq) (rule subspace_Inter) |
|
40377 | 82 |
|
49529 | 83 |
lemma substdbasis_expansion_unique: |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
84 |
assumes d: "d \<subseteq> Basis" |
53302 | 85 |
shows "(\<Sum>i\<in>d. f i *\<^sub>R i) = (x::'a::euclidean_space) \<longleftrightarrow> |
86 |
(\<forall>i\<in>Basis. (i \<in> d \<longrightarrow> f i = x \<bullet> i) \<and> (i \<notin> d \<longrightarrow> x \<bullet> i = 0))" |
|
49529 | 87 |
proof - |
53339 | 88 |
have *: "\<And>x a b P. x * (if P then a else b) = (if P then x * a else x * b)" |
53302 | 89 |
by auto |
90 |
have **: "finite d" |
|
91 |
by (auto intro: finite_subset[OF assms]) |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
92 |
have ***: "\<And>i. i \<in> Basis \<Longrightarrow> (\<Sum>i\<in>d. f i *\<^sub>R i) \<bullet> i = (\<Sum>x\<in>d. if x = i then f x else 0)" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
93 |
using d |
57418 | 94 |
by (auto intro!: setsum.cong simp: inner_Basis inner_setsum_left) |
49529 | 95 |
show ?thesis |
57418 | 96 |
unfolding euclidean_eq_iff[where 'a='a] by (auto simp: setsum.delta[OF **] ***) |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
97 |
qed |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
98 |
|
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
99 |
lemma independent_substdbasis: "d \<subseteq> Basis \<Longrightarrow> independent d" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
100 |
by (rule independent_mono[OF independent_Basis]) |
40377 | 101 |
|
49531 | 102 |
lemma dim_cball: |
53302 | 103 |
assumes "e > 0" |
49529 | 104 |
shows "dim (cball (0 :: 'n::euclidean_space) e) = DIM('n)" |
105 |
proof - |
|
53302 | 106 |
{ |
107 |
fix x :: "'n::euclidean_space" |
|
108 |
def y \<equiv> "(e / norm x) *\<^sub>R x" |
|
53339 | 109 |
then have "y \<in> cball 0 e" |
53302 | 110 |
using cball_def dist_norm[of 0 y] assms by auto |
53339 | 111 |
moreover have *: "x = (norm x / e) *\<^sub>R y" |
53302 | 112 |
using y_def assms by simp |
113 |
moreover from * have "x = (norm x/e) *\<^sub>R y" |
|
114 |
by auto |
|
53339 | 115 |
ultimately have "x \<in> span (cball 0 e)" |
49529 | 116 |
using span_mul[of y "cball 0 e" "norm x/e"] span_inc[of "cball 0 e"] by auto |
53302 | 117 |
} |
53339 | 118 |
then have "span (cball 0 e) = (UNIV :: 'n::euclidean_space set)" |
53302 | 119 |
by auto |
49529 | 120 |
then show ?thesis |
121 |
using dim_span[of "cball (0 :: 'n::euclidean_space) e"] by (auto simp add: dim_UNIV) |
|
40377 | 122 |
qed |
123 |
||
124 |
lemma indep_card_eq_dim_span: |
|
53339 | 125 |
fixes B :: "'n::euclidean_space set" |
49529 | 126 |
assumes "independent B" |
53339 | 127 |
shows "finite B \<and> card B = dim (span B)" |
40377 | 128 |
using assms basis_card_eq_dim[of B "span B"] span_inc by auto |
129 |
||
53339 | 130 |
lemma setsum_not_0: "setsum f A \<noteq> 0 \<Longrightarrow> \<exists>a \<in> A. f a \<noteq> 0" |
49529 | 131 |
by (rule ccontr) auto |
40377 | 132 |
|
49531 | 133 |
lemma translate_inj_on: |
53339 | 134 |
fixes A :: "'a::ab_group_add set" |
135 |
shows "inj_on (\<lambda>x. a + x) A" |
|
49529 | 136 |
unfolding inj_on_def by auto |
40377 | 137 |
|
138 |
lemma translation_assoc: |
|
139 |
fixes a b :: "'a::ab_group_add" |
|
53339 | 140 |
shows "(\<lambda>x. b + x) ` ((\<lambda>x. a + x) ` S) = (\<lambda>x. (a + b) + x) ` S" |
49529 | 141 |
by auto |
40377 | 142 |
|
143 |
lemma translation_invert: |
|
144 |
fixes a :: "'a::ab_group_add" |
|
53339 | 145 |
assumes "(\<lambda>x. a + x) ` A = (\<lambda>x. a + x) ` B" |
49529 | 146 |
shows "A = B" |
147 |
proof - |
|
53339 | 148 |
have "(\<lambda>x. -a + x) ` ((\<lambda>x. a + x) ` A) = (\<lambda>x. - a + x) ` ((\<lambda>x. a + x) ` B)" |
49529 | 149 |
using assms by auto |
150 |
then show ?thesis |
|
151 |
using translation_assoc[of "-a" a A] translation_assoc[of "-a" a B] by auto |
|
40377 | 152 |
qed |
153 |
||
154 |
lemma translation_galois: |
|
155 |
fixes a :: "'a::ab_group_add" |
|
53339 | 156 |
shows "T = ((\<lambda>x. a + x) ` S) \<longleftrightarrow> S = ((\<lambda>x. (- a) + x) ` T)" |
53333 | 157 |
using translation_assoc[of "-a" a S] |
158 |
apply auto |
|
159 |
using translation_assoc[of a "-a" T] |
|
160 |
apply auto |
|
49529 | 161 |
done |
40377 | 162 |
|
163 |
lemma translation_inverse_subset: |
|
53339 | 164 |
assumes "((\<lambda>x. - a + x) ` V) \<le> (S :: 'n::ab_group_add set)" |
165 |
shows "V \<le> ((\<lambda>x. a + x) ` S)" |
|
49529 | 166 |
proof - |
53333 | 167 |
{ |
168 |
fix x |
|
169 |
assume "x \<in> V" |
|
170 |
then have "x-a \<in> S" using assms by auto |
|
171 |
then have "x \<in> {a + v |v. v \<in> S}" |
|
49529 | 172 |
apply auto |
173 |
apply (rule exI[of _ "x-a"]) |
|
174 |
apply simp |
|
175 |
done |
|
53333 | 176 |
then have "x \<in> ((\<lambda>x. a+x) ` S)" by auto |
177 |
} |
|
178 |
then show ?thesis by auto |
|
40377 | 179 |
qed |
180 |
||
181 |
lemma basis_to_basis_subspace_isomorphism: |
|
182 |
assumes s: "subspace (S:: ('n::euclidean_space) set)" |
|
49529 | 183 |
and t: "subspace (T :: ('m::euclidean_space) set)" |
184 |
and d: "dim S = dim T" |
|
53333 | 185 |
and B: "B \<subseteq> S" "independent B" "S \<subseteq> span B" "card B = dim S" |
186 |
and C: "C \<subseteq> T" "independent C" "T \<subseteq> span C" "card C = dim T" |
|
187 |
shows "\<exists>f. linear f \<and> f ` B = C \<and> f ` S = T \<and> inj_on f S" |
|
49529 | 188 |
proof - |
53333 | 189 |
from B independent_bound have fB: "finite B" |
190 |
by blast |
|
191 |
from C independent_bound have fC: "finite C" |
|
192 |
by blast |
|
40377 | 193 |
from B(4) C(4) card_le_inj[of B C] d obtain f where |
60420 | 194 |
f: "f ` B \<subseteq> C" "inj_on f B" using \<open>finite B\<close> \<open>finite C\<close> by auto |
40377 | 195 |
from linear_independent_extend[OF B(2)] obtain g where |
53333 | 196 |
g: "linear g" "\<forall>x \<in> B. g x = f x" by blast |
40377 | 197 |
from inj_on_iff_eq_card[OF fB, of f] f(2) |
198 |
have "card (f ` B) = card B" by simp |
|
199 |
with B(4) C(4) have ceq: "card (f ` B) = card C" using d |
|
200 |
by simp |
|
201 |
have "g ` B = f ` B" using g(2) |
|
202 |
by (auto simp add: image_iff) |
|
203 |
also have "\<dots> = C" using card_subset_eq[OF fC f(1) ceq] . |
|
204 |
finally have gBC: "g ` B = C" . |
|
205 |
have gi: "inj_on g B" using f(2) g(2) |
|
206 |
by (auto simp add: inj_on_def) |
|
207 |
note g0 = linear_indep_image_lemma[OF g(1) fB, unfolded gBC, OF C(2) gi] |
|
53333 | 208 |
{ |
209 |
fix x y |
|
49529 | 210 |
assume x: "x \<in> S" and y: "y \<in> S" and gxy: "g x = g y" |
53333 | 211 |
from B(3) x y have x': "x \<in> span B" and y': "y \<in> span B" |
212 |
by blast+ |
|
213 |
from gxy have th0: "g (x - y) = 0" |
|
214 |
by (simp add: linear_sub[OF g(1)]) |
|
215 |
have th1: "x - y \<in> span B" using x' y' |
|
216 |
by (metis span_sub) |
|
217 |
have "x = y" using g0[OF th1 th0] by simp |
|
218 |
} |
|
219 |
then have giS: "inj_on g S" unfolding inj_on_def by blast |
|
40377 | 220 |
from span_subspace[OF B(1,3) s] |
53333 | 221 |
have "g ` S = span (g ` B)" |
222 |
by (simp add: span_linear_image[OF g(1)]) |
|
223 |
also have "\<dots> = span C" |
|
224 |
unfolding gBC .. |
|
225 |
also have "\<dots> = T" |
|
226 |
using span_subspace[OF C(1,3) t] . |
|
40377 | 227 |
finally have gS: "g ` S = T" . |
53333 | 228 |
from g(1) gS giS gBC show ?thesis |
229 |
by blast |
|
40377 | 230 |
qed |
231 |
||
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
232 |
lemma closure_bounded_linear_image_subset: |
44524 | 233 |
assumes f: "bounded_linear f" |
53333 | 234 |
shows "f ` closure S \<subseteq> closure (f ` S)" |
44524 | 235 |
using linear_continuous_on [OF f] closed_closure closure_subset |
236 |
by (rule image_closure_subset) |
|
237 |
||
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
238 |
lemma closure_linear_image_subset: |
53339 | 239 |
fixes f :: "'m::euclidean_space \<Rightarrow> 'n::real_normed_vector" |
49529 | 240 |
assumes "linear f" |
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
241 |
shows "f ` (closure S) \<subseteq> closure (f ` S)" |
44524 | 242 |
using assms unfolding linear_conv_bounded_linear |
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
243 |
by (rule closure_bounded_linear_image_subset) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
244 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
245 |
lemma closed_injective_linear_image: |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
246 |
fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
247 |
assumes S: "closed S" and f: "linear f" "inj f" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
248 |
shows "closed (f ` S)" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
249 |
proof - |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
250 |
obtain g where g: "linear g" "g \<circ> f = id" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
251 |
using linear_injective_left_inverse [OF f] by blast |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
252 |
then have confg: "continuous_on (range f) g" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
253 |
using linear_continuous_on linear_conv_bounded_linear by blast |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
254 |
have [simp]: "g ` f ` S = S" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
255 |
using g by (simp add: image_comp) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
256 |
have cgf: "closed (g ` f ` S)" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
257 |
by (simp add: `g \<circ> f = id` S image_comp) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
258 |
have [simp]: "{x \<in> range f. g x \<in> S} = f ` S" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
259 |
using g by (simp add: o_def id_def image_def) metis |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
260 |
show ?thesis |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
261 |
apply (rule closedin_closed_trans [of "range f"]) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
262 |
apply (rule continuous_closedin_preimage [OF confg cgf, simplified]) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
263 |
apply (rule closed_injective_image_subspace) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
264 |
using f |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
265 |
apply (auto simp: linear_linear linear_injective_0) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
266 |
done |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
267 |
qed |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
268 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
269 |
lemma closed_injective_linear_image_eq: |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
270 |
fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
271 |
assumes f: "linear f" "inj f" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
272 |
shows "(closed(image f s) \<longleftrightarrow> closed s)" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
273 |
by (metis closed_injective_linear_image closure_eq closure_linear_image_subset closure_subset_eq f(1) f(2) inj_image_subset_iff) |
40377 | 274 |
|
275 |
lemma closure_injective_linear_image: |
|
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
276 |
fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
277 |
shows "\<lbrakk>linear f; inj f\<rbrakk> \<Longrightarrow> f ` (closure S) = closure (f ` S)" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
278 |
apply (rule subset_antisym) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
279 |
apply (simp add: closure_linear_image_subset) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
280 |
by (simp add: closure_minimal closed_injective_linear_image closure_subset image_mono) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
281 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
282 |
lemma closure_bounded_linear_image: |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
283 |
fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
284 |
shows "\<lbrakk>linear f; bounded S\<rbrakk> \<Longrightarrow> f ` (closure S) = closure (f ` S)" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
285 |
apply (rule subset_antisym, simp add: closure_linear_image_subset) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
286 |
apply (rule closure_minimal, simp add: closure_subset image_mono) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
287 |
by (meson bounded_closure closed_closure compact_continuous_image compact_eq_bounded_closed linear_continuous_on linear_conv_bounded_linear) |
40377 | 288 |
|
44524 | 289 |
lemma closure_scaleR: |
53339 | 290 |
fixes S :: "'a::real_normed_vector set" |
44524 | 291 |
shows "(op *\<^sub>R c) ` (closure S) = closure ((op *\<^sub>R c) ` S)" |
292 |
proof |
|
293 |
show "(op *\<^sub>R c) ` (closure S) \<subseteq> closure ((op *\<^sub>R c) ` S)" |
|
53333 | 294 |
using bounded_linear_scaleR_right |
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
295 |
by (rule closure_bounded_linear_image_subset) |
44524 | 296 |
show "closure ((op *\<^sub>R c) ` S) \<subseteq> (op *\<^sub>R c) ` (closure S)" |
49529 | 297 |
by (intro closure_minimal image_mono closure_subset closed_scaling closed_closure) |
298 |
qed |
|
299 |
||
300 |
lemma fst_linear: "linear fst" |
|
53600
8fda7ad57466
make 'linear' into a sublocale of 'bounded_linear';
huffman
parents:
53406
diff
changeset
|
301 |
unfolding linear_iff by (simp add: algebra_simps) |
49529 | 302 |
|
303 |
lemma snd_linear: "linear snd" |
|
53600
8fda7ad57466
make 'linear' into a sublocale of 'bounded_linear';
huffman
parents:
53406
diff
changeset
|
304 |
unfolding linear_iff by (simp add: algebra_simps) |
49529 | 305 |
|
54465 | 306 |
lemma fst_snd_linear: "linear (\<lambda>(x,y). x + y)" |
53600
8fda7ad57466
make 'linear' into a sublocale of 'bounded_linear';
huffman
parents:
53406
diff
changeset
|
307 |
unfolding linear_iff by (simp add: algebra_simps) |
40377 | 308 |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
309 |
lemma scaleR_2: |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
310 |
fixes x :: "'a::real_vector" |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
311 |
shows "scaleR 2 x = x + x" |
49529 | 312 |
unfolding one_add_one [symmetric] scaleR_left_distrib by simp |
313 |
||
314 |
lemma vector_choose_size: |
|
53333 | 315 |
"0 \<le> c \<Longrightarrow> \<exists>x::'a::euclidean_space. norm x = c" |
316 |
apply (rule exI [where x="c *\<^sub>R (SOME i. i \<in> Basis)"]) |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
317 |
apply (auto simp: SOME_Basis) |
49529 | 318 |
done |
319 |
||
320 |
lemma setsum_delta_notmem: |
|
321 |
assumes "x \<notin> s" |
|
33175 | 322 |
shows "setsum (\<lambda>y. if (y = x) then P x else Q y) s = setsum Q s" |
49529 | 323 |
and "setsum (\<lambda>y. if (x = y) then P x else Q y) s = setsum Q s" |
324 |
and "setsum (\<lambda>y. if (y = x) then P y else Q y) s = setsum Q s" |
|
325 |
and "setsum (\<lambda>y. if (x = y) then P y else Q y) s = setsum Q s" |
|
57418 | 326 |
apply (rule_tac [!] setsum.cong) |
53333 | 327 |
using assms |
328 |
apply auto |
|
49529 | 329 |
done |
33175 | 330 |
|
331 |
lemma setsum_delta'': |
|
49529 | 332 |
fixes s::"'a::real_vector set" |
333 |
assumes "finite s" |
|
33175 | 334 |
shows "(\<Sum>x\<in>s. (if y = x then f x else 0) *\<^sub>R x) = (if y\<in>s then (f y) *\<^sub>R y else 0)" |
49529 | 335 |
proof - |
336 |
have *: "\<And>x y. (if y = x then f x else (0::real)) *\<^sub>R x = (if x=y then (f x) *\<^sub>R x else 0)" |
|
337 |
by auto |
|
338 |
show ?thesis |
|
57418 | 339 |
unfolding * using setsum.delta[OF assms, of y "\<lambda>x. f x *\<^sub>R x"] by auto |
33175 | 340 |
qed |
341 |
||
53333 | 342 |
lemma if_smult: "(if P then x else (y::real)) *\<^sub>R v = (if P then x *\<^sub>R v else y *\<^sub>R v)" |
57418 | 343 |
by (fact if_distrib) |
33175 | 344 |
|
345 |
lemma dist_triangle_eq: |
|
44361
75ec83d45303
remove unnecessary euclidean_space class constraints
huffman
parents:
44349
diff
changeset
|
346 |
fixes x y z :: "'a::real_inner" |
53333 | 347 |
shows "dist x z = dist x y + dist y z \<longleftrightarrow> |
348 |
norm (x - y) *\<^sub>R (y - z) = norm (y - z) *\<^sub>R (x - y)" |
|
49529 | 349 |
proof - |
350 |
have *: "x - y + (y - z) = x - z" by auto |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
351 |
show ?thesis unfolding dist_norm norm_triangle_eq[of "x - y" "y - z", unfolded *] |
49529 | 352 |
by (auto simp add:norm_minus_commute) |
353 |
qed |
|
33175 | 354 |
|
53406 | 355 |
lemma norm_minus_eqI: "x = - y \<Longrightarrow> norm x = norm y" by auto |
33175 | 356 |
|
49529 | 357 |
lemma Min_grI: |
358 |
assumes "finite A" "A \<noteq> {}" "\<forall>a\<in>A. x < a" |
|
359 |
shows "x < Min A" |
|
33175 | 360 |
unfolding Min_gr_iff[OF assms(1,2)] using assms(3) by auto |
361 |
||
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
362 |
lemma norm_lt: "norm x < norm y \<longleftrightarrow> inner x x < inner y y" |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
363 |
unfolding norm_eq_sqrt_inner by simp |
33175 | 364 |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
365 |
lemma norm_le: "norm x \<le> norm y \<longleftrightarrow> inner x x \<le> inner y y" |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
366 |
unfolding norm_eq_sqrt_inner by simp |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
367 |
|
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
368 |
|
60420 | 369 |
subsection \<open>Affine set and affine hull\<close> |
33175 | 370 |
|
49529 | 371 |
definition affine :: "'a::real_vector set \<Rightarrow> bool" |
372 |
where "affine s \<longleftrightarrow> (\<forall>x\<in>s. \<forall>y\<in>s. \<forall>u v. u + v = 1 \<longrightarrow> u *\<^sub>R x + v *\<^sub>R y \<in> s)" |
|
33175 | 373 |
|
374 |
lemma affine_alt: "affine s \<longleftrightarrow> (\<forall>x\<in>s. \<forall>y\<in>s. \<forall>u::real. (1 - u) *\<^sub>R x + u *\<^sub>R y \<in> s)" |
|
49529 | 375 |
unfolding affine_def by (metis eq_diff_eq') |
33175 | 376 |
|
377 |
lemma affine_empty[intro]: "affine {}" |
|
378 |
unfolding affine_def by auto |
|
379 |
||
380 |
lemma affine_sing[intro]: "affine {x}" |
|
381 |
unfolding affine_alt by (auto simp add: scaleR_left_distrib [symmetric]) |
|
382 |
||
383 |
lemma affine_UNIV[intro]: "affine UNIV" |
|
384 |
unfolding affine_def by auto |
|
385 |
||
60585 | 386 |
lemma affine_Inter[intro]: "(\<forall>s\<in>f. affine s) \<Longrightarrow> affine (\<Inter>f)" |
49531 | 387 |
unfolding affine_def by auto |
33175 | 388 |
|
60303 | 389 |
lemma affine_Int[intro]: "affine s \<Longrightarrow> affine t \<Longrightarrow> affine (s \<inter> t)" |
33175 | 390 |
unfolding affine_def by auto |
391 |
||
60303 | 392 |
lemma affine_affine_hull [simp]: "affine(affine hull s)" |
49529 | 393 |
unfolding hull_def |
394 |
using affine_Inter[of "{t. affine t \<and> s \<subseteq> t}"] by auto |
|
33175 | 395 |
|
396 |
lemma affine_hull_eq[simp]: "(affine hull s = s) \<longleftrightarrow> affine s" |
|
49529 | 397 |
by (metis affine_affine_hull hull_same) |
398 |
||
33175 | 399 |
|
60420 | 400 |
subsubsection \<open>Some explicit formulations (from Lars Schewe)\<close> |
33175 | 401 |
|
49529 | 402 |
lemma affine: |
403 |
fixes V::"'a::real_vector set" |
|
404 |
shows "affine V \<longleftrightarrow> |
|
405 |
(\<forall>s u. finite s \<and> s \<noteq> {} \<and> s \<subseteq> V \<and> setsum u s = 1 \<longrightarrow> (setsum (\<lambda>x. (u x) *\<^sub>R x)) s \<in> V)" |
|
406 |
unfolding affine_def |
|
407 |
apply rule |
|
408 |
apply(rule, rule, rule) |
|
49531 | 409 |
apply(erule conjE)+ |
49529 | 410 |
defer |
411 |
apply (rule, rule, rule, rule, rule) |
|
412 |
proof - |
|
413 |
fix x y u v |
|
414 |
assume as: "x \<in> V" "y \<in> V" "u + v = (1::real)" |
|
33175 | 415 |
"\<forall>s u. finite s \<and> s \<noteq> {} \<and> s \<subseteq> V \<and> setsum u s = 1 \<longrightarrow> (\<Sum>x\<in>s. u x *\<^sub>R x) \<in> V" |
49529 | 416 |
then show "u *\<^sub>R x + v *\<^sub>R y \<in> V" |
417 |
apply (cases "x = y") |
|
418 |
using as(4)[THEN spec[where x="{x,y}"], THEN spec[where x="\<lambda>w. if w = x then u else v"]] |
|
419 |
and as(1-3) |
|
53333 | 420 |
apply (auto simp add: scaleR_left_distrib[symmetric]) |
421 |
done |
|
33175 | 422 |
next |
49529 | 423 |
fix s u |
424 |
assume as: "\<forall>x\<in>V. \<forall>y\<in>V. \<forall>u v. u + v = 1 \<longrightarrow> u *\<^sub>R x + v *\<^sub>R y \<in> V" |
|
33175 | 425 |
"finite s" "s \<noteq> {}" "s \<subseteq> V" "setsum u s = (1::real)" |
426 |
def n \<equiv> "card s" |
|
427 |
have "card s = 0 \<or> card s = 1 \<or> card s = 2 \<or> card s > 2" by auto |
|
49529 | 428 |
then show "(\<Sum>x\<in>s. u x *\<^sub>R x) \<in> V" |
429 |
proof (auto simp only: disjE) |
|
430 |
assume "card s = 2" |
|
53333 | 431 |
then have "card s = Suc (Suc 0)" |
432 |
by auto |
|
433 |
then obtain a b where "s = {a, b}" |
|
434 |
unfolding card_Suc_eq by auto |
|
49529 | 435 |
then show ?thesis |
436 |
using as(1)[THEN bspec[where x=a], THEN bspec[where x=b]] using as(4,5) |
|
437 |
by (auto simp add: setsum_clauses(2)) |
|
438 |
next |
|
439 |
assume "card s > 2" |
|
440 |
then show ?thesis using as and n_def |
|
441 |
proof (induct n arbitrary: u s) |
|
442 |
case 0 |
|
443 |
then show ?case by auto |
|
444 |
next |
|
445 |
case (Suc n) |
|
446 |
fix s :: "'a set" and u :: "'a \<Rightarrow> real" |
|
447 |
assume IA: |
|
448 |
"\<And>u s. \<lbrakk>2 < card s; \<forall>x\<in>V. \<forall>y\<in>V. \<forall>u v. u + v = 1 \<longrightarrow> u *\<^sub>R x + v *\<^sub>R y \<in> V; finite s; |
|
449 |
s \<noteq> {}; s \<subseteq> V; setsum u s = 1; n = card s \<rbrakk> \<Longrightarrow> (\<Sum>x\<in>s. u x *\<^sub>R x) \<in> V" |
|
450 |
and as: |
|
451 |
"Suc n = card s" "2 < card s" "\<forall>x\<in>V. \<forall>y\<in>V. \<forall>u v. u + v = 1 \<longrightarrow> u *\<^sub>R x + v *\<^sub>R y \<in> V" |
|
33175 | 452 |
"finite s" "s \<noteq> {}" "s \<subseteq> V" "setsum u s = 1" |
49529 | 453 |
have "\<exists>x\<in>s. u x \<noteq> 1" |
454 |
proof (rule ccontr) |
|
455 |
assume "\<not> ?thesis" |
|
53333 | 456 |
then have "setsum u s = real_of_nat (card s)" |
457 |
unfolding card_eq_setsum by auto |
|
49529 | 458 |
then show False |
60420 | 459 |
using as(7) and \<open>card s > 2\<close> |
49529 | 460 |
by (metis One_nat_def less_Suc0 Zero_not_Suc of_nat_1 of_nat_eq_iff numeral_2_eq_2) |
45498
2dc373f1867a
avoid numeral-representation-specific rules in metis proof
huffman
parents:
45051
diff
changeset
|
461 |
qed |
53339 | 462 |
then obtain x where x:"x \<in> s" "u x \<noteq> 1" by auto |
33175 | 463 |
|
49529 | 464 |
have c: "card (s - {x}) = card s - 1" |
53333 | 465 |
apply (rule card_Diff_singleton) |
60420 | 466 |
using \<open>x\<in>s\<close> as(4) |
53333 | 467 |
apply auto |
468 |
done |
|
49529 | 469 |
have *: "s = insert x (s - {x})" "finite (s - {x})" |
60420 | 470 |
using \<open>x\<in>s\<close> and as(4) by auto |
49529 | 471 |
have **: "setsum u (s - {x}) = 1 - u x" |
49530 | 472 |
using setsum_clauses(2)[OF *(2), of u x, unfolded *(1)[symmetric] as(7)] by auto |
49529 | 473 |
have ***: "inverse (1 - u x) * setsum u (s - {x}) = 1" |
60420 | 474 |
unfolding ** using \<open>u x \<noteq> 1\<close> by auto |
49529 | 475 |
have "(\<Sum>xa\<in>s - {x}. (inverse (1 - u x) * u xa) *\<^sub>R xa) \<in> V" |
476 |
proof (cases "card (s - {x}) > 2") |
|
477 |
case True |
|
478 |
then have "s - {x} \<noteq> {}" "card (s - {x}) = n" |
|
479 |
unfolding c and as(1)[symmetric] |
|
49531 | 480 |
proof (rule_tac ccontr) |
49529 | 481 |
assume "\<not> s - {x} \<noteq> {}" |
49531 | 482 |
then have "card (s - {x}) = 0" unfolding card_0_eq[OF *(2)] by simp |
49529 | 483 |
then show False using True by auto |
484 |
qed auto |
|
485 |
then show ?thesis |
|
486 |
apply (rule_tac IA[of "s - {x}" "\<lambda>y. (inverse (1 - u x) * u y)"]) |
|
53333 | 487 |
unfolding setsum_right_distrib[symmetric] |
488 |
using as and *** and True |
|
49529 | 489 |
apply auto |
490 |
done |
|
491 |
next |
|
492 |
case False |
|
53333 | 493 |
then have "card (s - {x}) = Suc (Suc 0)" |
494 |
using as(2) and c by auto |
|
495 |
then obtain a b where "(s - {x}) = {a, b}" "a\<noteq>b" |
|
496 |
unfolding card_Suc_eq by auto |
|
497 |
then show ?thesis |
|
498 |
using as(3)[THEN bspec[where x=a], THEN bspec[where x=b]] |
|
60420 | 499 |
using *** *(2) and \<open>s \<subseteq> V\<close> |
53333 | 500 |
unfolding setsum_right_distrib |
501 |
by (auto simp add: setsum_clauses(2)) |
|
49529 | 502 |
qed |
503 |
then have "u x + (1 - u x) = 1 \<Longrightarrow> |
|
504 |
u x *\<^sub>R x + (1 - u x) *\<^sub>R ((\<Sum>xa\<in>s - {x}. u xa *\<^sub>R xa) /\<^sub>R (1 - u x)) \<in> V" |
|
505 |
apply - |
|
506 |
apply (rule as(3)[rule_format]) |
|
51524 | 507 |
unfolding Real_Vector_Spaces.scaleR_right.setsum |
53333 | 508 |
using x(1) as(6) |
509 |
apply auto |
|
49529 | 510 |
done |
511 |
then show "(\<Sum>x\<in>s. u x *\<^sub>R x) \<in> V" |
|
49530 | 512 |
unfolding scaleR_scaleR[symmetric] and scaleR_right.setsum [symmetric] |
49529 | 513 |
apply (subst *) |
514 |
unfolding setsum_clauses(2)[OF *(2)] |
|
60420 | 515 |
using \<open>u x \<noteq> 1\<close> |
53333 | 516 |
apply auto |
49529 | 517 |
done |
518 |
qed |
|
519 |
next |
|
520 |
assume "card s = 1" |
|
53333 | 521 |
then obtain a where "s={a}" |
522 |
by (auto simp add: card_Suc_eq) |
|
523 |
then show ?thesis |
|
524 |
using as(4,5) by simp |
|
60420 | 525 |
qed (insert \<open>s\<noteq>{}\<close> \<open>finite s\<close>, auto) |
33175 | 526 |
qed |
527 |
||
528 |
lemma affine_hull_explicit: |
|
53333 | 529 |
"affine hull p = |
530 |
{y. \<exists>s u. finite s \<and> s \<noteq> {} \<and> s \<subseteq> p \<and> setsum u s = 1 \<and> setsum (\<lambda>v. (u v) *\<^sub>R v) s = y}" |
|
49529 | 531 |
apply (rule hull_unique) |
532 |
apply (subst subset_eq) |
|
533 |
prefer 3 |
|
534 |
apply rule |
|
535 |
unfolding mem_Collect_eq |
|
536 |
apply (erule exE)+ |
|
537 |
apply (erule conjE)+ |
|
538 |
prefer 2 |
|
539 |
apply rule |
|
540 |
proof - |
|
541 |
fix x |
|
542 |
assume "x\<in>p" |
|
543 |
then show "\<exists>s u. finite s \<and> s \<noteq> {} \<and> s \<subseteq> p \<and> setsum u s = 1 \<and> (\<Sum>v\<in>s. u v *\<^sub>R v) = x" |
|
53333 | 544 |
apply (rule_tac x="{x}" in exI) |
545 |
apply (rule_tac x="\<lambda>x. 1" in exI) |
|
49529 | 546 |
apply auto |
547 |
done |
|
33175 | 548 |
next |
49529 | 549 |
fix t x s u |
53333 | 550 |
assume as: "p \<subseteq> t" "affine t" "finite s" "s \<noteq> {}" |
551 |
"s \<subseteq> p" "setsum u s = 1" "(\<Sum>v\<in>s. u v *\<^sub>R v) = x" |
|
49529 | 552 |
then show "x \<in> t" |
53333 | 553 |
using as(2)[unfolded affine, THEN spec[where x=s], THEN spec[where x=u]] |
554 |
by auto |
|
33175 | 555 |
next |
49529 | 556 |
show "affine {y. \<exists>s u. finite s \<and> s \<noteq> {} \<and> s \<subseteq> p \<and> setsum u s = 1 \<and> (\<Sum>v\<in>s. u v *\<^sub>R v) = y}" |
557 |
unfolding affine_def |
|
558 |
apply (rule, rule, rule, rule, rule) |
|
559 |
unfolding mem_Collect_eq |
|
560 |
proof - |
|
561 |
fix u v :: real |
|
562 |
assume uv: "u + v = 1" |
|
563 |
fix x |
|
564 |
assume "\<exists>s u. finite s \<and> s \<noteq> {} \<and> s \<subseteq> p \<and> setsum u s = 1 \<and> (\<Sum>v\<in>s. u v *\<^sub>R v) = x" |
|
565 |
then obtain sx ux where |
|
53333 | 566 |
x: "finite sx" "sx \<noteq> {}" "sx \<subseteq> p" "setsum ux sx = 1" "(\<Sum>v\<in>sx. ux v *\<^sub>R v) = x" |
567 |
by auto |
|
568 |
fix y |
|
569 |
assume "\<exists>s u. finite s \<and> s \<noteq> {} \<and> s \<subseteq> p \<and> setsum u s = 1 \<and> (\<Sum>v\<in>s. u v *\<^sub>R v) = y" |
|
49529 | 570 |
then obtain sy uy where |
571 |
y: "finite sy" "sy \<noteq> {}" "sy \<subseteq> p" "setsum uy sy = 1" "(\<Sum>v\<in>sy. uy v *\<^sub>R v) = y" by auto |
|
53333 | 572 |
have xy: "finite (sx \<union> sy)" |
573 |
using x(1) y(1) by auto |
|
574 |
have **: "(sx \<union> sy) \<inter> sx = sx" "(sx \<union> sy) \<inter> sy = sy" |
|
575 |
by auto |
|
49529 | 576 |
show "\<exists>s ua. finite s \<and> s \<noteq> {} \<and> s \<subseteq> p \<and> |
577 |
setsum ua s = 1 \<and> (\<Sum>v\<in>s. ua v *\<^sub>R v) = u *\<^sub>R x + v *\<^sub>R y" |
|
578 |
apply (rule_tac x="sx \<union> sy" in exI) |
|
579 |
apply (rule_tac x="\<lambda>a. (if a\<in>sx then u * ux a else 0) + (if a\<in>sy then v * uy a else 0)" in exI) |
|
57418 | 580 |
unfolding scaleR_left_distrib setsum.distrib if_smult scaleR_zero_left |
581 |
** setsum.inter_restrict[OF xy, symmetric] |
|
53333 | 582 |
unfolding scaleR_scaleR[symmetric] Real_Vector_Spaces.scaleR_right.setsum [symmetric] |
583 |
and setsum_right_distrib[symmetric] |
|
49529 | 584 |
unfolding x y |
53333 | 585 |
using x(1-3) y(1-3) uv |
586 |
apply simp |
|
49529 | 587 |
done |
588 |
qed |
|
589 |
qed |
|
33175 | 590 |
|
591 |
lemma affine_hull_finite: |
|
592 |
assumes "finite s" |
|
593 |
shows "affine hull s = {y. \<exists>u. setsum u s = 1 \<and> setsum (\<lambda>v. u v *\<^sub>R v) s = y}" |
|
53333 | 594 |
unfolding affine_hull_explicit and set_eq_iff and mem_Collect_eq |
595 |
apply (rule, rule) |
|
596 |
apply (erule exE)+ |
|
597 |
apply (erule conjE)+ |
|
49529 | 598 |
defer |
599 |
apply (erule exE) |
|
600 |
apply (erule conjE) |
|
601 |
proof - |
|
602 |
fix x u |
|
603 |
assume "setsum u s = 1" "(\<Sum>v\<in>s. u v *\<^sub>R v) = x" |
|
604 |
then show "\<exists>sa u. finite sa \<and> |
|
605 |
\<not> (\<forall>x. (x \<in> sa) = (x \<in> {})) \<and> sa \<subseteq> s \<and> setsum u sa = 1 \<and> (\<Sum>v\<in>sa. u v *\<^sub>R v) = x" |
|
606 |
apply (rule_tac x=s in exI, rule_tac x=u in exI) |
|
53333 | 607 |
using assms |
608 |
apply auto |
|
49529 | 609 |
done |
33175 | 610 |
next |
49529 | 611 |
fix x t u |
612 |
assume "t \<subseteq> s" |
|
53333 | 613 |
then have *: "s \<inter> t = t" |
614 |
by auto |
|
33175 | 615 |
assume "finite t" "\<not> (\<forall>x. (x \<in> t) = (x \<in> {}))" "setsum u t = 1" "(\<Sum>v\<in>t. u v *\<^sub>R v) = x" |
49529 | 616 |
then show "\<exists>u. setsum u s = 1 \<and> (\<Sum>v\<in>s. u v *\<^sub>R v) = x" |
617 |
apply (rule_tac x="\<lambda>x. if x\<in>t then u x else 0" in exI) |
|
57418 | 618 |
unfolding if_smult scaleR_zero_left and setsum.inter_restrict[OF assms, symmetric] and * |
49529 | 619 |
apply auto |
620 |
done |
|
621 |
qed |
|
622 |
||
33175 | 623 |
|
60420 | 624 |
subsubsection \<open>Stepping theorems and hence small special cases\<close> |
33175 | 625 |
|
626 |
lemma affine_hull_empty[simp]: "affine hull {} = {}" |
|
49529 | 627 |
by (rule hull_unique) auto |
33175 | 628 |
|
629 |
lemma affine_hull_finite_step: |
|
630 |
fixes y :: "'a::real_vector" |
|
49529 | 631 |
shows |
632 |
"(\<exists>u. setsum u {} = w \<and> setsum (\<lambda>x. u x *\<^sub>R x) {} = y) \<longleftrightarrow> w = 0 \<and> y = 0" (is ?th1) |
|
53347 | 633 |
and |
49529 | 634 |
"finite s \<Longrightarrow> |
635 |
(\<exists>u. setsum u (insert a s) = w \<and> setsum (\<lambda>x. u x *\<^sub>R x) (insert a s) = y) \<longleftrightarrow> |
|
53347 | 636 |
(\<exists>v u. setsum u s = w - v \<and> setsum (\<lambda>x. u x *\<^sub>R x) s = y - v *\<^sub>R a)" (is "_ \<Longrightarrow> ?lhs = ?rhs") |
49529 | 637 |
proof - |
33175 | 638 |
show ?th1 by simp |
53347 | 639 |
assume fin: "finite s" |
640 |
show "?lhs = ?rhs" |
|
641 |
proof |
|
53302 | 642 |
assume ?lhs |
643 |
then obtain u where u: "setsum u (insert a s) = w \<and> (\<Sum>x\<in>insert a s. u x *\<^sub>R x) = y" |
|
644 |
by auto |
|
53347 | 645 |
show ?rhs |
49529 | 646 |
proof (cases "a \<in> s") |
647 |
case True |
|
648 |
then have *: "insert a s = s" by auto |
|
53302 | 649 |
show ?thesis |
650 |
using u[unfolded *] |
|
651 |
apply(rule_tac x=0 in exI) |
|
652 |
apply auto |
|
653 |
done |
|
33175 | 654 |
next |
49529 | 655 |
case False |
656 |
then show ?thesis |
|
657 |
apply (rule_tac x="u a" in exI) |
|
53347 | 658 |
using u and fin |
53302 | 659 |
apply auto |
49529 | 660 |
done |
53302 | 661 |
qed |
53347 | 662 |
next |
53302 | 663 |
assume ?rhs |
664 |
then obtain v u where vu: "setsum u s = w - v" "(\<Sum>x\<in>s. u x *\<^sub>R x) = y - v *\<^sub>R a" |
|
665 |
by auto |
|
666 |
have *: "\<And>x M. (if x = a then v else M) *\<^sub>R x = (if x = a then v *\<^sub>R x else M *\<^sub>R x)" |
|
667 |
by auto |
|
53347 | 668 |
show ?lhs |
49529 | 669 |
proof (cases "a \<in> s") |
670 |
case True |
|
671 |
then show ?thesis |
|
672 |
apply (rule_tac x="\<lambda>x. (if x=a then v else 0) + u x" in exI) |
|
53347 | 673 |
unfolding setsum_clauses(2)[OF fin] |
53333 | 674 |
apply simp |
57418 | 675 |
unfolding scaleR_left_distrib and setsum.distrib |
33175 | 676 |
unfolding vu and * and scaleR_zero_left |
57418 | 677 |
apply (auto simp add: setsum.delta[OF fin]) |
49529 | 678 |
done |
33175 | 679 |
next |
49531 | 680 |
case False |
49529 | 681 |
then have **: |
682 |
"\<And>x. x \<in> s \<Longrightarrow> u x = (if x = a then v else u x)" |
|
683 |
"\<And>x. x \<in> s \<Longrightarrow> u x *\<^sub>R x = (if x = a then v *\<^sub>R x else u x *\<^sub>R x)" by auto |
|
33175 | 684 |
from False show ?thesis |
49529 | 685 |
apply (rule_tac x="\<lambda>x. if x=a then v else u x" in exI) |
53347 | 686 |
unfolding setsum_clauses(2)[OF fin] and * using vu |
57418 | 687 |
using setsum.cong [of s _ "\<lambda>x. u x *\<^sub>R x" "\<lambda>x. if x = a then v *\<^sub>R x else u x *\<^sub>R x", OF _ **(2)] |
688 |
using setsum.cong [of s _ u "\<lambda>x. if x = a then v else u x", OF _ **(1)] |
|
49529 | 689 |
apply auto |
690 |
done |
|
691 |
qed |
|
53347 | 692 |
qed |
33175 | 693 |
qed |
694 |
||
695 |
lemma affine_hull_2: |
|
696 |
fixes a b :: "'a::real_vector" |
|
53302 | 697 |
shows "affine hull {a,b} = {u *\<^sub>R a + v *\<^sub>R b| u v. (u + v = 1)}" |
698 |
(is "?lhs = ?rhs") |
|
49529 | 699 |
proof - |
700 |
have *: |
|
49531 | 701 |
"\<And>x y z. z = x - y \<longleftrightarrow> y + z = (x::real)" |
49529 | 702 |
"\<And>x y z. z = x - y \<longleftrightarrow> y + z = (x::'a)" by auto |
33175 | 703 |
have "?lhs = {y. \<exists>u. setsum u {a, b} = 1 \<and> (\<Sum>v\<in>{a, b}. u v *\<^sub>R v) = y}" |
704 |
using affine_hull_finite[of "{a,b}"] by auto |
|
705 |
also have "\<dots> = {y. \<exists>v u. u b = 1 - v \<and> u b *\<^sub>R b = y - v *\<^sub>R a}" |
|
49529 | 706 |
by (simp add: affine_hull_finite_step(2)[of "{b}" a]) |
33175 | 707 |
also have "\<dots> = ?rhs" unfolding * by auto |
708 |
finally show ?thesis by auto |
|
709 |
qed |
|
710 |
||
711 |
lemma affine_hull_3: |
|
712 |
fixes a b c :: "'a::real_vector" |
|
53302 | 713 |
shows "affine hull {a,b,c} = { u *\<^sub>R a + v *\<^sub>R b + w *\<^sub>R c| u v w. u + v + w = 1}" |
49529 | 714 |
proof - |
715 |
have *: |
|
49531 | 716 |
"\<And>x y z. z = x - y \<longleftrightarrow> y + z = (x::real)" |
49529 | 717 |
"\<And>x y z. z = x - y \<longleftrightarrow> y + z = (x::'a)" by auto |
718 |
show ?thesis |
|
719 |
apply (simp add: affine_hull_finite affine_hull_finite_step) |
|
720 |
unfolding * |
|
721 |
apply auto |
|
53302 | 722 |
apply (rule_tac x=v in exI) |
723 |
apply (rule_tac x=va in exI) |
|
724 |
apply auto |
|
725 |
apply (rule_tac x=u in exI) |
|
726 |
apply force |
|
49529 | 727 |
done |
33175 | 728 |
qed |
729 |
||
40377 | 730 |
lemma mem_affine: |
53333 | 731 |
assumes "affine S" "x \<in> S" "y \<in> S" "u + v = 1" |
53347 | 732 |
shows "u *\<^sub>R x + v *\<^sub>R y \<in> S" |
40377 | 733 |
using assms affine_def[of S] by auto |
734 |
||
735 |
lemma mem_affine_3: |
|
53333 | 736 |
assumes "affine S" "x \<in> S" "y \<in> S" "z \<in> S" "u + v + w = 1" |
53347 | 737 |
shows "u *\<^sub>R x + v *\<^sub>R y + w *\<^sub>R z \<in> S" |
49529 | 738 |
proof - |
53347 | 739 |
have "u *\<^sub>R x + v *\<^sub>R y + w *\<^sub>R z \<in> affine hull {x, y, z}" |
49529 | 740 |
using affine_hull_3[of x y z] assms by auto |
741 |
moreover |
|
53347 | 742 |
have "affine hull {x, y, z} \<subseteq> affine hull S" |
49529 | 743 |
using hull_mono[of "{x, y, z}" "S"] assms by auto |
744 |
moreover |
|
53347 | 745 |
have "affine hull S = S" |
746 |
using assms affine_hull_eq[of S] by auto |
|
49531 | 747 |
ultimately show ?thesis by auto |
40377 | 748 |
qed |
749 |
||
750 |
lemma mem_affine_3_minus: |
|
53333 | 751 |
assumes "affine S" "x \<in> S" "y \<in> S" "z \<in> S" |
752 |
shows "x + v *\<^sub>R (y-z) \<in> S" |
|
753 |
using mem_affine_3[of S x y z 1 v "-v"] assms |
|
754 |
by (simp add: algebra_simps) |
|
40377 | 755 |
|
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
756 |
corollary mem_affine_3_minus2: |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
757 |
"\<lbrakk>affine S; x \<in> S; y \<in> S; z \<in> S\<rbrakk> \<Longrightarrow> x - v *\<^sub>R (y-z) \<in> S" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
758 |
by (metis add_uminus_conv_diff mem_affine_3_minus real_vector.scale_minus_left) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
759 |
|
40377 | 760 |
|
60420 | 761 |
subsubsection \<open>Some relations between affine hull and subspaces\<close> |
33175 | 762 |
|
763 |
lemma affine_hull_insert_subset_span: |
|
49529 | 764 |
"affine hull (insert a s) \<subseteq> {a + v| v . v \<in> span {x - a | x . x \<in> s}}" |
765 |
unfolding subset_eq Ball_def |
|
766 |
unfolding affine_hull_explicit span_explicit mem_Collect_eq |
|
50804 | 767 |
apply (rule, rule) |
768 |
apply (erule exE)+ |
|
769 |
apply (erule conjE)+ |
|
49529 | 770 |
proof - |
771 |
fix x t u |
|
772 |
assume as: "finite t" "t \<noteq> {}" "t \<subseteq> insert a s" "setsum u t = 1" "(\<Sum>v\<in>t. u v *\<^sub>R v) = x" |
|
53333 | 773 |
have "(\<lambda>x. x - a) ` (t - {a}) \<subseteq> {x - a |x. x \<in> s}" |
774 |
using as(3) by auto |
|
49529 | 775 |
then show "\<exists>v. x = a + v \<and> (\<exists>S u. finite S \<and> S \<subseteq> {x - a |x. x \<in> s} \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = v)" |
776 |
apply (rule_tac x="x - a" in exI) |
|
33175 | 777 |
apply (rule conjI, simp) |
49529 | 778 |
apply (rule_tac x="(\<lambda>x. x - a) ` (t - {a})" in exI) |
779 |
apply (rule_tac x="\<lambda>x. u (x + a)" in exI) |
|
33175 | 780 |
apply (rule conjI) using as(1) apply simp |
781 |
apply (erule conjI) |
|
782 |
using as(1) |
|
57418 | 783 |
apply (simp add: setsum.reindex[unfolded inj_on_def] scaleR_right_diff_distrib |
49530 | 784 |
setsum_subtractf scaleR_left.setsum[symmetric] setsum_diff1 scaleR_left_diff_distrib) |
49529 | 785 |
unfolding as |
786 |
apply simp |
|
787 |
done |
|
788 |
qed |
|
33175 | 789 |
|
790 |
lemma affine_hull_insert_span: |
|
791 |
assumes "a \<notin> s" |
|
49529 | 792 |
shows "affine hull (insert a s) = {a + v | v . v \<in> span {x - a | x. x \<in> s}}" |
793 |
apply (rule, rule affine_hull_insert_subset_span) |
|
794 |
unfolding subset_eq Ball_def |
|
795 |
unfolding affine_hull_explicit and mem_Collect_eq |
|
796 |
proof (rule, rule, erule exE, erule conjE) |
|
49531 | 797 |
fix y v |
49529 | 798 |
assume "y = a + v" "v \<in> span {x - a |x. x \<in> s}" |
53339 | 799 |
then obtain t u where obt: "finite t" "t \<subseteq> {x - a |x. x \<in> s}" "a + (\<Sum>v\<in>t. u v *\<^sub>R v) = y" |
49529 | 800 |
unfolding span_explicit by auto |
33175 | 801 |
def f \<equiv> "(\<lambda>x. x + a) ` t" |
53333 | 802 |
have f: "finite f" "f \<subseteq> s" "(\<Sum>v\<in>f. u (v - a) *\<^sub>R (v - a)) = y - a" |
57418 | 803 |
unfolding f_def using obt by (auto simp add: setsum.reindex[unfolded inj_on_def]) |
53333 | 804 |
have *: "f \<inter> {a} = {}" "f \<inter> - {a} = f" |
805 |
using f(2) assms by auto |
|
33175 | 806 |
show "\<exists>sa u. finite sa \<and> sa \<noteq> {} \<and> sa \<subseteq> insert a s \<and> setsum u sa = 1 \<and> (\<Sum>v\<in>sa. u v *\<^sub>R v) = y" |
49529 | 807 |
apply (rule_tac x = "insert a f" in exI) |
808 |
apply (rule_tac x = "\<lambda>x. if x=a then 1 - setsum (\<lambda>x. u (x - a)) f else u (x - a)" in exI) |
|
53339 | 809 |
using assms and f |
810 |
unfolding setsum_clauses(2)[OF f(1)] and if_smult |
|
57418 | 811 |
unfolding setsum.If_cases[OF f(1), of "\<lambda>x. x = a"] |
49529 | 812 |
apply (auto simp add: setsum_subtractf scaleR_left.setsum algebra_simps *) |
813 |
done |
|
814 |
qed |
|
33175 | 815 |
|
816 |
lemma affine_hull_span: |
|
817 |
assumes "a \<in> s" |
|
818 |
shows "affine hull s = {a + v | v. v \<in> span {x - a | x. x \<in> s - {a}}}" |
|
819 |
using affine_hull_insert_span[of a "s - {a}", unfolded insert_Diff[OF assms]] by auto |
|
820 |
||
49529 | 821 |
|
60420 | 822 |
subsubsection \<open>Parallel affine sets\<close> |
40377 | 823 |
|
53347 | 824 |
definition affine_parallel :: "'a::real_vector set \<Rightarrow> 'a::real_vector set \<Rightarrow> bool" |
53339 | 825 |
where "affine_parallel S T \<longleftrightarrow> (\<exists>a. T = (\<lambda>x. a + x) ` S)" |
40377 | 826 |
|
827 |
lemma affine_parallel_expl_aux: |
|
49529 | 828 |
fixes S T :: "'a::real_vector set" |
53339 | 829 |
assumes "\<forall>x. x \<in> S \<longleftrightarrow> a + x \<in> T" |
830 |
shows "T = (\<lambda>x. a + x) ` S" |
|
49529 | 831 |
proof - |
53302 | 832 |
{ |
833 |
fix x |
|
53339 | 834 |
assume "x \<in> T" |
835 |
then have "( - a) + x \<in> S" |
|
836 |
using assms by auto |
|
837 |
then have "x \<in> ((\<lambda>x. a + x) ` S)" |
|
53333 | 838 |
using imageI[of "-a+x" S "(\<lambda>x. a+x)"] by auto |
53302 | 839 |
} |
53339 | 840 |
moreover have "T \<ge> (\<lambda>x. a + x) ` S" |
53333 | 841 |
using assms by auto |
49529 | 842 |
ultimately show ?thesis by auto |
843 |
qed |
|
844 |
||
53339 | 845 |
lemma affine_parallel_expl: "affine_parallel S T \<longleftrightarrow> (\<exists>a. \<forall>x. x \<in> S \<longleftrightarrow> a + x \<in> T)" |
49529 | 846 |
unfolding affine_parallel_def |
847 |
using affine_parallel_expl_aux[of S _ T] by auto |
|
848 |
||
849 |
lemma affine_parallel_reflex: "affine_parallel S S" |
|
53302 | 850 |
unfolding affine_parallel_def |
851 |
apply (rule exI[of _ "0"]) |
|
852 |
apply auto |
|
853 |
done |
|
40377 | 854 |
|
855 |
lemma affine_parallel_commut: |
|
49529 | 856 |
assumes "affine_parallel A B" |
857 |
shows "affine_parallel B A" |
|
858 |
proof - |
|
54230
b1d955791529
more simplification rules on unary and binary minus
haftmann
parents:
53676
diff
changeset
|
859 |
from assms obtain a where B: "B = (\<lambda>x. a + x) ` A" |
49529 | 860 |
unfolding affine_parallel_def by auto |
54230
b1d955791529
more simplification rules on unary and binary minus
haftmann
parents:
53676
diff
changeset
|
861 |
have [simp]: "(\<lambda>x. x - a) = plus (- a)" by (simp add: fun_eq_iff) |
b1d955791529
more simplification rules on unary and binary minus
haftmann
parents:
53676
diff
changeset
|
862 |
from B show ?thesis |
53333 | 863 |
using translation_galois [of B a A] |
864 |
unfolding affine_parallel_def by auto |
|
40377 | 865 |
qed |
866 |
||
867 |
lemma affine_parallel_assoc: |
|
53339 | 868 |
assumes "affine_parallel A B" |
869 |
and "affine_parallel B C" |
|
49531 | 870 |
shows "affine_parallel A C" |
49529 | 871 |
proof - |
53333 | 872 |
from assms obtain ab where "B = (\<lambda>x. ab + x) ` A" |
49531 | 873 |
unfolding affine_parallel_def by auto |
874 |
moreover |
|
53333 | 875 |
from assms obtain bc where "C = (\<lambda>x. bc + x) ` B" |
49529 | 876 |
unfolding affine_parallel_def by auto |
877 |
ultimately show ?thesis |
|
878 |
using translation_assoc[of bc ab A] unfolding affine_parallel_def by auto |
|
40377 | 879 |
qed |
880 |
||
881 |
lemma affine_translation_aux: |
|
882 |
fixes a :: "'a::real_vector" |
|
53333 | 883 |
assumes "affine ((\<lambda>x. a + x) ` S)" |
884 |
shows "affine S" |
|
53302 | 885 |
proof - |
886 |
{ |
|
887 |
fix x y u v |
|
53333 | 888 |
assume xy: "x \<in> S" "y \<in> S" "(u :: real) + v = 1" |
889 |
then have "(a + x) \<in> ((\<lambda>x. a + x) ` S)" "(a + y) \<in> ((\<lambda>x. a + x) ` S)" |
|
890 |
by auto |
|
53339 | 891 |
then have h1: "u *\<^sub>R (a + x) + v *\<^sub>R (a + y) \<in> (\<lambda>x. a + x) ` S" |
49529 | 892 |
using xy assms unfolding affine_def by auto |
53339 | 893 |
have "u *\<^sub>R (a + x) + v *\<^sub>R (a + y) = (u + v) *\<^sub>R a + (u *\<^sub>R x + v *\<^sub>R y)" |
49529 | 894 |
by (simp add: algebra_simps) |
53339 | 895 |
also have "\<dots> = a + (u *\<^sub>R x + v *\<^sub>R y)" |
60420 | 896 |
using \<open>u + v = 1\<close> by auto |
53339 | 897 |
ultimately have "a + (u *\<^sub>R x + v *\<^sub>R y) \<in> (\<lambda>x. a + x) ` S" |
53333 | 898 |
using h1 by auto |
49529 | 899 |
then have "u *\<^sub>R x + v *\<^sub>R y : S" by auto |
900 |
} |
|
901 |
then show ?thesis unfolding affine_def by auto |
|
40377 | 902 |
qed |
903 |
||
904 |
lemma affine_translation: |
|
905 |
fixes a :: "'a::real_vector" |
|
53339 | 906 |
shows "affine S \<longleftrightarrow> affine ((\<lambda>x. a + x) ` S)" |
49529 | 907 |
proof - |
53339 | 908 |
have "affine S \<Longrightarrow> affine ((\<lambda>x. a + x) ` S)" |
909 |
using affine_translation_aux[of "-a" "((\<lambda>x. a + x) ` S)"] |
|
49529 | 910 |
using translation_assoc[of "-a" a S] by auto |
911 |
then show ?thesis using affine_translation_aux by auto |
|
40377 | 912 |
qed |
913 |
||
914 |
lemma parallel_is_affine: |
|
49529 | 915 |
fixes S T :: "'a::real_vector set" |
916 |
assumes "affine S" "affine_parallel S T" |
|
917 |
shows "affine T" |
|
918 |
proof - |
|
53339 | 919 |
from assms obtain a where "T = (\<lambda>x. a + x) ` S" |
49531 | 920 |
unfolding affine_parallel_def by auto |
53339 | 921 |
then show ?thesis |
922 |
using affine_translation assms by auto |
|
40377 | 923 |
qed |
924 |
||
44361
75ec83d45303
remove unnecessary euclidean_space class constraints
huffman
parents:
44349
diff
changeset
|
925 |
lemma subspace_imp_affine: "subspace s \<Longrightarrow> affine s" |
40377 | 926 |
unfolding subspace_def affine_def by auto |
927 |
||
49529 | 928 |
|
60420 | 929 |
subsubsection \<open>Subspace parallel to an affine set\<close> |
40377 | 930 |
|
53339 | 931 |
lemma subspace_affine: "subspace S \<longleftrightarrow> affine S \<and> 0 \<in> S" |
49529 | 932 |
proof - |
53333 | 933 |
have h0: "subspace S \<Longrightarrow> affine S \<and> 0 \<in> S" |
49529 | 934 |
using subspace_imp_affine[of S] subspace_0 by auto |
53302 | 935 |
{ |
53333 | 936 |
assume assm: "affine S \<and> 0 \<in> S" |
53302 | 937 |
{ |
938 |
fix c :: real |
|
54465 | 939 |
fix x |
940 |
assume x: "x \<in> S" |
|
49529 | 941 |
have "c *\<^sub>R x = (1-c) *\<^sub>R 0 + c *\<^sub>R x" by auto |
942 |
moreover |
|
53339 | 943 |
have "(1 - c) *\<^sub>R 0 + c *\<^sub>R x \<in> S" |
54465 | 944 |
using affine_alt[of S] assm x by auto |
53333 | 945 |
ultimately have "c *\<^sub>R x \<in> S" by auto |
49529 | 946 |
} |
53333 | 947 |
then have h1: "\<forall>c. \<forall>x \<in> S. c *\<^sub>R x \<in> S" by auto |
49529 | 948 |
|
53302 | 949 |
{ |
950 |
fix x y |
|
54465 | 951 |
assume xy: "x \<in> S" "y \<in> S" |
49529 | 952 |
def u == "(1 :: real)/2" |
53302 | 953 |
have "(1/2) *\<^sub>R (x+y) = (1/2) *\<^sub>R (x+y)" |
954 |
by auto |
|
49529 | 955 |
moreover |
53302 | 956 |
have "(1/2) *\<^sub>R (x+y)=(1/2) *\<^sub>R x + (1-(1/2)) *\<^sub>R y" |
957 |
by (simp add: algebra_simps) |
|
49529 | 958 |
moreover |
54465 | 959 |
have "(1 - u) *\<^sub>R x + u *\<^sub>R y \<in> S" |
960 |
using affine_alt[of S] assm xy by auto |
|
49529 | 961 |
ultimately |
53333 | 962 |
have "(1/2) *\<^sub>R (x+y) \<in> S" |
53302 | 963 |
using u_def by auto |
49529 | 964 |
moreover |
54465 | 965 |
have "x + y = 2 *\<^sub>R ((1/2) *\<^sub>R (x+y))" |
53302 | 966 |
by auto |
49529 | 967 |
ultimately |
54465 | 968 |
have "x + y \<in> S" |
53302 | 969 |
using h1[rule_format, of "(1/2) *\<^sub>R (x+y)" "2"] by auto |
49529 | 970 |
} |
53302 | 971 |
then have "\<forall>x \<in> S. \<forall>y \<in> S. x + y \<in> S" |
972 |
by auto |
|
973 |
then have "subspace S" |
|
974 |
using h1 assm unfolding subspace_def by auto |
|
49529 | 975 |
} |
976 |
then show ?thesis using h0 by metis |
|
40377 | 977 |
qed |
978 |
||
979 |
lemma affine_diffs_subspace: |
|
53333 | 980 |
assumes "affine S" "a \<in> S" |
53302 | 981 |
shows "subspace ((\<lambda>x. (-a)+x) ` S)" |
49529 | 982 |
proof - |
54230
b1d955791529
more simplification rules on unary and binary minus
haftmann
parents:
53676
diff
changeset
|
983 |
have [simp]: "(\<lambda>x. x - a) = plus (- a)" by (simp add: fun_eq_iff) |
53302 | 984 |
have "affine ((\<lambda>x. (-a)+x) ` S)" |
49531 | 985 |
using affine_translation assms by auto |
53302 | 986 |
moreover have "0 : ((\<lambda>x. (-a)+x) ` S)" |
53333 | 987 |
using assms exI[of "(\<lambda>x. x\<in>S \<and> -a+x = 0)" a] by auto |
49531 | 988 |
ultimately show ?thesis using subspace_affine by auto |
40377 | 989 |
qed |
990 |
||
991 |
lemma parallel_subspace_explicit: |
|
54465 | 992 |
assumes "affine S" |
993 |
and "a \<in> S" |
|
994 |
assumes "L \<equiv> {y. \<exists>x \<in> S. (-a) + x = y}" |
|
995 |
shows "subspace L \<and> affine_parallel S L" |
|
49529 | 996 |
proof - |
54230
b1d955791529
more simplification rules on unary and binary minus
haftmann
parents:
53676
diff
changeset
|
997 |
from assms have "L = plus (- a) ` S" by auto |
b1d955791529
more simplification rules on unary and binary minus
haftmann
parents:
53676
diff
changeset
|
998 |
then have par: "affine_parallel S L" |
54465 | 999 |
unfolding affine_parallel_def .. |
49531 | 1000 |
then have "affine L" using assms parallel_is_affine by auto |
53302 | 1001 |
moreover have "0 \<in> L" |
54230
b1d955791529
more simplification rules on unary and binary minus
haftmann
parents:
53676
diff
changeset
|
1002 |
using assms by auto |
53302 | 1003 |
ultimately show ?thesis |
1004 |
using subspace_affine par by auto |
|
40377 | 1005 |
qed |
1006 |
||
1007 |
lemma parallel_subspace_aux: |
|
53302 | 1008 |
assumes "subspace A" |
1009 |
and "subspace B" |
|
1010 |
and "affine_parallel A B" |
|
1011 |
shows "A \<supseteq> B" |
|
49529 | 1012 |
proof - |
54465 | 1013 |
from assms obtain a where a: "\<forall>x. x \<in> A \<longleftrightarrow> a + x \<in> B" |
49529 | 1014 |
using affine_parallel_expl[of A B] by auto |
53302 | 1015 |
then have "-a \<in> A" |
1016 |
using assms subspace_0[of B] by auto |
|
1017 |
then have "a \<in> A" |
|
1018 |
using assms subspace_neg[of A "-a"] by auto |
|
1019 |
then show ?thesis |
|
54465 | 1020 |
using assms a unfolding subspace_def by auto |
40377 | 1021 |
qed |
1022 |
||
1023 |
lemma parallel_subspace: |
|
53302 | 1024 |
assumes "subspace A" |
1025 |
and "subspace B" |
|
1026 |
and "affine_parallel A B" |
|
49529 | 1027 |
shows "A = B" |
1028 |
proof |
|
53302 | 1029 |
show "A \<supseteq> B" |
49529 | 1030 |
using assms parallel_subspace_aux by auto |
53302 | 1031 |
show "A \<subseteq> B" |
49529 | 1032 |
using assms parallel_subspace_aux[of B A] affine_parallel_commut by auto |
40377 | 1033 |
qed |
1034 |
||
1035 |
lemma affine_parallel_subspace: |
|
53302 | 1036 |
assumes "affine S" "S \<noteq> {}" |
53339 | 1037 |
shows "\<exists>!L. subspace L \<and> affine_parallel S L" |
49529 | 1038 |
proof - |
53339 | 1039 |
have ex: "\<exists>L. subspace L \<and> affine_parallel S L" |
49531 | 1040 |
using assms parallel_subspace_explicit by auto |
53302 | 1041 |
{ |
1042 |
fix L1 L2 |
|
53339 | 1043 |
assume ass: "subspace L1 \<and> affine_parallel S L1" "subspace L2 \<and> affine_parallel S L2" |
49529 | 1044 |
then have "affine_parallel L1 L2" |
1045 |
using affine_parallel_commut[of S L1] affine_parallel_assoc[of L1 S L2] by auto |
|
1046 |
then have "L1 = L2" |
|
1047 |
using ass parallel_subspace by auto |
|
1048 |
} |
|
1049 |
then show ?thesis using ex by auto |
|
1050 |
qed |
|
1051 |
||
40377 | 1052 |
|
60420 | 1053 |
subsection \<open>Cones\<close> |
33175 | 1054 |
|
49529 | 1055 |
definition cone :: "'a::real_vector set \<Rightarrow> bool" |
53339 | 1056 |
where "cone s \<longleftrightarrow> (\<forall>x\<in>s. \<forall>c\<ge>0. c *\<^sub>R x \<in> s)" |
33175 | 1057 |
|
1058 |
lemma cone_empty[intro, simp]: "cone {}" |
|
1059 |
unfolding cone_def by auto |
|
1060 |
||
1061 |
lemma cone_univ[intro, simp]: "cone UNIV" |
|
1062 |
unfolding cone_def by auto |
|
1063 |
||
53339 | 1064 |
lemma cone_Inter[intro]: "\<forall>s\<in>f. cone s \<Longrightarrow> cone (\<Inter>f)" |
33175 | 1065 |
unfolding cone_def by auto |
1066 |
||
49529 | 1067 |
|
60420 | 1068 |
subsubsection \<open>Conic hull\<close> |
33175 | 1069 |
|
1070 |
lemma cone_cone_hull: "cone (cone hull s)" |
|
44170
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44142
diff
changeset
|
1071 |
unfolding hull_def by auto |
33175 | 1072 |
|
53302 | 1073 |
lemma cone_hull_eq: "cone hull s = s \<longleftrightarrow> cone s" |
49529 | 1074 |
apply (rule hull_eq) |
53302 | 1075 |
using cone_Inter |
1076 |
unfolding subset_eq |
|
1077 |
apply auto |
|
49529 | 1078 |
done |
33175 | 1079 |
|
40377 | 1080 |
lemma mem_cone: |
53302 | 1081 |
assumes "cone S" "x \<in> S" "c \<ge> 0" |
40377 | 1082 |
shows "c *\<^sub>R x : S" |
1083 |
using assms cone_def[of S] by auto |
|
1084 |
||
1085 |
lemma cone_contains_0: |
|
49529 | 1086 |
assumes "cone S" |
53302 | 1087 |
shows "S \<noteq> {} \<longleftrightarrow> 0 \<in> S" |
49529 | 1088 |
proof - |
53302 | 1089 |
{ |
1090 |
assume "S \<noteq> {}" |
|
1091 |
then obtain a where "a \<in> S" by auto |
|
1092 |
then have "0 \<in> S" |
|
1093 |
using assms mem_cone[of S a 0] by auto |
|
49529 | 1094 |
} |
1095 |
then show ?thesis by auto |
|
40377 | 1096 |
qed |
1097 |
||
44361
75ec83d45303
remove unnecessary euclidean_space class constraints
huffman
parents:
44349
diff
changeset
|
1098 |
lemma cone_0: "cone {0}" |
49529 | 1099 |
unfolding cone_def by auto |
40377 | 1100 |
|
53302 | 1101 |
lemma cone_Union[intro]: "(\<forall>s\<in>f. cone s) \<longrightarrow> cone (Union f)" |
40377 | 1102 |
unfolding cone_def by blast |
1103 |
||
1104 |
lemma cone_iff: |
|
53347 | 1105 |
assumes "S \<noteq> {}" |
1106 |
shows "cone S \<longleftrightarrow> 0 \<in> S \<and> (\<forall>c. c > 0 \<longrightarrow> (op *\<^sub>R c) ` S = S)" |
|
49529 | 1107 |
proof - |
53302 | 1108 |
{ |
1109 |
assume "cone S" |
|
1110 |
{ |
|
53347 | 1111 |
fix c :: real |
1112 |
assume "c > 0" |
|
53302 | 1113 |
{ |
1114 |
fix x |
|
53347 | 1115 |
assume "x \<in> S" |
1116 |
then have "x \<in> (op *\<^sub>R c) ` S" |
|
49529 | 1117 |
unfolding image_def |
60420 | 1118 |
using \<open>cone S\<close> \<open>c>0\<close> mem_cone[of S x "1/c"] |
54465 | 1119 |
exI[of "(\<lambda>t. t \<in> S \<and> x = c *\<^sub>R t)" "(1 / c) *\<^sub>R x"] |
53347 | 1120 |
by auto |
49529 | 1121 |
} |
1122 |
moreover |
|
53302 | 1123 |
{ |
1124 |
fix x |
|
53347 | 1125 |
assume "x \<in> (op *\<^sub>R c) ` S" |
1126 |
then have "x \<in> S" |
|
60420 | 1127 |
using \<open>cone S\<close> \<open>c > 0\<close> |
1128 |
unfolding cone_def image_def \<open>c > 0\<close> by auto |
|
49529 | 1129 |
} |
53302 | 1130 |
ultimately have "(op *\<^sub>R c) ` S = S" by auto |
40377 | 1131 |
} |
53339 | 1132 |
then have "0 \<in> S \<and> (\<forall>c. c > 0 \<longrightarrow> (op *\<^sub>R c) ` S = S)" |
60420 | 1133 |
using \<open>cone S\<close> cone_contains_0[of S] assms by auto |
49529 | 1134 |
} |
1135 |
moreover |
|
53302 | 1136 |
{ |
53339 | 1137 |
assume a: "0 \<in> S \<and> (\<forall>c. c > 0 \<longrightarrow> (op *\<^sub>R c) ` S = S)" |
53302 | 1138 |
{ |
1139 |
fix x |
|
1140 |
assume "x \<in> S" |
|
53347 | 1141 |
fix c1 :: real |
1142 |
assume "c1 \<ge> 0" |
|
1143 |
then have "c1 = 0 \<or> c1 > 0" by auto |
|
60420 | 1144 |
then have "c1 *\<^sub>R x \<in> S" using a \<open>x \<in> S\<close> by auto |
49529 | 1145 |
} |
1146 |
then have "cone S" unfolding cone_def by auto |
|
40377 | 1147 |
} |
49529 | 1148 |
ultimately show ?thesis by blast |
1149 |
qed |
|
1150 |
||
1151 |
lemma cone_hull_empty: "cone hull {} = {}" |
|
1152 |
by (metis cone_empty cone_hull_eq) |
|
1153 |
||
53302 | 1154 |
lemma cone_hull_empty_iff: "S = {} \<longleftrightarrow> cone hull S = {}" |
49529 | 1155 |
by (metis bot_least cone_hull_empty hull_subset xtrans(5)) |
1156 |
||
53302 | 1157 |
lemma cone_hull_contains_0: "S \<noteq> {} \<longleftrightarrow> 0 \<in> cone hull S" |
49529 | 1158 |
using cone_cone_hull[of S] cone_contains_0[of "cone hull S"] cone_hull_empty_iff[of S] |
1159 |
by auto |
|
40377 | 1160 |
|
1161 |
lemma mem_cone_hull: |
|
53347 | 1162 |
assumes "x \<in> S" "c \<ge> 0" |
53302 | 1163 |
shows "c *\<^sub>R x \<in> cone hull S" |
49529 | 1164 |
by (metis assms cone_cone_hull hull_inc mem_cone) |
1165 |
||
53339 | 1166 |
lemma cone_hull_expl: "cone hull S = {c *\<^sub>R x | c x. c \<ge> 0 \<and> x \<in> S}" |
1167 |
(is "?lhs = ?rhs") |
|
49529 | 1168 |
proof - |
53302 | 1169 |
{ |
1170 |
fix x |
|
1171 |
assume "x \<in> ?rhs" |
|
54465 | 1172 |
then obtain cx :: real and xx where x: "x = cx *\<^sub>R xx" "cx \<ge> 0" "xx \<in> S" |
49529 | 1173 |
by auto |
53347 | 1174 |
fix c :: real |
1175 |
assume c: "c \<ge> 0" |
|
53339 | 1176 |
then have "c *\<^sub>R x = (c * cx) *\<^sub>R xx" |
54465 | 1177 |
using x by (simp add: algebra_simps) |
49529 | 1178 |
moreover |
56536 | 1179 |
have "c * cx \<ge> 0" using c x by auto |
49529 | 1180 |
ultimately |
54465 | 1181 |
have "c *\<^sub>R x \<in> ?rhs" using x by auto |
53302 | 1182 |
} |
53347 | 1183 |
then have "cone ?rhs" |
1184 |
unfolding cone_def by auto |
|
1185 |
then have "?rhs \<in> Collect cone" |
|
1186 |
unfolding mem_Collect_eq by auto |
|
53302 | 1187 |
{ |
1188 |
fix x |
|
1189 |
assume "x \<in> S" |
|
1190 |
then have "1 *\<^sub>R x \<in> ?rhs" |
|
49531 | 1191 |
apply auto |
53347 | 1192 |
apply (rule_tac x = 1 in exI) |
49529 | 1193 |
apply auto |
1194 |
done |
|
53302 | 1195 |
then have "x \<in> ?rhs" by auto |
53347 | 1196 |
} |
1197 |
then have "S \<subseteq> ?rhs" by auto |
|
53302 | 1198 |
then have "?lhs \<subseteq> ?rhs" |
60420 | 1199 |
using \<open>?rhs \<in> Collect cone\<close> hull_minimal[of S "?rhs" "cone"] by auto |
49529 | 1200 |
moreover |
53302 | 1201 |
{ |
1202 |
fix x |
|
1203 |
assume "x \<in> ?rhs" |
|
54465 | 1204 |
then obtain cx :: real and xx where x: "x = cx *\<^sub>R xx" "cx \<ge> 0" "xx \<in> S" |
53339 | 1205 |
by auto |
1206 |
then have "xx \<in> cone hull S" |
|
1207 |
using hull_subset[of S] by auto |
|
53302 | 1208 |
then have "x \<in> ?lhs" |
54465 | 1209 |
using x cone_cone_hull[of S] cone_def[of "cone hull S"] by auto |
49529 | 1210 |
} |
1211 |
ultimately show ?thesis by auto |
|
40377 | 1212 |
qed |
1213 |
||
1214 |
lemma cone_closure: |
|
53347 | 1215 |
fixes S :: "'a::real_normed_vector set" |
49529 | 1216 |
assumes "cone S" |
1217 |
shows "cone (closure S)" |
|
1218 |
proof (cases "S = {}") |
|
1219 |
case True |
|
1220 |
then show ?thesis by auto |
|
1221 |
next |
|
1222 |
case False |
|
53339 | 1223 |
then have "0 \<in> S \<and> (\<forall>c. c > 0 \<longrightarrow> op *\<^sub>R c ` S = S)" |
49529 | 1224 |
using cone_iff[of S] assms by auto |
53339 | 1225 |
then have "0 \<in> closure S \<and> (\<forall>c. c > 0 \<longrightarrow> op *\<^sub>R c ` closure S = closure S)" |
49529 | 1226 |
using closure_subset by (auto simp add: closure_scaleR) |
53339 | 1227 |
then show ?thesis |
60974
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
1228 |
using False cone_iff[of "closure S"] by auto |
49529 | 1229 |
qed |
1230 |
||
40377 | 1231 |
|
60420 | 1232 |
subsection \<open>Affine dependence and consequential theorems (from Lars Schewe)\<close> |
33175 | 1233 |
|
49529 | 1234 |
definition affine_dependent :: "'a::real_vector set \<Rightarrow> bool" |
53339 | 1235 |
where "affine_dependent s \<longleftrightarrow> (\<exists>x\<in>s. x \<in> affine hull (s - {x}))" |
33175 | 1236 |
|
1237 |
lemma affine_dependent_explicit: |
|
1238 |
"affine_dependent p \<longleftrightarrow> |
|
1239 |
(\<exists>s u. finite s \<and> s \<subseteq> p \<and> setsum u s = 0 \<and> |
|
53347 | 1240 |
(\<exists>v\<in>s. u v \<noteq> 0) \<and> setsum (\<lambda>v. u v *\<^sub>R v) s = 0)" |
49529 | 1241 |
unfolding affine_dependent_def affine_hull_explicit mem_Collect_eq |
1242 |
apply rule |
|
1243 |
apply (erule bexE, erule exE, erule exE) |
|
1244 |
apply (erule conjE)+ |
|
1245 |
defer |
|
1246 |
apply (erule exE, erule exE) |
|
1247 |
apply (erule conjE)+ |
|
1248 |
apply (erule bexE) |
|
1249 |
proof - |
|
1250 |
fix x s u |
|
1251 |
assume as: "x \<in> p" "finite s" "s \<noteq> {}" "s \<subseteq> p - {x}" "setsum u s = 1" "(\<Sum>v\<in>s. u v *\<^sub>R v) = x" |
|
53302 | 1252 |
have "x \<notin> s" using as(1,4) by auto |
33175 | 1253 |
show "\<exists>s u. finite s \<and> s \<subseteq> p \<and> setsum u s = 0 \<and> (\<exists>v\<in>s. u v \<noteq> 0) \<and> (\<Sum>v\<in>s. u v *\<^sub>R v) = 0" |
49529 | 1254 |
apply (rule_tac x="insert x s" in exI, rule_tac x="\<lambda>v. if v = x then - 1 else u v" in exI) |
60420 | 1255 |
unfolding if_smult and setsum_clauses(2)[OF as(2)] and setsum_delta_notmem[OF \<open>x\<notin>s\<close>] and as |
53339 | 1256 |
using as |
1257 |
apply auto |
|
49529 | 1258 |
done |
33175 | 1259 |
next |
49529 | 1260 |
fix s u v |
53302 | 1261 |
assume as: "finite s" "s \<subseteq> p" "setsum u s = 0" "(\<Sum>v\<in>s. u v *\<^sub>R v) = 0" "v \<in> s" "u v \<noteq> 0" |
53339 | 1262 |
have "s \<noteq> {v}" |
1263 |
using as(3,6) by auto |
|
49529 | 1264 |
then show "\<exists>x\<in>p. \<exists>s u. finite s \<and> s \<noteq> {} \<and> s \<subseteq> p - {x} \<and> setsum u s = 1 \<and> (\<Sum>v\<in>s. u v *\<^sub>R v) = x" |
53302 | 1265 |
apply (rule_tac x=v in bexI) |
1266 |
apply (rule_tac x="s - {v}" in exI) |
|
1267 |
apply (rule_tac x="\<lambda>x. - (1 / u v) * u x" in exI) |
|
49530 | 1268 |
unfolding scaleR_scaleR[symmetric] and scaleR_right.setsum [symmetric] |
1269 |
unfolding setsum_right_distrib[symmetric] and setsum_diff1[OF as(1)] |
|
53302 | 1270 |
using as |
1271 |
apply auto |
|
49529 | 1272 |
done |
33175 | 1273 |
qed |
1274 |
||
1275 |
lemma affine_dependent_explicit_finite: |
|
49529 | 1276 |
fixes s :: "'a::real_vector set" |
1277 |
assumes "finite s" |
|
53302 | 1278 |
shows "affine_dependent s \<longleftrightarrow> |
1279 |
(\<exists>u. setsum u s = 0 \<and> (\<exists>v\<in>s. u v \<noteq> 0) \<and> setsum (\<lambda>v. u v *\<^sub>R v) s = 0)" |
|
33175 | 1280 |
(is "?lhs = ?rhs") |
1281 |
proof |
|
53347 | 1282 |
have *: "\<And>vt u v. (if vt then u v else 0) *\<^sub>R v = (if vt then (u v) *\<^sub>R v else 0::'a)" |
49529 | 1283 |
by auto |
33175 | 1284 |
assume ?lhs |
49529 | 1285 |
then obtain t u v where |
53339 | 1286 |
"finite t" "t \<subseteq> s" "setsum u t = 0" "v\<in>t" "u v \<noteq> 0" "(\<Sum>v\<in>t. u v *\<^sub>R v) = 0" |
33175 | 1287 |
unfolding affine_dependent_explicit by auto |
49529 | 1288 |
then show ?rhs |
1289 |
apply (rule_tac x="\<lambda>x. if x\<in>t then u x else 0" in exI) |
|
57418 | 1290 |
apply auto unfolding * and setsum.inter_restrict[OF assms, symmetric] |
60420 | 1291 |
unfolding Int_absorb1[OF \<open>t\<subseteq>s\<close>] |
49529 | 1292 |
apply auto |
1293 |
done |
|
33175 | 1294 |
next |
1295 |
assume ?rhs |
|
53339 | 1296 |
then obtain u v where "setsum u s = 0" "v\<in>s" "u v \<noteq> 0" "(\<Sum>v\<in>s. u v *\<^sub>R v) = 0" |
1297 |
by auto |
|
49529 | 1298 |
then show ?lhs unfolding affine_dependent_explicit |
1299 |
using assms by auto |
|
1300 |
qed |
|
1301 |
||
33175 | 1302 |
|
60420 | 1303 |
subsection \<open>Connectedness of convex sets\<close> |
44465
fa56622bb7bc
move connected_real_lemma to the one place it is used
huffman
parents:
44457
diff
changeset
|
1304 |
|
51480
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
hoelzl
parents:
51475
diff
changeset
|
1305 |
lemma connectedD: |
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
hoelzl
parents:
51475
diff
changeset
|
1306 |
"connected S \<Longrightarrow> open A \<Longrightarrow> open B \<Longrightarrow> S \<subseteq> A \<union> B \<Longrightarrow> A \<inter> B \<inter> S = {} \<Longrightarrow> A \<inter> S = {} \<or> B \<inter> S = {}" |
61426
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61222
diff
changeset
|
1307 |
by (rule Topological_Spaces.topological_space_class.connectedD) |
33175 | 1308 |
|
1309 |
lemma convex_connected: |
|
1310 |
fixes s :: "'a::real_normed_vector set" |
|
53302 | 1311 |
assumes "convex s" |
1312 |
shows "connected s" |
|
51480
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
hoelzl
parents:
51475
diff
changeset
|
1313 |
proof (rule connectedI) |
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
hoelzl
parents:
51475
diff
changeset
|
1314 |
fix A B |
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
hoelzl
parents:
51475
diff
changeset
|
1315 |
assume "open A" "open B" "A \<inter> B \<inter> s = {}" "s \<subseteq> A \<union> B" |
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
hoelzl
parents:
51475
diff
changeset
|
1316 |
moreover |
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
hoelzl
parents:
51475
diff
changeset
|
1317 |
assume "A \<inter> s \<noteq> {}" "B \<inter> s \<noteq> {}" |
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
hoelzl
parents:
51475
diff
changeset
|
1318 |
then obtain a b where a: "a \<in> A" "a \<in> s" and b: "b \<in> B" "b \<in> s" by auto |
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
hoelzl
parents:
51475
diff
changeset
|
1319 |
def f \<equiv> "\<lambda>u. u *\<^sub>R a + (1 - u) *\<^sub>R b" |
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
hoelzl
parents:
51475
diff
changeset
|
1320 |
then have "continuous_on {0 .. 1} f" |
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56369
diff
changeset
|
1321 |
by (auto intro!: continuous_intros) |
51480
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
hoelzl
parents:
51475
diff
changeset
|
1322 |
then have "connected (f ` {0 .. 1})" |
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
hoelzl
parents:
51475
diff
changeset
|
1323 |
by (auto intro!: connected_continuous_image) |
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
hoelzl
parents:
51475
diff
changeset
|
1324 |
note connectedD[OF this, of A B] |
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
hoelzl
parents:
51475
diff
changeset
|
1325 |
moreover have "a \<in> A \<inter> f ` {0 .. 1}" |
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
hoelzl
parents:
51475
diff
changeset
|
1326 |
using a by (auto intro!: image_eqI[of _ _ 1] simp: f_def) |
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
hoelzl
parents:
51475
diff
changeset
|
1327 |
moreover have "b \<in> B \<inter> f ` {0 .. 1}" |
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
hoelzl
parents:
51475
diff
changeset
|
1328 |
using b by (auto intro!: image_eqI[of _ _ 0] simp: f_def) |
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
hoelzl
parents:
51475
diff
changeset
|
1329 |
moreover have "f ` {0 .. 1} \<subseteq> s" |
60420 | 1330 |
using \<open>convex s\<close> a b unfolding convex_def f_def by auto |
51480
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
hoelzl
parents:
51475
diff
changeset
|
1331 |
ultimately show False by auto |
33175 | 1332 |
qed |
1333 |
||
61426
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61222
diff
changeset
|
1334 |
corollary connected_UNIV[intro]: "connected (UNIV :: 'a::real_normed_vector set)" |
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61222
diff
changeset
|
1335 |
by(simp add: convex_connected) |
33175 | 1336 |
|
60420 | 1337 |
text \<open>Balls, being convex, are connected.\<close> |
33175 | 1338 |
|
56188 | 1339 |
lemma convex_prod: |
53347 | 1340 |
assumes "\<And>i. i \<in> Basis \<Longrightarrow> convex {x. P i x}" |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
1341 |
shows "convex {x. \<forall>i\<in>Basis. P i (x\<bullet>i)}" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
1342 |
using assms unfolding convex_def |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
1343 |
by (auto simp: inner_add_left) |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
1344 |
|
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
1345 |
lemma convex_positive_orthant: "convex {x::'a::euclidean_space. (\<forall>i\<in>Basis. 0 \<le> x\<bullet>i)}" |
56188 | 1346 |
by (rule convex_prod) (simp add: atLeast_def[symmetric] convex_real_interval) |
33175 | 1347 |
|
1348 |
lemma convex_local_global_minimum: |
|
1349 |
fixes s :: "'a::real_normed_vector set" |
|
53347 | 1350 |
assumes "e > 0" |
1351 |
and "convex_on s f" |
|
1352 |
and "ball x e \<subseteq> s" |
|
1353 |
and "\<forall>y\<in>ball x e. f x \<le> f y" |
|
33175 | 1354 |
shows "\<forall>y\<in>s. f x \<le> f y" |
53302 | 1355 |
proof (rule ccontr) |
1356 |
have "x \<in> s" using assms(1,3) by auto |
|
1357 |
assume "\<not> ?thesis" |
|
1358 |
then obtain y where "y\<in>s" and y: "f x > f y" by auto |
|
53347 | 1359 |
then have xy: "0 < dist x y" |
1360 |
by (auto simp add: dist_nz[symmetric]) |
|
1361 |
||
1362 |
then obtain u where "0 < u" "u \<le> 1" and u: "u < e / dist x y" |
|
60420 | 1363 |
using real_lbound_gt_zero[of 1 "e / dist x y"] xy \<open>e>0\<close> by auto |
53302 | 1364 |
then have "f ((1-u) *\<^sub>R x + u *\<^sub>R y) \<le> (1-u) * f x + u * f y" |
60420 | 1365 |
using \<open>x\<in>s\<close> \<open>y\<in>s\<close> |
53302 | 1366 |
using assms(2)[unfolded convex_on_def, |
1367 |
THEN bspec[where x=x], THEN bspec[where x=y], THEN spec[where x="1-u"]] |
|
50804 | 1368 |
by auto |
33175 | 1369 |
moreover |
50804 | 1370 |
have *: "x - ((1 - u) *\<^sub>R x + u *\<^sub>R y) = u *\<^sub>R (x - y)" |
1371 |
by (simp add: algebra_simps) |
|
1372 |
have "(1 - u) *\<^sub>R x + u *\<^sub>R y \<in> ball x e" |
|
53302 | 1373 |
unfolding mem_ball dist_norm |
60420 | 1374 |
unfolding * and norm_scaleR and abs_of_pos[OF \<open>0<u\<close>] |
50804 | 1375 |
unfolding dist_norm[symmetric] |
53302 | 1376 |
using u |
1377 |
unfolding pos_less_divide_eq[OF xy] |
|
1378 |
by auto |
|
1379 |
then have "f x \<le> f ((1 - u) *\<^sub>R x + u *\<^sub>R y)" |
|
1380 |
using assms(4) by auto |
|
50804 | 1381 |
ultimately show False |
60420 | 1382 |
using mult_strict_left_mono[OF y \<open>u>0\<close>] |
53302 | 1383 |
unfolding left_diff_distrib |
1384 |
by auto |
|
33175 | 1385 |
qed |
1386 |
||
60800
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
1387 |
lemma convex_ball [iff]: |
33175 | 1388 |
fixes x :: "'a::real_normed_vector" |
49531 | 1389 |
shows "convex (ball x e)" |
50804 | 1390 |
proof (auto simp add: convex_def) |
1391 |
fix y z |
|
1392 |
assume yz: "dist x y < e" "dist x z < e" |
|
1393 |
fix u v :: real |
|
1394 |
assume uv: "0 \<le> u" "0 \<le> v" "u + v = 1" |
|
1395 |
have "dist x (u *\<^sub>R y + v *\<^sub>R z) \<le> u * dist x y + v * dist x z" |
|
1396 |
using uv yz |
|
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1397 |
using convex_on_dist [of "ball x e" x, unfolded convex_on_def, |
53302 | 1398 |
THEN bspec[where x=y], THEN bspec[where x=z]] |
50804 | 1399 |
by auto |
1400 |
then show "dist x (u *\<^sub>R y + v *\<^sub>R z) < e" |
|
1401 |
using convex_bound_lt[OF yz uv] by auto |
|
33175 | 1402 |
qed |
1403 |
||
60800
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
1404 |
lemma convex_cball [iff]: |
33175 | 1405 |
fixes x :: "'a::real_normed_vector" |
53347 | 1406 |
shows "convex (cball x e)" |
1407 |
proof - |
|
1408 |
{ |
|
1409 |
fix y z |
|
1410 |
assume yz: "dist x y \<le> e" "dist x z \<le> e" |
|
1411 |
fix u v :: real |
|
1412 |
assume uv: "0 \<le> u" "0 \<le> v" "u + v = 1" |
|
1413 |
have "dist x (u *\<^sub>R y + v *\<^sub>R z) \<le> u * dist x y + v * dist x z" |
|
1414 |
using uv yz |
|
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1415 |
using convex_on_dist [of "cball x e" x, unfolded convex_on_def, |
53347 | 1416 |
THEN bspec[where x=y], THEN bspec[where x=z]] |
1417 |
by auto |
|
1418 |
then have "dist x (u *\<^sub>R y + v *\<^sub>R z) \<le> e" |
|
1419 |
using convex_bound_le[OF yz uv] by auto |
|
1420 |
} |
|
1421 |
then show ?thesis by (auto simp add: convex_def Ball_def) |
|
33175 | 1422 |
qed |
1423 |
||
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
1424 |
lemma connected_ball [iff]: |
33175 | 1425 |
fixes x :: "'a::real_normed_vector" |
1426 |
shows "connected (ball x e)" |
|
1427 |
using convex_connected convex_ball by auto |
|
1428 |
||
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
1429 |
lemma connected_cball [iff]: |
33175 | 1430 |
fixes x :: "'a::real_normed_vector" |
53302 | 1431 |
shows "connected (cball x e)" |
33175 | 1432 |
using convex_connected convex_cball by auto |
1433 |
||
50804 | 1434 |
|
60420 | 1435 |
subsection \<open>Convex hull\<close> |
33175 | 1436 |
|
60762 | 1437 |
lemma convex_convex_hull [iff]: "convex (convex hull s)" |
53302 | 1438 |
unfolding hull_def |
1439 |
using convex_Inter[of "{t. convex t \<and> s \<subseteq> t}"] |
|
44170
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44142
diff
changeset
|
1440 |
by auto |
33175 | 1441 |
|
34064
eee04bbbae7e
avoid dependency on implicit dest rule predicate1D in proofs
haftmann
parents:
33758
diff
changeset
|
1442 |
lemma convex_hull_eq: "convex hull s = s \<longleftrightarrow> convex s" |
50804 | 1443 |
by (metis convex_convex_hull hull_same) |
33175 | 1444 |
|
1445 |
lemma bounded_convex_hull: |
|
1446 |
fixes s :: "'a::real_normed_vector set" |
|
53347 | 1447 |
assumes "bounded s" |
1448 |
shows "bounded (convex hull s)" |
|
50804 | 1449 |
proof - |
1450 |
from assms obtain B where B: "\<forall>x\<in>s. norm x \<le> B" |
|
1451 |
unfolding bounded_iff by auto |
|
1452 |
show ?thesis |
|
1453 |
apply (rule bounded_subset[OF bounded_cball, of _ 0 B]) |
|
44170
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44142
diff
changeset
|
1454 |
unfolding subset_hull[of convex, OF convex_cball] |
53302 | 1455 |
unfolding subset_eq mem_cball dist_norm using B |
1456 |
apply auto |
|
50804 | 1457 |
done |
1458 |
qed |
|
33175 | 1459 |
|
1460 |
lemma finite_imp_bounded_convex_hull: |
|
1461 |
fixes s :: "'a::real_normed_vector set" |
|
53302 | 1462 |
shows "finite s \<Longrightarrow> bounded (convex hull s)" |
1463 |
using bounded_convex_hull finite_imp_bounded |
|
1464 |
by auto |
|
33175 | 1465 |
|
50804 | 1466 |
|
60420 | 1467 |
subsubsection \<open>Convex hull is "preserved" by a linear function\<close> |
40377 | 1468 |
|
1469 |
lemma convex_hull_linear_image: |
|
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1470 |
assumes f: "linear f" |
40377 | 1471 |
shows "f ` (convex hull s) = convex hull (f ` s)" |
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1472 |
proof |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1473 |
show "convex hull (f ` s) \<subseteq> f ` (convex hull s)" |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1474 |
by (intro hull_minimal image_mono hull_subset convex_linear_image assms convex_convex_hull) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1475 |
show "f ` (convex hull s) \<subseteq> convex hull (f ` s)" |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1476 |
proof (unfold image_subset_iff_subset_vimage, rule hull_minimal) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1477 |
show "s \<subseteq> f -` (convex hull (f ` s))" |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1478 |
by (fast intro: hull_inc) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1479 |
show "convex (f -` (convex hull (f ` s)))" |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1480 |
by (intro convex_linear_vimage [OF f] convex_convex_hull) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1481 |
qed |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1482 |
qed |
40377 | 1483 |
|
1484 |
lemma in_convex_hull_linear_image: |
|
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1485 |
assumes "linear f" |
53347 | 1486 |
and "x \<in> convex hull s" |
53339 | 1487 |
shows "f x \<in> convex hull (f ` s)" |
50804 | 1488 |
using convex_hull_linear_image[OF assms(1)] assms(2) by auto |
1489 |
||
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1490 |
lemma convex_hull_Times: |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1491 |
"convex hull (s \<times> t) = (convex hull s) \<times> (convex hull t)" |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1492 |
proof |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1493 |
show "convex hull (s \<times> t) \<subseteq> (convex hull s) \<times> (convex hull t)" |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1494 |
by (intro hull_minimal Sigma_mono hull_subset convex_Times convex_convex_hull) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1495 |
have "\<forall>x\<in>convex hull s. \<forall>y\<in>convex hull t. (x, y) \<in> convex hull (s \<times> t)" |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1496 |
proof (intro hull_induct) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1497 |
fix x y assume "x \<in> s" and "y \<in> t" |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1498 |
then show "(x, y) \<in> convex hull (s \<times> t)" |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1499 |
by (simp add: hull_inc) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1500 |
next |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1501 |
fix x let ?S = "((\<lambda>y. (0, y)) -` (\<lambda>p. (- x, 0) + p) ` (convex hull s \<times> t))" |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1502 |
have "convex ?S" |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1503 |
by (intro convex_linear_vimage convex_translation convex_convex_hull, |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1504 |
simp add: linear_iff) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1505 |
also have "?S = {y. (x, y) \<in> convex hull (s \<times> t)}" |
57865 | 1506 |
by (auto simp add: image_def Bex_def) |
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1507 |
finally show "convex {y. (x, y) \<in> convex hull (s \<times> t)}" . |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1508 |
next |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1509 |
show "convex {x. \<forall>y\<in>convex hull t. (x, y) \<in> convex hull (s \<times> t)}" |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1510 |
proof (unfold Collect_ball_eq, rule convex_INT [rule_format]) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1511 |
fix y let ?S = "((\<lambda>x. (x, 0)) -` (\<lambda>p. (0, - y) + p) ` (convex hull s \<times> t))" |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1512 |
have "convex ?S" |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1513 |
by (intro convex_linear_vimage convex_translation convex_convex_hull, |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1514 |
simp add: linear_iff) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1515 |
also have "?S = {x. (x, y) \<in> convex hull (s \<times> t)}" |
57865 | 1516 |
by (auto simp add: image_def Bex_def) |
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1517 |
finally show "convex {x. (x, y) \<in> convex hull (s \<times> t)}" . |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1518 |
qed |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1519 |
qed |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1520 |
then show "(convex hull s) \<times> (convex hull t) \<subseteq> convex hull (s \<times> t)" |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1521 |
unfolding subset_eq split_paired_Ball_Sigma . |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1522 |
qed |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
1523 |
|
40377 | 1524 |
|
60420 | 1525 |
subsubsection \<open>Stepping theorems for convex hulls of finite sets\<close> |
33175 | 1526 |
|
1527 |
lemma convex_hull_empty[simp]: "convex hull {} = {}" |
|
50804 | 1528 |
by (rule hull_unique) auto |
33175 | 1529 |
|
1530 |
lemma convex_hull_singleton[simp]: "convex hull {a} = {a}" |
|
50804 | 1531 |
by (rule hull_unique) auto |
33175 | 1532 |
|
1533 |
lemma convex_hull_insert: |
|
1534 |
fixes s :: "'a::real_vector set" |
|
1535 |
assumes "s \<noteq> {}" |
|
50804 | 1536 |
shows "convex hull (insert a s) = |
1537 |
{x. \<exists>u\<ge>0. \<exists>v\<ge>0. \<exists>b. (u + v = 1) \<and> b \<in> (convex hull s) \<and> (x = u *\<^sub>R a + v *\<^sub>R b)}" |
|
53347 | 1538 |
(is "_ = ?hull") |
50804 | 1539 |
apply (rule, rule hull_minimal, rule) |
1540 |
unfolding insert_iff |
|
1541 |
prefer 3 |
|
1542 |
apply rule |
|
1543 |
proof - |
|
1544 |
fix x |
|
1545 |
assume x: "x = a \<or> x \<in> s" |
|
1546 |
then show "x \<in> ?hull" |
|
1547 |
apply rule |
|
1548 |
unfolding mem_Collect_eq |
|
1549 |
apply (rule_tac x=1 in exI) |
|
1550 |
defer |
|
1551 |
apply (rule_tac x=0 in exI) |
|
1552 |
using assms hull_subset[of s convex] |
|
1553 |
apply auto |
|
1554 |
done |
|
33175 | 1555 |
next |
50804 | 1556 |
fix x |
1557 |
assume "x \<in> ?hull" |
|
1558 |
then obtain u v b where obt: "u\<ge>0" "v\<ge>0" "u + v = 1" "b \<in> convex hull s" "x = u *\<^sub>R a + v *\<^sub>R b" |
|
1559 |
by auto |
|
53339 | 1560 |
have "a \<in> convex hull insert a s" "b \<in> convex hull insert a s" |
50804 | 1561 |
using hull_mono[of s "insert a s" convex] hull_mono[of "{a}" "insert a s" convex] and obt(4) |
1562 |
by auto |
|
1563 |
then show "x \<in> convex hull insert a s" |
|
53676 | 1564 |
unfolding obt(5) using obt(1-3) |
1565 |
by (rule convexD [OF convex_convex_hull]) |
|
33175 | 1566 |
next |
50804 | 1567 |
show "convex ?hull" |
53676 | 1568 |
proof (rule convexI) |
50804 | 1569 |
fix x y u v |
1570 |
assume as: "(0::real) \<le> u" "0 \<le> v" "u + v = 1" "x\<in>?hull" "y\<in>?hull" |
|
53339 | 1571 |
from as(4) obtain u1 v1 b1 where |
1572 |
obt1: "u1\<ge>0" "v1\<ge>0" "u1 + v1 = 1" "b1 \<in> convex hull s" "x = u1 *\<^sub>R a + v1 *\<^sub>R b1" |
|
1573 |
by auto |
|
1574 |
from as(5) obtain u2 v2 b2 where |
|
1575 |
obt2: "u2\<ge>0" "v2\<ge>0" "u2 + v2 = 1" "b2 \<in> convex hull s" "y = u2 *\<^sub>R a + v2 *\<^sub>R b2" |
|
1576 |
by auto |
|
50804 | 1577 |
have *: "\<And>(x::'a) s1 s2. x - s1 *\<^sub>R x - s2 *\<^sub>R x = ((1::real) - (s1 + s2)) *\<^sub>R x" |
1578 |
by (auto simp add: algebra_simps) |
|
1579 |
have **: "\<exists>b \<in> convex hull s. u *\<^sub>R x + v *\<^sub>R y = |
|
1580 |
(u * u1) *\<^sub>R a + (v * u2) *\<^sub>R a + (b - (u * u1) *\<^sub>R b - (v * u2) *\<^sub>R b)" |
|
1581 |
proof (cases "u * v1 + v * v2 = 0") |
|
1582 |
case True |
|
1583 |
have *: "\<And>(x::'a) s1 s2. x - s1 *\<^sub>R x - s2 *\<^sub>R x = ((1::real) - (s1 + s2)) *\<^sub>R x" |
|
1584 |
by (auto simp add: algebra_simps) |
|
1585 |
from True have ***: "u * v1 = 0" "v * v2 = 0" |
|
60420 | 1586 |
using mult_nonneg_nonneg[OF \<open>u\<ge>0\<close> \<open>v1\<ge>0\<close>] mult_nonneg_nonneg[OF \<open>v\<ge>0\<close> \<open>v2\<ge>0\<close>] |
53302 | 1587 |
by arith+ |
50804 | 1588 |
then have "u * u1 + v * u2 = 1" |
1589 |
using as(3) obt1(3) obt2(3) by auto |
|
1590 |
then show ?thesis |
|
1591 |
unfolding obt1(5) obt2(5) * |
|
1592 |
using assms hull_subset[of s convex] |
|
1593 |
by (auto simp add: *** scaleR_right_distrib) |
|
33175 | 1594 |
next |
50804 | 1595 |
case False |
1596 |
have "1 - (u * u1 + v * u2) = (u + v) - (u * u1 + v * u2)" |
|
1597 |
using as(3) obt1(3) obt2(3) by (auto simp add: field_simps) |
|
1598 |
also have "\<dots> = u * (v1 + u1 - u1) + v * (v2 + u2 - u2)" |
|
1599 |
using as(3) obt1(3) obt2(3) by (auto simp add: field_simps) |
|
1600 |
also have "\<dots> = u * v1 + v * v2" |
|
1601 |
by simp |
|
1602 |
finally have **:"1 - (u * u1 + v * u2) = u * v1 + v * v2" by auto |
|
1603 |
have "0 \<le> u * v1 + v * v2" "0 \<le> u * v1" "0 \<le> u * v1 + v * v2" "0 \<le> v * v2" |
|
56536 | 1604 |
using as(1,2) obt1(1,2) obt2(1,2) by auto |
50804 | 1605 |
then show ?thesis |
1606 |
unfolding obt1(5) obt2(5) |
|
1607 |
unfolding * and ** |
|
1608 |
using False |
|
53339 | 1609 |
apply (rule_tac |
1610 |
x = "((u * v1) / (u * v1 + v * v2)) *\<^sub>R b1 + ((v * v2) / (u * v1 + v * v2)) *\<^sub>R b2" in bexI) |
|
50804 | 1611 |
defer |
53676 | 1612 |
apply (rule convexD [OF convex_convex_hull]) |
50804 | 1613 |
using obt1(4) obt2(4) |
49530 | 1614 |
unfolding add_divide_distrib[symmetric] and zero_le_divide_iff |
50804 | 1615 |
apply (auto simp add: scaleR_left_distrib scaleR_right_distrib) |
1616 |
done |
|
1617 |
qed |
|
1618 |
have u1: "u1 \<le> 1" |
|
1619 |
unfolding obt1(3)[symmetric] and not_le using obt1(2) by auto |
|
1620 |
have u2: "u2 \<le> 1" |
|
1621 |
unfolding obt2(3)[symmetric] and not_le using obt2(2) by auto |
|
53339 | 1622 |
have "u1 * u + u2 * v \<le> max u1 u2 * u + max u1 u2 * v" |
50804 | 1623 |
apply (rule add_mono) |
1624 |
apply (rule_tac [!] mult_right_mono) |
|
1625 |
using as(1,2) obt1(1,2) obt2(1,2) |
|
1626 |
apply auto |
|
1627 |
done |
|
1628 |
also have "\<dots> \<le> 1" |
|
1629 |
unfolding distrib_left[symmetric] and as(3) using u1 u2 by auto |
|
1630 |
finally show "u *\<^sub>R x + v *\<^sub>R y \<in> ?hull" |
|
1631 |
unfolding mem_Collect_eq |
|
1632 |
apply (rule_tac x="u * u1 + v * u2" in exI) |
|
1633 |
apply (rule conjI) |
|
1634 |
defer |
|
1635 |
apply (rule_tac x="1 - u * u1 - v * u2" in exI) |
|
1636 |
unfolding Bex_def |
|
1637 |
using as(1,2) obt1(1,2) obt2(1,2) ** |
|
56536 | 1638 |
apply (auto simp add: algebra_simps) |
50804 | 1639 |
done |
33175 | 1640 |
qed |
1641 |
qed |
|
1642 |
||
1643 |
||
60420 | 1644 |
subsubsection \<open>Explicit expression for convex hull\<close> |
33175 | 1645 |
|
1646 |
lemma convex_hull_indexed: |
|
1647 |
fixes s :: "'a::real_vector set" |
|
50804 | 1648 |
shows "convex hull s = |
53347 | 1649 |
{y. \<exists>k u x. |
1650 |
(\<forall>i\<in>{1::nat .. k}. 0 \<le> u i \<and> x i \<in> s) \<and> |
|
1651 |
(setsum u {1..k} = 1) \<and> (setsum (\<lambda>i. u i *\<^sub>R x i) {1..k} = y)}" |
|
53339 | 1652 |
(is "?xyz = ?hull") |
50804 | 1653 |
apply (rule hull_unique) |
1654 |
apply rule |
|
1655 |
defer |
|
53676 | 1656 |
apply (rule convexI) |
50804 | 1657 |
proof - |
1658 |
fix x |
|
1659 |
assume "x\<in>s" |
|
1660 |
then show "x \<in> ?hull" |
|
1661 |
unfolding mem_Collect_eq |
|
1662 |
apply (rule_tac x=1 in exI, rule_tac x="\<lambda>x. 1" in exI) |
|
1663 |
apply auto |
|
1664 |
done |
|
33175 | 1665 |
next |
50804 | 1666 |
fix t |
1667 |
assume as: "s \<subseteq> t" "convex t" |
|
1668 |
show "?hull \<subseteq> t" |
|
1669 |
apply rule |
|
1670 |
unfolding mem_Collect_eq |
|
53302 | 1671 |
apply (elim exE conjE) |
50804 | 1672 |
proof - |
1673 |
fix x k u y |
|
1674 |
assume assm: |
|
1675 |
"\<forall>i\<in>{1::nat..k}. 0 \<le> u i \<and> y i \<in> s" |
|
1676 |
"setsum u {1..k} = 1" "(\<Sum>i = 1..k. u i *\<^sub>R y i) = x" |
|
1677 |
show "x\<in>t" |
|
1678 |
unfolding assm(3) [symmetric] |
|
1679 |
apply (rule as(2)[unfolded convex, rule_format]) |
|
1680 |
using assm(1,2) as(1) apply auto |
|
1681 |
done |
|
1682 |
qed |
|
33175 | 1683 |
next |
50804 | 1684 |
fix x y u v |
53347 | 1685 |
assume uv: "0 \<le> u" "0 \<le> v" "u + v = (1::real)" |
1686 |
assume xy: "x \<in> ?hull" "y \<in> ?hull" |
|
50804 | 1687 |
from xy obtain k1 u1 x1 where |
53339 | 1688 |
x: "\<forall>i\<in>{1::nat..k1}. 0\<le>u1 i \<and> x1 i \<in> s" "setsum u1 {Suc 0..k1} = 1" "(\<Sum>i = Suc 0..k1. u1 i *\<^sub>R x1 i) = x" |
50804 | 1689 |
by auto |
1690 |
from xy obtain k2 u2 x2 where |
|
53339 | 1691 |
y: "\<forall>i\<in>{1::nat..k2}. 0\<le>u2 i \<and> x2 i \<in> s" "setsum u2 {Suc 0..k2} = 1" "(\<Sum>i = Suc 0..k2. u2 i *\<^sub>R x2 i) = y" |
50804 | 1692 |
by auto |
1693 |
have *: "\<And>P (x1::'a) x2 s1 s2 i. |
|
1694 |
(if P i then s1 else s2) *\<^sub>R (if P i then x1 else x2) = (if P i then s1 *\<^sub>R x1 else s2 *\<^sub>R x2)" |
|
33175 | 1695 |
"{1..k1 + k2} \<inter> {1..k1} = {1..k1}" "{1..k1 + k2} \<inter> - {1..k1} = (\<lambda>i. i + k1) ` {1..k2}" |
50804 | 1696 |
prefer 3 |
1697 |
apply (rule, rule) |
|
1698 |
unfolding image_iff |
|
1699 |
apply (rule_tac x = "x - k1" in bexI) |
|
1700 |
apply (auto simp add: not_le) |
|
1701 |
done |
|
1702 |
have inj: "inj_on (\<lambda>i. i + k1) {1..k2}" |
|
1703 |
unfolding inj_on_def by auto |
|
1704 |
show "u *\<^sub>R x + v *\<^sub>R y \<in> ?hull" |
|
1705 |
apply rule |
|
1706 |
apply (rule_tac x="k1 + k2" in exI) |
|
1707 |
apply (rule_tac x="\<lambda>i. if i \<in> {1..k1} then u * u1 i else v * u2 (i - k1)" in exI) |
|
1708 |
apply (rule_tac x="\<lambda>i. if i \<in> {1..k1} then x1 i else x2 (i - k1)" in exI) |
|
1709 |
apply (rule, rule) |
|
1710 |
defer |
|
1711 |
apply rule |
|
57418 | 1712 |
unfolding * and setsum.If_cases[OF finite_atLeastAtMost[of 1 "k1 + k2"]] and |
1713 |
setsum.reindex[OF inj] and o_def Collect_mem_eq |
|
50804 | 1714 |
unfolding scaleR_scaleR[symmetric] scaleR_right.setsum [symmetric] setsum_right_distrib[symmetric] |
1715 |
proof - |
|
1716 |
fix i |
|
1717 |
assume i: "i \<in> {1..k1+k2}" |
|
1718 |
show "0 \<le> (if i \<in> {1..k1} then u * u1 i else v * u2 (i - k1)) \<and> |
|
1719 |
(if i \<in> {1..k1} then x1 i else x2 (i - k1)) \<in> s" |
|
1720 |
proof (cases "i\<in>{1..k1}") |
|
1721 |
case True |
|
1722 |
then show ?thesis |
|
56536 | 1723 |
using uv(1) x(1)[THEN bspec[where x=i]] by auto |
50804 | 1724 |
next |
1725 |
case False |
|
1726 |
def j \<equiv> "i - k1" |
|
53347 | 1727 |
from i False have "j \<in> {1..k2}" |
1728 |
unfolding j_def by auto |
|
50804 | 1729 |
then show ?thesis |
56536 | 1730 |
using False uv(2) y(1)[THEN bspec[where x=j]] |
1731 |
by (auto simp: j_def[symmetric]) |
|
50804 | 1732 |
qed |
1733 |
qed (auto simp add: not_le x(2,3) y(2,3) uv(3)) |
|
33175 | 1734 |
qed |
1735 |
||
1736 |
lemma convex_hull_finite: |
|
1737 |
fixes s :: "'a::real_vector set" |
|
1738 |
assumes "finite s" |
|
1739 |
shows "convex hull s = {y. \<exists>u. (\<forall>x\<in>s. 0 \<le> u x) \<and> |
|
53339 | 1740 |
setsum u s = 1 \<and> setsum (\<lambda>x. u x *\<^sub>R x) s = y}" |
1741 |
(is "?HULL = ?set") |
|
50804 | 1742 |
proof (rule hull_unique, auto simp add: convex_def[of ?set]) |
1743 |
fix x |
|
1744 |
assume "x \<in> s" |
|
1745 |
then show "\<exists>u. (\<forall>x\<in>s. 0 \<le> u x) \<and> setsum u s = 1 \<and> (\<Sum>x\<in>s. u x *\<^sub>R x) = x" |
|
1746 |
apply (rule_tac x="\<lambda>y. if x=y then 1 else 0" in exI) |
|
1747 |
apply auto |
|
57418 | 1748 |
unfolding setsum.delta'[OF assms] and setsum_delta''[OF assms] |
50804 | 1749 |
apply auto |
1750 |
done |
|
33175 | 1751 |
next |
50804 | 1752 |
fix u v :: real |
1753 |
assume uv: "0 \<le> u" "0 \<le> v" "u + v = 1" |
|
1754 |
fix ux assume ux: "\<forall>x\<in>s. 0 \<le> ux x" "setsum ux s = (1::real)" |
|
1755 |
fix uy assume uy: "\<forall>x\<in>s. 0 \<le> uy x" "setsum uy s = (1::real)" |
|
53339 | 1756 |
{ |
1757 |
fix x |
|
50804 | 1758 |
assume "x\<in>s" |
1759 |
then have "0 \<le> u * ux x + v * uy x" |
|
1760 |
using ux(1)[THEN bspec[where x=x]] uy(1)[THEN bspec[where x=x]] and uv(1,2) |
|
56536 | 1761 |
by auto |
50804 | 1762 |
} |
1763 |
moreover |
|
1764 |
have "(\<Sum>x\<in>s. u * ux x + v * uy x) = 1" |
|
57418 | 1765 |
unfolding setsum.distrib and setsum_right_distrib[symmetric] and ux(2) uy(2) |
53302 | 1766 |
using uv(3) by auto |
50804 | 1767 |
moreover |
1768 |
have "(\<Sum>x\<in>s. (u * ux x + v * uy x) *\<^sub>R x) = u *\<^sub>R (\<Sum>x\<in>s. ux x *\<^sub>R x) + v *\<^sub>R (\<Sum>x\<in>s. uy x *\<^sub>R x)" |
|
57418 | 1769 |
unfolding scaleR_left_distrib and setsum.distrib and scaleR_scaleR[symmetric] |
53339 | 1770 |
and scaleR_right.setsum [symmetric] |
50804 | 1771 |
by auto |
1772 |
ultimately |
|
1773 |
show "\<exists>uc. (\<forall>x\<in>s. 0 \<le> uc x) \<and> setsum uc s = 1 \<and> |
|
1774 |
(\<Sum>x\<in>s. uc x *\<^sub>R x) = u *\<^sub>R (\<Sum>x\<in>s. ux x *\<^sub>R x) + v *\<^sub>R (\<Sum>x\<in>s. uy x *\<^sub>R x)" |
|
1775 |
apply (rule_tac x="\<lambda>x. u * ux x + v * uy x" in exI) |
|
1776 |
apply auto |
|
1777 |
done |
|
33175 | 1778 |
next |
50804 | 1779 |
fix t |
1780 |
assume t: "s \<subseteq> t" "convex t" |
|
1781 |
fix u |
|
1782 |
assume u: "\<forall>x\<in>s. 0 \<le> u x" "setsum u s = (1::real)" |
|
1783 |
then show "(\<Sum>x\<in>s. u x *\<^sub>R x) \<in> t" |
|
1784 |
using t(2)[unfolded convex_explicit, THEN spec[where x=s], THEN spec[where x=u]] |
|
33175 | 1785 |
using assms and t(1) by auto |
1786 |
qed |
|
1787 |
||
50804 | 1788 |
|
60420 | 1789 |
subsubsection \<open>Another formulation from Lars Schewe\<close> |
33175 | 1790 |
|
1791 |
lemma convex_hull_explicit: |
|
1792 |
fixes p :: "'a::real_vector set" |
|
53347 | 1793 |
shows "convex hull p = |
1794 |
{y. \<exists>s u. finite s \<and> s \<subseteq> p \<and> (\<forall>x\<in>s. 0 \<le> u x) \<and> setsum u s = 1 \<and> setsum (\<lambda>v. u v *\<^sub>R v) s = y}" |
|
53339 | 1795 |
(is "?lhs = ?rhs") |
50804 | 1796 |
proof - |
53302 | 1797 |
{ |
1798 |
fix x |
|
1799 |
assume "x\<in>?lhs" |
|
50804 | 1800 |
then obtain k u y where |
1801 |
obt: "\<forall>i\<in>{1::nat..k}. 0 \<le> u i \<and> y i \<in> p" "setsum u {1..k} = 1" "(\<Sum>i = 1..k. u i *\<^sub>R y i) = x" |
|
33175 | 1802 |
unfolding convex_hull_indexed by auto |
1803 |
||
50804 | 1804 |
have fin: "finite {1..k}" by auto |
1805 |
have fin': "\<And>v. finite {i \<in> {1..k}. y i = v}" by auto |
|
53302 | 1806 |
{ |
1807 |
fix j |
|
50804 | 1808 |
assume "j\<in>{1..k}" |
1809 |
then have "y j \<in> p" "0 \<le> setsum u {i. Suc 0 \<le> i \<and> i \<le> k \<and> y i = y j}" |
|
1810 |
using obt(1)[THEN bspec[where x=j]] and obt(2) |
|
1811 |
apply simp |
|
1812 |
apply (rule setsum_nonneg) |
|
1813 |
using obt(1) |
|
1814 |
apply auto |
|
1815 |
done |
|
1816 |
} |
|
33175 | 1817 |
moreover |
49531 | 1818 |
have "(\<Sum>v\<in>y ` {1..k}. setsum u {i \<in> {1..k}. y i = v}) = 1" |
49530 | 1819 |
unfolding setsum_image_gen[OF fin, symmetric] using obt(2) by auto |
33175 | 1820 |
moreover have "(\<Sum>v\<in>y ` {1..k}. setsum u {i \<in> {1..k}. y i = v} *\<^sub>R v) = x" |
49530 | 1821 |
using setsum_image_gen[OF fin, of "\<lambda>i. u i *\<^sub>R y i" y, symmetric] |
33175 | 1822 |
unfolding scaleR_left.setsum using obt(3) by auto |
50804 | 1823 |
ultimately |
1824 |
have "\<exists>s u. finite s \<and> s \<subseteq> p \<and> (\<forall>x\<in>s. 0 \<le> u x) \<and> setsum u s = 1 \<and> (\<Sum>v\<in>s. u v *\<^sub>R v) = x" |
|
1825 |
apply (rule_tac x="y ` {1..k}" in exI) |
|
1826 |
apply (rule_tac x="\<lambda>v. setsum u {i\<in>{1..k}. y i = v}" in exI) |
|
1827 |
apply auto |
|
1828 |
done |
|
1829 |
then have "x\<in>?rhs" by auto |
|
1830 |
} |
|
33175 | 1831 |
moreover |
53302 | 1832 |
{ |
1833 |
fix y |
|
1834 |
assume "y\<in>?rhs" |
|
50804 | 1835 |
then obtain s u where |
53339 | 1836 |
obt: "finite s" "s \<subseteq> p" "\<forall>x\<in>s. 0 \<le> u x" "setsum u s = 1" "(\<Sum>v\<in>s. u v *\<^sub>R v) = y" |
1837 |
by auto |
|
50804 | 1838 |
|
1839 |
obtain f where f: "inj_on f {1..card s}" "f ` {1..card s} = s" |
|
1840 |
using ex_bij_betw_nat_finite_1[OF obt(1)] unfolding bij_betw_def by auto |
|
1841 |
||
53302 | 1842 |
{ |
1843 |
fix i :: nat |
|
50804 | 1844 |
assume "i\<in>{1..card s}" |
1845 |
then have "f i \<in> s" |
|
1846 |
apply (subst f(2)[symmetric]) |
|
1847 |
apply auto |
|
1848 |
done |
|
1849 |
then have "0 \<le> u (f i)" "f i \<in> p" using obt(2,3) by auto |
|
1850 |
} |
|
53347 | 1851 |
moreover have *: "finite {1..card s}" by auto |
53302 | 1852 |
{ |
1853 |
fix y |
|
50804 | 1854 |
assume "y\<in>s" |
53302 | 1855 |
then obtain i where "i\<in>{1..card s}" "f i = y" |
1856 |
using f using image_iff[of y f "{1..card s}"] |
|
50804 | 1857 |
by auto |
1858 |
then have "{x. Suc 0 \<le> x \<and> x \<le> card s \<and> f x = y} = {i}" |
|
1859 |
apply auto |
|
1860 |
using f(1)[unfolded inj_on_def] |
|
1861 |
apply(erule_tac x=x in ballE) |
|
1862 |
apply auto |
|
1863 |
done |
|
1864 |
then have "card {x. Suc 0 \<le> x \<and> x \<le> card s \<and> f x = y} = 1" by auto |
|
1865 |
then have "(\<Sum>x\<in>{x \<in> {1..card s}. f x = y}. u (f x)) = u y" |
|
1866 |
"(\<Sum>x\<in>{x \<in> {1..card s}. f x = y}. u (f x) *\<^sub>R f x) = u y *\<^sub>R y" |
|
1867 |
by (auto simp add: setsum_constant_scaleR) |
|
1868 |
} |
|
1869 |
then have "(\<Sum>x = 1..card s. u (f x)) = 1" "(\<Sum>i = 1..card s. u (f i) *\<^sub>R f i) = y" |
|
53339 | 1870 |
unfolding setsum_image_gen[OF *(1), of "\<lambda>x. u (f x) *\<^sub>R f x" f] |
1871 |
and setsum_image_gen[OF *(1), of "\<lambda>x. u (f x)" f] |
|
1872 |
unfolding f |
|
57418 | 1873 |
using setsum.cong [of s s "\<lambda>y. (\<Sum>x\<in>{x \<in> {1..card s}. f x = y}. u (f x) *\<^sub>R f x)" "\<lambda>v. u v *\<^sub>R v"] |
1874 |
using setsum.cong [of s s "\<lambda>y. (\<Sum>x\<in>{x \<in> {1..card s}. f x = y}. u (f x))" u] |
|
53302 | 1875 |
unfolding obt(4,5) |
1876 |
by auto |
|
50804 | 1877 |
ultimately |
1878 |
have "\<exists>k u x. (\<forall>i\<in>{1..k}. 0 \<le> u i \<and> x i \<in> p) \<and> setsum u {1..k} = 1 \<and> |
|
1879 |
(\<Sum>i::nat = 1..k. u i *\<^sub>R x i) = y" |
|
1880 |
apply (rule_tac x="card s" in exI) |
|
1881 |
apply (rule_tac x="u \<circ> f" in exI) |
|
1882 |
apply (rule_tac x=f in exI) |
|
1883 |
apply fastforce |
|
1884 |
done |
|
53302 | 1885 |
then have "y \<in> ?lhs" |
1886 |
unfolding convex_hull_indexed by auto |
|
50804 | 1887 |
} |
53302 | 1888 |
ultimately show ?thesis |
1889 |
unfolding set_eq_iff by blast |
|
33175 | 1890 |
qed |
1891 |
||
50804 | 1892 |
|
60420 | 1893 |
subsubsection \<open>A stepping theorem for that expansion\<close> |
33175 | 1894 |
|
1895 |
lemma convex_hull_finite_step: |
|
50804 | 1896 |
fixes s :: "'a::real_vector set" |
1897 |
assumes "finite s" |
|
53302 | 1898 |
shows |
1899 |
"(\<exists>u. (\<forall>x\<in>insert a s. 0 \<le> u x) \<and> setsum u (insert a s) = w \<and> setsum (\<lambda>x. u x *\<^sub>R x) (insert a s) = y) |
|
1900 |
\<longleftrightarrow> (\<exists>v\<ge>0. \<exists>u. (\<forall>x\<in>s. 0 \<le> u x) \<and> setsum u s = w - v \<and> setsum (\<lambda>x. u x *\<^sub>R x) s = y - v *\<^sub>R a)" |
|
1901 |
(is "?lhs = ?rhs") |
|
50804 | 1902 |
proof (rule, case_tac[!] "a\<in>s") |
53302 | 1903 |
assume "a \<in> s" |
53339 | 1904 |
then have *: "insert a s = s" by auto |
50804 | 1905 |
assume ?lhs |
1906 |
then show ?rhs |
|
1907 |
unfolding * |
|
1908 |
apply (rule_tac x=0 in exI) |
|
1909 |
apply auto |
|
1910 |
done |
|
33175 | 1911 |
next |
50804 | 1912 |
assume ?lhs |
53302 | 1913 |
then obtain u where |
1914 |
u: "\<forall>x\<in>insert a s. 0 \<le> u x" "setsum u (insert a s) = w" "(\<Sum>x\<in>insert a s. u x *\<^sub>R x) = y" |
|
50804 | 1915 |
by auto |
1916 |
assume "a \<notin> s" |
|
1917 |
then show ?rhs |
|
1918 |
apply (rule_tac x="u a" in exI) |
|
1919 |
using u(1)[THEN bspec[where x=a]] |
|
1920 |
apply simp |
|
1921 |
apply (rule_tac x=u in exI) |
|
60420 | 1922 |
using u[unfolded setsum_clauses(2)[OF assms]] and \<open>a\<notin>s\<close> |
50804 | 1923 |
apply auto |
1924 |
done |
|
33175 | 1925 |
next |
50804 | 1926 |
assume "a \<in> s" |
1927 |
then have *: "insert a s = s" by auto |
|
1928 |
have fin: "finite (insert a s)" using assms by auto |
|
1929 |
assume ?rhs |
|
1930 |
then obtain v u where uv: "v\<ge>0" "\<forall>x\<in>s. 0 \<le> u x" "setsum u s = w - v" "(\<Sum>x\<in>s. u x *\<^sub>R x) = y - v *\<^sub>R a" |
|
1931 |
by auto |
|
1932 |
show ?lhs |
|
1933 |
apply (rule_tac x = "\<lambda>x. (if a = x then v else 0) + u x" in exI) |
|
57418 | 1934 |
unfolding scaleR_left_distrib and setsum.distrib and setsum_delta''[OF fin] and setsum.delta'[OF fin] |
50804 | 1935 |
unfolding setsum_clauses(2)[OF assms] |
60420 | 1936 |
using uv and uv(2)[THEN bspec[where x=a]] and \<open>a\<in>s\<close> |
50804 | 1937 |
apply auto |
1938 |
done |
|
33175 | 1939 |
next |
50804 | 1940 |
assume ?rhs |
53339 | 1941 |
then obtain v u where |
1942 |
uv: "v\<ge>0" "\<forall>x\<in>s. 0 \<le> u x" "setsum u s = w - v" "(\<Sum>x\<in>s. u x *\<^sub>R x) = y - v *\<^sub>R a" |
|
50804 | 1943 |
by auto |
1944 |
moreover |
|
1945 |
assume "a \<notin> s" |
|
1946 |
moreover |
|
53302 | 1947 |
have "(\<Sum>x\<in>s. if a = x then v else u x) = setsum u s" |
1948 |
and "(\<Sum>x\<in>s. (if a = x then v else u x) *\<^sub>R x) = (\<Sum>x\<in>s. u x *\<^sub>R x)" |
|
57418 | 1949 |
apply (rule_tac setsum.cong) apply rule |
50804 | 1950 |
defer |
57418 | 1951 |
apply (rule_tac setsum.cong) apply rule |
60420 | 1952 |
using \<open>a \<notin> s\<close> |
50804 | 1953 |
apply auto |
1954 |
done |
|
1955 |
ultimately show ?lhs |
|
1956 |
apply (rule_tac x="\<lambda>x. if a = x then v else u x" in exI) |
|
1957 |
unfolding setsum_clauses(2)[OF assms] |
|
1958 |
apply auto |
|
1959 |
done |
|
1960 |
qed |
|
1961 |
||
33175 | 1962 |
|
60420 | 1963 |
subsubsection \<open>Hence some special cases\<close> |
33175 | 1964 |
|
1965 |
lemma convex_hull_2: |
|
1966 |
"convex hull {a,b} = {u *\<^sub>R a + v *\<^sub>R b | u v. 0 \<le> u \<and> 0 \<le> v \<and> u + v = 1}" |
|
53302 | 1967 |
proof - |
1968 |
have *: "\<And>u. (\<forall>x\<in>{a, b}. 0 \<le> u x) \<longleftrightarrow> 0 \<le> u a \<and> 0 \<le> u b" |
|
1969 |
by auto |
|
1970 |
have **: "finite {b}" by auto |
|
1971 |
show ?thesis |
|
1972 |
apply (simp add: convex_hull_finite) |
|
1973 |
unfolding convex_hull_finite_step[OF **, of a 1, unfolded * conj_assoc] |
|
1974 |
apply auto |
|
1975 |
apply (rule_tac x=v in exI) |
|
1976 |
apply (rule_tac x="1 - v" in exI) |
|
1977 |
apply simp |
|
1978 |
apply (rule_tac x=u in exI) |
|
1979 |
apply simp |
|
1980 |
apply (rule_tac x="\<lambda>x. v" in exI) |
|
1981 |
apply simp |
|
1982 |
done |
|
1983 |
qed |
|
33175 | 1984 |
|
1985 |
lemma convex_hull_2_alt: "convex hull {a,b} = {a + u *\<^sub>R (b - a) | u. 0 \<le> u \<and> u \<le> 1}" |
|
44170
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44142
diff
changeset
|
1986 |
unfolding convex_hull_2 |
53302 | 1987 |
proof (rule Collect_cong) |
1988 |
have *: "\<And>x y ::real. x + y = 1 \<longleftrightarrow> x = 1 - y" |
|
1989 |
by auto |
|
1990 |
fix x |
|
1991 |
show "(\<exists>v u. x = v *\<^sub>R a + u *\<^sub>R b \<and> 0 \<le> v \<and> 0 \<le> u \<and> v + u = 1) \<longleftrightarrow> |
|
1992 |
(\<exists>u. x = a + u *\<^sub>R (b - a) \<and> 0 \<le> u \<and> u \<le> 1)" |
|
1993 |
unfolding * |
|
1994 |
apply auto |
|
1995 |
apply (rule_tac[!] x=u in exI) |
|
1996 |
apply (auto simp add: algebra_simps) |
|
1997 |
done |
|
1998 |
qed |
|
33175 | 1999 |
|
2000 |
lemma convex_hull_3: |
|
2001 |
"convex hull {a,b,c} = { u *\<^sub>R a + v *\<^sub>R b + w *\<^sub>R c | u v w. 0 \<le> u \<and> 0 \<le> v \<and> 0 \<le> w \<and> u + v + w = 1}" |
|
53302 | 2002 |
proof - |
2003 |
have fin: "finite {a,b,c}" "finite {b,c}" "finite {c}" |
|
2004 |
by auto |
|
2005 |
have *: "\<And>x y z ::real. x + y + z = 1 \<longleftrightarrow> x = 1 - y - z" |
|
44361
75ec83d45303
remove unnecessary euclidean_space class constraints
huffman
parents:
44349
diff
changeset
|
2006 |
by (auto simp add: field_simps) |
53302 | 2007 |
show ?thesis |
2008 |
unfolding convex_hull_finite[OF fin(1)] and convex_hull_finite_step[OF fin(2)] and * |
|
2009 |
unfolding convex_hull_finite_step[OF fin(3)] |
|
2010 |
apply (rule Collect_cong) |
|
2011 |
apply simp |
|
2012 |
apply auto |
|
2013 |
apply (rule_tac x=va in exI) |
|
2014 |
apply (rule_tac x="u c" in exI) |
|
2015 |
apply simp |
|
2016 |
apply (rule_tac x="1 - v - w" in exI) |
|
2017 |
apply simp |
|
2018 |
apply (rule_tac x=v in exI) |
|
2019 |
apply simp |
|
2020 |
apply (rule_tac x="\<lambda>x. w" in exI) |
|
2021 |
apply simp |
|
2022 |
done |
|
2023 |
qed |
|
33175 | 2024 |
|
2025 |
lemma convex_hull_3_alt: |
|
2026 |
"convex hull {a,b,c} = {a + u *\<^sub>R (b - a) + v *\<^sub>R (c - a) | u v. 0 \<le> u \<and> 0 \<le> v \<and> u + v \<le> 1}" |
|
53302 | 2027 |
proof - |
2028 |
have *: "\<And>x y z ::real. x + y + z = 1 \<longleftrightarrow> x = 1 - y - z" |
|
2029 |
by auto |
|
2030 |
show ?thesis |
|
2031 |
unfolding convex_hull_3 |
|
2032 |
apply (auto simp add: *) |
|
2033 |
apply (rule_tac x=v in exI) |
|
2034 |
apply (rule_tac x=w in exI) |
|
2035 |
apply (simp add: algebra_simps) |
|
2036 |
apply (rule_tac x=u in exI) |
|
2037 |
apply (rule_tac x=v in exI) |
|
2038 |
apply (simp add: algebra_simps) |
|
2039 |
done |
|
2040 |
qed |
|
2041 |
||
33175 | 2042 |
|
60420 | 2043 |
subsection \<open>Relations among closure notions and corresponding hulls\<close> |
33175 | 2044 |
|
2045 |
lemma affine_imp_convex: "affine s \<Longrightarrow> convex s" |
|
2046 |
unfolding affine_def convex_def by auto |
|
2047 |
||
44361
75ec83d45303
remove unnecessary euclidean_space class constraints
huffman
parents:
44349
diff
changeset
|
2048 |
lemma subspace_imp_convex: "subspace s \<Longrightarrow> convex s" |
33175 | 2049 |
using subspace_imp_affine affine_imp_convex by auto |
2050 |
||
44361
75ec83d45303
remove unnecessary euclidean_space class constraints
huffman
parents:
44349
diff
changeset
|
2051 |
lemma affine_hull_subset_span: "(affine hull s) \<subseteq> (span s)" |
53302 | 2052 |
by (metis hull_minimal span_inc subspace_imp_affine subspace_span) |
33175 | 2053 |
|
44361
75ec83d45303
remove unnecessary euclidean_space class constraints
huffman
parents:
44349
diff
changeset
|
2054 |
lemma convex_hull_subset_span: "(convex hull s) \<subseteq> (span s)" |
53302 | 2055 |
by (metis hull_minimal span_inc subspace_imp_convex subspace_span) |
33175 | 2056 |
|
2057 |
lemma convex_hull_subset_affine_hull: "(convex hull s) \<subseteq> (affine hull s)" |
|
53302 | 2058 |
by (metis affine_affine_hull affine_imp_convex hull_minimal hull_subset) |
2059 |
||
2060 |
||
2061 |
lemma affine_dependent_imp_dependent: "affine_dependent s \<Longrightarrow> dependent s" |
|
49531 | 2062 |
unfolding affine_dependent_def dependent_def |
33175 | 2063 |
using affine_hull_subset_span by auto |
2064 |
||
2065 |
lemma dependent_imp_affine_dependent: |
|
53302 | 2066 |
assumes "dependent {x - a| x . x \<in> s}" |
2067 |
and "a \<notin> s" |
|
33175 | 2068 |
shows "affine_dependent (insert a s)" |
53302 | 2069 |
proof - |
49531 | 2070 |
from assms(1)[unfolded dependent_explicit] obtain S u v |
53347 | 2071 |
where obt: "finite S" "S \<subseteq> {x - a |x. x \<in> s}" "v\<in>S" "u v \<noteq> 0" "(\<Sum>v\<in>S. u v *\<^sub>R v) = 0" |
2072 |
by auto |
|
33175 | 2073 |
def t \<equiv> "(\<lambda>x. x + a) ` S" |
2074 |
||
53347 | 2075 |
have inj: "inj_on (\<lambda>x. x + a) S" |
53302 | 2076 |
unfolding inj_on_def by auto |
2077 |
have "0 \<notin> S" |
|
2078 |
using obt(2) assms(2) unfolding subset_eq by auto |
|
53347 | 2079 |
have fin: "finite t" and "t \<subseteq> s" |
53302 | 2080 |
unfolding t_def using obt(1,2) by auto |
2081 |
then have "finite (insert a t)" and "insert a t \<subseteq> insert a s" |
|
2082 |
by auto |
|
2083 |
moreover have *: "\<And>P Q. (\<Sum>x\<in>t. (if x = a then P x else Q x)) = (\<Sum>x\<in>t. Q x)" |
|
57418 | 2084 |
apply (rule setsum.cong) |
60420 | 2085 |
using \<open>a\<notin>s\<close> \<open>t\<subseteq>s\<close> |
53302 | 2086 |
apply auto |
2087 |
done |
|
33175 | 2088 |
have "(\<Sum>x\<in>insert a t. if x = a then - (\<Sum>x\<in>t. u (x - a)) else u (x - a)) = 0" |
53302 | 2089 |
unfolding setsum_clauses(2)[OF fin] |
60420 | 2090 |
using \<open>a\<notin>s\<close> \<open>t\<subseteq>s\<close> |
53302 | 2091 |
apply auto |
2092 |
unfolding * |
|
2093 |
apply auto |
|
2094 |
done |
|
33175 | 2095 |
moreover have "\<exists>v\<in>insert a t. (if v = a then - (\<Sum>x\<in>t. u (x - a)) else u (v - a)) \<noteq> 0" |
53302 | 2096 |
apply (rule_tac x="v + a" in bexI) |
60420 | 2097 |
using obt(3,4) and \<open>0\<notin>S\<close> |
53302 | 2098 |
unfolding t_def |
2099 |
apply auto |
|
2100 |
done |
|
2101 |
moreover have *: "\<And>P Q. (\<Sum>x\<in>t. (if x = a then P x else Q x) *\<^sub>R x) = (\<Sum>x\<in>t. Q x *\<^sub>R x)" |
|
57418 | 2102 |
apply (rule setsum.cong) |
60420 | 2103 |
using \<open>a\<notin>s\<close> \<open>t\<subseteq>s\<close> |
53302 | 2104 |
apply auto |
2105 |
done |
|
49531 | 2106 |
have "(\<Sum>x\<in>t. u (x - a)) *\<^sub>R a = (\<Sum>v\<in>t. u (v - a) *\<^sub>R v)" |
53302 | 2107 |
unfolding scaleR_left.setsum |
57418 | 2108 |
unfolding t_def and setsum.reindex[OF inj] and o_def |
53302 | 2109 |
using obt(5) |
57418 | 2110 |
by (auto simp add: setsum.distrib scaleR_right_distrib) |
53302 | 2111 |
then have "(\<Sum>v\<in>insert a t. (if v = a then - (\<Sum>x\<in>t. u (x - a)) else u (v - a)) *\<^sub>R v) = 0" |
2112 |
unfolding setsum_clauses(2)[OF fin] |
|
60420 | 2113 |
using \<open>a\<notin>s\<close> \<open>t\<subseteq>s\<close> |
53302 | 2114 |
by (auto simp add: *) |
2115 |
ultimately show ?thesis |
|
2116 |
unfolding affine_dependent_explicit |
|
2117 |
apply (rule_tac x="insert a t" in exI) |
|
2118 |
apply auto |
|
2119 |
done |
|
33175 | 2120 |
qed |
2121 |
||
2122 |
lemma convex_cone: |
|
53302 | 2123 |
"convex s \<and> cone s \<longleftrightarrow> (\<forall>x\<in>s. \<forall>y\<in>s. (x + y) \<in> s) \<and> (\<forall>x\<in>s. \<forall>c\<ge>0. (c *\<^sub>R x) \<in> s)" |
2124 |
(is "?lhs = ?rhs") |
|
2125 |
proof - |
|
2126 |
{ |
|
2127 |
fix x y |
|
2128 |
assume "x\<in>s" "y\<in>s" and ?lhs |
|
2129 |
then have "2 *\<^sub>R x \<in>s" "2 *\<^sub>R y \<in> s" |
|
2130 |
unfolding cone_def by auto |
|
2131 |
then have "x + y \<in> s" |
|
60420 | 2132 |
using \<open>?lhs\<close>[unfolded convex_def, THEN conjunct1] |
53302 | 2133 |
apply (erule_tac x="2*\<^sub>R x" in ballE) |
2134 |
apply (erule_tac x="2*\<^sub>R y" in ballE) |
|
2135 |
apply (erule_tac x="1/2" in allE) |
|
2136 |
apply simp |
|
2137 |
apply (erule_tac x="1/2" in allE) |
|
2138 |
apply auto |
|
2139 |
done |
|
2140 |
} |
|
2141 |
then show ?thesis |
|
2142 |
unfolding convex_def cone_def by blast |
|
2143 |
qed |
|
2144 |
||
2145 |
lemma affine_dependent_biggerset: |
|
53347 | 2146 |
fixes s :: "'a::euclidean_space set" |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
2147 |
assumes "finite s" "card s \<ge> DIM('a) + 2" |
33175 | 2148 |
shows "affine_dependent s" |
53302 | 2149 |
proof - |
2150 |
have "s \<noteq> {}" using assms by auto |
|
2151 |
then obtain a where "a\<in>s" by auto |
|
2152 |
have *: "{x - a |x. x \<in> s - {a}} = (\<lambda>x. x - a) ` (s - {a})" |
|
2153 |
by auto |
|
2154 |
have "card {x - a |x. x \<in> s - {a}} = card (s - {a})" |
|
2155 |
unfolding * |
|
2156 |
apply (rule card_image) |
|
2157 |
unfolding inj_on_def |
|
2158 |
apply auto |
|
2159 |
done |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
2160 |
also have "\<dots> > DIM('a)" using assms(2) |
60420 | 2161 |
unfolding card_Diff_singleton[OF assms(1) \<open>a\<in>s\<close>] by auto |
53302 | 2162 |
finally show ?thesis |
60420 | 2163 |
apply (subst insert_Diff[OF \<open>a\<in>s\<close>, symmetric]) |
53302 | 2164 |
apply (rule dependent_imp_affine_dependent) |
2165 |
apply (rule dependent_biggerset) |
|
2166 |
apply auto |
|
2167 |
done |
|
2168 |
qed |
|
33175 | 2169 |
|
2170 |
lemma affine_dependent_biggerset_general: |
|
53347 | 2171 |
assumes "finite (s :: 'a::euclidean_space set)" |
2172 |
and "card s \<ge> dim s + 2" |
|
33175 | 2173 |
shows "affine_dependent s" |
53302 | 2174 |
proof - |
33175 | 2175 |
from assms(2) have "s \<noteq> {}" by auto |
2176 |
then obtain a where "a\<in>s" by auto |
|
53302 | 2177 |
have *: "{x - a |x. x \<in> s - {a}} = (\<lambda>x. x - a) ` (s - {a})" |
2178 |
by auto |
|
2179 |
have **: "card {x - a |x. x \<in> s - {a}} = card (s - {a})" |
|
2180 |
unfolding * |
|
2181 |
apply (rule card_image) |
|
2182 |
unfolding inj_on_def |
|
2183 |
apply auto |
|
2184 |
done |
|
33175 | 2185 |
have "dim {x - a |x. x \<in> s - {a}} \<le> dim s" |
53302 | 2186 |
apply (rule subset_le_dim) |
2187 |
unfolding subset_eq |
|
60420 | 2188 |
using \<open>a\<in>s\<close> |
53302 | 2189 |
apply (auto simp add:span_superset span_sub) |
2190 |
done |
|
33175 | 2191 |
also have "\<dots> < dim s + 1" by auto |
53302 | 2192 |
also have "\<dots> \<le> card (s - {a})" |
2193 |
using assms |
|
60420 | 2194 |
using card_Diff_singleton[OF assms(1) \<open>a\<in>s\<close>] |
53302 | 2195 |
by auto |
2196 |
finally show ?thesis |
|
60420 | 2197 |
apply (subst insert_Diff[OF \<open>a\<in>s\<close>, symmetric]) |
53302 | 2198 |
apply (rule dependent_imp_affine_dependent) |
2199 |
apply (rule dependent_biggerset_general) |
|
2200 |
unfolding ** |
|
2201 |
apply auto |
|
2202 |
done |
|
2203 |
qed |
|
2204 |
||
33175 | 2205 |
|
60420 | 2206 |
subsection \<open>Some Properties of Affine Dependent Sets\<close> |
40377 | 2207 |
|
53347 | 2208 |
lemma affine_independent_empty: "\<not> affine_dependent {}" |
40377 | 2209 |
by (simp add: affine_dependent_def) |
2210 |
||
53302 | 2211 |
lemma affine_independent_sing: "\<not> affine_dependent {a}" |
2212 |
by (simp add: affine_dependent_def) |
|
2213 |
||
2214 |
lemma affine_hull_translation: "affine hull ((\<lambda>x. a + x) ` S) = (\<lambda>x. a + x) ` (affine hull S)" |
|
2215 |
proof - |
|
2216 |
have "affine ((\<lambda>x. a + x) ` (affine hull S))" |
|
60303 | 2217 |
using affine_translation affine_affine_hull by blast |
53347 | 2218 |
moreover have "(\<lambda>x. a + x) ` S \<subseteq> (\<lambda>x. a + x) ` (affine hull S)" |
53302 | 2219 |
using hull_subset[of S] by auto |
53347 | 2220 |
ultimately have h1: "affine hull ((\<lambda>x. a + x) ` S) \<subseteq> (\<lambda>x. a + x) ` (affine hull S)" |
53302 | 2221 |
by (metis hull_minimal) |
2222 |
have "affine((\<lambda>x. -a + x) ` (affine hull ((\<lambda>x. a + x) ` S)))" |
|
60303 | 2223 |
using affine_translation affine_affine_hull by blast |
53347 | 2224 |
moreover have "(\<lambda>x. -a + x) ` (\<lambda>x. a + x) ` S \<subseteq> (\<lambda>x. -a + x) ` (affine hull ((\<lambda>x. a + x) ` S))" |
53302 | 2225 |
using hull_subset[of "(\<lambda>x. a + x) ` S"] by auto |
53347 | 2226 |
moreover have "S = (\<lambda>x. -a + x) ` (\<lambda>x. a + x) ` S" |
53302 | 2227 |
using translation_assoc[of "-a" a] by auto |
2228 |
ultimately have "(\<lambda>x. -a + x) ` (affine hull ((\<lambda>x. a + x) ` S)) >= (affine hull S)" |
|
2229 |
by (metis hull_minimal) |
|
2230 |
then have "affine hull ((\<lambda>x. a + x) ` S) >= (\<lambda>x. a + x) ` (affine hull S)" |
|
2231 |
by auto |
|
54465 | 2232 |
then show ?thesis using h1 by auto |
40377 | 2233 |
qed |
2234 |
||
2235 |
lemma affine_dependent_translation: |
|
2236 |
assumes "affine_dependent S" |
|
53339 | 2237 |
shows "affine_dependent ((\<lambda>x. a + x) ` S)" |
53302 | 2238 |
proof - |
54465 | 2239 |
obtain x where x: "x \<in> S \<and> x \<in> affine hull (S - {x})" |
53302 | 2240 |
using assms affine_dependent_def by auto |
2241 |
have "op + a ` (S - {x}) = op + a ` S - {a + x}" |
|
2242 |
by auto |
|
53347 | 2243 |
then have "a + x \<in> affine hull ((\<lambda>x. a + x) ` S - {a + x})" |
54465 | 2244 |
using affine_hull_translation[of a "S - {x}"] x by auto |
53347 | 2245 |
moreover have "a + x \<in> (\<lambda>x. a + x) ` S" |
54465 | 2246 |
using x by auto |
53302 | 2247 |
ultimately show ?thesis |
2248 |
unfolding affine_dependent_def by auto |
|
40377 | 2249 |
qed |
2250 |
||
2251 |
lemma affine_dependent_translation_eq: |
|
54465 | 2252 |
"affine_dependent S \<longleftrightarrow> affine_dependent ((\<lambda>x. a + x) ` S)" |
53302 | 2253 |
proof - |
2254 |
{ |
|
53339 | 2255 |
assume "affine_dependent ((\<lambda>x. a + x) ` S)" |
53302 | 2256 |
then have "affine_dependent S" |
53339 | 2257 |
using affine_dependent_translation[of "((\<lambda>x. a + x) ` S)" "-a"] translation_assoc[of "-a" a] |
53302 | 2258 |
by auto |
2259 |
} |
|
2260 |
then show ?thesis |
|
2261 |
using affine_dependent_translation by auto |
|
40377 | 2262 |
qed |
2263 |
||
2264 |
lemma affine_hull_0_dependent: |
|
53339 | 2265 |
assumes "0 \<in> affine hull S" |
40377 | 2266 |
shows "dependent S" |
53302 | 2267 |
proof - |
54465 | 2268 |
obtain s u where s_u: "finite s \<and> s \<noteq> {} \<and> s \<subseteq> S \<and> setsum u s = 1 \<and> (\<Sum>v\<in>s. u v *\<^sub>R v) = 0" |
53302 | 2269 |
using assms affine_hull_explicit[of S] by auto |
53339 | 2270 |
then have "\<exists>v\<in>s. u v \<noteq> 0" |
53302 | 2271 |
using setsum_not_0[of "u" "s"] by auto |
53339 | 2272 |
then have "finite s \<and> s \<subseteq> S \<and> (\<exists>v\<in>s. u v \<noteq> 0 \<and> (\<Sum>v\<in>s. u v *\<^sub>R v) = 0)" |
54465 | 2273 |
using s_u by auto |
53302 | 2274 |
then show ?thesis |
2275 |
unfolding dependent_explicit[of S] by auto |
|
40377 | 2276 |
qed |
2277 |
||
2278 |
lemma affine_dependent_imp_dependent2: |
|
2279 |
assumes "affine_dependent (insert 0 S)" |
|
2280 |
shows "dependent S" |
|
53302 | 2281 |
proof - |
54465 | 2282 |
obtain x where x: "x \<in> insert 0 S \<and> x \<in> affine hull (insert 0 S - {x})" |
53302 | 2283 |
using affine_dependent_def[of "(insert 0 S)"] assms by blast |
2284 |
then have "x \<in> span (insert 0 S - {x})" |
|
2285 |
using affine_hull_subset_span by auto |
|
2286 |
moreover have "span (insert 0 S - {x}) = span (S - {x})" |
|
2287 |
using insert_Diff_if[of "0" S "{x}"] span_insert_0[of "S-{x}"] by auto |
|
2288 |
ultimately have "x \<in> span (S - {x})" by auto |
|
2289 |
then have "x \<noteq> 0 \<Longrightarrow> dependent S" |
|
54465 | 2290 |
using x dependent_def by auto |
53302 | 2291 |
moreover |
2292 |
{ |
|
2293 |
assume "x = 0" |
|
2294 |
then have "0 \<in> affine hull S" |
|
54465 | 2295 |
using x hull_mono[of "S - {0}" S] by auto |
53302 | 2296 |
then have "dependent S" |
2297 |
using affine_hull_0_dependent by auto |
|
2298 |
} |
|
2299 |
ultimately show ?thesis by auto |
|
40377 | 2300 |
qed |
2301 |
||
2302 |
lemma affine_dependent_iff_dependent: |
|
53302 | 2303 |
assumes "a \<notin> S" |
2304 |
shows "affine_dependent (insert a S) \<longleftrightarrow> dependent ((\<lambda>x. -a + x) ` S)" |
|
2305 |
proof - |
|
2306 |
have "(op + (- a) ` S) = {x - a| x . x : S}" by auto |
|
2307 |
then show ?thesis |
|
2308 |
using affine_dependent_translation_eq[of "(insert a S)" "-a"] |
|
49531 | 2309 |
affine_dependent_imp_dependent2 assms |
53302 | 2310 |
dependent_imp_affine_dependent[of a S] |
54230
b1d955791529
more simplification rules on unary and binary minus
haftmann
parents:
53676
diff
changeset
|
2311 |
by (auto simp del: uminus_add_conv_diff) |
40377 | 2312 |
qed |
2313 |
||
2314 |
lemma affine_dependent_iff_dependent2: |
|
53339 | 2315 |
assumes "a \<in> S" |
2316 |
shows "affine_dependent S \<longleftrightarrow> dependent ((\<lambda>x. -a + x) ` (S-{a}))" |
|
53302 | 2317 |
proof - |
53339 | 2318 |
have "insert a (S - {a}) = S" |
53302 | 2319 |
using assms by auto |
2320 |
then show ?thesis |
|
2321 |
using assms affine_dependent_iff_dependent[of a "S-{a}"] by auto |
|
40377 | 2322 |
qed |
2323 |
||
2324 |
lemma affine_hull_insert_span_gen: |
|
53339 | 2325 |
"affine hull (insert a s) = (\<lambda>x. a + x) ` span ((\<lambda>x. - a + x) ` s)" |
53302 | 2326 |
proof - |
53339 | 2327 |
have h1: "{x - a |x. x \<in> s} = ((\<lambda>x. -a+x) ` s)" |
53302 | 2328 |
by auto |
2329 |
{ |
|
2330 |
assume "a \<notin> s" |
|
2331 |
then have ?thesis |
|
2332 |
using affine_hull_insert_span[of a s] h1 by auto |
|
2333 |
} |
|
2334 |
moreover |
|
2335 |
{ |
|
2336 |
assume a1: "a \<in> s" |
|
53339 | 2337 |
have "\<exists>x. x \<in> s \<and> -a+x=0" |
53302 | 2338 |
apply (rule exI[of _ a]) |
2339 |
using a1 |
|
2340 |
apply auto |
|
2341 |
done |
|
53339 | 2342 |
then have "insert 0 ((\<lambda>x. -a+x) ` (s - {a})) = (\<lambda>x. -a+x) ` s" |
53302 | 2343 |
by auto |
53339 | 2344 |
then have "span ((\<lambda>x. -a+x) ` (s - {a}))=span ((\<lambda>x. -a+x) ` s)" |
54230
b1d955791529
more simplification rules on unary and binary minus
haftmann
parents:
53676
diff
changeset
|
2345 |
using span_insert_0[of "op + (- a) ` (s - {a})"] by (auto simp del: uminus_add_conv_diff) |
53339 | 2346 |
moreover have "{x - a |x. x \<in> (s - {a})} = ((\<lambda>x. -a+x) ` (s - {a}))" |
53302 | 2347 |
by auto |
53339 | 2348 |
moreover have "insert a (s - {a}) = insert a s" |
53302 | 2349 |
using assms by auto |
2350 |
ultimately have ?thesis |
|
2351 |
using assms affine_hull_insert_span[of "a" "s-{a}"] by auto |
|
2352 |
} |
|
2353 |
ultimately show ?thesis by auto |
|
40377 | 2354 |
qed |
2355 |
||
2356 |
lemma affine_hull_span2: |
|
53302 | 2357 |
assumes "a \<in> s" |
2358 |
shows "affine hull s = (\<lambda>x. a+x) ` span ((\<lambda>x. -a+x) ` (s-{a}))" |
|
2359 |
using affine_hull_insert_span_gen[of a "s - {a}", unfolded insert_Diff[OF assms]] |
|
2360 |
by auto |
|
40377 | 2361 |
|
2362 |
lemma affine_hull_span_gen: |
|
53339 | 2363 |
assumes "a \<in> affine hull s" |
2364 |
shows "affine hull s = (\<lambda>x. a+x) ` span ((\<lambda>x. -a+x) ` s)" |
|
53302 | 2365 |
proof - |
2366 |
have "affine hull (insert a s) = affine hull s" |
|
2367 |
using hull_redundant[of a affine s] assms by auto |
|
2368 |
then show ?thesis |
|
2369 |
using affine_hull_insert_span_gen[of a "s"] by auto |
|
40377 | 2370 |
qed |
2371 |
||
2372 |
lemma affine_hull_span_0: |
|
53339 | 2373 |
assumes "0 \<in> affine hull S" |
40377 | 2374 |
shows "affine hull S = span S" |
53302 | 2375 |
using affine_hull_span_gen[of "0" S] assms by auto |
40377 | 2376 |
|
2377 |
||
2378 |
lemma extend_to_affine_basis: |
|
53339 | 2379 |
fixes S V :: "'n::euclidean_space set" |
2380 |
assumes "\<not> affine_dependent S" "S \<subseteq> V" "S \<noteq> {}" |
|
2381 |
shows "\<exists>T. \<not> affine_dependent T \<and> S \<subseteq> T \<and> T \<subseteq> V \<and> affine hull T = affine hull V" |
|
53302 | 2382 |
proof - |
54465 | 2383 |
obtain a where a: "a \<in> S" |
53302 | 2384 |
using assms by auto |
53339 | 2385 |
then have h0: "independent ((\<lambda>x. -a + x) ` (S-{a}))" |
53302 | 2386 |
using affine_dependent_iff_dependent2 assms by auto |
54465 | 2387 |
then obtain B where B: |
53339 | 2388 |
"(\<lambda>x. -a+x) ` (S - {a}) \<subseteq> B \<and> B \<subseteq> (\<lambda>x. -a+x) ` V \<and> independent B \<and> (\<lambda>x. -a+x) ` V \<subseteq> span B" |
2389 |
using maximal_independent_subset_extend[of "(\<lambda>x. -a+x) ` (S-{a})" "(\<lambda>x. -a + x) ` V"] assms |
|
53302 | 2390 |
by blast |
53339 | 2391 |
def T \<equiv> "(\<lambda>x. a+x) ` insert 0 B" |
2392 |
then have "T = insert a ((\<lambda>x. a+x) ` B)" |
|
2393 |
by auto |
|
2394 |
then have "affine hull T = (\<lambda>x. a+x) ` span B" |
|
2395 |
using affine_hull_insert_span_gen[of a "((\<lambda>x. a+x) ` B)"] translation_assoc[of "-a" a B] |
|
53302 | 2396 |
by auto |
53347 | 2397 |
then have "V \<subseteq> affine hull T" |
54465 | 2398 |
using B assms translation_inverse_subset[of a V "span B"] |
53302 | 2399 |
by auto |
53339 | 2400 |
moreover have "T \<subseteq> V" |
54465 | 2401 |
using T_def B a assms by auto |
53302 | 2402 |
ultimately have "affine hull T = affine hull V" |
44457
d366fa5551ef
declare euclidean_simps [simp] at the point they are proved;
huffman
parents:
44365
diff
changeset
|
2403 |
by (metis Int_absorb1 Int_absorb2 hull_hull hull_mono) |
53347 | 2404 |
moreover have "S \<subseteq> T" |
54465 | 2405 |
using T_def B translation_inverse_subset[of a "S-{a}" B] |
53302 | 2406 |
by auto |
2407 |
moreover have "\<not> affine_dependent T" |
|
53339 | 2408 |
using T_def affine_dependent_translation_eq[of "insert 0 B"] |
54465 | 2409 |
affine_dependent_imp_dependent2 B |
53302 | 2410 |
by auto |
60420 | 2411 |
ultimately show ?thesis using \<open>T \<subseteq> V\<close> by auto |
40377 | 2412 |
qed |
2413 |
||
49531 | 2414 |
lemma affine_basis_exists: |
53339 | 2415 |
fixes V :: "'n::euclidean_space set" |
2416 |
shows "\<exists>B. B \<subseteq> V \<and> \<not> affine_dependent B \<and> affine hull V = affine hull B" |
|
53302 | 2417 |
proof (cases "V = {}") |
2418 |
case True |
|
2419 |
then show ?thesis |
|
2420 |
using affine_independent_empty by auto |
|
2421 |
next |
|
2422 |
case False |
|
2423 |
then obtain x where "x \<in> V" by auto |
|
2424 |
then show ?thesis |
|
53347 | 2425 |
using affine_dependent_def[of "{x}"] extend_to_affine_basis[of "{x}" V] |
53302 | 2426 |
by auto |
2427 |
qed |
|
2428 |
||
40377 | 2429 |
|
60420 | 2430 |
subsection \<open>Affine Dimension of a Set\<close> |
40377 | 2431 |
|
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
2432 |
definition aff_dim :: "('a::euclidean_space) set \<Rightarrow> int" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
2433 |
where "aff_dim V = |
53339 | 2434 |
(SOME d :: int. |
2435 |
\<exists>B. affine hull B = affine hull V \<and> \<not> affine_dependent B \<and> of_nat (card B) = d + 1)" |
|
40377 | 2436 |
|
2437 |
lemma aff_dim_basis_exists: |
|
49531 | 2438 |
fixes V :: "('n::euclidean_space) set" |
53339 | 2439 |
shows "\<exists>B. affine hull B = affine hull V \<and> \<not> affine_dependent B \<and> of_nat (card B) = aff_dim V + 1" |
53302 | 2440 |
proof - |
53347 | 2441 |
obtain B where "\<not> affine_dependent B \<and> affine hull B = affine hull V" |
53302 | 2442 |
using affine_basis_exists[of V] by auto |
2443 |
then show ?thesis |
|
53339 | 2444 |
unfolding aff_dim_def |
53347 | 2445 |
some_eq_ex[of "\<lambda>d. \<exists>B. affine hull B = affine hull V \<and> \<not> affine_dependent B \<and> of_nat (card B) = d + 1"] |
53302 | 2446 |
apply auto |
53339 | 2447 |
apply (rule exI[of _ "int (card B) - (1 :: int)"]) |
53302 | 2448 |
apply (rule exI[of _ "B"]) |
2449 |
apply auto |
|
2450 |
done |
|
2451 |
qed |
|
2452 |
||
2453 |
lemma affine_hull_nonempty: "S \<noteq> {} \<longleftrightarrow> affine hull S \<noteq> {}" |
|
2454 |
proof - |
|
2455 |
have "S = {} \<Longrightarrow> affine hull S = {}" |
|
2456 |
using affine_hull_empty by auto |
|
2457 |
moreover have "affine hull S = {} \<Longrightarrow> S = {}" |
|
2458 |
unfolding hull_def by auto |
|
2459 |
ultimately show ?thesis by blast |
|
40377 | 2460 |
qed |
2461 |
||
2462 |
lemma aff_dim_parallel_subspace_aux: |
|
53347 | 2463 |
fixes B :: "'n::euclidean_space set" |
53302 | 2464 |
assumes "\<not> affine_dependent B" "a \<in> B" |
53339 | 2465 |
shows "finite B \<and> ((card B) - 1 = dim (span ((\<lambda>x. -a+x) ` (B-{a}))))" |
53302 | 2466 |
proof - |
53339 | 2467 |
have "independent ((\<lambda>x. -a + x) ` (B-{a}))" |
53302 | 2468 |
using affine_dependent_iff_dependent2 assms by auto |
53339 | 2469 |
then have fin: "dim (span ((\<lambda>x. -a+x) ` (B-{a}))) = card ((\<lambda>x. -a + x) ` (B-{a}))" |
2470 |
"finite ((\<lambda>x. -a + x) ` (B - {a}))" |
|
53347 | 2471 |
using indep_card_eq_dim_span[of "(\<lambda>x. -a+x) ` (B-{a})"] by auto |
53302 | 2472 |
show ?thesis |
53339 | 2473 |
proof (cases "(\<lambda>x. -a + x) ` (B - {a}) = {}") |
53302 | 2474 |
case True |
53339 | 2475 |
have "B = insert a ((\<lambda>x. a + x) ` (\<lambda>x. -a + x) ` (B - {a}))" |
53302 | 2476 |
using translation_assoc[of "a" "-a" "(B - {a})"] assms by auto |
53339 | 2477 |
then have "B = {a}" using True by auto |
53302 | 2478 |
then show ?thesis using assms fin by auto |
2479 |
next |
|
2480 |
case False |
|
53339 | 2481 |
then have "card ((\<lambda>x. -a + x) ` (B - {a})) > 0" |
53302 | 2482 |
using fin by auto |
53339 | 2483 |
moreover have h1: "card ((\<lambda>x. -a + x) ` (B-{a})) = card (B-{a})" |
53302 | 2484 |
apply (rule card_image) |
2485 |
using translate_inj_on |
|
54230
b1d955791529
more simplification rules on unary and binary minus
haftmann
parents:
53676
diff
changeset
|
2486 |
apply (auto simp del: uminus_add_conv_diff) |
53302 | 2487 |
done |
53339 | 2488 |
ultimately have "card (B-{a}) > 0" by auto |
2489 |
then have *: "finite (B - {a})" |
|
53302 | 2490 |
using card_gt_0_iff[of "(B - {a})"] by auto |
53339 | 2491 |
then have "card (B - {a}) = card B - 1" |
53302 | 2492 |
using card_Diff_singleton assms by auto |
2493 |
with * show ?thesis using fin h1 by auto |
|
2494 |
qed |
|
40377 | 2495 |
qed |
2496 |
||
2497 |
lemma aff_dim_parallel_subspace: |
|
53339 | 2498 |
fixes V L :: "'n::euclidean_space set" |
53302 | 2499 |
assumes "V \<noteq> {}" |
53339 | 2500 |
and "subspace L" |
2501 |
and "affine_parallel (affine hull V) L" |
|
53302 | 2502 |
shows "aff_dim V = int (dim L)" |
2503 |
proof - |
|
53339 | 2504 |
obtain B where |
54465 | 2505 |
B: "affine hull B = affine hull V \<and> \<not> affine_dependent B \<and> int (card B) = aff_dim V + 1" |
53302 | 2506 |
using aff_dim_basis_exists by auto |
2507 |
then have "B \<noteq> {}" |
|
54465 | 2508 |
using assms B affine_hull_nonempty[of V] affine_hull_nonempty[of B] |
53302 | 2509 |
by auto |
54465 | 2510 |
then obtain a where a: "a \<in> B" by auto |
53302 | 2511 |
def Lb \<equiv> "span ((\<lambda>x. -a+x) ` (B-{a}))" |
40377 | 2512 |
moreover have "affine_parallel (affine hull B) Lb" |
54465 | 2513 |
using Lb_def B assms affine_hull_span2[of a B] a |
53339 | 2514 |
affine_parallel_commut[of "Lb" "(affine hull B)"] |
2515 |
unfolding affine_parallel_def |
|
2516 |
by auto |
|
53302 | 2517 |
moreover have "subspace Lb" |
2518 |
using Lb_def subspace_span by auto |
|
2519 |
moreover have "affine hull B \<noteq> {}" |
|
54465 | 2520 |
using assms B affine_hull_nonempty[of V] by auto |
53302 | 2521 |
ultimately have "L = Lb" |
54465 | 2522 |
using assms affine_parallel_subspace[of "affine hull B"] affine_affine_hull[of B] B |
53302 | 2523 |
by auto |
53339 | 2524 |
then have "dim L = dim Lb" |
2525 |
by auto |
|
2526 |
moreover have "card B - 1 = dim Lb" and "finite B" |
|
54465 | 2527 |
using Lb_def aff_dim_parallel_subspace_aux a B by auto |
53302 | 2528 |
ultimately show ?thesis |
60420 | 2529 |
using B \<open>B \<noteq> {}\<close> card_gt_0_iff[of B] by auto |
40377 | 2530 |
qed |
2531 |
||
2532 |
lemma aff_independent_finite: |
|
53339 | 2533 |
fixes B :: "'n::euclidean_space set" |
2534 |
assumes "\<not> affine_dependent B" |
|
53302 | 2535 |
shows "finite B" |
2536 |
proof - |
|
2537 |
{ |
|
2538 |
assume "B \<noteq> {}" |
|
2539 |
then obtain a where "a \<in> B" by auto |
|
2540 |
then have ?thesis |
|
2541 |
using aff_dim_parallel_subspace_aux assms by auto |
|
2542 |
} |
|
2543 |
then show ?thesis by auto |
|
40377 | 2544 |
qed |
2545 |
||
2546 |
lemma independent_finite: |
|
53339 | 2547 |
fixes B :: "'n::euclidean_space set" |
53302 | 2548 |
assumes "independent B" |
2549 |
shows "finite B" |
|
2550 |
using affine_dependent_imp_dependent[of B] aff_independent_finite[of B] assms |
|
2551 |
by auto |
|
40377 | 2552 |
|
2553 |
lemma subspace_dim_equal: |
|
53339 | 2554 |
assumes "subspace (S :: ('n::euclidean_space) set)" |
2555 |
and "subspace T" |
|
2556 |
and "S \<subseteq> T" |
|
2557 |
and "dim S \<ge> dim T" |
|
53302 | 2558 |
shows "S = T" |
2559 |
proof - |
|
53347 | 2560 |
obtain B where B: "B \<le> S" "independent B \<and> S \<subseteq> span B" "card B = dim S" |
53339 | 2561 |
using basis_exists[of S] by auto |
2562 |
then have "span B \<subseteq> S" |
|
2563 |
using span_mono[of B S] span_eq[of S] assms by metis |
|
2564 |
then have "span B = S" |
|
53347 | 2565 |
using B by auto |
53339 | 2566 |
have "dim S = dim T" |
2567 |
using assms dim_subset[of S T] by auto |
|
2568 |
then have "T \<subseteq> span B" |
|
53347 | 2569 |
using card_eq_dim[of B T] B independent_finite assms by auto |
53339 | 2570 |
then show ?thesis |
60420 | 2571 |
using assms \<open>span B = S\<close> by auto |
40377 | 2572 |
qed |
2573 |
||
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
2574 |
lemma span_substd_basis: |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
2575 |
assumes d: "d \<subseteq> Basis" |
53347 | 2576 |
shows "span d = {x. \<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x\<bullet>i = 0}" |
2577 |
(is "_ = ?B") |
|
53339 | 2578 |
proof - |
2579 |
have "d \<subseteq> ?B" |
|
2580 |
using d by (auto simp: inner_Basis) |
|
2581 |
moreover have s: "subspace ?B" |
|
2582 |
using subspace_substandard[of "\<lambda>i. i \<notin> d"] . |
|
2583 |
ultimately have "span d \<subseteq> ?B" |
|
2584 |
using span_mono[of d "?B"] span_eq[of "?B"] by blast |
|
53374
a14d2a854c02
tuned proofs -- clarified flow of facts wrt. calculation;
wenzelm
parents:
53348
diff
changeset
|
2585 |
moreover have *: "card d \<le> dim (span d)" |
53339 | 2586 |
using independent_card_le_dim[of d "span d"] independent_substdbasis[OF assms] span_inc[of d] |
2587 |
by auto |
|
53374
a14d2a854c02
tuned proofs -- clarified flow of facts wrt. calculation;
wenzelm
parents:
53348
diff
changeset
|
2588 |
moreover from * have "dim ?B \<le> dim (span d)" |
53339 | 2589 |
using dim_substandard[OF assms] by auto |
2590 |
ultimately show ?thesis |
|
2591 |
using s subspace_dim_equal[of "span d" "?B"] subspace_span[of d] by auto |
|
40377 | 2592 |
qed |
2593 |
||
2594 |
lemma basis_to_substdbasis_subspace_isomorphism: |
|
53339 | 2595 |
fixes B :: "'a::euclidean_space set" |
2596 |
assumes "independent B" |
|
2597 |
shows "\<exists>f d::'a set. card d = card B \<and> linear f \<and> f ` B = d \<and> |
|
2598 |
f ` span B = {x. \<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x \<bullet> i = 0} \<and> inj_on f (span B) \<and> d \<subseteq> Basis" |
|
2599 |
proof - |
|
2600 |
have B: "card B = dim B" |
|
2601 |
using dim_unique[of B B "card B"] assms span_inc[of B] by auto |
|
2602 |
have "dim B \<le> card (Basis :: 'a set)" |
|
2603 |
using dim_subset_UNIV[of B] by simp |
|
2604 |
from ex_card[OF this] obtain d :: "'a set" where d: "d \<subseteq> Basis" and t: "card d = dim B" |
|
2605 |
by auto |
|
53347 | 2606 |
let ?t = "{x::'a::euclidean_space. \<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x\<bullet>i = 0}" |
53339 | 2607 |
have "\<exists>f. linear f \<and> f ` B = d \<and> f ` span B = ?t \<and> inj_on f (span B)" |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
2608 |
apply (rule basis_to_basis_subspace_isomorphism[of "span B" ?t B "d"]) |
53339 | 2609 |
apply (rule subspace_span) |
2610 |
apply (rule subspace_substandard) |
|
2611 |
defer |
|
2612 |
apply (rule span_inc) |
|
2613 |
apply (rule assms) |
|
2614 |
defer |
|
2615 |
unfolding dim_span[of B] |
|
2616 |
apply(rule B) |
|
54465 | 2617 |
unfolding span_substd_basis[OF d, symmetric] |
53339 | 2618 |
apply (rule span_inc) |
2619 |
apply (rule independent_substdbasis[OF d]) |
|
2620 |
apply rule |
|
2621 |
apply assumption |
|
2622 |
unfolding t[symmetric] span_substd_basis[OF d] dim_substandard[OF d] |
|
2623 |
apply auto |
|
2624 |
done |
|
60420 | 2625 |
with t \<open>card B = dim B\<close> d show ?thesis by auto |
40377 | 2626 |
qed |
2627 |
||
2628 |
lemma aff_dim_empty: |
|
53339 | 2629 |
fixes S :: "'n::euclidean_space set" |
2630 |
shows "S = {} \<longleftrightarrow> aff_dim S = -1" |
|
2631 |
proof - |
|
2632 |
obtain B where *: "affine hull B = affine hull S" |
|
2633 |
and "\<not> affine_dependent B" |
|
2634 |
and "int (card B) = aff_dim S + 1" |
|
2635 |
using aff_dim_basis_exists by auto |
|
2636 |
moreover |
|
2637 |
from * have "S = {} \<longleftrightarrow> B = {}" |
|
2638 |
using affine_hull_nonempty[of B] affine_hull_nonempty[of S] by auto |
|
2639 |
ultimately show ?thesis |
|
2640 |
using aff_independent_finite[of B] card_gt_0_iff[of B] by auto |
|
2641 |
qed |
|
2642 |
||
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
2643 |
lemma aff_dim_empty_eq [simp]: "aff_dim ({}::'a::euclidean_space set) = -1" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
2644 |
by (simp add: aff_dim_empty [symmetric]) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
2645 |
|
53339 | 2646 |
lemma aff_dim_affine_hull: "aff_dim (affine hull S) = aff_dim S" |
2647 |
unfolding aff_dim_def using hull_hull[of _ S] by auto |
|
40377 | 2648 |
|
2649 |
lemma aff_dim_affine_hull2: |
|
53339 | 2650 |
assumes "affine hull S = affine hull T" |
2651 |
shows "aff_dim S = aff_dim T" |
|
2652 |
unfolding aff_dim_def using assms by auto |
|
40377 | 2653 |
|
49531 | 2654 |
lemma aff_dim_unique: |
53339 | 2655 |
fixes B V :: "'n::euclidean_space set" |
2656 |
assumes "affine hull B = affine hull V \<and> \<not> affine_dependent B" |
|
2657 |
shows "of_nat (card B) = aff_dim V + 1" |
|
2658 |
proof (cases "B = {}") |
|
2659 |
case True |
|
2660 |
then have "V = {}" |
|
2661 |
using affine_hull_nonempty[of V] affine_hull_nonempty[of B] assms |
|
2662 |
by auto |
|
2663 |
then have "aff_dim V = (-1::int)" |
|
2664 |
using aff_dim_empty by auto |
|
2665 |
then show ?thesis |
|
60420 | 2666 |
using \<open>B = {}\<close> by auto |
53339 | 2667 |
next |
2668 |
case False |
|
54465 | 2669 |
then obtain a where a: "a \<in> B" by auto |
53339 | 2670 |
def Lb \<equiv> "span ((\<lambda>x. -a+x) ` (B-{a}))" |
40377 | 2671 |
have "affine_parallel (affine hull B) Lb" |
54465 | 2672 |
using Lb_def affine_hull_span2[of a B] a |
53339 | 2673 |
affine_parallel_commut[of "Lb" "(affine hull B)"] |
2674 |
unfolding affine_parallel_def by auto |
|
2675 |
moreover have "subspace Lb" |
|
2676 |
using Lb_def subspace_span by auto |
|
2677 |
ultimately have "aff_dim B = int(dim Lb)" |
|
60420 | 2678 |
using aff_dim_parallel_subspace[of B Lb] \<open>B \<noteq> {}\<close> by auto |
53339 | 2679 |
moreover have "(card B) - 1 = dim Lb" "finite B" |
54465 | 2680 |
using Lb_def aff_dim_parallel_subspace_aux a assms by auto |
53339 | 2681 |
ultimately have "of_nat (card B) = aff_dim B + 1" |
60420 | 2682 |
using \<open>B \<noteq> {}\<close> card_gt_0_iff[of B] by auto |
53339 | 2683 |
then show ?thesis |
2684 |
using aff_dim_affine_hull2 assms by auto |
|
40377 | 2685 |
qed |
2686 |
||
49531 | 2687 |
lemma aff_dim_affine_independent: |
53339 | 2688 |
fixes B :: "'n::euclidean_space set" |
2689 |
assumes "\<not> affine_dependent B" |
|
2690 |
shows "of_nat (card B) = aff_dim B + 1" |
|
40377 | 2691 |
using aff_dim_unique[of B B] assms by auto |
2692 |
||
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
2693 |
lemma affine_independent_iff_card: |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
2694 |
fixes s :: "'a::euclidean_space set" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
2695 |
shows "~ affine_dependent s \<longleftrightarrow> finite s \<and> aff_dim s = int(card s) - 1" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
2696 |
apply (rule iffI) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
2697 |
apply (simp add: aff_dim_affine_independent aff_independent_finite) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
2698 |
by (metis affine_basis_exists [of s] aff_dim_unique card_subset_eq diff_add_cancel of_nat_eq_iff) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
2699 |
|
49531 | 2700 |
lemma aff_dim_sing: |
53339 | 2701 |
fixes a :: "'n::euclidean_space" |
2702 |
shows "aff_dim {a} = 0" |
|
40377 | 2703 |
using aff_dim_affine_independent[of "{a}"] affine_independent_sing by auto |
2704 |
||
2705 |
lemma aff_dim_inner_basis_exists: |
|
49531 | 2706 |
fixes V :: "('n::euclidean_space) set" |
53339 | 2707 |
shows "\<exists>B. B \<subseteq> V \<and> affine hull B = affine hull V \<and> |
2708 |
\<not> affine_dependent B \<and> of_nat (card B) = aff_dim V + 1" |
|
2709 |
proof - |
|
53347 | 2710 |
obtain B where B: "\<not> affine_dependent B" "B \<subseteq> V" "affine hull B = affine hull V" |
53339 | 2711 |
using affine_basis_exists[of V] by auto |
2712 |
then have "of_nat(card B) = aff_dim V+1" using aff_dim_unique by auto |
|
53347 | 2713 |
with B show ?thesis by auto |
40377 | 2714 |
qed |
2715 |
||
2716 |
lemma aff_dim_le_card: |
|
53347 | 2717 |
fixes V :: "'n::euclidean_space set" |
53339 | 2718 |
assumes "finite V" |
53347 | 2719 |
shows "aff_dim V \<le> of_nat (card V) - 1" |
53339 | 2720 |
proof - |
53347 | 2721 |
obtain B where B: "B \<subseteq> V" "of_nat (card B) = aff_dim V + 1" |
53339 | 2722 |
using aff_dim_inner_basis_exists[of V] by auto |
2723 |
then have "card B \<le> card V" |
|
2724 |
using assms card_mono by auto |
|
53347 | 2725 |
with B show ?thesis by auto |
40377 | 2726 |
qed |
2727 |
||
2728 |
lemma aff_dim_parallel_eq: |
|
53339 | 2729 |
fixes S T :: "'n::euclidean_space set" |
2730 |
assumes "affine_parallel (affine hull S) (affine hull T)" |
|
2731 |
shows "aff_dim S = aff_dim T" |
|
2732 |
proof - |
|
2733 |
{ |
|
2734 |
assume "T \<noteq> {}" "S \<noteq> {}" |
|
53347 | 2735 |
then obtain L where L: "subspace L \<and> affine_parallel (affine hull T) L" |
2736 |
using affine_parallel_subspace[of "affine hull T"] |
|
2737 |
affine_affine_hull[of T] affine_hull_nonempty |
|
53339 | 2738 |
by auto |
2739 |
then have "aff_dim T = int (dim L)" |
|
60420 | 2740 |
using aff_dim_parallel_subspace \<open>T \<noteq> {}\<close> by auto |
53339 | 2741 |
moreover have *: "subspace L \<and> affine_parallel (affine hull S) L" |
53347 | 2742 |
using L affine_parallel_assoc[of "affine hull S" "affine hull T" L] assms by auto |
53339 | 2743 |
moreover from * have "aff_dim S = int (dim L)" |
60420 | 2744 |
using aff_dim_parallel_subspace \<open>S \<noteq> {}\<close> by auto |
53339 | 2745 |
ultimately have ?thesis by auto |
2746 |
} |
|
2747 |
moreover |
|
2748 |
{ |
|
2749 |
assume "S = {}" |
|
2750 |
then have "S = {}" and "T = {}" |
|
2751 |
using assms affine_hull_nonempty |
|
2752 |
unfolding affine_parallel_def |
|
2753 |
by auto |
|
2754 |
then have ?thesis using aff_dim_empty by auto |
|
2755 |
} |
|
2756 |
moreover |
|
2757 |
{ |
|
2758 |
assume "T = {}" |
|
2759 |
then have "S = {}" and "T = {}" |
|
2760 |
using assms affine_hull_nonempty |
|
2761 |
unfolding affine_parallel_def |
|
2762 |
by auto |
|
2763 |
then have ?thesis |
|
2764 |
using aff_dim_empty by auto |
|
2765 |
} |
|
2766 |
ultimately show ?thesis by blast |
|
40377 | 2767 |
qed |
2768 |
||
2769 |
lemma aff_dim_translation_eq: |
|
53339 | 2770 |
fixes a :: "'n::euclidean_space" |
2771 |
shows "aff_dim ((\<lambda>x. a + x) ` S) = aff_dim S" |
|
2772 |
proof - |
|
53347 | 2773 |
have "affine_parallel (affine hull S) (affine hull ((\<lambda>x. a + x) ` S))" |
53339 | 2774 |
unfolding affine_parallel_def |
2775 |
apply (rule exI[of _ "a"]) |
|
2776 |
using affine_hull_translation[of a S] |
|
2777 |
apply auto |
|
2778 |
done |
|
2779 |
then show ?thesis |
|
2780 |
using aff_dim_parallel_eq[of S "(\<lambda>x. a + x) ` S"] by auto |
|
40377 | 2781 |
qed |
2782 |
||
2783 |
lemma aff_dim_affine: |
|
53339 | 2784 |
fixes S L :: "'n::euclidean_space set" |
2785 |
assumes "S \<noteq> {}" |
|
2786 |
and "affine S" |
|
2787 |
and "subspace L" |
|
2788 |
and "affine_parallel S L" |
|
2789 |
shows "aff_dim S = int (dim L)" |
|
2790 |
proof - |
|
2791 |
have *: "affine hull S = S" |
|
2792 |
using assms affine_hull_eq[of S] by auto |
|
2793 |
then have "affine_parallel (affine hull S) L" |
|
2794 |
using assms by (simp add: *) |
|
2795 |
then show ?thesis |
|
2796 |
using assms aff_dim_parallel_subspace[of S L] by blast |
|
40377 | 2797 |
qed |
2798 |
||
2799 |
lemma dim_affine_hull: |
|
53339 | 2800 |
fixes S :: "'n::euclidean_space set" |
2801 |
shows "dim (affine hull S) = dim S" |
|
2802 |
proof - |
|
2803 |
have "dim (affine hull S) \<ge> dim S" |
|
2804 |
using dim_subset by auto |
|
2805 |
moreover have "dim (span S) \<ge> dim (affine hull S)" |
|
60303 | 2806 |
using dim_subset affine_hull_subset_span by blast |
53339 | 2807 |
moreover have "dim (span S) = dim S" |
2808 |
using dim_span by auto |
|
2809 |
ultimately show ?thesis by auto |
|
40377 | 2810 |
qed |
2811 |
||
2812 |
lemma aff_dim_subspace: |
|
53339 | 2813 |
fixes S :: "'n::euclidean_space set" |
2814 |
assumes "S \<noteq> {}" |
|
2815 |
and "subspace S" |
|
2816 |
shows "aff_dim S = int (dim S)" |
|
2817 |
using aff_dim_affine[of S S] assms subspace_imp_affine[of S] affine_parallel_reflex[of S] |
|
2818 |
by auto |
|
40377 | 2819 |
|
2820 |
lemma aff_dim_zero: |
|
53339 | 2821 |
fixes S :: "'n::euclidean_space set" |
2822 |
assumes "0 \<in> affine hull S" |
|
2823 |
shows "aff_dim S = int (dim S)" |
|
2824 |
proof - |
|
2825 |
have "subspace (affine hull S)" |
|
2826 |
using subspace_affine[of "affine hull S"] affine_affine_hull assms |
|
2827 |
by auto |
|
2828 |
then have "aff_dim (affine hull S) = int (dim (affine hull S))" |
|
2829 |
using assms aff_dim_subspace[of "affine hull S"] by auto |
|
2830 |
then show ?thesis |
|
2831 |
using aff_dim_affine_hull[of S] dim_affine_hull[of S] |
|
2832 |
by auto |
|
40377 | 2833 |
qed |
2834 |
||
53347 | 2835 |
lemma aff_dim_univ: "aff_dim (UNIV :: 'n::euclidean_space set) = int(DIM('n))" |
2836 |
using aff_dim_subspace[of "(UNIV :: 'n::euclidean_space set)"] |
|
53339 | 2837 |
dim_UNIV[where 'a="'n::euclidean_space"] |
2838 |
by auto |
|
40377 | 2839 |
|
2840 |
lemma aff_dim_geq: |
|
53339 | 2841 |
fixes V :: "'n::euclidean_space set" |
2842 |
shows "aff_dim V \<ge> -1" |
|
2843 |
proof - |
|
53347 | 2844 |
obtain B where "affine hull B = affine hull V" |
2845 |
and "\<not> affine_dependent B" |
|
2846 |
and "int (card B) = aff_dim V + 1" |
|
53339 | 2847 |
using aff_dim_basis_exists by auto |
2848 |
then show ?thesis by auto |
|
40377 | 2849 |
qed |
2850 |
||
49531 | 2851 |
lemma independent_card_le_aff_dim: |
53347 | 2852 |
fixes B :: "'n::euclidean_space set" |
2853 |
assumes "B \<subseteq> V" |
|
53339 | 2854 |
assumes "\<not> affine_dependent B" |
2855 |
shows "int (card B) \<le> aff_dim V + 1" |
|
2856 |
proof (cases "B = {}") |
|
2857 |
case True |
|
2858 |
then have "-1 \<le> aff_dim V" |
|
2859 |
using aff_dim_geq by auto |
|
2860 |
with True show ?thesis by auto |
|
2861 |
next |
|
2862 |
case False |
|
53347 | 2863 |
then obtain T where T: "\<not> affine_dependent T \<and> B \<subseteq> T \<and> T \<subseteq> V \<and> affine hull T = affine hull V" |
53339 | 2864 |
using assms extend_to_affine_basis[of B V] by auto |
2865 |
then have "of_nat (card T) = aff_dim V + 1" |
|
2866 |
using aff_dim_unique by auto |
|
2867 |
then show ?thesis |
|
53347 | 2868 |
using T card_mono[of T B] aff_independent_finite[of T] by auto |
40377 | 2869 |
qed |
2870 |
||
2871 |
lemma aff_dim_subset: |
|
53347 | 2872 |
fixes S T :: "'n::euclidean_space set" |
2873 |
assumes "S \<subseteq> T" |
|
2874 |
shows "aff_dim S \<le> aff_dim T" |
|
53339 | 2875 |
proof - |
53347 | 2876 |
obtain B where B: "\<not> affine_dependent B" "B \<subseteq> S" "affine hull B = affine hull S" |
2877 |
"of_nat (card B) = aff_dim S + 1" |
|
53339 | 2878 |
using aff_dim_inner_basis_exists[of S] by auto |
2879 |
then have "int (card B) \<le> aff_dim T + 1" |
|
2880 |
using assms independent_card_le_aff_dim[of B T] by auto |
|
53347 | 2881 |
with B show ?thesis by auto |
40377 | 2882 |
qed |
2883 |
||
2884 |
lemma aff_dim_subset_univ: |
|
53339 | 2885 |
fixes S :: "'n::euclidean_space set" |
2886 |
shows "aff_dim S \<le> int (DIM('n))" |
|
49531 | 2887 |
proof - |
53339 | 2888 |
have "aff_dim (UNIV :: 'n::euclidean_space set) = int(DIM('n))" |
2889 |
using aff_dim_univ by auto |
|
2890 |
then show "aff_dim (S:: 'n::euclidean_space set) \<le> int(DIM('n))" |
|
2891 |
using assms aff_dim_subset[of S "(UNIV :: ('n::euclidean_space) set)"] subset_UNIV by auto |
|
40377 | 2892 |
qed |
2893 |
||
2894 |
lemma affine_dim_equal: |
|
53347 | 2895 |
fixes S :: "'n::euclidean_space set" |
2896 |
assumes "affine S" "affine T" "S \<noteq> {}" "S \<subseteq> T" "aff_dim S = aff_dim T" |
|
2897 |
shows "S = T" |
|
2898 |
proof - |
|
2899 |
obtain a where "a \<in> S" using assms by auto |
|
2900 |
then have "a \<in> T" using assms by auto |
|
2901 |
def LS \<equiv> "{y. \<exists>x \<in> S. (-a) + x = y}" |
|
2902 |
then have ls: "subspace LS" "affine_parallel S LS" |
|
60420 | 2903 |
using assms parallel_subspace_explicit[of S a LS] \<open>a \<in> S\<close> by auto |
53347 | 2904 |
then have h1: "int(dim LS) = aff_dim S" |
2905 |
using assms aff_dim_affine[of S LS] by auto |
|
2906 |
have "T \<noteq> {}" using assms by auto |
|
2907 |
def LT \<equiv> "{y. \<exists>x \<in> T. (-a) + x = y}" |
|
2908 |
then have lt: "subspace LT \<and> affine_parallel T LT" |
|
60420 | 2909 |
using assms parallel_subspace_explicit[of T a LT] \<open>a \<in> T\<close> by auto |
53347 | 2910 |
then have "int(dim LT) = aff_dim T" |
60420 | 2911 |
using assms aff_dim_affine[of T LT] \<open>T \<noteq> {}\<close> by auto |
53347 | 2912 |
then have "dim LS = dim LT" |
2913 |
using h1 assms by auto |
|
2914 |
moreover have "LS \<le> LT" |
|
2915 |
using LS_def LT_def assms by auto |
|
2916 |
ultimately have "LS = LT" |
|
2917 |
using subspace_dim_equal[of LS LT] ls lt by auto |
|
2918 |
moreover have "S = {x. \<exists>y \<in> LS. a+y=x}" |
|
2919 |
using LS_def by auto |
|
2920 |
moreover have "T = {x. \<exists>y \<in> LT. a+y=x}" |
|
2921 |
using LT_def by auto |
|
2922 |
ultimately show ?thesis by auto |
|
40377 | 2923 |
qed |
2924 |
||
2925 |
lemma affine_hull_univ: |
|
53347 | 2926 |
fixes S :: "'n::euclidean_space set" |
2927 |
assumes "aff_dim S = int(DIM('n))" |
|
2928 |
shows "affine hull S = (UNIV :: ('n::euclidean_space) set)" |
|
2929 |
proof - |
|
2930 |
have "S \<noteq> {}" |
|
2931 |
using assms aff_dim_empty[of S] by auto |
|
2932 |
have h0: "S \<subseteq> affine hull S" |
|
2933 |
using hull_subset[of S _] by auto |
|
2934 |
have h1: "aff_dim (UNIV :: ('n::euclidean_space) set) = aff_dim S" |
|
2935 |
using aff_dim_univ assms by auto |
|
2936 |
then have h2: "aff_dim (affine hull S) \<le> aff_dim (UNIV :: ('n::euclidean_space) set)" |
|
2937 |
using aff_dim_subset_univ[of "affine hull S"] assms h0 by auto |
|
2938 |
have h3: "aff_dim S \<le> aff_dim (affine hull S)" |
|
2939 |
using h0 aff_dim_subset[of S "affine hull S"] assms by auto |
|
2940 |
then have h4: "aff_dim (affine hull S) = aff_dim (UNIV :: ('n::euclidean_space) set)" |
|
2941 |
using h0 h1 h2 by auto |
|
2942 |
then show ?thesis |
|
2943 |
using affine_dim_equal[of "affine hull S" "(UNIV :: ('n::euclidean_space) set)"] |
|
60420 | 2944 |
affine_affine_hull[of S] affine_UNIV assms h4 h0 \<open>S \<noteq> {}\<close> |
53347 | 2945 |
by auto |
40377 | 2946 |
qed |
2947 |
||
2948 |
lemma aff_dim_convex_hull: |
|
53347 | 2949 |
fixes S :: "'n::euclidean_space set" |
2950 |
shows "aff_dim (convex hull S) = aff_dim S" |
|
49531 | 2951 |
using aff_dim_affine_hull[of S] convex_hull_subset_affine_hull[of S] |
53347 | 2952 |
hull_subset[of S "convex"] aff_dim_subset[of S "convex hull S"] |
2953 |
aff_dim_subset[of "convex hull S" "affine hull S"] |
|
2954 |
by auto |
|
40377 | 2955 |
|
2956 |
lemma aff_dim_cball: |
|
53347 | 2957 |
fixes a :: "'n::euclidean_space" |
2958 |
assumes "e > 0" |
|
2959 |
shows "aff_dim (cball a e) = int (DIM('n))" |
|
2960 |
proof - |
|
2961 |
have "(\<lambda>x. a + x) ` (cball 0 e) \<subseteq> cball a e" |
|
2962 |
unfolding cball_def dist_norm by auto |
|
2963 |
then have "aff_dim (cball (0 :: 'n::euclidean_space) e) \<le> aff_dim (cball a e)" |
|
2964 |
using aff_dim_translation_eq[of a "cball 0 e"] |
|
2965 |
aff_dim_subset[of "op + a ` cball 0 e" "cball a e"] |
|
2966 |
by auto |
|
2967 |
moreover have "aff_dim (cball (0 :: 'n::euclidean_space) e) = int (DIM('n))" |
|
2968 |
using hull_inc[of "(0 :: 'n::euclidean_space)" "cball 0 e"] |
|
2969 |
centre_in_cball[of "(0 :: 'n::euclidean_space)"] assms |
|
2970 |
by (simp add: dim_cball[of e] aff_dim_zero[of "cball 0 e"]) |
|
2971 |
ultimately show ?thesis |
|
2972 |
using aff_dim_subset_univ[of "cball a e"] by auto |
|
40377 | 2973 |
qed |
2974 |
||
2975 |
lemma aff_dim_open: |
|
53347 | 2976 |
fixes S :: "'n::euclidean_space set" |
2977 |
assumes "open S" |
|
2978 |
and "S \<noteq> {}" |
|
2979 |
shows "aff_dim S = int (DIM('n))" |
|
2980 |
proof - |
|
2981 |
obtain x where "x \<in> S" |
|
2982 |
using assms by auto |
|
2983 |
then obtain e where e: "e > 0" "cball x e \<subseteq> S" |
|
2984 |
using open_contains_cball[of S] assms by auto |
|
2985 |
then have "aff_dim (cball x e) \<le> aff_dim S" |
|
2986 |
using aff_dim_subset by auto |
|
2987 |
with e show ?thesis |
|
2988 |
using aff_dim_cball[of e x] aff_dim_subset_univ[of S] by auto |
|
40377 | 2989 |
qed |
2990 |
||
2991 |
lemma low_dim_interior: |
|
53347 | 2992 |
fixes S :: "'n::euclidean_space set" |
2993 |
assumes "\<not> aff_dim S = int (DIM('n))" |
|
2994 |
shows "interior S = {}" |
|
2995 |
proof - |
|
2996 |
have "aff_dim(interior S) \<le> aff_dim S" |
|
2997 |
using interior_subset aff_dim_subset[of "interior S" S] by auto |
|
2998 |
then show ?thesis |
|
2999 |
using aff_dim_open[of "interior S"] aff_dim_subset_univ[of S] assms by auto |
|
40377 | 3000 |
qed |
3001 |
||
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
3002 |
corollary empty_interior_lowdim: |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
3003 |
fixes S :: "'n::euclidean_space set" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
3004 |
shows "dim S < DIM ('n) \<Longrightarrow> interior S = {}" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
3005 |
by (metis low_dim_interior affine_hull_univ dim_affine_hull less_not_refl dim_UNIV) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
3006 |
|
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3007 |
subsection \<open>Caratheodory's theorem.\<close> |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3008 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3009 |
lemma convex_hull_caratheodory_aff_dim: |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3010 |
fixes p :: "('a::euclidean_space) set" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3011 |
shows "convex hull p = |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3012 |
{y. \<exists>s u. finite s \<and> s \<subseteq> p \<and> card s \<le> aff_dim p + 1 \<and> |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3013 |
(\<forall>x\<in>s. 0 \<le> u x) \<and> setsum u s = 1 \<and> setsum (\<lambda>v. u v *\<^sub>R v) s = y}" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3014 |
unfolding convex_hull_explicit set_eq_iff mem_Collect_eq |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3015 |
proof (intro allI iffI) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3016 |
fix y |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3017 |
let ?P = "\<lambda>n. \<exists>s u. finite s \<and> card s = n \<and> s \<subseteq> p \<and> (\<forall>x\<in>s. 0 \<le> u x) \<and> |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3018 |
setsum u s = 1 \<and> (\<Sum>v\<in>s. u v *\<^sub>R v) = y" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3019 |
assume "\<exists>s u. finite s \<and> s \<subseteq> p \<and> (\<forall>x\<in>s. 0 \<le> u x) \<and> setsum u s = 1 \<and> (\<Sum>v\<in>s. u v *\<^sub>R v) = y" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3020 |
then obtain N where "?P N" by auto |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3021 |
then have "\<exists>n\<le>N. (\<forall>k<n. \<not> ?P k) \<and> ?P n" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3022 |
apply (rule_tac ex_least_nat_le) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3023 |
apply auto |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3024 |
done |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3025 |
then obtain n where "?P n" and smallest: "\<forall>k<n. \<not> ?P k" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3026 |
by blast |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3027 |
then obtain s u where obt: "finite s" "card s = n" "s\<subseteq>p" "\<forall>x\<in>s. 0 \<le> u x" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3028 |
"setsum u s = 1" "(\<Sum>v\<in>s. u v *\<^sub>R v) = y" by auto |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3029 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3030 |
have "card s \<le> aff_dim p + 1" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3031 |
proof (rule ccontr, simp only: not_le) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3032 |
assume "aff_dim p + 1 < card s" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3033 |
then have "affine_dependent s" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3034 |
using affine_dependent_biggerset[OF obt(1)] independent_card_le_aff_dim not_less obt(3) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3035 |
by blast |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3036 |
then obtain w v where wv: "setsum w s = 0" "v\<in>s" "w v \<noteq> 0" "(\<Sum>v\<in>s. w v *\<^sub>R v) = 0" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3037 |
using affine_dependent_explicit_finite[OF obt(1)] by auto |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3038 |
def i \<equiv> "(\<lambda>v. (u v) / (- w v)) ` {v\<in>s. w v < 0}" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3039 |
def t \<equiv> "Min i" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3040 |
have "\<exists>x\<in>s. w x < 0" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3041 |
proof (rule ccontr, simp add: not_less) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3042 |
assume as:"\<forall>x\<in>s. 0 \<le> w x" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3043 |
then have "setsum w (s - {v}) \<ge> 0" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3044 |
apply (rule_tac setsum_nonneg) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3045 |
apply auto |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3046 |
done |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3047 |
then have "setsum w s > 0" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3048 |
unfolding setsum.remove[OF obt(1) \<open>v\<in>s\<close>] |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3049 |
using as[THEN bspec[where x=v]] \<open>v\<in>s\<close> \<open>w v \<noteq> 0\<close> by auto |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3050 |
then show False using wv(1) by auto |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3051 |
qed |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3052 |
then have "i \<noteq> {}" unfolding i_def by auto |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3053 |
then have "t \<ge> 0" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3054 |
using Min_ge_iff[of i 0 ] and obt(1) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3055 |
unfolding t_def i_def |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3056 |
using obt(4)[unfolded le_less] |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3057 |
by (auto simp: divide_le_0_iff) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3058 |
have t: "\<forall>v\<in>s. u v + t * w v \<ge> 0" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3059 |
proof |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3060 |
fix v |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3061 |
assume "v \<in> s" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3062 |
then have v: "0 \<le> u v" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3063 |
using obt(4)[THEN bspec[where x=v]] by auto |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3064 |
show "0 \<le> u v + t * w v" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3065 |
proof (cases "w v < 0") |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3066 |
case False |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3067 |
thus ?thesis using v \<open>t\<ge>0\<close> by auto |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3068 |
next |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3069 |
case True |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3070 |
then have "t \<le> u v / (- w v)" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3071 |
using \<open>v\<in>s\<close> unfolding t_def i_def |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3072 |
apply (rule_tac Min_le) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3073 |
using obt(1) apply auto |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3074 |
done |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3075 |
then show ?thesis |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3076 |
unfolding real_0_le_add_iff |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3077 |
using pos_le_divide_eq[OF True[unfolded neg_0_less_iff_less[symmetric]]] |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3078 |
by auto |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3079 |
qed |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3080 |
qed |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3081 |
obtain a where "a \<in> s" and "t = (\<lambda>v. (u v) / (- w v)) a" and "w a < 0" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3082 |
using Min_in[OF _ \<open>i\<noteq>{}\<close>] and obt(1) unfolding i_def t_def by auto |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3083 |
then have a: "a \<in> s" "u a + t * w a = 0" by auto |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3084 |
have *: "\<And>f. setsum f (s - {a}) = setsum f s - ((f a)::'b::ab_group_add)" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3085 |
unfolding setsum.remove[OF obt(1) \<open>a\<in>s\<close>] by auto |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3086 |
have "(\<Sum>v\<in>s. u v + t * w v) = 1" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3087 |
unfolding setsum.distrib wv(1) setsum_right_distrib[symmetric] obt(5) by auto |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3088 |
moreover have "(\<Sum>v\<in>s. u v *\<^sub>R v + (t * w v) *\<^sub>R v) - (u a *\<^sub>R a + (t * w a) *\<^sub>R a) = y" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3089 |
unfolding setsum.distrib obt(6) scaleR_scaleR[symmetric] scaleR_right.setsum [symmetric] wv(4) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3090 |
using a(2) [THEN eq_neg_iff_add_eq_0 [THEN iffD2]] by simp |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3091 |
ultimately have "?P (n - 1)" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3092 |
apply (rule_tac x="(s - {a})" in exI) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3093 |
apply (rule_tac x="\<lambda>v. u v + t * w v" in exI) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3094 |
using obt(1-3) and t and a |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3095 |
apply (auto simp add: * scaleR_left_distrib) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3096 |
done |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3097 |
then show False |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3098 |
using smallest[THEN spec[where x="n - 1"]] by auto |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3099 |
qed |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3100 |
then show "\<exists>s u. finite s \<and> s \<subseteq> p \<and> card s \<le> aff_dim p + 1 \<and> |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3101 |
(\<forall>x\<in>s. 0 \<le> u x) \<and> setsum u s = 1 \<and> (\<Sum>v\<in>s. u v *\<^sub>R v) = y" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3102 |
using obt by auto |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3103 |
qed auto |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3104 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3105 |
lemma caratheodory_aff_dim: |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3106 |
fixes p :: "('a::euclidean_space) set" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3107 |
shows "convex hull p = {x. \<exists>s. finite s \<and> s \<subseteq> p \<and> card s \<le> aff_dim p + 1 \<and> x \<in> convex hull s}" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3108 |
(is "?lhs = ?rhs") |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3109 |
proof |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3110 |
show "?lhs \<subseteq> ?rhs" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3111 |
apply (subst convex_hull_caratheodory_aff_dim) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3112 |
apply clarify |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3113 |
apply (rule_tac x="s" in exI) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3114 |
apply (simp add: hull_subset convex_explicit [THEN iffD1, OF convex_convex_hull]) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3115 |
done |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3116 |
next |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3117 |
show "?rhs \<subseteq> ?lhs" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3118 |
using hull_mono by blast |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3119 |
qed |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3120 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3121 |
lemma convex_hull_caratheodory: |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3122 |
fixes p :: "('a::euclidean_space) set" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3123 |
shows "convex hull p = |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3124 |
{y. \<exists>s u. finite s \<and> s \<subseteq> p \<and> card s \<le> DIM('a) + 1 \<and> |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3125 |
(\<forall>x\<in>s. 0 \<le> u x) \<and> setsum u s = 1 \<and> setsum (\<lambda>v. u v *\<^sub>R v) s = y}" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3126 |
(is "?lhs = ?rhs") |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3127 |
proof (intro set_eqI iffI) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3128 |
fix x |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3129 |
assume "x \<in> ?lhs" then show "x \<in> ?rhs" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3130 |
apply (simp only: convex_hull_caratheodory_aff_dim Set.mem_Collect_eq) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3131 |
apply (erule ex_forward)+ |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3132 |
using aff_dim_subset_univ [of p] |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3133 |
apply simp |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3134 |
done |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3135 |
next |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3136 |
fix x |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3137 |
assume "x \<in> ?rhs" then show "x \<in> ?lhs" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3138 |
by (auto simp add: convex_hull_explicit) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3139 |
qed |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3140 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3141 |
theorem caratheodory: |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3142 |
"convex hull p = |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3143 |
{x::'a::euclidean_space. \<exists>s. finite s \<and> s \<subseteq> p \<and> |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3144 |
card s \<le> DIM('a) + 1 \<and> x \<in> convex hull s}" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3145 |
proof safe |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3146 |
fix x |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3147 |
assume "x \<in> convex hull p" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3148 |
then obtain s u where "finite s" "s \<subseteq> p" "card s \<le> DIM('a) + 1" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3149 |
"\<forall>x\<in>s. 0 \<le> u x" "setsum u s = 1" "(\<Sum>v\<in>s. u v *\<^sub>R v) = x" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3150 |
unfolding convex_hull_caratheodory by auto |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3151 |
then show "\<exists>s. finite s \<and> s \<subseteq> p \<and> card s \<le> DIM('a) + 1 \<and> x \<in> convex hull s" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3152 |
apply (rule_tac x=s in exI) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3153 |
using hull_subset[of s convex] |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3154 |
using convex_convex_hull[unfolded convex_explicit, of s, |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3155 |
THEN spec[where x=s], THEN spec[where x=u]] |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3156 |
apply auto |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3157 |
done |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3158 |
next |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3159 |
fix x s |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3160 |
assume "finite s" "s \<subseteq> p" "card s \<le> DIM('a) + 1" "x \<in> convex hull s" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3161 |
then show "x \<in> convex hull p" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3162 |
using hull_mono[OF \<open>s\<subseteq>p\<close>] by auto |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3163 |
qed |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3164 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
3165 |
|
60420 | 3166 |
subsection \<open>Relative interior of a set\<close> |
40377 | 3167 |
|
53347 | 3168 |
definition "rel_interior S = |
3169 |
{x. \<exists>T. openin (subtopology euclidean (affine hull S)) T \<and> x \<in> T \<and> T \<subseteq> S}" |
|
3170 |
||
3171 |
lemma rel_interior: |
|
3172 |
"rel_interior S = {x \<in> S. \<exists>T. open T \<and> x \<in> T \<and> T \<inter> affine hull S \<subseteq> S}" |
|
3173 |
unfolding rel_interior_def[of S] openin_open[of "affine hull S"] |
|
3174 |
apply auto |
|
3175 |
proof - |
|
3176 |
fix x T |
|
3177 |
assume *: "x \<in> S" "open T" "x \<in> T" "T \<inter> affine hull S \<subseteq> S" |
|
3178 |
then have **: "x \<in> T \<inter> affine hull S" |
|
3179 |
using hull_inc by auto |
|
54465 | 3180 |
show "\<exists>Tb. (\<exists>Ta. open Ta \<and> Tb = affine hull S \<inter> Ta) \<and> x \<in> Tb \<and> Tb \<subseteq> S" |
3181 |
apply (rule_tac x = "T \<inter> (affine hull S)" in exI) |
|
53347 | 3182 |
using * ** |
3183 |
apply auto |
|
3184 |
done |
|
3185 |
qed |
|
3186 |
||
3187 |
lemma mem_rel_interior: "x \<in> rel_interior S \<longleftrightarrow> (\<exists>T. open T \<and> x \<in> T \<inter> S \<and> T \<inter> affine hull S \<subseteq> S)" |
|
3188 |
by (auto simp add: rel_interior) |
|
3189 |
||
3190 |
lemma mem_rel_interior_ball: |
|
3191 |
"x \<in> rel_interior S \<longleftrightarrow> x \<in> S \<and> (\<exists>e. e > 0 \<and> ball x e \<inter> affine hull S \<subseteq> S)" |
|
40377 | 3192 |
apply (simp add: rel_interior, safe) |
3193 |
apply (force simp add: open_contains_ball) |
|
53347 | 3194 |
apply (rule_tac x = "ball x e" in exI) |
44457
d366fa5551ef
declare euclidean_simps [simp] at the point they are proved;
huffman
parents:
44365
diff
changeset
|
3195 |
apply simp |
40377 | 3196 |
done |
3197 |
||
49531 | 3198 |
lemma rel_interior_ball: |
53347 | 3199 |
"rel_interior S = {x \<in> S. \<exists>e. e > 0 \<and> ball x e \<inter> affine hull S \<subseteq> S}" |
3200 |
using mem_rel_interior_ball [of _ S] by auto |
|
3201 |
||
3202 |
lemma mem_rel_interior_cball: |
|
3203 |
"x \<in> rel_interior S \<longleftrightarrow> x \<in> S \<and> (\<exists>e. e > 0 \<and> cball x e \<inter> affine hull S \<subseteq> S)" |
|
49531 | 3204 |
apply (simp add: rel_interior, safe) |
40377 | 3205 |
apply (force simp add: open_contains_cball) |
53347 | 3206 |
apply (rule_tac x = "ball x e" in exI) |
44457
d366fa5551ef
declare euclidean_simps [simp] at the point they are proved;
huffman
parents:
44365
diff
changeset
|
3207 |
apply (simp add: subset_trans [OF ball_subset_cball]) |
40377 | 3208 |
apply auto |
3209 |
done |
|
3210 |
||
53347 | 3211 |
lemma rel_interior_cball: |
3212 |
"rel_interior S = {x \<in> S. \<exists>e. e > 0 \<and> cball x e \<inter> affine hull S \<subseteq> S}" |
|
3213 |
using mem_rel_interior_cball [of _ S] by auto |
|
40377 | 3214 |
|
60303 | 3215 |
lemma rel_interior_empty [simp]: "rel_interior {} = {}" |
49531 | 3216 |
by (auto simp add: rel_interior_def) |
40377 | 3217 |
|
60303 | 3218 |
lemma affine_hull_sing [simp]: "affine hull {a :: 'n::euclidean_space} = {a}" |
53347 | 3219 |
by (metis affine_hull_eq affine_sing) |
40377 | 3220 |
|
60303 | 3221 |
lemma rel_interior_sing [simp]: "rel_interior {a :: 'n::euclidean_space} = {a}" |
53347 | 3222 |
unfolding rel_interior_ball affine_hull_sing |
3223 |
apply auto |
|
3224 |
apply (rule_tac x = "1 :: real" in exI) |
|
3225 |
apply simp |
|
3226 |
done |
|
40377 | 3227 |
|
3228 |
lemma subset_rel_interior: |
|
53347 | 3229 |
fixes S T :: "'n::euclidean_space set" |
3230 |
assumes "S \<subseteq> T" |
|
3231 |
and "affine hull S = affine hull T" |
|
3232 |
shows "rel_interior S \<subseteq> rel_interior T" |
|
49531 | 3233 |
using assms by (auto simp add: rel_interior_def) |
3234 |
||
53347 | 3235 |
lemma rel_interior_subset: "rel_interior S \<subseteq> S" |
3236 |
by (auto simp add: rel_interior_def) |
|
3237 |
||
3238 |
lemma rel_interior_subset_closure: "rel_interior S \<subseteq> closure S" |
|
3239 |
using rel_interior_subset by (auto simp add: closure_def) |
|
3240 |
||
3241 |
lemma interior_subset_rel_interior: "interior S \<subseteq> rel_interior S" |
|
3242 |
by (auto simp add: rel_interior interior_def) |
|
40377 | 3243 |
|
3244 |
lemma interior_rel_interior: |
|
53347 | 3245 |
fixes S :: "'n::euclidean_space set" |
3246 |
assumes "aff_dim S = int(DIM('n))" |
|
3247 |
shows "rel_interior S = interior S" |
|
40377 | 3248 |
proof - |
53347 | 3249 |
have "affine hull S = UNIV" |
3250 |
using assms affine_hull_univ[of S] by auto |
|
3251 |
then show ?thesis |
|
3252 |
unfolding rel_interior interior_def by auto |
|
40377 | 3253 |
qed |
3254 |
||
60303 | 3255 |
lemma rel_interior_interior: |
3256 |
fixes S :: "'n::euclidean_space set" |
|
3257 |
assumes "affine hull S = UNIV" |
|
3258 |
shows "rel_interior S = interior S" |
|
3259 |
using assms unfolding rel_interior interior_def by auto |
|
3260 |
||
40377 | 3261 |
lemma rel_interior_open: |
53347 | 3262 |
fixes S :: "'n::euclidean_space set" |
3263 |
assumes "open S" |
|
3264 |
shows "rel_interior S = S" |
|
3265 |
by (metis assms interior_eq interior_subset_rel_interior rel_interior_subset set_eq_subset) |
|
40377 | 3266 |
|
60800
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
3267 |
lemma interior_ball [simp]: "interior (ball x e) = ball x e" |
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
3268 |
by (simp add: interior_open) |
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
3269 |
|
40377 | 3270 |
lemma interior_rel_interior_gen: |
53347 | 3271 |
fixes S :: "'n::euclidean_space set" |
3272 |
shows "interior S = (if aff_dim S = int(DIM('n)) then rel_interior S else {})" |
|
3273 |
by (metis interior_rel_interior low_dim_interior) |
|
40377 | 3274 |
|
49531 | 3275 |
lemma rel_interior_univ: |
53347 | 3276 |
fixes S :: "'n::euclidean_space set" |
3277 |
shows "rel_interior (affine hull S) = affine hull S" |
|
3278 |
proof - |
|
3279 |
have *: "rel_interior (affine hull S) \<subseteq> affine hull S" |
|
3280 |
using rel_interior_subset by auto |
|
3281 |
{ |
|
3282 |
fix x |
|
3283 |
assume x: "x \<in> affine hull S" |
|
3284 |
def e \<equiv> "1::real" |
|
3285 |
then have "e > 0" "ball x e \<inter> affine hull (affine hull S) \<subseteq> affine hull S" |
|
3286 |
using hull_hull[of _ S] by auto |
|
3287 |
then have "x \<in> rel_interior (affine hull S)" |
|
3288 |
using x rel_interior_ball[of "affine hull S"] by auto |
|
3289 |
} |
|
3290 |
then show ?thesis using * by auto |
|
40377 | 3291 |
qed |
3292 |
||
3293 |
lemma rel_interior_univ2: "rel_interior (UNIV :: ('n::euclidean_space) set) = UNIV" |
|
53347 | 3294 |
by (metis open_UNIV rel_interior_open) |
40377 | 3295 |
|
3296 |
lemma rel_interior_convex_shrink: |
|
53347 | 3297 |
fixes S :: "'a::euclidean_space set" |
3298 |
assumes "convex S" |
|
3299 |
and "c \<in> rel_interior S" |
|
3300 |
and "x \<in> S" |
|
3301 |
and "0 < e" |
|
3302 |
and "e \<le> 1" |
|
3303 |
shows "x - e *\<^sub>R (x - c) \<in> rel_interior S" |
|
3304 |
proof - |
|
54465 | 3305 |
obtain d where "d > 0" and d: "ball c d \<inter> affine hull S \<subseteq> S" |
53347 | 3306 |
using assms(2) unfolding mem_rel_interior_ball by auto |
3307 |
{ |
|
3308 |
fix y |
|
3309 |
assume as: "dist (x - e *\<^sub>R (x - c)) y < e * d" "y \<in> affine hull S" |
|
3310 |
have *: "y = (1 - (1 - e)) *\<^sub>R ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) + (1 - e) *\<^sub>R x" |
|
60420 | 3311 |
using \<open>e > 0\<close> by (auto simp add: scaleR_left_diff_distrib scaleR_right_diff_distrib) |
53347 | 3312 |
have "x \<in> affine hull S" |
3313 |
using assms hull_subset[of S] by auto |
|
49531 | 3314 |
moreover have "1 / e + - ((1 - e) / e) = 1" |
60420 | 3315 |
using \<open>e > 0\<close> left_diff_distrib[of "1" "(1-e)" "1/e"] by auto |
53347 | 3316 |
ultimately have **: "(1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x \<in> affine hull S" |
3317 |
using as affine_affine_hull[of S] mem_affine[of "affine hull S" y x "(1 / e)" "-((1 - e) / e)"] |
|
3318 |
by (simp add: algebra_simps) |
|
40377 | 3319 |
have "dist c ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) = abs(1/e) * norm (e *\<^sub>R c - y + (1 - e) *\<^sub>R x)" |
53347 | 3320 |
unfolding dist_norm norm_scaleR[symmetric] |
3321 |
apply (rule arg_cong[where f=norm]) |
|
60420 | 3322 |
using \<open>e > 0\<close> |
53347 | 3323 |
apply (auto simp add: euclidean_eq_iff[where 'a='a] field_simps inner_simps) |
3324 |
done |
|
3325 |
also have "\<dots> = abs (1/e) * norm (x - e *\<^sub>R (x - c) - y)" |
|
3326 |
by (auto intro!:arg_cong[where f=norm] simp add: algebra_simps) |
|
3327 |
also have "\<dots> < d" |
|
60420 | 3328 |
using as[unfolded dist_norm] and \<open>e > 0\<close> |
3329 |
by (auto simp add:pos_divide_less_eq[OF \<open>e > 0\<close>] mult.commute) |
|
53347 | 3330 |
finally have "y \<in> S" |
3331 |
apply (subst *) |
|
3332 |
apply (rule assms(1)[unfolded convex_alt,rule_format]) |
|
3333 |
apply (rule d[unfolded subset_eq,rule_format]) |
|
3334 |
unfolding mem_ball |
|
3335 |
using assms(3-5) ** |
|
3336 |
apply auto |
|
3337 |
done |
|
3338 |
} |
|
3339 |
then have "ball (x - e *\<^sub>R (x - c)) (e*d) \<inter> affine hull S \<subseteq> S" |
|
3340 |
by auto |
|
3341 |
moreover have "e * d > 0" |
|
60420 | 3342 |
using \<open>e > 0\<close> \<open>d > 0\<close> by simp |
53347 | 3343 |
moreover have c: "c \<in> S" |
3344 |
using assms rel_interior_subset by auto |
|
3345 |
moreover from c have "x - e *\<^sub>R (x - c) \<in> S" |
|
61426
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61222
diff
changeset
|
3346 |
using convexD_alt[of S x c e] |
53347 | 3347 |
apply (simp add: algebra_simps) |
3348 |
using assms |
|
3349 |
apply auto |
|
3350 |
done |
|
3351 |
ultimately show ?thesis |
|
60420 | 3352 |
using mem_rel_interior_ball[of "x - e *\<^sub>R (x - c)" S] \<open>e > 0\<close> by auto |
40377 | 3353 |
qed |
3354 |
||
3355 |
lemma interior_real_semiline: |
|
53347 | 3356 |
fixes a :: real |
3357 |
shows "interior {a..} = {a<..}" |
|
3358 |
proof - |
|
3359 |
{ |
|
3360 |
fix y |
|
3361 |
assume "a < y" |
|
3362 |
then have "y \<in> interior {a..}" |
|
3363 |
apply (simp add: mem_interior) |
|
3364 |
apply (rule_tac x="(y-a)" in exI) |
|
3365 |
apply (auto simp add: dist_norm) |
|
3366 |
done |
|
3367 |
} |
|
3368 |
moreover |
|
3369 |
{ |
|
3370 |
fix y |
|
3371 |
assume "y \<in> interior {a..}" |
|
3372 |
then obtain e where e: "e > 0" "cball y e \<subseteq> {a..}" |
|
3373 |
using mem_interior_cball[of y "{a..}"] by auto |
|
3374 |
moreover from e have "y - e \<in> cball y e" |
|
3375 |
by (auto simp add: cball_def dist_norm) |
|
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
3376 |
ultimately have "a \<le> y - e" by blast |
53347 | 3377 |
then have "a < y" using e by auto |
3378 |
} |
|
3379 |
ultimately show ?thesis by auto |
|
40377 | 3380 |
qed |
3381 |
||
56188 | 3382 |
lemma rel_interior_real_box: |
53347 | 3383 |
fixes a b :: real |
3384 |
assumes "a < b" |
|
56188 | 3385 |
shows "rel_interior {a .. b} = {a <..< b}" |
53347 | 3386 |
proof - |
54775
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
immler
parents:
54465
diff
changeset
|
3387 |
have "box a b \<noteq> {}" |
53347 | 3388 |
using assms |
3389 |
unfolding set_eq_iff |
|
56189
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
3390 |
by (auto intro!: exI[of _ "(a + b) / 2"] simp: box_def) |
40377 | 3391 |
then show ?thesis |
56188 | 3392 |
using interior_rel_interior_gen[of "cbox a b", symmetric] |
3393 |
by (simp split: split_if_asm del: box_real add: box_real[symmetric] interior_cbox) |
|
40377 | 3394 |
qed |
3395 |
||
3396 |
lemma rel_interior_real_semiline: |
|
53347 | 3397 |
fixes a :: real |
3398 |
shows "rel_interior {a..} = {a<..}" |
|
3399 |
proof - |
|
3400 |
have *: "{a<..} \<noteq> {}" |
|
3401 |
unfolding set_eq_iff by (auto intro!: exI[of _ "a + 1"]) |
|
3402 |
then show ?thesis using interior_real_semiline interior_rel_interior_gen[of "{a..}"] |
|
3403 |
by (auto split: split_if_asm) |
|
40377 | 3404 |
qed |
3405 |
||
60420 | 3406 |
subsubsection \<open>Relative open sets\<close> |
40377 | 3407 |
|
53347 | 3408 |
definition "rel_open S \<longleftrightarrow> rel_interior S = S" |
3409 |
||
3410 |
lemma rel_open: "rel_open S \<longleftrightarrow> openin (subtopology euclidean (affine hull S)) S" |
|
3411 |
unfolding rel_open_def rel_interior_def |
|
3412 |
apply auto |
|
3413 |
using openin_subopen[of "subtopology euclidean (affine hull S)" S] |
|
3414 |
apply auto |
|
3415 |
done |
|
3416 |
||
3417 |
lemma opein_rel_interior: "openin (subtopology euclidean (affine hull S)) (rel_interior S)" |
|
40377 | 3418 |
apply (simp add: rel_interior_def) |
53347 | 3419 |
apply (subst openin_subopen) |
3420 |
apply blast |
|
3421 |
done |
|
40377 | 3422 |
|
49531 | 3423 |
lemma affine_rel_open: |
53347 | 3424 |
fixes S :: "'n::euclidean_space set" |
3425 |
assumes "affine S" |
|
3426 |
shows "rel_open S" |
|
3427 |
unfolding rel_open_def |
|
3428 |
using assms rel_interior_univ[of S] affine_hull_eq[of S] |
|
3429 |
by metis |
|
40377 | 3430 |
|
49531 | 3431 |
lemma affine_closed: |
53347 | 3432 |
fixes S :: "'n::euclidean_space set" |
3433 |
assumes "affine S" |
|
3434 |
shows "closed S" |
|
3435 |
proof - |
|
3436 |
{ |
|
3437 |
assume "S \<noteq> {}" |
|
3438 |
then obtain L where L: "subspace L" "affine_parallel S L" |
|
3439 |
using assms affine_parallel_subspace[of S] by auto |
|
3440 |
then obtain a where a: "S = (op + a ` L)" |
|
3441 |
using affine_parallel_def[of L S] affine_parallel_commut by auto |
|
3442 |
from L have "closed L" using closed_subspace by auto |
|
3443 |
then have "closed S" |
|
3444 |
using closed_translation a by auto |
|
3445 |
} |
|
3446 |
then show ?thesis by auto |
|
40377 | 3447 |
qed |
3448 |
||
3449 |
lemma closure_affine_hull: |
|
53347 | 3450 |
fixes S :: "'n::euclidean_space set" |
3451 |
shows "closure S \<subseteq> affine hull S" |
|
44524 | 3452 |
by (intro closure_minimal hull_subset affine_closed affine_affine_hull) |
40377 | 3453 |
|
3454 |
lemma closure_same_affine_hull: |
|
53347 | 3455 |
fixes S :: "'n::euclidean_space set" |
40377 | 3456 |
shows "affine hull (closure S) = affine hull S" |
53347 | 3457 |
proof - |
3458 |
have "affine hull (closure S) \<subseteq> affine hull S" |
|
3459 |
using hull_mono[of "closure S" "affine hull S" "affine"] |
|
3460 |
closure_affine_hull[of S] hull_hull[of "affine" S] |
|
3461 |
by auto |
|
3462 |
moreover have "affine hull (closure S) \<supseteq> affine hull S" |
|
3463 |
using hull_mono[of "S" "closure S" "affine"] closure_subset by auto |
|
3464 |
ultimately show ?thesis by auto |
|
49531 | 3465 |
qed |
3466 |
||
3467 |
lemma closure_aff_dim: |
|
53347 | 3468 |
fixes S :: "'n::euclidean_space set" |
40377 | 3469 |
shows "aff_dim (closure S) = aff_dim S" |
53347 | 3470 |
proof - |
3471 |
have "aff_dim S \<le> aff_dim (closure S)" |
|
3472 |
using aff_dim_subset closure_subset by auto |
|
3473 |
moreover have "aff_dim (closure S) \<le> aff_dim (affine hull S)" |
|
3474 |
using aff_dim_subset closure_affine_hull by auto |
|
3475 |
moreover have "aff_dim (affine hull S) = aff_dim S" |
|
3476 |
using aff_dim_affine_hull by auto |
|
3477 |
ultimately show ?thesis by auto |
|
40377 | 3478 |
qed |
3479 |
||
3480 |
lemma rel_interior_closure_convex_shrink: |
|
53347 | 3481 |
fixes S :: "_::euclidean_space set" |
3482 |
assumes "convex S" |
|
3483 |
and "c \<in> rel_interior S" |
|
3484 |
and "x \<in> closure S" |
|
3485 |
and "e > 0" |
|
3486 |
and "e \<le> 1" |
|
3487 |
shows "x - e *\<^sub>R (x - c) \<in> rel_interior S" |
|
3488 |
proof - |
|
3489 |
obtain d where "d > 0" and d: "ball c d \<inter> affine hull S \<subseteq> S" |
|
3490 |
using assms(2) unfolding mem_rel_interior_ball by auto |
|
3491 |
have "\<exists>y \<in> S. norm (y - x) * (1 - e) < e * d" |
|
3492 |
proof (cases "x \<in> S") |
|
3493 |
case True |
|
60420 | 3494 |
then show ?thesis using \<open>e > 0\<close> \<open>d > 0\<close> |
53347 | 3495 |
apply (rule_tac bexI[where x=x]) |
56544 | 3496 |
apply (auto) |
53347 | 3497 |
done |
3498 |
next |
|
3499 |
case False |
|
3500 |
then have x: "x islimpt S" |
|
3501 |
using assms(3)[unfolded closure_def] by auto |
|
3502 |
show ?thesis |
|
3503 |
proof (cases "e = 1") |
|
3504 |
case True |
|
3505 |
obtain y where "y \<in> S" "y \<noteq> x" "dist y x < 1" |
|
40377 | 3506 |
using x[unfolded islimpt_approachable,THEN spec[where x=1]] by auto |
53347 | 3507 |
then show ?thesis |
3508 |
apply (rule_tac x=y in bexI) |
|
3509 |
unfolding True |
|
60420 | 3510 |
using \<open>d > 0\<close> |
53347 | 3511 |
apply auto |
3512 |
done |
|
3513 |
next |
|
3514 |
case False |
|
3515 |
then have "0 < e * d / (1 - e)" and *: "1 - e > 0" |
|
60420 | 3516 |
using \<open>e \<le> 1\<close> \<open>e > 0\<close> \<open>d > 0\<close> by (auto) |
53347 | 3517 |
then obtain y where "y \<in> S" "y \<noteq> x" "dist y x < e * d / (1 - e)" |
40377 | 3518 |
using x[unfolded islimpt_approachable,THEN spec[where x="e*d / (1 - e)"]] by auto |
53347 | 3519 |
then show ?thesis |
3520 |
apply (rule_tac x=y in bexI) |
|
3521 |
unfolding dist_norm |
|
3522 |
using pos_less_divide_eq[OF *] |
|
3523 |
apply auto |
|
3524 |
done |
|
3525 |
qed |
|
3526 |
qed |
|
3527 |
then obtain y where "y \<in> S" and y: "norm (y - x) * (1 - e) < e * d" |
|
3528 |
by auto |
|
3529 |
def z \<equiv> "c + ((1 - e) / e) *\<^sub>R (x - y)" |
|
3530 |
have *: "x - e *\<^sub>R (x - c) = y - e *\<^sub>R (y - z)" |
|
60420 | 3531 |
unfolding z_def using \<open>e > 0\<close> |
53347 | 3532 |
by (auto simp add: scaleR_right_diff_distrib scaleR_right_distrib scaleR_left_diff_distrib) |
3533 |
have zball: "z \<in> ball c d" |
|
3534 |
using mem_ball z_def dist_norm[of c] |
|
3535 |
using y and assms(4,5) |
|
3536 |
by (auto simp add:field_simps norm_minus_commute) |
|
3537 |
have "x \<in> affine hull S" |
|
3538 |
using closure_affine_hull assms by auto |
|
3539 |
moreover have "y \<in> affine hull S" |
|
60420 | 3540 |
using \<open>y \<in> S\<close> hull_subset[of S] by auto |
53347 | 3541 |
moreover have "c \<in> affine hull S" |
3542 |
using assms rel_interior_subset hull_subset[of S] by auto |
|
3543 |
ultimately have "z \<in> affine hull S" |
|
49531 | 3544 |
using z_def affine_affine_hull[of S] |
53347 | 3545 |
mem_affine_3_minus [of "affine hull S" c x y "(1 - e) / e"] |
3546 |
assms |
|
3547 |
by (auto simp add: field_simps) |
|
3548 |
then have "z \<in> S" using d zball by auto |
|
3549 |
obtain d1 where "d1 > 0" and d1: "ball z d1 \<le> ball c d" |
|
40377 | 3550 |
using zball open_ball[of c d] openE[of "ball c d" z] by auto |
53347 | 3551 |
then have "ball z d1 \<inter> affine hull S \<subseteq> ball c d \<inter> affine hull S" |
3552 |
by auto |
|
3553 |
then have "ball z d1 \<inter> affine hull S \<subseteq> S" |
|
3554 |
using d by auto |
|
3555 |
then have "z \<in> rel_interior S" |
|
60420 | 3556 |
using mem_rel_interior_ball using \<open>d1 > 0\<close> \<open>z \<in> S\<close> by auto |
53347 | 3557 |
then have "y - e *\<^sub>R (y - z) \<in> rel_interior S" |
60420 | 3558 |
using rel_interior_convex_shrink[of S z y e] assms \<open>y \<in> S\<close> by auto |
53347 | 3559 |
then show ?thesis using * by auto |
3560 |
qed |
|
3561 |
||
40377 | 3562 |
|
60420 | 3563 |
subsubsection\<open>Relative interior preserves under linear transformations\<close> |
40377 | 3564 |
|
3565 |
lemma rel_interior_translation_aux: |
|
53347 | 3566 |
fixes a :: "'n::euclidean_space" |
3567 |
shows "((\<lambda>x. a + x) ` rel_interior S) \<subseteq> rel_interior ((\<lambda>x. a + x) ` S)" |
|
3568 |
proof - |
|
3569 |
{ |
|
3570 |
fix x |
|
3571 |
assume x: "x \<in> rel_interior S" |
|
3572 |
then obtain T where "open T" "x \<in> T \<inter> S" "T \<inter> affine hull S \<subseteq> S" |
|
3573 |
using mem_rel_interior[of x S] by auto |
|
3574 |
then have "open ((\<lambda>x. a + x) ` T)" |
|
3575 |
and "a + x \<in> ((\<lambda>x. a + x) ` T) \<inter> ((\<lambda>x. a + x) ` S)" |
|
3576 |
and "((\<lambda>x. a + x) ` T) \<inter> affine hull ((\<lambda>x. a + x) ` S) \<subseteq> (\<lambda>x. a + x) ` S" |
|
3577 |
using affine_hull_translation[of a S] open_translation[of T a] x by auto |
|
3578 |
then have "a + x \<in> rel_interior ((\<lambda>x. a + x) ` S)" |
|
3579 |
using mem_rel_interior[of "a+x" "((\<lambda>x. a + x) ` S)"] by auto |
|
3580 |
} |
|
3581 |
then show ?thesis by auto |
|
60809
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
3582 |
qed |
40377 | 3583 |
|
3584 |
lemma rel_interior_translation: |
|
53347 | 3585 |
fixes a :: "'n::euclidean_space" |
3586 |
shows "rel_interior ((\<lambda>x. a + x) ` S) = (\<lambda>x. a + x) ` rel_interior S" |
|
3587 |
proof - |
|
3588 |
have "(\<lambda>x. (-a) + x) ` rel_interior ((\<lambda>x. a + x) ` S) \<subseteq> rel_interior S" |
|
3589 |
using rel_interior_translation_aux[of "-a" "(\<lambda>x. a + x) ` S"] |
|
3590 |
translation_assoc[of "-a" "a"] |
|
3591 |
by auto |
|
3592 |
then have "((\<lambda>x. a + x) ` rel_interior S) \<supseteq> rel_interior ((\<lambda>x. a + x) ` S)" |
|
3593 |
using translation_inverse_subset[of a "rel_interior (op + a ` S)" "rel_interior S"] |
|
3594 |
by auto |
|
3595 |
then show ?thesis |
|
3596 |
using rel_interior_translation_aux[of a S] by auto |
|
40377 | 3597 |
qed |
3598 |
||
3599 |
||
3600 |
lemma affine_hull_linear_image: |
|
53347 | 3601 |
assumes "bounded_linear f" |
3602 |
shows "f ` (affine hull s) = affine hull f ` s" |
|
3603 |
apply rule |
|
3604 |
unfolding subset_eq ball_simps |
|
3605 |
apply (rule_tac[!] hull_induct, rule hull_inc) |
|
3606 |
prefer 3 |
|
3607 |
apply (erule imageE) |
|
3608 |
apply (rule_tac x=xa in image_eqI) |
|
3609 |
apply assumption |
|
3610 |
apply (rule hull_subset[unfolded subset_eq, rule_format]) |
|
3611 |
apply assumption |
|
3612 |
proof - |
|
40377 | 3613 |
interpret f: bounded_linear f by fact |
53347 | 3614 |
show "affine {x. f x \<in> affine hull f ` s}" |
3615 |
unfolding affine_def |
|
3616 |
by (auto simp add: f.scaleR f.add affine_affine_hull[unfolded affine_def, rule_format]) |
|
3617 |
show "affine {x. x \<in> f ` (affine hull s)}" |
|
3618 |
using affine_affine_hull[unfolded affine_def, of s] |
|
40377 | 3619 |
unfolding affine_def by (auto simp add: f.scaleR [symmetric] f.add [symmetric]) |
3620 |
qed auto |
|
3621 |
||
3622 |
||
3623 |
lemma rel_interior_injective_on_span_linear_image: |
|
53347 | 3624 |
fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space" |
3625 |
and S :: "'m::euclidean_space set" |
|
3626 |
assumes "bounded_linear f" |
|
3627 |
and "inj_on f (span S)" |
|
3628 |
shows "rel_interior (f ` S) = f ` (rel_interior S)" |
|
3629 |
proof - |
|
3630 |
{ |
|
3631 |
fix z |
|
3632 |
assume z: "z \<in> rel_interior (f ` S)" |
|
3633 |
then have "z \<in> f ` S" |
|
3634 |
using rel_interior_subset[of "f ` S"] by auto |
|
3635 |
then obtain x where x: "x \<in> S" "f x = z" by auto |
|
3636 |
obtain e2 where e2: "e2 > 0" "cball z e2 \<inter> affine hull (f ` S) \<subseteq> (f ` S)" |
|
3637 |
using z rel_interior_cball[of "f ` S"] by auto |
|
3638 |
obtain K where K: "K > 0" "\<And>x. norm (f x) \<le> norm x * K" |
|
3639 |
using assms Real_Vector_Spaces.bounded_linear.pos_bounded[of f] by auto |
|
3640 |
def e1 \<equiv> "1 / K" |
|
3641 |
then have e1: "e1 > 0" "\<And>x. e1 * norm (f x) \<le> norm x" |
|
3642 |
using K pos_le_divide_eq[of e1] by auto |
|
3643 |
def e \<equiv> "e1 * e2" |
|
56544 | 3644 |
then have "e > 0" using e1 e2 by auto |
53347 | 3645 |
{ |
3646 |
fix y |
|
3647 |
assume y: "y \<in> cball x e \<inter> affine hull S" |
|
3648 |
then have h1: "f y \<in> affine hull (f ` S)" |
|
3649 |
using affine_hull_linear_image[of f S] assms by auto |
|
3650 |
from y have "norm (x-y) \<le> e1 * e2" |
|
3651 |
using cball_def[of x e] dist_norm[of x y] e_def by auto |
|
3652 |
moreover have "f x - f y = f (x - y)" |
|
3653 |
using assms linear_sub[of f x y] linear_conv_bounded_linear[of f] by auto |
|
3654 |
moreover have "e1 * norm (f (x-y)) \<le> norm (x - y)" |
|
3655 |
using e1 by auto |
|
3656 |
ultimately have "e1 * norm ((f x)-(f y)) \<le> e1 * e2" |
|
3657 |
by auto |
|
3658 |
then have "f y \<in> cball z e2" |
|
3659 |
using cball_def[of "f x" e2] dist_norm[of "f x" "f y"] e1 x by auto |
|
3660 |
then have "f y \<in> f ` S" |
|
3661 |
using y e2 h1 by auto |
|
3662 |
then have "y \<in> S" |
|
3663 |
using assms y hull_subset[of S] affine_hull_subset_span |
|
61520
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
3664 |
inj_on_image_mem_iff [OF \<open>inj_on f (span S)\<close>] |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
3665 |
by (metis Int_iff span_inc subsetCE) |
53347 | 3666 |
} |
3667 |
then have "z \<in> f ` (rel_interior S)" |
|
60420 | 3668 |
using mem_rel_interior_cball[of x S] \<open>e > 0\<close> x by auto |
49531 | 3669 |
} |
53347 | 3670 |
moreover |
3671 |
{ |
|
3672 |
fix x |
|
3673 |
assume x: "x \<in> rel_interior S" |
|
54465 | 3674 |
then obtain e2 where e2: "e2 > 0" "cball x e2 \<inter> affine hull S \<subseteq> S" |
53347 | 3675 |
using rel_interior_cball[of S] by auto |
3676 |
have "x \<in> S" using x rel_interior_subset by auto |
|
3677 |
then have *: "f x \<in> f ` S" by auto |
|
3678 |
have "\<forall>x\<in>span S. f x = 0 \<longrightarrow> x = 0" |
|
3679 |
using assms subspace_span linear_conv_bounded_linear[of f] |
|
3680 |
linear_injective_on_subspace_0[of f "span S"] |
|
3681 |
by auto |
|
3682 |
then obtain e1 where e1: "e1 > 0" "\<forall>x \<in> span S. e1 * norm x \<le> norm (f x)" |
|
3683 |
using assms injective_imp_isometric[of "span S" f] |
|
3684 |
subspace_span[of S] closed_subspace[of "span S"] |
|
3685 |
by auto |
|
3686 |
def e \<equiv> "e1 * e2" |
|
56544 | 3687 |
hence "e > 0" using e1 e2 by auto |
53347 | 3688 |
{ |
3689 |
fix y |
|
3690 |
assume y: "y \<in> cball (f x) e \<inter> affine hull (f ` S)" |
|
3691 |
then have "y \<in> f ` (affine hull S)" |
|
3692 |
using affine_hull_linear_image[of f S] assms by auto |
|
3693 |
then obtain xy where xy: "xy \<in> affine hull S" "f xy = y" by auto |
|
3694 |
with y have "norm (f x - f xy) \<le> e1 * e2" |
|
3695 |
using cball_def[of "f x" e] dist_norm[of "f x" y] e_def by auto |
|
3696 |
moreover have "f x - f xy = f (x - xy)" |
|
3697 |
using assms linear_sub[of f x xy] linear_conv_bounded_linear[of f] by auto |
|
3698 |
moreover have *: "x - xy \<in> span S" |
|
60420 | 3699 |
using subspace_sub[of "span S" x xy] subspace_span \<open>x \<in> S\<close> xy |
53347 | 3700 |
affine_hull_subset_span[of S] span_inc |
3701 |
by auto |
|
3702 |
moreover from * have "e1 * norm (x - xy) \<le> norm (f (x - xy))" |
|
3703 |
using e1 by auto |
|
3704 |
ultimately have "e1 * norm (x - xy) \<le> e1 * e2" |
|
3705 |
by auto |
|
3706 |
then have "xy \<in> cball x e2" |
|
3707 |
using cball_def[of x e2] dist_norm[of x xy] e1 by auto |
|
3708 |
then have "y \<in> f ` S" |
|
3709 |
using xy e2 by auto |
|
3710 |
} |
|
3711 |
then have "f x \<in> rel_interior (f ` S)" |
|
60420 | 3712 |
using mem_rel_interior_cball[of "(f x)" "(f ` S)"] * \<open>e > 0\<close> by auto |
49531 | 3713 |
} |
53347 | 3714 |
ultimately show ?thesis by auto |
40377 | 3715 |
qed |
3716 |
||
3717 |
lemma rel_interior_injective_linear_image: |
|
53347 | 3718 |
fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space" |
3719 |
assumes "bounded_linear f" |
|
3720 |
and "inj f" |
|
3721 |
shows "rel_interior (f ` S) = f ` (rel_interior S)" |
|
3722 |
using assms rel_interior_injective_on_span_linear_image[of f S] |
|
3723 |
subset_inj_on[of f "UNIV" "span S"] |
|
3724 |
by auto |
|
3725 |
||
40377 | 3726 |
|
60420 | 3727 |
subsection\<open>Some Properties of subset of standard basis\<close> |
40377 | 3728 |
|
53347 | 3729 |
lemma affine_hull_substd_basis: |
3730 |
assumes "d \<subseteq> Basis" |
|
3731 |
shows "affine hull (insert 0 d) = {x::'a::euclidean_space. \<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x\<bullet>i = 0}" |
|
3732 |
(is "affine hull (insert 0 ?A) = ?B") |
|
3733 |
proof - |
|
61076 | 3734 |
have *: "\<And>A. op + (0::'a) ` A = A" "\<And>A. op + (- (0::'a)) ` A = A" |
53347 | 3735 |
by auto |
3736 |
show ?thesis |
|
3737 |
unfolding affine_hull_insert_span_gen span_substd_basis[OF assms,symmetric] * .. |
|
40377 | 3738 |
qed |
3739 |
||
60303 | 3740 |
lemma affine_hull_convex_hull [simp]: "affine hull (convex hull S) = affine hull S" |
53347 | 3741 |
by (metis Int_absorb1 Int_absorb2 convex_hull_subset_affine_hull hull_hull hull_mono hull_subset) |
3742 |
||
40377 | 3743 |
|
60420 | 3744 |
subsection \<open>Openness and compactness are preserved by convex hull operation.\<close> |
33175 | 3745 |
|
34964 | 3746 |
lemma open_convex_hull[intro]: |
33175 | 3747 |
fixes s :: "'a::real_normed_vector set" |
3748 |
assumes "open s" |
|
53347 | 3749 |
shows "open (convex hull s)" |
3750 |
unfolding open_contains_cball convex_hull_explicit |
|
3751 |
unfolding mem_Collect_eq ball_simps(8) |
|
3752 |
proof (rule, rule) |
|
3753 |
fix a |
|
33175 | 3754 |
assume "\<exists>sa u. finite sa \<and> sa \<subseteq> s \<and> (\<forall>x\<in>sa. 0 \<le> u x) \<and> setsum u sa = 1 \<and> (\<Sum>v\<in>sa. u v *\<^sub>R v) = a" |
53347 | 3755 |
then obtain t u where obt: "finite t" "t\<subseteq>s" "\<forall>x\<in>t. 0 \<le> u x" "setsum u t = 1" "(\<Sum>v\<in>t. u v *\<^sub>R v) = a" |
3756 |
by auto |
|
3757 |
||
3758 |
from assms[unfolded open_contains_cball] obtain b |
|
3759 |
where b: "\<forall>x\<in>s. 0 < b x \<and> cball x (b x) \<subseteq> s" |
|
3760 |
using bchoice[of s "\<lambda>x e. e > 0 \<and> cball x e \<subseteq> s"] by auto |
|
3761 |
have "b ` t \<noteq> {}" |
|
56889
48a745e1bde7
avoid the Complex constructor, use the more natural Re/Im view; moved csqrt to Complex.
hoelzl
parents:
56571
diff
changeset
|
3762 |
using obt by auto |
53347 | 3763 |
def i \<equiv> "b ` t" |
3764 |
||
3765 |
show "\<exists>e > 0. |
|
3766 |
cball a e \<subseteq> {y. \<exists>sa u. finite sa \<and> sa \<subseteq> s \<and> (\<forall>x\<in>sa. 0 \<le> u x) \<and> setsum u sa = 1 \<and> (\<Sum>v\<in>sa. u v *\<^sub>R v) = y}" |
|
3767 |
apply (rule_tac x = "Min i" in exI) |
|
3768 |
unfolding subset_eq |
|
3769 |
apply rule |
|
3770 |
defer |
|
3771 |
apply rule |
|
3772 |
unfolding mem_Collect_eq |
|
3773 |
proof - |
|
3774 |
show "0 < Min i" |
|
60420 | 3775 |
unfolding i_def and Min_gr_iff[OF finite_imageI[OF obt(1)] \<open>b ` t\<noteq>{}\<close>] |
53347 | 3776 |
using b |
3777 |
apply simp |
|
3778 |
apply rule |
|
3779 |
apply (erule_tac x=x in ballE) |
|
60420 | 3780 |
using \<open>t\<subseteq>s\<close> |
53347 | 3781 |
apply auto |
3782 |
done |
|
3783 |
next |
|
3784 |
fix y |
|
3785 |
assume "y \<in> cball a (Min i)" |
|
3786 |
then have y: "norm (a - y) \<le> Min i" |
|
3787 |
unfolding dist_norm[symmetric] by auto |
|
3788 |
{ |
|
3789 |
fix x |
|
3790 |
assume "x \<in> t" |
|
3791 |
then have "Min i \<le> b x" |
|
3792 |
unfolding i_def |
|
3793 |
apply (rule_tac Min_le) |
|
3794 |
using obt(1) |
|
3795 |
apply auto |
|
3796 |
done |
|
3797 |
then have "x + (y - a) \<in> cball x (b x)" |
|
3798 |
using y unfolding mem_cball dist_norm by auto |
|
60420 | 3799 |
moreover from \<open>x\<in>t\<close> have "x \<in> s" |
53347 | 3800 |
using obt(2) by auto |
3801 |
ultimately have "x + (y - a) \<in> s" |
|
54465 | 3802 |
using y and b[THEN bspec[where x=x]] unfolding subset_eq by fast |
53347 | 3803 |
} |
33175 | 3804 |
moreover |
53347 | 3805 |
have *: "inj_on (\<lambda>v. v + (y - a)) t" |
3806 |
unfolding inj_on_def by auto |
|
33175 | 3807 |
have "(\<Sum>v\<in>(\<lambda>v. v + (y - a)) ` t. u (v - (y - a))) = 1" |
57418 | 3808 |
unfolding setsum.reindex[OF *] o_def using obt(4) by auto |
33175 | 3809 |
moreover have "(\<Sum>v\<in>(\<lambda>v. v + (y - a)) ` t. u (v - (y - a)) *\<^sub>R v) = y" |
57418 | 3810 |
unfolding setsum.reindex[OF *] o_def using obt(4,5) |
3811 |
by (simp add: setsum.distrib setsum_subtractf scaleR_left.setsum[symmetric] scaleR_right_distrib) |
|
53347 | 3812 |
ultimately |
3813 |
show "\<exists>sa u. finite sa \<and> (\<forall>x\<in>sa. x \<in> s) \<and> (\<forall>x\<in>sa. 0 \<le> u x) \<and> setsum u sa = 1 \<and> (\<Sum>v\<in>sa. u v *\<^sub>R v) = y" |
|
3814 |
apply (rule_tac x="(\<lambda>v. v + (y - a)) ` t" in exI) |
|
3815 |
apply (rule_tac x="\<lambda>v. u (v - (y - a))" in exI) |
|
3816 |
using obt(1, 3) |
|
3817 |
apply auto |
|
3818 |
done |
|
33175 | 3819 |
qed |
3820 |
qed |
|
3821 |
||
3822 |
lemma compact_convex_combinations: |
|
3823 |
fixes s t :: "'a::real_normed_vector set" |
|
3824 |
assumes "compact s" "compact t" |
|
3825 |
shows "compact { (1 - u) *\<^sub>R x + u *\<^sub>R y | x y u. 0 \<le> u \<and> u \<le> 1 \<and> x \<in> s \<and> y \<in> t}" |
|
53347 | 3826 |
proof - |
33175 | 3827 |
let ?X = "{0..1} \<times> s \<times> t" |
3828 |
let ?h = "(\<lambda>z. (1 - fst z) *\<^sub>R fst (snd z) + fst z *\<^sub>R snd (snd z))" |
|
53347 | 3829 |
have *: "{ (1 - u) *\<^sub>R x + u *\<^sub>R y | x y u. 0 \<le> u \<and> u \<le> 1 \<and> x \<in> s \<and> y \<in> t} = ?h ` ?X" |
3830 |
apply (rule set_eqI) |
|
3831 |
unfolding image_iff mem_Collect_eq |
|
3832 |
apply rule |
|
3833 |
apply auto |
|
3834 |
apply (rule_tac x=u in rev_bexI) |
|
3835 |
apply simp |
|
3836 |
apply (erule rev_bexI) |
|
3837 |
apply (erule rev_bexI) |
|
3838 |
apply simp |
|
3839 |
apply auto |
|
3840 |
done |
|
56188 | 3841 |
have "continuous_on ?X (\<lambda>z. (1 - fst z) *\<^sub>R fst (snd z) + fst z *\<^sub>R snd (snd z))" |
33175 | 3842 |
unfolding continuous_on by (rule ballI) (intro tendsto_intros) |
53347 | 3843 |
then show ?thesis |
3844 |
unfolding * |
|
33175 | 3845 |
apply (rule compact_continuous_image) |
56188 | 3846 |
apply (intro compact_Times compact_Icc assms) |
33175 | 3847 |
done |
3848 |
qed |
|
3849 |
||
44525
fbb777aec0d4
generalize lemma finite_imp_compact_convex_hull and related lemmas
huffman
parents:
44524
diff
changeset
|
3850 |
lemma finite_imp_compact_convex_hull: |
53347 | 3851 |
fixes s :: "'a::real_normed_vector set" |
3852 |
assumes "finite s" |
|
3853 |
shows "compact (convex hull s)" |
|
44525
fbb777aec0d4
generalize lemma finite_imp_compact_convex_hull and related lemmas
huffman
parents:
44524
diff
changeset
|
3854 |
proof (cases "s = {}") |
53347 | 3855 |
case True |
3856 |
then show ?thesis by simp |
|
44525
fbb777aec0d4
generalize lemma finite_imp_compact_convex_hull and related lemmas
huffman
parents:
44524
diff
changeset
|
3857 |
next |
53347 | 3858 |
case False |
3859 |
with assms show ?thesis |
|
44525
fbb777aec0d4
generalize lemma finite_imp_compact_convex_hull and related lemmas
huffman
parents:
44524
diff
changeset
|
3860 |
proof (induct rule: finite_ne_induct) |
53347 | 3861 |
case (singleton x) |
3862 |
show ?case by simp |
|
44525
fbb777aec0d4
generalize lemma finite_imp_compact_convex_hull and related lemmas
huffman
parents:
44524
diff
changeset
|
3863 |
next |
fbb777aec0d4
generalize lemma finite_imp_compact_convex_hull and related lemmas
huffman
parents:
44524
diff
changeset
|
3864 |
case (insert x A) |
fbb777aec0d4
generalize lemma finite_imp_compact_convex_hull and related lemmas
huffman
parents:
44524
diff
changeset
|
3865 |
let ?f = "\<lambda>(u, y::'a). u *\<^sub>R x + (1 - u) *\<^sub>R y" |
fbb777aec0d4
generalize lemma finite_imp_compact_convex_hull and related lemmas
huffman
parents:
44524
diff
changeset
|
3866 |
let ?T = "{0..1::real} \<times> (convex hull A)" |
fbb777aec0d4
generalize lemma finite_imp_compact_convex_hull and related lemmas
huffman
parents:
44524
diff
changeset
|
3867 |
have "continuous_on ?T ?f" |
fbb777aec0d4
generalize lemma finite_imp_compact_convex_hull and related lemmas
huffman
parents:
44524
diff
changeset
|
3868 |
unfolding split_def continuous_on by (intro ballI tendsto_intros) |
fbb777aec0d4
generalize lemma finite_imp_compact_convex_hull and related lemmas
huffman
parents:
44524
diff
changeset
|
3869 |
moreover have "compact ?T" |
56188 | 3870 |
by (intro compact_Times compact_Icc insert) |
44525
fbb777aec0d4
generalize lemma finite_imp_compact_convex_hull and related lemmas
huffman
parents:
44524
diff
changeset
|
3871 |
ultimately have "compact (?f ` ?T)" |
fbb777aec0d4
generalize lemma finite_imp_compact_convex_hull and related lemmas
huffman
parents:
44524
diff
changeset
|
3872 |
by (rule compact_continuous_image) |
fbb777aec0d4
generalize lemma finite_imp_compact_convex_hull and related lemmas
huffman
parents:
44524
diff
changeset
|
3873 |
also have "?f ` ?T = convex hull (insert x A)" |
60420 | 3874 |
unfolding convex_hull_insert [OF \<open>A \<noteq> {}\<close>] |
44525
fbb777aec0d4
generalize lemma finite_imp_compact_convex_hull and related lemmas
huffman
parents:
44524
diff
changeset
|
3875 |
apply safe |
fbb777aec0d4
generalize lemma finite_imp_compact_convex_hull and related lemmas
huffman
parents:
44524
diff
changeset
|
3876 |
apply (rule_tac x=a in exI, simp) |
fbb777aec0d4
generalize lemma finite_imp_compact_convex_hull and related lemmas
huffman
parents:
44524
diff
changeset
|
3877 |
apply (rule_tac x="1 - a" in exI, simp) |
fbb777aec0d4
generalize lemma finite_imp_compact_convex_hull and related lemmas
huffman
parents:
44524
diff
changeset
|
3878 |
apply fast |
fbb777aec0d4
generalize lemma finite_imp_compact_convex_hull and related lemmas
huffman
parents:
44524
diff
changeset
|
3879 |
apply (rule_tac x="(u, b)" in image_eqI, simp_all) |
fbb777aec0d4
generalize lemma finite_imp_compact_convex_hull and related lemmas
huffman
parents:
44524
diff
changeset
|
3880 |
done |
fbb777aec0d4
generalize lemma finite_imp_compact_convex_hull and related lemmas
huffman
parents:
44524
diff
changeset
|
3881 |
finally show "compact (convex hull (insert x A))" . |
fbb777aec0d4
generalize lemma finite_imp_compact_convex_hull and related lemmas
huffman
parents:
44524
diff
changeset
|
3882 |
qed |
fbb777aec0d4
generalize lemma finite_imp_compact_convex_hull and related lemmas
huffman
parents:
44524
diff
changeset
|
3883 |
qed |
fbb777aec0d4
generalize lemma finite_imp_compact_convex_hull and related lemmas
huffman
parents:
44524
diff
changeset
|
3884 |
|
53347 | 3885 |
lemma compact_convex_hull: |
3886 |
fixes s :: "'a::euclidean_space set" |
|
3887 |
assumes "compact s" |
|
3888 |
shows "compact (convex hull s)" |
|
3889 |
proof (cases "s = {}") |
|
3890 |
case True |
|
3891 |
then show ?thesis using compact_empty by simp |
|
33175 | 3892 |
next |
53347 | 3893 |
case False |
3894 |
then obtain w where "w \<in> s" by auto |
|
3895 |
show ?thesis |
|
3896 |
unfolding caratheodory[of s] |
|
3897 |
proof (induct ("DIM('a) + 1")) |
|
3898 |
case 0 |
|
3899 |
have *: "{x.\<exists>sa. finite sa \<and> sa \<subseteq> s \<and> card sa \<le> 0 \<and> x \<in> convex hull sa} = {}" |
|
36362
06475a1547cb
fix lots of looping simp calls and other warnings
huffman
parents:
36341
diff
changeset
|
3900 |
using compact_empty by auto |
53347 | 3901 |
from 0 show ?case unfolding * by simp |
33175 | 3902 |
next |
3903 |
case (Suc n) |
|
53347 | 3904 |
show ?case |
3905 |
proof (cases "n = 0") |
|
3906 |
case True |
|
3907 |
have "{x. \<exists>t. finite t \<and> t \<subseteq> s \<and> card t \<le> Suc n \<and> x \<in> convex hull t} = s" |
|
3908 |
unfolding set_eq_iff and mem_Collect_eq |
|
3909 |
proof (rule, rule) |
|
3910 |
fix x |
|
3911 |
assume "\<exists>t. finite t \<and> t \<subseteq> s \<and> card t \<le> Suc n \<and> x \<in> convex hull t" |
|
3912 |
then obtain t where t: "finite t" "t \<subseteq> s" "card t \<le> Suc n" "x \<in> convex hull t" |
|
3913 |
by auto |
|
3914 |
show "x \<in> s" |
|
3915 |
proof (cases "card t = 0") |
|
3916 |
case True |
|
3917 |
then show ?thesis |
|
3918 |
using t(4) unfolding card_0_eq[OF t(1)] by simp |
|
33175 | 3919 |
next |
53347 | 3920 |
case False |
60420 | 3921 |
then have "card t = Suc 0" using t(3) \<open>n=0\<close> by auto |
33175 | 3922 |
then obtain a where "t = {a}" unfolding card_Suc_eq by auto |
53347 | 3923 |
then show ?thesis using t(2,4) by simp |
33175 | 3924 |
qed |
3925 |
next |
|
3926 |
fix x assume "x\<in>s" |
|
53347 | 3927 |
then show "\<exists>t. finite t \<and> t \<subseteq> s \<and> card t \<le> Suc n \<and> x \<in> convex hull t" |
3928 |
apply (rule_tac x="{x}" in exI) |
|
3929 |
unfolding convex_hull_singleton |
|
3930 |
apply auto |
|
3931 |
done |
|
3932 |
qed |
|
3933 |
then show ?thesis using assms by simp |
|
33175 | 3934 |
next |
53347 | 3935 |
case False |
3936 |
have "{x. \<exists>t. finite t \<and> t \<subseteq> s \<and> card t \<le> Suc n \<and> x \<in> convex hull t} = |
|
3937 |
{(1 - u) *\<^sub>R x + u *\<^sub>R y | x y u. |
|
3938 |
0 \<le> u \<and> u \<le> 1 \<and> x \<in> s \<and> y \<in> {x. \<exists>t. finite t \<and> t \<subseteq> s \<and> card t \<le> n \<and> x \<in> convex hull t}}" |
|
3939 |
unfolding set_eq_iff and mem_Collect_eq |
|
3940 |
proof (rule, rule) |
|
3941 |
fix x |
|
3942 |
assume "\<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> |
|
33175 | 3943 |
0 \<le> c \<and> c \<le> 1 \<and> u \<in> s \<and> (\<exists>t. finite t \<and> t \<subseteq> s \<and> card t \<le> n \<and> v \<in> convex hull t)" |
53347 | 3944 |
then obtain u v c t where obt: "x = (1 - c) *\<^sub>R u + c *\<^sub>R v" |
3945 |
"0 \<le> c \<and> c \<le> 1" "u \<in> s" "finite t" "t \<subseteq> s" "card t \<le> n" "v \<in> convex hull t" |
|
3946 |
by auto |
|
33175 | 3947 |
moreover have "(1 - c) *\<^sub>R u + c *\<^sub>R v \<in> convex hull insert u t" |
61426
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61222
diff
changeset
|
3948 |
apply (rule convexD_alt) |
53347 | 3949 |
using obt(2) and convex_convex_hull and hull_subset[of "insert u t" convex] |
3950 |
using obt(7) and hull_mono[of t "insert u t"] |
|
3951 |
apply auto |
|
3952 |
done |
|
33175 | 3953 |
ultimately show "\<exists>t. finite t \<and> t \<subseteq> s \<and> card t \<le> Suc n \<and> x \<in> convex hull t" |
53347 | 3954 |
apply (rule_tac x="insert u t" in exI) |
3955 |
apply (auto simp add: card_insert_if) |
|
3956 |
done |
|
33175 | 3957 |
next |
53347 | 3958 |
fix x |
3959 |
assume "\<exists>t. finite t \<and> t \<subseteq> s \<and> card t \<le> Suc n \<and> x \<in> convex hull t" |
|
3960 |
then obtain t where t: "finite t" "t \<subseteq> s" "card t \<le> Suc n" "x \<in> convex hull t" |
|
3961 |
by auto |
|
3962 |
show "\<exists>u v c. x = (1 - c) *\<^sub>R u + c *\<^sub>R v \<and> |
|
33175 | 3963 |
0 \<le> c \<and> c \<le> 1 \<and> u \<in> s \<and> (\<exists>t. finite t \<and> t \<subseteq> s \<and> card t \<le> n \<and> v \<in> convex hull t)" |
53347 | 3964 |
proof (cases "card t = Suc n") |
3965 |
case False |
|
3966 |
then have "card t \<le> n" using t(3) by auto |
|
3967 |
then show ?thesis |
|
3968 |
apply (rule_tac x=w in exI, rule_tac x=x in exI, rule_tac x=1 in exI) |
|
60420 | 3969 |
using \<open>w\<in>s\<close> and t |
53347 | 3970 |
apply (auto intro!: exI[where x=t]) |
3971 |
done |
|
33175 | 3972 |
next |
53347 | 3973 |
case True |
3974 |
then obtain a u where au: "t = insert a u" "a\<notin>u" |
|
3975 |
apply (drule_tac card_eq_SucD) |
|
3976 |
apply auto |
|
3977 |
done |
|
3978 |
show ?thesis |
|
3979 |
proof (cases "u = {}") |
|
3980 |
case True |
|
3981 |
then have "x = a" using t(4)[unfolded au] by auto |
|
60420 | 3982 |
show ?thesis unfolding \<open>x = a\<close> |
53347 | 3983 |
apply (rule_tac x=a in exI) |
3984 |
apply (rule_tac x=a in exI) |
|
3985 |
apply (rule_tac x=1 in exI) |
|
60420 | 3986 |
using t and \<open>n \<noteq> 0\<close> |
53347 | 3987 |
unfolding au |
3988 |
apply (auto intro!: exI[where x="{a}"]) |
|
3989 |
done |
|
33175 | 3990 |
next |
53347 | 3991 |
case False |
3992 |
obtain ux vx b where obt: "ux\<ge>0" "vx\<ge>0" "ux + vx = 1" |
|
3993 |
"b \<in> convex hull u" "x = ux *\<^sub>R a + vx *\<^sub>R b" |
|
3994 |
using t(4)[unfolded au convex_hull_insert[OF False]] |
|
3995 |
by auto |
|
3996 |
have *: "1 - vx = ux" using obt(3) by auto |
|
3997 |
show ?thesis |
|
3998 |
apply (rule_tac x=a in exI) |
|
3999 |
apply (rule_tac x=b in exI) |
|
4000 |
apply (rule_tac x=vx in exI) |
|
4001 |
using obt and t(1-3) |
|
4002 |
unfolding au and * using card_insert_disjoint[OF _ au(2)] |
|
4003 |
apply (auto intro!: exI[where x=u]) |
|
4004 |
done |
|
33175 | 4005 |
qed |
4006 |
qed |
|
4007 |
qed |
|
53347 | 4008 |
then show ?thesis |
4009 |
using compact_convex_combinations[OF assms Suc] by simp |
|
33175 | 4010 |
qed |
36362
06475a1547cb
fix lots of looping simp calls and other warnings
huffman
parents:
36341
diff
changeset
|
4011 |
qed |
33175 | 4012 |
qed |
4013 |
||
53347 | 4014 |
|
60420 | 4015 |
subsection \<open>Extremal points of a simplex are some vertices.\<close> |
33175 | 4016 |
|
4017 |
lemma dist_increases_online: |
|
4018 |
fixes a b d :: "'a::real_inner" |
|
4019 |
assumes "d \<noteq> 0" |
|
4020 |
shows "dist a (b + d) > dist a b \<or> dist a (b - d) > dist a b" |
|
53347 | 4021 |
proof (cases "inner a d - inner b d > 0") |
4022 |
case True |
|
4023 |
then have "0 < inner d d + (inner a d * 2 - inner b d * 2)" |
|
4024 |
apply (rule_tac add_pos_pos) |
|
4025 |
using assms |
|
4026 |
apply auto |
|
4027 |
done |
|
4028 |
then show ?thesis |
|
4029 |
apply (rule_tac disjI2) |
|
4030 |
unfolding dist_norm and norm_eq_sqrt_inner and real_sqrt_less_iff |
|
4031 |
apply (simp add: algebra_simps inner_commute) |
|
4032 |
done |
|
33175 | 4033 |
next |
53347 | 4034 |
case False |
4035 |
then have "0 < inner d d + (inner b d * 2 - inner a d * 2)" |
|
4036 |
apply (rule_tac add_pos_nonneg) |
|
4037 |
using assms |
|
4038 |
apply auto |
|
4039 |
done |
|
4040 |
then show ?thesis |
|
4041 |
apply (rule_tac disjI1) |
|
4042 |
unfolding dist_norm and norm_eq_sqrt_inner and real_sqrt_less_iff |
|
4043 |
apply (simp add: algebra_simps inner_commute) |
|
4044 |
done |
|
33175 | 4045 |
qed |
4046 |
||
4047 |
lemma norm_increases_online: |
|
4048 |
fixes d :: "'a::real_inner" |
|
53347 | 4049 |
shows "d \<noteq> 0 \<Longrightarrow> norm (a + d) > norm a \<or> norm(a - d) > norm a" |
33175 | 4050 |
using dist_increases_online[of d a 0] unfolding dist_norm by auto |
4051 |
||
4052 |
lemma simplex_furthest_lt: |
|
53347 | 4053 |
fixes s :: "'a::real_inner set" |
4054 |
assumes "finite s" |
|
4055 |
shows "\<forall>x \<in> convex hull s. x \<notin> s \<longrightarrow> (\<exists>y \<in> convex hull s. norm (x - a) < norm(y - a))" |
|
4056 |
using assms |
|
4057 |
proof induct |
|
4058 |
fix x s |
|
4059 |
assume as: "finite s" "x\<notin>s" "\<forall>x\<in>convex hull s. x \<notin> s \<longrightarrow> (\<exists>y\<in>convex hull s. norm (x - a) < norm (y - a))" |
|
4060 |
show "\<forall>xa\<in>convex hull insert x s. xa \<notin> insert x s \<longrightarrow> |
|
4061 |
(\<exists>y\<in>convex hull insert x s. norm (xa - a) < norm (y - a))" |
|
4062 |
proof (rule, rule, cases "s = {}") |
|
4063 |
case False |
|
4064 |
fix y |
|
4065 |
assume y: "y \<in> convex hull insert x s" "y \<notin> insert x s" |
|
4066 |
obtain u v b where obt: "u\<ge>0" "v\<ge>0" "u + v = 1" "b \<in> convex hull s" "y = u *\<^sub>R x + v *\<^sub>R b" |
|
33175 | 4067 |
using y(1)[unfolded convex_hull_insert[OF False]] by auto |
4068 |
show "\<exists>z\<in>convex hull insert x s. norm (y - a) < norm (z - a)" |
|
53347 | 4069 |
proof (cases "y \<in> convex hull s") |
4070 |
case True |
|
4071 |
then obtain z where "z \<in> convex hull s" "norm (y - a) < norm (z - a)" |
|
33175 | 4072 |
using as(3)[THEN bspec[where x=y]] and y(2) by auto |
53347 | 4073 |
then show ?thesis |
4074 |
apply (rule_tac x=z in bexI) |
|
4075 |
unfolding convex_hull_insert[OF False] |
|
4076 |
apply auto |
|
4077 |
done |
|
33175 | 4078 |
next |
53347 | 4079 |
case False |
4080 |
show ?thesis |
|
4081 |
using obt(3) |
|
4082 |
proof (cases "u = 0", case_tac[!] "v = 0") |
|
4083 |
assume "u = 0" "v \<noteq> 0" |
|
4084 |
then have "y = b" using obt by auto |
|
4085 |
then show ?thesis using False and obt(4) by auto |
|
33175 | 4086 |
next |
53347 | 4087 |
assume "u \<noteq> 0" "v = 0" |
4088 |
then have "y = x" using obt by auto |
|
4089 |
then show ?thesis using y(2) by auto |
|
4090 |
next |
|
4091 |
assume "u \<noteq> 0" "v \<noteq> 0" |
|
4092 |
then obtain w where w: "w>0" "w<u" "w<v" |
|
4093 |
using real_lbound_gt_zero[of u v] and obt(1,2) by auto |
|
4094 |
have "x \<noteq> b" |
|
4095 |
proof |
|
4096 |
assume "x = b" |
|
4097 |
then have "y = b" unfolding obt(5) |
|
4098 |
using obt(3) by (auto simp add: scaleR_left_distrib[symmetric]) |
|
4099 |
then show False using obt(4) and False by simp |
|
4100 |
qed |
|
4101 |
then have *: "w *\<^sub>R (x - b) \<noteq> 0" using w(1) by auto |
|
4102 |
show ?thesis |
|
4103 |
using dist_increases_online[OF *, of a y] |
|
4104 |
proof (elim disjE) |
|
33175 | 4105 |
assume "dist a y < dist a (y + w *\<^sub>R (x - b))" |
53347 | 4106 |
then have "norm (y - a) < norm ((u + w) *\<^sub>R x + (v - w) *\<^sub>R b - a)" |
4107 |
unfolding dist_commute[of a] |
|
4108 |
unfolding dist_norm obt(5) |
|
4109 |
by (simp add: algebra_simps) |
|
33175 | 4110 |
moreover have "(u + w) *\<^sub>R x + (v - w) *\<^sub>R b \<in> convex hull insert x s" |
60420 | 4111 |
unfolding convex_hull_insert[OF \<open>s\<noteq>{}\<close>] and mem_Collect_eq |
53347 | 4112 |
apply (rule_tac x="u + w" in exI) |
4113 |
apply rule |
|
4114 |
defer |
|
4115 |
apply (rule_tac x="v - w" in exI) |
|
60420 | 4116 |
using \<open>u \<ge> 0\<close> and w and obt(3,4) |
53347 | 4117 |
apply auto |
4118 |
done |
|
33175 | 4119 |
ultimately show ?thesis by auto |
4120 |
next |
|
4121 |
assume "dist a y < dist a (y - w *\<^sub>R (x - b))" |
|
53347 | 4122 |
then have "norm (y - a) < norm ((u - w) *\<^sub>R x + (v + w) *\<^sub>R b - a)" |
4123 |
unfolding dist_commute[of a] |
|
4124 |
unfolding dist_norm obt(5) |
|
4125 |
by (simp add: algebra_simps) |
|
33175 | 4126 |
moreover have "(u - w) *\<^sub>R x + (v + w) *\<^sub>R b \<in> convex hull insert x s" |
60420 | 4127 |
unfolding convex_hull_insert[OF \<open>s\<noteq>{}\<close>] and mem_Collect_eq |
53347 | 4128 |
apply (rule_tac x="u - w" in exI) |
4129 |
apply rule |
|
4130 |
defer |
|
4131 |
apply (rule_tac x="v + w" in exI) |
|
60420 | 4132 |
using \<open>u \<ge> 0\<close> and w and obt(3,4) |
53347 | 4133 |
apply auto |
4134 |
done |
|
33175 | 4135 |
ultimately show ?thesis by auto |
4136 |
qed |
|
4137 |
qed auto |
|
4138 |
qed |
|
4139 |
qed auto |
|
4140 |
qed (auto simp add: assms) |
|
4141 |
||
4142 |
lemma simplex_furthest_le: |
|
53347 | 4143 |
fixes s :: "'a::real_inner set" |
4144 |
assumes "finite s" |
|
4145 |
and "s \<noteq> {}" |
|
4146 |
shows "\<exists>y\<in>s. \<forall>x\<in> convex hull s. norm (x - a) \<le> norm (y - a)" |
|
4147 |
proof - |
|
4148 |
have "convex hull s \<noteq> {}" |
|
4149 |
using hull_subset[of s convex] and assms(2) by auto |
|
4150 |
then obtain x where x: "x \<in> convex hull s" "\<forall>y\<in>convex hull s. norm (y - a) \<le> norm (x - a)" |
|
33175 | 4151 |
using distance_attains_sup[OF finite_imp_compact_convex_hull[OF assms(1)], of a] |
53347 | 4152 |
unfolding dist_commute[of a] |
4153 |
unfolding dist_norm |
|
4154 |
by auto |
|
4155 |
show ?thesis |
|
4156 |
proof (cases "x \<in> s") |
|
4157 |
case False |
|
4158 |
then obtain y where "y \<in> convex hull s" "norm (x - a) < norm (y - a)" |
|
4159 |
using simplex_furthest_lt[OF assms(1), THEN bspec[where x=x]] and x(1) |
|
4160 |
by auto |
|
4161 |
then show ?thesis |
|
4162 |
using x(2)[THEN bspec[where x=y]] by auto |
|
4163 |
next |
|
4164 |
case True |
|
4165 |
with x show ?thesis by auto |
|
4166 |
qed |
|
33175 | 4167 |
qed |
4168 |
||
4169 |
lemma simplex_furthest_le_exists: |
|
44525
fbb777aec0d4
generalize lemma finite_imp_compact_convex_hull and related lemmas
huffman
parents:
44524
diff
changeset
|
4170 |
fixes s :: "('a::real_inner) set" |
53347 | 4171 |
shows "finite s \<Longrightarrow> \<forall>x\<in>(convex hull s). \<exists>y\<in>s. norm (x - a) \<le> norm (y - a)" |
4172 |
using simplex_furthest_le[of s] by (cases "s = {}") auto |
|
33175 | 4173 |
|
4174 |
lemma simplex_extremal_le: |
|
53347 | 4175 |
fixes s :: "'a::real_inner set" |
4176 |
assumes "finite s" |
|
4177 |
and "s \<noteq> {}" |
|
4178 |
shows "\<exists>u\<in>s. \<exists>v\<in>s. \<forall>x\<in>convex hull s. \<forall>y \<in> convex hull s. norm (x - y) \<le> norm (u - v)" |
|
4179 |
proof - |
|
4180 |
have "convex hull s \<noteq> {}" |
|
4181 |
using hull_subset[of s convex] and assms(2) by auto |
|
4182 |
then obtain u v where obt: "u \<in> convex hull s" "v \<in> convex hull s" |
|
33175 | 4183 |
"\<forall>x\<in>convex hull s. \<forall>y\<in>convex hull s. norm (x - y) \<le> norm (u - v)" |
53347 | 4184 |
using compact_sup_maxdistance[OF finite_imp_compact_convex_hull[OF assms(1)]] |
4185 |
by (auto simp: dist_norm) |
|
4186 |
then show ?thesis |
|
4187 |
proof (cases "u\<notin>s \<or> v\<notin>s", elim disjE) |
|
4188 |
assume "u \<notin> s" |
|
4189 |
then obtain y where "y \<in> convex hull s" "norm (u - v) < norm (y - v)" |
|
4190 |
using simplex_furthest_lt[OF assms(1), THEN bspec[where x=u]] and obt(1) |
|
4191 |
by auto |
|
4192 |
then show ?thesis |
|
4193 |
using obt(3)[THEN bspec[where x=y], THEN bspec[where x=v]] and obt(2) |
|
4194 |
by auto |
|
33175 | 4195 |
next |
53347 | 4196 |
assume "v \<notin> s" |
4197 |
then obtain y where "y \<in> convex hull s" "norm (v - u) < norm (y - u)" |
|
4198 |
using simplex_furthest_lt[OF assms(1), THEN bspec[where x=v]] and obt(2) |
|
4199 |
by auto |
|
4200 |
then show ?thesis |
|
4201 |
using obt(3)[THEN bspec[where x=u], THEN bspec[where x=y]] and obt(1) |
|
33175 | 4202 |
by (auto simp add: norm_minus_commute) |
4203 |
qed auto |
|
49531 | 4204 |
qed |
33175 | 4205 |
|
4206 |
lemma simplex_extremal_le_exists: |
|
53347 | 4207 |
fixes s :: "'a::real_inner set" |
4208 |
shows "finite s \<Longrightarrow> x \<in> convex hull s \<Longrightarrow> y \<in> convex hull s \<Longrightarrow> |
|
4209 |
\<exists>u\<in>s. \<exists>v\<in>s. norm (x - y) \<le> norm (u - v)" |
|
4210 |
using convex_hull_empty simplex_extremal_le[of s] |
|
4211 |
by(cases "s = {}") auto |
|
4212 |
||
33175 | 4213 |
|
60420 | 4214 |
subsection \<open>Closest point of a convex set is unique, with a continuous projection.\<close> |
33175 | 4215 |
|
53347 | 4216 |
definition closest_point :: "'a::{real_inner,heine_borel} set \<Rightarrow> 'a \<Rightarrow> 'a" |
4217 |
where "closest_point s a = (SOME x. x \<in> s \<and> (\<forall>y\<in>s. dist a x \<le> dist a y))" |
|
33175 | 4218 |
|
4219 |
lemma closest_point_exists: |
|
53347 | 4220 |
assumes "closed s" |
4221 |
and "s \<noteq> {}" |
|
4222 |
shows "closest_point s a \<in> s" |
|
4223 |
and "\<forall>y\<in>s. dist a (closest_point s a) \<le> dist a y" |
|
4224 |
unfolding closest_point_def |
|
4225 |
apply(rule_tac[!] someI2_ex) |
|
4226 |
using distance_attains_inf[OF assms(1,2), of a] |
|
4227 |
apply auto |
|
4228 |
done |
|
4229 |
||
4230 |
lemma closest_point_in_set: "closed s \<Longrightarrow> s \<noteq> {} \<Longrightarrow> closest_point s a \<in> s" |
|
4231 |
by (meson closest_point_exists) |
|
4232 |
||
4233 |
lemma closest_point_le: "closed s \<Longrightarrow> x \<in> s \<Longrightarrow> dist a (closest_point s a) \<le> dist a x" |
|
33175 | 4234 |
using closest_point_exists[of s] by auto |
4235 |
||
4236 |
lemma closest_point_self: |
|
53347 | 4237 |
assumes "x \<in> s" |
4238 |
shows "closest_point s x = x" |
|
4239 |
unfolding closest_point_def |
|
4240 |
apply (rule some1_equality, rule ex1I[of _ x]) |
|
4241 |
using assms |
|
4242 |
apply auto |
|
4243 |
done |
|
4244 |
||
4245 |
lemma closest_point_refl: "closed s \<Longrightarrow> s \<noteq> {} \<Longrightarrow> closest_point s x = x \<longleftrightarrow> x \<in> s" |
|
4246 |
using closest_point_in_set[of s x] closest_point_self[of x s] |
|
4247 |
by auto |
|
33175 | 4248 |
|
36337 | 4249 |
lemma closer_points_lemma: |
33175 | 4250 |
assumes "inner y z > 0" |
4251 |
shows "\<exists>u>0. \<forall>v>0. v \<le> u \<longrightarrow> norm(v *\<^sub>R z - y) < norm y" |
|
53347 | 4252 |
proof - |
4253 |
have z: "inner z z > 0" |
|
4254 |
unfolding inner_gt_zero_iff using assms by auto |
|
4255 |
then show ?thesis |
|
4256 |
using assms |
|
4257 |
apply (rule_tac x = "inner y z / inner z z" in exI) |
|
4258 |
apply rule |
|
4259 |
defer |
|
4260 |
proof rule+ |
|
4261 |
fix v |
|
4262 |
assume "0 < v" and "v \<le> inner y z / inner z z" |
|
4263 |
then show "norm (v *\<^sub>R z - y) < norm y" |
|
4264 |
unfolding norm_lt using z and assms |
|
60420 | 4265 |
by (simp add: field_simps inner_diff inner_commute mult_strict_left_mono[OF _ \<open>0<v\<close>]) |
56541 | 4266 |
qed auto |
53347 | 4267 |
qed |
33175 | 4268 |
|
4269 |
lemma closer_point_lemma: |
|
4270 |
assumes "inner (y - x) (z - x) > 0" |
|
4271 |
shows "\<exists>u>0. u \<le> 1 \<and> dist (x + u *\<^sub>R (z - x)) y < dist x y" |
|
53347 | 4272 |
proof - |
4273 |
obtain u where "u > 0" |
|
4274 |
and u: "\<forall>v>0. v \<le> u \<longrightarrow> norm (v *\<^sub>R (z - x) - (y - x)) < norm (y - x)" |
|
33175 | 4275 |
using closer_points_lemma[OF assms] by auto |
53347 | 4276 |
show ?thesis |
4277 |
apply (rule_tac x="min u 1" in exI) |
|
60420 | 4278 |
using u[THEN spec[where x="min u 1"]] and \<open>u > 0\<close> |
53347 | 4279 |
unfolding dist_norm by (auto simp add: norm_minus_commute field_simps) |
4280 |
qed |
|
33175 | 4281 |
|
4282 |
lemma any_closest_point_dot: |
|
4283 |
assumes "convex s" "closed s" "x \<in> s" "y \<in> s" "\<forall>z\<in>s. dist a x \<le> dist a z" |
|
4284 |
shows "inner (a - x) (y - x) \<le> 0" |
|
53347 | 4285 |
proof (rule ccontr) |
4286 |
assume "\<not> ?thesis" |
|
4287 |
then obtain u where u: "u>0" "u\<le>1" "dist (x + u *\<^sub>R (y - x)) a < dist x a" |
|
4288 |
using closer_point_lemma[of a x y] by auto |
|
4289 |
let ?z = "(1 - u) *\<^sub>R x + u *\<^sub>R y" |
|
4290 |
have "?z \<in> s" |
|
61426
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61222
diff
changeset
|
4291 |
using convexD_alt[OF assms(1,3,4), of u] using u by auto |
53347 | 4292 |
then show False |
4293 |
using assms(5)[THEN bspec[where x="?z"]] and u(3) |
|
4294 |
by (auto simp add: dist_commute algebra_simps) |
|
4295 |
qed |
|
33175 | 4296 |
|
4297 |
lemma any_closest_point_unique: |
|
36337 | 4298 |
fixes x :: "'a::real_inner" |
33175 | 4299 |
assumes "convex s" "closed s" "x \<in> s" "y \<in> s" |
53347 | 4300 |
"\<forall>z\<in>s. dist a x \<le> dist a z" "\<forall>z\<in>s. dist a y \<le> dist a z" |
4301 |
shows "x = y" |
|
4302 |
using any_closest_point_dot[OF assms(1-4,5)] and any_closest_point_dot[OF assms(1-2,4,3,6)] |
|
33175 | 4303 |
unfolding norm_pths(1) and norm_le_square |
4304 |
by (auto simp add: algebra_simps) |
|
4305 |
||
4306 |
lemma closest_point_unique: |
|
4307 |
assumes "convex s" "closed s" "x \<in> s" "\<forall>z\<in>s. dist a x \<le> dist a z" |
|
4308 |
shows "x = closest_point s a" |
|
49531 | 4309 |
using any_closest_point_unique[OF assms(1-3) _ assms(4), of "closest_point s a"] |
33175 | 4310 |
using closest_point_exists[OF assms(2)] and assms(3) by auto |
4311 |
||
4312 |
lemma closest_point_dot: |
|
4313 |
assumes "convex s" "closed s" "x \<in> s" |
|
4314 |
shows "inner (a - closest_point s a) (x - closest_point s a) \<le> 0" |
|
53347 | 4315 |
apply (rule any_closest_point_dot[OF assms(1,2) _ assms(3)]) |
4316 |
using closest_point_exists[OF assms(2)] and assms(3) |
|
4317 |
apply auto |
|
4318 |
done |
|
33175 | 4319 |
|
4320 |
lemma closest_point_lt: |
|
4321 |
assumes "convex s" "closed s" "x \<in> s" "x \<noteq> closest_point s a" |
|
4322 |
shows "dist a (closest_point s a) < dist a x" |
|
53347 | 4323 |
apply (rule ccontr) |
4324 |
apply (rule_tac notE[OF assms(4)]) |
|
4325 |
apply (rule closest_point_unique[OF assms(1-3), of a]) |
|
4326 |
using closest_point_le[OF assms(2), of _ a] |
|
4327 |
apply fastforce |
|
4328 |
done |
|
33175 | 4329 |
|
4330 |
lemma closest_point_lipschitz: |
|
53347 | 4331 |
assumes "convex s" |
4332 |
and "closed s" "s \<noteq> {}" |
|
33175 | 4333 |
shows "dist (closest_point s x) (closest_point s y) \<le> dist x y" |
53347 | 4334 |
proof - |
33175 | 4335 |
have "inner (x - closest_point s x) (closest_point s y - closest_point s x) \<le> 0" |
53347 | 4336 |
and "inner (y - closest_point s y) (closest_point s x - closest_point s y) \<le> 0" |
4337 |
apply (rule_tac[!] any_closest_point_dot[OF assms(1-2)]) |
|
4338 |
using closest_point_exists[OF assms(2-3)] |
|
4339 |
apply auto |
|
4340 |
done |
|
4341 |
then show ?thesis unfolding dist_norm and norm_le |
|
33175 | 4342 |
using inner_ge_zero[of "(x - closest_point s x) - (y - closest_point s y)"] |
53347 | 4343 |
by (simp add: inner_add inner_diff inner_commute) |
4344 |
qed |
|
33175 | 4345 |
|
4346 |
lemma continuous_at_closest_point: |
|
53347 | 4347 |
assumes "convex s" |
4348 |
and "closed s" |
|
4349 |
and "s \<noteq> {}" |
|
33175 | 4350 |
shows "continuous (at x) (closest_point s)" |
49531 | 4351 |
unfolding continuous_at_eps_delta |
33175 | 4352 |
using le_less_trans[OF closest_point_lipschitz[OF assms]] by auto |
4353 |
||
4354 |
lemma continuous_on_closest_point: |
|
53347 | 4355 |
assumes "convex s" |
4356 |
and "closed s" |
|
4357 |
and "s \<noteq> {}" |
|
33175 | 4358 |
shows "continuous_on t (closest_point s)" |
53347 | 4359 |
by (metis continuous_at_imp_continuous_on continuous_at_closest_point[OF assms]) |
4360 |
||
33175 | 4361 |
|
60420 | 4362 |
subsubsection \<open>Various point-to-set separating/supporting hyperplane theorems.\<close> |
33175 | 4363 |
|
4364 |
lemma supporting_hyperplane_closed_point: |
|
36337 | 4365 |
fixes z :: "'a::{real_inner,heine_borel}" |
53347 | 4366 |
assumes "convex s" |
4367 |
and "closed s" |
|
4368 |
and "s \<noteq> {}" |
|
4369 |
and "z \<notin> s" |
|
4370 |
shows "\<exists>a b. \<exists>y\<in>s. inner a z < b \<and> inner a y = b \<and> (\<forall>x\<in>s. inner a x \<ge> b)" |
|
4371 |
proof - |
|
4372 |
from distance_attains_inf[OF assms(2-3)] |
|
4373 |
obtain y where "y \<in> s" and y: "\<forall>x\<in>s. dist z y \<le> dist z x" |
|
4374 |
by auto |
|
4375 |
show ?thesis |
|
4376 |
apply (rule_tac x="y - z" in exI) |
|
4377 |
apply (rule_tac x="inner (y - z) y" in exI) |
|
4378 |
apply (rule_tac x=y in bexI) |
|
4379 |
apply rule |
|
4380 |
defer |
|
4381 |
apply rule |
|
4382 |
defer |
|
4383 |
apply rule |
|
4384 |
apply (rule ccontr) |
|
60420 | 4385 |
using \<open>y \<in> s\<close> |
53347 | 4386 |
proof - |
4387 |
show "inner (y - z) z < inner (y - z) y" |
|
4388 |
apply (subst diff_less_iff(1)[symmetric]) |
|
4389 |
unfolding inner_diff_right[symmetric] and inner_gt_zero_iff |
|
60420 | 4390 |
using \<open>y\<in>s\<close> \<open>z\<notin>s\<close> |
53347 | 4391 |
apply auto |
4392 |
done |
|
33175 | 4393 |
next |
53347 | 4394 |
fix x |
4395 |
assume "x \<in> s" |
|
4396 |
have *: "\<forall>u. 0 \<le> u \<and> u \<le> 1 \<longrightarrow> dist z y \<le> dist z ((1 - u) *\<^sub>R y + u *\<^sub>R x)" |
|
60420 | 4397 |
using assms(1)[unfolded convex_alt] and y and \<open>x\<in>s\<close> and \<open>y\<in>s\<close> by auto |
53347 | 4398 |
assume "\<not> inner (y - z) y \<le> inner (y - z) x" |
4399 |
then obtain v where "v > 0" "v \<le> 1" "dist (y + v *\<^sub>R (x - y)) z < dist y z" |
|
4400 |
using closer_point_lemma[of z y x] by (auto simp add: inner_diff) |
|
4401 |
then show False |
|
4402 |
using *[THEN spec[where x=v]] by (auto simp add: dist_commute algebra_simps) |
|
33175 | 4403 |
qed auto |
4404 |
qed |
|
4405 |
||
4406 |
lemma separating_hyperplane_closed_point: |
|
36337 | 4407 |
fixes z :: "'a::{real_inner,heine_borel}" |
53347 | 4408 |
assumes "convex s" |
4409 |
and "closed s" |
|
4410 |
and "z \<notin> s" |
|
33175 | 4411 |
shows "\<exists>a b. inner a z < b \<and> (\<forall>x\<in>s. inner a x > b)" |
53347 | 4412 |
proof (cases "s = {}") |
4413 |
case True |
|
4414 |
then show ?thesis |
|
4415 |
apply (rule_tac x="-z" in exI) |
|
4416 |
apply (rule_tac x=1 in exI) |
|
4417 |
using less_le_trans[OF _ inner_ge_zero[of z]] |
|
4418 |
apply auto |
|
4419 |
done |
|
33175 | 4420 |
next |
53347 | 4421 |
case False |
4422 |
obtain y where "y \<in> s" and y: "\<forall>x\<in>s. dist z y \<le> dist z x" |
|
33175 | 4423 |
using distance_attains_inf[OF assms(2) False] by auto |
53347 | 4424 |
show ?thesis |
4425 |
apply (rule_tac x="y - z" in exI) |
|
4426 |
apply (rule_tac x="inner (y - z) z + (norm (y - z))\<^sup>2 / 2" in exI) |
|
4427 |
apply rule |
|
4428 |
defer |
|
4429 |
apply rule |
|
4430 |
proof - |
|
4431 |
fix x |
|
4432 |
assume "x \<in> s" |
|
4433 |
have "\<not> 0 < inner (z - y) (x - y)" |
|
4434 |
apply (rule notI) |
|
4435 |
apply (drule closer_point_lemma) |
|
4436 |
proof - |
|
33175 | 4437 |
assume "\<exists>u>0. u \<le> 1 \<and> dist (y + u *\<^sub>R (x - y)) z < dist y z" |
53347 | 4438 |
then obtain u where "u > 0" "u \<le> 1" "dist (y + u *\<^sub>R (x - y)) z < dist y z" |
4439 |
by auto |
|
4440 |
then show False using y[THEN bspec[where x="y + u *\<^sub>R (x - y)"]] |
|
33175 | 4441 |
using assms(1)[unfolded convex_alt, THEN bspec[where x=y]] |
60420 | 4442 |
using \<open>x\<in>s\<close> \<open>y\<in>s\<close> by (auto simp add: dist_commute algebra_simps) |
53347 | 4443 |
qed |
4444 |
moreover have "0 < (norm (y - z))\<^sup>2" |
|
60420 | 4445 |
using \<open>y\<in>s\<close> \<open>z\<notin>s\<close> by auto |
53347 | 4446 |
then have "0 < inner (y - z) (y - z)" |
4447 |
unfolding power2_norm_eq_inner by simp |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
51524
diff
changeset
|
4448 |
ultimately show "inner (y - z) z + (norm (y - z))\<^sup>2 / 2 < inner (y - z) x" |
53347 | 4449 |
unfolding power2_norm_eq_inner and not_less |
4450 |
by (auto simp add: field_simps inner_commute inner_diff) |
|
60420 | 4451 |
qed (insert \<open>y\<in>s\<close> \<open>z\<notin>s\<close>, auto) |
33175 | 4452 |
qed |
4453 |
||
4454 |
lemma separating_hyperplane_closed_0: |
|
53347 | 4455 |
assumes "convex (s::('a::euclidean_space) set)" |
4456 |
and "closed s" |
|
4457 |
and "0 \<notin> s" |
|
33175 | 4458 |
shows "\<exists>a b. a \<noteq> 0 \<and> 0 < b \<and> (\<forall>x\<in>s. inner a x > b)" |
53347 | 4459 |
proof (cases "s = {}") |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
4460 |
case True |
53347 | 4461 |
have "norm ((SOME i. i\<in>Basis)::'a) = 1" "(SOME i. i\<in>Basis) \<noteq> (0::'a)" |
4462 |
defer |
|
4463 |
apply (subst norm_le_zero_iff[symmetric]) |
|
4464 |
apply (auto simp: SOME_Basis) |
|
4465 |
done |
|
4466 |
then show ?thesis |
|
4467 |
apply (rule_tac x="SOME i. i\<in>Basis" in exI) |
|
4468 |
apply (rule_tac x=1 in exI) |
|
4469 |
using True using DIM_positive[where 'a='a] |
|
4470 |
apply auto |
|
4471 |
done |
|
4472 |
next |
|
4473 |
case False |
|
4474 |
then show ?thesis |
|
4475 |
using False using separating_hyperplane_closed_point[OF assms] |
|
4476 |
apply (elim exE) |
|
4477 |
unfolding inner_zero_right |
|
4478 |
apply (rule_tac x=a in exI) |
|
4479 |
apply (rule_tac x=b in exI) |
|
4480 |
apply auto |
|
4481 |
done |
|
4482 |
qed |
|
4483 |
||
33175 | 4484 |
|
60420 | 4485 |
subsubsection \<open>Now set-to-set for closed/compact sets\<close> |
33175 | 4486 |
|
4487 |
lemma separating_hyperplane_closed_compact: |
|
53347 | 4488 |
fixes s :: "'a::euclidean_space set" |
4489 |
assumes "convex s" |
|
4490 |
and "closed s" |
|
4491 |
and "convex t" |
|
4492 |
and "compact t" |
|
4493 |
and "t \<noteq> {}" |
|
4494 |
and "s \<inter> t = {}" |
|
33175 | 4495 |
shows "\<exists>a b. (\<forall>x\<in>s. inner a x < b) \<and> (\<forall>x\<in>t. inner a x > b)" |
53347 | 4496 |
proof (cases "s = {}") |
33175 | 4497 |
case True |
53347 | 4498 |
obtain b where b: "b > 0" "\<forall>x\<in>t. norm x \<le> b" |
4499 |
using compact_imp_bounded[OF assms(4)] unfolding bounded_pos by auto |
|
4500 |
obtain z :: 'a where z: "norm z = b + 1" |
|
4501 |
using vector_choose_size[of "b + 1"] and b(1) by auto |
|
4502 |
then have "z \<notin> t" using b(2)[THEN bspec[where x=z]] by auto |
|
4503 |
then obtain a b where ab: "inner a z < b" "\<forall>x\<in>t. b < inner a x" |
|
4504 |
using separating_hyperplane_closed_point[OF assms(3) compact_imp_closed[OF assms(4)], of z] |
|
4505 |
by auto |
|
4506 |
then show ?thesis |
|
4507 |
using True by auto |
|
33175 | 4508 |
next |
53347 | 4509 |
case False |
4510 |
then obtain y where "y \<in> s" by auto |
|
33175 | 4511 |
obtain a b where "0 < b" "\<forall>x\<in>{x - y |x y. x \<in> s \<and> y \<in> t}. b < inner a x" |
4512 |
using separating_hyperplane_closed_point[OF convex_differences[OF assms(1,3)], of 0] |
|
53347 | 4513 |
using closed_compact_differences[OF assms(2,4)] |
4514 |
using assms(6) by auto blast |
|
4515 |
then have ab: "\<forall>x\<in>s. \<forall>y\<in>t. b + inner a y < inner a x" |
|
4516 |
apply - |
|
4517 |
apply rule |
|
4518 |
apply rule |
|
4519 |
apply (erule_tac x="x - y" in ballE) |
|
4520 |
apply (auto simp add: inner_diff) |
|
4521 |
done |
|
54263
c4159fe6fa46
move Lubs from HOL to HOL-Library (replaced by conditionally complete lattices)
hoelzl
parents:
54258
diff
changeset
|
4522 |
def k \<equiv> "SUP x:t. a \<bullet> x" |
53347 | 4523 |
show ?thesis |
4524 |
apply (rule_tac x="-a" in exI) |
|
4525 |
apply (rule_tac x="-(k + b / 2)" in exI) |
|
54263
c4159fe6fa46
move Lubs from HOL to HOL-Library (replaced by conditionally complete lattices)
hoelzl
parents:
54258
diff
changeset
|
4526 |
apply (intro conjI ballI) |
53347 | 4527 |
unfolding inner_minus_left and neg_less_iff_less |
4528 |
proof - |
|
54263
c4159fe6fa46
move Lubs from HOL to HOL-Library (replaced by conditionally complete lattices)
hoelzl
parents:
54258
diff
changeset
|
4529 |
fix x assume "x \<in> t" |
c4159fe6fa46
move Lubs from HOL to HOL-Library (replaced by conditionally complete lattices)
hoelzl
parents:
54258
diff
changeset
|
4530 |
then have "inner a x - b / 2 < k" |
53347 | 4531 |
unfolding k_def |
54263
c4159fe6fa46
move Lubs from HOL to HOL-Library (replaced by conditionally complete lattices)
hoelzl
parents:
54258
diff
changeset
|
4532 |
proof (subst less_cSUP_iff) |
c4159fe6fa46
move Lubs from HOL to HOL-Library (replaced by conditionally complete lattices)
hoelzl
parents:
54258
diff
changeset
|
4533 |
show "t \<noteq> {}" by fact |
c4159fe6fa46
move Lubs from HOL to HOL-Library (replaced by conditionally complete lattices)
hoelzl
parents:
54258
diff
changeset
|
4534 |
show "bdd_above (op \<bullet> a ` t)" |
60420 | 4535 |
using ab[rule_format, of y] \<open>y \<in> s\<close> |
54263
c4159fe6fa46
move Lubs from HOL to HOL-Library (replaced by conditionally complete lattices)
hoelzl
parents:
54258
diff
changeset
|
4536 |
by (intro bdd_aboveI2[where M="inner a y - b"]) (auto simp: field_simps intro: less_imp_le) |
60420 | 4537 |
qed (auto intro!: bexI[of _ x] \<open>0<b\<close>) |
54263
c4159fe6fa46
move Lubs from HOL to HOL-Library (replaced by conditionally complete lattices)
hoelzl
parents:
54258
diff
changeset
|
4538 |
then show "inner a x < k + b / 2" |
c4159fe6fa46
move Lubs from HOL to HOL-Library (replaced by conditionally complete lattices)
hoelzl
parents:
54258
diff
changeset
|
4539 |
by auto |
33175 | 4540 |
next |
53347 | 4541 |
fix x |
4542 |
assume "x \<in> s" |
|
4543 |
then have "k \<le> inner a x - b" |
|
4544 |
unfolding k_def |
|
54263
c4159fe6fa46
move Lubs from HOL to HOL-Library (replaced by conditionally complete lattices)
hoelzl
parents:
54258
diff
changeset
|
4545 |
apply (rule_tac cSUP_least) |
53347 | 4546 |
using assms(5) |
4547 |
using ab[THEN bspec[where x=x]] |
|
4548 |
apply auto |
|
4549 |
done |
|
4550 |
then show "k + b / 2 < inner a x" |
|
60420 | 4551 |
using \<open>0 < b\<close> by auto |
33175 | 4552 |
qed |
4553 |
qed |
|
4554 |
||
4555 |
lemma separating_hyperplane_compact_closed: |
|
53347 | 4556 |
fixes s :: "'a::euclidean_space set" |
4557 |
assumes "convex s" |
|
4558 |
and "compact s" |
|
4559 |
and "s \<noteq> {}" |
|
4560 |
and "convex t" |
|
4561 |
and "closed t" |
|
4562 |
and "s \<inter> t = {}" |
|
33175 | 4563 |
shows "\<exists>a b. (\<forall>x\<in>s. inner a x < b) \<and> (\<forall>x\<in>t. inner a x > b)" |
53347 | 4564 |
proof - |
4565 |
obtain a b where "(\<forall>x\<in>t. inner a x < b) \<and> (\<forall>x\<in>s. b < inner a x)" |
|
4566 |
using separating_hyperplane_closed_compact[OF assms(4-5,1-2,3)] and assms(6) |
|
4567 |
by auto |
|
4568 |
then show ?thesis |
|
4569 |
apply (rule_tac x="-a" in exI) |
|
4570 |
apply (rule_tac x="-b" in exI) |
|
4571 |
apply auto |
|
4572 |
done |
|
4573 |
qed |
|
4574 |
||
33175 | 4575 |
|
60420 | 4576 |
subsubsection \<open>General case without assuming closure and getting non-strict separation\<close> |
33175 | 4577 |
|
4578 |
lemma separating_hyperplane_set_0: |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
4579 |
assumes "convex s" "(0::'a::euclidean_space) \<notin> s" |
33175 | 4580 |
shows "\<exists>a. a \<noteq> 0 \<and> (\<forall>x\<in>s. 0 \<le> inner a x)" |
53347 | 4581 |
proof - |
4582 |
let ?k = "\<lambda>c. {x::'a. 0 \<le> inner c x}" |
|
60585 | 4583 |
have "frontier (cball 0 1) \<inter> (\<Inter>(?k ` s)) \<noteq> {}" |
53347 | 4584 |
apply (rule compact_imp_fip) |
4585 |
apply (rule compact_frontier[OF compact_cball]) |
|
4586 |
defer |
|
4587 |
apply rule |
|
4588 |
apply rule |
|
4589 |
apply (erule conjE) |
|
4590 |
proof - |
|
4591 |
fix f |
|
4592 |
assume as: "f \<subseteq> ?k ` s" "finite f" |
|
4593 |
obtain c where c: "f = ?k ` c" "c \<subseteq> s" "finite c" |
|
4594 |
using finite_subset_image[OF as(2,1)] by auto |
|
4595 |
then obtain a b where ab: "a \<noteq> 0" "0 < b" "\<forall>x\<in>convex hull c. b < inner a x" |
|
33175 | 4596 |
using separating_hyperplane_closed_0[OF convex_convex_hull, of c] |
4597 |
using finite_imp_compact_convex_hull[OF c(3), THEN compact_imp_closed] and assms(2) |
|
53347 | 4598 |
using subset_hull[of convex, OF assms(1), symmetric, of c] |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61531
diff
changeset
|
4599 |
by force |
53347 | 4600 |
then have "\<exists>x. norm x = 1 \<and> (\<forall>y\<in>c. 0 \<le> inner y x)" |
4601 |
apply (rule_tac x = "inverse(norm a) *\<^sub>R a" in exI) |
|
4602 |
using hull_subset[of c convex] |
|
4603 |
unfolding subset_eq and inner_scaleR |
|
56536 | 4604 |
by (auto simp add: inner_commute del: ballE elim!: ballE) |
53347 | 4605 |
then show "frontier (cball 0 1) \<inter> \<Inter>f \<noteq> {}" |
4606 |
unfolding c(1) frontier_cball dist_norm by auto |
|
4607 |
qed (insert closed_halfspace_ge, auto) |
|
4608 |
then obtain x where "norm x = 1" "\<forall>y\<in>s. x\<in>?k y" |
|
4609 |
unfolding frontier_cball dist_norm by auto |
|
4610 |
then show ?thesis |
|
4611 |
apply (rule_tac x=x in exI) |
|
4612 |
apply (auto simp add: inner_commute) |
|
4613 |
done |
|
4614 |
qed |
|
33175 | 4615 |
|
4616 |
lemma separating_hyperplane_sets: |
|
53347 | 4617 |
fixes s t :: "'a::euclidean_space set" |
4618 |
assumes "convex s" |
|
4619 |
and "convex t" |
|
4620 |
and "s \<noteq> {}" |
|
4621 |
and "t \<noteq> {}" |
|
4622 |
and "s \<inter> t = {}" |
|
33175 | 4623 |
shows "\<exists>a b. a \<noteq> 0 \<and> (\<forall>x\<in>s. inner a x \<le> b) \<and> (\<forall>x\<in>t. inner a x \<ge> b)" |
53347 | 4624 |
proof - |
4625 |
from separating_hyperplane_set_0[OF convex_differences[OF assms(2,1)]] |
|
4626 |
obtain a where "a \<noteq> 0" "\<forall>x\<in>{x - y |x y. x \<in> t \<and> y \<in> s}. 0 \<le> inner a x" |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61531
diff
changeset
|
4627 |
using assms(3-5) by fastforce |
54263
c4159fe6fa46
move Lubs from HOL to HOL-Library (replaced by conditionally complete lattices)
hoelzl
parents:
54258
diff
changeset
|
4628 |
then have *: "\<And>x y. x \<in> t \<Longrightarrow> y \<in> s \<Longrightarrow> inner a y \<le> inner a x" |
33270 | 4629 |
by (force simp add: inner_diff) |
54263
c4159fe6fa46
move Lubs from HOL to HOL-Library (replaced by conditionally complete lattices)
hoelzl
parents:
54258
diff
changeset
|
4630 |
then have bdd: "bdd_above ((op \<bullet> a)`s)" |
60420 | 4631 |
using \<open>t \<noteq> {}\<close> by (auto intro: bdd_aboveI2[OF *]) |
54263
c4159fe6fa46
move Lubs from HOL to HOL-Library (replaced by conditionally complete lattices)
hoelzl
parents:
54258
diff
changeset
|
4632 |
show ?thesis |
60420 | 4633 |
using \<open>a\<noteq>0\<close> |
54263
c4159fe6fa46
move Lubs from HOL to HOL-Library (replaced by conditionally complete lattices)
hoelzl
parents:
54258
diff
changeset
|
4634 |
by (intro exI[of _ a] exI[of _ "SUP x:s. a \<bullet> x"]) |
60420 | 4635 |
(auto intro!: cSUP_upper bdd cSUP_least \<open>a \<noteq> 0\<close> \<open>s \<noteq> {}\<close> *) |
4636 |
qed |
|
4637 |
||
4638 |
||
4639 |
subsection \<open>More convexity generalities\<close> |
|
33175 | 4640 |
|
4641 |
lemma convex_closure: |
|
4642 |
fixes s :: "'a::real_normed_vector set" |
|
53347 | 4643 |
assumes "convex s" |
4644 |
shows "convex (closure s)" |
|
53676 | 4645 |
apply (rule convexI) |
4646 |
apply (unfold closure_sequential, elim exE) |
|
4647 |
apply (rule_tac x="\<lambda>n. u *\<^sub>R xa n + v *\<^sub>R xb n" in exI) |
|
53347 | 4648 |
apply (rule,rule) |
53676 | 4649 |
apply (rule convexD [OF assms]) |
53347 | 4650 |
apply (auto del: tendsto_const intro!: tendsto_intros) |
4651 |
done |
|
33175 | 4652 |
|
4653 |
lemma convex_interior: |
|
4654 |
fixes s :: "'a::real_normed_vector set" |
|
53347 | 4655 |
assumes "convex s" |
4656 |
shows "convex (interior s)" |
|
4657 |
unfolding convex_alt Ball_def mem_interior |
|
4658 |
apply (rule,rule,rule,rule,rule,rule) |
|
4659 |
apply (elim exE conjE) |
|
4660 |
proof - |
|
4661 |
fix x y u |
|
4662 |
assume u: "0 \<le> u" "u \<le> (1::real)" |
|
4663 |
fix e d |
|
4664 |
assume ed: "ball x e \<subseteq> s" "ball y d \<subseteq> s" "0<d" "0<e" |
|
4665 |
show "\<exists>e>0. ball ((1 - u) *\<^sub>R x + u *\<^sub>R y) e \<subseteq> s" |
|
4666 |
apply (rule_tac x="min d e" in exI) |
|
4667 |
apply rule |
|
4668 |
unfolding subset_eq |
|
4669 |
defer |
|
4670 |
apply rule |
|
4671 |
proof - |
|
4672 |
fix z |
|
4673 |
assume "z \<in> ball ((1 - u) *\<^sub>R x + u *\<^sub>R y) (min d e)" |
|
4674 |
then have "(1- u) *\<^sub>R (z - u *\<^sub>R (y - x)) + u *\<^sub>R (z + (1 - u) *\<^sub>R (y - x)) \<in> s" |
|
4675 |
apply (rule_tac assms[unfolded convex_alt, rule_format]) |
|
4676 |
using ed(1,2) and u |
|
4677 |
unfolding subset_eq mem_ball Ball_def dist_norm |
|
4678 |
apply (auto simp add: algebra_simps) |
|
4679 |
done |
|
4680 |
then show "z \<in> s" |
|
4681 |
using u by (auto simp add: algebra_simps) |
|
4682 |
qed(insert u ed(3-4), auto) |
|
4683 |
qed |
|
33175 | 4684 |
|
34964 | 4685 |
lemma convex_hull_eq_empty[simp]: "convex hull s = {} \<longleftrightarrow> s = {}" |
33175 | 4686 |
using hull_subset[of s convex] convex_hull_empty by auto |
4687 |
||
53347 | 4688 |
|
60420 | 4689 |
subsection \<open>Moving and scaling convex hulls.\<close> |
33175 | 4690 |
|
53676 | 4691 |
lemma convex_hull_set_plus: |
4692 |
"convex hull (s + t) = convex hull s + convex hull t" |
|
4693 |
unfolding set_plus_image |
|
4694 |
apply (subst convex_hull_linear_image [symmetric]) |
|
4695 |
apply (simp add: linear_iff scaleR_right_distrib) |
|
4696 |
apply (simp add: convex_hull_Times) |
|
4697 |
done |
|
4698 |
||
4699 |
lemma translation_eq_singleton_plus: "(\<lambda>x. a + x) ` t = {a} + t" |
|
4700 |
unfolding set_plus_def by auto |
|
33175 | 4701 |
|
4702 |
lemma convex_hull_translation: |
|
4703 |
"convex hull ((\<lambda>x. a + x) ` s) = (\<lambda>x. a + x) ` (convex hull s)" |
|
53676 | 4704 |
unfolding translation_eq_singleton_plus |
4705 |
by (simp only: convex_hull_set_plus convex_hull_singleton) |
|
33175 | 4706 |
|
4707 |
lemma convex_hull_scaling: |
|
4708 |
"convex hull ((\<lambda>x. c *\<^sub>R x) ` s) = (\<lambda>x. c *\<^sub>R x) ` (convex hull s)" |
|
53676 | 4709 |
using linear_scaleR by (rule convex_hull_linear_image [symmetric]) |
33175 | 4710 |
|
4711 |
lemma convex_hull_affinity: |
|
4712 |
"convex hull ((\<lambda>x. a + c *\<^sub>R x) ` s) = (\<lambda>x. a + c *\<^sub>R x) ` (convex hull s)" |
|
53347 | 4713 |
by(simp only: image_image[symmetric] convex_hull_scaling convex_hull_translation) |
4714 |
||
33175 | 4715 |
|
60420 | 4716 |
subsection \<open>Convexity of cone hulls\<close> |
40377 | 4717 |
|
4718 |
lemma convex_cone_hull: |
|
53347 | 4719 |
assumes "convex S" |
4720 |
shows "convex (cone hull S)" |
|
53676 | 4721 |
proof (rule convexI) |
4722 |
fix x y |
|
4723 |
assume xy: "x \<in> cone hull S" "y \<in> cone hull S" |
|
4724 |
then have "S \<noteq> {}" |
|
4725 |
using cone_hull_empty_iff[of S] by auto |
|
4726 |
fix u v :: real |
|
4727 |
assume uv: "u \<ge> 0" "v \<ge> 0" "u + v = 1" |
|
4728 |
then have *: "u *\<^sub>R x \<in> cone hull S" "v *\<^sub>R y \<in> cone hull S" |
|
4729 |
using cone_cone_hull[of S] xy cone_def[of "cone hull S"] by auto |
|
4730 |
from * obtain cx :: real and xx where x: "u *\<^sub>R x = cx *\<^sub>R xx" "cx \<ge> 0" "xx \<in> S" |
|
4731 |
using cone_hull_expl[of S] by auto |
|
4732 |
from * obtain cy :: real and yy where y: "v *\<^sub>R y = cy *\<^sub>R yy" "cy \<ge> 0" "yy \<in> S" |
|
4733 |
using cone_hull_expl[of S] by auto |
|
53347 | 4734 |
{ |
53676 | 4735 |
assume "cx + cy \<le> 0" |
4736 |
then have "u *\<^sub>R x = 0" and "v *\<^sub>R y = 0" |
|
4737 |
using x y by auto |
|
4738 |
then have "u *\<^sub>R x + v *\<^sub>R y = 0" |
|
4739 |
by auto |
|
4740 |
then have "u *\<^sub>R x + v *\<^sub>R y \<in> cone hull S" |
|
60420 | 4741 |
using cone_hull_contains_0[of S] \<open>S \<noteq> {}\<close> by auto |
40377 | 4742 |
} |
53676 | 4743 |
moreover |
4744 |
{ |
|
4745 |
assume "cx + cy > 0" |
|
4746 |
then have "(cx / (cx + cy)) *\<^sub>R xx + (cy / (cx + cy)) *\<^sub>R yy \<in> S" |
|
4747 |
using assms mem_convex_alt[of S xx yy cx cy] x y by auto |
|
4748 |
then have "cx *\<^sub>R xx + cy *\<^sub>R yy \<in> cone hull S" |
|
60420 | 4749 |
using mem_cone_hull[of "(cx/(cx+cy)) *\<^sub>R xx + (cy/(cx+cy)) *\<^sub>R yy" S "cx+cy"] \<open>cx+cy>0\<close> |
53676 | 4750 |
by (auto simp add: scaleR_right_distrib) |
4751 |
then have "u *\<^sub>R x + v *\<^sub>R y \<in> cone hull S" |
|
4752 |
using x y by auto |
|
4753 |
} |
|
4754 |
moreover have "cx + cy \<le> 0 \<or> cx + cy > 0" by auto |
|
4755 |
ultimately show "u *\<^sub>R x + v *\<^sub>R y \<in> cone hull S" by blast |
|
40377 | 4756 |
qed |
4757 |
||
4758 |
lemma cone_convex_hull: |
|
53347 | 4759 |
assumes "cone S" |
4760 |
shows "cone (convex hull S)" |
|
4761 |
proof (cases "S = {}") |
|
4762 |
case True |
|
4763 |
then show ?thesis by auto |
|
4764 |
next |
|
4765 |
case False |
|
54465 | 4766 |
then have *: "0 \<in> S \<and> (\<forall>c. c > 0 \<longrightarrow> op *\<^sub>R c ` S = S)" |
4767 |
using cone_iff[of S] assms by auto |
|
53347 | 4768 |
{ |
4769 |
fix c :: real |
|
4770 |
assume "c > 0" |
|
4771 |
then have "op *\<^sub>R c ` (convex hull S) = convex hull (op *\<^sub>R c ` S)" |
|
4772 |
using convex_hull_scaling[of _ S] by auto |
|
4773 |
also have "\<dots> = convex hull S" |
|
60420 | 4774 |
using * \<open>c > 0\<close> by auto |
53347 | 4775 |
finally have "op *\<^sub>R c ` (convex hull S) = convex hull S" |
4776 |
by auto |
|
40377 | 4777 |
} |
53347 | 4778 |
then have "0 \<in> convex hull S" "\<And>c. c > 0 \<Longrightarrow> (op *\<^sub>R c ` (convex hull S)) = (convex hull S)" |
4779 |
using * hull_subset[of S convex] by auto |
|
4780 |
then show ?thesis |
|
60420 | 4781 |
using \<open>S \<noteq> {}\<close> cone_iff[of "convex hull S"] by auto |
4782 |
qed |
|
4783 |
||
4784 |
subsection \<open>Convex set as intersection of halfspaces\<close> |
|
33175 | 4785 |
|
4786 |
lemma convex_halfspace_intersection: |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
4787 |
fixes s :: "('a::euclidean_space) set" |
33175 | 4788 |
assumes "closed s" "convex s" |
60585 | 4789 |
shows "s = \<Inter>{h. s \<subseteq> h \<and> (\<exists>a b. h = {x. inner a x \<le> b})}" |
53347 | 4790 |
apply (rule set_eqI) |
4791 |
apply rule |
|
4792 |
unfolding Inter_iff Ball_def mem_Collect_eq |
|
4793 |
apply (rule,rule,erule conjE) |
|
4794 |
proof - |
|
54465 | 4795 |
fix x |
53347 | 4796 |
assume "\<forall>xa. s \<subseteq> xa \<and> (\<exists>a b. xa = {x. inner a x \<le> b}) \<longrightarrow> x \<in> xa" |
4797 |
then have "\<forall>a b. s \<subseteq> {x. inner a x \<le> b} \<longrightarrow> x \<in> {x. inner a x \<le> b}" |
|
4798 |
by blast |
|
4799 |
then show "x \<in> s" |
|
4800 |
apply (rule_tac ccontr) |
|
4801 |
apply (drule separating_hyperplane_closed_point[OF assms(2,1)]) |
|
4802 |
apply (erule exE)+ |
|
4803 |
apply (erule_tac x="-a" in allE) |
|
4804 |
apply (erule_tac x="-b" in allE) |
|
4805 |
apply auto |
|
4806 |
done |
|
33175 | 4807 |
qed auto |
4808 |
||
53347 | 4809 |
|
60420 | 4810 |
subsection \<open>Radon's theorem (from Lars Schewe)\<close> |
33175 | 4811 |
|
4812 |
lemma radon_ex_lemma: |
|
4813 |
assumes "finite c" "affine_dependent c" |
|
4814 |
shows "\<exists>u. setsum u c = 0 \<and> (\<exists>v\<in>c. u v \<noteq> 0) \<and> setsum (\<lambda>v. u v *\<^sub>R v) c = 0" |
|
53347 | 4815 |
proof - |
55697 | 4816 |
from assms(2)[unfolded affine_dependent_explicit] |
4817 |
obtain s u where |
|
4818 |
"finite s" "s \<subseteq> c" "setsum u s = 0" "\<exists>v\<in>s. u v \<noteq> 0" "(\<Sum>v\<in>s. u v *\<^sub>R v) = 0" |
|
4819 |
by blast |
|
53347 | 4820 |
then show ?thesis |
4821 |
apply (rule_tac x="\<lambda>v. if v\<in>s then u v else 0" in exI) |
|
57418 | 4822 |
unfolding if_smult scaleR_zero_left and setsum.inter_restrict[OF assms(1), symmetric] |
53347 | 4823 |
apply (auto simp add: Int_absorb1) |
4824 |
done |
|
4825 |
qed |
|
33175 | 4826 |
|
4827 |
lemma radon_s_lemma: |
|
53347 | 4828 |
assumes "finite s" |
4829 |
and "setsum f s = (0::real)" |
|
33175 | 4830 |
shows "setsum f {x\<in>s. 0 < f x} = - setsum f {x\<in>s. f x < 0}" |
53347 | 4831 |
proof - |
4832 |
have *: "\<And>x. (if f x < 0 then f x else 0) + (if 0 < f x then f x else 0) = f x" |
|
4833 |
by auto |
|
4834 |
show ?thesis |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61531
diff
changeset
|
4835 |
unfolding add_eq_0_iff[symmetric] and setsum.inter_filter[OF assms(1)] |
57418 | 4836 |
and setsum.distrib[symmetric] and * |
53347 | 4837 |
using assms(2) |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61531
diff
changeset
|
4838 |
by assumption |
53347 | 4839 |
qed |
33175 | 4840 |
|
4841 |
lemma radon_v_lemma: |
|
53347 | 4842 |
assumes "finite s" |
4843 |
and "setsum f s = 0" |
|
4844 |
and "\<forall>x. g x = (0::real) \<longrightarrow> f x = (0::'a::euclidean_space)" |
|
33175 | 4845 |
shows "(setsum f {x\<in>s. 0 < g x}) = - setsum f {x\<in>s. g x < 0}" |
53347 | 4846 |
proof - |
4847 |
have *: "\<And>x. (if 0 < g x then f x else 0) + (if g x < 0 then f x else 0) = f x" |
|
4848 |
using assms(3) by auto |
|
4849 |
show ?thesis |
|
57418 | 4850 |
unfolding eq_neg_iff_add_eq_0 and setsum.inter_filter[OF assms(1)] |
4851 |
and setsum.distrib[symmetric] and * |
|
53347 | 4852 |
using assms(2) |
4853 |
apply assumption |
|
4854 |
done |
|
4855 |
qed |
|
33175 | 4856 |
|
4857 |
lemma radon_partition: |
|
4858 |
assumes "finite c" "affine_dependent c" |
|
53347 | 4859 |
shows "\<exists>m p. m \<inter> p = {} \<and> m \<union> p = c \<and> (convex hull m) \<inter> (convex hull p) \<noteq> {}" |
4860 |
proof - |
|
4861 |
obtain u v where uv: "setsum u c = 0" "v\<in>c" "u v \<noteq> 0" "(\<Sum>v\<in>c. u v *\<^sub>R v) = 0" |
|
4862 |
using radon_ex_lemma[OF assms] by auto |
|
4863 |
have fin: "finite {x \<in> c. 0 < u x}" "finite {x \<in> c. 0 > u x}" |
|
4864 |
using assms(1) by auto |
|
4865 |
def z \<equiv> "inverse (setsum u {x\<in>c. u x > 0}) *\<^sub>R setsum (\<lambda>x. u x *\<^sub>R x) {x\<in>c. u x > 0}" |
|
4866 |
have "setsum u {x \<in> c. 0 < u x} \<noteq> 0" |
|
4867 |
proof (cases "u v \<ge> 0") |
|
4868 |
case False |
|
4869 |
then have "u v < 0" by auto |
|
4870 |
then show ?thesis |
|
4871 |
proof (cases "\<exists>w\<in>{x \<in> c. 0 < u x}. u w > 0") |
|
4872 |
case True |
|
4873 |
then show ?thesis |
|
4874 |
using setsum_nonneg_eq_0_iff[of _ u, OF fin(1)] by auto |
|
33175 | 4875 |
next |
53347 | 4876 |
case False |
4877 |
then have "setsum u c \<le> setsum (\<lambda>x. if x=v then u v else 0) c" |
|
4878 |
apply (rule_tac setsum_mono) |
|
4879 |
apply auto |
|
4880 |
done |
|
4881 |
then show ?thesis |
|
60420 | 4882 |
unfolding setsum.delta[OF assms(1)] using uv(2) and \<open>u v < 0\<close> and uv(1) by auto |
53347 | 4883 |
qed |
33175 | 4884 |
qed (insert setsum_nonneg_eq_0_iff[of _ u, OF fin(1)] uv(2-3), auto) |
4885 |
||
53347 | 4886 |
then have *: "setsum u {x\<in>c. u x > 0} > 0" |
4887 |
unfolding less_le |
|
4888 |
apply (rule_tac conjI) |
|
4889 |
apply (rule_tac setsum_nonneg) |
|
4890 |
apply auto |
|
4891 |
done |
|
33175 | 4892 |
moreover have "setsum u ({x \<in> c. 0 < u x} \<union> {x \<in> c. u x < 0}) = setsum u c" |
4893 |
"(\<Sum>x\<in>{x \<in> c. 0 < u x} \<union> {x \<in> c. u x < 0}. u x *\<^sub>R x) = (\<Sum>x\<in>c. u x *\<^sub>R x)" |
|
53347 | 4894 |
using assms(1) |
57418 | 4895 |
apply (rule_tac[!] setsum.mono_neutral_left) |
53347 | 4896 |
apply auto |
4897 |
done |
|
4898 |
then have "setsum u {x \<in> c. 0 < u x} = - setsum u {x \<in> c. 0 > u x}" |
|
4899 |
"(\<Sum>x\<in>{x \<in> c. 0 < u x}. u x *\<^sub>R x) = - (\<Sum>x\<in>{x \<in> c. 0 > u x}. u x *\<^sub>R x)" |
|
4900 |
unfolding eq_neg_iff_add_eq_0 |
|
4901 |
using uv(1,4) |
|
57418 | 4902 |
by (auto simp add: setsum.union_inter_neutral[OF fin, symmetric]) |
49531 | 4903 |
moreover have "\<forall>x\<in>{v \<in> c. u v < 0}. 0 \<le> inverse (setsum u {x \<in> c. 0 < u x}) * - u x" |
53347 | 4904 |
apply rule |
4905 |
apply (rule mult_nonneg_nonneg) |
|
4906 |
using * |
|
4907 |
apply auto |
|
4908 |
done |
|
4909 |
ultimately have "z \<in> convex hull {v \<in> c. u v \<le> 0}" |
|
4910 |
unfolding convex_hull_explicit mem_Collect_eq |
|
4911 |
apply (rule_tac x="{v \<in> c. u v < 0}" in exI) |
|
4912 |
apply (rule_tac x="\<lambda>y. inverse (setsum u {x\<in>c. u x > 0}) * - u y" in exI) |
|
49530 | 4913 |
using assms(1) unfolding scaleR_scaleR[symmetric] scaleR_right.setsum [symmetric] and z_def |
53347 | 4914 |
apply (auto simp add: setsum_negf setsum_right_distrib[symmetric]) |
4915 |
done |
|
49531 | 4916 |
moreover have "\<forall>x\<in>{v \<in> c. 0 < u v}. 0 \<le> inverse (setsum u {x \<in> c. 0 < u x}) * u x" |
53347 | 4917 |
apply rule |
4918 |
apply (rule mult_nonneg_nonneg) |
|
4919 |
using * |
|
4920 |
apply auto |
|
4921 |
done |
|
4922 |
then have "z \<in> convex hull {v \<in> c. u v > 0}" |
|
4923 |
unfolding convex_hull_explicit mem_Collect_eq |
|
4924 |
apply (rule_tac x="{v \<in> c. 0 < u v}" in exI) |
|
4925 |
apply (rule_tac x="\<lambda>y. inverse (setsum u {x\<in>c. u x > 0}) * u y" in exI) |
|
4926 |
using assms(1) |
|
4927 |
unfolding scaleR_scaleR[symmetric] scaleR_right.setsum [symmetric] and z_def |
|
4928 |
using * |
|
4929 |
apply (auto simp add: setsum_negf setsum_right_distrib[symmetric]) |
|
4930 |
done |
|
4931 |
ultimately show ?thesis |
|
4932 |
apply (rule_tac x="{v\<in>c. u v \<le> 0}" in exI) |
|
4933 |
apply (rule_tac x="{v\<in>c. u v > 0}" in exI) |
|
4934 |
apply auto |
|
4935 |
done |
|
4936 |
qed |
|
4937 |
||
4938 |
lemma radon: |
|
4939 |
assumes "affine_dependent c" |
|
4940 |
obtains m p where "m \<subseteq> c" "p \<subseteq> c" "m \<inter> p = {}" "(convex hull m) \<inter> (convex hull p) \<noteq> {}" |
|
4941 |
proof - |
|
55697 | 4942 |
from assms[unfolded affine_dependent_explicit] |
4943 |
obtain s u where |
|
4944 |
"finite s" "s \<subseteq> c" "setsum u s = 0" "\<exists>v\<in>s. u v \<noteq> 0" "(\<Sum>v\<in>s. u v *\<^sub>R v) = 0" |
|
4945 |
by blast |
|
53347 | 4946 |
then have *: "finite s" "affine_dependent s" and s: "s \<subseteq> c" |
4947 |
unfolding affine_dependent_explicit by auto |
|
55697 | 4948 |
from radon_partition[OF *] |
4949 |
obtain m p where "m \<inter> p = {}" "m \<union> p = s" "convex hull m \<inter> convex hull p \<noteq> {}" |
|
4950 |
by blast |
|
53347 | 4951 |
then show ?thesis |
4952 |
apply (rule_tac that[of p m]) |
|
4953 |
using s |
|
4954 |
apply auto |
|
4955 |
done |
|
4956 |
qed |
|
4957 |
||
33175 | 4958 |
|
60420 | 4959 |
subsection \<open>Helly's theorem\<close> |
33175 | 4960 |
|
53347 | 4961 |
lemma helly_induct: |
4962 |
fixes f :: "'a::euclidean_space set set" |
|
4963 |
assumes "card f = n" |
|
4964 |
and "n \<ge> DIM('a) + 1" |
|
60585 | 4965 |
and "\<forall>s\<in>f. convex s" "\<forall>t\<subseteq>f. card t = DIM('a) + 1 \<longrightarrow> \<Inter>t \<noteq> {}" |
53347 | 4966 |
shows "\<Inter>f \<noteq> {}" |
4967 |
using assms |
|
4968 |
proof (induct n arbitrary: f) |
|
4969 |
case 0 |
|
4970 |
then show ?case by auto |
|
4971 |
next |
|
4972 |
case (Suc n) |
|
4973 |
have "finite f" |
|
60420 | 4974 |
using \<open>card f = Suc n\<close> by (auto intro: card_ge_0_finite) |
53347 | 4975 |
show "\<Inter>f \<noteq> {}" |
4976 |
apply (cases "n = DIM('a)") |
|
4977 |
apply (rule Suc(5)[rule_format]) |
|
60420 | 4978 |
unfolding \<open>card f = Suc n\<close> |
53347 | 4979 |
proof - |
4980 |
assume ng: "n \<noteq> DIM('a)" |
|
4981 |
then have "\<exists>X. \<forall>s\<in>f. X s \<in> \<Inter>(f - {s})" |
|
4982 |
apply (rule_tac bchoice) |
|
4983 |
unfolding ex_in_conv |
|
4984 |
apply (rule, rule Suc(1)[rule_format]) |
|
60420 | 4985 |
unfolding card_Diff_singleton_if[OF \<open>finite f\<close>] \<open>card f = Suc n\<close> |
53347 | 4986 |
defer |
4987 |
defer |
|
4988 |
apply (rule Suc(4)[rule_format]) |
|
4989 |
defer |
|
4990 |
apply (rule Suc(5)[rule_format]) |
|
60420 | 4991 |
using Suc(3) \<open>finite f\<close> |
53347 | 4992 |
apply auto |
4993 |
done |
|
4994 |
then obtain X where X: "\<forall>s\<in>f. X s \<in> \<Inter>(f - {s})" by auto |
|
4995 |
show ?thesis |
|
4996 |
proof (cases "inj_on X f") |
|
4997 |
case False |
|
4998 |
then obtain s t where st: "s\<noteq>t" "s\<in>f" "t\<in>f" "X s = X t" |
|
4999 |
unfolding inj_on_def by auto |
|
5000 |
then have *: "\<Inter>f = \<Inter>(f - {s}) \<inter> \<Inter>(f - {t})" by auto |
|
5001 |
show ?thesis |
|
5002 |
unfolding * |
|
5003 |
unfolding ex_in_conv[symmetric] |
|
5004 |
apply (rule_tac x="X s" in exI) |
|
5005 |
apply rule |
|
5006 |
apply (rule X[rule_format]) |
|
5007 |
using X st |
|
5008 |
apply auto |
|
5009 |
done |
|
5010 |
next |
|
5011 |
case True |
|
5012 |
then obtain m p where mp: "m \<inter> p = {}" "m \<union> p = X ` f" "convex hull m \<inter> convex hull p \<noteq> {}" |
|
5013 |
using radon_partition[of "X ` f"] and affine_dependent_biggerset[of "X ` f"] |
|
60420 | 5014 |
unfolding card_image[OF True] and \<open>card f = Suc n\<close> |
5015 |
using Suc(3) \<open>finite f\<close> and ng |
|
53347 | 5016 |
by auto |
5017 |
have "m \<subseteq> X ` f" "p \<subseteq> X ` f" |
|
5018 |
using mp(2) by auto |
|
5019 |
then obtain g h where gh:"m = X ` g" "p = X ` h" "g \<subseteq> f" "h \<subseteq> f" |
|
5020 |
unfolding subset_image_iff by auto |
|
5021 |
then have "f \<union> (g \<union> h) = f" by auto |
|
5022 |
then have f: "f = g \<union> h" |
|
5023 |
using inj_on_Un_image_eq_iff[of X f "g \<union> h"] and True |
|
5024 |
unfolding mp(2)[unfolded image_Un[symmetric] gh] |
|
5025 |
by auto |
|
5026 |
have *: "g \<inter> h = {}" |
|
5027 |
using mp(1) |
|
5028 |
unfolding gh |
|
5029 |
using inj_on_image_Int[OF True gh(3,4)] |
|
5030 |
by auto |
|
5031 |
have "convex hull (X ` h) \<subseteq> \<Inter>g" "convex hull (X ` g) \<subseteq> \<Inter>h" |
|
5032 |
apply (rule_tac [!] hull_minimal) |
|
5033 |
using Suc gh(3-4) |
|
5034 |
unfolding subset_eq |
|
5035 |
apply (rule_tac [2] convex_Inter, rule_tac [4] convex_Inter) |
|
5036 |
apply rule |
|
5037 |
prefer 3 |
|
5038 |
apply rule |
|
5039 |
proof - |
|
5040 |
fix x |
|
5041 |
assume "x \<in> X ` g" |
|
55697 | 5042 |
then obtain y where "y \<in> g" "x = X y" |
5043 |
unfolding image_iff .. |
|
53347 | 5044 |
then show "x \<in> \<Inter>h" |
5045 |
using X[THEN bspec[where x=y]] using * f by auto |
|
5046 |
next |
|
5047 |
fix x |
|
5048 |
assume "x \<in> X ` h" |
|
55697 | 5049 |
then obtain y where "y \<in> h" "x = X y" |
5050 |
unfolding image_iff .. |
|
53347 | 5051 |
then show "x \<in> \<Inter>g" |
5052 |
using X[THEN bspec[where x=y]] using * f by auto |
|
5053 |
qed auto |
|
5054 |
then show ?thesis |
|
5055 |
unfolding f using mp(3)[unfolded gh] by blast |
|
5056 |
qed |
|
5057 |
qed auto |
|
5058 |
qed |
|
5059 |
||
5060 |
lemma helly: |
|
5061 |
fixes f :: "'a::euclidean_space set set" |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
5062 |
assumes "card f \<ge> DIM('a) + 1" "\<forall>s\<in>f. convex s" |
60585 | 5063 |
and "\<forall>t\<subseteq>f. card t = DIM('a) + 1 \<longrightarrow> \<Inter>t \<noteq> {}" |
53347 | 5064 |
shows "\<Inter>f \<noteq> {}" |
5065 |
apply (rule helly_induct) |
|
5066 |
using assms |
|
5067 |
apply auto |
|
5068 |
done |
|
5069 |
||
33175 | 5070 |
|
60420 | 5071 |
subsection \<open>Homeomorphism of all convex compact sets with nonempty interior\<close> |
33175 | 5072 |
|
5073 |
lemma compact_frontier_line_lemma: |
|
53347 | 5074 |
fixes s :: "'a::euclidean_space set" |
5075 |
assumes "compact s" |
|
5076 |
and "0 \<in> s" |
|
5077 |
and "x \<noteq> 0" |
|
5078 |
obtains u where "0 \<le> u" and "(u *\<^sub>R x) \<in> frontier s" "\<forall>v>u. (v *\<^sub>R x) \<notin> s" |
|
5079 |
proof - |
|
5080 |
obtain b where b: "b > 0" "\<forall>x\<in>s. norm x \<le> b" |
|
5081 |
using compact_imp_bounded[OF assms(1), unfolded bounded_pos] by auto |
|
33175 | 5082 |
let ?A = "{y. \<exists>u. 0 \<le> u \<and> u \<le> b / norm(x) \<and> (y = u *\<^sub>R x)}" |
53347 | 5083 |
have A: "?A = (\<lambda>u. u *\<^sub>R x) ` {0 .. b / norm x}" |
36431
340755027840
move definitions and theorems for type real^1 to separate theory file
huffman
parents:
36365
diff
changeset
|
5084 |
by auto |
53347 | 5085 |
have *: "\<And>x A B. x\<in>A \<Longrightarrow> x\<in>B \<Longrightarrow> A\<inter>B \<noteq> {}" by blast |
5086 |
have "compact ?A" |
|
5087 |
unfolding A |
|
5088 |
apply (rule compact_continuous_image) |
|
5089 |
apply (rule continuous_at_imp_continuous_on) |
|
5090 |
apply rule |
|
5091 |
apply (intro continuous_intros) |
|
56188 | 5092 |
apply (rule compact_Icc) |
53347 | 5093 |
done |
5094 |
moreover have "{y. \<exists>u\<ge>0. u \<le> b / norm x \<and> y = u *\<^sub>R x} \<inter> s \<noteq> {}" |
|
5095 |
apply(rule *[OF _ assms(2)]) |
|
5096 |
unfolding mem_Collect_eq |
|
60420 | 5097 |
using \<open>b > 0\<close> assms(3) |
56571
f4635657d66f
added divide_nonneg_nonneg and co; made it a simp rule
hoelzl
parents:
56544
diff
changeset
|
5098 |
apply auto |
53347 | 5099 |
done |
33175 | 5100 |
ultimately obtain u y where obt: "u\<ge>0" "u \<le> b / norm x" "y = u *\<^sub>R x" |
53347 | 5101 |
"y \<in> ?A" "y \<in> s" "\<forall>z\<in>?A \<inter> s. dist 0 z \<le> dist 0 y" |
5102 |
using distance_attains_sup[OF compact_inter[OF _ assms(1), of ?A], of 0] |
|
5103 |
by auto |
|
5104 |
||
5105 |
have "norm x > 0" |
|
5106 |
using assms(3)[unfolded zero_less_norm_iff[symmetric]] by auto |
|
5107 |
{ |
|
5108 |
fix v |
|
5109 |
assume as: "v > u" "v *\<^sub>R x \<in> s" |
|
5110 |
then have "v \<le> b / norm x" |
|
5111 |
using b(2)[rule_format, OF as(2)] |
|
60420 | 5112 |
using \<open>u\<ge>0\<close> |
5113 |
unfolding pos_le_divide_eq[OF \<open>norm x > 0\<close>] |
|
53347 | 5114 |
by auto |
5115 |
then have "norm (v *\<^sub>R x) \<le> norm y" |
|
5116 |
apply (rule_tac obt(6)[rule_format, unfolded dist_0_norm]) |
|
5117 |
apply (rule IntI) |
|
5118 |
defer |
|
5119 |
apply (rule as(2)) |
|
5120 |
unfolding mem_Collect_eq |
|
5121 |
apply (rule_tac x=v in exI) |
|
60420 | 5122 |
using as(1) \<open>u\<ge>0\<close> |
53347 | 5123 |
apply (auto simp add: field_simps) |
5124 |
done |
|
5125 |
then have False |
|
60420 | 5126 |
unfolding obt(3) using \<open>u\<ge>0\<close> \<open>norm x > 0\<close> \<open>v > u\<close> |
53347 | 5127 |
by (auto simp add:field_simps) |
33175 | 5128 |
} note u_max = this |
5129 |
||
53347 | 5130 |
have "u *\<^sub>R x \<in> frontier s" |
5131 |
unfolding frontier_straddle |
|
5132 |
apply (rule,rule,rule) |
|
5133 |
apply (rule_tac x="u *\<^sub>R x" in bexI) |
|
5134 |
unfolding obt(3)[symmetric] |
|
5135 |
prefer 3 |
|
5136 |
apply (rule_tac x="(u + (e / 2) / norm x) *\<^sub>R x" in exI) |
|
5137 |
apply (rule, rule) |
|
5138 |
proof - |
|
5139 |
fix e |
|
5140 |
assume "e > 0" and as: "(u + e / 2 / norm x) *\<^sub>R x \<in> s" |
|
5141 |
then have "u + e / 2 / norm x > u" |
|
60420 | 5142 |
using \<open>norm x > 0\<close> by (auto simp del:zero_less_norm_iff) |
53347 | 5143 |
then show False using u_max[OF _ as] by auto |
60420 | 5144 |
qed (insert \<open>y\<in>s\<close>, auto simp add: dist_norm scaleR_left_distrib obt(3)) |
53347 | 5145 |
then show ?thesis by(metis that[of u] u_max obt(1)) |
36071 | 5146 |
qed |
33175 | 5147 |
|
5148 |
lemma starlike_compact_projective: |
|
53347 | 5149 |
assumes "compact s" |
5150 |
and "cball (0::'a::euclidean_space) 1 \<subseteq> s " |
|
5151 |
and "\<forall>x\<in>s. \<forall>u. 0 \<le> u \<and> u < 1 \<longrightarrow> u *\<^sub>R x \<in> s - frontier s" |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
5152 |
shows "s homeomorphic (cball (0::'a::euclidean_space) 1)" |
53347 | 5153 |
proof - |
5154 |
have fs: "frontier s \<subseteq> s" |
|
5155 |
apply (rule frontier_subset_closed) |
|
5156 |
using compact_imp_closed[OF assms(1)] |
|
5157 |
apply simp |
|
5158 |
done |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
5159 |
def pi \<equiv> "\<lambda>x::'a. inverse (norm x) *\<^sub>R x" |
53347 | 5160 |
have "0 \<notin> frontier s" |
5161 |
unfolding frontier_straddle |
|
5162 |
apply (rule notI) |
|
5163 |
apply (erule_tac x=1 in allE) |
|
5164 |
using assms(2)[unfolded subset_eq Ball_def mem_cball] |
|
5165 |
apply auto |
|
5166 |
done |
|
5167 |
have injpi: "\<And>x y. pi x = pi y \<and> norm x = norm y \<longleftrightarrow> x = y" |
|
5168 |
unfolding pi_def by auto |
|
5169 |
||
5170 |
have contpi: "continuous_on (UNIV - {0}) pi" |
|
5171 |
apply (rule continuous_at_imp_continuous_on) |
|
33175 | 5172 |
apply rule unfolding pi_def |
44647
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44629
diff
changeset
|
5173 |
apply (intro continuous_intros) |
33175 | 5174 |
apply simp |
5175 |
done |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
5176 |
def sphere \<equiv> "{x::'a. norm x = 1}" |
53347 | 5177 |
have pi: "\<And>x. x \<noteq> 0 \<Longrightarrow> pi x \<in> sphere" "\<And>x u. u>0 \<Longrightarrow> pi (u *\<^sub>R x) = pi x" |
5178 |
unfolding pi_def sphere_def by auto |
|
5179 |
||
5180 |
have "0 \<in> s" |
|
5181 |
using assms(2) and centre_in_cball[of 0 1] by auto |
|
5182 |
have front_smul: "\<forall>x\<in>frontier s. \<forall>u\<ge>0. u *\<^sub>R x \<in> s \<longleftrightarrow> u \<le> 1" |
|
5183 |
proof (rule,rule,rule) |
|
5184 |
fix x and u :: real |
|
5185 |
assume x: "x \<in> frontier s" and "0 \<le> u" |
|
5186 |
then have "x \<noteq> 0" |
|
60420 | 5187 |
using \<open>0 \<notin> frontier s\<close> by auto |
53347 | 5188 |
obtain v where v: "0 \<le> v" "v *\<^sub>R x \<in> frontier s" "\<forall>w>v. w *\<^sub>R x \<notin> s" |
60420 | 5189 |
using compact_frontier_line_lemma[OF assms(1) \<open>0\<in>s\<close> \<open>x\<noteq>0\<close>] by auto |
53347 | 5190 |
have "v = 1" |
5191 |
apply (rule ccontr) |
|
5192 |
unfolding neq_iff |
|
5193 |
apply (erule disjE) |
|
5194 |
proof - |
|
5195 |
assume "v < 1" |
|
5196 |
then show False |
|
5197 |
using v(3)[THEN spec[where x=1]] using x and fs by auto |
|
5198 |
next |
|
5199 |
assume "v > 1" |
|
5200 |
then show False |
|
5201 |
using assms(3)[THEN bspec[where x="v *\<^sub>R x"], THEN spec[where x="inverse v"]] |
|
5202 |
using v and x and fs |
|
5203 |
unfolding inverse_less_1_iff by auto |
|
5204 |
qed |
|
5205 |
show "u *\<^sub>R x \<in> s \<longleftrightarrow> u \<le> 1" |
|
5206 |
apply rule |
|
60420 | 5207 |
using v(3)[unfolded \<open>v=1\<close>, THEN spec[where x=u]] |
53347 | 5208 |
proof - |
5209 |
assume "u \<le> 1" |
|
5210 |
then show "u *\<^sub>R x \<in> s" |
|
5211 |
apply (cases "u = 1") |
|
5212 |
using assms(3)[THEN bspec[where x=x], THEN spec[where x=u]] |
|
60420 | 5213 |
using \<open>0\<le>u\<close> and x and fs |
53347 | 5214 |
apply auto |
5215 |
done |
|
5216 |
qed auto |
|
5217 |
qed |
|
33175 | 5218 |
|
5219 |
have "\<exists>surf. homeomorphism (frontier s) sphere pi surf" |
|
53347 | 5220 |
apply (rule homeomorphism_compact) |
5221 |
apply (rule compact_frontier[OF assms(1)]) |
|
5222 |
apply (rule continuous_on_subset[OF contpi]) |
|
5223 |
defer |
|
5224 |
apply (rule set_eqI) |
|
5225 |
apply rule |
|
5226 |
unfolding inj_on_def |
|
5227 |
prefer 3 |
|
5228 |
apply(rule,rule,rule) |
|
5229 |
proof - |
|
5230 |
fix x |
|
5231 |
assume "x \<in> pi ` frontier s" |
|
5232 |
then obtain y where "y \<in> frontier s" "x = pi y" by auto |
|
5233 |
then show "x \<in> sphere" |
|
60420 | 5234 |
using pi(1)[of y] and \<open>0 \<notin> frontier s\<close> by auto |
53347 | 5235 |
next |
5236 |
fix x |
|
5237 |
assume "x \<in> sphere" |
|
5238 |
then have "norm x = 1" "x \<noteq> 0" |
|
5239 |
unfolding sphere_def by auto |
|
33175 | 5240 |
then obtain u where "0 \<le> u" "u *\<^sub>R x \<in> frontier s" "\<forall>v>u. v *\<^sub>R x \<notin> s" |
60420 | 5241 |
using compact_frontier_line_lemma[OF assms(1) \<open>0\<in>s\<close>, of x] by auto |
53347 | 5242 |
then show "x \<in> pi ` frontier s" |
5243 |
unfolding image_iff le_less pi_def |
|
5244 |
apply (rule_tac x="u *\<^sub>R x" in bexI) |
|
60420 | 5245 |
using \<open>norm x = 1\<close> \<open>0 \<notin> frontier s\<close> |
53347 | 5246 |
apply auto |
5247 |
done |
|
5248 |
next |
|
5249 |
fix x y |
|
5250 |
assume as: "x \<in> frontier s" "y \<in> frontier s" "pi x = pi y" |
|
53348 | 5251 |
then have xys: "x \<in> s" "y \<in> s" |
53347 | 5252 |
using fs by auto |
53348 | 5253 |
from as(1,2) have nor: "norm x \<noteq> 0" "norm y \<noteq> 0" |
60420 | 5254 |
using \<open>0\<notin>frontier s\<close> by auto |
53348 | 5255 |
from nor have x: "x = norm x *\<^sub>R ((inverse (norm y)) *\<^sub>R y)" |
5256 |
unfolding as(3)[unfolded pi_def, symmetric] by auto |
|
5257 |
from nor have y: "y = norm y *\<^sub>R ((inverse (norm x)) *\<^sub>R x)" |
|
5258 |
unfolding as(3)[unfolded pi_def] by auto |
|
5259 |
have "0 \<le> norm y * inverse (norm x)" and "0 \<le> norm x * inverse (norm y)" |
|
53347 | 5260 |
using nor |
5261 |
apply auto |
|
5262 |
done |
|
5263 |
then have "norm x = norm y" |
|
5264 |
apply - |
|
5265 |
apply (rule ccontr) |
|
5266 |
unfolding neq_iff |
|
33175 | 5267 |
using x y and front_smul[THEN bspec, OF as(1), THEN spec[where x="norm y * (inverse (norm x))"]] |
5268 |
using front_smul[THEN bspec, OF as(2), THEN spec[where x="norm x * (inverse (norm y))"]] |
|
53347 | 5269 |
using xys nor |
56571
f4635657d66f
added divide_nonneg_nonneg and co; made it a simp rule
hoelzl
parents:
56544
diff
changeset
|
5270 |
apply (auto simp add: field_simps) |
53347 | 5271 |
done |
5272 |
then show "x = y" |
|
5273 |
apply (subst injpi[symmetric]) |
|
5274 |
using as(3) |
|
5275 |
apply auto |
|
5276 |
done |
|
60420 | 5277 |
qed (insert \<open>0 \<notin> frontier s\<close>, auto) |
53347 | 5278 |
then obtain surf where |
5279 |
surf: "\<forall>x\<in>frontier s. surf (pi x) = x" "pi ` frontier s = sphere" "continuous_on (frontier s) pi" |
|
5280 |
"\<forall>y\<in>sphere. pi (surf y) = y" "surf ` sphere = frontier s" "continuous_on sphere surf" |
|
5281 |
unfolding homeomorphism_def by auto |
|
5282 |
||
5283 |
have cont_surfpi: "continuous_on (UNIV - {0}) (surf \<circ> pi)" |
|
5284 |
apply (rule continuous_on_compose) |
|
5285 |
apply (rule contpi) |
|
5286 |
apply (rule continuous_on_subset[of sphere]) |
|
5287 |
apply (rule surf(6)) |
|
5288 |
using pi(1) |
|
5289 |
apply auto |
|
5290 |
done |
|
5291 |
||
5292 |
{ |
|
5293 |
fix x |
|
5294 |
assume as: "x \<in> cball (0::'a) 1" |
|
5295 |
have "norm x *\<^sub>R surf (pi x) \<in> s" |
|
5296 |
proof (cases "x=0 \<or> norm x = 1") |
|
5297 |
case False |
|
5298 |
then have "pi x \<in> sphere" "norm x < 1" |
|
5299 |
using pi(1)[of x] as by(auto simp add: dist_norm) |
|
5300 |
then show ?thesis |
|
5301 |
apply (rule_tac assms(3)[rule_format, THEN DiffD1]) |
|
5302 |
apply (rule_tac fs[unfolded subset_eq, rule_format]) |
|
5303 |
unfolding surf(5)[symmetric] |
|
5304 |
apply auto |
|
5305 |
done |
|
5306 |
next |
|
5307 |
case True |
|
5308 |
then show ?thesis |
|
5309 |
apply rule |
|
5310 |
defer |
|
5311 |
unfolding pi_def |
|
5312 |
apply (rule fs[unfolded subset_eq, rule_format]) |
|
5313 |
unfolding surf(5)[unfolded sphere_def, symmetric] |
|
60420 | 5314 |
using \<open>0\<in>s\<close> |
53347 | 5315 |
apply auto |
5316 |
done |
|
5317 |
qed |
|
5318 |
} note hom = this |
|
5319 |
||
5320 |
{ |
|
5321 |
fix x |
|
5322 |
assume "x \<in> s" |
|
5323 |
then have "x \<in> (\<lambda>x. norm x *\<^sub>R surf (pi x)) ` cball 0 1" |
|
5324 |
proof (cases "x = 0") |
|
5325 |
case True |
|
5326 |
show ?thesis |
|
5327 |
unfolding image_iff True |
|
5328 |
apply (rule_tac x=0 in bexI) |
|
5329 |
apply auto |
|
5330 |
done |
|
5331 |
next |
|
5332 |
let ?a = "inverse (norm (surf (pi x)))" |
|
5333 |
case False |
|
5334 |
then have invn: "inverse (norm x) \<noteq> 0" by auto |
|
5335 |
from False have pix: "pi x\<in>sphere" using pi(1) by auto |
|
5336 |
then have "pi (surf (pi x)) = pi x" |
|
5337 |
apply (rule_tac surf(4)[rule_format]) |
|
5338 |
apply assumption |
|
5339 |
done |
|
5340 |
then have **: "norm x *\<^sub>R (?a *\<^sub>R surf (pi x)) = x" |
|
5341 |
apply (rule_tac scaleR_left_imp_eq[OF invn]) |
|
5342 |
unfolding pi_def |
|
5343 |
using invn |
|
5344 |
apply auto |
|
5345 |
done |
|
5346 |
then have *: "?a * norm x > 0" and "?a > 0" "?a \<noteq> 0" |
|
60420 | 5347 |
using surf(5) \<open>0\<notin>frontier s\<close> |
53347 | 5348 |
apply - |
5349 |
apply (rule mult_pos_pos) |
|
5350 |
using False[unfolded zero_less_norm_iff[symmetric]] |
|
5351 |
apply auto |
|
5352 |
done |
|
5353 |
have "norm (surf (pi x)) \<noteq> 0" |
|
5354 |
using ** False by auto |
|
5355 |
then have "norm x = norm ((?a * norm x) *\<^sub>R surf (pi x))" |
|
60420 | 5356 |
unfolding norm_scaleR abs_mult abs_norm_cancel abs_of_pos[OF \<open>?a > 0\<close>] by auto |
49531 | 5357 |
moreover have "pi x = pi ((inverse (norm (surf (pi x))) * norm x) *\<^sub>R surf (pi x))" |
33175 | 5358 |
unfolding pi(2)[OF *] surf(4)[rule_format, OF pix] .. |
53347 | 5359 |
moreover have "surf (pi x) \<in> frontier s" |
5360 |
using surf(5) pix by auto |
|
5361 |
then have "dist 0 (inverse (norm (surf (pi x))) *\<^sub>R x) \<le> 1" |
|
5362 |
unfolding dist_norm |
|
5363 |
using ** and * |
|
5364 |
using front_smul[THEN bspec[where x="surf (pi x)"], THEN spec[where x="norm x * ?a"]] |
|
60420 | 5365 |
using False \<open>x\<in>s\<close> |
53347 | 5366 |
by (auto simp add: field_simps) |
5367 |
ultimately show ?thesis |
|
5368 |
unfolding image_iff |
|
5369 |
apply (rule_tac x="inverse (norm (surf(pi x))) *\<^sub>R x" in bexI) |
|
5370 |
apply (subst injpi[symmetric]) |
|
60420 | 5371 |
unfolding abs_mult abs_norm_cancel abs_of_pos[OF \<open>?a > 0\<close>] |
5372 |
unfolding pi(2)[OF \<open>?a > 0\<close>] |
|
53347 | 5373 |
apply auto |
5374 |
done |
|
5375 |
qed |
|
5376 |
} note hom2 = this |
|
5377 |
||
5378 |
show ?thesis |
|
5379 |
apply (subst homeomorphic_sym) |
|
5380 |
apply (rule homeomorphic_compact[where f="\<lambda>x. norm x *\<^sub>R surf (pi x)"]) |
|
5381 |
apply (rule compact_cball) |
|
5382 |
defer |
|
5383 |
apply (rule set_eqI) |
|
5384 |
apply rule |
|
5385 |
apply (erule imageE) |
|
5386 |
apply (drule hom) |
|
5387 |
prefer 4 |
|
5388 |
apply (rule continuous_at_imp_continuous_on) |
|
5389 |
apply rule |
|
5390 |
apply (rule_tac [3] hom2) |
|
5391 |
proof - |
|
5392 |
fix x :: 'a |
|
5393 |
assume as: "x \<in> cball 0 1" |
|
5394 |
then show "continuous (at x) (\<lambda>x. norm x *\<^sub>R surf (pi x))" |
|
5395 |
proof (cases "x = 0") |
|
5396 |
case False |
|
5397 |
then show ?thesis |
|
5398 |
apply (intro continuous_intros) |
|
5399 |
using cont_surfpi |
|
5400 |
unfolding continuous_on_eq_continuous_at[OF open_delete[OF open_UNIV]] o_def |
|
5401 |
apply auto |
|
5402 |
done |
|
5403 |
next |
|
5404 |
case True |
|
5405 |
obtain B where B: "\<forall>x\<in>s. norm x \<le> B" |
|
5406 |
using compact_imp_bounded[OF assms(1)] unfolding bounded_iff by auto |
|
5407 |
then have "B > 0" |
|
5408 |
using assms(2) |
|
5409 |
unfolding subset_eq |
|
5410 |
apply (erule_tac x="SOME i. i\<in>Basis" in ballE) |
|
5411 |
defer |
|
5412 |
apply (erule_tac x="SOME i. i\<in>Basis" in ballE) |
|
5413 |
unfolding Ball_def mem_cball dist_norm |
|
5414 |
using DIM_positive[where 'a='a] |
|
5415 |
apply (auto simp: SOME_Basis) |
|
5416 |
done |
|
5417 |
show ?thesis |
|
5418 |
unfolding True continuous_at Lim_at |
|
5419 |
apply(rule,rule) |
|
5420 |
apply(rule_tac x="e / B" in exI) |
|
5421 |
apply rule |
|
5422 |
apply (rule divide_pos_pos) |
|
5423 |
prefer 3 |
|
5424 |
apply(rule,rule,erule conjE) |
|
5425 |
unfolding norm_zero scaleR_zero_left dist_norm diff_0_right norm_scaleR abs_norm_cancel |
|
5426 |
proof - |
|
5427 |
fix e and x :: 'a |
|
5428 |
assume as: "norm x < e / B" "0 < norm x" "e > 0" |
|
5429 |
then have "surf (pi x) \<in> frontier s" |
|
5430 |
using pi(1)[of x] unfolding surf(5)[symmetric] by auto |
|
5431 |
then have "norm (surf (pi x)) \<le> B" |
|
5432 |
using B fs by auto |
|
5433 |
then have "norm x * norm (surf (pi x)) \<le> norm x * B" |
|
5434 |
using as(2) by auto |
|
5435 |
also have "\<dots> < e / B * B" |
|
5436 |
apply (rule mult_strict_right_mono) |
|
60420 | 5437 |
using as(1) \<open>B>0\<close> |
53347 | 5438 |
apply auto |
5439 |
done |
|
60420 | 5440 |
also have "\<dots> = e" using \<open>B > 0\<close> by auto |
53347 | 5441 |
finally show "norm x * norm (surf (pi x)) < e" . |
60420 | 5442 |
qed (insert \<open>B>0\<close>, auto) |
53347 | 5443 |
qed |
5444 |
next |
|
5445 |
{ |
|
5446 |
fix x |
|
5447 |
assume as: "surf (pi x) = 0" |
|
5448 |
have "x = 0" |
|
5449 |
proof (rule ccontr) |
|
5450 |
assume "x \<noteq> 0" |
|
5451 |
then have "pi x \<in> sphere" |
|
5452 |
using pi(1) by auto |
|
5453 |
then have "surf (pi x) \<in> frontier s" |
|
5454 |
using surf(5) by auto |
|
5455 |
then show False |
|
60420 | 5456 |
using \<open>0\<notin>frontier s\<close> unfolding as by simp |
53347 | 5457 |
qed |
33175 | 5458 |
} note surf_0 = this |
53347 | 5459 |
show "inj_on (\<lambda>x. norm x *\<^sub>R surf (pi x)) (cball 0 1)" |
5460 |
unfolding inj_on_def |
|
5461 |
proof (rule,rule,rule) |
|
5462 |
fix x y |
|
5463 |
assume as: "x \<in> cball 0 1" "y \<in> cball 0 1" "norm x *\<^sub>R surf (pi x) = norm y *\<^sub>R surf (pi y)" |
|
5464 |
then show "x = y" |
|
5465 |
proof (cases "x=0 \<or> y=0") |
|
5466 |
case True |
|
5467 |
then show ?thesis |
|
5468 |
using as by (auto elim: surf_0) |
|
5469 |
next |
|
33175 | 5470 |
case False |
53347 | 5471 |
then have "pi (surf (pi x)) = pi (surf (pi y))" |
5472 |
using as(3) |
|
5473 |
using pi(2)[of "norm x" "surf (pi x)"] pi(2)[of "norm y" "surf (pi y)"] |
|
5474 |
by auto |
|
5475 |
moreover have "pi x \<in> sphere" "pi y \<in> sphere" |
|
5476 |
using pi(1) False by auto |
|
5477 |
ultimately have *: "pi x = pi y" |
|
5478 |
using surf(4)[THEN bspec[where x="pi x"]] surf(4)[THEN bspec[where x="pi y"]] |
|
5479 |
by auto |
|
5480 |
moreover have "norm x = norm y" |
|
5481 |
using as(3)[unfolded *] using False |
|
5482 |
by (auto dest:surf_0) |
|
5483 |
ultimately show ?thesis |
|
5484 |
using injpi by auto |
|
5485 |
qed |
|
5486 |
qed |
|
5487 |
qed auto |
|
5488 |
qed |
|
33175 | 5489 |
|
44519 | 5490 |
lemma homeomorphic_convex_compact_lemma: |
53347 | 5491 |
fixes s :: "'a::euclidean_space set" |
5492 |
assumes "convex s" |
|
5493 |
and "compact s" |
|
5494 |
and "cball 0 1 \<subseteq> s" |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
5495 |
shows "s homeomorphic (cball (0::'a) 1)" |
44519 | 5496 |
proof (rule starlike_compact_projective[OF assms(2-3)], clarify) |
53347 | 5497 |
fix x u |
5498 |
assume "x \<in> s" and "0 \<le> u" and "u < (1::real)" |
|
5499 |
have "open (ball (u *\<^sub>R x) (1 - u))" |
|
5500 |
by (rule open_ball) |
|
44519 | 5501 |
moreover have "u *\<^sub>R x \<in> ball (u *\<^sub>R x) (1 - u)" |
60420 | 5502 |
unfolding centre_in_ball using \<open>u < 1\<close> by simp |
44519 | 5503 |
moreover have "ball (u *\<^sub>R x) (1 - u) \<subseteq> s" |
5504 |
proof |
|
53347 | 5505 |
fix y |
5506 |
assume "y \<in> ball (u *\<^sub>R x) (1 - u)" |
|
5507 |
then have "dist (u *\<^sub>R x) y < 1 - u" |
|
5508 |
unfolding mem_ball . |
|
60420 | 5509 |
with \<open>u < 1\<close> have "inverse (1 - u) *\<^sub>R (y - u *\<^sub>R x) \<in> cball 0 1" |
44519 | 5510 |
by (simp add: dist_norm inverse_eq_divide norm_minus_commute) |
5511 |
with assms(3) have "inverse (1 - u) *\<^sub>R (y - u *\<^sub>R x) \<in> s" .. |
|
5512 |
with assms(1) have "(1 - u) *\<^sub>R ((y - u *\<^sub>R x) /\<^sub>R (1 - u)) + u *\<^sub>R x \<in> s" |
|
61426
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61222
diff
changeset
|
5513 |
using \<open>x \<in> s\<close> \<open>0 \<le> u\<close> \<open>u < 1\<close> [THEN less_imp_le] by (rule convexD_alt) |
60420 | 5514 |
then show "y \<in> s" using \<open>u < 1\<close> |
53347 | 5515 |
by simp |
44519 | 5516 |
qed |
5517 |
ultimately have "u *\<^sub>R x \<in> interior s" .. |
|
53347 | 5518 |
then show "u *\<^sub>R x \<in> s - frontier s" |
5519 |
using frontier_def and interior_subset by auto |
|
5520 |
qed |
|
33175 | 5521 |
|
53348 | 5522 |
lemma homeomorphic_convex_compact_cball: |
5523 |
fixes e :: real |
|
5524 |
and s :: "'a::euclidean_space set" |
|
5525 |
assumes "convex s" |
|
5526 |
and "compact s" |
|
5527 |
and "interior s \<noteq> {}" |
|
5528 |
and "e > 0" |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
5529 |
shows "s homeomorphic (cball (b::'a) e)" |
53348 | 5530 |
proof - |
5531 |
obtain a where "a \<in> interior s" |
|
5532 |
using assms(3) by auto |
|
5533 |
then obtain d where "d > 0" and d: "cball a d \<subseteq> s" |
|
5534 |
unfolding mem_interior_cball by auto |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
5535 |
let ?d = "inverse d" and ?n = "0::'a" |
33175 | 5536 |
have "cball ?n 1 \<subseteq> (\<lambda>x. inverse d *\<^sub>R (x - a)) ` s" |
53348 | 5537 |
apply rule |
5538 |
apply (rule_tac x="d *\<^sub>R x + a" in image_eqI) |
|
5539 |
defer |
|
5540 |
apply (rule d[unfolded subset_eq, rule_format]) |
|
60420 | 5541 |
using \<open>d > 0\<close> |
53348 | 5542 |
unfolding mem_cball dist_norm |
5543 |
apply (auto simp add: mult_right_le_one_le) |
|
5544 |
done |
|
5545 |
then have "(\<lambda>x. inverse d *\<^sub>R (x - a)) ` s homeomorphic cball ?n 1" |
|
5546 |
using homeomorphic_convex_compact_lemma[of "(\<lambda>x. ?d *\<^sub>R -a + ?d *\<^sub>R x) ` s", |
|
5547 |
OF convex_affinity compact_affinity] |
|
5548 |
using assms(1,2) |
|
57865 | 5549 |
by (auto simp add: scaleR_right_diff_distrib) |
53348 | 5550 |
then show ?thesis |
5551 |
apply (rule_tac homeomorphic_trans[OF _ homeomorphic_balls(2)[of 1 _ ?n]]) |
|
5552 |
apply (rule homeomorphic_trans[OF homeomorphic_affinity[of "?d" s "?d *\<^sub>R -a"]]) |
|
60420 | 5553 |
using \<open>d>0\<close> \<open>e>0\<close> |
57865 | 5554 |
apply (auto simp add: scaleR_right_diff_distrib) |
53348 | 5555 |
done |
5556 |
qed |
|
5557 |
||
5558 |
lemma homeomorphic_convex_compact: |
|
5559 |
fixes s :: "'a::euclidean_space set" |
|
5560 |
and t :: "'a set" |
|
33175 | 5561 |
assumes "convex s" "compact s" "interior s \<noteq> {}" |
53348 | 5562 |
and "convex t" "compact t" "interior t \<noteq> {}" |
33175 | 5563 |
shows "s homeomorphic t" |
53348 | 5564 |
using assms |
5565 |
by (meson zero_less_one homeomorphic_trans homeomorphic_convex_compact_cball homeomorphic_sym) |
|
5566 |
||
33175 | 5567 |
|
60420 | 5568 |
subsection \<open>Epigraphs of convex functions\<close> |
33175 | 5569 |
|
53348 | 5570 |
definition "epigraph s (f :: _ \<Rightarrow> real) = {xy. fst xy \<in> s \<and> f (fst xy) \<le> snd xy}" |
5571 |
||
5572 |
lemma mem_epigraph: "(x, y) \<in> epigraph s f \<longleftrightarrow> x \<in> s \<and> f x \<le> y" |
|
5573 |
unfolding epigraph_def by auto |
|
5574 |
||
5575 |
lemma convex_epigraph: "convex (epigraph s f) \<longleftrightarrow> convex_on s f \<and> convex s" |
|
36338 | 5576 |
unfolding convex_def convex_on_def |
5577 |
unfolding Ball_def split_paired_All epigraph_def |
|
5578 |
unfolding mem_Collect_eq fst_conv snd_conv fst_add snd_add fst_scaleR snd_scaleR Ball_def[symmetric] |
|
53348 | 5579 |
apply safe |
5580 |
defer |
|
5581 |
apply (erule_tac x=x in allE) |
|
5582 |
apply (erule_tac x="f x" in allE) |
|
5583 |
apply safe |
|
5584 |
apply (erule_tac x=xa in allE) |
|
5585 |
apply (erule_tac x="f xa" in allE) |
|
5586 |
prefer 3 |
|
5587 |
apply (rule_tac y="u * f a + v * f aa" in order_trans) |
|
5588 |
defer |
|
5589 |
apply (auto intro!:mult_left_mono add_mono) |
|
5590 |
done |
|
5591 |
||
5592 |
lemma convex_epigraphI: "convex_on s f \<Longrightarrow> convex s \<Longrightarrow> convex (epigraph s f)" |
|
5593 |
unfolding convex_epigraph by auto |
|
5594 |
||
5595 |
lemma convex_epigraph_convex: "convex s \<Longrightarrow> convex_on s f \<longleftrightarrow> convex(epigraph s f)" |
|
5596 |
by (simp add: convex_epigraph) |
|
5597 |
||
33175 | 5598 |
|
60420 | 5599 |
subsubsection \<open>Use this to derive general bound property of convex function\<close> |
33175 | 5600 |
|
5601 |
lemma convex_on: |
|
5602 |
assumes "convex s" |
|
53348 | 5603 |
shows "convex_on s f \<longleftrightarrow> |
5604 |
(\<forall>k u x. (\<forall>i\<in>{1..k::nat}. 0 \<le> u i \<and> x i \<in> s) \<and> setsum u {1..k} = 1 \<longrightarrow> |
|
5605 |
f (setsum (\<lambda>i. u i *\<^sub>R x i) {1..k} ) \<le> setsum (\<lambda>i. u i * f(x i)) {1..k})" |
|
33175 | 5606 |
unfolding convex_epigraph_convex[OF assms] convex epigraph_def Ball_def mem_Collect_eq |
36338 | 5607 |
unfolding fst_setsum snd_setsum fst_scaleR snd_scaleR |
5608 |
apply safe |
|
5609 |
apply (drule_tac x=k in spec) |
|
5610 |
apply (drule_tac x=u in spec) |
|
5611 |
apply (drule_tac x="\<lambda>i. (x i, f (x i))" in spec) |
|
5612 |
apply simp |
|
53348 | 5613 |
using assms[unfolded convex] |
5614 |
apply simp |
|
5615 |
apply (rule_tac y="\<Sum>i = 1..k. u i * f (fst (x i))" in order_trans) |
|
5616 |
defer |
|
5617 |
apply (rule setsum_mono) |
|
5618 |
apply (erule_tac x=i in allE) |
|
5619 |
unfolding real_scaleR_def |
|
5620 |
apply (rule mult_left_mono) |
|
5621 |
using assms[unfolded convex] |
|
5622 |
apply auto |
|
5623 |
done |
|
33175 | 5624 |
|
36338 | 5625 |
|
60420 | 5626 |
subsection \<open>Convexity of general and special intervals\<close> |
33175 | 5627 |
|
5628 |
lemma is_interval_convex: |
|
53348 | 5629 |
fixes s :: "'a::euclidean_space set" |
5630 |
assumes "is_interval s" |
|
5631 |
shows "convex s" |
|
37732
6432bf0d7191
generalize type of is_interval to class euclidean_space
huffman
parents:
37673
diff
changeset
|
5632 |
proof (rule convexI) |
53348 | 5633 |
fix x y and u v :: real |
5634 |
assume as: "x \<in> s" "y \<in> s" "0 \<le> u" "0 \<le> v" "u + v = 1" |
|
5635 |
then have *: "u = 1 - v" "1 - v \<ge> 0" and **: "v = 1 - u" "1 - u \<ge> 0" |
|
5636 |
by auto |
|
5637 |
{ |
|
5638 |
fix a b |
|
5639 |
assume "\<not> b \<le> u * a + v * b" |
|
5640 |
then have "u * a < (1 - v) * b" |
|
5641 |
unfolding not_le using as(4) by (auto simp add: field_simps) |
|
5642 |
then have "a < b" |
|
5643 |
unfolding * using as(4) *(2) |
|
5644 |
apply (rule_tac mult_left_less_imp_less[of "1 - v"]) |
|
5645 |
apply (auto simp add: field_simps) |
|
5646 |
done |
|
5647 |
then have "a \<le> u * a + v * b" |
|
5648 |
unfolding * using as(4) |
|
5649 |
by (auto simp add: field_simps intro!:mult_right_mono) |
|
5650 |
} |
|
5651 |
moreover |
|
5652 |
{ |
|
5653 |
fix a b |
|
5654 |
assume "\<not> u * a + v * b \<le> a" |
|
5655 |
then have "v * b > (1 - u) * a" |
|
5656 |
unfolding not_le using as(4) by (auto simp add: field_simps) |
|
5657 |
then have "a < b" |
|
5658 |
unfolding * using as(4) |
|
5659 |
apply (rule_tac mult_left_less_imp_less) |
|
5660 |
apply (auto simp add: field_simps) |
|
5661 |
done |
|
5662 |
then have "u * a + v * b \<le> b" |
|
5663 |
unfolding ** |
|
5664 |
using **(2) as(3) |
|
5665 |
by (auto simp add: field_simps intro!:mult_right_mono) |
|
5666 |
} |
|
5667 |
ultimately show "u *\<^sub>R x + v *\<^sub>R y \<in> s" |
|
5668 |
apply - |
|
5669 |
apply (rule assms[unfolded is_interval_def, rule_format, OF as(1,2)]) |
|
5670 |
using as(3-) DIM_positive[where 'a='a] |
|
5671 |
apply (auto simp: inner_simps) |
|
5672 |
done |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
5673 |
qed |
33175 | 5674 |
|
5675 |
lemma is_interval_connected: |
|
53348 | 5676 |
fixes s :: "'a::euclidean_space set" |
33175 | 5677 |
shows "is_interval s \<Longrightarrow> connected s" |
5678 |
using is_interval_convex convex_connected by auto |
|
5679 |
||
56188 | 5680 |
lemma convex_box: "convex (cbox a b)" "convex (box a (b::'a::euclidean_space))" |
5681 |
apply (rule_tac[!] is_interval_convex)+ |
|
56189
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
5682 |
using is_interval_box is_interval_cbox |
53348 | 5683 |
apply auto |
5684 |
done |
|
33175 | 5685 |
|
60420 | 5686 |
subsection \<open>On @{text "real"}, @{text "is_interval"}, @{text "convex"} and @{text "connected"} are all equivalent.\<close> |
33175 | 5687 |
|
5688 |
lemma is_interval_1: |
|
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5689 |
"is_interval (s::real set) \<longleftrightarrow> (\<forall>a\<in>s. \<forall>b\<in>s. \<forall> x. a \<le> x \<and> x \<le> b \<longrightarrow> x \<in> s)" |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5690 |
unfolding is_interval_def by auto |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5691 |
|
54465 | 5692 |
lemma is_interval_connected_1: |
5693 |
fixes s :: "real set" |
|
5694 |
shows "is_interval s \<longleftrightarrow> connected s" |
|
5695 |
apply rule |
|
5696 |
apply (rule is_interval_connected, assumption) |
|
5697 |
unfolding is_interval_1 |
|
5698 |
apply rule |
|
5699 |
apply rule |
|
5700 |
apply rule |
|
5701 |
apply rule |
|
5702 |
apply (erule conjE) |
|
5703 |
apply (rule ccontr) |
|
5704 |
proof - |
|
5705 |
fix a b x |
|
5706 |
assume as: "connected s" "a \<in> s" "b \<in> s" "a \<le> x" "x \<le> b" "x \<notin> s" |
|
5707 |
then have *: "a < x" "x < b" |
|
5708 |
unfolding not_le [symmetric] by auto |
|
5709 |
let ?halfl = "{..<x} " |
|
5710 |
let ?halfr = "{x<..}" |
|
5711 |
{ |
|
5712 |
fix y |
|
5713 |
assume "y \<in> s" |
|
60420 | 5714 |
with \<open>x \<notin> s\<close> have "x \<noteq> y" by auto |
54465 | 5715 |
then have "y \<in> ?halfr \<union> ?halfl" by auto |
5716 |
} |
|
5717 |
moreover have "a \<in> ?halfl" "b \<in> ?halfr" using * by auto |
|
5718 |
then have "?halfl \<inter> s \<noteq> {}" "?halfr \<inter> s \<noteq> {}" |
|
5719 |
using as(2-3) by auto |
|
5720 |
ultimately show False |
|
5721 |
apply (rule_tac notE[OF as(1)[unfolded connected_def]]) |
|
5722 |
apply (rule_tac x = ?halfl in exI) |
|
5723 |
apply (rule_tac x = ?halfr in exI) |
|
5724 |
apply rule |
|
5725 |
apply (rule open_lessThan) |
|
5726 |
apply rule |
|
5727 |
apply (rule open_greaterThan) |
|
5728 |
apply auto |
|
5729 |
done |
|
5730 |
qed |
|
33175 | 5731 |
|
5732 |
lemma is_interval_convex_1: |
|
54465 | 5733 |
fixes s :: "real set" |
5734 |
shows "is_interval s \<longleftrightarrow> convex s" |
|
5735 |
by (metis is_interval_convex convex_connected is_interval_connected_1) |
|
33175 | 5736 |
|
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
5737 |
lemma connected_convex_1: |
54465 | 5738 |
fixes s :: "real set" |
5739 |
shows "connected s \<longleftrightarrow> convex s" |
|
5740 |
by (metis is_interval_convex convex_connected is_interval_connected_1) |
|
53348 | 5741 |
|
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
5742 |
lemma connected_convex_1_gen: |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
5743 |
fixes s :: "'a :: euclidean_space set" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
5744 |
assumes "DIM('a) = 1" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
5745 |
shows "connected s \<longleftrightarrow> convex s" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
5746 |
proof - |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
5747 |
obtain f:: "'a \<Rightarrow> real" where linf: "linear f" and "inj f" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
5748 |
using subspace_isomorphism [where 'a = 'a and 'b = real] |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
5749 |
by (metis DIM_real dim_UNIV subspace_UNIV assms) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
5750 |
then have "f -` (f ` s) = s" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
5751 |
by (simp add: inj_vimage_image_eq) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
5752 |
then show ?thesis |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
5753 |
by (metis connected_convex_1 convex_linear_vimage linf convex_connected connected_linear_image) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
5754 |
qed |
53348 | 5755 |
|
60420 | 5756 |
subsection \<open>Another intermediate value theorem formulation\<close> |
33175 | 5757 |
|
53348 | 5758 |
lemma ivt_increasing_component_on_1: |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61531
diff
changeset
|
5759 |
fixes f :: "real \<Rightarrow> 'a::euclidean_space" |
53348 | 5760 |
assumes "a \<le> b" |
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
5761 |
and "continuous_on {a..b} f" |
53348 | 5762 |
and "(f a)\<bullet>k \<le> y" "y \<le> (f b)\<bullet>k" |
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
5763 |
shows "\<exists>x\<in>{a..b}. (f x)\<bullet>k = y" |
56188 | 5764 |
proof - |
5765 |
have "f a \<in> f ` cbox a b" "f b \<in> f ` cbox a b" |
|
53348 | 5766 |
apply (rule_tac[!] imageI) |
5767 |
using assms(1) |
|
5768 |
apply auto |
|
5769 |
done |
|
5770 |
then show ?thesis |
|
56188 | 5771 |
using connected_ivt_component[of "f ` cbox a b" "f a" "f b" k y] |
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
5772 |
by (simp add: Topology_Euclidean_Space.connected_continuous_image assms) |
53348 | 5773 |
qed |
5774 |
||
5775 |
lemma ivt_increasing_component_1: |
|
5776 |
fixes f :: "real \<Rightarrow> 'a::euclidean_space" |
|
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
5777 |
shows "a \<le> b \<Longrightarrow> \<forall>x\<in>{a..b}. continuous (at x) f \<Longrightarrow> |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
5778 |
f a\<bullet>k \<le> y \<Longrightarrow> y \<le> f b\<bullet>k \<Longrightarrow> \<exists>x\<in>{a..b}. (f x)\<bullet>k = y" |
53348 | 5779 |
by (rule ivt_increasing_component_on_1) (auto simp add: continuous_at_imp_continuous_on) |
5780 |
||
5781 |
lemma ivt_decreasing_component_on_1: |
|
5782 |
fixes f :: "real \<Rightarrow> 'a::euclidean_space" |
|
5783 |
assumes "a \<le> b" |
|
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
5784 |
and "continuous_on {a..b} f" |
53348 | 5785 |
and "(f b)\<bullet>k \<le> y" |
5786 |
and "y \<le> (f a)\<bullet>k" |
|
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
5787 |
shows "\<exists>x\<in>{a..b}. (f x)\<bullet>k = y" |
53348 | 5788 |
apply (subst neg_equal_iff_equal[symmetric]) |
44531
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44525
diff
changeset
|
5789 |
using ivt_increasing_component_on_1[of a b "\<lambda>x. - f x" k "- y"] |
53348 | 5790 |
using assms using continuous_on_minus |
5791 |
apply auto |
|
5792 |
done |
|
5793 |
||
5794 |
lemma ivt_decreasing_component_1: |
|
5795 |
fixes f :: "real \<Rightarrow> 'a::euclidean_space" |
|
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
5796 |
shows "a \<le> b \<Longrightarrow> \<forall>x\<in>{a..b}. continuous (at x) f \<Longrightarrow> |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
5797 |
f b\<bullet>k \<le> y \<Longrightarrow> y \<le> f a\<bullet>k \<Longrightarrow> \<exists>x\<in>{a..b}. (f x)\<bullet>k = y" |
53348 | 5798 |
by (rule ivt_decreasing_component_on_1) (auto simp: continuous_at_imp_continuous_on) |
5799 |
||
33175 | 5800 |
|
60420 | 5801 |
subsection \<open>A bound within a convex hull, and so an interval\<close> |
33175 | 5802 |
|
5803 |
lemma convex_on_convex_hull_bound: |
|
53348 | 5804 |
assumes "convex_on (convex hull s) f" |
5805 |
and "\<forall>x\<in>s. f x \<le> b" |
|
5806 |
shows "\<forall>x\<in> convex hull s. f x \<le> b" |
|
5807 |
proof |
|
5808 |
fix x |
|
5809 |
assume "x \<in> convex hull s" |
|
5810 |
then obtain k u v where |
|
5811 |
obt: "\<forall>i\<in>{1..k::nat}. 0 \<le> u i \<and> v i \<in> s" "setsum u {1..k} = 1" "(\<Sum>i = 1..k. u i *\<^sub>R v i) = x" |
|
33175 | 5812 |
unfolding convex_hull_indexed mem_Collect_eq by auto |
53348 | 5813 |
have "(\<Sum>i = 1..k. u i * f (v i)) \<le> b" |
5814 |
using setsum_mono[of "{1..k}" "\<lambda>i. u i * f (v i)" "\<lambda>i. u i * b"] |
|
5815 |
unfolding setsum_left_distrib[symmetric] obt(2) mult_1 |
|
5816 |
apply (drule_tac meta_mp) |
|
5817 |
apply (rule mult_left_mono) |
|
5818 |
using assms(2) obt(1) |
|
5819 |
apply auto |
|
5820 |
done |
|
5821 |
then show "f x \<le> b" |
|
5822 |
using assms(1)[unfolded convex_on[OF convex_convex_hull], rule_format, of k u v] |
|
5823 |
unfolding obt(2-3) |
|
5824 |
using obt(1) and hull_subset[unfolded subset_eq, rule_format, of _ s] |
|
5825 |
by auto |
|
5826 |
qed |
|
5827 |
||
5828 |
lemma inner_setsum_Basis[simp]: "i \<in> Basis \<Longrightarrow> (\<Sum>Basis) \<bullet> i = 1" |
|
57418 | 5829 |
by (simp add: inner_setsum_left setsum.If_cases inner_Basis) |
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5830 |
|
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5831 |
lemma convex_set_plus: |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5832 |
assumes "convex s" and "convex t" shows "convex (s + t)" |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5833 |
proof - |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5834 |
have "convex {x + y |x y. x \<in> s \<and> y \<in> t}" |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5835 |
using assms by (rule convex_sums) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5836 |
moreover have "{x + y |x y. x \<in> s \<and> y \<in> t} = s + t" |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5837 |
unfolding set_plus_def by auto |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5838 |
finally show "convex (s + t)" . |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5839 |
qed |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5840 |
|
55929
91f245c23bc5
remove lemmas in favor of more general ones: convex(_hull)_set_{plus,setsum}
huffman
parents:
55928
diff
changeset
|
5841 |
lemma convex_set_setsum: |
91f245c23bc5
remove lemmas in favor of more general ones: convex(_hull)_set_{plus,setsum}
huffman
parents:
55928
diff
changeset
|
5842 |
assumes "\<And>i. i \<in> A \<Longrightarrow> convex (B i)" |
91f245c23bc5
remove lemmas in favor of more general ones: convex(_hull)_set_{plus,setsum}
huffman
parents:
55928
diff
changeset
|
5843 |
shows "convex (\<Sum>i\<in>A. B i)" |
91f245c23bc5
remove lemmas in favor of more general ones: convex(_hull)_set_{plus,setsum}
huffman
parents:
55928
diff
changeset
|
5844 |
proof (cases "finite A") |
91f245c23bc5
remove lemmas in favor of more general ones: convex(_hull)_set_{plus,setsum}
huffman
parents:
55928
diff
changeset
|
5845 |
case True then show ?thesis using assms |
91f245c23bc5
remove lemmas in favor of more general ones: convex(_hull)_set_{plus,setsum}
huffman
parents:
55928
diff
changeset
|
5846 |
by induct (auto simp: convex_set_plus) |
91f245c23bc5
remove lemmas in favor of more general ones: convex(_hull)_set_{plus,setsum}
huffman
parents:
55928
diff
changeset
|
5847 |
qed auto |
91f245c23bc5
remove lemmas in favor of more general ones: convex(_hull)_set_{plus,setsum}
huffman
parents:
55928
diff
changeset
|
5848 |
|
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5849 |
lemma finite_set_setsum: |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5850 |
assumes "finite A" and "\<forall>i\<in>A. finite (B i)" shows "finite (\<Sum>i\<in>A. B i)" |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5851 |
using assms by (induct set: finite, simp, simp add: finite_set_plus) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5852 |
|
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5853 |
lemma set_setsum_eq: |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5854 |
"finite A \<Longrightarrow> (\<Sum>i\<in>A. B i) = {\<Sum>i\<in>A. f i |f. \<forall>i\<in>A. f i \<in> B i}" |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5855 |
apply (induct set: finite) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5856 |
apply simp |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5857 |
apply simp |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5858 |
apply (safe elim!: set_plus_elim) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5859 |
apply (rule_tac x="fun_upd f x a" in exI) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5860 |
apply simp |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5861 |
apply (rule_tac f="\<lambda>x. a + x" in arg_cong) |
57418 | 5862 |
apply (rule setsum.cong [OF refl]) |
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5863 |
apply clarsimp |
57865 | 5864 |
apply fast |
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5865 |
done |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5866 |
|
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5867 |
lemma box_eq_set_setsum_Basis: |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5868 |
shows "{x. \<forall>i\<in>Basis. x\<bullet>i \<in> B i} = (\<Sum>i\<in>Basis. image (\<lambda>x. x *\<^sub>R i) (B i))" |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5869 |
apply (subst set_setsum_eq [OF finite_Basis]) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5870 |
apply safe |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5871 |
apply (fast intro: euclidean_representation [symmetric]) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5872 |
apply (subst inner_setsum_left) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5873 |
apply (subgoal_tac "(\<Sum>x\<in>Basis. f x \<bullet> i) = f i \<bullet> i") |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5874 |
apply (drule (1) bspec) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5875 |
apply clarsimp |
57418 | 5876 |
apply (frule setsum.remove [OF finite_Basis]) |
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5877 |
apply (erule trans) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5878 |
apply simp |
57418 | 5879 |
apply (rule setsum.neutral) |
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5880 |
apply clarsimp |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5881 |
apply (frule_tac x=i in bspec, assumption) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5882 |
apply (drule_tac x=x in bspec, assumption) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5883 |
apply clarsimp |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5884 |
apply (cut_tac u=x and v=i in inner_Basis, assumption+) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5885 |
apply (rule ccontr) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5886 |
apply simp |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5887 |
done |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5888 |
|
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5889 |
lemma convex_hull_set_setsum: |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5890 |
"convex hull (\<Sum>i\<in>A. B i) = (\<Sum>i\<in>A. convex hull (B i))" |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5891 |
proof (cases "finite A") |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5892 |
assume "finite A" then show ?thesis |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5893 |
by (induct set: finite, simp, simp add: convex_hull_set_plus) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5894 |
qed simp |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5895 |
|
56188 | 5896 |
lemma convex_hull_eq_real_cbox: |
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5897 |
fixes x y :: real assumes "x \<le> y" |
56188 | 5898 |
shows "convex hull {x, y} = cbox x y" |
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5899 |
proof (rule hull_unique) |
60420 | 5900 |
show "{x, y} \<subseteq> cbox x y" using \<open>x \<le> y\<close> by auto |
56188 | 5901 |
show "convex (cbox x y)" |
5902 |
by (rule convex_box) |
|
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5903 |
next |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5904 |
fix s assume "{x, y} \<subseteq> s" and "convex s" |
56188 | 5905 |
then show "cbox x y \<subseteq> s" |
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5906 |
unfolding is_interval_convex_1 [symmetric] is_interval_def Basis_real_def |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5907 |
by - (clarify, simp (no_asm_use), fast) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5908 |
qed |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
5909 |
|
33175 | 5910 |
lemma unit_interval_convex_hull: |
57447
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57418
diff
changeset
|
5911 |
"cbox (0::'a::euclidean_space) One = convex hull {x. \<forall>i\<in>Basis. (x\<bullet>i = 0) \<or> (x\<bullet>i = 1)}" |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
5912 |
(is "?int = convex hull ?points") |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
5913 |
proof - |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
5914 |
have One[simp]: "\<And>i. i \<in> Basis \<Longrightarrow> One \<bullet> i = 1" |
57418 | 5915 |
by (simp add: One_def inner_setsum_left setsum.If_cases inner_Basis) |
56188 | 5916 |
have "?int = {x. \<forall>i\<in>Basis. x \<bullet> i \<in> cbox 0 1}" |
5917 |
by (auto simp: cbox_def) |
|
5918 |
also have "\<dots> = (\<Sum>i\<in>Basis. (\<lambda>x. x *\<^sub>R i) ` cbox 0 1)" |
|
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5919 |
by (simp only: box_eq_set_setsum_Basis) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5920 |
also have "\<dots> = (\<Sum>i\<in>Basis. (\<lambda>x. x *\<^sub>R i) ` (convex hull {0, 1}))" |
56188 | 5921 |
by (simp only: convex_hull_eq_real_cbox zero_le_one) |
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5922 |
also have "\<dots> = (\<Sum>i\<in>Basis. convex hull ((\<lambda>x. x *\<^sub>R i) ` {0, 1}))" |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5923 |
by (simp only: convex_hull_linear_image linear_scaleR_left) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5924 |
also have "\<dots> = convex hull (\<Sum>i\<in>Basis. (\<lambda>x. x *\<^sub>R i) ` {0, 1})" |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5925 |
by (simp only: convex_hull_set_setsum) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5926 |
also have "\<dots> = convex hull {x. \<forall>i\<in>Basis. x\<bullet>i \<in> {0, 1}}" |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5927 |
by (simp only: box_eq_set_setsum_Basis) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5928 |
also have "convex hull {x. \<forall>i\<in>Basis. x\<bullet>i \<in> {0, 1}} = convex hull ?points" |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5929 |
by simp |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
5930 |
finally show ?thesis . |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
5931 |
qed |
33175 | 5932 |
|
60420 | 5933 |
text \<open>And this is a finite set of vertices.\<close> |
33175 | 5934 |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
5935 |
lemma unit_cube_convex_hull: |
56188 | 5936 |
obtains s :: "'a::euclidean_space set" |
5937 |
where "finite s" and "cbox 0 (\<Sum>Basis) = convex hull s" |
|
53348 | 5938 |
apply (rule that[of "{x::'a. \<forall>i\<in>Basis. x\<bullet>i=0 \<or> x\<bullet>i=1}"]) |
5939 |
apply (rule finite_subset[of _ "(\<lambda>s. (\<Sum>i\<in>Basis. (if i\<in>s then 1 else 0) *\<^sub>R i)::'a) ` Pow Basis"]) |
|
5940 |
prefer 3 |
|
5941 |
apply (rule unit_interval_convex_hull) |
|
5942 |
apply rule |
|
5943 |
unfolding mem_Collect_eq |
|
5944 |
proof - |
|
5945 |
fix x :: 'a |
|
5946 |
assume as: "\<forall>i\<in>Basis. x \<bullet> i = 0 \<or> x \<bullet> i = 1" |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
5947 |
show "x \<in> (\<lambda>s. \<Sum>i\<in>Basis. (if i\<in>s then 1 else 0) *\<^sub>R i) ` Pow Basis" |
53348 | 5948 |
apply (rule image_eqI[where x="{i. i\<in>Basis \<and> x\<bullet>i = 1}"]) |
5949 |
using as |
|
5950 |
apply (subst euclidean_eq_iff) |
|
57865 | 5951 |
apply auto |
53348 | 5952 |
done |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
5953 |
qed auto |
33175 | 5954 |
|
60420 | 5955 |
text \<open>Hence any cube (could do any nonempty interval).\<close> |
33175 | 5956 |
|
5957 |
lemma cube_convex_hull: |
|
53348 | 5958 |
assumes "d > 0" |
56188 | 5959 |
obtains s :: "'a::euclidean_space set" where |
5960 |
"finite s" and "cbox (x - (\<Sum>i\<in>Basis. d*\<^sub>Ri)) (x + (\<Sum>i\<in>Basis. d*\<^sub>Ri)) = convex hull s" |
|
53348 | 5961 |
proof - |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
5962 |
let ?d = "(\<Sum>i\<in>Basis. d*\<^sub>Ri)::'a" |
56188 | 5963 |
have *: "cbox (x - ?d) (x + ?d) = (\<lambda>y. x - ?d + (2 * d) *\<^sub>R y) ` cbox 0 (\<Sum>Basis)" |
53348 | 5964 |
apply (rule set_eqI, rule) |
5965 |
unfolding image_iff |
|
5966 |
defer |
|
5967 |
apply (erule bexE) |
|
5968 |
proof - |
|
5969 |
fix y |
|
56188 | 5970 |
assume as: "y\<in>cbox (x - ?d) (x + ?d)" |
5971 |
then have "inverse (2 * d) *\<^sub>R (y - (x - ?d)) \<in> cbox 0 (\<Sum>Basis)" |
|
58776
95e58e04e534
use NO_MATCH-simproc for distribution rules in field_simps, otherwise field_simps on '(a / (c + d)) * (e + f)' can be non-terminating
hoelzl
parents:
57865
diff
changeset
|
5972 |
using assms by (simp add: mem_box field_simps inner_simps) |
60420 | 5973 |
with \<open>0 < d\<close> show "\<exists>z\<in>cbox 0 (\<Sum>Basis). y = x - ?d + (2 * d) *\<^sub>R z" |
58776
95e58e04e534
use NO_MATCH-simproc for distribution rules in field_simps, otherwise field_simps on '(a / (c + d)) * (e + f)' can be non-terminating
hoelzl
parents:
57865
diff
changeset
|
5974 |
by (intro bexI[of _ "inverse (2 * d) *\<^sub>R (y - (x - ?d))"]) auto |
33175 | 5975 |
next |
53348 | 5976 |
fix y z |
56188 | 5977 |
assume as: "z\<in>cbox 0 (\<Sum>Basis)" "y = x - ?d + (2*d) *\<^sub>R z" |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
5978 |
have "\<And>i. i\<in>Basis \<Longrightarrow> 0 \<le> d * (z \<bullet> i) \<and> d * (z \<bullet> i) \<le> d" |
56188 | 5979 |
using assms as(1)[unfolded mem_box] |
53348 | 5980 |
apply (erule_tac x=i in ballE) |
5981 |
apply rule |
|
56536 | 5982 |
prefer 2 |
53348 | 5983 |
apply (rule mult_right_le_one_le) |
5984 |
using assms |
|
5985 |
apply auto |
|
5986 |
done |
|
56188 | 5987 |
then show "y \<in> cbox (x - ?d) (x + ?d)" |
5988 |
unfolding as(2) mem_box |
|
53348 | 5989 |
apply - |
5990 |
apply rule |
|
56188 | 5991 |
using as(1)[unfolded mem_box] |
53348 | 5992 |
apply (erule_tac x=i in ballE) |
5993 |
using assms |
|
5994 |
apply (auto simp: inner_simps) |
|
5995 |
done |
|
5996 |
qed |
|
56188 | 5997 |
obtain s where "finite s" "cbox 0 (\<Sum>Basis::'a) = convex hull s" |
53348 | 5998 |
using unit_cube_convex_hull by auto |
5999 |
then show ?thesis |
|
6000 |
apply (rule_tac that[of "(\<lambda>y. x - ?d + (2 * d) *\<^sub>R y)` s"]) |
|
6001 |
unfolding * and convex_hull_affinity |
|
6002 |
apply auto |
|
6003 |
done |
|
6004 |
qed |
|
6005 |
||
33175 | 6006 |
|
60420 | 6007 |
subsection \<open>Bounded convex function on open set is continuous\<close> |
33175 | 6008 |
|
6009 |
lemma convex_on_bounded_continuous: |
|
36338 | 6010 |
fixes s :: "('a::real_normed_vector) set" |
53348 | 6011 |
assumes "open s" |
6012 |
and "convex_on s f" |
|
6013 |
and "\<forall>x\<in>s. abs(f x) \<le> b" |
|
33175 | 6014 |
shows "continuous_on s f" |
53348 | 6015 |
apply (rule continuous_at_imp_continuous_on) |
6016 |
unfolding continuous_at_real_range |
|
6017 |
proof (rule,rule,rule) |
|
6018 |
fix x and e :: real |
|
6019 |
assume "x \<in> s" "e > 0" |
|
33175 | 6020 |
def B \<equiv> "abs b + 1" |
53348 | 6021 |
have B: "0 < B" "\<And>x. x\<in>s \<Longrightarrow> abs (f x) \<le> B" |
6022 |
unfolding B_def |
|
6023 |
defer |
|
6024 |
apply (drule assms(3)[rule_format]) |
|
6025 |
apply auto |
|
6026 |
done |
|
6027 |
obtain k where "k > 0" and k: "cball x k \<subseteq> s" |
|
6028 |
using assms(1)[unfolded open_contains_cball, THEN bspec[where x=x]] |
|
60420 | 6029 |
using \<open>x\<in>s\<close> by auto |
33175 | 6030 |
show "\<exists>d>0. \<forall>x'. norm (x' - x) < d \<longrightarrow> \<bar>f x' - f x\<bar> < e" |
53348 | 6031 |
apply (rule_tac x="min (k / 2) (e / (2 * B) * k)" in exI) |
6032 |
apply rule |
|
6033 |
defer |
|
6034 |
proof (rule, rule) |
|
6035 |
fix y |
|
6036 |
assume as: "norm (y - x) < min (k / 2) (e / (2 * B) * k)" |
|
6037 |
show "\<bar>f y - f x\<bar> < e" |
|
6038 |
proof (cases "y = x") |
|
6039 |
case False |
|
6040 |
def t \<equiv> "k / norm (y - x)" |
|
6041 |
have "2 < t" "0<t" |
|
60420 | 6042 |
unfolding t_def using as False and \<open>k>0\<close> |
53348 | 6043 |
by (auto simp add:field_simps) |
6044 |
have "y \<in> s" |
|
6045 |
apply (rule k[unfolded subset_eq,rule_format]) |
|
6046 |
unfolding mem_cball dist_norm |
|
6047 |
apply (rule order_trans[of _ "2 * norm (x - y)"]) |
|
6048 |
using as |
|
6049 |
by (auto simp add: field_simps norm_minus_commute) |
|
6050 |
{ |
|
6051 |
def w \<equiv> "x + t *\<^sub>R (y - x)" |
|
6052 |
have "w \<in> s" |
|
6053 |
unfolding w_def |
|
6054 |
apply (rule k[unfolded subset_eq,rule_format]) |
|
6055 |
unfolding mem_cball dist_norm |
|
6056 |
unfolding t_def |
|
60420 | 6057 |
using \<open>k>0\<close> |
53348 | 6058 |
apply auto |
6059 |
done |
|
6060 |
have "(1 / t) *\<^sub>R x + - x + ((t - 1) / t) *\<^sub>R x = (1 / t - 1 + (t - 1) / t) *\<^sub>R x" |
|
6061 |
by (auto simp add: algebra_simps) |
|
6062 |
also have "\<dots> = 0" |
|
60420 | 6063 |
using \<open>t > 0\<close> by (auto simp add:field_simps) |
53348 | 6064 |
finally have w: "(1 / t) *\<^sub>R w + ((t - 1) / t) *\<^sub>R x = y" |
60420 | 6065 |
unfolding w_def using False and \<open>t > 0\<close> |
53348 | 6066 |
by (auto simp add: algebra_simps) |
6067 |
have "2 * B < e * t" |
|
60420 | 6068 |
unfolding t_def using \<open>0 < e\<close> \<open>0 < k\<close> \<open>B > 0\<close> and as and False |
53348 | 6069 |
by (auto simp add:field_simps) |
6070 |
then have "(f w - f x) / t < e" |
|
60420 | 6071 |
using B(2)[OF \<open>w\<in>s\<close>] and B(2)[OF \<open>x\<in>s\<close>] |
6072 |
using \<open>t > 0\<close> by (auto simp add:field_simps) |
|
53348 | 6073 |
then have th1: "f y - f x < e" |
6074 |
apply - |
|
6075 |
apply (rule le_less_trans) |
|
6076 |
defer |
|
6077 |
apply assumption |
|
33175 | 6078 |
using assms(2)[unfolded convex_on_def,rule_format,of w x "1/t" "(t - 1)/t", unfolded w] |
60420 | 6079 |
using \<open>0 < t\<close> \<open>2 < t\<close> and \<open>x \<in> s\<close> \<open>w \<in> s\<close> |
53348 | 6080 |
by (auto simp add:field_simps) |
6081 |
} |
|
49531 | 6082 |
moreover |
53348 | 6083 |
{ |
6084 |
def w \<equiv> "x - t *\<^sub>R (y - x)" |
|
6085 |
have "w \<in> s" |
|
6086 |
unfolding w_def |
|
6087 |
apply (rule k[unfolded subset_eq,rule_format]) |
|
6088 |
unfolding mem_cball dist_norm |
|
6089 |
unfolding t_def |
|
60420 | 6090 |
using \<open>k > 0\<close> |
53348 | 6091 |
apply auto |
6092 |
done |
|
6093 |
have "(1 / (1 + t)) *\<^sub>R x + (t / (1 + t)) *\<^sub>R x = (1 / (1 + t) + t / (1 + t)) *\<^sub>R x" |
|
6094 |
by (auto simp add: algebra_simps) |
|
6095 |
also have "\<dots> = x" |
|
60420 | 6096 |
using \<open>t > 0\<close> by (auto simp add:field_simps) |
53348 | 6097 |
finally have w: "(1 / (1+t)) *\<^sub>R w + (t / (1 + t)) *\<^sub>R y = x" |
60420 | 6098 |
unfolding w_def using False and \<open>t > 0\<close> |
53348 | 6099 |
by (auto simp add: algebra_simps) |
6100 |
have "2 * B < e * t" |
|
6101 |
unfolding t_def |
|
60420 | 6102 |
using \<open>0 < e\<close> \<open>0 < k\<close> \<open>B > 0\<close> and as and False |
53348 | 6103 |
by (auto simp add:field_simps) |
6104 |
then have *: "(f w - f y) / t < e" |
|
60420 | 6105 |
using B(2)[OF \<open>w\<in>s\<close>] and B(2)[OF \<open>y\<in>s\<close>] |
6106 |
using \<open>t > 0\<close> |
|
53348 | 6107 |
by (auto simp add:field_simps) |
49531 | 6108 |
have "f x \<le> 1 / (1 + t) * f w + (t / (1 + t)) * f y" |
33175 | 6109 |
using assms(2)[unfolded convex_on_def,rule_format,of w y "1/(1+t)" "t / (1+t)",unfolded w] |
60420 | 6110 |
using \<open>0 < t\<close> \<open>2 < t\<close> and \<open>y \<in> s\<close> \<open>w \<in> s\<close> |
53348 | 6111 |
by (auto simp add:field_simps) |
6112 |
also have "\<dots> = (f w + t * f y) / (1 + t)" |
|
60420 | 6113 |
using \<open>t > 0\<close> by (auto simp add: divide_simps) |
53348 | 6114 |
also have "\<dots> < e + f y" |
60420 | 6115 |
using \<open>t > 0\<close> * \<open>e > 0\<close> by (auto simp add: field_simps) |
53348 | 6116 |
finally have "f x - f y < e" by auto |
6117 |
} |
|
49531 | 6118 |
ultimately show ?thesis by auto |
60420 | 6119 |
qed (insert \<open>0<e\<close>, auto) |
6120 |
qed (insert \<open>0<e\<close> \<open>0<k\<close> \<open>0<B\<close>, auto simp: field_simps) |
|
6121 |
qed |
|
6122 |
||
6123 |
||
6124 |
subsection \<open>Upper bound on a ball implies upper and lower bounds\<close> |
|
33175 | 6125 |
|
6126 |
lemma convex_bounds_lemma: |
|
36338 | 6127 |
fixes x :: "'a::real_normed_vector" |
53348 | 6128 |
assumes "convex_on (cball x e) f" |
6129 |
and "\<forall>y \<in> cball x e. f y \<le> b" |
|
6130 |
shows "\<forall>y \<in> cball x e. abs (f y) \<le> b + 2 * abs (f x)" |
|
6131 |
apply rule |
|
6132 |
proof (cases "0 \<le> e") |
|
6133 |
case True |
|
6134 |
fix y |
|
6135 |
assume y: "y \<in> cball x e" |
|
6136 |
def z \<equiv> "2 *\<^sub>R x - y" |
|
6137 |
have *: "x - (2 *\<^sub>R x - y) = y - x" |
|
6138 |
by (simp add: scaleR_2) |
|
6139 |
have z: "z \<in> cball x e" |
|
6140 |
using y unfolding z_def mem_cball dist_norm * by (auto simp add: norm_minus_commute) |
|
6141 |
have "(1 / 2) *\<^sub>R y + (1 / 2) *\<^sub>R z = x" |
|
6142 |
unfolding z_def by (auto simp add: algebra_simps) |
|
6143 |
then show "\<bar>f y\<bar> \<le> b + 2 * \<bar>f x\<bar>" |
|
6144 |
using assms(1)[unfolded convex_on_def,rule_format, OF y z, of "1/2" "1/2"] |
|
6145 |
using assms(2)[rule_format,OF y] assms(2)[rule_format,OF z] |
|
6146 |
by (auto simp add:field_simps) |
|
6147 |
next |
|
6148 |
case False |
|
6149 |
fix y |
|
6150 |
assume "y \<in> cball x e" |
|
6151 |
then have "dist x y < 0" |
|
6152 |
using False unfolding mem_cball not_le by (auto simp del: dist_not_less_zero) |
|
6153 |
then show "\<bar>f y\<bar> \<le> b + 2 * \<bar>f x\<bar>" |
|
6154 |
using zero_le_dist[of x y] by auto |
|
6155 |
qed |
|
6156 |
||
33175 | 6157 |
|
60420 | 6158 |
subsubsection \<open>Hence a convex function on an open set is continuous\<close> |
33175 | 6159 |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
6160 |
lemma real_of_nat_ge_one_iff: "1 \<le> real (n::nat) \<longleftrightarrow> 1 \<le> n" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
6161 |
by auto |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
6162 |
|
33175 | 6163 |
lemma convex_on_continuous: |
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6164 |
assumes "open (s::('a::euclidean_space) set)" "convex_on s f" |
33175 | 6165 |
shows "continuous_on s f" |
53348 | 6166 |
unfolding continuous_on_eq_continuous_at[OF assms(1)] |
6167 |
proof |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
6168 |
note dimge1 = DIM_positive[where 'a='a] |
53348 | 6169 |
fix x |
6170 |
assume "x \<in> s" |
|
6171 |
then obtain e where e: "cball x e \<subseteq> s" "e > 0" |
|
6172 |
using assms(1) unfolding open_contains_cball by auto |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
6173 |
def d \<equiv> "e / real DIM('a)" |
53348 | 6174 |
have "0 < d" |
60420 | 6175 |
unfolding d_def using \<open>e > 0\<close> dimge1 by auto |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
6176 |
let ?d = "(\<Sum>i\<in>Basis. d *\<^sub>R i)::'a" |
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6177 |
obtain c |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6178 |
where c: "finite c" |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6179 |
and c1: "convex hull c \<subseteq> cball x e" |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6180 |
and c2: "cball x d \<subseteq> convex hull c" |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6181 |
proof |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6182 |
def c \<equiv> "\<Sum>i\<in>Basis. (\<lambda>a. a *\<^sub>R i) ` {x\<bullet>i - d, x\<bullet>i + d}" |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6183 |
show "finite c" |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6184 |
unfolding c_def by (simp add: finite_set_setsum) |
56188 | 6185 |
have 1: "convex hull c = {a. \<forall>i\<in>Basis. a \<bullet> i \<in> cbox (x \<bullet> i - d) (x \<bullet> i + d)}" |
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6186 |
unfolding box_eq_set_setsum_Basis |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6187 |
unfolding c_def convex_hull_set_setsum |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6188 |
apply (subst convex_hull_linear_image [symmetric]) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6189 |
apply (simp add: linear_iff scaleR_add_left) |
57418 | 6190 |
apply (rule setsum.cong [OF refl]) |
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6191 |
apply (rule image_cong [OF _ refl]) |
56188 | 6192 |
apply (rule convex_hull_eq_real_cbox) |
60420 | 6193 |
apply (cut_tac \<open>0 < d\<close>, simp) |
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6194 |
done |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6195 |
then have 2: "convex hull c = {a. \<forall>i\<in>Basis. a \<bullet> i \<in> cball (x \<bullet> i) d}" |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6196 |
by (simp add: dist_norm abs_le_iff algebra_simps) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6197 |
show "cball x d \<subseteq> convex hull c" |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6198 |
unfolding 2 |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6199 |
apply clarsimp |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6200 |
apply (simp only: dist_norm) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6201 |
apply (subst inner_diff_left [symmetric]) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6202 |
apply simp |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6203 |
apply (erule (1) order_trans [OF Basis_le_norm]) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6204 |
done |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6205 |
have e': "e = (\<Sum>(i::'a)\<in>Basis. d)" |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61531
diff
changeset
|
6206 |
by (simp add: d_def DIM_positive) |
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6207 |
show "convex hull c \<subseteq> cball x e" |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6208 |
unfolding 2 |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6209 |
apply clarsimp |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6210 |
apply (subst euclidean_dist_l2) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6211 |
apply (rule order_trans [OF setL2_le_setsum]) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6212 |
apply (rule zero_le_dist) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6213 |
unfolding e' |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6214 |
apply (rule setsum_mono) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6215 |
apply simp |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6216 |
done |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6217 |
qed |
33175 | 6218 |
def k \<equiv> "Max (f ` c)" |
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6219 |
have "convex_on (convex hull c) f" |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
6220 |
apply(rule convex_on_subset[OF assms(2)]) |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
6221 |
apply(rule subset_trans[OF _ e(1)]) |
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6222 |
apply(rule c1) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6223 |
done |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6224 |
then have k: "\<forall>y\<in>convex hull c. f y \<le> k" |
53348 | 6225 |
apply (rule_tac convex_on_convex_hull_bound) |
6226 |
apply assumption |
|
6227 |
unfolding k_def |
|
6228 |
apply (rule, rule Max_ge) |
|
6229 |
using c(1) |
|
6230 |
apply auto |
|
6231 |
done |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
6232 |
have "d \<le> e" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
6233 |
unfolding d_def |
53348 | 6234 |
apply (rule mult_imp_div_pos_le) |
60420 | 6235 |
using \<open>e > 0\<close> |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
6236 |
unfolding mult_le_cancel_left1 |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
6237 |
apply (auto simp: real_of_nat_ge_one_iff Suc_le_eq DIM_positive) |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
6238 |
done |
53348 | 6239 |
then have dsube: "cball x d \<subseteq> cball x e" |
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6240 |
by (rule subset_cball) |
53348 | 6241 |
have conv: "convex_on (cball x d) f" |
6242 |
apply (rule convex_on_subset) |
|
6243 |
apply (rule convex_on_subset[OF assms(2)]) |
|
6244 |
apply (rule e(1)) |
|
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6245 |
apply (rule dsube) |
53348 | 6246 |
done |
6247 |
then have "\<forall>y\<in>cball x d. abs (f y) \<le> k + 2 * abs (f x)" |
|
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6248 |
apply (rule convex_bounds_lemma) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6249 |
apply (rule ballI) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6250 |
apply (rule k [rule_format]) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6251 |
apply (erule rev_subsetD) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6252 |
apply (rule c2) |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
6253 |
done |
53348 | 6254 |
then have "continuous_on (ball x d) f" |
6255 |
apply (rule_tac convex_on_bounded_continuous) |
|
6256 |
apply (rule open_ball, rule convex_on_subset[OF conv]) |
|
6257 |
apply (rule ball_subset_cball) |
|
33270 | 6258 |
apply force |
6259 |
done |
|
53348 | 6260 |
then show "continuous (at x) f" |
6261 |
unfolding continuous_on_eq_continuous_at[OF open_ball] |
|
60420 | 6262 |
using \<open>d > 0\<close> by auto |
6263 |
qed |
|
6264 |
||
6265 |
||
6266 |
subsection \<open>Line segments, Starlike Sets, etc.\<close> |
|
33270 | 6267 |
|
49531 | 6268 |
(* Use the same overloading tricks as for intervals, so that |
33270 | 6269 |
segment[a,b] is closed and segment(a,b) is open relative to affine hull. *) |
33175 | 6270 |
|
53348 | 6271 |
definition midpoint :: "'a::real_vector \<Rightarrow> 'a \<Rightarrow> 'a" |
6272 |
where "midpoint a b = (inverse (2::real)) *\<^sub>R (a + b)" |
|
6273 |
||
6274 |
definition closed_segment :: "'a::real_vector \<Rightarrow> 'a \<Rightarrow> 'a set" |
|
6275 |
where "closed_segment a b = {(1 - u) *\<^sub>R a + u *\<^sub>R b | u::real. 0 \<le> u \<and> u \<le> 1}" |
|
6276 |
||
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6277 |
definition open_segment :: "'a::real_vector \<Rightarrow> 'a \<Rightarrow> 'a set" where |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6278 |
"open_segment a b \<equiv> closed_segment a b - {a,b}" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6279 |
|
53348 | 6280 |
definition "between = (\<lambda>(a,b) x. x \<in> closed_segment a b)" |
33175 | 6281 |
|
61520
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
6282 |
definition "starlike s \<longleftrightarrow> (\<exists>a\<in>s. \<forall>x\<in>s. closed_segment a x \<subseteq> s)" |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
6283 |
|
33175 | 6284 |
lemmas segment = open_segment_def closed_segment_def |
6285 |
||
6286 |
lemma midpoint_refl: "midpoint x x = x" |
|
53348 | 6287 |
unfolding midpoint_def |
6288 |
unfolding scaleR_right_distrib |
|
6289 |
unfolding scaleR_left_distrib[symmetric] |
|
6290 |
by auto |
|
6291 |
||
6292 |
lemma midpoint_sym: "midpoint a b = midpoint b a" |
|
6293 |
unfolding midpoint_def by (auto simp add: scaleR_right_distrib) |
|
33175 | 6294 |
|
36338 | 6295 |
lemma midpoint_eq_iff: "midpoint a b = c \<longleftrightarrow> a + b = c + c" |
6296 |
proof - |
|
6297 |
have "midpoint a b = c \<longleftrightarrow> scaleR 2 (midpoint a b) = scaleR 2 c" |
|
6298 |
by simp |
|
53348 | 6299 |
then show ?thesis |
36338 | 6300 |
unfolding midpoint_def scaleR_2 [symmetric] by simp |
6301 |
qed |
|
6302 |
||
33175 | 6303 |
lemma dist_midpoint: |
36338 | 6304 |
fixes a b :: "'a::real_normed_vector" shows |
33175 | 6305 |
"dist a (midpoint a b) = (dist a b) / 2" (is ?t1) |
6306 |
"dist b (midpoint a b) = (dist a b) / 2" (is ?t2) |
|
6307 |
"dist (midpoint a b) a = (dist a b) / 2" (is ?t3) |
|
6308 |
"dist (midpoint a b) b = (dist a b) / 2" (is ?t4) |
|
53348 | 6309 |
proof - |
6310 |
have *: "\<And>x y::'a. 2 *\<^sub>R x = - y \<Longrightarrow> norm x = (norm y) / 2" |
|
6311 |
unfolding equation_minus_iff by auto |
|
6312 |
have **: "\<And>x y::'a. 2 *\<^sub>R x = y \<Longrightarrow> norm x = (norm y) / 2" |
|
6313 |
by auto |
|
33175 | 6314 |
note scaleR_right_distrib [simp] |
53348 | 6315 |
show ?t1 |
6316 |
unfolding midpoint_def dist_norm |
|
6317 |
apply (rule **) |
|
6318 |
apply (simp add: scaleR_right_diff_distrib) |
|
6319 |
apply (simp add: scaleR_2) |
|
6320 |
done |
|
6321 |
show ?t2 |
|
6322 |
unfolding midpoint_def dist_norm |
|
6323 |
apply (rule *) |
|
6324 |
apply (simp add: scaleR_right_diff_distrib) |
|
6325 |
apply (simp add: scaleR_2) |
|
6326 |
done |
|
6327 |
show ?t3 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61531
diff
changeset
|
6328 |
unfolding midpoint_def dist_norm |
53348 | 6329 |
apply (rule *) |
6330 |
apply (simp add: scaleR_right_diff_distrib) |
|
6331 |
apply (simp add: scaleR_2) |
|
6332 |
done |
|
6333 |
show ?t4 |
|
6334 |
unfolding midpoint_def dist_norm |
|
6335 |
apply (rule **) |
|
6336 |
apply (simp add: scaleR_right_diff_distrib) |
|
6337 |
apply (simp add: scaleR_2) |
|
6338 |
done |
|
36338 | 6339 |
qed |
33175 | 6340 |
|
6341 |
lemma midpoint_eq_endpoint: |
|
36338 | 6342 |
"midpoint a b = a \<longleftrightarrow> a = b" |
33175 | 6343 |
"midpoint a b = b \<longleftrightarrow> a = b" |
36338 | 6344 |
unfolding midpoint_eq_iff by auto |
33175 | 6345 |
|
6346 |
lemma convex_contains_segment: |
|
6347 |
"convex s \<longleftrightarrow> (\<forall>a\<in>s. \<forall>b\<in>s. closed_segment a b \<subseteq> s)" |
|
6348 |
unfolding convex_alt closed_segment_def by auto |
|
6349 |
||
60762 | 6350 |
lemma closed_segment_subset_convex_hull: |
6351 |
"\<lbrakk>x \<in> convex hull s; y \<in> convex hull s\<rbrakk> \<Longrightarrow> closed_segment x y \<subseteq> convex hull s" |
|
60809
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
6352 |
using convex_contains_segment by blast |
60762 | 6353 |
|
33175 | 6354 |
lemma convex_imp_starlike: |
6355 |
"convex s \<Longrightarrow> s \<noteq> {} \<Longrightarrow> starlike s" |
|
6356 |
unfolding convex_contains_segment starlike_def by auto |
|
6357 |
||
6358 |
lemma segment_convex_hull: |
|
53348 | 6359 |
"closed_segment a b = convex hull {a,b}" |
6360 |
proof - |
|
6361 |
have *: "\<And>x. {x} \<noteq> {}" by auto |
|
6362 |
show ?thesis |
|
6363 |
unfolding segment convex_hull_insert[OF *] convex_hull_singleton |
|
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6364 |
by (safe; rule_tac x="1 - u" in exI; force) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6365 |
qed |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6366 |
|
61520
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
6367 |
lemma open_closed_segment: "u \<in> open_segment w z \<Longrightarrow> u \<in> closed_segment w z" |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
6368 |
by (auto simp add: closed_segment_def open_segment_def) |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
6369 |
|
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6370 |
lemma segment_open_subset_closed: |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6371 |
"open_segment a b \<subseteq> closed_segment a b" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6372 |
by (auto simp: closed_segment_def open_segment_def) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6373 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6374 |
lemma bounded_closed_segment: |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6375 |
fixes a :: "'a::euclidean_space" shows "bounded (closed_segment a b)" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6376 |
by (simp add: segment_convex_hull compact_convex_hull compact_imp_bounded) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6377 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6378 |
lemma bounded_open_segment: |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6379 |
fixes a :: "'a::euclidean_space" shows "bounded (open_segment a b)" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6380 |
by (rule bounded_subset [OF bounded_closed_segment segment_open_subset_closed]) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6381 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6382 |
lemmas bounded_segment = bounded_closed_segment open_closed_segment |
61426
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61222
diff
changeset
|
6383 |
|
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61222
diff
changeset
|
6384 |
lemma ends_in_segment [iff]: "a \<in> closed_segment a b" "b \<in> closed_segment a b" |
53348 | 6385 |
unfolding segment_convex_hull |
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6386 |
by (auto intro!: hull_subset[unfolded subset_eq, rule_format]) |
33175 | 6387 |
|
6388 |
lemma segment_furthest_le: |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
6389 |
fixes a b x y :: "'a::euclidean_space" |
53348 | 6390 |
assumes "x \<in> closed_segment a b" |
6391 |
shows "norm (y - x) \<le> norm (y - a) \<or> norm (y - x) \<le> norm (y - b)" |
|
6392 |
proof - |
|
6393 |
obtain z where "z \<in> {a, b}" "norm (x - y) \<le> norm (z - y)" |
|
6394 |
using simplex_furthest_le[of "{a, b}" y] |
|
6395 |
using assms[unfolded segment_convex_hull] |
|
6396 |
by auto |
|
6397 |
then show ?thesis |
|
6398 |
by (auto simp add:norm_minus_commute) |
|
6399 |
qed |
|
33175 | 6400 |
|
6401 |
lemma segment_bound: |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
6402 |
fixes x a b :: "'a::euclidean_space" |
33175 | 6403 |
assumes "x \<in> closed_segment a b" |
53348 | 6404 |
shows "norm (x - a) \<le> norm (b - a)" "norm (x - b) \<le> norm (b - a)" |
33175 | 6405 |
using segment_furthest_le[OF assms, of a] |
6406 |
using segment_furthest_le[OF assms, of b] |
|
49531 | 6407 |
by (auto simp add:norm_minus_commute) |
33175 | 6408 |
|
60176 | 6409 |
lemma closed_segment_commute: "closed_segment a b = closed_segment b a" |
6410 |
proof - |
|
6411 |
have "{a, b} = {b, a}" by auto |
|
6412 |
thus ?thesis |
|
6413 |
by (simp add: segment_convex_hull) |
|
6414 |
qed |
|
6415 |
||
61520
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
6416 |
lemma open_segment_commute: "open_segment a b = open_segment b a" |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
6417 |
proof - |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
6418 |
have "{a, b} = {b, a}" by auto |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
6419 |
thus ?thesis |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
6420 |
by (simp add: closed_segment_commute open_segment_def) |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
6421 |
qed |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
6422 |
|
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
6423 |
lemma closed_segment_idem [simp]: "closed_segment a a = {a}" |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
6424 |
unfolding segment by (auto simp add: algebra_simps) |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
6425 |
|
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
6426 |
lemma open_segment_idem [simp]: "open_segment a a = {}" |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
6427 |
by (simp add: open_segment_def) |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
6428 |
|
60176 | 6429 |
lemma closed_segment_eq_real_ivl: |
6430 |
fixes a b::real |
|
6431 |
shows "closed_segment a b = (if a \<le> b then {a .. b} else {b .. a})" |
|
6432 |
proof - |
|
6433 |
have "b \<le> a \<Longrightarrow> closed_segment b a = {b .. a}" |
|
6434 |
and "a \<le> b \<Longrightarrow> closed_segment a b = {a .. b}" |
|
6435 |
by (auto simp: convex_hull_eq_real_cbox segment_convex_hull) |
|
6436 |
thus ?thesis |
|
6437 |
by (auto simp: closed_segment_commute) |
|
6438 |
qed |
|
6439 |
||
60809
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
6440 |
lemma closed_segment_real_eq: |
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
6441 |
fixes u::real shows "closed_segment u v = (\<lambda>x. (v - u) * x + u) ` {0..1}" |
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
6442 |
by (simp add: add.commute [of u] image_affinity_atLeastAtMost [where c=u] closed_segment_eq_real_ivl) |
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
6443 |
|
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6444 |
subsubsection\<open>More lemmas, especially for working with the underlying formula\<close> |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6445 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6446 |
lemma segment_eq_compose: |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6447 |
fixes a :: "'a :: real_vector" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6448 |
shows "(\<lambda>u. (1 - u) *\<^sub>R a + u *\<^sub>R b) = (\<lambda>x. a + x) o (\<lambda>u. u *\<^sub>R (b - a))" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6449 |
by (simp add: o_def algebra_simps) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6450 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6451 |
lemma segment_degen_1: |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6452 |
fixes a :: "'a :: real_vector" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6453 |
shows "(1 - u) *\<^sub>R a + u *\<^sub>R b = b \<longleftrightarrow> a=b \<or> u=1" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6454 |
proof - |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6455 |
{ assume "(1 - u) *\<^sub>R a + u *\<^sub>R b = b" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6456 |
then have "(1 - u) *\<^sub>R a = (1 - u) *\<^sub>R b" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6457 |
by (simp add: algebra_simps) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6458 |
then have "a=b \<or> u=1" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6459 |
by simp |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6460 |
} then show ?thesis |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6461 |
by (auto simp: algebra_simps) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6462 |
qed |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6463 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6464 |
lemma segment_degen_0: |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6465 |
fixes a :: "'a :: real_vector" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6466 |
shows "(1 - u) *\<^sub>R a + u *\<^sub>R b = a \<longleftrightarrow> a=b \<or> u=0" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6467 |
using segment_degen_1 [of "1-u" b a] |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6468 |
by (auto simp: algebra_simps) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6469 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6470 |
lemma closed_segment_image_interval: |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6471 |
"closed_segment a b = (\<lambda>u. (1 - u) *\<^sub>R a + u *\<^sub>R b) ` {0..1}" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6472 |
by (auto simp: set_eq_iff image_iff closed_segment_def) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6473 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6474 |
lemma open_segment_image_interval: |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6475 |
"open_segment a b = (if a=b then {} else (\<lambda>u. (1 - u) *\<^sub>R a + u *\<^sub>R b) ` {0<..<1})" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6476 |
by (auto simp: open_segment_def closed_segment_def segment_degen_0 segment_degen_1) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6477 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6478 |
lemmas segment_image_interval = closed_segment_image_interval open_segment_image_interval |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6479 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6480 |
lemma closure_closed_segment [simp]: |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6481 |
fixes a :: "'a::euclidean_space" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6482 |
shows "closure(closed_segment a b) = closed_segment a b" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6483 |
by (simp add: closure_eq compact_imp_closed segment_convex_hull compact_convex_hull) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6484 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6485 |
lemma closure_open_segment [simp]: |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6486 |
fixes a :: "'a::euclidean_space" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6487 |
shows "closure(open_segment a b) = (if a = b then {} else closed_segment a b)" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6488 |
proof - |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6489 |
have "closure ((\<lambda>u. u *\<^sub>R (b - a)) ` {0<..<1}) = (\<lambda>u. u *\<^sub>R (b - a)) ` closure {0<..<1}" if "a \<noteq> b" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6490 |
apply (rule closure_injective_linear_image [symmetric]) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6491 |
apply (simp add:) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6492 |
using that by (simp add: inj_on_def) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6493 |
then show ?thesis |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6494 |
by (simp add: segment_image_interval segment_eq_compose closure_greaterThanLessThan [symmetric] |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6495 |
closure_translation image_comp [symmetric] del: closure_greaterThanLessThan) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6496 |
qed |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6497 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6498 |
lemma closed_segment [simp]: |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6499 |
fixes a :: "'a::euclidean_space" shows "closed (closed_segment a b)" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6500 |
using closure_subset_eq by fastforce |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6501 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6502 |
lemma closed_open_segment_iff [simp]: |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6503 |
fixes a :: "'a::euclidean_space" shows "closed(open_segment a b) \<longleftrightarrow> a = b" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6504 |
by (metis open_segment_def DiffE closure_eq closure_open_segment ends_in_segment(1) insert_iff segment_image_interval(2)) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6505 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6506 |
lemma compact_segment [simp]: |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6507 |
fixes a :: "'a::euclidean_space" shows "compact (closed_segment a b)" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6508 |
by (simp add: compact_convex_hull segment_convex_hull) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6509 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6510 |
lemma compact_open_segment_iff [simp]: |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6511 |
fixes a :: "'a::euclidean_space" shows "compact(open_segment a b) \<longleftrightarrow> a = b" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6512 |
by (simp add: bounded_open_segment compact_eq_bounded_closed) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6513 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6514 |
lemma convex_closed_segment [iff]: "convex (closed_segment a b)" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6515 |
unfolding segment_convex_hull by(rule convex_convex_hull) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6516 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6517 |
lemma convex_open_segment [iff]: "convex(open_segment a b)" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6518 |
proof - |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6519 |
have "convex ((\<lambda>u. u *\<^sub>R (b-a)) ` {0<..<1})" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6520 |
by (rule convex_linear_image) auto |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6521 |
then show ?thesis |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6522 |
apply (simp add: open_segment_image_interval segment_eq_compose) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6523 |
by (metis image_comp convex_translation) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6524 |
qed |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6525 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6526 |
lemmas convex_segment = convex_closed_segment convex_open_segment |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6527 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6528 |
lemma connected_segment [iff]: |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6529 |
fixes x :: "'a :: real_normed_vector" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6530 |
shows "connected (closed_segment x y)" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6531 |
by (simp add: convex_connected) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6532 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6533 |
lemma affine_hull_closed_segment [simp]: |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6534 |
"affine hull (closed_segment a b) = affine hull {a,b}" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6535 |
by (simp add: segment_convex_hull) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6536 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6537 |
lemma affine_hull_open_segment [simp]: |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6538 |
fixes a :: "'a::euclidean_space" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6539 |
shows "affine hull (open_segment a b) = (if a = b then {} else affine hull {a,b})" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6540 |
by (metis affine_hull_convex_hull affine_hull_empty closure_open_segment closure_same_affine_hull segment_convex_hull) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6541 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6542 |
subsubsection\<open>Betweenness\<close> |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6543 |
|
33175 | 6544 |
lemma between_mem_segment: "between (a,b) x \<longleftrightarrow> x \<in> closed_segment a b" |
44170
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44142
diff
changeset
|
6545 |
unfolding between_def by auto |
33175 | 6546 |
|
53348 | 6547 |
lemma between: "between (a, b) (x::'a::euclidean_space) \<longleftrightarrow> dist a b = (dist a x) + (dist x b)" |
6548 |
proof (cases "a = b") |
|
6549 |
case True |
|
6550 |
then show ?thesis |
|
6551 |
unfolding between_def split_conv |
|
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6552 |
by (auto simp add: dist_commute) |
53348 | 6553 |
next |
6554 |
case False |
|
6555 |
then have Fal: "norm (a - b) \<noteq> 0" and Fal2: "norm (a - b) > 0" |
|
6556 |
by auto |
|
6557 |
have *: "\<And>u. a - ((1 - u) *\<^sub>R a + u *\<^sub>R b) = u *\<^sub>R (a - b)" |
|
6558 |
by (auto simp add: algebra_simps) |
|
6559 |
show ?thesis |
|
6560 |
unfolding between_def split_conv closed_segment_def mem_Collect_eq |
|
6561 |
apply rule |
|
6562 |
apply (elim exE conjE) |
|
6563 |
apply (subst dist_triangle_eq) |
|
6564 |
proof - |
|
6565 |
fix u |
|
6566 |
assume as: "x = (1 - u) *\<^sub>R a + u *\<^sub>R b" "0 \<le> u" "u \<le> 1" |
|
6567 |
then have *: "a - x = u *\<^sub>R (a - b)" "x - b = (1 - u) *\<^sub>R (a - b)" |
|
6568 |
unfolding as(1) by (auto simp add:algebra_simps) |
|
6569 |
show "norm (a - x) *\<^sub>R (x - b) = norm (x - b) *\<^sub>R (a - x)" |
|
6570 |
unfolding norm_minus_commute[of x a] * using as(2,3) |
|
6571 |
by (auto simp add: field_simps) |
|
6572 |
next |
|
6573 |
assume as: "dist a b = dist a x + dist x b" |
|
6574 |
have "norm (a - x) / norm (a - b) \<le> 1" |
|
56571
f4635657d66f
added divide_nonneg_nonneg and co; made it a simp rule
hoelzl
parents:
56544
diff
changeset
|
6575 |
using Fal2 unfolding as[unfolded dist_norm] norm_ge_zero by auto |
53348 | 6576 |
then show "\<exists>u. x = (1 - u) *\<^sub>R a + u *\<^sub>R b \<and> 0 \<le> u \<and> u \<le> 1" |
6577 |
apply (rule_tac x="dist a x / dist a b" in exI) |
|
6578 |
unfolding dist_norm |
|
6579 |
apply (subst euclidean_eq_iff) |
|
6580 |
apply rule |
|
6581 |
defer |
|
6582 |
apply rule |
|
56571
f4635657d66f
added divide_nonneg_nonneg and co; made it a simp rule
hoelzl
parents:
56544
diff
changeset
|
6583 |
prefer 3 |
53348 | 6584 |
apply rule |
6585 |
proof - |
|
6586 |
fix i :: 'a |
|
6587 |
assume i: "i \<in> Basis" |
|
6588 |
have "((1 - norm (a - x) / norm (a - b)) *\<^sub>R a + (norm (a - x) / norm (a - b)) *\<^sub>R b) \<bullet> i = |
|
6589 |
((norm (a - b) - norm (a - x)) * (a \<bullet> i) + norm (a - x) * (b \<bullet> i)) / norm (a - b)" |
|
6590 |
using Fal by (auto simp add: field_simps inner_simps) |
|
6591 |
also have "\<dots> = x\<bullet>i" |
|
6592 |
apply (rule divide_eq_imp[OF Fal]) |
|
6593 |
unfolding as[unfolded dist_norm] |
|
6594 |
using as[unfolded dist_triangle_eq] |
|
6595 |
apply - |
|
6596 |
apply (subst (asm) euclidean_eq_iff) |
|
6597 |
using i |
|
6598 |
apply (erule_tac x=i in ballE) |
|
57865 | 6599 |
apply (auto simp add: field_simps inner_simps) |
53348 | 6600 |
done |
6601 |
finally show "x \<bullet> i = |
|
6602 |
((1 - norm (a - x) / norm (a - b)) *\<^sub>R a + (norm (a - x) / norm (a - b)) *\<^sub>R b) \<bullet> i" |
|
6603 |
by auto |
|
6604 |
qed (insert Fal2, auto) |
|
6605 |
qed |
|
6606 |
qed |
|
6607 |
||
6608 |
lemma between_midpoint: |
|
6609 |
fixes a :: "'a::euclidean_space" |
|
6610 |
shows "between (a,b) (midpoint a b)" (is ?t1) |
|
6611 |
and "between (b,a) (midpoint a b)" (is ?t2) |
|
6612 |
proof - |
|
6613 |
have *: "\<And>x y z. x = (1/2::real) *\<^sub>R z \<Longrightarrow> y = (1/2) *\<^sub>R z \<Longrightarrow> norm z = norm x + norm y" |
|
6614 |
by auto |
|
6615 |
show ?t1 ?t2 |
|
6616 |
unfolding between midpoint_def dist_norm |
|
6617 |
apply(rule_tac[!] *) |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
6618 |
unfolding euclidean_eq_iff[where 'a='a] |
53348 | 6619 |
apply (auto simp add: field_simps inner_simps) |
6620 |
done |
|
6621 |
qed |
|
33175 | 6622 |
|
6623 |
lemma between_mem_convex_hull: |
|
6624 |
"between (a,b) x \<longleftrightarrow> x \<in> convex hull {a,b}" |
|
6625 |
unfolding between_mem_segment segment_convex_hull .. |
|
6626 |
||
53348 | 6627 |
|
60420 | 6628 |
subsection \<open>Shrinking towards the interior of a convex set\<close> |
33175 | 6629 |
|
6630 |
lemma mem_interior_convex_shrink: |
|
53348 | 6631 |
fixes s :: "'a::euclidean_space set" |
6632 |
assumes "convex s" |
|
6633 |
and "c \<in> interior s" |
|
6634 |
and "x \<in> s" |
|
6635 |
and "0 < e" |
|
6636 |
and "e \<le> 1" |
|
33175 | 6637 |
shows "x - e *\<^sub>R (x - c) \<in> interior s" |
53348 | 6638 |
proof - |
6639 |
obtain d where "d > 0" and d: "ball c d \<subseteq> s" |
|
6640 |
using assms(2) unfolding mem_interior by auto |
|
6641 |
show ?thesis |
|
6642 |
unfolding mem_interior |
|
6643 |
apply (rule_tac x="e*d" in exI) |
|
6644 |
apply rule |
|
6645 |
defer |
|
6646 |
unfolding subset_eq Ball_def mem_ball |
|
6647 |
proof (rule, rule) |
|
6648 |
fix y |
|
6649 |
assume as: "dist (x - e *\<^sub>R (x - c)) y < e * d" |
|
6650 |
have *: "y = (1 - (1 - e)) *\<^sub>R ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) + (1 - e) *\<^sub>R x" |
|
60420 | 6651 |
using \<open>e > 0\<close> by (auto simp add: scaleR_left_diff_distrib scaleR_right_diff_distrib) |
33175 | 6652 |
have "dist c ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) = abs(1/e) * norm (e *\<^sub>R c - y + (1 - e) *\<^sub>R x)" |
53348 | 6653 |
unfolding dist_norm |
6654 |
unfolding norm_scaleR[symmetric] |
|
6655 |
apply (rule arg_cong[where f=norm]) |
|
60420 | 6656 |
using \<open>e > 0\<close> |
53348 | 6657 |
by (auto simp add: euclidean_eq_iff[where 'a='a] field_simps inner_simps) |
6658 |
also have "\<dots> = abs (1/e) * norm (x - e *\<^sub>R (x - c) - y)" |
|
6659 |
by (auto intro!:arg_cong[where f=norm] simp add: algebra_simps) |
|
6660 |
also have "\<dots> < d" |
|
60420 | 6661 |
using as[unfolded dist_norm] and \<open>e > 0\<close> |
6662 |
by (auto simp add:pos_divide_less_eq[OF \<open>e > 0\<close>] mult.commute) |
|
53348 | 6663 |
finally show "y \<in> s" |
6664 |
apply (subst *) |
|
6665 |
apply (rule assms(1)[unfolded convex_alt,rule_format]) |
|
6666 |
apply (rule d[unfolded subset_eq,rule_format]) |
|
6667 |
unfolding mem_ball |
|
6668 |
using assms(3-5) |
|
6669 |
apply auto |
|
6670 |
done |
|
60420 | 6671 |
qed (insert \<open>e>0\<close> \<open>d>0\<close>, auto) |
53348 | 6672 |
qed |
33175 | 6673 |
|
6674 |
lemma mem_interior_closure_convex_shrink: |
|
53348 | 6675 |
fixes s :: "'a::euclidean_space set" |
6676 |
assumes "convex s" |
|
6677 |
and "c \<in> interior s" |
|
6678 |
and "x \<in> closure s" |
|
6679 |
and "0 < e" |
|
6680 |
and "e \<le> 1" |
|
33175 | 6681 |
shows "x - e *\<^sub>R (x - c) \<in> interior s" |
53348 | 6682 |
proof - |
6683 |
obtain d where "d > 0" and d: "ball c d \<subseteq> s" |
|
6684 |
using assms(2) unfolding mem_interior by auto |
|
6685 |
have "\<exists>y\<in>s. norm (y - x) * (1 - e) < e * d" |
|
6686 |
proof (cases "x \<in> s") |
|
6687 |
case True |
|
6688 |
then show ?thesis |
|
60420 | 6689 |
using \<open>e > 0\<close> \<open>d > 0\<close> |
53348 | 6690 |
apply (rule_tac bexI[where x=x]) |
56544 | 6691 |
apply (auto) |
53348 | 6692 |
done |
6693 |
next |
|
6694 |
case False |
|
6695 |
then have x: "x islimpt s" |
|
6696 |
using assms(3)[unfolded closure_def] by auto |
|
6697 |
show ?thesis |
|
6698 |
proof (cases "e = 1") |
|
6699 |
case True |
|
6700 |
obtain y where "y \<in> s" "y \<noteq> x" "dist y x < 1" |
|
33175 | 6701 |
using x[unfolded islimpt_approachable,THEN spec[where x=1]] by auto |
53348 | 6702 |
then show ?thesis |
6703 |
apply (rule_tac x=y in bexI) |
|
6704 |
unfolding True |
|
60420 | 6705 |
using \<open>d > 0\<close> |
53348 | 6706 |
apply auto |
6707 |
done |
|
6708 |
next |
|
6709 |
case False |
|
6710 |
then have "0 < e * d / (1 - e)" and *: "1 - e > 0" |
|
60420 | 6711 |
using \<open>e \<le> 1\<close> \<open>e > 0\<close> \<open>d > 0\<close> by auto |
53348 | 6712 |
then obtain y where "y \<in> s" "y \<noteq> x" "dist y x < e * d / (1 - e)" |
33175 | 6713 |
using x[unfolded islimpt_approachable,THEN spec[where x="e*d / (1 - e)"]] by auto |
53348 | 6714 |
then show ?thesis |
6715 |
apply (rule_tac x=y in bexI) |
|
6716 |
unfolding dist_norm |
|
6717 |
using pos_less_divide_eq[OF *] |
|
6718 |
apply auto |
|
6719 |
done |
|
6720 |
qed |
|
6721 |
qed |
|
6722 |
then obtain y where "y \<in> s" and y: "norm (y - x) * (1 - e) < e * d" |
|
6723 |
by auto |
|
33175 | 6724 |
def z \<equiv> "c + ((1 - e) / e) *\<^sub>R (x - y)" |
53348 | 6725 |
have *: "x - e *\<^sub>R (x - c) = y - e *\<^sub>R (y - z)" |
60420 | 6726 |
unfolding z_def using \<open>e > 0\<close> |
53348 | 6727 |
by (auto simp add: scaleR_right_diff_distrib scaleR_right_distrib scaleR_left_diff_distrib) |
6728 |
have "z \<in> interior s" |
|
6729 |
apply (rule interior_mono[OF d,unfolded subset_eq,rule_format]) |
|
33175 | 6730 |
unfolding interior_open[OF open_ball] mem_ball z_def dist_norm using y and assms(4,5) |
53348 | 6731 |
apply (auto simp add:field_simps norm_minus_commute) |
6732 |
done |
|
6733 |
then show ?thesis |
|
6734 |
unfolding * |
|
6735 |
apply - |
|
6736 |
apply (rule mem_interior_convex_shrink) |
|
60420 | 6737 |
using assms(1,4-5) \<open>y\<in>s\<close> |
53348 | 6738 |
apply auto |
6739 |
done |
|
6740 |
qed |
|
6741 |
||
33175 | 6742 |
|
60420 | 6743 |
subsection \<open>Some obvious but surprisingly hard simplex lemmas\<close> |
33175 | 6744 |
|
6745 |
lemma simplex: |
|
53348 | 6746 |
assumes "finite s" |
6747 |
and "0 \<notin> s" |
|
6748 |
shows "convex hull (insert 0 s) = |
|
6749 |
{y. (\<exists>u. (\<forall>x\<in>s. 0 \<le> u x) \<and> setsum u s \<le> 1 \<and> setsum (\<lambda>x. u x *\<^sub>R x) s = y)}" |
|
6750 |
unfolding convex_hull_finite[OF finite.insertI[OF assms(1)]] |
|
6751 |
apply (rule set_eqI, rule) |
|
6752 |
unfolding mem_Collect_eq |
|
6753 |
apply (erule_tac[!] exE) |
|
6754 |
apply (erule_tac[!] conjE)+ |
|
6755 |
unfolding setsum_clauses(2)[OF assms(1)] |
|
6756 |
apply (rule_tac x=u in exI) |
|
6757 |
defer |
|
6758 |
apply (rule_tac x="\<lambda>x. if x = 0 then 1 - setsum u s else u x" in exI) |
|
6759 |
using assms(2) |
|
6760 |
unfolding if_smult and setsum_delta_notmem[OF assms(2)] |
|
6761 |
apply auto |
|
6762 |
done |
|
33175 | 6763 |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
6764 |
lemma substd_simplex: |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
6765 |
assumes d: "d \<subseteq> Basis" |
53348 | 6766 |
shows "convex hull (insert 0 d) = |
54465 | 6767 |
{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)}" |
40377 | 6768 |
(is "convex hull (insert 0 ?p) = ?s") |
53348 | 6769 |
proof - |
6770 |
let ?D = d |
|
6771 |
have "0 \<notin> ?p" |
|
6772 |
using assms by (auto simp: image_def) |
|
6773 |
from d have "finite d" |
|
6774 |
by (blast intro: finite_subset finite_Basis) |
|
6775 |
show ?thesis |
|
60420 | 6776 |
unfolding simplex[OF \<open>finite d\<close> \<open>0 \<notin> ?p\<close>] |
53348 | 6777 |
apply (rule set_eqI) |
6778 |
unfolding mem_Collect_eq |
|
6779 |
apply rule |
|
6780 |
apply (elim exE conjE) |
|
6781 |
apply (erule_tac[2] conjE)+ |
|
6782 |
proof - |
|
6783 |
fix x :: "'a::euclidean_space" |
|
6784 |
fix u |
|
6785 |
assume as: "\<forall>x\<in>?D. 0 \<le> u x" "setsum u ?D \<le> 1" "(\<Sum>x\<in>?D. u x *\<^sub>R x) = x" |
|
6786 |
have *: "\<forall>i\<in>Basis. i:d \<longrightarrow> u i = x\<bullet>i" |
|
54465 | 6787 |
and "(\<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x \<bullet> i = 0)" |
53348 | 6788 |
using as(3) |
6789 |
unfolding substdbasis_expansion_unique[OF assms] |
|
6790 |
by auto |
|
6791 |
then have **: "setsum u ?D = setsum (op \<bullet> x) ?D" |
|
6792 |
apply - |
|
57418 | 6793 |
apply (rule setsum.cong) |
53348 | 6794 |
using assms |
6795 |
apply auto |
|
6796 |
done |
|
6797 |
have "(\<forall>i\<in>Basis. 0 \<le> x\<bullet>i) \<and> setsum (op \<bullet> x) ?D \<le> 1" |
|
6798 |
proof (rule,rule) |
|
6799 |
fix i :: 'a |
|
6800 |
assume i: "i \<in> Basis" |
|
6801 |
have "i \<in> d \<Longrightarrow> 0 \<le> x\<bullet>i" |
|
6802 |
unfolding *[rule_format,OF i,symmetric] |
|
6803 |
apply (rule_tac as(1)[rule_format]) |
|
6804 |
apply auto |
|
6805 |
done |
|
6806 |
moreover have "i \<notin> d \<Longrightarrow> 0 \<le> x\<bullet>i" |
|
60420 | 6807 |
using \<open>(\<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x \<bullet> i = 0)\<close>[rule_format, OF i] by auto |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
6808 |
ultimately show "0 \<le> x\<bullet>i" by auto |
53348 | 6809 |
qed (insert as(2)[unfolded **], auto) |
6810 |
then show "(\<forall>i\<in>Basis. 0 \<le> x\<bullet>i) \<and> setsum (op \<bullet> x) ?D \<le> 1 \<and> (\<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x \<bullet> i = 0)" |
|
60420 | 6811 |
using \<open>(\<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x \<bullet> i = 0)\<close> by auto |
53348 | 6812 |
next |
6813 |
fix x :: "'a::euclidean_space" |
|
6814 |
assume as: "\<forall>i\<in>Basis. 0 \<le> x \<bullet> i" "setsum (op \<bullet> x) ?D \<le> 1" "(\<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x \<bullet> i = 0)" |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
6815 |
show "\<exists>u. (\<forall>x\<in>?D. 0 \<le> u x) \<and> setsum u ?D \<le> 1 \<and> (\<Sum>x\<in>?D. u x *\<^sub>R x) = x" |
53348 | 6816 |
using as d |
6817 |
unfolding substdbasis_expansion_unique[OF assms] |
|
6818 |
apply (rule_tac x="inner x" in exI) |
|
6819 |
apply auto |
|
6820 |
done |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
6821 |
qed |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
6822 |
qed |
40377 | 6823 |
|
33175 | 6824 |
lemma std_simplex: |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
6825 |
"convex hull (insert 0 Basis) = |
53348 | 6826 |
{x::'a::euclidean_space. (\<forall>i\<in>Basis. 0 \<le> x\<bullet>i) \<and> setsum (\<lambda>i. x\<bullet>i) Basis \<le> 1}" |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
6827 |
using substd_simplex[of Basis] by auto |
33175 | 6828 |
|
6829 |
lemma interior_std_simplex: |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
6830 |
"interior (convex hull (insert 0 Basis)) = |
53348 | 6831 |
{x::'a::euclidean_space. (\<forall>i\<in>Basis. 0 < x\<bullet>i) \<and> setsum (\<lambda>i. x\<bullet>i) Basis < 1}" |
6832 |
apply (rule set_eqI) |
|
6833 |
unfolding mem_interior std_simplex |
|
6834 |
unfolding subset_eq mem_Collect_eq Ball_def mem_ball |
|
6835 |
unfolding Ball_def[symmetric] |
|
6836 |
apply rule |
|
6837 |
apply (elim exE conjE) |
|
6838 |
defer |
|
6839 |
apply (erule conjE) |
|
6840 |
proof - |
|
6841 |
fix x :: 'a |
|
6842 |
fix e |
|
6843 |
assume "e > 0" and as: "\<forall>xa. dist x xa < e \<longrightarrow> (\<forall>x\<in>Basis. 0 \<le> xa \<bullet> x) \<and> setsum (op \<bullet> xa) Basis \<le> 1" |
|
6844 |
show "(\<forall>xa\<in>Basis. 0 < x \<bullet> xa) \<and> setsum (op \<bullet> x) Basis < 1" |
|
6845 |
apply safe |
|
6846 |
proof - |
|
6847 |
fix i :: 'a |
|
6848 |
assume i: "i \<in> Basis" |
|
6849 |
then show "0 < x \<bullet> i" |
|
60420 | 6850 |
using as[THEN spec[where x="x - (e / 2) *\<^sub>R i"]] and \<open>e > 0\<close> |
53348 | 6851 |
unfolding dist_norm |
6852 |
by (auto elim!: ballE[where x=i] simp: inner_simps) |
|
6853 |
next |
|
60420 | 6854 |
have **: "dist x (x + (e / 2) *\<^sub>R (SOME i. i\<in>Basis)) < e" using \<open>e > 0\<close> |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
6855 |
unfolding dist_norm |
53348 | 6856 |
by (auto intro!: mult_strict_left_mono simp: SOME_Basis) |
6857 |
have "\<And>i. i \<in> Basis \<Longrightarrow> (x + (e / 2) *\<^sub>R (SOME i. i\<in>Basis)) \<bullet> i = |
|
6858 |
x\<bullet>i + (if i = (SOME i. i\<in>Basis) then e/2 else 0)" |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
6859 |
by (auto simp: SOME_Basis inner_Basis inner_simps) |
53348 | 6860 |
then have *: "setsum (op \<bullet> (x + (e / 2) *\<^sub>R (SOME i. i\<in>Basis))) Basis = |
6861 |
setsum (\<lambda>i. x\<bullet>i + (if (SOME i. i\<in>Basis) = i then e/2 else 0)) Basis" |
|
57418 | 6862 |
apply (rule_tac setsum.cong) |
53348 | 6863 |
apply auto |
6864 |
done |
|
6865 |
have "setsum (op \<bullet> x) Basis < setsum (op \<bullet> (x + (e / 2) *\<^sub>R (SOME i. i\<in>Basis))) Basis" |
|
57418 | 6866 |
unfolding * setsum.distrib |
60420 | 6867 |
using \<open>e > 0\<close> DIM_positive[where 'a='a] |
57418 | 6868 |
apply (subst setsum.delta') |
53348 | 6869 |
apply (auto simp: SOME_Basis) |
6870 |
done |
|
6871 |
also have "\<dots> \<le> 1" |
|
6872 |
using ** |
|
6873 |
apply (drule_tac as[rule_format]) |
|
6874 |
apply auto |
|
6875 |
done |
|
6876 |
finally show "setsum (op \<bullet> x) Basis < 1" by auto |
|
6877 |
qed |
|
6878 |
next |
|
6879 |
fix x :: 'a |
|
6880 |
assume as: "\<forall>i\<in>Basis. 0 < x \<bullet> i" "setsum (op \<bullet> x) Basis < 1" |
|
55697 | 6881 |
obtain a :: 'b where "a \<in> UNIV" using UNIV_witness .. |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
6882 |
let ?d = "(1 - setsum (op \<bullet> x) Basis) / real (DIM('a))" |
53348 | 6883 |
have "Min ((op \<bullet> x) ` Basis) > 0" |
6884 |
apply (rule Min_grI) |
|
6885 |
using as(1) |
|
6886 |
apply auto |
|
6887 |
done |
|
6888 |
moreover have "?d > 0" |
|
56541 | 6889 |
using as(2) by (auto simp: Suc_le_eq DIM_positive) |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
6890 |
ultimately show "\<exists>e>0. \<forall>y. dist x y < e \<longrightarrow> (\<forall>i\<in>Basis. 0 \<le> y \<bullet> i) \<and> setsum (op \<bullet> y) Basis \<le> 1" |
59807 | 6891 |
apply (rule_tac x="min (Min ((op \<bullet> x) ` Basis)) D" for D in exI) |
53348 | 6892 |
apply rule |
6893 |
defer |
|
6894 |
apply (rule, rule) |
|
6895 |
proof - |
|
6896 |
fix y |
|
6897 |
assume y: "dist x y < min (Min (op \<bullet> x ` Basis)) ?d" |
|
6898 |
have "setsum (op \<bullet> y) Basis \<le> setsum (\<lambda>i. x\<bullet>i + ?d) Basis" |
|
6899 |
proof (rule setsum_mono) |
|
6900 |
fix i :: 'a |
|
6901 |
assume i: "i \<in> Basis" |
|
6902 |
then have "abs (y\<bullet>i - x\<bullet>i) < ?d" |
|
6903 |
apply - |
|
6904 |
apply (rule le_less_trans) |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
6905 |
using Basis_le_norm[OF i, of "y - x"] |
53348 | 6906 |
using y[unfolded min_less_iff_conj dist_norm, THEN conjunct2] |
6907 |
apply (auto simp add: norm_minus_commute inner_diff_left) |
|
6908 |
done |
|
6909 |
then show "y \<bullet> i \<le> x \<bullet> i + ?d" by auto |
|
6910 |
qed |
|
6911 |
also have "\<dots> \<le> 1" |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61531
diff
changeset
|
6912 |
unfolding setsum.distrib setsum_constant |
53348 | 6913 |
by (auto simp add: Suc_le_eq) |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
6914 |
finally show "(\<forall>i\<in>Basis. 0 \<le> y \<bullet> i) \<and> setsum (op \<bullet> y) Basis \<le> 1" |
53348 | 6915 |
proof safe |
6916 |
fix i :: 'a |
|
6917 |
assume i: "i \<in> Basis" |
|
6918 |
have "norm (x - y) < x\<bullet>i" |
|
6919 |
apply (rule less_le_trans) |
|
6920 |
apply (rule y[unfolded min_less_iff_conj dist_norm, THEN conjunct1]) |
|
6921 |
using i |
|
6922 |
apply auto |
|
6923 |
done |
|
6924 |
then show "0 \<le> y\<bullet>i" |
|
6925 |
using Basis_le_norm[OF i, of "x - y"] and as(1)[rule_format, OF i] |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
6926 |
by (auto simp: inner_simps) |
53348 | 6927 |
qed |
6928 |
qed auto |
|
6929 |
qed |
|
6930 |
||
6931 |
lemma interior_std_simplex_nonempty: |
|
6932 |
obtains a :: "'a::euclidean_space" where |
|
6933 |
"a \<in> interior(convex hull (insert 0 Basis))" |
|
6934 |
proof - |
|
6935 |
let ?D = "Basis :: 'a set" |
|
6936 |
let ?a = "setsum (\<lambda>b::'a. inverse (2 * real DIM('a)) *\<^sub>R b) Basis" |
|
6937 |
{ |
|
6938 |
fix i :: 'a |
|
6939 |
assume i: "i \<in> Basis" |
|
6940 |
have "?a \<bullet> i = inverse (2 * real DIM('a))" |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
6941 |
by (rule trans[of _ "setsum (\<lambda>j. if i = j then inverse (2 * real DIM('a)) else 0) ?D"]) |
57418 | 6942 |
(simp_all add: setsum.If_cases i) } |
33175 | 6943 |
note ** = this |
53348 | 6944 |
show ?thesis |
6945 |
apply (rule that[of ?a]) |
|
6946 |
unfolding interior_std_simplex mem_Collect_eq |
|
6947 |
proof safe |
|
6948 |
fix i :: 'a |
|
6949 |
assume i: "i \<in> Basis" |
|
6950 |
show "0 < ?a \<bullet> i" |
|
6951 |
unfolding **[OF i] by (auto simp add: Suc_le_eq DIM_positive) |
|
6952 |
next |
|
6953 |
have "setsum (op \<bullet> ?a) ?D = setsum (\<lambda>i. inverse (2 * real DIM('a))) ?D" |
|
57418 | 6954 |
apply (rule setsum.cong) |
6955 |
apply rule |
|
53348 | 6956 |
apply auto |
6957 |
done |
|
6958 |
also have "\<dots> < 1" |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61531
diff
changeset
|
6959 |
unfolding setsum_constant divide_inverse[symmetric] |
53348 | 6960 |
by (auto simp add: field_simps) |
6961 |
finally show "setsum (op \<bullet> ?a) ?D < 1" by auto |
|
40377 | 6962 |
qed |
53348 | 6963 |
qed |
6964 |
||
6965 |
lemma rel_interior_substd_simplex: |
|
6966 |
assumes d: "d \<subseteq> Basis" |
|
6967 |
shows "rel_interior (convex hull (insert 0 d)) = |
|
6968 |
{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)}" |
|
6969 |
(is "rel_interior (convex hull (insert 0 ?p)) = ?s") |
|
6970 |
proof - |
|
6971 |
have "finite d" |
|
6972 |
apply (rule finite_subset) |
|
6973 |
using assms |
|
6974 |
apply auto |
|
6975 |
done |
|
6976 |
show ?thesis |
|
6977 |
proof (cases "d = {}") |
|
6978 |
case True |
|
6979 |
then show ?thesis |
|
6980 |
using rel_interior_sing using euclidean_eq_iff[of _ 0] by auto |
|
6981 |
next |
|
6982 |
case False |
|
6983 |
have h0: "affine hull (convex hull (insert 0 ?p)) = |
|
6984 |
{x::'a::euclidean_space. (\<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x\<bullet>i = 0)}" |
|
6985 |
using affine_hull_convex_hull affine_hull_substd_basis assms by auto |
|
6986 |
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" |
|
6987 |
by auto |
|
6988 |
{ |
|
6989 |
fix x :: "'a::euclidean_space" |
|
6990 |
assume x: "x \<in> rel_interior (convex hull (insert 0 ?p))" |
|
6991 |
then obtain e where e0: "e > 0" and |
|
6992 |
"ball x e \<inter> {xa. (\<forall>i\<in>Basis. i \<notin> d \<longrightarrow> xa\<bullet>i = 0)} \<subseteq> convex hull (insert 0 ?p)" |
|
6993 |
using mem_rel_interior_ball[of x "convex hull (insert 0 ?p)"] h0 by auto |
|
6994 |
then have as: "\<forall>xa. dist x xa < e \<and> (\<forall>i\<in>Basis. i \<notin> d \<longrightarrow> xa\<bullet>i = 0) \<longrightarrow> |
|
6995 |
(\<forall>i\<in>d. 0 \<le> xa \<bullet> i) \<and> setsum (op \<bullet> xa) d \<le> 1" |
|
6996 |
unfolding ball_def unfolding substd_simplex[OF assms] using assms by auto |
|
6997 |
have x0: "(\<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x\<bullet>i = 0)" |
|
6998 |
using x rel_interior_subset substd_simplex[OF assms] by auto |
|
54465 | 6999 |
have "(\<forall>i\<in>d. 0 < x \<bullet> i) \<and> setsum (op \<bullet> x) d < 1 \<and> (\<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x\<bullet>i = 0)" |
7000 |
apply rule |
|
7001 |
apply rule |
|
53348 | 7002 |
proof - |
7003 |
fix i :: 'a |
|
7004 |
assume "i \<in> d" |
|
7005 |
then have "\<forall>ia\<in>d. 0 \<le> (x - (e / 2) *\<^sub>R i) \<bullet> ia" |
|
7006 |
apply - |
|
7007 |
apply (rule as[rule_format,THEN conjunct1]) |
|
7008 |
unfolding dist_norm |
|
60420 | 7009 |
using d \<open>e > 0\<close> x0 |
53348 | 7010 |
apply (auto simp: inner_simps inner_Basis) |
7011 |
done |
|
7012 |
then show "0 < x \<bullet> i" |
|
7013 |
apply (erule_tac x=i in ballE) |
|
60420 | 7014 |
using \<open>e > 0\<close> \<open>i \<in> d\<close> d |
53348 | 7015 |
apply (auto simp: inner_simps inner_Basis) |
7016 |
done |
|
7017 |
next |
|
7018 |
obtain a where a: "a \<in> d" |
|
60420 | 7019 |
using \<open>d \<noteq> {}\<close> by auto |
53348 | 7020 |
then have **: "dist x (x + (e / 2) *\<^sub>R a) < e" |
60420 | 7021 |
using \<open>e > 0\<close> norm_Basis[of a] d |
53348 | 7022 |
unfolding dist_norm |
7023 |
by auto |
|
7024 |
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)" |
|
7025 |
using a d by (auto simp: inner_simps inner_Basis) |
|
7026 |
then have *: "setsum (op \<bullet> (x + (e / 2) *\<^sub>R a)) d = |
|
7027 |
setsum (\<lambda>i. x\<bullet>i + (if a = i then e/2 else 0)) d" |
|
57418 | 7028 |
using d by (intro setsum.cong) auto |
53348 | 7029 |
have "a \<in> Basis" |
60420 | 7030 |
using \<open>a \<in> d\<close> d by auto |
53348 | 7031 |
then have h1: "(\<forall>i\<in>Basis. i \<notin> d \<longrightarrow> (x + (e / 2) *\<^sub>R a) \<bullet> i = 0)" |
60420 | 7032 |
using x0 d \<open>a\<in>d\<close> by (auto simp add: inner_add_left inner_Basis) |
53348 | 7033 |
have "setsum (op \<bullet> x) d < setsum (op \<bullet> (x + (e / 2) *\<^sub>R a)) d" |
57418 | 7034 |
unfolding * setsum.distrib |
60420 | 7035 |
using \<open>e > 0\<close> \<open>a \<in> d\<close> |
7036 |
using \<open>finite d\<close> |
|
57418 | 7037 |
by (auto simp add: setsum.delta') |
53348 | 7038 |
also have "\<dots> \<le> 1" |
7039 |
using ** h1 as[rule_format, of "x + (e / 2) *\<^sub>R a"] |
|
7040 |
by auto |
|
7041 |
finally show "setsum (op \<bullet> x) d < 1 \<and> (\<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x\<bullet>i = 0)" |
|
7042 |
using x0 by auto |
|
7043 |
qed |
|
7044 |
} |
|
7045 |
moreover |
|
7046 |
{ |
|
7047 |
fix x :: "'a::euclidean_space" |
|
7048 |
assume as: "x \<in> ?s" |
|
7049 |
have "\<forall>i. 0 < x\<bullet>i \<or> 0 = x\<bullet>i \<longrightarrow> 0 \<le> x\<bullet>i" |
|
7050 |
by auto |
|
7051 |
moreover have "\<forall>i. i \<in> d \<or> i \<notin> d" by auto |
|
7052 |
ultimately |
|
54465 | 7053 |
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" |
53348 | 7054 |
by metis |
7055 |
then have h2: "x \<in> convex hull (insert 0 ?p)" |
|
7056 |
using as assms |
|
7057 |
unfolding substd_simplex[OF assms] by fastforce |
|
7058 |
obtain a where a: "a \<in> d" |
|
60420 | 7059 |
using \<open>d \<noteq> {}\<close> by auto |
53348 | 7060 |
let ?d = "(1 - setsum (op \<bullet> x) d) / real (card d)" |
60420 | 7061 |
have "0 < card d" using \<open>d \<noteq> {}\<close> \<open>finite d\<close> |
44466 | 7062 |
by (simp add: card_gt_0_iff) |
53348 | 7063 |
have "Min ((op \<bullet> x) ` d) > 0" |
60420 | 7064 |
using as \<open>d \<noteq> {}\<close> \<open>finite d\<close> by (simp add: Min_grI) |
7065 |
moreover have "?d > 0" using as using \<open>0 < card d\<close> by auto |
|
53348 | 7066 |
ultimately have h3: "min (Min ((op \<bullet> x) ` d)) ?d > 0" |
7067 |
by auto |
|
54465 | 7068 |
|
53348 | 7069 |
have "x \<in> rel_interior (convex hull (insert 0 ?p))" |
7070 |
unfolding rel_interior_ball mem_Collect_eq h0 |
|
7071 |
apply (rule,rule h2) |
|
7072 |
unfolding substd_simplex[OF assms] |
|
7073 |
apply (rule_tac x="min (Min ((op \<bullet> x) ` d)) ?d" in exI) |
|
7074 |
apply (rule, rule h3) |
|
7075 |
apply safe |
|
7076 |
unfolding mem_ball |
|
7077 |
proof - |
|
7078 |
fix y :: 'a |
|
7079 |
assume y: "dist x y < min (Min (op \<bullet> x ` d)) ?d" |
|
7080 |
assume y2: "\<forall>i\<in>Basis. i \<notin> d \<longrightarrow> y\<bullet>i = 0" |
|
7081 |
have "setsum (op \<bullet> y) d \<le> setsum (\<lambda>i. x\<bullet>i + ?d) d" |
|
7082 |
proof (rule setsum_mono) |
|
7083 |
fix i |
|
7084 |
assume "i \<in> d" |
|
7085 |
with d have i: "i \<in> Basis" |
|
7086 |
by auto |
|
7087 |
have "abs (y\<bullet>i - x\<bullet>i) < ?d" |
|
7088 |
apply (rule le_less_trans) |
|
7089 |
using Basis_le_norm[OF i, of "y - x"] |
|
7090 |
using y[unfolded min_less_iff_conj dist_norm, THEN conjunct2] |
|
7091 |
apply (auto simp add: norm_minus_commute inner_simps) |
|
7092 |
done |
|
7093 |
then show "y \<bullet> i \<le> x \<bullet> i + ?d" by auto |
|
7094 |
qed |
|
7095 |
also have "\<dots> \<le> 1" |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61531
diff
changeset
|
7096 |
unfolding setsum.distrib setsum_constant using \<open>0 < card d\<close> |
53348 | 7097 |
by auto |
7098 |
finally show "setsum (op \<bullet> y) d \<le> 1" . |
|
54465 | 7099 |
|
53348 | 7100 |
fix i :: 'a |
7101 |
assume i: "i \<in> Basis" |
|
7102 |
then show "0 \<le> y\<bullet>i" |
|
7103 |
proof (cases "i\<in>d") |
|
7104 |
case True |
|
7105 |
have "norm (x - y) < x\<bullet>i" |
|
7106 |
using y[unfolded min_less_iff_conj dist_norm, THEN conjunct1] |
|
60420 | 7107 |
using Min_gr_iff[of "op \<bullet> x ` d" "norm (x - y)"] \<open>0 < card d\<close> \<open>i:d\<close> |
53348 | 7108 |
by (simp add: card_gt_0_iff) |
7109 |
then show "0 \<le> y\<bullet>i" |
|
7110 |
using Basis_le_norm[OF i, of "x - y"] and as(1)[rule_format] |
|
7111 |
by (auto simp: inner_simps) |
|
7112 |
qed (insert y2, auto) |
|
7113 |
qed |
|
7114 |
} |
|
7115 |
ultimately have |
|
7116 |
"\<And>x. x \<in> rel_interior (convex hull insert 0 d) \<longleftrightarrow> |
|
7117 |
x \<in> {x. (\<forall>i\<in>d. 0 < x \<bullet> i) \<and> setsum (op \<bullet> x) d < 1 \<and> (\<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x \<bullet> i = 0)}" |
|
7118 |
by blast |
|
7119 |
then show ?thesis by (rule set_eqI) |
|
40377 | 7120 |
qed |
53348 | 7121 |
qed |
7122 |
||
7123 |
lemma rel_interior_substd_simplex_nonempty: |
|
7124 |
assumes "d \<noteq> {}" |
|
7125 |
and "d \<subseteq> Basis" |
|
7126 |
obtains a :: "'a::euclidean_space" |
|
7127 |
where "a \<in> rel_interior (convex hull (insert 0 d))" |
|
7128 |
proof - |
|
7129 |
let ?D = d |
|
7130 |
let ?a = "setsum (\<lambda>b::'a::euclidean_space. inverse (2 * real (card d)) *\<^sub>R b) ?D" |
|
7131 |
have "finite d" |
|
7132 |
apply (rule finite_subset) |
|
7133 |
using assms(2) |
|
7134 |
apply auto |
|
7135 |
done |
|
7136 |
then have d1: "0 < real (card d)" |
|
60420 | 7137 |
using \<open>d \<noteq> {}\<close> by auto |
53348 | 7138 |
{ |
7139 |
fix i |
|
7140 |
assume "i \<in> d" |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
7141 |
have "?a \<bullet> i = inverse (2 * real (card d))" |
53348 | 7142 |
apply (rule trans[of _ "setsum (\<lambda>j. if i = j then inverse (2 * real (card d)) else 0) ?D"]) |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
7143 |
unfolding inner_setsum_left |
57418 | 7144 |
apply (rule setsum.cong) |
60420 | 7145 |
using \<open>i \<in> d\<close> \<open>finite d\<close> setsum.delta'[of d i "(\<lambda>k. inverse (2 * real (card d)))"] |
53348 | 7146 |
d1 assms(2) |
57418 | 7147 |
by (auto simp: inner_Basis set_rev_mp[OF _ assms(2)]) |
53348 | 7148 |
} |
40377 | 7149 |
note ** = this |
53348 | 7150 |
show ?thesis |
7151 |
apply (rule that[of ?a]) |
|
7152 |
unfolding rel_interior_substd_simplex[OF assms(2)] mem_Collect_eq |
|
7153 |
proof safe |
|
7154 |
fix i |
|
7155 |
assume "i \<in> d" |
|
7156 |
have "0 < inverse (2 * real (card d))" |
|
7157 |
using d1 by auto |
|
60420 | 7158 |
also have "\<dots> = ?a \<bullet> i" using **[of i] \<open>i \<in> d\<close> |
53348 | 7159 |
by auto |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
7160 |
finally show "0 < ?a \<bullet> i" by auto |
53348 | 7161 |
next |
7162 |
have "setsum (op \<bullet> ?a) ?D = setsum (\<lambda>i. inverse (2 * real (card d))) ?D" |
|
57418 | 7163 |
by (rule setsum.cong) (rule refl, rule **) |
53348 | 7164 |
also have "\<dots> < 1" |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61531
diff
changeset
|
7165 |
unfolding setsum_constant divide_real_def[symmetric] |
53348 | 7166 |
by (auto simp add: field_simps) |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
7167 |
finally show "setsum (op \<bullet> ?a) ?D < 1" by auto |
53348 | 7168 |
next |
7169 |
fix i |
|
7170 |
assume "i \<in> Basis" and "i \<notin> d" |
|
7171 |
have "?a \<in> span d" |
|
56196
32b7eafc5a52
remove unnecessary finiteness assumptions from lemmas about setsum
huffman
parents:
56189
diff
changeset
|
7172 |
proof (rule span_setsum[of d "(\<lambda>b. b /\<^sub>R (2 * real (card d)))" d]) |
53348 | 7173 |
{ |
7174 |
fix x :: "'a::euclidean_space" |
|
7175 |
assume "x \<in> d" |
|
7176 |
then have "x \<in> span d" |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
7177 |
using span_superset[of _ "d"] by auto |
53348 | 7178 |
then have "x /\<^sub>R (2 * real (card d)) \<in> span d" |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50104
diff
changeset
|
7179 |
using span_mul[of x "d" "(inverse (real (card d)) / 2)"] by auto |
53348 | 7180 |
} |
7181 |
then show "\<forall>x\<in>d. x /\<^sub>R (2 * real (card d)) \<in> span d" |
|
7182 |
by auto |
|
40377 | 7183 |
qed |
53348 | 7184 |
then show "?a \<bullet> i = 0 " |
60420 | 7185 |
using \<open>i \<notin> d\<close> unfolding span_substd_basis[OF assms(2)] using \<open>i \<in> Basis\<close> by auto |
40377 | 7186 |
qed |
7187 |
qed |
|
7188 |
||
53348 | 7189 |
|
60420 | 7190 |
subsection \<open>Relative interior of convex set\<close> |
40377 | 7191 |
|
49531 | 7192 |
lemma rel_interior_convex_nonempty_aux: |
53348 | 7193 |
fixes S :: "'n::euclidean_space set" |
7194 |
assumes "convex S" |
|
7195 |
and "0 \<in> S" |
|
7196 |
shows "rel_interior S \<noteq> {}" |
|
7197 |
proof (cases "S = {0}") |
|
7198 |
case True |
|
7199 |
then show ?thesis using rel_interior_sing by auto |
|
7200 |
next |
|
7201 |
case False |
|
7202 |
obtain B where B: "independent B \<and> B \<le> S \<and> S \<le> span B \<and> card B = dim S" |
|
7203 |
using basis_exists[of S] by auto |
|
7204 |
then have "B \<noteq> {}" |
|
60420 | 7205 |
using B assms \<open>S \<noteq> {0}\<close> span_empty by auto |
53348 | 7206 |
have "insert 0 B \<le> span B" |
7207 |
using subspace_span[of B] subspace_0[of "span B"] span_inc by auto |
|
7208 |
then have "span (insert 0 B) \<le> span B" |
|
40377 | 7209 |
using span_span[of B] span_mono[of "insert 0 B" "span B"] by blast |
53348 | 7210 |
then have "convex hull insert 0 B \<le> span B" |
40377 | 7211 |
using convex_hull_subset_span[of "insert 0 B"] by auto |
53348 | 7212 |
then have "span (convex hull insert 0 B) \<le> span B" |
40377 | 7213 |
using span_span[of B] span_mono[of "convex hull insert 0 B" "span B"] by blast |
53348 | 7214 |
then have *: "span (convex hull insert 0 B) = span B" |
40377 | 7215 |
using span_mono[of B "convex hull insert 0 B"] hull_subset[of "insert 0 B"] by auto |
53348 | 7216 |
then have "span (convex hull insert 0 B) = span S" |
7217 |
using B span_mono[of B S] span_mono[of S "span B"] span_span[of B] by auto |
|
7218 |
moreover have "0 \<in> affine hull (convex hull insert 0 B)" |
|
40377 | 7219 |
using hull_subset[of "convex hull insert 0 B"] hull_subset[of "insert 0 B"] by auto |
53348 | 7220 |
ultimately have **: "affine hull (convex hull insert 0 B) = affine hull S" |
49531 | 7221 |
using affine_hull_span_0[of "convex hull insert 0 B"] affine_hull_span_0[of "S"] |
53348 | 7222 |
assms hull_subset[of S] |
7223 |
by auto |
|
7224 |
obtain d and f :: "'n \<Rightarrow> 'n" where |
|
7225 |
fd: "card d = card B" "linear f" "f ` B = d" |
|
7226 |
"f ` span B = {x. \<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x \<bullet> i = (0::real)} \<and> inj_on f (span B)" |
|
7227 |
and d: "d \<subseteq> Basis" |
|
7228 |
using basis_to_substdbasis_subspace_isomorphism[of B,OF _ ] B by auto |
|
7229 |
then have "bounded_linear f" |
|
7230 |
using linear_conv_bounded_linear by auto |
|
7231 |
have "d \<noteq> {}" |
|
60420 | 7232 |
using fd B \<open>B \<noteq> {}\<close> by auto |
53348 | 7233 |
have "insert 0 d = f ` (insert 0 B)" |
7234 |
using fd linear_0 by auto |
|
7235 |
then have "(convex hull (insert 0 d)) = f ` (convex hull (insert 0 B))" |
|
7236 |
using convex_hull_linear_image[of f "(insert 0 d)"] |
|
60420 | 7237 |
convex_hull_linear_image[of f "(insert 0 B)"] \<open>linear f\<close> |
53348 | 7238 |
by auto |
7239 |
moreover have "rel_interior (f ` (convex hull insert 0 B)) = |
|
7240 |
f ` rel_interior (convex hull insert 0 B)" |
|
7241 |
apply (rule rel_interior_injective_on_span_linear_image[of f "(convex hull insert 0 B)"]) |
|
60420 | 7242 |
using \<open>bounded_linear f\<close> fd * |
53348 | 7243 |
apply auto |
7244 |
done |
|
7245 |
ultimately have "rel_interior (convex hull insert 0 B) \<noteq> {}" |
|
60420 | 7246 |
using rel_interior_substd_simplex_nonempty[OF \<open>d \<noteq> {}\<close> d] |
53348 | 7247 |
apply auto |
7248 |
apply blast |
|
7249 |
done |
|
7250 |
moreover have "convex hull (insert 0 B) \<subseteq> S" |
|
7251 |
using B assms hull_mono[of "insert 0 B" "S" "convex"] convex_hull_eq |
|
7252 |
by auto |
|
7253 |
ultimately show ?thesis |
|
7254 |
using subset_rel_interior[of "convex hull insert 0 B" S] ** by auto |
|
40377 | 7255 |
qed |
7256 |
||
7257 |
lemma rel_interior_convex_nonempty: |
|
53348 | 7258 |
fixes S :: "'n::euclidean_space set" |
7259 |
assumes "convex S" |
|
7260 |
shows "rel_interior S = {} \<longleftrightarrow> S = {}" |
|
7261 |
proof - |
|
7262 |
{ |
|
7263 |
assume "S \<noteq> {}" |
|
7264 |
then obtain a where "a \<in> S" by auto |
|
7265 |
then have "0 \<in> op + (-a) ` S" |
|
7266 |
using assms exI[of "(\<lambda>x. x \<in> S \<and> - a + x = 0)" a] by auto |
|
7267 |
then have "rel_interior (op + (-a) ` S) \<noteq> {}" |
|
7268 |
using rel_interior_convex_nonempty_aux[of "op + (-a) ` S"] |
|
7269 |
convex_translation[of S "-a"] assms |
|
7270 |
by auto |
|
7271 |
then have "rel_interior S \<noteq> {}" |
|
7272 |
using rel_interior_translation by auto |
|
7273 |
} |
|
7274 |
then show ?thesis |
|
7275 |
using rel_interior_empty by auto |
|
40377 | 7276 |
qed |
7277 |
||
7278 |
lemma convex_rel_interior: |
|
53348 | 7279 |
fixes S :: "'n::euclidean_space set" |
7280 |
assumes "convex S" |
|
7281 |
shows "convex (rel_interior S)" |
|
7282 |
proof - |
|
7283 |
{ |
|
7284 |
fix x y and u :: real |
|
7285 |
assume assm: "x \<in> rel_interior S" "y \<in> rel_interior S" "0 \<le> u" "u \<le> 1" |
|
7286 |
then have "x \<in> S" |
|
7287 |
using rel_interior_subset by auto |
|
7288 |
have "x - u *\<^sub>R (x-y) \<in> rel_interior S" |
|
7289 |
proof (cases "0 = u") |
|
7290 |
case False |
|
7291 |
then have "0 < u" using assm by auto |
|
7292 |
then show ?thesis |
|
60420 | 7293 |
using assm rel_interior_convex_shrink[of S y x u] assms \<open>x \<in> S\<close> by auto |
53348 | 7294 |
next |
7295 |
case True |
|
7296 |
then show ?thesis using assm by auto |
|
7297 |
qed |
|
7298 |
then have "(1 - u) *\<^sub>R x + u *\<^sub>R y \<in> rel_interior S" |
|
7299 |
by (simp add: algebra_simps) |
|
7300 |
} |
|
7301 |
then show ?thesis |
|
7302 |
unfolding convex_alt by auto |
|
40377 | 7303 |
qed |
7304 |
||
49531 | 7305 |
lemma convex_closure_rel_interior: |
53348 | 7306 |
fixes S :: "'n::euclidean_space set" |
7307 |
assumes "convex S" |
|
7308 |
shows "closure (rel_interior S) = closure S" |
|
7309 |
proof - |
|
7310 |
have h1: "closure (rel_interior S) \<le> closure S" |
|
7311 |
using closure_mono[of "rel_interior S" S] rel_interior_subset[of S] by auto |
|
7312 |
show ?thesis |
|
7313 |
proof (cases "S = {}") |
|
7314 |
case False |
|
7315 |
then obtain a where a: "a \<in> rel_interior S" |
|
7316 |
using rel_interior_convex_nonempty assms by auto |
|
7317 |
{ fix x |
|
7318 |
assume x: "x \<in> closure S" |
|
7319 |
{ |
|
7320 |
assume "x = a" |
|
7321 |
then have "x \<in> closure (rel_interior S)" |
|
7322 |
using a unfolding closure_def by auto |
|
7323 |
} |
|
7324 |
moreover |
|
7325 |
{ |
|
7326 |
assume "x \<noteq> a" |
|
7327 |
{ |
|
7328 |
fix e :: real |
|
7329 |
assume "e > 0" |
|
7330 |
def e1 \<equiv> "min 1 (e/norm (x - a))" |
|
7331 |
then have e1: "e1 > 0" "e1 \<le> 1" "e1 * norm (x - a) \<le> e" |
|
60420 | 7332 |
using \<open>x \<noteq> a\<close> \<open>e > 0\<close> le_divide_eq[of e1 e "norm (x - a)"] |
53348 | 7333 |
by simp_all |
7334 |
then have *: "x - e1 *\<^sub>R (x - a) : rel_interior S" |
|
7335 |
using rel_interior_closure_convex_shrink[of S a x e1] assms x a e1_def |
|
7336 |
by auto |
|
7337 |
have "\<exists>y. y \<in> rel_interior S \<and> y \<noteq> x \<and> dist y x \<le> e" |
|
7338 |
apply (rule_tac x="x - e1 *\<^sub>R (x - a)" in exI) |
|
60420 | 7339 |
using * e1 dist_norm[of "x - e1 *\<^sub>R (x - a)" x] \<open>x \<noteq> a\<close> |
53348 | 7340 |
apply simp |
7341 |
done |
|
7342 |
} |
|
7343 |
then have "x islimpt rel_interior S" |
|
7344 |
unfolding islimpt_approachable_le by auto |
|
7345 |
then have "x \<in> closure(rel_interior S)" |
|
7346 |
unfolding closure_def by auto |
|
7347 |
} |
|
7348 |
ultimately have "x \<in> closure(rel_interior S)" by auto |
|
7349 |
} |
|
7350 |
then show ?thesis using h1 by auto |
|
7351 |
next |
|
7352 |
case True |
|
7353 |
then have "rel_interior S = {}" |
|
7354 |
using rel_interior_empty by auto |
|
7355 |
then have "closure (rel_interior S) = {}" |
|
7356 |
using closure_empty by auto |
|
7357 |
with True show ?thesis by auto |
|
7358 |
qed |
|
40377 | 7359 |
qed |
7360 |
||
7361 |
lemma rel_interior_same_affine_hull: |
|
53348 | 7362 |
fixes S :: "'n::euclidean_space set" |
40377 | 7363 |
assumes "convex S" |
7364 |
shows "affine hull (rel_interior S) = affine hull S" |
|
53348 | 7365 |
by (metis assms closure_same_affine_hull convex_closure_rel_interior) |
40377 | 7366 |
|
49531 | 7367 |
lemma rel_interior_aff_dim: |
53348 | 7368 |
fixes S :: "'n::euclidean_space set" |
40377 | 7369 |
assumes "convex S" |
7370 |
shows "aff_dim (rel_interior S) = aff_dim S" |
|
53348 | 7371 |
by (metis aff_dim_affine_hull2 assms rel_interior_same_affine_hull) |
40377 | 7372 |
|
7373 |
lemma rel_interior_rel_interior: |
|
53348 | 7374 |
fixes S :: "'n::euclidean_space set" |
40377 | 7375 |
assumes "convex S" |
7376 |
shows "rel_interior (rel_interior S) = rel_interior S" |
|
53348 | 7377 |
proof - |
7378 |
have "openin (subtopology euclidean (affine hull (rel_interior S))) (rel_interior S)" |
|
7379 |
using opein_rel_interior[of S] rel_interior_same_affine_hull[of S] assms by auto |
|
7380 |
then show ?thesis |
|
7381 |
using rel_interior_def by auto |
|
40377 | 7382 |
qed |
7383 |
||
7384 |
lemma rel_interior_rel_open: |
|
53348 | 7385 |
fixes S :: "'n::euclidean_space set" |
40377 | 7386 |
assumes "convex S" |
7387 |
shows "rel_open (rel_interior S)" |
|
53348 | 7388 |
unfolding rel_open_def using rel_interior_rel_interior assms by auto |
40377 | 7389 |
|
7390 |
lemma convex_rel_interior_closure_aux: |
|
53348 | 7391 |
fixes x y z :: "'n::euclidean_space" |
7392 |
assumes "0 < a" "0 < b" "(a + b) *\<^sub>R z = a *\<^sub>R x + b *\<^sub>R y" |
|
7393 |
obtains e where "0 < e" "e \<le> 1" "z = y - e *\<^sub>R (y - x)" |
|
7394 |
proof - |
|
7395 |
def e \<equiv> "a / (a + b)" |
|
7396 |
have "z = (1 / (a + b)) *\<^sub>R ((a + b) *\<^sub>R z)" |
|
7397 |
apply auto |
|
7398 |
using assms |
|
7399 |
apply simp |
|
7400 |
done |
|
7401 |
also have "\<dots> = (1 / (a + b)) *\<^sub>R (a *\<^sub>R x + b *\<^sub>R y)" |
|
7402 |
using assms scaleR_cancel_left[of "1/(a+b)" "(a + b) *\<^sub>R z" "a *\<^sub>R x + b *\<^sub>R y"] |
|
7403 |
by auto |
|
7404 |
also have "\<dots> = y - e *\<^sub>R (y-x)" |
|
7405 |
using e_def |
|
7406 |
apply (simp add: algebra_simps) |
|
7407 |
using scaleR_left_distrib[of "a/(a+b)" "b/(a+b)" y] assms add_divide_distrib[of a b "a+b"] |
|
7408 |
apply auto |
|
7409 |
done |
|
7410 |
finally have "z = y - e *\<^sub>R (y-x)" |
|
7411 |
by auto |
|
56541 | 7412 |
moreover have "e > 0" using e_def assms by auto |
7413 |
moreover have "e \<le> 1" using e_def assms by auto |
|
7414 |
ultimately show ?thesis using that[of e] by auto |
|
40377 | 7415 |
qed |
7416 |
||
49531 | 7417 |
lemma convex_rel_interior_closure: |
53348 | 7418 |
fixes S :: "'n::euclidean_space set" |
40377 | 7419 |
assumes "convex S" |
7420 |
shows "rel_interior (closure S) = rel_interior S" |
|
53348 | 7421 |
proof (cases "S = {}") |
7422 |
case True |
|
7423 |
then show ?thesis |
|
7424 |
using assms rel_interior_convex_nonempty by auto |
|
7425 |
next |
|
7426 |
case False |
|
7427 |
have "rel_interior (closure S) \<supseteq> rel_interior S" |
|
7428 |
using subset_rel_interior[of S "closure S"] closure_same_affine_hull closure_subset |
|
7429 |
by auto |
|
40377 | 7430 |
moreover |
53348 | 7431 |
{ |
7432 |
fix z |
|
54465 | 7433 |
assume z: "z \<in> rel_interior (closure S)" |
53348 | 7434 |
obtain x where x: "x \<in> rel_interior S" |
60420 | 7435 |
using \<open>S \<noteq> {}\<close> assms rel_interior_convex_nonempty by auto |
53348 | 7436 |
have "z \<in> rel_interior S" |
7437 |
proof (cases "x = z") |
|
7438 |
case True |
|
7439 |
then show ?thesis using x by auto |
|
7440 |
next |
|
7441 |
case False |
|
54465 | 7442 |
obtain e where e: "e > 0" "cball z e \<inter> affine hull closure S \<le> closure S" |
53348 | 7443 |
using z rel_interior_cball[of "closure S"] by auto |
56541 | 7444 |
hence *: "0 < e/norm(z-x)" using e False by auto |
53348 | 7445 |
def y \<equiv> "z + (e/norm(z-x)) *\<^sub>R (z-x)" |
7446 |
have yball: "y \<in> cball z e" |
|
7447 |
using mem_cball y_def dist_norm[of z y] e by auto |
|
7448 |
have "x \<in> affine hull closure S" |
|
7449 |
using x rel_interior_subset_closure hull_inc[of x "closure S"] by auto |
|
7450 |
moreover have "z \<in> affine hull closure S" |
|
7451 |
using z rel_interior_subset hull_subset[of "closure S"] by auto |
|
7452 |
ultimately have "y \<in> affine hull closure S" |
|
49531 | 7453 |
using y_def affine_affine_hull[of "closure S"] |
40377 | 7454 |
mem_affine_3_minus [of "affine hull closure S" z z x "e/norm(z-x)"] by auto |
53348 | 7455 |
then have "y \<in> closure S" using e yball by auto |
7456 |
have "(1 + (e/norm(z-x))) *\<^sub>R z = (e/norm(z-x)) *\<^sub>R x + y" |
|
49531 | 7457 |
using y_def by (simp add: algebra_simps) |
53348 | 7458 |
then obtain e1 where "0 < e1" "e1 \<le> 1" "z = y - e1 *\<^sub>R (y - x)" |
49531 | 7459 |
using * convex_rel_interior_closure_aux[of "e / norm (z - x)" 1 z x y] |
53348 | 7460 |
by (auto simp add: algebra_simps) |
7461 |
then show ?thesis |
|
60420 | 7462 |
using rel_interior_closure_convex_shrink assms x \<open>y \<in> closure S\<close> |
53348 | 7463 |
by auto |
7464 |
qed |
|
7465 |
} |
|
7466 |
ultimately show ?thesis by auto |
|
40377 | 7467 |
qed |
7468 |
||
49531 | 7469 |
lemma convex_interior_closure: |
53348 | 7470 |
fixes S :: "'n::euclidean_space set" |
7471 |
assumes "convex S" |
|
7472 |
shows "interior (closure S) = interior S" |
|
7473 |
using closure_aff_dim[of S] interior_rel_interior_gen[of S] |
|
7474 |
interior_rel_interior_gen[of "closure S"] |
|
7475 |
convex_rel_interior_closure[of S] assms |
|
7476 |
by auto |
|
40377 | 7477 |
|
7478 |
lemma closure_eq_rel_interior_eq: |
|
53348 | 7479 |
fixes S1 S2 :: "'n::euclidean_space set" |
7480 |
assumes "convex S1" |
|
7481 |
and "convex S2" |
|
7482 |
shows "closure S1 = closure S2 \<longleftrightarrow> rel_interior S1 = rel_interior S2" |
|
7483 |
by (metis convex_rel_interior_closure convex_closure_rel_interior assms) |
|
40377 | 7484 |
|
7485 |
lemma closure_eq_between: |
|
53348 | 7486 |
fixes S1 S2 :: "'n::euclidean_space set" |
7487 |
assumes "convex S1" |
|
7488 |
and "convex S2" |
|
7489 |
shows "closure S1 = closure S2 \<longleftrightarrow> rel_interior S1 \<le> S2 \<and> S2 \<subseteq> closure S1" |
|
54465 | 7490 |
(is "?A \<longleftrightarrow> ?B") |
53348 | 7491 |
proof |
7492 |
assume ?A |
|
7493 |
then show ?B |
|
7494 |
by (metis assms closure_subset convex_rel_interior_closure rel_interior_subset) |
|
7495 |
next |
|
7496 |
assume ?B |
|
7497 |
then have "closure S1 \<subseteq> closure S2" |
|
7498 |
by (metis assms(1) convex_closure_rel_interior closure_mono) |
|
60420 | 7499 |
moreover from \<open>?B\<close> have "closure S1 \<supseteq> closure S2" |
53348 | 7500 |
by (metis closed_closure closure_minimal) |
7501 |
ultimately show ?A .. |
|
40377 | 7502 |
qed |
7503 |
||
7504 |
lemma open_inter_closure_rel_interior: |
|
53348 | 7505 |
fixes S A :: "'n::euclidean_space set" |
7506 |
assumes "convex S" |
|
7507 |
and "open A" |
|
7508 |
shows "A \<inter> closure S = {} \<longleftrightarrow> A \<inter> rel_interior S = {}" |
|
7509 |
by (metis assms convex_closure_rel_interior open_inter_closure_eq_empty) |
|
40377 | 7510 |
|
7511 |
definition "rel_frontier S = closure S - rel_interior S" |
|
7512 |
||
53348 | 7513 |
lemma closed_affine_hull: |
7514 |
fixes S :: "'n::euclidean_space set" |
|
7515 |
shows "closed (affine hull S)" |
|
7516 |
by (metis affine_affine_hull affine_closed) |
|
7517 |
||
7518 |
lemma closed_rel_frontier: |
|
7519 |
fixes S :: "'n::euclidean_space set" |
|
7520 |
shows "closed (rel_frontier S)" |
|
7521 |
proof - |
|
7522 |
have *: "closedin (subtopology euclidean (affine hull S)) (closure S - rel_interior S)" |
|
7523 |
apply (rule closedin_diff[of "subtopology euclidean (affine hull S)""closure S" "rel_interior S"]) |
|
7524 |
using closed_closedin_trans[of "affine hull S" "closure S"] closed_affine_hull[of S] |
|
7525 |
closure_affine_hull[of S] opein_rel_interior[of S] |
|
7526 |
apply auto |
|
7527 |
done |
|
7528 |
show ?thesis |
|
7529 |
apply (rule closedin_closed_trans[of "affine hull S" "rel_frontier S"]) |
|
7530 |
unfolding rel_frontier_def |
|
7531 |
using * closed_affine_hull |
|
7532 |
apply auto |
|
7533 |
done |
|
49531 | 7534 |
qed |
7535 |
||
40377 | 7536 |
|
7537 |
lemma convex_rel_frontier_aff_dim: |
|
53348 | 7538 |
fixes S1 S2 :: "'n::euclidean_space set" |
7539 |
assumes "convex S1" |
|
7540 |
and "convex S2" |
|
7541 |
and "S2 \<noteq> {}" |
|
7542 |
and "S1 \<le> rel_frontier S2" |
|
7543 |
shows "aff_dim S1 < aff_dim S2" |
|
7544 |
proof - |
|
7545 |
have "S1 \<subseteq> closure S2" |
|
7546 |
using assms unfolding rel_frontier_def by auto |
|
7547 |
then have *: "affine hull S1 \<subseteq> affine hull S2" |
|
7548 |
using hull_mono[of "S1" "closure S2"] closure_same_affine_hull[of S2] |
|
7549 |
by auto |
|
7550 |
then have "aff_dim S1 \<le> aff_dim S2" |
|
7551 |
using * aff_dim_affine_hull[of S1] aff_dim_affine_hull[of S2] |
|
7552 |
aff_dim_subset[of "affine hull S1" "affine hull S2"] |
|
7553 |
by auto |
|
7554 |
moreover |
|
7555 |
{ |
|
7556 |
assume eq: "aff_dim S1 = aff_dim S2" |
|
7557 |
then have "S1 \<noteq> {}" |
|
60420 | 7558 |
using aff_dim_empty[of S1] aff_dim_empty[of S2] \<open>S2 \<noteq> {}\<close> by auto |
53348 | 7559 |
have **: "affine hull S1 = affine hull S2" |
7560 |
apply (rule affine_dim_equal) |
|
7561 |
using * affine_affine_hull |
|
7562 |
apply auto |
|
60420 | 7563 |
using \<open>S1 \<noteq> {}\<close> hull_subset[of S1] |
53348 | 7564 |
apply auto |
7565 |
using eq aff_dim_affine_hull[of S1] aff_dim_affine_hull[of S2] |
|
7566 |
apply auto |
|
7567 |
done |
|
7568 |
obtain a where a: "a \<in> rel_interior S1" |
|
60420 | 7569 |
using \<open>S1 \<noteq> {}\<close> rel_interior_convex_nonempty assms by auto |
53348 | 7570 |
obtain T where T: "open T" "a \<in> T \<inter> S1" "T \<inter> affine hull S1 \<subseteq> S1" |
7571 |
using mem_rel_interior[of a S1] a by auto |
|
7572 |
then have "a \<in> T \<inter> closure S2" |
|
7573 |
using a assms unfolding rel_frontier_def by auto |
|
54465 | 7574 |
then obtain b where b: "b \<in> T \<inter> rel_interior S2" |
53348 | 7575 |
using open_inter_closure_rel_interior[of S2 T] assms T by auto |
7576 |
then have "b \<in> affine hull S1" |
|
7577 |
using rel_interior_subset hull_subset[of S2] ** by auto |
|
7578 |
then have "b \<in> S1" |
|
7579 |
using T b by auto |
|
7580 |
then have False |
|
7581 |
using b assms unfolding rel_frontier_def by auto |
|
7582 |
} |
|
7583 |
ultimately show ?thesis |
|
7584 |
using less_le by auto |
|
40377 | 7585 |
qed |
7586 |
||
7587 |
||
7588 |
lemma convex_rel_interior_if: |
|
53348 | 7589 |
fixes S :: "'n::euclidean_space set" |
7590 |
assumes "convex S" |
|
7591 |
and "z \<in> rel_interior S" |
|
7592 |
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)" |
|
7593 |
proof - |
|
54465 | 7594 |
obtain e1 where e1: "e1 > 0 \<and> cball z e1 \<inter> affine hull S \<subseteq> S" |
7595 |
using mem_rel_interior_cball[of z S] assms by auto |
|
53348 | 7596 |
{ |
7597 |
fix x |
|
7598 |
assume x: "x \<in> affine hull S" |
|
54465 | 7599 |
{ |
7600 |
assume "x \<noteq> z" |
|
53348 | 7601 |
def m \<equiv> "1 + e1/norm(x-z)" |
60420 | 7602 |
hence "m > 1" using e1 \<open>x \<noteq> z\<close> by auto |
53348 | 7603 |
{ |
7604 |
fix e |
|
7605 |
assume e: "e > 1 \<and> e \<le> m" |
|
7606 |
have "z \<in> affine hull S" |
|
7607 |
using assms rel_interior_subset hull_subset[of S] by auto |
|
7608 |
then have *: "(1 - e)*\<^sub>R x + e *\<^sub>R z \<in> affine hull S" |
|
7609 |
using mem_affine[of "affine hull S" x z "(1-e)" e] affine_affine_hull[of S] x |
|
7610 |
by auto |
|
7611 |
have "norm (z + e *\<^sub>R x - (x + e *\<^sub>R z)) = norm ((e - 1) *\<^sub>R (x - z))" |
|
7612 |
by (simp add: algebra_simps) |
|
7613 |
also have "\<dots> = (e - 1) * norm (x-z)" |
|
7614 |
using norm_scaleR e by auto |
|
7615 |
also have "\<dots> \<le> (m - 1) * norm (x - z)" |
|
7616 |
using e mult_right_mono[of _ _ "norm(x-z)"] by auto |
|
7617 |
also have "\<dots> = (e1 / norm (x - z)) * norm (x - z)" |
|
7618 |
using m_def by auto |
|
7619 |
also have "\<dots> = e1" |
|
60420 | 7620 |
using \<open>x \<noteq> z\<close> e1 by simp |
53348 | 7621 |
finally have **: "norm (z + e *\<^sub>R x - (x + e *\<^sub>R z)) \<le> e1" |
7622 |
by auto |
|
7623 |
have "(1 - e)*\<^sub>R x+ e *\<^sub>R z \<in> cball z e1" |
|
7624 |
using m_def ** |
|
7625 |
unfolding cball_def dist_norm |
|
7626 |
by (auto simp add: algebra_simps) |
|
7627 |
then have "(1 - e) *\<^sub>R x+ e *\<^sub>R z \<in> S" |
|
7628 |
using e * e1 by auto |
|
7629 |
} |
|
7630 |
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 )" |
|
60420 | 7631 |
using \<open>m> 1 \<close> by auto |
53348 | 7632 |
} |
7633 |
moreover |
|
7634 |
{ |
|
7635 |
assume "x = z" |
|
7636 |
def m \<equiv> "1 + e1" |
|
7637 |
then have "m > 1" |
|
7638 |
using e1 by auto |
|
7639 |
{ |
|
7640 |
fix e |
|
7641 |
assume e: "e > 1 \<and> e \<le> m" |
|
7642 |
then have "(1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S" |
|
60420 | 7643 |
using e1 x \<open>x = z\<close> by (auto simp add: algebra_simps) |
53348 | 7644 |
then have "(1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S" |
7645 |
using e by auto |
|
7646 |
} |
|
7647 |
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)" |
|
60420 | 7648 |
using \<open>m > 1\<close> by auto |
53348 | 7649 |
} |
7650 |
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 )" |
|
7651 |
by auto |
|
40377 | 7652 |
} |
53348 | 7653 |
then show ?thesis by auto |
40377 | 7654 |
qed |
7655 |
||
7656 |
lemma convex_rel_interior_if2: |
|
53348 | 7657 |
fixes S :: "'n::euclidean_space set" |
7658 |
assumes "convex S" |
|
7659 |
assumes "z \<in> rel_interior S" |
|
7660 |
shows "\<forall>x\<in>affine hull S. \<exists>e. e > 1 \<and> (1 - e)*\<^sub>R x + e *\<^sub>R z \<in> S" |
|
7661 |
using convex_rel_interior_if[of S z] assms by auto |
|
40377 | 7662 |
|
7663 |
lemma convex_rel_interior_only_if: |
|
53348 | 7664 |
fixes S :: "'n::euclidean_space set" |
7665 |
assumes "convex S" |
|
7666 |
and "S \<noteq> {}" |
|
7667 |
assumes "\<forall>x\<in>S. \<exists>e. e > 1 \<and> (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S" |
|
7668 |
shows "z \<in> rel_interior S" |
|
7669 |
proof - |
|
7670 |
obtain x where x: "x \<in> rel_interior S" |
|
7671 |
using rel_interior_convex_nonempty assms by auto |
|
7672 |
then have "x \<in> S" |
|
7673 |
using rel_interior_subset by auto |
|
7674 |
then obtain e where e: "e > 1 \<and> (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S" |
|
7675 |
using assms by auto |
|
7676 |
def y \<equiv> "(1 - e) *\<^sub>R x + e *\<^sub>R z" |
|
7677 |
then have "y \<in> S" using e by auto |
|
7678 |
def e1 \<equiv> "1/e" |
|
7679 |
then have "0 < e1 \<and> e1 < 1" using e by auto |
|
7680 |
then have "z =y - (1 - e1) *\<^sub>R (y - x)" |
|
7681 |
using e1_def y_def by (auto simp add: algebra_simps) |
|
7682 |
then show ?thesis |
|
60420 | 7683 |
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 |
53348 | 7684 |
by auto |
40377 | 7685 |
qed |
7686 |
||
7687 |
lemma convex_rel_interior_iff: |
|
53348 | 7688 |
fixes S :: "'n::euclidean_space set" |
7689 |
assumes "convex S" |
|
7690 |
and "S \<noteq> {}" |
|
7691 |
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)" |
|
7692 |
using assms hull_subset[of S "affine"] |
|
7693 |
convex_rel_interior_if[of S z] convex_rel_interior_only_if[of S z] |
|
7694 |
by auto |
|
40377 | 7695 |
|
7696 |
lemma convex_rel_interior_iff2: |
|
53348 | 7697 |
fixes S :: "'n::euclidean_space set" |
7698 |
assumes "convex S" |
|
7699 |
and "S \<noteq> {}" |
|
7700 |
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)" |
|
7701 |
using assms hull_subset[of S] convex_rel_interior_if2[of S z] convex_rel_interior_only_if[of S z] |
|
7702 |
by auto |
|
40377 | 7703 |
|
7704 |
lemma convex_interior_iff: |
|
53348 | 7705 |
fixes S :: "'n::euclidean_space set" |
7706 |
assumes "convex S" |
|
7707 |
shows "z \<in> interior S \<longleftrightarrow> (\<forall>x. \<exists>e. e > 0 \<and> z + e *\<^sub>R x \<in> S)" |
|
7708 |
proof (cases "aff_dim S = int DIM('n)") |
|
7709 |
case False |
|
7710 |
{ |
|
7711 |
assume "z \<in> interior S" |
|
7712 |
then have False |
|
7713 |
using False interior_rel_interior_gen[of S] by auto |
|
40377 | 7714 |
} |
7715 |
moreover |
|
53348 | 7716 |
{ |
7717 |
assume r: "\<forall>x. \<exists>e. e > 0 \<and> z + e *\<^sub>R x \<in> S" |
|
7718 |
{ |
|
7719 |
fix x |
|
54465 | 7720 |
obtain e1 where e1: "e1 > 0 \<and> z + e1 *\<^sub>R (x - z) \<in> S" |
53348 | 7721 |
using r by auto |
54465 | 7722 |
obtain e2 where e2: "e2 > 0 \<and> z + e2 *\<^sub>R (z - x) \<in> S" |
53348 | 7723 |
using r by auto |
7724 |
def x1 \<equiv> "z + e1 *\<^sub>R (x - z)" |
|
7725 |
then have x1: "x1 \<in> affine hull S" |
|
54465 | 7726 |
using e1 hull_subset[of S] by auto |
53348 | 7727 |
def x2 \<equiv> "z + e2 *\<^sub>R (z - x)" |
7728 |
then have x2: "x2 \<in> affine hull S" |
|
54465 | 7729 |
using e2 hull_subset[of S] by auto |
53348 | 7730 |
have *: "e1/(e1+e2) + e2/(e1+e2) = 1" |
54465 | 7731 |
using add_divide_distrib[of e1 e2 "e1+e2"] e1 e2 by simp |
53348 | 7732 |
then have "z = (e2/(e1+e2)) *\<^sub>R x1 + (e1/(e1+e2)) *\<^sub>R x2" |
7733 |
using x1_def x2_def |
|
7734 |
apply (auto simp add: algebra_simps) |
|
7735 |
using scaleR_left_distrib[of "e1/(e1+e2)" "e2/(e1+e2)" z] |
|
7736 |
apply auto |
|
7737 |
done |
|
7738 |
then have z: "z \<in> affine hull S" |
|
7739 |
using mem_affine[of "affine hull S" x1 x2 "e2/(e1+e2)" "e1/(e1+e2)"] |
|
7740 |
x1 x2 affine_affine_hull[of S] * |
|
7741 |
by auto |
|
7742 |
have "x1 - x2 = (e1 + e2) *\<^sub>R (x - z)" |
|
7743 |
using x1_def x2_def by (auto simp add: algebra_simps) |
|
7744 |
then have "x = z+(1/(e1+e2)) *\<^sub>R (x1-x2)" |
|
54465 | 7745 |
using e1 e2 by simp |
53348 | 7746 |
then have "x \<in> affine hull S" |
7747 |
using mem_affine_3_minus[of "affine hull S" z x1 x2 "1/(e1+e2)"] |
|
7748 |
x1 x2 z affine_affine_hull[of S] |
|
7749 |
by auto |
|
7750 |
} |
|
7751 |
then have "affine hull S = UNIV" |
|
7752 |
by auto |
|
7753 |
then have "aff_dim S = int DIM('n)" |
|
7754 |
using aff_dim_affine_hull[of S] by (simp add: aff_dim_univ) |
|
7755 |
then have False |
|
7756 |
using False by auto |
|
7757 |
} |
|
7758 |
ultimately show ?thesis by auto |
|
7759 |
next |
|
7760 |
case True |
|
7761 |
then have "S \<noteq> {}" |
|
7762 |
using aff_dim_empty[of S] by auto |
|
7763 |
have *: "affine hull S = UNIV" |
|
7764 |
using True affine_hull_univ by auto |
|
7765 |
{ |
|
7766 |
assume "z \<in> interior S" |
|
7767 |
then have "z \<in> rel_interior S" |
|
7768 |
using True interior_rel_interior_gen[of S] by auto |
|
7769 |
then have **: "\<forall>x. \<exists>e. e > 1 \<and> (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S" |
|
60420 | 7770 |
using convex_rel_interior_iff2[of S z] assms \<open>S \<noteq> {}\<close> * by auto |
53348 | 7771 |
fix x |
7772 |
obtain e1 where e1: "e1 > 1" "(1 - e1) *\<^sub>R (z - x) + e1 *\<^sub>R z \<in> S" |
|
40377 | 7773 |
using **[rule_format, of "z-x"] by auto |
53348 | 7774 |
def e \<equiv> "e1 - 1" |
7775 |
then have "(1 - e1) *\<^sub>R (z - x) + e1 *\<^sub>R z = z + e *\<^sub>R x" |
|
7776 |
by (simp add: algebra_simps) |
|
7777 |
then have "e > 0" "z + e *\<^sub>R x \<in> S" |
|
7778 |
using e1 e_def by auto |
|
7779 |
then have "\<exists>e. e > 0 \<and> z + e *\<^sub>R x \<in> S" |
|
7780 |
by auto |
|
40377 | 7781 |
} |
7782 |
moreover |
|
53348 | 7783 |
{ |
7784 |
assume r: "\<forall>x. \<exists>e. e > 0 \<and> z + e *\<^sub>R x \<in> S" |
|
7785 |
{ |
|
7786 |
fix x |
|
7787 |
obtain e1 where e1: "e1 > 0" "z + e1 *\<^sub>R (z - x) \<in> S" |
|
7788 |
using r[rule_format, of "z-x"] by auto |
|
7789 |
def e \<equiv> "e1 + 1" |
|
7790 |
then have "z + e1 *\<^sub>R (z - x) = (1 - e) *\<^sub>R x + e *\<^sub>R z" |
|
7791 |
by (simp add: algebra_simps) |
|
7792 |
then have "e > 1" "(1 - e)*\<^sub>R x + e *\<^sub>R z \<in> S" |
|
7793 |
using e1 e_def by auto |
|
7794 |
then have "\<exists>e. e > 1 \<and> (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S" by auto |
|
40377 | 7795 |
} |
53348 | 7796 |
then have "z \<in> rel_interior S" |
60420 | 7797 |
using convex_rel_interior_iff2[of S z] assms \<open>S \<noteq> {}\<close> by auto |
53348 | 7798 |
then have "z \<in> interior S" |
7799 |
using True interior_rel_interior_gen[of S] by auto |
|
7800 |
} |
|
7801 |
ultimately show ?thesis by auto |
|
7802 |
qed |
|
7803 |
||
40377 | 7804 |
|
60420 | 7805 |
subsubsection \<open>Relative interior and closure under common operations\<close> |
40377 | 7806 |
|
53348 | 7807 |
lemma rel_interior_inter_aux: "\<Inter>{rel_interior S |S. S : I} \<subseteq> \<Inter>I" |
7808 |
proof - |
|
7809 |
{ |
|
7810 |
fix y |
|
7811 |
assume "y \<in> \<Inter>{rel_interior S |S. S : I}" |
|
7812 |
then have y: "\<forall>S \<in> I. y \<in> rel_interior S" |
|
7813 |
by auto |
|
7814 |
{ |
|
7815 |
fix S |
|
7816 |
assume "S \<in> I" |
|
7817 |
then have "y \<in> S" |
|
7818 |
using rel_interior_subset y by auto |
|
7819 |
} |
|
7820 |
then have "y \<in> \<Inter>I" by auto |
|
7821 |
} |
|
7822 |
then show ?thesis by auto |
|
7823 |
qed |
|
7824 |
||
7825 |
lemma closure_inter: "closure (\<Inter>I) \<le> \<Inter>{closure S |S. S \<in> I}" |
|
7826 |
proof - |
|
7827 |
{ |
|
7828 |
fix y |
|
7829 |
assume "y \<in> \<Inter>I" |
|
7830 |
then have y: "\<forall>S \<in> I. y \<in> S" by auto |
|
7831 |
{ |
|
7832 |
fix S |
|
7833 |
assume "S \<in> I" |
|
7834 |
then have "y \<in> closure S" |
|
7835 |
using closure_subset y by auto |
|
7836 |
} |
|
7837 |
then have "y \<in> \<Inter>{closure S |S. S \<in> I}" |
|
7838 |
by auto |
|
7839 |
} |
|
7840 |
then have "\<Inter>I \<subseteq> \<Inter>{closure S |S. S \<in> I}" |
|
7841 |
by auto |
|
54465 | 7842 |
moreover have "closed (\<Inter>{closure S |S. S \<in> I})" |
53348 | 7843 |
unfolding closed_Inter closed_closure by auto |
54465 | 7844 |
ultimately show ?thesis using closure_hull[of "\<Inter>I"] |
53348 | 7845 |
hull_minimal[of "\<Inter>I" "\<Inter>{closure S |S. S \<in> I}" "closed"] by auto |
40377 | 7846 |
qed |
7847 |
||
49531 | 7848 |
lemma convex_closure_rel_interior_inter: |
53348 | 7849 |
assumes "\<forall>S\<in>I. convex (S :: 'n::euclidean_space set)" |
7850 |
and "\<Inter>{rel_interior S |S. S \<in> I} \<noteq> {}" |
|
7851 |
shows "\<Inter>{closure S |S. S \<in> I} \<le> closure (\<Inter>{rel_interior S |S. S \<in> I})" |
|
7852 |
proof - |
|
7853 |
obtain x where x: "\<forall>S\<in>I. x \<in> rel_interior S" |
|
7854 |
using assms by auto |
|
7855 |
{ |
|
7856 |
fix y |
|
7857 |
assume "y \<in> \<Inter>{closure S |S. S \<in> I}" |
|
7858 |
then have y: "\<forall>S \<in> I. y \<in> closure S" |
|
7859 |
by auto |
|
7860 |
{ |
|
7861 |
assume "y = x" |
|
7862 |
then have "y \<in> closure (\<Inter>{rel_interior S |S. S \<in> I})" |
|
54465 | 7863 |
using x closure_subset[of "\<Inter>{rel_interior S |S. S \<in> I}"] by auto |
53348 | 7864 |
} |
7865 |
moreover |
|
7866 |
{ |
|
7867 |
assume "y \<noteq> x" |
|
7868 |
{ fix e :: real |
|
7869 |
assume e: "e > 0" |
|
7870 |
def e1 \<equiv> "min 1 (e/norm (y - x))" |
|
7871 |
then have e1: "e1 > 0" "e1 \<le> 1" "e1 * norm (y - x) \<le> e" |
|
60420 | 7872 |
using \<open>y \<noteq> x\<close> \<open>e > 0\<close> le_divide_eq[of e1 e "norm (y - x)"] |
53348 | 7873 |
by simp_all |
7874 |
def z \<equiv> "y - e1 *\<^sub>R (y - x)" |
|
7875 |
{ |
|
7876 |
fix S |
|
7877 |
assume "S \<in> I" |
|
7878 |
then have "z \<in> rel_interior S" |
|
7879 |
using rel_interior_closure_convex_shrink[of S x y e1] assms x y e1 z_def |
|
7880 |
by auto |
|
7881 |
} |
|
7882 |
then have *: "z \<in> \<Inter>{rel_interior S |S. S \<in> I}" |
|
7883 |
by auto |
|
7884 |
have "\<exists>z. z \<in> \<Inter>{rel_interior S |S. S \<in> I} \<and> z \<noteq> y \<and> dist z y \<le> e" |
|
7885 |
apply (rule_tac x="z" in exI) |
|
60420 | 7886 |
using \<open>y \<noteq> x\<close> z_def * e1 e dist_norm[of z y] |
53348 | 7887 |
apply simp |
7888 |
done |
|
7889 |
} |
|
7890 |
then have "y islimpt \<Inter>{rel_interior S |S. S \<in> I}" |
|
7891 |
unfolding islimpt_approachable_le by blast |
|
7892 |
then have "y \<in> closure (\<Inter>{rel_interior S |S. S \<in> I})" |
|
7893 |
unfolding closure_def by auto |
|
7894 |
} |
|
7895 |
ultimately have "y \<in> closure (\<Inter>{rel_interior S |S. S \<in> I})" |
|
7896 |
by auto |
|
40377 | 7897 |
} |
53348 | 7898 |
then show ?thesis by auto |
40377 | 7899 |
qed |
7900 |
||
7901 |
||
49531 | 7902 |
lemma convex_closure_inter: |
53348 | 7903 |
assumes "\<forall>S\<in>I. convex (S :: 'n::euclidean_space set)" |
7904 |
and "\<Inter>{rel_interior S |S. S \<in> I} \<noteq> {}" |
|
54465 | 7905 |
shows "closure (\<Inter>I) = \<Inter>{closure S |S. S \<in> I}" |
53348 | 7906 |
proof - |
7907 |
have "\<Inter>{closure S |S. S \<in> I} \<le> closure (\<Inter>{rel_interior S |S. S \<in> I})" |
|
7908 |
using convex_closure_rel_interior_inter assms by auto |
|
7909 |
moreover |
|
60585 | 7910 |
have "closure (\<Inter>{rel_interior S |S. S \<in> I}) \<le> closure (\<Inter>I)" |
54465 | 7911 |
using rel_interior_inter_aux closure_mono[of "\<Inter>{rel_interior S |S. S \<in> I}" "\<Inter>I"] |
53348 | 7912 |
by auto |
7913 |
ultimately show ?thesis |
|
7914 |
using closure_inter[of I] by auto |
|
40377 | 7915 |
qed |
7916 |
||
49531 | 7917 |
lemma convex_inter_rel_interior_same_closure: |
53348 | 7918 |
assumes "\<forall>S\<in>I. convex (S :: 'n::euclidean_space set)" |
7919 |
and "\<Inter>{rel_interior S |S. S \<in> I} \<noteq> {}" |
|
54465 | 7920 |
shows "closure (\<Inter>{rel_interior S |S. S \<in> I}) = closure (\<Inter>I)" |
53348 | 7921 |
proof - |
7922 |
have "\<Inter>{closure S |S. S \<in> I} \<le> closure (\<Inter>{rel_interior S |S. S \<in> I})" |
|
7923 |
using convex_closure_rel_interior_inter assms by auto |
|
7924 |
moreover |
|
7925 |
have "closure (\<Inter>{rel_interior S |S. S \<in> I}) \<le> closure (\<Inter>I)" |
|
54465 | 7926 |
using rel_interior_inter_aux closure_mono[of "\<Inter>{rel_interior S |S. S \<in> I}" "\<Inter>I"] |
53348 | 7927 |
by auto |
7928 |
ultimately show ?thesis |
|
7929 |
using closure_inter[of I] by auto |
|
40377 | 7930 |
qed |
7931 |
||
49531 | 7932 |
lemma convex_rel_interior_inter: |
53348 | 7933 |
assumes "\<forall>S\<in>I. convex (S :: 'n::euclidean_space set)" |
7934 |
and "\<Inter>{rel_interior S |S. S \<in> I} \<noteq> {}" |
|
54465 | 7935 |
shows "rel_interior (\<Inter>I) \<subseteq> \<Inter>{rel_interior S |S. S \<in> I}" |
53348 | 7936 |
proof - |
7937 |
have "convex (\<Inter>I)" |
|
7938 |
using assms convex_Inter by auto |
|
7939 |
moreover |
|
54465 | 7940 |
have "convex (\<Inter>{rel_interior S |S. S \<in> I})" |
53348 | 7941 |
apply (rule convex_Inter) |
7942 |
using assms convex_rel_interior |
|
7943 |
apply auto |
|
7944 |
done |
|
7945 |
ultimately |
|
7946 |
have "rel_interior (\<Inter>{rel_interior S |S. S \<in> I}) = rel_interior (\<Inter>I)" |
|
7947 |
using convex_inter_rel_interior_same_closure assms |
|
7948 |
closure_eq_rel_interior_eq[of "\<Inter>{rel_interior S |S. S \<in> I}" "\<Inter>I"] |
|
7949 |
by blast |
|
7950 |
then show ?thesis |
|
7951 |
using rel_interior_subset[of "\<Inter>{rel_interior S |S. S \<in> I}"] by auto |
|
40377 | 7952 |
qed |
7953 |
||
49531 | 7954 |
lemma convex_rel_interior_finite_inter: |
53348 | 7955 |
assumes "\<forall>S\<in>I. convex (S :: 'n::euclidean_space set)" |
7956 |
and "\<Inter>{rel_interior S |S. S \<in> I} \<noteq> {}" |
|
7957 |
and "finite I" |
|
7958 |
shows "rel_interior (\<Inter>I) = \<Inter>{rel_interior S |S. S \<in> I}" |
|
7959 |
proof - |
|
7960 |
have "\<Inter>I \<noteq> {}" |
|
7961 |
using assms rel_interior_inter_aux[of I] by auto |
|
7962 |
have "convex (\<Inter>I)" |
|
7963 |
using convex_Inter assms by auto |
|
7964 |
show ?thesis |
|
7965 |
proof (cases "I = {}") |
|
7966 |
case True |
|
7967 |
then show ?thesis |
|
7968 |
using Inter_empty rel_interior_univ2 by auto |
|
7969 |
next |
|
7970 |
case False |
|
7971 |
{ |
|
7972 |
fix z |
|
7973 |
assume z: "z \<in> \<Inter>{rel_interior S |S. S \<in> I}" |
|
7974 |
{ |
|
7975 |
fix x |
|
7976 |
assume x: "x \<in> Inter I" |
|
7977 |
{ |
|
7978 |
fix S |
|
7979 |
assume S: "S \<in> I" |
|
7980 |
then have "z \<in> rel_interior S" "x \<in> S" |
|
7981 |
using z x by auto |
|
7982 |
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)" |
|
7983 |
using convex_rel_interior_if[of S z] S assms hull_subset[of S] by auto |
|
7984 |
} |
|
7985 |
then obtain mS where |
|
7986 |
mS: "\<forall>S\<in>I. mS S > 1 \<and> (\<forall>e. e > 1 \<and> e \<le> mS S \<longrightarrow> (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S)" by metis |
|
7987 |
def e \<equiv> "Min (mS ` I)" |
|
60420 | 7988 |
then have "e \<in> mS ` I" using assms \<open>I \<noteq> {}\<close> by simp |
53348 | 7989 |
then have "e > 1" using mS by auto |
7990 |
moreover have "\<forall>S\<in>I. e \<le> mS S" |
|
7991 |
using e_def assms by auto |
|
7992 |
ultimately have "\<exists>e > 1. (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> \<Inter>I" |
|
7993 |
using mS by auto |
|
7994 |
} |
|
7995 |
then have "z \<in> rel_interior (\<Inter>I)" |
|
60420 | 7996 |
using convex_rel_interior_iff[of "\<Inter>I" z] \<open>\<Inter>I \<noteq> {}\<close> \<open>convex (\<Inter>I)\<close> by auto |
53348 | 7997 |
} |
7998 |
then show ?thesis |
|
7999 |
using convex_rel_interior_inter[of I] assms by auto |
|
8000 |
qed |
|
40377 | 8001 |
qed |
8002 |
||
49531 | 8003 |
lemma convex_closure_inter_two: |
53348 | 8004 |
fixes S T :: "'n::euclidean_space set" |
8005 |
assumes "convex S" |
|
8006 |
and "convex T" |
|
8007 |
assumes "rel_interior S \<inter> rel_interior T \<noteq> {}" |
|
8008 |
shows "closure (S \<inter> T) = closure S \<inter> closure T" |
|
8009 |
using convex_closure_inter[of "{S,T}"] assms by auto |
|
40377 | 8010 |
|
49531 | 8011 |
lemma convex_rel_interior_inter_two: |
53348 | 8012 |
fixes S T :: "'n::euclidean_space set" |
8013 |
assumes "convex S" |
|
8014 |
and "convex T" |
|
8015 |
and "rel_interior S \<inter> rel_interior T \<noteq> {}" |
|
8016 |
shows "rel_interior (S \<inter> T) = rel_interior S \<inter> rel_interior T" |
|
8017 |
using convex_rel_interior_finite_inter[of "{S,T}"] assms by auto |
|
40377 | 8018 |
|
49531 | 8019 |
lemma convex_affine_closure_inter: |
53348 | 8020 |
fixes S T :: "'n::euclidean_space set" |
8021 |
assumes "convex S" |
|
8022 |
and "affine T" |
|
8023 |
and "rel_interior S \<inter> T \<noteq> {}" |
|
8024 |
shows "closure (S \<inter> T) = closure S \<inter> T" |
|
8025 |
proof - |
|
8026 |
have "affine hull T = T" |
|
8027 |
using assms by auto |
|
8028 |
then have "rel_interior T = T" |
|
8029 |
using rel_interior_univ[of T] by metis |
|
8030 |
moreover have "closure T = T" |
|
8031 |
using assms affine_closed[of T] by auto |
|
8032 |
ultimately show ?thesis |
|
8033 |
using convex_closure_inter_two[of S T] assms affine_imp_convex by auto |
|
49531 | 8034 |
qed |
8035 |
||
8036 |
lemma convex_affine_rel_interior_inter: |
|
53348 | 8037 |
fixes S T :: "'n::euclidean_space set" |
8038 |
assumes "convex S" |
|
8039 |
and "affine T" |
|
8040 |
and "rel_interior S \<inter> T \<noteq> {}" |
|
8041 |
shows "rel_interior (S \<inter> T) = rel_interior S \<inter> T" |
|
8042 |
proof - |
|
8043 |
have "affine hull T = T" |
|
8044 |
using assms by auto |
|
8045 |
then have "rel_interior T = T" |
|
8046 |
using rel_interior_univ[of T] by metis |
|
8047 |
moreover have "closure T = T" |
|
8048 |
using assms affine_closed[of T] by auto |
|
8049 |
ultimately show ?thesis |
|
8050 |
using convex_rel_interior_inter_two[of S T] assms affine_imp_convex by auto |
|
40377 | 8051 |
qed |
8052 |
||
8053 |
lemma subset_rel_interior_convex: |
|
53348 | 8054 |
fixes S T :: "'n::euclidean_space set" |
8055 |
assumes "convex S" |
|
8056 |
and "convex T" |
|
8057 |
and "S \<le> closure T" |
|
8058 |
and "\<not> S \<subseteq> rel_frontier T" |
|
8059 |
shows "rel_interior S \<subseteq> rel_interior T" |
|
8060 |
proof - |
|
8061 |
have *: "S \<inter> closure T = S" |
|
8062 |
using assms by auto |
|
8063 |
have "\<not> rel_interior S \<subseteq> rel_frontier T" |
|
8064 |
using closure_mono[of "rel_interior S" "rel_frontier T"] closed_rel_frontier[of T] |
|
8065 |
closure_closed[of S] convex_closure_rel_interior[of S] closure_subset[of S] assms |
|
8066 |
by auto |
|
8067 |
then have "rel_interior S \<inter> rel_interior (closure T) \<noteq> {}" |
|
8068 |
using assms rel_frontier_def[of T] rel_interior_subset convex_rel_interior_closure[of T] |
|
8069 |
by auto |
|
8070 |
then have "rel_interior S \<inter> rel_interior T = rel_interior (S \<inter> closure T)" |
|
8071 |
using assms convex_closure convex_rel_interior_inter_two[of S "closure T"] |
|
8072 |
convex_rel_interior_closure[of T] |
|
8073 |
by auto |
|
8074 |
also have "\<dots> = rel_interior S" |
|
8075 |
using * by auto |
|
8076 |
finally show ?thesis |
|
8077 |
by auto |
|
8078 |
qed |
|
40377 | 8079 |
|
8080 |
lemma rel_interior_convex_linear_image: |
|
53348 | 8081 |
fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space" |
8082 |
assumes "linear f" |
|
8083 |
and "convex S" |
|
8084 |
shows "f ` (rel_interior S) = rel_interior (f ` S)" |
|
8085 |
proof (cases "S = {}") |
|
8086 |
case True |
|
8087 |
then show ?thesis |
|
8088 |
using assms rel_interior_empty rel_interior_convex_nonempty by auto |
|
8089 |
next |
|
8090 |
case False |
|
8091 |
have *: "f ` (rel_interior S) \<subseteq> f ` S" |
|
8092 |
unfolding image_mono using rel_interior_subset by auto |
|
8093 |
have "f ` S \<subseteq> f ` (closure S)" |
|
8094 |
unfolding image_mono using closure_subset by auto |
|
8095 |
also have "\<dots> = f ` (closure (rel_interior S))" |
|
8096 |
using convex_closure_rel_interior assms by auto |
|
8097 |
also have "\<dots> \<subseteq> closure (f ` (rel_interior S))" |
|
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
8098 |
using closure_linear_image_subset assms by auto |
53348 | 8099 |
finally have "closure (f ` S) = closure (f ` rel_interior S)" |
8100 |
using closure_mono[of "f ` S" "closure (f ` rel_interior S)"] closure_closure |
|
8101 |
closure_mono[of "f ` rel_interior S" "f ` S"] * |
|
8102 |
by auto |
|
8103 |
then have "rel_interior (f ` S) = rel_interior (f ` rel_interior S)" |
|
8104 |
using assms convex_rel_interior |
|
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
8105 |
linear_conv_bounded_linear[of f] convex_linear_image[of _ S] |
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
8106 |
convex_linear_image[of _ "rel_interior S"] |
53348 | 8107 |
closure_eq_rel_interior_eq[of "f ` S" "f ` rel_interior S"] |
8108 |
by auto |
|
8109 |
then have "rel_interior (f ` S) \<subseteq> f ` rel_interior S" |
|
8110 |
using rel_interior_subset by auto |
|
8111 |
moreover |
|
8112 |
{ |
|
8113 |
fix z |
|
8114 |
assume "z \<in> f ` rel_interior S" |
|
8115 |
then obtain z1 where z1: "z1 \<in> rel_interior S" "f z1 = z" by auto |
|
8116 |
{ |
|
8117 |
fix x |
|
8118 |
assume "x \<in> f ` S" |
|
8119 |
then obtain x1 where x1: "x1 \<in> S" "f x1 = x" by auto |
|
54465 | 8120 |
then obtain e where e: "e > 1" "(1 - e) *\<^sub>R x1 + e *\<^sub>R z1 : S" |
60420 | 8121 |
using convex_rel_interior_iff[of S z1] \<open>convex S\<close> x1 z1 by auto |
53348 | 8122 |
moreover have "f ((1 - e) *\<^sub>R x1 + e *\<^sub>R z1) = (1 - e) *\<^sub>R x + e *\<^sub>R z" |
60420 | 8123 |
using x1 z1 \<open>linear f\<close> by (simp add: linear_add_cmul) |
53348 | 8124 |
ultimately have "(1 - e) *\<^sub>R x + e *\<^sub>R z : f ` S" |
40377 | 8125 |
using imageI[of "(1 - e) *\<^sub>R x1 + e *\<^sub>R z1" S f] by auto |
53348 | 8126 |
then have "\<exists>e. e > 1 \<and> (1 - e) *\<^sub>R x + e *\<^sub>R z : f ` S" |
54465 | 8127 |
using e by auto |
53348 | 8128 |
} |
8129 |
then have "z \<in> rel_interior (f ` S)" |
|
60420 | 8130 |
using convex_rel_interior_iff[of "f ` S" z] \<open>convex S\<close> |
8131 |
\<open>linear f\<close> \<open>S \<noteq> {}\<close> convex_linear_image[of f S] linear_conv_bounded_linear[of f] |
|
53348 | 8132 |
by auto |
8133 |
} |
|
8134 |
ultimately show ?thesis by auto |
|
40377 | 8135 |
qed |
8136 |
||
8137 |
lemma rel_interior_convex_linear_preimage: |
|
53348 | 8138 |
fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space" |
8139 |
assumes "linear f" |
|
8140 |
and "convex S" |
|
8141 |
and "f -` (rel_interior S) \<noteq> {}" |
|
8142 |
shows "rel_interior (f -` S) = f -` (rel_interior S)" |
|
8143 |
proof - |
|
8144 |
have "S \<noteq> {}" |
|
8145 |
using assms rel_interior_empty by auto |
|
8146 |
have nonemp: "f -` S \<noteq> {}" |
|
8147 |
by (metis assms(3) rel_interior_subset subset_empty vimage_mono) |
|
8148 |
then have "S \<inter> (range f) \<noteq> {}" |
|
8149 |
by auto |
|
8150 |
have conv: "convex (f -` S)" |
|
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
8151 |
using convex_linear_vimage assms by auto |
53348 | 8152 |
then have "convex (S \<inter> range f)" |
8153 |
by (metis assms(1) assms(2) convex_Int subspace_UNIV subspace_imp_convex subspace_linear_image) |
|
8154 |
{ |
|
8155 |
fix z |
|
8156 |
assume "z \<in> f -` (rel_interior S)" |
|
8157 |
then have z: "f z : rel_interior S" |
|
8158 |
by auto |
|
8159 |
{ |
|
8160 |
fix x |
|
8161 |
assume "x \<in> f -` S" |
|
8162 |
then have "f x \<in> S" by auto |
|
8163 |
then obtain e where e: "e > 1" "(1 - e) *\<^sub>R f x + e *\<^sub>R f z \<in> S" |
|
60420 | 8164 |
using convex_rel_interior_iff[of S "f z"] z assms \<open>S \<noteq> {}\<close> by auto |
53348 | 8165 |
moreover have "(1 - e) *\<^sub>R f x + e *\<^sub>R f z = f ((1 - e) *\<^sub>R x + e *\<^sub>R z)" |
60420 | 8166 |
using \<open>linear f\<close> by (simp add: linear_iff) |
53348 | 8167 |
ultimately have "\<exists>e. e > 1 \<and> (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> f -` S" |
8168 |
using e by auto |
|
8169 |
} |
|
8170 |
then have "z \<in> rel_interior (f -` S)" |
|
8171 |
using convex_rel_interior_iff[of "f -` S" z] conv nonemp by auto |
|
8172 |
} |
|
8173 |
moreover |
|
54465 | 8174 |
{ |
53348 | 8175 |
fix z |
8176 |
assume z: "z \<in> rel_interior (f -` S)" |
|
8177 |
{ |
|
8178 |
fix x |
|
8179 |
assume "x \<in> S \<inter> range f" |
|
8180 |
then obtain y where y: "f y = x" "y \<in> f -` S" by auto |
|
8181 |
then obtain e where e: "e > 1" "(1 - e) *\<^sub>R y + e *\<^sub>R z \<in> f -` S" |
|
8182 |
using convex_rel_interior_iff[of "f -` S" z] z conv by auto |
|
8183 |
moreover have "(1 - e) *\<^sub>R x + e *\<^sub>R f z = f ((1 - e) *\<^sub>R y + e *\<^sub>R z)" |
|
60420 | 8184 |
using \<open>linear f\<close> y by (simp add: linear_iff) |
53348 | 8185 |
ultimately have "\<exists>e. e > 1 \<and> (1 - e) *\<^sub>R x + e *\<^sub>R f z \<in> S \<inter> range f" |
8186 |
using e by auto |
|
8187 |
} |
|
8188 |
then have "f z \<in> rel_interior (S \<inter> range f)" |
|
60420 | 8189 |
using \<open>convex (S \<inter> (range f))\<close> \<open>S \<inter> range f \<noteq> {}\<close> |
53348 | 8190 |
convex_rel_interior_iff[of "S \<inter> (range f)" "f z"] |
8191 |
by auto |
|
8192 |
moreover have "affine (range f)" |
|
8193 |
by (metis assms(1) subspace_UNIV subspace_imp_affine subspace_linear_image) |
|
8194 |
ultimately have "f z \<in> rel_interior S" |
|
8195 |
using convex_affine_rel_interior_inter[of S "range f"] assms by auto |
|
8196 |
then have "z \<in> f -` (rel_interior S)" |
|
8197 |
by auto |
|
8198 |
} |
|
8199 |
ultimately show ?thesis by auto |
|
40377 | 8200 |
qed |
49531 | 8201 |
|
40377 | 8202 |
lemma rel_interior_direct_sum: |
53348 | 8203 |
fixes S :: "'n::euclidean_space set" |
8204 |
and T :: "'m::euclidean_space set" |
|
8205 |
assumes "convex S" |
|
8206 |
and "convex T" |
|
8207 |
shows "rel_interior (S \<times> T) = rel_interior S \<times> rel_interior T" |
|
8208 |
proof - |
|
60303 | 8209 |
{ assume "S = {}" |
53348 | 8210 |
then have ?thesis |
60303 | 8211 |
by auto |
53348 | 8212 |
} |
8213 |
moreover |
|
60303 | 8214 |
{ assume "T = {}" |
53348 | 8215 |
then have ?thesis |
60303 | 8216 |
by auto |
53348 | 8217 |
} |
8218 |
moreover |
|
8219 |
{ |
|
8220 |
assume "S \<noteq> {}" "T \<noteq> {}" |
|
8221 |
then have ri: "rel_interior S \<noteq> {}" "rel_interior T \<noteq> {}" |
|
8222 |
using rel_interior_convex_nonempty assms by auto |
|
8223 |
then have "fst -` rel_interior S \<noteq> {}" |
|
8224 |
using fst_vimage_eq_Times[of "rel_interior S"] by auto |
|
8225 |
then have "rel_interior ((fst :: 'n * 'm \<Rightarrow> 'n) -` S) = fst -` rel_interior S" |
|
60420 | 8226 |
using fst_linear \<open>convex S\<close> rel_interior_convex_linear_preimage[of fst S] by auto |
53348 | 8227 |
then have s: "rel_interior (S \<times> (UNIV :: 'm set)) = rel_interior S \<times> UNIV" |
8228 |
by (simp add: fst_vimage_eq_Times) |
|
8229 |
from ri have "snd -` rel_interior T \<noteq> {}" |
|
8230 |
using snd_vimage_eq_Times[of "rel_interior T"] by auto |
|
8231 |
then have "rel_interior ((snd :: 'n * 'm \<Rightarrow> 'm) -` T) = snd -` rel_interior T" |
|
60420 | 8232 |
using snd_linear \<open>convex T\<close> rel_interior_convex_linear_preimage[of snd T] by auto |
53348 | 8233 |
then have t: "rel_interior ((UNIV :: 'n set) \<times> T) = UNIV \<times> rel_interior T" |
8234 |
by (simp add: snd_vimage_eq_Times) |
|
8235 |
from s t have *: "rel_interior (S \<times> (UNIV :: 'm set)) \<inter> rel_interior ((UNIV :: 'n set) \<times> T) = |
|
8236 |
rel_interior S \<times> rel_interior T" by auto |
|
8237 |
have "S \<times> T = S \<times> (UNIV :: 'm set) \<inter> (UNIV :: 'n set) \<times> T" |
|
8238 |
by auto |
|
8239 |
then have "rel_interior (S \<times> T) = rel_interior ((S \<times> (UNIV :: 'm set)) \<inter> ((UNIV :: 'n set) \<times> T))" |
|
8240 |
by auto |
|
8241 |
also have "\<dots> = rel_interior (S \<times> (UNIV :: 'm set)) \<inter> rel_interior ((UNIV :: 'n set) \<times> T)" |
|
55787 | 8242 |
apply (subst convex_rel_interior_inter_two[of "S \<times> (UNIV :: 'm set)" "(UNIV :: 'n set) \<times> T"]) |
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
8243 |
using * ri assms convex_Times |
53348 | 8244 |
apply auto |
8245 |
done |
|
8246 |
finally have ?thesis using * by auto |
|
8247 |
} |
|
8248 |
ultimately show ?thesis by blast |
|
40377 | 8249 |
qed |
8250 |
||
49531 | 8251 |
lemma rel_interior_scaleR: |
53348 | 8252 |
fixes S :: "'n::euclidean_space set" |
8253 |
assumes "c \<noteq> 0" |
|
8254 |
shows "(op *\<^sub>R c) ` (rel_interior S) = rel_interior ((op *\<^sub>R c) ` S)" |
|
8255 |
using rel_interior_injective_linear_image[of "(op *\<^sub>R c)" S] |
|
8256 |
linear_conv_bounded_linear[of "op *\<^sub>R c"] linear_scaleR injective_scaleR[of c] assms |
|
8257 |
by auto |
|
40377 | 8258 |
|
49531 | 8259 |
lemma rel_interior_convex_scaleR: |
53348 | 8260 |
fixes S :: "'n::euclidean_space set" |
8261 |
assumes "convex S" |
|
8262 |
shows "(op *\<^sub>R c) ` (rel_interior S) = rel_interior ((op *\<^sub>R c) ` S)" |
|
8263 |
by (metis assms linear_scaleR rel_interior_convex_linear_image) |
|
40377 | 8264 |
|
49531 | 8265 |
lemma convex_rel_open_scaleR: |
53348 | 8266 |
fixes S :: "'n::euclidean_space set" |
8267 |
assumes "convex S" |
|
8268 |
and "rel_open S" |
|
8269 |
shows "convex ((op *\<^sub>R c) ` S) \<and> rel_open ((op *\<^sub>R c) ` S)" |
|
8270 |
by (metis assms convex_scaling rel_interior_convex_scaleR rel_open_def) |
|
40377 | 8271 |
|
49531 | 8272 |
lemma convex_rel_open_finite_inter: |
53348 | 8273 |
assumes "\<forall>S\<in>I. convex (S :: 'n::euclidean_space set) \<and> rel_open S" |
8274 |
and "finite I" |
|
8275 |
shows "convex (\<Inter>I) \<and> rel_open (\<Inter>I)" |
|
54465 | 8276 |
proof (cases "\<Inter>{rel_interior S |S. S \<in> I} = {}") |
53348 | 8277 |
case True |
8278 |
then have "\<Inter>I = {}" |
|
8279 |
using assms unfolding rel_open_def by auto |
|
8280 |
then show ?thesis |
|
8281 |
unfolding rel_open_def using rel_interior_empty by auto |
|
8282 |
next |
|
8283 |
case False |
|
54465 | 8284 |
then have "rel_open (\<Inter>I)" |
53348 | 8285 |
using assms unfolding rel_open_def |
8286 |
using convex_rel_interior_finite_inter[of I] |
|
8287 |
by auto |
|
8288 |
then show ?thesis |
|
8289 |
using convex_Inter assms by auto |
|
40377 | 8290 |
qed |
8291 |
||
8292 |
lemma convex_rel_open_linear_image: |
|
53348 | 8293 |
fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space" |
8294 |
assumes "linear f" |
|
8295 |
and "convex S" |
|
8296 |
and "rel_open S" |
|
8297 |
shows "convex (f ` S) \<and> rel_open (f ` S)" |
|
57865 | 8298 |
by (metis assms convex_linear_image rel_interior_convex_linear_image rel_open_def) |
40377 | 8299 |
|
8300 |
lemma convex_rel_open_linear_preimage: |
|
53348 | 8301 |
fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space" |
8302 |
assumes "linear f" |
|
8303 |
and "convex S" |
|
8304 |
and "rel_open S" |
|
8305 |
shows "convex (f -` S) \<and> rel_open (f -` S)" |
|
8306 |
proof (cases "f -` (rel_interior S) = {}") |
|
8307 |
case True |
|
8308 |
then have "f -` S = {}" |
|
8309 |
using assms unfolding rel_open_def by auto |
|
8310 |
then show ?thesis |
|
8311 |
unfolding rel_open_def using rel_interior_empty by auto |
|
8312 |
next |
|
8313 |
case False |
|
8314 |
then have "rel_open (f -` S)" |
|
8315 |
using assms unfolding rel_open_def |
|
8316 |
using rel_interior_convex_linear_preimage[of f S] |
|
8317 |
by auto |
|
8318 |
then show ?thesis |
|
53620
3c7f5e7926dc
generalized and simplified proofs of several theorems about convex sets
huffman
parents:
53600
diff
changeset
|
8319 |
using convex_linear_vimage assms |
53348 | 8320 |
by auto |
40377 | 8321 |
qed |
8322 |
||
8323 |
lemma rel_interior_projection: |
|
53348 | 8324 |
fixes S :: "('m::euclidean_space \<times> 'n::euclidean_space) set" |
8325 |
and f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space set" |
|
8326 |
assumes "convex S" |
|
8327 |
and "f = (\<lambda>y. {z. (y, z) \<in> S})" |
|
8328 |
shows "(y, z) \<in> rel_interior S \<longleftrightarrow> (y \<in> rel_interior {y. (f y \<noteq> {})} \<and> z \<in> rel_interior (f y))" |
|
8329 |
proof - |
|
8330 |
{ |
|
8331 |
fix y |
|
8332 |
assume "y \<in> {y. f y \<noteq> {}}" |
|
8333 |
then obtain z where "(y, z) \<in> S" |
|
8334 |
using assms by auto |
|
8335 |
then have "\<exists>x. x \<in> S \<and> y = fst x" |
|
8336 |
apply (rule_tac x="(y, z)" in exI) |
|
8337 |
apply auto |
|
8338 |
done |
|
8339 |
then obtain x where "x \<in> S" "y = fst x" |
|
8340 |
by blast |
|
8341 |
then have "y \<in> fst ` S" |
|
8342 |
unfolding image_def by auto |
|
40377 | 8343 |
} |
53348 | 8344 |
then have "fst ` S = {y. f y \<noteq> {}}" |
8345 |
unfolding fst_def using assms by auto |
|
8346 |
then have h1: "fst ` rel_interior S = rel_interior {y. f y \<noteq> {}}" |
|
8347 |
using rel_interior_convex_linear_image[of fst S] assms fst_linear by auto |
|
8348 |
{ |
|
8349 |
fix y |
|
8350 |
assume "y \<in> rel_interior {y. f y \<noteq> {}}" |
|
8351 |
then have "y \<in> fst ` rel_interior S" |
|
8352 |
using h1 by auto |
|
8353 |
then have *: "rel_interior S \<inter> fst -` {y} \<noteq> {}" |
|
8354 |
by auto |
|
8355 |
moreover have aff: "affine (fst -` {y})" |
|
8356 |
unfolding affine_alt by (simp add: algebra_simps) |
|
8357 |
ultimately have **: "rel_interior (S \<inter> fst -` {y}) = rel_interior S \<inter> fst -` {y}" |
|
8358 |
using convex_affine_rel_interior_inter[of S "fst -` {y}"] assms by auto |
|
8359 |
have conv: "convex (S \<inter> fst -` {y})" |
|
8360 |
using convex_Int assms aff affine_imp_convex by auto |
|
8361 |
{ |
|
8362 |
fix x |
|
8363 |
assume "x \<in> f y" |
|
8364 |
then have "(y, x) \<in> S \<inter> (fst -` {y})" |
|
8365 |
using assms by auto |
|
8366 |
moreover have "x = snd (y, x)" by auto |
|
8367 |
ultimately have "x \<in> snd ` (S \<inter> fst -` {y})" |
|
8368 |
by blast |
|
8369 |
} |
|
8370 |
then have "snd ` (S \<inter> fst -` {y}) = f y" |
|
8371 |
using assms by auto |
|
8372 |
then have ***: "rel_interior (f y) = snd ` rel_interior (S \<inter> fst -` {y})" |
|
8373 |
using rel_interior_convex_linear_image[of snd "S \<inter> fst -` {y}"] snd_linear conv |
|
8374 |
by auto |
|
8375 |
{ |
|
8376 |
fix z |
|
8377 |
assume "z \<in> rel_interior (f y)" |
|
8378 |
then have "z \<in> snd ` rel_interior (S \<inter> fst -` {y})" |
|
8379 |
using *** by auto |
|
8380 |
moreover have "{y} = fst ` rel_interior (S \<inter> fst -` {y})" |
|
8381 |
using * ** rel_interior_subset by auto |
|
8382 |
ultimately have "(y, z) \<in> rel_interior (S \<inter> fst -` {y})" |
|
8383 |
by force |
|
8384 |
then have "(y,z) \<in> rel_interior S" |
|
8385 |
using ** by auto |
|
8386 |
} |
|
8387 |
moreover |
|
8388 |
{ |
|
8389 |
fix z |
|
8390 |
assume "(y, z) \<in> rel_interior S" |
|
8391 |
then have "(y, z) \<in> rel_interior (S \<inter> fst -` {y})" |
|
8392 |
using ** by auto |
|
8393 |
then have "z \<in> snd ` rel_interior (S \<inter> fst -` {y})" |
|
8394 |
by (metis Range_iff snd_eq_Range) |
|
8395 |
then have "z \<in> rel_interior (f y)" |
|
8396 |
using *** by auto |
|
8397 |
} |
|
8398 |
ultimately have "\<And>z. (y, z) \<in> rel_interior S \<longleftrightarrow> z \<in> rel_interior (f y)" |
|
8399 |
by auto |
|
40377 | 8400 |
} |
53348 | 8401 |
then have h2: "\<And>y z. y \<in> rel_interior {t. f t \<noteq> {}} \<Longrightarrow> |
8402 |
(y, z) \<in> rel_interior S \<longleftrightarrow> z \<in> rel_interior (f y)" |
|
8403 |
by auto |
|
8404 |
{ |
|
8405 |
fix y z |
|
8406 |
assume asm: "(y, z) \<in> rel_interior S" |
|
8407 |
then have "y \<in> fst ` rel_interior S" |
|
8408 |
by (metis Domain_iff fst_eq_Domain) |
|
8409 |
then have "y \<in> rel_interior {t. f t \<noteq> {}}" |
|
8410 |
using h1 by auto |
|
8411 |
then have "y \<in> rel_interior {t. f t \<noteq> {}}" and "(z : rel_interior (f y))" |
|
8412 |
using h2 asm by auto |
|
40377 | 8413 |
} |
53348 | 8414 |
then show ?thesis using h2 by blast |
8415 |
qed |
|
8416 |
||
40377 | 8417 |
|
60420 | 8418 |
subsubsection \<open>Relative interior of convex cone\<close> |
40377 | 8419 |
|
8420 |
lemma cone_rel_interior: |
|
53348 | 8421 |
fixes S :: "'m::euclidean_space set" |
8422 |
assumes "cone S" |
|
8423 |
shows "cone ({0} \<union> rel_interior S)" |
|
8424 |
proof (cases "S = {}") |
|
8425 |
case True |
|
8426 |
then show ?thesis |
|
8427 |
by (simp add: rel_interior_empty cone_0) |
|
8428 |
next |
|
8429 |
case False |
|
8430 |
then have *: "0 \<in> S \<and> (\<forall>c. c > 0 \<longrightarrow> op *\<^sub>R c ` S = S)" |
|
8431 |
using cone_iff[of S] assms by auto |
|
8432 |
then have *: "0 \<in> ({0} \<union> rel_interior S)" |
|
54465 | 8433 |
and "\<forall>c. c > 0 \<longrightarrow> op *\<^sub>R c ` ({0} \<union> rel_interior S) = ({0} \<union> rel_interior S)" |
53348 | 8434 |
by (auto simp add: rel_interior_scaleR) |
8435 |
then show ?thesis |
|
54465 | 8436 |
using cone_iff[of "{0} \<union> rel_interior S"] by auto |
40377 | 8437 |
qed |
8438 |
||
8439 |
lemma rel_interior_convex_cone_aux: |
|
54465 | 8440 |
fixes S :: "'m::euclidean_space set" |
8441 |
assumes "convex S" |
|
55787 | 8442 |
shows "(c, x) \<in> rel_interior (cone hull ({(1 :: real)} \<times> S)) \<longleftrightarrow> |
54465 | 8443 |
c > 0 \<and> x \<in> ((op *\<^sub>R c) ` (rel_interior S))" |
8444 |
proof (cases "S = {}") |
|
8445 |
case True |
|
8446 |
then show ?thesis |
|
8447 |
by (simp add: rel_interior_empty cone_hull_empty) |
|
8448 |
next |
|
8449 |
case False |
|
8450 |
then obtain s where "s \<in> S" by auto |
|
55787 | 8451 |
have conv: "convex ({(1 :: real)} \<times> S)" |
54465 | 8452 |
using convex_Times[of "{(1 :: real)}" S] assms convex_singleton[of "1 :: real"] |
8453 |
by auto |
|
55787 | 8454 |
def f \<equiv> "\<lambda>y. {z. (y, z) \<in> cone hull ({1 :: real} \<times> S)}" |
8455 |
then have *: "(c, x) \<in> rel_interior (cone hull ({(1 :: real)} \<times> S)) = |
|
54465 | 8456 |
(c \<in> rel_interior {y. f y \<noteq> {}} \<and> x \<in> rel_interior (f c))" |
55787 | 8457 |
apply (subst rel_interior_projection[of "cone hull ({(1 :: real)} \<times> S)" f c x]) |
8458 |
using convex_cone_hull[of "{(1 :: real)} \<times> S"] conv |
|
54465 | 8459 |
apply auto |
8460 |
done |
|
8461 |
{ |
|
8462 |
fix y :: real |
|
8463 |
assume "y \<ge> 0" |
|
55787 | 8464 |
then have "y *\<^sub>R (1,s) \<in> cone hull ({1 :: real} \<times> S)" |
60420 | 8465 |
using cone_hull_expl[of "{(1 :: real)} \<times> S"] \<open>s \<in> S\<close> by auto |
54465 | 8466 |
then have "f y \<noteq> {}" |
8467 |
using f_def by auto |
|
8468 |
} |
|
8469 |
then have "{y. f y \<noteq> {}} = {0..}" |
|
55787 | 8470 |
using f_def cone_hull_expl[of "{1 :: real} \<times> S"] by auto |
54465 | 8471 |
then have **: "rel_interior {y. f y \<noteq> {}} = {0<..}" |
8472 |
using rel_interior_real_semiline by auto |
|
8473 |
{ |
|
8474 |
fix c :: real |
|
8475 |
assume "c > 0" |
|
8476 |
then have "f c = (op *\<^sub>R c ` S)" |
|
55787 | 8477 |
using f_def cone_hull_expl[of "{1 :: real} \<times> S"] by auto |
54465 | 8478 |
then have "rel_interior (f c) = op *\<^sub>R c ` rel_interior S" |
8479 |
using rel_interior_convex_scaleR[of S c] assms by auto |
|
8480 |
} |
|
8481 |
then show ?thesis using * ** by auto |
|
8482 |
qed |
|
40377 | 8483 |
|
8484 |
lemma rel_interior_convex_cone: |
|
54465 | 8485 |
fixes S :: "'m::euclidean_space set" |
8486 |
assumes "convex S" |
|
55787 | 8487 |
shows "rel_interior (cone hull ({1 :: real} \<times> S)) = |
54465 | 8488 |
{(c, c *\<^sub>R x) | c x. c > 0 \<and> x \<in> rel_interior S}" |
8489 |
(is "?lhs = ?rhs") |
|
8490 |
proof - |
|
8491 |
{ |
|
8492 |
fix z |
|
8493 |
assume "z \<in> ?lhs" |
|
8494 |
have *: "z = (fst z, snd z)" |
|
8495 |
by auto |
|
8496 |
have "z \<in> ?rhs" |
|
60420 | 8497 |
using rel_interior_convex_cone_aux[of S "fst z" "snd z"] assms \<open>z \<in> ?lhs\<close> |
54465 | 8498 |
apply auto |
8499 |
apply (rule_tac x = "fst z" in exI) |
|
8500 |
apply (rule_tac x = x in exI) |
|
8501 |
using * |
|
8502 |
apply auto |
|
8503 |
done |
|
8504 |
} |
|
8505 |
moreover |
|
8506 |
{ |
|
8507 |
fix z |
|
8508 |
assume "z \<in> ?rhs" |
|
8509 |
then have "z \<in> ?lhs" |
|
8510 |
using rel_interior_convex_cone_aux[of S "fst z" "snd z"] assms |
|
8511 |
by auto |
|
8512 |
} |
|
8513 |
ultimately show ?thesis by blast |
|
40377 | 8514 |
qed |
8515 |
||
8516 |
lemma convex_hull_finite_union: |
|
54465 | 8517 |
assumes "finite I" |
8518 |
assumes "\<forall>i\<in>I. convex (S i) \<and> (S i) \<noteq> {}" |
|
8519 |
shows "convex hull (\<Union>(S ` I)) = |
|
8520 |
{setsum (\<lambda>i. c i *\<^sub>R s i) I | c s. (\<forall>i\<in>I. c i \<ge> 0) \<and> setsum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> S i)}" |
|
40377 | 8521 |
(is "?lhs = ?rhs") |
54465 | 8522 |
proof - |
8523 |
have "?lhs \<supseteq> ?rhs" |
|
8524 |
proof |
|
8525 |
fix x |
|
8526 |
assume "x : ?rhs" |
|
8527 |
then obtain c s where *: "setsum (\<lambda>i. c i *\<^sub>R s i) I = x" "setsum c I = 1" |
|
8528 |
"(\<forall>i\<in>I. c i \<ge> 0) \<and> (\<forall>i\<in>I. s i \<in> S i)" by auto |
|
8529 |
then have "\<forall>i\<in>I. s i \<in> convex hull (\<Union>(S ` I))" |
|
8530 |
using hull_subset[of "\<Union>(S ` I)" convex] by auto |
|
8531 |
then show "x \<in> ?lhs" |
|
8532 |
unfolding *(1)[symmetric] |
|
8533 |
apply (subst convex_setsum[of I "convex hull \<Union>(S ` I)" c s]) |
|
8534 |
using * assms convex_convex_hull |
|
8535 |
apply auto |
|
8536 |
done |
|
8537 |
qed |
|
8538 |
||
8539 |
{ |
|
8540 |
fix i |
|
8541 |
assume "i \<in> I" |
|
8542 |
with assms have "\<exists>p. p \<in> S i" by auto |
|
8543 |
} |
|
8544 |
then obtain p where p: "\<forall>i\<in>I. p i \<in> S i" by metis |
|
8545 |
||
8546 |
{ |
|
8547 |
fix i |
|
8548 |
assume "i \<in> I" |
|
8549 |
{ |
|
8550 |
fix x |
|
8551 |
assume "x \<in> S i" |
|
8552 |
def c \<equiv> "\<lambda>j. if j = i then 1::real else 0" |
|
8553 |
then have *: "setsum c I = 1" |
|
60420 | 8554 |
using \<open>finite I\<close> \<open>i \<in> I\<close> setsum.delta[of I i "\<lambda>j::'a. 1::real"] |
54465 | 8555 |
by auto |
8556 |
def s \<equiv> "\<lambda>j. if j = i then x else p j" |
|
8557 |
then have "\<forall>j. c j *\<^sub>R s j = (if j = i then x else 0)" |
|
8558 |
using c_def by (auto simp add: algebra_simps) |
|
8559 |
then have "x = setsum (\<lambda>i. c i *\<^sub>R s i) I" |
|
60420 | 8560 |
using s_def c_def \<open>finite I\<close> \<open>i \<in> I\<close> setsum.delta[of I i "\<lambda>j::'a. x"] |
54465 | 8561 |
by auto |
8562 |
then have "x \<in> ?rhs" |
|
8563 |
apply auto |
|
8564 |
apply (rule_tac x = c in exI) |
|
8565 |
apply (rule_tac x = s in exI) |
|
60420 | 8566 |
using * c_def s_def p \<open>x \<in> S i\<close> |
54465 | 8567 |
apply auto |
8568 |
done |
|
40377 | 8569 |
} |
54465 | 8570 |
then have "?rhs \<supseteq> S i" by auto |
8571 |
} |
|
8572 |
then have *: "?rhs \<supseteq> \<Union>(S ` I)" by auto |
|
8573 |
||
8574 |
{ |
|
8575 |
fix u v :: real |
|
8576 |
assume uv: "u \<ge> 0 \<and> v \<ge> 0 \<and> u + v = 1" |
|
8577 |
fix x y |
|
8578 |
assume xy: "x \<in> ?rhs \<and> y \<in> ?rhs" |
|
8579 |
from xy obtain c s where |
|
8580 |
xc: "x = setsum (\<lambda>i. c i *\<^sub>R s i) I \<and> (\<forall>i\<in>I. c i \<ge> 0) \<and> setsum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> S i)" |
|
8581 |
by auto |
|
8582 |
from xy obtain d t where |
|
8583 |
yc: "y = setsum (\<lambda>i. d i *\<^sub>R t i) I \<and> (\<forall>i\<in>I. d i \<ge> 0) \<and> setsum d I = 1 \<and> (\<forall>i\<in>I. t i \<in> S i)" |
|
8584 |
by auto |
|
8585 |
def e \<equiv> "\<lambda>i. u * c i + v * d i" |
|
8586 |
have ge0: "\<forall>i\<in>I. e i \<ge> 0" |
|
56536 | 8587 |
using e_def xc yc uv by simp |
54465 | 8588 |
have "setsum (\<lambda>i. u * c i) I = u * setsum c I" |
8589 |
by (simp add: setsum_right_distrib) |
|
8590 |
moreover have "setsum (\<lambda>i. v * d i) I = v * setsum d I" |
|
8591 |
by (simp add: setsum_right_distrib) |
|
8592 |
ultimately have sum1: "setsum e I = 1" |
|
57418 | 8593 |
using e_def xc yc uv by (simp add: setsum.distrib) |
54465 | 8594 |
def q \<equiv> "\<lambda>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" |
8595 |
{ |
|
8596 |
fix i |
|
8597 |
assume i: "i \<in> I" |
|
8598 |
have "q i \<in> S i" |
|
8599 |
proof (cases "e i = 0") |
|
8600 |
case True |
|
8601 |
then show ?thesis using i p q_def by auto |
|
8602 |
next |
|
8603 |
case False |
|
8604 |
then show ?thesis |
|
8605 |
using mem_convex_alt[of "S i" "s i" "t i" "u * (c i)" "v * (d i)"] |
|
8606 |
mult_nonneg_nonneg[of u "c i"] mult_nonneg_nonneg[of v "d i"] |
|
8607 |
assms q_def e_def i False xc yc uv |
|
56536 | 8608 |
by (auto simp del: mult_nonneg_nonneg) |
54465 | 8609 |
qed |
8610 |
} |
|
8611 |
then have qs: "\<forall>i\<in>I. q i \<in> S i" by auto |
|
8612 |
{ |
|
8613 |
fix i |
|
8614 |
assume i: "i \<in> I" |
|
8615 |
have "(u * c i) *\<^sub>R s i + (v * d i) *\<^sub>R t i = e i *\<^sub>R q i" |
|
8616 |
proof (cases "e i = 0") |
|
8617 |
case True |
|
8618 |
have ge: "u * (c i) \<ge> 0 \<and> v * d i \<ge> 0" |
|
56536 | 8619 |
using xc yc uv i by simp |
54465 | 8620 |
moreover from ge have "u * c i \<le> 0 \<and> v * d i \<le> 0" |
8621 |
using True e_def i by simp |
|
8622 |
ultimately have "u * c i = 0 \<and> v * d i = 0" by auto |
|
8623 |
with True show ?thesis by auto |
|
8624 |
next |
|
8625 |
case False |
|
8626 |
then have "(u * (c i)/(e i))*\<^sub>R (s i)+(v * (d i)/(e i))*\<^sub>R (t i) = q i" |
|
8627 |
using q_def by auto |
|
8628 |
then have "e i *\<^sub>R ((u * (c i)/(e i))*\<^sub>R (s i)+(v * (d i)/(e i))*\<^sub>R (t i)) |
|
8629 |
= (e i) *\<^sub>R (q i)" by auto |
|
8630 |
with False show ?thesis by (simp add: algebra_simps) |
|
8631 |
qed |
|
8632 |
} |
|
8633 |
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" |
|
8634 |
by auto |
|
8635 |
have "u *\<^sub>R x + v *\<^sub>R y = setsum (\<lambda>i. (u * c i) *\<^sub>R s i + (v * d i) *\<^sub>R t i) I" |
|
57418 | 8636 |
using xc yc by (simp add: algebra_simps scaleR_right.setsum setsum.distrib) |
54465 | 8637 |
also have "\<dots> = setsum (\<lambda>i. e i *\<^sub>R q i) I" |
8638 |
using * by auto |
|
8639 |
finally have "u *\<^sub>R x + v *\<^sub>R y = setsum (\<lambda>i. (e i) *\<^sub>R (q i)) I" |
|
8640 |
by auto |
|
8641 |
then have "u *\<^sub>R x + v *\<^sub>R y \<in> ?rhs" |
|
8642 |
using ge0 sum1 qs by auto |
|
8643 |
} |
|
8644 |
then have "convex ?rhs" unfolding convex_def by auto |
|
8645 |
then show ?thesis |
|
60420 | 8646 |
using \<open>?lhs \<supseteq> ?rhs\<close> * hull_minimal[of "\<Union>(S ` I)" ?rhs convex] |
54465 | 8647 |
by blast |
40377 | 8648 |
qed |
8649 |
||
8650 |
lemma convex_hull_union_two: |
|
54465 | 8651 |
fixes S T :: "'m::euclidean_space set" |
8652 |
assumes "convex S" |
|
8653 |
and "S \<noteq> {}" |
|
8654 |
and "convex T" |
|
8655 |
and "T \<noteq> {}" |
|
8656 |
shows "convex hull (S \<union> T) = |
|
8657 |
{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}" |
|
40377 | 8658 |
(is "?lhs = ?rhs") |
54465 | 8659 |
proof |
8660 |
def I \<equiv> "{1::nat, 2}" |
|
8661 |
def s \<equiv> "\<lambda>i. if i = (1::nat) then S else T" |
|
8662 |
have "\<Union>(s ` I) = S \<union> T" |
|
8663 |
using s_def I_def by auto |
|
8664 |
then have "convex hull (\<Union>(s ` I)) = convex hull (S \<union> T)" |
|
8665 |
by auto |
|
8666 |
moreover have "convex hull \<Union>(s ` I) = |
|
8667 |
{\<Sum> i\<in>I. c i *\<^sub>R sa i | c sa. (\<forall>i\<in>I. 0 \<le> c i) \<and> setsum c I = 1 \<and> (\<forall>i\<in>I. sa i \<in> s i)}" |
|
8668 |
apply (subst convex_hull_finite_union[of I s]) |
|
8669 |
using assms s_def I_def |
|
8670 |
apply auto |
|
8671 |
done |
|
8672 |
moreover have |
|
8673 |
"{\<Sum>i\<in>I. c i *\<^sub>R sa i | c sa. (\<forall>i\<in>I. 0 \<le> c i) \<and> setsum c I = 1 \<and> (\<forall>i\<in>I. sa i \<in> s i)} \<le> ?rhs" |
|
8674 |
using s_def I_def by auto |
|
8675 |
ultimately show "?lhs \<subseteq> ?rhs" by auto |
|
8676 |
{ |
|
8677 |
fix x |
|
8678 |
assume "x \<in> ?rhs" |
|
8679 |
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" |
|
8680 |
by auto |
|
8681 |
then have "x \<in> convex hull {s, t}" |
|
8682 |
using convex_hull_2[of s t] by auto |
|
8683 |
then have "x \<in> convex hull (S \<union> T)" |
|
8684 |
using * hull_mono[of "{s, t}" "S \<union> T"] by auto |
|
8685 |
} |
|
8686 |
then show "?lhs \<supseteq> ?rhs" by blast |
|
8687 |
qed |
|
8688 |
||
40377 | 8689 |
|
60420 | 8690 |
subsection \<open>Convexity on direct sums\<close> |
40887
ee8d0548c148
Prove rel_interior_convex_hull_union (by Grechuck Bogdan).
hoelzl
parents:
40719
diff
changeset
|
8691 |
|
ee8d0548c148
Prove rel_interior_convex_hull_union (by Grechuck Bogdan).
hoelzl
parents:
40719
diff
changeset
|
8692 |
lemma closure_sum: |
55928 | 8693 |
fixes S T :: "'a::real_normed_vector set" |
47445
69e96e5500df
Set_Algebras: removed syntax \<oplus> and \<otimes>, in favour of plain + and *
krauss
parents:
47444
diff
changeset
|
8694 |
shows "closure S + closure T \<subseteq> closure (S + T)" |
55928 | 8695 |
unfolding set_plus_image closure_Times [symmetric] split_def |
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
8696 |
by (intro closure_bounded_linear_image_subset bounded_linear_add |
55928 | 8697 |
bounded_linear_fst bounded_linear_snd) |
40887
ee8d0548c148
Prove rel_interior_convex_hull_union (by Grechuck Bogdan).
hoelzl
parents:
40719
diff
changeset
|
8698 |
|
ee8d0548c148
Prove rel_interior_convex_hull_union (by Grechuck Bogdan).
hoelzl
parents:
40719
diff
changeset
|
8699 |
lemma rel_interior_sum: |
54465 | 8700 |
fixes S T :: "'n::euclidean_space set" |
8701 |
assumes "convex S" |
|
8702 |
and "convex T" |
|
8703 |
shows "rel_interior (S + T) = rel_interior S + rel_interior T" |
|
8704 |
proof - |
|
55787 | 8705 |
have "rel_interior S + rel_interior T = (\<lambda>(x,y). x + y) ` (rel_interior S \<times> rel_interior T)" |
54465 | 8706 |
by (simp add: set_plus_image) |
55787 | 8707 |
also have "\<dots> = (\<lambda>(x,y). x + y) ` rel_interior (S \<times> T)" |
54465 | 8708 |
using rel_interior_direct_sum assms by auto |
8709 |
also have "\<dots> = rel_interior (S + T)" |
|
8710 |
using fst_snd_linear convex_Times assms |
|
55787 | 8711 |
rel_interior_convex_linear_image[of "(\<lambda>(x,y). x + y)" "S \<times> T"] |
54465 | 8712 |
by (auto simp add: set_plus_image) |
8713 |
finally show ?thesis .. |
|
40887
ee8d0548c148
Prove rel_interior_convex_hull_union (by Grechuck Bogdan).
hoelzl
parents:
40719
diff
changeset
|
8714 |
qed |
ee8d0548c148
Prove rel_interior_convex_hull_union (by Grechuck Bogdan).
hoelzl
parents:
40719
diff
changeset
|
8715 |
|
ee8d0548c148
Prove rel_interior_convex_hull_union (by Grechuck Bogdan).
hoelzl
parents:
40719
diff
changeset
|
8716 |
lemma rel_interior_sum_gen: |
54465 | 8717 |
fixes S :: "'a \<Rightarrow> 'n::euclidean_space set" |
8718 |
assumes "\<forall>i\<in>I. convex (S i)" |
|
8719 |
shows "rel_interior (setsum S I) = setsum (\<lambda>i. rel_interior (S i)) I" |
|
8720 |
apply (subst setsum_set_cond_linear[of convex]) |
|
8721 |
using rel_interior_sum rel_interior_sing[of "0"] assms |
|
55929
91f245c23bc5
remove lemmas in favor of more general ones: convex(_hull)_set_{plus,setsum}
huffman
parents:
55928
diff
changeset
|
8722 |
apply (auto simp add: convex_set_plus) |
54465 | 8723 |
done |
40887
ee8d0548c148
Prove rel_interior_convex_hull_union (by Grechuck Bogdan).
hoelzl
parents:
40719
diff
changeset
|
8724 |
|
ee8d0548c148
Prove rel_interior_convex_hull_union (by Grechuck Bogdan).
hoelzl
parents:
40719
diff
changeset
|
8725 |
lemma convex_rel_open_direct_sum: |
54465 | 8726 |
fixes S T :: "'n::euclidean_space set" |
8727 |
assumes "convex S" |
|
8728 |
and "rel_open S" |
|
8729 |
and "convex T" |
|
8730 |
and "rel_open T" |
|
55787 | 8731 |
shows "convex (S \<times> T) \<and> rel_open (S \<times> T)" |
54465 | 8732 |
by (metis assms convex_Times rel_interior_direct_sum rel_open_def) |
40887
ee8d0548c148
Prove rel_interior_convex_hull_union (by Grechuck Bogdan).
hoelzl
parents:
40719
diff
changeset
|
8733 |
|
ee8d0548c148
Prove rel_interior_convex_hull_union (by Grechuck Bogdan).
hoelzl
parents:
40719
diff
changeset
|
8734 |
lemma convex_rel_open_sum: |
54465 | 8735 |
fixes S T :: "'n::euclidean_space set" |
8736 |
assumes "convex S" |
|
8737 |
and "rel_open S" |
|
8738 |
and "convex T" |
|
8739 |
and "rel_open T" |
|
8740 |
shows "convex (S + T) \<and> rel_open (S + T)" |
|
55929
91f245c23bc5
remove lemmas in favor of more general ones: convex(_hull)_set_{plus,setsum}
huffman
parents:
55928
diff
changeset
|
8741 |
by (metis assms convex_set_plus rel_interior_sum rel_open_def) |
40887
ee8d0548c148
Prove rel_interior_convex_hull_union (by Grechuck Bogdan).
hoelzl
parents:
40719
diff
changeset
|
8742 |
|
ee8d0548c148
Prove rel_interior_convex_hull_union (by Grechuck Bogdan).
hoelzl
parents:
40719
diff
changeset
|
8743 |
lemma convex_hull_finite_union_cones: |
54465 | 8744 |
assumes "finite I" |
8745 |
and "I \<noteq> {}" |
|
8746 |
assumes "\<forall>i\<in>I. convex (S i) \<and> cone (S i) \<and> S i \<noteq> {}" |
|
8747 |
shows "convex hull (\<Union>(S ` I)) = setsum S I" |
|
40887
ee8d0548c148
Prove rel_interior_convex_hull_union (by Grechuck Bogdan).
hoelzl
parents:
40719
diff
changeset
|
8748 |
(is "?lhs = ?rhs") |
54465 | 8749 |
proof - |
8750 |
{ |
|
8751 |
fix x |
|
8752 |
assume "x \<in> ?lhs" |
|
8753 |
then obtain c xs where |
|
8754 |
x: "x = setsum (\<lambda>i. c i *\<^sub>R xs i) I \<and> (\<forall>i\<in>I. c i \<ge> 0) \<and> setsum c I = 1 \<and> (\<forall>i\<in>I. xs i \<in> S i)" |
|
8755 |
using convex_hull_finite_union[of I S] assms by auto |
|
8756 |
def s \<equiv> "\<lambda>i. c i *\<^sub>R xs i" |
|
8757 |
{ |
|
8758 |
fix i |
|
8759 |
assume "i \<in> I" |
|
8760 |
then have "s i \<in> S i" |
|
8761 |
using s_def x assms mem_cone[of "S i" "xs i" "c i"] by auto |
|
8762 |
} |
|
8763 |
then have "\<forall>i\<in>I. s i \<in> S i" by auto |
|
8764 |
moreover have "x = setsum s I" using x s_def by auto |
|
8765 |
ultimately have "x \<in> ?rhs" |
|
8766 |
using set_setsum_alt[of I S] assms by auto |
|
8767 |
} |
|
8768 |
moreover |
|
8769 |
{ |
|
8770 |
fix x |
|
8771 |
assume "x \<in> ?rhs" |
|
8772 |
then obtain s where x: "x = setsum s I \<and> (\<forall>i\<in>I. s i \<in> S i)" |
|
8773 |
using set_setsum_alt[of I S] assms by auto |
|
8774 |
def xs \<equiv> "\<lambda>i. of_nat(card I) *\<^sub>R s i" |
|
8775 |
then have "x = setsum (\<lambda>i. ((1 :: real) / of_nat(card I)) *\<^sub>R xs i) I" |
|
8776 |
using x assms by auto |
|
8777 |
moreover have "\<forall>i\<in>I. xs i \<in> S i" |
|
8778 |
using x xs_def assms by (simp add: cone_def) |
|
8779 |
moreover have "\<forall>i\<in>I. (1 :: real) / of_nat (card I) \<ge> 0" |
|
8780 |
by auto |
|
8781 |
moreover have "setsum (\<lambda>i. (1 :: real) / of_nat (card I)) I = 1" |
|
8782 |
using assms by auto |
|
8783 |
ultimately have "x \<in> ?lhs" |
|
8784 |
apply (subst convex_hull_finite_union[of I S]) |
|
8785 |
using assms |
|
8786 |
apply blast |
|
8787 |
using assms |
|
8788 |
apply blast |
|
8789 |
apply rule |
|
8790 |
apply (rule_tac x = "(\<lambda>i. (1 :: real) / of_nat (card I))" in exI) |
|
8791 |
apply auto |
|
8792 |
done |
|
8793 |
} |
|
8794 |
ultimately show ?thesis by auto |
|
40887
ee8d0548c148
Prove rel_interior_convex_hull_union (by Grechuck Bogdan).
hoelzl
parents:
40719
diff
changeset
|
8795 |
qed |
ee8d0548c148
Prove rel_interior_convex_hull_union (by Grechuck Bogdan).
hoelzl
parents:
40719
diff
changeset
|
8796 |
|
ee8d0548c148
Prove rel_interior_convex_hull_union (by Grechuck Bogdan).
hoelzl
parents:
40719
diff
changeset
|
8797 |
lemma convex_hull_union_cones_two: |
54465 | 8798 |
fixes S T :: "'m::euclidean_space set" |
8799 |
assumes "convex S" |
|
8800 |
and "cone S" |
|
8801 |
and "S \<noteq> {}" |
|
8802 |
assumes "convex T" |
|
8803 |
and "cone T" |
|
8804 |
and "T \<noteq> {}" |
|
8805 |
shows "convex hull (S \<union> T) = S + T" |
|
8806 |
proof - |
|
8807 |
def I \<equiv> "{1::nat, 2}" |
|
8808 |
def A \<equiv> "(\<lambda>i. if i = (1::nat) then S else T)" |
|
8809 |
have "\<Union>(A ` I) = S \<union> T" |
|
8810 |
using A_def I_def by auto |
|
8811 |
then have "convex hull (\<Union>(A ` I)) = convex hull (S \<union> T)" |
|
8812 |
by auto |
|
8813 |
moreover have "convex hull \<Union>(A ` I) = setsum A I" |
|
8814 |
apply (subst convex_hull_finite_union_cones[of I A]) |
|
8815 |
using assms A_def I_def |
|
8816 |
apply auto |
|
8817 |
done |
|
8818 |
moreover have "setsum A I = S + T" |
|
8819 |
using A_def I_def |
|
8820 |
unfolding set_plus_def |
|
8821 |
apply auto |
|
8822 |
unfolding set_plus_def |
|
8823 |
apply auto |
|
8824 |
done |
|
8825 |
ultimately show ?thesis by auto |
|
40887
ee8d0548c148
Prove rel_interior_convex_hull_union (by Grechuck Bogdan).
hoelzl
parents:
40719
diff
changeset
|
8826 |
qed |
ee8d0548c148
Prove rel_interior_convex_hull_union (by Grechuck Bogdan).
hoelzl
parents:
40719
diff
changeset
|
8827 |
|
ee8d0548c148
Prove rel_interior_convex_hull_union (by Grechuck Bogdan).
hoelzl
parents:
40719
diff
changeset
|
8828 |
lemma rel_interior_convex_hull_union: |
54465 | 8829 |
fixes S :: "'a \<Rightarrow> 'n::euclidean_space set" |
8830 |
assumes "finite I" |
|
8831 |
and "\<forall>i\<in>I. convex (S i) \<and> S i \<noteq> {}" |
|
8832 |
shows "rel_interior (convex hull (\<Union>(S ` I))) = |
|
8833 |
{setsum (\<lambda>i. c i *\<^sub>R s i) I | c s. (\<forall>i\<in>I. c i > 0) \<and> setsum c I = 1 \<and> |
|
8834 |
(\<forall>i\<in>I. s i \<in> rel_interior(S i))}" |
|
8835 |
(is "?lhs = ?rhs") |
|
8836 |
proof (cases "I = {}") |
|
8837 |
case True |
|
8838 |
then show ?thesis |
|
8839 |
using convex_hull_empty rel_interior_empty by auto |
|
8840 |
next |
|
8841 |
case False |
|
8842 |
def C0 \<equiv> "convex hull (\<Union>(S ` I))" |
|
8843 |
have "\<forall>i\<in>I. C0 \<ge> S i" |
|
8844 |
unfolding C0_def using hull_subset[of "\<Union>(S ` I)"] by auto |
|
55787 | 8845 |
def K0 \<equiv> "cone hull ({1 :: real} \<times> C0)" |
8846 |
def K \<equiv> "\<lambda>i. cone hull ({1 :: real} \<times> S i)" |
|
54465 | 8847 |
have "\<forall>i\<in>I. K i \<noteq> {}" |
8848 |
unfolding K_def using assms |
|
8849 |
by (simp add: cone_hull_empty_iff[symmetric]) |
|
8850 |
{ |
|
8851 |
fix i |
|
8852 |
assume "i \<in> I" |
|
8853 |
then have "convex (K i)" |
|
8854 |
unfolding K_def |
|
8855 |
apply (subst convex_cone_hull) |
|
8856 |
apply (subst convex_Times) |
|
8857 |
using assms |
|
8858 |
apply auto |
|
8859 |
done |
|
40887
ee8d0548c148
Prove rel_interior_convex_hull_union (by Grechuck Bogdan).
hoelzl
parents:
40719
diff
changeset
|
8860 |
} |
54465 | 8861 |
then have convK: "\<forall>i\<in>I. convex (K i)" |
8862 |
by auto |
|
8863 |
{ |
|
8864 |
fix i |
|
8865 |
assume "i \<in> I" |
|
8866 |
then have "K0 \<supseteq> K i" |
|
8867 |
unfolding K0_def K_def |
|
8868 |
apply (subst hull_mono) |
|
60420 | 8869 |
using \<open>\<forall>i\<in>I. C0 \<ge> S i\<close> |
54465 | 8870 |
apply auto |
8871 |
done |
|
40887
ee8d0548c148
Prove rel_interior_convex_hull_union (by Grechuck Bogdan).
hoelzl
parents:
40719
diff
changeset
|
8872 |
} |
54465 | 8873 |
then have "K0 \<supseteq> \<Union>(K ` I)" by auto |
8874 |
moreover have "convex K0" |
|
8875 |
unfolding K0_def |
|
8876 |
apply (subst convex_cone_hull) |
|
8877 |
apply (subst convex_Times) |
|
8878 |
unfolding C0_def |
|
8879 |
using convex_convex_hull |
|
8880 |
apply auto |
|
8881 |
done |
|
8882 |
ultimately have geq: "K0 \<supseteq> convex hull (\<Union>(K ` I))" |
|
8883 |
using hull_minimal[of _ "K0" "convex"] by blast |
|
55787 | 8884 |
have "\<forall>i\<in>I. K i \<supseteq> {1 :: real} \<times> S i" |
54465 | 8885 |
using K_def by (simp add: hull_subset) |
55787 | 8886 |
then have "\<Union>(K ` I) \<supseteq> {1 :: real} \<times> \<Union>(S ` I)" |
54465 | 8887 |
by auto |
55787 | 8888 |
then have "convex hull \<Union>(K ` I) \<supseteq> convex hull ({1 :: real} \<times> \<Union>(S ` I))" |
54465 | 8889 |
by (simp add: hull_mono) |
55787 | 8890 |
then have "convex hull \<Union>(K ` I) \<supseteq> {1 :: real} \<times> C0" |
54465 | 8891 |
unfolding C0_def |
8892 |
using convex_hull_Times[of "{(1 :: real)}" "\<Union>(S ` I)"] convex_hull_singleton |
|
8893 |
by auto |
|
8894 |
moreover have "cone (convex hull (\<Union>(K ` I)))" |
|
8895 |
apply (subst cone_convex_hull) |
|
8896 |
using cone_Union[of "K ` I"] |
|
8897 |
apply auto |
|
8898 |
unfolding K_def |
|
8899 |
using cone_cone_hull |
|
8900 |
apply auto |
|
8901 |
done |
|
8902 |
ultimately have "convex hull (\<Union>(K ` I)) \<supseteq> K0" |
|
8903 |
unfolding K0_def |
|
60585 | 8904 |
using hull_minimal[of _ "convex hull (\<Union>(K ` I))" "cone"] |
54465 | 8905 |
by blast |
8906 |
then have "K0 = convex hull (\<Union>(K ` I))" |
|
8907 |
using geq by auto |
|
8908 |
also have "\<dots> = setsum K I" |
|
8909 |
apply (subst convex_hull_finite_union_cones[of I K]) |
|
8910 |
using assms |
|
8911 |
apply blast |
|
8912 |
using False |
|
8913 |
apply blast |
|
8914 |
unfolding K_def |
|
8915 |
apply rule |
|
8916 |
apply (subst convex_cone_hull) |
|
8917 |
apply (subst convex_Times) |
|
60420 | 8918 |
using assms cone_cone_hull \<open>\<forall>i\<in>I. K i \<noteq> {}\<close> K_def |
54465 | 8919 |
apply auto |
8920 |
done |
|
47444
d21c95af2df7
removed "setsum_set", now subsumed by generic setsum
krauss
parents:
47108
diff
changeset
|
8921 |
finally have "K0 = setsum K I" by auto |
54465 | 8922 |
then have *: "rel_interior K0 = setsum (\<lambda>i. (rel_interior (K i))) I" |
8923 |
using rel_interior_sum_gen[of I K] convK by auto |
|
8924 |
{ |
|
8925 |
fix x |
|
8926 |
assume "x \<in> ?lhs" |
|
8927 |
then have "(1::real, x) \<in> rel_interior K0" |
|
8928 |
using K0_def C0_def rel_interior_convex_cone_aux[of C0 "1::real" x] convex_convex_hull |
|
8929 |
by auto |
|
8930 |
then obtain k where k: "(1::real, x) = setsum k I \<and> (\<forall>i\<in>I. k i \<in> rel_interior (K i))" |
|
60420 | 8931 |
using \<open>finite I\<close> * set_setsum_alt[of I "\<lambda>i. rel_interior (K i)"] by auto |
54465 | 8932 |
{ |
8933 |
fix i |
|
8934 |
assume "i \<in> I" |
|
55787 | 8935 |
then have "convex (S i) \<and> k i \<in> rel_interior (cone hull {1} \<times> S i)" |
54465 | 8936 |
using k K_def assms by auto |
8937 |
then have "\<exists>ci si. k i = (ci, ci *\<^sub>R si) \<and> 0 < ci \<and> si \<in> rel_interior (S i)" |
|
8938 |
using rel_interior_convex_cone[of "S i"] by auto |
|
40887
ee8d0548c148
Prove rel_interior_convex_hull_union (by Grechuck Bogdan).
hoelzl
parents:
40719
diff
changeset
|
8939 |
} |
54465 | 8940 |
then obtain c s where |
8941 |
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)" |
|
8942 |
by metis |
|
8943 |
then have "x = (\<Sum>i\<in>I. c i *\<^sub>R s i) \<and> setsum c I = 1" |
|
8944 |
using k by (simp add: setsum_prod) |
|
8945 |
then have "x \<in> ?rhs" |
|
8946 |
using k |
|
8947 |
apply auto |
|
8948 |
apply (rule_tac x = c in exI) |
|
8949 |
apply (rule_tac x = s in exI) |
|
8950 |
using cs |
|
8951 |
apply auto |
|
8952 |
done |
|
40887
ee8d0548c148
Prove rel_interior_convex_hull_union (by Grechuck Bogdan).
hoelzl
parents:
40719
diff
changeset
|
8953 |
} |
ee8d0548c148
Prove rel_interior_convex_hull_union (by Grechuck Bogdan).
hoelzl
parents:
40719
diff
changeset
|
8954 |
moreover |
54465 | 8955 |
{ |
8956 |
fix x |
|
8957 |
assume "x \<in> ?rhs" |
|
8958 |
then obtain c s where cs: "x = setsum (\<lambda>i. c i *\<^sub>R s i) I \<and> |
|
8959 |
(\<forall>i\<in>I. c i > 0) \<and> setsum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))" |
|
8960 |
by auto |
|
8961 |
def k \<equiv> "\<lambda>i. (c i, c i *\<^sub>R s i)" |
|
8962 |
{ |
|
8963 |
fix i assume "i:I" |
|
8964 |
then have "k i \<in> rel_interior (K i)" |
|
8965 |
using k_def K_def assms cs rel_interior_convex_cone[of "S i"] |
|
8966 |
by auto |
|
40887
ee8d0548c148
Prove rel_interior_convex_hull_union (by Grechuck Bogdan).
hoelzl
parents:
40719
diff
changeset
|
8967 |
} |
54465 | 8968 |
then have "(1::real, x) \<in> rel_interior K0" |
8969 |
using K0_def * set_setsum_alt[of I "(\<lambda>i. rel_interior (K i))"] assms k_def cs |
|
8970 |
apply auto |
|
8971 |
apply (rule_tac x = k in exI) |
|
8972 |
apply (simp add: setsum_prod) |
|
8973 |
done |
|
8974 |
then have "x \<in> ?lhs" |
|
8975 |
using K0_def C0_def rel_interior_convex_cone_aux[of C0 1 x] |
|
8976 |
by (auto simp add: convex_convex_hull) |
|
40887
ee8d0548c148
Prove rel_interior_convex_hull_union (by Grechuck Bogdan).
hoelzl
parents:
40719
diff
changeset
|
8977 |
} |
54465 | 8978 |
ultimately show ?thesis by blast |
40887
ee8d0548c148
Prove rel_interior_convex_hull_union (by Grechuck Bogdan).
hoelzl
parents:
40719
diff
changeset
|
8979 |
qed |
ee8d0548c148
Prove rel_interior_convex_hull_union (by Grechuck Bogdan).
hoelzl
parents:
40719
diff
changeset
|
8980 |
|
50104 | 8981 |
|
8982 |
lemma convex_le_Inf_differential: |
|
8983 |
fixes f :: "real \<Rightarrow> real" |
|
8984 |
assumes "convex_on I f" |
|
54465 | 8985 |
and "x \<in> interior I" |
8986 |
and "y \<in> I" |
|
50104 | 8987 |
shows "f y \<ge> f x + Inf ((\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I)) * (y - x)" |
54465 | 8988 |
(is "_ \<ge> _ + Inf (?F x) * (y - x)") |
50104 | 8989 |
proof (cases rule: linorder_cases) |
8990 |
assume "x < y" |
|
8991 |
moreover |
|
8992 |
have "open (interior I)" by auto |
|
60420 | 8993 |
from openE[OF this \<open>x \<in> interior I\<close>] |
55697 | 8994 |
obtain e where e: "0 < e" "ball x e \<subseteq> interior I" . |
50104 | 8995 |
moreover def t \<equiv> "min (x + e / 2) ((x + y) / 2)" |
8996 |
ultimately have "x < t" "t < y" "t \<in> ball x e" |
|
8997 |
by (auto simp: dist_real_def field_simps split: split_min) |
|
60420 | 8998 |
with \<open>x \<in> interior I\<close> e interior_subset[of I] have "t \<in> I" "x \<in> I" by auto |
50104 | 8999 |
|
9000 |
have "open (interior I)" by auto |
|
60420 | 9001 |
from openE[OF this \<open>x \<in> interior I\<close>] |
55697 | 9002 |
obtain e where "0 < e" "ball x e \<subseteq> interior I" . |
50104 | 9003 |
moreover def K \<equiv> "x - e / 2" |
60420 | 9004 |
with \<open>0 < e\<close> have "K \<in> ball x e" "K < x" |
54465 | 9005 |
by (auto simp: dist_real_def) |
50104 | 9006 |
ultimately have "K \<in> I" "K < x" "x \<in> I" |
60420 | 9007 |
using interior_subset[of I] \<open>x \<in> interior I\<close> by auto |
50104 | 9008 |
|
9009 |
have "Inf (?F x) \<le> (f x - f y) / (x - y)" |
|
54258
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents:
54230
diff
changeset
|
9010 |
proof (intro bdd_belowI cInf_lower2) |
50104 | 9011 |
show "(f x - f t) / (x - t) \<in> ?F x" |
60420 | 9012 |
using \<open>t \<in> I\<close> \<open>x < t\<close> by auto |
50104 | 9013 |
show "(f x - f t) / (x - t) \<le> (f x - f y) / (x - y)" |
60420 | 9014 |
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> |
54465 | 9015 |
by (rule convex_on_diff) |
50104 | 9016 |
next |
54465 | 9017 |
fix y |
9018 |
assume "y \<in> ?F x" |
|
60420 | 9019 |
with order_trans[OF convex_on_diff[OF \<open>convex_on I f\<close> \<open>K \<in> I\<close> _ \<open>K < x\<close> _]] |
50104 | 9020 |
show "(f K - f x) / (K - x) \<le> y" by auto |
9021 |
qed |
|
9022 |
then show ?thesis |
|
60420 | 9023 |
using \<open>x < y\<close> by (simp add: field_simps) |
50104 | 9024 |
next |
9025 |
assume "y < x" |
|
9026 |
moreover |
|
9027 |
have "open (interior I)" by auto |
|
60420 | 9028 |
from openE[OF this \<open>x \<in> interior I\<close>] |
55697 | 9029 |
obtain e where e: "0 < e" "ball x e \<subseteq> interior I" . |
50104 | 9030 |
moreover def t \<equiv> "x + e / 2" |
9031 |
ultimately have "x < t" "t \<in> ball x e" |
|
9032 |
by (auto simp: dist_real_def field_simps) |
|
60420 | 9033 |
with \<open>x \<in> interior I\<close> e interior_subset[of I] have "t \<in> I" "x \<in> I" by auto |
50104 | 9034 |
|
9035 |
have "(f x - f y) / (x - y) \<le> Inf (?F x)" |
|
51475
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
hoelzl
parents:
50979
diff
changeset
|
9036 |
proof (rule cInf_greatest) |
50104 | 9037 |
have "(f x - f y) / (x - y) = (f y - f x) / (y - x)" |
60420 | 9038 |
using \<open>y < x\<close> by (auto simp: field_simps) |
50104 | 9039 |
also |
54465 | 9040 |
fix z |
9041 |
assume "z \<in> ?F x" |
|
60420 | 9042 |
with order_trans[OF convex_on_diff[OF \<open>convex_on I f\<close> \<open>y \<in> I\<close> _ \<open>y < x\<close>]] |
54465 | 9043 |
have "(f y - f x) / (y - x) \<le> z" |
9044 |
by auto |
|
50104 | 9045 |
finally show "(f x - f y) / (x - y) \<le> z" . |
9046 |
next |
|
9047 |
have "open (interior I)" by auto |
|
60420 | 9048 |
from openE[OF this \<open>x \<in> interior I\<close>] |
55697 | 9049 |
obtain e where e: "0 < e" "ball x e \<subseteq> interior I" . |
54465 | 9050 |
then have "x + e / 2 \<in> ball x e" |
9051 |
by (auto simp: dist_real_def) |
|
9052 |
with e interior_subset[of I] have "x + e / 2 \<in> {x<..} \<inter> I" |
|
9053 |
by auto |
|
9054 |
then show "?F x \<noteq> {}" |
|
9055 |
by blast |
|
50104 | 9056 |
qed |
9057 |
then show ?thesis |
|
60420 | 9058 |
using \<open>y < x\<close> by (simp add: field_simps) |
50104 | 9059 |
qed simp |
60762 | 9060 |
|
60420 | 9061 |
subsection\<open>Explicit formulas for interior and relative interior of convex hull\<close> |
60762 | 9062 |
|
9063 |
lemma interior_atLeastAtMost [simp]: |
|
9064 |
fixes a::real shows "interior {a..b} = {a<..<b}" |
|
9065 |
using interior_cbox [of a b] by auto |
|
9066 |
||
9067 |
lemma interior_atLeastLessThan [simp]: |
|
9068 |
fixes a::real shows "interior {a..<b} = {a<..<b}" |
|
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
9069 |
by (metis atLeastLessThan_def greaterThanLessThan_def interior_atLeastAtMost interior_Int interior_interior interior_real_semiline) |
60762 | 9070 |
|
9071 |
lemma interior_lessThanAtMost [simp]: |
|
9072 |
fixes a::real shows "interior {a<..b} = {a<..<b}" |
|
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
9073 |
by (metis atLeastAtMost_def greaterThanAtMost_def interior_atLeastAtMost interior_Int |
60762 | 9074 |
interior_interior interior_real_semiline) |
9075 |
||
9076 |
lemma at_within_closed_interval: |
|
9077 |
fixes x::real |
|
9078 |
shows "a < x \<Longrightarrow> x < b \<Longrightarrow> (at x within {a..b}) = at x" |
|
9079 |
by (metis at_within_interior greaterThanLessThan_iff interior_atLeastAtMost) |
|
9080 |
||
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9081 |
lemma affine_independent_convex_affine_hull: |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9082 |
fixes s :: "'a::euclidean_space set" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9083 |
assumes "~affine_dependent s" "t \<subseteq> s" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9084 |
shows "convex hull t = affine hull t \<inter> convex hull s" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9085 |
proof - |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9086 |
have fin: "finite s" "finite t" using assms aff_independent_finite finite_subset by auto |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9087 |
{ fix u v x |
60809
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
9088 |
assume uv: "setsum u t = 1" "\<forall>x\<in>s. 0 \<le> v x" "setsum v s = 1" |
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9089 |
"(\<Sum>x\<in>s. v x *\<^sub>R x) = (\<Sum>v\<in>t. u v *\<^sub>R v)" "x \<in> t" |
60420 | 9090 |
then have s: "s = (s - t) \<union> t" --\<open>split into separate cases\<close> |
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9091 |
using assms by auto |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9092 |
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)" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9093 |
"setsum v t + setsum v (s - t) = 1" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9094 |
using uv fin s |
60809
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
9095 |
by (auto simp: setsum.union_disjoint [symmetric] Un_commute) |
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
9096 |
have "(\<Sum>x\<in>s. if x \<in> t then v x - u x else v x) = 0" |
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9097 |
"(\<Sum>x\<in>s. (if x \<in> t then v x - u x else v x) *\<^sub>R x) = 0" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9098 |
using uv fin |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9099 |
by (subst s, subst setsum.union_disjoint, auto simp: algebra_simps setsum_subtractf)+ |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9100 |
} note [simp] = this |
60809
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
9101 |
have "convex hull t \<subseteq> affine hull t" |
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9102 |
using convex_hull_subset_affine_hull by blast |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9103 |
moreover have "convex hull t \<subseteq> convex hull s" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9104 |
using assms hull_mono by blast |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9105 |
moreover have "affine hull t \<inter> convex hull s \<subseteq> convex hull t" |
60809
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
9106 |
using assms |
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9107 |
apply (simp add: convex_hull_finite affine_hull_finite fin affine_dependent_explicit) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9108 |
apply (drule_tac x=s in spec) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9109 |
apply (auto simp: fin) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9110 |
apply (rule_tac x=u in exI) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9111 |
apply (rename_tac v) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9112 |
apply (drule_tac x="\<lambda>x. if x \<in> t then v x - u x else v x" in spec) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9113 |
apply (force)+ |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9114 |
done |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9115 |
ultimately show ?thesis |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9116 |
by blast |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9117 |
qed |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9118 |
|
60809
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
9119 |
lemma affine_independent_span_eq: |
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9120 |
fixes s :: "'a::euclidean_space set" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9121 |
assumes "~affine_dependent s" "card s = Suc (DIM ('a))" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9122 |
shows "affine hull s = UNIV" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9123 |
proof (cases "s = {}") |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9124 |
case True then show ?thesis |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9125 |
using assms by simp |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9126 |
next |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9127 |
case False |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9128 |
then obtain a t where t: "a \<notin> t" "s = insert a t" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9129 |
by blast |
60809
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
9130 |
then have fin: "finite t" using assms |
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9131 |
by (metis finite_insert aff_independent_finite) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9132 |
show ?thesis |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9133 |
using assms t fin |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9134 |
apply (simp add: affine_dependent_iff_dependent affine_hull_insert_span_gen) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9135 |
apply (rule subset_antisym) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9136 |
apply force |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9137 |
apply (rule Fun.vimage_subsetD) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9138 |
apply (metis add.commute diff_add_cancel surj_def) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9139 |
apply (rule card_ge_dim_independent) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9140 |
apply (auto simp: card_image inj_on_def dim_subset_UNIV) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9141 |
done |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9142 |
qed |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9143 |
|
60809
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
9144 |
lemma affine_independent_span_gt: |
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9145 |
fixes s :: "'a::euclidean_space set" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9146 |
assumes ind: "~ affine_dependent s" and dim: "DIM ('a) < card s" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9147 |
shows "affine hull s = UNIV" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9148 |
apply (rule affine_independent_span_eq [OF ind]) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9149 |
apply (rule antisym) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9150 |
using assms |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9151 |
apply auto |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9152 |
apply (metis add_2_eq_Suc' not_less_eq_eq affine_dependent_biggerset aff_independent_finite) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9153 |
done |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9154 |
|
60809
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
9155 |
lemma empty_interior_affine_hull: |
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9156 |
fixes s :: "'a::euclidean_space set" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9157 |
assumes "finite s" and dim: "card s \<le> DIM ('a)" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9158 |
shows "interior(affine hull s) = {}" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9159 |
using assms |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9160 |
apply (induct s rule: finite_induct) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9161 |
apply (simp_all add: affine_dependent_iff_dependent affine_hull_insert_span_gen interior_translation) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9162 |
apply (rule empty_interior_lowdim) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9163 |
apply (simp add: affine_dependent_iff_dependent affine_hull_insert_span_gen) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9164 |
apply (metis Suc_le_lessD not_less order_trans card_image_le finite_imageI dim_le_card) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9165 |
done |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9166 |
|
60809
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
9167 |
lemma empty_interior_convex_hull: |
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9168 |
fixes s :: "'a::euclidean_space set" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9169 |
assumes "finite s" and dim: "card s \<le> DIM ('a)" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9170 |
shows "interior(convex hull s) = {}" |
60809
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
9171 |
by (metis Diff_empty Diff_eq_empty_iff convex_hull_subset_affine_hull |
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9172 |
interior_mono empty_interior_affine_hull [OF assms]) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9173 |
|
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9174 |
lemma explicit_subset_rel_interior_convex_hull: |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9175 |
fixes s :: "'a::euclidean_space set" |
60809
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
9176 |
shows "finite s |
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9177 |
\<Longrightarrow> {y. \<exists>u. (\<forall>x \<in> s. 0 < u x \<and> u x < 1) \<and> setsum u s = 1 \<and> setsum (\<lambda>x. u x *\<^sub>R x) s = y} |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9178 |
\<subseteq> rel_interior (convex hull s)" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9179 |
by (force simp add: rel_interior_convex_hull_union [where S="\<lambda>x. {x}" and I=s, simplified]) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9180 |
|
60809
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
9181 |
lemma explicit_subset_rel_interior_convex_hull_minimal: |
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9182 |
fixes s :: "'a::euclidean_space set" |
60809
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
9183 |
shows "finite s |
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9184 |
\<Longrightarrow> {y. \<exists>u. (\<forall>x \<in> s. 0 < u x) \<and> setsum u s = 1 \<and> setsum (\<lambda>x. u x *\<^sub>R x) s = y} |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9185 |
\<subseteq> rel_interior (convex hull s)" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9186 |
by (force simp add: rel_interior_convex_hull_union [where S="\<lambda>x. {x}" and I=s, simplified]) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9187 |
|
60809
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
9188 |
lemma rel_interior_convex_hull_explicit: |
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9189 |
fixes s :: "'a::euclidean_space set" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9190 |
assumes "~ affine_dependent s" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9191 |
shows "rel_interior(convex hull s) = |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9192 |
{y. \<exists>u. (\<forall>x \<in> s. 0 < u x) \<and> setsum u s = 1 \<and> setsum (\<lambda>x. u x *\<^sub>R x) s = y}" |
60809
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
9193 |
(is "?lhs = ?rhs") |
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9194 |
proof |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9195 |
show "?rhs \<le> ?lhs" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9196 |
by (simp add: aff_independent_finite explicit_subset_rel_interior_convex_hull_minimal assms) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9197 |
next |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9198 |
show "?lhs \<le> ?rhs" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9199 |
proof (cases "\<exists>a. s = {a}") |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9200 |
case True then show "?lhs \<le> ?rhs" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9201 |
by force |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9202 |
next |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9203 |
case False |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9204 |
have fs: "finite s" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9205 |
using assms by (simp add: aff_independent_finite) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9206 |
{ fix a b and d::real |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9207 |
assume ab: "a \<in> s" "b \<in> s" "a \<noteq> b" |
60420 | 9208 |
then have s: "s = (s - {a,b}) \<union> {a,b}" --\<open>split into separate cases\<close> |
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9209 |
by auto |
60809
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
9210 |
have "(\<Sum>x\<in>s. if x = a then - d else if x = b then d else 0) = 0" |
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9211 |
"(\<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" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9212 |
using ab fs |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9213 |
by (subst s, subst setsum.union_disjoint, auto)+ |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9214 |
} note [simp] = this |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9215 |
{ fix y |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9216 |
assume y: "y \<in> convex hull s" "y \<notin> ?rhs" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9217 |
{ fix u T a |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9218 |
assume ua: "\<forall>x\<in>s. 0 \<le> u x" "setsum u s = 1" "\<not> 0 < u a" "a \<in> s" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9219 |
and yT: "y = (\<Sum>x\<in>s. u x *\<^sub>R x)" "y \<in> T" "open T" |
60809
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
9220 |
and sb: "T \<inter> affine hull s \<subseteq> {w. \<exists>u. (\<forall>x\<in>s. 0 \<le> u x) \<and> setsum u s = 1 \<and> (\<Sum>x\<in>s. u x *\<^sub>R x) = w}" |
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9221 |
have ua0: "u a = 0" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9222 |
using ua by auto |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9223 |
obtain b where b: "b\<in>s" "a \<noteq> b" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9224 |
using ua False by auto |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9225 |
obtain e where e: "0 < e" "ball (\<Sum>x\<in>s. u x *\<^sub>R x) e \<subseteq> T" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9226 |
using yT by (auto elim: openE) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9227 |
with b obtain d where d: "0 < d" "norm(d *\<^sub>R (a-b)) < e" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9228 |
by (auto intro: that [of "e / 2 / norm(a-b)"]) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9229 |
have "(\<Sum>x\<in>s. u x *\<^sub>R x) \<in> affine hull s" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9230 |
using yT y by (metis affine_hull_convex_hull hull_redundant_eq) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9231 |
then have "(\<Sum>x\<in>s. u x *\<^sub>R x) - d *\<^sub>R (a - b) \<in> affine hull s" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9232 |
using ua b by (auto simp: hull_inc intro: mem_affine_3_minus2) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9233 |
then have "y - d *\<^sub>R (a - b) \<in> T \<inter> affine hull s" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9234 |
using d e yT by auto |
60809
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
9235 |
then obtain v where "\<forall>x\<in>s. 0 \<le> v x" |
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
9236 |
"setsum v s = 1" |
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9237 |
"(\<Sum>x\<in>s. v x *\<^sub>R x) = (\<Sum>x\<in>s. u x *\<^sub>R x) - d *\<^sub>R (a - b)" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9238 |
using subsetD [OF sb] yT |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9239 |
by auto |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9240 |
then have False |
60809
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
9241 |
using assms |
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9242 |
apply (simp add: affine_dependent_explicit_finite fs) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9243 |
apply (drule_tac x="\<lambda>x. (v x - u x) - (if x = a then -d else if x = b then d else 0)" in spec) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9244 |
using ua b d |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9245 |
apply (auto simp: algebra_simps setsum_subtractf setsum.distrib) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9246 |
done |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9247 |
} note * = this |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9248 |
have "y \<notin> rel_interior (convex hull s)" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9249 |
using y |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9250 |
apply (simp add: mem_rel_interior affine_hull_convex_hull) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9251 |
apply (auto simp: convex_hull_finite [OF fs]) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9252 |
apply (drule_tac x=u in spec) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9253 |
apply (auto intro: *) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9254 |
done |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9255 |
} with rel_interior_subset show "?lhs \<le> ?rhs" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9256 |
by blast |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9257 |
qed |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9258 |
qed |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9259 |
|
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9260 |
lemma interior_convex_hull_explicit_minimal: |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9261 |
fixes s :: "'a::euclidean_space set" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9262 |
shows |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9263 |
"~ affine_dependent s |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9264 |
==> interior(convex hull s) = |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9265 |
(if card(s) \<le> DIM('a) then {} |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9266 |
else {y. \<exists>u. (\<forall>x \<in> s. 0 < u x) \<and> setsum u s = 1 \<and> (\<Sum>x\<in>s. u x *\<^sub>R x) = y})" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9267 |
apply (simp add: aff_independent_finite empty_interior_convex_hull, clarify) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9268 |
apply (rule trans [of _ "rel_interior(convex hull s)"]) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9269 |
apply (simp add: affine_hull_convex_hull affine_independent_span_gt rel_interior_interior) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9270 |
by (simp add: rel_interior_convex_hull_explicit) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9271 |
|
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9272 |
lemma interior_convex_hull_explicit: |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9273 |
fixes s :: "'a::euclidean_space set" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9274 |
assumes "~ affine_dependent s" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9275 |
shows |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9276 |
"interior(convex hull s) = |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9277 |
(if card(s) \<le> DIM('a) then {} |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9278 |
else {y. \<exists>u. (\<forall>x \<in> s. 0 < u x \<and> u x < 1) \<and> setsum u s = 1 \<and> (\<Sum>x\<in>s. u x *\<^sub>R x) = y})" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9279 |
proof - |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9280 |
{ fix u :: "'a \<Rightarrow> real" and a |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9281 |
assume "card Basis < card s" and u: "\<And>x. x\<in>s \<Longrightarrow> 0 < u x" "setsum u s = 1" and a: "a \<in> s" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9282 |
then have cs: "Suc 0 < card s" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9283 |
by (metis DIM_positive less_trans_Suc) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9284 |
obtain b where b: "b \<in> s" "a \<noteq> b" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9285 |
proof (cases "s \<le> {a}") |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9286 |
case True |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9287 |
then show thesis |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9288 |
using cs subset_singletonD by fastforce |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9289 |
next |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9290 |
case False |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9291 |
then show thesis |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9292 |
by (blast intro: that) |
60809
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
9293 |
qed |
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9294 |
have "u a + u b \<le> setsum u {a,b}" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9295 |
using a b by simp |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9296 |
also have "... \<le> setsum u s" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9297 |
apply (rule Groups_Big.setsum_mono2) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9298 |
using a b u |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9299 |
apply (auto simp: less_imp_le aff_independent_finite assms) |
60809
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
9300 |
done |
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9301 |
finally have "u a < 1" |
60420 | 9302 |
using \<open>b \<in> s\<close> u by fastforce |
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9303 |
} note [simp] = this |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9304 |
show ?thesis |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9305 |
using assms |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9306 |
apply (auto simp: interior_convex_hull_explicit_minimal) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9307 |
apply (rule_tac x=u in exI) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9308 |
apply (auto simp: not_le) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9309 |
done |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9310 |
qed |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9311 |
|
60420 | 9312 |
subsection\<open>Similar results for closure and (relative or absolute) frontier.\<close> |
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9313 |
|
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9314 |
lemma closure_convex_hull [simp]: |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9315 |
fixes s :: "'a::euclidean_space set" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9316 |
shows "compact s ==> closure(convex hull s) = convex hull s" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9317 |
by (simp add: compact_imp_closed compact_convex_hull) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9318 |
|
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9319 |
lemma rel_frontier_convex_hull_explicit: |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9320 |
fixes s :: "'a::euclidean_space set" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9321 |
assumes "~ affine_dependent s" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9322 |
shows "rel_frontier(convex hull s) = |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9323 |
{y. \<exists>u. (\<forall>x \<in> s. 0 \<le> u x) \<and> (\<exists>x \<in> s. u x = 0) \<and> setsum u s = 1 \<and> setsum (\<lambda>x. u x *\<^sub>R x) s = y}" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9324 |
proof - |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9325 |
have fs: "finite s" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9326 |
using assms by (simp add: aff_independent_finite) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9327 |
show ?thesis |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9328 |
apply (simp add: rel_frontier_def finite_imp_compact rel_interior_convex_hull_explicit assms fs) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9329 |
apply (auto simp: convex_hull_finite fs) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9330 |
apply (drule_tac x=u in spec) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9331 |
apply (rule_tac x=u in exI) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9332 |
apply force |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9333 |
apply (rename_tac v) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9334 |
apply (rule notE [OF assms]) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9335 |
apply (simp add: affine_dependent_explicit) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9336 |
apply (rule_tac x=s in exI) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9337 |
apply (auto simp: fs) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9338 |
apply (rule_tac x = "\<lambda>x. u x - v x" in exI) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9339 |
apply (force simp: setsum_subtractf scaleR_diff_left) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9340 |
done |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9341 |
qed |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9342 |
|
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9343 |
lemma frontier_convex_hull_explicit: |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9344 |
fixes s :: "'a::euclidean_space set" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9345 |
assumes "~ affine_dependent s" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9346 |
shows "frontier(convex hull s) = |
60809
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
9347 |
{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> |
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9348 |
setsum u s = 1 \<and> setsum (\<lambda>x. u x *\<^sub>R x) s = y}" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9349 |
proof - |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9350 |
have fs: "finite s" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9351 |
using assms by (simp add: aff_independent_finite) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9352 |
show ?thesis |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9353 |
proof (cases "DIM ('a) < card s") |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9354 |
case True |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9355 |
with assms fs show ?thesis |
60809
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
9356 |
by (simp add: rel_frontier_def frontier_def rel_frontier_convex_hull_explicit [symmetric] |
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9357 |
interior_convex_hull_explicit_minimal rel_interior_convex_hull_explicit) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9358 |
next |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9359 |
case False |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9360 |
then have "card s \<le> DIM ('a)" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9361 |
by linarith |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9362 |
then show ?thesis |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9363 |
using assms fs |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9364 |
apply (simp add: frontier_def interior_convex_hull_explicit finite_imp_compact) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9365 |
apply (simp add: convex_hull_finite) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9366 |
done |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9367 |
qed |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9368 |
qed |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9369 |
|
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9370 |
lemma rel_frontier_convex_hull_cases: |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9371 |
fixes s :: "'a::euclidean_space set" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9372 |
assumes "~ affine_dependent s" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9373 |
shows "rel_frontier(convex hull s) = \<Union>{convex hull (s - {x}) |x. x \<in> s}" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9374 |
proof - |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9375 |
have fs: "finite s" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9376 |
using assms by (simp add: aff_independent_finite) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9377 |
{ fix u a |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9378 |
have "\<forall>x\<in>s. 0 \<le> u x \<Longrightarrow> a \<in> s \<Longrightarrow> u a = 0 \<Longrightarrow> setsum u s = 1 \<Longrightarrow> |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9379 |
\<exists>x v. x \<in> s \<and> |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9380 |
(\<forall>x\<in>s - {x}. 0 \<le> v x) \<and> |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9381 |
setsum v (s - {x}) = 1 \<and> (\<Sum>x\<in>s - {x}. v x *\<^sub>R x) = (\<Sum>x\<in>s. u x *\<^sub>R x)" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9382 |
apply (rule_tac x=a in exI) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9383 |
apply (rule_tac x=u in exI) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9384 |
apply (simp add: Groups_Big.setsum_diff1 fs) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9385 |
done } |
60809
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
9386 |
moreover |
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9387 |
{ fix a u |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9388 |
have "a \<in> s \<Longrightarrow> \<forall>x\<in>s - {a}. 0 \<le> u x \<Longrightarrow> setsum u (s - {a}) = 1 \<Longrightarrow> |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9389 |
\<exists>v. (\<forall>x\<in>s. 0 \<le> v x) \<and> |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9390 |
(\<exists>x\<in>s. v x = 0) \<and> setsum v s = 1 \<and> (\<Sum>x\<in>s. v x *\<^sub>R x) = (\<Sum>x\<in>s - {a}. u x *\<^sub>R x)" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9391 |
apply (rule_tac x="\<lambda>x. if x = a then 0 else u x" in exI) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9392 |
apply (auto simp: setsum.If_cases Diff_eq if_smult fs) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9393 |
done } |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9394 |
ultimately show ?thesis |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9395 |
using assms |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9396 |
apply (simp add: rel_frontier_convex_hull_explicit) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9397 |
apply (simp add: convex_hull_finite fs Union_SetCompr_eq, auto) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9398 |
done |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9399 |
qed |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9400 |
|
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9401 |
lemma frontier_convex_hull_eq_rel_frontier: |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9402 |
fixes s :: "'a::euclidean_space set" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9403 |
assumes "~ affine_dependent s" |
60809
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
9404 |
shows "frontier(convex hull s) = |
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9405 |
(if card s \<le> DIM ('a) then convex hull s else rel_frontier(convex hull s))" |
60809
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
9406 |
using assms |
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
9407 |
unfolding rel_frontier_def frontier_def |
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
9408 |
by (simp add: affine_independent_span_gt rel_interior_interior |
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9409 |
finite_imp_compact empty_interior_convex_hull aff_independent_finite) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9410 |
|
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9411 |
lemma frontier_convex_hull_cases: |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9412 |
fixes s :: "'a::euclidean_space set" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9413 |
assumes "~ affine_dependent s" |
60809
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
9414 |
shows "frontier(convex hull s) = |
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9415 |
(if card s \<le> DIM ('a) then convex hull s else \<Union>{convex hull (s - {x}) |x. x \<in> s})" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9416 |
by (simp add: assms frontier_convex_hull_eq_rel_frontier rel_frontier_convex_hull_cases) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9417 |
|
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9418 |
lemma in_frontier_convex_hull: |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9419 |
fixes s :: "'a::euclidean_space set" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9420 |
assumes "finite s" "card s \<le> Suc (DIM ('a))" "x \<in> s" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9421 |
shows "x \<in> frontier(convex hull s)" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9422 |
proof (cases "affine_dependent s") |
60809
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
9423 |
case True |
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9424 |
with assms show ?thesis |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9425 |
apply (auto simp: affine_dependent_def frontier_def finite_imp_compact hull_inc) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9426 |
by (metis card.insert_remove convex_hull_subset_affine_hull empty_interior_affine_hull finite_Diff hull_redundant insert_Diff insert_Diff_single insert_not_empty interior_mono not_less_eq_eq subset_empty) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9427 |
next |
60809
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
9428 |
case False |
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
9429 |
{ assume "card s = Suc (card Basis)" |
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9430 |
then have cs: "Suc 0 < card s" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9431 |
by (simp add: DIM_positive) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9432 |
with subset_singletonD have "\<exists>y \<in> s. y \<noteq> x" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9433 |
by (cases "s \<le> {x}") fastforce+ |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9434 |
} note [dest!] = this |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9435 |
show ?thesis using assms |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9436 |
unfolding frontier_convex_hull_cases [OF False] Union_SetCompr_eq |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9437 |
by (auto simp: le_Suc_eq hull_inc) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9438 |
qed |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9439 |
|
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9440 |
lemma not_in_interior_convex_hull: |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9441 |
fixes s :: "'a::euclidean_space set" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9442 |
assumes "finite s" "card s \<le> Suc (DIM ('a))" "x \<in> s" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9443 |
shows "x \<notin> interior(convex hull s)" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9444 |
using in_frontier_convex_hull [OF assms] |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9445 |
by (metis Diff_iff frontier_def) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9446 |
|
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9447 |
lemma interior_convex_hull_eq_empty: |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9448 |
fixes s :: "'a::euclidean_space set" |
60762 | 9449 |
assumes "card s = Suc (DIM ('a))" |
60307
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9450 |
shows "interior(convex hull s) = {} \<longleftrightarrow> affine_dependent s" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9451 |
proof - |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9452 |
{ fix a b |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9453 |
assume ab: "a \<in> interior (convex hull s)" "b \<in> s" "b \<in> affine hull (s - {b})" |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9454 |
then have "interior(affine hull s) = {}" using assms |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9455 |
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) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9456 |
then have False using ab |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9457 |
by (metis convex_hull_subset_affine_hull equals0D interior_mono subset_eq) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9458 |
} then |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9459 |
show ?thesis |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9460 |
using assms |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9461 |
apply auto |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9462 |
apply (metis UNIV_I affine_hull_convex_hull affine_hull_empty affine_independent_span_eq convex_convex_hull empty_iff rel_interior_interior rel_interior_same_affine_hull) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9463 |
apply (auto simp: affine_dependent_def) |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9464 |
done |
75e1aa7a450e
Convex hulls: theorems about interior, etc. And a few simple lemmas.
paulson <lp15@cam.ac.uk>
parents:
60303
diff
changeset
|
9465 |
qed |
50104 | 9466 |
|
60800
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
9467 |
|
60762 | 9468 |
subsection \<open>Coplanarity, and collinearity in terms of affine hull\<close> |
9469 |
||
9470 |
definition coplanar where |
|
9471 |
"coplanar s \<equiv> \<exists>u v w. s \<subseteq> affine hull {u,v,w}" |
|
9472 |
||
9473 |
lemma collinear_affine_hull: |
|
9474 |
"collinear s \<longleftrightarrow> (\<exists>u v. s \<subseteq> affine hull {u,v})" |
|
9475 |
proof (cases "s={}") |
|
9476 |
case True then show ?thesis |
|
9477 |
by simp |
|
9478 |
next |
|
9479 |
case False |
|
9480 |
then obtain x where x: "x \<in> s" by auto |
|
9481 |
{ fix u |
|
9482 |
assume *: "\<And>x y. \<lbrakk>x\<in>s; y\<in>s\<rbrakk> \<Longrightarrow> \<exists>c. x - y = c *\<^sub>R u" |
|
9483 |
have "\<exists>u v. s \<subseteq> {a *\<^sub>R u + b *\<^sub>R v |a b. a + b = 1}" |
|
9484 |
apply (rule_tac x=x in exI) |
|
9485 |
apply (rule_tac x="x+u" in exI, clarify) |
|
9486 |
apply (erule exE [OF * [OF x]]) |
|
9487 |
apply (rename_tac c) |
|
9488 |
apply (rule_tac x="1+c" in exI) |
|
9489 |
apply (rule_tac x="-c" in exI) |
|
9490 |
apply (simp add: algebra_simps) |
|
9491 |
done |
|
9492 |
} moreover |
|
9493 |
{ fix u v x y |
|
9494 |
assume *: "s \<subseteq> {a *\<^sub>R u + b *\<^sub>R v |a b. a + b = 1}" |
|
9495 |
have "x\<in>s \<Longrightarrow> y\<in>s \<Longrightarrow> \<exists>c. x - y = c *\<^sub>R (v-u)" |
|
9496 |
apply (drule subsetD [OF *])+ |
|
9497 |
apply simp |
|
9498 |
apply clarify |
|
9499 |
apply (rename_tac r1 r2) |
|
9500 |
apply (rule_tac x="r1-r2" in exI) |
|
9501 |
apply (simp add: algebra_simps) |
|
9502 |
apply (metis scaleR_left.add) |
|
9503 |
done |
|
9504 |
} ultimately |
|
9505 |
show ?thesis |
|
9506 |
unfolding collinear_def affine_hull_2 |
|
9507 |
by blast |
|
9508 |
qed |
|
9509 |
||
9510 |
lemma collinear_imp_coplanar: |
|
9511 |
"collinear s ==> coplanar s" |
|
9512 |
by (metis collinear_affine_hull coplanar_def insert_absorb2) |
|
9513 |
||
9514 |
lemma collinear_small: |
|
9515 |
assumes "finite s" "card s \<le> 2" |
|
9516 |
shows "collinear s" |
|
9517 |
proof - |
|
9518 |
have "card s = 0 \<or> card s = 1 \<or> card s = 2" |
|
9519 |
using assms by linarith |
|
9520 |
then show ?thesis using assms |
|
9521 |
using card_eq_SucD |
|
9522 |
by auto (metis collinear_2 numeral_2_eq_2) |
|
9523 |
qed |
|
9524 |
||
9525 |
lemma coplanar_small: |
|
9526 |
assumes "finite s" "card s \<le> 3" |
|
9527 |
shows "coplanar s" |
|
9528 |
proof - |
|
9529 |
have "card s \<le> 2 \<or> card s = Suc (Suc (Suc 0))" |
|
9530 |
using assms by linarith |
|
9531 |
then show ?thesis using assms |
|
9532 |
apply safe |
|
9533 |
apply (simp add: collinear_small collinear_imp_coplanar) |
|
9534 |
apply (safe dest!: card_eq_SucD) |
|
9535 |
apply (auto simp: coplanar_def) |
|
9536 |
apply (metis hull_subset insert_subset) |
|
9537 |
done |
|
9538 |
qed |
|
9539 |
||
9540 |
lemma coplanar_empty: "coplanar {}" |
|
9541 |
by (simp add: coplanar_small) |
|
9542 |
||
9543 |
lemma coplanar_sing: "coplanar {a}" |
|
9544 |
by (simp add: coplanar_small) |
|
9545 |
||
9546 |
lemma coplanar_2: "coplanar {a,b}" |
|
9547 |
by (auto simp: card_insert_if coplanar_small) |
|
9548 |
||
9549 |
lemma coplanar_3: "coplanar {a,b,c}" |
|
9550 |
by (auto simp: card_insert_if coplanar_small) |
|
9551 |
||
9552 |
lemma collinear_affine_hull_collinear: "collinear(affine hull s) \<longleftrightarrow> collinear s" |
|
9553 |
unfolding collinear_affine_hull |
|
9554 |
by (metis affine_affine_hull subset_hull hull_hull hull_mono) |
|
9555 |
||
9556 |
lemma coplanar_affine_hull_coplanar: "coplanar(affine hull s) \<longleftrightarrow> coplanar s" |
|
9557 |
unfolding coplanar_def |
|
9558 |
by (metis affine_affine_hull subset_hull hull_hull hull_mono) |
|
9559 |
||
9560 |
lemma coplanar_linear_image: |
|
9561 |
fixes f :: "'a::euclidean_space \<Rightarrow> 'b::real_normed_vector" |
|
9562 |
assumes "coplanar s" "linear f" shows "coplanar(f ` s)" |
|
9563 |
proof - |
|
9564 |
{ fix u v w |
|
9565 |
assume "s \<subseteq> affine hull {u, v, w}" |
|
9566 |
then have "f ` s \<subseteq> f ` (affine hull {u, v, w})" |
|
9567 |
by (simp add: image_mono) |
|
9568 |
then have "f ` s \<subseteq> affine hull (f ` {u, v, w})" |
|
9569 |
by (metis assms(2) linear_conv_bounded_linear affine_hull_linear_image) |
|
9570 |
} then |
|
9571 |
show ?thesis |
|
9572 |
by auto (meson assms(1) coplanar_def) |
|
9573 |
qed |
|
9574 |
||
60800
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
9575 |
lemma coplanar_translation_imp: "coplanar s \<Longrightarrow> coplanar ((\<lambda>x. a + x) ` s)" |
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
9576 |
unfolding coplanar_def |
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
9577 |
apply clarify |
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
9578 |
apply (rule_tac x="u+a" in exI) |
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
9579 |
apply (rule_tac x="v+a" in exI) |
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
9580 |
apply (rule_tac x="w+a" in exI) |
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
9581 |
using affine_hull_translation [of a "{u,v,w}" for u v w] |
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
9582 |
apply (force simp: add.commute) |
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
9583 |
done |
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
9584 |
|
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
9585 |
lemma coplanar_translation_eq: "coplanar((\<lambda>x. a + x) ` s) \<longleftrightarrow> coplanar s" |
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
9586 |
by (metis (no_types) coplanar_translation_imp translation_galois) |
60762 | 9587 |
|
9588 |
lemma coplanar_linear_image_eq: |
|
9589 |
fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" |
|
9590 |
assumes "linear f" "inj f" shows "coplanar(f ` s) = coplanar s" |
|
60809
457abb82fb9e
the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents:
60800
diff
changeset
|
9591 |
proof |
60800
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
9592 |
assume "coplanar s" |
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
9593 |
then show "coplanar (f ` s)" |
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
9594 |
unfolding coplanar_def |
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
9595 |
using affine_hull_linear_image [of f "{u,v,w}" for u v w] assms |
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
9596 |
by (meson coplanar_def coplanar_linear_image) |
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
9597 |
next |
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
9598 |
obtain g where g: "linear g" "g \<circ> f = id" |
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
9599 |
using linear_injective_left_inverse [OF assms] |
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
9600 |
by blast |
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
9601 |
assume "coplanar (f ` s)" |
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
9602 |
then obtain u v w where "f ` s \<subseteq> affine hull {u, v, w}" |
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
9603 |
by (auto simp: coplanar_def) |
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
9604 |
then have "g ` f ` s \<subseteq> g ` (affine hull {u, v, w})" |
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
9605 |
by blast |
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
9606 |
then have "s \<subseteq> g ` (affine hull {u, v, w})" |
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
9607 |
using g by (simp add: Fun.image_comp) |
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
9608 |
then show "coplanar s" |
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
9609 |
unfolding coplanar_def |
61222 | 9610 |
using affine_hull_linear_image [of g "{u,v,w}" for u v w] \<open>linear g\<close> linear_conv_bounded_linear |
60800
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
9611 |
by fastforce |
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
9612 |
qed |
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
9613 |
(*The HOL Light proof is simply |
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
9614 |
MATCH_ACCEPT_TAC(LINEAR_INVARIANT_RULE COPLANAR_LINEAR_IMAGE));; |
60762 | 9615 |
*) |
9616 |
||
9617 |
lemma coplanar_subset: "\<lbrakk>coplanar t; s \<subseteq> t\<rbrakk> \<Longrightarrow> coplanar s" |
|
9618 |
by (meson coplanar_def order_trans) |
|
9619 |
||
9620 |
lemma affine_hull_3_imp_collinear: "c \<in> affine hull {a,b} \<Longrightarrow> collinear {a,b,c}" |
|
9621 |
by (metis collinear_2 collinear_affine_hull_collinear hull_redundant insert_commute) |
|
9622 |
||
9623 |
lemma collinear_3_imp_in_affine_hull: "\<lbrakk>collinear {a,b,c}; a \<noteq> b\<rbrakk> \<Longrightarrow> c \<in> affine hull {a,b}" |
|
9624 |
unfolding collinear_def |
|
9625 |
apply clarify |
|
9626 |
apply (frule_tac x=b in bspec, blast, drule_tac x=a in bspec, blast, erule exE) |
|
9627 |
apply (drule_tac x=c in bspec, blast, drule_tac x=a in bspec, blast, erule exE) |
|
9628 |
apply (rename_tac y x) |
|
9629 |
apply (simp add: affine_hull_2) |
|
9630 |
apply (rule_tac x="1 - x/y" in exI) |
|
9631 |
apply (simp add: algebra_simps) |
|
9632 |
done |
|
9633 |
||
9634 |
lemma collinear_3_affine_hull: |
|
9635 |
assumes "a \<noteq> b" |
|
9636 |
shows "collinear {a,b,c} \<longleftrightarrow> c \<in> affine hull {a,b}" |
|
9637 |
using affine_hull_3_imp_collinear assms collinear_3_imp_in_affine_hull by blast |
|
9638 |
||
9639 |
lemma collinear_3_eq_affine_dependent: |
|
9640 |
"collinear{a,b,c} \<longleftrightarrow> a = b \<or> a = c \<or> b = c \<or> affine_dependent {a,b,c}" |
|
9641 |
apply (case_tac "a=b", simp) |
|
9642 |
apply (case_tac "a=c") |
|
9643 |
apply (simp add: insert_commute) |
|
9644 |
apply (case_tac "b=c") |
|
9645 |
apply (simp add: insert_commute) |
|
9646 |
apply (auto simp: affine_dependent_def collinear_3_affine_hull insert_Diff_if) |
|
9647 |
apply (metis collinear_3_affine_hull insert_commute)+ |
|
9648 |
done |
|
9649 |
||
9650 |
lemma affine_dependent_imp_collinear_3: |
|
9651 |
"affine_dependent {a,b,c} \<Longrightarrow> collinear{a,b,c}" |
|
9652 |
by (simp add: collinear_3_eq_affine_dependent) |
|
9653 |
||
9654 |
lemma collinear_3: "NO_MATCH 0 x \<Longrightarrow> collinear {x,y,z} \<longleftrightarrow> collinear {0, x-y, z-y}" |
|
9655 |
by (auto simp add: collinear_def) |
|
9656 |
||
9657 |
||
9658 |
thm affine_hull_nonempty |
|
9659 |
corollary affine_hull_eq_empty [simp]: "affine hull S = {} \<longleftrightarrow> S = {}" |
|
9660 |
using affine_hull_nonempty by blast |
|
9661 |
||
9662 |
lemma affine_hull_2_alt: |
|
9663 |
fixes a b :: "'a::real_vector" |
|
9664 |
shows "affine hull {a,b} = range (\<lambda>u. a + u *\<^sub>R (b - a))" |
|
9665 |
apply (simp add: affine_hull_2, safe) |
|
9666 |
apply (rule_tac x=v in image_eqI) |
|
9667 |
apply (simp add: algebra_simps) |
|
9668 |
apply (metis scaleR_add_left scaleR_one, simp) |
|
9669 |
apply (rule_tac x="1-u" in exI) |
|
9670 |
apply (simp add: algebra_simps) |
|
9671 |
done |
|
9672 |
||
9673 |
lemma interior_convex_hull_3_minimal: |
|
9674 |
fixes a :: "'a::euclidean_space" |
|
9675 |
shows "\<lbrakk>~ collinear{a,b,c}; DIM('a) = 2\<rbrakk> |
|
9676 |
\<Longrightarrow> interior(convex hull {a,b,c}) = |
|
9677 |
{v. \<exists>x y z. 0 < x \<and> 0 < y \<and> 0 < z \<and> x + y + z = 1 \<and> |
|
9678 |
x *\<^sub>R a + y *\<^sub>R b + z *\<^sub>R c = v}" |
|
9679 |
apply (simp add: collinear_3_eq_affine_dependent interior_convex_hull_explicit_minimal, safe) |
|
9680 |
apply (rule_tac x="u a" in exI, simp) |
|
9681 |
apply (rule_tac x="u b" in exI, simp) |
|
9682 |
apply (rule_tac x="u c" in exI, simp) |
|
9683 |
apply (rename_tac uu x y z) |
|
9684 |
apply (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) |
|
9685 |
apply simp |
|
9686 |
done |
|
9687 |
||
60974
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9688 |
subsection\<open>The infimum of the distance between two sets\<close> |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9689 |
|
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9690 |
definition setdist :: "'a::metric_space set \<Rightarrow> 'a set \<Rightarrow> real" where |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9691 |
"setdist s t \<equiv> |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9692 |
(if s = {} \<or> t = {} then 0 |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9693 |
else Inf {dist x y| x y. x \<in> s \<and> y \<in> t})" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9694 |
|
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9695 |
lemma setdist_empty1 [simp]: "setdist {} t = 0" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9696 |
by (simp add: setdist_def) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9697 |
|
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9698 |
lemma setdist_empty2 [simp]: "setdist t {} = 0" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9699 |
by (simp add: setdist_def) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9700 |
|
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9701 |
lemma setdist_pos_le: "0 \<le> setdist s t" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9702 |
by (auto simp: setdist_def ex_in_conv [symmetric] intro: cInf_greatest) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9703 |
|
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9704 |
lemma le_setdistI: |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9705 |
assumes "s \<noteq> {}" "t \<noteq> {}" "\<And>x y. \<lbrakk>x \<in> s; y \<in> t\<rbrakk> \<Longrightarrow> d \<le> dist x y" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9706 |
shows "d \<le> setdist s t" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9707 |
using assms |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9708 |
by (auto simp: setdist_def Set.ex_in_conv [symmetric] intro: cInf_greatest) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9709 |
|
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9710 |
lemma setdist_le_dist: "\<lbrakk>x \<in> s; y \<in> t\<rbrakk> \<Longrightarrow> setdist s t \<le> dist x y" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9711 |
unfolding setdist_def |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9712 |
by (auto intro!: bdd_belowI [where m=0] cInf_lower) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9713 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61531
diff
changeset
|
9714 |
lemma le_setdist_iff: |
60974
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9715 |
"d \<le> setdist s t \<longleftrightarrow> |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9716 |
(\<forall>x \<in> s. \<forall>y \<in> t. d \<le> dist x y) \<and> (s = {} \<or> t = {} \<longrightarrow> d \<le> 0)" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9717 |
apply (cases "s = {} \<or> t = {}") |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9718 |
apply (force simp add: setdist_def) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9719 |
apply (intro iffI conjI) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9720 |
using setdist_le_dist apply fastforce |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9721 |
apply (auto simp: intro: le_setdistI) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9722 |
done |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9723 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61531
diff
changeset
|
9724 |
lemma setdist_ltE: |
60974
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9725 |
assumes "setdist s t < b" "s \<noteq> {}" "t \<noteq> {}" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9726 |
obtains x y where "x \<in> s" "y \<in> t" "dist x y < b" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9727 |
using assms |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9728 |
by (auto simp: not_le [symmetric] le_setdist_iff) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9729 |
|
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9730 |
lemma setdist_refl: "setdist s s = 0" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9731 |
apply (cases "s = {}") |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9732 |
apply (force simp add: setdist_def) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9733 |
apply (rule antisym [OF _ setdist_pos_le]) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9734 |
apply (metis all_not_in_conv dist_self setdist_le_dist) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9735 |
done |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9736 |
|
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9737 |
lemma setdist_sym: "setdist s t = setdist t s" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9738 |
by (force simp: setdist_def dist_commute intro!: arg_cong [where f=Inf]) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9739 |
|
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9740 |
lemma setdist_triangle: "setdist s t \<le> setdist s {a} + setdist {a} t" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9741 |
proof (cases "s = {} \<or> t = {}") |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9742 |
case True then show ?thesis |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9743 |
using setdist_pos_le by fastforce |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9744 |
next |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9745 |
case False |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61531
diff
changeset
|
9746 |
have "\<And>x. x \<in> s \<Longrightarrow> setdist s t - dist x a \<le> setdist {a} t" |
60974
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9747 |
apply (rule le_setdistI, blast) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9748 |
using False apply (fastforce intro: le_setdistI) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9749 |
apply (simp add: algebra_simps) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9750 |
apply (metis dist_commute dist_triangle_alt order_trans [OF setdist_le_dist]) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9751 |
done |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9752 |
then have "setdist s t - setdist {a} t \<le> setdist s {a}" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9753 |
using False by (fastforce intro: le_setdistI) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9754 |
then show ?thesis |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9755 |
by (simp add: algebra_simps) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9756 |
qed |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9757 |
|
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9758 |
lemma setdist_singletons [simp]: "setdist {x} {y} = dist x y" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9759 |
by (simp add: setdist_def) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9760 |
|
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9761 |
lemma setdist_Lipschitz: "abs(setdist {x} s - setdist {y} s) \<le> dist x y" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9762 |
apply (subst setdist_singletons [symmetric]) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9763 |
by (metis abs_diff_le_iff diff_le_eq setdist_triangle setdist_sym) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9764 |
|
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9765 |
lemma continuous_at_setdist: "continuous (at x) (\<lambda>y. (setdist {y} s))" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9766 |
by (force simp: continuous_at_eps_delta dist_real_def intro: le_less_trans [OF setdist_Lipschitz]) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9767 |
|
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9768 |
lemma continuous_on_setdist: "continuous_on t (\<lambda>y. (setdist {y} s))" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9769 |
by (metis continuous_at_setdist continuous_at_imp_continuous_on) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9770 |
|
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9771 |
lemma uniformly_continuous_on_setdist: "uniformly_continuous_on t (\<lambda>y. (setdist {y} s))" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9772 |
by (force simp: uniformly_continuous_on_def dist_real_def intro: le_less_trans [OF setdist_Lipschitz]) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9773 |
|
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9774 |
lemma setdist_subset_right: "\<lbrakk>t \<noteq> {}; t \<subseteq> u\<rbrakk> \<Longrightarrow> setdist s u \<le> setdist s t" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9775 |
apply (cases "s = {} \<or> u = {}", force) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9776 |
apply (auto simp: setdist_def intro!: bdd_belowI [where m=0] cInf_superset_mono) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9777 |
done |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9778 |
|
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9779 |
lemma setdist_subset_left: "\<lbrakk>s \<noteq> {}; s \<subseteq> t\<rbrakk> \<Longrightarrow> setdist t u \<le> setdist s u" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9780 |
by (metis setdist_subset_right setdist_sym) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9781 |
|
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9782 |
lemma setdist_closure_1 [simp]: "setdist (closure s) t = setdist s t" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9783 |
proof (cases "s = {} \<or> t = {}") |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9784 |
case True then show ?thesis by force |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9785 |
next |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9786 |
case False |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9787 |
{ fix y |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9788 |
assume "y \<in> t" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9789 |
have "continuous_on (closure s) (\<lambda>a. dist a y)" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9790 |
by (auto simp: continuous_intros dist_norm) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9791 |
then have *: "\<And>x. x \<in> closure s \<Longrightarrow> setdist s t \<le> dist x y" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9792 |
apply (rule continuous_ge_on_closure) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9793 |
apply assumption |
61222 | 9794 |
apply (blast intro: setdist_le_dist \<open>y \<in> t\<close> ) |
60974
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9795 |
done |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9796 |
} note * = this |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9797 |
show ?thesis |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9798 |
apply (rule antisym) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9799 |
using False closure_subset apply (blast intro: setdist_subset_left) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9800 |
using False * |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9801 |
apply (force simp add: closure_eq_empty intro!: le_setdistI) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9802 |
done |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9803 |
qed |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9804 |
|
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9805 |
lemma setdist_closure_2 [simp]: "setdist t (closure s) = setdist t s" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9806 |
by (metis setdist_closure_1 setdist_sym) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9807 |
|
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9808 |
lemma setdist_compact_closed: |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9809 |
fixes s :: "'a::euclidean_space set" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9810 |
assumes s: "compact s" and t: "closed t" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9811 |
and "s \<noteq> {}" "t \<noteq> {}" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9812 |
shows "\<exists>x \<in> s. \<exists>y \<in> t. dist x y = setdist s t" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9813 |
proof - |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9814 |
have "{x - y |x y. x \<in> s \<and> y \<in> t} \<noteq> {}" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9815 |
using assms by blast |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9816 |
then |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9817 |
have "\<exists>x \<in> s. \<exists>y \<in> t. dist x y \<le> setdist s t" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9818 |
using distance_attains_inf [where a=0, OF compact_closed_differences [OF s t]] assms |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9819 |
apply (clarsimp simp: dist_norm le_setdist_iff, blast) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9820 |
done |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9821 |
then show ?thesis |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9822 |
by (blast intro!: antisym [OF _ setdist_le_dist] ) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9823 |
qed |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9824 |
|
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9825 |
lemma setdist_closed_compact: |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9826 |
fixes s :: "'a::euclidean_space set" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9827 |
assumes s: "closed s" and t: "compact t" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9828 |
and "s \<noteq> {}" "t \<noteq> {}" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9829 |
shows "\<exists>x \<in> s. \<exists>y \<in> t. dist x y = setdist s t" |
61222 | 9830 |
using setdist_compact_closed [OF t s \<open>t \<noteq> {}\<close> \<open>s \<noteq> {}\<close>] |
60974
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9831 |
by (metis dist_commute setdist_sym) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9832 |
|
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9833 |
lemma setdist_eq_0I: "\<lbrakk>x \<in> s; x \<in> t\<rbrakk> \<Longrightarrow> setdist s t = 0" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9834 |
by (metis antisym dist_self setdist_le_dist setdist_pos_le) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9835 |
|
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9836 |
lemma setdist_eq_0_compact_closed: |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9837 |
fixes s :: "'a::euclidean_space set" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9838 |
assumes s: "compact s" and t: "closed t" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9839 |
shows "setdist s t = 0 \<longleftrightarrow> s = {} \<or> t = {} \<or> s \<inter> t \<noteq> {}" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9840 |
apply (cases "s = {} \<or> t = {}", force) |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61531
diff
changeset
|
9841 |
using setdist_compact_closed [OF s t] |
60974
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9842 |
apply (force intro: setdist_eq_0I ) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9843 |
done |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9844 |
|
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9845 |
corollary setdist_gt_0_compact_closed: |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9846 |
fixes s :: "'a::euclidean_space set" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9847 |
assumes s: "compact s" and t: "closed t" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9848 |
shows "setdist s t > 0 \<longleftrightarrow> (s \<noteq> {} \<and> t \<noteq> {} \<and> s \<inter> t = {})" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9849 |
using setdist_pos_le [of s t] setdist_eq_0_compact_closed [OF assms] |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9850 |
by linarith |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9851 |
|
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9852 |
lemma setdist_eq_0_closed_compact: |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9853 |
fixes s :: "'a::euclidean_space set" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9854 |
assumes s: "closed s" and t: "compact t" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9855 |
shows "setdist s t = 0 \<longleftrightarrow> s = {} \<or> t = {} \<or> s \<inter> t \<noteq> {}" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9856 |
using setdist_eq_0_compact_closed [OF t s] |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9857 |
by (metis Int_commute setdist_sym) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9858 |
|
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9859 |
lemma setdist_eq_0_bounded: |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9860 |
fixes s :: "'a::euclidean_space set" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9861 |
assumes "bounded s \<or> bounded t" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9862 |
shows "setdist s t = 0 \<longleftrightarrow> s = {} \<or> t = {} \<or> closure s \<inter> closure t \<noteq> {}" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9863 |
apply (cases "s = {} \<or> t = {}", force) |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61531
diff
changeset
|
9864 |
using setdist_eq_0_compact_closed [of "closure s" "closure t"] |
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61531
diff
changeset
|
9865 |
setdist_eq_0_closed_compact [of "closure s" "closure t"] assms |
60974
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9866 |
apply (force simp add: bounded_closure compact_eq_bounded_closed) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9867 |
done |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9868 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61531
diff
changeset
|
9869 |
lemma setdist_unique: |
60974
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9870 |
"\<lbrakk>a \<in> s; b \<in> t; \<And>x y. x \<in> s \<and> y \<in> t ==> dist a b \<le> dist x y\<rbrakk> |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9871 |
\<Longrightarrow> setdist s t = dist a b" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9872 |
by (force simp add: setdist_le_dist le_setdist_iff intro: antisym) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9873 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61531
diff
changeset
|
9874 |
lemma setdist_closest_point: |
60974
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9875 |
"\<lbrakk>closed s; s \<noteq> {}\<rbrakk> \<Longrightarrow> setdist {a} s = dist a (closest_point s a)" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9876 |
apply (rule setdist_unique) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9877 |
using closest_point_le |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9878 |
apply (auto simp: closest_point_in_set) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9879 |
done |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9880 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61531
diff
changeset
|
9881 |
lemma setdist_eq_0_sing_1 [simp]: |
60974
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9882 |
fixes s :: "'a::euclidean_space set" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9883 |
shows "setdist {x} s = 0 \<longleftrightarrow> s = {} \<or> x \<in> closure s" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9884 |
by (auto simp: setdist_eq_0_bounded) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9885 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61531
diff
changeset
|
9886 |
lemma setdist_eq_0_sing_2 [simp]: |
60974
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9887 |
fixes s :: "'a::euclidean_space set" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9888 |
shows "setdist s {x} = 0 \<longleftrightarrow> s = {} \<or> x \<in> closure s" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9889 |
by (auto simp: setdist_eq_0_bounded) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9890 |
|
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9891 |
lemma setdist_sing_in_set: |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9892 |
fixes s :: "'a::euclidean_space set" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9893 |
shows "x \<in> s \<Longrightarrow> setdist {x} s = 0" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9894 |
using closure_subset by force |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9895 |
|
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9896 |
lemma setdist_le_sing: "x \<in> s ==> setdist s t \<le> setdist {x} t" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9897 |
using setdist_subset_left by auto |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9898 |
|
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60809
diff
changeset
|
9899 |
|
33175 | 9900 |
end |