author | hoelzl |
Tue, 26 Mar 2013 12:20:59 +0100 | |
changeset 51528 | 66c3a7589de7 |
parent 51481 | ef949192e5d6 |
child 53593 | a7bcbb5a17d8 |
permissions | -rw-r--r-- |
41959 | 1 |
(* Title: HOL/Multivariate_Analysis/Path_Connected.thy |
36583 | 2 |
Author: Robert Himmelmann, TU Muenchen |
3 |
*) |
|
4 |
||
5 |
header {* Continuous paths and path-connected sets *} |
|
6 |
||
7 |
theory Path_Connected |
|
37674
f86de9c00c47
convert theorem path_connected_sphere to euclidean_space class
huffman
parents:
37489
diff
changeset
|
8 |
imports Convex_Euclidean_Space |
36583 | 9 |
begin |
10 |
||
11 |
subsection {* Paths. *} |
|
12 |
||
49653 | 13 |
definition path :: "(real \<Rightarrow> 'a::topological_space) \<Rightarrow> bool" |
36583 | 14 |
where "path g \<longleftrightarrow> continuous_on {0 .. 1} g" |
15 |
||
49653 | 16 |
definition pathstart :: "(real \<Rightarrow> 'a::topological_space) \<Rightarrow> 'a" |
36583 | 17 |
where "pathstart g = g 0" |
18 |
||
49653 | 19 |
definition pathfinish :: "(real \<Rightarrow> 'a::topological_space) \<Rightarrow> 'a" |
36583 | 20 |
where "pathfinish g = g 1" |
21 |
||
49653 | 22 |
definition path_image :: "(real \<Rightarrow> 'a::topological_space) \<Rightarrow> 'a set" |
36583 | 23 |
where "path_image g = g ` {0 .. 1}" |
24 |
||
49653 | 25 |
definition reversepath :: "(real \<Rightarrow> 'a::topological_space) \<Rightarrow> (real \<Rightarrow> 'a)" |
36583 | 26 |
where "reversepath g = (\<lambda>x. g(1 - x))" |
27 |
||
49653 | 28 |
definition joinpaths :: "(real \<Rightarrow> 'a::topological_space) \<Rightarrow> (real \<Rightarrow> 'a) \<Rightarrow> (real \<Rightarrow> 'a)" |
36583 | 29 |
(infixr "+++" 75) |
30 |
where "g1 +++ g2 = (\<lambda>x. if x \<le> 1/2 then g1 (2 * x) else g2 (2 * x - 1))" |
|
31 |
||
49653 | 32 |
definition simple_path :: "(real \<Rightarrow> 'a::topological_space) \<Rightarrow> bool" |
36583 | 33 |
where "simple_path g \<longleftrightarrow> |
49653 | 34 |
(\<forall>x\<in>{0..1}. \<forall>y\<in>{0..1}. g x = g y \<longrightarrow> x = y \<or> x = 0 \<and> y = 1 \<or> x = 1 \<and> y = 0)" |
36583 | 35 |
|
49653 | 36 |
definition injective_path :: "(real \<Rightarrow> 'a::topological_space) \<Rightarrow> bool" |
36583 | 37 |
where "injective_path g \<longleftrightarrow> (\<forall>x\<in>{0..1}. \<forall>y\<in>{0..1}. g x = g y \<longrightarrow> x = y)" |
38 |
||
49653 | 39 |
|
36583 | 40 |
subsection {* Some lemmas about these concepts. *} |
41 |
||
49653 | 42 |
lemma injective_imp_simple_path: "injective_path g \<Longrightarrow> simple_path g" |
36583 | 43 |
unfolding injective_path_def simple_path_def by auto |
44 |
||
45 |
lemma path_image_nonempty: "path_image g \<noteq> {}" |
|
46 |
unfolding path_image_def image_is_empty interval_eq_empty by auto |
|
47 |
||
48 |
lemma pathstart_in_path_image[intro]: "(pathstart g) \<in> path_image g" |
|
49 |
unfolding pathstart_def path_image_def by auto |
|
50 |
||
51 |
lemma pathfinish_in_path_image[intro]: "(pathfinish g) \<in> path_image g" |
|
52 |
unfolding pathfinish_def path_image_def by auto |
|
53 |
||
54 |
lemma connected_path_image[intro]: "path g \<Longrightarrow> connected(path_image g)" |
|
55 |
unfolding path_def path_image_def |
|
56 |
apply (erule connected_continuous_image) |
|
49653 | 57 |
apply (rule convex_connected, rule convex_real_interval) |
58 |
done |
|
36583 | 59 |
|
50935
cfdf19d3ca32
generalize compact_path_image to topological_space
hoelzl
parents:
50884
diff
changeset
|
60 |
lemma compact_path_image[intro]: "path g \<Longrightarrow> compact(path_image g)" |
36583 | 61 |
unfolding path_def path_image_def |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36583
diff
changeset
|
62 |
by (erule compact_continuous_image, rule compact_interval) |
36583 | 63 |
|
64 |
lemma reversepath_reversepath[simp]: "reversepath(reversepath g) = g" |
|
65 |
unfolding reversepath_def by auto |
|
66 |
||
67 |
lemma pathstart_reversepath[simp]: "pathstart(reversepath g) = pathfinish g" |
|
68 |
unfolding pathstart_def reversepath_def pathfinish_def by auto |
|
69 |
||
70 |
lemma pathfinish_reversepath[simp]: "pathfinish(reversepath g) = pathstart g" |
|
71 |
unfolding pathstart_def reversepath_def pathfinish_def by auto |
|
72 |
||
49653 | 73 |
lemma pathstart_join[simp]: "pathstart (g1 +++ g2) = pathstart g1" |
36583 | 74 |
unfolding pathstart_def joinpaths_def pathfinish_def by auto |
75 |
||
49653 | 76 |
lemma pathfinish_join[simp]: "pathfinish (g1 +++ g2) = pathfinish g2" |
36583 | 77 |
unfolding pathstart_def joinpaths_def pathfinish_def by auto |
78 |
||
49653 | 79 |
lemma path_image_reversepath[simp]: "path_image(reversepath g) = path_image g" |
80 |
proof - |
|
81 |
have *: "\<And>g. path_image(reversepath g) \<subseteq> path_image g" |
|
82 |
unfolding path_image_def subset_eq reversepath_def Ball_def image_iff |
|
83 |
apply(rule,rule,erule bexE) |
|
84 |
apply(rule_tac x="1 - xa" in bexI) |
|
85 |
apply auto |
|
86 |
done |
|
87 |
show ?thesis |
|
88 |
using *[of g] *[of "reversepath g"] |
|
89 |
unfolding reversepath_reversepath by auto |
|
90 |
qed |
|
36583 | 91 |
|
49653 | 92 |
lemma path_reversepath[simp]: "path (reversepath g) \<longleftrightarrow> path g" |
93 |
proof - |
|
94 |
have *: "\<And>g. path g \<Longrightarrow> path (reversepath g)" |
|
95 |
unfolding path_def reversepath_def |
|
96 |
apply (rule continuous_on_compose[unfolded o_def, of _ "\<lambda>x. 1 - x"]) |
|
97 |
apply (intro continuous_on_intros) |
|
98 |
apply (rule continuous_on_subset[of "{0..1}"], assumption) |
|
99 |
apply auto |
|
100 |
done |
|
101 |
show ?thesis |
|
102 |
using *[of "reversepath g"] *[of g] |
|
103 |
unfolding reversepath_reversepath |
|
104 |
by (rule iffI) |
|
105 |
qed |
|
106 |
||
107 |
lemmas reversepath_simps = |
|
108 |
path_reversepath path_image_reversepath pathstart_reversepath pathfinish_reversepath |
|
36583 | 109 |
|
49653 | 110 |
lemma path_join[simp]: |
111 |
assumes "pathfinish g1 = pathstart g2" |
|
112 |
shows "path (g1 +++ g2) \<longleftrightarrow> path g1 \<and> path g2" |
|
113 |
unfolding path_def pathfinish_def pathstart_def |
|
51478
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
50935
diff
changeset
|
114 |
proof safe |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
50935
diff
changeset
|
115 |
assume cont: "continuous_on {0..1} (g1 +++ g2)" |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
50935
diff
changeset
|
116 |
have g1: "continuous_on {0..1} g1 \<longleftrightarrow> continuous_on {0..1} ((g1 +++ g2) \<circ> (\<lambda>x. x / 2))" |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
50935
diff
changeset
|
117 |
by (intro continuous_on_cong refl) (auto simp: joinpaths_def) |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
50935
diff
changeset
|
118 |
have g2: "continuous_on {0..1} g2 \<longleftrightarrow> continuous_on {0..1} ((g1 +++ g2) \<circ> (\<lambda>x. x / 2 + 1/2))" |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
50935
diff
changeset
|
119 |
using assms by (intro continuous_on_cong refl) (auto simp: joinpaths_def pathfinish_def pathstart_def) |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
50935
diff
changeset
|
120 |
show "continuous_on {0..1} g1" "continuous_on {0..1} g2" |
51481
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents:
51478
diff
changeset
|
121 |
unfolding g1 g2 |
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents:
51478
diff
changeset
|
122 |
by (auto intro!: continuous_on_intros continuous_on_subset[OF cont] simp del: o_apply) |
51478
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
50935
diff
changeset
|
123 |
next |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
50935
diff
changeset
|
124 |
assume g1g2: "continuous_on {0..1} g1" "continuous_on {0..1} g2" |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
50935
diff
changeset
|
125 |
have 01: "{0 .. 1} = {0..1/2} \<union> {1/2 .. 1::real}" |
36583 | 126 |
by auto |
51478
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
50935
diff
changeset
|
127 |
{ fix x :: real assume "0 \<le> x" "x \<le> 1" then have "x \<in> (\<lambda>x. x * 2) ` {0..1 / 2}" |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
50935
diff
changeset
|
128 |
by (intro image_eqI[where x="x/2"]) auto } |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
50935
diff
changeset
|
129 |
note 1 = this |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
50935
diff
changeset
|
130 |
{ fix x :: real assume "0 \<le> x" "x \<le> 1" then have "x \<in> (\<lambda>x. x * 2 - 1) ` {1 / 2..1}" |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
50935
diff
changeset
|
131 |
by (intro image_eqI[where x="x/2 + 1/2"]) auto } |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
50935
diff
changeset
|
132 |
note 2 = this |
49653 | 133 |
show "continuous_on {0..1} (g1 +++ g2)" |
51478
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
50935
diff
changeset
|
134 |
using assms unfolding joinpaths_def 01 |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
50935
diff
changeset
|
135 |
by (intro continuous_on_cases closed_atLeastAtMost g1g2[THEN continuous_on_compose2] continuous_on_intros) |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
50935
diff
changeset
|
136 |
(auto simp: field_simps pathfinish_def pathstart_def intro!: 1 2) |
49653 | 137 |
qed |
36583 | 138 |
|
49653 | 139 |
lemma path_image_join_subset: "path_image(g1 +++ g2) \<subseteq> (path_image g1 \<union> path_image g2)" |
51478
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
50935
diff
changeset
|
140 |
unfolding path_image_def joinpaths_def by auto |
36583 | 141 |
|
142 |
lemma subset_path_image_join: |
|
49653 | 143 |
assumes "path_image g1 \<subseteq> s" "path_image g2 \<subseteq> s" |
144 |
shows "path_image(g1 +++ g2) \<subseteq> s" |
|
36583 | 145 |
using path_image_join_subset[of g1 g2] and assms by auto |
146 |
||
147 |
lemma path_image_join: |
|
51478
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
50935
diff
changeset
|
148 |
assumes "pathfinish g1 = pathstart g2" |
36583 | 149 |
shows "path_image(g1 +++ g2) = (path_image g1) \<union> (path_image g2)" |
49653 | 150 |
apply (rule, rule path_image_join_subset, rule) |
151 |
unfolding Un_iff |
|
152 |
proof (erule disjE) |
|
153 |
fix x |
|
154 |
assume "x \<in> path_image g1" |
|
155 |
then obtain y where y: "y\<in>{0..1}" "x = g1 y" |
|
156 |
unfolding path_image_def image_iff by auto |
|
49654 | 157 |
then show "x \<in> path_image (g1 +++ g2)" |
49653 | 158 |
unfolding joinpaths_def path_image_def image_iff |
159 |
apply (rule_tac x="(1/2) *\<^sub>R y" in bexI) |
|
160 |
apply auto |
|
161 |
done |
|
162 |
next |
|
163 |
fix x |
|
164 |
assume "x \<in> path_image g2" |
|
165 |
then obtain y where y: "y\<in>{0..1}" "x = g2 y" |
|
166 |
unfolding path_image_def image_iff by auto |
|
167 |
then show "x \<in> path_image (g1 +++ g2)" |
|
168 |
unfolding joinpaths_def path_image_def image_iff |
|
169 |
apply(rule_tac x="(1/2) *\<^sub>R (y + 1)" in bexI) |
|
51478
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
50935
diff
changeset
|
170 |
using assms(1)[unfolded pathfinish_def pathstart_def] |
49653 | 171 |
apply (auto simp add: add_divide_distrib) |
172 |
done |
|
173 |
qed |
|
36583 | 174 |
|
175 |
lemma not_in_path_image_join: |
|
49653 | 176 |
assumes "x \<notin> path_image g1" "x \<notin> path_image g2" |
177 |
shows "x \<notin> path_image(g1 +++ g2)" |
|
36583 | 178 |
using assms and path_image_join_subset[of g1 g2] by auto |
179 |
||
49653 | 180 |
lemma simple_path_reversepath: |
181 |
assumes "simple_path g" |
|
182 |
shows "simple_path (reversepath g)" |
|
183 |
using assms |
|
184 |
unfolding simple_path_def reversepath_def |
|
185 |
apply - |
|
186 |
apply (rule ballI)+ |
|
187 |
apply (erule_tac x="1-x" in ballE, erule_tac x="1-y" in ballE) |
|
188 |
apply auto |
|
189 |
done |
|
36583 | 190 |
|
191 |
lemma simple_path_join_loop: |
|
192 |
assumes "injective_path g1" "injective_path g2" "pathfinish g2 = pathstart g1" |
|
49653 | 193 |
"(path_image g1 \<inter> path_image g2) \<subseteq> {pathstart g1,pathstart g2}" |
36583 | 194 |
shows "simple_path(g1 +++ g2)" |
49653 | 195 |
unfolding simple_path_def |
196 |
proof ((rule ballI)+, rule impI) |
|
197 |
let ?g = "g1 +++ g2" |
|
36583 | 198 |
note inj = assms(1,2)[unfolded injective_path_def, rule_format] |
49653 | 199 |
fix x y :: real |
200 |
assume xy: "x \<in> {0..1}" "y \<in> {0..1}" "?g x = ?g y" |
|
201 |
show "x = y \<or> x = 0 \<and> y = 1 \<or> x = 1 \<and> y = 0" |
|
202 |
proof (case_tac "x \<le> 1/2", case_tac[!] "y \<le> 1/2", unfold not_le) |
|
203 |
assume as: "x \<le> 1 / 2" "y \<le> 1 / 2" |
|
49654 | 204 |
then have "g1 (2 *\<^sub>R x) = g1 (2 *\<^sub>R y)" |
49653 | 205 |
using xy(3) unfolding joinpaths_def by auto |
206 |
moreover |
|
207 |
have "2 *\<^sub>R x \<in> {0..1}" "2 *\<^sub>R y \<in> {0..1}" using xy(1,2) as |
|
36583 | 208 |
by auto |
49653 | 209 |
ultimately |
210 |
show ?thesis using inj(1)[of "2*\<^sub>R x" "2*\<^sub>R y"] by auto |
|
211 |
next |
|
212 |
assume as:"x > 1 / 2" "y > 1 / 2" |
|
49654 | 213 |
then have "g2 (2 *\<^sub>R x - 1) = g2 (2 *\<^sub>R y - 1)" |
49653 | 214 |
using xy(3) unfolding joinpaths_def by auto |
215 |
moreover |
|
216 |
have "2 *\<^sub>R x - 1 \<in> {0..1}" "2 *\<^sub>R y - 1 \<in> {0..1}" |
|
217 |
using xy(1,2) as by auto |
|
218 |
ultimately |
|
219 |
show ?thesis using inj(2)[of "2*\<^sub>R x - 1" "2*\<^sub>R y - 1"] by auto |
|
220 |
next |
|
221 |
assume as:"x \<le> 1 / 2" "y > 1 / 2" |
|
49654 | 222 |
then have "?g x \<in> path_image g1" "?g y \<in> path_image g2" |
49653 | 223 |
unfolding path_image_def joinpaths_def |
36583 | 224 |
using xy(1,2) by auto |
49653 | 225 |
moreover |
226 |
have "?g y \<noteq> pathstart g2" using as(2) unfolding pathstart_def joinpaths_def |
|
36583 | 227 |
using inj(2)[of "2 *\<^sub>R y - 1" 0] and xy(2) |
228 |
by (auto simp add: field_simps) |
|
49653 | 229 |
ultimately |
230 |
have *:"?g x = pathstart g1" using assms(4) unfolding xy(3) by auto |
|
49654 | 231 |
then have "x = 0" unfolding pathstart_def joinpaths_def using as(1) and xy(1) |
36583 | 232 |
using inj(1)[of "2 *\<^sub>R x" 0] by auto |
49653 | 233 |
moreover |
234 |
have "y = 1" using * unfolding xy(3) assms(3)[THEN sym] |
|
36583 | 235 |
unfolding joinpaths_def pathfinish_def using as(2) and xy(2) |
236 |
using inj(2)[of "2 *\<^sub>R y - 1" 1] by auto |
|
237 |
ultimately show ?thesis by auto |
|
49653 | 238 |
next |
239 |
assume as: "x > 1 / 2" "y \<le> 1 / 2" |
|
49654 | 240 |
then have "?g x \<in> path_image g2" "?g y \<in> path_image g1" |
49653 | 241 |
unfolding path_image_def joinpaths_def |
36583 | 242 |
using xy(1,2) by auto |
49653 | 243 |
moreover |
244 |
have "?g x \<noteq> pathstart g2" using as(1) unfolding pathstart_def joinpaths_def |
|
36583 | 245 |
using inj(2)[of "2 *\<^sub>R x - 1" 0] and xy(1) |
246 |
by (auto simp add: field_simps) |
|
49653 | 247 |
ultimately |
248 |
have *: "?g y = pathstart g1" using assms(4) unfolding xy(3) by auto |
|
49654 | 249 |
then have "y = 0" unfolding pathstart_def joinpaths_def using as(2) and xy(2) |
36583 | 250 |
using inj(1)[of "2 *\<^sub>R y" 0] by auto |
49653 | 251 |
moreover |
252 |
have "x = 1" using * unfolding xy(3)[THEN sym] assms(3)[THEN sym] |
|
36583 | 253 |
unfolding joinpaths_def pathfinish_def using as(1) and xy(1) |
254 |
using inj(2)[of "2 *\<^sub>R x - 1" 1] by auto |
|
49653 | 255 |
ultimately show ?thesis by auto |
256 |
qed |
|
257 |
qed |
|
36583 | 258 |
|
259 |
lemma injective_path_join: |
|
260 |
assumes "injective_path g1" "injective_path g2" "pathfinish g1 = pathstart g2" |
|
49653 | 261 |
"(path_image g1 \<inter> path_image g2) \<subseteq> {pathstart g2}" |
36583 | 262 |
shows "injective_path(g1 +++ g2)" |
49653 | 263 |
unfolding injective_path_def |
264 |
proof (rule, rule, rule) |
|
265 |
let ?g = "g1 +++ g2" |
|
36583 | 266 |
note inj = assms(1,2)[unfolded injective_path_def, rule_format] |
49653 | 267 |
fix x y |
268 |
assume xy: "x \<in> {0..1}" "y \<in> {0..1}" "(g1 +++ g2) x = (g1 +++ g2) y" |
|
269 |
show "x = y" |
|
270 |
proof (cases "x \<le> 1/2", case_tac[!] "y \<le> 1/2", unfold not_le) |
|
271 |
assume "x \<le> 1 / 2" "y \<le> 1 / 2" |
|
49654 | 272 |
then show ?thesis using inj(1)[of "2*\<^sub>R x" "2*\<^sub>R y"] and xy |
36583 | 273 |
unfolding joinpaths_def by auto |
49653 | 274 |
next |
275 |
assume "x > 1 / 2" "y > 1 / 2" |
|
49654 | 276 |
then show ?thesis using inj(2)[of "2*\<^sub>R x - 1" "2*\<^sub>R y - 1"] and xy |
36583 | 277 |
unfolding joinpaths_def by auto |
49653 | 278 |
next |
279 |
assume as: "x \<le> 1 / 2" "y > 1 / 2" |
|
49654 | 280 |
then have "?g x \<in> path_image g1" "?g y \<in> path_image g2" |
49653 | 281 |
unfolding path_image_def joinpaths_def |
36583 | 282 |
using xy(1,2) by auto |
49654 | 283 |
then have "?g x = pathfinish g1" "?g y = pathstart g2" |
49653 | 284 |
using assms(4) unfolding assms(3) xy(3) by auto |
49654 | 285 |
then show ?thesis |
49653 | 286 |
using as and inj(1)[of "2 *\<^sub>R x" 1] inj(2)[of "2 *\<^sub>R y - 1" 0] and xy(1,2) |
36583 | 287 |
unfolding pathstart_def pathfinish_def joinpaths_def |
288 |
by auto |
|
49653 | 289 |
next |
290 |
assume as:"x > 1 / 2" "y \<le> 1 / 2" |
|
49654 | 291 |
then have "?g x \<in> path_image g2" "?g y \<in> path_image g1" |
49653 | 292 |
unfolding path_image_def joinpaths_def |
36583 | 293 |
using xy(1,2) by auto |
49654 | 294 |
then have "?g x = pathstart g2" "?g y = pathfinish g1" |
49653 | 295 |
using assms(4) unfolding assms(3) xy(3) by auto |
49654 | 296 |
then show ?thesis using as and inj(2)[of "2 *\<^sub>R x - 1" 0] inj(1)[of "2 *\<^sub>R y" 1] and xy(1,2) |
36583 | 297 |
unfolding pathstart_def pathfinish_def joinpaths_def |
49653 | 298 |
by auto |
299 |
qed |
|
300 |
qed |
|
36583 | 301 |
|
302 |
lemmas join_paths_simps = path_join path_image_join pathstart_join pathfinish_join |
|
303 |
||
49653 | 304 |
|
36583 | 305 |
subsection {* Reparametrizing a closed curve to start at some chosen point. *} |
306 |
||
307 |
definition "shiftpath a (f::real \<Rightarrow> 'a::topological_space) = |
|
308 |
(\<lambda>x. if (a + x) \<le> 1 then f(a + x) else f(a + x - 1))" |
|
309 |
||
310 |
lemma pathstart_shiftpath: "a \<le> 1 \<Longrightarrow> pathstart(shiftpath a g) = g a" |
|
311 |
unfolding pathstart_def shiftpath_def by auto |
|
312 |
||
49653 | 313 |
lemma pathfinish_shiftpath: |
314 |
assumes "0 \<le> a" "pathfinish g = pathstart g" |
|
36583 | 315 |
shows "pathfinish(shiftpath a g) = g a" |
316 |
using assms unfolding pathstart_def pathfinish_def shiftpath_def |
|
317 |
by auto |
|
318 |
||
319 |
lemma endpoints_shiftpath: |
|
320 |
assumes "pathfinish g = pathstart g" "a \<in> {0 .. 1}" |
|
321 |
shows "pathfinish(shiftpath a g) = g a" "pathstart(shiftpath a g) = g a" |
|
322 |
using assms by(auto intro!:pathfinish_shiftpath pathstart_shiftpath) |
|
323 |
||
324 |
lemma closed_shiftpath: |
|
325 |
assumes "pathfinish g = pathstart g" "a \<in> {0..1}" |
|
326 |
shows "pathfinish(shiftpath a g) = pathstart(shiftpath a g)" |
|
327 |
using endpoints_shiftpath[OF assms] by auto |
|
328 |
||
329 |
lemma path_shiftpath: |
|
330 |
assumes "path g" "pathfinish g = pathstart g" "a \<in> {0..1}" |
|
49653 | 331 |
shows "path(shiftpath a g)" |
332 |
proof - |
|
333 |
have *: "{0 .. 1} = {0 .. 1-a} \<union> {1-a .. 1}" using assms(3) by auto |
|
334 |
have **: "\<And>x. x + a = 1 \<Longrightarrow> g (x + a - 1) = g (x + a)" |
|
36583 | 335 |
using assms(2)[unfolded pathfinish_def pathstart_def] by auto |
49653 | 336 |
show ?thesis |
337 |
unfolding path_def shiftpath_def * |
|
338 |
apply (rule continuous_on_union) |
|
339 |
apply (rule closed_real_atLeastAtMost)+ |
|
340 |
apply (rule continuous_on_eq[of _ "g \<circ> (\<lambda>x. a + x)"]) prefer 3 |
|
341 |
apply (rule continuous_on_eq[of _ "g \<circ> (\<lambda>x. a - 1 + x)"]) defer prefer 3 |
|
342 |
apply (rule continuous_on_intros)+ prefer 2 |
|
343 |
apply (rule continuous_on_intros)+ |
|
344 |
apply (rule_tac[1-2] continuous_on_subset[OF assms(1)[unfolded path_def]]) |
|
345 |
using assms(3) and ** |
|
346 |
apply (auto, auto simp add: field_simps) |
|
347 |
done |
|
348 |
qed |
|
36583 | 349 |
|
49653 | 350 |
lemma shiftpath_shiftpath: |
351 |
assumes "pathfinish g = pathstart g" "a \<in> {0..1}" "x \<in> {0..1}" |
|
36583 | 352 |
shows "shiftpath (1 - a) (shiftpath a g) x = g x" |
353 |
using assms unfolding pathfinish_def pathstart_def shiftpath_def by auto |
|
354 |
||
355 |
lemma path_image_shiftpath: |
|
356 |
assumes "a \<in> {0..1}" "pathfinish g = pathstart g" |
|
49653 | 357 |
shows "path_image(shiftpath a g) = path_image g" |
358 |
proof - |
|
359 |
{ fix x |
|
360 |
assume as:"g 1 = g 0" "x \<in> {0..1::real}" " \<forall>y\<in>{0..1} \<inter> {x. \<not> a + x \<le> 1}. g x \<noteq> g (a + y - 1)" |
|
49654 | 361 |
then have "\<exists>y\<in>{0..1} \<inter> {x. a + x \<le> 1}. g x = g (a + y)" |
49653 | 362 |
proof (cases "a \<le> x") |
363 |
case False |
|
49654 | 364 |
then show ?thesis |
49653 | 365 |
apply (rule_tac x="1 + x - a" in bexI) |
36583 | 366 |
using as(1,2) and as(3)[THEN bspec[where x="1 + x - a"]] and assms(1) |
49653 | 367 |
apply (auto simp add: field_simps atomize_not) |
368 |
done |
|
369 |
next |
|
370 |
case True |
|
49654 | 371 |
then show ?thesis using as(1-2) and assms(1) apply(rule_tac x="x - a" in bexI) |
49653 | 372 |
by(auto simp add: field_simps) |
373 |
qed |
|
374 |
} |
|
49654 | 375 |
then show ?thesis |
49653 | 376 |
using assms unfolding shiftpath_def path_image_def pathfinish_def pathstart_def |
377 |
by(auto simp add: image_iff) |
|
378 |
qed |
|
379 |
||
36583 | 380 |
|
381 |
subsection {* Special case of straight-line paths. *} |
|
382 |
||
49653 | 383 |
definition linepath :: "'a::real_normed_vector \<Rightarrow> 'a \<Rightarrow> real \<Rightarrow> 'a" |
384 |
where "linepath a b = (\<lambda>x. (1 - x) *\<^sub>R a + x *\<^sub>R b)" |
|
36583 | 385 |
|
386 |
lemma pathstart_linepath[simp]: "pathstart(linepath a b) = a" |
|
387 |
unfolding pathstart_def linepath_def by auto |
|
388 |
||
389 |
lemma pathfinish_linepath[simp]: "pathfinish(linepath a b) = b" |
|
390 |
unfolding pathfinish_def linepath_def by auto |
|
391 |
||
392 |
lemma continuous_linepath_at[intro]: "continuous (at x) (linepath a b)" |
|
393 |
unfolding linepath_def by (intro continuous_intros) |
|
394 |
||
395 |
lemma continuous_on_linepath[intro]: "continuous_on s (linepath a b)" |
|
396 |
using continuous_linepath_at by(auto intro!: continuous_at_imp_continuous_on) |
|
397 |
||
398 |
lemma path_linepath[intro]: "path(linepath a b)" |
|
399 |
unfolding path_def by(rule continuous_on_linepath) |
|
400 |
||
401 |
lemma path_image_linepath[simp]: "path_image(linepath a b) = (closed_segment a b)" |
|
49653 | 402 |
unfolding path_image_def segment linepath_def |
403 |
apply (rule set_eqI, rule) defer |
|
404 |
unfolding mem_Collect_eq image_iff |
|
405 |
apply(erule exE) |
|
406 |
apply(rule_tac x="u *\<^sub>R 1" in bexI) |
|
407 |
apply auto |
|
408 |
done |
|
409 |
||
410 |
lemma reversepath_linepath[simp]: "reversepath(linepath a b) = linepath b a" |
|
411 |
unfolding reversepath_def linepath_def |
|
36583 | 412 |
by auto |
413 |
||
414 |
lemma injective_path_linepath: |
|
49653 | 415 |
assumes "a \<noteq> b" |
416 |
shows "injective_path (linepath a b)" |
|
36583 | 417 |
proof - |
418 |
{ fix x y :: "real" |
|
419 |
assume "x *\<^sub>R b + y *\<^sub>R a = x *\<^sub>R a + y *\<^sub>R b" |
|
49654 | 420 |
then have "(x - y) *\<^sub>R a = (x - y) *\<^sub>R b" by (simp add: algebra_simps) |
36583 | 421 |
with assms have "x = y" by simp } |
49654 | 422 |
then show ?thesis |
49653 | 423 |
unfolding injective_path_def linepath_def |
424 |
by (auto simp add: algebra_simps) |
|
425 |
qed |
|
36583 | 426 |
|
49653 | 427 |
lemma simple_path_linepath[intro]: "a \<noteq> b \<Longrightarrow> simple_path(linepath a b)" |
428 |
by(auto intro!: injective_imp_simple_path injective_path_linepath) |
|
429 |
||
36583 | 430 |
|
431 |
subsection {* Bounding a point away from a path. *} |
|
432 |
||
433 |
lemma not_on_path_ball: |
|
434 |
fixes g :: "real \<Rightarrow> 'a::heine_borel" |
|
435 |
assumes "path g" "z \<notin> path_image g" |
|
49653 | 436 |
shows "\<exists>e > 0. ball z e \<inter> (path_image g) = {}" |
437 |
proof - |
|
438 |
obtain a where "a \<in> path_image g" "\<forall>y \<in> path_image g. dist z a \<le> dist z y" |
|
36583 | 439 |
using distance_attains_inf[OF _ path_image_nonempty, of g z] |
440 |
using compact_path_image[THEN compact_imp_closed, OF assms(1)] by auto |
|
49654 | 441 |
then show ?thesis |
49653 | 442 |
apply (rule_tac x="dist z a" in exI) |
443 |
using assms(2) |
|
444 |
apply (auto intro!: dist_pos_lt) |
|
445 |
done |
|
446 |
qed |
|
36583 | 447 |
|
448 |
lemma not_on_path_cball: |
|
449 |
fixes g :: "real \<Rightarrow> 'a::heine_borel" |
|
450 |
assumes "path g" "z \<notin> path_image g" |
|
49653 | 451 |
shows "\<exists>e>0. cball z e \<inter> (path_image g) = {}" |
452 |
proof - |
|
453 |
obtain e where "ball z e \<inter> path_image g = {}" "e>0" |
|
454 |
using not_on_path_ball[OF assms] by auto |
|
36583 | 455 |
moreover have "cball z (e/2) \<subseteq> ball z e" using `e>0` by auto |
49653 | 456 |
ultimately show ?thesis apply(rule_tac x="e/2" in exI) by auto |
457 |
qed |
|
458 |
||
36583 | 459 |
|
460 |
subsection {* Path component, considered as a "joinability" relation (from Tom Hales). *} |
|
461 |
||
49653 | 462 |
definition "path_component s x y \<longleftrightarrow> |
463 |
(\<exists>g. path g \<and> path_image g \<subseteq> s \<and> pathstart g = x \<and> pathfinish g = y)" |
|
36583 | 464 |
|
465 |
lemmas path_defs = path_def pathstart_def pathfinish_def path_image_def path_component_def |
|
466 |
||
49653 | 467 |
lemma path_component_mem: |
468 |
assumes "path_component s x y" |
|
469 |
shows "x \<in> s" "y \<in> s" |
|
36583 | 470 |
using assms unfolding path_defs by auto |
471 |
||
49653 | 472 |
lemma path_component_refl: |
473 |
assumes "x \<in> s" |
|
474 |
shows "path_component s x x" |
|
475 |
unfolding path_defs |
|
476 |
apply (rule_tac x="\<lambda>u. x" in exI) |
|
477 |
using assms apply (auto intro!:continuous_on_intros) done |
|
36583 | 478 |
|
479 |
lemma path_component_refl_eq: "path_component s x x \<longleftrightarrow> x \<in> s" |
|
49653 | 480 |
by (auto intro!: path_component_mem path_component_refl) |
36583 | 481 |
|
482 |
lemma path_component_sym: "path_component s x y \<Longrightarrow> path_component s y x" |
|
49653 | 483 |
using assms |
484 |
unfolding path_component_def |
|
485 |
apply (erule exE) |
|
486 |
apply (rule_tac x="reversepath g" in exI) |
|
487 |
apply auto |
|
488 |
done |
|
36583 | 489 |
|
49653 | 490 |
lemma path_component_trans: |
491 |
assumes "path_component s x y" "path_component s y z" |
|
492 |
shows "path_component s x z" |
|
493 |
using assms |
|
494 |
unfolding path_component_def |
|
495 |
apply - |
|
496 |
apply (erule exE)+ |
|
497 |
apply (rule_tac x="g +++ ga" in exI) |
|
498 |
apply (auto simp add: path_image_join) |
|
499 |
done |
|
36583 | 500 |
|
501 |
lemma path_component_of_subset: "s \<subseteq> t \<Longrightarrow> path_component s x y \<Longrightarrow> path_component t x y" |
|
502 |
unfolding path_component_def by auto |
|
503 |
||
49653 | 504 |
|
36583 | 505 |
subsection {* Can also consider it as a set, as the name suggests. *} |
506 |
||
49653 | 507 |
lemma path_component_set: |
508 |
"{y. path_component s x y} = |
|
509 |
{y. (\<exists>g. path g \<and> path_image g \<subseteq> s \<and> pathstart g = x \<and> pathfinish g = y)}" |
|
510 |
apply (rule set_eqI) |
|
511 |
unfolding mem_Collect_eq |
|
512 |
unfolding path_component_def |
|
513 |
apply auto |
|
514 |
done |
|
36583 | 515 |
|
44170
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
41959
diff
changeset
|
516 |
lemma path_component_subset: "{y. path_component s x y} \<subseteq> s" |
49653 | 517 |
apply (rule, rule path_component_mem(2)) |
518 |
apply auto |
|
519 |
done |
|
36583 | 520 |
|
44170
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
41959
diff
changeset
|
521 |
lemma path_component_eq_empty: "{y. path_component s x y} = {} \<longleftrightarrow> x \<notin> s" |
49653 | 522 |
apply rule |
523 |
apply (drule equals0D[of _ x]) defer |
|
524 |
apply (rule equals0I) |
|
525 |
unfolding mem_Collect_eq |
|
526 |
apply (drule path_component_mem(1)) |
|
527 |
using path_component_refl |
|
528 |
apply auto |
|
529 |
done |
|
530 |
||
36583 | 531 |
|
532 |
subsection {* Path connectedness of a space. *} |
|
533 |
||
49653 | 534 |
definition "path_connected s \<longleftrightarrow> |
535 |
(\<forall>x\<in>s. \<forall>y\<in>s. \<exists>g. path g \<and> (path_image g) \<subseteq> s \<and> pathstart g = x \<and> pathfinish g = y)" |
|
36583 | 536 |
|
537 |
lemma path_connected_component: "path_connected s \<longleftrightarrow> (\<forall>x\<in>s. \<forall>y\<in>s. path_component s x y)" |
|
538 |
unfolding path_connected_def path_component_def by auto |
|
539 |
||
44170
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
41959
diff
changeset
|
540 |
lemma path_connected_component_set: "path_connected s \<longleftrightarrow> (\<forall>x\<in>s. {y. path_component s x y} = s)" |
49653 | 541 |
unfolding path_connected_component |
542 |
apply (rule, rule, rule, rule path_component_subset) |
|
543 |
unfolding subset_eq mem_Collect_eq Ball_def |
|
544 |
apply auto |
|
545 |
done |
|
546 |
||
36583 | 547 |
|
548 |
subsection {* Some useful lemmas about path-connectedness. *} |
|
549 |
||
550 |
lemma convex_imp_path_connected: |
|
551 |
fixes s :: "'a::real_normed_vector set" |
|
552 |
assumes "convex s" shows "path_connected s" |
|
49653 | 553 |
unfolding path_connected_def |
554 |
apply (rule, rule, rule_tac x = "linepath x y" in exI) |
|
555 |
unfolding path_image_linepath |
|
556 |
using assms [unfolded convex_contains_segment] |
|
557 |
apply auto |
|
558 |
done |
|
36583 | 559 |
|
49653 | 560 |
lemma path_connected_imp_connected: |
561 |
assumes "path_connected s" |
|
562 |
shows "connected s" |
|
563 |
unfolding connected_def not_ex |
|
564 |
apply (rule, rule, rule ccontr) |
|
565 |
unfolding not_not |
|
566 |
apply (erule conjE)+ |
|
567 |
proof - |
|
568 |
fix e1 e2 |
|
569 |
assume as: "open e1" "open e2" "s \<subseteq> e1 \<union> e2" "e1 \<inter> e2 \<inter> s = {}" "e1 \<inter> s \<noteq> {}" "e2 \<inter> s \<noteq> {}" |
|
36583 | 570 |
then obtain x1 x2 where obt:"x1\<in>e1\<inter>s" "x2\<in>e2\<inter>s" by auto |
571 |
then obtain g where g:"path g" "path_image g \<subseteq> s" "pathstart g = x1" "pathfinish g = x2" |
|
572 |
using assms[unfolded path_connected_def,rule_format,of x1 x2] by auto |
|
49653 | 573 |
have *: "connected {0..1::real}" |
574 |
by (auto intro!: convex_connected convex_real_interval) |
|
575 |
have "{0..1} \<subseteq> {x \<in> {0..1}. g x \<in> e1} \<union> {x \<in> {0..1}. g x \<in> e2}" |
|
576 |
using as(3) g(2)[unfolded path_defs] by blast |
|
577 |
moreover have "{x \<in> {0..1}. g x \<in> e1} \<inter> {x \<in> {0..1}. g x \<in> e2} = {}" |
|
578 |
using as(4) g(2)[unfolded path_defs] unfolding subset_eq by auto |
|
579 |
moreover have "{x \<in> {0..1}. g x \<in> e1} \<noteq> {} \<and> {x \<in> {0..1}. g x \<in> e2} \<noteq> {}" |
|
580 |
using g(3,4)[unfolded path_defs] using obt |
|
36583 | 581 |
by (simp add: ex_in_conv [symmetric], metis zero_le_one order_refl) |
49653 | 582 |
ultimately show False |
583 |
using *[unfolded connected_local not_ex, rule_format, of "{x\<in>{0..1}. g x \<in> e1}" "{x\<in>{0..1}. g x \<in> e2}"] |
|
36583 | 584 |
using continuous_open_in_preimage[OF g(1)[unfolded path_def] as(1)] |
49653 | 585 |
using continuous_open_in_preimage[OF g(1)[unfolded path_def] as(2)] |
586 |
by auto |
|
587 |
qed |
|
36583 | 588 |
|
589 |
lemma open_path_component: |
|
590 |
fixes s :: "'a::real_normed_vector set" (*TODO: generalize to metric_space*) |
|
49653 | 591 |
assumes "open s" |
592 |
shows "open {y. path_component s x y}" |
|
593 |
unfolding open_contains_ball |
|
594 |
proof |
|
595 |
fix y |
|
596 |
assume as: "y \<in> {y. path_component s x y}" |
|
49654 | 597 |
then have "y \<in> s" |
49653 | 598 |
apply - |
599 |
apply (rule path_component_mem(2)) |
|
600 |
unfolding mem_Collect_eq |
|
601 |
apply auto |
|
602 |
done |
|
603 |
then obtain e where e:"e>0" "ball y e \<subseteq> s" |
|
604 |
using assms[unfolded open_contains_ball] by auto |
|
605 |
show "\<exists>e > 0. ball y e \<subseteq> {y. path_component s x y}" |
|
606 |
apply (rule_tac x=e in exI) |
|
607 |
apply (rule,rule `e>0`, rule) |
|
608 |
unfolding mem_ball mem_Collect_eq |
|
609 |
proof - |
|
610 |
fix z |
|
611 |
assume "dist y z < e" |
|
49654 | 612 |
then show "path_component s x z" |
49653 | 613 |
apply (rule_tac path_component_trans[of _ _ y]) defer |
614 |
apply (rule path_component_of_subset[OF e(2)]) |
|
615 |
apply (rule convex_imp_path_connected[OF convex_ball, unfolded path_connected_component, rule_format]) |
|
616 |
using `e>0` as |
|
617 |
apply auto |
|
618 |
done |
|
619 |
qed |
|
620 |
qed |
|
36583 | 621 |
|
622 |
lemma open_non_path_component: |
|
623 |
fixes s :: "'a::real_normed_vector set" (*TODO: generalize to metric_space*) |
|
49653 | 624 |
assumes "open s" |
625 |
shows "open(s - {y. path_component s x y})" |
|
626 |
unfolding open_contains_ball |
|
627 |
proof |
|
628 |
fix y |
|
629 |
assume as: "y\<in>s - {y. path_component s x y}" |
|
630 |
then obtain e where e:"e>0" "ball y e \<subseteq> s" |
|
631 |
using assms [unfolded open_contains_ball] by auto |
|
632 |
show "\<exists>e>0. ball y e \<subseteq> s - {y. path_component s x y}" |
|
633 |
apply (rule_tac x=e in exI) |
|
634 |
apply (rule, rule `e>0`, rule, rule) defer |
|
635 |
proof (rule ccontr) |
|
636 |
fix z |
|
637 |
assume "z \<in> ball y e" "\<not> z \<notin> {y. path_component s x y}" |
|
49654 | 638 |
then have "y \<in> {y. path_component s x y}" |
49653 | 639 |
unfolding not_not mem_Collect_eq using `e>0` |
640 |
apply - |
|
641 |
apply (rule path_component_trans, assumption) |
|
642 |
apply (rule path_component_of_subset[OF e(2)]) |
|
643 |
apply (rule convex_imp_path_connected[OF convex_ball, unfolded path_connected_component, rule_format]) |
|
644 |
apply auto |
|
645 |
done |
|
49654 | 646 |
then show False using as by auto |
49653 | 647 |
qed (insert e(2), auto) |
648 |
qed |
|
36583 | 649 |
|
650 |
lemma connected_open_path_connected: |
|
651 |
fixes s :: "'a::real_normed_vector set" (*TODO: generalize to metric_space*) |
|
49653 | 652 |
assumes "open s" "connected s" |
653 |
shows "path_connected s" |
|
654 |
unfolding path_connected_component_set |
|
655 |
proof (rule, rule, rule path_component_subset, rule) |
|
656 |
fix x y |
|
657 |
assume "x \<in> s" "y \<in> s" |
|
658 |
show "y \<in> {y. path_component s x y}" |
|
659 |
proof (rule ccontr) |
|
660 |
assume "y \<notin> {y. path_component s x y}" |
|
661 |
moreover |
|
662 |
have "{y. path_component s x y} \<inter> s \<noteq> {}" |
|
663 |
using `x\<in>s` path_component_eq_empty path_component_subset[of s x] by auto |
|
664 |
ultimately |
|
665 |
show False |
|
666 |
using `y\<in>s` open_non_path_component[OF assms(1)] open_path_component[OF assms(1)] |
|
667 |
using assms(2)[unfolded connected_def not_ex, rule_format, of"{y. path_component s x y}" "s - {y. path_component s x y}"] |
|
668 |
by auto |
|
669 |
qed |
|
670 |
qed |
|
36583 | 671 |
|
672 |
lemma path_connected_continuous_image: |
|
49653 | 673 |
assumes "continuous_on s f" "path_connected s" |
674 |
shows "path_connected (f ` s)" |
|
675 |
unfolding path_connected_def |
|
676 |
proof (rule, rule) |
|
677 |
fix x' y' |
|
678 |
assume "x' \<in> f ` s" "y' \<in> f ` s" |
|
679 |
then obtain x y where xy: "x\<in>s" "y\<in>s" "x' = f x" "y' = f y" by auto |
|
680 |
guess g using assms(2)[unfolded path_connected_def, rule_format, OF xy(1,2)] .. |
|
49654 | 681 |
then show "\<exists>g. path g \<and> path_image g \<subseteq> f ` s \<and> pathstart g = x' \<and> pathfinish g = y'" |
49653 | 682 |
unfolding xy |
683 |
apply (rule_tac x="f \<circ> g" in exI) |
|
684 |
unfolding path_defs |
|
51481
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents:
51478
diff
changeset
|
685 |
apply (intro conjI continuous_on_compose continuous_on_subset[OF assms(1)]) |
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents:
51478
diff
changeset
|
686 |
apply auto |
49653 | 687 |
done |
688 |
qed |
|
36583 | 689 |
|
690 |
lemma homeomorphic_path_connectedness: |
|
691 |
"s homeomorphic t \<Longrightarrow> (path_connected s \<longleftrightarrow> path_connected t)" |
|
49653 | 692 |
unfolding homeomorphic_def homeomorphism_def |
693 |
apply (erule exE|erule conjE)+ |
|
694 |
apply rule |
|
695 |
apply (drule_tac f=f in path_connected_continuous_image) prefer 3 |
|
696 |
apply (drule_tac f=g in path_connected_continuous_image) |
|
697 |
apply auto |
|
698 |
done |
|
36583 | 699 |
|
700 |
lemma path_connected_empty: "path_connected {}" |
|
701 |
unfolding path_connected_def by auto |
|
702 |
||
703 |
lemma path_connected_singleton: "path_connected {a}" |
|
704 |
unfolding path_connected_def pathstart_def pathfinish_def path_image_def |
|
705 |
apply (clarify, rule_tac x="\<lambda>x. a" in exI, simp add: image_constant_conv) |
|
706 |
apply (simp add: path_def continuous_on_const) |
|
707 |
done |
|
708 |
||
49653 | 709 |
lemma path_connected_Un: |
710 |
assumes "path_connected s" "path_connected t" "s \<inter> t \<noteq> {}" |
|
711 |
shows "path_connected (s \<union> t)" |
|
712 |
unfolding path_connected_component |
|
713 |
proof (rule, rule) |
|
714 |
fix x y |
|
715 |
assume as: "x \<in> s \<union> t" "y \<in> s \<union> t" |
|
36583 | 716 |
from assms(3) obtain z where "z \<in> s \<inter> t" by auto |
49654 | 717 |
then show "path_component (s \<union> t) x y" |
49653 | 718 |
using as and assms(1-2)[unfolded path_connected_component] |
719 |
apply - |
|
720 |
apply (erule_tac[!] UnE)+ |
|
721 |
apply (rule_tac[2-3] path_component_trans[of _ _ z]) |
|
722 |
apply (auto simp add:path_component_of_subset [OF Un_upper1] path_component_of_subset[OF Un_upper2]) |
|
723 |
done |
|
724 |
qed |
|
36583 | 725 |
|
37674
f86de9c00c47
convert theorem path_connected_sphere to euclidean_space class
huffman
parents:
37489
diff
changeset
|
726 |
lemma path_connected_UNION: |
f86de9c00c47
convert theorem path_connected_sphere to euclidean_space class
huffman
parents:
37489
diff
changeset
|
727 |
assumes "\<And>i. i \<in> A \<Longrightarrow> path_connected (S i)" |
49653 | 728 |
and "\<And>i. i \<in> A \<Longrightarrow> z \<in> S i" |
37674
f86de9c00c47
convert theorem path_connected_sphere to euclidean_space class
huffman
parents:
37489
diff
changeset
|
729 |
shows "path_connected (\<Union>i\<in>A. S i)" |
49653 | 730 |
unfolding path_connected_component |
731 |
proof clarify |
|
37674
f86de9c00c47
convert theorem path_connected_sphere to euclidean_space class
huffman
parents:
37489
diff
changeset
|
732 |
fix x i y j |
f86de9c00c47
convert theorem path_connected_sphere to euclidean_space class
huffman
parents:
37489
diff
changeset
|
733 |
assume *: "i \<in> A" "x \<in> S i" "j \<in> A" "y \<in> S j" |
49654 | 734 |
then have "path_component (S i) x z" and "path_component (S j) z y" |
37674
f86de9c00c47
convert theorem path_connected_sphere to euclidean_space class
huffman
parents:
37489
diff
changeset
|
735 |
using assms by (simp_all add: path_connected_component) |
49654 | 736 |
then have "path_component (\<Union>i\<in>A. S i) x z" and "path_component (\<Union>i\<in>A. S i) z y" |
48125
602dc0215954
tuned proofs -- prefer direct "rotated" instead of old-style COMP;
wenzelm
parents:
44647
diff
changeset
|
737 |
using *(1,3) by (auto elim!: path_component_of_subset [rotated]) |
49654 | 738 |
then show "path_component (\<Union>i\<in>A. S i) x y" |
37674
f86de9c00c47
convert theorem path_connected_sphere to euclidean_space class
huffman
parents:
37489
diff
changeset
|
739 |
by (rule path_component_trans) |
f86de9c00c47
convert theorem path_connected_sphere to euclidean_space class
huffman
parents:
37489
diff
changeset
|
740 |
qed |
36583 | 741 |
|
49653 | 742 |
|
37674
f86de9c00c47
convert theorem path_connected_sphere to euclidean_space class
huffman
parents:
37489
diff
changeset
|
743 |
subsection {* sphere is path-connected. *} |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36583
diff
changeset
|
744 |
|
36583 | 745 |
lemma path_connected_punctured_universe: |
37674
f86de9c00c47
convert theorem path_connected_sphere to euclidean_space class
huffman
parents:
37489
diff
changeset
|
746 |
assumes "2 \<le> DIM('a::euclidean_space)" |
f86de9c00c47
convert theorem path_connected_sphere to euclidean_space class
huffman
parents:
37489
diff
changeset
|
747 |
shows "path_connected((UNIV::'a::euclidean_space set) - {a})" |
49653 | 748 |
proof - |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49654
diff
changeset
|
749 |
let ?A = "{x::'a. \<exists>i\<in>Basis. x \<bullet> i < a \<bullet> i}" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49654
diff
changeset
|
750 |
let ?B = "{x::'a. \<exists>i\<in>Basis. a \<bullet> i < x \<bullet> i}" |
36583 | 751 |
|
49653 | 752 |
have A: "path_connected ?A" |
753 |
unfolding Collect_bex_eq |
|
37674
f86de9c00c47
convert theorem path_connected_sphere to euclidean_space class
huffman
parents:
37489
diff
changeset
|
754 |
proof (rule path_connected_UNION) |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49654
diff
changeset
|
755 |
fix i :: 'a |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49654
diff
changeset
|
756 |
assume "i \<in> Basis" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49654
diff
changeset
|
757 |
then show "(\<Sum>i\<in>Basis. (a \<bullet> i - 1)*\<^sub>R i) \<in> {x::'a. x \<bullet> i < a \<bullet> i}" by simp |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49654
diff
changeset
|
758 |
show "path_connected {x. x \<bullet> i < a \<bullet> i}" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49654
diff
changeset
|
759 |
using convex_imp_path_connected [OF convex_halfspace_lt, of i "a \<bullet> i"] |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49654
diff
changeset
|
760 |
by (simp add: inner_commute) |
37674
f86de9c00c47
convert theorem path_connected_sphere to euclidean_space class
huffman
parents:
37489
diff
changeset
|
761 |
qed |
f86de9c00c47
convert theorem path_connected_sphere to euclidean_space class
huffman
parents:
37489
diff
changeset
|
762 |
have B: "path_connected ?B" unfolding Collect_bex_eq |
f86de9c00c47
convert theorem path_connected_sphere to euclidean_space class
huffman
parents:
37489
diff
changeset
|
763 |
proof (rule path_connected_UNION) |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49654
diff
changeset
|
764 |
fix i :: 'a |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49654
diff
changeset
|
765 |
assume "i \<in> Basis" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49654
diff
changeset
|
766 |
then show "(\<Sum>i\<in>Basis. (a \<bullet> i + 1) *\<^sub>R i) \<in> {x::'a. a \<bullet> i < x \<bullet> i}" by simp |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49654
diff
changeset
|
767 |
show "path_connected {x. a \<bullet> 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:
49654
diff
changeset
|
768 |
using convex_imp_path_connected [OF convex_halfspace_gt, of "a \<bullet> i" i] |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49654
diff
changeset
|
769 |
by (simp add: inner_commute) |
37674
f86de9c00c47
convert theorem path_connected_sphere to euclidean_space class
huffman
parents:
37489
diff
changeset
|
770 |
qed |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49654
diff
changeset
|
771 |
obtain S :: "'a set" where "S \<subseteq> Basis" "card S = Suc (Suc 0)" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49654
diff
changeset
|
772 |
using ex_card[OF assms] by auto |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49654
diff
changeset
|
773 |
then obtain b0 b1 :: 'a where "b0 \<in> Basis" "b1 \<in> Basis" "b0 \<noteq> b1" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49654
diff
changeset
|
774 |
unfolding card_Suc_eq by auto |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49654
diff
changeset
|
775 |
then have "a + b0 - b1 \<in> ?A \<inter> ?B" by (auto simp: inner_simps inner_Basis) |
49654 | 776 |
then have "?A \<inter> ?B \<noteq> {}" by fast |
37674
f86de9c00c47
convert theorem path_connected_sphere to euclidean_space class
huffman
parents:
37489
diff
changeset
|
777 |
with A B have "path_connected (?A \<union> ?B)" |
f86de9c00c47
convert theorem path_connected_sphere to euclidean_space class
huffman
parents:
37489
diff
changeset
|
778 |
by (rule path_connected_Un) |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49654
diff
changeset
|
779 |
also have "?A \<union> ?B = {x. \<exists>i\<in>Basis. x \<bullet> i \<noteq> a \<bullet> i}" |
37674
f86de9c00c47
convert theorem path_connected_sphere to euclidean_space class
huffman
parents:
37489
diff
changeset
|
780 |
unfolding neq_iff bex_disj_distrib Collect_disj_eq .. |
f86de9c00c47
convert theorem path_connected_sphere to euclidean_space class
huffman
parents:
37489
diff
changeset
|
781 |
also have "\<dots> = {x. x \<noteq> a}" |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49654
diff
changeset
|
782 |
unfolding euclidean_eq_iff [where 'a='a] by (simp add: Bex_def) |
37674
f86de9c00c47
convert theorem path_connected_sphere to euclidean_space class
huffman
parents:
37489
diff
changeset
|
783 |
also have "\<dots> = UNIV - {a}" by auto |
f86de9c00c47
convert theorem path_connected_sphere to euclidean_space class
huffman
parents:
37489
diff
changeset
|
784 |
finally show ?thesis . |
f86de9c00c47
convert theorem path_connected_sphere to euclidean_space class
huffman
parents:
37489
diff
changeset
|
785 |
qed |
36583 | 786 |
|
37674
f86de9c00c47
convert theorem path_connected_sphere to euclidean_space class
huffman
parents:
37489
diff
changeset
|
787 |
lemma path_connected_sphere: |
f86de9c00c47
convert theorem path_connected_sphere to euclidean_space class
huffman
parents:
37489
diff
changeset
|
788 |
assumes "2 \<le> DIM('a::euclidean_space)" |
f86de9c00c47
convert theorem path_connected_sphere to euclidean_space class
huffman
parents:
37489
diff
changeset
|
789 |
shows "path_connected {x::'a::euclidean_space. norm(x - a) = r}" |
f86de9c00c47
convert theorem path_connected_sphere to euclidean_space class
huffman
parents:
37489
diff
changeset
|
790 |
proof (rule linorder_cases [of r 0]) |
49653 | 791 |
assume "r < 0" |
49654 | 792 |
then have "{x::'a. norm(x - a) = r} = {}" by auto |
793 |
then show ?thesis using path_connected_empty by simp |
|
37674
f86de9c00c47
convert theorem path_connected_sphere to euclidean_space class
huffman
parents:
37489
diff
changeset
|
794 |
next |
f86de9c00c47
convert theorem path_connected_sphere to euclidean_space class
huffman
parents:
37489
diff
changeset
|
795 |
assume "r = 0" |
49654 | 796 |
then show ?thesis using path_connected_singleton by simp |
37674
f86de9c00c47
convert theorem path_connected_sphere to euclidean_space class
huffman
parents:
37489
diff
changeset
|
797 |
next |
f86de9c00c47
convert theorem path_connected_sphere to euclidean_space class
huffman
parents:
37489
diff
changeset
|
798 |
assume r: "0 < r" |
49654 | 799 |
then have *: "{x::'a. norm(x - a) = r} = (\<lambda>x. a + r *\<^sub>R x) ` {x. norm x = 1}" |
49653 | 800 |
apply - |
801 |
apply (rule set_eqI, rule) |
|
802 |
unfolding image_iff |
|
803 |
apply (rule_tac x="(1/r) *\<^sub>R (x - a)" in bexI) |
|
804 |
unfolding mem_Collect_eq norm_scaleR |
|
805 |
apply (auto simp add: scaleR_right_diff_distrib) |
|
806 |
done |
|
807 |
have **: "{x::'a. norm x = 1} = (\<lambda>x. (1/norm x) *\<^sub>R x) ` (UNIV - {0})" |
|
808 |
apply (rule set_eqI,rule) |
|
809 |
unfolding image_iff |
|
810 |
apply (rule_tac x=x in bexI) |
|
811 |
unfolding mem_Collect_eq |
|
812 |
apply (auto split:split_if_asm) |
|
813 |
done |
|
44647
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44531
diff
changeset
|
814 |
have "continuous_on (UNIV - {0}) (\<lambda>x::'a. 1 / norm x)" |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44531
diff
changeset
|
815 |
unfolding field_divide_inverse by (simp add: continuous_on_intros) |
49654 | 816 |
then show ?thesis unfolding * ** using path_connected_punctured_universe[OF assms] |
49653 | 817 |
by (auto intro!: path_connected_continuous_image continuous_on_intros) |
37674
f86de9c00c47
convert theorem path_connected_sphere to euclidean_space class
huffman
parents:
37489
diff
changeset
|
818 |
qed |
36583 | 819 |
|
37674
f86de9c00c47
convert theorem path_connected_sphere to euclidean_space class
huffman
parents:
37489
diff
changeset
|
820 |
lemma connected_sphere: "2 \<le> DIM('a::euclidean_space) \<Longrightarrow> connected {x::'a. norm(x - a) = r}" |
36583 | 821 |
using path_connected_sphere path_connected_imp_connected by auto |
822 |
||
823 |
end |