author | wenzelm |
Fri, 13 Sep 2013 22:31:56 +0200 | |
changeset 53628 | 15405540288e |
parent 53627 | f3fd9168911c |
child 54775 | 2d3df8633dad |
permissions | -rw-r--r-- |
53572 | 1 |
(* Author: John Harrison |
2 |
Author: Robert Himmelmann, TU Muenchen (translation from HOL light) |
|
3 |
*) |
|
36432 | 4 |
|
53572 | 5 |
header {* Fashoda meet theorem *} |
36432 | 6 |
|
7 |
theory Fashoda |
|
37674
f86de9c00c47
convert theorem path_connected_sphere to euclidean_space class
huffman
parents:
37489
diff
changeset
|
8 |
imports Brouwer_Fixpoint Path_Connected Cartesian_Euclidean_Space |
36432 | 9 |
begin |
10 |
||
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
44647
diff
changeset
|
11 |
(* move *) |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
44647
diff
changeset
|
12 |
|
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
44647
diff
changeset
|
13 |
lemma cart_eq_inner_axis: "a $ i = a \<bullet> axis i 1" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
44647
diff
changeset
|
14 |
by (simp add: inner_axis) |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
44647
diff
changeset
|
15 |
|
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
44647
diff
changeset
|
16 |
lemma axis_in_Basis: "a \<in> Basis \<Longrightarrow> axis i a \<in> Basis" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
44647
diff
changeset
|
17 |
by (auto simp add: Basis_vec_def axis_eq_axis) |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
44647
diff
changeset
|
18 |
|
53572 | 19 |
|
20 |
subsection {* Fashoda meet theorem *} |
|
36432 | 21 |
|
53572 | 22 |
lemma infnorm_2: |
23 |
fixes x :: "real^2" |
|
24 |
shows "infnorm x = max (abs (x$1)) (abs (x$2))" |
|
25 |
unfolding infnorm_cart UNIV_2 by (rule cSup_eq) auto |
|
36432 | 26 |
|
53572 | 27 |
lemma infnorm_eq_1_2: |
28 |
fixes x :: "real^2" |
|
29 |
shows "infnorm x = 1 \<longleftrightarrow> |
|
30 |
abs (x$1) \<le> 1 \<and> abs (x$2) \<le> 1 \<and> (x$1 = -1 \<or> x$1 = 1 \<or> x$2 = -1 \<or> x$2 = 1)" |
|
36432 | 31 |
unfolding infnorm_2 by auto |
32 |
||
53572 | 33 |
lemma infnorm_eq_1_imp: |
34 |
fixes x :: "real^2" |
|
35 |
assumes "infnorm x = 1" |
|
36 |
shows "abs (x$1) \<le> 1" and "abs (x$2) \<le> 1" |
|
36432 | 37 |
using assms unfolding infnorm_eq_1_2 by auto |
38 |
||
53572 | 39 |
lemma fashoda_unit: |
40 |
fixes f g :: "real \<Rightarrow> real^2" |
|
41 |
assumes "f ` {- 1..1} \<subseteq> {- 1..1}" |
|
42 |
and "g ` {- 1..1} \<subseteq> {- 1..1}" |
|
43 |
and "continuous_on {- 1..1} f" |
|
44 |
and "continuous_on {- 1..1} g" |
|
45 |
and "f (- 1)$1 = - 1" |
|
46 |
and "f 1$1 = 1" "g (- 1) $2 = -1" |
|
47 |
and "g 1 $2 = 1" |
|
48 |
shows "\<exists>s\<in>{- 1..1}. \<exists>t\<in>{- 1..1}. f s = g t" |
|
49 |
proof (rule ccontr) |
|
50 |
assume "\<not> ?thesis" |
|
51 |
note as = this[unfolded bex_simps,rule_format] |
|
36432 | 52 |
def sqprojection \<equiv> "\<lambda>z::real^2. (inverse (infnorm z)) *\<^sub>R z" |
53572 | 53 |
def negatex \<equiv> "\<lambda>x::real^2. (vector [-(x$1), x$2])::real^2" |
54 |
have lem1: "\<forall>z::real^2. infnorm (negatex z) = infnorm z" |
|
36432 | 55 |
unfolding negatex_def infnorm_2 vector_2 by auto |
53572 | 56 |
have lem2: "\<forall>z. z \<noteq> 0 \<longrightarrow> infnorm (sqprojection z) = 1" |
57 |
unfolding sqprojection_def |
|
58 |
unfolding infnorm_mul[unfolded scalar_mult_eq_scaleR] |
|
59 |
unfolding abs_inverse real_abs_infnorm |
|
53628 | 60 |
apply (subst infnorm_eq_0[symmetric]) |
53572 | 61 |
apply auto |
62 |
done |
|
63 |
let ?F = "\<lambda>w::real^2. (f \<circ> (\<lambda>x. x$1)) w - (g \<circ> (\<lambda>x. x$2)) w" |
|
64 |
have *: "\<And>i. (\<lambda>x::real^2. x $ i) ` {- 1..1} = {- 1..1::real}" |
|
65 |
apply (rule set_eqI) |
|
66 |
unfolding image_iff Bex_def mem_interval_cart |
|
67 |
apply rule |
|
68 |
defer |
|
69 |
apply (rule_tac x="vec x" in exI) |
|
70 |
apply auto |
|
71 |
done |
|
72 |
{ |
|
73 |
fix x |
|
74 |
assume "x \<in> (\<lambda>w. (f \<circ> (\<lambda>x. x $ 1)) w - (g \<circ> (\<lambda>x. x $ 2)) w) ` {- 1..1::real^2}" |
|
36432 | 75 |
then guess w unfolding image_iff .. note w = this |
53572 | 76 |
then have "x \<noteq> 0" |
77 |
using as[of "w$1" "w$2"] |
|
78 |
unfolding mem_interval_cart |
|
79 |
by auto |
|
80 |
} note x0 = this |
|
81 |
have 21: "\<And>i::2. i \<noteq> 1 \<Longrightarrow> i = 2" |
|
82 |
using UNIV_2 by auto |
|
83 |
have 1: "{- 1<..<1::real^2} \<noteq> {}" |
|
84 |
unfolding interval_eq_empty_cart by auto |
|
85 |
have 2: "continuous_on {- 1..1} (negatex \<circ> sqprojection \<circ> ?F)" |
|
86 |
apply (intro continuous_on_intros continuous_on_component) |
|
87 |
unfolding * |
|
88 |
apply (rule assms)+ |
|
89 |
apply (subst sqprojection_def) |
|
90 |
apply (intro continuous_on_intros) |
|
91 |
apply (simp add: infnorm_eq_0 x0) |
|
92 |
apply (rule linear_continuous_on) |
|
93 |
proof - |
|
94 |
show "bounded_linear negatex" |
|
95 |
apply (rule bounded_linearI') |
|
96 |
unfolding vec_eq_iff |
|
97 |
proof (rule_tac[!] allI) |
|
98 |
fix i :: 2 |
|
99 |
fix x y :: "real^2" |
|
100 |
fix c :: real |
|
101 |
show "negatex (x + y) $ i = |
|
102 |
(negatex x + negatex y) $ i" "negatex (c *\<^sub>R x) $ i = (c *\<^sub>R negatex x) $ i" |
|
103 |
apply - |
|
104 |
apply (case_tac[!] "i\<noteq>1") |
|
105 |
prefer 3 |
|
106 |
apply (drule_tac[1-2] 21) |
|
107 |
unfolding negatex_def |
|
108 |
apply (auto simp add:vector_2) |
|
109 |
done |
|
110 |
qed |
|
44647
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44531
diff
changeset
|
111 |
qed |
53572 | 112 |
have 3: "(negatex \<circ> sqprojection \<circ> ?F) ` {- 1..1} \<subseteq> {- 1..1}" |
113 |
unfolding subset_eq |
|
114 |
apply rule |
|
115 |
proof - |
|
116 |
case goal1 |
|
117 |
then guess y unfolding image_iff .. note y=this |
|
118 |
have "?F y \<noteq> 0" |
|
119 |
apply (rule x0) |
|
120 |
using y(1) |
|
121 |
apply auto |
|
122 |
done |
|
123 |
then have *: "infnorm (sqprojection (?F y)) = 1" |
|
53628 | 124 |
unfolding y o_def |
125 |
by - (rule lem2[rule_format]) |
|
53572 | 126 |
have "infnorm x = 1" |
53628 | 127 |
unfolding *[symmetric] y o_def |
128 |
by (rule lem1[rule_format]) |
|
53572 | 129 |
then show "x \<in> {- 1..1}" |
130 |
unfolding mem_interval_cart infnorm_2 |
|
131 |
apply - |
|
132 |
apply rule |
|
133 |
proof - |
|
134 |
case goal1 |
|
135 |
then show ?case |
|
136 |
apply (cases "i = 1") |
|
137 |
defer |
|
138 |
apply (drule 21) |
|
139 |
apply auto |
|
140 |
done |
|
141 |
qed |
|
142 |
qed |
|
143 |
guess x |
|
144 |
apply (rule brouwer_weak[of "{- 1..1::real^2}" "negatex \<circ> sqprojection \<circ> ?F"]) |
|
145 |
apply (rule compact_interval convex_interval)+ unfolding interior_closed_interval |
|
146 |
apply (rule 1 2 3)+ |
|
147 |
done |
|
148 |
note x=this |
|
149 |
have "?F x \<noteq> 0" |
|
150 |
apply (rule x0) |
|
151 |
using x(1) |
|
152 |
apply auto |
|
153 |
done |
|
154 |
then have *: "infnorm (sqprojection (?F x)) = 1" |
|
53628 | 155 |
unfolding o_def |
156 |
by (rule lem2[rule_format]) |
|
53572 | 157 |
have nx: "infnorm x = 1" |
53628 | 158 |
apply (subst x(2)[symmetric]) |
159 |
unfolding *[symmetric] o_def |
|
53572 | 160 |
apply (rule lem1[rule_format]) |
161 |
done |
|
162 |
have "\<forall>x i. x \<noteq> 0 \<longrightarrow> (0 < (sqprojection x)$i \<longleftrightarrow> 0 < x$i)" |
|
163 |
and "\<forall>x i. x \<noteq> 0 \<longrightarrow> ((sqprojection x)$i < 0 \<longleftrightarrow> x$i < 0)" |
|
164 |
apply - |
|
165 |
apply (rule_tac[!] allI impI)+ |
|
166 |
proof - |
|
167 |
fix x :: "real^2" |
|
168 |
fix i :: 2 |
|
169 |
assume x: "x \<noteq> 0" |
|
170 |
have "inverse (infnorm x) > 0" |
|
53628 | 171 |
using x[unfolded infnorm_pos_lt[symmetric]] by auto |
53572 | 172 |
then show "(0 < sqprojection x $ i) = (0 < x $ i)" |
173 |
and "(sqprojection x $ i < 0) = (x $ i < 0)" |
|
44282
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
huffman
parents:
44136
diff
changeset
|
174 |
unfolding sqprojection_def vector_component_simps vector_scaleR_component real_scaleR_def |
53572 | 175 |
unfolding zero_less_mult_iff mult_less_0_iff |
176 |
by (auto simp add: field_simps) |
|
177 |
qed |
|
36432 | 178 |
note lem3 = this[rule_format] |
53572 | 179 |
have x1: "x $ 1 \<in> {- 1..1::real}" "x $ 2 \<in> {- 1..1::real}" |
180 |
using x(1) unfolding mem_interval_cart by auto |
|
181 |
then have nz: "f (x $ 1) - g (x $ 2) \<noteq> 0" |
|
182 |
unfolding right_minus_eq |
|
183 |
apply - |
|
184 |
apply (rule as) |
|
185 |
apply auto |
|
186 |
done |
|
187 |
have "x $ 1 = -1 \<or> x $ 1 = 1 \<or> x $ 2 = -1 \<or> x $ 2 = 1" |
|
188 |
using nx unfolding infnorm_eq_1_2 by auto |
|
189 |
then show False |
|
190 |
proof - |
|
191 |
fix P Q R S |
|
192 |
presume "P \<or> Q \<or> R \<or> S" |
|
193 |
and "P \<Longrightarrow> False" |
|
194 |
and "Q \<Longrightarrow> False" |
|
195 |
and "R \<Longrightarrow> False" |
|
196 |
and "S \<Longrightarrow> False" |
|
197 |
then show False by auto |
|
198 |
next |
|
199 |
assume as: "x$1 = 1" |
|
200 |
then have *: "f (x $ 1) $ 1 = 1" |
|
201 |
using assms(6) by auto |
|
36432 | 202 |
have "sqprojection (f (x$1) - g (x$2)) $ 1 < 0" |
44136
e63ad7d5158d
more uniform naming scheme for finite cartesian product type and related theorems
huffman
parents:
41958
diff
changeset
|
203 |
using x(2)[unfolded o_def vec_eq_iff,THEN spec[where x=1]] |
53572 | 204 |
unfolding as negatex_def vector_2 |
205 |
by auto |
|
206 |
moreover |
|
207 |
from x1 have "g (x $ 2) \<in> {- 1..1}" |
|
208 |
apply - |
|
209 |
apply (rule assms(2)[unfolded subset_eq,rule_format]) |
|
210 |
apply auto |
|
211 |
done |
|
212 |
ultimately show False |
|
213 |
unfolding lem3[OF nz] vector_component_simps * mem_interval_cart |
|
214 |
apply (erule_tac x=1 in allE) |
|
215 |
apply auto |
|
216 |
done |
|
217 |
next |
|
218 |
assume as: "x$1 = -1" |
|
219 |
then have *: "f (x $ 1) $ 1 = - 1" |
|
220 |
using assms(5) by auto |
|
36432 | 221 |
have "sqprojection (f (x$1) - g (x$2)) $ 1 > 0" |
44136
e63ad7d5158d
more uniform naming scheme for finite cartesian product type and related theorems
huffman
parents:
41958
diff
changeset
|
222 |
using x(2)[unfolded o_def vec_eq_iff,THEN spec[where x=1]] |
53572 | 223 |
unfolding as negatex_def vector_2 |
224 |
by auto |
|
225 |
moreover |
|
226 |
from x1 have "g (x $ 2) \<in> {- 1..1}" |
|
227 |
apply - |
|
228 |
apply (rule assms(2)[unfolded subset_eq,rule_format]) |
|
229 |
apply auto |
|
230 |
done |
|
231 |
ultimately show False |
|
232 |
unfolding lem3[OF nz] vector_component_simps * mem_interval_cart |
|
233 |
apply (erule_tac x=1 in allE) |
|
234 |
apply auto |
|
235 |
done |
|
236 |
next |
|
237 |
assume as: "x$2 = 1" |
|
238 |
then have *: "g (x $ 2) $ 2 = 1" |
|
239 |
using assms(8) by auto |
|
36432 | 240 |
have "sqprojection (f (x$1) - g (x$2)) $ 2 > 0" |
44136
e63ad7d5158d
more uniform naming scheme for finite cartesian product type and related theorems
huffman
parents:
41958
diff
changeset
|
241 |
using x(2)[unfolded o_def vec_eq_iff,THEN spec[where x=2]] |
53572 | 242 |
unfolding as negatex_def vector_2 |
243 |
by auto |
|
244 |
moreover |
|
245 |
from x1 have "f (x $ 1) \<in> {- 1..1}" |
|
246 |
apply - |
|
247 |
apply (rule assms(1)[unfolded subset_eq,rule_format]) |
|
248 |
apply auto |
|
249 |
done |
|
250 |
ultimately show False |
|
251 |
unfolding lem3[OF nz] vector_component_simps * mem_interval_cart |
|
252 |
apply (erule_tac x=2 in allE) |
|
253 |
apply auto |
|
254 |
done |
|
255 |
next |
|
256 |
assume as: "x$2 = -1" |
|
257 |
then have *: "g (x $ 2) $ 2 = - 1" |
|
258 |
using assms(7) by auto |
|
36432 | 259 |
have "sqprojection (f (x$1) - g (x$2)) $ 2 < 0" |
44136
e63ad7d5158d
more uniform naming scheme for finite cartesian product type and related theorems
huffman
parents:
41958
diff
changeset
|
260 |
using x(2)[unfolded o_def vec_eq_iff,THEN spec[where x=2]] |
53572 | 261 |
unfolding as negatex_def vector_2 |
262 |
by auto |
|
263 |
moreover |
|
264 |
from x1 have "f (x $ 1) \<in> {- 1..1}" |
|
265 |
apply - |
|
266 |
apply (rule assms(1)[unfolded subset_eq,rule_format]) |
|
267 |
apply auto |
|
268 |
done |
|
269 |
ultimately show False |
|
270 |
unfolding lem3[OF nz] vector_component_simps * mem_interval_cart |
|
271 |
apply (erule_tac x=2 in allE) |
|
272 |
apply auto |
|
273 |
done |
|
274 |
qed auto |
|
275 |
qed |
|
36432 | 276 |
|
53572 | 277 |
lemma fashoda_unit_path: |
278 |
fixes f g :: "real \<Rightarrow> real^2" |
|
279 |
assumes "path f" |
|
280 |
and "path g" |
|
281 |
and "path_image f \<subseteq> {- 1..1}" |
|
282 |
and "path_image g \<subseteq> {- 1..1}" |
|
283 |
and "(pathstart f)$1 = -1" |
|
284 |
and "(pathfinish f)$1 = 1" |
|
285 |
and "(pathstart g)$2 = -1" |
|
286 |
and "(pathfinish g)$2 = 1" |
|
287 |
obtains z where "z \<in> path_image f" and "z \<in> path_image g" |
|
288 |
proof - |
|
36432 | 289 |
note assms=assms[unfolded path_def pathstart_def pathfinish_def path_image_def] |
290 |
def iscale \<equiv> "\<lambda>z::real. inverse 2 *\<^sub>R (z + 1)" |
|
53572 | 291 |
have isc: "iscale ` {- 1..1} \<subseteq> {0..1}" |
292 |
unfolding iscale_def by auto |
|
293 |
have "\<exists>s\<in>{- 1..1}. \<exists>t\<in>{- 1..1}. (f \<circ> iscale) s = (g \<circ> iscale) t" |
|
294 |
proof (rule fashoda_unit) |
|
36432 | 295 |
show "(f \<circ> iscale) ` {- 1..1} \<subseteq> {- 1..1}" "(g \<circ> iscale) ` {- 1..1} \<subseteq> {- 1..1}" |
296 |
using isc and assms(3-4) unfolding image_compose by auto |
|
53572 | 297 |
have *: "continuous_on {- 1..1} iscale" |
298 |
unfolding iscale_def by (rule continuous_on_intros)+ |
|
36432 | 299 |
show "continuous_on {- 1..1} (f \<circ> iscale)" "continuous_on {- 1..1} (g \<circ> iscale)" |
53572 | 300 |
apply - |
301 |
apply (rule_tac[!] continuous_on_compose[OF *]) |
|
302 |
apply (rule_tac[!] continuous_on_subset[OF _ isc]) |
|
303 |
apply (rule assms)+ |
|
304 |
done |
|
305 |
have *: "(1 / 2) *\<^sub>R (1 + (1::real^1)) = 1" |
|
306 |
unfolding vec_eq_iff by auto |
|
307 |
show "(f \<circ> iscale) (- 1) $ 1 = - 1" |
|
308 |
and "(f \<circ> iscale) 1 $ 1 = 1" |
|
309 |
and "(g \<circ> iscale) (- 1) $ 2 = -1" |
|
310 |
and "(g \<circ> iscale) 1 $ 2 = 1" |
|
311 |
unfolding o_def iscale_def |
|
312 |
using assms |
|
313 |
by (auto simp add: *) |
|
314 |
qed |
|
36432 | 315 |
then guess s .. from this(2) guess t .. note st=this |
53572 | 316 |
show thesis |
53628 | 317 |
apply (rule_tac z = "f (iscale s)" in that) |
318 |
using st `s \<in> {- 1..1}` |
|
53572 | 319 |
unfolding o_def path_image_def image_iff |
320 |
apply - |
|
321 |
apply (rule_tac x="iscale s" in bexI) |
|
322 |
prefer 3 |
|
323 |
apply (rule_tac x="iscale t" in bexI) |
|
324 |
using isc[unfolded subset_eq, rule_format] |
|
325 |
apply auto |
|
326 |
done |
|
327 |
qed |
|
36432 | 328 |
|
53627 | 329 |
lemma fashoda: |
330 |
fixes b :: "real^2" |
|
331 |
assumes "path f" |
|
332 |
and "path g" |
|
333 |
and "path_image f \<subseteq> {a..b}" |
|
334 |
and "path_image g \<subseteq> {a..b}" |
|
335 |
and "(pathstart f)$1 = a$1" |
|
336 |
and "(pathfinish f)$1 = b$1" |
|
337 |
and "(pathstart g)$2 = a$2" |
|
338 |
and "(pathfinish g)$2 = b$2" |
|
339 |
obtains z where "z \<in> path_image f" and "z \<in> path_image g" |
|
340 |
proof - |
|
341 |
fix P Q S |
|
342 |
presume "P \<or> Q \<or> S" "P \<Longrightarrow> thesis" and "Q \<Longrightarrow> thesis" and "S \<Longrightarrow> thesis" |
|
343 |
then show thesis |
|
344 |
by auto |
|
345 |
next |
|
346 |
have "{a..b} \<noteq> {}" |
|
347 |
using assms(3) using path_image_nonempty by auto |
|
348 |
then have "a \<le> b" |
|
349 |
unfolding interval_eq_empty_cart less_eq_vec_def by (auto simp add: not_less) |
|
350 |
then show "a$1 = b$1 \<or> a$2 = b$2 \<or> (a$1 < b$1 \<and> a$2 < b$2)" |
|
351 |
unfolding less_eq_vec_def forall_2 by auto |
|
352 |
next |
|
353 |
assume as: "a$1 = b$1" |
|
354 |
have "\<exists>z\<in>path_image g. z$2 = (pathstart f)$2" |
|
355 |
apply (rule connected_ivt_component_cart) |
|
356 |
apply (rule connected_path_image assms)+ |
|
357 |
apply (rule pathstart_in_path_image) |
|
358 |
apply (rule pathfinish_in_path_image) |
|
36432 | 359 |
unfolding assms using assms(3)[unfolded path_image_def subset_eq,rule_format,of "f 0"] |
53627 | 360 |
unfolding pathstart_def |
361 |
apply (auto simp add: less_eq_vec_def) |
|
362 |
done |
|
363 |
then guess z .. note z=this |
|
364 |
have "z \<in> {a..b}" |
|
365 |
using z(1) assms(4) |
|
366 |
unfolding path_image_def |
|
367 |
by blast |
|
368 |
then have "z = f 0" |
|
369 |
unfolding vec_eq_iff forall_2 |
|
370 |
unfolding z(2) pathstart_def |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36593
diff
changeset
|
371 |
using assms(3)[unfolded path_image_def subset_eq mem_interval_cart,rule_format,of "f 0" 1] |
53627 | 372 |
unfolding mem_interval_cart |
373 |
apply (erule_tac x=1 in allE) |
|
374 |
using as |
|
375 |
apply auto |
|
376 |
done |
|
377 |
then show thesis |
|
378 |
apply - |
|
379 |
apply (rule that[OF _ z(1)]) |
|
380 |
unfolding path_image_def |
|
381 |
apply auto |
|
382 |
done |
|
383 |
next |
|
384 |
assume as: "a$2 = b$2" |
|
385 |
have "\<exists>z\<in>path_image f. z$1 = (pathstart g)$1" |
|
386 |
apply (rule connected_ivt_component_cart) |
|
387 |
apply (rule connected_path_image assms)+ |
|
388 |
apply (rule pathstart_in_path_image) |
|
389 |
apply (rule pathfinish_in_path_image) |
|
390 |
unfolding assms |
|
391 |
using assms(4)[unfolded path_image_def subset_eq,rule_format,of "g 0"] |
|
392 |
unfolding pathstart_def |
|
393 |
apply (auto simp add: less_eq_vec_def) |
|
394 |
done |
|
395 |
then guess z .. note z=this |
|
396 |
have "z \<in> {a..b}" |
|
397 |
using z(1) assms(3) |
|
398 |
unfolding path_image_def |
|
399 |
by blast |
|
400 |
then have "z = g 0" |
|
401 |
unfolding vec_eq_iff forall_2 |
|
402 |
unfolding z(2) pathstart_def |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36593
diff
changeset
|
403 |
using assms(4)[unfolded path_image_def subset_eq mem_interval_cart,rule_format,of "g 0" 2] |
53627 | 404 |
unfolding mem_interval_cart |
405 |
apply (erule_tac x=2 in allE) |
|
406 |
using as |
|
407 |
apply auto |
|
408 |
done |
|
409 |
then show thesis |
|
410 |
apply - |
|
411 |
apply (rule that[OF z(1)]) |
|
412 |
unfolding path_image_def |
|
413 |
apply auto |
|
414 |
done |
|
415 |
next |
|
416 |
assume as: "a $ 1 < b $ 1 \<and> a $ 2 < b $ 2" |
|
417 |
have int_nem: "{- 1..1::real^2} \<noteq> {}" |
|
418 |
unfolding interval_eq_empty_cart by auto |
|
419 |
guess z |
|
420 |
apply (rule fashoda_unit_path[of "interval_bij (a,b) (- 1,1) \<circ> f" "interval_bij (a,b) (- 1,1) \<circ> g"]) |
|
36432 | 421 |
unfolding path_def path_image_def pathstart_def pathfinish_def |
53627 | 422 |
apply (rule_tac[1-2] continuous_on_compose) |
423 |
apply (rule assms[unfolded path_def] continuous_on_interval_bij)+ |
|
424 |
unfolding subset_eq |
|
425 |
apply(rule_tac[1-2] ballI) |
|
426 |
proof - |
|
427 |
fix x |
|
428 |
assume "x \<in> (interval_bij (a, b) (- 1, 1) \<circ> f) ` {0..1}" |
|
429 |
then guess y |
|
430 |
unfolding image_iff .. note y=this |
|
431 |
show "x \<in> {- 1..1}" |
|
432 |
unfolding y o_def |
|
433 |
apply (rule in_interval_interval_bij) |
|
434 |
using y(1) |
|
435 |
using assms(3)[unfolded path_image_def subset_eq] int_nem |
|
436 |
apply auto |
|
437 |
done |
|
438 |
next |
|
439 |
fix x |
|
440 |
assume "x \<in> (interval_bij (a, b) (- 1, 1) \<circ> g) ` {0..1}" |
|
36432 | 441 |
then guess y unfolding image_iff .. note y=this |
53627 | 442 |
show "x \<in> {- 1..1}" |
443 |
unfolding y o_def |
|
444 |
apply (rule in_interval_interval_bij) |
|
445 |
using y(1) |
|
446 |
using assms(4)[unfolded path_image_def subset_eq] int_nem |
|
447 |
apply auto |
|
448 |
done |
|
449 |
next |
|
450 |
show "(interval_bij (a, b) (- 1, 1) \<circ> f) 0 $ 1 = -1" |
|
451 |
and "(interval_bij (a, b) (- 1, 1) \<circ> f) 1 $ 1 = 1" |
|
452 |
and "(interval_bij (a, b) (- 1, 1) \<circ> g) 0 $ 2 = -1" |
|
453 |
and "(interval_bij (a, b) (- 1, 1) \<circ> g) 1 $ 2 = 1" |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
44647
diff
changeset
|
454 |
using assms as |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
44647
diff
changeset
|
455 |
by (simp_all add: axis_in_Basis cart_eq_inner_axis pathstart_def pathfinish_def interval_bij_def) |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
44647
diff
changeset
|
456 |
(simp_all add: inner_axis) |
53627 | 457 |
qed |
458 |
note z=this |
|
36432 | 459 |
from z(1) guess zf unfolding image_iff .. note zf=this |
460 |
from z(2) guess zg unfolding image_iff .. note zg=this |
|
53627 | 461 |
have *: "\<forall>i. (- 1) $ i < (1::real^2) $ i \<and> a $ i < b $ i" |
462 |
unfolding forall_2 |
|
463 |
using as |
|
464 |
by auto |
|
465 |
show thesis |
|
466 |
apply (rule_tac z="interval_bij (- 1,1) (a,b) z" in that) |
|
467 |
apply (subst zf) |
|
468 |
defer |
|
469 |
apply (subst zg) |
|
470 |
unfolding o_def interval_bij_bij_cart[OF *] path_image_def |
|
471 |
using zf(1) zg(1) |
|
472 |
apply auto |
|
473 |
done |
|
474 |
qed |
|
36432 | 475 |
|
53627 | 476 |
|
477 |
subsection {* Some slightly ad hoc lemmas I use below *} |
|
36432 | 478 |
|
53627 | 479 |
lemma segment_vertical: |
480 |
fixes a :: "real^2" |
|
481 |
assumes "a$1 = b$1" |
|
482 |
shows "x \<in> closed_segment a b \<longleftrightarrow> |
|
483 |
x$1 = a$1 \<and> x$1 = b$1 \<and> (a$2 \<le> x$2 \<and> x$2 \<le> b$2 \<or> b$2 \<le> x$2 \<and> x$2 \<le> a$2)" |
|
484 |
(is "_ = ?R") |
|
485 |
proof - |
|
36432 | 486 |
let ?L = "\<exists>u. (x $ 1 = (1 - u) * a $ 1 + u * b $ 1 \<and> x $ 2 = (1 - u) * a $ 2 + u * b $ 2) \<and> 0 \<le> u \<and> u \<le> 1" |
53627 | 487 |
{ |
488 |
presume "?L \<Longrightarrow> ?R" and "?R \<Longrightarrow> ?L" |
|
489 |
then show ?thesis |
|
490 |
unfolding closed_segment_def mem_Collect_eq |
|
53628 | 491 |
unfolding vec_eq_iff forall_2 scalar_mult_eq_scaleR[symmetric] vector_component_simps |
53627 | 492 |
by blast |
493 |
} |
|
494 |
{ |
|
495 |
assume ?L |
|
496 |
then guess u by (elim exE conjE) note u=this |
|
497 |
{ fix b a |
|
498 |
assume "b + u * a > a + u * b" |
|
499 |
then have "(1 - u) * b > (1 - u) * a" |
|
500 |
by (auto simp add:field_simps) |
|
501 |
then have "b \<ge> a" |
|
502 |
apply (drule_tac mult_less_imp_less_left) |
|
503 |
using u |
|
504 |
apply auto |
|
505 |
done |
|
506 |
then have "u * a \<le> u * b" |
|
507 |
apply - |
|
508 |
apply (rule mult_left_mono[OF _ u(3)]) |
|
509 |
using u(3-4) |
|
510 |
apply (auto simp add: field_simps) |
|
511 |
done |
|
512 |
} note * = this |
|
513 |
{ |
|
514 |
fix a b |
|
515 |
assume "u * b > u * a" |
|
516 |
then have "(1 - u) * a \<le> (1 - u) * b" |
|
517 |
apply - |
|
518 |
apply (rule mult_left_mono) |
|
519 |
apply (drule mult_less_imp_less_left) |
|
520 |
using u |
|
521 |
apply auto |
|
522 |
done |
|
523 |
then have "a + u * b \<le> b + u * a" |
|
524 |
by (auto simp add: field_simps) |
|
525 |
} note ** = this |
|
526 |
then show ?R |
|
527 |
unfolding u assms |
|
528 |
using u |
|
529 |
by (auto simp add:field_simps not_le intro: * **) |
|
530 |
} |
|
531 |
{ |
|
532 |
assume ?R |
|
533 |
then show ?L |
|
534 |
proof (cases "x$2 = b$2") |
|
535 |
case True |
|
536 |
then show ?L |
|
537 |
apply (rule_tac x="(x$2 - a$2) / (b$2 - a$2)" in exI) |
|
538 |
unfolding assms True |
|
539 |
using `?R` |
|
540 |
apply (auto simp add: field_simps) |
|
541 |
done |
|
542 |
next |
|
543 |
case False |
|
544 |
then show ?L |
|
545 |
apply (rule_tac x="1 - (x$2 - b$2) / (a$2 - b$2)" in exI) |
|
546 |
unfolding assms |
|
547 |
using `?R` |
|
548 |
apply (auto simp add: field_simps) |
|
549 |
done |
|
550 |
qed |
|
551 |
} |
|
552 |
qed |
|
36432 | 553 |
|
53627 | 554 |
lemma segment_horizontal: |
555 |
fixes a :: "real^2" |
|
556 |
assumes "a$2 = b$2" |
|
557 |
shows "x \<in> closed_segment a b \<longleftrightarrow> |
|
558 |
x$2 = a$2 \<and> x$2 = b$2 \<and> (a$1 \<le> x$1 \<and> x$1 \<le> b$1 \<or> b$1 \<le> x$1 \<and> x$1 \<le> a$1)" |
|
559 |
(is "_ = ?R") |
|
560 |
proof - |
|
36432 | 561 |
let ?L = "\<exists>u. (x $ 1 = (1 - u) * a $ 1 + u * b $ 1 \<and> x $ 2 = (1 - u) * a $ 2 + u * b $ 2) \<and> 0 \<le> u \<and> u \<le> 1" |
53627 | 562 |
{ |
563 |
presume "?L \<Longrightarrow> ?R" and "?R \<Longrightarrow> ?L" |
|
564 |
then show ?thesis |
|
565 |
unfolding closed_segment_def mem_Collect_eq |
|
53628 | 566 |
unfolding vec_eq_iff forall_2 scalar_mult_eq_scaleR[symmetric] vector_component_simps |
53627 | 567 |
by blast |
568 |
} |
|
569 |
{ |
|
570 |
assume ?L |
|
571 |
then guess u by (elim exE conjE) note u=this |
|
572 |
{ |
|
573 |
fix b a |
|
574 |
assume "b + u * a > a + u * b" |
|
575 |
then have "(1 - u) * b > (1 - u) * a" |
|
53628 | 576 |
by (auto simp add: field_simps) |
53627 | 577 |
then have "b \<ge> a" |
578 |
apply (drule_tac mult_less_imp_less_left) |
|
579 |
using u |
|
580 |
apply auto |
|
581 |
done |
|
582 |
then have "u * a \<le> u * b" |
|
583 |
apply - |
|
584 |
apply (rule mult_left_mono[OF _ u(3)]) |
|
585 |
using u(3-4) |
|
586 |
apply (auto simp add: field_simps) |
|
587 |
done |
|
588 |
} note * = this |
|
589 |
{ |
|
590 |
fix a b |
|
591 |
assume "u * b > u * a" |
|
592 |
then have "(1 - u) * a \<le> (1 - u) * b" |
|
593 |
apply - |
|
594 |
apply (rule mult_left_mono) |
|
595 |
apply (drule mult_less_imp_less_left) |
|
596 |
using u |
|
597 |
apply auto |
|
598 |
done |
|
599 |
then have "a + u * b \<le> b + u * a" |
|
600 |
by (auto simp add: field_simps) |
|
601 |
} note ** = this |
|
602 |
then show ?R |
|
603 |
unfolding u assms |
|
604 |
using u |
|
605 |
by (auto simp add: field_simps not_le intro: * **) |
|
606 |
} |
|
607 |
{ |
|
608 |
assume ?R |
|
609 |
then show ?L |
|
610 |
proof (cases "x$1 = b$1") |
|
611 |
case True |
|
612 |
then show ?L |
|
613 |
apply (rule_tac x="(x$1 - a$1) / (b$1 - a$1)" in exI) |
|
614 |
unfolding assms True |
|
615 |
using `?R` |
|
616 |
apply (auto simp add: field_simps) |
|
617 |
done |
|
618 |
next |
|
619 |
case False |
|
620 |
then show ?L |
|
621 |
apply (rule_tac x="1 - (x$1 - b$1) / (a$1 - b$1)" in exI) |
|
622 |
unfolding assms |
|
623 |
using `?R` |
|
624 |
apply (auto simp add: field_simps) |
|
625 |
done |
|
626 |
qed |
|
627 |
} |
|
628 |
qed |
|
36432 | 629 |
|
53627 | 630 |
|
631 |
subsection {* Useful Fashoda corollary pointed out to me by Tom Hales *} |
|
36432 | 632 |
|
53627 | 633 |
lemma fashoda_interlace: |
634 |
fixes a :: "real^2" |
|
635 |
assumes "path f" |
|
636 |
and "path g" |
|
637 |
and "path_image f \<subseteq> {a..b}" |
|
638 |
and "path_image g \<subseteq> {a..b}" |
|
639 |
and "(pathstart f)$2 = a$2" |
|
640 |
and "(pathfinish f)$2 = a$2" |
|
641 |
and "(pathstart g)$2 = a$2" |
|
642 |
and "(pathfinish g)$2 = a$2" |
|
643 |
and "(pathstart f)$1 < (pathstart g)$1" |
|
644 |
and "(pathstart g)$1 < (pathfinish f)$1" |
|
645 |
and "(pathfinish f)$1 < (pathfinish g)$1" |
|
646 |
obtains z where "z \<in> path_image f" and "z \<in> path_image g" |
|
647 |
proof - |
|
648 |
have "{a..b} \<noteq> {}" |
|
649 |
using path_image_nonempty using assms(3) by auto |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36593
diff
changeset
|
650 |
note ab=this[unfolded interval_eq_empty_cart not_ex forall_2 not_less] |
53628 | 651 |
have "pathstart f \<in> {a..b}" |
652 |
and "pathfinish f \<in> {a..b}" |
|
653 |
and "pathstart g \<in> {a..b}" |
|
654 |
and "pathfinish g \<in> {a..b}" |
|
655 |
using pathstart_in_path_image pathfinish_in_path_image |
|
656 |
using assms(3-4) |
|
657 |
by auto |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36593
diff
changeset
|
658 |
note startfin = this[unfolded mem_interval_cart forall_2] |
36432 | 659 |
let ?P1 = "linepath (vector[a$1 - 2, a$2 - 2]) (vector[(pathstart f)$1,a$2 - 2]) +++ |
660 |
linepath(vector[(pathstart f)$1,a$2 - 2])(pathstart f) +++ f +++ |
|
661 |
linepath(pathfinish f)(vector[(pathfinish f)$1,a$2 - 2]) +++ |
|
662 |
linepath(vector[(pathfinish f)$1,a$2 - 2])(vector[b$1 + 2,a$2 - 2])" |
|
663 |
let ?P2 = "linepath(vector[(pathstart g)$1, (pathstart g)$2 - 3])(pathstart g) +++ g +++ |
|
664 |
linepath(pathfinish g)(vector[(pathfinish g)$1,a$2 - 1]) +++ |
|
665 |
linepath(vector[(pathfinish g)$1,a$2 - 1])(vector[b$1 + 1,a$2 - 1]) +++ |
|
666 |
linepath(vector[b$1 + 1,a$2 - 1])(vector[b$1 + 1,b$2 + 3])" |
|
667 |
let ?a = "vector[a$1 - 2, a$2 - 3]" |
|
668 |
let ?b = "vector[b$1 + 2, b$2 + 3]" |
|
53627 | 669 |
have P1P2: "path_image ?P1 = path_image (linepath (vector[a$1 - 2, a$2 - 2]) (vector[(pathstart f)$1,a$2 - 2])) \<union> |
36432 | 670 |
path_image (linepath(vector[(pathstart f)$1,a$2 - 2])(pathstart f)) \<union> path_image f \<union> |
671 |
path_image (linepath(pathfinish f)(vector[(pathfinish f)$1,a$2 - 2])) \<union> |
|
672 |
path_image (linepath(vector[(pathfinish f)$1,a$2 - 2])(vector[b$1 + 2,a$2 - 2]))" |
|
673 |
"path_image ?P2 = path_image(linepath(vector[(pathstart g)$1, (pathstart g)$2 - 3])(pathstart g)) \<union> path_image g \<union> |
|
674 |
path_image(linepath(pathfinish g)(vector[(pathfinish g)$1,a$2 - 1])) \<union> |
|
675 |
path_image(linepath(vector[(pathfinish g)$1,a$2 - 1])(vector[b$1 + 1,a$2 - 1])) \<union> |
|
676 |
path_image(linepath(vector[b$1 + 1,a$2 - 1])(vector[b$1 + 1,b$2 + 3]))" using assms(1-2) |
|
677 |
by(auto simp add: path_image_join path_linepath) |
|
53627 | 678 |
have abab: "{a..b} \<subseteq> {?a..?b}" |
679 |
by (auto simp add:less_eq_vec_def forall_2 vector_2) |
|
680 |
guess z |
|
681 |
apply (rule fashoda[of ?P1 ?P2 ?a ?b]) |
|
682 |
unfolding pathstart_join pathfinish_join pathstart_linepath pathfinish_linepath vector_2 |
|
683 |
proof - |
|
53628 | 684 |
show "path ?P1" and "path ?P2" |
53627 | 685 |
using assms by auto |
686 |
have "path_image ?P1 \<subseteq> {?a .. ?b}" |
|
687 |
unfolding P1P2 path_image_linepath |
|
688 |
apply (rule Un_least)+ |
|
689 |
defer 3 |
|
690 |
apply (rule_tac[1-4] convex_interval(1)[unfolded convex_contains_segment,rule_format]) |
|
691 |
unfolding mem_interval_cart forall_2 vector_2 |
|
692 |
using ab startfin abab assms(3) |
|
693 |
using assms(9-) |
|
694 |
unfolding assms |
|
695 |
apply (auto simp add: field_simps) |
|
696 |
done |
|
53628 | 697 |
then show "path_image ?P1 \<subseteq> {?a .. ?b}" . |
53627 | 698 |
have "path_image ?P2 \<subseteq> {?a .. ?b}" |
699 |
unfolding P1P2 path_image_linepath |
|
700 |
apply (rule Un_least)+ |
|
701 |
defer 2 |
|
702 |
apply (rule_tac[1-4] convex_interval(1)[unfolded convex_contains_segment,rule_format]) |
|
703 |
unfolding mem_interval_cart forall_2 vector_2 |
|
704 |
using ab startfin abab assms(4) |
|
705 |
using assms(9-) |
|
706 |
unfolding assms |
|
707 |
apply (auto simp add: field_simps) |
|
708 |
done |
|
53628 | 709 |
then show "path_image ?P2 \<subseteq> {?a .. ?b}" . |
53627 | 710 |
show "a $ 1 - 2 = a $ 1 - 2" |
711 |
and "b $ 1 + 2 = b $ 1 + 2" |
|
712 |
and "pathstart g $ 2 - 3 = a $ 2 - 3" |
|
713 |
and "b $ 2 + 3 = b $ 2 + 3" |
|
714 |
by (auto simp add: assms) |
|
53628 | 715 |
qed |
716 |
note z=this[unfolded P1P2 path_image_linepath] |
|
53627 | 717 |
show thesis |
718 |
apply (rule that[of z]) |
|
719 |
proof - |
|
36432 | 720 |
have "(z \<in> closed_segment (vector [a $ 1 - 2, a $ 2 - 2]) (vector [pathstart f $ 1, a $ 2 - 2]) \<or> |
53627 | 721 |
z \<in> closed_segment (vector [pathstart f $ 1, a $ 2 - 2]) (pathstart f)) \<or> |
722 |
z \<in> closed_segment (pathfinish f) (vector [pathfinish f $ 1, a $ 2 - 2]) \<or> |
|
723 |
z \<in> closed_segment (vector [pathfinish f $ 1, a $ 2 - 2]) (vector [b $ 1 + 2, a $ 2 - 2]) \<Longrightarrow> |
|
724 |
(((z \<in> closed_segment (vector [pathstart g $ 1, pathstart g $ 2 - 3]) (pathstart g)) \<or> |
|
725 |
z \<in> closed_segment (pathfinish g) (vector [pathfinish g $ 1, a $ 2 - 1])) \<or> |
|
726 |
z \<in> closed_segment (vector [pathfinish g $ 1, a $ 2 - 1]) (vector [b $ 1 + 1, a $ 2 - 1])) \<or> |
|
727 |
z \<in> closed_segment (vector [b $ 1 + 1, a $ 2 - 1]) (vector [b $ 1 + 1, b $ 2 + 3]) \<Longrightarrow> False" |
|
728 |
apply (simp only: segment_vertical segment_horizontal vector_2) |
|
729 |
proof - |
|
730 |
case goal1 note as=this |
|
731 |
have "pathfinish f \<in> {a..b}" |
|
732 |
using assms(3) pathfinish_in_path_image[of f] by auto |
|
53628 | 733 |
then have "1 + b $ 1 \<le> pathfinish f $ 1 \<Longrightarrow> False" |
53627 | 734 |
unfolding mem_interval_cart forall_2 by auto |
735 |
then have "z$1 \<noteq> pathfinish f$1" |
|
53628 | 736 |
using as(2) |
737 |
using assms ab |
|
738 |
by (auto simp add: field_simps) |
|
53627 | 739 |
moreover have "pathstart f \<in> {a..b}" |
53628 | 740 |
using assms(3) pathstart_in_path_image[of f] |
741 |
by auto |
|
53627 | 742 |
then have "1 + b $ 1 \<le> pathstart f $ 1 \<Longrightarrow> False" |
53628 | 743 |
unfolding mem_interval_cart forall_2 |
744 |
by auto |
|
53627 | 745 |
then have "z$1 \<noteq> pathstart f$1" |
53628 | 746 |
using as(2) using assms ab |
747 |
by (auto simp add: field_simps) |
|
53627 | 748 |
ultimately have *: "z$2 = a$2 - 2" |
53628 | 749 |
using goal1(1) |
750 |
by auto |
|
53627 | 751 |
have "z$1 \<noteq> pathfinish g$1" |
53628 | 752 |
using as(2) |
753 |
using assms ab |
|
754 |
by (auto simp add: field_simps *) |
|
53627 | 755 |
moreover have "pathstart g \<in> {a..b}" |
53628 | 756 |
using assms(4) pathstart_in_path_image[of g] |
757 |
by auto |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36593
diff
changeset
|
758 |
note this[unfolded mem_interval_cart forall_2] |
53627 | 759 |
then have "z$1 \<noteq> pathstart g$1" |
53628 | 760 |
using as(1) |
761 |
using assms ab |
|
762 |
by (auto simp add: field_simps *) |
|
36432 | 763 |
ultimately have "a $ 2 - 1 \<le> z $ 2 \<and> z $ 2 \<le> b $ 2 + 3 \<or> b $ 2 + 3 \<le> z $ 2 \<and> z $ 2 \<le> a $ 2 - 1" |
53628 | 764 |
using as(2) |
765 |
unfolding * assms |
|
766 |
by (auto simp add: field_simps) |
|
53627 | 767 |
then show False |
768 |
unfolding * using ab by auto |
|
769 |
qed |
|
770 |
then have "z \<in> path_image f \<or> z \<in> path_image g" |
|
771 |
using z unfolding Un_iff by blast |
|
772 |
then have z': "z \<in> {a..b}" |
|
53628 | 773 |
using assms(3-4) |
774 |
by auto |
|
53627 | 775 |
have "a $ 2 = z $ 2 \<Longrightarrow> (z $ 1 = pathstart f $ 1 \<or> z $ 1 = pathfinish f $ 1) \<Longrightarrow> |
776 |
z = pathstart f \<or> z = pathfinish f" |
|
53628 | 777 |
unfolding vec_eq_iff forall_2 assms |
778 |
by auto |
|
53627 | 779 |
with z' show "z \<in> path_image f" |
780 |
using z(1) |
|
781 |
unfolding Un_iff mem_interval_cart forall_2 |
|
782 |
apply - |
|
783 |
apply (simp only: segment_vertical segment_horizontal vector_2) |
|
784 |
unfolding assms |
|
785 |
apply auto |
|
786 |
done |
|
787 |
have "a $ 2 = z $ 2 \<Longrightarrow> (z $ 1 = pathstart g $ 1 \<or> z $ 1 = pathfinish g $ 1) \<Longrightarrow> |
|
788 |
z = pathstart g \<or> z = pathfinish g" |
|
53628 | 789 |
unfolding vec_eq_iff forall_2 assms |
790 |
by auto |
|
53627 | 791 |
with z' show "z \<in> path_image g" |
792 |
using z(2) |
|
793 |
unfolding Un_iff mem_interval_cart forall_2 |
|
794 |
apply (simp only: segment_vertical segment_horizontal vector_2) |
|
795 |
unfolding assms |
|
796 |
apply auto |
|
797 |
done |
|
798 |
qed |
|
799 |
qed |
|
36432 | 800 |
|
801 |
(** The Following still needs to be translated. Maybe I will do that later. |
|
802 |
||
803 |
(* ------------------------------------------------------------------------- *) |
|
804 |
(* Complement in dimension N >= 2 of set homeomorphic to any interval in *) |
|
805 |
(* any dimension is (path-)connected. This naively generalizes the argument *) |
|
806 |
(* in Ryuji Maehara's paper "The Jordan curve theorem via the Brouwer *) |
|
807 |
(* fixed point theorem", American Mathematical Monthly 1984. *) |
|
808 |
(* ------------------------------------------------------------------------- *) |
|
809 |
||
810 |
let RETRACTION_INJECTIVE_IMAGE_INTERVAL = prove |
|
811 |
(`!p:real^M->real^N a b. |
|
812 |
~(interval[a,b] = {}) /\ |
|
813 |
p continuous_on interval[a,b] /\ |
|
814 |
(!x y. x IN interval[a,b] /\ y IN interval[a,b] /\ p x = p y ==> x = y) |
|
815 |
==> ?f. f continuous_on (:real^N) /\ |
|
816 |
IMAGE f (:real^N) SUBSET (IMAGE p (interval[a,b])) /\ |
|
817 |
(!x. x IN (IMAGE p (interval[a,b])) ==> f x = x)`, |
|
818 |
REPEAT STRIP_TAC THEN |
|
819 |
FIRST_ASSUM(MP_TAC o GEN_REWRITE_RULE I [INJECTIVE_ON_LEFT_INVERSE]) THEN |
|
820 |
DISCH_THEN(X_CHOOSE_TAC `q:real^N->real^M`) THEN |
|
821 |
SUBGOAL_THEN `(q:real^N->real^M) continuous_on |
|
822 |
(IMAGE p (interval[a:real^M,b]))` |
|
823 |
ASSUME_TAC THENL |
|
824 |
[MATCH_MP_TAC CONTINUOUS_ON_INVERSE THEN ASM_REWRITE_TAC[COMPACT_INTERVAL]; |
|
825 |
ALL_TAC] THEN |
|
826 |
MP_TAC(ISPECL [`q:real^N->real^M`; |
|
827 |
`IMAGE (p:real^M->real^N) |
|
828 |
(interval[a,b])`; |
|
829 |
`a:real^M`; `b:real^M`] |
|
830 |
TIETZE_CLOSED_INTERVAL) THEN |
|
831 |
ASM_SIMP_TAC[COMPACT_INTERVAL; COMPACT_CONTINUOUS_IMAGE; |
|
832 |
COMPACT_IMP_CLOSED] THEN |
|
833 |
ANTS_TAC THENL [ASM SET_TAC[]; ALL_TAC] THEN |
|
834 |
DISCH_THEN(X_CHOOSE_THEN `r:real^N->real^M` STRIP_ASSUME_TAC) THEN |
|
835 |
EXISTS_TAC `(p:real^M->real^N) o (r:real^N->real^M)` THEN |
|
836 |
REWRITE_TAC[SUBSET; FORALL_IN_IMAGE; o_THM; IN_UNIV] THEN |
|
837 |
CONJ_TAC THENL [ALL_TAC; ASM SET_TAC[]] THEN |
|
838 |
MATCH_MP_TAC CONTINUOUS_ON_COMPOSE THEN ASM_REWRITE_TAC[] THEN |
|
839 |
FIRST_X_ASSUM(MATCH_MP_TAC o MATCH_MP(REWRITE_RULE[IMP_CONJ] |
|
840 |
CONTINUOUS_ON_SUBSET)) THEN ASM SET_TAC[]);; |
|
841 |
||
842 |
let UNBOUNDED_PATH_COMPONENTS_COMPLEMENT_HOMEOMORPHIC_INTERVAL = prove |
|
843 |
(`!s:real^N->bool a b:real^M. |
|
844 |
s homeomorphic (interval[a,b]) |
|
845 |
==> !x. ~(x IN s) ==> ~bounded(path_component((:real^N) DIFF s) x)`, |
|
846 |
REPEAT GEN_TAC THEN REWRITE_TAC[homeomorphic; homeomorphism] THEN |
|
847 |
REWRITE_TAC[LEFT_IMP_EXISTS_THM] THEN |
|
848 |
MAP_EVERY X_GEN_TAC [`p':real^N->real^M`; `p:real^M->real^N`] THEN |
|
849 |
DISCH_TAC THEN |
|
850 |
SUBGOAL_THEN |
|
851 |
`!x y. x IN interval[a,b] /\ y IN interval[a,b] /\ |
|
852 |
(p:real^M->real^N) x = p y ==> x = y` |
|
853 |
ASSUME_TAC THENL [ASM_MESON_TAC[]; ALL_TAC] THEN |
|
854 |
FIRST_X_ASSUM(MP_TAC o funpow 4 CONJUNCT2) THEN |
|
855 |
DISCH_THEN(CONJUNCTS_THEN2 (SUBST1_TAC o SYM) ASSUME_TAC) THEN |
|
856 |
ASM_CASES_TAC `interval[a:real^M,b] = {}` THEN |
|
857 |
ASM_REWRITE_TAC[IMAGE_CLAUSES; DIFF_EMPTY; PATH_COMPONENT_UNIV; |
|
858 |
NOT_BOUNDED_UNIV] THEN |
|
859 |
ABBREV_TAC `s = (:real^N) DIFF (IMAGE p (interval[a:real^M,b]))` THEN |
|
860 |
X_GEN_TAC `c:real^N` THEN REPEAT STRIP_TAC THEN |
|
861 |
SUBGOAL_THEN `(c:real^N) IN s` ASSUME_TAC THENL [ASM SET_TAC[]; ALL_TAC] THEN |
|
862 |
SUBGOAL_THEN `bounded((path_component s c) UNION |
|
863 |
(IMAGE (p:real^M->real^N) (interval[a,b])))` |
|
864 |
MP_TAC THENL |
|
865 |
[ASM_SIMP_TAC[BOUNDED_UNION; COMPACT_IMP_BOUNDED; COMPACT_IMP_BOUNDED; |
|
866 |
COMPACT_CONTINUOUS_IMAGE; COMPACT_INTERVAL]; |
|
867 |
ALL_TAC] THEN |
|
868 |
DISCH_THEN(MP_TAC o SPEC `c:real^N` o MATCH_MP BOUNDED_SUBSET_BALL) THEN |
|
869 |
REWRITE_TAC[UNION_SUBSET] THEN |
|
870 |
DISCH_THEN(X_CHOOSE_THEN `B:real` STRIP_ASSUME_TAC) THEN |
|
871 |
MP_TAC(ISPECL [`p:real^M->real^N`; `a:real^M`; `b:real^M`] |
|
872 |
RETRACTION_INJECTIVE_IMAGE_INTERVAL) THEN |
|
873 |
ASM_REWRITE_TAC[SUBSET; IN_UNIV] THEN |
|
874 |
DISCH_THEN(X_CHOOSE_THEN `r:real^N->real^N` MP_TAC) THEN |
|
875 |
DISCH_THEN(CONJUNCTS_THEN2 ASSUME_TAC |
|
876 |
(CONJUNCTS_THEN2 MP_TAC ASSUME_TAC)) THEN |
|
877 |
REWRITE_TAC[FORALL_IN_IMAGE; IN_UNIV] THEN DISCH_TAC THEN |
|
878 |
ABBREV_TAC `q = \z:real^N. if z IN path_component s c then r(z) else z` THEN |
|
879 |
SUBGOAL_THEN |
|
880 |
`(q:real^N->real^N) continuous_on |
|
881 |
(closure(path_component s c) UNION ((:real^N) DIFF (path_component s c)))` |
|
882 |
MP_TAC THENL |
|
883 |
[EXPAND_TAC "q" THEN MATCH_MP_TAC CONTINUOUS_ON_CASES THEN |
|
884 |
REWRITE_TAC[CLOSED_CLOSURE; CONTINUOUS_ON_ID; GSYM OPEN_CLOSED] THEN |
|
885 |
REPEAT CONJ_TAC THENL |
|
886 |
[MATCH_MP_TAC OPEN_PATH_COMPONENT THEN EXPAND_TAC "s" THEN |
|
887 |
ASM_SIMP_TAC[GSYM CLOSED_OPEN; COMPACT_IMP_CLOSED; |
|
888 |
COMPACT_CONTINUOUS_IMAGE; COMPACT_INTERVAL]; |
|
889 |
ASM_MESON_TAC[CONTINUOUS_ON_SUBSET; SUBSET_UNIV]; |
|
890 |
ALL_TAC] THEN |
|
891 |
X_GEN_TAC `z:real^N` THEN |
|
892 |
REWRITE_TAC[SET_RULE `~(z IN (s DIFF t) /\ z IN t)`] THEN |
|
893 |
STRIP_TAC THEN FIRST_X_ASSUM MATCH_MP_TAC THEN |
|
894 |
MP_TAC(ISPECL |
|
895 |
[`path_component s (z:real^N)`; `path_component s (c:real^N)`] |
|
896 |
OPEN_INTER_CLOSURE_EQ_EMPTY) THEN |
|
897 |
ASM_REWRITE_TAC[GSYM DISJOINT; PATH_COMPONENT_DISJOINT] THEN ANTS_TAC THENL |
|
898 |
[MATCH_MP_TAC OPEN_PATH_COMPONENT THEN EXPAND_TAC "s" THEN |
|
899 |
ASM_SIMP_TAC[GSYM CLOSED_OPEN; COMPACT_IMP_CLOSED; |
|
900 |
COMPACT_CONTINUOUS_IMAGE; COMPACT_INTERVAL]; |
|
901 |
REWRITE_TAC[DISJOINT; EXTENSION; IN_INTER; NOT_IN_EMPTY] THEN |
|
902 |
DISCH_THEN(MP_TAC o SPEC `z:real^N`) THEN ASM_REWRITE_TAC[] THEN |
|
903 |
GEN_REWRITE_TAC (LAND_CONV o ONCE_DEPTH_CONV) [IN] THEN |
|
904 |
REWRITE_TAC[PATH_COMPONENT_REFL_EQ] THEN ASM SET_TAC[]]; |
|
905 |
ALL_TAC] THEN |
|
906 |
SUBGOAL_THEN |
|
907 |
`closure(path_component s c) UNION ((:real^N) DIFF (path_component s c)) = |
|
908 |
(:real^N)` |
|
909 |
SUBST1_TAC THENL |
|
910 |
[MATCH_MP_TAC(SET_RULE `s SUBSET t ==> t UNION (UNIV DIFF s) = UNIV`) THEN |
|
911 |
REWRITE_TAC[CLOSURE_SUBSET]; |
|
912 |
DISCH_TAC] THEN |
|
913 |
MP_TAC(ISPECL |
|
914 |
[`(\x. &2 % c - x) o |
|
915 |
(\x. c + B / norm(x - c) % (x - c)) o (q:real^N->real^N)`; |
|
916 |
`cball(c:real^N,B)`] |
|
917 |
BROUWER) THEN |
|
918 |
REWRITE_TAC[NOT_IMP; GSYM CONJ_ASSOC; COMPACT_CBALL; CONVEX_CBALL] THEN |
|
919 |
ASM_SIMP_TAC[CBALL_EQ_EMPTY; REAL_LT_IMP_LE; REAL_NOT_LT] THEN |
|
920 |
SUBGOAL_THEN `!x. ~((q:real^N->real^N) x = c)` ASSUME_TAC THENL |
|
921 |
[X_GEN_TAC `x:real^N` THEN EXPAND_TAC "q" THEN |
|
922 |
REWRITE_TAC[NORM_EQ_0; VECTOR_SUB_EQ] THEN COND_CASES_TAC THEN |
|
923 |
ASM SET_TAC[PATH_COMPONENT_REFL_EQ]; |
|
924 |
ALL_TAC] THEN |
|
925 |
REPEAT CONJ_TAC THENL |
|
926 |
[MATCH_MP_TAC CONTINUOUS_ON_COMPOSE THEN |
|
927 |
SIMP_TAC[CONTINUOUS_ON_SUB; CONTINUOUS_ON_ID; CONTINUOUS_ON_CONST] THEN |
|
928 |
MATCH_MP_TAC CONTINUOUS_ON_COMPOSE THEN CONJ_TAC THENL |
|
929 |
[ASM_MESON_TAC[CONTINUOUS_ON_SUBSET; SUBSET_UNIV]; ALL_TAC] THEN |
|
930 |
MATCH_MP_TAC CONTINUOUS_ON_ADD THEN REWRITE_TAC[CONTINUOUS_ON_CONST] THEN |
|
931 |
MATCH_MP_TAC CONTINUOUS_ON_MUL THEN |
|
932 |
SIMP_TAC[CONTINUOUS_ON_SUB; CONTINUOUS_ON_ID; CONTINUOUS_ON_CONST] THEN |
|
933 |
REWRITE_TAC[o_DEF; real_div; LIFT_CMUL] THEN |
|
934 |
MATCH_MP_TAC CONTINUOUS_ON_CMUL THEN |
|
935 |
MATCH_MP_TAC(REWRITE_RULE[o_DEF] CONTINUOUS_ON_INV) THEN |
|
936 |
ASM_REWRITE_TAC[FORALL_IN_IMAGE; NORM_EQ_0; VECTOR_SUB_EQ] THEN |
|
937 |
SUBGOAL_THEN |
|
938 |
`(\x:real^N. lift(norm(x - c))) = (lift o norm) o (\x. x - c)` |
|
939 |
SUBST1_TAC THENL [REWRITE_TAC[o_DEF]; ALL_TAC] THEN |
|
940 |
MATCH_MP_TAC CONTINUOUS_ON_COMPOSE THEN |
|
941 |
ASM_SIMP_TAC[CONTINUOUS_ON_SUB; CONTINUOUS_ON_ID; CONTINUOUS_ON_CONST; |
|
942 |
CONTINUOUS_ON_LIFT_NORM]; |
|
943 |
REWRITE_TAC[SUBSET; FORALL_IN_IMAGE; IN_CBALL; o_THM; dist] THEN |
|
944 |
X_GEN_TAC `x:real^N` THEN DISCH_TAC THEN |
|
945 |
REWRITE_TAC[VECTOR_ARITH `c - (&2 % c - (c + x)) = x`] THEN |
|
946 |
REWRITE_TAC[NORM_MUL; REAL_ABS_DIV; REAL_ABS_NORM] THEN |
|
947 |
ASM_SIMP_TAC[REAL_DIV_RMUL; NORM_EQ_0; VECTOR_SUB_EQ] THEN |
|
948 |
ASM_REAL_ARITH_TAC; |
|
949 |
REWRITE_TAC[NOT_EXISTS_THM; TAUT `~(c /\ b) <=> c ==> ~b`] THEN |
|
950 |
REWRITE_TAC[IN_CBALL; o_THM; dist] THEN |
|
951 |
X_GEN_TAC `x:real^N` THEN DISCH_TAC THEN |
|
952 |
REWRITE_TAC[VECTOR_ARITH `&2 % c - (c + x') = x <=> --x' = x - c`] THEN |
|
953 |
ASM_CASES_TAC `(x:real^N) IN path_component s c` THENL |
|
954 |
[MATCH_MP_TAC(NORM_ARITH `norm(y) < B /\ norm(x) = B ==> ~(--x = y)`) THEN |
|
955 |
REWRITE_TAC[NORM_MUL; REAL_ABS_DIV; REAL_ABS_NORM] THEN |
|
956 |
ASM_SIMP_TAC[REAL_DIV_RMUL; NORM_EQ_0; VECTOR_SUB_EQ] THEN |
|
957 |
ASM_SIMP_TAC[REAL_ARITH `&0 < B ==> abs B = B`] THEN |
|
958 |
UNDISCH_TAC `path_component s c SUBSET ball(c:real^N,B)` THEN |
|
959 |
REWRITE_TAC[SUBSET; IN_BALL] THEN ASM_MESON_TAC[dist; NORM_SUB]; |
|
960 |
EXPAND_TAC "q" THEN REWRITE_TAC[] THEN ASM_REWRITE_TAC[] THEN |
|
961 |
REWRITE_TAC[VECTOR_ARITH `--(c % x) = x <=> (&1 + c) % x = vec 0`] THEN |
|
962 |
ASM_REWRITE_TAC[DE_MORGAN_THM; VECTOR_SUB_EQ; VECTOR_MUL_EQ_0] THEN |
|
963 |
SUBGOAL_THEN `~(x:real^N = c)` ASSUME_TAC THENL |
|
964 |
[ASM_MESON_TAC[PATH_COMPONENT_REFL; IN]; ALL_TAC] THEN |
|
965 |
ASM_REWRITE_TAC[] THEN |
|
966 |
MATCH_MP_TAC(REAL_ARITH `&0 < x ==> ~(&1 + x = &0)`) THEN |
|
967 |
ASM_SIMP_TAC[REAL_LT_DIV; NORM_POS_LT; VECTOR_SUB_EQ]]]);; |
|
968 |
||
969 |
let PATH_CONNECTED_COMPLEMENT_HOMEOMORPHIC_INTERVAL = prove |
|
970 |
(`!s:real^N->bool a b:real^M. |
|
971 |
2 <= dimindex(:N) /\ s homeomorphic interval[a,b] |
|
972 |
==> path_connected((:real^N) DIFF s)`, |
|
973 |
REPEAT STRIP_TAC THEN REWRITE_TAC[PATH_CONNECTED_IFF_PATH_COMPONENT] THEN |
|
974 |
FIRST_ASSUM(MP_TAC o MATCH_MP |
|
975 |
UNBOUNDED_PATH_COMPONENTS_COMPLEMENT_HOMEOMORPHIC_INTERVAL) THEN |
|
976 |
ASM_REWRITE_TAC[SET_RULE `~(x IN s) <=> x IN (UNIV DIFF s)`] THEN |
|
977 |
ABBREV_TAC `t = (:real^N) DIFF s` THEN |
|
978 |
DISCH_TAC THEN MAP_EVERY X_GEN_TAC [`x:real^N`; `y:real^N`] THEN |
|
979 |
STRIP_TAC THEN FIRST_ASSUM(MP_TAC o MATCH_MP HOMEOMORPHIC_COMPACTNESS) THEN |
|
980 |
REWRITE_TAC[COMPACT_INTERVAL] THEN |
|
981 |
DISCH_THEN(MP_TAC o MATCH_MP COMPACT_IMP_BOUNDED) THEN |
|
982 |
REWRITE_TAC[BOUNDED_POS; LEFT_IMP_EXISTS_THM] THEN |
|
983 |
X_GEN_TAC `B:real` THEN STRIP_TAC THEN |
|
984 |
SUBGOAL_THEN `(?u:real^N. u IN path_component t x /\ B < norm(u)) /\ |
|
985 |
(?v:real^N. v IN path_component t y /\ B < norm(v))` |
|
986 |
STRIP_ASSUME_TAC THENL |
|
987 |
[ASM_MESON_TAC[BOUNDED_POS; REAL_NOT_LE]; ALL_TAC] THEN |
|
988 |
MATCH_MP_TAC PATH_COMPONENT_TRANS THEN EXISTS_TAC `u:real^N` THEN |
|
989 |
CONJ_TAC THENL [ASM_MESON_TAC[IN]; ALL_TAC] THEN |
|
990 |
MATCH_MP_TAC PATH_COMPONENT_SYM THEN |
|
991 |
MATCH_MP_TAC PATH_COMPONENT_TRANS THEN EXISTS_TAC `v:real^N` THEN |
|
992 |
CONJ_TAC THENL [ASM_MESON_TAC[IN]; ALL_TAC] THEN |
|
993 |
MATCH_MP_TAC PATH_COMPONENT_OF_SUBSET THEN |
|
994 |
EXISTS_TAC `(:real^N) DIFF cball(vec 0,B)` THEN CONJ_TAC THENL |
|
995 |
[EXPAND_TAC "t" THEN MATCH_MP_TAC(SET_RULE |
|
996 |
`s SUBSET t ==> (u DIFF t) SUBSET (u DIFF s)`) THEN |
|
997 |
ASM_REWRITE_TAC[SUBSET; IN_CBALL_0]; |
|
998 |
MP_TAC(ISPEC `cball(vec 0:real^N,B)` |
|
999 |
PATH_CONNECTED_COMPLEMENT_BOUNDED_CONVEX) THEN |
|
1000 |
ASM_REWRITE_TAC[BOUNDED_CBALL; CONVEX_CBALL] THEN |
|
1001 |
REWRITE_TAC[PATH_CONNECTED_IFF_PATH_COMPONENT] THEN |
|
1002 |
DISCH_THEN MATCH_MP_TAC THEN |
|
1003 |
ASM_REWRITE_TAC[IN_DIFF; IN_UNIV; IN_CBALL_0; REAL_NOT_LE]]);; |
|
1004 |
||
1005 |
(* ------------------------------------------------------------------------- *) |
|
1006 |
(* In particular, apply all these to the special case of an arc. *) |
|
1007 |
(* ------------------------------------------------------------------------- *) |
|
1008 |
||
1009 |
let RETRACTION_ARC = prove |
|
1010 |
(`!p. arc p |
|
1011 |
==> ?f. f continuous_on (:real^N) /\ |
|
1012 |
IMAGE f (:real^N) SUBSET path_image p /\ |
|
1013 |
(!x. x IN path_image p ==> f x = x)`, |
|
1014 |
REWRITE_TAC[arc; path; path_image] THEN REPEAT STRIP_TAC THEN |
|
1015 |
MATCH_MP_TAC RETRACTION_INJECTIVE_IMAGE_INTERVAL THEN |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36593
diff
changeset
|
1016 |
ASM_REWRITE_TAC[INTERVAL_EQ_EMPTY_CART_1; DROP_VEC; REAL_NOT_LT; REAL_POS]);; |
36432 | 1017 |
|
1018 |
let PATH_CONNECTED_ARC_COMPLEMENT = prove |
|
1019 |
(`!p. 2 <= dimindex(:N) /\ arc p |
|
1020 |
==> path_connected((:real^N) DIFF path_image p)`, |
|
1021 |
REWRITE_TAC[arc; path] THEN REPEAT STRIP_TAC THEN SIMP_TAC[path_image] THEN |
|
1022 |
MP_TAC(ISPECL [`path_image p:real^N->bool`; `vec 0:real^1`; `vec 1:real^1`] |
|
1023 |
PATH_CONNECTED_COMPLEMENT_HOMEOMORPHIC_INTERVAL) THEN |
|
1024 |
ASM_REWRITE_TAC[path_image] THEN DISCH_THEN MATCH_MP_TAC THEN |
|
1025 |
ONCE_REWRITE_TAC[HOMEOMORPHIC_SYM] THEN |
|
1026 |
MATCH_MP_TAC HOMEOMORPHIC_COMPACT THEN |
|
1027 |
EXISTS_TAC `p:real^1->real^N` THEN ASM_REWRITE_TAC[COMPACT_INTERVAL]);; |
|
1028 |
||
1029 |
let CONNECTED_ARC_COMPLEMENT = prove |
|
1030 |
(`!p. 2 <= dimindex(:N) /\ arc p |
|
1031 |
==> connected((:real^N) DIFF path_image p)`, |
|
1032 |
SIMP_TAC[PATH_CONNECTED_ARC_COMPLEMENT; PATH_CONNECTED_IMP_CONNECTED]);; *) |
|
1033 |
||
1034 |
end |