author | eberlm |
Mon, 02 Nov 2015 11:56:28 +0100 | |
changeset 61531 | ab2e862263e7 |
parent 61524 | f2e51e704a96 |
child 61552 | 980dd46a03fb |
permissions | -rw-r--r-- |
33714
eb2574ac4173
Added new lemmas to Euclidean Space by Robert Himmelmann
hoelzl
parents:
33324
diff
changeset
|
1 |
(* title: HOL/Library/Topology_Euclidian_Space.thy |
33175 | 2 |
Author: Amine Chaieb, University of Cambridge |
3 |
Author: Robert Himmelmann, TU Muenchen |
|
44075 | 4 |
Author: Brian Huffman, Portland State University |
33175 | 5 |
*) |
6 |
||
60420 | 7 |
section \<open>Elementary topology in Euclidean space.\<close> |
33175 | 8 |
|
9 |
theory Topology_Euclidean_Space |
|
50087 | 10 |
imports |
50938 | 11 |
Complex_Main |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
12 |
"~~/src/HOL/Library/Countable_Set" |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
13 |
"~~/src/HOL/Library/FuncSet" |
50938 | 14 |
Linear_Algebra |
50087 | 15 |
Norm_Arith |
16 |
begin |
|
17 |
||
50972 | 18 |
lemma dist_0_norm: |
19 |
fixes x :: "'a::real_normed_vector" |
|
20 |
shows "dist 0 x = norm x" |
|
21 |
unfolding dist_norm by simp |
|
22 |
||
50943
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
23 |
lemma dist_double: "dist x y < d / 2 \<Longrightarrow> dist x z < d / 2 \<Longrightarrow> dist y z < d" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
24 |
using dist_triangle[of y z x] by (simp add: dist_commute) |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
25 |
|
50972 | 26 |
(* LEGACY *) |
53640 | 27 |
lemma lim_subseq: "subseq r \<Longrightarrow> s ----> l \<Longrightarrow> (s \<circ> r) ----> l" |
50972 | 28 |
by (rule LIMSEQ_subseq_LIMSEQ) |
29 |
||
53282 | 30 |
lemma countable_PiE: |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
31 |
"finite I \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> countable (F i)) \<Longrightarrow> countable (PiE I F)" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
32 |
by (induct I arbitrary: F rule: finite_induct) (auto simp: PiE_insert_eq) |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
33 |
|
51481
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents:
51480
diff
changeset
|
34 |
lemma Lim_within_open: |
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents:
51480
diff
changeset
|
35 |
fixes f :: "'a::topological_space \<Rightarrow> 'b::topological_space" |
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents:
51480
diff
changeset
|
36 |
shows "a \<in> S \<Longrightarrow> open S \<Longrightarrow> (f ---> l)(at a within S) \<longleftrightarrow> (f ---> l)(at a)" |
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents:
51480
diff
changeset
|
37 |
by (fact tendsto_within_open) |
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents:
51480
diff
changeset
|
38 |
|
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents:
51480
diff
changeset
|
39 |
lemma continuous_on_union: |
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents:
51480
diff
changeset
|
40 |
"closed s \<Longrightarrow> closed t \<Longrightarrow> continuous_on s f \<Longrightarrow> continuous_on t f \<Longrightarrow> continuous_on (s \<union> t) f" |
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents:
51480
diff
changeset
|
41 |
by (fact continuous_on_closed_Un) |
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents:
51480
diff
changeset
|
42 |
|
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents:
51480
diff
changeset
|
43 |
lemma continuous_on_cases: |
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents:
51480
diff
changeset
|
44 |
"closed s \<Longrightarrow> closed t \<Longrightarrow> continuous_on s f \<Longrightarrow> continuous_on t g \<Longrightarrow> |
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents:
51480
diff
changeset
|
45 |
\<forall>x. (x\<in>s \<and> \<not> P x) \<or> (x \<in> t \<and> P x) \<longrightarrow> f x = g x \<Longrightarrow> |
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents:
51480
diff
changeset
|
46 |
continuous_on (s \<union> t) (\<lambda>x. if P x then f x else g x)" |
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents:
51480
diff
changeset
|
47 |
by (rule continuous_on_If) auto |
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents:
51480
diff
changeset
|
48 |
|
53255 | 49 |
|
60420 | 50 |
subsection \<open>Topological Basis\<close> |
50087 | 51 |
|
52 |
context topological_space |
|
53 |
begin |
|
54 |
||
53291 | 55 |
definition "topological_basis B \<longleftrightarrow> |
56 |
(\<forall>b\<in>B. open b) \<and> (\<forall>x. open x \<longrightarrow> (\<exists>B'. B' \<subseteq> B \<and> \<Union>B' = x))" |
|
51343
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
57 |
|
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
58 |
lemma topological_basis: |
53291 | 59 |
"topological_basis B \<longleftrightarrow> (\<forall>x. open x \<longleftrightarrow> (\<exists>B'. B' \<subseteq> B \<and> \<Union>B' = x))" |
50998 | 60 |
unfolding topological_basis_def |
61 |
apply safe |
|
62 |
apply fastforce |
|
63 |
apply fastforce |
|
64 |
apply (erule_tac x="x" in allE) |
|
65 |
apply simp |
|
66 |
apply (rule_tac x="{x}" in exI) |
|
67 |
apply auto |
|
68 |
done |
|
69 |
||
50087 | 70 |
lemma topological_basis_iff: |
71 |
assumes "\<And>B'. B' \<in> B \<Longrightarrow> open B'" |
|
72 |
shows "topological_basis B \<longleftrightarrow> (\<forall>O'. open O' \<longrightarrow> (\<forall>x\<in>O'. \<exists>B'\<in>B. x \<in> B' \<and> B' \<subseteq> O'))" |
|
73 |
(is "_ \<longleftrightarrow> ?rhs") |
|
74 |
proof safe |
|
75 |
fix O' and x::'a |
|
76 |
assume H: "topological_basis B" "open O'" "x \<in> O'" |
|
53282 | 77 |
then have "(\<exists>B'\<subseteq>B. \<Union>B' = O')" by (simp add: topological_basis_def) |
50087 | 78 |
then obtain B' where "B' \<subseteq> B" "O' = \<Union>B'" by auto |
53282 | 79 |
then show "\<exists>B'\<in>B. x \<in> B' \<and> B' \<subseteq> O'" using H by auto |
50087 | 80 |
next |
81 |
assume H: ?rhs |
|
53282 | 82 |
show "topological_basis B" |
83 |
using assms unfolding topological_basis_def |
|
50087 | 84 |
proof safe |
53640 | 85 |
fix O' :: "'a set" |
53282 | 86 |
assume "open O'" |
50087 | 87 |
with H obtain f where "\<forall>x\<in>O'. f x \<in> B \<and> x \<in> f x \<and> f x \<subseteq> O'" |
88 |
by (force intro: bchoice simp: Bex_def) |
|
53282 | 89 |
then show "\<exists>B'\<subseteq>B. \<Union>B' = O'" |
50087 | 90 |
by (auto intro: exI[where x="{f x |x. x \<in> O'}"]) |
91 |
qed |
|
92 |
qed |
|
93 |
||
94 |
lemma topological_basisI: |
|
95 |
assumes "\<And>B'. B' \<in> B \<Longrightarrow> open B'" |
|
53282 | 96 |
and "\<And>O' x. open O' \<Longrightarrow> x \<in> O' \<Longrightarrow> \<exists>B'\<in>B. x \<in> B' \<and> B' \<subseteq> O'" |
50087 | 97 |
shows "topological_basis B" |
98 |
using assms by (subst topological_basis_iff) auto |
|
99 |
||
100 |
lemma topological_basisE: |
|
101 |
fixes O' |
|
102 |
assumes "topological_basis B" |
|
53282 | 103 |
and "open O'" |
104 |
and "x \<in> O'" |
|
50087 | 105 |
obtains B' where "B' \<in> B" "x \<in> B'" "B' \<subseteq> O'" |
106 |
proof atomize_elim |
|
53282 | 107 |
from assms have "\<And>B'. B'\<in>B \<Longrightarrow> open B'" |
108 |
by (simp add: topological_basis_def) |
|
50087 | 109 |
with topological_basis_iff assms |
53282 | 110 |
show "\<exists>B'. B' \<in> B \<and> x \<in> B' \<and> B' \<subseteq> O'" |
111 |
using assms by (simp add: Bex_def) |
|
50087 | 112 |
qed |
113 |
||
50094
84ddcf5364b4
allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents:
50087
diff
changeset
|
114 |
lemma topological_basis_open: |
84ddcf5364b4
allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents:
50087
diff
changeset
|
115 |
assumes "topological_basis B" |
53282 | 116 |
and "X \<in> B" |
50094
84ddcf5364b4
allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents:
50087
diff
changeset
|
117 |
shows "open X" |
53282 | 118 |
using assms by (simp add: topological_basis_def) |
50094
84ddcf5364b4
allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents:
50087
diff
changeset
|
119 |
|
51343
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
120 |
lemma topological_basis_imp_subbasis: |
53255 | 121 |
assumes B: "topological_basis B" |
122 |
shows "open = generate_topology B" |
|
51343
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
123 |
proof (intro ext iffI) |
53255 | 124 |
fix S :: "'a set" |
125 |
assume "open S" |
|
51343
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
126 |
with B obtain B' where "B' \<subseteq> B" "S = \<Union>B'" |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
127 |
unfolding topological_basis_def by blast |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
128 |
then show "generate_topology B S" |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
129 |
by (auto intro: generate_topology.intros dest: topological_basis_open) |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
130 |
next |
53255 | 131 |
fix S :: "'a set" |
132 |
assume "generate_topology B S" |
|
133 |
then show "open S" |
|
51343
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
134 |
by induct (auto dest: topological_basis_open[OF B]) |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
135 |
qed |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
136 |
|
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
137 |
lemma basis_dense: |
53640 | 138 |
fixes B :: "'a set set" |
139 |
and f :: "'a set \<Rightarrow> 'a" |
|
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
140 |
assumes "topological_basis B" |
53255 | 141 |
and choosefrom_basis: "\<And>B'. B' \<noteq> {} \<Longrightarrow> f B' \<in> B'" |
55522 | 142 |
shows "\<forall>X. open X \<longrightarrow> X \<noteq> {} \<longrightarrow> (\<exists>B' \<in> B. f B' \<in> X)" |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
143 |
proof (intro allI impI) |
53640 | 144 |
fix X :: "'a set" |
145 |
assume "open X" and "X \<noteq> {}" |
|
60420 | 146 |
from topological_basisE[OF \<open>topological_basis B\<close> \<open>open X\<close> choosefrom_basis[OF \<open>X \<noteq> {}\<close>]] |
55522 | 147 |
obtain B' where "B' \<in> B" "f X \<in> B'" "B' \<subseteq> X" . |
53255 | 148 |
then show "\<exists>B'\<in>B. f B' \<in> X" |
149 |
by (auto intro!: choosefrom_basis) |
|
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
150 |
qed |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
151 |
|
50087 | 152 |
end |
153 |
||
50882
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
154 |
lemma topological_basis_prod: |
53255 | 155 |
assumes A: "topological_basis A" |
156 |
and B: "topological_basis B" |
|
50882
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
157 |
shows "topological_basis ((\<lambda>(a, b). a \<times> b) ` (A \<times> B))" |
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
158 |
unfolding topological_basis_def |
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
159 |
proof (safe, simp_all del: ex_simps add: subset_image_iff ex_simps(1)[symmetric]) |
53255 | 160 |
fix S :: "('a \<times> 'b) set" |
161 |
assume "open S" |
|
50882
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
162 |
then show "\<exists>X\<subseteq>A \<times> B. (\<Union>(a,b)\<in>X. a \<times> b) = S" |
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
163 |
proof (safe intro!: exI[of _ "{x\<in>A \<times> B. fst x \<times> snd x \<subseteq> S}"]) |
53255 | 164 |
fix x y |
165 |
assume "(x, y) \<in> S" |
|
60420 | 166 |
from open_prod_elim[OF \<open>open S\<close> this] |
50882
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
167 |
obtain a b where a: "open a""x \<in> a" and b: "open b" "y \<in> b" and "a \<times> b \<subseteq> S" |
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
168 |
by (metis mem_Sigma_iff) |
55522 | 169 |
moreover |
170 |
from A a obtain A0 where "A0 \<in> A" "x \<in> A0" "A0 \<subseteq> a" |
|
171 |
by (rule topological_basisE) |
|
172 |
moreover |
|
173 |
from B b obtain B0 where "B0 \<in> B" "y \<in> B0" "B0 \<subseteq> b" |
|
174 |
by (rule topological_basisE) |
|
50882
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
175 |
ultimately show "(x, y) \<in> (\<Union>(a, b)\<in>{X \<in> A \<times> B. fst X \<times> snd X \<subseteq> S}. a \<times> b)" |
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
176 |
by (intro UN_I[of "(A0, B0)"]) auto |
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
177 |
qed auto |
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
178 |
qed (metis A B topological_basis_open open_Times) |
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
179 |
|
53255 | 180 |
|
60420 | 181 |
subsection \<open>Countable Basis\<close> |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
182 |
|
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
183 |
locale countable_basis = |
53640 | 184 |
fixes B :: "'a::topological_space set set" |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
185 |
assumes is_basis: "topological_basis B" |
53282 | 186 |
and countable_basis: "countable B" |
33175 | 187 |
begin |
188 |
||
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
189 |
lemma open_countable_basis_ex: |
50087 | 190 |
assumes "open X" |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
191 |
shows "\<exists>B' \<subseteq> B. X = Union B'" |
53255 | 192 |
using assms countable_basis is_basis |
193 |
unfolding topological_basis_def by blast |
|
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
194 |
|
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
195 |
lemma open_countable_basisE: |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
196 |
assumes "open X" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
197 |
obtains B' where "B' \<subseteq> B" "X = Union B'" |
53255 | 198 |
using assms open_countable_basis_ex |
199 |
by (atomize_elim) simp |
|
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
200 |
|
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
201 |
lemma countable_dense_exists: |
53291 | 202 |
"\<exists>D::'a set. countable D \<and> (\<forall>X. open X \<longrightarrow> X \<noteq> {} \<longrightarrow> (\<exists>d \<in> D. d \<in> X))" |
50087 | 203 |
proof - |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
204 |
let ?f = "(\<lambda>B'. SOME x. x \<in> B')" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
205 |
have "countable (?f ` B)" using countable_basis by simp |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
206 |
with basis_dense[OF is_basis, of ?f] show ?thesis |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
207 |
by (intro exI[where x="?f ` B"]) (metis (mono_tags) all_not_in_conv imageI someI) |
50087 | 208 |
qed |
209 |
||
210 |
lemma countable_dense_setE: |
|
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
211 |
obtains D :: "'a set" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
212 |
where "countable D" "\<And>X. open X \<Longrightarrow> X \<noteq> {} \<Longrightarrow> \<exists>d \<in> D. d \<in> X" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
213 |
using countable_dense_exists by blast |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
214 |
|
50087 | 215 |
end |
216 |
||
50883 | 217 |
lemma (in first_countable_topology) first_countable_basisE: |
218 |
obtains A where "countable A" "\<And>a. a \<in> A \<Longrightarrow> x \<in> a" "\<And>a. a \<in> A \<Longrightarrow> open a" |
|
219 |
"\<And>S. open S \<Longrightarrow> x \<in> S \<Longrightarrow> (\<exists>a\<in>A. a \<subseteq> S)" |
|
220 |
using first_countable_basis[of x] |
|
51473 | 221 |
apply atomize_elim |
222 |
apply (elim exE) |
|
223 |
apply (rule_tac x="range A" in exI) |
|
224 |
apply auto |
|
225 |
done |
|
50883 | 226 |
|
51105 | 227 |
lemma (in first_countable_topology) first_countable_basis_Int_stableE: |
228 |
obtains A where "countable A" "\<And>a. a \<in> A \<Longrightarrow> x \<in> a" "\<And>a. a \<in> A \<Longrightarrow> open a" |
|
229 |
"\<And>S. open S \<Longrightarrow> x \<in> S \<Longrightarrow> (\<exists>a\<in>A. a \<subseteq> S)" |
|
230 |
"\<And>a b. a \<in> A \<Longrightarrow> b \<in> A \<Longrightarrow> a \<inter> b \<in> A" |
|
231 |
proof atomize_elim |
|
55522 | 232 |
obtain A' where A': |
233 |
"countable A'" |
|
234 |
"\<And>a. a \<in> A' \<Longrightarrow> x \<in> a" |
|
235 |
"\<And>a. a \<in> A' \<Longrightarrow> open a" |
|
236 |
"\<And>S. open S \<Longrightarrow> x \<in> S \<Longrightarrow> \<exists>a\<in>A'. a \<subseteq> S" |
|
237 |
by (rule first_countable_basisE) blast |
|
51105 | 238 |
def A \<equiv> "(\<lambda>N. \<Inter>((\<lambda>n. from_nat_into A' n) ` N)) ` (Collect finite::nat set set)" |
53255 | 239 |
then show "\<exists>A. countable A \<and> (\<forall>a. a \<in> A \<longrightarrow> x \<in> a) \<and> (\<forall>a. a \<in> A \<longrightarrow> open a) \<and> |
51105 | 240 |
(\<forall>S. open S \<longrightarrow> x \<in> S \<longrightarrow> (\<exists>a\<in>A. a \<subseteq> S)) \<and> (\<forall>a b. a \<in> A \<longrightarrow> b \<in> A \<longrightarrow> a \<inter> b \<in> A)" |
241 |
proof (safe intro!: exI[where x=A]) |
|
53255 | 242 |
show "countable A" |
243 |
unfolding A_def by (intro countable_image countable_Collect_finite) |
|
244 |
fix a |
|
245 |
assume "a \<in> A" |
|
246 |
then show "x \<in> a" "open a" |
|
247 |
using A'(4)[OF open_UNIV] by (auto simp: A_def intro: A' from_nat_into) |
|
51105 | 248 |
next |
52141
eff000cab70f
weaker precendence of syntax for big intersection and union on sets
haftmann
parents:
51773
diff
changeset
|
249 |
let ?int = "\<lambda>N. \<Inter>(from_nat_into A' ` N)" |
53255 | 250 |
fix a b |
251 |
assume "a \<in> A" "b \<in> A" |
|
252 |
then obtain N M where "a = ?int N" "b = ?int M" "finite (N \<union> M)" |
|
253 |
by (auto simp: A_def) |
|
254 |
then show "a \<inter> b \<in> A" |
|
255 |
by (auto simp: A_def intro!: image_eqI[where x="N \<union> M"]) |
|
51105 | 256 |
next |
53255 | 257 |
fix S |
258 |
assume "open S" "x \<in> S" |
|
259 |
then obtain a where a: "a\<in>A'" "a \<subseteq> S" using A' by blast |
|
260 |
then show "\<exists>a\<in>A. a \<subseteq> S" using a A' |
|
51105 | 261 |
by (intro bexI[where x=a]) (auto simp: A_def intro: image_eqI[where x="{to_nat_on A' a}"]) |
262 |
qed |
|
263 |
qed |
|
264 |
||
51473 | 265 |
lemma (in topological_space) first_countableI: |
53255 | 266 |
assumes "countable A" |
267 |
and 1: "\<And>a. a \<in> A \<Longrightarrow> x \<in> a" "\<And>a. a \<in> A \<Longrightarrow> open a" |
|
268 |
and 2: "\<And>S. open S \<Longrightarrow> x \<in> S \<Longrightarrow> \<exists>a\<in>A. a \<subseteq> S" |
|
51473 | 269 |
shows "\<exists>A::nat \<Rightarrow> 'a set. (\<forall>i. x \<in> A i \<and> open (A i)) \<and> (\<forall>S. open S \<and> x \<in> S \<longrightarrow> (\<exists>i. A i \<subseteq> S))" |
270 |
proof (safe intro!: exI[of _ "from_nat_into A"]) |
|
53255 | 271 |
fix i |
51473 | 272 |
have "A \<noteq> {}" using 2[of UNIV] by auto |
53255 | 273 |
show "x \<in> from_nat_into A i" "open (from_nat_into A i)" |
60420 | 274 |
using range_from_nat_into_subset[OF \<open>A \<noteq> {}\<close>] 1 by auto |
53255 | 275 |
next |
276 |
fix S |
|
277 |
assume "open S" "x\<in>S" from 2[OF this] |
|
278 |
show "\<exists>i. from_nat_into A i \<subseteq> S" |
|
60420 | 279 |
using subset_range_from_nat_into[OF \<open>countable A\<close>] by auto |
51473 | 280 |
qed |
51350 | 281 |
|
50883 | 282 |
instance prod :: (first_countable_topology, first_countable_topology) first_countable_topology |
283 |
proof |
|
284 |
fix x :: "'a \<times> 'b" |
|
55522 | 285 |
obtain A where A: |
286 |
"countable A" |
|
287 |
"\<And>a. a \<in> A \<Longrightarrow> fst x \<in> a" |
|
288 |
"\<And>a. a \<in> A \<Longrightarrow> open a" |
|
289 |
"\<And>S. open S \<Longrightarrow> fst x \<in> S \<Longrightarrow> \<exists>a\<in>A. a \<subseteq> S" |
|
290 |
by (rule first_countable_basisE[of "fst x"]) blast |
|
291 |
obtain B where B: |
|
292 |
"countable B" |
|
293 |
"\<And>a. a \<in> B \<Longrightarrow> snd x \<in> a" |
|
294 |
"\<And>a. a \<in> B \<Longrightarrow> open a" |
|
295 |
"\<And>S. open S \<Longrightarrow> snd x \<in> S \<Longrightarrow> \<exists>a\<in>B. a \<subseteq> S" |
|
296 |
by (rule first_countable_basisE[of "snd x"]) blast |
|
53282 | 297 |
show "\<exists>A::nat \<Rightarrow> ('a \<times> 'b) set. |
298 |
(\<forall>i. x \<in> A i \<and> open (A i)) \<and> (\<forall>S. open S \<and> x \<in> S \<longrightarrow> (\<exists>i. A i \<subseteq> S))" |
|
51473 | 299 |
proof (rule first_countableI[of "(\<lambda>(a, b). a \<times> b) ` (A \<times> B)"], safe) |
53255 | 300 |
fix a b |
301 |
assume x: "a \<in> A" "b \<in> B" |
|
53640 | 302 |
with A(2, 3)[of a] B(2, 3)[of b] show "x \<in> a \<times> b" and "open (a \<times> b)" |
303 |
unfolding mem_Times_iff |
|
304 |
by (auto intro: open_Times) |
|
50883 | 305 |
next |
53255 | 306 |
fix S |
307 |
assume "open S" "x \<in> S" |
|
55522 | 308 |
then obtain a' b' where a'b': "open a'" "open b'" "x \<in> a' \<times> b'" "a' \<times> b' \<subseteq> S" |
309 |
by (rule open_prod_elim) |
|
310 |
moreover |
|
311 |
from a'b' A(4)[of a'] B(4)[of b'] |
|
312 |
obtain a b where "a \<in> A" "a \<subseteq> a'" "b \<in> B" "b \<subseteq> b'" |
|
313 |
by auto |
|
314 |
ultimately |
|
315 |
show "\<exists>a\<in>(\<lambda>(a, b). a \<times> b) ` (A \<times> B). a \<subseteq> S" |
|
50883 | 316 |
by (auto intro!: bexI[of _ "a \<times> b"] bexI[of _ a] bexI[of _ b]) |
317 |
qed (simp add: A B) |
|
318 |
qed |
|
319 |
||
50881
ae630bab13da
renamed countable_basis_space to second_countable_topology
hoelzl
parents:
50526
diff
changeset
|
320 |
class second_countable_topology = topological_space + |
53282 | 321 |
assumes ex_countable_subbasis: |
322 |
"\<exists>B::'a::topological_space set set. countable B \<and> open = generate_topology B" |
|
51343
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
323 |
begin |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
324 |
|
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
325 |
lemma ex_countable_basis: "\<exists>B::'a set set. countable B \<and> topological_basis B" |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
326 |
proof - |
53255 | 327 |
from ex_countable_subbasis obtain B where B: "countable B" "open = generate_topology B" |
328 |
by blast |
|
51343
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
329 |
let ?B = "Inter ` {b. finite b \<and> b \<subseteq> B }" |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
330 |
|
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
331 |
show ?thesis |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
332 |
proof (intro exI conjI) |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
333 |
show "countable ?B" |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
334 |
by (intro countable_image countable_Collect_finite_subset B) |
53255 | 335 |
{ |
336 |
fix S |
|
337 |
assume "open S" |
|
51343
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
338 |
then have "\<exists>B'\<subseteq>{b. finite b \<and> b \<subseteq> B}. (\<Union>b\<in>B'. \<Inter>b) = S" |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
339 |
unfolding B |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
340 |
proof induct |
53255 | 341 |
case UNIV |
342 |
show ?case by (intro exI[of _ "{{}}"]) simp |
|
51343
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
343 |
next |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
344 |
case (Int a b) |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
345 |
then obtain x y where x: "a = UNION x Inter" "\<And>i. i \<in> x \<Longrightarrow> finite i \<and> i \<subseteq> B" |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
346 |
and y: "b = UNION y Inter" "\<And>i. i \<in> y \<Longrightarrow> finite i \<and> i \<subseteq> B" |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
347 |
by blast |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
348 |
show ?case |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
349 |
unfolding x y Int_UN_distrib2 |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
350 |
by (intro exI[of _ "{i \<union> j| i j. i \<in> x \<and> j \<in> y}"]) (auto dest: x(2) y(2)) |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
351 |
next |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
352 |
case (UN K) |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
353 |
then have "\<forall>k\<in>K. \<exists>B'\<subseteq>{b. finite b \<and> b \<subseteq> B}. UNION B' Inter = k" by auto |
55522 | 354 |
then obtain k where |
355 |
"\<forall>ka\<in>K. k ka \<subseteq> {b. finite b \<and> b \<subseteq> B} \<and> UNION (k ka) Inter = ka" |
|
356 |
unfolding bchoice_iff .. |
|
51343
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
357 |
then show "\<exists>B'\<subseteq>{b. finite b \<and> b \<subseteq> B}. UNION B' Inter = \<Union>K" |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
358 |
by (intro exI[of _ "UNION K k"]) auto |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
359 |
next |
53255 | 360 |
case (Basis S) |
361 |
then show ?case |
|
51343
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
362 |
by (intro exI[of _ "{{S}}"]) auto |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
363 |
qed |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
364 |
then have "(\<exists>B'\<subseteq>Inter ` {b. finite b \<and> b \<subseteq> B}. \<Union>B' = S)" |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
365 |
unfolding subset_image_iff by blast } |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
366 |
then show "topological_basis ?B" |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
367 |
unfolding topological_space_class.topological_basis_def |
53282 | 368 |
by (safe intro!: topological_space_class.open_Inter) |
51343
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
369 |
(simp_all add: B generate_topology.Basis subset_eq) |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
370 |
qed |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
371 |
qed |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
372 |
|
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
373 |
end |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
374 |
|
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
375 |
sublocale second_countable_topology < |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
376 |
countable_basis "SOME B. countable B \<and> topological_basis B" |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
377 |
using someI_ex[OF ex_countable_basis] |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
378 |
by unfold_locales safe |
50094
84ddcf5364b4
allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents:
50087
diff
changeset
|
379 |
|
50882
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
380 |
instance prod :: (second_countable_topology, second_countable_topology) second_countable_topology |
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
381 |
proof |
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
382 |
obtain A :: "'a set set" where "countable A" "topological_basis A" |
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
383 |
using ex_countable_basis by auto |
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
384 |
moreover |
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
385 |
obtain B :: "'b set set" where "countable B" "topological_basis B" |
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
386 |
using ex_countable_basis by auto |
51343
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
387 |
ultimately show "\<exists>B::('a \<times> 'b) set set. countable B \<and> open = generate_topology B" |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
388 |
by (auto intro!: exI[of _ "(\<lambda>(a, b). a \<times> b) ` (A \<times> B)"] topological_basis_prod |
b61b32f62c78
use generate_topology for second countable topologies, does not require intersection stable basis
hoelzl
parents:
51342
diff
changeset
|
389 |
topological_basis_imp_subbasis) |
50882
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
390 |
qed |
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
391 |
|
50883 | 392 |
instance second_countable_topology \<subseteq> first_countable_topology |
393 |
proof |
|
394 |
fix x :: 'a |
|
395 |
def B \<equiv> "SOME B::'a set set. countable B \<and> topological_basis B" |
|
396 |
then have B: "countable B" "topological_basis B" |
|
397 |
using countable_basis is_basis |
|
398 |
by (auto simp: countable_basis is_basis) |
|
53282 | 399 |
then show "\<exists>A::nat \<Rightarrow> 'a set. |
400 |
(\<forall>i. x \<in> A i \<and> open (A i)) \<and> (\<forall>S. open S \<and> x \<in> S \<longrightarrow> (\<exists>i. A i \<subseteq> S))" |
|
51473 | 401 |
by (intro first_countableI[of "{b\<in>B. x \<in> b}"]) |
402 |
(fastforce simp: topological_space_class.topological_basis_def)+ |
|
50883 | 403 |
qed |
404 |
||
53255 | 405 |
|
60420 | 406 |
subsection \<open>Polish spaces\<close> |
407 |
||
408 |
text \<open>Textbooks define Polish spaces as completely metrizable. |
|
409 |
We assume the topology to be complete for a given metric.\<close> |
|
50087 | 410 |
|
50881
ae630bab13da
renamed countable_basis_space to second_countable_topology
hoelzl
parents:
50526
diff
changeset
|
411 |
class polish_space = complete_space + second_countable_topology |
50087 | 412 |
|
60420 | 413 |
subsection \<open>General notion of a topology as a value\<close> |
33175 | 414 |
|
53255 | 415 |
definition "istopology L \<longleftrightarrow> |
60585 | 416 |
L {} \<and> (\<forall>S T. L S \<longrightarrow> L T \<longrightarrow> L (S \<inter> T)) \<and> (\<forall>K. Ball K L \<longrightarrow> L (\<Union>K))" |
53255 | 417 |
|
49834 | 418 |
typedef 'a topology = "{L::('a set) \<Rightarrow> bool. istopology L}" |
33175 | 419 |
morphisms "openin" "topology" |
420 |
unfolding istopology_def by blast |
|
421 |
||
422 |
lemma istopology_open_in[intro]: "istopology(openin U)" |
|
423 |
using openin[of U] by blast |
|
424 |
||
425 |
lemma topology_inverse': "istopology U \<Longrightarrow> openin (topology U) = U" |
|
44170
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44167
diff
changeset
|
426 |
using topology_inverse[unfolded mem_Collect_eq] . |
33175 | 427 |
|
428 |
lemma topology_inverse_iff: "istopology U \<longleftrightarrow> openin (topology U) = U" |
|
429 |
using topology_inverse[of U] istopology_open_in[of "topology U"] by auto |
|
430 |
||
431 |
lemma topology_eq: "T1 = T2 \<longleftrightarrow> (\<forall>S. openin T1 S \<longleftrightarrow> openin T2 S)" |
|
53255 | 432 |
proof |
433 |
assume "T1 = T2" |
|
434 |
then show "\<forall>S. openin T1 S \<longleftrightarrow> openin T2 S" by simp |
|
435 |
next |
|
436 |
assume H: "\<forall>S. openin T1 S \<longleftrightarrow> openin T2 S" |
|
437 |
then have "openin T1 = openin T2" by (simp add: fun_eq_iff) |
|
438 |
then have "topology (openin T1) = topology (openin T2)" by simp |
|
439 |
then show "T1 = T2" unfolding openin_inverse . |
|
33175 | 440 |
qed |
441 |
||
60420 | 442 |
text\<open>Infer the "universe" from union of all sets in the topology.\<close> |
33175 | 443 |
|
53640 | 444 |
definition "topspace T = \<Union>{S. openin T S}" |
33175 | 445 |
|
60420 | 446 |
subsubsection \<open>Main properties of open sets\<close> |
33175 | 447 |
|
448 |
lemma openin_clauses: |
|
449 |
fixes U :: "'a topology" |
|
53282 | 450 |
shows |
451 |
"openin U {}" |
|
452 |
"\<And>S T. openin U S \<Longrightarrow> openin U T \<Longrightarrow> openin U (S\<inter>T)" |
|
453 |
"\<And>K. (\<forall>S \<in> K. openin U S) \<Longrightarrow> openin U (\<Union>K)" |
|
454 |
using openin[of U] unfolding istopology_def mem_Collect_eq by fast+ |
|
33175 | 455 |
|
456 |
lemma openin_subset[intro]: "openin U S \<Longrightarrow> S \<subseteq> topspace U" |
|
457 |
unfolding topspace_def by blast |
|
53255 | 458 |
|
459 |
lemma openin_empty[simp]: "openin U {}" |
|
460 |
by (simp add: openin_clauses) |
|
33175 | 461 |
|
462 |
lemma openin_Int[intro]: "openin U S \<Longrightarrow> openin U T \<Longrightarrow> openin U (S \<inter> T)" |
|
36362
06475a1547cb
fix lots of looping simp calls and other warnings
huffman
parents:
36360
diff
changeset
|
463 |
using openin_clauses by simp |
06475a1547cb
fix lots of looping simp calls and other warnings
huffman
parents:
36360
diff
changeset
|
464 |
|
60585 | 465 |
lemma openin_Union[intro]: "(\<forall>S \<in>K. openin U S) \<Longrightarrow> openin U (\<Union>K)" |
36362
06475a1547cb
fix lots of looping simp calls and other warnings
huffman
parents:
36360
diff
changeset
|
466 |
using openin_clauses by simp |
33175 | 467 |
|
468 |
lemma openin_Un[intro]: "openin U S \<Longrightarrow> openin U T \<Longrightarrow> openin U (S \<union> T)" |
|
469 |
using openin_Union[of "{S,T}" U] by auto |
|
470 |
||
53255 | 471 |
lemma openin_topspace[intro, simp]: "openin U (topspace U)" |
472 |
by (simp add: openin_Union topspace_def) |
|
33175 | 473 |
|
49711 | 474 |
lemma openin_subopen: "openin U S \<longleftrightarrow> (\<forall>x \<in> S. \<exists>T. openin U T \<and> x \<in> T \<and> T \<subseteq> S)" |
475 |
(is "?lhs \<longleftrightarrow> ?rhs") |
|
36584 | 476 |
proof |
49711 | 477 |
assume ?lhs |
478 |
then show ?rhs by auto |
|
36584 | 479 |
next |
480 |
assume H: ?rhs |
|
481 |
let ?t = "\<Union>{T. openin U T \<and> T \<subseteq> S}" |
|
482 |
have "openin U ?t" by (simp add: openin_Union) |
|
483 |
also have "?t = S" using H by auto |
|
484 |
finally show "openin U S" . |
|
33175 | 485 |
qed |
486 |
||
49711 | 487 |
|
60420 | 488 |
subsubsection \<open>Closed sets\<close> |
33175 | 489 |
|
490 |
definition "closedin U S \<longleftrightarrow> S \<subseteq> topspace U \<and> openin U (topspace U - S)" |
|
491 |
||
53255 | 492 |
lemma closedin_subset: "closedin U S \<Longrightarrow> S \<subseteq> topspace U" |
493 |
by (metis closedin_def) |
|
494 |
||
495 |
lemma closedin_empty[simp]: "closedin U {}" |
|
496 |
by (simp add: closedin_def) |
|
497 |
||
498 |
lemma closedin_topspace[intro, simp]: "closedin U (topspace U)" |
|
499 |
by (simp add: closedin_def) |
|
500 |
||
33175 | 501 |
lemma closedin_Un[intro]: "closedin U S \<Longrightarrow> closedin U T \<Longrightarrow> closedin U (S \<union> T)" |
502 |
by (auto simp add: Diff_Un closedin_def) |
|
503 |
||
60585 | 504 |
lemma Diff_Inter[intro]: "A - \<Inter>S = \<Union>{A - s|s. s\<in>S}" |
53255 | 505 |
by auto |
506 |
||
507 |
lemma closedin_Inter[intro]: |
|
508 |
assumes Ke: "K \<noteq> {}" |
|
509 |
and Kc: "\<forall>S \<in>K. closedin U S" |
|
60585 | 510 |
shows "closedin U (\<Inter>K)" |
53255 | 511 |
using Ke Kc unfolding closedin_def Diff_Inter by auto |
33175 | 512 |
|
513 |
lemma closedin_Int[intro]: "closedin U S \<Longrightarrow> closedin U T \<Longrightarrow> closedin U (S \<inter> T)" |
|
514 |
using closedin_Inter[of "{S,T}" U] by auto |
|
515 |
||
516 |
lemma openin_closedin_eq: "openin U S \<longleftrightarrow> S \<subseteq> topspace U \<and> closedin U (topspace U - S)" |
|
517 |
apply (auto simp add: closedin_def Diff_Diff_Int inf_absorb2) |
|
518 |
apply (metis openin_subset subset_eq) |
|
519 |
done |
|
520 |
||
53255 | 521 |
lemma openin_closedin: "S \<subseteq> topspace U \<Longrightarrow> (openin U S \<longleftrightarrow> closedin U (topspace U - S))" |
33175 | 522 |
by (simp add: openin_closedin_eq) |
523 |
||
53255 | 524 |
lemma openin_diff[intro]: |
525 |
assumes oS: "openin U S" |
|
526 |
and cT: "closedin U T" |
|
527 |
shows "openin U (S - T)" |
|
528 |
proof - |
|
33175 | 529 |
have "S - T = S \<inter> (topspace U - T)" using openin_subset[of U S] oS cT |
530 |
by (auto simp add: topspace_def openin_subset) |
|
53282 | 531 |
then show ?thesis using oS cT |
532 |
by (auto simp add: closedin_def) |
|
33175 | 533 |
qed |
534 |
||
53255 | 535 |
lemma closedin_diff[intro]: |
536 |
assumes oS: "closedin U S" |
|
537 |
and cT: "openin U T" |
|
538 |
shows "closedin U (S - T)" |
|
539 |
proof - |
|
540 |
have "S - T = S \<inter> (topspace U - T)" |
|
53282 | 541 |
using closedin_subset[of U S] oS cT by (auto simp add: topspace_def) |
53255 | 542 |
then show ?thesis |
543 |
using oS cT by (auto simp add: openin_closedin_eq) |
|
544 |
qed |
|
545 |
||
33175 | 546 |
|
60420 | 547 |
subsubsection \<open>Subspace topology\<close> |
44170
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44167
diff
changeset
|
548 |
|
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44167
diff
changeset
|
549 |
definition "subtopology U V = topology (\<lambda>T. \<exists>S. T = S \<inter> V \<and> openin U S)" |
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44167
diff
changeset
|
550 |
|
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44167
diff
changeset
|
551 |
lemma istopology_subtopology: "istopology (\<lambda>T. \<exists>S. T = S \<inter> V \<and> openin U S)" |
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44167
diff
changeset
|
552 |
(is "istopology ?L") |
53255 | 553 |
proof - |
44170
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44167
diff
changeset
|
554 |
have "?L {}" by blast |
53255 | 555 |
{ |
556 |
fix A B |
|
557 |
assume A: "?L A" and B: "?L B" |
|
558 |
from A B obtain Sa and Sb where Sa: "openin U Sa" "A = Sa \<inter> V" and Sb: "openin U Sb" "B = Sb \<inter> V" |
|
559 |
by blast |
|
560 |
have "A \<inter> B = (Sa \<inter> Sb) \<inter> V" "openin U (Sa \<inter> Sb)" |
|
561 |
using Sa Sb by blast+ |
|
562 |
then have "?L (A \<inter> B)" by blast |
|
563 |
} |
|
33175 | 564 |
moreover |
53255 | 565 |
{ |
53282 | 566 |
fix K |
567 |
assume K: "K \<subseteq> Collect ?L" |
|
44170
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44167
diff
changeset
|
568 |
have th0: "Collect ?L = (\<lambda>S. S \<inter> V) ` Collect (openin U)" |
55775 | 569 |
by blast |
33175 | 570 |
from K[unfolded th0 subset_image_iff] |
53255 | 571 |
obtain Sk where Sk: "Sk \<subseteq> Collect (openin U)" "K = (\<lambda>S. S \<inter> V) ` Sk" |
572 |
by blast |
|
573 |
have "\<Union>K = (\<Union>Sk) \<inter> V" |
|
574 |
using Sk by auto |
|
60585 | 575 |
moreover have "openin U (\<Union>Sk)" |
53255 | 576 |
using Sk by (auto simp add: subset_eq) |
577 |
ultimately have "?L (\<Union>K)" by blast |
|
578 |
} |
|
44170
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44167
diff
changeset
|
579 |
ultimately show ?thesis |
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44167
diff
changeset
|
580 |
unfolding subset_eq mem_Collect_eq istopology_def by blast |
33175 | 581 |
qed |
582 |
||
53255 | 583 |
lemma openin_subtopology: "openin (subtopology U V) S \<longleftrightarrow> (\<exists>T. openin U T \<and> S = T \<inter> V)" |
33175 | 584 |
unfolding subtopology_def topology_inverse'[OF istopology_subtopology] |
44170
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44167
diff
changeset
|
585 |
by auto |
33175 | 586 |
|
53255 | 587 |
lemma topspace_subtopology: "topspace (subtopology U V) = topspace U \<inter> V" |
33175 | 588 |
by (auto simp add: topspace_def openin_subtopology) |
589 |
||
53255 | 590 |
lemma closedin_subtopology: "closedin (subtopology U V) S \<longleftrightarrow> (\<exists>T. closedin U T \<and> S = T \<inter> V)" |
33175 | 591 |
unfolding closedin_def topspace_subtopology |
55775 | 592 |
by (auto simp add: openin_subtopology) |
33175 | 593 |
|
594 |
lemma openin_subtopology_refl: "openin (subtopology U V) V \<longleftrightarrow> V \<subseteq> topspace U" |
|
595 |
unfolding openin_subtopology |
|
55775 | 596 |
by auto (metis IntD1 in_mono openin_subset) |
49711 | 597 |
|
598 |
lemma subtopology_superset: |
|
599 |
assumes UV: "topspace U \<subseteq> V" |
|
33175 | 600 |
shows "subtopology U V = U" |
53255 | 601 |
proof - |
602 |
{ |
|
603 |
fix S |
|
604 |
{ |
|
605 |
fix T |
|
606 |
assume T: "openin U T" "S = T \<inter> V" |
|
607 |
from T openin_subset[OF T(1)] UV have eq: "S = T" |
|
608 |
by blast |
|
609 |
have "openin U S" |
|
610 |
unfolding eq using T by blast |
|
611 |
} |
|
33175 | 612 |
moreover |
53255 | 613 |
{ |
614 |
assume S: "openin U S" |
|
615 |
then have "\<exists>T. openin U T \<and> S = T \<inter> V" |
|
616 |
using openin_subset[OF S] UV by auto |
|
617 |
} |
|
618 |
ultimately have "(\<exists>T. openin U T \<and> S = T \<inter> V) \<longleftrightarrow> openin U S" |
|
619 |
by blast |
|
620 |
} |
|
621 |
then show ?thesis |
|
622 |
unfolding topology_eq openin_subtopology by blast |
|
33175 | 623 |
qed |
624 |
||
625 |
lemma subtopology_topspace[simp]: "subtopology U (topspace U) = U" |
|
626 |
by (simp add: subtopology_superset) |
|
627 |
||
628 |
lemma subtopology_UNIV[simp]: "subtopology U UNIV = U" |
|
629 |
by (simp add: subtopology_superset) |
|
630 |
||
53255 | 631 |
|
60420 | 632 |
subsubsection \<open>The standard Euclidean topology\<close> |
33175 | 633 |
|
53255 | 634 |
definition euclidean :: "'a::topological_space topology" |
635 |
where "euclidean = topology open" |
|
33175 | 636 |
|
637 |
lemma open_openin: "open S \<longleftrightarrow> openin euclidean S" |
|
638 |
unfolding euclidean_def |
|
639 |
apply (rule cong[where x=S and y=S]) |
|
640 |
apply (rule topology_inverse[symmetric]) |
|
641 |
apply (auto simp add: istopology_def) |
|
44170
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44167
diff
changeset
|
642 |
done |
33175 | 643 |
|
644 |
lemma topspace_euclidean: "topspace euclidean = UNIV" |
|
645 |
apply (simp add: topspace_def) |
|
39302
d7728f65b353
renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
nipkow
parents:
39198
diff
changeset
|
646 |
apply (rule set_eqI) |
53255 | 647 |
apply (auto simp add: open_openin[symmetric]) |
648 |
done |
|
33175 | 649 |
|
650 |
lemma topspace_euclidean_subtopology[simp]: "topspace (subtopology euclidean S) = S" |
|
651 |
by (simp add: topspace_euclidean topspace_subtopology) |
|
652 |
||
653 |
lemma closed_closedin: "closed S \<longleftrightarrow> closedin euclidean S" |
|
654 |
by (simp add: closed_def closedin_def topspace_euclidean open_openin Compl_eq_Diff_UNIV) |
|
655 |
||
656 |
lemma open_subopen: "open S \<longleftrightarrow> (\<forall>x\<in>S. \<exists>T. open T \<and> x \<in> T \<and> T \<subseteq> S)" |
|
657 |
by (simp add: open_openin openin_subopen[symmetric]) |
|
658 |
||
60420 | 659 |
text \<open>Basic "localization" results are handy for connectedness.\<close> |
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
660 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
661 |
lemma openin_open: "openin (subtopology euclidean U) S \<longleftrightarrow> (\<exists>T. open T \<and> (S = U \<inter> T))" |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
662 |
by (auto simp add: openin_subtopology open_openin[symmetric]) |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
663 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
664 |
lemma openin_open_Int[intro]: "open S \<Longrightarrow> openin (subtopology euclidean U) (U \<inter> S)" |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
665 |
by (auto simp add: openin_open) |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
666 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
667 |
lemma open_openin_trans[trans]: |
53255 | 668 |
"open S \<Longrightarrow> open T \<Longrightarrow> T \<subseteq> S \<Longrightarrow> openin (subtopology euclidean S) T" |
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
669 |
by (metis Int_absorb1 openin_open_Int) |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
670 |
|
53255 | 671 |
lemma open_subset: "S \<subseteq> T \<Longrightarrow> open S \<Longrightarrow> openin (subtopology euclidean T) S" |
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
672 |
by (auto simp add: openin_open) |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
673 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
674 |
lemma closedin_closed: "closedin (subtopology euclidean U) S \<longleftrightarrow> (\<exists>T. closed T \<and> S = U \<inter> T)" |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
675 |
by (simp add: closedin_subtopology closed_closedin Int_ac) |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
676 |
|
53291 | 677 |
lemma closedin_closed_Int: "closed S \<Longrightarrow> closedin (subtopology euclidean U) (U \<inter> S)" |
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
678 |
by (metis closedin_closed) |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
679 |
|
53282 | 680 |
lemma closed_closedin_trans: |
681 |
"closed S \<Longrightarrow> closed T \<Longrightarrow> T \<subseteq> S \<Longrightarrow> closedin (subtopology euclidean S) T" |
|
55775 | 682 |
by (metis closedin_closed inf.absorb2) |
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
683 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
684 |
lemma closed_subset: "S \<subseteq> T \<Longrightarrow> closed S \<Longrightarrow> closedin (subtopology euclidean T) S" |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
685 |
by (auto simp add: closedin_closed) |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
686 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
687 |
lemma openin_euclidean_subtopology_iff: |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
688 |
fixes S U :: "'a::metric_space set" |
53255 | 689 |
shows "openin (subtopology euclidean U) S \<longleftrightarrow> |
690 |
S \<subseteq> U \<and> (\<forall>x\<in>S. \<exists>e>0. \<forall>x'\<in>U. dist x' x < e \<longrightarrow> x'\<in> S)" |
|
691 |
(is "?lhs \<longleftrightarrow> ?rhs") |
|
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
692 |
proof |
53255 | 693 |
assume ?lhs |
53282 | 694 |
then show ?rhs |
695 |
unfolding openin_open open_dist by blast |
|
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
696 |
next |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
697 |
def T \<equiv> "{x. \<exists>a\<in>S. \<exists>d>0. (\<forall>y\<in>U. dist y a < d \<longrightarrow> y \<in> S) \<and> dist x a < d}" |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
698 |
have 1: "\<forall>x\<in>T. \<exists>e>0. \<forall>y. dist y x < e \<longrightarrow> y \<in> T" |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
699 |
unfolding T_def |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
700 |
apply clarsimp |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
701 |
apply (rule_tac x="d - dist x a" in exI) |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
702 |
apply (clarsimp simp add: less_diff_eq) |
55775 | 703 |
by (metis dist_commute dist_triangle_lt) |
53282 | 704 |
assume ?rhs then have 2: "S = U \<inter> T" |
60141
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60040
diff
changeset
|
705 |
unfolding T_def |
55775 | 706 |
by auto (metis dist_self) |
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
707 |
from 1 2 show ?lhs |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
708 |
unfolding openin_open open_dist by fast |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
709 |
qed |
61306
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
710 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
711 |
lemma connected_open_in: |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
712 |
"connected s \<longleftrightarrow> |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
713 |
~(\<exists>e1 e2. openin (subtopology euclidean s) e1 \<and> |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
714 |
openin (subtopology euclidean s) e2 \<and> |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
715 |
s \<subseteq> e1 \<union> e2 \<and> e1 \<inter> e2 = {} \<and> e1 \<noteq> {} \<and> e2 \<noteq> {})" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
716 |
apply (simp add: connected_def openin_open, safe) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
717 |
apply (simp_all, blast+) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
718 |
done |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
719 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
720 |
lemma connected_open_in_eq: |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
721 |
"connected s \<longleftrightarrow> |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
722 |
~(\<exists>e1 e2. openin (subtopology euclidean s) e1 \<and> |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
723 |
openin (subtopology euclidean s) e2 \<and> |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
724 |
e1 \<union> e2 = s \<and> e1 \<inter> e2 = {} \<and> |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
725 |
e1 \<noteq> {} \<and> e2 \<noteq> {})" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
726 |
apply (simp add: connected_open_in, safe) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
727 |
apply blast |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
728 |
by (metis Int_lower1 Un_subset_iff openin_open subset_antisym) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
729 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
730 |
lemma connected_closed_in: |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
731 |
"connected s \<longleftrightarrow> |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
732 |
~(\<exists>e1 e2. |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
733 |
closedin (subtopology euclidean s) e1 \<and> |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
734 |
closedin (subtopology euclidean s) e2 \<and> |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
735 |
s \<subseteq> e1 \<union> e2 \<and> e1 \<inter> e2 = {} \<and> |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
736 |
e1 \<noteq> {} \<and> e2 \<noteq> {})" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
737 |
proof - |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
738 |
{ fix A B x x' |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
739 |
assume s_sub: "s \<subseteq> A \<union> B" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
740 |
and disj: "A \<inter> B \<inter> s = {}" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
741 |
and x: "x \<in> s" "x \<in> B" and x': "x' \<in> s" "x' \<in> A" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
742 |
and cl: "closed A" "closed B" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
743 |
assume "\<forall>e1. (\<forall>T. closed T \<longrightarrow> e1 \<noteq> s \<inter> T) \<or> (\<forall>e2. e1 \<inter> e2 = {} \<longrightarrow> s \<subseteq> e1 \<union> e2 \<longrightarrow> (\<forall>T. closed T \<longrightarrow> e2 \<noteq> s \<inter> T) \<or> e1 = {} \<or> e2 = {})" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
744 |
then have "\<And>C D. s \<inter> C = {} \<or> s \<inter> D = {} \<or> s \<inter> (C \<inter> (s \<inter> D)) \<noteq> {} \<or> \<not> s \<subseteq> s \<inter> (C \<union> D) \<or> \<not> closed C \<or> \<not> closed D" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
745 |
by (metis (no_types) Int_Un_distrib Int_assoc) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
746 |
moreover have "s \<inter> (A \<inter> B) = {}" "s \<inter> (A \<union> B) = s" "s \<inter> B \<noteq> {}" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
747 |
using disj s_sub x by blast+ |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
748 |
ultimately have "s \<inter> A = {}" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
749 |
using cl by (metis inf.left_commute inf_bot_right order_refl) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
750 |
then have False |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
751 |
using x' by blast |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
752 |
} note * = this |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
753 |
show ?thesis |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
754 |
apply (simp add: connected_closed closedin_closed) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
755 |
apply (safe; simp) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
756 |
apply blast |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
757 |
apply (blast intro: *) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
758 |
done |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
759 |
qed |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
760 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
761 |
lemma connected_closed_in_eq: |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
762 |
"connected s \<longleftrightarrow> |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
763 |
~(\<exists>e1 e2. |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
764 |
closedin (subtopology euclidean s) e1 \<and> |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
765 |
closedin (subtopology euclidean s) e2 \<and> |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
766 |
e1 \<union> e2 = s \<and> e1 \<inter> e2 = {} \<and> |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
767 |
e1 \<noteq> {} \<and> e2 \<noteq> {})" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
768 |
apply (simp add: connected_closed_in, safe) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
769 |
apply blast |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
770 |
by (metis Int_lower1 Un_subset_iff closedin_closed subset_antisym) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
771 |
|
60420 | 772 |
text \<open>These "transitivity" results are handy too\<close> |
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
773 |
|
53255 | 774 |
lemma openin_trans[trans]: |
775 |
"openin (subtopology euclidean T) S \<Longrightarrow> openin (subtopology euclidean U) T \<Longrightarrow> |
|
776 |
openin (subtopology euclidean U) S" |
|
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
777 |
unfolding open_openin openin_open by blast |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
778 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
779 |
lemma openin_open_trans: "openin (subtopology euclidean T) S \<Longrightarrow> open T \<Longrightarrow> open S" |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
780 |
by (auto simp add: openin_open intro: openin_trans) |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
781 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
782 |
lemma closedin_trans[trans]: |
53255 | 783 |
"closedin (subtopology euclidean T) S \<Longrightarrow> closedin (subtopology euclidean U) T \<Longrightarrow> |
784 |
closedin (subtopology euclidean U) S" |
|
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
785 |
by (auto simp add: closedin_closed closed_closedin closed_Inter Int_assoc) |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
786 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
787 |
lemma closedin_closed_trans: "closedin (subtopology euclidean T) S \<Longrightarrow> closed T \<Longrightarrow> closed S" |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
788 |
by (auto simp add: closedin_closed intro: closedin_trans) |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
789 |
|
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
790 |
lemma openin_subtopology_inter_subset: |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
791 |
"openin (subtopology euclidean u) (u \<inter> s) \<and> v \<subseteq> u \<Longrightarrow> openin (subtopology euclidean v) (v \<inter> s)" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
792 |
by (auto simp: openin_subtopology) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
793 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
794 |
lemma openin_open_eq: "open s \<Longrightarrow> (openin (subtopology euclidean s) t \<longleftrightarrow> open t \<and> t \<subseteq> s)" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
795 |
using open_subset openin_open_trans openin_subset by fastforce |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
796 |
|
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
797 |
|
60420 | 798 |
subsection \<open>Open and closed balls\<close> |
33175 | 799 |
|
53255 | 800 |
definition ball :: "'a::metric_space \<Rightarrow> real \<Rightarrow> 'a set" |
801 |
where "ball x e = {y. dist x y < e}" |
|
802 |
||
803 |
definition cball :: "'a::metric_space \<Rightarrow> real \<Rightarrow> 'a set" |
|
804 |
where "cball x e = {y. dist x y \<le> e}" |
|
33175 | 805 |
|
45776
714100f5fda4
remove mem_(c)ball_0 and centre_in_(c)ball from simpset, as rules mem_(c)ball always match instead
huffman
parents:
45548
diff
changeset
|
806 |
lemma mem_ball [simp]: "y \<in> ball x e \<longleftrightarrow> dist x y < e" |
714100f5fda4
remove mem_(c)ball_0 and centre_in_(c)ball from simpset, as rules mem_(c)ball always match instead
huffman
parents:
45548
diff
changeset
|
807 |
by (simp add: ball_def) |
714100f5fda4
remove mem_(c)ball_0 and centre_in_(c)ball from simpset, as rules mem_(c)ball always match instead
huffman
parents:
45548
diff
changeset
|
808 |
|
714100f5fda4
remove mem_(c)ball_0 and centre_in_(c)ball from simpset, as rules mem_(c)ball always match instead
huffman
parents:
45548
diff
changeset
|
809 |
lemma mem_cball [simp]: "y \<in> cball x e \<longleftrightarrow> dist x y \<le> e" |
714100f5fda4
remove mem_(c)ball_0 and centre_in_(c)ball from simpset, as rules mem_(c)ball always match instead
huffman
parents:
45548
diff
changeset
|
810 |
by (simp add: cball_def) |
714100f5fda4
remove mem_(c)ball_0 and centre_in_(c)ball from simpset, as rules mem_(c)ball always match instead
huffman
parents:
45548
diff
changeset
|
811 |
|
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
812 |
lemma ball_trivial [simp]: "ball x 0 = {}" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
813 |
by (simp add: ball_def) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
814 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
815 |
lemma cball_trivial [simp]: "cball x 0 = {x}" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
816 |
by (simp add: cball_def) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
817 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
818 |
lemma mem_ball_0 [simp]: |
33175 | 819 |
fixes x :: "'a::real_normed_vector" |
820 |
shows "x \<in> ball 0 e \<longleftrightarrow> norm x < e" |
|
821 |
by (simp add: dist_norm) |
|
822 |
||
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
823 |
lemma mem_cball_0 [simp]: |
33175 | 824 |
fixes x :: "'a::real_normed_vector" |
825 |
shows "x \<in> cball 0 e \<longleftrightarrow> norm x \<le> e" |
|
826 |
by (simp add: dist_norm) |
|
827 |
||
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
828 |
lemma centre_in_ball [simp]: "x \<in> ball x e \<longleftrightarrow> 0 < e" |
45776
714100f5fda4
remove mem_(c)ball_0 and centre_in_(c)ball from simpset, as rules mem_(c)ball always match instead
huffman
parents:
45548
diff
changeset
|
829 |
by simp |
714100f5fda4
remove mem_(c)ball_0 and centre_in_(c)ball from simpset, as rules mem_(c)ball always match instead
huffman
parents:
45548
diff
changeset
|
830 |
|
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
831 |
lemma centre_in_cball [simp]: "x \<in> cball x e \<longleftrightarrow> 0 \<le> e" |
45776
714100f5fda4
remove mem_(c)ball_0 and centre_in_(c)ball from simpset, as rules mem_(c)ball always match instead
huffman
parents:
45548
diff
changeset
|
832 |
by simp |
714100f5fda4
remove mem_(c)ball_0 and centre_in_(c)ball from simpset, as rules mem_(c)ball always match instead
huffman
parents:
45548
diff
changeset
|
833 |
|
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
834 |
lemma ball_subset_cball [simp,intro]: "ball x e \<subseteq> cball x e" |
53255 | 835 |
by (simp add: subset_eq) |
836 |
||
53282 | 837 |
lemma subset_ball[intro]: "d \<le> e \<Longrightarrow> ball x d \<subseteq> ball x e" |
53255 | 838 |
by (simp add: subset_eq) |
839 |
||
53282 | 840 |
lemma subset_cball[intro]: "d \<le> e \<Longrightarrow> cball x d \<subseteq> cball x e" |
53255 | 841 |
by (simp add: subset_eq) |
842 |
||
33175 | 843 |
lemma ball_max_Un: "ball a (max r s) = ball a r \<union> ball a s" |
39302
d7728f65b353
renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
nipkow
parents:
39198
diff
changeset
|
844 |
by (simp add: set_eq_iff) arith |
33175 | 845 |
|
846 |
lemma ball_min_Int: "ball a (min r s) = ball a r \<inter> ball a s" |
|
39302
d7728f65b353
renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
nipkow
parents:
39198
diff
changeset
|
847 |
by (simp add: set_eq_iff) |
33175 | 848 |
|
61426
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61424
diff
changeset
|
849 |
lemma cball_diff_eq_sphere: "cball a r - ball a r = {x. dist x a = r}" |
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61424
diff
changeset
|
850 |
by (auto simp: cball_def ball_def dist_commute) |
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61424
diff
changeset
|
851 |
|
53255 | 852 |
lemma diff_less_iff: |
853 |
"(a::real) - b > 0 \<longleftrightarrow> a > b" |
|
33175 | 854 |
"(a::real) - b < 0 \<longleftrightarrow> a < b" |
53255 | 855 |
"a - b < c \<longleftrightarrow> a < c + b" "a - b > c \<longleftrightarrow> a > c + b" |
856 |
by arith+ |
|
857 |
||
858 |
lemma diff_le_iff: |
|
859 |
"(a::real) - b \<ge> 0 \<longleftrightarrow> a \<ge> b" |
|
860 |
"(a::real) - b \<le> 0 \<longleftrightarrow> a \<le> b" |
|
861 |
"a - b \<le> c \<longleftrightarrow> a \<le> c + b" |
|
862 |
"a - b \<ge> c \<longleftrightarrow> a \<ge> c + b" |
|
863 |
by arith+ |
|
33175 | 864 |
|
54070 | 865 |
lemma open_ball [intro, simp]: "open (ball x e)" |
866 |
proof - |
|
867 |
have "open (dist x -` {..<e})" |
|
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56290
diff
changeset
|
868 |
by (intro open_vimage open_lessThan continuous_intros) |
54070 | 869 |
also have "dist x -` {..<e} = ball x e" |
870 |
by auto |
|
871 |
finally show ?thesis . |
|
872 |
qed |
|
33175 | 873 |
|
874 |
lemma open_contains_ball: "open S \<longleftrightarrow> (\<forall>x\<in>S. \<exists>e>0. ball x e \<subseteq> S)" |
|
875 |
unfolding open_dist subset_eq mem_ball Ball_def dist_commute .. |
|
876 |
||
33714
eb2574ac4173
Added new lemmas to Euclidean Space by Robert Himmelmann
hoelzl
parents:
33324
diff
changeset
|
877 |
lemma openE[elim?]: |
53282 | 878 |
assumes "open S" "x\<in>S" |
33714
eb2574ac4173
Added new lemmas to Euclidean Space by Robert Himmelmann
hoelzl
parents:
33324
diff
changeset
|
879 |
obtains e where "e>0" "ball x e \<subseteq> S" |
eb2574ac4173
Added new lemmas to Euclidean Space by Robert Himmelmann
hoelzl
parents:
33324
diff
changeset
|
880 |
using assms unfolding open_contains_ball by auto |
eb2574ac4173
Added new lemmas to Euclidean Space by Robert Himmelmann
hoelzl
parents:
33324
diff
changeset
|
881 |
|
33175 | 882 |
lemma open_contains_ball_eq: "open S \<Longrightarrow> \<forall>x. x\<in>S \<longleftrightarrow> (\<exists>e>0. ball x e \<subseteq> S)" |
883 |
by (metis open_contains_ball subset_eq centre_in_ball) |
|
884 |
||
885 |
lemma ball_eq_empty[simp]: "ball x e = {} \<longleftrightarrow> e \<le> 0" |
|
39302
d7728f65b353
renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
nipkow
parents:
39198
diff
changeset
|
886 |
unfolding mem_ball set_eq_iff |
33175 | 887 |
apply (simp add: not_less) |
52624 | 888 |
apply (metis zero_le_dist order_trans dist_self) |
889 |
done |
|
33175 | 890 |
|
53291 | 891 |
lemma ball_empty[intro]: "e \<le> 0 \<Longrightarrow> ball x e = {}" by simp |
33175 | 892 |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
893 |
lemma euclidean_dist_l2: |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
894 |
fixes x y :: "'a :: euclidean_space" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
895 |
shows "dist x y = setL2 (\<lambda>i. dist (x \<bullet> i) (y \<bullet> i)) Basis" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
896 |
unfolding dist_norm norm_eq_sqrt_inner setL2_def |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
897 |
by (subst euclidean_inner) (simp add: power2_eq_square inner_diff_left) |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
898 |
|
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
899 |
lemma eventually_nhds_ball: "d > 0 \<Longrightarrow> eventually (\<lambda>x. x \<in> ball z d) (nhds z)" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
900 |
by (rule eventually_nhds_in_open) simp_all |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
901 |
|
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
902 |
lemma eventually_at_ball: "d > 0 \<Longrightarrow> eventually (\<lambda>t. t \<in> ball z d \<and> t \<in> A) (at z within A)" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
903 |
unfolding eventually_at by (intro exI[of _ d]) (simp_all add: dist_commute) |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
904 |
|
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
905 |
lemma eventually_at_ball': "d > 0 \<Longrightarrow> eventually (\<lambda>t. t \<in> ball z d \<and> t \<noteq> z \<and> t \<in> A) (at z within A)" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
906 |
unfolding eventually_at by (intro exI[of _ d]) (simp_all add: dist_commute) |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
907 |
|
56189
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
908 |
|
60420 | 909 |
subsection \<open>Boxes\<close> |
56189
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
910 |
|
57447
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57418
diff
changeset
|
911 |
abbreviation One :: "'a::euclidean_space" |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57418
diff
changeset
|
912 |
where "One \<equiv> \<Sum>Basis" |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57418
diff
changeset
|
913 |
|
54775
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
immler
parents:
54489
diff
changeset
|
914 |
definition (in euclidean_space) eucl_less (infix "<e" 50) |
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
immler
parents:
54489
diff
changeset
|
915 |
where "eucl_less a b \<longleftrightarrow> (\<forall>i\<in>Basis. a \<bullet> i < b \<bullet> i)" |
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
immler
parents:
54489
diff
changeset
|
916 |
|
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
immler
parents:
54489
diff
changeset
|
917 |
definition box_eucl_less: "box a b = {x. a <e x \<and> x <e b}" |
56188 | 918 |
definition "cbox a b = {x. \<forall>i\<in>Basis. a \<bullet> i \<le> x \<bullet> i \<and> x \<bullet> i \<le> b \<bullet> i}" |
54775
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
immler
parents:
54489
diff
changeset
|
919 |
|
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
immler
parents:
54489
diff
changeset
|
920 |
lemma box_def: "box a b = {x. \<forall>i\<in>Basis. a \<bullet> i < x \<bullet> i \<and> x \<bullet> i < b \<bullet> i}" |
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
immler
parents:
54489
diff
changeset
|
921 |
and in_box_eucl_less: "x \<in> box a b \<longleftrightarrow> a <e x \<and> x <e b" |
56188 | 922 |
and mem_box: "x \<in> box a b \<longleftrightarrow> (\<forall>i\<in>Basis. a \<bullet> i < x \<bullet> i \<and> x \<bullet> i < b \<bullet> i)" |
923 |
"x \<in> cbox a b \<longleftrightarrow> (\<forall>i\<in>Basis. a \<bullet> i \<le> x \<bullet> i \<and> x \<bullet> i \<le> b \<bullet> i)" |
|
924 |
by (auto simp: box_eucl_less eucl_less_def cbox_def) |
|
925 |
||
60615
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents:
60585
diff
changeset
|
926 |
lemma cbox_Pair_eq: "cbox (a, c) (b, d) = cbox a b \<times> cbox c d" |
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents:
60585
diff
changeset
|
927 |
by (force simp: cbox_def Basis_prod_def) |
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents:
60585
diff
changeset
|
928 |
|
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents:
60585
diff
changeset
|
929 |
lemma cbox_Pair_iff [iff]: "(x, y) \<in> cbox (a, c) (b, d) \<longleftrightarrow> x \<in> cbox a b \<and> y \<in> cbox c d" |
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents:
60585
diff
changeset
|
930 |
by (force simp: cbox_Pair_eq) |
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents:
60585
diff
changeset
|
931 |
|
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents:
60585
diff
changeset
|
932 |
lemma cbox_Pair_eq_0: "cbox (a, c) (b, d) = {} \<longleftrightarrow> cbox a b = {} \<or> cbox c d = {}" |
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents:
60585
diff
changeset
|
933 |
by (force simp: cbox_Pair_eq) |
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents:
60585
diff
changeset
|
934 |
|
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents:
60585
diff
changeset
|
935 |
lemma swap_cbox_Pair [simp]: "prod.swap ` cbox (c, a) (d, b) = cbox (a,c) (b,d)" |
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents:
60585
diff
changeset
|
936 |
by auto |
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents:
60585
diff
changeset
|
937 |
|
56188 | 938 |
lemma mem_box_real[simp]: |
939 |
"(x::real) \<in> box a b \<longleftrightarrow> a < x \<and> x < b" |
|
940 |
"(x::real) \<in> cbox a b \<longleftrightarrow> a \<le> x \<and> x \<le> b" |
|
941 |
by (auto simp: mem_box) |
|
942 |
||
943 |
lemma box_real[simp]: |
|
944 |
fixes a b:: real |
|
945 |
shows "box a b = {a <..< b}" "cbox a b = {a .. b}" |
|
946 |
by auto |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
947 |
|
57447
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57418
diff
changeset
|
948 |
lemma box_Int_box: |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57418
diff
changeset
|
949 |
fixes a :: "'a::euclidean_space" |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57418
diff
changeset
|
950 |
shows "box a b \<inter> box c d = |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57418
diff
changeset
|
951 |
box (\<Sum>i\<in>Basis. max (a\<bullet>i) (c\<bullet>i) *\<^sub>R i) (\<Sum>i\<in>Basis. min (b\<bullet>i) (d\<bullet>i) *\<^sub>R i)" |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57418
diff
changeset
|
952 |
unfolding set_eq_iff and Int_iff and mem_box by auto |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57418
diff
changeset
|
953 |
|
50087 | 954 |
lemma rational_boxes: |
61076 | 955 |
fixes x :: "'a::euclidean_space" |
53291 | 956 |
assumes "e > 0" |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
957 |
shows "\<exists>a b. (\<forall>i\<in>Basis. a \<bullet> i \<in> \<rat> \<and> b \<bullet> i \<in> \<rat> ) \<and> x \<in> box a b \<and> box a b \<subseteq> ball x e" |
50087 | 958 |
proof - |
959 |
def e' \<equiv> "e / (2 * sqrt (real (DIM ('a))))" |
|
53291 | 960 |
then have e: "e' > 0" |
56541 | 961 |
using assms by (auto simp: DIM_positive) |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
962 |
have "\<forall>i. \<exists>y. y \<in> \<rat> \<and> y < x \<bullet> i \<and> x \<bullet> i - y < e'" (is "\<forall>i. ?th i") |
50087 | 963 |
proof |
53255 | 964 |
fix i |
965 |
from Rats_dense_in_real[of "x \<bullet> i - e'" "x \<bullet> i"] e |
|
966 |
show "?th i" by auto |
|
50087 | 967 |
qed |
55522 | 968 |
from choice[OF this] obtain a where |
969 |
a: "\<forall>xa. a xa \<in> \<rat> \<and> a xa < x \<bullet> xa \<and> x \<bullet> xa - a xa < e'" .. |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
970 |
have "\<forall>i. \<exists>y. y \<in> \<rat> \<and> x \<bullet> i < y \<and> y - x \<bullet> i < e'" (is "\<forall>i. ?th i") |
50087 | 971 |
proof |
53255 | 972 |
fix i |
973 |
from Rats_dense_in_real[of "x \<bullet> i" "x \<bullet> i + e'"] e |
|
974 |
show "?th i" by auto |
|
50087 | 975 |
qed |
55522 | 976 |
from choice[OF this] obtain b where |
977 |
b: "\<forall>xa. b xa \<in> \<rat> \<and> x \<bullet> xa < b xa \<and> b xa - x \<bullet> xa < e'" .. |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
978 |
let ?a = "\<Sum>i\<in>Basis. a i *\<^sub>R i" and ?b = "\<Sum>i\<in>Basis. b i *\<^sub>R i" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
979 |
show ?thesis |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
980 |
proof (rule exI[of _ ?a], rule exI[of _ ?b], safe) |
53255 | 981 |
fix y :: 'a |
982 |
assume *: "y \<in> box ?a ?b" |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
52625
diff
changeset
|
983 |
have "dist x y = sqrt (\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<^sup>2)" |
50087 | 984 |
unfolding setL2_def[symmetric] by (rule euclidean_dist_l2) |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
985 |
also have "\<dots> < sqrt (\<Sum>(i::'a)\<in>Basis. e^2 / real (DIM('a)))" |
50087 | 986 |
proof (rule real_sqrt_less_mono, rule setsum_strict_mono) |
53255 | 987 |
fix i :: "'a" |
988 |
assume i: "i \<in> Basis" |
|
989 |
have "a i < y\<bullet>i \<and> y\<bullet>i < b i" |
|
990 |
using * i by (auto simp: box_def) |
|
991 |
moreover have "a i < x\<bullet>i" "x\<bullet>i - a i < e'" |
|
992 |
using a by auto |
|
993 |
moreover have "x\<bullet>i < b i" "b i - x\<bullet>i < e'" |
|
994 |
using b by auto |
|
995 |
ultimately have "\<bar>x\<bullet>i - y\<bullet>i\<bar> < 2 * e'" |
|
996 |
by auto |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
997 |
then have "dist (x \<bullet> i) (y \<bullet> i) < e/sqrt (real (DIM('a)))" |
50087 | 998 |
unfolding e'_def by (auto simp: dist_real_def) |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
52625
diff
changeset
|
999 |
then have "(dist (x \<bullet> i) (y \<bullet> i))\<^sup>2 < (e/sqrt (real (DIM('a))))\<^sup>2" |
50087 | 1000 |
by (rule power_strict_mono) auto |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
52625
diff
changeset
|
1001 |
then show "(dist (x \<bullet> i) (y \<bullet> i))\<^sup>2 < e\<^sup>2 / real DIM('a)" |
50087 | 1002 |
by (simp add: power_divide) |
1003 |
qed auto |
|
53255 | 1004 |
also have "\<dots> = e" |
60420 | 1005 |
using \<open>0 < e\<close> by (simp add: real_eq_of_nat) |
53255 | 1006 |
finally show "y \<in> ball x e" |
1007 |
by (auto simp: ball_def) |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
1008 |
qed (insert a b, auto simp: box_def) |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
1009 |
qed |
51103 | 1010 |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
1011 |
lemma open_UNION_box: |
61076 | 1012 |
fixes M :: "'a::euclidean_space set" |
53282 | 1013 |
assumes "open M" |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
1014 |
defines "a' \<equiv> \<lambda>f :: 'a \<Rightarrow> real \<times> real. (\<Sum>(i::'a)\<in>Basis. fst (f i) *\<^sub>R i)" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
1015 |
defines "b' \<equiv> \<lambda>f :: 'a \<Rightarrow> real \<times> real. (\<Sum>(i::'a)\<in>Basis. snd (f i) *\<^sub>R i)" |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
52625
diff
changeset
|
1016 |
defines "I \<equiv> {f\<in>Basis \<rightarrow>\<^sub>E \<rat> \<times> \<rat>. box (a' f) (b' f) \<subseteq> M}" |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
1017 |
shows "M = (\<Union>f\<in>I. box (a' f) (b' f))" |
52624 | 1018 |
proof - |
60462 | 1019 |
have "x \<in> (\<Union>f\<in>I. box (a' f) (b' f))" if "x \<in> M" for x |
1020 |
proof - |
|
52624 | 1021 |
obtain e where e: "e > 0" "ball x e \<subseteq> M" |
60420 | 1022 |
using openE[OF \<open>open M\<close> \<open>x \<in> M\<close>] by auto |
53282 | 1023 |
moreover obtain a b where ab: |
1024 |
"x \<in> box a b" |
|
1025 |
"\<forall>i \<in> Basis. a \<bullet> i \<in> \<rat>" |
|
1026 |
"\<forall>i\<in>Basis. b \<bullet> i \<in> \<rat>" |
|
1027 |
"box a b \<subseteq> ball x e" |
|
52624 | 1028 |
using rational_boxes[OF e(1)] by metis |
60462 | 1029 |
ultimately show ?thesis |
52624 | 1030 |
by (intro UN_I[of "\<lambda>i\<in>Basis. (a \<bullet> i, b \<bullet> i)"]) |
1031 |
(auto simp: euclidean_representation I_def a'_def b'_def) |
|
60462 | 1032 |
qed |
52624 | 1033 |
then show ?thesis by (auto simp: I_def) |
1034 |
qed |
|
1035 |
||
56189
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1036 |
lemma box_eq_empty: |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1037 |
fixes a :: "'a::euclidean_space" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1038 |
shows "(box a b = {} \<longleftrightarrow> (\<exists>i\<in>Basis. b\<bullet>i \<le> a\<bullet>i))" (is ?th1) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1039 |
and "(cbox a b = {} \<longleftrightarrow> (\<exists>i\<in>Basis. b\<bullet>i < a\<bullet>i))" (is ?th2) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1040 |
proof - |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1041 |
{ |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1042 |
fix i x |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1043 |
assume i: "i\<in>Basis" and as:"b\<bullet>i \<le> a\<bullet>i" and x:"x\<in>box a b" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1044 |
then have "a \<bullet> i < x \<bullet> i \<and> x \<bullet> i < b \<bullet> i" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1045 |
unfolding mem_box by (auto simp: box_def) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1046 |
then have "a\<bullet>i < b\<bullet>i" by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1047 |
then have False using as by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1048 |
} |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1049 |
moreover |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1050 |
{ |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1051 |
assume as: "\<forall>i\<in>Basis. \<not> (b\<bullet>i \<le> a\<bullet>i)" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1052 |
let ?x = "(1/2) *\<^sub>R (a + b)" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1053 |
{ |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1054 |
fix i :: 'a |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1055 |
assume i: "i \<in> Basis" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1056 |
have "a\<bullet>i < b\<bullet>i" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1057 |
using as[THEN bspec[where x=i]] i by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1058 |
then have "a\<bullet>i < ((1/2) *\<^sub>R (a+b)) \<bullet> i" "((1/2) *\<^sub>R (a+b)) \<bullet> i < b\<bullet>i" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1059 |
by (auto simp: inner_add_left) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1060 |
} |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1061 |
then have "box a b \<noteq> {}" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1062 |
using mem_box(1)[of "?x" a b] by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1063 |
} |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1064 |
ultimately show ?th1 by blast |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1065 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1066 |
{ |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1067 |
fix i x |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1068 |
assume i: "i \<in> Basis" and as:"b\<bullet>i < a\<bullet>i" and x:"x\<in>cbox a b" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1069 |
then have "a \<bullet> i \<le> x \<bullet> i \<and> x \<bullet> i \<le> b \<bullet> i" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1070 |
unfolding mem_box by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1071 |
then have "a\<bullet>i \<le> b\<bullet>i" by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1072 |
then have False using as by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1073 |
} |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1074 |
moreover |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1075 |
{ |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1076 |
assume as:"\<forall>i\<in>Basis. \<not> (b\<bullet>i < a\<bullet>i)" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1077 |
let ?x = "(1/2) *\<^sub>R (a + b)" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1078 |
{ |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1079 |
fix i :: 'a |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1080 |
assume i:"i \<in> Basis" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1081 |
have "a\<bullet>i \<le> b\<bullet>i" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1082 |
using as[THEN bspec[where x=i]] i by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1083 |
then have "a\<bullet>i \<le> ((1/2) *\<^sub>R (a+b)) \<bullet> i" "((1/2) *\<^sub>R (a+b)) \<bullet> i \<le> b\<bullet>i" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1084 |
by (auto simp: inner_add_left) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1085 |
} |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1086 |
then have "cbox a b \<noteq> {}" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1087 |
using mem_box(2)[of "?x" a b] by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1088 |
} |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1089 |
ultimately show ?th2 by blast |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1090 |
qed |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1091 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1092 |
lemma box_ne_empty: |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1093 |
fixes a :: "'a::euclidean_space" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1094 |
shows "cbox a b \<noteq> {} \<longleftrightarrow> (\<forall>i\<in>Basis. a\<bullet>i \<le> b\<bullet>i)" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1095 |
and "box a b \<noteq> {} \<longleftrightarrow> (\<forall>i\<in>Basis. a\<bullet>i < b\<bullet>i)" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1096 |
unfolding box_eq_empty[of a b] by fastforce+ |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1097 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1098 |
lemma |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1099 |
fixes a :: "'a::euclidean_space" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1100 |
shows cbox_sing: "cbox a a = {a}" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1101 |
and box_sing: "box a a = {}" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1102 |
unfolding set_eq_iff mem_box eq_iff [symmetric] |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1103 |
by (auto intro!: euclidean_eqI[where 'a='a]) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1104 |
(metis all_not_in_conv nonempty_Basis) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1105 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1106 |
lemma subset_box_imp: |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1107 |
fixes a :: "'a::euclidean_space" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1108 |
shows "(\<forall>i\<in>Basis. a\<bullet>i \<le> c\<bullet>i \<and> d\<bullet>i \<le> b\<bullet>i) \<Longrightarrow> cbox c d \<subseteq> cbox a b" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1109 |
and "(\<forall>i\<in>Basis. a\<bullet>i < c\<bullet>i \<and> d\<bullet>i < b\<bullet>i) \<Longrightarrow> cbox c d \<subseteq> box a b" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1110 |
and "(\<forall>i\<in>Basis. a\<bullet>i \<le> c\<bullet>i \<and> d\<bullet>i \<le> b\<bullet>i) \<Longrightarrow> box c d \<subseteq> cbox a b" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1111 |
and "(\<forall>i\<in>Basis. a\<bullet>i \<le> c\<bullet>i \<and> d\<bullet>i \<le> b\<bullet>i) \<Longrightarrow> box c d \<subseteq> box a b" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1112 |
unfolding subset_eq[unfolded Ball_def] unfolding mem_box |
58757 | 1113 |
by (best intro: order_trans less_le_trans le_less_trans less_imp_le)+ |
56189
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1114 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1115 |
lemma box_subset_cbox: |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1116 |
fixes a :: "'a::euclidean_space" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1117 |
shows "box a b \<subseteq> cbox a b" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1118 |
unfolding subset_eq [unfolded Ball_def] mem_box |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1119 |
by (fast intro: less_imp_le) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1120 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1121 |
lemma subset_box: |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1122 |
fixes a :: "'a::euclidean_space" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1123 |
shows "cbox c d \<subseteq> cbox a b \<longleftrightarrow> (\<forall>i\<in>Basis. c\<bullet>i \<le> d\<bullet>i) --> (\<forall>i\<in>Basis. a\<bullet>i \<le> c\<bullet>i \<and> d\<bullet>i \<le> b\<bullet>i)" (is ?th1) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1124 |
and "cbox c d \<subseteq> box a b \<longleftrightarrow> (\<forall>i\<in>Basis. c\<bullet>i \<le> d\<bullet>i) --> (\<forall>i\<in>Basis. a\<bullet>i < c\<bullet>i \<and> d\<bullet>i < b\<bullet>i)" (is ?th2) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1125 |
and "box c d \<subseteq> cbox a b \<longleftrightarrow> (\<forall>i\<in>Basis. c\<bullet>i < d\<bullet>i) --> (\<forall>i\<in>Basis. a\<bullet>i \<le> c\<bullet>i \<and> d\<bullet>i \<le> b\<bullet>i)" (is ?th3) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1126 |
and "box c d \<subseteq> box a b \<longleftrightarrow> (\<forall>i\<in>Basis. c\<bullet>i < d\<bullet>i) --> (\<forall>i\<in>Basis. a\<bullet>i \<le> c\<bullet>i \<and> d\<bullet>i \<le> b\<bullet>i)" (is ?th4) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1127 |
proof - |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1128 |
show ?th1 |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1129 |
unfolding subset_eq and Ball_def and mem_box |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1130 |
by (auto intro: order_trans) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1131 |
show ?th2 |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1132 |
unfolding subset_eq and Ball_def and mem_box |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1133 |
by (auto intro: le_less_trans less_le_trans order_trans less_imp_le) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1134 |
{ |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1135 |
assume as: "box c d \<subseteq> cbox a b" "\<forall>i\<in>Basis. c\<bullet>i < d\<bullet>i" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1136 |
then have "box c d \<noteq> {}" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1137 |
unfolding box_eq_empty by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1138 |
fix i :: 'a |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1139 |
assume i: "i \<in> Basis" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1140 |
(** TODO combine the following two parts as done in the HOL_light version. **) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1141 |
{ |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1142 |
let ?x = "(\<Sum>j\<in>Basis. (if j=i then ((min (a\<bullet>j) (d\<bullet>j))+c\<bullet>j)/2 else (c\<bullet>j+d\<bullet>j)/2) *\<^sub>R j)::'a" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1143 |
assume as2: "a\<bullet>i > c\<bullet>i" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1144 |
{ |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1145 |
fix j :: 'a |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1146 |
assume j: "j \<in> Basis" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1147 |
then have "c \<bullet> j < ?x \<bullet> j \<and> ?x \<bullet> j < d \<bullet> j" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1148 |
apply (cases "j = i") |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1149 |
using as(2)[THEN bspec[where x=j]] i |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1150 |
apply (auto simp add: as2) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1151 |
done |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1152 |
} |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1153 |
then have "?x\<in>box c d" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1154 |
using i unfolding mem_box by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1155 |
moreover |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1156 |
have "?x \<notin> cbox a b" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1157 |
unfolding mem_box |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1158 |
apply auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1159 |
apply (rule_tac x=i in bexI) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1160 |
using as(2)[THEN bspec[where x=i]] and as2 i |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1161 |
apply auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1162 |
done |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1163 |
ultimately have False using as by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1164 |
} |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1165 |
then have "a\<bullet>i \<le> c\<bullet>i" by (rule ccontr) auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1166 |
moreover |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1167 |
{ |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1168 |
let ?x = "(\<Sum>j\<in>Basis. (if j=i then ((max (b\<bullet>j) (c\<bullet>j))+d\<bullet>j)/2 else (c\<bullet>j+d\<bullet>j)/2) *\<^sub>R j)::'a" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1169 |
assume as2: "b\<bullet>i < d\<bullet>i" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1170 |
{ |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1171 |
fix j :: 'a |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1172 |
assume "j\<in>Basis" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1173 |
then have "d \<bullet> j > ?x \<bullet> j \<and> ?x \<bullet> j > c \<bullet> j" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1174 |
apply (cases "j = i") |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1175 |
using as(2)[THEN bspec[where x=j]] |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1176 |
apply (auto simp add: as2) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1177 |
done |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1178 |
} |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1179 |
then have "?x\<in>box c d" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1180 |
unfolding mem_box by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1181 |
moreover |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1182 |
have "?x\<notin>cbox a b" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1183 |
unfolding mem_box |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1184 |
apply auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1185 |
apply (rule_tac x=i in bexI) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1186 |
using as(2)[THEN bspec[where x=i]] and as2 using i |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1187 |
apply auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1188 |
done |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1189 |
ultimately have False using as by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1190 |
} |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1191 |
then have "b\<bullet>i \<ge> d\<bullet>i" by (rule ccontr) auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1192 |
ultimately |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1193 |
have "a\<bullet>i \<le> c\<bullet>i \<and> d\<bullet>i \<le> b\<bullet>i" by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1194 |
} note part1 = this |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1195 |
show ?th3 |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1196 |
unfolding subset_eq and Ball_def and mem_box |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1197 |
apply (rule, rule, rule, rule) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1198 |
apply (rule part1) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1199 |
unfolding subset_eq and Ball_def and mem_box |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1200 |
prefer 4 |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1201 |
apply auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1202 |
apply (erule_tac x=xa in allE, erule_tac x=xa in allE, fastforce)+ |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1203 |
done |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1204 |
{ |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1205 |
assume as: "box c d \<subseteq> box a b" "\<forall>i\<in>Basis. c\<bullet>i < d\<bullet>i" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1206 |
fix i :: 'a |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1207 |
assume i:"i\<in>Basis" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1208 |
from as(1) have "box c d \<subseteq> cbox a b" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1209 |
using box_subset_cbox[of a b] by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1210 |
then have "a\<bullet>i \<le> c\<bullet>i \<and> d\<bullet>i \<le> b\<bullet>i" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1211 |
using part1 and as(2) using i by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1212 |
} note * = this |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1213 |
show ?th4 |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1214 |
unfolding subset_eq and Ball_def and mem_box |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1215 |
apply (rule, rule, rule, rule) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1216 |
apply (rule *) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1217 |
unfolding subset_eq and Ball_def and mem_box |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1218 |
prefer 4 |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1219 |
apply auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1220 |
apply (erule_tac x=xa in allE, simp)+ |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1221 |
done |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1222 |
qed |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1223 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1224 |
lemma inter_interval: |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1225 |
fixes a :: "'a::euclidean_space" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1226 |
shows "cbox a b \<inter> cbox c d = |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1227 |
cbox (\<Sum>i\<in>Basis. max (a\<bullet>i) (c\<bullet>i) *\<^sub>R i) (\<Sum>i\<in>Basis. min (b\<bullet>i) (d\<bullet>i) *\<^sub>R i)" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1228 |
unfolding set_eq_iff and Int_iff and mem_box |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1229 |
by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1230 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1231 |
lemma disjoint_interval: |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1232 |
fixes a::"'a::euclidean_space" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1233 |
shows "cbox a b \<inter> cbox c d = {} \<longleftrightarrow> (\<exists>i\<in>Basis. (b\<bullet>i < a\<bullet>i \<or> d\<bullet>i < c\<bullet>i \<or> b\<bullet>i < c\<bullet>i \<or> d\<bullet>i < a\<bullet>i))" (is ?th1) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1234 |
and "cbox a b \<inter> box c d = {} \<longleftrightarrow> (\<exists>i\<in>Basis. (b\<bullet>i < a\<bullet>i \<or> d\<bullet>i \<le> c\<bullet>i \<or> b\<bullet>i \<le> c\<bullet>i \<or> d\<bullet>i \<le> a\<bullet>i))" (is ?th2) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1235 |
and "box a b \<inter> cbox c d = {} \<longleftrightarrow> (\<exists>i\<in>Basis. (b\<bullet>i \<le> a\<bullet>i \<or> d\<bullet>i < c\<bullet>i \<or> b\<bullet>i \<le> c\<bullet>i \<or> d\<bullet>i \<le> a\<bullet>i))" (is ?th3) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1236 |
and "box a b \<inter> box c d = {} \<longleftrightarrow> (\<exists>i\<in>Basis. (b\<bullet>i \<le> a\<bullet>i \<or> d\<bullet>i \<le> c\<bullet>i \<or> b\<bullet>i \<le> c\<bullet>i \<or> d\<bullet>i \<le> a\<bullet>i))" (is ?th4) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1237 |
proof - |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1238 |
let ?z = "(\<Sum>i\<in>Basis. (((max (a\<bullet>i) (c\<bullet>i)) + (min (b\<bullet>i) (d\<bullet>i))) / 2) *\<^sub>R i)::'a" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1239 |
have **: "\<And>P Q. (\<And>i :: 'a. i \<in> Basis \<Longrightarrow> Q ?z i \<Longrightarrow> P i) \<Longrightarrow> |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1240 |
(\<And>i x :: 'a. i \<in> Basis \<Longrightarrow> P i \<Longrightarrow> Q x i) \<Longrightarrow> (\<forall>x. \<exists>i\<in>Basis. Q x i) \<longleftrightarrow> (\<exists>i\<in>Basis. P i)" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1241 |
by blast |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1242 |
note * = set_eq_iff Int_iff empty_iff mem_box ball_conj_distrib[symmetric] eq_False ball_simps(10) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1243 |
show ?th1 unfolding * by (intro **) auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1244 |
show ?th2 unfolding * by (intro **) auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1245 |
show ?th3 unfolding * by (intro **) auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1246 |
show ?th4 unfolding * by (intro **) auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1247 |
qed |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1248 |
|
57447
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57418
diff
changeset
|
1249 |
lemma UN_box_eq_UNIV: "(\<Union>i::nat. box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) = UNIV" |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57418
diff
changeset
|
1250 |
proof - |
60462 | 1251 |
have "\<bar>x \<bullet> b\<bar> < real (ceiling (Max ((\<lambda>b. \<bar>x \<bullet> b\<bar>)`Basis)) + 1)" |
1252 |
if [simp]: "b \<in> Basis" for x b :: 'a |
|
1253 |
proof - |
|
59587
8ea7b22525cb
Removed the obsolete functions "natfloor" and "natceiling"
nipkow
parents:
58877
diff
changeset
|
1254 |
have "\<bar>x \<bullet> b\<bar> \<le> real (ceiling \<bar>x \<bullet> b\<bar>)" |
8ea7b22525cb
Removed the obsolete functions "natfloor" and "natceiling"
nipkow
parents:
58877
diff
changeset
|
1255 |
by (rule real_of_int_ceiling_ge) |
8ea7b22525cb
Removed the obsolete functions "natfloor" and "natceiling"
nipkow
parents:
58877
diff
changeset
|
1256 |
also have "\<dots> \<le> real (ceiling (Max ((\<lambda>b. \<bar>x \<bullet> b\<bar>)`Basis)))" |
8ea7b22525cb
Removed the obsolete functions "natfloor" and "natceiling"
nipkow
parents:
58877
diff
changeset
|
1257 |
by (auto intro!: ceiling_mono) |
8ea7b22525cb
Removed the obsolete functions "natfloor" and "natceiling"
nipkow
parents:
58877
diff
changeset
|
1258 |
also have "\<dots> < real (ceiling (Max ((\<lambda>b. \<bar>x \<bullet> b\<bar>)`Basis)) + 1)" |
57447
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57418
diff
changeset
|
1259 |
by simp |
60462 | 1260 |
finally show ?thesis . |
1261 |
qed |
|
1262 |
then have "\<exists>n::nat. \<forall>b\<in>Basis. \<bar>x \<bullet> b\<bar> < real n" for x :: 'a |
|
59587
8ea7b22525cb
Removed the obsolete functions "natfloor" and "natceiling"
nipkow
parents:
58877
diff
changeset
|
1263 |
by (metis order.strict_trans reals_Archimedean2) |
57447
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57418
diff
changeset
|
1264 |
moreover have "\<And>x b::'a. \<And>n::nat. \<bar>x \<bullet> b\<bar> < real n \<longleftrightarrow> - real n < x \<bullet> b \<and> x \<bullet> b < real n" |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57418
diff
changeset
|
1265 |
by auto |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57418
diff
changeset
|
1266 |
ultimately show ?thesis |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57418
diff
changeset
|
1267 |
by (auto simp: box_def inner_setsum_left inner_Basis setsum.If_cases) |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57418
diff
changeset
|
1268 |
qed |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57418
diff
changeset
|
1269 |
|
60420 | 1270 |
text \<open>Intervals in general, including infinite and mixtures of open and closed.\<close> |
56189
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1271 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1272 |
definition "is_interval (s::('a::euclidean_space) set) \<longleftrightarrow> |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1273 |
(\<forall>a\<in>s. \<forall>b\<in>s. \<forall>x. (\<forall>i\<in>Basis. ((a\<bullet>i \<le> x\<bullet>i \<and> x\<bullet>i \<le> b\<bullet>i) \<or> (b\<bullet>i \<le> x\<bullet>i \<and> x\<bullet>i \<le> a\<bullet>i))) \<longrightarrow> x \<in> s)" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1274 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1275 |
lemma is_interval_cbox: "is_interval (cbox a (b::'a::euclidean_space))" (is ?th1) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1276 |
and is_interval_box: "is_interval (box a b)" (is ?th2) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1277 |
unfolding is_interval_def mem_box Ball_def atLeastAtMost_iff |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1278 |
by (meson order_trans le_less_trans less_le_trans less_trans)+ |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1279 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1280 |
lemma is_interval_empty: |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1281 |
"is_interval {}" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1282 |
unfolding is_interval_def |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1283 |
by simp |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1284 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1285 |
lemma is_interval_univ: |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1286 |
"is_interval UNIV" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1287 |
unfolding is_interval_def |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1288 |
by simp |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1289 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1290 |
lemma mem_is_intervalI: |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1291 |
assumes "is_interval s" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1292 |
assumes "a \<in> s" "b \<in> s" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1293 |
assumes "\<And>i. i \<in> Basis \<Longrightarrow> a \<bullet> i \<le> x \<bullet> i \<and> x \<bullet> i \<le> b \<bullet> i \<or> b \<bullet> i \<le> x \<bullet> i \<and> x \<bullet> i \<le> a \<bullet> i" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1294 |
shows "x \<in> s" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1295 |
by (rule assms(1)[simplified is_interval_def, rule_format, OF assms(2,3,4)]) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1296 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1297 |
lemma interval_subst: |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1298 |
fixes S::"'a::euclidean_space set" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1299 |
assumes "is_interval S" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1300 |
assumes "x \<in> S" "y j \<in> S" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1301 |
assumes "j \<in> Basis" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1302 |
shows "(\<Sum>i\<in>Basis. (if i = j then y i \<bullet> i else x \<bullet> i) *\<^sub>R i) \<in> S" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1303 |
by (rule mem_is_intervalI[OF assms(1,2)]) (auto simp: assms) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1304 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1305 |
lemma mem_box_componentwiseI: |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1306 |
fixes S::"'a::euclidean_space set" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1307 |
assumes "is_interval S" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1308 |
assumes "\<And>i. i \<in> Basis \<Longrightarrow> x \<bullet> i \<in> ((\<lambda>x. x \<bullet> i) ` S)" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1309 |
shows "x \<in> S" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1310 |
proof - |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1311 |
from assms have "\<forall>i \<in> Basis. \<exists>s \<in> S. x \<bullet> i = s \<bullet> i" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1312 |
by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1313 |
with finite_Basis obtain s and bs::"'a list" where |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1314 |
s: "\<And>i. i \<in> Basis \<Longrightarrow> x \<bullet> i = s i \<bullet> i" "\<And>i. i \<in> Basis \<Longrightarrow> s i \<in> S" and |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1315 |
bs: "set bs = Basis" "distinct bs" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1316 |
by (metis finite_distinct_list) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1317 |
from nonempty_Basis s obtain j where j: "j \<in> Basis" "s j \<in> S" by blast |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1318 |
def y \<equiv> "rec_list |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1319 |
(s j) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1320 |
(\<lambda>j _ Y. (\<Sum>i\<in>Basis. (if i = j then s i \<bullet> i else Y \<bullet> i) *\<^sub>R i))" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1321 |
have "x = (\<Sum>i\<in>Basis. (if i \<in> set bs then s i \<bullet> i else s j \<bullet> i) *\<^sub>R i)" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1322 |
using bs by (auto simp add: s(1)[symmetric] euclidean_representation) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1323 |
also have [symmetric]: "y bs = \<dots>" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1324 |
using bs(2) bs(1)[THEN equalityD1] |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1325 |
by (induct bs) (auto simp: y_def euclidean_representation intro!: euclidean_eqI[where 'a='a]) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1326 |
also have "y bs \<in> S" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1327 |
using bs(1)[THEN equalityD1] |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1328 |
apply (induct bs) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1329 |
apply (auto simp: y_def j) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1330 |
apply (rule interval_subst[OF assms(1)]) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1331 |
apply (auto simp: s) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1332 |
done |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1333 |
finally show ?thesis . |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1334 |
qed |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
1335 |
|
33175 | 1336 |
|
60420 | 1337 |
subsection\<open>Connectedness\<close> |
33175 | 1338 |
|
1339 |
lemma connected_local: |
|
53255 | 1340 |
"connected S \<longleftrightarrow> |
1341 |
\<not> (\<exists>e1 e2. |
|
1342 |
openin (subtopology euclidean S) e1 \<and> |
|
1343 |
openin (subtopology euclidean S) e2 \<and> |
|
1344 |
S \<subseteq> e1 \<union> e2 \<and> |
|
1345 |
e1 \<inter> e2 = {} \<and> |
|
1346 |
e1 \<noteq> {} \<and> |
|
1347 |
e2 \<noteq> {})" |
|
53282 | 1348 |
unfolding connected_def openin_open |
59765
26d1c71784f1
tweaked a few slow or very ugly proofs
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1349 |
by safe blast+ |
33175 | 1350 |
|
34105 | 1351 |
lemma exists_diff: |
1352 |
fixes P :: "'a set \<Rightarrow> bool" |
|
60462 | 1353 |
shows "(\<exists>S. P (- S)) \<longleftrightarrow> (\<exists>S. P S)" (is "?lhs \<longleftrightarrow> ?rhs") |
53255 | 1354 |
proof - |
1355 |
{ |
|
1356 |
assume "?lhs" |
|
1357 |
then have ?rhs by blast |
|
1358 |
} |
|
33175 | 1359 |
moreover |
53255 | 1360 |
{ |
1361 |
fix S |
|
1362 |
assume H: "P S" |
|
34105 | 1363 |
have "S = - (- S)" by auto |
53255 | 1364 |
with H have "P (- (- S))" by metis |
1365 |
} |
|
33175 | 1366 |
ultimately show ?thesis by metis |
1367 |
qed |
|
1368 |
||
1369 |
lemma connected_clopen: "connected S \<longleftrightarrow> |
|
53255 | 1370 |
(\<forall>T. openin (subtopology euclidean S) T \<and> |
1371 |
closedin (subtopology euclidean S) T \<longrightarrow> T = {} \<or> T = S)" (is "?lhs \<longleftrightarrow> ?rhs") |
|
1372 |
proof - |
|
1373 |
have "\<not> connected S \<longleftrightarrow> |
|
1374 |
(\<exists>e1 e2. open e1 \<and> open (- e2) \<and> S \<subseteq> e1 \<union> (- e2) \<and> e1 \<inter> (- e2) \<inter> S = {} \<and> e1 \<inter> S \<noteq> {} \<and> (- e2) \<inter> S \<noteq> {})" |
|
33175 | 1375 |
unfolding connected_def openin_open closedin_closed |
55775 | 1376 |
by (metis double_complement) |
53282 | 1377 |
then have th0: "connected S \<longleftrightarrow> |
53255 | 1378 |
\<not> (\<exists>e2 e1. closed e2 \<and> open e1 \<and> S \<subseteq> e1 \<union> (- e2) \<and> e1 \<inter> (- e2) \<inter> S = {} \<and> e1 \<inter> S \<noteq> {} \<and> (- e2) \<inter> S \<noteq> {})" |
52624 | 1379 |
(is " _ \<longleftrightarrow> \<not> (\<exists>e2 e1. ?P e2 e1)") |
1380 |
apply (simp add: closed_def) |
|
1381 |
apply metis |
|
1382 |
done |
|
33175 | 1383 |
have th1: "?rhs \<longleftrightarrow> \<not> (\<exists>t' t. closed t'\<and>t = S\<inter>t' \<and> t\<noteq>{} \<and> t\<noteq>S \<and> (\<exists>t'. open t' \<and> t = S \<inter> t'))" |
1384 |
(is "_ \<longleftrightarrow> \<not> (\<exists>t' t. ?Q t' t)") |
|
1385 |
unfolding connected_def openin_open closedin_closed by auto |
|
53255 | 1386 |
{ |
1387 |
fix e2 |
|
1388 |
{ |
|
1389 |
fix e1 |
|
53282 | 1390 |
have "?P e2 e1 \<longleftrightarrow> (\<exists>t. closed e2 \<and> t = S\<inter>e2 \<and> open e1 \<and> t = S\<inter>e1 \<and> t\<noteq>{} \<and> t \<noteq> S)" |
53255 | 1391 |
by auto |
1392 |
} |
|
1393 |
then have "(\<exists>e1. ?P e2 e1) \<longleftrightarrow> (\<exists>t. ?Q e2 t)" |
|
1394 |
by metis |
|
1395 |
} |
|
1396 |
then have "\<forall>e2. (\<exists>e1. ?P e2 e1) \<longleftrightarrow> (\<exists>t. ?Q e2 t)" |
|
1397 |
by blast |
|
1398 |
then show ?thesis |
|
1399 |
unfolding th0 th1 by simp |
|
33175 | 1400 |
qed |
1401 |
||
60420 | 1402 |
subsection\<open>Limit points\<close> |
33175 | 1403 |
|
53282 | 1404 |
definition (in topological_space) islimpt:: "'a \<Rightarrow> 'a set \<Rightarrow> bool" (infixr "islimpt" 60) |
53255 | 1405 |
where "x islimpt S \<longleftrightarrow> (\<forall>T. x\<in>T \<longrightarrow> open T \<longrightarrow> (\<exists>y\<in>S. y\<in>T \<and> y\<noteq>x))" |
33175 | 1406 |
|
1407 |
lemma islimptI: |
|
1408 |
assumes "\<And>T. x \<in> T \<Longrightarrow> open T \<Longrightarrow> \<exists>y\<in>S. y \<in> T \<and> y \<noteq> x" |
|
1409 |
shows "x islimpt S" |
|
1410 |
using assms unfolding islimpt_def by auto |
|
1411 |
||
1412 |
lemma islimptE: |
|
1413 |
assumes "x islimpt S" and "x \<in> T" and "open T" |
|
1414 |
obtains y where "y \<in> S" and "y \<in> T" and "y \<noteq> x" |
|
1415 |
using assms unfolding islimpt_def by auto |
|
1416 |
||
44584 | 1417 |
lemma islimpt_iff_eventually: "x islimpt S \<longleftrightarrow> \<not> eventually (\<lambda>y. y \<notin> S) (at x)" |
1418 |
unfolding islimpt_def eventually_at_topological by auto |
|
1419 |
||
53255 | 1420 |
lemma islimpt_subset: "x islimpt S \<Longrightarrow> S \<subseteq> T \<Longrightarrow> x islimpt T" |
44584 | 1421 |
unfolding islimpt_def by fast |
33175 | 1422 |
|
1423 |
lemma islimpt_approachable: |
|
1424 |
fixes x :: "'a::metric_space" |
|
1425 |
shows "x islimpt S \<longleftrightarrow> (\<forall>e>0. \<exists>x'\<in>S. x' \<noteq> x \<and> dist x' x < e)" |
|
44584 | 1426 |
unfolding islimpt_iff_eventually eventually_at by fast |
33175 | 1427 |
|
1428 |
lemma islimpt_approachable_le: |
|
1429 |
fixes x :: "'a::metric_space" |
|
53640 | 1430 |
shows "x islimpt S \<longleftrightarrow> (\<forall>e>0. \<exists>x'\<in> S. x' \<noteq> x \<and> dist x' x \<le> e)" |
33175 | 1431 |
unfolding islimpt_approachable |
44584 | 1432 |
using approachable_lt_le [where f="\<lambda>y. dist y x" and P="\<lambda>y. y \<notin> S \<or> y = x", |
1433 |
THEN arg_cong [where f=Not]] |
|
1434 |
by (simp add: Bex_def conj_commute conj_left_commute) |
|
33175 | 1435 |
|
44571 | 1436 |
lemma islimpt_UNIV_iff: "x islimpt UNIV \<longleftrightarrow> \<not> open {x}" |
1437 |
unfolding islimpt_def by (safe, fast, case_tac "T = {x}", fast, fast) |
|
1438 |
||
51351 | 1439 |
lemma islimpt_punctured: "x islimpt S = x islimpt (S-{x})" |
1440 |
unfolding islimpt_def by blast |
|
1441 |
||
60420 | 1442 |
text \<open>A perfect space has no isolated points.\<close> |
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1443 |
|
44571 | 1444 |
lemma islimpt_UNIV [simp, intro]: "(x::'a::perfect_space) islimpt UNIV" |
1445 |
unfolding islimpt_UNIV_iff by (rule not_open_singleton) |
|
33175 | 1446 |
|
1447 |
lemma perfect_choose_dist: |
|
44072
5b970711fb39
class perfect_space inherits from topological_space;
huffman
parents:
43338
diff
changeset
|
1448 |
fixes x :: "'a::{perfect_space, metric_space}" |
33175 | 1449 |
shows "0 < r \<Longrightarrow> \<exists>a. a \<noteq> x \<and> dist a x < r" |
53255 | 1450 |
using islimpt_UNIV [of x] |
1451 |
by (simp add: islimpt_approachable) |
|
33175 | 1452 |
|
1453 |
lemma closed_limpt: "closed S \<longleftrightarrow> (\<forall>x. x islimpt S \<longrightarrow> x \<in> S)" |
|
1454 |
unfolding closed_def |
|
1455 |
apply (subst open_subopen) |
|
34105 | 1456 |
apply (simp add: islimpt_def subset_eq) |
52624 | 1457 |
apply (metis ComplE ComplI) |
1458 |
done |
|
33175 | 1459 |
|
1460 |
lemma islimpt_EMPTY[simp]: "\<not> x islimpt {}" |
|
1461 |
unfolding islimpt_def by auto |
|
1462 |
||
1463 |
lemma finite_set_avoid: |
|
1464 |
fixes a :: "'a::metric_space" |
|
53255 | 1465 |
assumes fS: "finite S" |
53640 | 1466 |
shows "\<exists>d>0. \<forall>x\<in>S. x \<noteq> a \<longrightarrow> d \<le> dist a x" |
53255 | 1467 |
proof (induct rule: finite_induct[OF fS]) |
1468 |
case 1 |
|
1469 |
then show ?case by (auto intro: zero_less_one) |
|
33175 | 1470 |
next |
1471 |
case (2 x F) |
|
60462 | 1472 |
from 2 obtain d where d: "d > 0" "\<forall>x\<in>F. x \<noteq> a \<longrightarrow> d \<le> dist a x" |
53255 | 1473 |
by blast |
1474 |
show ?case |
|
1475 |
proof (cases "x = a") |
|
1476 |
case True |
|
1477 |
then show ?thesis using d by auto |
|
1478 |
next |
|
1479 |
case False |
|
33175 | 1480 |
let ?d = "min d (dist a x)" |
53255 | 1481 |
have dp: "?d > 0" |
1482 |
using False d(1) using dist_nz by auto |
|
60462 | 1483 |
from d have d': "\<forall>x\<in>F. x \<noteq> a \<longrightarrow> ?d \<le> dist a x" |
53255 | 1484 |
by auto |
1485 |
with dp False show ?thesis |
|
1486 |
by (auto intro!: exI[where x="?d"]) |
|
1487 |
qed |
|
33175 | 1488 |
qed |
1489 |
||
1490 |
lemma islimpt_Un: "x islimpt (S \<union> T) \<longleftrightarrow> x islimpt S \<or> x islimpt T" |
|
50897
078590669527
generalize lemma islimpt_finite to class t1_space
huffman
parents:
50884
diff
changeset
|
1491 |
by (simp add: islimpt_iff_eventually eventually_conj_iff) |
33175 | 1492 |
|
1493 |
lemma discrete_imp_closed: |
|
1494 |
fixes S :: "'a::metric_space set" |
|
53255 | 1495 |
assumes e: "0 < e" |
1496 |
and d: "\<forall>x \<in> S. \<forall>y \<in> S. dist y x < e \<longrightarrow> y = x" |
|
33175 | 1497 |
shows "closed S" |
53255 | 1498 |
proof - |
1499 |
{ |
|
1500 |
fix x |
|
1501 |
assume C: "\<forall>e>0. \<exists>x'\<in>S. x' \<noteq> x \<and> dist x' x < e" |
|
33175 | 1502 |
from e have e2: "e/2 > 0" by arith |
53282 | 1503 |
from C[rule_format, OF e2] obtain y where y: "y \<in> S" "y \<noteq> x" "dist y x < e/2" |
53255 | 1504 |
by blast |
33175 | 1505 |
let ?m = "min (e/2) (dist x y) " |
53255 | 1506 |
from e2 y(2) have mp: "?m > 0" |
53291 | 1507 |
by (simp add: dist_nz[symmetric]) |
53282 | 1508 |
from C[rule_format, OF mp] obtain z where z: "z \<in> S" "z \<noteq> x" "dist z x < ?m" |
53255 | 1509 |
by blast |
33175 | 1510 |
have th: "dist z y < e" using z y |
1511 |
by (intro dist_triangle_lt [where z=x], simp) |
|
1512 |
from d[rule_format, OF y(1) z(1) th] y z |
|
1513 |
have False by (auto simp add: dist_commute)} |
|
53255 | 1514 |
then show ?thesis |
1515 |
by (metis islimpt_approachable closed_limpt [where 'a='a]) |
|
33175 | 1516 |
qed |
1517 |
||
61524
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
1518 |
lemma closed_of_nat_image: "closed (of_nat ` A :: 'a :: real_normed_algebra_1 set)" |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
1519 |
by (rule discrete_imp_closed[of 1]) (auto simp: dist_of_nat) |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
1520 |
|
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
1521 |
lemma closed_of_int_image: "closed (of_int ` A :: 'a :: real_normed_algebra_1 set)" |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
1522 |
by (rule discrete_imp_closed[of 1]) (auto simp: dist_of_int) |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
1523 |
|
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
1524 |
lemma closed_Nats [simp]: "closed (\<nat> :: 'a :: real_normed_algebra_1 set)" |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
1525 |
unfolding Nats_def by (rule closed_of_nat_image) |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
1526 |
|
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
1527 |
lemma closed_Ints [simp]: "closed (\<int> :: 'a :: real_normed_algebra_1 set)" |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
1528 |
unfolding Ints_def by (rule closed_of_int_image) |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
1529 |
|
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1530 |
|
60420 | 1531 |
subsection \<open>Interior of a Set\<close> |
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1532 |
|
44519 | 1533 |
definition "interior S = \<Union>{T. open T \<and> T \<subseteq> S}" |
1534 |
||
1535 |
lemma interiorI [intro?]: |
|
1536 |
assumes "open T" and "x \<in> T" and "T \<subseteq> S" |
|
1537 |
shows "x \<in> interior S" |
|
1538 |
using assms unfolding interior_def by fast |
|
1539 |
||
1540 |
lemma interiorE [elim?]: |
|
1541 |
assumes "x \<in> interior S" |
|
1542 |
obtains T where "open T" and "x \<in> T" and "T \<subseteq> S" |
|
1543 |
using assms unfolding interior_def by fast |
|
1544 |
||
1545 |
lemma open_interior [simp, intro]: "open (interior S)" |
|
1546 |
by (simp add: interior_def open_Union) |
|
1547 |
||
1548 |
lemma interior_subset: "interior S \<subseteq> S" |
|
1549 |
by (auto simp add: interior_def) |
|
1550 |
||
1551 |
lemma interior_maximal: "T \<subseteq> S \<Longrightarrow> open T \<Longrightarrow> T \<subseteq> interior S" |
|
1552 |
by (auto simp add: interior_def) |
|
1553 |
||
1554 |
lemma interior_open: "open S \<Longrightarrow> interior S = S" |
|
1555 |
by (intro equalityI interior_subset interior_maximal subset_refl) |
|
33175 | 1556 |
|
1557 |
lemma interior_eq: "interior S = S \<longleftrightarrow> open S" |
|
44519 | 1558 |
by (metis open_interior interior_open) |
1559 |
||
1560 |
lemma open_subset_interior: "open S \<Longrightarrow> S \<subseteq> interior T \<longleftrightarrow> S \<subseteq> T" |
|
33175 | 1561 |
by (metis interior_maximal interior_subset subset_trans) |
1562 |
||
44519 | 1563 |
lemma interior_empty [simp]: "interior {} = {}" |
1564 |
using open_empty by (rule interior_open) |
|
1565 |
||
44522
2f7e9d890efe
rename subset_{interior,closure} to {interior,closure}_mono;
huffman
parents:
44519
diff
changeset
|
1566 |
lemma interior_UNIV [simp]: "interior UNIV = UNIV" |
2f7e9d890efe
rename subset_{interior,closure} to {interior,closure}_mono;
huffman
parents:
44519
diff
changeset
|
1567 |
using open_UNIV by (rule interior_open) |
2f7e9d890efe
rename subset_{interior,closure} to {interior,closure}_mono;
huffman
parents:
44519
diff
changeset
|
1568 |
|
44519 | 1569 |
lemma interior_interior [simp]: "interior (interior S) = interior S" |
1570 |
using open_interior by (rule interior_open) |
|
1571 |
||
44522
2f7e9d890efe
rename subset_{interior,closure} to {interior,closure}_mono;
huffman
parents:
44519
diff
changeset
|
1572 |
lemma interior_mono: "S \<subseteq> T \<Longrightarrow> interior S \<subseteq> interior T" |
2f7e9d890efe
rename subset_{interior,closure} to {interior,closure}_mono;
huffman
parents:
44519
diff
changeset
|
1573 |
by (auto simp add: interior_def) |
44519 | 1574 |
|
1575 |
lemma interior_unique: |
|
1576 |
assumes "T \<subseteq> S" and "open T" |
|
1577 |
assumes "\<And>T'. T' \<subseteq> S \<Longrightarrow> open T' \<Longrightarrow> T' \<subseteq> T" |
|
1578 |
shows "interior S = T" |
|
1579 |
by (intro equalityI assms interior_subset open_interior interior_maximal) |
|
1580 |
||
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
1581 |
lemma interior_singleton [simp]: |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
1582 |
fixes a :: "'a::perfect_space" shows "interior {a} = {}" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
1583 |
apply (rule interior_unique, simp_all) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
1584 |
using not_open_singleton subset_singletonD by fastforce |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
1585 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
1586 |
lemma interior_Int [simp]: "interior (S \<inter> T) = interior S \<inter> interior T" |
44522
2f7e9d890efe
rename subset_{interior,closure} to {interior,closure}_mono;
huffman
parents:
44519
diff
changeset
|
1587 |
by (intro equalityI Int_mono Int_greatest interior_mono Int_lower1 |
44519 | 1588 |
Int_lower2 interior_maximal interior_subset open_Int open_interior) |
1589 |
||
1590 |
lemma mem_interior: "x \<in> interior S \<longleftrightarrow> (\<exists>e>0. ball x e \<subseteq> S)" |
|
1591 |
using open_contains_ball_eq [where S="interior S"] |
|
1592 |
by (simp add: open_subset_interior) |
|
33175 | 1593 |
|
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1594 |
lemma eventually_nhds_in_nhd: "x \<in> interior s \<Longrightarrow> eventually (\<lambda>y. y \<in> s) (nhds x)" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1595 |
using interior_subset[of s] by (subst eventually_nhds) blast |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1596 |
|
33175 | 1597 |
lemma interior_limit_point [intro]: |
1598 |
fixes x :: "'a::perfect_space" |
|
53255 | 1599 |
assumes x: "x \<in> interior S" |
1600 |
shows "x islimpt S" |
|
44072
5b970711fb39
class perfect_space inherits from topological_space;
huffman
parents:
43338
diff
changeset
|
1601 |
using x islimpt_UNIV [of x] |
5b970711fb39
class perfect_space inherits from topological_space;
huffman
parents:
43338
diff
changeset
|
1602 |
unfolding interior_def islimpt_def |
5b970711fb39
class perfect_space inherits from topological_space;
huffman
parents:
43338
diff
changeset
|
1603 |
apply (clarsimp, rename_tac T T') |
5b970711fb39
class perfect_space inherits from topological_space;
huffman
parents:
43338
diff
changeset
|
1604 |
apply (drule_tac x="T \<inter> T'" in spec) |
5b970711fb39
class perfect_space inherits from topological_space;
huffman
parents:
43338
diff
changeset
|
1605 |
apply (auto simp add: open_Int) |
5b970711fb39
class perfect_space inherits from topological_space;
huffman
parents:
43338
diff
changeset
|
1606 |
done |
33175 | 1607 |
|
1608 |
lemma interior_closed_Un_empty_interior: |
|
53255 | 1609 |
assumes cS: "closed S" |
1610 |
and iT: "interior T = {}" |
|
44519 | 1611 |
shows "interior (S \<union> T) = interior S" |
33175 | 1612 |
proof |
44519 | 1613 |
show "interior S \<subseteq> interior (S \<union> T)" |
53255 | 1614 |
by (rule interior_mono) (rule Un_upper1) |
33175 | 1615 |
show "interior (S \<union> T) \<subseteq> interior S" |
1616 |
proof |
|
53255 | 1617 |
fix x |
1618 |
assume "x \<in> interior (S \<union> T)" |
|
44519 | 1619 |
then obtain R where "open R" "x \<in> R" "R \<subseteq> S \<union> T" .. |
33175 | 1620 |
show "x \<in> interior S" |
1621 |
proof (rule ccontr) |
|
1622 |
assume "x \<notin> interior S" |
|
60420 | 1623 |
with \<open>x \<in> R\<close> \<open>open R\<close> obtain y where "y \<in> R - S" |
44519 | 1624 |
unfolding interior_def by fast |
60420 | 1625 |
from \<open>open R\<close> \<open>closed S\<close> have "open (R - S)" |
53282 | 1626 |
by (rule open_Diff) |
60420 | 1627 |
from \<open>R \<subseteq> S \<union> T\<close> have "R - S \<subseteq> T" |
53282 | 1628 |
by fast |
60420 | 1629 |
from \<open>y \<in> R - S\<close> \<open>open (R - S)\<close> \<open>R - S \<subseteq> T\<close> \<open>interior T = {}\<close> show False |
53282 | 1630 |
unfolding interior_def by fast |
33175 | 1631 |
qed |
1632 |
qed |
|
1633 |
qed |
|
1634 |
||
44365 | 1635 |
lemma interior_Times: "interior (A \<times> B) = interior A \<times> interior B" |
1636 |
proof (rule interior_unique) |
|
1637 |
show "interior A \<times> interior B \<subseteq> A \<times> B" |
|
1638 |
by (intro Sigma_mono interior_subset) |
|
1639 |
show "open (interior A \<times> interior B)" |
|
1640 |
by (intro open_Times open_interior) |
|
53255 | 1641 |
fix T |
1642 |
assume "T \<subseteq> A \<times> B" and "open T" |
|
1643 |
then show "T \<subseteq> interior A \<times> interior B" |
|
53282 | 1644 |
proof safe |
53255 | 1645 |
fix x y |
1646 |
assume "(x, y) \<in> T" |
|
44519 | 1647 |
then obtain C D where "open C" "open D" "C \<times> D \<subseteq> T" "x \<in> C" "y \<in> D" |
60420 | 1648 |
using \<open>open T\<close> unfolding open_prod_def by fast |
53255 | 1649 |
then have "open C" "open D" "C \<subseteq> A" "D \<subseteq> B" "x \<in> C" "y \<in> D" |
60420 | 1650 |
using \<open>T \<subseteq> A \<times> B\<close> by auto |
53255 | 1651 |
then show "x \<in> interior A" and "y \<in> interior B" |
44519 | 1652 |
by (auto intro: interiorI) |
1653 |
qed |
|
44365 | 1654 |
qed |
1655 |
||
61245 | 1656 |
lemma interior_Ici: |
1657 |
fixes x :: "'a :: {dense_linorder, linorder_topology}" |
|
1658 |
assumes "b < x" |
|
1659 |
shows "interior { x ..} = { x <..}" |
|
1660 |
proof (rule interior_unique) |
|
1661 |
fix T assume "T \<subseteq> {x ..}" "open T" |
|
1662 |
moreover have "x \<notin> T" |
|
1663 |
proof |
|
1664 |
assume "x \<in> T" |
|
1665 |
obtain y where "y < x" "{y <.. x} \<subseteq> T" |
|
1666 |
using open_left[OF \<open>open T\<close> \<open>x \<in> T\<close> \<open>b < x\<close>] by auto |
|
1667 |
with dense[OF \<open>y < x\<close>] obtain z where "z \<in> T" "z < x" |
|
1668 |
by (auto simp: subset_eq Ball_def) |
|
1669 |
with \<open>T \<subseteq> {x ..}\<close> show False by auto |
|
1670 |
qed |
|
1671 |
ultimately show "T \<subseteq> {x <..}" |
|
1672 |
by (auto simp: subset_eq less_le) |
|
1673 |
qed auto |
|
1674 |
||
1675 |
lemma interior_Iic: |
|
1676 |
fixes x :: "'a :: {dense_linorder, linorder_topology}" |
|
1677 |
assumes "x < b" |
|
1678 |
shows "interior {.. x} = {..< x}" |
|
1679 |
proof (rule interior_unique) |
|
1680 |
fix T assume "T \<subseteq> {.. x}" "open T" |
|
1681 |
moreover have "x \<notin> T" |
|
1682 |
proof |
|
1683 |
assume "x \<in> T" |
|
1684 |
obtain y where "x < y" "{x ..< y} \<subseteq> T" |
|
1685 |
using open_right[OF \<open>open T\<close> \<open>x \<in> T\<close> \<open>x < b\<close>] by auto |
|
1686 |
with dense[OF \<open>x < y\<close>] obtain z where "z \<in> T" "x < z" |
|
1687 |
by (auto simp: subset_eq Ball_def less_le) |
|
1688 |
with \<open>T \<subseteq> {.. x}\<close> show False by auto |
|
1689 |
qed |
|
1690 |
ultimately show "T \<subseteq> {..< x}" |
|
1691 |
by (auto simp: subset_eq less_le) |
|
1692 |
qed auto |
|
33175 | 1693 |
|
60420 | 1694 |
subsection \<open>Closure of a Set\<close> |
33175 | 1695 |
|
1696 |
definition "closure S = S \<union> {x | x. x islimpt S}" |
|
1697 |
||
44518 | 1698 |
lemma interior_closure: "interior S = - (closure (- S))" |
1699 |
unfolding interior_def closure_def islimpt_def by auto |
|
1700 |
||
34105 | 1701 |
lemma closure_interior: "closure S = - interior (- S)" |
44518 | 1702 |
unfolding interior_closure by simp |
33175 | 1703 |
|
1704 |
lemma closed_closure[simp, intro]: "closed (closure S)" |
|
44518 | 1705 |
unfolding closure_interior by (simp add: closed_Compl) |
1706 |
||
1707 |
lemma closure_subset: "S \<subseteq> closure S" |
|
1708 |
unfolding closure_def by simp |
|
33175 | 1709 |
|
1710 |
lemma closure_hull: "closure S = closed hull S" |
|
44519 | 1711 |
unfolding hull_def closure_interior interior_def by auto |
33175 | 1712 |
|
1713 |
lemma closure_eq: "closure S = S \<longleftrightarrow> closed S" |
|
44519 | 1714 |
unfolding closure_hull using closed_Inter by (rule hull_eq) |
1715 |
||
1716 |
lemma closure_closed [simp]: "closed S \<Longrightarrow> closure S = S" |
|
1717 |
unfolding closure_eq . |
|
1718 |
||
1719 |
lemma closure_closure [simp]: "closure (closure S) = closure S" |
|
44518 | 1720 |
unfolding closure_hull by (rule hull_hull) |
33175 | 1721 |
|
44522
2f7e9d890efe
rename subset_{interior,closure} to {interior,closure}_mono;
huffman
parents:
44519
diff
changeset
|
1722 |
lemma closure_mono: "S \<subseteq> T \<Longrightarrow> closure S \<subseteq> closure T" |
44518 | 1723 |
unfolding closure_hull by (rule hull_mono) |
33175 | 1724 |
|
44519 | 1725 |
lemma closure_minimal: "S \<subseteq> T \<Longrightarrow> closed T \<Longrightarrow> closure S \<subseteq> T" |
44518 | 1726 |
unfolding closure_hull by (rule hull_minimal) |
33175 | 1727 |
|
44519 | 1728 |
lemma closure_unique: |
53255 | 1729 |
assumes "S \<subseteq> T" |
1730 |
and "closed T" |
|
1731 |
and "\<And>T'. S \<subseteq> T' \<Longrightarrow> closed T' \<Longrightarrow> T \<subseteq> T'" |
|
44519 | 1732 |
shows "closure S = T" |
1733 |
using assms unfolding closure_hull by (rule hull_unique) |
|
1734 |
||
1735 |
lemma closure_empty [simp]: "closure {} = {}" |
|
44518 | 1736 |
using closed_empty by (rule closure_closed) |
33175 | 1737 |
|
44522
2f7e9d890efe
rename subset_{interior,closure} to {interior,closure}_mono;
huffman
parents:
44519
diff
changeset
|
1738 |
lemma closure_UNIV [simp]: "closure UNIV = UNIV" |
44518 | 1739 |
using closed_UNIV by (rule closure_closed) |
1740 |
||
1741 |
lemma closure_union [simp]: "closure (S \<union> T) = closure S \<union> closure T" |
|
1742 |
unfolding closure_interior by simp |
|
33175 | 1743 |
|
60974
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
1744 |
lemma closure_eq_empty [iff]: "closure S = {} \<longleftrightarrow> S = {}" |
33175 | 1745 |
using closure_empty closure_subset[of S] |
1746 |
by blast |
|
1747 |
||
1748 |
lemma closure_subset_eq: "closure S \<subseteq> S \<longleftrightarrow> closed S" |
|
1749 |
using closure_eq[of S] closure_subset[of S] |
|
1750 |
by simp |
|
1751 |
||
1752 |
lemma open_inter_closure_eq_empty: |
|
1753 |
"open S \<Longrightarrow> (S \<inter> closure T) = {} \<longleftrightarrow> S \<inter> T = {}" |
|
34105 | 1754 |
using open_subset_interior[of S "- T"] |
1755 |
using interior_subset[of "- T"] |
|
33175 | 1756 |
unfolding closure_interior |
1757 |
by auto |
|
1758 |
||
1759 |
lemma open_inter_closure_subset: |
|
1760 |
"open S \<Longrightarrow> (S \<inter> (closure T)) \<subseteq> closure(S \<inter> T)" |
|
1761 |
proof |
|
1762 |
fix x |
|
1763 |
assume as: "open S" "x \<in> S \<inter> closure T" |
|
53255 | 1764 |
{ |
53282 | 1765 |
assume *: "x islimpt T" |
33175 | 1766 |
have "x islimpt (S \<inter> T)" |
1767 |
proof (rule islimptI) |
|
1768 |
fix A |
|
1769 |
assume "x \<in> A" "open A" |
|
1770 |
with as have "x \<in> A \<inter> S" "open (A \<inter> S)" |
|
1771 |
by (simp_all add: open_Int) |
|
1772 |
with * obtain y where "y \<in> T" "y \<in> A \<inter> S" "y \<noteq> x" |
|
1773 |
by (rule islimptE) |
|
53255 | 1774 |
then have "y \<in> S \<inter> T" "y \<in> A \<and> y \<noteq> x" |
33175 | 1775 |
by simp_all |
53255 | 1776 |
then show "\<exists>y\<in>(S \<inter> T). y \<in> A \<and> y \<noteq> x" .. |
33175 | 1777 |
qed |
1778 |
} |
|
1779 |
then show "x \<in> closure (S \<inter> T)" using as |
|
1780 |
unfolding closure_def |
|
1781 |
by blast |
|
1782 |
qed |
|
1783 |
||
44519 | 1784 |
lemma closure_complement: "closure (- S) = - interior S" |
44518 | 1785 |
unfolding closure_interior by simp |
33175 | 1786 |
|
44519 | 1787 |
lemma interior_complement: "interior (- S) = - closure S" |
44518 | 1788 |
unfolding closure_interior by simp |
33175 | 1789 |
|
44365 | 1790 |
lemma closure_Times: "closure (A \<times> B) = closure A \<times> closure B" |
44519 | 1791 |
proof (rule closure_unique) |
44365 | 1792 |
show "A \<times> B \<subseteq> closure A \<times> closure B" |
1793 |
by (intro Sigma_mono closure_subset) |
|
1794 |
show "closed (closure A \<times> closure B)" |
|
1795 |
by (intro closed_Times closed_closure) |
|
53282 | 1796 |
fix T |
1797 |
assume "A \<times> B \<subseteq> T" and "closed T" |
|
1798 |
then show "closure A \<times> closure B \<subseteq> T" |
|
44365 | 1799 |
apply (simp add: closed_def open_prod_def, clarify) |
1800 |
apply (rule ccontr) |
|
1801 |
apply (drule_tac x="(a, b)" in bspec, simp, clarify, rename_tac C D) |
|
1802 |
apply (simp add: closure_interior interior_def) |
|
1803 |
apply (drule_tac x=C in spec) |
|
1804 |
apply (drule_tac x=D in spec) |
|
1805 |
apply auto |
|
1806 |
done |
|
1807 |
qed |
|
1808 |
||
51351 | 1809 |
lemma islimpt_in_closure: "(x islimpt S) = (x:closure(S-{x}))" |
1810 |
unfolding closure_def using islimpt_punctured by blast |
|
1811 |
||
61306
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1812 |
lemma connected_imp_connected_closure: "connected s \<Longrightarrow> connected (closure s)" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1813 |
by (rule connectedI) (meson closure_subset open_Int open_inter_closure_eq_empty subset_trans connectedD) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1814 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1815 |
lemma limpt_of_limpts: |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1816 |
fixes x :: "'a::metric_space" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1817 |
shows "x islimpt {y. y islimpt s} \<Longrightarrow> x islimpt s" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1818 |
apply (clarsimp simp add: islimpt_approachable) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1819 |
apply (drule_tac x="e/2" in spec) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1820 |
apply (auto simp: simp del: less_divide_eq_numeral1) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1821 |
apply (drule_tac x="dist x' x" in spec) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1822 |
apply (auto simp: zero_less_dist_iff simp del: less_divide_eq_numeral1) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1823 |
apply (erule rev_bexI) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1824 |
by (metis dist_commute dist_triangle_half_r less_trans less_irrefl) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1825 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1826 |
lemma closed_limpts: "closed {x::'a::metric_space. x islimpt s}" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1827 |
using closed_limpt limpt_of_limpts by blast |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1828 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1829 |
lemma limpt_of_closure: |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1830 |
fixes x :: "'a::metric_space" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1831 |
shows "x islimpt closure s \<longleftrightarrow> x islimpt s" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1832 |
by (auto simp: closure_def islimpt_Un dest: limpt_of_limpts) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1833 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1834 |
lemma closed_in_limpt: |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1835 |
"closedin (subtopology euclidean t) s \<longleftrightarrow> s \<subseteq> t \<and> (\<forall>x. x islimpt s \<and> x \<in> t \<longrightarrow> x \<in> s)" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1836 |
apply (simp add: closedin_closed, safe) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1837 |
apply (simp add: closed_limpt islimpt_subset) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1838 |
apply (rule_tac x="closure s" in exI) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1839 |
apply simp |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1840 |
apply (force simp: closure_def) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1841 |
done |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1842 |
|
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
1843 |
lemma closedin_closed_eq: |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
1844 |
"closed s \<Longrightarrow> (closedin (subtopology euclidean s) t \<longleftrightarrow> closed t \<and> t \<subseteq> s)" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
1845 |
by (meson closed_in_limpt closed_subset closedin_closed_trans) |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
1846 |
|
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1847 |
|
61306
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1848 |
subsection\<open>Connected components, considered as a connectedness relation or a set\<close> |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1849 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1850 |
definition |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1851 |
"connected_component s x y \<equiv> \<exists>t. connected t \<and> t \<subseteq> s \<and> x \<in> t \<and> y \<in> t" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1852 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1853 |
abbreviation |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1854 |
"connected_component_set s x \<equiv> Collect (connected_component s x)" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1855 |
|
61426
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61424
diff
changeset
|
1856 |
lemma connected_componentI: |
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61424
diff
changeset
|
1857 |
"\<lbrakk>connected t; t \<subseteq> s; x \<in> t; y \<in> t\<rbrakk> \<Longrightarrow> connected_component s x y" |
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61424
diff
changeset
|
1858 |
by (auto simp: connected_component_def) |
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61424
diff
changeset
|
1859 |
|
61306
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1860 |
lemma connected_component_in: "connected_component s x y \<Longrightarrow> x \<in> s \<and> y \<in> s" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1861 |
by (auto simp: connected_component_def) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1862 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1863 |
lemma connected_component_refl: "x \<in> s \<Longrightarrow> connected_component s x x" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1864 |
apply (auto simp: connected_component_def) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1865 |
using connected_sing by blast |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1866 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1867 |
lemma connected_component_refl_eq [simp]: "connected_component s x x \<longleftrightarrow> x \<in> s" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1868 |
by (auto simp: connected_component_refl) (auto simp: connected_component_def) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1869 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1870 |
lemma connected_component_sym: "connected_component s x y \<Longrightarrow> connected_component s y x" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1871 |
by (auto simp: connected_component_def) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1872 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1873 |
lemma connected_component_trans: |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1874 |
"\<lbrakk>connected_component s x y; connected_component s y z\<rbrakk> \<Longrightarrow> connected_component s x z" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1875 |
unfolding connected_component_def |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1876 |
by (metis Int_iff Un_iff Un_subset_iff equals0D connected_Un) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1877 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1878 |
lemma connected_component_of_subset: "\<lbrakk>connected_component s x y; s \<subseteq> t\<rbrakk> \<Longrightarrow> connected_component t x y" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1879 |
by (auto simp: connected_component_def) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1880 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1881 |
lemma connected_component_Union: "connected_component_set s x = Union {t. connected t \<and> x \<in> t \<and> t \<subseteq> s}" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1882 |
by (auto simp: connected_component_def) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1883 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1884 |
lemma connected_connected_component [iff]: "connected (connected_component_set s x)" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1885 |
by (auto simp: connected_component_Union intro: connected_Union) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1886 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1887 |
lemma connected_iff_eq_connected_component_set: "connected s \<longleftrightarrow> (\<forall>x \<in> s. connected_component_set s x = s)" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1888 |
proof (cases "s={}") |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1889 |
case True then show ?thesis by simp |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1890 |
next |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1891 |
case False |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1892 |
then obtain x where "x \<in> s" by auto |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1893 |
show ?thesis |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1894 |
proof |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1895 |
assume "connected s" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1896 |
then show "\<forall>x \<in> s. connected_component_set s x = s" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1897 |
by (force simp: connected_component_def) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1898 |
next |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1899 |
assume "\<forall>x \<in> s. connected_component_set s x = s" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1900 |
then show "connected s" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1901 |
by (metis `x \<in> s` connected_connected_component) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1902 |
qed |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1903 |
qed |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1904 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1905 |
lemma connected_component_subset: "connected_component_set s x \<subseteq> s" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1906 |
using connected_component_in by blast |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1907 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1908 |
lemma connected_component_eq_self: "\<lbrakk>connected s; x \<in> s\<rbrakk> \<Longrightarrow> connected_component_set s x = s" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1909 |
by (simp add: connected_iff_eq_connected_component_set) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1910 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1911 |
lemma connected_iff_connected_component: |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1912 |
"connected s \<longleftrightarrow> (\<forall>x \<in> s. \<forall>y \<in> s. connected_component s x y)" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1913 |
using connected_component_in by (auto simp: connected_iff_eq_connected_component_set) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1914 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1915 |
lemma connected_component_maximal: |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1916 |
"\<lbrakk>x \<in> t; connected t; t \<subseteq> s\<rbrakk> \<Longrightarrow> t \<subseteq> (connected_component_set s x)" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1917 |
using connected_component_eq_self connected_component_of_subset by blast |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1918 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1919 |
lemma connected_component_mono: |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1920 |
"s \<subseteq> t \<Longrightarrow> (connected_component_set s x) \<subseteq> (connected_component_set t x)" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1921 |
by (simp add: Collect_mono connected_component_of_subset) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1922 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1923 |
lemma connected_component_eq_empty [simp]: "connected_component_set s x = {} \<longleftrightarrow> (x \<notin> s)" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1924 |
using connected_component_refl by (fastforce simp: connected_component_in) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1925 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1926 |
lemma connected_component_set_empty [simp]: "connected_component_set {} x = {}" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1927 |
using connected_component_eq_empty by blast |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1928 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1929 |
lemma connected_component_eq: |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1930 |
"y \<in> connected_component_set s x |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1931 |
\<Longrightarrow> (connected_component_set s y = connected_component_set s x)" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1932 |
by (metis (no_types, lifting) Collect_cong connected_component_sym connected_component_trans mem_Collect_eq) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1933 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1934 |
lemma closed_connected_component: |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1935 |
assumes s: "closed s" shows "closed (connected_component_set s x)" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1936 |
proof (cases "x \<in> s") |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1937 |
case False then show ?thesis |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1938 |
by (metis connected_component_eq_empty closed_empty) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1939 |
next |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1940 |
case True |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1941 |
show ?thesis |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1942 |
unfolding closure_eq [symmetric] |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1943 |
proof |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1944 |
show "closure (connected_component_set s x) \<subseteq> connected_component_set s x" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1945 |
apply (rule connected_component_maximal) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1946 |
apply (simp add: closure_def True) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1947 |
apply (simp add: connected_imp_connected_closure) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1948 |
apply (simp add: s closure_minimal connected_component_subset) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1949 |
done |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1950 |
next |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1951 |
show "connected_component_set s x \<subseteq> closure (connected_component_set s x)" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1952 |
by (simp add: closure_subset) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1953 |
qed |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1954 |
qed |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1955 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1956 |
lemma connected_component_disjoint: |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1957 |
"(connected_component_set s a) \<inter> (connected_component_set s b) = {} \<longleftrightarrow> |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1958 |
a \<notin> connected_component_set s b" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1959 |
apply (auto simp: connected_component_eq) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1960 |
using connected_component_eq connected_component_sym by blast |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1961 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1962 |
lemma connected_component_nonoverlap: |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1963 |
"(connected_component_set s a) \<inter> (connected_component_set s b) = {} \<longleftrightarrow> |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1964 |
(a \<notin> s \<or> b \<notin> s \<or> connected_component_set s a \<noteq> connected_component_set s b)" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1965 |
apply (auto simp: connected_component_in) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1966 |
using connected_component_refl_eq apply blast |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1967 |
apply (metis connected_component_eq mem_Collect_eq) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1968 |
apply (metis connected_component_eq mem_Collect_eq) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1969 |
done |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1970 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1971 |
lemma connected_component_overlap: |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1972 |
"(connected_component_set s a \<inter> connected_component_set s b \<noteq> {}) = |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1973 |
(a \<in> s \<and> b \<in> s \<and> connected_component_set s a = connected_component_set s b)" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1974 |
by (auto simp: connected_component_nonoverlap) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1975 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1976 |
lemma connected_component_sym_eq: "connected_component s x y \<longleftrightarrow> connected_component s y x" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1977 |
using connected_component_sym by blast |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1978 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1979 |
lemma connected_component_eq_eq: |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1980 |
"connected_component_set s x = connected_component_set s y \<longleftrightarrow> |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1981 |
x \<notin> s \<and> y \<notin> s \<or> x \<in> s \<and> y \<in> s \<and> connected_component s x y" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1982 |
apply (case_tac "y \<in> s") |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1983 |
apply (simp add:) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1984 |
apply (metis connected_component_eq connected_component_eq_empty connected_component_refl_eq mem_Collect_eq) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1985 |
apply (case_tac "x \<in> s") |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1986 |
apply (simp add:) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1987 |
apply (metis connected_component_eq_empty) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1988 |
using connected_component_eq_empty by blast |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1989 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1990 |
lemma connected_iff_connected_component_eq: |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1991 |
"connected s \<longleftrightarrow> |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1992 |
(\<forall>x \<in> s. \<forall>y \<in> s. connected_component_set s x = connected_component_set s y)" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1993 |
by (simp add: connected_component_eq_eq connected_iff_connected_component) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1994 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1995 |
lemma connected_component_idemp: |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1996 |
"connected_component_set (connected_component_set s x) x = connected_component_set s x" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1997 |
apply (rule subset_antisym) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1998 |
apply (simp add: connected_component_subset) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
1999 |
by (metis connected_component_eq_empty connected_component_maximal connected_component_refl_eq connected_connected_component mem_Collect_eq set_eq_subset) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2000 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2001 |
lemma connected_component_unique: |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2002 |
"\<lbrakk>x \<in> c; c \<subseteq> s; connected c; |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2003 |
\<And>c'. x \<in> c' \<and> c' \<subseteq> s \<and> connected c' |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2004 |
\<Longrightarrow> c' \<subseteq> c\<rbrakk> |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2005 |
\<Longrightarrow> connected_component_set s x = c" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2006 |
apply (rule subset_antisym) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2007 |
apply (meson connected_component_maximal connected_component_subset connected_connected_component contra_subsetD) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2008 |
by (simp add: connected_component_maximal) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2009 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2010 |
lemma joinable_connected_component_eq: |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2011 |
"\<lbrakk>connected t; t \<subseteq> s; |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2012 |
connected_component_set s x \<inter> t \<noteq> {}; |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2013 |
connected_component_set s y \<inter> t \<noteq> {}\<rbrakk> |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2014 |
\<Longrightarrow> connected_component_set s x = connected_component_set s y" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2015 |
apply (simp add: ex_in_conv [symmetric]) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2016 |
apply (rule connected_component_eq) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2017 |
by (metis (no_types, hide_lams) connected_component_eq_eq connected_component_in connected_component_maximal subsetD mem_Collect_eq) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2018 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2019 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2020 |
lemma Union_connected_component: "Union (connected_component_set s ` s) = s" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2021 |
apply (rule subset_antisym) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2022 |
apply (simp add: SUP_least connected_component_subset) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2023 |
using connected_component_refl_eq |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2024 |
by force |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2025 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2026 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2027 |
lemma complement_connected_component_unions: |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2028 |
"s - connected_component_set s x = |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2029 |
Union (connected_component_set s ` s - {connected_component_set s x})" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2030 |
apply (subst Union_connected_component [symmetric], auto) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2031 |
apply (metis connected_component_eq_eq connected_component_in) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2032 |
by (metis connected_component_eq mem_Collect_eq) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2033 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2034 |
lemma connected_component_intermediate_subset: |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2035 |
"\<lbrakk>connected_component_set u a \<subseteq> t; t \<subseteq> u\<rbrakk> |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2036 |
\<Longrightarrow> connected_component_set t a = connected_component_set u a" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2037 |
apply (case_tac "a \<in> u") |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2038 |
apply (simp add: connected_component_maximal connected_component_mono subset_antisym) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2039 |
using connected_component_eq_empty by blast |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2040 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2041 |
subsection\<open>The set of connected components of a set\<close> |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2042 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2043 |
definition components:: "'a::topological_space set \<Rightarrow> 'a set set" where |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2044 |
"components s \<equiv> connected_component_set s ` s" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2045 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2046 |
lemma components_iff: "s \<in> components u \<longleftrightarrow> (\<exists>x. x \<in> u \<and> s = connected_component_set u x)" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2047 |
by (auto simp: components_def) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2048 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2049 |
lemma Union_components: "u = Union (components u)" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2050 |
apply (rule subset_antisym) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2051 |
apply (metis Union_connected_component components_def set_eq_subset) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2052 |
using Union_connected_component components_def by fastforce |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2053 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2054 |
lemma pairwise_disjoint_components: "pairwise (\<lambda>X Y. X \<inter> Y = {}) (components u)" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2055 |
apply (simp add: pairwise_def) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2056 |
apply (auto simp: components_iff) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2057 |
apply (metis connected_component_eq_eq connected_component_in)+ |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2058 |
done |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2059 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2060 |
lemma in_components_nonempty: "c \<in> components s \<Longrightarrow> c \<noteq> {}" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2061 |
by (metis components_iff connected_component_eq_empty) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2062 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2063 |
lemma in_components_subset: "c \<in> components s \<Longrightarrow> c \<subseteq> s" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2064 |
using Union_components by blast |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2065 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2066 |
lemma in_components_connected: "c \<in> components s \<Longrightarrow> connected c" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2067 |
by (metis components_iff connected_connected_component) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2068 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2069 |
lemma in_components_maximal: |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2070 |
"c \<in> components s \<longleftrightarrow> |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2071 |
(c \<noteq> {} \<and> c \<subseteq> s \<and> connected c \<and> (\<forall>d. d \<noteq> {} \<and> c \<subseteq> d \<and> d \<subseteq> s \<and> connected d \<longrightarrow> d = c))" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2072 |
apply (rule iffI) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2073 |
apply (simp add: in_components_nonempty in_components_connected) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2074 |
apply (metis (full_types) components_iff connected_component_eq_self connected_component_intermediate_subset connected_component_refl in_components_subset mem_Collect_eq rev_subsetD) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2075 |
by (metis bot.extremum_uniqueI components_iff connected_component_eq_empty connected_component_maximal connected_component_subset connected_connected_component subset_emptyI) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2076 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2077 |
lemma joinable_components_eq: |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2078 |
"connected t \<and> t \<subseteq> s \<and> c1 \<in> components s \<and> c2 \<in> components s \<and> c1 \<inter> t \<noteq> {} \<and> c2 \<inter> t \<noteq> {} \<Longrightarrow> c1 = c2" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2079 |
by (metis (full_types) components_iff joinable_connected_component_eq) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2080 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2081 |
lemma closed_components: "\<lbrakk>closed s; c \<in> components s\<rbrakk> \<Longrightarrow> closed c" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2082 |
by (metis closed_connected_component components_iff) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2083 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2084 |
lemma components_nonoverlap: |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2085 |
"\<lbrakk>c \<in> components s; c' \<in> components s\<rbrakk> \<Longrightarrow> (c \<inter> c' = {}) \<longleftrightarrow> (c \<noteq> c')" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2086 |
apply (auto simp: in_components_nonempty components_iff) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2087 |
using connected_component_refl apply blast |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2088 |
apply (metis connected_component_eq_eq connected_component_in) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2089 |
by (metis connected_component_eq mem_Collect_eq) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2090 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2091 |
lemma components_eq: "\<lbrakk>c \<in> components s; c' \<in> components s\<rbrakk> \<Longrightarrow> (c = c' \<longleftrightarrow> c \<inter> c' \<noteq> {})" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2092 |
by (metis components_nonoverlap) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2093 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2094 |
lemma components_eq_empty [simp]: "components s = {} \<longleftrightarrow> s = {}" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2095 |
by (simp add: components_def) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2096 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2097 |
lemma components_empty [simp]: "components {} = {}" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2098 |
by simp |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2099 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2100 |
lemma connected_eq_connected_components_eq: "connected s \<longleftrightarrow> (\<forall>c \<in> components s. \<forall>c' \<in> components s. c = c')" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2101 |
by (metis (no_types, hide_lams) components_iff connected_component_eq_eq connected_iff_connected_component) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2102 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2103 |
lemma components_eq_sing_iff: "components s = {s} \<longleftrightarrow> connected s \<and> s \<noteq> {}" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2104 |
apply (rule iffI) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2105 |
using in_components_connected apply fastforce |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2106 |
apply safe |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2107 |
using Union_components apply fastforce |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2108 |
apply (metis components_iff connected_component_eq_self) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2109 |
using in_components_maximal by auto |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2110 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2111 |
lemma components_eq_sing_exists: "(\<exists>a. components s = {a}) \<longleftrightarrow> connected s \<and> s \<noteq> {}" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2112 |
apply (rule iffI) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2113 |
using connected_eq_connected_components_eq apply fastforce |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2114 |
by (metis components_eq_sing_iff) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2115 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2116 |
lemma connected_eq_components_subset_sing: "connected s \<longleftrightarrow> components s \<subseteq> {s}" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2117 |
by (metis Union_components components_empty components_eq_sing_iff connected_empty insert_subset order_refl subset_singletonD) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2118 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2119 |
lemma connected_eq_components_subset_sing_exists: "connected s \<longleftrightarrow> (\<exists>a. components s \<subseteq> {a})" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2120 |
by (metis components_eq_sing_exists connected_eq_components_subset_sing empty_iff subset_iff subset_singletonD) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2121 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2122 |
lemma in_components_self: "s \<in> components s \<longleftrightarrow> connected s \<and> s \<noteq> {}" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2123 |
by (metis components_empty components_eq_sing_iff empty_iff in_components_connected insertI1) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2124 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2125 |
lemma components_maximal: "\<lbrakk>c \<in> components s; connected t; t \<subseteq> s; c \<inter> t \<noteq> {}\<rbrakk> \<Longrightarrow> t \<subseteq> c" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2126 |
apply (simp add: components_def ex_in_conv [symmetric], clarify) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2127 |
by (meson connected_component_def connected_component_trans) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2128 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2129 |
lemma exists_component_superset: "\<lbrakk>t \<subseteq> s; s \<noteq> {}; connected t\<rbrakk> \<Longrightarrow> \<exists>c. c \<in> components s \<and> t \<subseteq> c" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2130 |
apply (case_tac "t = {}") |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2131 |
apply force |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2132 |
by (metis components_def ex_in_conv connected_component_maximal contra_subsetD image_eqI) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2133 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2134 |
lemma components_intermediate_subset: "\<lbrakk>s \<in> components u; s \<subseteq> t; t \<subseteq> u\<rbrakk> \<Longrightarrow> s \<in> components t" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2135 |
apply (auto simp: components_iff) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2136 |
by (metis connected_component_eq_empty connected_component_intermediate_subset) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2137 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2138 |
lemma in_components_unions_complement: "c \<in> components s \<Longrightarrow> s - c = Union(components s - {c})" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2139 |
by (metis complement_connected_component_unions components_def components_iff) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2140 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2141 |
lemma connected_intermediate_closure: |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2142 |
assumes cs: "connected s" and st: "s \<subseteq> t" and ts: "t \<subseteq> closure s" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2143 |
shows "connected t" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2144 |
proof (rule connectedI) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2145 |
fix A B |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2146 |
assume A: "open A" and B: "open B" and Alap: "A \<inter> t \<noteq> {}" and Blap: "B \<inter> t \<noteq> {}" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2147 |
and disj: "A \<inter> B \<inter> t = {}" and cover: "t \<subseteq> A \<union> B" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2148 |
have disjs: "A \<inter> B \<inter> s = {}" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2149 |
using disj st by auto |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2150 |
have "A \<inter> closure s \<noteq> {}" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2151 |
using Alap Int_absorb1 ts by blast |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2152 |
then have Alaps: "A \<inter> s \<noteq> {}" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2153 |
by (simp add: A open_inter_closure_eq_empty) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2154 |
have "B \<inter> closure s \<noteq> {}" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2155 |
using Blap Int_absorb1 ts by blast |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2156 |
then have Blaps: "B \<inter> s \<noteq> {}" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2157 |
by (simp add: B open_inter_closure_eq_empty) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2158 |
then show False |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2159 |
using cs [unfolded connected_def] A B disjs Alaps Blaps cover st |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2160 |
by blast |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2161 |
qed |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2162 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2163 |
lemma closed_in_connected_component: "closedin (subtopology euclidean s) (connected_component_set s x)" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2164 |
proof (cases "connected_component_set s x = {}") |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2165 |
case True then show ?thesis |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2166 |
by (metis closedin_empty) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2167 |
next |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2168 |
case False |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2169 |
then obtain y where y: "connected_component s x y" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2170 |
by blast |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2171 |
have 1: "connected_component_set s x \<subseteq> s \<inter> closure (connected_component_set s x)" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2172 |
by (auto simp: closure_def connected_component_in) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2173 |
have 2: "connected_component s x y \<Longrightarrow> s \<inter> closure (connected_component_set s x) \<subseteq> connected_component_set s x" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2174 |
apply (rule connected_component_maximal) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2175 |
apply (simp add:) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2176 |
using closure_subset connected_component_in apply fastforce |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2177 |
using "1" connected_intermediate_closure apply blast+ |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2178 |
done |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2179 |
show ?thesis using y |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2180 |
apply (simp add: Topology_Euclidean_Space.closedin_closed) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2181 |
using 1 2 by auto |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
2182 |
qed |
51351 | 2183 |
|
60420 | 2184 |
subsection \<open>Frontier (aka boundary)\<close> |
33175 | 2185 |
|
2186 |
definition "frontier S = closure S - interior S" |
|
2187 |
||
53255 | 2188 |
lemma frontier_closed: "closed (frontier S)" |
33175 | 2189 |
by (simp add: frontier_def closed_Diff) |
2190 |
||
34105 | 2191 |
lemma frontier_closures: "frontier S = (closure S) \<inter> (closure(- S))" |
33175 | 2192 |
by (auto simp add: frontier_def interior_closure) |
2193 |
||
2194 |
lemma frontier_straddle: |
|
2195 |
fixes a :: "'a::metric_space" |
|
44909 | 2196 |
shows "a \<in> frontier S \<longleftrightarrow> (\<forall>e>0. (\<exists>x\<in>S. dist a x < e) \<and> (\<exists>x. x \<notin> S \<and> dist a x < e))" |
2197 |
unfolding frontier_def closure_interior |
|
2198 |
by (auto simp add: mem_interior subset_eq ball_def) |
|
33175 | 2199 |
|
2200 |
lemma frontier_subset_closed: "closed S \<Longrightarrow> frontier S \<subseteq> S" |
|
2201 |
by (metis frontier_def closure_closed Diff_subset) |
|
2202 |
||
34964 | 2203 |
lemma frontier_empty[simp]: "frontier {} = {}" |
36362
06475a1547cb
fix lots of looping simp calls and other warnings
huffman
parents:
36360
diff
changeset
|
2204 |
by (simp add: frontier_def) |
33175 | 2205 |
|
2206 |
lemma frontier_subset_eq: "frontier S \<subseteq> S \<longleftrightarrow> closed S" |
|
58757 | 2207 |
proof - |
53255 | 2208 |
{ |
2209 |
assume "frontier S \<subseteq> S" |
|
2210 |
then have "closure S \<subseteq> S" |
|
2211 |
using interior_subset unfolding frontier_def by auto |
|
2212 |
then have "closed S" |
|
2213 |
using closure_subset_eq by auto |
|
33175 | 2214 |
} |
53255 | 2215 |
then show ?thesis using frontier_subset_closed[of S] .. |
33175 | 2216 |
qed |
2217 |
||
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
2218 |
lemma frontier_complement [simp]: "frontier (- S) = frontier S" |
33175 | 2219 |
by (auto simp add: frontier_def closure_complement interior_complement) |
2220 |
||
2221 |
lemma frontier_disjoint_eq: "frontier S \<inter> S = {} \<longleftrightarrow> open S" |
|
34105 | 2222 |
using frontier_complement frontier_subset_eq[of "- S"] |
2223 |
unfolding open_closed by auto |
|
33175 | 2224 |
|
58757 | 2225 |
|
60420 | 2226 |
subsection \<open>Filters and the ``eventually true'' quantifier\<close> |
44081
730f7cced3a6
rename type 'a net to 'a filter, following standard mathematical terminology
huffman
parents:
44076
diff
changeset
|
2227 |
|
52624 | 2228 |
definition indirection :: "'a::real_normed_vector \<Rightarrow> 'a \<Rightarrow> 'a filter" |
2229 |
(infixr "indirection" 70) |
|
2230 |
where "a indirection v = at a within {b. \<exists>c\<ge>0. b - a = scaleR c v}" |
|
33175 | 2231 |
|
60420 | 2232 |
text \<open>Identify Trivial limits, where we can't approach arbitrarily closely.\<close> |
33175 | 2233 |
|
52624 | 2234 |
lemma trivial_limit_within: "trivial_limit (at a within S) \<longleftrightarrow> \<not> a islimpt S" |
33175 | 2235 |
proof |
2236 |
assume "trivial_limit (at a within S)" |
|
53255 | 2237 |
then show "\<not> a islimpt S" |
33175 | 2238 |
unfolding trivial_limit_def |
51641
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents:
51530
diff
changeset
|
2239 |
unfolding eventually_at_topological |
33175 | 2240 |
unfolding islimpt_def |
39302
d7728f65b353
renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
nipkow
parents:
39198
diff
changeset
|
2241 |
apply (clarsimp simp add: set_eq_iff) |
33175 | 2242 |
apply (rename_tac T, rule_tac x=T in exI) |
36358
246493d61204
define nets directly as filters, instead of as filter bases
huffman
parents:
36336
diff
changeset
|
2243 |
apply (clarsimp, drule_tac x=y in bspec, simp_all) |
33175 | 2244 |
done |
2245 |
next |
|
2246 |
assume "\<not> a islimpt S" |
|
53255 | 2247 |
then show "trivial_limit (at a within S)" |
55775 | 2248 |
unfolding trivial_limit_def eventually_at_topological islimpt_def |
2249 |
by metis |
|
33175 | 2250 |
qed |
2251 |
||
2252 |
lemma trivial_limit_at_iff: "trivial_limit (at a) \<longleftrightarrow> \<not> a islimpt UNIV" |
|
45031 | 2253 |
using trivial_limit_within [of a UNIV] by simp |
33175 | 2254 |
|
2255 |
lemma trivial_limit_at: |
|
2256 |
fixes a :: "'a::perfect_space" |
|
2257 |
shows "\<not> trivial_limit (at a)" |
|
44571 | 2258 |
by (rule at_neq_bot) |
33175 | 2259 |
|
2260 |
lemma trivial_limit_at_infinity: |
|
44081
730f7cced3a6
rename type 'a net to 'a filter, following standard mathematical terminology
huffman
parents:
44076
diff
changeset
|
2261 |
"\<not> trivial_limit (at_infinity :: ('a::{real_normed_vector,perfect_space}) filter)" |
36358
246493d61204
define nets directly as filters, instead of as filter bases
huffman
parents:
36336
diff
changeset
|
2262 |
unfolding trivial_limit_def eventually_at_infinity |
246493d61204
define nets directly as filters, instead of as filter bases
huffman
parents:
36336
diff
changeset
|
2263 |
apply clarsimp |
44072
5b970711fb39
class perfect_space inherits from topological_space;
huffman
parents:
43338
diff
changeset
|
2264 |
apply (subgoal_tac "\<exists>x::'a. x \<noteq> 0", clarify) |
5b970711fb39
class perfect_space inherits from topological_space;
huffman
parents:
43338
diff
changeset
|
2265 |
apply (rule_tac x="scaleR (b / norm x) x" in exI, simp) |
5b970711fb39
class perfect_space inherits from topological_space;
huffman
parents:
43338
diff
changeset
|
2266 |
apply (cut_tac islimpt_UNIV [of "0::'a", unfolded islimpt_def]) |
5b970711fb39
class perfect_space inherits from topological_space;
huffman
parents:
43338
diff
changeset
|
2267 |
apply (drule_tac x=UNIV in spec, simp) |
33175 | 2268 |
done |
2269 |
||
53640 | 2270 |
lemma not_trivial_limit_within: "\<not> trivial_limit (at x within S) = (x \<in> closure (S - {x}))" |
2271 |
using islimpt_in_closure |
|
2272 |
by (metis trivial_limit_within) |
|
51351 | 2273 |
|
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2274 |
lemma at_within_eq_bot_iff: "(at c within A = bot) \<longleftrightarrow> (c \<notin> closure (A - {c}))" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2275 |
using not_trivial_limit_within[of c A] by blast |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2276 |
|
60420 | 2277 |
text \<open>Some property holds "sufficiently close" to the limit point.\<close> |
33175 | 2278 |
|
2279 |
lemma trivial_limit_eventually: "trivial_limit net \<Longrightarrow> eventually P net" |
|
45031 | 2280 |
by simp |
33175 | 2281 |
|
2282 |
lemma trivial_limit_eq: "trivial_limit net \<longleftrightarrow> (\<forall>P. eventually P net)" |
|
44342
8321948340ea
redefine constant 'trivial_limit' as an abbreviation
huffman
parents:
44286
diff
changeset
|
2283 |
by (simp add: filter_eq_iff) |
33175 | 2284 |
|
60420 | 2285 |
text\<open>Combining theorems for "eventually"\<close> |
33175 | 2286 |
|
2287 |
lemma eventually_rev_mono: |
|
2288 |
"eventually P net \<Longrightarrow> (\<forall>x. P x \<longrightarrow> Q x) \<Longrightarrow> eventually Q net" |
|
53255 | 2289 |
using eventually_mono [of P Q] by fast |
33175 | 2290 |
|
53282 | 2291 |
lemma not_eventually: "(\<forall>x. \<not> P x ) \<Longrightarrow> \<not> trivial_limit net \<Longrightarrow> \<not> eventually (\<lambda>x. P x) net" |
33175 | 2292 |
by (simp add: eventually_False) |
2293 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
2294 |
|
60420 | 2295 |
subsection \<open>Limits\<close> |
33175 | 2296 |
|
2297 |
lemma Lim: |
|
53255 | 2298 |
"(f ---> l) net \<longleftrightarrow> |
33175 | 2299 |
trivial_limit net \<or> |
2300 |
(\<forall>e>0. eventually (\<lambda>x. dist (f x) l < e) net)" |
|
2301 |
unfolding tendsto_iff trivial_limit_eq by auto |
|
2302 |
||
60420 | 2303 |
text\<open>Show that they yield usual definitions in the various cases.\<close> |
33175 | 2304 |
|
2305 |
lemma Lim_within_le: "(f ---> l)(at a within S) \<longleftrightarrow> |
|
53640 | 2306 |
(\<forall>e>0. \<exists>d>0. \<forall>x\<in>S. 0 < dist x a \<and> dist x a \<le> d \<longrightarrow> dist (f x) l < e)" |
51641
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents:
51530
diff
changeset
|
2307 |
by (auto simp add: tendsto_iff eventually_at_le dist_nz) |
33175 | 2308 |
|
2309 |
lemma Lim_within: "(f ---> l) (at a within S) \<longleftrightarrow> |
|
53640 | 2310 |
(\<forall>e >0. \<exists>d>0. \<forall>x \<in> S. 0 < dist x a \<and> dist x a < d \<longrightarrow> dist (f x) l < e)" |
51641
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents:
51530
diff
changeset
|
2311 |
by (auto simp add: tendsto_iff eventually_at dist_nz) |
33175 | 2312 |
|
2313 |
lemma Lim_at: "(f ---> l) (at a) \<longleftrightarrow> |
|
53640 | 2314 |
(\<forall>e >0. \<exists>d>0. \<forall>x. 0 < dist x a \<and> dist x a < d \<longrightarrow> dist (f x) l < e)" |
51530
609914f0934a
rename eventually_at / _within, to distinguish them from the lemmas in the HOL image
hoelzl
parents:
51518
diff
changeset
|
2315 |
by (auto simp add: tendsto_iff eventually_at2) |
33175 | 2316 |
|
2317 |
lemma Lim_at_infinity: |
|
53640 | 2318 |
"(f ---> l) at_infinity \<longleftrightarrow> (\<forall>e>0. \<exists>b. \<forall>x. norm x \<ge> b \<longrightarrow> dist (f x) l < e)" |
33175 | 2319 |
by (auto simp add: tendsto_iff eventually_at_infinity) |
2320 |
||
2321 |
lemma Lim_eventually: "eventually (\<lambda>x. f x = l) net \<Longrightarrow> (f ---> l) net" |
|
2322 |
by (rule topological_tendstoI, auto elim: eventually_rev_mono) |
|
2323 |
||
60420 | 2324 |
text\<open>The expected monotonicity property.\<close> |
33175 | 2325 |
|
53255 | 2326 |
lemma Lim_Un: |
2327 |
assumes "(f ---> l) (at x within S)" "(f ---> l) (at x within T)" |
|
51641
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents:
51530
diff
changeset
|
2328 |
shows "(f ---> l) (at x within (S \<union> T))" |
53860 | 2329 |
using assms unfolding at_within_union by (rule filterlim_sup) |
33175 | 2330 |
|
2331 |
lemma Lim_Un_univ: |
|
53282 | 2332 |
"(f ---> l) (at x within S) \<Longrightarrow> (f ---> l) (at x within T) \<Longrightarrow> |
53255 | 2333 |
S \<union> T = UNIV \<Longrightarrow> (f ---> l) (at x)" |
51641
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents:
51530
diff
changeset
|
2334 |
by (metis Lim_Un) |
33175 | 2335 |
|
60420 | 2336 |
text\<open>Interrelations between restricted and unrestricted limits.\<close> |
33175 | 2337 |
|
60974
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
2338 |
lemma Lim_at_imp_Lim_at_within: |
51641
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents:
51530
diff
changeset
|
2339 |
"(f ---> l) (at x) \<Longrightarrow> (f ---> l) (at x within S)" |
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents:
51530
diff
changeset
|
2340 |
by (metis order_refl filterlim_mono subset_UNIV at_le) |
33175 | 2341 |
|
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
2342 |
lemma eventually_within_interior: |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
2343 |
assumes "x \<in> interior S" |
53255 | 2344 |
shows "eventually P (at x within S) \<longleftrightarrow> eventually P (at x)" |
2345 |
(is "?lhs = ?rhs") |
|
2346 |
proof |
|
44519 | 2347 |
from assms obtain T where T: "open T" "x \<in> T" "T \<subseteq> S" .. |
53255 | 2348 |
{ |
2349 |
assume "?lhs" |
|
53640 | 2350 |
then obtain A where "open A" and "x \<in> A" and "\<forall>y\<in>A. y \<noteq> x \<longrightarrow> y \<in> S \<longrightarrow> P y" |
51641
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents:
51530
diff
changeset
|
2351 |
unfolding eventually_at_topological |
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
2352 |
by auto |
53640 | 2353 |
with T have "open (A \<inter> T)" and "x \<in> A \<inter> T" and "\<forall>y \<in> A \<inter> T. y \<noteq> x \<longrightarrow> P y" |
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
2354 |
by auto |
53255 | 2355 |
then show "?rhs" |
51471 | 2356 |
unfolding eventually_at_topological by auto |
53255 | 2357 |
next |
2358 |
assume "?rhs" |
|
2359 |
then show "?lhs" |
|
51641
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents:
51530
diff
changeset
|
2360 |
by (auto elim: eventually_elim1 simp: eventually_at_filter) |
52624 | 2361 |
} |
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
2362 |
qed |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
2363 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
2364 |
lemma at_within_interior: |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
2365 |
"x \<in> interior S \<Longrightarrow> at x within S = at x" |
51641
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents:
51530
diff
changeset
|
2366 |
unfolding filter_eq_iff by (intro allI eventually_within_interior) |
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
2367 |
|
43338 | 2368 |
lemma Lim_within_LIMSEQ: |
53862 | 2369 |
fixes a :: "'a::first_countable_topology" |
43338 | 2370 |
assumes "\<forall>S. (\<forall>n. S n \<noteq> a \<and> S n \<in> T) \<and> S ----> a \<longrightarrow> (\<lambda>n. X (S n)) ----> L" |
2371 |
shows "(X ---> L) (at a within T)" |
|
44584 | 2372 |
using assms unfolding tendsto_def [where l=L] |
2373 |
by (simp add: sequentially_imp_eventually_within) |
|
43338 | 2374 |
|
2375 |
lemma Lim_right_bound: |
|
51773 | 2376 |
fixes f :: "'a :: {linorder_topology, conditionally_complete_linorder, no_top} \<Rightarrow> |
2377 |
'b::{linorder_topology, conditionally_complete_linorder}" |
|
43338 | 2378 |
assumes mono: "\<And>a b. a \<in> I \<Longrightarrow> b \<in> I \<Longrightarrow> x < a \<Longrightarrow> a \<le> b \<Longrightarrow> f a \<le> f b" |
53255 | 2379 |
and bnd: "\<And>a. a \<in> I \<Longrightarrow> x < a \<Longrightarrow> K \<le> f a" |
43338 | 2380 |
shows "(f ---> Inf (f ` ({x<..} \<inter> I))) (at x within ({x<..} \<inter> I))" |
53640 | 2381 |
proof (cases "{x<..} \<inter> I = {}") |
2382 |
case True |
|
53859 | 2383 |
then show ?thesis by simp |
43338 | 2384 |
next |
53640 | 2385 |
case False |
43338 | 2386 |
show ?thesis |
51518
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
hoelzl
parents:
51481
diff
changeset
|
2387 |
proof (rule order_tendstoI) |
53282 | 2388 |
fix a |
2389 |
assume a: "a < Inf (f ` ({x<..} \<inter> I))" |
|
53255 | 2390 |
{ |
2391 |
fix y |
|
2392 |
assume "y \<in> {x<..} \<inter> I" |
|
53640 | 2393 |
with False bnd have "Inf (f ` ({x<..} \<inter> I)) \<le> f y" |
56166 | 2394 |
by (auto intro!: cInf_lower bdd_belowI2 simp del: Inf_image_eq) |
53255 | 2395 |
with a have "a < f y" |
2396 |
by (blast intro: less_le_trans) |
|
2397 |
} |
|
51518
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
hoelzl
parents:
51481
diff
changeset
|
2398 |
then show "eventually (\<lambda>x. a < f x) (at x within ({x<..} \<inter> I))" |
51641
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents:
51530
diff
changeset
|
2399 |
by (auto simp: eventually_at_filter intro: exI[of _ 1] zero_less_one) |
51518
6a56b7088a6a
separate SupInf into Conditional_Complete_Lattice, move instantiation of real to RealDef
hoelzl
parents:
51481
diff
changeset
|
2400 |
next |
53255 | 2401 |
fix a |
2402 |
assume "Inf (f ` ({x<..} \<inter> I)) < a" |
|
53640 | 2403 |
from cInf_lessD[OF _ this] False obtain y where y: "x < y" "y \<in> I" "f y < a" |
53255 | 2404 |
by auto |
51641
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents:
51530
diff
changeset
|
2405 |
then have "eventually (\<lambda>x. x \<in> I \<longrightarrow> f x < a) (at_right x)" |
60420 | 2406 |
unfolding eventually_at_right[OF \<open>x < y\<close>] by (metis less_imp_le le_less_trans mono) |
51641
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents:
51530
diff
changeset
|
2407 |
then show "eventually (\<lambda>x. f x < a) (at x within ({x<..} \<inter> I))" |
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents:
51530
diff
changeset
|
2408 |
unfolding eventually_at_filter by eventually_elim simp |
43338 | 2409 |
qed |
2410 |
qed |
|
2411 |
||
60420 | 2412 |
text\<open>Another limit point characterization.\<close> |
33175 | 2413 |
|
2414 |
lemma islimpt_sequential: |
|
50883 | 2415 |
fixes x :: "'a::first_countable_topology" |
2416 |
shows "x islimpt S \<longleftrightarrow> (\<exists>f. (\<forall>n::nat. f n \<in> S - {x}) \<and> (f ---> x) sequentially)" |
|
33175 | 2417 |
(is "?lhs = ?rhs") |
2418 |
proof |
|
2419 |
assume ?lhs |
|
55522 | 2420 |
from countable_basis_at_decseq[of x] obtain A where A: |
2421 |
"\<And>i. open (A i)" |
|
2422 |
"\<And>i. x \<in> A i" |
|
2423 |
"\<And>S. open S \<Longrightarrow> x \<in> S \<Longrightarrow> eventually (\<lambda>i. A i \<subseteq> S) sequentially" |
|
2424 |
by blast |
|
50883 | 2425 |
def f \<equiv> "\<lambda>n. SOME y. y \<in> S \<and> y \<in> A n \<and> x \<noteq> y" |
53255 | 2426 |
{ |
2427 |
fix n |
|
60420 | 2428 |
from \<open>?lhs\<close> have "\<exists>y. y \<in> S \<and> y \<in> A n \<and> x \<noteq> y" |
50883 | 2429 |
unfolding islimpt_def using A(1,2)[of n] by auto |
2430 |
then have "f n \<in> S \<and> f n \<in> A n \<and> x \<noteq> f n" |
|
2431 |
unfolding f_def by (rule someI_ex) |
|
53255 | 2432 |
then have "f n \<in> S" "f n \<in> A n" "x \<noteq> f n" by auto |
2433 |
} |
|
50883 | 2434 |
then have "\<forall>n. f n \<in> S - {x}" by auto |
2435 |
moreover have "(\<lambda>n. f n) ----> x" |
|
2436 |
proof (rule topological_tendstoI) |
|
53255 | 2437 |
fix S |
2438 |
assume "open S" "x \<in> S" |
|
60420 | 2439 |
from A(3)[OF this] \<open>\<And>n. f n \<in> A n\<close> |
53255 | 2440 |
show "eventually (\<lambda>x. f x \<in> S) sequentially" |
2441 |
by (auto elim!: eventually_elim1) |
|
44584 | 2442 |
qed |
2443 |
ultimately show ?rhs by fast |
|
33175 | 2444 |
next |
2445 |
assume ?rhs |
|
53255 | 2446 |
then obtain f :: "nat \<Rightarrow> 'a" where f: "\<And>n. f n \<in> S - {x}" and lim: "f ----> x" |
2447 |
by auto |
|
50883 | 2448 |
show ?lhs |
2449 |
unfolding islimpt_def |
|
2450 |
proof safe |
|
53255 | 2451 |
fix T |
2452 |
assume "open T" "x \<in> T" |
|
50883 | 2453 |
from lim[THEN topological_tendstoD, OF this] f |
2454 |
show "\<exists>y\<in>S. y \<in> T \<and> y \<noteq> x" |
|
2455 |
unfolding eventually_sequentially by auto |
|
2456 |
qed |
|
33175 | 2457 |
qed |
2458 |
||
2459 |
lemma Lim_null: |
|
2460 |
fixes f :: "'a \<Rightarrow> 'b::real_normed_vector" |
|
44125 | 2461 |
shows "(f ---> l) net \<longleftrightarrow> ((\<lambda>x. f(x) - l) ---> 0) net" |
33175 | 2462 |
by (simp add: Lim dist_norm) |
2463 |
||
2464 |
lemma Lim_null_comparison: |
|
2465 |
fixes f :: "'a \<Rightarrow> 'b::real_normed_vector" |
|
2466 |
assumes "eventually (\<lambda>x. norm (f x) \<le> g x) net" "(g ---> 0) net" |
|
2467 |
shows "(f ---> 0) net" |
|
53282 | 2468 |
using assms(2) |
44252
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
2469 |
proof (rule metric_tendsto_imp_tendsto) |
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
2470 |
show "eventually (\<lambda>x. dist (f x) 0 \<le> dist (g x) 0) net" |
53255 | 2471 |
using assms(1) by (rule eventually_elim1) (simp add: dist_norm) |
33175 | 2472 |
qed |
2473 |
||
2474 |
lemma Lim_transform_bound: |
|
2475 |
fixes f :: "'a \<Rightarrow> 'b::real_normed_vector" |
|
53255 | 2476 |
and g :: "'a \<Rightarrow> 'c::real_normed_vector" |
53640 | 2477 |
assumes "eventually (\<lambda>n. norm (f n) \<le> norm (g n)) net" |
53255 | 2478 |
and "(g ---> 0) net" |
33175 | 2479 |
shows "(f ---> 0) net" |
44252
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
2480 |
using assms(1) tendsto_norm_zero [OF assms(2)] |
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
2481 |
by (rule Lim_null_comparison) |
33175 | 2482 |
|
60420 | 2483 |
text\<open>Deducing things about the limit from the elements.\<close> |
33175 | 2484 |
|
2485 |
lemma Lim_in_closed_set: |
|
53255 | 2486 |
assumes "closed S" |
2487 |
and "eventually (\<lambda>x. f(x) \<in> S) net" |
|
53640 | 2488 |
and "\<not> trivial_limit net" "(f ---> l) net" |
33175 | 2489 |
shows "l \<in> S" |
2490 |
proof (rule ccontr) |
|
2491 |
assume "l \<notin> S" |
|
60420 | 2492 |
with \<open>closed S\<close> have "open (- S)" "l \<in> - S" |
33175 | 2493 |
by (simp_all add: open_Compl) |
2494 |
with assms(4) have "eventually (\<lambda>x. f x \<in> - S) net" |
|
2495 |
by (rule topological_tendstoD) |
|
2496 |
with assms(2) have "eventually (\<lambda>x. False) net" |
|
2497 |
by (rule eventually_elim2) simp |
|
2498 |
with assms(3) show "False" |
|
2499 |
by (simp add: eventually_False) |
|
2500 |
qed |
|
2501 |
||
60420 | 2502 |
text\<open>Need to prove closed(cball(x,e)) before deducing this as a corollary.\<close> |
33175 | 2503 |
|
2504 |
lemma Lim_dist_ubound: |
|
53255 | 2505 |
assumes "\<not>(trivial_limit net)" |
2506 |
and "(f ---> l) net" |
|
53640 | 2507 |
and "eventually (\<lambda>x. dist a (f x) \<le> e) net" |
2508 |
shows "dist a l \<le> e" |
|
56290 | 2509 |
using assms by (fast intro: tendsto_le tendsto_intros) |
33175 | 2510 |
|
2511 |
lemma Lim_norm_ubound: |
|
2512 |
fixes f :: "'a \<Rightarrow> 'b::real_normed_vector" |
|
53255 | 2513 |
assumes "\<not>(trivial_limit net)" "(f ---> l) net" "eventually (\<lambda>x. norm(f x) \<le> e) net" |
2514 |
shows "norm(l) \<le> e" |
|
56290 | 2515 |
using assms by (fast intro: tendsto_le tendsto_intros) |
33175 | 2516 |
|
2517 |
lemma Lim_norm_lbound: |
|
2518 |
fixes f :: "'a \<Rightarrow> 'b::real_normed_vector" |
|
53640 | 2519 |
assumes "\<not> trivial_limit net" |
2520 |
and "(f ---> l) net" |
|
2521 |
and "eventually (\<lambda>x. e \<le> norm (f x)) net" |
|
33175 | 2522 |
shows "e \<le> norm l" |
56290 | 2523 |
using assms by (fast intro: tendsto_le tendsto_intros) |
33175 | 2524 |
|
60420 | 2525 |
text\<open>Limit under bilinear function\<close> |
33175 | 2526 |
|
2527 |
lemma Lim_bilinear: |
|
53282 | 2528 |
assumes "(f ---> l) net" |
2529 |
and "(g ---> m) net" |
|
2530 |
and "bounded_bilinear h" |
|
33175 | 2531 |
shows "((\<lambda>x. h (f x) (g x)) ---> (h l m)) net" |
60420 | 2532 |
using \<open>bounded_bilinear h\<close> \<open>(f ---> l) net\<close> \<open>(g ---> m) net\<close> |
52624 | 2533 |
by (rule bounded_bilinear.tendsto) |
33175 | 2534 |
|
60420 | 2535 |
text\<open>These are special for limits out of the same vector space.\<close> |
33175 | 2536 |
|
2537 |
lemma Lim_within_id: "(id ---> a) (at a within s)" |
|
51641
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents:
51530
diff
changeset
|
2538 |
unfolding id_def by (rule tendsto_ident_at) |
33175 | 2539 |
|
2540 |
lemma Lim_at_id: "(id ---> a) (at a)" |
|
45031 | 2541 |
unfolding id_def by (rule tendsto_ident_at) |
33175 | 2542 |
|
2543 |
lemma Lim_at_zero: |
|
2544 |
fixes a :: "'a::real_normed_vector" |
|
53291 | 2545 |
and l :: "'b::topological_space" |
53282 | 2546 |
shows "(f ---> l) (at a) \<longleftrightarrow> ((\<lambda>x. f(a + x)) ---> l) (at 0)" |
44252
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
2547 |
using LIM_offset_zero LIM_offset_zero_cancel .. |
33175 | 2548 |
|
60420 | 2549 |
text\<open>It's also sometimes useful to extract the limit point from the filter.\<close> |
33175 | 2550 |
|
52624 | 2551 |
abbreviation netlimit :: "'a::t2_space filter \<Rightarrow> 'a" |
2552 |
where "netlimit F \<equiv> Lim F (\<lambda>x. x)" |
|
33175 | 2553 |
|
53282 | 2554 |
lemma netlimit_within: "\<not> trivial_limit (at a within S) \<Longrightarrow> netlimit (at a within S) = a" |
51365 | 2555 |
by (rule tendsto_Lim) (auto intro: tendsto_intros) |
33175 | 2556 |
|
2557 |
lemma netlimit_at: |
|
44072
5b970711fb39
class perfect_space inherits from topological_space;
huffman
parents:
43338
diff
changeset
|
2558 |
fixes a :: "'a::{perfect_space,t2_space}" |
33175 | 2559 |
shows "netlimit (at a) = a" |
45031 | 2560 |
using netlimit_within [of a UNIV] by simp |
33175 | 2561 |
|
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
2562 |
lemma lim_within_interior: |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
2563 |
"x \<in> interior S \<Longrightarrow> (f ---> l) (at x within S) \<longleftrightarrow> (f ---> l) (at x)" |
51641
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents:
51530
diff
changeset
|
2564 |
by (metis at_within_interior) |
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
2565 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
2566 |
lemma netlimit_within_interior: |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
2567 |
fixes x :: "'a::{t2_space,perfect_space}" |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
2568 |
assumes "x \<in> interior S" |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
2569 |
shows "netlimit (at x within S) = x" |
52624 | 2570 |
using assms by (metis at_within_interior netlimit_at) |
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
2571 |
|
33175 | 2572 |
|
60420 | 2573 |
text\<open>Useful lemmas on closure and set of possible sequential limits.\<close> |
33175 | 2574 |
|
2575 |
lemma closure_sequential: |
|
50883 | 2576 |
fixes l :: "'a::first_countable_topology" |
53291 | 2577 |
shows "l \<in> closure S \<longleftrightarrow> (\<exists>x. (\<forall>n. x n \<in> S) \<and> (x ---> l) sequentially)" |
2578 |
(is "?lhs = ?rhs") |
|
33175 | 2579 |
proof |
53282 | 2580 |
assume "?lhs" |
2581 |
moreover |
|
2582 |
{ |
|
2583 |
assume "l \<in> S" |
|
2584 |
then have "?rhs" using tendsto_const[of l sequentially] by auto |
|
52624 | 2585 |
} |
2586 |
moreover |
|
53282 | 2587 |
{ |
2588 |
assume "l islimpt S" |
|
2589 |
then have "?rhs" unfolding islimpt_sequential by auto |
|
52624 | 2590 |
} |
2591 |
ultimately show "?rhs" |
|
2592 |
unfolding closure_def by auto |
|
33175 | 2593 |
next |
2594 |
assume "?rhs" |
|
53282 | 2595 |
then show "?lhs" unfolding closure_def islimpt_sequential by auto |
33175 | 2596 |
qed |
2597 |
||
2598 |
lemma closed_sequential_limits: |
|
50883 | 2599 |
fixes S :: "'a::first_countable_topology set" |
33175 | 2600 |
shows "closed S \<longleftrightarrow> (\<forall>x l. (\<forall>n. x n \<in> S) \<and> (x ---> l) sequentially \<longrightarrow> l \<in> S)" |
55775 | 2601 |
by (metis closure_sequential closure_subset_eq subset_iff) |
33175 | 2602 |
|
2603 |
lemma closure_approachable: |
|
2604 |
fixes S :: "'a::metric_space set" |
|
2605 |
shows "x \<in> closure S \<longleftrightarrow> (\<forall>e>0. \<exists>y\<in>S. dist y x < e)" |
|
2606 |
apply (auto simp add: closure_def islimpt_approachable) |
|
52624 | 2607 |
apply (metis dist_self) |
2608 |
done |
|
33175 | 2609 |
|
2610 |
lemma closed_approachable: |
|
2611 |
fixes S :: "'a::metric_space set" |
|
53291 | 2612 |
shows "closed S \<Longrightarrow> (\<forall>e>0. \<exists>y\<in>S. dist y x < e) \<longleftrightarrow> x \<in> S" |
33175 | 2613 |
by (metis closure_closed closure_approachable) |
2614 |
||
51351 | 2615 |
lemma closure_contains_Inf: |
2616 |
fixes S :: "real set" |
|
54258
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents:
54230
diff
changeset
|
2617 |
assumes "S \<noteq> {}" "bdd_below S" |
51351 | 2618 |
shows "Inf S \<in> closure S" |
52624 | 2619 |
proof - |
51351 | 2620 |
have *: "\<forall>x\<in>S. Inf S \<le> x" |
54258
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents:
54230
diff
changeset
|
2621 |
using cInf_lower[of _ S] assms by metis |
52624 | 2622 |
{ |
53282 | 2623 |
fix e :: real |
2624 |
assume "e > 0" |
|
52624 | 2625 |
then have "Inf S < Inf S + e" by simp |
2626 |
with assms obtain x where "x \<in> S" "x < Inf S + e" |
|
54258
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents:
54230
diff
changeset
|
2627 |
by (subst (asm) cInf_less_iff) auto |
52624 | 2628 |
with * have "\<exists>x\<in>S. dist x (Inf S) < e" |
2629 |
by (intro bexI[of _ x]) (auto simp add: dist_real_def) |
|
2630 |
} |
|
2631 |
then show ?thesis unfolding closure_approachable by auto |
|
51351 | 2632 |
qed |
2633 |
||
2634 |
lemma closed_contains_Inf: |
|
2635 |
fixes S :: "real set" |
|
54258
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents:
54230
diff
changeset
|
2636 |
shows "S \<noteq> {} \<Longrightarrow> bdd_below S \<Longrightarrow> closed S \<Longrightarrow> Inf S \<in> S" |
51351 | 2637 |
by (metis closure_contains_Inf closure_closed assms) |
2638 |
||
2639 |
lemma not_trivial_limit_within_ball: |
|
53640 | 2640 |
"\<not> trivial_limit (at x within S) \<longleftrightarrow> (\<forall>e>0. S \<inter> ball x e - {x} \<noteq> {})" |
60462 | 2641 |
(is "?lhs \<longleftrightarrow> ?rhs") |
2642 |
proof |
|
2643 |
show ?rhs if ?lhs |
|
2644 |
proof - |
|
53282 | 2645 |
{ |
2646 |
fix e :: real |
|
2647 |
assume "e > 0" |
|
53640 | 2648 |
then obtain y where "y \<in> S - {x}" and "dist y x < e" |
60420 | 2649 |
using \<open>?lhs\<close> not_trivial_limit_within[of x S] closure_approachable[of x "S - {x}"] |
51351 | 2650 |
by auto |
53640 | 2651 |
then have "y \<in> S \<inter> ball x e - {x}" |
51351 | 2652 |
unfolding ball_def by (simp add: dist_commute) |
53640 | 2653 |
then have "S \<inter> ball x e - {x} \<noteq> {}" by blast |
52624 | 2654 |
} |
60462 | 2655 |
then show ?thesis by auto |
2656 |
qed |
|
2657 |
show ?lhs if ?rhs |
|
2658 |
proof - |
|
53282 | 2659 |
{ |
2660 |
fix e :: real |
|
2661 |
assume "e > 0" |
|
53640 | 2662 |
then obtain y where "y \<in> S \<inter> ball x e - {x}" |
60420 | 2663 |
using \<open>?rhs\<close> by blast |
53640 | 2664 |
then have "y \<in> S - {x}" and "dist y x < e" |
2665 |
unfolding ball_def by (simp_all add: dist_commute) |
|
2666 |
then have "\<exists>y \<in> S - {x}. dist y x < e" |
|
53282 | 2667 |
by auto |
51351 | 2668 |
} |
60462 | 2669 |
then show ?thesis |
53282 | 2670 |
using not_trivial_limit_within[of x S] closure_approachable[of x "S - {x}"] |
2671 |
by auto |
|
60462 | 2672 |
qed |
51351 | 2673 |
qed |
2674 |
||
52624 | 2675 |
|
60420 | 2676 |
subsection \<open>Infimum Distance\<close> |
50087 | 2677 |
|
54260
6a967667fd45
use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents:
54259
diff
changeset
|
2678 |
definition "infdist x A = (if A = {} then 0 else INF a:A. dist x a)" |
6a967667fd45
use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents:
54259
diff
changeset
|
2679 |
|
6a967667fd45
use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents:
54259
diff
changeset
|
2680 |
lemma bdd_below_infdist[intro, simp]: "bdd_below (dist x`A)" |
54258
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents:
54230
diff
changeset
|
2681 |
by (auto intro!: zero_le_dist) |
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents:
54230
diff
changeset
|
2682 |
|
54260
6a967667fd45
use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents:
54259
diff
changeset
|
2683 |
lemma infdist_notempty: "A \<noteq> {} \<Longrightarrow> infdist x A = (INF a:A. dist x a)" |
50087 | 2684 |
by (simp add: infdist_def) |
2685 |
||
52624 | 2686 |
lemma infdist_nonneg: "0 \<le> infdist x A" |
54260
6a967667fd45
use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents:
54259
diff
changeset
|
2687 |
by (auto simp add: infdist_def intro: cINF_greatest) |
6a967667fd45
use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents:
54259
diff
changeset
|
2688 |
|
6a967667fd45
use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents:
54259
diff
changeset
|
2689 |
lemma infdist_le: "a \<in> A \<Longrightarrow> infdist x A \<le> dist x a" |
6a967667fd45
use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents:
54259
diff
changeset
|
2690 |
by (auto intro: cINF_lower simp add: infdist_def) |
6a967667fd45
use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents:
54259
diff
changeset
|
2691 |
|
6a967667fd45
use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents:
54259
diff
changeset
|
2692 |
lemma infdist_le2: "a \<in> A \<Longrightarrow> dist x a \<le> d \<Longrightarrow> infdist x A \<le> d" |
6a967667fd45
use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents:
54259
diff
changeset
|
2693 |
by (auto intro!: cINF_lower2 simp add: infdist_def) |
54258
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents:
54230
diff
changeset
|
2694 |
|
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents:
54230
diff
changeset
|
2695 |
lemma infdist_zero[simp]: "a \<in> A \<Longrightarrow> infdist a A = 0" |
54260
6a967667fd45
use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents:
54259
diff
changeset
|
2696 |
by (auto intro!: antisym infdist_nonneg infdist_le2) |
50087 | 2697 |
|
52624 | 2698 |
lemma infdist_triangle: "infdist x A \<le> infdist y A + dist x y" |
53640 | 2699 |
proof (cases "A = {}") |
2700 |
case True |
|
53282 | 2701 |
then show ?thesis by (simp add: infdist_def) |
50087 | 2702 |
next |
53640 | 2703 |
case False |
52624 | 2704 |
then obtain a where "a \<in> A" by auto |
50087 | 2705 |
have "infdist x A \<le> Inf {dist x y + dist y a |a. a \<in> A}" |
51475
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
hoelzl
parents:
51473
diff
changeset
|
2706 |
proof (rule cInf_greatest) |
60420 | 2707 |
from \<open>A \<noteq> {}\<close> show "{dist x y + dist y a |a. a \<in> A} \<noteq> {}" |
53282 | 2708 |
by simp |
2709 |
fix d |
|
2710 |
assume "d \<in> {dist x y + dist y a |a. a \<in> A}" |
|
2711 |
then obtain a where d: "d = dist x y + dist y a" "a \<in> A" |
|
2712 |
by auto |
|
50087 | 2713 |
show "infdist x A \<le> d" |
60420 | 2714 |
unfolding infdist_notempty[OF \<open>A \<noteq> {}\<close>] |
54260
6a967667fd45
use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents:
54259
diff
changeset
|
2715 |
proof (rule cINF_lower2) |
6a967667fd45
use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents:
54259
diff
changeset
|
2716 |
show "a \<in> A" by fact |
53282 | 2717 |
show "dist x a \<le> d" |
2718 |
unfolding d by (rule dist_triangle) |
|
54258
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents:
54230
diff
changeset
|
2719 |
qed simp |
50087 | 2720 |
qed |
2721 |
also have "\<dots> = dist x y + infdist y A" |
|
51475
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
hoelzl
parents:
51473
diff
changeset
|
2722 |
proof (rule cInf_eq, safe) |
53282 | 2723 |
fix a |
2724 |
assume "a \<in> A" |
|
2725 |
then show "dist x y + infdist y A \<le> dist x y + dist y a" |
|
2726 |
by (auto intro: infdist_le) |
|
50087 | 2727 |
next |
53282 | 2728 |
fix i |
2729 |
assume inf: "\<And>d. d \<in> {dist x y + dist y a |a. a \<in> A} \<Longrightarrow> i \<le> d" |
|
2730 |
then have "i - dist x y \<le> infdist y A" |
|
60420 | 2731 |
unfolding infdist_notempty[OF \<open>A \<noteq> {}\<close>] using \<open>a \<in> A\<close> |
54260
6a967667fd45
use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents:
54259
diff
changeset
|
2732 |
by (intro cINF_greatest) (auto simp: field_simps) |
53282 | 2733 |
then show "i \<le> dist x y + infdist y A" |
2734 |
by simp |
|
50087 | 2735 |
qed |
2736 |
finally show ?thesis by simp |
|
2737 |
qed |
|
2738 |
||
51475
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
hoelzl
parents:
51473
diff
changeset
|
2739 |
lemma in_closure_iff_infdist_zero: |
50087 | 2740 |
assumes "A \<noteq> {}" |
2741 |
shows "x \<in> closure A \<longleftrightarrow> infdist x A = 0" |
|
2742 |
proof |
|
2743 |
assume "x \<in> closure A" |
|
2744 |
show "infdist x A = 0" |
|
2745 |
proof (rule ccontr) |
|
2746 |
assume "infdist x A \<noteq> 0" |
|
53282 | 2747 |
with infdist_nonneg[of x A] have "infdist x A > 0" |
2748 |
by auto |
|
2749 |
then have "ball x (infdist x A) \<inter> closure A = {}" |
|
52624 | 2750 |
apply auto |
60420 | 2751 |
apply (metis \<open>x \<in> closure A\<close> closure_approachable dist_commute infdist_le not_less) |
52624 | 2752 |
done |
53282 | 2753 |
then have "x \<notin> closure A" |
60420 | 2754 |
by (metis \<open>0 < infdist x A\<close> centre_in_ball disjoint_iff_not_equal) |
2755 |
then show False using \<open>x \<in> closure A\<close> by simp |
|
50087 | 2756 |
qed |
2757 |
next |
|
2758 |
assume x: "infdist x A = 0" |
|
53282 | 2759 |
then obtain a where "a \<in> A" |
2760 |
by atomize_elim (metis all_not_in_conv assms) |
|
2761 |
show "x \<in> closure A" |
|
2762 |
unfolding closure_approachable |
|
2763 |
apply safe |
|
2764 |
proof (rule ccontr) |
|
2765 |
fix e :: real |
|
2766 |
assume "e > 0" |
|
50087 | 2767 |
assume "\<not> (\<exists>y\<in>A. dist y x < e)" |
60420 | 2768 |
then have "infdist x A \<ge> e" using \<open>a \<in> A\<close> |
50087 | 2769 |
unfolding infdist_def |
54260
6a967667fd45
use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents:
54259
diff
changeset
|
2770 |
by (force simp: dist_commute intro: cINF_greatest) |
60420 | 2771 |
with x \<open>e > 0\<close> show False by auto |
50087 | 2772 |
qed |
2773 |
qed |
|
2774 |
||
51475
ebf9d4fd00ba
introduct the conditional_complete_lattice type class; generalize theorems about real Sup and Inf to it
hoelzl
parents:
51473
diff
changeset
|
2775 |
lemma in_closed_iff_infdist_zero: |
50087 | 2776 |
assumes "closed A" "A \<noteq> {}" |
2777 |
shows "x \<in> A \<longleftrightarrow> infdist x A = 0" |
|
2778 |
proof - |
|
2779 |
have "x \<in> closure A \<longleftrightarrow> infdist x A = 0" |
|
2780 |
by (rule in_closure_iff_infdist_zero) fact |
|
2781 |
with assms show ?thesis by simp |
|
2782 |
qed |
|
2783 |
||
2784 |
lemma tendsto_infdist [tendsto_intros]: |
|
2785 |
assumes f: "(f ---> l) F" |
|
2786 |
shows "((\<lambda>x. infdist (f x) A) ---> infdist l A) F" |
|
2787 |
proof (rule tendstoI) |
|
53282 | 2788 |
fix e ::real |
2789 |
assume "e > 0" |
|
50087 | 2790 |
from tendstoD[OF f this] |
2791 |
show "eventually (\<lambda>x. dist (infdist (f x) A) (infdist l A) < e) F" |
|
2792 |
proof (eventually_elim) |
|
2793 |
fix x |
|
2794 |
from infdist_triangle[of l A "f x"] infdist_triangle[of "f x" A l] |
|
2795 |
have "dist (infdist (f x) A) (infdist l A) \<le> dist (f x) l" |
|
2796 |
by (simp add: dist_commute dist_real_def) |
|
2797 |
also assume "dist (f x) l < e" |
|
2798 |
finally show "dist (infdist (f x) A) (infdist l A) < e" . |
|
2799 |
qed |
|
2800 |
qed |
|
2801 |
||
60420 | 2802 |
text\<open>Some other lemmas about sequences.\<close> |
33175 | 2803 |
|
53597 | 2804 |
lemma sequentially_offset: (* TODO: move to Topological_Spaces.thy *) |
36441 | 2805 |
assumes "eventually (\<lambda>i. P i) sequentially" |
2806 |
shows "eventually (\<lambda>i. P (i + k)) sequentially" |
|
53597 | 2807 |
using assms by (rule eventually_sequentially_seg [THEN iffD2]) |
2808 |
||
2809 |
lemma seq_offset_neg: (* TODO: move to Topological_Spaces.thy *) |
|
53291 | 2810 |
"(f ---> l) sequentially \<Longrightarrow> ((\<lambda>i. f(i - k)) ---> l) sequentially" |
53597 | 2811 |
apply (erule filterlim_compose) |
2812 |
apply (simp add: filterlim_def le_sequentially eventually_filtermap eventually_sequentially) |
|
52624 | 2813 |
apply arith |
2814 |
done |
|
33175 | 2815 |
|
2816 |
lemma seq_harmonic: "((\<lambda>n. inverse (real n)) ---> 0) sequentially" |
|
53597 | 2817 |
using LIMSEQ_inverse_real_of_nat by (rule LIMSEQ_imp_Suc) (* TODO: move to Limits.thy *) |
33175 | 2818 |
|
60420 | 2819 |
subsection \<open>More properties of closed balls\<close> |
33175 | 2820 |
|
61204 | 2821 |
lemma closed_cball [iff]: "closed (cball x e)" |
54070 | 2822 |
proof - |
2823 |
have "closed (dist x -` {..e})" |
|
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56290
diff
changeset
|
2824 |
by (intro closed_vimage closed_atMost continuous_intros) |
54070 | 2825 |
also have "dist x -` {..e} = cball x e" |
2826 |
by auto |
|
2827 |
finally show ?thesis . |
|
2828 |
qed |
|
33175 | 2829 |
|
2830 |
lemma open_contains_cball: "open S \<longleftrightarrow> (\<forall>x\<in>S. \<exists>e>0. cball x e \<subseteq> S)" |
|
52624 | 2831 |
proof - |
2832 |
{ |
|
2833 |
fix x and e::real |
|
2834 |
assume "x\<in>S" "e>0" "ball x e \<subseteq> S" |
|
53282 | 2835 |
then have "\<exists>d>0. cball x d \<subseteq> S" unfolding subset_eq by (rule_tac x="e/2" in exI, auto) |
52624 | 2836 |
} |
2837 |
moreover |
|
2838 |
{ |
|
2839 |
fix x and e::real |
|
2840 |
assume "x\<in>S" "e>0" "cball x e \<subseteq> S" |
|
53282 | 2841 |
then have "\<exists>d>0. ball x d \<subseteq> S" |
52624 | 2842 |
unfolding subset_eq |
2843 |
apply(rule_tac x="e/2" in exI) |
|
2844 |
apply auto |
|
2845 |
done |
|
2846 |
} |
|
2847 |
ultimately show ?thesis |
|
2848 |
unfolding open_contains_ball by auto |
|
33175 | 2849 |
qed |
2850 |
||
53291 | 2851 |
lemma open_contains_cball_eq: "open S \<Longrightarrow> (\<forall>x. x \<in> S \<longleftrightarrow> (\<exists>e>0. cball x e \<subseteq> S))" |
44170
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44167
diff
changeset
|
2852 |
by (metis open_contains_cball subset_eq order_less_imp_le centre_in_cball) |
33175 | 2853 |
|
2854 |
lemma mem_interior_cball: "x \<in> interior S \<longleftrightarrow> (\<exists>e>0. cball x e \<subseteq> S)" |
|
2855 |
apply (simp add: interior_def, safe) |
|
2856 |
apply (force simp add: open_contains_cball) |
|
2857 |
apply (rule_tac x="ball x e" in exI) |
|
36362
06475a1547cb
fix lots of looping simp calls and other warnings
huffman
parents:
36360
diff
changeset
|
2858 |
apply (simp add: subset_trans [OF ball_subset_cball]) |
33175 | 2859 |
done |
2860 |
||
2861 |
lemma islimpt_ball: |
|
2862 |
fixes x y :: "'a::{real_normed_vector,perfect_space}" |
|
53291 | 2863 |
shows "y islimpt ball x e \<longleftrightarrow> 0 < e \<and> y \<in> cball x e" |
60462 | 2864 |
(is "?lhs \<longleftrightarrow> ?rhs") |
33175 | 2865 |
proof |
60462 | 2866 |
show ?rhs if ?lhs |
2867 |
proof |
|
2868 |
{ |
|
2869 |
assume "e \<le> 0" |
|
2870 |
then have *: "ball x e = {}" |
|
2871 |
using ball_eq_empty[of x e] by auto |
|
2872 |
have False using \<open>?lhs\<close> |
|
2873 |
unfolding * using islimpt_EMPTY[of y] by auto |
|
2874 |
} |
|
2875 |
then show "e > 0" by (metis not_less) |
|
2876 |
show "y \<in> cball x e" |
|
2877 |
using closed_cball[of x e] islimpt_subset[of y "ball x e" "cball x e"] |
|
2878 |
ball_subset_cball[of x e] \<open>?lhs\<close> |
|
2879 |
unfolding closed_limpt by auto |
|
2880 |
qed |
|
2881 |
show ?lhs if ?rhs |
|
2882 |
proof - |
|
2883 |
from that have "e > 0" by auto |
|
2884 |
{ |
|
2885 |
fix d :: real |
|
2886 |
assume "d > 0" |
|
2887 |
have "\<exists>x'\<in>ball x e. x' \<noteq> y \<and> dist x' y < d" |
|
2888 |
proof (cases "d \<le> dist x y") |
|
53282 | 2889 |
case True |
2890 |
then show "\<exists>x'\<in>ball x e. x' \<noteq> y \<and> dist x' y < d" |
|
60462 | 2891 |
proof (cases "x = y") |
2892 |
case True |
|
2893 |
then have False |
|
2894 |
using \<open>d \<le> dist x y\<close> \<open>d>0\<close> by auto |
|
2895 |
then show "\<exists>x'\<in>ball x e. x' \<noteq> y \<and> dist x' y < d" |
|
2896 |
by auto |
|
2897 |
next |
|
2898 |
case False |
|
2899 |
have "dist x (y - (d / (2 * dist y x)) *\<^sub>R (y - x)) = |
|
2900 |
norm (x - y + (d / (2 * norm (y - x))) *\<^sub>R (y - x))" |
|
2901 |
unfolding mem_cball mem_ball dist_norm diff_diff_eq2 diff_add_eq[symmetric] |
|
2902 |
by auto |
|
2903 |
also have "\<dots> = \<bar>- 1 + d / (2 * norm (x - y))\<bar> * norm (x - y)" |
|
2904 |
using scaleR_left_distrib[of "- 1" "d / (2 * norm (y - x))", symmetric, of "y - x"] |
|
2905 |
unfolding scaleR_minus_left scaleR_one |
|
2906 |
by (auto simp add: norm_minus_commute) |
|
2907 |
also have "\<dots> = \<bar>- norm (x - y) + d / 2\<bar>" |
|
2908 |
unfolding abs_mult_pos[of "norm (x - y)", OF norm_ge_zero[of "x - y"]] |
|
2909 |
unfolding distrib_right using \<open>x\<noteq>y\<close>[unfolded dist_nz, unfolded dist_norm] |
|
2910 |
by auto |
|
2911 |
also have "\<dots> \<le> e - d/2" using \<open>d \<le> dist x y\<close> and \<open>d>0\<close> and \<open>?rhs\<close> |
|
2912 |
by (auto simp add: dist_norm) |
|
2913 |
finally have "y - (d / (2 * dist y x)) *\<^sub>R (y - x) \<in> ball x e" using \<open>d>0\<close> |
|
2914 |
by auto |
|
2915 |
moreover |
|
2916 |
have "(d / (2*dist y x)) *\<^sub>R (y - x) \<noteq> 0" |
|
2917 |
using \<open>x\<noteq>y\<close>[unfolded dist_nz] \<open>d>0\<close> unfolding scaleR_eq_0_iff |
|
2918 |
by (auto simp add: dist_commute) |
|
2919 |
moreover |
|
2920 |
have "dist (y - (d / (2 * dist y x)) *\<^sub>R (y - x)) y < d" |
|
2921 |
unfolding dist_norm |
|
2922 |
apply simp |
|
2923 |
unfolding norm_minus_cancel |
|
2924 |
using \<open>d > 0\<close> \<open>x\<noteq>y\<close>[unfolded dist_nz] dist_commute[of x y] |
|
2925 |
unfolding dist_norm |
|
2926 |
apply auto |
|
2927 |
done |
|
2928 |
ultimately show "\<exists>x'\<in>ball x e. x' \<noteq> y \<and> dist x' y < d" |
|
2929 |
apply (rule_tac x = "y - (d / (2*dist y x)) *\<^sub>R (y - x)" in bexI) |
|
2930 |
apply auto |
|
2931 |
done |
|
2932 |
qed |
|
33175 | 2933 |
next |
2934 |
case False |
|
60462 | 2935 |
then have "d > dist x y" by auto |
2936 |
show "\<exists>x' \<in> ball x e. x' \<noteq> y \<and> dist x' y < d" |
|
2937 |
proof (cases "x = y") |
|
2938 |
case True |
|
2939 |
obtain z where **: "z \<noteq> y" "dist z y < min e d" |
|
2940 |
using perfect_choose_dist[of "min e d" y] |
|
2941 |
using \<open>d > 0\<close> \<open>e>0\<close> by auto |
|
2942 |
show "\<exists>x'\<in>ball x e. x' \<noteq> y \<and> dist x' y < d" |
|
2943 |
unfolding \<open>x = y\<close> |
|
2944 |
using \<open>z \<noteq> y\<close> ** |
|
2945 |
apply (rule_tac x=z in bexI) |
|
2946 |
apply (auto simp add: dist_commute) |
|
2947 |
done |
|
2948 |
next |
|
2949 |
case False |
|
2950 |
then show "\<exists>x'\<in>ball x e. x' \<noteq> y \<and> dist x' y < d" |
|
2951 |
using \<open>d>0\<close> \<open>d > dist x y\<close> \<open>?rhs\<close> |
|
2952 |
apply (rule_tac x=x in bexI) |
|
2953 |
apply auto |
|
2954 |
done |
|
2955 |
qed |
|
33175 | 2956 |
qed |
60462 | 2957 |
} |
2958 |
then show ?thesis |
|
2959 |
unfolding mem_cball islimpt_approachable mem_ball by auto |
|
2960 |
qed |
|
33175 | 2961 |
qed |
2962 |
||
2963 |
lemma closure_ball_lemma: |
|
2964 |
fixes x y :: "'a::real_normed_vector" |
|
53282 | 2965 |
assumes "x \<noteq> y" |
2966 |
shows "y islimpt ball x (dist x y)" |
|
33175 | 2967 |
proof (rule islimptI) |
53282 | 2968 |
fix T |
2969 |
assume "y \<in> T" "open T" |
|
33175 | 2970 |
then obtain r where "0 < r" "\<forall>z. dist z y < r \<longrightarrow> z \<in> T" |
2971 |
unfolding open_dist by fast |
|
2972 |
(* choose point between x and y, within distance r of y. *) |
|
2973 |
def k \<equiv> "min 1 (r / (2 * dist x y))" |
|
2974 |
def z \<equiv> "y + scaleR k (x - y)" |
|
2975 |
have z_def2: "z = x + scaleR (1 - k) (y - x)" |
|
2976 |
unfolding z_def by (simp add: algebra_simps) |
|
2977 |
have "dist z y < r" |
|
60420 | 2978 |
unfolding z_def k_def using \<open>0 < r\<close> |
33175 | 2979 |
by (simp add: dist_norm min_def) |
53282 | 2980 |
then have "z \<in> T" |
60420 | 2981 |
using \<open>\<forall>z. dist z y < r \<longrightarrow> z \<in> T\<close> by simp |
33175 | 2982 |
have "dist x z < dist x y" |
2983 |
unfolding z_def2 dist_norm |
|
2984 |
apply (simp add: norm_minus_commute) |
|
2985 |
apply (simp only: dist_norm [symmetric]) |
|
2986 |
apply (subgoal_tac "\<bar>1 - k\<bar> * dist x y < 1 * dist x y", simp) |
|
2987 |
apply (rule mult_strict_right_mono) |
|
60420 | 2988 |
apply (simp add: k_def zero_less_dist_iff \<open>0 < r\<close> \<open>x \<noteq> y\<close>) |
2989 |
apply (simp add: zero_less_dist_iff \<open>x \<noteq> y\<close>) |
|
33175 | 2990 |
done |
53282 | 2991 |
then have "z \<in> ball x (dist x y)" |
2992 |
by simp |
|
33175 | 2993 |
have "z \<noteq> y" |
60420 | 2994 |
unfolding z_def k_def using \<open>x \<noteq> y\<close> \<open>0 < r\<close> |
33175 | 2995 |
by (simp add: min_def) |
2996 |
show "\<exists>z\<in>ball x (dist x y). z \<in> T \<and> z \<noteq> y" |
|
60420 | 2997 |
using \<open>z \<in> ball x (dist x y)\<close> \<open>z \<in> T\<close> \<open>z \<noteq> y\<close> |
33175 | 2998 |
by fast |
2999 |
qed |
|
3000 |
||
3001 |
lemma closure_ball: |
|
3002 |
fixes x :: "'a::real_normed_vector" |
|
3003 |
shows "0 < e \<Longrightarrow> closure (ball x e) = cball x e" |
|
52624 | 3004 |
apply (rule equalityI) |
3005 |
apply (rule closure_minimal) |
|
3006 |
apply (rule ball_subset_cball) |
|
3007 |
apply (rule closed_cball) |
|
3008 |
apply (rule subsetI, rename_tac y) |
|
3009 |
apply (simp add: le_less [where 'a=real]) |
|
3010 |
apply (erule disjE) |
|
3011 |
apply (rule subsetD [OF closure_subset], simp) |
|
3012 |
apply (simp add: closure_def) |
|
3013 |
apply clarify |
|
3014 |
apply (rule closure_ball_lemma) |
|
3015 |
apply (simp add: zero_less_dist_iff) |
|
3016 |
done |
|
33175 | 3017 |
|
3018 |
(* In a trivial vector space, this fails for e = 0. *) |
|
3019 |
lemma interior_cball: |
|
3020 |
fixes x :: "'a::{real_normed_vector, perfect_space}" |
|
3021 |
shows "interior (cball x e) = ball x e" |
|
53640 | 3022 |
proof (cases "e \<ge> 0") |
33175 | 3023 |
case False note cs = this |
53282 | 3024 |
from cs have "ball x e = {}" |
3025 |
using ball_empty[of e x] by auto |
|
3026 |
moreover |
|
3027 |
{ |
|
3028 |
fix y |
|
3029 |
assume "y \<in> cball x e" |
|
3030 |
then have False |
|
3031 |
unfolding mem_cball using dist_nz[of x y] cs by auto |
|
3032 |
} |
|
3033 |
then have "cball x e = {}" by auto |
|
3034 |
then have "interior (cball x e) = {}" |
|
3035 |
using interior_empty by auto |
|
33175 | 3036 |
ultimately show ?thesis by blast |
3037 |
next |
|
3038 |
case True note cs = this |
|
53282 | 3039 |
have "ball x e \<subseteq> cball x e" |
3040 |
using ball_subset_cball by auto |
|
3041 |
moreover |
|
3042 |
{ |
|
3043 |
fix S y |
|
3044 |
assume as: "S \<subseteq> cball x e" "open S" "y\<in>S" |
|
3045 |
then obtain d where "d>0" and d: "\<forall>x'. dist x' y < d \<longrightarrow> x' \<in> S" |
|
3046 |
unfolding open_dist by blast |
|
33175 | 3047 |
then obtain xa where xa_y: "xa \<noteq> y" and xa: "dist xa y < d" |
3048 |
using perfect_choose_dist [of d] by auto |
|
53282 | 3049 |
have "xa \<in> S" |
3050 |
using d[THEN spec[where x = xa]] |
|
3051 |
using xa by (auto simp add: dist_commute) |
|
3052 |
then have xa_cball: "xa \<in> cball x e" |
|
3053 |
using as(1) by auto |
|
3054 |
then have "y \<in> ball x e" |
|
3055 |
proof (cases "x = y") |
|
33175 | 3056 |
case True |
53282 | 3057 |
then have "e > 0" |
3058 |
using xa_y[unfolded dist_nz] xa_cball[unfolded mem_cball] |
|
52624 | 3059 |
by (auto simp add: dist_commute) |
53282 | 3060 |
then show "y \<in> ball x e" |
60420 | 3061 |
using \<open>x = y \<close> by simp |
33175 | 3062 |
next |
3063 |
case False |
|
53282 | 3064 |
have "dist (y + (d / 2 / dist y x) *\<^sub>R (y - x)) y < d" |
3065 |
unfolding dist_norm |
|
60420 | 3066 |
using \<open>d>0\<close> norm_ge_zero[of "y - x"] \<open>x \<noteq> y\<close> by auto |
53282 | 3067 |
then have *: "y + (d / 2 / dist y x) *\<^sub>R (y - x) \<in> cball x e" |
52624 | 3068 |
using d as(1)[unfolded subset_eq] by blast |
60420 | 3069 |
have "y - x \<noteq> 0" using \<open>x \<noteq> y\<close> by auto |
56541 | 3070 |
hence **:"d / (2 * norm (y - x)) > 0" |
60420 | 3071 |
unfolding zero_less_norm_iff[symmetric] using \<open>d>0\<close> by auto |
53282 | 3072 |
have "dist (y + (d / 2 / dist y x) *\<^sub>R (y - x)) x = |
3073 |
norm (y + (d / (2 * norm (y - x))) *\<^sub>R y - (d / (2 * norm (y - x))) *\<^sub>R x - x)" |
|
33175 | 3074 |
by (auto simp add: dist_norm algebra_simps) |
3075 |
also have "\<dots> = norm ((1 + d / (2 * norm (y - x))) *\<^sub>R (y - x))" |
|
3076 |
by (auto simp add: algebra_simps) |
|
3077 |
also have "\<dots> = \<bar>1 + d / (2 * norm (y - x))\<bar> * norm (y - x)" |
|
3078 |
using ** by auto |
|
53282 | 3079 |
also have "\<dots> = (dist y x) + d/2" |
3080 |
using ** by (auto simp add: distrib_right dist_norm) |
|
3081 |
finally have "e \<ge> dist x y +d/2" |
|
3082 |
using *[unfolded mem_cball] by (auto simp add: dist_commute) |
|
3083 |
then show "y \<in> ball x e" |
|
60420 | 3084 |
unfolding mem_ball using \<open>d>0\<close> by auto |
52624 | 3085 |
qed |
3086 |
} |
|
53282 | 3087 |
then have "\<forall>S \<subseteq> cball x e. open S \<longrightarrow> S \<subseteq> ball x e" |
3088 |
by auto |
|
52624 | 3089 |
ultimately show ?thesis |
53640 | 3090 |
using interior_unique[of "ball x e" "cball x e"] |
3091 |
using open_ball[of x e] |
|
3092 |
by auto |
|
33175 | 3093 |
qed |
3094 |
||
3095 |
lemma frontier_ball: |
|
3096 |
fixes a :: "'a::real_normed_vector" |
|
53291 | 3097 |
shows "0 < e \<Longrightarrow> frontier(ball a e) = {x. dist a x = e}" |
36362
06475a1547cb
fix lots of looping simp calls and other warnings
huffman
parents:
36360
diff
changeset
|
3098 |
apply (simp add: frontier_def closure_ball interior_open order_less_imp_le) |
39302
d7728f65b353
renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
nipkow
parents:
39198
diff
changeset
|
3099 |
apply (simp add: set_eq_iff) |
52624 | 3100 |
apply arith |
3101 |
done |
|
33175 | 3102 |
|
3103 |
lemma frontier_cball: |
|
3104 |
fixes a :: "'a::{real_normed_vector, perfect_space}" |
|
53640 | 3105 |
shows "frontier (cball a e) = {x. dist a x = e}" |
36362
06475a1547cb
fix lots of looping simp calls and other warnings
huffman
parents:
36360
diff
changeset
|
3106 |
apply (simp add: frontier_def interior_cball closed_cball order_less_imp_le) |
39302
d7728f65b353
renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
nipkow
parents:
39198
diff
changeset
|
3107 |
apply (simp add: set_eq_iff) |
52624 | 3108 |
apply arith |
3109 |
done |
|
33175 | 3110 |
|
53640 | 3111 |
lemma cball_eq_empty: "cball x e = {} \<longleftrightarrow> e < 0" |
39302
d7728f65b353
renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
nipkow
parents:
39198
diff
changeset
|
3112 |
apply (simp add: set_eq_iff not_le) |
52624 | 3113 |
apply (metis zero_le_dist dist_self order_less_le_trans) |
3114 |
done |
|
3115 |
||
53282 | 3116 |
lemma cball_empty: "e < 0 \<Longrightarrow> cball x e = {}" |
52624 | 3117 |
by (simp add: cball_eq_empty) |
33175 | 3118 |
|
3119 |
lemma cball_eq_sing: |
|
44072
5b970711fb39
class perfect_space inherits from topological_space;
huffman
parents:
43338
diff
changeset
|
3120 |
fixes x :: "'a::{metric_space,perfect_space}" |
53640 | 3121 |
shows "cball x e = {x} \<longleftrightarrow> e = 0" |
33175 | 3122 |
proof (rule linorder_cases) |
3123 |
assume e: "0 < e" |
|
3124 |
obtain a where "a \<noteq> x" "dist a x < e" |
|
3125 |
using perfect_choose_dist [OF e] by auto |
|
53282 | 3126 |
then have "a \<noteq> x" "dist x a \<le> e" |
3127 |
by (auto simp add: dist_commute) |
|
39302
d7728f65b353
renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
nipkow
parents:
39198
diff
changeset
|
3128 |
with e show ?thesis by (auto simp add: set_eq_iff) |
33175 | 3129 |
qed auto |
3130 |
||
3131 |
lemma cball_sing: |
|
3132 |
fixes x :: "'a::metric_space" |
|
53291 | 3133 |
shows "e = 0 \<Longrightarrow> cball x e = {x}" |
39302
d7728f65b353
renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
nipkow
parents:
39198
diff
changeset
|
3134 |
by (auto simp add: set_eq_iff) |
33175 | 3135 |
|
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
3136 |
|
60420 | 3137 |
subsection \<open>Boundedness\<close> |
33175 | 3138 |
|
3139 |
(* FIXME: This has to be unified with BSEQ!! *) |
|
52624 | 3140 |
definition (in metric_space) bounded :: "'a set \<Rightarrow> bool" |
3141 |
where "bounded S \<longleftrightarrow> (\<exists>x e. \<forall>y\<in>S. dist x y \<le> e)" |
|
33175 | 3142 |
|
61426
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61424
diff
changeset
|
3143 |
lemma bounded_subset_cball: "bounded S \<longleftrightarrow> (\<exists>e x. S \<subseteq> cball x e \<and> 0 \<le> e)" |
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61424
diff
changeset
|
3144 |
unfolding bounded_def subset_eq by auto (meson order_trans zero_le_dist) |
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61424
diff
changeset
|
3145 |
|
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61424
diff
changeset
|
3146 |
lemma bounded_subset_ballD: |
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61424
diff
changeset
|
3147 |
assumes "bounded S" shows "\<exists>r. 0 < r \<and> S \<subseteq> ball x r" |
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61424
diff
changeset
|
3148 |
proof - |
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61424
diff
changeset
|
3149 |
obtain e::real and y where "S \<subseteq> cball y e" "0 \<le> e" |
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61424
diff
changeset
|
3150 |
using assms by (auto simp: bounded_subset_cball) |
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61424
diff
changeset
|
3151 |
then show ?thesis |
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61424
diff
changeset
|
3152 |
apply (rule_tac x="dist x y + e + 1" in exI) |
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61424
diff
changeset
|
3153 |
apply (simp add: add.commute add_pos_nonneg) |
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61424
diff
changeset
|
3154 |
apply (erule subset_trans) |
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61424
diff
changeset
|
3155 |
apply (clarsimp simp add: cball_def) |
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61424
diff
changeset
|
3156 |
by (metis add_le_cancel_right add_strict_increasing dist_commute dist_triangle_le zero_less_one) |
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61424
diff
changeset
|
3157 |
qed |
50998 | 3158 |
|
33175 | 3159 |
lemma bounded_any_center: "bounded S \<longleftrightarrow> (\<exists>e. \<forall>y\<in>S. dist a y \<le> e)" |
52624 | 3160 |
unfolding bounded_def |
57512
cc97b347b301
reduced name variants for assoc and commute on plus and mult
haftmann
parents:
57448
diff
changeset
|
3161 |
by auto (metis add.commute add_le_cancel_right dist_commute dist_triangle_le) |
33175 | 3162 |
|
3163 |
lemma bounded_iff: "bounded S \<longleftrightarrow> (\<exists>a. \<forall>x\<in>S. norm x \<le> a)" |
|
52624 | 3164 |
unfolding bounded_any_center [where a=0] |
3165 |
by (simp add: dist_norm) |
|
33175 | 3166 |
|
53282 | 3167 |
lemma bounded_realI: |
3168 |
assumes "\<forall>x\<in>s. abs (x::real) \<le> B" |
|
3169 |
shows "bounded s" |
|
3170 |
unfolding bounded_def dist_real_def |
|
55775 | 3171 |
by (metis abs_minus_commute assms diff_0_right) |
50104 | 3172 |
|
50948 | 3173 |
lemma bounded_empty [simp]: "bounded {}" |
3174 |
by (simp add: bounded_def) |
|
3175 |
||
53291 | 3176 |
lemma bounded_subset: "bounded T \<Longrightarrow> S \<subseteq> T \<Longrightarrow> bounded S" |
33175 | 3177 |
by (metis bounded_def subset_eq) |
3178 |
||
53291 | 3179 |
lemma bounded_interior[intro]: "bounded S \<Longrightarrow> bounded(interior S)" |
33175 | 3180 |
by (metis bounded_subset interior_subset) |
3181 |
||
52624 | 3182 |
lemma bounded_closure[intro]: |
3183 |
assumes "bounded S" |
|
3184 |
shows "bounded (closure S)" |
|
3185 |
proof - |
|
3186 |
from assms obtain x and a where a: "\<forall>y\<in>S. dist x y \<le> a" |
|
3187 |
unfolding bounded_def by auto |
|
3188 |
{ |
|
3189 |
fix y |
|
3190 |
assume "y \<in> closure S" |
|
33175 | 3191 |
then obtain f where f: "\<forall>n. f n \<in> S" "(f ---> y) sequentially" |
3192 |
unfolding closure_sequential by auto |
|
3193 |
have "\<forall>n. f n \<in> S \<longrightarrow> dist x (f n) \<le> a" using a by simp |
|
53282 | 3194 |
then have "eventually (\<lambda>n. dist x (f n) \<le> a) sequentially" |
33175 | 3195 |
by (rule eventually_mono, simp add: f(1)) |
3196 |
have "dist x y \<le> a" |
|
3197 |
apply (rule Lim_dist_ubound [of sequentially f]) |
|
3198 |
apply (rule trivial_limit_sequentially) |
|
3199 |
apply (rule f(2)) |
|
3200 |
apply fact |
|
3201 |
done |
|
3202 |
} |
|
53282 | 3203 |
then show ?thesis |
3204 |
unfolding bounded_def by auto |
|
33175 | 3205 |
qed |
3206 |
||
3207 |
lemma bounded_cball[simp,intro]: "bounded (cball x e)" |
|
3208 |
apply (simp add: bounded_def) |
|
3209 |
apply (rule_tac x=x in exI) |
|
3210 |
apply (rule_tac x=e in exI) |
|
3211 |
apply auto |
|
3212 |
done |
|
3213 |
||
53640 | 3214 |
lemma bounded_ball[simp,intro]: "bounded (ball x e)" |
33175 | 3215 |
by (metis ball_subset_cball bounded_cball bounded_subset) |
3216 |
||
3217 |
lemma bounded_Un[simp]: "bounded (S \<union> T) \<longleftrightarrow> bounded S \<and> bounded T" |
|
3218 |
apply (auto simp add: bounded_def) |
|
55775 | 3219 |
by (metis Un_iff add_le_cancel_left dist_triangle le_max_iff_disj max.order_iff) |
33175 | 3220 |
|
53640 | 3221 |
lemma bounded_Union[intro]: "finite F \<Longrightarrow> \<forall>S\<in>F. bounded S \<Longrightarrow> bounded (\<Union>F)" |
52624 | 3222 |
by (induct rule: finite_induct[of F]) auto |
33175 | 3223 |
|
50955 | 3224 |
lemma bounded_UN [intro]: "finite A \<Longrightarrow> \<forall>x\<in>A. bounded (B x) \<Longrightarrow> bounded (\<Union>x\<in>A. B x)" |
52624 | 3225 |
by (induct set: finite) auto |
50955 | 3226 |
|
50948 | 3227 |
lemma bounded_insert [simp]: "bounded (insert x S) \<longleftrightarrow> bounded S" |
3228 |
proof - |
|
53640 | 3229 |
have "\<forall>y\<in>{x}. dist x y \<le> 0" |
3230 |
by simp |
|
3231 |
then have "bounded {x}" |
|
3232 |
unfolding bounded_def by fast |
|
3233 |
then show ?thesis |
|
3234 |
by (metis insert_is_Un bounded_Un) |
|
50948 | 3235 |
qed |
3236 |
||
3237 |
lemma finite_imp_bounded [intro]: "finite S \<Longrightarrow> bounded S" |
|
52624 | 3238 |
by (induct set: finite) simp_all |
50948 | 3239 |
|
53640 | 3240 |
lemma bounded_pos: "bounded S \<longleftrightarrow> (\<exists>b>0. \<forall>x\<in> S. norm x \<le> b)" |
33175 | 3241 |
apply (simp add: bounded_iff) |
53640 | 3242 |
apply (subgoal_tac "\<And>x (y::real). 0 < 1 + abs y \<and> (x \<le> y \<longrightarrow> x \<le> 1 + abs y)") |
52624 | 3243 |
apply metis |
3244 |
apply arith |
|
3245 |
done |
|
33175 | 3246 |
|
60762 | 3247 |
lemma bounded_pos_less: "bounded S \<longleftrightarrow> (\<exists>b>0. \<forall>x\<in> S. norm x < b)" |
3248 |
apply (simp add: bounded_pos) |
|
3249 |
apply (safe; rule_tac x="b+1" in exI; force) |
|
3250 |
done |
|
3251 |
||
53640 | 3252 |
lemma Bseq_eq_bounded: |
3253 |
fixes f :: "nat \<Rightarrow> 'a::real_normed_vector" |
|
3254 |
shows "Bseq f \<longleftrightarrow> bounded (range f)" |
|
50972 | 3255 |
unfolding Bseq_def bounded_pos by auto |
3256 |
||
33175 | 3257 |
lemma bounded_Int[intro]: "bounded S \<or> bounded T \<Longrightarrow> bounded (S \<inter> T)" |
3258 |
by (metis Int_lower1 Int_lower2 bounded_subset) |
|
3259 |
||
53291 | 3260 |
lemma bounded_diff[intro]: "bounded S \<Longrightarrow> bounded (S - T)" |
52624 | 3261 |
by (metis Diff_subset bounded_subset) |
33175 | 3262 |
|
3263 |
lemma not_bounded_UNIV[simp, intro]: |
|
3264 |
"\<not> bounded (UNIV :: 'a::{real_normed_vector, perfect_space} set)" |
|
53640 | 3265 |
proof (auto simp add: bounded_pos not_le) |
33175 | 3266 |
obtain x :: 'a where "x \<noteq> 0" |
3267 |
using perfect_choose_dist [OF zero_less_one] by fast |
|
53640 | 3268 |
fix b :: real |
3269 |
assume b: "b >0" |
|
3270 |
have b1: "b +1 \<ge> 0" |
|
3271 |
using b by simp |
|
60420 | 3272 |
with \<open>x \<noteq> 0\<close> have "b < norm (scaleR (b + 1) (sgn x))" |
33175 | 3273 |
by (simp add: norm_sgn) |
3274 |
then show "\<exists>x::'a. b < norm x" .. |
|
3275 |
qed |
|
3276 |
||
61426
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61424
diff
changeset
|
3277 |
corollary cobounded_imp_unbounded: |
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61424
diff
changeset
|
3278 |
fixes S :: "'a::{real_normed_vector, perfect_space} set" |
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61424
diff
changeset
|
3279 |
shows "bounded (- S) \<Longrightarrow> ~ (bounded S)" |
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61424
diff
changeset
|
3280 |
using bounded_Un [of S "-S"] by (simp add: sup_compl_top) |
d53db136e8fd
new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents:
61424
diff
changeset
|
3281 |
|
33175 | 3282 |
lemma bounded_linear_image: |
53291 | 3283 |
assumes "bounded S" |
3284 |
and "bounded_linear f" |
|
3285 |
shows "bounded (f ` S)" |
|
52624 | 3286 |
proof - |
53640 | 3287 |
from assms(1) obtain b where b: "b > 0" "\<forall>x\<in>S. norm x \<le> b" |
52624 | 3288 |
unfolding bounded_pos by auto |
53640 | 3289 |
from assms(2) obtain B where B: "B > 0" "\<forall>x. norm (f x) \<le> B * norm x" |
57514
bdc2c6b40bf2
prefer ac_simps collections over separate name bindings for add and mult
haftmann
parents:
57512
diff
changeset
|
3290 |
using bounded_linear.pos_bounded by (auto simp add: ac_simps) |
52624 | 3291 |
{ |
53282 | 3292 |
fix x |
53640 | 3293 |
assume "x \<in> S" |
3294 |
then have "norm x \<le> b" |
|
3295 |
using b by auto |
|
3296 |
then have "norm (f x) \<le> B * b" |
|
3297 |
using B(2) |
|
52624 | 3298 |
apply (erule_tac x=x in allE) |
3299 |
apply (metis B(1) B(2) order_trans mult_le_cancel_left_pos) |
|
3300 |
done |
|
33175 | 3301 |
} |
53282 | 3302 |
then show ?thesis |
3303 |
unfolding bounded_pos |
|
52624 | 3304 |
apply (rule_tac x="b*B" in exI) |
57512
cc97b347b301
reduced name variants for assoc and commute on plus and mult
haftmann
parents:
57448
diff
changeset
|
3305 |
using b B by (auto simp add: mult.commute) |
33175 | 3306 |
qed |
3307 |
||
3308 |
lemma bounded_scaling: |
|
3309 |
fixes S :: "'a::real_normed_vector set" |
|
3310 |
shows "bounded S \<Longrightarrow> bounded ((\<lambda>x. c *\<^sub>R x) ` S)" |
|
53291 | 3311 |
apply (rule bounded_linear_image) |
3312 |
apply assumption |
|
44282
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
huffman
parents:
44252
diff
changeset
|
3313 |
apply (rule bounded_linear_scaleR_right) |
33175 | 3314 |
done |
3315 |
||
3316 |
lemma bounded_translation: |
|
3317 |
fixes S :: "'a::real_normed_vector set" |
|
52624 | 3318 |
assumes "bounded S" |
3319 |
shows "bounded ((\<lambda>x. a + x) ` S)" |
|
53282 | 3320 |
proof - |
53640 | 3321 |
from assms obtain b where b: "b > 0" "\<forall>x\<in>S. norm x \<le> b" |
52624 | 3322 |
unfolding bounded_pos by auto |
3323 |
{ |
|
3324 |
fix x |
|
53640 | 3325 |
assume "x \<in> S" |
53282 | 3326 |
then have "norm (a + x) \<le> b + norm a" |
52624 | 3327 |
using norm_triangle_ineq[of a x] b by auto |
33175 | 3328 |
} |
53282 | 3329 |
then show ?thesis |
52624 | 3330 |
unfolding bounded_pos |
3331 |
using norm_ge_zero[of a] b(1) and add_strict_increasing[of b 0 "norm a"] |
|
48048
87b94fb75198
remove stray reference to no-longer-existing theorem 'add'
huffman
parents:
47108
diff
changeset
|
3332 |
by (auto intro!: exI[of _ "b + norm a"]) |
33175 | 3333 |
qed |
3334 |
||
60615
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents:
60585
diff
changeset
|
3335 |
lemma bounded_uminus [simp]: |
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents:
60585
diff
changeset
|
3336 |
fixes X :: "'a::euclidean_space set" |
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents:
60585
diff
changeset
|
3337 |
shows "bounded (uminus ` X) \<longleftrightarrow> bounded X" |
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents:
60585
diff
changeset
|
3338 |
by (auto simp: bounded_def dist_norm; rule_tac x="-x" in exI; force simp add: add.commute norm_minus_commute) |
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents:
60585
diff
changeset
|
3339 |
|
33175 | 3340 |
|
60420 | 3341 |
text\<open>Some theorems on sups and infs using the notion "bounded".\<close> |
33175 | 3342 |
|
54258
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents:
54230
diff
changeset
|
3343 |
lemma bounded_real: "bounded (S::real set) \<longleftrightarrow> (\<exists>a. \<forall>x\<in>S. \<bar>x\<bar> \<le> a)" |
33175 | 3344 |
by (simp add: bounded_iff) |
3345 |
||
54258
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents:
54230
diff
changeset
|
3346 |
lemma bounded_imp_bdd_above: "bounded S \<Longrightarrow> bdd_above (S :: real set)" |
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents:
54230
diff
changeset
|
3347 |
by (auto simp: bounded_def bdd_above_def dist_real_def) |
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents:
54230
diff
changeset
|
3348 |
(metis abs_le_D1 abs_minus_commute diff_le_eq) |
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents:
54230
diff
changeset
|
3349 |
|
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents:
54230
diff
changeset
|
3350 |
lemma bounded_imp_bdd_below: "bounded S \<Longrightarrow> bdd_below (S :: real set)" |
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents:
54230
diff
changeset
|
3351 |
by (auto simp: bounded_def bdd_below_def dist_real_def) |
57512
cc97b347b301
reduced name variants for assoc and commute on plus and mult
haftmann
parents:
57448
diff
changeset
|
3352 |
(metis abs_le_D1 add.commute diff_le_eq) |
54258
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents:
54230
diff
changeset
|
3353 |
|
60615
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents:
60585
diff
changeset
|
3354 |
lemma bounded_inner_imp_bdd_above: |
60974
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
3355 |
assumes "bounded s" |
60615
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents:
60585
diff
changeset
|
3356 |
shows "bdd_above ((\<lambda>x. x \<bullet> a) ` s)" |
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents:
60585
diff
changeset
|
3357 |
by (simp add: assms bounded_imp_bdd_above bounded_linear_image bounded_linear_inner_left) |
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents:
60585
diff
changeset
|
3358 |
|
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents:
60585
diff
changeset
|
3359 |
lemma bounded_inner_imp_bdd_below: |
60974
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
3360 |
assumes "bounded s" |
60615
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents:
60585
diff
changeset
|
3361 |
shows "bdd_below ((\<lambda>x. x \<bullet> a) ` s)" |
e5fa1d5d3952
Useful lemmas. The theorem concerning swapping the variables in a double integral.
paulson <lp15@cam.ac.uk>
parents:
60585
diff
changeset
|
3362 |
by (simp add: assms bounded_imp_bdd_below bounded_linear_image bounded_linear_inner_left) |
54258
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents:
54230
diff
changeset
|
3363 |
|
33270 | 3364 |
lemma bounded_has_Sup: |
3365 |
fixes S :: "real set" |
|
53640 | 3366 |
assumes "bounded S" |
3367 |
and "S \<noteq> {}" |
|
53282 | 3368 |
shows "\<forall>x\<in>S. x \<le> Sup S" |
3369 |
and "\<forall>b. (\<forall>x\<in>S. x \<le> b) \<longrightarrow> Sup S \<le> b" |
|
33270 | 3370 |
proof |
53282 | 3371 |
show "\<forall>b. (\<forall>x\<in>S. x \<le> b) \<longrightarrow> Sup S \<le> b" |
3372 |
using assms by (metis cSup_least) |
|
54258
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents:
54230
diff
changeset
|
3373 |
qed (metis cSup_upper assms(1) bounded_imp_bdd_above) |
33270 | 3374 |
|
3375 |
lemma Sup_insert: |
|
3376 |
fixes S :: "real set" |
|
53291 | 3377 |
shows "bounded S \<Longrightarrow> Sup (insert x S) = (if S = {} then x else max x (Sup S))" |
54258
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents:
54230
diff
changeset
|
3378 |
by (auto simp: bounded_imp_bdd_above sup_max cSup_insert_If) |
33270 | 3379 |
|
3380 |
lemma Sup_insert_finite: |
|
61306
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
3381 |
fixes S :: "'a::conditionally_complete_linorder set" |
53291 | 3382 |
shows "finite S \<Longrightarrow> Sup (insert x S) = (if S = {} then x else max x (Sup S))" |
61306
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
3383 |
by (simp add: cSup_insert sup_max) |
33270 | 3384 |
|
3385 |
lemma bounded_has_Inf: |
|
3386 |
fixes S :: "real set" |
|
53640 | 3387 |
assumes "bounded S" |
3388 |
and "S \<noteq> {}" |
|
53282 | 3389 |
shows "\<forall>x\<in>S. x \<ge> Inf S" |
3390 |
and "\<forall>b. (\<forall>x\<in>S. x \<ge> b) \<longrightarrow> Inf S \<ge> b" |
|
33175 | 3391 |
proof |
53640 | 3392 |
show "\<forall>b. (\<forall>x\<in>S. x \<ge> b) \<longrightarrow> Inf S \<ge> b" |
53282 | 3393 |
using assms by (metis cInf_greatest) |
54258
adfc759263ab
use bdd_above and bdd_below for conditionally complete lattices
hoelzl
parents:
54230
diff
changeset
|
3394 |
qed (metis cInf_lower assms(1) bounded_imp_bdd_below) |
33270 | 3395 |
|
3396 |
lemma Inf_insert: |
|
3397 |
fixes S :: "real set" |
|
53291 | 3398 |
shows "bounded S \<Longrightarrow> Inf (insert x S) = (if S = {} then x else min x (Inf S))" |
54259
71c701dc5bf9
add SUP and INF for conditionally complete lattices
hoelzl
parents:
54258
diff
changeset
|
3399 |
by (auto simp: bounded_imp_bdd_below inf_min cInf_insert_If) |
50944 | 3400 |
|
33270 | 3401 |
lemma Inf_insert_finite: |
61306
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
3402 |
fixes S :: "'a::conditionally_complete_linorder set" |
53291 | 3403 |
shows "finite S \<Longrightarrow> Inf (insert x S) = (if S = {} then x else min x (Inf S))" |
61306
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
3404 |
by (simp add: cInf_eq_Min) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
3405 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
3406 |
lemma finite_imp_less_Inf: |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
3407 |
fixes a :: "'a::conditionally_complete_linorder" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
3408 |
shows "\<lbrakk>finite X; x \<in> X; \<And>x. x\<in>X \<Longrightarrow> a < x\<rbrakk> \<Longrightarrow> a < Inf X" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
3409 |
by (induction X rule: finite_induct) (simp_all add: cInf_eq_Min Inf_insert_finite) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
3410 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
3411 |
lemma finite_less_Inf_iff: |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
3412 |
fixes a :: "'a :: conditionally_complete_linorder" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
3413 |
shows "\<lbrakk>finite X; X \<noteq> {}\<rbrakk> \<Longrightarrow> a < Inf X \<longleftrightarrow> (\<forall>x \<in> X. a < x)" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
3414 |
by (auto simp: cInf_eq_Min) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
3415 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
3416 |
lemma finite_imp_Sup_less: |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
3417 |
fixes a :: "'a::conditionally_complete_linorder" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
3418 |
shows "\<lbrakk>finite X; x \<in> X; \<And>x. x\<in>X \<Longrightarrow> a > x\<rbrakk> \<Longrightarrow> a > Sup X" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
3419 |
by (induction X rule: finite_induct) (simp_all add: cSup_eq_Max Sup_insert_finite) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
3420 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
3421 |
lemma finite_Sup_less_iff: |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
3422 |
fixes a :: "'a :: conditionally_complete_linorder" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
3423 |
shows "\<lbrakk>finite X; X \<noteq> {}\<rbrakk> \<Longrightarrow> a > Sup X \<longleftrightarrow> (\<forall>x \<in> X. a > x)" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
3424 |
by (auto simp: cSup_eq_Max) |
33270 | 3425 |
|
60420 | 3426 |
subsection \<open>Compactness\<close> |
3427 |
||
3428 |
subsubsection \<open>Bolzano-Weierstrass property\<close> |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3429 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3430 |
lemma heine_borel_imp_bolzano_weierstrass: |
53640 | 3431 |
assumes "compact s" |
3432 |
and "infinite t" |
|
3433 |
and "t \<subseteq> s" |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3434 |
shows "\<exists>x \<in> s. x islimpt t" |
53291 | 3435 |
proof (rule ccontr) |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3436 |
assume "\<not> (\<exists>x \<in> s. x islimpt t)" |
53640 | 3437 |
then obtain f where f: "\<forall>x\<in>s. x \<in> f x \<and> open (f x) \<and> (\<forall>y\<in>t. y \<in> f x \<longrightarrow> y = x)" |
52624 | 3438 |
unfolding islimpt_def |
53282 | 3439 |
using bchoice[of s "\<lambda> x T. x \<in> T \<and> open T \<and> (\<forall>y\<in>t. y \<in> T \<longrightarrow> y = x)"] |
3440 |
by auto |
|
53640 | 3441 |
obtain g where g: "g \<subseteq> {t. \<exists>x. x \<in> s \<and> t = f x}" "finite g" "s \<subseteq> \<Union>g" |
52624 | 3442 |
using assms(1)[unfolded compact_eq_heine_borel, THEN spec[where x="{t. \<exists>x. x\<in>s \<and> t = f x}"]] |
3443 |
using f by auto |
|
53640 | 3444 |
from g(1,3) have g':"\<forall>x\<in>g. \<exists>xa \<in> s. x = f xa" |
3445 |
by auto |
|
52624 | 3446 |
{ |
3447 |
fix x y |
|
53640 | 3448 |
assume "x \<in> t" "y \<in> t" "f x = f y" |
53282 | 3449 |
then have "x \<in> f x" "y \<in> f x \<longrightarrow> y = x" |
60420 | 3450 |
using f[THEN bspec[where x=x]] and \<open>t \<subseteq> s\<close> by auto |
53282 | 3451 |
then have "x = y" |
60420 | 3452 |
using \<open>f x = f y\<close> and f[THEN bspec[where x=y]] and \<open>y \<in> t\<close> and \<open>t \<subseteq> s\<close> |
53640 | 3453 |
by auto |
52624 | 3454 |
} |
53282 | 3455 |
then have "inj_on f t" |
52624 | 3456 |
unfolding inj_on_def by simp |
53282 | 3457 |
then have "infinite (f ` t)" |
52624 | 3458 |
using assms(2) using finite_imageD by auto |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3459 |
moreover |
52624 | 3460 |
{ |
3461 |
fix x |
|
53640 | 3462 |
assume "x \<in> t" "f x \<notin> g" |
60420 | 3463 |
from g(3) assms(3) \<open>x \<in> t\<close> obtain h where "h \<in> g" and "x \<in> h" |
53640 | 3464 |
by auto |
3465 |
then obtain y where "y \<in> s" "h = f y" |
|
52624 | 3466 |
using g'[THEN bspec[where x=h]] by auto |
53282 | 3467 |
then have "y = x" |
60420 | 3468 |
using f[THEN bspec[where x=y]] and \<open>x\<in>t\<close> and \<open>x\<in>h\<close>[unfolded \<open>h = f y\<close>] |
53640 | 3469 |
by auto |
53282 | 3470 |
then have False |
60420 | 3471 |
using \<open>f x \<notin> g\<close> \<open>h \<in> g\<close> unfolding \<open>h = f y\<close> |
53640 | 3472 |
by auto |
52624 | 3473 |
} |
53282 | 3474 |
then have "f ` t \<subseteq> g" by auto |
52624 | 3475 |
ultimately show False |
3476 |
using g(2) using finite_subset by auto |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3477 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3478 |
|
50943
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3479 |
lemma acc_point_range_imp_convergent_subsequence: |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3480 |
fixes l :: "'a :: first_countable_topology" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3481 |
assumes l: "\<forall>U. l\<in>U \<longrightarrow> open U \<longrightarrow> infinite (U \<inter> range f)" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3482 |
shows "\<exists>r. subseq r \<and> (f \<circ> r) ----> l" |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3483 |
proof - |
55522 | 3484 |
from countable_basis_at_decseq[of l] |
3485 |
obtain A where A: |
|
3486 |
"\<And>i. open (A i)" |
|
3487 |
"\<And>i. l \<in> A i" |
|
3488 |
"\<And>S. open S \<Longrightarrow> l \<in> S \<Longrightarrow> eventually (\<lambda>i. A i \<subseteq> S) sequentially" |
|
3489 |
by blast |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3490 |
def s \<equiv> "\<lambda>n i. SOME j. i < j \<and> f j \<in> A (Suc n)" |
52624 | 3491 |
{ |
3492 |
fix n i |
|
50943
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3493 |
have "infinite (A (Suc n) \<inter> range f - f`{.. i})" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3494 |
using l A by auto |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3495 |
then have "\<exists>x. x \<in> A (Suc n) \<inter> range f - f`{.. i}" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3496 |
unfolding ex_in_conv by (intro notI) simp |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3497 |
then have "\<exists>j. f j \<in> A (Suc n) \<and> j \<notin> {.. i}" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3498 |
by auto |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3499 |
then have "\<exists>a. i < a \<and> f a \<in> A (Suc n)" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3500 |
by (auto simp: not_le) |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3501 |
then have "i < s n i" "f (s n i) \<in> A (Suc n)" |
52624 | 3502 |
unfolding s_def by (auto intro: someI2_ex) |
3503 |
} |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3504 |
note s = this |
55415 | 3505 |
def r \<equiv> "rec_nat (s 0 0) s" |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3506 |
have "subseq r" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3507 |
by (auto simp: r_def s subseq_Suc_iff) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3508 |
moreover |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3509 |
have "(\<lambda>n. f (r n)) ----> l" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3510 |
proof (rule topological_tendstoI) |
53282 | 3511 |
fix S |
3512 |
assume "open S" "l \<in> S" |
|
53640 | 3513 |
with A(3) have "eventually (\<lambda>i. A i \<subseteq> S) sequentially" |
3514 |
by auto |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3515 |
moreover |
52624 | 3516 |
{ |
3517 |
fix i |
|
53282 | 3518 |
assume "Suc 0 \<le> i" |
3519 |
then have "f (r i) \<in> A i" |
|
52624 | 3520 |
by (cases i) (simp_all add: r_def s) |
3521 |
} |
|
3522 |
then have "eventually (\<lambda>i. f (r i) \<in> A i) sequentially" |
|
3523 |
by (auto simp: eventually_sequentially) |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3524 |
ultimately show "eventually (\<lambda>i. f (r i) \<in> S) sequentially" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3525 |
by eventually_elim auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3526 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3527 |
ultimately show "\<exists>r. subseq r \<and> (f \<circ> r) ----> l" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3528 |
by (auto simp: convergent_def comp_def) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3529 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3530 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3531 |
lemma sequence_infinite_lemma: |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3532 |
fixes f :: "nat \<Rightarrow> 'a::t1_space" |
53282 | 3533 |
assumes "\<forall>n. f n \<noteq> l" |
3534 |
and "(f ---> l) sequentially" |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3535 |
shows "infinite (range f)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3536 |
proof |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3537 |
assume "finite (range f)" |
53640 | 3538 |
then have "closed (range f)" |
3539 |
by (rule finite_imp_closed) |
|
3540 |
then have "open (- range f)" |
|
3541 |
by (rule open_Compl) |
|
3542 |
from assms(1) have "l \<in> - range f" |
|
3543 |
by auto |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3544 |
from assms(2) have "eventually (\<lambda>n. f n \<in> - range f) sequentially" |
60420 | 3545 |
using \<open>open (- range f)\<close> \<open>l \<in> - range f\<close> |
53640 | 3546 |
by (rule topological_tendstoD) |
3547 |
then show False |
|
3548 |
unfolding eventually_sequentially |
|
3549 |
by auto |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3550 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3551 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3552 |
lemma closure_insert: |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3553 |
fixes x :: "'a::t1_space" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3554 |
shows "closure (insert x s) = insert x (closure s)" |
52624 | 3555 |
apply (rule closure_unique) |
3556 |
apply (rule insert_mono [OF closure_subset]) |
|
3557 |
apply (rule closed_insert [OF closed_closure]) |
|
3558 |
apply (simp add: closure_minimal) |
|
3559 |
done |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3560 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3561 |
lemma islimpt_insert: |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3562 |
fixes x :: "'a::t1_space" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3563 |
shows "x islimpt (insert a s) \<longleftrightarrow> x islimpt s" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3564 |
proof |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3565 |
assume *: "x islimpt (insert a s)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3566 |
show "x islimpt s" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3567 |
proof (rule islimptI) |
53282 | 3568 |
fix t |
3569 |
assume t: "x \<in> t" "open t" |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3570 |
show "\<exists>y\<in>s. y \<in> t \<and> y \<noteq> x" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3571 |
proof (cases "x = a") |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3572 |
case True |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3573 |
obtain y where "y \<in> insert a s" "y \<in> t" "y \<noteq> x" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3574 |
using * t by (rule islimptE) |
60420 | 3575 |
with \<open>x = a\<close> show ?thesis by auto |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3576 |
next |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3577 |
case False |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3578 |
with t have t': "x \<in> t - {a}" "open (t - {a})" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3579 |
by (simp_all add: open_Diff) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3580 |
obtain y where "y \<in> insert a s" "y \<in> t - {a}" "y \<noteq> x" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3581 |
using * t' by (rule islimptE) |
53282 | 3582 |
then show ?thesis by auto |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3583 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3584 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3585 |
next |
53282 | 3586 |
assume "x islimpt s" |
3587 |
then show "x islimpt (insert a s)" |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3588 |
by (rule islimpt_subset) auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3589 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3590 |
|
50897
078590669527
generalize lemma islimpt_finite to class t1_space
huffman
parents:
50884
diff
changeset
|
3591 |
lemma islimpt_finite: |
078590669527
generalize lemma islimpt_finite to class t1_space
huffman
parents:
50884
diff
changeset
|
3592 |
fixes x :: "'a::t1_space" |
078590669527
generalize lemma islimpt_finite to class t1_space
huffman
parents:
50884
diff
changeset
|
3593 |
shows "finite s \<Longrightarrow> \<not> x islimpt s" |
52624 | 3594 |
by (induct set: finite) (simp_all add: islimpt_insert) |
50897
078590669527
generalize lemma islimpt_finite to class t1_space
huffman
parents:
50884
diff
changeset
|
3595 |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3596 |
lemma islimpt_union_finite: |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3597 |
fixes x :: "'a::t1_space" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3598 |
shows "finite s \<Longrightarrow> x islimpt (s \<union> t) \<longleftrightarrow> x islimpt t" |
52624 | 3599 |
by (simp add: islimpt_Un islimpt_finite) |
50897
078590669527
generalize lemma islimpt_finite to class t1_space
huffman
parents:
50884
diff
changeset
|
3600 |
|
50943
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3601 |
lemma islimpt_eq_acc_point: |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3602 |
fixes l :: "'a :: t1_space" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3603 |
shows "l islimpt S \<longleftrightarrow> (\<forall>U. l\<in>U \<longrightarrow> open U \<longrightarrow> infinite (U \<inter> S))" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3604 |
proof (safe intro!: islimptI) |
53282 | 3605 |
fix U |
3606 |
assume "l islimpt S" "l \<in> U" "open U" "finite (U \<inter> S)" |
|
50943
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3607 |
then have "l islimpt S" "l \<in> (U - (U \<inter> S - {l}))" "open (U - (U \<inter> S - {l}))" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3608 |
by (auto intro: finite_imp_closed) |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3609 |
then show False |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3610 |
by (rule islimptE) auto |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3611 |
next |
53282 | 3612 |
fix T |
3613 |
assume *: "\<forall>U. l\<in>U \<longrightarrow> open U \<longrightarrow> infinite (U \<inter> S)" "l \<in> T" "open T" |
|
3614 |
then have "infinite (T \<inter> S - {l})" |
|
3615 |
by auto |
|
50943
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3616 |
then have "\<exists>x. x \<in> (T \<inter> S - {l})" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3617 |
unfolding ex_in_conv by (intro notI) simp |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3618 |
then show "\<exists>y\<in>S. y \<in> T \<and> y \<noteq> l" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3619 |
by auto |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3620 |
qed |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3621 |
|
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3622 |
lemma islimpt_range_imp_convergent_subsequence: |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3623 |
fixes l :: "'a :: {t1_space, first_countable_topology}" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3624 |
assumes l: "l islimpt (range f)" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3625 |
shows "\<exists>r. subseq r \<and> (f \<circ> r) ----> l" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3626 |
using l unfolding islimpt_eq_acc_point |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3627 |
by (rule acc_point_range_imp_convergent_subsequence) |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3628 |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3629 |
lemma sequence_unique_limpt: |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3630 |
fixes f :: "nat \<Rightarrow> 'a::t2_space" |
53282 | 3631 |
assumes "(f ---> l) sequentially" |
3632 |
and "l' islimpt (range f)" |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3633 |
shows "l' = l" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3634 |
proof (rule ccontr) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3635 |
assume "l' \<noteq> l" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3636 |
obtain s t where "open s" "open t" "l' \<in> s" "l \<in> t" "s \<inter> t = {}" |
60420 | 3637 |
using hausdorff [OF \<open>l' \<noteq> l\<close>] by auto |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3638 |
have "eventually (\<lambda>n. f n \<in> t) sequentially" |
60420 | 3639 |
using assms(1) \<open>open t\<close> \<open>l \<in> t\<close> by (rule topological_tendstoD) |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3640 |
then obtain N where "\<forall>n\<ge>N. f n \<in> t" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3641 |
unfolding eventually_sequentially by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3642 |
|
53282 | 3643 |
have "UNIV = {..<N} \<union> {N..}" |
3644 |
by auto |
|
3645 |
then have "l' islimpt (f ` ({..<N} \<union> {N..}))" |
|
3646 |
using assms(2) by simp |
|
3647 |
then have "l' islimpt (f ` {..<N} \<union> f ` {N..})" |
|
3648 |
by (simp add: image_Un) |
|
3649 |
then have "l' islimpt (f ` {N..})" |
|
3650 |
by (simp add: islimpt_union_finite) |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3651 |
then obtain y where "y \<in> f ` {N..}" "y \<in> s" "y \<noteq> l'" |
60420 | 3652 |
using \<open>l' \<in> s\<close> \<open>open s\<close> by (rule islimptE) |
53282 | 3653 |
then obtain n where "N \<le> n" "f n \<in> s" "f n \<noteq> l'" |
3654 |
by auto |
|
60420 | 3655 |
with \<open>\<forall>n\<ge>N. f n \<in> t\<close> have "f n \<in> s \<inter> t" |
53282 | 3656 |
by simp |
60420 | 3657 |
with \<open>s \<inter> t = {}\<close> show False |
53282 | 3658 |
by simp |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3659 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3660 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3661 |
lemma bolzano_weierstrass_imp_closed: |
53640 | 3662 |
fixes s :: "'a::{first_countable_topology,t2_space} set" |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3663 |
assumes "\<forall>t. infinite t \<and> t \<subseteq> s --> (\<exists>x \<in> s. x islimpt t)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3664 |
shows "closed s" |
52624 | 3665 |
proof - |
3666 |
{ |
|
3667 |
fix x l |
|
3668 |
assume as: "\<forall>n::nat. x n \<in> s" "(x ---> l) sequentially" |
|
53282 | 3669 |
then have "l \<in> s" |
52624 | 3670 |
proof (cases "\<forall>n. x n \<noteq> l") |
3671 |
case False |
|
53282 | 3672 |
then show "l\<in>s" using as(1) by auto |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3673 |
next |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3674 |
case True note cas = this |
52624 | 3675 |
with as(2) have "infinite (range x)" |
3676 |
using sequence_infinite_lemma[of x l] by auto |
|
3677 |
then obtain l' where "l'\<in>s" "l' islimpt (range x)" |
|
3678 |
using assms[THEN spec[where x="range x"]] as(1) by auto |
|
53282 | 3679 |
then show "l\<in>s" using sequence_unique_limpt[of x l l'] |
52624 | 3680 |
using as cas by auto |
3681 |
qed |
|
3682 |
} |
|
53282 | 3683 |
then show ?thesis |
3684 |
unfolding closed_sequential_limits by fast |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3685 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3686 |
|
50944 | 3687 |
lemma compact_imp_bounded: |
52624 | 3688 |
assumes "compact U" |
3689 |
shows "bounded U" |
|
50944 | 3690 |
proof - |
52624 | 3691 |
have "compact U" "\<forall>x\<in>U. open (ball x 1)" "U \<subseteq> (\<Union>x\<in>U. ball x 1)" |
3692 |
using assms by auto |
|
50944 | 3693 |
then obtain D where D: "D \<subseteq> U" "finite D" "U \<subseteq> (\<Union>x\<in>D. ball x 1)" |
52624 | 3694 |
by (rule compactE_image) |
60420 | 3695 |
from \<open>finite D\<close> have "bounded (\<Union>x\<in>D. ball x 1)" |
50955 | 3696 |
by (simp add: bounded_UN) |
60420 | 3697 |
then show "bounded U" using \<open>U \<subseteq> (\<Union>x\<in>D. ball x 1)\<close> |
50955 | 3698 |
by (rule bounded_subset) |
50944 | 3699 |
qed |
3700 |
||
60420 | 3701 |
text\<open>In particular, some common special cases.\<close> |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3702 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3703 |
lemma compact_union [intro]: |
53291 | 3704 |
assumes "compact s" |
3705 |
and "compact t" |
|
53282 | 3706 |
shows " compact (s \<union> t)" |
50898 | 3707 |
proof (rule compactI) |
52624 | 3708 |
fix f |
3709 |
assume *: "Ball f open" "s \<union> t \<subseteq> \<Union>f" |
|
60420 | 3710 |
from * \<open>compact s\<close> obtain s' where "s' \<subseteq> f \<and> finite s' \<and> s \<subseteq> \<Union>s'" |
56073
29e308b56d23
enhanced simplifier solver for preconditions of rewrite rule, can now deal with conjunctions
nipkow
parents:
55927
diff
changeset
|
3711 |
unfolding compact_eq_heine_borel by (auto elim!: allE[of _ f]) |
52624 | 3712 |
moreover |
60420 | 3713 |
from * \<open>compact t\<close> obtain t' where "t' \<subseteq> f \<and> finite t' \<and> t \<subseteq> \<Union>t'" |
56073
29e308b56d23
enhanced simplifier solver for preconditions of rewrite rule, can now deal with conjunctions
nipkow
parents:
55927
diff
changeset
|
3714 |
unfolding compact_eq_heine_borel by (auto elim!: allE[of _ f]) |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3715 |
ultimately show "\<exists>f'\<subseteq>f. finite f' \<and> s \<union> t \<subseteq> \<Union>f'" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3716 |
by (auto intro!: exI[of _ "s' \<union> t'"]) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3717 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3718 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3719 |
lemma compact_Union [intro]: "finite S \<Longrightarrow> (\<And>T. T \<in> S \<Longrightarrow> compact T) \<Longrightarrow> compact (\<Union>S)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3720 |
by (induct set: finite) auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3721 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3722 |
lemma compact_UN [intro]: |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3723 |
"finite A \<Longrightarrow> (\<And>x. x \<in> A \<Longrightarrow> compact (B x)) \<Longrightarrow> compact (\<Union>x\<in>A. B x)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3724 |
unfolding SUP_def by (rule compact_Union) auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3725 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3726 |
lemma closed_inter_compact [intro]: |
53282 | 3727 |
assumes "closed s" |
3728 |
and "compact t" |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3729 |
shows "compact (s \<inter> t)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3730 |
using compact_inter_closed [of t s] assms |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3731 |
by (simp add: Int_commute) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3732 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3733 |
lemma compact_inter [intro]: |
50898 | 3734 |
fixes s t :: "'a :: t2_space set" |
53282 | 3735 |
assumes "compact s" |
3736 |
and "compact t" |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3737 |
shows "compact (s \<inter> t)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3738 |
using assms by (intro compact_inter_closed compact_imp_closed) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3739 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3740 |
lemma compact_sing [simp]: "compact {a}" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3741 |
unfolding compact_eq_heine_borel by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3742 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3743 |
lemma compact_insert [simp]: |
53282 | 3744 |
assumes "compact s" |
3745 |
shows "compact (insert x s)" |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3746 |
proof - |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3747 |
have "compact ({x} \<union> s)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3748 |
using compact_sing assms by (rule compact_union) |
53282 | 3749 |
then show ?thesis by simp |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3750 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3751 |
|
52624 | 3752 |
lemma finite_imp_compact: "finite s \<Longrightarrow> compact s" |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3753 |
by (induct set: finite) simp_all |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3754 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3755 |
lemma open_delete: |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3756 |
fixes s :: "'a::t1_space set" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3757 |
shows "open s \<Longrightarrow> open (s - {x})" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3758 |
by (simp add: open_Diff) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3759 |
|
60420 | 3760 |
text\<open>Compactness expressed with filters\<close> |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3761 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3762 |
lemma closure_iff_nhds_not_empty: |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3763 |
"x \<in> closure X \<longleftrightarrow> (\<forall>A. \<forall>S\<subseteq>A. open S \<longrightarrow> x \<in> S \<longrightarrow> X \<inter> A \<noteq> {})" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3764 |
proof safe |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3765 |
assume x: "x \<in> closure X" |
53282 | 3766 |
fix S A |
3767 |
assume "open S" "x \<in> S" "X \<inter> A = {}" "S \<subseteq> A" |
|
3768 |
then have "x \<notin> closure (-S)" |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3769 |
by (auto simp: closure_complement subset_eq[symmetric] intro: interiorI) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3770 |
with x have "x \<in> closure X - closure (-S)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3771 |
by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3772 |
also have "\<dots> \<subseteq> closure (X \<inter> S)" |
60420 | 3773 |
using \<open>open S\<close> open_inter_closure_subset[of S X] by (simp add: closed_Compl ac_simps) |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3774 |
finally have "X \<inter> S \<noteq> {}" by auto |
60420 | 3775 |
then show False using \<open>X \<inter> A = {}\<close> \<open>S \<subseteq> A\<close> by auto |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3776 |
next |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3777 |
assume "\<forall>A S. S \<subseteq> A \<longrightarrow> open S \<longrightarrow> x \<in> S \<longrightarrow> X \<inter> A \<noteq> {}" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3778 |
from this[THEN spec, of "- X", THEN spec, of "- closure X"] |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3779 |
show "x \<in> closure X" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3780 |
by (simp add: closure_subset open_Compl) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3781 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3782 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3783 |
lemma compact_filter: |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3784 |
"compact U \<longleftrightarrow> (\<forall>F. F \<noteq> bot \<longrightarrow> eventually (\<lambda>x. x \<in> U) F \<longrightarrow> (\<exists>x\<in>U. inf (nhds x) F \<noteq> bot))" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3785 |
proof (intro allI iffI impI compact_fip[THEN iffD2] notI) |
53282 | 3786 |
fix F |
3787 |
assume "compact U" |
|
3788 |
assume F: "F \<noteq> bot" "eventually (\<lambda>x. x \<in> U) F" |
|
3789 |
then have "U \<noteq> {}" |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3790 |
by (auto simp: eventually_False) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3791 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3792 |
def Z \<equiv> "closure ` {A. eventually (\<lambda>x. x \<in> A) F}" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3793 |
then have "\<forall>z\<in>Z. closed z" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3794 |
by auto |
53282 | 3795 |
moreover |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3796 |
have ev_Z: "\<And>z. z \<in> Z \<Longrightarrow> eventually (\<lambda>x. x \<in> z) F" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3797 |
unfolding Z_def by (auto elim: eventually_elim1 intro: set_mp[OF closure_subset]) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3798 |
have "(\<forall>B \<subseteq> Z. finite B \<longrightarrow> U \<inter> \<Inter>B \<noteq> {})" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3799 |
proof (intro allI impI) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3800 |
fix B assume "finite B" "B \<subseteq> Z" |
60420 | 3801 |
with \<open>finite B\<close> ev_Z F(2) have "eventually (\<lambda>x. x \<in> U \<inter> (\<Inter>B)) F" |
60040
1fa1023b13b9
move MOST and INFM in Infinite_Set to Filter; change them to abbreviations over the cofinite filter
hoelzl
parents:
60017
diff
changeset
|
3802 |
by (auto simp: eventually_ball_finite_distrib eventually_conj_iff) |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3803 |
with F show "U \<inter> \<Inter>B \<noteq> {}" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3804 |
by (intro notI) (simp add: eventually_False) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3805 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3806 |
ultimately have "U \<inter> \<Inter>Z \<noteq> {}" |
60420 | 3807 |
using \<open>compact U\<close> unfolding compact_fip by blast |
53282 | 3808 |
then obtain x where "x \<in> U" and x: "\<And>z. z \<in> Z \<Longrightarrow> x \<in> z" |
3809 |
by auto |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3810 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3811 |
have "\<And>P. eventually P (inf (nhds x) F) \<Longrightarrow> P \<noteq> bot" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3812 |
unfolding eventually_inf eventually_nhds |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3813 |
proof safe |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3814 |
fix P Q R S |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3815 |
assume "eventually R F" "open S" "x \<in> S" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3816 |
with open_inter_closure_eq_empty[of S "{x. R x}"] x[of "closure {x. R x}"] |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3817 |
have "S \<inter> {x. R x} \<noteq> {}" by (auto simp: Z_def) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3818 |
moreover assume "Ball S Q" "\<forall>x. Q x \<and> R x \<longrightarrow> bot x" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3819 |
ultimately show False by (auto simp: set_eq_iff) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3820 |
qed |
60420 | 3821 |
with \<open>x \<in> U\<close> show "\<exists>x\<in>U. inf (nhds x) F \<noteq> bot" |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3822 |
by (metis eventually_bot) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3823 |
next |
53282 | 3824 |
fix A |
3825 |
assume A: "\<forall>a\<in>A. closed a" "\<forall>B\<subseteq>A. finite B \<longrightarrow> U \<inter> \<Inter>B \<noteq> {}" "U \<inter> \<Inter>A = {}" |
|
57276 | 3826 |
def F \<equiv> "INF a:insert U A. principal a" |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3827 |
have "F \<noteq> bot" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3828 |
unfolding F_def |
57276 | 3829 |
proof (rule INF_filter_not_bot) |
3830 |
fix X assume "X \<subseteq> insert U A" "finite X" |
|
3831 |
moreover with A(2)[THEN spec, of "X - {U}"] have "U \<inter> \<Inter>(X - {U}) \<noteq> {}" |
|
53282 | 3832 |
by auto |
57276 | 3833 |
ultimately show "(INF a:X. principal a) \<noteq> bot" |
3834 |
by (auto simp add: INF_principal_finite principal_eq_bot_iff) |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3835 |
qed |
57276 | 3836 |
moreover |
3837 |
have "F \<le> principal U" |
|
3838 |
unfolding F_def by auto |
|
3839 |
then have "eventually (\<lambda>x. x \<in> U) F" |
|
3840 |
by (auto simp: le_filter_def eventually_principal) |
|
53282 | 3841 |
moreover |
3842 |
assume "\<forall>F. F \<noteq> bot \<longrightarrow> eventually (\<lambda>x. x \<in> U) F \<longrightarrow> (\<exists>x\<in>U. inf (nhds x) F \<noteq> bot)" |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3843 |
ultimately obtain x where "x \<in> U" and x: "inf (nhds x) F \<noteq> bot" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3844 |
by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3845 |
|
57276 | 3846 |
{ fix V assume "V \<in> A" |
3847 |
then have "F \<le> principal V" |
|
3848 |
unfolding F_def by (intro INF_lower2[of V]) auto |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3849 |
then have V: "eventually (\<lambda>x. x \<in> V) F" |
57276 | 3850 |
by (auto simp: le_filter_def eventually_principal) |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3851 |
have "x \<in> closure V" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3852 |
unfolding closure_iff_nhds_not_empty |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3853 |
proof (intro impI allI) |
53282 | 3854 |
fix S A |
3855 |
assume "open S" "x \<in> S" "S \<subseteq> A" |
|
3856 |
then have "eventually (\<lambda>x. x \<in> A) (nhds x)" |
|
3857 |
by (auto simp: eventually_nhds) |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3858 |
with V have "eventually (\<lambda>x. x \<in> V \<inter> A) (inf (nhds x) F)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3859 |
by (auto simp: eventually_inf) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3860 |
with x show "V \<inter> A \<noteq> {}" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3861 |
by (auto simp del: Int_iff simp add: trivial_limit_def) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3862 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3863 |
then have "x \<in> V" |
60420 | 3864 |
using \<open>V \<in> A\<close> A(1) by simp |
53282 | 3865 |
} |
60420 | 3866 |
with \<open>x\<in>U\<close> have "x \<in> U \<inter> \<Inter>A" by auto |
3867 |
with \<open>U \<inter> \<Inter>A = {}\<close> show False by auto |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3868 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3869 |
|
50941
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3870 |
definition "countably_compact U \<longleftrightarrow> |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3871 |
(\<forall>A. countable A \<longrightarrow> (\<forall>a\<in>A. open a) \<longrightarrow> U \<subseteq> \<Union>A \<longrightarrow> (\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union>T))" |
50941
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3872 |
|
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3873 |
lemma countably_compactE: |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3874 |
assumes "countably_compact s" and "\<forall>t\<in>C. open t" and "s \<subseteq> \<Union>C" "countable C" |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3875 |
obtains C' where "C' \<subseteq> C" and "finite C'" and "s \<subseteq> \<Union>C'" |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3876 |
using assms unfolding countably_compact_def by metis |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3877 |
|
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3878 |
lemma countably_compactI: |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3879 |
assumes "\<And>C. \<forall>t\<in>C. open t \<Longrightarrow> s \<subseteq> \<Union>C \<Longrightarrow> countable C \<Longrightarrow> (\<exists>C'\<subseteq>C. finite C' \<and> s \<subseteq> \<Union>C')" |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3880 |
shows "countably_compact s" |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3881 |
using assms unfolding countably_compact_def by metis |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3882 |
|
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3883 |
lemma compact_imp_countably_compact: "compact U \<Longrightarrow> countably_compact U" |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3884 |
by (auto simp: compact_eq_heine_borel countably_compact_def) |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3885 |
|
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3886 |
lemma countably_compact_imp_compact: |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3887 |
assumes "countably_compact U" |
53282 | 3888 |
and ccover: "countable B" "\<forall>b\<in>B. open b" |
3889 |
and basis: "\<And>T x. open T \<Longrightarrow> x \<in> T \<Longrightarrow> x \<in> U \<Longrightarrow> \<exists>b\<in>B. x \<in> b \<and> b \<inter> U \<subseteq> T" |
|
50941
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3890 |
shows "compact U" |
60420 | 3891 |
using \<open>countably_compact U\<close> |
53282 | 3892 |
unfolding compact_eq_heine_borel countably_compact_def |
50941
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3893 |
proof safe |
53282 | 3894 |
fix A |
3895 |
assume A: "\<forall>a\<in>A. open a" "U \<subseteq> \<Union>A" |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3896 |
assume *: "\<forall>A. countable A \<longrightarrow> (\<forall>a\<in>A. open a) \<longrightarrow> U \<subseteq> \<Union>A \<longrightarrow> (\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union>T)" |
50941
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3897 |
|
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3898 |
moreover def C \<equiv> "{b\<in>B. \<exists>a\<in>A. b \<inter> U \<subseteq> a}" |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3899 |
ultimately have "countable C" "\<forall>a\<in>C. open a" |
50941
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3900 |
unfolding C_def using ccover by auto |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3901 |
moreover |
50941
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3902 |
have "\<Union>A \<inter> U \<subseteq> \<Union>C" |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3903 |
proof safe |
53282 | 3904 |
fix x a |
3905 |
assume "x \<in> U" "x \<in> a" "a \<in> A" |
|
3906 |
with basis[of a x] A obtain b where "b \<in> B" "x \<in> b" "b \<inter> U \<subseteq> a" |
|
3907 |
by blast |
|
60420 | 3908 |
with \<open>a \<in> A\<close> show "x \<in> \<Union>C" |
53282 | 3909 |
unfolding C_def by auto |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3910 |
qed |
60420 | 3911 |
then have "U \<subseteq> \<Union>C" using \<open>U \<subseteq> \<Union>A\<close> by auto |
53374
a14d2a854c02
tuned proofs -- clarified flow of facts wrt. calculation;
wenzelm
parents:
53291
diff
changeset
|
3912 |
ultimately obtain T where T: "T\<subseteq>C" "finite T" "U \<subseteq> \<Union>T" |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3913 |
using * by metis |
53374
a14d2a854c02
tuned proofs -- clarified flow of facts wrt. calculation;
wenzelm
parents:
53291
diff
changeset
|
3914 |
then have "\<forall>t\<in>T. \<exists>a\<in>A. t \<inter> U \<subseteq> a" |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3915 |
by (auto simp: C_def) |
55522 | 3916 |
then obtain f where "\<forall>t\<in>T. f t \<in> A \<and> t \<inter> U \<subseteq> f t" |
3917 |
unfolding bchoice_iff Bex_def .. |
|
53374
a14d2a854c02
tuned proofs -- clarified flow of facts wrt. calculation;
wenzelm
parents:
53291
diff
changeset
|
3918 |
with T show "\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union>T" |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3919 |
unfolding C_def by (intro exI[of _ "f`T"]) fastforce |
50941
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3920 |
qed |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3921 |
|
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3922 |
lemma countably_compact_imp_compact_second_countable: |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3923 |
"countably_compact U \<Longrightarrow> compact (U :: 'a :: second_countable_topology set)" |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3924 |
proof (rule countably_compact_imp_compact) |
53282 | 3925 |
fix T and x :: 'a |
3926 |
assume "open T" "x \<in> T" |
|
55522 | 3927 |
from topological_basisE[OF is_basis this] obtain b where |
3928 |
"b \<in> (SOME B. countable B \<and> topological_basis B)" "x \<in> b" "b \<subseteq> T" . |
|
53282 | 3929 |
then show "\<exists>b\<in>SOME B. countable B \<and> topological_basis B. x \<in> b \<and> b \<inter> U \<subseteq> T" |
55522 | 3930 |
by blast |
50941
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3931 |
qed (insert countable_basis topological_basis_open[OF is_basis], auto) |
36437 | 3932 |
|
50943
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3933 |
lemma countably_compact_eq_compact: |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3934 |
"countably_compact U \<longleftrightarrow> compact (U :: 'a :: second_countable_topology set)" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
3935 |
using countably_compact_imp_compact_second_countable compact_imp_countably_compact by blast |
53282 | 3936 |
|
60420 | 3937 |
subsubsection\<open>Sequential compactness\<close> |
33175 | 3938 |
|
53282 | 3939 |
definition seq_compact :: "'a::topological_space set \<Rightarrow> bool" |
3940 |
where "seq_compact S \<longleftrightarrow> |
|
53640 | 3941 |
(\<forall>f. (\<forall>n. f n \<in> S) \<longrightarrow> (\<exists>l\<in>S. \<exists>r. subseq r \<and> ((f \<circ> r) ---> l) sequentially))" |
33175 | 3942 |
|
54070 | 3943 |
lemma seq_compactI: |
3944 |
assumes "\<And>f. \<forall>n. f n \<in> S \<Longrightarrow> \<exists>l\<in>S. \<exists>r. subseq r \<and> ((f \<circ> r) ---> l) sequentially" |
|
3945 |
shows "seq_compact S" |
|
3946 |
unfolding seq_compact_def using assms by fast |
|
3947 |
||
3948 |
lemma seq_compactE: |
|
3949 |
assumes "seq_compact S" "\<forall>n. f n \<in> S" |
|
3950 |
obtains l r where "l \<in> S" "subseq r" "((f \<circ> r) ---> l) sequentially" |
|
3951 |
using assms unfolding seq_compact_def by fast |
|
3952 |
||
3953 |
lemma closed_sequentially: (* TODO: move upwards *) |
|
3954 |
assumes "closed s" and "\<forall>n. f n \<in> s" and "f ----> l" |
|
3955 |
shows "l \<in> s" |
|
3956 |
proof (rule ccontr) |
|
3957 |
assume "l \<notin> s" |
|
60420 | 3958 |
with \<open>closed s\<close> and \<open>f ----> l\<close> have "eventually (\<lambda>n. f n \<in> - s) sequentially" |
54070 | 3959 |
by (fast intro: topological_tendstoD) |
60420 | 3960 |
with \<open>\<forall>n. f n \<in> s\<close> show "False" |
54070 | 3961 |
by simp |
3962 |
qed |
|
3963 |
||
3964 |
lemma seq_compact_inter_closed: |
|
3965 |
assumes "seq_compact s" and "closed t" |
|
3966 |
shows "seq_compact (s \<inter> t)" |
|
3967 |
proof (rule seq_compactI) |
|
3968 |
fix f assume "\<forall>n::nat. f n \<in> s \<inter> t" |
|
3969 |
hence "\<forall>n. f n \<in> s" and "\<forall>n. f n \<in> t" |
|
3970 |
by simp_all |
|
60420 | 3971 |
from \<open>seq_compact s\<close> and \<open>\<forall>n. f n \<in> s\<close> |
54070 | 3972 |
obtain l r where "l \<in> s" and r: "subseq r" and l: "(f \<circ> r) ----> l" |
3973 |
by (rule seq_compactE) |
|
60420 | 3974 |
from \<open>\<forall>n. f n \<in> t\<close> have "\<forall>n. (f \<circ> r) n \<in> t" |
54070 | 3975 |
by simp |
60420 | 3976 |
from \<open>closed t\<close> and this and l have "l \<in> t" |
54070 | 3977 |
by (rule closed_sequentially) |
60420 | 3978 |
with \<open>l \<in> s\<close> and r and l show "\<exists>l\<in>s \<inter> t. \<exists>r. subseq r \<and> (f \<circ> r) ----> l" |
54070 | 3979 |
by fast |
3980 |
qed |
|
3981 |
||
3982 |
lemma seq_compact_closed_subset: |
|
3983 |
assumes "closed s" and "s \<subseteq> t" and "seq_compact t" |
|
3984 |
shows "seq_compact s" |
|
3985 |
using assms seq_compact_inter_closed [of t s] by (simp add: Int_absorb1) |
|
3986 |
||
50941
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3987 |
lemma seq_compact_imp_countably_compact: |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3988 |
fixes U :: "'a :: first_countable_topology set" |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3989 |
assumes "seq_compact U" |
50941
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3990 |
shows "countably_compact U" |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3991 |
proof (safe intro!: countably_compactI) |
52624 | 3992 |
fix A |
3993 |
assume A: "\<forall>a\<in>A. open a" "U \<subseteq> \<Union>A" "countable A" |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3994 |
have subseq: "\<And>X. range X \<subseteq> U \<Longrightarrow> \<exists>r x. x \<in> U \<and> subseq r \<and> (X \<circ> r) ----> x" |
60420 | 3995 |
using \<open>seq_compact U\<close> by (fastforce simp: seq_compact_def subset_eq) |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3996 |
show "\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union>T" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3997 |
proof cases |
52624 | 3998 |
assume "finite A" |
3999 |
with A show ?thesis by auto |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4000 |
next |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4001 |
assume "infinite A" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4002 |
then have "A \<noteq> {}" by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4003 |
show ?thesis |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4004 |
proof (rule ccontr) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4005 |
assume "\<not> (\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union>T)" |
53282 | 4006 |
then have "\<forall>T. \<exists>x. T \<subseteq> A \<and> finite T \<longrightarrow> (x \<in> U - \<Union>T)" |
4007 |
by auto |
|
4008 |
then obtain X' where T: "\<And>T. T \<subseteq> A \<Longrightarrow> finite T \<Longrightarrow> X' T \<in> U - \<Union>T" |
|
4009 |
by metis |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4010 |
def X \<equiv> "\<lambda>n. X' (from_nat_into A ` {.. n})" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4011 |
have X: "\<And>n. X n \<in> U - (\<Union>i\<le>n. from_nat_into A i)" |
60420 | 4012 |
using \<open>A \<noteq> {}\<close> unfolding X_def SUP_def by (intro T) (auto intro: from_nat_into) |
53282 | 4013 |
then have "range X \<subseteq> U" |
4014 |
by auto |
|
4015 |
with subseq[of X] obtain r x where "x \<in> U" and r: "subseq r" "(X \<circ> r) ----> x" |
|
4016 |
by auto |
|
60420 | 4017 |
from \<open>x\<in>U\<close> \<open>U \<subseteq> \<Union>A\<close> from_nat_into_surj[OF \<open>countable A\<close>] |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4018 |
obtain n where "x \<in> from_nat_into A n" by auto |
60420 | 4019 |
with r(2) A(1) from_nat_into[OF \<open>A \<noteq> {}\<close>, of n] |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4020 |
have "eventually (\<lambda>i. X (r i) \<in> from_nat_into A n) sequentially" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4021 |
unfolding tendsto_def by (auto simp: comp_def) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4022 |
then obtain N where "\<And>i. N \<le> i \<Longrightarrow> X (r i) \<in> from_nat_into A n" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4023 |
by (auto simp: eventually_sequentially) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4024 |
moreover from X have "\<And>i. n \<le> r i \<Longrightarrow> X (r i) \<notin> from_nat_into A n" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4025 |
by auto |
60420 | 4026 |
moreover from \<open>subseq r\<close>[THEN seq_suble, of "max n N"] have "\<exists>i. n \<le> r i \<and> N \<le> i" |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4027 |
by (auto intro!: exI[of _ "max n N"]) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4028 |
ultimately show False |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4029 |
by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4030 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4031 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4032 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4033 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4034 |
lemma compact_imp_seq_compact: |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4035 |
fixes U :: "'a :: first_countable_topology set" |
53282 | 4036 |
assumes "compact U" |
4037 |
shows "seq_compact U" |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4038 |
unfolding seq_compact_def |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4039 |
proof safe |
52624 | 4040 |
fix X :: "nat \<Rightarrow> 'a" |
4041 |
assume "\<forall>n. X n \<in> U" |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4042 |
then have "eventually (\<lambda>x. x \<in> U) (filtermap X sequentially)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4043 |
by (auto simp: eventually_filtermap) |
52624 | 4044 |
moreover |
4045 |
have "filtermap X sequentially \<noteq> bot" |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4046 |
by (simp add: trivial_limit_def eventually_filtermap) |
52624 | 4047 |
ultimately |
4048 |
obtain x where "x \<in> U" and x: "inf (nhds x) (filtermap X sequentially) \<noteq> bot" (is "?F \<noteq> _") |
|
60420 | 4049 |
using \<open>compact U\<close> by (auto simp: compact_filter) |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4050 |
|
55522 | 4051 |
from countable_basis_at_decseq[of x] |
4052 |
obtain A where A: |
|
4053 |
"\<And>i. open (A i)" |
|
4054 |
"\<And>i. x \<in> A i" |
|
4055 |
"\<And>S. open S \<Longrightarrow> x \<in> S \<Longrightarrow> eventually (\<lambda>i. A i \<subseteq> S) sequentially" |
|
4056 |
by blast |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4057 |
def s \<equiv> "\<lambda>n i. SOME j. i < j \<and> X j \<in> A (Suc n)" |
52624 | 4058 |
{ |
4059 |
fix n i |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4060 |
have "\<exists>a. i < a \<and> X a \<in> A (Suc n)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4061 |
proof (rule ccontr) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4062 |
assume "\<not> (\<exists>a>i. X a \<in> A (Suc n))" |
53282 | 4063 |
then have "\<And>a. Suc i \<le> a \<Longrightarrow> X a \<notin> A (Suc n)" |
4064 |
by auto |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4065 |
then have "eventually (\<lambda>x. x \<notin> A (Suc n)) (filtermap X sequentially)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4066 |
by (auto simp: eventually_filtermap eventually_sequentially) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4067 |
moreover have "eventually (\<lambda>x. x \<in> A (Suc n)) (nhds x)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4068 |
using A(1,2)[of "Suc n"] by (auto simp: eventually_nhds) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4069 |
ultimately have "eventually (\<lambda>x. False) ?F" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4070 |
by (auto simp add: eventually_inf) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4071 |
with x show False |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4072 |
by (simp add: eventually_False) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4073 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4074 |
then have "i < s n i" "X (s n i) \<in> A (Suc n)" |
52624 | 4075 |
unfolding s_def by (auto intro: someI2_ex) |
4076 |
} |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4077 |
note s = this |
55415 | 4078 |
def r \<equiv> "rec_nat (s 0 0) s" |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4079 |
have "subseq r" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4080 |
by (auto simp: r_def s subseq_Suc_iff) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4081 |
moreover |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4082 |
have "(\<lambda>n. X (r n)) ----> x" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4083 |
proof (rule topological_tendstoI) |
52624 | 4084 |
fix S |
4085 |
assume "open S" "x \<in> S" |
|
53282 | 4086 |
with A(3) have "eventually (\<lambda>i. A i \<subseteq> S) sequentially" |
4087 |
by auto |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4088 |
moreover |
52624 | 4089 |
{ |
4090 |
fix i |
|
4091 |
assume "Suc 0 \<le> i" |
|
4092 |
then have "X (r i) \<in> A i" |
|
4093 |
by (cases i) (simp_all add: r_def s) |
|
4094 |
} |
|
4095 |
then have "eventually (\<lambda>i. X (r i) \<in> A i) sequentially" |
|
4096 |
by (auto simp: eventually_sequentially) |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4097 |
ultimately show "eventually (\<lambda>i. X (r i) \<in> S) sequentially" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4098 |
by eventually_elim auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4099 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4100 |
ultimately show "\<exists>x \<in> U. \<exists>r. subseq r \<and> (X \<circ> r) ----> x" |
60420 | 4101 |
using \<open>x \<in> U\<close> by (auto simp: convergent_def comp_def) |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4102 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4103 |
|
50943
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4104 |
lemma countably_compact_imp_acc_point: |
53291 | 4105 |
assumes "countably_compact s" |
4106 |
and "countable t" |
|
4107 |
and "infinite t" |
|
4108 |
and "t \<subseteq> s" |
|
50943
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4109 |
shows "\<exists>x\<in>s. \<forall>U. x\<in>U \<and> open U \<longrightarrow> infinite (U \<inter> t)" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4110 |
proof (rule ccontr) |
53282 | 4111 |
def C \<equiv> "(\<lambda>F. interior (F \<union> (- t))) ` {F. finite F \<and> F \<subseteq> t }" |
60420 | 4112 |
note \<open>countably_compact s\<close> |
53282 | 4113 |
moreover have "\<forall>t\<in>C. open t" |
50943
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4114 |
by (auto simp: C_def) |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4115 |
moreover |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4116 |
assume "\<not> (\<exists>x\<in>s. \<forall>U. x\<in>U \<and> open U \<longrightarrow> infinite (U \<inter> t))" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4117 |
then have s: "\<And>x. x \<in> s \<Longrightarrow> \<exists>U. x\<in>U \<and> open U \<and> finite (U \<inter> t)" by metis |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4118 |
have "s \<subseteq> \<Union>C" |
60420 | 4119 |
using \<open>t \<subseteq> s\<close> |
50943
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4120 |
unfolding C_def Union_image_eq |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4121 |
apply (safe dest!: s) |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4122 |
apply (rule_tac a="U \<inter> t" in UN_I) |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4123 |
apply (auto intro!: interiorI simp add: finite_subset) |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4124 |
done |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4125 |
moreover |
60420 | 4126 |
from \<open>countable t\<close> have "countable C" |
50943
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4127 |
unfolding C_def by (auto intro: countable_Collect_finite_subset) |
55522 | 4128 |
ultimately |
4129 |
obtain D where "D \<subseteq> C" "finite D" "s \<subseteq> \<Union>D" |
|
4130 |
by (rule countably_compactE) |
|
53282 | 4131 |
then obtain E where E: "E \<subseteq> {F. finite F \<and> F \<subseteq> t }" "finite E" |
4132 |
and s: "s \<subseteq> (\<Union>F\<in>E. interior (F \<union> (- t)))" |
|
50943
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4133 |
by (metis (lifting) Union_image_eq finite_subset_image C_def) |
60420 | 4134 |
from s \<open>t \<subseteq> s\<close> have "t \<subseteq> \<Union>E" |
50943
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4135 |
using interior_subset by blast |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4136 |
moreover have "finite (\<Union>E)" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4137 |
using E by auto |
60420 | 4138 |
ultimately show False using \<open>infinite t\<close> |
53282 | 4139 |
by (auto simp: finite_subset) |
50943
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4140 |
qed |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4141 |
|
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4142 |
lemma countable_acc_point_imp_seq_compact: |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4143 |
fixes s :: "'a::first_countable_topology set" |
53291 | 4144 |
assumes "\<forall>t. infinite t \<and> countable t \<and> t \<subseteq> s \<longrightarrow> |
4145 |
(\<exists>x\<in>s. \<forall>U. x\<in>U \<and> open U \<longrightarrow> infinite (U \<inter> t))" |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4146 |
shows "seq_compact s" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4147 |
proof - |
52624 | 4148 |
{ |
4149 |
fix f :: "nat \<Rightarrow> 'a" |
|
4150 |
assume f: "\<forall>n. f n \<in> s" |
|
50943
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4151 |
have "\<exists>l\<in>s. \<exists>r. subseq r \<and> ((f \<circ> r) ---> l) sequentially" |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4152 |
proof (cases "finite (range f)") |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4153 |
case True |
50941
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
4154 |
obtain l where "infinite {n. f n = f l}" |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
4155 |
using pigeonhole_infinite[OF _ True] by auto |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
4156 |
then obtain r where "subseq r" and fr: "\<forall>n. f (r n) = f l" |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
4157 |
using infinite_enumerate by blast |
53282 | 4158 |
then have "subseq r \<and> (f \<circ> r) ----> f l" |
58729
e8ecc79aee43
add tendsto_const and tendsto_ident_at as simp and intro rules
hoelzl
parents:
58184
diff
changeset
|
4159 |
by (simp add: fr o_def) |
50941
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
4160 |
with f show "\<exists>l\<in>s. \<exists>r. subseq r \<and> (f \<circ> r) ----> l" |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
4161 |
by auto |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4162 |
next |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4163 |
case False |
53282 | 4164 |
with f assms have "\<exists>x\<in>s. \<forall>U. x\<in>U \<and> open U \<longrightarrow> infinite (U \<inter> range f)" |
4165 |
by auto |
|
50943
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4166 |
then obtain l where "l \<in> s" "\<forall>U. l\<in>U \<and> open U \<longrightarrow> infinite (U \<inter> range f)" .. |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4167 |
from this(2) have "\<exists>r. subseq r \<and> ((f \<circ> r) ---> l) sequentially" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4168 |
using acc_point_range_imp_convergent_subsequence[of l f] by auto |
60420 | 4169 |
with \<open>l \<in> s\<close> show "\<exists>l\<in>s. \<exists>r. subseq r \<and> ((f \<circ> r) ---> l) sequentially" .. |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4170 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4171 |
} |
53282 | 4172 |
then show ?thesis |
4173 |
unfolding seq_compact_def by auto |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4174 |
qed |
44075 | 4175 |
|
50943
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4176 |
lemma seq_compact_eq_countably_compact: |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4177 |
fixes U :: "'a :: first_countable_topology set" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4178 |
shows "seq_compact U \<longleftrightarrow> countably_compact U" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4179 |
using |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4180 |
countable_acc_point_imp_seq_compact |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4181 |
countably_compact_imp_acc_point |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4182 |
seq_compact_imp_countably_compact |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4183 |
by metis |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4184 |
|
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4185 |
lemma seq_compact_eq_acc_point: |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4186 |
fixes s :: "'a :: first_countable_topology set" |
53291 | 4187 |
shows "seq_compact s \<longleftrightarrow> |
4188 |
(\<forall>t. infinite t \<and> countable t \<and> t \<subseteq> s --> (\<exists>x\<in>s. \<forall>U. x\<in>U \<and> open U \<longrightarrow> infinite (U \<inter> t)))" |
|
50943
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4189 |
using |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4190 |
countable_acc_point_imp_seq_compact[of s] |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4191 |
countably_compact_imp_acc_point[of s] |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4192 |
seq_compact_imp_countably_compact[of s] |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4193 |
by metis |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4194 |
|
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4195 |
lemma seq_compact_eq_compact: |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4196 |
fixes U :: "'a :: second_countable_topology set" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4197 |
shows "seq_compact U \<longleftrightarrow> compact U" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4198 |
using seq_compact_eq_countably_compact countably_compact_eq_compact by blast |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4199 |
|
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4200 |
lemma bolzano_weierstrass_imp_seq_compact: |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4201 |
fixes s :: "'a::{t1_space, first_countable_topology} set" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4202 |
shows "\<forall>t. infinite t \<and> t \<subseteq> s --> (\<exists>x \<in> s. x islimpt t) \<Longrightarrow> seq_compact s" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4203 |
by (rule countable_acc_point_imp_seq_compact) (metis islimpt_eq_acc_point) |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4204 |
|
60420 | 4205 |
subsubsection\<open>Totally bounded\<close> |
50940
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
4206 |
|
53282 | 4207 |
lemma cauchy_def: "Cauchy s \<longleftrightarrow> (\<forall>e>0. \<exists>N. \<forall>m n. m \<ge> N \<and> n \<ge> N --> dist(s m)(s n) < e)" |
52624 | 4208 |
unfolding Cauchy_def by metis |
4209 |
||
50940
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
4210 |
lemma seq_compact_imp_totally_bounded: |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
4211 |
assumes "seq_compact s" |
58184
db1381d811ab
cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents:
57865
diff
changeset
|
4212 |
shows "\<forall>e>0. \<exists>k. finite k \<and> k \<subseteq> s \<and> s \<subseteq> (\<Union>x\<in>k. ball x e)" |
db1381d811ab
cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents:
57865
diff
changeset
|
4213 |
proof - |
db1381d811ab
cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents:
57865
diff
changeset
|
4214 |
{ fix e::real assume "e > 0" assume *: "\<And>k. finite k \<Longrightarrow> k \<subseteq> s \<Longrightarrow> \<not> s \<subseteq> (\<Union>x\<in>k. ball x e)" |
db1381d811ab
cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents:
57865
diff
changeset
|
4215 |
let ?Q = "\<lambda>x n r. r \<in> s \<and> (\<forall>m < (n::nat). \<not> (dist (x m) r < e))" |
db1381d811ab
cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents:
57865
diff
changeset
|
4216 |
have "\<exists>x. \<forall>n::nat. ?Q x n (x n)" |
db1381d811ab
cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents:
57865
diff
changeset
|
4217 |
proof (rule dependent_wellorder_choice) |
db1381d811ab
cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents:
57865
diff
changeset
|
4218 |
fix n x assume "\<And>y. y < n \<Longrightarrow> ?Q x y (x y)" |
db1381d811ab
cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents:
57865
diff
changeset
|
4219 |
then have "\<not> s \<subseteq> (\<Union>x\<in>x ` {0..<n}. ball x e)" |
db1381d811ab
cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents:
57865
diff
changeset
|
4220 |
using *[of "x ` {0 ..< n}"] by (auto simp: subset_eq) |
52624 | 4221 |
then obtain z where z:"z\<in>s" "z \<notin> (\<Union>x\<in>x ` {0..<n}. ball x e)" |
4222 |
unfolding subset_eq by auto |
|
58184
db1381d811ab
cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents:
57865
diff
changeset
|
4223 |
show "\<exists>r. ?Q x n r" |
db1381d811ab
cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents:
57865
diff
changeset
|
4224 |
using z by auto |
db1381d811ab
cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents:
57865
diff
changeset
|
4225 |
qed simp |
db1381d811ab
cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents:
57865
diff
changeset
|
4226 |
then obtain x where "\<forall>n::nat. x n \<in> s" and x:"\<And>n m. m < n \<Longrightarrow> \<not> (dist (x m) (x n) < e)" |
db1381d811ab
cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents:
57865
diff
changeset
|
4227 |
by blast |
db1381d811ab
cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents:
57865
diff
changeset
|
4228 |
then obtain l r where "l \<in> s" and r:"subseq r" and "((x \<circ> r) ---> l) sequentially" |
db1381d811ab
cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents:
57865
diff
changeset
|
4229 |
using assms by (metis seq_compact_def) |
db1381d811ab
cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents:
57865
diff
changeset
|
4230 |
from this(3) have "Cauchy (x \<circ> r)" |
db1381d811ab
cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents:
57865
diff
changeset
|
4231 |
using LIMSEQ_imp_Cauchy by auto |
db1381d811ab
cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents:
57865
diff
changeset
|
4232 |
then obtain N::nat where "\<And>m n. N \<le> m \<Longrightarrow> N \<le> n \<Longrightarrow> dist ((x \<circ> r) m) ((x \<circ> r) n) < e" |
60420 | 4233 |
unfolding cauchy_def using \<open>e > 0\<close> by blast |
58184
db1381d811ab
cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents:
57865
diff
changeset
|
4234 |
then have False |
db1381d811ab
cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents:
57865
diff
changeset
|
4235 |
using x[of "r N" "r (N+1)"] r by (auto simp: subseq_def) } |
db1381d811ab
cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents:
57865
diff
changeset
|
4236 |
then show ?thesis |
db1381d811ab
cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents:
57865
diff
changeset
|
4237 |
by metis |
50940
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
4238 |
qed |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
4239 |
|
60420 | 4240 |
subsubsection\<open>Heine-Borel theorem\<close> |
50940
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
4241 |
|
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
4242 |
lemma seq_compact_imp_heine_borel: |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
4243 |
fixes s :: "'a :: metric_space set" |
53282 | 4244 |
assumes "seq_compact s" |
4245 |
shows "compact s" |
|
50943
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4246 |
proof - |
60420 | 4247 |
from seq_compact_imp_totally_bounded[OF \<open>seq_compact s\<close>] |
58184
db1381d811ab
cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents:
57865
diff
changeset
|
4248 |
obtain f where f: "\<forall>e>0. finite (f e) \<and> f e \<subseteq> s \<and> s \<subseteq> (\<Union>x\<in>f e. ball x e)" |
55522 | 4249 |
unfolding choice_iff' .. |
50943
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4250 |
def K \<equiv> "(\<lambda>(x, r). ball x r) ` ((\<Union>e \<in> \<rat> \<inter> {0 <..}. f e) \<times> \<rat>)" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4251 |
have "countably_compact s" |
60420 | 4252 |
using \<open>seq_compact s\<close> by (rule seq_compact_imp_countably_compact) |
50943
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4253 |
then show "compact s" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4254 |
proof (rule countably_compact_imp_compact) |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4255 |
show "countable K" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4256 |
unfolding K_def using f |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4257 |
by (auto intro: countable_finite countable_subset countable_rat |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4258 |
intro!: countable_image countable_SIGMA countable_UN) |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4259 |
show "\<forall>b\<in>K. open b" by (auto simp: K_def) |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4260 |
next |
53282 | 4261 |
fix T x |
4262 |
assume T: "open T" "x \<in> T" and x: "x \<in> s" |
|
4263 |
from openE[OF T] obtain e where "0 < e" "ball x e \<subseteq> T" |
|
4264 |
by auto |
|
4265 |
then have "0 < e / 2" "ball x (e / 2) \<subseteq> T" |
|
4266 |
by auto |
|
60420 | 4267 |
from Rats_dense_in_real[OF \<open>0 < e / 2\<close>] obtain r where "r \<in> \<rat>" "0 < r" "r < e / 2" |
53282 | 4268 |
by auto |
60420 | 4269 |
from f[rule_format, of r] \<open>0 < r\<close> \<open>x \<in> s\<close> obtain k where "k \<in> f r" "x \<in> ball k r" |
50943
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4270 |
unfolding Union_image_eq by auto |
60420 | 4271 |
from \<open>r \<in> \<rat>\<close> \<open>0 < r\<close> \<open>k \<in> f r\<close> have "ball k r \<in> K" |
53282 | 4272 |
by (auto simp: K_def) |
50943
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4273 |
then show "\<exists>b\<in>K. x \<in> b \<and> b \<inter> s \<subseteq> T" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4274 |
proof (rule bexI[rotated], safe) |
53282 | 4275 |
fix y |
4276 |
assume "y \<in> ball k r" |
|
60420 | 4277 |
with \<open>r < e / 2\<close> \<open>x \<in> ball k r\<close> have "dist x y < e" |
50943
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4278 |
by (intro dist_double[where x = k and d=e]) (auto simp: dist_commute) |
60420 | 4279 |
with \<open>ball x e \<subseteq> T\<close> show "y \<in> T" |
53282 | 4280 |
by auto |
4281 |
next |
|
4282 |
show "x \<in> ball k r" by fact |
|
4283 |
qed |
|
50943
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
4284 |
qed |
50940
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
4285 |
qed |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
4286 |
|
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
4287 |
lemma compact_eq_seq_compact_metric: |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
4288 |
"compact (s :: 'a::metric_space set) \<longleftrightarrow> seq_compact s" |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
4289 |
using compact_imp_seq_compact seq_compact_imp_heine_borel by blast |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
4290 |
|
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
4291 |
lemma compact_def: |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
4292 |
"compact (S :: 'a::metric_space set) \<longleftrightarrow> |
53640 | 4293 |
(\<forall>f. (\<forall>n. f n \<in> S) \<longrightarrow> (\<exists>l\<in>S. \<exists>r. subseq r \<and> (f \<circ> r) ----> l))" |
50940
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
4294 |
unfolding compact_eq_seq_compact_metric seq_compact_def by auto |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
4295 |
|
60420 | 4296 |
subsubsection \<open>Complete the chain of compactness variants\<close> |
50944 | 4297 |
|
4298 |
lemma compact_eq_bolzano_weierstrass: |
|
4299 |
fixes s :: "'a::metric_space set" |
|
53282 | 4300 |
shows "compact s \<longleftrightarrow> (\<forall>t. infinite t \<and> t \<subseteq> s --> (\<exists>x \<in> s. x islimpt t))" |
4301 |
(is "?lhs = ?rhs") |
|
50944 | 4302 |
proof |
52624 | 4303 |
assume ?lhs |
53282 | 4304 |
then show ?rhs |
4305 |
using heine_borel_imp_bolzano_weierstrass[of s] by auto |
|
50944 | 4306 |
next |
52624 | 4307 |
assume ?rhs |
53282 | 4308 |
then show ?lhs |
50944 | 4309 |
unfolding compact_eq_seq_compact_metric by (rule bolzano_weierstrass_imp_seq_compact) |
4310 |
qed |
|
4311 |
||
4312 |
lemma bolzano_weierstrass_imp_bounded: |
|
53282 | 4313 |
"\<forall>t. infinite t \<and> t \<subseteq> s \<longrightarrow> (\<exists>x \<in> s. x islimpt t) \<Longrightarrow> bounded s" |
50944 | 4314 |
using compact_imp_bounded unfolding compact_eq_bolzano_weierstrass . |
4315 |
||
60420 | 4316 |
subsection \<open>Metric spaces with the Heine-Borel property\<close> |
4317 |
||
4318 |
text \<open> |
|
33175 | 4319 |
A metric space (or topological vector space) is said to have the |
4320 |
Heine-Borel property if every closed and bounded subset is compact. |
|
60420 | 4321 |
\<close> |
33175 | 4322 |
|
44207
ea99698c2070
locale-ize some definitions, so perfect_space and heine_borel can inherit from the proper superclasses
huffman
parents:
44170
diff
changeset
|
4323 |
class heine_borel = metric_space + |
33175 | 4324 |
assumes bounded_imp_convergent_subsequence: |
50998 | 4325 |
"bounded (range f) \<Longrightarrow> \<exists>l r. subseq r \<and> ((f \<circ> r) ---> l) sequentially" |
33175 | 4326 |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4327 |
lemma bounded_closed_imp_seq_compact: |
33175 | 4328 |
fixes s::"'a::heine_borel set" |
53282 | 4329 |
assumes "bounded s" |
4330 |
and "closed s" |
|
4331 |
shows "seq_compact s" |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
4332 |
proof (unfold seq_compact_def, clarify) |
53282 | 4333 |
fix f :: "nat \<Rightarrow> 'a" |
4334 |
assume f: "\<forall>n. f n \<in> s" |
|
60420 | 4335 |
with \<open>bounded s\<close> have "bounded (range f)" |
53282 | 4336 |
by (auto intro: bounded_subset) |
33175 | 4337 |
obtain l r where r: "subseq r" and l: "((f \<circ> r) ---> l) sequentially" |
60420 | 4338 |
using bounded_imp_convergent_subsequence [OF \<open>bounded (range f)\<close>] by auto |
53282 | 4339 |
from f have fr: "\<forall>n. (f \<circ> r) n \<in> s" |
4340 |
by simp |
|
60420 | 4341 |
have "l \<in> s" using \<open>closed s\<close> fr l |
54070 | 4342 |
by (rule closed_sequentially) |
33175 | 4343 |
show "\<exists>l\<in>s. \<exists>r. subseq r \<and> ((f \<circ> r) ---> l) sequentially" |
60420 | 4344 |
using \<open>l \<in> s\<close> r l by blast |
33175 | 4345 |
qed |
4346 |
||
50944 | 4347 |
lemma compact_eq_bounded_closed: |
4348 |
fixes s :: "'a::heine_borel set" |
|
53291 | 4349 |
shows "compact s \<longleftrightarrow> bounded s \<and> closed s" |
4350 |
(is "?lhs = ?rhs") |
|
50944 | 4351 |
proof |
52624 | 4352 |
assume ?lhs |
53282 | 4353 |
then show ?rhs |
52624 | 4354 |
using compact_imp_closed compact_imp_bounded |
4355 |
by blast |
|
50944 | 4356 |
next |
52624 | 4357 |
assume ?rhs |
53282 | 4358 |
then show ?lhs |
52624 | 4359 |
using bounded_closed_imp_seq_compact[of s] |
4360 |
unfolding compact_eq_seq_compact_metric |
|
4361 |
by auto |
|
50944 | 4362 |
qed |
4363 |
||
61306
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
4364 |
lemma compact_components: |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
4365 |
fixes s :: "'a::heine_borel set" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
4366 |
shows "\<lbrakk>compact s; c \<in> components s\<rbrakk> \<Longrightarrow> compact c" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
4367 |
by (meson bounded_subset closed_components in_components_subset compact_eq_bounded_closed) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
4368 |
|
50973
4a2c82644889
generalized diameter from real_normed_vector to metric_space
hoelzl
parents:
50972
diff
changeset
|
4369 |
(* TODO: is this lemma necessary? *) |
50972 | 4370 |
lemma bounded_increasing_convergent: |
4371 |
fixes s :: "nat \<Rightarrow> real" |
|
50973
4a2c82644889
generalized diameter from real_normed_vector to metric_space
hoelzl
parents:
50972
diff
changeset
|
4372 |
shows "bounded {s n| n. True} \<Longrightarrow> \<forall>n. s n \<le> s (Suc n) \<Longrightarrow> \<exists>l. s ----> l" |
50972 | 4373 |
using Bseq_mono_convergent[of s] incseq_Suc_iff[of s] |
4374 |
by (auto simp: image_def Bseq_eq_bounded convergent_def incseq_def) |
|
33175 | 4375 |
|
4376 |
instance real :: heine_borel |
|
4377 |
proof |
|
50998 | 4378 |
fix f :: "nat \<Rightarrow> real" |
4379 |
assume f: "bounded (range f)" |
|
50972 | 4380 |
obtain r where r: "subseq r" "monoseq (f \<circ> r)" |
4381 |
unfolding comp_def by (metis seq_monosub) |
|
4382 |
then have "Bseq (f \<circ> r)" |
|
50998 | 4383 |
unfolding Bseq_eq_bounded using f by (auto intro: bounded_subset) |
53374
a14d2a854c02
tuned proofs -- clarified flow of facts wrt. calculation;
wenzelm
parents:
53291
diff
changeset
|
4384 |
with r show "\<exists>l r. subseq r \<and> (f \<circ> r) ----> l" |
50972 | 4385 |
using Bseq_monoseq_convergent[of "f \<circ> r"] by (auto simp: convergent_def) |
33175 | 4386 |
qed |
4387 |
||
4388 |
lemma compact_lemma: |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
4389 |
fixes f :: "nat \<Rightarrow> 'a::euclidean_space" |
50998 | 4390 |
assumes "bounded (range f)" |
53291 | 4391 |
shows "\<forall>d\<subseteq>Basis. \<exists>l::'a. \<exists> r. |
4392 |
subseq r \<and> (\<forall>e>0. eventually (\<lambda>n. \<forall>i\<in>d. dist (f (r n) \<bullet> i) (l \<bullet> i) < e) sequentially)" |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
4393 |
proof safe |
52624 | 4394 |
fix d :: "'a set" |
53282 | 4395 |
assume d: "d \<subseteq> Basis" |
4396 |
with finite_Basis have "finite d" |
|
4397 |
by (blast intro: finite_subset) |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
4398 |
from this d show "\<exists>l::'a. \<exists>r. subseq r \<and> |
52624 | 4399 |
(\<forall>e>0. eventually (\<lambda>n. \<forall>i\<in>d. dist (f (r n) \<bullet> i) (l \<bullet> i) < e) sequentially)" |
4400 |
proof (induct d) |
|
4401 |
case empty |
|
53282 | 4402 |
then show ?case |
4403 |
unfolding subseq_def by auto |
|
52624 | 4404 |
next |
4405 |
case (insert k d) |
|
53282 | 4406 |
have k[intro]: "k \<in> Basis" |
4407 |
using insert by auto |
|
4408 |
have s': "bounded ((\<lambda>x. x \<bullet> k) ` range f)" |
|
60420 | 4409 |
using \<open>bounded (range f)\<close> |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
4410 |
by (auto intro!: bounded_linear_image bounded_linear_inner_left) |
53282 | 4411 |
obtain l1::"'a" and r1 where r1: "subseq r1" |
4412 |
and lr1: "\<forall>e > 0. eventually (\<lambda>n. \<forall>i\<in>d. dist (f (r1 n) \<bullet> i) (l1 \<bullet> i) < e) sequentially" |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
4413 |
using insert(3) using insert(4) by auto |
53282 | 4414 |
have f': "\<forall>n. f (r1 n) \<bullet> k \<in> (\<lambda>x. x \<bullet> k) ` range f" |
4415 |
by simp |
|
50998 | 4416 |
have "bounded (range (\<lambda>i. f (r1 i) \<bullet> k))" |
4417 |
by (metis (lifting) bounded_subset f' image_subsetI s') |
|
4418 |
then obtain l2 r2 where r2:"subseq r2" and lr2:"((\<lambda>i. f (r1 (r2 i)) \<bullet> k) ---> l2) sequentially" |
|
53282 | 4419 |
using bounded_imp_convergent_subsequence[of "\<lambda>i. f (r1 i) \<bullet> k"] |
4420 |
by (auto simp: o_def) |
|
4421 |
def r \<equiv> "r1 \<circ> r2" |
|
4422 |
have r:"subseq r" |
|
33175 | 4423 |
using r1 and r2 unfolding r_def o_def subseq_def by auto |
4424 |
moreover |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
4425 |
def l \<equiv> "(\<Sum>i\<in>Basis. (if i = k then l2 else l1\<bullet>i) *\<^sub>R i)::'a" |
52624 | 4426 |
{ |
4427 |
fix e::real |
|
53282 | 4428 |
assume "e > 0" |
60420 | 4429 |
from lr1 \<open>e > 0\<close> have N1: "eventually (\<lambda>n. \<forall>i\<in>d. dist (f (r1 n) \<bullet> i) (l1 \<bullet> i) < e) sequentially" |
52624 | 4430 |
by blast |
60420 | 4431 |
from lr2 \<open>e > 0\<close> have N2:"eventually (\<lambda>n. dist (f (r1 (r2 n)) \<bullet> k) l2 < e) sequentially" |
52624 | 4432 |
by (rule tendstoD) |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
4433 |
from r2 N1 have N1': "eventually (\<lambda>n. \<forall>i\<in>d. dist (f (r1 (r2 n)) \<bullet> i) (l1 \<bullet> i) < e) sequentially" |
33175 | 4434 |
by (rule eventually_subseq) |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
4435 |
have "eventually (\<lambda>n. \<forall>i\<in>(insert k d). dist (f (r n) \<bullet> i) (l \<bullet> i) < e) sequentially" |
53282 | 4436 |
using N1' N2 |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
4437 |
by eventually_elim (insert insert.prems, auto simp: l_def r_def o_def) |
33175 | 4438 |
} |
4439 |
ultimately show ?case by auto |
|
4440 |
qed |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
4441 |
qed |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
4442 |
|
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
4443 |
instance euclidean_space \<subseteq> heine_borel |
33175 | 4444 |
proof |
50998 | 4445 |
fix f :: "nat \<Rightarrow> 'a" |
4446 |
assume f: "bounded (range f)" |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
4447 |
then obtain l::'a and r where r: "subseq r" |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
4448 |
and l: "\<forall>e>0. eventually (\<lambda>n. \<forall>i\<in>Basis. dist (f (r n) \<bullet> i) (l \<bullet> i) < e) sequentially" |
50998 | 4449 |
using compact_lemma [OF f] by blast |
52624 | 4450 |
{ |
4451 |
fix e::real |
|
53282 | 4452 |
assume "e > 0" |
56541 | 4453 |
hence "e / real_of_nat DIM('a) > 0" by (simp add: DIM_positive) |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
4454 |
with l have "eventually (\<lambda>n. \<forall>i\<in>Basis. dist (f (r n) \<bullet> i) (l \<bullet> i) < e / (real_of_nat DIM('a))) sequentially" |
33175 | 4455 |
by simp |
4456 |
moreover |
|
52624 | 4457 |
{ |
4458 |
fix n |
|
4459 |
assume n: "\<forall>i\<in>Basis. dist (f (r n) \<bullet> i) (l \<bullet> i) < e / (real_of_nat DIM('a))" |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
4460 |
have "dist (f (r n)) l \<le> (\<Sum>i\<in>Basis. dist (f (r n) \<bullet> i) (l \<bullet> i))" |
52624 | 4461 |
apply (subst euclidean_dist_l2) |
4462 |
using zero_le_dist |
|
53282 | 4463 |
apply (rule setL2_le_setsum) |
4464 |
done |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
4465 |
also have "\<dots> < (\<Sum>i\<in>(Basis::'a set). e / (real_of_nat DIM('a)))" |
52624 | 4466 |
apply (rule setsum_strict_mono) |
4467 |
using n |
|
53282 | 4468 |
apply auto |
4469 |
done |
|
4470 |
finally have "dist (f (r n)) l < e" |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
4471 |
by auto |
33175 | 4472 |
} |
4473 |
ultimately have "eventually (\<lambda>n. dist (f (r n)) l < e) sequentially" |
|
4474 |
by (rule eventually_elim1) |
|
4475 |
} |
|
53282 | 4476 |
then have *: "((f \<circ> r) ---> l) sequentially" |
52624 | 4477 |
unfolding o_def tendsto_iff by simp |
4478 |
with r show "\<exists>l r. subseq r \<and> ((f \<circ> r) ---> l) sequentially" |
|
4479 |
by auto |
|
33175 | 4480 |
qed |
4481 |
||
4482 |
lemma bounded_fst: "bounded s \<Longrightarrow> bounded (fst ` s)" |
|
52624 | 4483 |
unfolding bounded_def |
55775 | 4484 |
by (metis (erased, hide_lams) dist_fst_le image_iff order_trans) |
33175 | 4485 |
|
4486 |
lemma bounded_snd: "bounded s \<Longrightarrow> bounded (snd ` s)" |
|
52624 | 4487 |
unfolding bounded_def |
55775 | 4488 |
by (metis (no_types, hide_lams) dist_snd_le image_iff order.trans) |
33175 | 4489 |
|
37678
0040bafffdef
"prod" and "sum" replace "*" and "+" respectively
haftmann
parents:
37649
diff
changeset
|
4490 |
instance prod :: (heine_borel, heine_borel) heine_borel |
33175 | 4491 |
proof |
50998 | 4492 |
fix f :: "nat \<Rightarrow> 'a \<times> 'b" |
4493 |
assume f: "bounded (range f)" |
|
56154
f0a927235162
more complete set of lemmas wrt. image and composition
haftmann
parents:
56073
diff
changeset
|
4494 |
then have "bounded (fst ` range f)" |
f0a927235162
more complete set of lemmas wrt. image and composition
haftmann
parents:
56073
diff
changeset
|
4495 |
by (rule bounded_fst) |
f0a927235162
more complete set of lemmas wrt. image and composition
haftmann
parents:
56073
diff
changeset
|
4496 |
then have s1: "bounded (range (fst \<circ> f))" |
f0a927235162
more complete set of lemmas wrt. image and composition
haftmann
parents:
56073
diff
changeset
|
4497 |
by (simp add: image_comp) |
50998 | 4498 |
obtain l1 r1 where r1: "subseq r1" and l1: "(\<lambda>n. fst (f (r1 n))) ----> l1" |
4499 |
using bounded_imp_convergent_subsequence [OF s1] unfolding o_def by fast |
|
4500 |
from f have s2: "bounded (range (snd \<circ> f \<circ> r1))" |
|
4501 |
by (auto simp add: image_comp intro: bounded_snd bounded_subset) |
|
53282 | 4502 |
obtain l2 r2 where r2: "subseq r2" and l2: "((\<lambda>n. snd (f (r1 (r2 n)))) ---> l2) sequentially" |
50998 | 4503 |
using bounded_imp_convergent_subsequence [OF s2] |
33175 | 4504 |
unfolding o_def by fast |
4505 |
have l1': "((\<lambda>n. fst (f (r1 (r2 n)))) ---> l1) sequentially" |
|
50972 | 4506 |
using LIMSEQ_subseq_LIMSEQ [OF l1 r2] unfolding o_def . |
33175 | 4507 |
have l: "((f \<circ> (r1 \<circ> r2)) ---> (l1, l2)) sequentially" |
4508 |
using tendsto_Pair [OF l1' l2] unfolding o_def by simp |
|
4509 |
have r: "subseq (r1 \<circ> r2)" |
|
4510 |
using r1 r2 unfolding subseq_def by simp |
|
4511 |
show "\<exists>l r. subseq r \<and> ((f \<circ> r) ---> l) sequentially" |
|
4512 |
using l r by fast |
|
4513 |
qed |
|
4514 |
||
60420 | 4515 |
subsubsection \<open>Completeness\<close> |
33175 | 4516 |
|
52624 | 4517 |
definition complete :: "'a::metric_space set \<Rightarrow> bool" |
4518 |
where "complete s \<longleftrightarrow> (\<forall>f. (\<forall>n. f n \<in> s) \<and> Cauchy f \<longrightarrow> (\<exists>l\<in>s. f ----> l))" |
|
4519 |
||
54070 | 4520 |
lemma completeI: |
4521 |
assumes "\<And>f. \<forall>n. f n \<in> s \<Longrightarrow> Cauchy f \<Longrightarrow> \<exists>l\<in>s. f ----> l" |
|
4522 |
shows "complete s" |
|
4523 |
using assms unfolding complete_def by fast |
|
4524 |
||
4525 |
lemma completeE: |
|
4526 |
assumes "complete s" and "\<forall>n. f n \<in> s" and "Cauchy f" |
|
4527 |
obtains l where "l \<in> s" and "f ----> l" |
|
4528 |
using assms unfolding complete_def by fast |
|
4529 |
||
52624 | 4530 |
lemma compact_imp_complete: |
4531 |
assumes "compact s" |
|
4532 |
shows "complete s" |
|
4533 |
proof - |
|
4534 |
{ |
|
4535 |
fix f |
|
4536 |
assume as: "(\<forall>n::nat. f n \<in> s)" "Cauchy f" |
|
50971 | 4537 |
from as(1) obtain l r where lr: "l\<in>s" "subseq r" "(f \<circ> r) ----> l" |
4538 |
using assms unfolding compact_def by blast |
|
4539 |
||
4540 |
note lr' = seq_suble [OF lr(2)] |
|
52624 | 4541 |
{ |
53282 | 4542 |
fix e :: real |
4543 |
assume "e > 0" |
|
52624 | 4544 |
from as(2) obtain N where N:"\<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (f m) (f n) < e/2" |
4545 |
unfolding cauchy_def |
|
60420 | 4546 |
using \<open>e > 0\<close> |
53282 | 4547 |
apply (erule_tac x="e/2" in allE) |
52624 | 4548 |
apply auto |
4549 |
done |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59815
diff
changeset
|
4550 |
from lr(3)[unfolded lim_sequentially, THEN spec[where x="e/2"]] |
53282 | 4551 |
obtain M where M:"\<forall>n\<ge>M. dist ((f \<circ> r) n) l < e/2" |
60420 | 4552 |
using \<open>e > 0\<close> by auto |
52624 | 4553 |
{ |
53282 | 4554 |
fix n :: nat |
4555 |
assume n: "n \<ge> max N M" |
|
4556 |
have "dist ((f \<circ> r) n) l < e/2" |
|
4557 |
using n M by auto |
|
4558 |
moreover have "r n \<ge> N" |
|
4559 |
using lr'[of n] n by auto |
|
4560 |
then have "dist (f n) ((f \<circ> r) n) < e / 2" |
|
4561 |
using N and n by auto |
|
52624 | 4562 |
ultimately have "dist (f n) l < e" |
53282 | 4563 |
using dist_triangle_half_r[of "f (r n)" "f n" e l] |
4564 |
by (auto simp add: dist_commute) |
|
52624 | 4565 |
} |
53282 | 4566 |
then have "\<exists>N. \<forall>n\<ge>N. dist (f n) l < e" by blast |
52624 | 4567 |
} |
60420 | 4568 |
then have "\<exists>l\<in>s. (f ---> l) sequentially" using \<open>l\<in>s\<close> |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59815
diff
changeset
|
4569 |
unfolding lim_sequentially by auto |
52624 | 4570 |
} |
53282 | 4571 |
then show ?thesis unfolding complete_def by auto |
50971 | 4572 |
qed |
4573 |
||
4574 |
lemma nat_approx_posE: |
|
4575 |
fixes e::real |
|
4576 |
assumes "0 < e" |
|
53282 | 4577 |
obtains n :: nat where "1 / (Suc n) < e" |
50971 | 4578 |
proof atomize_elim |
4579 |
have " 1 / real (Suc (nat (ceiling (1/e)))) < 1 / (ceiling (1/e))" |
|
60420 | 4580 |
by (rule divide_strict_left_mono) (auto simp: \<open>0 < e\<close>) |
50971 | 4581 |
also have "1 / (ceiling (1/e)) \<le> 1 / (1/e)" |
60420 | 4582 |
by (rule divide_left_mono) (auto simp: \<open>0 < e\<close>) |
50971 | 4583 |
also have "\<dots> = e" by simp |
4584 |
finally show "\<exists>n. 1 / real (Suc n) < e" .. |
|
4585 |
qed |
|
4586 |
||
4587 |
lemma compact_eq_totally_bounded: |
|
58184
db1381d811ab
cleanup Wfrec; introduce dependent_wf/wellorder_choice
hoelzl
parents:
57865
diff
changeset
|
4588 |
"compact s \<longleftrightarrow> complete s \<and> (\<forall>e>0. \<exists>k. finite k \<and> s \<subseteq> (\<Union>x\<in>k. ball x e))" |
50971 | 4589 |
(is "_ \<longleftrightarrow> ?rhs") |
4590 |
proof |
|
4591 |
assume assms: "?rhs" |
|
4592 |
then obtain k where k: "\<And>e. 0 < e \<Longrightarrow> finite (k e)" "\<And>e. 0 < e \<Longrightarrow> s \<subseteq> (\<Union>x\<in>k e. ball x e)" |
|
4593 |
by (auto simp: choice_iff') |
|
4594 |
||
4595 |
show "compact s" |
|
4596 |
proof cases |
|
53282 | 4597 |
assume "s = {}" |
4598 |
then show "compact s" by (simp add: compact_def) |
|
50971 | 4599 |
next |
4600 |
assume "s \<noteq> {}" |
|
4601 |
show ?thesis |
|
4602 |
unfolding compact_def |
|
4603 |
proof safe |
|
53282 | 4604 |
fix f :: "nat \<Rightarrow> 'a" |
4605 |
assume f: "\<forall>n. f n \<in> s" |
|
4606 |
||
50971 | 4607 |
def e \<equiv> "\<lambda>n. 1 / (2 * Suc n)" |
4608 |
then have [simp]: "\<And>n. 0 < e n" by auto |
|
4609 |
def B \<equiv> "\<lambda>n U. SOME b. infinite {n. f n \<in> b} \<and> (\<exists>x. b \<subseteq> ball x (e n) \<inter> U)" |
|
53282 | 4610 |
{ |
4611 |
fix n U |
|
4612 |
assume "infinite {n. f n \<in> U}" |
|
50971 | 4613 |
then have "\<exists>b\<in>k (e n). infinite {i\<in>{n. f n \<in> U}. f i \<in> ball b (e n)}" |
4614 |
using k f by (intro pigeonhole_infinite_rel) (auto simp: subset_eq) |
|
55522 | 4615 |
then obtain a where |
4616 |
"a \<in> k (e n)" |
|
4617 |
"infinite {i \<in> {n. f n \<in> U}. f i \<in> ball a (e n)}" .. |
|
50971 | 4618 |
then have "\<exists>b. infinite {i. f i \<in> b} \<and> (\<exists>x. b \<subseteq> ball x (e n) \<inter> U)" |
4619 |
by (intro exI[of _ "ball a (e n) \<inter> U"] exI[of _ a]) (auto simp: ac_simps) |
|
4620 |
from someI_ex[OF this] |
|
4621 |
have "infinite {i. f i \<in> B n U}" "\<exists>x. B n U \<subseteq> ball x (e n) \<inter> U" |
|
53282 | 4622 |
unfolding B_def by auto |
4623 |
} |
|
50971 | 4624 |
note B = this |
4625 |
||
55415 | 4626 |
def F \<equiv> "rec_nat (B 0 UNIV) B" |
53282 | 4627 |
{ |
4628 |
fix n |
|
4629 |
have "infinite {i. f i \<in> F n}" |
|
4630 |
by (induct n) (auto simp: F_def B) |
|
4631 |
} |
|
50971 | 4632 |
then have F: "\<And>n. \<exists>x. F (Suc n) \<subseteq> ball x (e n) \<inter> F n" |
4633 |
using B by (simp add: F_def) |
|
4634 |
then have F_dec: "\<And>m n. m \<le> n \<Longrightarrow> F n \<subseteq> F m" |
|
4635 |
using decseq_SucI[of F] by (auto simp: decseq_def) |
|
4636 |
||
4637 |
obtain sel where sel: "\<And>k i. i < sel k i" "\<And>k i. f (sel k i) \<in> F k" |
|
4638 |
proof (atomize_elim, unfold all_conj_distrib[symmetric], intro choice allI) |
|
4639 |
fix k i |
|
4640 |
have "infinite ({n. f n \<in> F k} - {.. i})" |
|
60420 | 4641 |
using \<open>infinite {n. f n \<in> F k}\<close> by auto |
50971 | 4642 |
from infinite_imp_nonempty[OF this] |
4643 |
show "\<exists>x>i. f x \<in> F k" |
|
4644 |
by (simp add: set_eq_iff not_le conj_commute) |
|
4645 |
qed |
|
4646 |
||
55415 | 4647 |
def t \<equiv> "rec_nat (sel 0 0) (\<lambda>n i. sel (Suc n) i)" |
50971 | 4648 |
have "subseq t" |
4649 |
unfolding subseq_Suc_iff by (simp add: t_def sel) |
|
4650 |
moreover have "\<forall>i. (f \<circ> t) i \<in> s" |
|
4651 |
using f by auto |
|
4652 |
moreover |
|
53282 | 4653 |
{ |
4654 |
fix n |
|
4655 |
have "(f \<circ> t) n \<in> F n" |
|
4656 |
by (cases n) (simp_all add: t_def sel) |
|
4657 |
} |
|
50971 | 4658 |
note t = this |
4659 |
||
4660 |
have "Cauchy (f \<circ> t)" |
|
4661 |
proof (safe intro!: metric_CauchyI exI elim!: nat_approx_posE) |
|
53282 | 4662 |
fix r :: real and N n m |
4663 |
assume "1 / Suc N < r" "Suc N \<le> n" "Suc N \<le> m" |
|
50971 | 4664 |
then have "(f \<circ> t) n \<in> F (Suc N)" "(f \<circ> t) m \<in> F (Suc N)" "2 * e N < r" |
4665 |
using F_dec t by (auto simp: e_def field_simps real_of_nat_Suc) |
|
4666 |
with F[of N] obtain x where "dist x ((f \<circ> t) n) < e N" "dist x ((f \<circ> t) m) < e N" |
|
4667 |
by (auto simp: subset_eq) |
|
60420 | 4668 |
with dist_triangle[of "(f \<circ> t) m" "(f \<circ> t) n" x] \<open>2 * e N < r\<close> |
50971 | 4669 |
show "dist ((f \<circ> t) m) ((f \<circ> t) n) < r" |
4670 |
by (simp add: dist_commute) |
|
4671 |
qed |
|
4672 |
||
4673 |
ultimately show "\<exists>l\<in>s. \<exists>r. subseq r \<and> (f \<circ> r) ----> l" |
|
4674 |
using assms unfolding complete_def by blast |
|
4675 |
qed |
|
4676 |
qed |
|
4677 |
qed (metis compact_imp_complete compact_imp_seq_compact seq_compact_imp_totally_bounded) |
|
33175 | 4678 |
|
4679 |
lemma cauchy: "Cauchy s \<longleftrightarrow> (\<forall>e>0.\<exists> N::nat. \<forall>n\<ge>N. dist(s n)(s N) < e)" (is "?lhs = ?rhs") |
|
53282 | 4680 |
proof - |
4681 |
{ |
|
4682 |
assume ?rhs |
|
4683 |
{ |
|
4684 |
fix e::real |
|
33175 | 4685 |
assume "e>0" |
60420 | 4686 |
with \<open>?rhs\<close> obtain N where N:"\<forall>n\<ge>N. dist (s n) (s N) < e/2" |
33175 | 4687 |
by (erule_tac x="e/2" in allE) auto |
53282 | 4688 |
{ |
4689 |
fix n m |
|
33175 | 4690 |
assume nm:"N \<le> m \<and> N \<le> n" |
53282 | 4691 |
then have "dist (s m) (s n) < e" using N |
33175 | 4692 |
using dist_triangle_half_l[of "s m" "s N" "e" "s n"] |
4693 |
by blast |
|
4694 |
} |
|
53282 | 4695 |
then have "\<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (s m) (s n) < e" |
33175 | 4696 |
by blast |
4697 |
} |
|
53282 | 4698 |
then have ?lhs |
33175 | 4699 |
unfolding cauchy_def |
4700 |
by blast |
|
4701 |
} |
|
53282 | 4702 |
then show ?thesis |
33175 | 4703 |
unfolding cauchy_def |
4704 |
using dist_triangle_half_l |
|
4705 |
by blast |
|
4706 |
qed |
|
4707 |
||
53282 | 4708 |
lemma cauchy_imp_bounded: |
4709 |
assumes "Cauchy s" |
|
4710 |
shows "bounded (range s)" |
|
4711 |
proof - |
|
4712 |
from assms obtain N :: nat where "\<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (s m) (s n) < 1" |
|
52624 | 4713 |
unfolding cauchy_def |
4714 |
apply (erule_tac x= 1 in allE) |
|
4715 |
apply auto |
|
4716 |
done |
|
53282 | 4717 |
then have N:"\<forall>n. N \<le> n \<longrightarrow> dist (s N) (s n) < 1" by auto |
33175 | 4718 |
moreover |
52624 | 4719 |
have "bounded (s ` {0..N})" |
4720 |
using finite_imp_bounded[of "s ` {1..N}"] by auto |
|
33175 | 4721 |
then obtain a where a:"\<forall>x\<in>s ` {0..N}. dist (s N) x \<le> a" |
4722 |
unfolding bounded_any_center [where a="s N"] by auto |
|
4723 |
ultimately show "?thesis" |
|
4724 |
unfolding bounded_any_center [where a="s N"] |
|
52624 | 4725 |
apply (rule_tac x="max a 1" in exI) |
4726 |
apply auto |
|
4727 |
apply (erule_tac x=y in allE) |
|
4728 |
apply (erule_tac x=y in ballE) |
|
4729 |
apply auto |
|
4730 |
done |
|
33175 | 4731 |
qed |
4732 |
||
4733 |
instance heine_borel < complete_space |
|
4734 |
proof |
|
4735 |
fix f :: "nat \<Rightarrow> 'a" assume "Cauchy f" |
|
53282 | 4736 |
then have "bounded (range f)" |
34104 | 4737 |
by (rule cauchy_imp_bounded) |
53282 | 4738 |
then have "compact (closure (range f))" |
50971 | 4739 |
unfolding compact_eq_bounded_closed by auto |
53282 | 4740 |
then have "complete (closure (range f))" |
50971 | 4741 |
by (rule compact_imp_complete) |
33175 | 4742 |
moreover have "\<forall>n. f n \<in> closure (range f)" |
4743 |
using closure_subset [of "range f"] by auto |
|
4744 |
ultimately have "\<exists>l\<in>closure (range f). (f ---> l) sequentially" |
|
60420 | 4745 |
using \<open>Cauchy f\<close> unfolding complete_def by auto |
33175 | 4746 |
then show "convergent f" |
36660
1cc4ab4b7ff7
make (X ----> L) an abbreviation for (X ---> L) sequentially
huffman
parents:
36659
diff
changeset
|
4747 |
unfolding convergent_def by auto |
33175 | 4748 |
qed |
4749 |
||
44632 | 4750 |
instance euclidean_space \<subseteq> banach .. |
4751 |
||
54070 | 4752 |
lemma complete_UNIV: "complete (UNIV :: ('a::complete_space) set)" |
4753 |
proof (rule completeI) |
|
4754 |
fix f :: "nat \<Rightarrow> 'a" assume "Cauchy f" |
|
53282 | 4755 |
then have "convergent f" by (rule Cauchy_convergent) |
54070 | 4756 |
then show "\<exists>l\<in>UNIV. f ----> l" unfolding convergent_def by simp |
53282 | 4757 |
qed |
4758 |
||
4759 |
lemma complete_imp_closed: |
|
4760 |
assumes "complete s" |
|
4761 |
shows "closed s" |
|
54070 | 4762 |
proof (unfold closed_sequential_limits, clarify) |
4763 |
fix f x assume "\<forall>n. f n \<in> s" and "f ----> x" |
|
60420 | 4764 |
from \<open>f ----> x\<close> have "Cauchy f" |
54070 | 4765 |
by (rule LIMSEQ_imp_Cauchy) |
60420 | 4766 |
with \<open>complete s\<close> and \<open>\<forall>n. f n \<in> s\<close> obtain l where "l \<in> s" and "f ----> l" |
54070 | 4767 |
by (rule completeE) |
60420 | 4768 |
from \<open>f ----> x\<close> and \<open>f ----> l\<close> have "x = l" |
54070 | 4769 |
by (rule LIMSEQ_unique) |
60420 | 4770 |
with \<open>l \<in> s\<close> show "x \<in> s" |
54070 | 4771 |
by simp |
4772 |
qed |
|
4773 |
||
4774 |
lemma complete_inter_closed: |
|
4775 |
assumes "complete s" and "closed t" |
|
4776 |
shows "complete (s \<inter> t)" |
|
4777 |
proof (rule completeI) |
|
4778 |
fix f assume "\<forall>n. f n \<in> s \<inter> t" and "Cauchy f" |
|
4779 |
then have "\<forall>n. f n \<in> s" and "\<forall>n. f n \<in> t" |
|
4780 |
by simp_all |
|
60420 | 4781 |
from \<open>complete s\<close> obtain l where "l \<in> s" and "f ----> l" |
4782 |
using \<open>\<forall>n. f n \<in> s\<close> and \<open>Cauchy f\<close> by (rule completeE) |
|
4783 |
from \<open>closed t\<close> and \<open>\<forall>n. f n \<in> t\<close> and \<open>f ----> l\<close> have "l \<in> t" |
|
54070 | 4784 |
by (rule closed_sequentially) |
60420 | 4785 |
with \<open>l \<in> s\<close> and \<open>f ----> l\<close> show "\<exists>l\<in>s \<inter> t. f ----> l" |
54070 | 4786 |
by fast |
4787 |
qed |
|
4788 |
||
4789 |
lemma complete_closed_subset: |
|
4790 |
assumes "closed s" and "s \<subseteq> t" and "complete t" |
|
4791 |
shows "complete s" |
|
4792 |
using assms complete_inter_closed [of t s] by (simp add: Int_absorb1) |
|
33175 | 4793 |
|
4794 |
lemma complete_eq_closed: |
|
54070 | 4795 |
fixes s :: "('a::complete_space) set" |
4796 |
shows "complete s \<longleftrightarrow> closed s" |
|
33175 | 4797 |
proof |
54070 | 4798 |
assume "closed s" then show "complete s" |
4799 |
using subset_UNIV complete_UNIV by (rule complete_closed_subset) |
|
33175 | 4800 |
next |
54070 | 4801 |
assume "complete s" then show "closed s" |
4802 |
by (rule complete_imp_closed) |
|
33175 | 4803 |
qed |
4804 |
||
4805 |
lemma convergent_eq_cauchy: |
|
4806 |
fixes s :: "nat \<Rightarrow> 'a::complete_space" |
|
44632 | 4807 |
shows "(\<exists>l. (s ---> l) sequentially) \<longleftrightarrow> Cauchy s" |
4808 |
unfolding Cauchy_convergent_iff convergent_def .. |
|
33175 | 4809 |
|
4810 |
lemma convergent_imp_bounded: |
|
4811 |
fixes s :: "nat \<Rightarrow> 'a::metric_space" |
|
44632 | 4812 |
shows "(s ---> l) sequentially \<Longrightarrow> bounded (range s)" |
50939
ae7cd20ed118
replace convergent_imp_cauchy by LIMSEQ_imp_Cauchy
hoelzl
parents:
50938
diff
changeset
|
4813 |
by (intro cauchy_imp_bounded LIMSEQ_imp_Cauchy) |
33175 | 4814 |
|
4815 |
lemma compact_cball[simp]: |
|
4816 |
fixes x :: "'a::heine_borel" |
|
54070 | 4817 |
shows "compact (cball x e)" |
33175 | 4818 |
using compact_eq_bounded_closed bounded_cball closed_cball |
4819 |
by blast |
|
4820 |
||
4821 |
lemma compact_frontier_bounded[intro]: |
|
4822 |
fixes s :: "'a::heine_borel set" |
|
54070 | 4823 |
shows "bounded s \<Longrightarrow> compact (frontier s)" |
33175 | 4824 |
unfolding frontier_def |
4825 |
using compact_eq_bounded_closed |
|
4826 |
by blast |
|
4827 |
||
4828 |
lemma compact_frontier[intro]: |
|
4829 |
fixes s :: "'a::heine_borel set" |
|
53291 | 4830 |
shows "compact s \<Longrightarrow> compact (frontier s)" |
33175 | 4831 |
using compact_eq_bounded_closed compact_frontier_bounded |
4832 |
by blast |
|
4833 |
||
4834 |
lemma frontier_subset_compact: |
|
4835 |
fixes s :: "'a::heine_borel set" |
|
53291 | 4836 |
shows "compact s \<Longrightarrow> frontier s \<subseteq> s" |
33175 | 4837 |
using frontier_subset_closed compact_eq_bounded_closed |
4838 |
by blast |
|
4839 |
||
60420 | 4840 |
subsection \<open>Bounded closed nest property (proof does not use Heine-Borel)\<close> |
33175 | 4841 |
|
4842 |
lemma bounded_closed_nest: |
|
54070 | 4843 |
fixes s :: "nat \<Rightarrow> ('a::heine_borel) set" |
4844 |
assumes "\<forall>n. closed (s n)" |
|
4845 |
and "\<forall>n. s n \<noteq> {}" |
|
4846 |
and "\<forall>m n. m \<le> n \<longrightarrow> s n \<subseteq> s m" |
|
4847 |
and "bounded (s 0)" |
|
4848 |
shows "\<exists>a. \<forall>n. a \<in> s n" |
|
52624 | 4849 |
proof - |
54070 | 4850 |
from assms(2) obtain x where x: "\<forall>n. x n \<in> s n" |
4851 |
using choice[of "\<lambda>n x. x \<in> s n"] by auto |
|
4852 |
from assms(4,1) have "seq_compact (s 0)" |
|
4853 |
by (simp add: bounded_closed_imp_seq_compact) |
|
4854 |
then obtain l r where lr: "l \<in> s 0" "subseq r" "(x \<circ> r) ----> l" |
|
4855 |
using x and assms(3) unfolding seq_compact_def by blast |
|
4856 |
have "\<forall>n. l \<in> s n" |
|
4857 |
proof |
|
53282 | 4858 |
fix n :: nat |
54070 | 4859 |
have "closed (s n)" |
4860 |
using assms(1) by simp |
|
4861 |
moreover have "\<forall>i. (x \<circ> r) i \<in> s i" |
|
4862 |
using x and assms(3) and lr(2) [THEN seq_suble] by auto |
|
4863 |
then have "\<forall>i. (x \<circ> r) (i + n) \<in> s n" |
|
4864 |
using assms(3) by (fast intro!: le_add2) |
|
4865 |
moreover have "(\<lambda>i. (x \<circ> r) (i + n)) ----> l" |
|
4866 |
using lr(3) by (rule LIMSEQ_ignore_initial_segment) |
|
4867 |
ultimately show "l \<in> s n" |
|
4868 |
by (rule closed_sequentially) |
|
4869 |
qed |
|
4870 |
then show ?thesis .. |
|
33175 | 4871 |
qed |
4872 |
||
60420 | 4873 |
text \<open>Decreasing case does not even need compactness, just completeness.\<close> |
33175 | 4874 |
|
4875 |
lemma decreasing_closed_nest: |
|
54070 | 4876 |
fixes s :: "nat \<Rightarrow> ('a::complete_space) set" |
53282 | 4877 |
assumes |
54070 | 4878 |
"\<forall>n. closed (s n)" |
4879 |
"\<forall>n. s n \<noteq> {}" |
|
4880 |
"\<forall>m n. m \<le> n \<longrightarrow> s n \<subseteq> s m" |
|
4881 |
"\<forall>e>0. \<exists>n. \<forall>x\<in>s n. \<forall>y\<in>s n. dist x y < e" |
|
4882 |
shows "\<exists>a. \<forall>n. a \<in> s n" |
|
4883 |
proof - |
|
4884 |
have "\<forall>n. \<exists>x. x \<in> s n" |
|
53282 | 4885 |
using assms(2) by auto |
4886 |
then have "\<exists>t. \<forall>n. t n \<in> s n" |
|
54070 | 4887 |
using choice[of "\<lambda>n x. x \<in> s n"] by auto |
33175 | 4888 |
then obtain t where t: "\<forall>n. t n \<in> s n" by auto |
53282 | 4889 |
{ |
4890 |
fix e :: real |
|
4891 |
assume "e > 0" |
|
4892 |
then obtain N where N:"\<forall>x\<in>s N. \<forall>y\<in>s N. dist x y < e" |
|
4893 |
using assms(4) by auto |
|
4894 |
{ |
|
4895 |
fix m n :: nat |
|
4896 |
assume "N \<le> m \<and> N \<le> n" |
|
4897 |
then have "t m \<in> s N" "t n \<in> s N" |
|
4898 |
using assms(3) t unfolding subset_eq t by blast+ |
|
4899 |
then have "dist (t m) (t n) < e" |
|
4900 |
using N by auto |
|
33175 | 4901 |
} |
53282 | 4902 |
then have "\<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (t m) (t n) < e" |
4903 |
by auto |
|
33175 | 4904 |
} |
53282 | 4905 |
then have "Cauchy t" |
4906 |
unfolding cauchy_def by auto |
|
4907 |
then obtain l where l:"(t ---> l) sequentially" |
|
54070 | 4908 |
using complete_UNIV unfolding complete_def by auto |
53282 | 4909 |
{ |
4910 |
fix n :: nat |
|
4911 |
{ |
|
4912 |
fix e :: real |
|
4913 |
assume "e > 0" |
|
4914 |
then obtain N :: nat where N: "\<forall>n\<ge>N. dist (t n) l < e" |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59815
diff
changeset
|
4915 |
using l[unfolded lim_sequentially] by auto |
53282 | 4916 |
have "t (max n N) \<in> s n" |
4917 |
using assms(3) |
|
4918 |
unfolding subset_eq |
|
4919 |
apply (erule_tac x=n in allE) |
|
4920 |
apply (erule_tac x="max n N" in allE) |
|
4921 |
using t |
|
4922 |
apply auto |
|
4923 |
done |
|
4924 |
then have "\<exists>y\<in>s n. dist y l < e" |
|
4925 |
apply (rule_tac x="t (max n N)" in bexI) |
|
4926 |
using N |
|
4927 |
apply auto |
|
4928 |
done |
|
33175 | 4929 |
} |
53282 | 4930 |
then have "l \<in> s n" |
4931 |
using closed_approachable[of "s n" l] assms(1) by auto |
|
33175 | 4932 |
} |
4933 |
then show ?thesis by auto |
|
4934 |
qed |
|
4935 |
||
60420 | 4936 |
text \<open>Strengthen it to the intersection actually being a singleton.\<close> |
33175 | 4937 |
|
4938 |
lemma decreasing_closed_nest_sing: |
|
44632 | 4939 |
fixes s :: "nat \<Rightarrow> 'a::complete_space set" |
53282 | 4940 |
assumes |
4941 |
"\<forall>n. closed(s n)" |
|
4942 |
"\<forall>n. s n \<noteq> {}" |
|
54070 | 4943 |
"\<forall>m n. m \<le> n \<longrightarrow> s n \<subseteq> s m" |
53282 | 4944 |
"\<forall>e>0. \<exists>n. \<forall>x \<in> (s n). \<forall> y\<in>(s n). dist x y < e" |
34104 | 4945 |
shows "\<exists>a. \<Inter>(range s) = {a}" |
53282 | 4946 |
proof - |
4947 |
obtain a where a: "\<forall>n. a \<in> s n" |
|
4948 |
using decreasing_closed_nest[of s] using assms by auto |
|
4949 |
{ |
|
4950 |
fix b |
|
4951 |
assume b: "b \<in> \<Inter>(range s)" |
|
4952 |
{ |
|
4953 |
fix e :: real |
|
4954 |
assume "e > 0" |
|
4955 |
then have "dist a b < e" |
|
4956 |
using assms(4) and b and a by blast |
|
33175 | 4957 |
} |
53282 | 4958 |
then have "dist a b = 0" |
4959 |
by (metis dist_eq_0_iff dist_nz less_le) |
|
33175 | 4960 |
} |
53282 | 4961 |
with a have "\<Inter>(range s) = {a}" |
4962 |
unfolding image_def by auto |
|
4963 |
then show ?thesis .. |
|
33175 | 4964 |
qed |
4965 |
||
60420 | 4966 |
text\<open>Cauchy-type criteria for uniform convergence.\<close> |
33175 | 4967 |
|
53282 | 4968 |
lemma uniformly_convergent_eq_cauchy: |
4969 |
fixes s::"nat \<Rightarrow> 'b \<Rightarrow> 'a::complete_space" |
|
4970 |
shows |
|
53291 | 4971 |
"(\<exists>l. \<forall>e>0. \<exists>N. \<forall>n x. N \<le> n \<and> P x \<longrightarrow> dist(s n x)(l x) < e) \<longleftrightarrow> |
4972 |
(\<forall>e>0. \<exists>N. \<forall>m n x. N \<le> m \<and> N \<le> n \<and> P x \<longrightarrow> dist (s m x) (s n x) < e)" |
|
53282 | 4973 |
(is "?lhs = ?rhs") |
4974 |
proof |
|
33175 | 4975 |
assume ?lhs |
53282 | 4976 |
then obtain l where l:"\<forall>e>0. \<exists>N. \<forall>n x. N \<le> n \<and> P x \<longrightarrow> dist (s n x) (l x) < e" |
4977 |
by auto |
|
4978 |
{ |
|
4979 |
fix e :: real |
|
4980 |
assume "e > 0" |
|
4981 |
then obtain N :: nat where N: "\<forall>n x. N \<le> n \<and> P x \<longrightarrow> dist (s n x) (l x) < e / 2" |
|
4982 |
using l[THEN spec[where x="e/2"]] by auto |
|
4983 |
{ |
|
4984 |
fix n m :: nat and x :: "'b" |
|
4985 |
assume "N \<le> m \<and> N \<le> n \<and> P x" |
|
4986 |
then have "dist (s m x) (s n x) < e" |
|
33175 | 4987 |
using N[THEN spec[where x=m], THEN spec[where x=x]] |
4988 |
using N[THEN spec[where x=n], THEN spec[where x=x]] |
|
53282 | 4989 |
using dist_triangle_half_l[of "s m x" "l x" e "s n x"] by auto |
4990 |
} |
|
4991 |
then have "\<exists>N. \<forall>m n x. N \<le> m \<and> N \<le> n \<and> P x --> dist (s m x) (s n x) < e" by auto |
|
4992 |
} |
|
4993 |
then show ?rhs by auto |
|
33175 | 4994 |
next |
4995 |
assume ?rhs |
|
53282 | 4996 |
then have "\<forall>x. P x \<longrightarrow> Cauchy (\<lambda>n. s n x)" |
4997 |
unfolding cauchy_def |
|
4998 |
apply auto |
|
4999 |
apply (erule_tac x=e in allE) |
|
5000 |
apply auto |
|
5001 |
done |
|
5002 |
then obtain l where l: "\<forall>x. P x \<longrightarrow> ((\<lambda>n. s n x) ---> l x) sequentially" |
|
53291 | 5003 |
unfolding convergent_eq_cauchy[symmetric] |
53282 | 5004 |
using choice[of "\<lambda>x l. P x \<longrightarrow> ((\<lambda>n. s n x) ---> l) sequentially"] |
5005 |
by auto |
|
5006 |
{ |
|
5007 |
fix e :: real |
|
5008 |
assume "e > 0" |
|
33175 | 5009 |
then obtain N where N:"\<forall>m n x. N \<le> m \<and> N \<le> n \<and> P x \<longrightarrow> dist (s m x) (s n x) < e/2" |
60420 | 5010 |
using \<open>?rhs\<close>[THEN spec[where x="e/2"]] by auto |
53282 | 5011 |
{ |
5012 |
fix x |
|
5013 |
assume "P x" |
|
33175 | 5014 |
then obtain M where M:"\<forall>n\<ge>M. dist (s n x) (l x) < e/2" |
60420 | 5015 |
using l[THEN spec[where x=x], unfolded lim_sequentially] and \<open>e > 0\<close> |
53282 | 5016 |
by (auto elim!: allE[where x="e/2"]) |
5017 |
fix n :: nat |
|
5018 |
assume "n \<ge> N" |
|
5019 |
then have "dist(s n x)(l x) < e" |
|
60420 | 5020 |
using \<open>P x\<close>and N[THEN spec[where x=n], THEN spec[where x="N+M"], THEN spec[where x=x]] |
53282 | 5021 |
using M[THEN spec[where x="N+M"]] and dist_triangle_half_l[of "s n x" "s (N+M) x" e "l x"] |
5022 |
by (auto simp add: dist_commute) |
|
5023 |
} |
|
5024 |
then have "\<exists>N. \<forall>n x. N \<le> n \<and> P x \<longrightarrow> dist(s n x)(l x) < e" |
|
5025 |
by auto |
|
5026 |
} |
|
5027 |
then show ?lhs by auto |
|
33175 | 5028 |
qed |
5029 |
||
5030 |
lemma uniformly_cauchy_imp_uniformly_convergent: |
|
51102 | 5031 |
fixes s :: "nat \<Rightarrow> 'a \<Rightarrow> 'b::complete_space" |
33175 | 5032 |
assumes "\<forall>e>0.\<exists>N. \<forall>m (n::nat) x. N \<le> m \<and> N \<le> n \<and> P x --> dist(s m x)(s n x) < e" |
53291 | 5033 |
and "\<forall>x. P x --> (\<forall>e>0. \<exists>N. \<forall>n. N \<le> n \<longrightarrow> dist(s n x)(l x) < e)" |
5034 |
shows "\<forall>e>0. \<exists>N. \<forall>n x. N \<le> n \<and> P x \<longrightarrow> dist(s n x)(l x) < e" |
|
53282 | 5035 |
proof - |
33175 | 5036 |
obtain l' where l:"\<forall>e>0. \<exists>N. \<forall>n x. N \<le> n \<and> P x \<longrightarrow> dist (s n x) (l' x) < e" |
53291 | 5037 |
using assms(1) unfolding uniformly_convergent_eq_cauchy[symmetric] by auto |
33175 | 5038 |
moreover |
53282 | 5039 |
{ |
5040 |
fix x |
|
5041 |
assume "P x" |
|
5042 |
then have "l x = l' x" |
|
5043 |
using tendsto_unique[OF trivial_limit_sequentially, of "\<lambda>n. s n x" "l x" "l' x"] |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59815
diff
changeset
|
5044 |
using l and assms(2) unfolding lim_sequentially by blast |
53282 | 5045 |
} |
33175 | 5046 |
ultimately show ?thesis by auto |
5047 |
qed |
|
5048 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
5049 |
|
60420 | 5050 |
subsection \<open>Continuity\<close> |
5051 |
||
5052 |
text\<open>Derive the epsilon-delta forms, which we often use as "definitions"\<close> |
|
33175 | 5053 |
|
5054 |
lemma continuous_within_eps_delta: |
|
5055 |
"continuous (at x within s) f \<longleftrightarrow> (\<forall>e>0. \<exists>d>0. \<forall>x'\<in> s. dist x' x < d --> dist (f x') (f x) < e)" |
|
5056 |
unfolding continuous_within and Lim_within |
|
53282 | 5057 |
apply auto |
55775 | 5058 |
apply (metis dist_nz dist_self) |
5059 |
apply blast |
|
53282 | 5060 |
done |
5061 |
||
5062 |
lemma continuous_at_eps_delta: |
|
5063 |
"continuous (at x) f \<longleftrightarrow> (\<forall>e > 0. \<exists>d > 0. \<forall>x'. dist x' x < d \<longrightarrow> dist (f x') (f x) < e)" |
|
45031 | 5064 |
using continuous_within_eps_delta [of x UNIV f] by simp |
33175 | 5065 |
|
57447
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57418
diff
changeset
|
5066 |
lemma continuous_at_right_real_increasing: |
57448
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
5067 |
fixes f :: "real \<Rightarrow> real" |
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
5068 |
assumes nondecF: "\<And>x y. x \<le> y \<Longrightarrow> f x \<le> f y" |
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
5069 |
shows "continuous (at_right a) f \<longleftrightarrow> (\<forall>e>0. \<exists>d>0. f (a + d) - f a < e)" |
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
5070 |
apply (simp add: greaterThan_def dist_real_def continuous_within Lim_within_le) |
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
5071 |
apply (intro all_cong ex_cong) |
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
5072 |
apply safe |
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
5073 |
apply (erule_tac x="a + d" in allE) |
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
5074 |
apply simp |
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
5075 |
apply (simp add: nondecF field_simps) |
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
5076 |
apply (drule nondecF) |
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
5077 |
apply simp |
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
5078 |
done |
57447
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57418
diff
changeset
|
5079 |
|
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57418
diff
changeset
|
5080 |
lemma continuous_at_left_real_increasing: |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57418
diff
changeset
|
5081 |
assumes nondecF: "\<And> x y. x \<le> y \<Longrightarrow> f x \<le> ((f y) :: real)" |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57418
diff
changeset
|
5082 |
shows "(continuous (at_left (a :: real)) f) = (\<forall>e > 0. \<exists>delta > 0. f a - f (a - delta) < e)" |
57448
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
5083 |
apply (simp add: lessThan_def dist_real_def continuous_within Lim_within_le) |
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
5084 |
apply (intro all_cong ex_cong) |
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
5085 |
apply safe |
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
5086 |
apply (erule_tac x="a - d" in allE) |
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
5087 |
apply simp |
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
5088 |
apply (simp add: nondecF field_simps) |
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
5089 |
apply (cut_tac x="a - d" and y="x" in nondecF) |
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
5090 |
apply simp_all |
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
5091 |
done |
57447
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57418
diff
changeset
|
5092 |
|
60420 | 5093 |
text\<open>Versions in terms of open balls.\<close> |
33175 | 5094 |
|
5095 |
lemma continuous_within_ball: |
|
53282 | 5096 |
"continuous (at x within s) f \<longleftrightarrow> |
5097 |
(\<forall>e > 0. \<exists>d > 0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e)" |
|
5098 |
(is "?lhs = ?rhs") |
|
33175 | 5099 |
proof |
5100 |
assume ?lhs |
|
53282 | 5101 |
{ |
5102 |
fix e :: real |
|
5103 |
assume "e > 0" |
|
33175 | 5104 |
then obtain d where d: "d>0" "\<forall>xa\<in>s. 0 < dist xa x \<and> dist xa x < d \<longrightarrow> dist (f xa) (f x) < e" |
60420 | 5105 |
using \<open>?lhs\<close>[unfolded continuous_within Lim_within] by auto |
53282 | 5106 |
{ |
5107 |
fix y |
|
5108 |
assume "y \<in> f ` (ball x d \<inter> s)" |
|
5109 |
then have "y \<in> ball (f x) e" |
|
5110 |
using d(2) |
|
53291 | 5111 |
unfolding dist_nz[symmetric] |
53282 | 5112 |
apply (auto simp add: dist_commute) |
5113 |
apply (erule_tac x=xa in ballE) |
|
5114 |
apply auto |
|
60420 | 5115 |
using \<open>e > 0\<close> |
53282 | 5116 |
apply auto |
5117 |
done |
|
33175 | 5118 |
} |
53282 | 5119 |
then have "\<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e" |
60420 | 5120 |
using \<open>d > 0\<close> |
53282 | 5121 |
unfolding subset_eq ball_def by (auto simp add: dist_commute) |
5122 |
} |
|
5123 |
then show ?rhs by auto |
|
33175 | 5124 |
next |
53282 | 5125 |
assume ?rhs |
5126 |
then show ?lhs |
|
5127 |
unfolding continuous_within Lim_within ball_def subset_eq |
|
5128 |
apply (auto simp add: dist_commute) |
|
5129 |
apply (erule_tac x=e in allE) |
|
61306
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
5130 |
apply auto |
53282 | 5131 |
done |
33175 | 5132 |
qed |
5133 |
||
5134 |
lemma continuous_at_ball: |
|
5135 |
"continuous (at x) f \<longleftrightarrow> (\<forall>e>0. \<exists>d>0. f ` (ball x d) \<subseteq> ball (f x) e)" (is "?lhs = ?rhs") |
|
5136 |
proof |
|
53282 | 5137 |
assume ?lhs |
5138 |
then show ?rhs |
|
5139 |
unfolding continuous_at Lim_at subset_eq Ball_def Bex_def image_iff mem_ball |
|
5140 |
apply auto |
|
5141 |
apply (erule_tac x=e in allE) |
|
5142 |
apply auto |
|
5143 |
apply (rule_tac x=d in exI) |
|
5144 |
apply auto |
|
5145 |
apply (erule_tac x=xa in allE) |
|
5146 |
apply (auto simp add: dist_commute dist_nz) |
|
53291 | 5147 |
unfolding dist_nz[symmetric] |
53282 | 5148 |
apply auto |
5149 |
done |
|
33175 | 5150 |
next |
53282 | 5151 |
assume ?rhs |
5152 |
then show ?lhs |
|
5153 |
unfolding continuous_at Lim_at subset_eq Ball_def Bex_def image_iff mem_ball |
|
5154 |
apply auto |
|
5155 |
apply (erule_tac x=e in allE) |
|
5156 |
apply auto |
|
5157 |
apply (rule_tac x=d in exI) |
|
5158 |
apply auto |
|
5159 |
apply (erule_tac x="f xa" in allE) |
|
5160 |
apply (auto simp add: dist_commute dist_nz) |
|
5161 |
done |
|
33175 | 5162 |
qed |
5163 |
||
60420 | 5164 |
text\<open>Define setwise continuity in terms of limits within the set.\<close> |
33175 | 5165 |
|
36359 | 5166 |
lemma continuous_on_iff: |
5167 |
"continuous_on s f \<longleftrightarrow> |
|
36440
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
5168 |
(\<forall>x\<in>s. \<forall>e>0. \<exists>d>0. \<forall>x'\<in>s. dist x' x < d \<longrightarrow> dist (f x') (f x) < e)" |
53282 | 5169 |
unfolding continuous_on_def Lim_within |
55775 | 5170 |
by (metis dist_pos_lt dist_self) |
53282 | 5171 |
|
5172 |
definition uniformly_continuous_on :: "'a set \<Rightarrow> ('a::metric_space \<Rightarrow> 'b::metric_space) \<Rightarrow> bool" |
|
5173 |
where "uniformly_continuous_on s f \<longleftrightarrow> |
|
36440
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
5174 |
(\<forall>e>0. \<exists>d>0. \<forall>x\<in>s. \<forall>x'\<in>s. dist x' x < d \<longrightarrow> dist (f x') (f x) < e)" |
35172
579dd5570f96
Added integration to Multivariate-Analysis (upto FTC)
himmelma
parents:
35028
diff
changeset
|
5175 |
|
60420 | 5176 |
text\<open>Some simple consequential lemmas.\<close> |
33175 | 5177 |
|
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
5178 |
lemma continuous_onD: |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
5179 |
assumes "continuous_on s f" "x\<in>s" "e>0" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
5180 |
obtains d where "d>0" "\<And>x'. \<lbrakk>x' \<in> s; dist x' x < d\<rbrakk> \<Longrightarrow> dist (f x') (f x) < e" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
5181 |
using assms [unfolded continuous_on_iff] by blast |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
5182 |
|
60974
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
5183 |
lemma uniformly_continuous_onE: |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
5184 |
assumes "uniformly_continuous_on s f" "0 < e" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
5185 |
obtains d where "d>0" "\<And>x x'. \<lbrakk>x\<in>s; x'\<in>s; dist x' x < d\<rbrakk> \<Longrightarrow> dist (f x') (f x) < e" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
5186 |
using assms |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
5187 |
by (auto simp: uniformly_continuous_on_def) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
5188 |
|
33175 | 5189 |
lemma uniformly_continuous_imp_continuous: |
53282 | 5190 |
"uniformly_continuous_on s f \<Longrightarrow> continuous_on s f" |
36359 | 5191 |
unfolding uniformly_continuous_on_def continuous_on_iff by blast |
33175 | 5192 |
|
5193 |
lemma continuous_at_imp_continuous_within: |
|
53282 | 5194 |
"continuous (at x) f \<Longrightarrow> continuous (at x within s) f" |
60762 | 5195 |
unfolding continuous_within continuous_at using Lim_at_imp_Lim_at_within by auto |
33175 | 5196 |
|
36440
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
5197 |
lemma Lim_trivial_limit: "trivial_limit net \<Longrightarrow> (f ---> l) net" |
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:
51475
diff
changeset
|
5198 |
by simp |
36440
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
5199 |
|
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
5200 |
lemmas continuous_on = continuous_on_def -- "legacy theorem name" |
33175 | 5201 |
|
5202 |
lemma continuous_within_subset: |
|
53282 | 5203 |
"continuous (at x within s) f \<Longrightarrow> t \<subseteq> s \<Longrightarrow> continuous (at x within t) f" |
51641
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents:
51530
diff
changeset
|
5204 |
unfolding continuous_within by(metis tendsto_within_subset) |
33175 | 5205 |
|
5206 |
lemma continuous_on_interior: |
|
53282 | 5207 |
"continuous_on s f \<Longrightarrow> x \<in> interior s \<Longrightarrow> continuous (at x) f" |
55775 | 5208 |
by (metis continuous_on_eq_continuous_at continuous_on_subset interiorE) |
33175 | 5209 |
|
5210 |
lemma continuous_on_eq: |
|
61204 | 5211 |
"\<lbrakk>continuous_on s f; \<And>x. x \<in> s \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> continuous_on s g" |
51641
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents:
51530
diff
changeset
|
5212 |
unfolding continuous_on_def tendsto_def eventually_at_topological |
36440
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
5213 |
by simp |
33175 | 5214 |
|
60420 | 5215 |
text \<open>Characterization of various kinds of continuity in terms of sequences.\<close> |
33175 | 5216 |
|
5217 |
lemma continuous_within_sequentially: |
|
44533
7abe4a59f75d
generalize and simplify proof of continuous_within_sequentially
huffman
parents:
44531
diff
changeset
|
5218 |
fixes f :: "'a::metric_space \<Rightarrow> 'b::topological_space" |
33175 | 5219 |
shows "continuous (at a within s) f \<longleftrightarrow> |
53282 | 5220 |
(\<forall>x. (\<forall>n::nat. x n \<in> s) \<and> (x ---> a) sequentially |
53640 | 5221 |
\<longrightarrow> ((f \<circ> x) ---> f a) sequentially)" |
53282 | 5222 |
(is "?lhs = ?rhs") |
33175 | 5223 |
proof |
5224 |
assume ?lhs |
|
53282 | 5225 |
{ |
5226 |
fix x :: "nat \<Rightarrow> 'a" |
|
5227 |
assume x: "\<forall>n. x n \<in> s" "\<forall>e>0. eventually (\<lambda>n. dist (x n) a < e) sequentially" |
|
5228 |
fix T :: "'b set" |
|
5229 |
assume "open T" and "f a \<in> T" |
|
60420 | 5230 |
with \<open>?lhs\<close> obtain d where "d>0" and d:"\<forall>x\<in>s. 0 < dist x a \<and> dist x a < d \<longrightarrow> f x \<in> T" |
51641
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents:
51530
diff
changeset
|
5231 |
unfolding continuous_within tendsto_def eventually_at by (auto simp: dist_nz) |
44533
7abe4a59f75d
generalize and simplify proof of continuous_within_sequentially
huffman
parents:
44531
diff
changeset
|
5232 |
have "eventually (\<lambda>n. dist (x n) a < d) sequentially" |
60420 | 5233 |
using x(2) \<open>d>0\<close> by simp |
53282 | 5234 |
then have "eventually (\<lambda>n. (f \<circ> x) n \<in> T) sequentially" |
46887 | 5235 |
proof eventually_elim |
53282 | 5236 |
case (elim n) |
5237 |
then show ?case |
|
60420 | 5238 |
using d x(1) \<open>f a \<in> T\<close> unfolding dist_nz[symmetric] by auto |
44533
7abe4a59f75d
generalize and simplify proof of continuous_within_sequentially
huffman
parents:
44531
diff
changeset
|
5239 |
qed |
33175 | 5240 |
} |
53282 | 5241 |
then show ?rhs |
5242 |
unfolding tendsto_iff tendsto_def by simp |
|
33175 | 5243 |
next |
53282 | 5244 |
assume ?rhs |
5245 |
then show ?lhs |
|
44533
7abe4a59f75d
generalize and simplify proof of continuous_within_sequentially
huffman
parents:
44531
diff
changeset
|
5246 |
unfolding continuous_within tendsto_def [where l="f a"] |
7abe4a59f75d
generalize and simplify proof of continuous_within_sequentially
huffman
parents:
44531
diff
changeset
|
5247 |
by (simp add: sequentially_imp_eventually_within) |
33175 | 5248 |
qed |
5249 |
||
5250 |
lemma continuous_at_sequentially: |
|
44533
7abe4a59f75d
generalize and simplify proof of continuous_within_sequentially
huffman
parents:
44531
diff
changeset
|
5251 |
fixes f :: "'a::metric_space \<Rightarrow> 'b::topological_space" |
53291 | 5252 |
shows "continuous (at a) f \<longleftrightarrow> |
53640 | 5253 |
(\<forall>x. (x ---> a) sequentially --> ((f \<circ> x) ---> f a) sequentially)" |
45031 | 5254 |
using continuous_within_sequentially[of a UNIV f] by simp |
33175 | 5255 |
|
5256 |
lemma continuous_on_sequentially: |
|
44533
7abe4a59f75d
generalize and simplify proof of continuous_within_sequentially
huffman
parents:
44531
diff
changeset
|
5257 |
fixes f :: "'a::metric_space \<Rightarrow> 'b::topological_space" |
36359 | 5258 |
shows "continuous_on s f \<longleftrightarrow> |
5259 |
(\<forall>x. \<forall>a \<in> s. (\<forall>n. x(n) \<in> s) \<and> (x ---> a) sequentially |
|
53640 | 5260 |
--> ((f \<circ> x) ---> f a) sequentially)" |
53291 | 5261 |
(is "?lhs = ?rhs") |
33175 | 5262 |
proof |
53282 | 5263 |
assume ?rhs |
5264 |
then show ?lhs |
|
5265 |
using continuous_within_sequentially[of _ s f] |
|
5266 |
unfolding continuous_on_eq_continuous_within |
|
5267 |
by auto |
|
33175 | 5268 |
next |
53282 | 5269 |
assume ?lhs |
5270 |
then show ?rhs |
|
5271 |
unfolding continuous_on_eq_continuous_within |
|
5272 |
using continuous_within_sequentially[of _ s f] |
|
5273 |
by auto |
|
33175 | 5274 |
qed |
5275 |
||
44648
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5276 |
lemma uniformly_continuous_on_sequentially: |
36441 | 5277 |
"uniformly_continuous_on s f \<longleftrightarrow> (\<forall>x y. (\<forall>n. x n \<in> s) \<and> (\<forall>n. y n \<in> s) \<and> |
5278 |
((\<lambda>n. dist (x n) (y n)) ---> 0) sequentially |
|
5279 |
\<longrightarrow> ((\<lambda>n. dist (f(x n)) (f(y n))) ---> 0) sequentially)" (is "?lhs = ?rhs") |
|
33175 | 5280 |
proof |
5281 |
assume ?lhs |
|
53282 | 5282 |
{ |
5283 |
fix x y |
|
5284 |
assume x: "\<forall>n. x n \<in> s" |
|
5285 |
and y: "\<forall>n. y n \<in> s" |
|
5286 |
and xy: "((\<lambda>n. dist (x n) (y n)) ---> 0) sequentially" |
|
5287 |
{ |
|
5288 |
fix e :: real |
|
5289 |
assume "e > 0" |
|
5290 |
then obtain d where "d > 0" and d: "\<forall>x\<in>s. \<forall>x'\<in>s. dist x' x < d \<longrightarrow> dist (f x') (f x) < e" |
|
60420 | 5291 |
using \<open>?lhs\<close>[unfolded uniformly_continuous_on_def, THEN spec[where x=e]] by auto |
53282 | 5292 |
obtain N where N: "\<forall>n\<ge>N. dist (x n) (y n) < d" |
60420 | 5293 |
using xy[unfolded lim_sequentially dist_norm] and \<open>d>0\<close> by auto |
53282 | 5294 |
{ |
5295 |
fix n |
|
5296 |
assume "n\<ge>N" |
|
5297 |
then have "dist (f (x n)) (f (y n)) < e" |
|
5298 |
using N[THEN spec[where x=n]] |
|
5299 |
using d[THEN bspec[where x="x n"], THEN bspec[where x="y n"]] |
|
5300 |
using x and y |
|
5301 |
unfolding dist_commute |
|
5302 |
by simp |
|
5303 |
} |
|
5304 |
then have "\<exists>N. \<forall>n\<ge>N. dist (f (x n)) (f (y n)) < e" |
|
5305 |
by auto |
|
5306 |
} |
|
5307 |
then have "((\<lambda>n. dist (f(x n)) (f(y n))) ---> 0) sequentially" |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59815
diff
changeset
|
5308 |
unfolding lim_sequentially and dist_real_def by auto |
53282 | 5309 |
} |
5310 |
then show ?rhs by auto |
|
33175 | 5311 |
next |
5312 |
assume ?rhs |
|
53282 | 5313 |
{ |
5314 |
assume "\<not> ?lhs" |
|
5315 |
then obtain e where "e > 0" "\<forall>d>0. \<exists>x\<in>s. \<exists>x'\<in>s. dist x' x < d \<and> \<not> dist (f x') (f x) < e" |
|
5316 |
unfolding uniformly_continuous_on_def by auto |
|
5317 |
then obtain fa where fa: |
|
5318 |
"\<forall>x. 0 < x \<longrightarrow> fst (fa x) \<in> s \<and> snd (fa x) \<in> s \<and> dist (fst (fa x)) (snd (fa x)) < x \<and> \<not> dist (f (fst (fa x))) (f (snd (fa x))) < e" |
|
5319 |
using choice[of "\<lambda>d x. d>0 \<longrightarrow> fst x \<in> s \<and> snd x \<in> s \<and> dist (snd x) (fst x) < d \<and> \<not> dist (f (snd x)) (f (fst x)) < e"] |
|
5320 |
unfolding Bex_def |
|
33175 | 5321 |
by (auto simp add: dist_commute) |
5322 |
def x \<equiv> "\<lambda>n::nat. fst (fa (inverse (real n + 1)))" |
|
5323 |
def y \<equiv> "\<lambda>n::nat. snd (fa (inverse (real n + 1)))" |
|
53282 | 5324 |
have xyn: "\<forall>n. x n \<in> s \<and> y n \<in> s" |
5325 |
and xy0: "\<forall>n. dist (x n) (y n) < inverse (real n + 1)" |
|
5326 |
and fxy:"\<forall>n. \<not> dist (f (x n)) (f (y n)) < e" |
|
5327 |
unfolding x_def and y_def using fa |
|
5328 |
by auto |
|
5329 |
{ |
|
5330 |
fix e :: real |
|
5331 |
assume "e > 0" |
|
5332 |
then obtain N :: nat where "N \<noteq> 0" and N: "0 < inverse (real N) \<and> inverse (real N) < e" |
|
5333 |
unfolding real_arch_inv[of e] by auto |
|
5334 |
{ |
|
5335 |
fix n :: nat |
|
5336 |
assume "n \<ge> N" |
|
5337 |
then have "inverse (real n + 1) < inverse (real N)" |
|
60420 | 5338 |
using real_of_nat_ge_zero and \<open>N\<noteq>0\<close> by auto |
33175 | 5339 |
also have "\<dots> < e" using N by auto |
5340 |
finally have "inverse (real n + 1) < e" by auto |
|
53282 | 5341 |
then have "dist (x n) (y n) < e" |
5342 |
using xy0[THEN spec[where x=n]] by auto |
|
5343 |
} |
|
5344 |
then have "\<exists>N. \<forall>n\<ge>N. dist (x n) (y n) < e" by auto |
|
5345 |
} |
|
5346 |
then have "\<forall>e>0. \<exists>N. \<forall>n\<ge>N. dist (f (x n)) (f (y n)) < e" |
|
60420 | 5347 |
using \<open>?rhs\<close>[THEN spec[where x=x], THEN spec[where x=y]] and xyn |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59815
diff
changeset
|
5348 |
unfolding lim_sequentially dist_real_def by auto |
60420 | 5349 |
then have False using fxy and \<open>e>0\<close> by auto |
53282 | 5350 |
} |
5351 |
then show ?lhs |
|
5352 |
unfolding uniformly_continuous_on_def by blast |
|
33175 | 5353 |
qed |
5354 |
||
60420 | 5355 |
text\<open>The usual transformation theorems.\<close> |
33175 | 5356 |
|
5357 |
lemma continuous_transform_within: |
|
36667 | 5358 |
fixes f g :: "'a::metric_space \<Rightarrow> 'b::topological_space" |
53282 | 5359 |
assumes "0 < d" |
5360 |
and "x \<in> s" |
|
5361 |
and "\<forall>x' \<in> s. dist x' x < d --> f x' = g x'" |
|
5362 |
and "continuous (at x within s) f" |
|
33175 | 5363 |
shows "continuous (at x within s) g" |
53282 | 5364 |
unfolding continuous_within |
36667 | 5365 |
proof (rule Lim_transform_within) |
5366 |
show "0 < d" by fact |
|
5367 |
show "\<forall>x'\<in>s. 0 < dist x' x \<and> dist x' x < d \<longrightarrow> f x' = g x'" |
|
5368 |
using assms(3) by auto |
|
5369 |
have "f x = g x" |
|
5370 |
using assms(1,2,3) by auto |
|
53282 | 5371 |
then show "(f ---> g x) (at x within s)" |
36667 | 5372 |
using assms(4) unfolding continuous_within by simp |
33175 | 5373 |
qed |
5374 |
||
5375 |
lemma continuous_transform_at: |
|
36667 | 5376 |
fixes f g :: "'a::metric_space \<Rightarrow> 'b::topological_space" |
53282 | 5377 |
assumes "0 < d" |
5378 |
and "\<forall>x'. dist x' x < d --> f x' = g x'" |
|
5379 |
and "continuous (at x) f" |
|
33175 | 5380 |
shows "continuous (at x) g" |
45031 | 5381 |
using continuous_transform_within [of d x UNIV f g] assms by simp |
33175 | 5382 |
|
53282 | 5383 |
|
60420 | 5384 |
subsubsection \<open>Structural rules for pointwise continuity\<close> |
33175 | 5385 |
|
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:
51475
diff
changeset
|
5386 |
lemmas continuous_within_id = continuous_ident |
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:
51475
diff
changeset
|
5387 |
|
60150
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5388 |
lemmas continuous_at_id = continuous_ident |
44647
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
5389 |
|
51361
21e5b6efb317
changed continuous_intros into a named theorems collection
hoelzl
parents:
51351
diff
changeset
|
5390 |
lemma continuous_infdist[continuous_intros]: |
50087 | 5391 |
assumes "continuous F f" |
5392 |
shows "continuous F (\<lambda>x. infdist (f x) A)" |
|
5393 |
using assms unfolding continuous_def by (rule tendsto_infdist) |
|
5394 |
||
51361
21e5b6efb317
changed continuous_intros into a named theorems collection
hoelzl
parents:
51351
diff
changeset
|
5395 |
lemma continuous_infnorm[continuous_intros]: |
53282 | 5396 |
"continuous F f \<Longrightarrow> continuous F (\<lambda>x. infnorm (f x))" |
44647
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
5397 |
unfolding continuous_def by (rule tendsto_infnorm) |
33175 | 5398 |
|
51361
21e5b6efb317
changed continuous_intros into a named theorems collection
hoelzl
parents:
51351
diff
changeset
|
5399 |
lemma continuous_inner[continuous_intros]: |
53282 | 5400 |
assumes "continuous F f" |
5401 |
and "continuous F g" |
|
44647
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
5402 |
shows "continuous F (\<lambda>x. inner (f x) (g x))" |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
5403 |
using assms unfolding continuous_def by (rule tendsto_inner) |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
5404 |
|
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:
51475
diff
changeset
|
5405 |
lemmas continuous_at_inverse = isCont_inverse |
44647
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
5406 |
|
60420 | 5407 |
subsubsection \<open>Structural rules for setwise continuity\<close> |
33175 | 5408 |
|
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56290
diff
changeset
|
5409 |
lemma continuous_on_infnorm[continuous_intros]: |
53282 | 5410 |
"continuous_on s f \<Longrightarrow> continuous_on s (\<lambda>x. infnorm (f x))" |
44647
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
5411 |
unfolding continuous_on by (fast intro: tendsto_infnorm) |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
5412 |
|
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56290
diff
changeset
|
5413 |
lemma continuous_on_inner[continuous_intros]: |
44531
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
5414 |
fixes g :: "'a::topological_space \<Rightarrow> 'b::real_inner" |
53282 | 5415 |
assumes "continuous_on s f" |
5416 |
and "continuous_on s g" |
|
44531
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
5417 |
shows "continuous_on s (\<lambda>x. inner (f x) (g x))" |
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
5418 |
using bounded_bilinear_inner assms |
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
5419 |
by (rule bounded_bilinear.continuous_on) |
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
5420 |
|
60420 | 5421 |
subsubsection \<open>Structural rules for uniform continuity\<close> |
33175 | 5422 |
|
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56290
diff
changeset
|
5423 |
lemma uniformly_continuous_on_id[continuous_intros]: |
53282 | 5424 |
"uniformly_continuous_on s (\<lambda>x. x)" |
44647
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
5425 |
unfolding uniformly_continuous_on_def by auto |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
5426 |
|
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56290
diff
changeset
|
5427 |
lemma uniformly_continuous_on_const[continuous_intros]: |
53282 | 5428 |
"uniformly_continuous_on s (\<lambda>x. c)" |
33175 | 5429 |
unfolding uniformly_continuous_on_def by simp |
5430 |
||
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56290
diff
changeset
|
5431 |
lemma uniformly_continuous_on_dist[continuous_intros]: |
44648
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5432 |
fixes f g :: "'a::metric_space \<Rightarrow> 'b::metric_space" |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5433 |
assumes "uniformly_continuous_on s f" |
53282 | 5434 |
and "uniformly_continuous_on s g" |
44648
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5435 |
shows "uniformly_continuous_on s (\<lambda>x. dist (f x) (g x))" |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5436 |
proof - |
53282 | 5437 |
{ |
5438 |
fix a b c d :: 'b |
|
5439 |
have "\<bar>dist a b - dist c d\<bar> \<le> dist a c + dist b d" |
|
44648
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5440 |
using dist_triangle2 [of a b c] dist_triangle2 [of b c d] |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5441 |
using dist_triangle3 [of c d a] dist_triangle [of a d b] |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5442 |
by arith |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5443 |
} note le = this |
53282 | 5444 |
{ |
5445 |
fix x y |
|
44648
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5446 |
assume f: "(\<lambda>n. dist (f (x n)) (f (y n))) ----> 0" |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5447 |
assume g: "(\<lambda>n. dist (g (x n)) (g (y n))) ----> 0" |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5448 |
have "(\<lambda>n. \<bar>dist (f (x n)) (g (x n)) - dist (f (y n)) (g (y n))\<bar>) ----> 0" |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5449 |
by (rule Lim_transform_bound [OF _ tendsto_add_zero [OF f g]], |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5450 |
simp add: le) |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5451 |
} |
53282 | 5452 |
then show ?thesis |
5453 |
using assms unfolding uniformly_continuous_on_sequentially |
|
44648
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5454 |
unfolding dist_real_def by simp |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5455 |
qed |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5456 |
|
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56290
diff
changeset
|
5457 |
lemma uniformly_continuous_on_norm[continuous_intros]: |
44648
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5458 |
assumes "uniformly_continuous_on s f" |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5459 |
shows "uniformly_continuous_on s (\<lambda>x. norm (f x))" |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5460 |
unfolding norm_conv_dist using assms |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5461 |
by (intro uniformly_continuous_on_dist uniformly_continuous_on_const) |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5462 |
|
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56290
diff
changeset
|
5463 |
lemma (in bounded_linear) uniformly_continuous_on[continuous_intros]: |
44648
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5464 |
assumes "uniformly_continuous_on s g" |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5465 |
shows "uniformly_continuous_on s (\<lambda>x. f (g x))" |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5466 |
using assms unfolding uniformly_continuous_on_sequentially |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5467 |
unfolding dist_norm tendsto_norm_zero_iff diff[symmetric] |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5468 |
by (auto intro: tendsto_zero) |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5469 |
|
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56290
diff
changeset
|
5470 |
lemma uniformly_continuous_on_cmul[continuous_intros]: |
36441 | 5471 |
fixes f :: "'a::metric_space \<Rightarrow> 'b::real_normed_vector" |
33175 | 5472 |
assumes "uniformly_continuous_on s f" |
5473 |
shows "uniformly_continuous_on s (\<lambda>x. c *\<^sub>R f(x))" |
|
44648
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5474 |
using bounded_linear_scaleR_right assms |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5475 |
by (rule bounded_linear.uniformly_continuous_on) |
33175 | 5476 |
|
5477 |
lemma dist_minus: |
|
5478 |
fixes x y :: "'a::real_normed_vector" |
|
5479 |
shows "dist (- x) (- y) = dist x y" |
|
5480 |
unfolding dist_norm minus_diff_minus norm_minus_cancel .. |
|
5481 |
||
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56290
diff
changeset
|
5482 |
lemma uniformly_continuous_on_minus[continuous_intros]: |
33175 | 5483 |
fixes f :: "'a::metric_space \<Rightarrow> 'b::real_normed_vector" |
44648
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5484 |
shows "uniformly_continuous_on s f \<Longrightarrow> uniformly_continuous_on s (\<lambda>x. - f x)" |
33175 | 5485 |
unfolding uniformly_continuous_on_def dist_minus . |
5486 |
||
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56290
diff
changeset
|
5487 |
lemma uniformly_continuous_on_add[continuous_intros]: |
36441 | 5488 |
fixes f g :: "'a::metric_space \<Rightarrow> 'b::real_normed_vector" |
44648
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5489 |
assumes "uniformly_continuous_on s f" |
53282 | 5490 |
and "uniformly_continuous_on s g" |
33175 | 5491 |
shows "uniformly_continuous_on s (\<lambda>x. f x + g x)" |
53282 | 5492 |
using assms |
5493 |
unfolding uniformly_continuous_on_sequentially |
|
44648
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5494 |
unfolding dist_norm tendsto_norm_zero_iff add_diff_add |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5495 |
by (auto intro: tendsto_add_zero) |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5496 |
|
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56290
diff
changeset
|
5497 |
lemma uniformly_continuous_on_diff[continuous_intros]: |
36441 | 5498 |
fixes f :: "'a::metric_space \<Rightarrow> 'b::real_normed_vector" |
53282 | 5499 |
assumes "uniformly_continuous_on s f" |
5500 |
and "uniformly_continuous_on s g" |
|
44648
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
5501 |
shows "uniformly_continuous_on s (\<lambda>x. f x - g x)" |
54230
b1d955791529
more simplification rules on unary and binary minus
haftmann
parents:
54070
diff
changeset
|
5502 |
using assms uniformly_continuous_on_add [of s f "- g"] |
b1d955791529
more simplification rules on unary and binary minus
haftmann
parents:
54070
diff
changeset
|
5503 |
by (simp add: fun_Compl_def uniformly_continuous_on_minus) |
33175 | 5504 |
|
60420 | 5505 |
text\<open>Continuity of all kinds is preserved under composition.\<close> |
33175 | 5506 |
|
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:
51475
diff
changeset
|
5507 |
lemmas continuous_at_compose = isCont_o |
33175 | 5508 |
|
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56290
diff
changeset
|
5509 |
lemma uniformly_continuous_on_compose[continuous_intros]: |
33175 | 5510 |
assumes "uniformly_continuous_on s f" "uniformly_continuous_on (f ` s) g" |
53640 | 5511 |
shows "uniformly_continuous_on s (g \<circ> f)" |
5512 |
proof - |
|
53282 | 5513 |
{ |
5514 |
fix e :: real |
|
5515 |
assume "e > 0" |
|
5516 |
then obtain d where "d > 0" |
|
5517 |
and d: "\<forall>x\<in>f ` s. \<forall>x'\<in>f ` s. dist x' x < d \<longrightarrow> dist (g x') (g x) < e" |
|
5518 |
using assms(2) unfolding uniformly_continuous_on_def by auto |
|
5519 |
obtain d' where "d'>0" "\<forall>x\<in>s. \<forall>x'\<in>s. dist x' x < d' \<longrightarrow> dist (f x') (f x) < d" |
|
60420 | 5520 |
using \<open>d > 0\<close> using assms(1) unfolding uniformly_continuous_on_def by auto |
53282 | 5521 |
then have "\<exists>d>0. \<forall>x\<in>s. \<forall>x'\<in>s. dist x' x < d \<longrightarrow> dist ((g \<circ> f) x') ((g \<circ> f) x) < e" |
60420 | 5522 |
using \<open>d>0\<close> using d by auto |
53282 | 5523 |
} |
5524 |
then show ?thesis |
|
5525 |
using assms unfolding uniformly_continuous_on_def by auto |
|
33175 | 5526 |
qed |
5527 |
||
60420 | 5528 |
text\<open>Continuity in terms of open preimages.\<close> |
33175 | 5529 |
|
5530 |
lemma continuous_at_open: |
|
53282 | 5531 |
"continuous (at x) f \<longleftrightarrow> (\<forall>t. open t \<and> f x \<in> t --> (\<exists>s. open s \<and> x \<in> s \<and> (\<forall>x' \<in> s. (f x') \<in> t)))" |
5532 |
unfolding continuous_within_topological [of x UNIV f] |
|
5533 |
unfolding imp_conjL |
|
5534 |
by (intro all_cong imp_cong ex_cong conj_cong refl) auto |
|
33175 | 5535 |
|
51351 | 5536 |
lemma continuous_imp_tendsto: |
53282 | 5537 |
assumes "continuous (at x0) f" |
5538 |
and "x ----> x0" |
|
51351 | 5539 |
shows "(f \<circ> x) ----> (f x0)" |
5540 |
proof (rule topological_tendstoI) |
|
5541 |
fix S |
|
5542 |
assume "open S" "f x0 \<in> S" |
|
5543 |
then obtain T where T_def: "open T" "x0 \<in> T" "\<forall>x\<in>T. f x \<in> S" |
|
5544 |
using assms continuous_at_open by metis |
|
5545 |
then have "eventually (\<lambda>n. x n \<in> T) sequentially" |
|
5546 |
using assms T_def by (auto simp: tendsto_def) |
|
5547 |
then show "eventually (\<lambda>n. (f \<circ> x) n \<in> S) sequentially" |
|
5548 |
using T_def by (auto elim!: eventually_elim1) |
|
5549 |
qed |
|
5550 |
||
33175 | 5551 |
lemma continuous_on_open: |
51481
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents:
51480
diff
changeset
|
5552 |
"continuous_on s f \<longleftrightarrow> |
53282 | 5553 |
(\<forall>t. openin (subtopology euclidean (f ` s)) t \<longrightarrow> |
5554 |
openin (subtopology euclidean s) {x \<in> s. f x \<in> t})" |
|
51481
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents:
51480
diff
changeset
|
5555 |
unfolding continuous_on_open_invariant openin_open Int_def vimage_def Int_commute |
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents:
51480
diff
changeset
|
5556 |
by (simp add: imp_ex imageI conj_commute eq_commute cong: conj_cong) |
36441 | 5557 |
|
60420 | 5558 |
text \<open>Similarly in terms of closed sets.\<close> |
33175 | 5559 |
|
5560 |
lemma continuous_on_closed: |
|
53282 | 5561 |
"continuous_on s f \<longleftrightarrow> |
5562 |
(\<forall>t. closedin (subtopology euclidean (f ` s)) t \<longrightarrow> |
|
5563 |
closedin (subtopology euclidean s) {x \<in> s. f x \<in> t})" |
|
51481
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents:
51480
diff
changeset
|
5564 |
unfolding continuous_on_closed_invariant closedin_closed Int_def vimage_def Int_commute |
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents:
51480
diff
changeset
|
5565 |
by (simp add: imp_ex imageI conj_commute eq_commute cong: conj_cong) |
33175 | 5566 |
|
60420 | 5567 |
text \<open>Half-global and completely global cases.\<close> |
33175 | 5568 |
|
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
5569 |
lemma continuous_openin_preimage: |
33175 | 5570 |
assumes "continuous_on s f" "open t" |
5571 |
shows "openin (subtopology euclidean s) {x \<in> s. f x \<in> t}" |
|
53282 | 5572 |
proof - |
5573 |
have *: "\<forall>x. x \<in> s \<and> f x \<in> t \<longleftrightarrow> x \<in> s \<and> f x \<in> (t \<inter> f ` s)" |
|
5574 |
by auto |
|
33175 | 5575 |
have "openin (subtopology euclidean (f ` s)) (t \<inter> f ` s)" |
5576 |
using openin_open_Int[of t "f ` s", OF assms(2)] unfolding openin_open by auto |
|
53282 | 5577 |
then show ?thesis |
5578 |
using assms(1)[unfolded continuous_on_open, THEN spec[where x="t \<inter> f ` s"]] |
|
5579 |
using * by auto |
|
33175 | 5580 |
qed |
5581 |
||
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
5582 |
lemma continuous_closedin_preimage: |
53291 | 5583 |
assumes "continuous_on s f" and "closed t" |
33175 | 5584 |
shows "closedin (subtopology euclidean s) {x \<in> s. f x \<in> t}" |
53282 | 5585 |
proof - |
5586 |
have *: "\<forall>x. x \<in> s \<and> f x \<in> t \<longleftrightarrow> x \<in> s \<and> f x \<in> (t \<inter> f ` s)" |
|
5587 |
by auto |
|
33175 | 5588 |
have "closedin (subtopology euclidean (f ` s)) (t \<inter> f ` s)" |
53282 | 5589 |
using closedin_closed_Int[of t "f ` s", OF assms(2)] unfolding Int_commute |
5590 |
by auto |
|
5591 |
then show ?thesis |
|
5592 |
using assms(1)[unfolded continuous_on_closed, THEN spec[where x="t \<inter> f ` s"]] |
|
5593 |
using * by auto |
|
33175 | 5594 |
qed |
5595 |
||
5596 |
lemma continuous_open_preimage: |
|
53291 | 5597 |
assumes "continuous_on s f" |
5598 |
and "open s" |
|
5599 |
and "open t" |
|
33175 | 5600 |
shows "open {x \<in> s. f x \<in> t}" |
5601 |
proof- |
|
5602 |
obtain T where T: "open T" "{x \<in> s. f x \<in> t} = s \<inter> T" |
|
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
5603 |
using continuous_openin_preimage[OF assms(1,3)] unfolding openin_open by auto |
53282 | 5604 |
then show ?thesis |
5605 |
using open_Int[of s T, OF assms(2)] by auto |
|
33175 | 5606 |
qed |
5607 |
||
5608 |
lemma continuous_closed_preimage: |
|
53291 | 5609 |
assumes "continuous_on s f" |
5610 |
and "closed s" |
|
5611 |
and "closed t" |
|
33175 | 5612 |
shows "closed {x \<in> s. f x \<in> t}" |
5613 |
proof- |
|
53282 | 5614 |
obtain T where "closed T" "{x \<in> s. f x \<in> t} = s \<inter> T" |
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
5615 |
using continuous_closedin_preimage[OF assms(1,3)] |
53282 | 5616 |
unfolding closedin_closed by auto |
5617 |
then show ?thesis using closed_Int[of s T, OF assms(2)] by auto |
|
33175 | 5618 |
qed |
5619 |
||
5620 |
lemma continuous_open_preimage_univ: |
|
53282 | 5621 |
"\<forall>x. continuous (at x) f \<Longrightarrow> open s \<Longrightarrow> open {x. f x \<in> s}" |
33175 | 5622 |
using continuous_open_preimage[of UNIV f s] open_UNIV continuous_at_imp_continuous_on by auto |
5623 |
||
5624 |
lemma continuous_closed_preimage_univ: |
|
53291 | 5625 |
"(\<forall>x. continuous (at x) f) \<Longrightarrow> closed s \<Longrightarrow> closed {x. f x \<in> s}" |
33175 | 5626 |
using continuous_closed_preimage[of UNIV f s] closed_UNIV continuous_at_imp_continuous_on by auto |
5627 |
||
53282 | 5628 |
lemma continuous_open_vimage: "\<forall>x. continuous (at x) f \<Longrightarrow> open s \<Longrightarrow> open (f -` s)" |
33175 | 5629 |
unfolding vimage_def by (rule continuous_open_preimage_univ) |
5630 |
||
53282 | 5631 |
lemma continuous_closed_vimage: "\<forall>x. continuous (at x) f \<Longrightarrow> closed s \<Longrightarrow> closed (f -` s)" |
33175 | 5632 |
unfolding vimage_def by (rule continuous_closed_preimage_univ) |
5633 |
||
36441 | 5634 |
lemma interior_image_subset: |
53291 | 5635 |
assumes "\<forall>x. continuous (at x) f" |
5636 |
and "inj f" |
|
35172
579dd5570f96
Added integration to Multivariate-Analysis (upto FTC)
himmelma
parents:
35028
diff
changeset
|
5637 |
shows "interior (f ` s) \<subseteq> f ` (interior s)" |
44519 | 5638 |
proof |
5639 |
fix x assume "x \<in> interior (f ` s)" |
|
5640 |
then obtain T where as: "open T" "x \<in> T" "T \<subseteq> f ` s" .. |
|
53282 | 5641 |
then have "x \<in> f ` s" by auto |
44519 | 5642 |
then obtain y where y: "y \<in> s" "x = f y" by auto |
5643 |
have "open (vimage f T)" |
|
60420 | 5644 |
using assms(1) \<open>open T\<close> by (rule continuous_open_vimage) |
44519 | 5645 |
moreover have "y \<in> vimage f T" |
60420 | 5646 |
using \<open>x = f y\<close> \<open>x \<in> T\<close> by simp |
44519 | 5647 |
moreover have "vimage f T \<subseteq> s" |
60420 | 5648 |
using \<open>T \<subseteq> image f s\<close> \<open>inj f\<close> unfolding inj_on_def subset_eq by auto |
44519 | 5649 |
ultimately have "y \<in> interior s" .. |
60420 | 5650 |
with \<open>x = f y\<close> show "x \<in> f ` interior s" .. |
5651 |
qed |
|
5652 |
||
5653 |
text \<open>Equality of continuous functions on closure and related results.\<close> |
|
33175 | 5654 |
|
5655 |
lemma continuous_closed_in_preimage_constant: |
|
36668
941ba2da372e
simplify definition of t1_space; generalize lemma closed_sing and related lemmas
huffman
parents:
36667
diff
changeset
|
5656 |
fixes f :: "_ \<Rightarrow> 'b::t1_space" |
53291 | 5657 |
shows "continuous_on s f \<Longrightarrow> closedin (subtopology euclidean s) {x \<in> s. f x = a}" |
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
5658 |
using continuous_closedin_preimage[of s f "{a}"] by auto |
33175 | 5659 |
|
5660 |
lemma continuous_closed_preimage_constant: |
|
36668
941ba2da372e
simplify definition of t1_space; generalize lemma closed_sing and related lemmas
huffman
parents:
36667
diff
changeset
|
5661 |
fixes f :: "_ \<Rightarrow> 'b::t1_space" |
53291 | 5662 |
shows "continuous_on s f \<Longrightarrow> closed s \<Longrightarrow> closed {x \<in> s. f x = a}" |
36668
941ba2da372e
simplify definition of t1_space; generalize lemma closed_sing and related lemmas
huffman
parents:
36667
diff
changeset
|
5663 |
using continuous_closed_preimage[of s f "{a}"] by auto |
33175 | 5664 |
|
5665 |
lemma continuous_constant_on_closure: |
|
36668
941ba2da372e
simplify definition of t1_space; generalize lemma closed_sing and related lemmas
huffman
parents:
36667
diff
changeset
|
5666 |
fixes f :: "_ \<Rightarrow> 'b::t1_space" |
33175 | 5667 |
assumes "continuous_on (closure s) f" |
53282 | 5668 |
and "\<forall>x \<in> s. f x = a" |
33175 | 5669 |
shows "\<forall>x \<in> (closure s). f x = a" |
5670 |
using continuous_closed_preimage_constant[of "closure s" f a] |
|
53282 | 5671 |
assms closure_minimal[of s "{x \<in> closure s. f x = a}"] closure_subset |
5672 |
unfolding subset_eq |
|
5673 |
by auto |
|
33175 | 5674 |
|
5675 |
lemma image_closure_subset: |
|
53291 | 5676 |
assumes "continuous_on (closure s) f" |
5677 |
and "closed t" |
|
5678 |
and "(f ` s) \<subseteq> t" |
|
33175 | 5679 |
shows "f ` (closure s) \<subseteq> t" |
53282 | 5680 |
proof - |
5681 |
have "s \<subseteq> {x \<in> closure s. f x \<in> t}" |
|
5682 |
using assms(3) closure_subset by auto |
|
33175 | 5683 |
moreover have "closed {x \<in> closure s. f x \<in> t}" |
5684 |
using continuous_closed_preimage[OF assms(1)] and assms(2) by auto |
|
5685 |
ultimately have "closure s = {x \<in> closure s . f x \<in> t}" |
|
5686 |
using closure_minimal[of s "{x \<in> closure s. f x \<in> t}"] by auto |
|
53282 | 5687 |
then show ?thesis by auto |
33175 | 5688 |
qed |
5689 |
||
5690 |
lemma continuous_on_closure_norm_le: |
|
5691 |
fixes f :: "'a::metric_space \<Rightarrow> 'b::real_normed_vector" |
|
53282 | 5692 |
assumes "continuous_on (closure s) f" |
5693 |
and "\<forall>y \<in> s. norm(f y) \<le> b" |
|
5694 |
and "x \<in> (closure s)" |
|
53291 | 5695 |
shows "norm (f x) \<le> b" |
53282 | 5696 |
proof - |
5697 |
have *: "f ` s \<subseteq> cball 0 b" |
|
53291 | 5698 |
using assms(2)[unfolded mem_cball_0[symmetric]] by auto |
33175 | 5699 |
show ?thesis |
5700 |
using image_closure_subset[OF assms(1) closed_cball[of 0 b] *] assms(3) |
|
53282 | 5701 |
unfolding subset_eq |
5702 |
apply (erule_tac x="f x" in ballE) |
|
5703 |
apply (auto simp add: dist_norm) |
|
5704 |
done |
|
33175 | 5705 |
qed |
5706 |
||
60420 | 5707 |
text \<open>Making a continuous function avoid some value in a neighbourhood.\<close> |
33175 | 5708 |
|
5709 |
lemma continuous_within_avoid: |
|
50898 | 5710 |
fixes f :: "'a::metric_space \<Rightarrow> 'b::t1_space" |
53282 | 5711 |
assumes "continuous (at x within s) f" |
5712 |
and "f x \<noteq> a" |
|
33175 | 5713 |
shows "\<exists>e>0. \<forall>y \<in> s. dist x y < e --> f y \<noteq> a" |
53291 | 5714 |
proof - |
50898 | 5715 |
obtain U where "open U" and "f x \<in> U" and "a \<notin> U" |
60420 | 5716 |
using t1_space [OF \<open>f x \<noteq> a\<close>] by fast |
50898 | 5717 |
have "(f ---> f x) (at x within s)" |
5718 |
using assms(1) by (simp add: continuous_within) |
|
53282 | 5719 |
then have "eventually (\<lambda>y. f y \<in> U) (at x within s)" |
60420 | 5720 |
using \<open>open U\<close> and \<open>f x \<in> U\<close> |
50898 | 5721 |
unfolding tendsto_def by fast |
53282 | 5722 |
then have "eventually (\<lambda>y. f y \<noteq> a) (at x within s)" |
60420 | 5723 |
using \<open>a \<notin> U\<close> by (fast elim: eventually_mono [rotated]) |
53282 | 5724 |
then show ?thesis |
60420 | 5725 |
using \<open>f x \<noteq> a\<close> by (auto simp: dist_commute zero_less_dist_iff eventually_at) |
33175 | 5726 |
qed |
5727 |
||
5728 |
lemma continuous_at_avoid: |
|
50898 | 5729 |
fixes f :: "'a::metric_space \<Rightarrow> 'b::t1_space" |
53282 | 5730 |
assumes "continuous (at x) f" |
5731 |
and "f x \<noteq> a" |
|
33175 | 5732 |
shows "\<exists>e>0. \<forall>y. dist x y < e \<longrightarrow> f y \<noteq> a" |
45031 | 5733 |
using assms continuous_within_avoid[of x UNIV f a] by simp |
33175 | 5734 |
|
5735 |
lemma continuous_on_avoid: |
|
50898 | 5736 |
fixes f :: "'a::metric_space \<Rightarrow> 'b::t1_space" |
53282 | 5737 |
assumes "continuous_on s f" |
5738 |
and "x \<in> s" |
|
5739 |
and "f x \<noteq> a" |
|
33175 | 5740 |
shows "\<exists>e>0. \<forall>y \<in> s. dist x y < e \<longrightarrow> f y \<noteq> a" |
53282 | 5741 |
using assms(1)[unfolded continuous_on_eq_continuous_within, THEN bspec[where x=x], |
5742 |
OF assms(2)] continuous_within_avoid[of x s f a] |
|
5743 |
using assms(3) |
|
5744 |
by auto |
|
33175 | 5745 |
|
5746 |
lemma continuous_on_open_avoid: |
|
50898 | 5747 |
fixes f :: "'a::metric_space \<Rightarrow> 'b::t1_space" |
53291 | 5748 |
assumes "continuous_on s f" |
5749 |
and "open s" |
|
5750 |
and "x \<in> s" |
|
5751 |
and "f x \<noteq> a" |
|
33175 | 5752 |
shows "\<exists>e>0. \<forall>y. dist x y < e \<longrightarrow> f y \<noteq> a" |
53282 | 5753 |
using assms(1)[unfolded continuous_on_eq_continuous_at[OF assms(2)], THEN bspec[where x=x], OF assms(3)] |
5754 |
using continuous_at_avoid[of x f a] assms(4) |
|
5755 |
by auto |
|
33175 | 5756 |
|
60420 | 5757 |
text \<open>Proving a function is constant by proving open-ness of level set.\<close> |
33175 | 5758 |
|
5759 |
lemma continuous_levelset_open_in_cases: |
|
36668
941ba2da372e
simplify definition of t1_space; generalize lemma closed_sing and related lemmas
huffman
parents:
36667
diff
changeset
|
5760 |
fixes f :: "_ \<Rightarrow> 'b::t1_space" |
36359 | 5761 |
shows "connected s \<Longrightarrow> continuous_on s f \<Longrightarrow> |
33175 | 5762 |
openin (subtopology euclidean s) {x \<in> s. f x = a} |
53282 | 5763 |
\<Longrightarrow> (\<forall>x \<in> s. f x \<noteq> a) \<or> (\<forall>x \<in> s. f x = a)" |
5764 |
unfolding connected_clopen |
|
5765 |
using continuous_closed_in_preimage_constant by auto |
|
33175 | 5766 |
|
5767 |
lemma continuous_levelset_open_in: |
|
36668
941ba2da372e
simplify definition of t1_space; generalize lemma closed_sing and related lemmas
huffman
parents:
36667
diff
changeset
|
5768 |
fixes f :: "_ \<Rightarrow> 'b::t1_space" |
36359 | 5769 |
shows "connected s \<Longrightarrow> continuous_on s f \<Longrightarrow> |
33175 | 5770 |
openin (subtopology euclidean s) {x \<in> s. f x = a} \<Longrightarrow> |
53291 | 5771 |
(\<exists>x \<in> s. f x = a) \<Longrightarrow> (\<forall>x \<in> s. f x = a)" |
53282 | 5772 |
using continuous_levelset_open_in_cases[of s f ] |
5773 |
by meson |
|
33175 | 5774 |
|
5775 |
lemma continuous_levelset_open: |
|
36668
941ba2da372e
simplify definition of t1_space; generalize lemma closed_sing and related lemmas
huffman
parents:
36667
diff
changeset
|
5776 |
fixes f :: "_ \<Rightarrow> 'b::t1_space" |
53282 | 5777 |
assumes "connected s" |
5778 |
and "continuous_on s f" |
|
5779 |
and "open {x \<in> s. f x = a}" |
|
5780 |
and "\<exists>x \<in> s. f x = a" |
|
33175 | 5781 |
shows "\<forall>x \<in> s. f x = a" |
53282 | 5782 |
using continuous_levelset_open_in[OF assms(1,2), of a, unfolded openin_open] |
5783 |
using assms (3,4) |
|
5784 |
by fast |
|
33175 | 5785 |
|
60420 | 5786 |
text \<open>Some arithmetical combinations (more to prove).\<close> |
33175 | 5787 |
|
5788 |
lemma open_scaling[intro]: |
|
5789 |
fixes s :: "'a::real_normed_vector set" |
|
53291 | 5790 |
assumes "c \<noteq> 0" |
5791 |
and "open s" |
|
33175 | 5792 |
shows "open((\<lambda>x. c *\<^sub>R x) ` s)" |
53282 | 5793 |
proof - |
5794 |
{ |
|
5795 |
fix x |
|
5796 |
assume "x \<in> s" |
|
5797 |
then obtain e where "e>0" |
|
5798 |
and e:"\<forall>x'. dist x' x < e \<longrightarrow> x' \<in> s" using assms(2)[unfolded open_dist, THEN bspec[where x=x]] |
|
5799 |
by auto |
|
5800 |
have "e * abs c > 0" |
|
60420 | 5801 |
using assms(1)[unfolded zero_less_abs_iff[symmetric]] \<open>e>0\<close> by auto |
33175 | 5802 |
moreover |
53282 | 5803 |
{ |
5804 |
fix y |
|
5805 |
assume "dist y (c *\<^sub>R x) < e * \<bar>c\<bar>" |
|
5806 |
then have "norm ((1 / c) *\<^sub>R y - x) < e" |
|
5807 |
unfolding dist_norm |
|
33175 | 5808 |
using norm_scaleR[of c "(1 / c) *\<^sub>R y - x", unfolded scaleR_right_diff_distrib, unfolded scaleR_scaleR] assms(1) |
53291 | 5809 |
assms(1)[unfolded zero_less_abs_iff[symmetric]] by (simp del:zero_less_abs_iff) |
53282 | 5810 |
then have "y \<in> op *\<^sub>R c ` s" |
5811 |
using rev_image_eqI[of "(1 / c) *\<^sub>R y" s y "op *\<^sub>R c"] |
|
5812 |
using e[THEN spec[where x="(1 / c) *\<^sub>R y"]] |
|
5813 |
using assms(1) |
|
5814 |
unfolding dist_norm scaleR_scaleR |
|
5815 |
by auto |
|
5816 |
} |
|
5817 |
ultimately have "\<exists>e>0. \<forall>x'. dist x' (c *\<^sub>R x) < e \<longrightarrow> x' \<in> op *\<^sub>R c ` s" |
|
5818 |
apply (rule_tac x="e * abs c" in exI) |
|
5819 |
apply auto |
|
5820 |
done |
|
5821 |
} |
|
5822 |
then show ?thesis unfolding open_dist by auto |
|
33175 | 5823 |
qed |
5824 |
||
5825 |
lemma minus_image_eq_vimage: |
|
5826 |
fixes A :: "'a::ab_group_add set" |
|
5827 |
shows "(\<lambda>x. - x) ` A = (\<lambda>x. - x) -` A" |
|
5828 |
by (auto intro!: image_eqI [where f="\<lambda>x. - x"]) |
|
5829 |
||
5830 |
lemma open_negations: |
|
5831 |
fixes s :: "'a::real_normed_vector set" |
|
54489
03ff4d1e6784
eliminiated neg_numeral in favour of - (numeral _)
haftmann
parents:
54263
diff
changeset
|
5832 |
shows "open s \<Longrightarrow> open ((\<lambda>x. - x) ` s)" |
03ff4d1e6784
eliminiated neg_numeral in favour of - (numeral _)
haftmann
parents:
54263
diff
changeset
|
5833 |
using open_scaling [of "- 1" s] by simp |
33175 | 5834 |
|
5835 |
lemma open_translation: |
|
5836 |
fixes s :: "'a::real_normed_vector set" |
|
53291 | 5837 |
assumes "open s" |
5838 |
shows "open((\<lambda>x. a + x) ` s)" |
|
53282 | 5839 |
proof - |
5840 |
{ |
|
5841 |
fix x |
|
5842 |
have "continuous (at x) (\<lambda>x. x - a)" |
|
5843 |
by (intro continuous_diff continuous_at_id continuous_const) |
|
5844 |
} |
|
5845 |
moreover have "{x. x - a \<in> s} = op + a ` s" |
|
5846 |
by force |
|
5847 |
ultimately show ?thesis using continuous_open_preimage_univ[of "\<lambda>x. x - a" s] |
|
5848 |
using assms by auto |
|
33175 | 5849 |
qed |
5850 |
||
5851 |
lemma open_affinity: |
|
5852 |
fixes s :: "'a::real_normed_vector set" |
|
5853 |
assumes "open s" "c \<noteq> 0" |
|
5854 |
shows "open ((\<lambda>x. a + c *\<^sub>R x) ` s)" |
|
53282 | 5855 |
proof - |
5856 |
have *: "(\<lambda>x. a + c *\<^sub>R x) = (\<lambda>x. a + x) \<circ> (\<lambda>x. c *\<^sub>R x)" |
|
5857 |
unfolding o_def .. |
|
5858 |
have "op + a ` op *\<^sub>R c ` s = (op + a \<circ> op *\<^sub>R c) ` s" |
|
5859 |
by auto |
|
5860 |
then show ?thesis |
|
5861 |
using assms open_translation[of "op *\<^sub>R c ` s" a] |
|
5862 |
unfolding * |
|
5863 |
by auto |
|
33175 | 5864 |
qed |
5865 |
||
5866 |
lemma interior_translation: |
|
5867 |
fixes s :: "'a::real_normed_vector set" |
|
5868 |
shows "interior ((\<lambda>x. a + x) ` s) = (\<lambda>x. a + x) ` (interior s)" |
|
39302
d7728f65b353
renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
nipkow
parents:
39198
diff
changeset
|
5869 |
proof (rule set_eqI, rule) |
53282 | 5870 |
fix x |
5871 |
assume "x \<in> interior (op + a ` s)" |
|
5872 |
then obtain e where "e > 0" and e: "ball x e \<subseteq> op + a ` s" |
|
5873 |
unfolding mem_interior by auto |
|
5874 |
then have "ball (x - a) e \<subseteq> s" |
|
5875 |
unfolding subset_eq Ball_def mem_ball dist_norm |
|
59815
cce82e360c2f
explicit commutative additive inverse operation;
haftmann
parents:
59765
diff
changeset
|
5876 |
by (auto simp add: diff_diff_eq) |
53282 | 5877 |
then show "x \<in> op + a ` interior s" |
5878 |
unfolding image_iff |
|
5879 |
apply (rule_tac x="x - a" in bexI) |
|
5880 |
unfolding mem_interior |
|
60420 | 5881 |
using \<open>e > 0\<close> |
53282 | 5882 |
apply auto |
5883 |
done |
|
33175 | 5884 |
next |
53282 | 5885 |
fix x |
5886 |
assume "x \<in> op + a ` interior s" |
|
5887 |
then obtain y e where "e > 0" and e: "ball y e \<subseteq> s" and y: "x = a + y" |
|
5888 |
unfolding image_iff Bex_def mem_interior by auto |
|
5889 |
{ |
|
5890 |
fix z |
|
5891 |
have *: "a + y - z = y + a - z" by auto |
|
5892 |
assume "z \<in> ball x e" |
|
5893 |
then have "z - a \<in> s" |
|
5894 |
using e[unfolded subset_eq, THEN bspec[where x="z - a"]] |
|
5895 |
unfolding mem_ball dist_norm y group_add_class.diff_diff_eq2 * |
|
5896 |
by auto |
|
5897 |
then have "z \<in> op + a ` s" |
|
5898 |
unfolding image_iff by (auto intro!: bexI[where x="z - a"]) |
|
5899 |
} |
|
5900 |
then have "ball x e \<subseteq> op + a ` s" |
|
5901 |
unfolding subset_eq by auto |
|
5902 |
then show "x \<in> interior (op + a ` s)" |
|
60420 | 5903 |
unfolding mem_interior using \<open>e > 0\<close> by auto |
5904 |
qed |
|
5905 |
||
5906 |
text \<open>Topological properties of linear functions.\<close> |
|
36437 | 5907 |
|
5908 |
lemma linear_lim_0: |
|
53282 | 5909 |
assumes "bounded_linear f" |
5910 |
shows "(f ---> 0) (at (0))" |
|
5911 |
proof - |
|
36437 | 5912 |
interpret f: bounded_linear f by fact |
5913 |
have "(f ---> f 0) (at 0)" |
|
5914 |
using tendsto_ident_at by (rule f.tendsto) |
|
53282 | 5915 |
then show ?thesis unfolding f.zero . |
36437 | 5916 |
qed |
5917 |
||
5918 |
lemma linear_continuous_at: |
|
53282 | 5919 |
assumes "bounded_linear f" |
5920 |
shows "continuous (at a) f" |
|
36437 | 5921 |
unfolding continuous_at using assms |
5922 |
apply (rule bounded_linear.tendsto) |
|
5923 |
apply (rule tendsto_ident_at) |
|
5924 |
done |
|
5925 |
||
5926 |
lemma linear_continuous_within: |
|
53291 | 5927 |
"bounded_linear f \<Longrightarrow> continuous (at x within s) f" |
36437 | 5928 |
using continuous_at_imp_continuous_within[of x f s] using linear_continuous_at[of f] by auto |
5929 |
||
5930 |
lemma linear_continuous_on: |
|
53291 | 5931 |
"bounded_linear f \<Longrightarrow> continuous_on s f" |
36437 | 5932 |
using continuous_at_imp_continuous_on[of s f] using linear_continuous_at[of f] by auto |
5933 |
||
60420 | 5934 |
text \<open>Also bilinear functions, in composition form.\<close> |
36437 | 5935 |
|
5936 |
lemma bilinear_continuous_at_compose: |
|
53282 | 5937 |
"continuous (at x) f \<Longrightarrow> continuous (at x) g \<Longrightarrow> bounded_bilinear h \<Longrightarrow> |
5938 |
continuous (at x) (\<lambda>x. h (f x) (g x))" |
|
5939 |
unfolding continuous_at |
|
5940 |
using Lim_bilinear[of f "f x" "(at x)" g "g x" h] |
|
5941 |
by auto |
|
36437 | 5942 |
|
5943 |
lemma bilinear_continuous_within_compose: |
|
53282 | 5944 |
"continuous (at x within s) f \<Longrightarrow> continuous (at x within s) g \<Longrightarrow> bounded_bilinear h \<Longrightarrow> |
5945 |
continuous (at x within s) (\<lambda>x. h (f x) (g x))" |
|
5946 |
unfolding continuous_within |
|
5947 |
using Lim_bilinear[of f "f x"] |
|
5948 |
by auto |
|
36437 | 5949 |
|
5950 |
lemma bilinear_continuous_on_compose: |
|
53282 | 5951 |
"continuous_on s f \<Longrightarrow> continuous_on s g \<Longrightarrow> bounded_bilinear h \<Longrightarrow> |
5952 |
continuous_on s (\<lambda>x. h (f x) (g x))" |
|
36441 | 5953 |
unfolding continuous_on_def |
5954 |
by (fast elim: bounded_bilinear.tendsto) |
|
36437 | 5955 |
|
60420 | 5956 |
text \<open>Preservation of compactness and connectedness under continuous function.\<close> |
33175 | 5957 |
|
50898 | 5958 |
lemma compact_eq_openin_cover: |
5959 |
"compact S \<longleftrightarrow> |
|
5960 |
(\<forall>C. (\<forall>c\<in>C. openin (subtopology euclidean S) c) \<and> S \<subseteq> \<Union>C \<longrightarrow> |
|
5961 |
(\<exists>D\<subseteq>C. finite D \<and> S \<subseteq> \<Union>D))" |
|
5962 |
proof safe |
|
5963 |
fix C |
|
5964 |
assume "compact S" and "\<forall>c\<in>C. openin (subtopology euclidean S) c" and "S \<subseteq> \<Union>C" |
|
53282 | 5965 |
then have "\<forall>c\<in>{T. open T \<and> S \<inter> T \<in> C}. open c" and "S \<subseteq> \<Union>{T. open T \<and> S \<inter> T \<in> C}" |
50898 | 5966 |
unfolding openin_open by force+ |
60420 | 5967 |
with \<open>compact S\<close> obtain D where "D \<subseteq> {T. open T \<and> S \<inter> T \<in> C}" and "finite D" and "S \<subseteq> \<Union>D" |
50898 | 5968 |
by (rule compactE) |
53282 | 5969 |
then have "image (\<lambda>T. S \<inter> T) D \<subseteq> C \<and> finite (image (\<lambda>T. S \<inter> T) D) \<and> S \<subseteq> \<Union>(image (\<lambda>T. S \<inter> T) D)" |
50898 | 5970 |
by auto |
53282 | 5971 |
then show "\<exists>D\<subseteq>C. finite D \<and> S \<subseteq> \<Union>D" .. |
50898 | 5972 |
next |
5973 |
assume 1: "\<forall>C. (\<forall>c\<in>C. openin (subtopology euclidean S) c) \<and> S \<subseteq> \<Union>C \<longrightarrow> |
|
5974 |
(\<exists>D\<subseteq>C. finite D \<and> S \<subseteq> \<Union>D)" |
|
5975 |
show "compact S" |
|
5976 |
proof (rule compactI) |
|
5977 |
fix C |
|
5978 |
let ?C = "image (\<lambda>T. S \<inter> T) C" |
|
5979 |
assume "\<forall>t\<in>C. open t" and "S \<subseteq> \<Union>C" |
|
53282 | 5980 |
then have "(\<forall>c\<in>?C. openin (subtopology euclidean S) c) \<and> S \<subseteq> \<Union>?C" |
50898 | 5981 |
unfolding openin_open by auto |
5982 |
with 1 obtain D where "D \<subseteq> ?C" and "finite D" and "S \<subseteq> \<Union>D" |
|
5983 |
by metis |
|
5984 |
let ?D = "inv_into C (\<lambda>T. S \<inter> T) ` D" |
|
5985 |
have "?D \<subseteq> C \<and> finite ?D \<and> S \<subseteq> \<Union>?D" |
|
5986 |
proof (intro conjI) |
|
60420 | 5987 |
from \<open>D \<subseteq> ?C\<close> show "?D \<subseteq> C" |
50898 | 5988 |
by (fast intro: inv_into_into) |
60420 | 5989 |
from \<open>finite D\<close> show "finite ?D" |
50898 | 5990 |
by (rule finite_imageI) |
60420 | 5991 |
from \<open>S \<subseteq> \<Union>D\<close> show "S \<subseteq> \<Union>?D" |
50898 | 5992 |
apply (rule subset_trans) |
5993 |
apply clarsimp |
|
60420 | 5994 |
apply (frule subsetD [OF \<open>D \<subseteq> ?C\<close>, THEN f_inv_into_f]) |
50898 | 5995 |
apply (erule rev_bexI, fast) |
5996 |
done |
|
5997 |
qed |
|
53282 | 5998 |
then show "\<exists>D\<subseteq>C. finite D \<and> S \<subseteq> \<Union>D" .. |
50898 | 5999 |
qed |
6000 |
qed |
|
6001 |
||
33175 | 6002 |
lemma connected_continuous_image: |
53291 | 6003 |
assumes "continuous_on s f" |
6004 |
and "connected s" |
|
33175 | 6005 |
shows "connected(f ` s)" |
53282 | 6006 |
proof - |
6007 |
{ |
|
6008 |
fix T |
|
53291 | 6009 |
assume as: |
6010 |
"T \<noteq> {}" |
|
6011 |
"T \<noteq> f ` s" |
|
6012 |
"openin (subtopology euclidean (f ` s)) T" |
|
6013 |
"closedin (subtopology euclidean (f ` s)) T" |
|
33175 | 6014 |
have "{x \<in> s. f x \<in> T} = {} \<or> {x \<in> s. f x \<in> T} = s" |
6015 |
using assms(1)[unfolded continuous_on_open, THEN spec[where x=T]] |
|
6016 |
using assms(1)[unfolded continuous_on_closed, THEN spec[where x=T]] |
|
6017 |
using assms(2)[unfolded connected_clopen, THEN spec[where x="{x \<in> s. f x \<in> T}"]] as(3,4) by auto |
|
53282 | 6018 |
then have False using as(1,2) |
6019 |
using as(4)[unfolded closedin_def topspace_euclidean_subtopology] by auto |
|
6020 |
} |
|
6021 |
then show ?thesis |
|
6022 |
unfolding connected_clopen by auto |
|
33175 | 6023 |
qed |
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6024 |
|
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6025 |
lemma connected_linear_image: |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6026 |
fixes f :: "'a::euclidean_space \<Rightarrow> 'b::real_normed_vector" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6027 |
assumes "linear f" and "connected s" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6028 |
shows "connected (f ` s)" |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6029 |
using connected_continuous_image assms linear_continuous_on linear_conv_bounded_linear by blast |
33175 | 6030 |
|
60420 | 6031 |
text \<open>Continuity implies uniform continuity on a compact domain.\<close> |
53282 | 6032 |
|
33175 | 6033 |
lemma compact_uniformly_continuous: |
53291 | 6034 |
assumes f: "continuous_on s f" |
6035 |
and s: "compact s" |
|
33175 | 6036 |
shows "uniformly_continuous_on s f" |
50943
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
6037 |
unfolding uniformly_continuous_on_def |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
6038 |
proof (cases, safe) |
53282 | 6039 |
fix e :: real |
6040 |
assume "0 < e" "s \<noteq> {}" |
|
50943
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
6041 |
def [simp]: R \<equiv> "{(y, d). y \<in> s \<and> 0 < d \<and> ball y d \<inter> s \<subseteq> {x \<in> s. f x \<in> ball (f y) (e/2) } }" |
50944 | 6042 |
let ?b = "(\<lambda>(y, d). ball y (d/2))" |
6043 |
have "(\<forall>r\<in>R. open (?b r))" "s \<subseteq> (\<Union>r\<in>R. ?b r)" |
|
50943
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
6044 |
proof safe |
53282 | 6045 |
fix y |
6046 |
assume "y \<in> s" |
|
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61426
diff
changeset
|
6047 |
from continuous_openin_preimage[OF f open_ball] |
50943
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
6048 |
obtain T where "open T" and T: "{x \<in> s. f x \<in> ball (f y) (e/2)} = T \<inter> s" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
6049 |
unfolding openin_subtopology open_openin by metis |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
6050 |
then obtain d where "ball y d \<subseteq> T" "0 < d" |
60420 | 6051 |
using \<open>0 < e\<close> \<open>y \<in> s\<close> by (auto elim!: openE) |
6052 |
with T \<open>y \<in> s\<close> show "y \<in> (\<Union>r\<in>R. ?b r)" |
|
50944 | 6053 |
by (intro UN_I[of "(y, d)"]) auto |
50943
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
6054 |
qed auto |
50944 | 6055 |
with s obtain D where D: "finite D" "D \<subseteq> R" "s \<subseteq> (\<Union>(y, d)\<in>D. ball y (d/2))" |
6056 |
by (rule compactE_image) |
|
60420 | 6057 |
with \<open>s \<noteq> {}\<close> have [simp]: "\<And>x. x < Min (snd ` D) \<longleftrightarrow> (\<forall>(y, d)\<in>D. x < d)" |
50943
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
6058 |
by (subst Min_gr_iff) auto |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
6059 |
show "\<exists>d>0. \<forall>x\<in>s. \<forall>x'\<in>s. dist x' x < d \<longrightarrow> dist (f x') (f x) < e" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
6060 |
proof (rule, safe) |
53282 | 6061 |
fix x x' |
6062 |
assume in_s: "x' \<in> s" "x \<in> s" |
|
50943
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
6063 |
with D obtain y d where x: "x \<in> ball y (d/2)" "(y, d) \<in> D" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
6064 |
by blast |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
6065 |
moreover assume "dist x x' < Min (snd`D) / 2" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
6066 |
ultimately have "dist y x' < d" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
6067 |
by (intro dist_double[where x=x and d=d]) (auto simp: dist_commute) |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
6068 |
with D x in_s show "dist (f x) (f x') < e" |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
6069 |
by (intro dist_double[where x="f y" and d=e]) (auto simp: dist_commute subset_eq) |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
6070 |
qed (insert D, auto) |
88a00a1c7c2c
use accumulation point characterization (avoids t1_space restriction for equivalence of countable and sequential compactness); remove heine_borel_lemma
hoelzl
parents:
50942
diff
changeset
|
6071 |
qed auto |
33175 | 6072 |
|
60420 | 6073 |
text \<open>A uniformly convergent limit of continuous functions is continuous.\<close> |
33175 | 6074 |
|
6075 |
lemma continuous_uniform_limit: |
|
44212
4d10e7f342b1
generalize lemma continuous_uniform_limit to class metric_space
huffman
parents:
44211
diff
changeset
|
6076 |
fixes f :: "'a \<Rightarrow> 'b::metric_space \<Rightarrow> 'c::metric_space" |
4d10e7f342b1
generalize lemma continuous_uniform_limit to class metric_space
huffman
parents:
44211
diff
changeset
|
6077 |
assumes "\<not> trivial_limit F" |
53282 | 6078 |
and "eventually (\<lambda>n. continuous_on s (f n)) F" |
6079 |
and "\<forall>e>0. eventually (\<lambda>n. \<forall>x\<in>s. dist (f n x) (g x) < e) F" |
|
33175 | 6080 |
shows "continuous_on s g" |
53282 | 6081 |
proof - |
6082 |
{ |
|
6083 |
fix x and e :: real |
|
6084 |
assume "x\<in>s" "e>0" |
|
44212
4d10e7f342b1
generalize lemma continuous_uniform_limit to class metric_space
huffman
parents:
44211
diff
changeset
|
6085 |
have "eventually (\<lambda>n. \<forall>x\<in>s. dist (f n x) (g x) < e / 3) F" |
60420 | 6086 |
using \<open>e>0\<close> assms(3)[THEN spec[where x="e/3"]] by auto |
44212
4d10e7f342b1
generalize lemma continuous_uniform_limit to class metric_space
huffman
parents:
44211
diff
changeset
|
6087 |
from eventually_happens [OF eventually_conj [OF this assms(2)]] |
4d10e7f342b1
generalize lemma continuous_uniform_limit to class metric_space
huffman
parents:
44211
diff
changeset
|
6088 |
obtain n where n:"\<forall>x\<in>s. dist (f n x) (g x) < e / 3" "continuous_on s (f n)" |
4d10e7f342b1
generalize lemma continuous_uniform_limit to class metric_space
huffman
parents:
44211
diff
changeset
|
6089 |
using assms(1) by blast |
60420 | 6090 |
have "e / 3 > 0" using \<open>e>0\<close> by auto |
33175 | 6091 |
then obtain d where "d>0" and d:"\<forall>x'\<in>s. dist x' x < d \<longrightarrow> dist (f n x') (f n x) < e / 3" |
60420 | 6092 |
using n(2)[unfolded continuous_on_iff, THEN bspec[where x=x], OF \<open>x\<in>s\<close>, THEN spec[where x="e/3"]] by blast |
53282 | 6093 |
{ |
6094 |
fix y |
|
6095 |
assume "y \<in> s" and "dist y x < d" |
|
6096 |
then have "dist (f n y) (f n x) < e / 3" |
|
44212
4d10e7f342b1
generalize lemma continuous_uniform_limit to class metric_space
huffman
parents:
44211
diff
changeset
|
6097 |
by (rule d [rule_format]) |
53282 | 6098 |
then have "dist (f n y) (g x) < 2 * e / 3" |
44212
4d10e7f342b1
generalize lemma continuous_uniform_limit to class metric_space
huffman
parents:
44211
diff
changeset
|
6099 |
using dist_triangle [of "f n y" "g x" "f n x"] |
60420 | 6100 |
using n(1)[THEN bspec[where x=x], OF \<open>x\<in>s\<close>] |
44212
4d10e7f342b1
generalize lemma continuous_uniform_limit to class metric_space
huffman
parents:
44211
diff
changeset
|
6101 |
by auto |
53282 | 6102 |
then have "dist (g y) (g x) < e" |
60420 | 6103 |
using n(1)[THEN bspec[where x=y], OF \<open>y\<in>s\<close>] |
44212
4d10e7f342b1
generalize lemma continuous_uniform_limit to class metric_space
huffman
parents:
44211
diff
changeset
|
6104 |
using dist_triangle3 [of "g y" "g x" "f n y"] |
53282 | 6105 |
by auto |
6106 |
} |
|
6107 |
then have "\<exists>d>0. \<forall>x'\<in>s. dist x' x < d \<longrightarrow> dist (g x') (g x) < e" |
|
60420 | 6108 |
using \<open>d>0\<close> by auto |
53282 | 6109 |
} |
6110 |
then show ?thesis |
|
6111 |
unfolding continuous_on_iff by auto |
|
33175 | 6112 |
qed |
6113 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
6114 |
|
60420 | 6115 |
subsection \<open>Topological stuff lifted from and dropped to R\<close> |
33175 | 6116 |
|
6117 |
lemma open_real: |
|
53282 | 6118 |
fixes s :: "real set" |
6119 |
shows "open s \<longleftrightarrow> (\<forall>x \<in> s. \<exists>e>0. \<forall>x'. abs(x' - x) < e --> x' \<in> s)" |
|
33175 | 6120 |
unfolding open_dist dist_norm by simp |
6121 |
||
6122 |
lemma islimpt_approachable_real: |
|
6123 |
fixes s :: "real set" |
|
6124 |
shows "x islimpt s \<longleftrightarrow> (\<forall>e>0. \<exists>x'\<in> s. x' \<noteq> x \<and> abs(x' - x) < e)" |
|
6125 |
unfolding islimpt_approachable dist_norm by simp |
|
6126 |
||
6127 |
lemma closed_real: |
|
6128 |
fixes s :: "real set" |
|
53282 | 6129 |
shows "closed s \<longleftrightarrow> (\<forall>x. (\<forall>e>0. \<exists>x' \<in> s. x' \<noteq> x \<and> abs(x' - x) < e) \<longrightarrow> x \<in> s)" |
33175 | 6130 |
unfolding closed_limpt islimpt_approachable dist_norm by simp |
6131 |
||
6132 |
lemma continuous_at_real_range: |
|
6133 |
fixes f :: "'a::real_normed_vector \<Rightarrow> real" |
|
53282 | 6134 |
shows "continuous (at x) f \<longleftrightarrow> (\<forall>e>0. \<exists>d>0. \<forall>x'. norm(x' - x) < d --> abs(f x' - f x) < e)" |
6135 |
unfolding continuous_at |
|
6136 |
unfolding Lim_at |
|
53291 | 6137 |
unfolding dist_nz[symmetric] |
53282 | 6138 |
unfolding dist_norm |
6139 |
apply auto |
|
6140 |
apply (erule_tac x=e in allE) |
|
6141 |
apply auto |
|
6142 |
apply (rule_tac x=d in exI) |
|
6143 |
apply auto |
|
6144 |
apply (erule_tac x=x' in allE) |
|
6145 |
apply auto |
|
6146 |
apply (erule_tac x=e in allE) |
|
6147 |
apply auto |
|
6148 |
done |
|
33175 | 6149 |
|
6150 |
lemma continuous_on_real_range: |
|
6151 |
fixes f :: "'a::real_normed_vector \<Rightarrow> real" |
|
53282 | 6152 |
shows "continuous_on s f \<longleftrightarrow> |
6153 |
(\<forall>x \<in> s. \<forall>e>0. \<exists>d>0. (\<forall>x' \<in> s. norm(x' - x) < d \<longrightarrow> abs(f x' - f x) < e))" |
|
36359 | 6154 |
unfolding continuous_on_iff dist_norm by simp |
33175 | 6155 |
|
60420 | 6156 |
text \<open>Hence some handy theorems on distance, diameter etc. of/from a set.\<close> |
33175 | 6157 |
|
6158 |
lemma distance_attains_sup: |
|
6159 |
assumes "compact s" "s \<noteq> {}" |
|
51346
d33de22432e2
tuned proofs (used continuity of infdist, dist and continuous_attains_sup)
hoelzl
parents:
51345
diff
changeset
|
6160 |
shows "\<exists>x\<in>s. \<forall>y\<in>s. dist a y \<le> dist a x" |
33175 | 6161 |
proof (rule continuous_attains_sup [OF assms]) |
53282 | 6162 |
{ |
6163 |
fix x |
|
6164 |
assume "x\<in>s" |
|
33175 | 6165 |
have "(dist a ---> dist a x) (at x within s)" |
51641
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents:
51530
diff
changeset
|
6166 |
by (intro tendsto_dist tendsto_const tendsto_ident_at) |
33175 | 6167 |
} |
53282 | 6168 |
then show "continuous_on s (dist a)" |
33175 | 6169 |
unfolding continuous_on .. |
6170 |
qed |
|
6171 |
||
60420 | 6172 |
text \<open>For \emph{minimal} distance, we only need closure, not compactness.\<close> |
33175 | 6173 |
|
6174 |
lemma distance_attains_inf: |
|
6175 |
fixes a :: "'a::heine_borel" |
|
53291 | 6176 |
assumes "closed s" |
6177 |
and "s \<noteq> {}" |
|
51346
d33de22432e2
tuned proofs (used continuity of infdist, dist and continuous_attains_sup)
hoelzl
parents:
51345
diff
changeset
|
6178 |
shows "\<exists>x\<in>s. \<forall>y\<in>s. dist a x \<le> dist a y" |
53282 | 6179 |
proof - |
51346
d33de22432e2
tuned proofs (used continuity of infdist, dist and continuous_attains_sup)
hoelzl
parents:
51345
diff
changeset
|
6180 |
from assms(2) obtain b where "b \<in> s" by auto |
d33de22432e2
tuned proofs (used continuity of infdist, dist and continuous_attains_sup)
hoelzl
parents:
51345
diff
changeset
|
6181 |
let ?B = "s \<inter> cball a (dist b a)" |
60420 | 6182 |
have "?B \<noteq> {}" using \<open>b \<in> s\<close> |
53282 | 6183 |
by (auto simp add: dist_commute) |
51346
d33de22432e2
tuned proofs (used continuity of infdist, dist and continuous_attains_sup)
hoelzl
parents:
51345
diff
changeset
|
6184 |
moreover have "continuous_on ?B (dist a)" |
d33de22432e2
tuned proofs (used continuity of infdist, dist and continuous_attains_sup)
hoelzl
parents:
51345
diff
changeset
|
6185 |
by (auto intro!: continuous_at_imp_continuous_on continuous_dist continuous_at_id continuous_const) |
33175 | 6186 |
moreover have "compact ?B" |
60420 | 6187 |
by (intro closed_inter_compact \<open>closed s\<close> compact_cball) |
51346
d33de22432e2
tuned proofs (used continuity of infdist, dist and continuous_attains_sup)
hoelzl
parents:
51345
diff
changeset
|
6188 |
ultimately obtain x where "x \<in> ?B" "\<forall>y\<in>?B. dist a x \<le> dist a y" |
d33de22432e2
tuned proofs (used continuity of infdist, dist and continuous_attains_sup)
hoelzl
parents:
51345
diff
changeset
|
6189 |
by (metis continuous_attains_inf) |
53282 | 6190 |
then show ?thesis by fastforce |
33175 | 6191 |
qed |
6192 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
6193 |
|
60420 | 6194 |
subsection \<open>Pasted sets\<close> |
33175 | 6195 |
|
6196 |
lemma bounded_Times: |
|
53282 | 6197 |
assumes "bounded s" "bounded t" |
6198 |
shows "bounded (s \<times> t)" |
|
6199 |
proof - |
|
33175 | 6200 |
obtain x y a b where "\<forall>z\<in>s. dist x z \<le> a" "\<forall>z\<in>t. dist y z \<le> b" |
6201 |
using assms [unfolded bounded_def] by auto |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
52625
diff
changeset
|
6202 |
then have "\<forall>z\<in>s \<times> t. dist (x, y) z \<le> sqrt (a\<^sup>2 + b\<^sup>2)" |
33175 | 6203 |
by (auto simp add: dist_Pair_Pair real_sqrt_le_mono add_mono power_mono) |
53282 | 6204 |
then show ?thesis unfolding bounded_any_center [where a="(x, y)"] by auto |
33175 | 6205 |
qed |
6206 |
||
6207 |
lemma mem_Times_iff: "x \<in> A \<times> B \<longleftrightarrow> fst x \<in> A \<and> snd x \<in> B" |
|
53282 | 6208 |
by (induct x) simp |
33175 | 6209 |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
6210 |
lemma seq_compact_Times: "seq_compact s \<Longrightarrow> seq_compact t \<Longrightarrow> seq_compact (s \<times> t)" |
53282 | 6211 |
unfolding seq_compact_def |
6212 |
apply clarify |
|
6213 |
apply (drule_tac x="fst \<circ> f" in spec) |
|
6214 |
apply (drule mp, simp add: mem_Times_iff) |
|
6215 |
apply (clarify, rename_tac l1 r1) |
|
6216 |
apply (drule_tac x="snd \<circ> f \<circ> r1" in spec) |
|
6217 |
apply (drule mp, simp add: mem_Times_iff) |
|
6218 |
apply (clarify, rename_tac l2 r2) |
|
6219 |
apply (rule_tac x="(l1, l2)" in rev_bexI, simp) |
|
6220 |
apply (rule_tac x="r1 \<circ> r2" in exI) |
|
6221 |
apply (rule conjI, simp add: subseq_def) |
|
6222 |
apply (drule_tac f=r2 in LIMSEQ_subseq_LIMSEQ, assumption) |
|
6223 |
apply (drule (1) tendsto_Pair) back |
|
6224 |
apply (simp add: o_def) |
|
6225 |
done |
|
6226 |
||
6227 |
lemma compact_Times: |
|
51349 | 6228 |
assumes "compact s" "compact t" |
6229 |
shows "compact (s \<times> t)" |
|
6230 |
proof (rule compactI) |
|
53282 | 6231 |
fix C |
6232 |
assume C: "\<forall>t\<in>C. open t" "s \<times> t \<subseteq> \<Union>C" |
|
51349 | 6233 |
have "\<forall>x\<in>s. \<exists>a. open a \<and> x \<in> a \<and> (\<exists>d\<subseteq>C. finite d \<and> a \<times> t \<subseteq> \<Union>d)" |
6234 |
proof |
|
53282 | 6235 |
fix x |
6236 |
assume "x \<in> s" |
|
51349 | 6237 |
have "\<forall>y\<in>t. \<exists>a b c. c \<in> C \<and> open a \<and> open b \<and> x \<in> a \<and> y \<in> b \<and> a \<times> b \<subseteq> c" (is "\<forall>y\<in>t. ?P y") |
53282 | 6238 |
proof |
6239 |
fix y |
|
6240 |
assume "y \<in> t" |
|
60420 | 6241 |
with \<open>x \<in> s\<close> C obtain c where "c \<in> C" "(x, y) \<in> c" "open c" by auto |
51349 | 6242 |
then show "?P y" by (auto elim!: open_prod_elim) |
6243 |
qed |
|
6244 |
then obtain a b c where b: "\<And>y. y \<in> t \<Longrightarrow> open (b y)" |
|
6245 |
and c: "\<And>y. y \<in> t \<Longrightarrow> c y \<in> C \<and> open (a y) \<and> open (b y) \<and> x \<in> a y \<and> y \<in> b y \<and> a y \<times> b y \<subseteq> c y" |
|
6246 |
by metis |
|
6247 |
then have "\<forall>y\<in>t. open (b y)" "t \<subseteq> (\<Union>y\<in>t. b y)" by auto |
|
60420 | 6248 |
from compactE_image[OF \<open>compact t\<close> this] obtain D where D: "D \<subseteq> t" "finite D" "t \<subseteq> (\<Union>y\<in>D. b y)" |
51349 | 6249 |
by auto |
53374
a14d2a854c02
tuned proofs -- clarified flow of facts wrt. calculation;
wenzelm
parents:
53291
diff
changeset
|
6250 |
moreover from D c have "(\<Inter>y\<in>D. a y) \<times> t \<subseteq> (\<Union>y\<in>D. c y)" |
51349 | 6251 |
by (fastforce simp: subset_eq) |
6252 |
ultimately show "\<exists>a. open a \<and> x \<in> a \<and> (\<exists>d\<subseteq>C. finite d \<and> a \<times> t \<subseteq> \<Union>d)" |
|
52141
eff000cab70f
weaker precendence of syntax for big intersection and union on sets
haftmann
parents:
51773
diff
changeset
|
6253 |
using c by (intro exI[of _ "c`D"] exI[of _ "\<Inter>(a`D)"] conjI) (auto intro!: open_INT) |
51349 | 6254 |
qed |
6255 |
then obtain a d where a: "\<forall>x\<in>s. open (a x)" "s \<subseteq> (\<Union>x\<in>s. a x)" |
|
6256 |
and d: "\<And>x. x \<in> s \<Longrightarrow> d x \<subseteq> C \<and> finite (d x) \<and> a x \<times> t \<subseteq> \<Union>d x" |
|
6257 |
unfolding subset_eq UN_iff by metis |
|
53282 | 6258 |
moreover |
60420 | 6259 |
from compactE_image[OF \<open>compact s\<close> a] |
53282 | 6260 |
obtain e where e: "e \<subseteq> s" "finite e" and s: "s \<subseteq> (\<Union>x\<in>e. a x)" |
6261 |
by auto |
|
51349 | 6262 |
moreover |
53282 | 6263 |
{ |
6264 |
from s have "s \<times> t \<subseteq> (\<Union>x\<in>e. a x \<times> t)" |
|
6265 |
by auto |
|
6266 |
also have "\<dots> \<subseteq> (\<Union>x\<in>e. \<Union>d x)" |
|
60420 | 6267 |
using d \<open>e \<subseteq> s\<close> by (intro UN_mono) auto |
53282 | 6268 |
finally have "s \<times> t \<subseteq> (\<Union>x\<in>e. \<Union>d x)" . |
6269 |
} |
|
51349 | 6270 |
ultimately show "\<exists>C'\<subseteq>C. finite C' \<and> s \<times> t \<subseteq> \<Union>C'" |
6271 |
by (intro exI[of _ "(\<Union>x\<in>e. d x)"]) (auto simp add: subset_eq) |
|
6272 |
qed |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
6273 |
|
60420 | 6274 |
text\<open>Hence some useful properties follow quite easily.\<close> |
33175 | 6275 |
|
6276 |
lemma compact_scaling: |
|
6277 |
fixes s :: "'a::real_normed_vector set" |
|
53282 | 6278 |
assumes "compact s" |
6279 |
shows "compact ((\<lambda>x. c *\<^sub>R x) ` s)" |
|
6280 |
proof - |
|
33175 | 6281 |
let ?f = "\<lambda>x. scaleR c x" |
53282 | 6282 |
have *: "bounded_linear ?f" by (rule bounded_linear_scaleR_right) |
6283 |
show ?thesis |
|
6284 |
using compact_continuous_image[of s ?f] continuous_at_imp_continuous_on[of s ?f] |
|
6285 |
using linear_continuous_at[OF *] assms |
|
6286 |
by auto |
|
33175 | 6287 |
qed |
6288 |
||
6289 |
lemma compact_negations: |
|
6290 |
fixes s :: "'a::real_normed_vector set" |
|
53282 | 6291 |
assumes "compact s" |
53291 | 6292 |
shows "compact ((\<lambda>x. - x) ` s)" |
33175 | 6293 |
using compact_scaling [OF assms, of "- 1"] by auto |
6294 |
||
6295 |
lemma compact_sums: |
|
6296 |
fixes s t :: "'a::real_normed_vector set" |
|
53291 | 6297 |
assumes "compact s" |
6298 |
and "compact t" |
|
53282 | 6299 |
shows "compact {x + y | x y. x \<in> s \<and> y \<in> t}" |
6300 |
proof - |
|
6301 |
have *: "{x + y | x y. x \<in> s \<and> y \<in> t} = (\<lambda>z. fst z + snd z) ` (s \<times> t)" |
|
6302 |
apply auto |
|
6303 |
unfolding image_iff |
|
6304 |
apply (rule_tac x="(xa, y)" in bexI) |
|
6305 |
apply auto |
|
6306 |
done |
|
33175 | 6307 |
have "continuous_on (s \<times> t) (\<lambda>z. fst z + snd z)" |
6308 |
unfolding continuous_on by (rule ballI) (intro tendsto_intros) |
|
53282 | 6309 |
then show ?thesis |
6310 |
unfolding * using compact_continuous_image compact_Times [OF assms] by auto |
|
33175 | 6311 |
qed |
6312 |
||
6313 |
lemma compact_differences: |
|
6314 |
fixes s t :: "'a::real_normed_vector set" |
|
53291 | 6315 |
assumes "compact s" |
6316 |
and "compact t" |
|
6317 |
shows "compact {x - y | x y. x \<in> s \<and> y \<in> t}" |
|
33175 | 6318 |
proof- |
6319 |
have "{x - y | x y. x\<in>s \<and> y \<in> t} = {x + y | x y. x \<in> s \<and> y \<in> (uminus ` t)}" |
|
53282 | 6320 |
apply auto |
6321 |
apply (rule_tac x= xa in exI) |
|
6322 |
apply auto |
|
6323 |
done |
|
6324 |
then show ?thesis |
|
6325 |
using compact_sums[OF assms(1) compact_negations[OF assms(2)]] by auto |
|
33175 | 6326 |
qed |
6327 |
||
6328 |
lemma compact_translation: |
|
6329 |
fixes s :: "'a::real_normed_vector set" |
|
53282 | 6330 |
assumes "compact s" |
6331 |
shows "compact ((\<lambda>x. a + x) ` s)" |
|
6332 |
proof - |
|
6333 |
have "{x + y |x y. x \<in> s \<and> y \<in> {a}} = (\<lambda>x. a + x) ` s" |
|
6334 |
by auto |
|
6335 |
then show ?thesis |
|
6336 |
using compact_sums[OF assms compact_sing[of a]] by auto |
|
33175 | 6337 |
qed |
6338 |
||
6339 |
lemma compact_affinity: |
|
6340 |
fixes s :: "'a::real_normed_vector set" |
|
53282 | 6341 |
assumes "compact s" |
6342 |
shows "compact ((\<lambda>x. a + c *\<^sub>R x) ` s)" |
|
6343 |
proof - |
|
6344 |
have "op + a ` op *\<^sub>R c ` s = (\<lambda>x. a + c *\<^sub>R x) ` s" |
|
6345 |
by auto |
|
6346 |
then show ?thesis |
|
6347 |
using compact_translation[OF compact_scaling[OF assms], of a c] by auto |
|
33175 | 6348 |
qed |
6349 |
||
60420 | 6350 |
text \<open>Hence we get the following.\<close> |
33175 | 6351 |
|
6352 |
lemma compact_sup_maxdistance: |
|
50973
4a2c82644889
generalized diameter from real_normed_vector to metric_space
hoelzl
parents:
50972
diff
changeset
|
6353 |
fixes s :: "'a::metric_space set" |
53291 | 6354 |
assumes "compact s" |
6355 |
and "s \<noteq> {}" |
|
50973
4a2c82644889
generalized diameter from real_normed_vector to metric_space
hoelzl
parents:
50972
diff
changeset
|
6356 |
shows "\<exists>x\<in>s. \<exists>y\<in>s. \<forall>u\<in>s. \<forall>v\<in>s. dist u v \<le> dist x y" |
53282 | 6357 |
proof - |
6358 |
have "compact (s \<times> s)" |
|
60420 | 6359 |
using \<open>compact s\<close> by (intro compact_Times) |
53282 | 6360 |
moreover have "s \<times> s \<noteq> {}" |
60420 | 6361 |
using \<open>s \<noteq> {}\<close> by auto |
50973
4a2c82644889
generalized diameter from real_normed_vector to metric_space
hoelzl
parents:
50972
diff
changeset
|
6362 |
moreover have "continuous_on (s \<times> s) (\<lambda>x. dist (fst x) (snd x))" |
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:
51475
diff
changeset
|
6363 |
by (intro continuous_at_imp_continuous_on ballI continuous_intros) |
50973
4a2c82644889
generalized diameter from real_normed_vector to metric_space
hoelzl
parents:
50972
diff
changeset
|
6364 |
ultimately show ?thesis |
4a2c82644889
generalized diameter from real_normed_vector to metric_space
hoelzl
parents:
50972
diff
changeset
|
6365 |
using continuous_attains_sup[of "s \<times> s" "\<lambda>x. dist (fst x) (snd x)"] by auto |
33175 | 6366 |
qed |
6367 |
||
60420 | 6368 |
text \<open>We can state this in terms of diameter of a set.\<close> |
33175 | 6369 |
|
54260
6a967667fd45
use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents:
54259
diff
changeset
|
6370 |
definition diameter :: "'a::metric_space set \<Rightarrow> real" where |
6a967667fd45
use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents:
54259
diff
changeset
|
6371 |
"diameter S = (if S = {} then 0 else SUP (x,y):S\<times>S. dist x y)" |
50973
4a2c82644889
generalized diameter from real_normed_vector to metric_space
hoelzl
parents:
50972
diff
changeset
|
6372 |
|
4a2c82644889
generalized diameter from real_normed_vector to metric_space
hoelzl
parents:
50972
diff
changeset
|
6373 |
lemma diameter_bounded_bound: |
4a2c82644889
generalized diameter from real_normed_vector to metric_space
hoelzl
parents:
50972
diff
changeset
|
6374 |
fixes s :: "'a :: metric_space set" |
4a2c82644889
generalized diameter from real_normed_vector to metric_space
hoelzl
parents:
50972
diff
changeset
|
6375 |
assumes s: "bounded s" "x \<in> s" "y \<in> s" |
4a2c82644889
generalized diameter from real_normed_vector to metric_space
hoelzl
parents:
50972
diff
changeset
|
6376 |
shows "dist x y \<le> diameter s" |
4a2c82644889
generalized diameter from real_normed_vector to metric_space
hoelzl
parents:
50972
diff
changeset
|
6377 |
proof - |
4a2c82644889
generalized diameter from real_normed_vector to metric_space
hoelzl
parents:
50972
diff
changeset
|
6378 |
from s obtain z d where z: "\<And>x. x \<in> s \<Longrightarrow> dist z x \<le> d" |
4a2c82644889
generalized diameter from real_normed_vector to metric_space
hoelzl
parents:
50972
diff
changeset
|
6379 |
unfolding bounded_def by auto |
61424
c3658c18b7bc
prod_case as canonical name for product type eliminator
haftmann
parents:
61306
diff
changeset
|
6380 |
have "bdd_above (case_prod dist ` (s\<times>s))" |
54260
6a967667fd45
use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents:
54259
diff
changeset
|
6381 |
proof (intro bdd_aboveI, safe) |
6a967667fd45
use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents:
54259
diff
changeset
|
6382 |
fix a b |
6a967667fd45
use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents:
54259
diff
changeset
|
6383 |
assume "a \<in> s" "b \<in> s" |
6a967667fd45
use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents:
54259
diff
changeset
|
6384 |
with z[of a] z[of b] dist_triangle[of a b z] |
6a967667fd45
use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents:
54259
diff
changeset
|
6385 |
show "dist a b \<le> 2 * d" |
6a967667fd45
use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents:
54259
diff
changeset
|
6386 |
by (simp add: dist_commute) |
6a967667fd45
use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents:
54259
diff
changeset
|
6387 |
qed |
6a967667fd45
use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents:
54259
diff
changeset
|
6388 |
moreover have "(x,y) \<in> s\<times>s" using s by auto |
6a967667fd45
use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents:
54259
diff
changeset
|
6389 |
ultimately have "dist x y \<le> (SUP (x,y):s\<times>s. dist x y)" |
6a967667fd45
use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents:
54259
diff
changeset
|
6390 |
by (rule cSUP_upper2) simp |
60420 | 6391 |
with \<open>x \<in> s\<close> show ?thesis |
50973
4a2c82644889
generalized diameter from real_normed_vector to metric_space
hoelzl
parents:
50972
diff
changeset
|
6392 |
by (auto simp add: diameter_def) |
4a2c82644889
generalized diameter from real_normed_vector to metric_space
hoelzl
parents:
50972
diff
changeset
|
6393 |
qed |
4a2c82644889
generalized diameter from real_normed_vector to metric_space
hoelzl
parents:
50972
diff
changeset
|
6394 |
|
4a2c82644889
generalized diameter from real_normed_vector to metric_space
hoelzl
parents:
50972
diff
changeset
|
6395 |
lemma diameter_lower_bounded: |
4a2c82644889
generalized diameter from real_normed_vector to metric_space
hoelzl
parents:
50972
diff
changeset
|
6396 |
fixes s :: "'a :: metric_space set" |
53282 | 6397 |
assumes s: "bounded s" |
6398 |
and d: "0 < d" "d < diameter s" |
|
50973
4a2c82644889
generalized diameter from real_normed_vector to metric_space
hoelzl
parents:
50972
diff
changeset
|
6399 |
shows "\<exists>x\<in>s. \<exists>y\<in>s. d < dist x y" |
4a2c82644889
generalized diameter from real_normed_vector to metric_space
hoelzl
parents:
50972
diff
changeset
|
6400 |
proof (rule ccontr) |
4a2c82644889
generalized diameter from real_normed_vector to metric_space
hoelzl
parents:
50972
diff
changeset
|
6401 |
assume contr: "\<not> ?thesis" |
54260
6a967667fd45
use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents:
54259
diff
changeset
|
6402 |
moreover have "s \<noteq> {}" |
6a967667fd45
use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents:
54259
diff
changeset
|
6403 |
using d by (auto simp add: diameter_def) |
6a967667fd45
use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents:
54259
diff
changeset
|
6404 |
ultimately have "diameter s \<le> d" |
6a967667fd45
use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents:
54259
diff
changeset
|
6405 |
by (auto simp: not_less diameter_def intro!: cSUP_least) |
60420 | 6406 |
with \<open>d < diameter s\<close> show False by auto |
50973
4a2c82644889
generalized diameter from real_normed_vector to metric_space
hoelzl
parents:
50972
diff
changeset
|
6407 |
qed |
33175 | 6408 |
|
6409 |
lemma diameter_bounded: |
|
6410 |
assumes "bounded s" |
|
50973
4a2c82644889
generalized diameter from real_normed_vector to metric_space
hoelzl
parents:
50972
diff
changeset
|
6411 |
shows "\<forall>x\<in>s. \<forall>y\<in>s. dist x y \<le> diameter s" |
53291 | 6412 |
and "\<forall>d>0. d < diameter s \<longrightarrow> (\<exists>x\<in>s. \<exists>y\<in>s. dist x y > d)" |
50973
4a2c82644889
generalized diameter from real_normed_vector to metric_space
hoelzl
parents:
50972
diff
changeset
|
6413 |
using diameter_bounded_bound[of s] diameter_lower_bounded[of s] assms |
4a2c82644889
generalized diameter from real_normed_vector to metric_space
hoelzl
parents:
50972
diff
changeset
|
6414 |
by auto |
33175 | 6415 |
|
6416 |
lemma diameter_compact_attained: |
|
53291 | 6417 |
assumes "compact s" |
6418 |
and "s \<noteq> {}" |
|
50973
4a2c82644889
generalized diameter from real_normed_vector to metric_space
hoelzl
parents:
50972
diff
changeset
|
6419 |
shows "\<exists>x\<in>s. \<exists>y\<in>s. dist x y = diameter s" |
4a2c82644889
generalized diameter from real_normed_vector to metric_space
hoelzl
parents:
50972
diff
changeset
|
6420 |
proof - |
53282 | 6421 |
have b: "bounded s" using assms(1) |
6422 |
by (rule compact_imp_bounded) |
|
53291 | 6423 |
then obtain x y where xys: "x\<in>s" "y\<in>s" |
6424 |
and xy: "\<forall>u\<in>s. \<forall>v\<in>s. dist u v \<le> dist x y" |
|
50973
4a2c82644889
generalized diameter from real_normed_vector to metric_space
hoelzl
parents:
50972
diff
changeset
|
6425 |
using compact_sup_maxdistance[OF assms] by auto |
53282 | 6426 |
then have "diameter s \<le> dist x y" |
6427 |
unfolding diameter_def |
|
6428 |
apply clarsimp |
|
54260
6a967667fd45
use INF and SUP on conditionally complete lattices in multivariate analysis
hoelzl
parents:
54259
diff
changeset
|
6429 |
apply (rule cSUP_least) |
53282 | 6430 |
apply fast+ |
6431 |
done |
|
6432 |
then show ?thesis |
|
36362
06475a1547cb
fix lots of looping simp calls and other warnings
huffman
parents:
36360
diff
changeset
|
6433 |
by (metis b diameter_bounded_bound order_antisym xys) |
33175 | 6434 |
qed |
6435 |
||
60420 | 6436 |
text \<open>Related results with closure as the conclusion.\<close> |
33175 | 6437 |
|
6438 |
lemma closed_scaling: |
|
6439 |
fixes s :: "'a::real_normed_vector set" |
|
53282 | 6440 |
assumes "closed s" |
6441 |
shows "closed ((\<lambda>x. c *\<^sub>R x) ` s)" |
|
53813 | 6442 |
proof (cases "c = 0") |
6443 |
case True then show ?thesis |
|
6444 |
by (auto simp add: image_constant_conv) |
|
33175 | 6445 |
next |
6446 |
case False |
|
53813 | 6447 |
from assms have "closed ((\<lambda>x. inverse c *\<^sub>R x) -` s)" |
6448 |
by (simp add: continuous_closed_vimage) |
|
6449 |
also have "(\<lambda>x. inverse c *\<^sub>R x) -` s = (\<lambda>x. c *\<^sub>R x) ` s" |
|
60420 | 6450 |
using \<open>c \<noteq> 0\<close> by (auto elim: image_eqI [rotated]) |
53813 | 6451 |
finally show ?thesis . |
33175 | 6452 |
qed |
6453 |
||
6454 |
lemma closed_negations: |
|
6455 |
fixes s :: "'a::real_normed_vector set" |
|
53282 | 6456 |
assumes "closed s" |
6457 |
shows "closed ((\<lambda>x. -x) ` s)" |
|
33175 | 6458 |
using closed_scaling[OF assms, of "- 1"] by simp |
6459 |
||
6460 |
lemma compact_closed_sums: |
|
6461 |
fixes s :: "'a::real_normed_vector set" |
|
53282 | 6462 |
assumes "compact s" and "closed t" |
6463 |
shows "closed {x + y | x y. x \<in> s \<and> y \<in> t}" |
|
6464 |
proof - |
|
33175 | 6465 |
let ?S = "{x + y |x y. x \<in> s \<and> y \<in> t}" |
53282 | 6466 |
{ |
6467 |
fix x l |
|
6468 |
assume as: "\<forall>n. x n \<in> ?S" "(x ---> l) sequentially" |
|
6469 |
from as(1) obtain f where f: "\<forall>n. x n = fst (f n) + snd (f n)" "\<forall>n. fst (f n) \<in> s" "\<forall>n. snd (f n) \<in> t" |
|
33175 | 6470 |
using choice[of "\<lambda>n y. x n = (fst y) + (snd y) \<and> fst y \<in> s \<and> snd y \<in> t"] by auto |
53282 | 6471 |
obtain l' r where "l'\<in>s" and r: "subseq r" and lr: "(((\<lambda>n. fst (f n)) \<circ> r) ---> l') sequentially" |
33175 | 6472 |
using assms(1)[unfolded compact_def, THEN spec[where x="\<lambda> n. fst (f n)"]] using f(2) by auto |
6473 |
have "((\<lambda>n. snd (f (r n))) ---> l - l') sequentially" |
|
53282 | 6474 |
using tendsto_diff[OF LIMSEQ_subseq_LIMSEQ[OF as(2) r] lr] and f(1) |
6475 |
unfolding o_def |
|
6476 |
by auto |
|
6477 |
then have "l - l' \<in> t" |
|
53291 | 6478 |
using assms(2)[unfolded closed_sequential_limits, |
6479 |
THEN spec[where x="\<lambda> n. snd (f (r n))"], |
|
6480 |
THEN spec[where x="l - l'"]] |
|
53282 | 6481 |
using f(3) |
6482 |
by auto |
|
6483 |
then have "l \<in> ?S" |
|
60420 | 6484 |
using \<open>l' \<in> s\<close> |
53282 | 6485 |
apply auto |
6486 |
apply (rule_tac x=l' in exI) |
|
6487 |
apply (rule_tac x="l - l'" in exI) |
|
6488 |
apply auto |
|
6489 |
done |
|
33175 | 6490 |
} |
53282 | 6491 |
then show ?thesis |
6492 |
unfolding closed_sequential_limits by fast |
|
33175 | 6493 |
qed |
6494 |
||
6495 |
lemma closed_compact_sums: |
|
6496 |
fixes s t :: "'a::real_normed_vector set" |
|
53291 | 6497 |
assumes "closed s" |
6498 |
and "compact t" |
|
33175 | 6499 |
shows "closed {x + y | x y. x \<in> s \<and> y \<in> t}" |
53282 | 6500 |
proof - |
6501 |
have "{x + y |x y. x \<in> t \<and> y \<in> s} = {x + y |x y. x \<in> s \<and> y \<in> t}" |
|
6502 |
apply auto |
|
6503 |
apply (rule_tac x=y in exI) |
|
6504 |
apply auto |
|
6505 |
apply (rule_tac x=y in exI) |
|
6506 |
apply auto |
|
6507 |
done |
|
6508 |
then show ?thesis |
|
6509 |
using compact_closed_sums[OF assms(2,1)] by simp |
|
33175 | 6510 |
qed |
6511 |
||
6512 |
lemma compact_closed_differences: |
|
6513 |
fixes s t :: "'a::real_normed_vector set" |
|
53291 | 6514 |
assumes "compact s" |
6515 |
and "closed t" |
|
33175 | 6516 |
shows "closed {x - y | x y. x \<in> s \<and> y \<in> t}" |
53282 | 6517 |
proof - |
33175 | 6518 |
have "{x + y |x y. x \<in> s \<and> y \<in> uminus ` t} = {x - y |x y. x \<in> s \<and> y \<in> t}" |
53282 | 6519 |
apply auto |
6520 |
apply (rule_tac x=xa in exI) |
|
6521 |
apply auto |
|
6522 |
apply (rule_tac x=xa in exI) |
|
6523 |
apply auto |
|
6524 |
done |
|
6525 |
then show ?thesis |
|
6526 |
using compact_closed_sums[OF assms(1) closed_negations[OF assms(2)]] by auto |
|
33175 | 6527 |
qed |
6528 |
||
6529 |
lemma closed_compact_differences: |
|
6530 |
fixes s t :: "'a::real_normed_vector set" |
|
53291 | 6531 |
assumes "closed s" |
6532 |
and "compact t" |
|
33175 | 6533 |
shows "closed {x - y | x y. x \<in> s \<and> y \<in> t}" |
53282 | 6534 |
proof - |
33175 | 6535 |
have "{x + y |x y. x \<in> s \<and> y \<in> uminus ` t} = {x - y |x y. x \<in> s \<and> y \<in> t}" |
53282 | 6536 |
apply auto |
6537 |
apply (rule_tac x=xa in exI) |
|
6538 |
apply auto |
|
6539 |
apply (rule_tac x=xa in exI) |
|
6540 |
apply auto |
|
6541 |
done |
|
6542 |
then show ?thesis |
|
6543 |
using closed_compact_sums[OF assms(1) compact_negations[OF assms(2)]] by simp |
|
33175 | 6544 |
qed |
6545 |
||
6546 |
lemma closed_translation: |
|
6547 |
fixes a :: "'a::real_normed_vector" |
|
53282 | 6548 |
assumes "closed s" |
6549 |
shows "closed ((\<lambda>x. a + x) ` s)" |
|
6550 |
proof - |
|
33175 | 6551 |
have "{a + y |y. y \<in> s} = (op + a ` s)" by auto |
53282 | 6552 |
then show ?thesis |
6553 |
using compact_closed_sums[OF compact_sing[of a] assms] by auto |
|
33175 | 6554 |
qed |
6555 |
||
34105 | 6556 |
lemma translation_Compl: |
6557 |
fixes a :: "'a::ab_group_add" |
|
6558 |
shows "(\<lambda>x. a + x) ` (- t) = - ((\<lambda>x. a + x) ` t)" |
|
53282 | 6559 |
apply (auto simp add: image_iff) |
6560 |
apply (rule_tac x="x - a" in bexI) |
|
6561 |
apply auto |
|
6562 |
done |
|
34105 | 6563 |
|
33175 | 6564 |
lemma translation_UNIV: |
53282 | 6565 |
fixes a :: "'a::ab_group_add" |
6566 |
shows "range (\<lambda>x. a + x) = UNIV" |
|
6567 |
apply (auto simp add: image_iff) |
|
6568 |
apply (rule_tac x="x - a" in exI) |
|
6569 |
apply auto |
|
6570 |
done |
|
33175 | 6571 |
|
6572 |
lemma translation_diff: |
|
6573 |
fixes a :: "'a::ab_group_add" |
|
6574 |
shows "(\<lambda>x. a + x) ` (s - t) = ((\<lambda>x. a + x) ` s) - ((\<lambda>x. a + x) ` t)" |
|
6575 |
by auto |
|
6576 |
||
6577 |
lemma closure_translation: |
|
6578 |
fixes a :: "'a::real_normed_vector" |
|
6579 |
shows "closure ((\<lambda>x. a + x) ` s) = (\<lambda>x. a + x) ` (closure s)" |
|
53282 | 6580 |
proof - |
6581 |
have *: "op + a ` (- s) = - op + a ` s" |
|
6582 |
apply auto |
|
6583 |
unfolding image_iff |
|
6584 |
apply (rule_tac x="x - a" in bexI) |
|
6585 |
apply auto |
|
6586 |
done |
|
6587 |
show ?thesis |
|
6588 |
unfolding closure_interior translation_Compl |
|
6589 |
using interior_translation[of a "- s"] |
|
6590 |
unfolding * |
|
6591 |
by auto |
|
33175 | 6592 |
qed |
6593 |
||
6594 |
lemma frontier_translation: |
|
6595 |
fixes a :: "'a::real_normed_vector" |
|
6596 |
shows "frontier((\<lambda>x. a + x) ` s) = (\<lambda>x. a + x) ` (frontier s)" |
|
53282 | 6597 |
unfolding frontier_def translation_diff interior_translation closure_translation |
6598 |
by auto |
|
33175 | 6599 |
|
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
6600 |
|
60420 | 6601 |
subsection \<open>Separation between points and sets\<close> |
33175 | 6602 |
|
6603 |
lemma separate_point_closed: |
|
6604 |
fixes s :: "'a::heine_borel set" |
|
53291 | 6605 |
assumes "closed s" |
6606 |
and "a \<notin> s" |
|
53282 | 6607 |
shows "\<exists>d>0. \<forall>x\<in>s. d \<le> dist a x" |
6608 |
proof (cases "s = {}") |
|
33175 | 6609 |
case True |
53282 | 6610 |
then show ?thesis by(auto intro!: exI[where x=1]) |
33175 | 6611 |
next |
6612 |
case False |
|
53282 | 6613 |
from assms obtain x where "x\<in>s" "\<forall>y\<in>s. dist a x \<le> dist a y" |
60420 | 6614 |
using \<open>s \<noteq> {}\<close> distance_attains_inf [of s a] by blast |
6615 |
with \<open>x\<in>s\<close> show ?thesis using dist_pos_lt[of a x] and\<open>a \<notin> s\<close> |
|
53282 | 6616 |
by blast |
33175 | 6617 |
qed |
6618 |
||
6619 |
lemma separate_compact_closed: |
|
50949 | 6620 |
fixes s t :: "'a::heine_borel set" |
53282 | 6621 |
assumes "compact s" |
6622 |
and t: "closed t" "s \<inter> t = {}" |
|
33175 | 6623 |
shows "\<exists>d>0. \<forall>x\<in>s. \<forall>y\<in>t. d \<le> dist x y" |
51346
d33de22432e2
tuned proofs (used continuity of infdist, dist and continuous_attains_sup)
hoelzl
parents:
51345
diff
changeset
|
6624 |
proof cases |
d33de22432e2
tuned proofs (used continuity of infdist, dist and continuous_attains_sup)
hoelzl
parents:
51345
diff
changeset
|
6625 |
assume "s \<noteq> {} \<and> t \<noteq> {}" |
d33de22432e2
tuned proofs (used continuity of infdist, dist and continuous_attains_sup)
hoelzl
parents:
51345
diff
changeset
|
6626 |
then have "s \<noteq> {}" "t \<noteq> {}" by auto |
d33de22432e2
tuned proofs (used continuity of infdist, dist and continuous_attains_sup)
hoelzl
parents:
51345
diff
changeset
|
6627 |
let ?inf = "\<lambda>x. infdist x t" |
d33de22432e2
tuned proofs (used continuity of infdist, dist and continuous_attains_sup)
hoelzl
parents:
51345
diff
changeset
|
6628 |
have "continuous_on s ?inf" |
d33de22432e2
tuned proofs (used continuity of infdist, dist and continuous_attains_sup)
hoelzl
parents:
51345
diff
changeset
|
6629 |
by (auto intro!: continuous_at_imp_continuous_on continuous_infdist continuous_at_id) |
d33de22432e2
tuned proofs (used continuity of infdist, dist and continuous_attains_sup)
hoelzl
parents:
51345
diff
changeset
|
6630 |
then obtain x where x: "x \<in> s" "\<forall>y\<in>s. ?inf x \<le> ?inf y" |
60420 | 6631 |
using continuous_attains_inf[OF \<open>compact s\<close> \<open>s \<noteq> {}\<close>] by auto |
51346
d33de22432e2
tuned proofs (used continuity of infdist, dist and continuous_attains_sup)
hoelzl
parents:
51345
diff
changeset
|
6632 |
then have "0 < ?inf x" |
60420 | 6633 |
using t \<open>t \<noteq> {}\<close> in_closed_iff_infdist_zero by (auto simp: less_le infdist_nonneg) |
51346
d33de22432e2
tuned proofs (used continuity of infdist, dist and continuous_attains_sup)
hoelzl
parents:
51345
diff
changeset
|
6634 |
moreover have "\<forall>x'\<in>s. \<forall>y\<in>t. ?inf x \<le> dist x' y" |
d33de22432e2
tuned proofs (used continuity of infdist, dist and continuous_attains_sup)
hoelzl
parents:
51345
diff
changeset
|
6635 |
using x by (auto intro: order_trans infdist_le) |
53282 | 6636 |
ultimately show ?thesis by auto |
51346
d33de22432e2
tuned proofs (used continuity of infdist, dist and continuous_attains_sup)
hoelzl
parents:
51345
diff
changeset
|
6637 |
qed (auto intro!: exI[of _ 1]) |
33175 | 6638 |
|
6639 |
lemma separate_closed_compact: |
|
50949 | 6640 |
fixes s t :: "'a::heine_borel set" |
53282 | 6641 |
assumes "closed s" |
6642 |
and "compact t" |
|
6643 |
and "s \<inter> t = {}" |
|
33175 | 6644 |
shows "\<exists>d>0. \<forall>x\<in>s. \<forall>y\<in>t. d \<le> dist x y" |
53282 | 6645 |
proof - |
6646 |
have *: "t \<inter> s = {}" |
|
6647 |
using assms(3) by auto |
|
6648 |
show ?thesis |
|
6649 |
using separate_compact_closed[OF assms(2,1) *] |
|
6650 |
apply auto |
|
6651 |
apply (rule_tac x=d in exI) |
|
6652 |
apply auto |
|
6653 |
apply (erule_tac x=y in ballE) |
|
6654 |
apply (auto simp add: dist_commute) |
|
6655 |
done |
|
33175 | 6656 |
qed |
6657 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
6658 |
|
60420 | 6659 |
subsection \<open>Closure of halfspaces and hyperplanes\<close> |
33175 | 6660 |
|
44219
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
6661 |
lemma isCont_open_vimage: |
53282 | 6662 |
assumes "\<And>x. isCont f x" |
6663 |
and "open s" |
|
6664 |
shows "open (f -` s)" |
|
44219
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
6665 |
proof - |
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
6666 |
from assms(1) have "continuous_on UNIV f" |
51641
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents:
51530
diff
changeset
|
6667 |
unfolding isCont_def continuous_on_def by simp |
53282 | 6668 |
then have "open {x \<in> UNIV. f x \<in> s}" |
60420 | 6669 |
using open_UNIV \<open>open s\<close> by (rule continuous_open_preimage) |
53282 | 6670 |
then show "open (f -` s)" |
44219
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
6671 |
by (simp add: vimage_def) |
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
6672 |
qed |
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
6673 |
|
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
6674 |
lemma isCont_closed_vimage: |
53282 | 6675 |
assumes "\<And>x. isCont f x" |
6676 |
and "closed s" |
|
6677 |
shows "closed (f -` s)" |
|
44219
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
6678 |
using assms unfolding closed_def vimage_Compl [symmetric] |
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
6679 |
by (rule isCont_open_vimage) |
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
6680 |
|
44213
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
6681 |
lemma open_Collect_less: |
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:
51475
diff
changeset
|
6682 |
fixes f g :: "'a::t2_space \<Rightarrow> real" |
44219
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
6683 |
assumes f: "\<And>x. isCont f x" |
53282 | 6684 |
and g: "\<And>x. isCont g x" |
44213
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
6685 |
shows "open {x. f x < g x}" |
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
6686 |
proof - |
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
6687 |
have "open ((\<lambda>x. g x - f x) -` {0<..})" |
44219
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
6688 |
using isCont_diff [OF g f] open_real_greaterThan |
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
6689 |
by (rule isCont_open_vimage) |
44213
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
6690 |
also have "((\<lambda>x. g x - f x) -` {0<..}) = {x. f x < g x}" |
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
6691 |
by auto |
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
6692 |
finally show ?thesis . |
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
6693 |
qed |
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
6694 |
|
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
6695 |
lemma closed_Collect_le: |
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:
51475
diff
changeset
|
6696 |
fixes f g :: "'a::t2_space \<Rightarrow> real" |
44219
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
6697 |
assumes f: "\<And>x. isCont f x" |
53282 | 6698 |
and g: "\<And>x. isCont g x" |
44213
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
6699 |
shows "closed {x. f x \<le> g x}" |
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
6700 |
proof - |
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
6701 |
have "closed ((\<lambda>x. g x - f x) -` {0..})" |
44219
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
6702 |
using isCont_diff [OF g f] closed_real_atLeast |
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
6703 |
by (rule isCont_closed_vimage) |
44213
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
6704 |
also have "((\<lambda>x. g x - f x) -` {0..}) = {x. f x \<le> g x}" |
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
6705 |
by auto |
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
6706 |
finally show ?thesis . |
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
6707 |
qed |
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
6708 |
|
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
6709 |
lemma closed_Collect_eq: |
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:
51475
diff
changeset
|
6710 |
fixes f g :: "'a::t2_space \<Rightarrow> 'b::t2_space" |
44219
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
6711 |
assumes f: "\<And>x. isCont f x" |
53282 | 6712 |
and g: "\<And>x. isCont g x" |
44213
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
6713 |
shows "closed {x. f x = g x}" |
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
6714 |
proof - |
44216 | 6715 |
have "open {(x::'b, y::'b). x \<noteq> y}" |
6716 |
unfolding open_prod_def by (auto dest!: hausdorff) |
|
53282 | 6717 |
then have "closed {(x::'b, y::'b). x = y}" |
44216 | 6718 |
unfolding closed_def split_def Collect_neg_eq . |
44219
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
6719 |
with isCont_Pair [OF f g] |
44216 | 6720 |
have "closed ((\<lambda>x. (f x, g x)) -` {(x, y). x = y})" |
44219
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
6721 |
by (rule isCont_closed_vimage) |
44216 | 6722 |
also have "\<dots> = {x. f x = g x}" by auto |
44213
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
6723 |
finally show ?thesis . |
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
6724 |
qed |
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
6725 |
|
60974
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
6726 |
lemma continuous_on_closed_Collect_le: |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
6727 |
fixes f g :: "'a::t2_space \<Rightarrow> real" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
6728 |
assumes f: "continuous_on s f" and g: "continuous_on s g" and s: "closed s" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
6729 |
shows "closed {x \<in> s. f x \<le> g x}" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
6730 |
proof - |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
6731 |
have "closed ((\<lambda>x. g x - f x) -` {0..} \<inter> s)" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
6732 |
using closed_real_atLeast continuous_on_diff [OF g f] |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
6733 |
by (simp add: continuous_on_closed_vimage [OF s]) |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
6734 |
also have "((\<lambda>x. g x - f x) -` {0..} \<inter> s) = {x\<in>s. f x \<le> g x}" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
6735 |
by auto |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
6736 |
finally show ?thesis . |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
6737 |
qed |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
6738 |
|
33175 | 6739 |
lemma continuous_at_inner: "continuous (at x) (inner a)" |
6740 |
unfolding continuous_at by (intro tendsto_intros) |
|
6741 |
||
6742 |
lemma closed_halfspace_le: "closed {x. inner a x \<le> b}" |
|
44233 | 6743 |
by (simp add: closed_Collect_le) |
33175 | 6744 |
|
6745 |
lemma closed_halfspace_ge: "closed {x. inner a x \<ge> b}" |
|
44233 | 6746 |
by (simp add: closed_Collect_le) |
33175 | 6747 |
|
6748 |
lemma closed_hyperplane: "closed {x. inner a x = b}" |
|
44233 | 6749 |
by (simp add: closed_Collect_eq) |
33175 | 6750 |
|
53282 | 6751 |
lemma closed_halfspace_component_le: "closed {x::'a::euclidean_space. x\<bullet>i \<le> a}" |
44233 | 6752 |
by (simp add: closed_Collect_le) |
33175 | 6753 |
|
53282 | 6754 |
lemma closed_halfspace_component_ge: "closed {x::'a::euclidean_space. x\<bullet>i \<ge> a}" |
44233 | 6755 |
by (simp add: closed_Collect_le) |
33175 | 6756 |
|
53813 | 6757 |
lemma closed_interval_left: |
6758 |
fixes b :: "'a::euclidean_space" |
|
6759 |
shows "closed {x::'a. \<forall>i\<in>Basis. x\<bullet>i \<le> b\<bullet>i}" |
|
6760 |
by (simp add: Collect_ball_eq closed_INT closed_Collect_le) |
|
6761 |
||
6762 |
lemma closed_interval_right: |
|
6763 |
fixes a :: "'a::euclidean_space" |
|
6764 |
shows "closed {x::'a. \<forall>i\<in>Basis. a\<bullet>i \<le> x\<bullet>i}" |
|
6765 |
by (simp add: Collect_ball_eq closed_INT closed_Collect_le) |
|
6766 |
||
60974
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
6767 |
lemma continuous_le_on_closure: |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
6768 |
fixes a::real |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
6769 |
assumes f: "continuous_on (closure s) f" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
6770 |
and x: "x \<in> closure(s)" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
6771 |
and xlo: "\<And>x. x \<in> s ==> f(x) \<le> a" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
6772 |
shows "f(x) \<le> a" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
6773 |
using image_closure_subset [OF f] |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
6774 |
using image_closure_subset [OF f] closed_halfspace_le [of "1::real" a] assms |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
6775 |
by force |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
6776 |
|
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
6777 |
lemma continuous_ge_on_closure: |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
6778 |
fixes a::real |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
6779 |
assumes f: "continuous_on (closure s) f" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
6780 |
and x: "x \<in> closure(s)" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
6781 |
and xlo: "\<And>x. x \<in> s ==> f(x) \<ge> a" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
6782 |
shows "f(x) \<ge> a" |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
6783 |
using image_closure_subset [OF f] closed_halfspace_ge [of a "1::real"] assms |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
6784 |
by force |
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
6785 |
|
60420 | 6786 |
text \<open>Openness of halfspaces.\<close> |
33175 | 6787 |
|
6788 |
lemma open_halfspace_lt: "open {x. inner a x < b}" |
|
44233 | 6789 |
by (simp add: open_Collect_less) |
33175 | 6790 |
|
6791 |
lemma open_halfspace_gt: "open {x. inner a x > b}" |
|
44233 | 6792 |
by (simp add: open_Collect_less) |
33175 | 6793 |
|
53282 | 6794 |
lemma open_halfspace_component_lt: "open {x::'a::euclidean_space. x\<bullet>i < a}" |
44233 | 6795 |
by (simp add: open_Collect_less) |
33175 | 6796 |
|
53282 | 6797 |
lemma open_halfspace_component_gt: "open {x::'a::euclidean_space. x\<bullet>i > a}" |
44233 | 6798 |
by (simp add: open_Collect_less) |
33175 | 6799 |
|
60420 | 6800 |
text \<open>This gives a simple derivation of limit component bounds.\<close> |
33175 | 6801 |
|
53282 | 6802 |
lemma Lim_component_le: |
6803 |
fixes f :: "'a \<Rightarrow> 'b::euclidean_space" |
|
6804 |
assumes "(f ---> l) net" |
|
6805 |
and "\<not> (trivial_limit net)" |
|
6806 |
and "eventually (\<lambda>x. f(x)\<bullet>i \<le> b) net" |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
6807 |
shows "l\<bullet>i \<le> b" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
6808 |
by (rule tendsto_le[OF assms(2) tendsto_const tendsto_inner[OF assms(1) tendsto_const] assms(3)]) |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
6809 |
|
53282 | 6810 |
lemma Lim_component_ge: |
6811 |
fixes f :: "'a \<Rightarrow> 'b::euclidean_space" |
|
6812 |
assumes "(f ---> l) net" |
|
6813 |
and "\<not> (trivial_limit net)" |
|
6814 |
and "eventually (\<lambda>x. b \<le> (f x)\<bullet>i) net" |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
6815 |
shows "b \<le> l\<bullet>i" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
6816 |
by (rule tendsto_le[OF assms(2) tendsto_inner[OF assms(1) tendsto_const] tendsto_const assms(3)]) |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
6817 |
|
53282 | 6818 |
lemma Lim_component_eq: |
6819 |
fixes f :: "'a \<Rightarrow> 'b::euclidean_space" |
|
53640 | 6820 |
assumes net: "(f ---> l) net" "\<not> trivial_limit net" |
53282 | 6821 |
and ev:"eventually (\<lambda>x. f(x)\<bullet>i = b) net" |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
6822 |
shows "l\<bullet>i = b" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
6823 |
using ev[unfolded order_eq_iff eventually_conj_iff] |
53282 | 6824 |
using Lim_component_ge[OF net, of b i] |
6825 |
using Lim_component_le[OF net, of i b] |
|
6826 |
by auto |
|
6827 |
||
60420 | 6828 |
text \<open>Limits relative to a union.\<close> |
33175 | 6829 |
|
6830 |
lemma eventually_within_Un: |
|
53282 | 6831 |
"eventually P (at x within (s \<union> t)) \<longleftrightarrow> |
6832 |
eventually P (at x within s) \<and> eventually P (at x within t)" |
|
51641
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents:
51530
diff
changeset
|
6833 |
unfolding eventually_at_filter |
33175 | 6834 |
by (auto elim!: eventually_rev_mp) |
6835 |
||
6836 |
lemma Lim_within_union: |
|
51641
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents:
51530
diff
changeset
|
6837 |
"(f ---> l) (at x within (s \<union> t)) \<longleftrightarrow> |
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents:
51530
diff
changeset
|
6838 |
(f ---> l) (at x within s) \<and> (f ---> l) (at x within t)" |
33175 | 6839 |
unfolding tendsto_def |
6840 |
by (auto simp add: eventually_within_Un) |
|
6841 |
||
36442 | 6842 |
lemma Lim_topological: |
53282 | 6843 |
"(f ---> l) net \<longleftrightarrow> |
6844 |
trivial_limit net \<or> (\<forall>S. open S \<longrightarrow> l \<in> S \<longrightarrow> eventually (\<lambda>x. f x \<in> S) net)" |
|
36442 | 6845 |
unfolding tendsto_def trivial_limit_eq by auto |
6846 |
||
61306
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
6847 |
text \<open>Continuity relative to a union.\<close> |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
6848 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
6849 |
lemma continuous_on_union_local: |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
6850 |
"\<lbrakk>closedin (subtopology euclidean (s \<union> t)) s; closedin (subtopology euclidean (s \<union> t)) t; |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
6851 |
continuous_on s f; continuous_on t f\<rbrakk> |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
6852 |
\<Longrightarrow> continuous_on (s \<union> t) f" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
6853 |
unfolding continuous_on closed_in_limpt |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
6854 |
by (metis Lim_trivial_limit Lim_within_union Un_iff trivial_limit_within) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
6855 |
|
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
6856 |
lemma continuous_on_cases_local: |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
6857 |
"\<lbrakk>closedin (subtopology euclidean (s \<union> t)) s; closedin (subtopology euclidean (s \<union> t)) t; |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
6858 |
continuous_on s f; continuous_on t g; |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
6859 |
\<And>x. \<lbrakk>x \<in> s \<and> ~P x \<or> x \<in> t \<and> P x\<rbrakk> \<Longrightarrow> f x = g x\<rbrakk> |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
6860 |
\<Longrightarrow> continuous_on (s \<union> t) (\<lambda>x. if P x then f x else g x)" |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
6861 |
by (rule continuous_on_union_local) (auto intro: continuous_on_eq) |
9dd394c866fc
New theorems about connected sets. And pairwise moved to Set.thy.
paulson <lp15@cam.ac.uk>
parents:
61284
diff
changeset
|
6862 |
|
60420 | 6863 |
text\<open>Some more convenient intermediate-value theorem formulations.\<close> |
33175 | 6864 |
|
6865 |
lemma connected_ivt_hyperplane: |
|
53291 | 6866 |
assumes "connected s" |
6867 |
and "x \<in> s" |
|
6868 |
and "y \<in> s" |
|
6869 |
and "inner a x \<le> b" |
|
6870 |
and "b \<le> inner a y" |
|
33175 | 6871 |
shows "\<exists>z \<in> s. inner a z = b" |
53282 | 6872 |
proof (rule ccontr) |
33175 | 6873 |
assume as:"\<not> (\<exists>z\<in>s. inner a z = b)" |
6874 |
let ?A = "{x. inner a x < b}" |
|
6875 |
let ?B = "{x. inner a x > b}" |
|
53282 | 6876 |
have "open ?A" "open ?B" |
6877 |
using open_halfspace_lt and open_halfspace_gt by auto |
|
53291 | 6878 |
moreover |
6879 |
have "?A \<inter> ?B = {}" by auto |
|
6880 |
moreover |
|
6881 |
have "s \<subseteq> ?A \<union> ?B" using as by auto |
|
6882 |
ultimately |
|
6883 |
show False |
|
53282 | 6884 |
using assms(1)[unfolded connected_def not_ex, |
6885 |
THEN spec[where x="?A"], THEN spec[where x="?B"]] |
|
6886 |
using assms(2-5) |
|
52625 | 6887 |
by auto |
6888 |
qed |
|
6889 |
||
6890 |
lemma connected_ivt_component: |
|
6891 |
fixes x::"'a::euclidean_space" |
|
6892 |
shows "connected s \<Longrightarrow> |
|
6893 |
x \<in> s \<Longrightarrow> y \<in> s \<Longrightarrow> |
|
6894 |
x\<bullet>k \<le> a \<Longrightarrow> a \<le> y\<bullet>k \<Longrightarrow> (\<exists>z\<in>s. z\<bullet>k = a)" |
|
6895 |
using connected_ivt_hyperplane[of s x y "k::'a" a] |
|
6896 |
by (auto simp: inner_commute) |
|
33175 | 6897 |
|
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
6898 |
|
60420 | 6899 |
subsection \<open>Intervals\<close> |
56189
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6900 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6901 |
lemma open_box[intro]: "open (box a b)" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6902 |
proof - |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6903 |
have "open (\<Inter>i\<in>Basis. (op \<bullet> i) -` {a \<bullet> i <..< b \<bullet> i})" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6904 |
by (auto intro!: continuous_open_vimage continuous_inner continuous_at_id continuous_const) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6905 |
also have "(\<Inter>i\<in>Basis. (op \<bullet> i) -` {a \<bullet> i <..< b \<bullet> i}) = box a b" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6906 |
by (auto simp add: box_def inner_commute) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6907 |
finally show ?thesis . |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6908 |
qed |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6909 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6910 |
instance euclidean_space \<subseteq> second_countable_topology |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6911 |
proof |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6912 |
def a \<equiv> "\<lambda>f :: 'a \<Rightarrow> (real \<times> real). \<Sum>i\<in>Basis. fst (f i) *\<^sub>R i" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6913 |
then have a: "\<And>f. (\<Sum>i\<in>Basis. fst (f i) *\<^sub>R i) = a f" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6914 |
by simp |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6915 |
def b \<equiv> "\<lambda>f :: 'a \<Rightarrow> (real \<times> real). \<Sum>i\<in>Basis. snd (f i) *\<^sub>R i" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6916 |
then have b: "\<And>f. (\<Sum>i\<in>Basis. snd (f i) *\<^sub>R i) = b f" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6917 |
by simp |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6918 |
def B \<equiv> "(\<lambda>f. box (a f) (b f)) ` (Basis \<rightarrow>\<^sub>E (\<rat> \<times> \<rat>))" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6919 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6920 |
have "Ball B open" by (simp add: B_def open_box) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6921 |
moreover have "(\<forall>A. open A \<longrightarrow> (\<exists>B'\<subseteq>B. \<Union>B' = A))" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6922 |
proof safe |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6923 |
fix A::"'a set" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6924 |
assume "open A" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6925 |
show "\<exists>B'\<subseteq>B. \<Union>B' = A" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6926 |
apply (rule exI[of _ "{b\<in>B. b \<subseteq> A}"]) |
60420 | 6927 |
apply (subst (3) open_UNION_box[OF \<open>open A\<close>]) |
56189
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6928 |
apply (auto simp add: a b B_def) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6929 |
done |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6930 |
qed |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6931 |
ultimately |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6932 |
have "topological_basis B" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6933 |
unfolding topological_basis_def by blast |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6934 |
moreover |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6935 |
have "countable B" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6936 |
unfolding B_def |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6937 |
by (intro countable_image countable_PiE finite_Basis countable_SIGMA countable_rat) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6938 |
ultimately show "\<exists>B::'a set set. countable B \<and> open = generate_topology B" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6939 |
by (blast intro: topological_basis_imp_subbasis) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6940 |
qed |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6941 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6942 |
instance euclidean_space \<subseteq> polish_space .. |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6943 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6944 |
lemma closed_cbox[intro]: |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6945 |
fixes a b :: "'a::euclidean_space" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6946 |
shows "closed (cbox a b)" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6947 |
proof - |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6948 |
have "closed (\<Inter>i\<in>Basis. (\<lambda>x. x\<bullet>i) -` {a\<bullet>i .. b\<bullet>i})" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6949 |
by (intro closed_INT ballI continuous_closed_vimage allI |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6950 |
linear_continuous_at closed_real_atLeastAtMost finite_Basis bounded_linear_inner_left) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6951 |
also have "(\<Inter>i\<in>Basis. (\<lambda>x. x\<bullet>i) -` {a\<bullet>i .. b\<bullet>i}) = cbox a b" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6952 |
by (auto simp add: cbox_def) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6953 |
finally show "closed (cbox a b)" . |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6954 |
qed |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6955 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6956 |
lemma interior_cbox [intro]: |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6957 |
fixes a b :: "'a::euclidean_space" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6958 |
shows "interior (cbox a b) = box a b" (is "?L = ?R") |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6959 |
proof(rule subset_antisym) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6960 |
show "?R \<subseteq> ?L" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6961 |
using box_subset_cbox open_box |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6962 |
by (rule interior_maximal) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6963 |
{ |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6964 |
fix x |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6965 |
assume "x \<in> interior (cbox a b)" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6966 |
then obtain s where s: "open s" "x \<in> s" "s \<subseteq> cbox a b" .. |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6967 |
then obtain e where "e>0" and e:"\<forall>x'. dist x' x < e \<longrightarrow> x' \<in> cbox a b" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6968 |
unfolding open_dist and subset_eq by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6969 |
{ |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6970 |
fix i :: 'a |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6971 |
assume i: "i \<in> Basis" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6972 |
have "dist (x - (e / 2) *\<^sub>R i) x < e" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6973 |
and "dist (x + (e / 2) *\<^sub>R i) x < e" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6974 |
unfolding dist_norm |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6975 |
apply auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6976 |
unfolding norm_minus_cancel |
60420 | 6977 |
using norm_Basis[OF i] \<open>e>0\<close> |
56189
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6978 |
apply auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6979 |
done |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6980 |
then have "a \<bullet> i \<le> (x - (e / 2) *\<^sub>R i) \<bullet> i" and "(x + (e / 2) *\<^sub>R i) \<bullet> i \<le> b \<bullet> i" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6981 |
using e[THEN spec[where x="x - (e/2) *\<^sub>R i"]] |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6982 |
and e[THEN spec[where x="x + (e/2) *\<^sub>R i"]] |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6983 |
unfolding mem_box |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6984 |
using i |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6985 |
by blast+ |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6986 |
then have "a \<bullet> i < x \<bullet> i" and "x \<bullet> i < b \<bullet> i" |
60420 | 6987 |
using \<open>e>0\<close> i |
56189
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6988 |
by (auto simp: inner_diff_left inner_Basis inner_add_left) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6989 |
} |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6990 |
then have "x \<in> box a b" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6991 |
unfolding mem_box by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6992 |
} |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6993 |
then show "?L \<subseteq> ?R" .. |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6994 |
qed |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6995 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6996 |
lemma bounded_cbox: |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6997 |
fixes a :: "'a::euclidean_space" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6998 |
shows "bounded (cbox a b)" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
6999 |
proof - |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7000 |
let ?b = "\<Sum>i\<in>Basis. \<bar>a\<bullet>i\<bar> + \<bar>b\<bullet>i\<bar>" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7001 |
{ |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7002 |
fix x :: "'a" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7003 |
assume x: "\<forall>i\<in>Basis. a \<bullet> i \<le> x \<bullet> i \<and> x \<bullet> i \<le> b \<bullet> i" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7004 |
{ |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7005 |
fix i :: 'a |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7006 |
assume "i \<in> Basis" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7007 |
then have "\<bar>x\<bullet>i\<bar> \<le> \<bar>a\<bullet>i\<bar> + \<bar>b\<bullet>i\<bar>" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7008 |
using x[THEN bspec[where x=i]] by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7009 |
} |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7010 |
then have "(\<Sum>i\<in>Basis. \<bar>x \<bullet> i\<bar>) \<le> ?b" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7011 |
apply - |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7012 |
apply (rule setsum_mono) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7013 |
apply auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7014 |
done |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7015 |
then have "norm x \<le> ?b" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7016 |
using norm_le_l1[of x] by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7017 |
} |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7018 |
then show ?thesis |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7019 |
unfolding cbox_def bounded_iff by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7020 |
qed |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7021 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7022 |
lemma bounded_box: |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7023 |
fixes a :: "'a::euclidean_space" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7024 |
shows "bounded (box a b)" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7025 |
using bounded_cbox[of a b] |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7026 |
using box_subset_cbox[of a b] |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7027 |
using bounded_subset[of "cbox a b" "box a b"] |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7028 |
by simp |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7029 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7030 |
lemma not_interval_univ: |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7031 |
fixes a :: "'a::euclidean_space" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7032 |
shows "cbox a b \<noteq> UNIV" "box a b \<noteq> UNIV" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7033 |
using bounded_box[of a b] bounded_cbox[of a b] by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7034 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7035 |
lemma compact_cbox: |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7036 |
fixes a :: "'a::euclidean_space" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7037 |
shows "compact (cbox a b)" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7038 |
using bounded_closed_imp_seq_compact[of "cbox a b"] using bounded_cbox[of a b] |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7039 |
by (auto simp: compact_eq_seq_compact_metric) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7040 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7041 |
lemma box_midpoint: |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7042 |
fixes a :: "'a::euclidean_space" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7043 |
assumes "box a b \<noteq> {}" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7044 |
shows "((1/2) *\<^sub>R (a + b)) \<in> box a b" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7045 |
proof - |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7046 |
{ |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7047 |
fix i :: 'a |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7048 |
assume "i \<in> Basis" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7049 |
then have "a \<bullet> i < ((1 / 2) *\<^sub>R (a + b)) \<bullet> i \<and> ((1 / 2) *\<^sub>R (a + b)) \<bullet> i < b \<bullet> i" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7050 |
using assms[unfolded box_ne_empty, THEN bspec[where x=i]] by (auto simp: inner_add_left) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7051 |
} |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7052 |
then show ?thesis unfolding mem_box by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7053 |
qed |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7054 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7055 |
lemma open_cbox_convex: |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7056 |
fixes x :: "'a::euclidean_space" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7057 |
assumes x: "x \<in> box a b" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7058 |
and y: "y \<in> cbox a b" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7059 |
and e: "0 < e" "e \<le> 1" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7060 |
shows "(e *\<^sub>R x + (1 - e) *\<^sub>R y) \<in> box a b" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7061 |
proof - |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7062 |
{ |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7063 |
fix i :: 'a |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7064 |
assume i: "i \<in> Basis" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7065 |
have "a \<bullet> i = e * (a \<bullet> i) + (1 - e) * (a \<bullet> i)" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7066 |
unfolding left_diff_distrib by simp |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7067 |
also have "\<dots> < e * (x \<bullet> i) + (1 - e) * (y \<bullet> i)" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7068 |
apply (rule add_less_le_mono) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7069 |
using e unfolding mult_less_cancel_left and mult_le_cancel_left |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7070 |
apply simp_all |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7071 |
using x unfolding mem_box using i |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7072 |
apply simp |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7073 |
using y unfolding mem_box using i |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7074 |
apply simp |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7075 |
done |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7076 |
finally have "a \<bullet> i < (e *\<^sub>R x + (1 - e) *\<^sub>R y) \<bullet> i" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7077 |
unfolding inner_simps by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7078 |
moreover |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7079 |
{ |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7080 |
have "b \<bullet> i = e * (b\<bullet>i) + (1 - e) * (b\<bullet>i)" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7081 |
unfolding left_diff_distrib by simp |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7082 |
also have "\<dots> > e * (x \<bullet> i) + (1 - e) * (y \<bullet> i)" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7083 |
apply (rule add_less_le_mono) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7084 |
using e unfolding mult_less_cancel_left and mult_le_cancel_left |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7085 |
apply simp_all |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7086 |
using x |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7087 |
unfolding mem_box |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7088 |
using i |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7089 |
apply simp |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7090 |
using y |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7091 |
unfolding mem_box |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7092 |
using i |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7093 |
apply simp |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7094 |
done |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7095 |
finally have "(e *\<^sub>R x + (1 - e) *\<^sub>R y) \<bullet> i < b \<bullet> i" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7096 |
unfolding inner_simps by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7097 |
} |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7098 |
ultimately have "a \<bullet> i < (e *\<^sub>R x + (1 - e) *\<^sub>R y) \<bullet> i \<and> (e *\<^sub>R x + (1 - e) *\<^sub>R y) \<bullet> i < b \<bullet> i" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7099 |
by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7100 |
} |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7101 |
then show ?thesis |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7102 |
unfolding mem_box by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7103 |
qed |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7104 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7105 |
lemma closure_box: |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7106 |
fixes a :: "'a::euclidean_space" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7107 |
assumes "box a b \<noteq> {}" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7108 |
shows "closure (box a b) = cbox a b" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7109 |
proof - |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7110 |
have ab: "a <e b" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7111 |
using assms by (simp add: eucl_less_def box_ne_empty) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7112 |
let ?c = "(1 / 2) *\<^sub>R (a + b)" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7113 |
{ |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7114 |
fix x |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7115 |
assume as:"x \<in> cbox a b" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7116 |
def f \<equiv> "\<lambda>n::nat. x + (inverse (real n + 1)) *\<^sub>R (?c - x)" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7117 |
{ |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7118 |
fix n |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7119 |
assume fn: "f n <e b \<longrightarrow> a <e f n \<longrightarrow> f n = x" and xc: "x \<noteq> ?c" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7120 |
have *: "0 < inverse (real n + 1)" "inverse (real n + 1) \<le> 1" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7121 |
unfolding inverse_le_1_iff by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7122 |
have "(inverse (real n + 1)) *\<^sub>R ((1 / 2) *\<^sub>R (a + b)) + (1 - inverse (real n + 1)) *\<^sub>R x = |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7123 |
x + (inverse (real n + 1)) *\<^sub>R (((1 / 2) *\<^sub>R (a + b)) - x)" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7124 |
by (auto simp add: algebra_simps) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7125 |
then have "f n <e b" and "a <e f n" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7126 |
using open_cbox_convex[OF box_midpoint[OF assms] as *] |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7127 |
unfolding f_def by (auto simp: box_def eucl_less_def) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7128 |
then have False |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7129 |
using fn unfolding f_def using xc by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7130 |
} |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7131 |
moreover |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7132 |
{ |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7133 |
assume "\<not> (f ---> x) sequentially" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7134 |
{ |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7135 |
fix e :: real |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7136 |
assume "e > 0" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7137 |
then have "\<exists>N::nat. inverse (real (N + 1)) < e" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7138 |
using real_arch_inv[of e] |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7139 |
apply (auto simp add: Suc_pred') |
61284
2314c2f62eb1
real_of_nat_Suc is now a simprule
paulson <lp15@cam.ac.uk>
parents:
61245
diff
changeset
|
7140 |
apply (metis Suc_pred' real_of_nat_Suc) |
56189
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7141 |
done |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7142 |
then obtain N :: nat where "inverse (real (N + 1)) < e" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7143 |
by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7144 |
then have "\<forall>n\<ge>N. inverse (real n + 1) < e" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7145 |
apply auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7146 |
apply (metis Suc_le_mono le_SucE less_imp_inverse_less nat_le_real_less order_less_trans |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7147 |
real_of_nat_Suc real_of_nat_Suc_gt_zero) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7148 |
done |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7149 |
then have "\<exists>N::nat. \<forall>n\<ge>N. inverse (real n + 1) < e" by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7150 |
} |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7151 |
then have "((\<lambda>n. inverse (real n + 1)) ---> 0) sequentially" |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59815
diff
changeset
|
7152 |
unfolding lim_sequentially by(auto simp add: dist_norm) |
56189
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7153 |
then have "(f ---> x) sequentially" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7154 |
unfolding f_def |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7155 |
using tendsto_add[OF tendsto_const, of "\<lambda>n::nat. (inverse (real n + 1)) *\<^sub>R ((1 / 2) *\<^sub>R (a + b) - x)" 0 sequentially x] |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7156 |
using tendsto_scaleR [OF _ tendsto_const, of "\<lambda>n::nat. inverse (real n + 1)" 0 sequentially "((1 / 2) *\<^sub>R (a + b) - x)"] |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7157 |
by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7158 |
} |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7159 |
ultimately have "x \<in> closure (box a b)" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7160 |
using as and box_midpoint[OF assms] |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7161 |
unfolding closure_def |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7162 |
unfolding islimpt_sequential |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7163 |
by (cases "x=?c") (auto simp: in_box_eucl_less) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7164 |
} |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7165 |
then show ?thesis |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7166 |
using closure_minimal[OF box_subset_cbox, of a b] by blast |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7167 |
qed |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7168 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7169 |
lemma bounded_subset_box_symmetric: |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7170 |
fixes s::"('a::euclidean_space) set" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7171 |
assumes "bounded s" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7172 |
shows "\<exists>a. s \<subseteq> box (-a) a" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7173 |
proof - |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7174 |
obtain b where "b>0" and b: "\<forall>x\<in>s. norm x \<le> b" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7175 |
using assms[unfolded bounded_pos] by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7176 |
def a \<equiv> "(\<Sum>i\<in>Basis. (b + 1) *\<^sub>R i)::'a" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7177 |
{ |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7178 |
fix x |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7179 |
assume "x \<in> s" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7180 |
fix i :: 'a |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7181 |
assume i: "i \<in> Basis" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7182 |
then have "(-a)\<bullet>i < x\<bullet>i" and "x\<bullet>i < a\<bullet>i" |
60420 | 7183 |
using b[THEN bspec[where x=x], OF \<open>x\<in>s\<close>] |
56189
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7184 |
using Basis_le_norm[OF i, of x] |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7185 |
unfolding inner_simps and a_def |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7186 |
by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7187 |
} |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7188 |
then show ?thesis |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7189 |
by (auto intro: exI[where x=a] simp add: box_def) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7190 |
qed |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7191 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7192 |
lemma bounded_subset_open_interval: |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7193 |
fixes s :: "('a::euclidean_space) set" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7194 |
shows "bounded s \<Longrightarrow> (\<exists>a b. s \<subseteq> box a b)" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7195 |
by (auto dest!: bounded_subset_box_symmetric) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7196 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7197 |
lemma bounded_subset_cbox_symmetric: |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7198 |
fixes s :: "('a::euclidean_space) set" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7199 |
assumes "bounded s" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7200 |
shows "\<exists>a. s \<subseteq> cbox (-a) a" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7201 |
proof - |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7202 |
obtain a where "s \<subseteq> box (-a) a" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7203 |
using bounded_subset_box_symmetric[OF assms] by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7204 |
then show ?thesis |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7205 |
using box_subset_cbox[of "-a" a] by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7206 |
qed |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7207 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7208 |
lemma bounded_subset_cbox: |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7209 |
fixes s :: "('a::euclidean_space) set" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7210 |
shows "bounded s \<Longrightarrow> \<exists>a b. s \<subseteq> cbox a b" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7211 |
using bounded_subset_cbox_symmetric[of s] by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7212 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7213 |
lemma frontier_cbox: |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7214 |
fixes a b :: "'a::euclidean_space" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7215 |
shows "frontier (cbox a b) = cbox a b - box a b" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7216 |
unfolding frontier_def unfolding interior_cbox and closure_closed[OF closed_cbox] .. |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7217 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7218 |
lemma frontier_box: |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7219 |
fixes a b :: "'a::euclidean_space" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7220 |
shows "frontier (box a b) = (if box a b = {} then {} else cbox a b - box a b)" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7221 |
proof (cases "box a b = {}") |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7222 |
case True |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7223 |
then show ?thesis |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7224 |
using frontier_empty by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7225 |
next |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7226 |
case False |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7227 |
then show ?thesis |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7228 |
unfolding frontier_def and closure_box[OF False] and interior_open[OF open_box] |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7229 |
by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7230 |
qed |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7231 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7232 |
lemma inter_interval_mixed_eq_empty: |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7233 |
fixes a :: "'a::euclidean_space" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7234 |
assumes "box c d \<noteq> {}" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7235 |
shows "box a b \<inter> cbox c d = {} \<longleftrightarrow> box a b \<inter> box c d = {}" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7236 |
unfolding closure_box[OF assms, symmetric] |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7237 |
unfolding open_inter_closure_eq_empty[OF open_box] .. |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7238 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7239 |
lemma diameter_cbox: |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7240 |
fixes a b::"'a::euclidean_space" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7241 |
shows "(\<forall>i \<in> Basis. a \<bullet> i \<le> b \<bullet> i) \<Longrightarrow> diameter (cbox a b) = dist a b" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7242 |
by (force simp add: diameter_def SUP_def simp del: Sup_image_eq intro!: cSup_eq_maximum setL2_mono |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7243 |
simp: euclidean_dist_l2[where 'a='a] cbox_def dist_norm) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7244 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7245 |
lemma eucl_less_eq_halfspaces: |
61076 | 7246 |
fixes a :: "'a::euclidean_space" |
56189
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7247 |
shows "{x. x <e a} = (\<Inter>i\<in>Basis. {x. x \<bullet> i < a \<bullet> i})" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7248 |
"{x. a <e x} = (\<Inter>i\<in>Basis. {x. a \<bullet> i < x \<bullet> i})" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7249 |
by (auto simp: eucl_less_def) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7250 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7251 |
lemma eucl_le_eq_halfspaces: |
61076 | 7252 |
fixes a :: "'a::euclidean_space" |
56189
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7253 |
shows "{x. \<forall>i\<in>Basis. x \<bullet> i \<le> a \<bullet> i} = (\<Inter>i\<in>Basis. {x. x \<bullet> i \<le> a \<bullet> i})" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7254 |
"{x. \<forall>i\<in>Basis. a \<bullet> i \<le> x \<bullet> i} = (\<Inter>i\<in>Basis. {x. a \<bullet> i \<le> x \<bullet> i})" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7255 |
by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7256 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7257 |
lemma open_Collect_eucl_less[simp, intro]: |
61076 | 7258 |
fixes a :: "'a::euclidean_space" |
56189
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7259 |
shows "open {x. x <e a}" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7260 |
"open {x. a <e x}" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7261 |
by (auto simp: eucl_less_eq_halfspaces open_halfspace_component_lt open_halfspace_component_gt) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7262 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7263 |
lemma closed_Collect_eucl_le[simp, intro]: |
61076 | 7264 |
fixes a :: "'a::euclidean_space" |
56189
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7265 |
shows "closed {x. \<forall>i\<in>Basis. a \<bullet> i \<le> x \<bullet> i}" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7266 |
"closed {x. \<forall>i\<in>Basis. x \<bullet> i \<le> a \<bullet> i}" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7267 |
unfolding eucl_le_eq_halfspaces |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7268 |
by (simp_all add: closed_INT closed_Collect_le) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7269 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7270 |
lemma image_affinity_cbox: fixes m::real |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7271 |
fixes a b c :: "'a::euclidean_space" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7272 |
shows "(\<lambda>x. m *\<^sub>R x + c) ` cbox a b = |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7273 |
(if cbox a b = {} then {} |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7274 |
else (if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7275 |
else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c)))" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7276 |
proof (cases "m = 0") |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7277 |
case True |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7278 |
{ |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7279 |
fix x |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7280 |
assume "\<forall>i\<in>Basis. x \<bullet> i \<le> c \<bullet> i" "\<forall>i\<in>Basis. c \<bullet> i \<le> x \<bullet> i" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7281 |
then have "x = c" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7282 |
apply - |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7283 |
apply (subst euclidean_eq_iff) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7284 |
apply (auto intro: order_antisym) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7285 |
done |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7286 |
} |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7287 |
moreover have "c \<in> cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c)" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7288 |
unfolding True by (auto simp add: cbox_sing) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7289 |
ultimately show ?thesis using True by (auto simp: cbox_def) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7290 |
next |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7291 |
case False |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7292 |
{ |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7293 |
fix y |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7294 |
assume "\<forall>i\<in>Basis. a \<bullet> i \<le> y \<bullet> i" "\<forall>i\<in>Basis. y \<bullet> i \<le> b \<bullet> i" "m > 0" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7295 |
then have "\<forall>i\<in>Basis. (m *\<^sub>R a + c) \<bullet> i \<le> (m *\<^sub>R y + c) \<bullet> i" and "\<forall>i\<in>Basis. (m *\<^sub>R y + c) \<bullet> i \<le> (m *\<^sub>R b + c) \<bullet> i" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7296 |
by (auto simp: inner_distrib) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7297 |
} |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7298 |
moreover |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7299 |
{ |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7300 |
fix y |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7301 |
assume "\<forall>i\<in>Basis. a \<bullet> i \<le> y \<bullet> i" "\<forall>i\<in>Basis. y \<bullet> i \<le> b \<bullet> i" "m < 0" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7302 |
then have "\<forall>i\<in>Basis. (m *\<^sub>R b + c) \<bullet> i \<le> (m *\<^sub>R y + c) \<bullet> i" and "\<forall>i\<in>Basis. (m *\<^sub>R y + c) \<bullet> i \<le> (m *\<^sub>R a + c) \<bullet> i" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7303 |
by (auto simp add: mult_left_mono_neg inner_distrib) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7304 |
} |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7305 |
moreover |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7306 |
{ |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7307 |
fix y |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7308 |
assume "m > 0" and "\<forall>i\<in>Basis. (m *\<^sub>R a + c) \<bullet> i \<le> y \<bullet> i" and "\<forall>i\<in>Basis. y \<bullet> i \<le> (m *\<^sub>R b + c) \<bullet> i" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7309 |
then have "y \<in> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7310 |
unfolding image_iff Bex_def mem_box |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7311 |
apply (intro exI[where x="(1 / m) *\<^sub>R (y - c)"]) |
57512
cc97b347b301
reduced name variants for assoc and commute on plus and mult
haftmann
parents:
57448
diff
changeset
|
7312 |
apply (auto simp add: pos_le_divide_eq pos_divide_le_eq mult.commute diff_le_iff inner_distrib inner_diff_left) |
56189
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7313 |
done |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7314 |
} |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7315 |
moreover |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7316 |
{ |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7317 |
fix y |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7318 |
assume "\<forall>i\<in>Basis. (m *\<^sub>R b + c) \<bullet> i \<le> y \<bullet> i" "\<forall>i\<in>Basis. y \<bullet> i \<le> (m *\<^sub>R a + c) \<bullet> i" "m < 0" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7319 |
then have "y \<in> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7320 |
unfolding image_iff Bex_def mem_box |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7321 |
apply (intro exI[where x="(1 / m) *\<^sub>R (y - c)"]) |
57512
cc97b347b301
reduced name variants for assoc and commute on plus and mult
haftmann
parents:
57448
diff
changeset
|
7322 |
apply (auto simp add: neg_le_divide_eq neg_divide_le_eq mult.commute diff_le_iff inner_distrib inner_diff_left) |
56189
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7323 |
done |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7324 |
} |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7325 |
ultimately show ?thesis using False by (auto simp: cbox_def) |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7326 |
qed |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7327 |
|
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7328 |
lemma image_smult_cbox:"(\<lambda>x. m *\<^sub>R (x::_::euclidean_space)) ` cbox a b = |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7329 |
(if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a) (m *\<^sub>R b) else cbox (m *\<^sub>R b) (m *\<^sub>R a))" |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7330 |
using image_affinity_cbox[of m 0 a b] by auto |
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7331 |
|
60176 | 7332 |
lemma islimpt_greaterThanLessThan1: |
7333 |
fixes a b::"'a::{linorder_topology, dense_order}" |
|
7334 |
assumes "a < b" |
|
7335 |
shows "a islimpt {a<..<b}" |
|
7336 |
proof (rule islimptI) |
|
7337 |
fix T |
|
7338 |
assume "open T" "a \<in> T" |
|
60420 | 7339 |
from open_right[OF this \<open>a < b\<close>] |
60176 | 7340 |
obtain c where c: "a < c" "{a..<c} \<subseteq> T" by auto |
7341 |
with assms dense[of a "min c b"] |
|
7342 |
show "\<exists>y\<in>{a<..<b}. y \<in> T \<and> y \<noteq> a" |
|
7343 |
by (metis atLeastLessThan_iff greaterThanLessThan_iff min_less_iff_conj |
|
7344 |
not_le order.strict_implies_order subset_eq) |
|
7345 |
qed |
|
7346 |
||
7347 |
lemma islimpt_greaterThanLessThan2: |
|
7348 |
fixes a b::"'a::{linorder_topology, dense_order}" |
|
7349 |
assumes "a < b" |
|
7350 |
shows "b islimpt {a<..<b}" |
|
7351 |
proof (rule islimptI) |
|
7352 |
fix T |
|
7353 |
assume "open T" "b \<in> T" |
|
60420 | 7354 |
from open_left[OF this \<open>a < b\<close>] |
60176 | 7355 |
obtain c where c: "c < b" "{c<..b} \<subseteq> T" by auto |
7356 |
with assms dense[of "max a c" b] |
|
7357 |
show "\<exists>y\<in>{a<..<b}. y \<in> T \<and> y \<noteq> b" |
|
7358 |
by (metis greaterThanAtMost_iff greaterThanLessThan_iff max_less_iff_conj |
|
7359 |
not_le order.strict_implies_order subset_eq) |
|
7360 |
qed |
|
7361 |
||
7362 |
lemma closure_greaterThanLessThan[simp]: |
|
7363 |
fixes a b::"'a::{linorder_topology, dense_order}" |
|
7364 |
shows "a < b \<Longrightarrow> closure {a <..< b} = {a .. b}" (is "_ \<Longrightarrow> ?l = ?r") |
|
7365 |
proof |
|
7366 |
have "?l \<subseteq> closure ?r" |
|
7367 |
by (rule closure_mono) auto |
|
7368 |
thus "closure {a<..<b} \<subseteq> {a..b}" by simp |
|
7369 |
qed (auto simp: closure_def order.order_iff_strict islimpt_greaterThanLessThan1 |
|
7370 |
islimpt_greaterThanLessThan2) |
|
7371 |
||
7372 |
lemma closure_greaterThan[simp]: |
|
7373 |
fixes a b::"'a::{no_top, linorder_topology, dense_order}" |
|
7374 |
shows "closure {a<..} = {a..}" |
|
7375 |
proof - |
|
7376 |
from gt_ex obtain b where "a < b" by auto |
|
7377 |
hence "{a<..} = {a<..<b} \<union> {b..}" by auto |
|
60420 | 7378 |
also have "closure \<dots> = {a..}" using \<open>a < b\<close> unfolding closure_union |
60176 | 7379 |
by auto |
7380 |
finally show ?thesis . |
|
7381 |
qed |
|
7382 |
||
7383 |
lemma closure_lessThan[simp]: |
|
7384 |
fixes b::"'a::{no_bot, linorder_topology, dense_order}" |
|
7385 |
shows "closure {..<b} = {..b}" |
|
7386 |
proof - |
|
7387 |
from lt_ex obtain a where "a < b" by auto |
|
7388 |
hence "{..<b} = {a<..<b} \<union> {..a}" by auto |
|
60420 | 7389 |
also have "closure \<dots> = {..b}" using \<open>a < b\<close> unfolding closure_union |
60176 | 7390 |
by auto |
7391 |
finally show ?thesis . |
|
7392 |
qed |
|
7393 |
||
7394 |
lemma closure_atLeastLessThan[simp]: |
|
7395 |
fixes a b::"'a::{linorder_topology, dense_order}" |
|
7396 |
assumes "a < b" |
|
7397 |
shows "closure {a ..< b} = {a .. b}" |
|
7398 |
proof - |
|
7399 |
from assms have "{a ..< b} = {a} \<union> {a <..< b}" by auto |
|
7400 |
also have "closure \<dots> = {a .. b}" unfolding closure_union |
|
7401 |
by (auto simp add: assms less_imp_le) |
|
7402 |
finally show ?thesis . |
|
7403 |
qed |
|
7404 |
||
7405 |
lemma closure_greaterThanAtMost[simp]: |
|
7406 |
fixes a b::"'a::{linorder_topology, dense_order}" |
|
7407 |
assumes "a < b" |
|
7408 |
shows "closure {a <.. b} = {a .. b}" |
|
7409 |
proof - |
|
7410 |
from assms have "{a <.. b} = {b} \<union> {a <..< b}" by auto |
|
7411 |
also have "closure \<dots> = {a .. b}" unfolding closure_union |
|
7412 |
by (auto simp add: assms less_imp_le) |
|
7413 |
finally show ?thesis . |
|
7414 |
qed |
|
7415 |
||
56189
c4daa97ac57a
removed dependencies on theory Ordered_Euclidean_Space
immler
parents:
56188
diff
changeset
|
7416 |
|
60420 | 7417 |
subsection \<open>Homeomorphisms\<close> |
33175 | 7418 |
|
52625 | 7419 |
definition "homeomorphism s t f g \<longleftrightarrow> |
7420 |
(\<forall>x\<in>s. (g(f x) = x)) \<and> (f ` s = t) \<and> continuous_on s f \<and> |
|
7421 |
(\<forall>y\<in>t. (f(g y) = y)) \<and> (g ` t = s) \<and> continuous_on t g" |
|
33175 | 7422 |
|
53640 | 7423 |
definition homeomorphic :: "'a::topological_space set \<Rightarrow> 'b::topological_space set \<Rightarrow> bool" |
53282 | 7424 |
(infixr "homeomorphic" 60) |
7425 |
where "s homeomorphic t \<equiv> (\<exists>f g. homeomorphism s t f g)" |
|
33175 | 7426 |
|
7427 |
lemma homeomorphic_refl: "s homeomorphic s" |
|
7428 |
unfolding homeomorphic_def |
|
7429 |
unfolding homeomorphism_def |
|
7430 |
using continuous_on_id |
|
53282 | 7431 |
apply (rule_tac x = "(\<lambda>x. x)" in exI) |
7432 |
apply (rule_tac x = "(\<lambda>x. x)" in exI) |
|
52625 | 7433 |
apply blast |
7434 |
done |
|
7435 |
||
7436 |
lemma homeomorphic_sym: "s homeomorphic t \<longleftrightarrow> t homeomorphic s" |
|
7437 |
unfolding homeomorphic_def |
|
7438 |
unfolding homeomorphism_def |
|
53282 | 7439 |
by blast |
33175 | 7440 |
|
7441 |
lemma homeomorphic_trans: |
|
53282 | 7442 |
assumes "s homeomorphic t" |
7443 |
and "t homeomorphic u" |
|
52625 | 7444 |
shows "s homeomorphic u" |
53282 | 7445 |
proof - |
7446 |
obtain f1 g1 where fg1: "\<forall>x\<in>s. g1 (f1 x) = x" "f1 ` s = t" |
|
7447 |
"continuous_on s f1" "\<forall>y\<in>t. f1 (g1 y) = y" "g1 ` t = s" "continuous_on t g1" |
|
33175 | 7448 |
using assms(1) unfolding homeomorphic_def homeomorphism_def by auto |
53282 | 7449 |
obtain f2 g2 where fg2: "\<forall>x\<in>t. g2 (f2 x) = x" "f2 ` t = u" "continuous_on t f2" |
7450 |
"\<forall>y\<in>u. f2 (g2 y) = y" "g2 ` u = t" "continuous_on u g2" |
|
33175 | 7451 |
using assms(2) unfolding homeomorphic_def homeomorphism_def by auto |
52625 | 7452 |
{ |
7453 |
fix x |
|
7454 |
assume "x\<in>s" |
|
53282 | 7455 |
then have "(g1 \<circ> g2) ((f2 \<circ> f1) x) = x" |
52625 | 7456 |
using fg1(1)[THEN bspec[where x=x]] and fg2(1)[THEN bspec[where x="f1 x"]] and fg1(2) |
7457 |
by auto |
|
7458 |
} |
|
7459 |
moreover have "(f2 \<circ> f1) ` s = u" |
|
7460 |
using fg1(2) fg2(2) by auto |
|
7461 |
moreover have "continuous_on s (f2 \<circ> f1)" |
|
7462 |
using continuous_on_compose[OF fg1(3)] and fg2(3) unfolding fg1(2) by auto |
|
53282 | 7463 |
moreover |
7464 |
{ |
|
52625 | 7465 |
fix y |
7466 |
assume "y\<in>u" |
|
53282 | 7467 |
then have "(f2 \<circ> f1) ((g1 \<circ> g2) y) = y" |
52625 | 7468 |
using fg2(4)[THEN bspec[where x=y]] and fg1(4)[THEN bspec[where x="g2 y"]] and fg2(5) |
7469 |
by auto |
|
7470 |
} |
|
33175 | 7471 |
moreover have "(g1 \<circ> g2) ` u = s" using fg1(5) fg2(5) by auto |
52625 | 7472 |
moreover have "continuous_on u (g1 \<circ> g2)" |
7473 |
using continuous_on_compose[OF fg2(6)] and fg1(6) |
|
7474 |
unfolding fg2(5) |
|
7475 |
by auto |
|
7476 |
ultimately show ?thesis |
|
7477 |
unfolding homeomorphic_def homeomorphism_def |
|
7478 |
apply (rule_tac x="f2 \<circ> f1" in exI) |
|
7479 |
apply (rule_tac x="g1 \<circ> g2" in exI) |
|
7480 |
apply auto |
|
7481 |
done |
|
33175 | 7482 |
qed |
7483 |
||
7484 |
lemma homeomorphic_minimal: |
|
52625 | 7485 |
"s homeomorphic t \<longleftrightarrow> |
33175 | 7486 |
(\<exists>f g. (\<forall>x\<in>s. f(x) \<in> t \<and> (g(f(x)) = x)) \<and> |
7487 |
(\<forall>y\<in>t. g(y) \<in> s \<and> (f(g(y)) = y)) \<and> |
|
7488 |
continuous_on s f \<and> continuous_on t g)" |
|
52625 | 7489 |
unfolding homeomorphic_def homeomorphism_def |
7490 |
apply auto |
|
7491 |
apply (rule_tac x=f in exI) |
|
7492 |
apply (rule_tac x=g in exI) |
|
7493 |
apply auto |
|
7494 |
apply (rule_tac x=f in exI) |
|
7495 |
apply (rule_tac x=g in exI) |
|
7496 |
apply auto |
|
7497 |
unfolding image_iff |
|
7498 |
apply (erule_tac x="g x" in ballE) |
|
7499 |
apply (erule_tac x="x" in ballE) |
|
7500 |
apply auto |
|
7501 |
apply (rule_tac x="g x" in bexI) |
|
7502 |
apply auto |
|
7503 |
apply (erule_tac x="f x" in ballE) |
|
7504 |
apply (erule_tac x="x" in ballE) |
|
7505 |
apply auto |
|
7506 |
apply (rule_tac x="f x" in bexI) |
|
7507 |
apply auto |
|
7508 |
done |
|
33175 | 7509 |
|
60420 | 7510 |
text \<open>Relatively weak hypotheses if a set is compact.\<close> |
33175 | 7511 |
|
7512 |
lemma homeomorphism_compact: |
|
50898 | 7513 |
fixes f :: "'a::topological_space \<Rightarrow> 'b::t2_space" |
33175 | 7514 |
assumes "compact s" "continuous_on s f" "f ` s = t" "inj_on f s" |
7515 |
shows "\<exists>g. homeomorphism s t f g" |
|
53282 | 7516 |
proof - |
33175 | 7517 |
def g \<equiv> "\<lambda>x. SOME y. y\<in>s \<and> f y = x" |
52625 | 7518 |
have g: "\<forall>x\<in>s. g (f x) = x" |
7519 |
using assms(3) assms(4)[unfolded inj_on_def] unfolding g_def by auto |
|
7520 |
{ |
|
53282 | 7521 |
fix y |
7522 |
assume "y \<in> t" |
|
7523 |
then obtain x where x:"f x = y" "x\<in>s" |
|
7524 |
using assms(3) by auto |
|
7525 |
then have "g (f x) = x" using g by auto |
|
53291 | 7526 |
then have "f (g y) = y" unfolding x(1)[symmetric] by auto |
52625 | 7527 |
} |
53282 | 7528 |
then have g':"\<forall>x\<in>t. f (g x) = x" by auto |
33175 | 7529 |
moreover |
52625 | 7530 |
{ |
7531 |
fix x |
|
7532 |
have "x\<in>s \<Longrightarrow> x \<in> g ` t" |
|
7533 |
using g[THEN bspec[where x=x]] |
|
7534 |
unfolding image_iff |
|
7535 |
using assms(3) |
|
7536 |
by (auto intro!: bexI[where x="f x"]) |
|
33175 | 7537 |
moreover |
52625 | 7538 |
{ |
7539 |
assume "x\<in>g ` t" |
|
33175 | 7540 |
then obtain y where y:"y\<in>t" "g y = x" by auto |
52625 | 7541 |
then obtain x' where x':"x'\<in>s" "f x' = y" |
7542 |
using assms(3) by auto |
|
53282 | 7543 |
then have "x \<in> s" |
52625 | 7544 |
unfolding g_def |
7545 |
using someI2[of "\<lambda>b. b\<in>s \<and> f b = y" x' "\<lambda>x. x\<in>s"] |
|
53291 | 7546 |
unfolding y(2)[symmetric] and g_def |
52625 | 7547 |
by auto |
7548 |
} |
|
7549 |
ultimately have "x\<in>s \<longleftrightarrow> x \<in> g ` t" .. |
|
7550 |
} |
|
53282 | 7551 |
then have "g ` t = s" by auto |
52625 | 7552 |
ultimately show ?thesis |
7553 |
unfolding homeomorphism_def homeomorphic_def |
|
7554 |
apply (rule_tac x=g in exI) |
|
7555 |
using g and assms(3) and continuous_on_inv[OF assms(2,1), of g, unfolded assms(3)] and assms(2) |
|
7556 |
apply auto |
|
7557 |
done |
|
33175 | 7558 |
qed |
7559 |
||
7560 |
lemma homeomorphic_compact: |
|
50898 | 7561 |
fixes f :: "'a::topological_space \<Rightarrow> 'b::t2_space" |
53282 | 7562 |
shows "compact s \<Longrightarrow> continuous_on s f \<Longrightarrow> (f ` s = t) \<Longrightarrow> inj_on f s \<Longrightarrow> s homeomorphic t" |
37486
b993fac7985b
beta-eta was too much, because it transformed SOME x. P x into Eps P, which caused problems later;
blanchet
parents:
37452
diff
changeset
|
7563 |
unfolding homeomorphic_def by (metis homeomorphism_compact) |
33175 | 7564 |
|
60420 | 7565 |
text\<open>Preservation of topological properties.\<close> |
33175 | 7566 |
|
52625 | 7567 |
lemma homeomorphic_compactness: "s homeomorphic t \<Longrightarrow> (compact s \<longleftrightarrow> compact t)" |
7568 |
unfolding homeomorphic_def homeomorphism_def |
|
7569 |
by (metis compact_continuous_image) |
|
33175 | 7570 |
|
60420 | 7571 |
text\<open>Results on translation, scaling etc.\<close> |
33175 | 7572 |
|
7573 |
lemma homeomorphic_scaling: |
|
7574 |
fixes s :: "'a::real_normed_vector set" |
|
53282 | 7575 |
assumes "c \<noteq> 0" |
7576 |
shows "s homeomorphic ((\<lambda>x. c *\<^sub>R x) ` s)" |
|
33175 | 7577 |
unfolding homeomorphic_minimal |
52625 | 7578 |
apply (rule_tac x="\<lambda>x. c *\<^sub>R x" in exI) |
7579 |
apply (rule_tac x="\<lambda>x. (1 / c) *\<^sub>R x" in exI) |
|
7580 |
using assms |
|
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56290
diff
changeset
|
7581 |
apply (auto simp add: continuous_intros) |
52625 | 7582 |
done |
33175 | 7583 |
|
7584 |
lemma homeomorphic_translation: |
|
7585 |
fixes s :: "'a::real_normed_vector set" |
|
7586 |
shows "s homeomorphic ((\<lambda>x. a + x) ` s)" |
|
7587 |
unfolding homeomorphic_minimal |
|
52625 | 7588 |
apply (rule_tac x="\<lambda>x. a + x" in exI) |
7589 |
apply (rule_tac x="\<lambda>x. -a + x" in exI) |
|
54230
b1d955791529
more simplification rules on unary and binary minus
haftmann
parents:
54070
diff
changeset
|
7590 |
using continuous_on_add [OF continuous_on_const continuous_on_id, of s a] |
b1d955791529
more simplification rules on unary and binary minus
haftmann
parents:
54070
diff
changeset
|
7591 |
continuous_on_add [OF continuous_on_const continuous_on_id, of "plus a ` s" "- a"] |
52625 | 7592 |
apply auto |
7593 |
done |
|
33175 | 7594 |
|
7595 |
lemma homeomorphic_affinity: |
|
7596 |
fixes s :: "'a::real_normed_vector set" |
|
52625 | 7597 |
assumes "c \<noteq> 0" |
7598 |
shows "s homeomorphic ((\<lambda>x. a + c *\<^sub>R x) ` s)" |
|
53282 | 7599 |
proof - |
52625 | 7600 |
have *: "op + a ` op *\<^sub>R c ` s = (\<lambda>x. a + c *\<^sub>R x) ` s" by auto |
33175 | 7601 |
show ?thesis |
7602 |
using homeomorphic_trans |
|
7603 |
using homeomorphic_scaling[OF assms, of s] |
|
52625 | 7604 |
using homeomorphic_translation[of "(\<lambda>x. c *\<^sub>R x) ` s" a] |
7605 |
unfolding * |
|
7606 |
by auto |
|
33175 | 7607 |
qed |
7608 |
||
7609 |
lemma homeomorphic_balls: |
|
50898 | 7610 |
fixes a b ::"'a::real_normed_vector" |
33175 | 7611 |
assumes "0 < d" "0 < e" |
7612 |
shows "(ball a d) homeomorphic (ball b e)" (is ?th) |
|
53282 | 7613 |
and "(cball a d) homeomorphic (cball b e)" (is ?cth) |
7614 |
proof - |
|
33175 | 7615 |
show ?th unfolding homeomorphic_minimal |
7616 |
apply(rule_tac x="\<lambda>x. b + (e/d) *\<^sub>R (x - a)" in exI) |
|
7617 |
apply(rule_tac x="\<lambda>x. a + (d/e) *\<^sub>R (x - b)" in exI) |
|
51364 | 7618 |
using assms |
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56290
diff
changeset
|
7619 |
apply (auto intro!: continuous_intros |
52625 | 7620 |
simp: dist_commute dist_norm pos_divide_less_eq mult_strict_left_mono) |
51364 | 7621 |
done |
33175 | 7622 |
show ?cth unfolding homeomorphic_minimal |
7623 |
apply(rule_tac x="\<lambda>x. b + (e/d) *\<^sub>R (x - a)" in exI) |
|
7624 |
apply(rule_tac x="\<lambda>x. a + (d/e) *\<^sub>R (x - b)" in exI) |
|
51364 | 7625 |
using assms |
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56290
diff
changeset
|
7626 |
apply (auto intro!: continuous_intros |
52625 | 7627 |
simp: dist_commute dist_norm pos_divide_le_eq mult_strict_left_mono) |
51364 | 7628 |
done |
33175 | 7629 |
qed |
7630 |
||
60420 | 7631 |
text\<open>"Isometry" (up to constant bounds) of injective linear map etc.\<close> |
33175 | 7632 |
|
7633 |
lemma cauchy_isometric: |
|
53640 | 7634 |
assumes e: "e > 0" |
52625 | 7635 |
and s: "subspace s" |
7636 |
and f: "bounded_linear f" |
|
53640 | 7637 |
and normf: "\<forall>x\<in>s. norm (f x) \<ge> e * norm x" |
7638 |
and xs: "\<forall>n. x n \<in> s" |
|
7639 |
and cf: "Cauchy (f \<circ> x)" |
|
33175 | 7640 |
shows "Cauchy x" |
52625 | 7641 |
proof - |
33175 | 7642 |
interpret f: bounded_linear f by fact |
52625 | 7643 |
{ |
53291 | 7644 |
fix d :: real |
7645 |
assume "d > 0" |
|
33175 | 7646 |
then obtain N where N:"\<forall>n\<ge>N. norm (f (x n) - f (x N)) < e * d" |
56544 | 7647 |
using cf[unfolded cauchy o_def dist_norm, THEN spec[where x="e*d"]] e |
52625 | 7648 |
by auto |
7649 |
{ |
|
7650 |
fix n |
|
7651 |
assume "n\<ge>N" |
|
45270
d5b5c9259afd
fix bug in cancel_factor simprocs so they will work on goals like 'x * y < x * z' where the common term is already on the left
huffman
parents:
45051
diff
changeset
|
7652 |
have "e * norm (x n - x N) \<le> norm (f (x n - x N))" |
52625 | 7653 |
using subspace_sub[OF s, of "x n" "x N"] |
7654 |
using xs[THEN spec[where x=N]] and xs[THEN spec[where x=n]] |
|
7655 |
using normf[THEN bspec[where x="x n - x N"]] |
|
7656 |
by auto |
|
45270
d5b5c9259afd
fix bug in cancel_factor simprocs so they will work on goals like 'x * y < x * z' where the common term is already on the left
huffman
parents:
45051
diff
changeset
|
7657 |
also have "norm (f (x n - x N)) < e * d" |
60420 | 7658 |
using \<open>N \<le> n\<close> N unfolding f.diff[symmetric] by auto |
7659 |
finally have "norm (x n - x N) < d" using \<open>e>0\<close> by simp |
|
52625 | 7660 |
} |
53282 | 7661 |
then have "\<exists>N. \<forall>n\<ge>N. norm (x n - x N) < d" by auto |
52625 | 7662 |
} |
53282 | 7663 |
then show ?thesis unfolding cauchy and dist_norm by auto |
33175 | 7664 |
qed |
7665 |
||
7666 |
lemma complete_isometric_image: |
|
52625 | 7667 |
assumes "0 < e" |
7668 |
and s: "subspace s" |
|
7669 |
and f: "bounded_linear f" |
|
7670 |
and normf: "\<forall>x\<in>s. norm(f x) \<ge> e * norm(x)" |
|
7671 |
and cs: "complete s" |
|
53291 | 7672 |
shows "complete (f ` s)" |
52625 | 7673 |
proof - |
7674 |
{ |
|
7675 |
fix g |
|
7676 |
assume as:"\<forall>n::nat. g n \<in> f ` s" and cfg:"Cauchy g" |
|
53282 | 7677 |
then obtain x where "\<forall>n. x n \<in> s \<and> g n = f (x n)" |
53640 | 7678 |
using choice[of "\<lambda> n xa. xa \<in> s \<and> g n = f xa"] |
7679 |
by auto |
|
7680 |
then have x:"\<forall>n. x n \<in> s" "\<forall>n. g n = f (x n)" |
|
7681 |
by auto |
|
7682 |
then have "f \<circ> x = g" |
|
7683 |
unfolding fun_eq_iff |
|
7684 |
by auto |
|
33175 | 7685 |
then obtain l where "l\<in>s" and l:"(x ---> l) sequentially" |
7686 |
using cs[unfolded complete_def, THEN spec[where x="x"]] |
|
60420 | 7687 |
using cauchy_isometric[OF \<open>0 < e\<close> s f normf] and cfg and x(1) |
53640 | 7688 |
by auto |
53282 | 7689 |
then have "\<exists>l\<in>f ` s. (g ---> l) sequentially" |
33175 | 7690 |
using linear_continuous_at[OF f, unfolded continuous_at_sequentially, THEN spec[where x=x], of l] |
60420 | 7691 |
unfolding \<open>f \<circ> x = g\<close> |
53640 | 7692 |
by auto |
52625 | 7693 |
} |
53640 | 7694 |
then show ?thesis |
7695 |
unfolding complete_def by auto |
|
33175 | 7696 |
qed |
7697 |
||
52625 | 7698 |
lemma injective_imp_isometric: |
7699 |
fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" |
|
7700 |
assumes s: "closed s" "subspace s" |
|
53640 | 7701 |
and f: "bounded_linear f" "\<forall>x\<in>s. f x = 0 \<longrightarrow> x = 0" |
7702 |
shows "\<exists>e>0. \<forall>x\<in>s. norm (f x) \<ge> e * norm x" |
|
52625 | 7703 |
proof (cases "s \<subseteq> {0::'a}") |
33175 | 7704 |
case True |
52625 | 7705 |
{ |
7706 |
fix x |
|
7707 |
assume "x \<in> s" |
|
53282 | 7708 |
then have "x = 0" using True by auto |
7709 |
then have "norm x \<le> norm (f x)" by auto |
|
52625 | 7710 |
} |
53282 | 7711 |
then show ?thesis by (auto intro!: exI[where x=1]) |
33175 | 7712 |
next |
7713 |
interpret f: bounded_linear f by fact |
|
7714 |
case False |
|
53640 | 7715 |
then obtain a where a: "a \<noteq> 0" "a \<in> s" |
7716 |
by auto |
|
7717 |
from False have "s \<noteq> {}" |
|
7718 |
by auto |
|
33175 | 7719 |
let ?S = "{f x| x. (x \<in> s \<and> norm x = norm a)}" |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
7720 |
let ?S' = "{x::'a. x\<in>s \<and> norm x = norm a}" |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
7721 |
let ?S'' = "{x::'a. norm x = norm a}" |
33175 | 7722 |
|
52625 | 7723 |
have "?S'' = frontier(cball 0 (norm a))" |
7724 |
unfolding frontier_cball and dist_norm by auto |
|
53282 | 7725 |
then have "compact ?S''" |
52625 | 7726 |
using compact_frontier[OF compact_cball, of 0 "norm a"] by auto |
33175 | 7727 |
moreover have "?S' = s \<inter> ?S''" by auto |
52625 | 7728 |
ultimately have "compact ?S'" |
7729 |
using closed_inter_compact[of s ?S''] using s(1) by auto |
|
33175 | 7730 |
moreover have *:"f ` ?S' = ?S" by auto |
52625 | 7731 |
ultimately have "compact ?S" |
7732 |
using compact_continuous_image[OF linear_continuous_on[OF f(1)], of ?S'] by auto |
|
53282 | 7733 |
then have "closed ?S" using compact_imp_closed by auto |
33175 | 7734 |
moreover have "?S \<noteq> {}" using a by auto |
52625 | 7735 |
ultimately obtain b' where "b'\<in>?S" "\<forall>y\<in>?S. norm b' \<le> norm y" |
7736 |
using distance_attains_inf[of ?S 0] unfolding dist_0_norm by auto |
|
53282 | 7737 |
then obtain b where "b\<in>s" |
7738 |
and ba: "norm b = norm a" |
|
7739 |
and b: "\<forall>x\<in>{x \<in> s. norm x = norm a}. norm (f b) \<le> norm (f x)" |
|
53291 | 7740 |
unfolding *[symmetric] unfolding image_iff by auto |
33175 | 7741 |
|
7742 |
let ?e = "norm (f b) / norm b" |
|
7743 |
have "norm b > 0" using ba and a and norm_ge_zero by auto |
|
52625 | 7744 |
moreover have "norm (f b) > 0" |
60420 | 7745 |
using f(2)[THEN bspec[where x=b], OF \<open>b\<in>s\<close>] |
7746 |
using \<open>norm b >0\<close> |
|
52625 | 7747 |
unfolding zero_less_norm_iff |
7748 |
by auto |
|
56541 | 7749 |
ultimately have "0 < norm (f b) / norm b" by simp |
33175 | 7750 |
moreover |
52625 | 7751 |
{ |
7752 |
fix x |
|
7753 |
assume "x\<in>s" |
|
53282 | 7754 |
then have "norm (f b) / norm b * norm x \<le> norm (f x)" |
52625 | 7755 |
proof (cases "x=0") |
7756 |
case True |
|
53282 | 7757 |
then show "norm (f b) / norm b * norm x \<le> norm (f x)" by auto |
33175 | 7758 |
next |
7759 |
case False |
|
53282 | 7760 |
then have *: "0 < norm a / norm x" |
60420 | 7761 |
using \<open>a\<noteq>0\<close> |
56541 | 7762 |
unfolding zero_less_norm_iff[symmetric] by simp |
52625 | 7763 |
have "\<forall>c. \<forall>x\<in>s. c *\<^sub>R x \<in> s" |
7764 |
using s[unfolded subspace_def] by auto |
|
53282 | 7765 |
then have "(norm a / norm x) *\<^sub>R x \<in> {x \<in> s. norm x = norm a}" |
60420 | 7766 |
using \<open>x\<in>s\<close> and \<open>x\<noteq>0\<close> by auto |
53282 | 7767 |
then show "norm (f b) / norm b * norm x \<le> norm (f x)" |
52625 | 7768 |
using b[THEN bspec[where x="(norm a / norm x) *\<^sub>R x"]] |
60420 | 7769 |
unfolding f.scaleR and ba using \<open>x\<noteq>0\<close> \<open>a\<noteq>0\<close> |
57512
cc97b347b301
reduced name variants for assoc and commute on plus and mult
haftmann
parents:
57448
diff
changeset
|
7770 |
by (auto simp add: mult.commute pos_le_divide_eq pos_divide_le_eq) |
52625 | 7771 |
qed |
7772 |
} |
|
7773 |
ultimately show ?thesis by auto |
|
33175 | 7774 |
qed |
7775 |
||
7776 |
lemma closed_injective_image_subspace: |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
7777 |
fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" |
53282 | 7778 |
assumes "subspace s" "bounded_linear f" "\<forall>x\<in>s. f x = 0 \<longrightarrow> x = 0" "closed s" |
33175 | 7779 |
shows "closed(f ` s)" |
53282 | 7780 |
proof - |
7781 |
obtain e where "e > 0" and e: "\<forall>x\<in>s. e * norm x \<le> norm (f x)" |
|
52625 | 7782 |
using injective_imp_isometric[OF assms(4,1,2,3)] by auto |
7783 |
show ?thesis |
|
60420 | 7784 |
using complete_isometric_image[OF \<open>e>0\<close> assms(1,2) e] and assms(4) |
53291 | 7785 |
unfolding complete_eq_closed[symmetric] by auto |
33175 | 7786 |
qed |
7787 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
7788 |
|
60420 | 7789 |
subsection \<open>Some properties of a canonical subspace\<close> |
33175 | 7790 |
|
7791 |
lemma subspace_substandard: |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
7792 |
"subspace {x::'a::euclidean_space. (\<forall>i\<in>Basis. P i \<longrightarrow> x\<bullet>i = 0)}" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
7793 |
unfolding subspace_def by (auto simp: inner_add_left) |
33175 | 7794 |
|
7795 |
lemma closed_substandard: |
|
52625 | 7796 |
"closed {x::'a::euclidean_space. \<forall>i\<in>Basis. P i --> x\<bullet>i = 0}" (is "closed ?A") |
7797 |
proof - |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
7798 |
let ?D = "{i\<in>Basis. P i}" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
7799 |
have "closed (\<Inter>i\<in>?D. {x::'a. x\<bullet>i = 0})" |
44457
d366fa5551ef
declare euclidean_simps [simp] at the point they are proved;
huffman
parents:
44365
diff
changeset
|
7800 |
by (simp add: closed_INT closed_Collect_eq) |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
7801 |
also have "(\<Inter>i\<in>?D. {x::'a. x\<bullet>i = 0}) = ?A" |
44457
d366fa5551ef
declare euclidean_simps [simp] at the point they are proved;
huffman
parents:
44365
diff
changeset
|
7802 |
by auto |
d366fa5551ef
declare euclidean_simps [simp] at the point they are proved;
huffman
parents:
44365
diff
changeset
|
7803 |
finally show "closed ?A" . |
33175 | 7804 |
qed |
7805 |
||
52625 | 7806 |
lemma dim_substandard: |
7807 |
assumes d: "d \<subseteq> Basis" |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
7808 |
shows "dim {x::'a::euclidean_space. \<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x\<bullet>i = 0} = card d" (is "dim ?A = _") |
53813 | 7809 |
proof (rule dim_unique) |
7810 |
show "d \<subseteq> ?A" |
|
7811 |
using d by (auto simp: inner_Basis) |
|
7812 |
show "independent d" |
|
7813 |
using independent_mono [OF independent_Basis d] . |
|
7814 |
show "?A \<subseteq> span d" |
|
7815 |
proof (clarify) |
|
7816 |
fix x assume x: "\<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x \<bullet> i = 0" |
|
7817 |
have "finite d" |
|
7818 |
using finite_subset [OF d finite_Basis] . |
|
7819 |
then have "(\<Sum>i\<in>d. (x \<bullet> i) *\<^sub>R i) \<in> span d" |
|
7820 |
by (simp add: span_setsum span_clauses) |
|
7821 |
also have "(\<Sum>i\<in>d. (x \<bullet> i) *\<^sub>R i) = (\<Sum>i\<in>Basis. (x \<bullet> i) *\<^sub>R i)" |
|
57418 | 7822 |
by (rule setsum.mono_neutral_cong_left [OF finite_Basis d]) (auto simp add: x) |
53813 | 7823 |
finally show "x \<in> span d" |
7824 |
unfolding euclidean_representation . |
|
7825 |
qed |
|
7826 |
qed simp |
|
33175 | 7827 |
|
60420 | 7828 |
text\<open>Hence closure and completeness of all subspaces.\<close> |
53282 | 7829 |
|
7830 |
lemma ex_card: |
|
7831 |
assumes "n \<le> card A" |
|
7832 |
shows "\<exists>S\<subseteq>A. card S = n" |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
7833 |
proof cases |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
7834 |
assume "finite A" |
55522 | 7835 |
from ex_bij_betw_nat_finite[OF this] obtain f where f: "bij_betw f {0..<card A} A" .. |
60420 | 7836 |
moreover from f \<open>n \<le> card A\<close> have "{..< n} \<subseteq> {..< card A}" "inj_on f {..< n}" |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
7837 |
by (auto simp: bij_betw_def intro: subset_inj_on) |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
7838 |
ultimately have "f ` {..< n} \<subseteq> A" "card (f ` {..< n}) = n" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
7839 |
by (auto simp: bij_betw_def card_image) |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
7840 |
then show ?thesis by blast |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
7841 |
next |
52625 | 7842 |
assume "\<not> finite A" |
60420 | 7843 |
with \<open>n \<le> card A\<close> show ?thesis by force |
52625 | 7844 |
qed |
7845 |
||
7846 |
lemma closed_subspace: |
|
53291 | 7847 |
fixes s :: "'a::euclidean_space set" |
52625 | 7848 |
assumes "subspace s" |
7849 |
shows "closed s" |
|
7850 |
proof - |
|
7851 |
have "dim s \<le> card (Basis :: 'a set)" |
|
7852 |
using dim_subset_UNIV by auto |
|
7853 |
with ex_card[OF this] obtain d :: "'a set" where t: "card d = dim s" and d: "d \<subseteq> Basis" |
|
7854 |
by auto |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
7855 |
let ?t = "{x::'a. \<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x\<bullet>i = 0}" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
7856 |
have "\<exists>f. linear f \<and> f ` {x::'a. \<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x \<bullet> i = 0} = s \<and> |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
7857 |
inj_on f {x::'a. \<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x \<bullet> i = 0}" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
7858 |
using dim_substandard[of d] t d assms |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
7859 |
by (intro subspace_isomorphism[OF subspace_substandard[of "\<lambda>i. i \<notin> d"]]) (auto simp: inner_Basis) |
55522 | 7860 |
then obtain f where f: |
7861 |
"linear f" |
|
7862 |
"f ` {x. \<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x \<bullet> i = 0} = s" |
|
7863 |
"inj_on f {x. \<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x \<bullet> i = 0}" |
|
7864 |
by blast |
|
52625 | 7865 |
interpret f: bounded_linear f |
7866 |
using f unfolding linear_conv_bounded_linear by auto |
|
7867 |
{ |
|
7868 |
fix x |
|
7869 |
have "x\<in>?t \<Longrightarrow> f x = 0 \<Longrightarrow> x = 0" |
|
7870 |
using f.zero d f(3)[THEN inj_onD, of x 0] by auto |
|
7871 |
} |
|
33175 | 7872 |
moreover have "closed ?t" using closed_substandard . |
7873 |
moreover have "subspace ?t" using subspace_substandard . |
|
52625 | 7874 |
ultimately show ?thesis |
7875 |
using closed_injective_image_subspace[of ?t f] |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
7876 |
unfolding f(2) using f(1) unfolding linear_conv_bounded_linear by auto |
33175 | 7877 |
qed |
7878 |
||
7879 |
lemma complete_subspace: |
|
52625 | 7880 |
fixes s :: "('a::euclidean_space) set" |
7881 |
shows "subspace s \<Longrightarrow> complete s" |
|
7882 |
using complete_eq_closed closed_subspace by auto |
|
33175 | 7883 |
|
7884 |
lemma dim_closure: |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
7885 |
fixes s :: "('a::euclidean_space) set" |
33175 | 7886 |
shows "dim(closure s) = dim s" (is "?dc = ?d") |
52625 | 7887 |
proof - |
33175 | 7888 |
have "?dc \<le> ?d" using closure_minimal[OF span_inc, of s] |
7889 |
using closed_subspace[OF subspace_span, of s] |
|
52625 | 7890 |
using dim_subset[of "closure s" "span s"] |
7891 |
unfolding dim_span |
|
7892 |
by auto |
|
53282 | 7893 |
then show ?thesis using dim_subset[OF closure_subset, of s] |
52625 | 7894 |
by auto |
33175 | 7895 |
qed |
7896 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
7897 |
|
60420 | 7898 |
subsection \<open>Affine transformations of intervals\<close> |
33175 | 7899 |
|
7900 |
lemma real_affinity_le: |
|
53291 | 7901 |
"0 < (m::'a::linordered_field) \<Longrightarrow> (m * x + c \<le> y \<longleftrightarrow> x \<le> inverse(m) * y + -(c / m))" |
57865 | 7902 |
by (simp add: field_simps) |
33175 | 7903 |
|
7904 |
lemma real_le_affinity: |
|
53291 | 7905 |
"0 < (m::'a::linordered_field) \<Longrightarrow> (y \<le> m * x + c \<longleftrightarrow> inverse(m) * y + -(c / m) \<le> x)" |
57865 | 7906 |
by (simp add: field_simps) |
33175 | 7907 |
|
7908 |
lemma real_affinity_lt: |
|
53291 | 7909 |
"0 < (m::'a::linordered_field) \<Longrightarrow> (m * x + c < y \<longleftrightarrow> x < inverse(m) * y + -(c / m))" |
57865 | 7910 |
by (simp add: field_simps) |
33175 | 7911 |
|
7912 |
lemma real_lt_affinity: |
|
53291 | 7913 |
"0 < (m::'a::linordered_field) \<Longrightarrow> (y < m * x + c \<longleftrightarrow> inverse(m) * y + -(c / m) < x)" |
57865 | 7914 |
by (simp add: field_simps) |
33175 | 7915 |
|
7916 |
lemma real_affinity_eq: |
|
53291 | 7917 |
"(m::'a::linordered_field) \<noteq> 0 \<Longrightarrow> (m * x + c = y \<longleftrightarrow> x = inverse(m) * y + -(c / m))" |
57865 | 7918 |
by (simp add: field_simps) |
33175 | 7919 |
|
7920 |
lemma real_eq_affinity: |
|
53291 | 7921 |
"(m::'a::linordered_field) \<noteq> 0 \<Longrightarrow> (y = m * x + c \<longleftrightarrow> inverse(m) * y + -(c / m) = x)" |
57865 | 7922 |
by (simp add: field_simps) |
33175 | 7923 |
|
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
7924 |
|
60420 | 7925 |
subsection \<open>Banach fixed point theorem (not really topological...)\<close> |
33175 | 7926 |
|
60974
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
7927 |
theorem banach_fix: |
53282 | 7928 |
assumes s: "complete s" "s \<noteq> {}" |
7929 |
and c: "0 \<le> c" "c < 1" |
|
7930 |
and f: "(f ` s) \<subseteq> s" |
|
53291 | 7931 |
and lipschitz: "\<forall>x\<in>s. \<forall>y\<in>s. dist (f x) (f y) \<le> c * dist x y" |
7932 |
shows "\<exists>!x\<in>s. f x = x" |
|
53282 | 7933 |
proof - |
33175 | 7934 |
have "1 - c > 0" using c by auto |
7935 |
||
7936 |
from s(2) obtain z0 where "z0 \<in> s" by auto |
|
7937 |
def z \<equiv> "\<lambda>n. (f ^^ n) z0" |
|
53282 | 7938 |
{ |
7939 |
fix n :: nat |
|
33175 | 7940 |
have "z n \<in> s" unfolding z_def |
52625 | 7941 |
proof (induct n) |
7942 |
case 0 |
|
60420 | 7943 |
then show ?case using \<open>z0 \<in> s\<close> by auto |
52625 | 7944 |
next |
7945 |
case Suc |
|
53282 | 7946 |
then show ?case using f by auto qed |
52625 | 7947 |
} note z_in_s = this |
33175 | 7948 |
|
7949 |
def d \<equiv> "dist (z 0) (z 1)" |
|
7950 |
||
7951 |
have fzn:"\<And>n. f (z n) = z (Suc n)" unfolding z_def by auto |
|
52625 | 7952 |
{ |
53282 | 7953 |
fix n :: nat |
33175 | 7954 |
have "dist (z n) (z (Suc n)) \<le> (c ^ n) * d" |
52625 | 7955 |
proof (induct n) |
53282 | 7956 |
case 0 |
7957 |
then show ?case |
|
52625 | 7958 |
unfolding d_def by auto |
33175 | 7959 |
next |
7960 |
case (Suc m) |
|
53282 | 7961 |
then have "c * dist (z m) (z (Suc m)) \<le> c ^ Suc m * d" |
60420 | 7962 |
using \<open>0 \<le> c\<close> |
52625 | 7963 |
using mult_left_mono[of "dist (z m) (z (Suc m))" "c ^ m * d" c] |
7964 |
by auto |
|
53282 | 7965 |
then show ?case |
52625 | 7966 |
using lipschitz[THEN bspec[where x="z m"], OF z_in_s, THEN bspec[where x="z (Suc m)"], OF z_in_s] |
7967 |
unfolding fzn and mult_le_cancel_left |
|
7968 |
by auto |
|
33175 | 7969 |
qed |
7970 |
} note cf_z = this |
|
7971 |
||
52625 | 7972 |
{ |
53282 | 7973 |
fix n m :: nat |
33175 | 7974 |
have "(1 - c) * dist (z m) (z (m+n)) \<le> (c ^ m) * d * (1 - c ^ n)" |
52625 | 7975 |
proof (induct n) |
53282 | 7976 |
case 0 |
7977 |
show ?case by auto |
|
33175 | 7978 |
next |
7979 |
case (Suc k) |
|
52625 | 7980 |
have "(1 - c) * dist (z m) (z (m + Suc k)) \<le> |
7981 |
(1 - c) * (dist (z m) (z (m + k)) + dist (z (m + k)) (z (Suc (m + k))))" |
|
7982 |
using dist_triangle and c by (auto simp add: dist_triangle) |
|
33175 | 7983 |
also have "\<dots> \<le> (1 - c) * (dist (z m) (z (m + k)) + c ^ (m + k) * d)" |
7984 |
using cf_z[of "m + k"] and c by auto |
|
7985 |
also have "\<dots> \<le> c ^ m * d * (1 - c ^ k) + (1 - c) * c ^ (m + k) * d" |
|
36350 | 7986 |
using Suc by (auto simp add: field_simps) |
33175 | 7987 |
also have "\<dots> = (c ^ m) * (d * (1 - c ^ k) + (1 - c) * c ^ k * d)" |
36350 | 7988 |
unfolding power_add by (auto simp add: field_simps) |
33175 | 7989 |
also have "\<dots> \<le> (c ^ m) * d * (1 - c ^ Suc k)" |
36350 | 7990 |
using c by (auto simp add: field_simps) |
33175 | 7991 |
finally show ?case by auto |
7992 |
qed |
|
7993 |
} note cf_z2 = this |
|
52625 | 7994 |
{ |
53282 | 7995 |
fix e :: real |
7996 |
assume "e > 0" |
|
7997 |
then have "\<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (z m) (z n) < e" |
|
52625 | 7998 |
proof (cases "d = 0") |
33175 | 7999 |
case True |
60420 | 8000 |
have *: "\<And>x. ((1 - c) * x \<le> 0) = (x \<le> 0)" using \<open>1 - c > 0\<close> |
57512
cc97b347b301
reduced name variants for assoc and commute on plus and mult
haftmann
parents:
57448
diff
changeset
|
8001 |
by (metis mult_zero_left mult.commute real_mult_le_cancel_iff1) |
41863 | 8002 |
from True have "\<And>n. z n = z0" using cf_z2[of 0] and c unfolding z_def |
8003 |
by (simp add: *) |
|
60420 | 8004 |
then show ?thesis using \<open>e>0\<close> by auto |
33175 | 8005 |
next |
52625 | 8006 |
case False |
53282 | 8007 |
then have "d>0" unfolding d_def using zero_le_dist[of "z 0" "z 1"] |
36778
739a9379e29b
avoid using real-specific versions of generic lemmas
huffman
parents:
36669
diff
changeset
|
8008 |
by (metis False d_def less_le) |
56541 | 8009 |
hence "0 < e * (1 - c) / d" |
60420 | 8010 |
using \<open>e>0\<close> and \<open>1-c>0\<close> by auto |
52625 | 8011 |
then obtain N where N:"c ^ N < e * (1 - c) / d" |
8012 |
using real_arch_pow_inv[of "e * (1 - c) / d" c] and c by auto |
|
8013 |
{ |
|
8014 |
fix m n::nat |
|
8015 |
assume "m>n" and as:"m\<ge>N" "n\<ge>N" |
|
60420 | 8016 |
have *:"c ^ n \<le> c ^ N" using \<open>n\<ge>N\<close> and c |
8017 |
using power_decreasing[OF \<open>n\<ge>N\<close>, of c] by auto |
|
52625 | 8018 |
have "1 - c ^ (m - n) > 0" |
60420 | 8019 |
using c and power_strict_mono[of c 1 "m - n"] using \<open>m>n\<close> by auto |
56541 | 8020 |
hence **: "d * (1 - c ^ (m - n)) / (1 - c) > 0" |
60420 | 8021 |
using \<open>d>0\<close> \<open>0 < 1 - c\<close> by auto |
33175 | 8022 |
|
8023 |
have "dist (z m) (z n) \<le> c ^ n * d * (1 - c ^ (m - n)) / (1 - c)" |
|
60420 | 8024 |
using cf_z2[of n "m - n"] and \<open>m>n\<close> |
8025 |
unfolding pos_le_divide_eq[OF \<open>1-c>0\<close>] |
|
57512
cc97b347b301
reduced name variants for assoc and commute on plus and mult
haftmann
parents:
57448
diff
changeset
|
8026 |
by (auto simp add: mult.commute dist_commute) |
33175 | 8027 |
also have "\<dots> \<le> c ^ N * d * (1 - c ^ (m - n)) / (1 - c)" |
8028 |
using mult_right_mono[OF * order_less_imp_le[OF **]] |
|
57512
cc97b347b301
reduced name variants for assoc and commute on plus and mult
haftmann
parents:
57448
diff
changeset
|
8029 |
unfolding mult.assoc by auto |
33175 | 8030 |
also have "\<dots> < (e * (1 - c) / d) * d * (1 - c ^ (m - n)) / (1 - c)" |
57512
cc97b347b301
reduced name variants for assoc and commute on plus and mult
haftmann
parents:
57448
diff
changeset
|
8031 |
using mult_strict_right_mono[OF N **] unfolding mult.assoc by auto |
53282 | 8032 |
also have "\<dots> = e * (1 - c ^ (m - n))" |
60420 | 8033 |
using c and \<open>d>0\<close> and \<open>1 - c > 0\<close> by auto |
8034 |
also have "\<dots> \<le> e" using c and \<open>1 - c ^ (m - n) > 0\<close> and \<open>e>0\<close> |
|
53282 | 8035 |
using mult_right_le_one_le[of e "1 - c ^ (m - n)"] by auto |
33175 | 8036 |
finally have "dist (z m) (z n) < e" by auto |
8037 |
} note * = this |
|
52625 | 8038 |
{ |
53282 | 8039 |
fix m n :: nat |
8040 |
assume as: "N \<le> m" "N \<le> n" |
|
8041 |
then have "dist (z n) (z m) < e" |
|
52625 | 8042 |
proof (cases "n = m") |
8043 |
case True |
|
60420 | 8044 |
then show ?thesis using \<open>e>0\<close> by auto |
33175 | 8045 |
next |
52625 | 8046 |
case False |
53282 | 8047 |
then show ?thesis using as and *[of n m] *[of m n] |
52625 | 8048 |
unfolding nat_neq_iff by (auto simp add: dist_commute) |
8049 |
qed |
|
8050 |
} |
|
53282 | 8051 |
then show ?thesis by auto |
33175 | 8052 |
qed |
8053 |
} |
|
53282 | 8054 |
then have "Cauchy z" |
8055 |
unfolding cauchy_def by auto |
|
52625 | 8056 |
then obtain x where "x\<in>s" and x:"(z ---> x) sequentially" |
8057 |
using s(1)[unfolded compact_def complete_def, THEN spec[where x=z]] and z_in_s by auto |
|
33175 | 8058 |
|
8059 |
def e \<equiv> "dist (f x) x" |
|
52625 | 8060 |
have "e = 0" |
8061 |
proof (rule ccontr) |
|
8062 |
assume "e \<noteq> 0" |
|
53282 | 8063 |
then have "e > 0" |
8064 |
unfolding e_def using zero_le_dist[of "f x" x] |
|
33175 | 8065 |
by (metis dist_eq_0_iff dist_nz e_def) |
8066 |
then obtain N where N:"\<forall>n\<ge>N. dist (z n) x < e / 2" |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59815
diff
changeset
|
8067 |
using x[unfolded lim_sequentially, THEN spec[where x="e/2"]] by auto |
53282 | 8068 |
then have N':"dist (z N) x < e / 2" by auto |
8069 |
||
8070 |
have *: "c * dist (z N) x \<le> dist (z N) x" |
|
52625 | 8071 |
unfolding mult_le_cancel_right2 |
33175 | 8072 |
using zero_le_dist[of "z N" x] and c |
36778
739a9379e29b
avoid using real-specific versions of generic lemmas
huffman
parents:
36669
diff
changeset
|
8073 |
by (metis dist_eq_0_iff dist_nz order_less_asym less_le) |
52625 | 8074 |
have "dist (f (z N)) (f x) \<le> c * dist (z N) x" |
8075 |
using lipschitz[THEN bspec[where x="z N"], THEN bspec[where x=x]] |
|
60420 | 8076 |
using z_in_s[of N] \<open>x\<in>s\<close> |
52625 | 8077 |
using c |
8078 |
by auto |
|
8079 |
also have "\<dots> < e / 2" |
|
8080 |
using N' and c using * by auto |
|
8081 |
finally show False |
|
8082 |
unfolding fzn |
|
33175 | 8083 |
using N[THEN spec[where x="Suc N"]] and dist_triangle_half_r[of "z (Suc N)" "f x" e x] |
52625 | 8084 |
unfolding e_def |
8085 |
by auto |
|
33175 | 8086 |
qed |
53282 | 8087 |
then have "f x = x" unfolding e_def by auto |
33175 | 8088 |
moreover |
52625 | 8089 |
{ |
8090 |
fix y |
|
8091 |
assume "f y = y" "y\<in>s" |
|
53282 | 8092 |
then have "dist x y \<le> c * dist x y" |
52625 | 8093 |
using lipschitz[THEN bspec[where x=x], THEN bspec[where x=y]] |
60420 | 8094 |
using \<open>x\<in>s\<close> and \<open>f x = x\<close> |
52625 | 8095 |
by auto |
53282 | 8096 |
then have "dist x y = 0" |
52625 | 8097 |
unfolding mult_le_cancel_right1 |
8098 |
using c and zero_le_dist[of x y] |
|
8099 |
by auto |
|
53282 | 8100 |
then have "y = x" by auto |
33175 | 8101 |
} |
60420 | 8102 |
ultimately show ?thesis using \<open>x\<in>s\<close> by blast+ |
8103 |
qed |
|
8104 |
||
8105 |
||
8106 |
subsection \<open>Edelstein fixed point theorem\<close> |
|
33175 | 8107 |
|
60974
6a6f15d8fbc4
New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
8108 |
theorem edelstein_fix: |
50970
3e5b67f85bf9
generalized theorem edelstein_fix to class metric_space
huffman
parents:
50955
diff
changeset
|
8109 |
fixes s :: "'a::metric_space set" |
52625 | 8110 |
assumes s: "compact s" "s \<noteq> {}" |
8111 |
and gs: "(g ` s) \<subseteq> s" |
|
8112 |
and dist: "\<forall>x\<in>s. \<forall>y\<in>s. x \<noteq> y \<longrightarrow> dist (g x) (g y) < dist x y" |
|
51347
f8a00792fbc1
tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents:
51346
diff
changeset
|
8113 |
shows "\<exists>!x\<in>s. g x = x" |
f8a00792fbc1
tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents:
51346
diff
changeset
|
8114 |
proof - |
f8a00792fbc1
tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents:
51346
diff
changeset
|
8115 |
let ?D = "(\<lambda>x. (x, x)) ` s" |
f8a00792fbc1
tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents:
51346
diff
changeset
|
8116 |
have D: "compact ?D" "?D \<noteq> {}" |
f8a00792fbc1
tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents:
51346
diff
changeset
|
8117 |
by (rule compact_continuous_image) |
f8a00792fbc1
tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents:
51346
diff
changeset
|
8118 |
(auto intro!: s continuous_Pair continuous_within_id simp: continuous_on_eq_continuous_within) |
f8a00792fbc1
tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents:
51346
diff
changeset
|
8119 |
|
f8a00792fbc1
tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents:
51346
diff
changeset
|
8120 |
have "\<And>x y e. x \<in> s \<Longrightarrow> y \<in> s \<Longrightarrow> 0 < e \<Longrightarrow> dist y x < e \<Longrightarrow> dist (g y) (g x) < e" |
f8a00792fbc1
tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents:
51346
diff
changeset
|
8121 |
using dist by fastforce |
f8a00792fbc1
tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents:
51346
diff
changeset
|
8122 |
then have "continuous_on s g" |
f8a00792fbc1
tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents:
51346
diff
changeset
|
8123 |
unfolding continuous_on_iff by auto |
f8a00792fbc1
tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents:
51346
diff
changeset
|
8124 |
then have cont: "continuous_on ?D (\<lambda>x. dist ((g \<circ> fst) x) (snd x))" |
f8a00792fbc1
tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents:
51346
diff
changeset
|
8125 |
unfolding continuous_on_eq_continuous_within |
f8a00792fbc1
tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents:
51346
diff
changeset
|
8126 |
by (intro continuous_dist ballI continuous_within_compose) |
60040
1fa1023b13b9
move MOST and INFM in Infinite_Set to Filter; change them to abbreviations over the cofinite filter
hoelzl
parents:
60017
diff
changeset
|
8127 |
(auto intro!: continuous_fst continuous_snd continuous_within_id simp: image_image) |
51347
f8a00792fbc1
tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents:
51346
diff
changeset
|
8128 |
|
f8a00792fbc1
tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents:
51346
diff
changeset
|
8129 |
obtain a where "a \<in> s" and le: "\<And>x. x \<in> s \<Longrightarrow> dist (g a) a \<le> dist (g x) x" |
f8a00792fbc1
tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents:
51346
diff
changeset
|
8130 |
using continuous_attains_inf[OF D cont] by auto |
f8a00792fbc1
tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents:
51346
diff
changeset
|
8131 |
|
f8a00792fbc1
tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents:
51346
diff
changeset
|
8132 |
have "g a = a" |
f8a00792fbc1
tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents:
51346
diff
changeset
|
8133 |
proof (rule ccontr) |
f8a00792fbc1
tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents:
51346
diff
changeset
|
8134 |
assume "g a \<noteq> a" |
60420 | 8135 |
with \<open>a \<in> s\<close> gs have "dist (g (g a)) (g a) < dist (g a) a" |
51347
f8a00792fbc1
tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents:
51346
diff
changeset
|
8136 |
by (intro dist[rule_format]) auto |
f8a00792fbc1
tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents:
51346
diff
changeset
|
8137 |
moreover have "dist (g a) a \<le> dist (g (g a)) (g a)" |
60420 | 8138 |
using \<open>a \<in> s\<close> gs by (intro le) auto |
51347
f8a00792fbc1
tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents:
51346
diff
changeset
|
8139 |
ultimately show False by auto |
33175 | 8140 |
qed |
51347
f8a00792fbc1
tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup)
hoelzl
parents:
51346
diff
changeset
|
8141 |
moreover have "\<And>x. x \<in> s \<Longrightarrow> g x = x \<Longrightarrow> x = a" |
60420 | 8142 |
using dist[THEN bspec[where x=a]] \<open>g a = a\<close> and \<open>a\<in>s\<close> by auto |
8143 |
ultimately show "\<exists>!x\<in>s. g x = x" using \<open>a \<in> s\<close> by blast |
|
33175 | 8144 |
qed |
8145 |
||
54775
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
immler
parents:
54489
diff
changeset
|
8146 |
no_notation |
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
immler
parents:
54489
diff
changeset
|
8147 |
eucl_less (infix "<e" 50) |
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
immler
parents:
54489
diff
changeset
|
8148 |
|
33175 | 8149 |
end |