author | hoelzl |
Fri, 18 Jan 2013 20:00:59 +0100 | |
changeset 50971 | 5e3d3d690975 |
parent 50970 | 3e5b67f85bf9 |
child 50972 | d2c6a0a7fcdf |
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 |
||
7 |
header {* Elementary topology in Euclidean space. *} |
|
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" |
50087 | 13 |
"~~/src/HOL/Library/Glbs" |
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
|
14 |
"~~/src/HOL/Library/FuncSet" |
50938 | 15 |
Linear_Algebra |
50087 | 16 |
Norm_Arith |
17 |
begin |
|
18 |
||
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
|
19 |
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
|
20 |
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
|
21 |
|
50942 | 22 |
(* TODO: Move this to RComplete.thy -- would need to include Glb into RComplete *) |
23 |
lemma real_isGlb_unique: "[| isGlb R S x; isGlb R S y |] ==> x = (y::real)" |
|
24 |
apply (frule isGlb_isLb) |
|
25 |
apply (frule_tac x = y in isGlb_isLb) |
|
26 |
apply (blast intro!: order_antisym dest!: isGlb_le_isLb) |
|
27 |
done |
|
28 |
||
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
|
29 |
lemma countable_PiE: |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
30 |
"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
|
31 |
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
|
32 |
|
50087 | 33 |
subsection {* Topological Basis *} |
34 |
||
35 |
context topological_space |
|
36 |
begin |
|
37 |
||
38 |
definition "topological_basis B = |
|
39 |
((\<forall>b\<in>B. open b) \<and> (\<forall>x. open x \<longrightarrow> (\<exists>B'. B' \<subseteq> B \<and> Union B' = x)))" |
|
40 |
||
41 |
lemma topological_basis_iff: |
|
42 |
assumes "\<And>B'. B' \<in> B \<Longrightarrow> open B'" |
|
43 |
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'))" |
|
44 |
(is "_ \<longleftrightarrow> ?rhs") |
|
45 |
proof safe |
|
46 |
fix O' and x::'a |
|
47 |
assume H: "topological_basis B" "open O'" "x \<in> O'" |
|
48 |
hence "(\<exists>B'\<subseteq>B. \<Union>B' = O')" by (simp add: topological_basis_def) |
|
49 |
then obtain B' where "B' \<subseteq> B" "O' = \<Union>B'" by auto |
|
50 |
thus "\<exists>B'\<in>B. x \<in> B' \<and> B' \<subseteq> O'" using H by auto |
|
51 |
next |
|
52 |
assume H: ?rhs |
|
53 |
show "topological_basis B" using assms unfolding topological_basis_def |
|
54 |
proof safe |
|
55 |
fix O'::"'a set" assume "open O'" |
|
56 |
with H obtain f where "\<forall>x\<in>O'. f x \<in> B \<and> x \<in> f x \<and> f x \<subseteq> O'" |
|
57 |
by (force intro: bchoice simp: Bex_def) |
|
58 |
thus "\<exists>B'\<subseteq>B. \<Union>B' = O'" |
|
59 |
by (auto intro: exI[where x="{f x |x. x \<in> O'}"]) |
|
60 |
qed |
|
61 |
qed |
|
62 |
||
63 |
lemma topological_basisI: |
|
64 |
assumes "\<And>B'. B' \<in> B \<Longrightarrow> open B'" |
|
65 |
assumes "\<And>O' x. open O' \<Longrightarrow> x \<in> O' \<Longrightarrow> \<exists>B'\<in>B. x \<in> B' \<and> B' \<subseteq> O'" |
|
66 |
shows "topological_basis B" |
|
67 |
using assms by (subst topological_basis_iff) auto |
|
68 |
||
69 |
lemma topological_basisE: |
|
70 |
fixes O' |
|
71 |
assumes "topological_basis B" |
|
72 |
assumes "open O'" |
|
73 |
assumes "x \<in> O'" |
|
74 |
obtains B' where "B' \<in> B" "x \<in> B'" "B' \<subseteq> O'" |
|
75 |
proof atomize_elim |
|
76 |
from assms have "\<And>B'. B'\<in>B \<Longrightarrow> open B'" by (simp add: topological_basis_def) |
|
77 |
with topological_basis_iff assms |
|
78 |
show "\<exists>B'. B' \<in> B \<and> x \<in> B' \<and> B' \<subseteq> O'" using assms by (simp add: Bex_def) |
|
79 |
qed |
|
80 |
||
50094
84ddcf5364b4
allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents:
50087
diff
changeset
|
81 |
lemma topological_basis_open: |
84ddcf5364b4
allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents:
50087
diff
changeset
|
82 |
assumes "topological_basis B" |
84ddcf5364b4
allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents:
50087
diff
changeset
|
83 |
assumes "X \<in> B" |
84ddcf5364b4
allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents:
50087
diff
changeset
|
84 |
shows "open X" |
84ddcf5364b4
allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents:
50087
diff
changeset
|
85 |
using assms |
84ddcf5364b4
allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents:
50087
diff
changeset
|
86 |
by (simp add: topological_basis_def) |
84ddcf5364b4
allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents:
50087
diff
changeset
|
87 |
|
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
88 |
lemma basis_dense: |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
89 |
fixes B::"'a set set" and f::"'a set \<Rightarrow> 'a" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
90 |
assumes "topological_basis B" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
91 |
assumes choosefrom_basis: "\<And>B'. B' \<noteq> {} \<Longrightarrow> f B' \<in> B'" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
92 |
shows "(\<forall>X. open X \<longrightarrow> X \<noteq> {} \<longrightarrow> (\<exists>B' \<in> B. f B' \<in> X))" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
93 |
proof (intro allI impI) |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
94 |
fix X::"'a set" assume "open X" "X \<noteq> {}" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
95 |
from topological_basisE[OF `topological_basis B` `open X` choosefrom_basis[OF `X \<noteq> {}`]] |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
96 |
guess B' . note B' = this |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
97 |
thus "\<exists>B'\<in>B. f B' \<in> X" by (auto intro!: choosefrom_basis) |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
98 |
qed |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
99 |
|
50087 | 100 |
end |
101 |
||
50882
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
102 |
lemma topological_basis_prod: |
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
103 |
assumes A: "topological_basis A" and B: "topological_basis B" |
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
104 |
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
|
105 |
unfolding topological_basis_def |
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
106 |
proof (safe, simp_all del: ex_simps add: subset_image_iff ex_simps(1)[symmetric]) |
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
107 |
fix S :: "('a \<times> 'b) set" assume "open S" |
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
108 |
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
|
109 |
proof (safe intro!: exI[of _ "{x\<in>A \<times> B. fst x \<times> snd x \<subseteq> S}"]) |
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
110 |
fix x y assume "(x, y) \<in> S" |
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
111 |
from open_prod_elim[OF `open S` this] |
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
112 |
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
|
113 |
by (metis mem_Sigma_iff) |
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
114 |
moreover from topological_basisE[OF A a] guess A0 . |
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
115 |
moreover from topological_basisE[OF B b] guess B0 . |
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
116 |
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
|
117 |
by (intro UN_I[of "(A0, B0)"]) auto |
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
118 |
qed auto |
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
119 |
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
|
120 |
|
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
121 |
subsection {* Countable Basis *} |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
122 |
|
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
123 |
locale countable_basis = |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
124 |
fixes B::"'a::topological_space set set" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
125 |
assumes is_basis: "topological_basis B" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
126 |
assumes countable_basis: "countable B" |
33175 | 127 |
begin |
128 |
||
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
129 |
lemma open_countable_basis_ex: |
50087 | 130 |
assumes "open X" |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
131 |
shows "\<exists>B' \<subseteq> B. X = Union B'" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
132 |
using assms countable_basis is_basis unfolding topological_basis_def by blast |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
133 |
|
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
134 |
lemma open_countable_basisE: |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
135 |
assumes "open X" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
136 |
obtains B' where "B' \<subseteq> B" "X = Union B'" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
137 |
using assms open_countable_basis_ex by (atomize_elim) simp |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
138 |
|
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
139 |
lemma countable_dense_exists: |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
140 |
shows "\<exists>D::'a set. countable D \<and> (\<forall>X. open X \<longrightarrow> X \<noteq> {} \<longrightarrow> (\<exists>d \<in> D. d \<in> X))" |
50087 | 141 |
proof - |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
142 |
let ?f = "(\<lambda>B'. SOME x. x \<in> B')" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
143 |
have "countable (?f ` B)" using countable_basis by simp |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
144 |
with basis_dense[OF is_basis, of ?f] show ?thesis |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
145 |
by (intro exI[where x="?f ` B"]) (metis (mono_tags) all_not_in_conv imageI someI) |
50087 | 146 |
qed |
147 |
||
148 |
lemma countable_dense_setE: |
|
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
149 |
obtains D :: "'a set" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
150 |
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
|
151 |
using countable_dense_exists by blast |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
152 |
|
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
153 |
text {* Construction of an increasing sequence approximating open sets, |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
154 |
therefore basis which is closed under union. *} |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
155 |
|
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
156 |
definition union_closed_basis::"'a set set" where |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
157 |
"union_closed_basis = (\<lambda>l. \<Union>set l) ` lists B" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
158 |
|
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
159 |
lemma basis_union_closed_basis: "topological_basis union_closed_basis" |
50094
84ddcf5364b4
allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents:
50087
diff
changeset
|
160 |
proof (rule topological_basisI) |
84ddcf5364b4
allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents:
50087
diff
changeset
|
161 |
fix O' and x::'a assume "open O'" "x \<in> O'" |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
162 |
from topological_basisE[OF is_basis this] guess B' . note B' = this |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
163 |
thus "\<exists>B'\<in>union_closed_basis. x \<in> B' \<and> B' \<subseteq> O'" unfolding union_closed_basis_def |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
164 |
by (auto intro!: bexI[where x="[B']"]) |
50094
84ddcf5364b4
allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents:
50087
diff
changeset
|
165 |
next |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
166 |
fix B' assume "B' \<in> union_closed_basis" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
167 |
thus "open B'" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
168 |
using topological_basis_open[OF is_basis] |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
169 |
by (auto simp: union_closed_basis_def) |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
170 |
qed |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
171 |
|
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
172 |
lemma countable_union_closed_basis: "countable union_closed_basis" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
173 |
unfolding union_closed_basis_def using countable_basis by simp |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
174 |
|
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
175 |
lemmas open_union_closed_basis = topological_basis_open[OF basis_union_closed_basis] |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
176 |
|
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
177 |
lemma union_closed_basis_ex: |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
178 |
assumes X: "X \<in> union_closed_basis" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
179 |
shows "\<exists>B'. finite B' \<and> X = \<Union>B' \<and> B' \<subseteq> B" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
180 |
proof - |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
181 |
from X obtain l where "\<And>x. x\<in>set l \<Longrightarrow> x\<in>B" "X = \<Union>set l" by (auto simp: union_closed_basis_def) |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
182 |
thus ?thesis by auto |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
183 |
qed |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
184 |
|
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
185 |
lemma union_closed_basisE: |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
186 |
assumes "X \<in> union_closed_basis" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
187 |
obtains B' where "finite B'" "X = \<Union>B'" "B' \<subseteq> B" using union_closed_basis_ex[OF assms] by blast |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
188 |
|
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
189 |
lemma union_closed_basisI: |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
190 |
assumes "finite B'" "X = \<Union>B'" "B' \<subseteq> B" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
191 |
shows "X \<in> union_closed_basis" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
192 |
proof - |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
193 |
from finite_list[OF `finite B'`] guess l .. |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
194 |
thus ?thesis using assms unfolding union_closed_basis_def by (auto intro!: image_eqI[where x=l]) |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
195 |
qed |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
196 |
|
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
197 |
lemma empty_basisI[intro]: "{} \<in> union_closed_basis" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
198 |
by (rule union_closed_basisI[of "{}"]) auto |
50087 | 199 |
|
200 |
lemma union_basisI[intro]: |
|
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
201 |
assumes "X \<in> union_closed_basis" "Y \<in> union_closed_basis" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
202 |
shows "X \<union> Y \<in> union_closed_basis" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
203 |
using assms by (auto intro: union_closed_basisI elim!:union_closed_basisE) |
50087 | 204 |
|
205 |
lemma open_imp_Union_of_incseq: |
|
206 |
assumes "open X" |
|
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
207 |
shows "\<exists>S. incseq S \<and> (\<Union>j. S j) = X \<and> range S \<subseteq> union_closed_basis" |
50087 | 208 |
proof - |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
209 |
from open_countable_basis_ex[OF `open X`] |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
210 |
obtain B' where B': "B'\<subseteq>B" "X = \<Union>B'" by auto |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
211 |
from this(1) countable_basis have "countable B'" by (rule countable_subset) |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
212 |
show ?thesis |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
213 |
proof cases |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
214 |
assume "B' \<noteq> {}" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
215 |
def S \<equiv> "\<lambda>n. \<Union>i\<in>{0..n}. from_nat_into B' i" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
216 |
have S:"\<And>n. S n = \<Union>{from_nat_into B' i|i. i\<in>{0..n}}" unfolding S_def by force |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
217 |
have "incseq S" by (force simp: S_def incseq_Suc_iff) |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
218 |
moreover |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
219 |
have "(\<Union>j. S j) = X" unfolding B' |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
220 |
proof safe |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
221 |
fix x X assume "X \<in> B'" "x \<in> X" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
222 |
then obtain n where "X = from_nat_into B' n" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
223 |
by (metis `countable B'` from_nat_into_surj) |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
224 |
also have "\<dots> \<subseteq> S n" by (auto simp: S_def) |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
225 |
finally show "x \<in> (\<Union>j. S j)" using `x \<in> X` by auto |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
226 |
next |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
227 |
fix x n |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
228 |
assume "x \<in> S n" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
229 |
also have "\<dots> = (\<Union>i\<in>{0..n}. from_nat_into B' i)" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
230 |
by (simp add: S_def) |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
231 |
also have "\<dots> \<subseteq> (\<Union>i. from_nat_into B' i)" by auto |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
232 |
also have "\<dots> \<subseteq> \<Union>B'" using `B' \<noteq> {}` by (auto intro: from_nat_into) |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
233 |
finally show "x \<in> \<Union>B'" . |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
234 |
qed |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
235 |
moreover have "range S \<subseteq> union_closed_basis" using B' |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
236 |
by (auto intro!: union_closed_basisI[OF _ S] simp: from_nat_into `B' \<noteq> {}`) |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
237 |
ultimately show ?thesis by auto |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
238 |
qed (auto simp: B') |
50087 | 239 |
qed |
240 |
||
241 |
lemma open_incseqE: |
|
242 |
assumes "open X" |
|
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
243 |
obtains S where "incseq S" "(\<Union>j. S j) = X" "range S \<subseteq> union_closed_basis" |
50087 | 244 |
using open_imp_Union_of_incseq assms by atomize_elim |
245 |
||
246 |
end |
|
247 |
||
50883 | 248 |
class first_countable_topology = topological_space + |
249 |
assumes first_countable_basis: |
|
250 |
"\<exists>A. countable A \<and> (\<forall>a\<in>A. x \<in> a \<and> open a) \<and> (\<forall>S. open S \<and> x \<in> S \<longrightarrow> (\<exists>a\<in>A. a \<subseteq> S))" |
|
251 |
||
252 |
lemma (in first_countable_topology) countable_basis_at_decseq: |
|
253 |
obtains A :: "nat \<Rightarrow> 'a set" where |
|
254 |
"\<And>i. open (A i)" "\<And>i. x \<in> (A i)" |
|
255 |
"\<And>S. open S \<Longrightarrow> x \<in> S \<Longrightarrow> eventually (\<lambda>i. A i \<subseteq> S) sequentially" |
|
256 |
proof atomize_elim |
|
257 |
from first_countable_basis[of x] obtain A |
|
258 |
where "countable A" |
|
259 |
and nhds: "\<And>a. a \<in> A \<Longrightarrow> open a" "\<And>a. a \<in> A \<Longrightarrow> x \<in> a" |
|
260 |
and incl: "\<And>S. open S \<Longrightarrow> x \<in> S \<Longrightarrow> \<exists>a\<in>A. a \<subseteq> S" by auto |
|
261 |
then have "A \<noteq> {}" by auto |
|
262 |
with `countable A` have r: "A = range (from_nat_into A)" by auto |
|
263 |
def F \<equiv> "\<lambda>n. \<Inter>i\<le>n. from_nat_into A i" |
|
264 |
show "\<exists>A. (\<forall>i. open (A i)) \<and> (\<forall>i. x \<in> A i) \<and> |
|
265 |
(\<forall>S. open S \<longrightarrow> x \<in> S \<longrightarrow> eventually (\<lambda>i. A i \<subseteq> S) sequentially)" |
|
266 |
proof (safe intro!: exI[of _ F]) |
|
267 |
fix i |
|
268 |
show "open (F i)" using nhds(1) r by (auto simp: F_def intro!: open_INT) |
|
269 |
show "x \<in> F i" using nhds(2) r by (auto simp: F_def) |
|
270 |
next |
|
271 |
fix S assume "open S" "x \<in> S" |
|
272 |
from incl[OF this] obtain i where "F i \<subseteq> S" |
|
273 |
by (subst (asm) r) (auto simp: F_def) |
|
274 |
moreover have "\<And>j. i \<le> j \<Longrightarrow> F j \<subseteq> F i" |
|
275 |
by (auto simp: F_def) |
|
276 |
ultimately show "eventually (\<lambda>i. F i \<subseteq> S) sequentially" |
|
277 |
by (auto simp: eventually_sequentially) |
|
278 |
qed |
|
279 |
qed |
|
280 |
||
281 |
lemma (in first_countable_topology) first_countable_basisE: |
|
282 |
obtains A where "countable A" "\<And>a. a \<in> A \<Longrightarrow> x \<in> a" "\<And>a. a \<in> A \<Longrightarrow> open a" |
|
283 |
"\<And>S. open S \<Longrightarrow> x \<in> S \<Longrightarrow> (\<exists>a\<in>A. a \<subseteq> S)" |
|
284 |
using first_countable_basis[of x] |
|
285 |
by atomize_elim auto |
|
286 |
||
287 |
instance prod :: (first_countable_topology, first_countable_topology) first_countable_topology |
|
288 |
proof |
|
289 |
fix x :: "'a \<times> 'b" |
|
290 |
from first_countable_basisE[of "fst x"] guess A :: "'a set set" . note A = this |
|
291 |
from first_countable_basisE[of "snd x"] guess B :: "'b set set" . note B = this |
|
292 |
show "\<exists>A::('a\<times>'b) set set. countable A \<and> (\<forall>a\<in>A. x \<in> a \<and> open a) \<and> (\<forall>S. open S \<and> x \<in> S \<longrightarrow> (\<exists>a\<in>A. a \<subseteq> S))" |
|
293 |
proof (intro exI[of _ "(\<lambda>(a, b). a \<times> b) ` (A \<times> B)"], safe) |
|
294 |
fix a b assume x: "a \<in> A" "b \<in> B" |
|
295 |
with A(2, 3)[of a] B(2, 3)[of b] show "x \<in> a \<times> b" "open (a \<times> b)" |
|
296 |
unfolding mem_Times_iff by (auto intro: open_Times) |
|
297 |
next |
|
298 |
fix S assume "open S" "x \<in> S" |
|
299 |
from open_prod_elim[OF this] guess a' b' . |
|
300 |
moreover with A(4)[of a'] B(4)[of b'] |
|
301 |
obtain a b where "a \<in> A" "a \<subseteq> a'" "b \<in> B" "b \<subseteq> b'" by auto |
|
302 |
ultimately show "\<exists>a\<in>(\<lambda>(a, b). a \<times> b) ` (A \<times> B). a \<subseteq> S" |
|
303 |
by (auto intro!: bexI[of _ "a \<times> b"] bexI[of _ a] bexI[of _ b]) |
|
304 |
qed (simp add: A B) |
|
305 |
qed |
|
306 |
||
307 |
instance metric_space \<subseteq> first_countable_topology |
|
308 |
proof |
|
309 |
fix x :: 'a |
|
310 |
show "\<exists>A. countable A \<and> (\<forall>a\<in>A. x \<in> a \<and> open a) \<and> (\<forall>S. open S \<and> x \<in> S \<longrightarrow> (\<exists>a\<in>A. a \<subseteq> S))" |
|
311 |
proof (intro exI, safe) |
|
312 |
fix S assume "open S" "x \<in> S" |
|
313 |
then obtain r where "0 < r" "{y. dist x y < r} \<subseteq> S" |
|
314 |
by (auto simp: open_dist dist_commute subset_eq) |
|
315 |
moreover from reals_Archimedean[OF `0 < r`] guess n .. |
|
316 |
moreover |
|
317 |
then have "{y. dist x y < inverse (Suc n)} \<subseteq> {y. dist x y < r}" |
|
318 |
by (auto simp: inverse_eq_divide) |
|
319 |
ultimately show "\<exists>a\<in>range (\<lambda>n. {y. dist x y < inverse (Suc n)}). a \<subseteq> S" |
|
320 |
by auto |
|
321 |
qed (auto intro: open_ball) |
|
322 |
qed |
|
323 |
||
50881
ae630bab13da
renamed countable_basis_space to second_countable_topology
hoelzl
parents:
50526
diff
changeset
|
324 |
class second_countable_topology = topological_space + |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
325 |
assumes ex_countable_basis: |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
326 |
"\<exists>B::'a::topological_space set set. countable B \<and> topological_basis B" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
327 |
|
50881
ae630bab13da
renamed countable_basis_space to second_countable_topology
hoelzl
parents:
50526
diff
changeset
|
328 |
sublocale second_countable_topology < countable_basis "SOME B. countable B \<and> topological_basis B" |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
329 |
using someI_ex[OF ex_countable_basis] by unfold_locales safe |
50094
84ddcf5364b4
allow arbitrary enumerations of basis in locale for generation of borel sets
immler
parents:
50087
diff
changeset
|
330 |
|
50882
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
331 |
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
|
332 |
proof |
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
333 |
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
|
334 |
using ex_countable_basis by auto |
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
335 |
moreover |
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
336 |
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
|
337 |
using ex_countable_basis by auto |
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
338 |
ultimately show "\<exists>B::('a \<times> 'b) set set. countable B \<and> topological_basis B" |
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
339 |
by (auto intro!: exI[of _ "(\<lambda>(a, b). a \<times> b) ` (A \<times> B)"] topological_basis_prod) |
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
340 |
qed |
a382bf90867e
move prod instantiation of second_countable_topology to its definition
hoelzl
parents:
50881
diff
changeset
|
341 |
|
50883 | 342 |
instance second_countable_topology \<subseteq> first_countable_topology |
343 |
proof |
|
344 |
fix x :: 'a |
|
345 |
def B \<equiv> "SOME B::'a set set. countable B \<and> topological_basis B" |
|
346 |
then have B: "countable B" "topological_basis B" |
|
347 |
using countable_basis is_basis |
|
348 |
by (auto simp: countable_basis is_basis) |
|
349 |
then show "\<exists>A. countable A \<and> (\<forall>a\<in>A. x \<in> a \<and> open a) \<and> (\<forall>S. open S \<and> x \<in> S \<longrightarrow> (\<exists>a\<in>A. a \<subseteq> S))" |
|
350 |
by (intro exI[of _ "{b\<in>B. x \<in> b}"]) |
|
351 |
(fastforce simp: topological_space_class.topological_basis_def) |
|
352 |
qed |
|
353 |
||
50087 | 354 |
subsection {* Polish spaces *} |
355 |
||
356 |
text {* Textbooks define Polish spaces as completely metrizable. |
|
357 |
We assume the topology to be complete for a given metric. *} |
|
358 |
||
50881
ae630bab13da
renamed countable_basis_space to second_countable_topology
hoelzl
parents:
50526
diff
changeset
|
359 |
class polish_space = complete_space + second_countable_topology |
50087 | 360 |
|
44517 | 361 |
subsection {* General notion of a topology as a value *} |
33175 | 362 |
|
44170
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44167
diff
changeset
|
363 |
definition "istopology L \<longleftrightarrow> 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))" |
49834 | 364 |
typedef 'a topology = "{L::('a set) \<Rightarrow> bool. istopology L}" |
33175 | 365 |
morphisms "openin" "topology" |
366 |
unfolding istopology_def by blast |
|
367 |
||
368 |
lemma istopology_open_in[intro]: "istopology(openin U)" |
|
369 |
using openin[of U] by blast |
|
370 |
||
371 |
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
|
372 |
using topology_inverse[unfolded mem_Collect_eq] . |
33175 | 373 |
|
374 |
lemma topology_inverse_iff: "istopology U \<longleftrightarrow> openin (topology U) = U" |
|
375 |
using topology_inverse[of U] istopology_open_in[of "topology U"] by auto |
|
376 |
||
377 |
lemma topology_eq: "T1 = T2 \<longleftrightarrow> (\<forall>S. openin T1 S \<longleftrightarrow> openin T2 S)" |
|
378 |
proof- |
|
49711 | 379 |
{ assume "T1=T2" |
380 |
hence "\<forall>S. openin T1 S \<longleftrightarrow> openin T2 S" by simp } |
|
33175 | 381 |
moreover |
49711 | 382 |
{ assume H: "\<forall>S. openin T1 S \<longleftrightarrow> openin T2 S" |
44170
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44167
diff
changeset
|
383 |
hence "openin T1 = openin T2" by (simp add: fun_eq_iff) |
33175 | 384 |
hence "topology (openin T1) = topology (openin T2)" by simp |
49711 | 385 |
hence "T1 = T2" unfolding openin_inverse . |
386 |
} |
|
33175 | 387 |
ultimately show ?thesis by blast |
388 |
qed |
|
389 |
||
390 |
text{* Infer the "universe" from union of all sets in the topology. *} |
|
391 |
||
392 |
definition "topspace T = \<Union>{S. openin T S}" |
|
393 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
394 |
subsubsection {* Main properties of open sets *} |
33175 | 395 |
|
396 |
lemma openin_clauses: |
|
397 |
fixes U :: "'a topology" |
|
398 |
shows "openin U {}" |
|
399 |
"\<And>S T. openin U S \<Longrightarrow> openin U T \<Longrightarrow> openin U (S\<inter>T)" |
|
400 |
"\<And>K. (\<forall>S \<in> K. openin U S) \<Longrightarrow> openin U (\<Union>K)" |
|
44170
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44167
diff
changeset
|
401 |
using openin[of U] unfolding istopology_def mem_Collect_eq |
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44167
diff
changeset
|
402 |
by fast+ |
33175 | 403 |
|
404 |
lemma openin_subset[intro]: "openin U S \<Longrightarrow> S \<subseteq> topspace U" |
|
405 |
unfolding topspace_def by blast |
|
406 |
lemma openin_empty[simp]: "openin U {}" by (simp add: openin_clauses) |
|
407 |
||
408 |
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
|
409 |
using openin_clauses by simp |
06475a1547cb
fix lots of looping simp calls and other warnings
huffman
parents:
36360
diff
changeset
|
410 |
|
06475a1547cb
fix lots of looping simp calls and other warnings
huffman
parents:
36360
diff
changeset
|
411 |
lemma openin_Union[intro]: "(\<forall>S \<in>K. openin U S) \<Longrightarrow> openin U (\<Union> K)" |
06475a1547cb
fix lots of looping simp calls and other warnings
huffman
parents:
36360
diff
changeset
|
412 |
using openin_clauses by simp |
33175 | 413 |
|
414 |
lemma openin_Un[intro]: "openin U S \<Longrightarrow> openin U T \<Longrightarrow> openin U (S \<union> T)" |
|
415 |
using openin_Union[of "{S,T}" U] by auto |
|
416 |
||
417 |
lemma openin_topspace[intro, simp]: "openin U (topspace U)" by (simp add: openin_Union topspace_def) |
|
418 |
||
49711 | 419 |
lemma openin_subopen: "openin U S \<longleftrightarrow> (\<forall>x \<in> S. \<exists>T. openin U T \<and> x \<in> T \<and> T \<subseteq> S)" |
420 |
(is "?lhs \<longleftrightarrow> ?rhs") |
|
36584 | 421 |
proof |
49711 | 422 |
assume ?lhs |
423 |
then show ?rhs by auto |
|
36584 | 424 |
next |
425 |
assume H: ?rhs |
|
426 |
let ?t = "\<Union>{T. openin U T \<and> T \<subseteq> S}" |
|
427 |
have "openin U ?t" by (simp add: openin_Union) |
|
428 |
also have "?t = S" using H by auto |
|
429 |
finally show "openin U S" . |
|
33175 | 430 |
qed |
431 |
||
49711 | 432 |
|
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
433 |
subsubsection {* Closed sets *} |
33175 | 434 |
|
435 |
definition "closedin U S \<longleftrightarrow> S \<subseteq> topspace U \<and> openin U (topspace U - S)" |
|
436 |
||
437 |
lemma closedin_subset: "closedin U S \<Longrightarrow> S \<subseteq> topspace U" by (metis closedin_def) |
|
438 |
lemma closedin_empty[simp]: "closedin U {}" by (simp add: closedin_def) |
|
439 |
lemma closedin_topspace[intro,simp]: |
|
440 |
"closedin U (topspace U)" by (simp add: closedin_def) |
|
441 |
lemma closedin_Un[intro]: "closedin U S \<Longrightarrow> closedin U T \<Longrightarrow> closedin U (S \<union> T)" |
|
442 |
by (auto simp add: Diff_Un closedin_def) |
|
443 |
||
444 |
lemma Diff_Inter[intro]: "A - \<Inter>S = \<Union> {A - s|s. s\<in>S}" by auto |
|
445 |
lemma closedin_Inter[intro]: assumes Ke: "K \<noteq> {}" and Kc: "\<forall>S \<in>K. closedin U S" |
|
446 |
shows "closedin U (\<Inter> K)" using Ke Kc unfolding closedin_def Diff_Inter by auto |
|
447 |
||
448 |
lemma closedin_Int[intro]: "closedin U S \<Longrightarrow> closedin U T \<Longrightarrow> closedin U (S \<inter> T)" |
|
449 |
using closedin_Inter[of "{S,T}" U] by auto |
|
450 |
||
451 |
lemma Diff_Diff_Int: "A - (A - B) = A \<inter> B" by blast |
|
452 |
lemma openin_closedin_eq: "openin U S \<longleftrightarrow> S \<subseteq> topspace U \<and> closedin U (topspace U - S)" |
|
453 |
apply (auto simp add: closedin_def Diff_Diff_Int inf_absorb2) |
|
454 |
apply (metis openin_subset subset_eq) |
|
455 |
done |
|
456 |
||
457 |
lemma openin_closedin: "S \<subseteq> topspace U \<Longrightarrow> (openin U S \<longleftrightarrow> closedin U (topspace U - S))" |
|
458 |
by (simp add: openin_closedin_eq) |
|
459 |
||
460 |
lemma openin_diff[intro]: assumes oS: "openin U S" and cT: "closedin U T" shows "openin U (S - T)" |
|
461 |
proof- |
|
462 |
have "S - T = S \<inter> (topspace U - T)" using openin_subset[of U S] oS cT |
|
463 |
by (auto simp add: topspace_def openin_subset) |
|
464 |
then show ?thesis using oS cT by (auto simp add: closedin_def) |
|
465 |
qed |
|
466 |
||
467 |
lemma closedin_diff[intro]: assumes oS: "closedin U S" and cT: "openin U T" shows "closedin U (S - T)" |
|
468 |
proof- |
|
469 |
have "S - T = S \<inter> (topspace U - T)" using closedin_subset[of U S] oS cT |
|
470 |
by (auto simp add: topspace_def ) |
|
471 |
then show ?thesis using oS cT by (auto simp add: openin_closedin_eq) |
|
472 |
qed |
|
473 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
474 |
subsubsection {* Subspace topology *} |
44170
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44167
diff
changeset
|
475 |
|
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44167
diff
changeset
|
476 |
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
|
477 |
|
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44167
diff
changeset
|
478 |
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
|
479 |
(is "istopology ?L") |
33175 | 480 |
proof- |
44170
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44167
diff
changeset
|
481 |
have "?L {}" by blast |
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44167
diff
changeset
|
482 |
{fix A B assume A: "?L A" and B: "?L B" |
33175 | 483 |
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" by blast |
484 |
have "A\<inter>B = (Sa \<inter> Sb) \<inter> V" "openin U (Sa \<inter> Sb)" using Sa Sb by blast+ |
|
44170
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44167
diff
changeset
|
485 |
then have "?L (A \<inter> B)" by blast} |
33175 | 486 |
moreover |
44170
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44167
diff
changeset
|
487 |
{fix K assume K: "K \<subseteq> Collect ?L" |
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44167
diff
changeset
|
488 |
have th0: "Collect ?L = (\<lambda>S. S \<inter> V) ` Collect (openin U)" |
39302
d7728f65b353
renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
nipkow
parents:
39198
diff
changeset
|
489 |
apply (rule set_eqI) |
33175 | 490 |
apply (simp add: Ball_def image_iff) |
44170
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44167
diff
changeset
|
491 |
by metis |
33175 | 492 |
from K[unfolded th0 subset_image_iff] |
44170
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44167
diff
changeset
|
493 |
obtain Sk where Sk: "Sk \<subseteq> Collect (openin U)" "K = (\<lambda>S. S \<inter> V) ` Sk" by blast |
33175 | 494 |
have "\<Union>K = (\<Union>Sk) \<inter> V" using Sk by auto |
44170
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44167
diff
changeset
|
495 |
moreover have "openin U (\<Union> Sk)" using Sk by (auto simp add: subset_eq) |
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44167
diff
changeset
|
496 |
ultimately have "?L (\<Union>K)" by blast} |
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44167
diff
changeset
|
497 |
ultimately show ?thesis |
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44167
diff
changeset
|
498 |
unfolding subset_eq mem_Collect_eq istopology_def by blast |
33175 | 499 |
qed |
500 |
||
501 |
lemma openin_subtopology: |
|
502 |
"openin (subtopology U V) S \<longleftrightarrow> (\<exists> T. (openin U T) \<and> (S = T \<inter> V))" |
|
503 |
unfolding subtopology_def topology_inverse'[OF istopology_subtopology] |
|
44170
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44167
diff
changeset
|
504 |
by auto |
33175 | 505 |
|
506 |
lemma topspace_subtopology: "topspace(subtopology U V) = topspace U \<inter> V" |
|
507 |
by (auto simp add: topspace_def openin_subtopology) |
|
508 |
||
509 |
lemma closedin_subtopology: |
|
510 |
"closedin (subtopology U V) S \<longleftrightarrow> (\<exists>T. closedin U T \<and> S = T \<inter> V)" |
|
511 |
unfolding closedin_def topspace_subtopology |
|
512 |
apply (simp add: openin_subtopology) |
|
513 |
apply (rule iffI) |
|
514 |
apply clarify |
|
515 |
apply (rule_tac x="topspace U - T" in exI) |
|
516 |
by auto |
|
517 |
||
518 |
lemma openin_subtopology_refl: "openin (subtopology U V) V \<longleftrightarrow> V \<subseteq> topspace U" |
|
519 |
unfolding openin_subtopology |
|
520 |
apply (rule iffI, clarify) |
|
521 |
apply (frule openin_subset[of U]) apply blast |
|
522 |
apply (rule exI[where x="topspace U"]) |
|
49711 | 523 |
apply auto |
524 |
done |
|
525 |
||
526 |
lemma subtopology_superset: |
|
527 |
assumes UV: "topspace U \<subseteq> V" |
|
33175 | 528 |
shows "subtopology U V = U" |
529 |
proof- |
|
530 |
{fix S |
|
531 |
{fix T assume T: "openin U T" "S = T \<inter> V" |
|
532 |
from T openin_subset[OF T(1)] UV have eq: "S = T" by blast |
|
533 |
have "openin U S" unfolding eq using T by blast} |
|
534 |
moreover |
|
535 |
{assume S: "openin U S" |
|
536 |
hence "\<exists>T. openin U T \<and> S = T \<inter> V" |
|
537 |
using openin_subset[OF S] UV by auto} |
|
538 |
ultimately have "(\<exists>T. openin U T \<and> S = T \<inter> V) \<longleftrightarrow> openin U S" by blast} |
|
539 |
then show ?thesis unfolding topology_eq openin_subtopology by blast |
|
540 |
qed |
|
541 |
||
542 |
lemma subtopology_topspace[simp]: "subtopology U (topspace U) = U" |
|
543 |
by (simp add: subtopology_superset) |
|
544 |
||
545 |
lemma subtopology_UNIV[simp]: "subtopology U UNIV = U" |
|
546 |
by (simp add: subtopology_superset) |
|
547 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
548 |
subsubsection {* The standard Euclidean topology *} |
33175 | 549 |
|
550 |
definition |
|
551 |
euclidean :: "'a::topological_space topology" where |
|
552 |
"euclidean = topology open" |
|
553 |
||
554 |
lemma open_openin: "open S \<longleftrightarrow> openin euclidean S" |
|
555 |
unfolding euclidean_def |
|
556 |
apply (rule cong[where x=S and y=S]) |
|
557 |
apply (rule topology_inverse[symmetric]) |
|
558 |
apply (auto simp add: istopology_def) |
|
44170
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44167
diff
changeset
|
559 |
done |
33175 | 560 |
|
561 |
lemma topspace_euclidean: "topspace euclidean = UNIV" |
|
562 |
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
|
563 |
apply (rule set_eqI) |
33175 | 564 |
by (auto simp add: open_openin[symmetric]) |
565 |
||
566 |
lemma topspace_euclidean_subtopology[simp]: "topspace (subtopology euclidean S) = S" |
|
567 |
by (simp add: topspace_euclidean topspace_subtopology) |
|
568 |
||
569 |
lemma closed_closedin: "closed S \<longleftrightarrow> closedin euclidean S" |
|
570 |
by (simp add: closed_def closedin_def topspace_euclidean open_openin Compl_eq_Diff_UNIV) |
|
571 |
||
572 |
lemma open_subopen: "open S \<longleftrightarrow> (\<forall>x\<in>S. \<exists>T. open T \<and> x \<in> T \<and> T \<subseteq> S)" |
|
573 |
by (simp add: open_openin openin_subopen[symmetric]) |
|
574 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
575 |
text {* Basic "localization" results are handy for connectedness. *} |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
576 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
577 |
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
|
578 |
by (auto simp add: openin_subtopology open_openin[symmetric]) |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
579 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
580 |
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
|
581 |
by (auto simp add: openin_open) |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
582 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
583 |
lemma open_openin_trans[trans]: |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
584 |
"open S \<Longrightarrow> open T \<Longrightarrow> T \<subseteq> S \<Longrightarrow> openin (subtopology euclidean S) T" |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
585 |
by (metis Int_absorb1 openin_open_Int) |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
586 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
587 |
lemma open_subset: "S \<subseteq> T \<Longrightarrow> open S \<Longrightarrow> openin (subtopology euclidean T) S" |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
588 |
by (auto simp add: openin_open) |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
589 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
590 |
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
|
591 |
by (simp add: closedin_subtopology closed_closedin Int_ac) |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
592 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
593 |
lemma closedin_closed_Int: "closed S ==> closedin (subtopology euclidean U) (U \<inter> S)" |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
594 |
by (metis closedin_closed) |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
595 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
596 |
lemma closed_closedin_trans: "closed S \<Longrightarrow> closed T \<Longrightarrow> T \<subseteq> S \<Longrightarrow> closedin (subtopology euclidean S) T" |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
597 |
apply (subgoal_tac "S \<inter> T = T" ) |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
598 |
apply auto |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
599 |
apply (frule closedin_closed_Int[of T S]) |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
600 |
by simp |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
601 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
602 |
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
|
603 |
by (auto simp add: closedin_closed) |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
604 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
605 |
lemma openin_euclidean_subtopology_iff: |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
606 |
fixes S U :: "'a::metric_space set" |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
607 |
shows "openin (subtopology euclidean U) S |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
608 |
\<longleftrightarrow> S \<subseteq> U \<and> (\<forall>x\<in>S. \<exists>e>0. \<forall>x'\<in>U. dist x' x < e \<longrightarrow> x'\<in> S)" (is "?lhs \<longleftrightarrow> ?rhs") |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
609 |
proof |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
610 |
assume ?lhs thus ?rhs unfolding openin_open open_dist by blast |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
611 |
next |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
612 |
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
|
613 |
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
|
614 |
unfolding T_def |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
615 |
apply clarsimp |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
616 |
apply (rule_tac x="d - dist x a" in exI) |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
617 |
apply (clarsimp simp add: less_diff_eq) |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
618 |
apply (erule rev_bexI) |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
619 |
apply (rule_tac x=d in exI, clarify) |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
620 |
apply (erule le_less_trans [OF dist_triangle]) |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
621 |
done |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
622 |
assume ?rhs hence 2: "S = U \<inter> T" |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
623 |
unfolding T_def |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
624 |
apply auto |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
625 |
apply (drule (1) bspec, erule rev_bexI) |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
626 |
apply auto |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
627 |
done |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
628 |
from 1 2 show ?lhs |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
629 |
unfolding openin_open open_dist by fast |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
630 |
qed |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
631 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
632 |
text {* These "transitivity" results are handy too *} |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
633 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
634 |
lemma openin_trans[trans]: "openin (subtopology euclidean T) S \<Longrightarrow> openin (subtopology euclidean U) T |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
635 |
\<Longrightarrow> openin (subtopology euclidean U) S" |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
636 |
unfolding open_openin openin_open by blast |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
637 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
638 |
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
|
639 |
by (auto simp add: openin_open intro: openin_trans) |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
640 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
641 |
lemma closedin_trans[trans]: |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
642 |
"closedin (subtopology euclidean T) S \<Longrightarrow> |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
643 |
closedin (subtopology euclidean U) T |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
644 |
==> closedin (subtopology euclidean U) S" |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
645 |
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
|
646 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
647 |
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
|
648 |
by (auto simp add: closedin_closed intro: closedin_trans) |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
649 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
650 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
651 |
subsection {* Open and closed balls *} |
33175 | 652 |
|
653 |
definition |
|
654 |
ball :: "'a::metric_space \<Rightarrow> real \<Rightarrow> 'a set" where |
|
655 |
"ball x e = {y. dist x y < e}" |
|
656 |
||
657 |
definition |
|
658 |
cball :: "'a::metric_space \<Rightarrow> real \<Rightarrow> 'a set" where |
|
659 |
"cball x e = {y. dist x y \<le> e}" |
|
660 |
||
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
|
661 |
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
|
662 |
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
|
663 |
|
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
|
664 |
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
|
665 |
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
|
666 |
|
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
|
667 |
lemma mem_ball_0: |
33175 | 668 |
fixes x :: "'a::real_normed_vector" |
669 |
shows "x \<in> ball 0 e \<longleftrightarrow> norm x < e" |
|
670 |
by (simp add: dist_norm) |
|
671 |
||
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
|
672 |
lemma mem_cball_0: |
33175 | 673 |
fixes x :: "'a::real_normed_vector" |
674 |
shows "x \<in> cball 0 e \<longleftrightarrow> norm x \<le> e" |
|
675 |
by (simp add: dist_norm) |
|
676 |
||
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
|
677 |
lemma centre_in_ball: "x \<in> ball x e \<longleftrightarrow> 0 < 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
|
678 |
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
|
679 |
|
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
|
680 |
lemma centre_in_cball: "x \<in> cball x e \<longleftrightarrow> 0 \<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
|
681 |
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
|
682 |
|
33175 | 683 |
lemma ball_subset_cball[simp,intro]: "ball x e \<subseteq> cball x e" by (simp add: subset_eq) |
684 |
lemma subset_ball[intro]: "d <= e ==> ball x d \<subseteq> ball x e" by (simp add: subset_eq) |
|
685 |
lemma subset_cball[intro]: "d <= e ==> cball x d \<subseteq> cball x e" by (simp add: subset_eq) |
|
686 |
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
|
687 |
by (simp add: set_eq_iff) arith |
33175 | 688 |
|
689 |
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
|
690 |
by (simp add: set_eq_iff) |
33175 | 691 |
|
692 |
lemma diff_less_iff: "(a::real) - b > 0 \<longleftrightarrow> a > b" |
|
693 |
"(a::real) - b < 0 \<longleftrightarrow> a < b" |
|
694 |
"a - b < c \<longleftrightarrow> a < c +b" "a - b > c \<longleftrightarrow> a > c +b" by arith+ |
|
695 |
lemma diff_le_iff: "(a::real) - b \<ge> 0 \<longleftrightarrow> a \<ge> b" "(a::real) - b \<le> 0 \<longleftrightarrow> a \<le> b" |
|
696 |
"a - b \<le> c \<longleftrightarrow> a \<le> c +b" "a - b \<ge> c \<longleftrightarrow> a \<ge> c +b" by arith+ |
|
697 |
||
698 |
lemma open_ball[intro, simp]: "open (ball x e)" |
|
44170
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44167
diff
changeset
|
699 |
unfolding open_dist ball_def mem_Collect_eq Ball_def |
33175 | 700 |
unfolding dist_commute |
701 |
apply clarify |
|
702 |
apply (rule_tac x="e - dist xa x" in exI) |
|
703 |
using dist_triangle_alt[where z=x] |
|
704 |
apply (clarsimp simp add: diff_less_iff) |
|
705 |
apply atomize |
|
706 |
apply (erule_tac x="y" in allE) |
|
707 |
apply (erule_tac x="xa" in allE) |
|
708 |
by arith |
|
709 |
||
710 |
lemma open_contains_ball: "open S \<longleftrightarrow> (\<forall>x\<in>S. \<exists>e>0. ball x e \<subseteq> S)" |
|
711 |
unfolding open_dist subset_eq mem_ball Ball_def dist_commute .. |
|
712 |
||
33714
eb2574ac4173
Added new lemmas to Euclidean Space by Robert Himmelmann
hoelzl
parents:
33324
diff
changeset
|
713 |
lemma openE[elim?]: |
eb2574ac4173
Added new lemmas to Euclidean Space by Robert Himmelmann
hoelzl
parents:
33324
diff
changeset
|
714 |
assumes "open S" "x\<in>S" |
eb2574ac4173
Added new lemmas to Euclidean Space by Robert Himmelmann
hoelzl
parents:
33324
diff
changeset
|
715 |
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
|
716 |
using assms unfolding open_contains_ball by auto |
eb2574ac4173
Added new lemmas to Euclidean Space by Robert Himmelmann
hoelzl
parents:
33324
diff
changeset
|
717 |
|
33175 | 718 |
lemma open_contains_ball_eq: "open S \<Longrightarrow> \<forall>x. x\<in>S \<longleftrightarrow> (\<exists>e>0. ball x e \<subseteq> S)" |
719 |
by (metis open_contains_ball subset_eq centre_in_ball) |
|
720 |
||
721 |
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
|
722 |
unfolding mem_ball set_eq_iff |
33175 | 723 |
apply (simp add: not_less) |
724 |
by (metis zero_le_dist order_trans dist_self) |
|
725 |
||
726 |
lemma ball_empty[intro]: "e \<le> 0 ==> ball x e = {}" by simp |
|
727 |
||
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
|
728 |
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
|
729 |
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
|
730 |
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
|
731 |
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
|
732 |
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
|
733 |
|
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
734 |
definition "box a b = {x. \<forall>i\<in>Basis. a \<bullet> i < x \<bullet> i \<and> x \<bullet> i < b \<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
|
735 |
|
50087 | 736 |
lemma rational_boxes: |
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
|
737 |
fixes x :: "'a\<Colon>euclidean_space" |
50087 | 738 |
assumes "0 < 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
|
739 |
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 | 740 |
proof - |
741 |
def e' \<equiv> "e / (2 * sqrt (real (DIM ('a))))" |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
742 |
then have e: "0 < e'" using assms by (auto intro!: divide_pos_pos simp: DIM_positive) |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
743 |
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 | 744 |
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
|
745 |
fix i from Rats_dense_in_real[of "x \<bullet> i - e'" "x \<bullet> i"] e show "?th i" by auto |
50087 | 746 |
qed |
747 |
from choice[OF this] guess a .. note a = this |
|
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
|
748 |
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 | 749 |
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
|
750 |
fix i from Rats_dense_in_real[of "x \<bullet> i" "x \<bullet> i + e'"] e show "?th i" by auto |
50087 | 751 |
qed |
752 |
from choice[OF this] guess b .. note b = this |
|
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
|
753 |
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
|
754 |
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
|
755 |
proof (rule exI[of _ ?a], rule exI[of _ ?b], safe) |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
756 |
fix y :: 'a assume *: "y \<in> box ?a ?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
|
757 |
have "dist x y = sqrt (\<Sum>i\<in>Basis. (dist (x \<bullet> i) (y \<bullet> i))\<twosuperior>)" |
50087 | 758 |
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
|
759 |
also have "\<dots> < sqrt (\<Sum>(i::'a)\<in>Basis. e^2 / real (DIM('a)))" |
50087 | 760 |
proof (rule real_sqrt_less_mono, rule setsum_strict_mono) |
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
|
761 |
fix i :: "'a" assume i: "i \<in> 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
|
762 |
have "a i < y\<bullet>i \<and> y\<bullet>i < b i" using * i by (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
|
763 |
moreover have "a i < x\<bullet>i" "x\<bullet>i - a i < e'" using a by auto |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
764 |
moreover have "x\<bullet>i < b i" "b i - x\<bullet>i < e'" using b by auto |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
765 |
ultimately have "\<bar>x\<bullet>i - y\<bullet>i\<bar> < 2 * e'" by auto |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
766 |
then have "dist (x \<bullet> i) (y \<bullet> i) < e/sqrt (real (DIM('a)))" |
50087 | 767 |
unfolding e'_def by (auto simp: dist_real_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
|
768 |
then have "(dist (x \<bullet> i) (y \<bullet> i))\<twosuperior> < (e/sqrt (real (DIM('a))))\<twosuperior>" |
50087 | 769 |
by (rule power_strict_mono) 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
|
770 |
then show "(dist (x \<bullet> i) (y \<bullet> i))\<twosuperior> < e\<twosuperior> / real DIM('a)" |
50087 | 771 |
by (simp add: power_divide) |
772 |
qed 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
|
773 |
also have "\<dots> = e" using `0 < e` by (simp add: real_eq_of_nat) |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
774 |
finally show "y \<in> ball x e" by (auto simp: ball_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
|
775 |
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
|
776 |
qed |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
777 |
|
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
778 |
lemma open_UNION_box: |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
779 |
fixes M :: "'a\<Colon>euclidean_space set" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
780 |
assumes "open M" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
781 |
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
|
782 |
defines "b' \<equiv> \<lambda>f :: 'a \<Rightarrow> real \<times> real. (\<Sum>(i::'a)\<in>Basis. snd (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
|
783 |
defines "I \<equiv> {f\<in>Basis \<rightarrow>\<^isub>E \<rat> \<times> \<rat>. box (a' f) (b' f) \<subseteq> M}" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
784 |
shows "M = (\<Union>f\<in>I. box (a' f) (b' f))" |
50087 | 785 |
proof safe |
786 |
fix x assume "x \<in> M" |
|
787 |
obtain e where e: "e > 0" "ball x e \<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
|
788 |
using openE[OF `open M` `x \<in> M`] by auto |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
789 |
moreover then obtain a b where ab: "x \<in> box a 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
|
790 |
"\<forall>i \<in> Basis. a \<bullet> i \<in> \<rat>" "\<forall>i\<in>Basis. b \<bullet> i \<in> \<rat>" "box a b \<subseteq> ball x e" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
791 |
using rational_boxes[OF e(1)] by metis |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
792 |
ultimately show "x \<in> (\<Union>f\<in>I. box (a' f) (b' 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
|
793 |
by (intro UN_I[of "\<lambda>i\<in>Basis. (a \<bullet> i, b \<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
|
794 |
(auto simp: euclidean_representation I_def a'_def b'_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
|
795 |
qed (auto simp: I_def) |
33175 | 796 |
|
797 |
subsection{* Connectedness *} |
|
798 |
||
799 |
definition "connected S \<longleftrightarrow> |
|
800 |
~(\<exists>e1 e2. open e1 \<and> open e2 \<and> S \<subseteq> (e1 \<union> e2) \<and> (e1 \<inter> e2 \<inter> S = {}) |
|
801 |
\<and> ~(e1 \<inter> S = {}) \<and> ~(e2 \<inter> S = {}))" |
|
802 |
||
803 |
lemma connected_local: |
|
804 |
"connected S \<longleftrightarrow> ~(\<exists>e1 e2. |
|
805 |
openin (subtopology euclidean S) e1 \<and> |
|
806 |
openin (subtopology euclidean S) e2 \<and> |
|
807 |
S \<subseteq> e1 \<union> e2 \<and> |
|
808 |
e1 \<inter> e2 = {} \<and> |
|
809 |
~(e1 = {}) \<and> |
|
810 |
~(e2 = {}))" |
|
811 |
unfolding connected_def openin_open by (safe, blast+) |
|
812 |
||
34105 | 813 |
lemma exists_diff: |
814 |
fixes P :: "'a set \<Rightarrow> bool" |
|
815 |
shows "(\<exists>S. P(- S)) \<longleftrightarrow> (\<exists>S. P S)" (is "?lhs \<longleftrightarrow> ?rhs") |
|
33175 | 816 |
proof- |
817 |
{assume "?lhs" hence ?rhs by blast } |
|
818 |
moreover |
|
819 |
{fix S assume H: "P S" |
|
34105 | 820 |
have "S = - (- S)" by auto |
821 |
with H have "P (- (- S))" by metis } |
|
33175 | 822 |
ultimately show ?thesis by metis |
823 |
qed |
|
824 |
||
825 |
lemma connected_clopen: "connected S \<longleftrightarrow> |
|
826 |
(\<forall>T. openin (subtopology euclidean S) T \<and> |
|
827 |
closedin (subtopology euclidean S) T \<longrightarrow> T = {} \<or> T = S)" (is "?lhs \<longleftrightarrow> ?rhs") |
|
828 |
proof- |
|
34105 | 829 |
have " \<not> connected S \<longleftrightarrow> (\<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 | 830 |
unfolding connected_def openin_open closedin_closed |
831 |
apply (subst exists_diff) by blast |
|
34105 | 832 |
hence th0: "connected S \<longleftrightarrow> \<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> {})" |
833 |
(is " _ \<longleftrightarrow> \<not> (\<exists>e2 e1. ?P e2 e1)") apply (simp add: closed_def) by metis |
|
33175 | 834 |
|
835 |
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'))" |
|
836 |
(is "_ \<longleftrightarrow> \<not> (\<exists>t' t. ?Q t' t)") |
|
837 |
unfolding connected_def openin_open closedin_closed by auto |
|
838 |
{fix e2 |
|
839 |
{fix e1 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)" |
|
840 |
by auto} |
|
841 |
then have "(\<exists>e1. ?P e2 e1) \<longleftrightarrow> (\<exists>t. ?Q e2 t)" by metis} |
|
842 |
then have "\<forall>e2. (\<exists>e1. ?P e2 e1) \<longleftrightarrow> (\<exists>t. ?Q e2 t)" by blast |
|
843 |
then show ?thesis unfolding th0 th1 by simp |
|
844 |
qed |
|
845 |
||
846 |
lemma connected_empty[simp, intro]: "connected {}" |
|
847 |
by (simp add: connected_def) |
|
848 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
849 |
|
33175 | 850 |
subsection{* Limit points *} |
851 |
||
44207
ea99698c2070
locale-ize some definitions, so perfect_space and heine_borel can inherit from the proper superclasses
huffman
parents:
44170
diff
changeset
|
852 |
definition (in topological_space) |
ea99698c2070
locale-ize some definitions, so perfect_space and heine_borel can inherit from the proper superclasses
huffman
parents:
44170
diff
changeset
|
853 |
islimpt:: "'a \<Rightarrow> 'a set \<Rightarrow> bool" (infixr "islimpt" 60) where |
33175 | 854 |
"x islimpt S \<longleftrightarrow> (\<forall>T. x\<in>T \<longrightarrow> open T \<longrightarrow> (\<exists>y\<in>S. y\<in>T \<and> y\<noteq>x))" |
855 |
||
856 |
lemma islimptI: |
|
857 |
assumes "\<And>T. x \<in> T \<Longrightarrow> open T \<Longrightarrow> \<exists>y\<in>S. y \<in> T \<and> y \<noteq> x" |
|
858 |
shows "x islimpt S" |
|
859 |
using assms unfolding islimpt_def by auto |
|
860 |
||
861 |
lemma islimptE: |
|
862 |
assumes "x islimpt S" and "x \<in> T" and "open T" |
|
863 |
obtains y where "y \<in> S" and "y \<in> T" and "y \<noteq> x" |
|
864 |
using assms unfolding islimpt_def by auto |
|
865 |
||
44584 | 866 |
lemma islimpt_iff_eventually: "x islimpt S \<longleftrightarrow> \<not> eventually (\<lambda>y. y \<notin> S) (at x)" |
867 |
unfolding islimpt_def eventually_at_topological by auto |
|
868 |
||
869 |
lemma islimpt_subset: "\<lbrakk>x islimpt S; S \<subseteq> T\<rbrakk> \<Longrightarrow> x islimpt T" |
|
870 |
unfolding islimpt_def by fast |
|
33175 | 871 |
|
872 |
lemma islimpt_approachable: |
|
873 |
fixes x :: "'a::metric_space" |
|
874 |
shows "x islimpt S \<longleftrightarrow> (\<forall>e>0. \<exists>x'\<in>S. x' \<noteq> x \<and> dist x' x < e)" |
|
44584 | 875 |
unfolding islimpt_iff_eventually eventually_at by fast |
33175 | 876 |
|
877 |
lemma islimpt_approachable_le: |
|
878 |
fixes x :: "'a::metric_space" |
|
879 |
shows "x islimpt S \<longleftrightarrow> (\<forall>e>0. \<exists>x'\<in> S. x' \<noteq> x \<and> dist x' x <= e)" |
|
880 |
unfolding islimpt_approachable |
|
44584 | 881 |
using approachable_lt_le [where f="\<lambda>y. dist y x" and P="\<lambda>y. y \<notin> S \<or> y = x", |
882 |
THEN arg_cong [where f=Not]] |
|
883 |
by (simp add: Bex_def conj_commute conj_left_commute) |
|
33175 | 884 |
|
44571 | 885 |
lemma islimpt_UNIV_iff: "x islimpt UNIV \<longleftrightarrow> \<not> open {x}" |
886 |
unfolding islimpt_def by (safe, fast, case_tac "T = {x}", fast, fast) |
|
887 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
888 |
text {* A perfect space has no isolated points. *} |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
889 |
|
44571 | 890 |
lemma islimpt_UNIV [simp, intro]: "(x::'a::perfect_space) islimpt UNIV" |
891 |
unfolding islimpt_UNIV_iff by (rule not_open_singleton) |
|
33175 | 892 |
|
893 |
lemma perfect_choose_dist: |
|
44072
5b970711fb39
class perfect_space inherits from topological_space;
huffman
parents:
43338
diff
changeset
|
894 |
fixes x :: "'a::{perfect_space, metric_space}" |
33175 | 895 |
shows "0 < r \<Longrightarrow> \<exists>a. a \<noteq> x \<and> dist a x < r" |
896 |
using islimpt_UNIV [of x] |
|
897 |
by (simp add: islimpt_approachable) |
|
898 |
||
899 |
lemma closed_limpt: "closed S \<longleftrightarrow> (\<forall>x. x islimpt S \<longrightarrow> x \<in> S)" |
|
900 |
unfolding closed_def |
|
901 |
apply (subst open_subopen) |
|
34105 | 902 |
apply (simp add: islimpt_def subset_eq) |
44170
510ac30f44c0
make Multivariate_Analysis work with separate set type
huffman
parents:
44167
diff
changeset
|
903 |
by (metis ComplE ComplI) |
33175 | 904 |
|
905 |
lemma islimpt_EMPTY[simp]: "\<not> x islimpt {}" |
|
906 |
unfolding islimpt_def by auto |
|
907 |
||
908 |
lemma finite_set_avoid: |
|
909 |
fixes a :: "'a::metric_space" |
|
910 |
assumes fS: "finite S" shows "\<exists>d>0. \<forall>x\<in>S. x \<noteq> a \<longrightarrow> d <= dist a x" |
|
911 |
proof(induct rule: finite_induct[OF fS]) |
|
41863 | 912 |
case 1 thus ?case by (auto intro: zero_less_one) |
33175 | 913 |
next |
914 |
case (2 x F) |
|
915 |
from 2 obtain d where d: "d >0" "\<forall>x\<in>F. x\<noteq>a \<longrightarrow> d \<le> dist a x" by blast |
|
916 |
{assume "x = a" hence ?case using d by auto } |
|
917 |
moreover |
|
918 |
{assume xa: "x\<noteq>a" |
|
919 |
let ?d = "min d (dist a x)" |
|
920 |
have dp: "?d > 0" using xa d(1) using dist_nz by auto |
|
921 |
from d have d': "\<forall>x\<in>F. x\<noteq>a \<longrightarrow> ?d \<le> dist a x" by auto |
|
922 |
with dp xa have ?case by(auto intro!: exI[where x="?d"]) } |
|
923 |
ultimately show ?case by blast |
|
924 |
qed |
|
925 |
||
926 |
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
|
927 |
by (simp add: islimpt_iff_eventually eventually_conj_iff) |
33175 | 928 |
|
929 |
lemma discrete_imp_closed: |
|
930 |
fixes S :: "'a::metric_space set" |
|
931 |
assumes e: "0 < e" and d: "\<forall>x \<in> S. \<forall>y \<in> S. dist y x < e \<longrightarrow> y = x" |
|
932 |
shows "closed S" |
|
933 |
proof- |
|
934 |
{fix x assume C: "\<forall>e>0. \<exists>x'\<in>S. x' \<noteq> x \<and> dist x' x < e" |
|
935 |
from e have e2: "e/2 > 0" by arith |
|
936 |
from C[rule_format, OF e2] obtain y where y: "y \<in> S" "y\<noteq>x" "dist y x < e/2" by blast |
|
937 |
let ?m = "min (e/2) (dist x y) " |
|
938 |
from e2 y(2) have mp: "?m > 0" by (simp add: dist_nz[THEN sym]) |
|
939 |
from C[rule_format, OF mp] obtain z where z: "z \<in> S" "z\<noteq>x" "dist z x < ?m" by blast |
|
940 |
have th: "dist z y < e" using z y |
|
941 |
by (intro dist_triangle_lt [where z=x], simp) |
|
942 |
from d[rule_format, OF y(1) z(1) th] y z |
|
943 |
have False by (auto simp add: dist_commute)} |
|
944 |
then show ?thesis by (metis islimpt_approachable closed_limpt [where 'a='a]) |
|
945 |
qed |
|
946 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
947 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
948 |
subsection {* Interior of a Set *} |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
949 |
|
44519 | 950 |
definition "interior S = \<Union>{T. open T \<and> T \<subseteq> S}" |
951 |
||
952 |
lemma interiorI [intro?]: |
|
953 |
assumes "open T" and "x \<in> T" and "T \<subseteq> S" |
|
954 |
shows "x \<in> interior S" |
|
955 |
using assms unfolding interior_def by fast |
|
956 |
||
957 |
lemma interiorE [elim?]: |
|
958 |
assumes "x \<in> interior S" |
|
959 |
obtains T where "open T" and "x \<in> T" and "T \<subseteq> S" |
|
960 |
using assms unfolding interior_def by fast |
|
961 |
||
962 |
lemma open_interior [simp, intro]: "open (interior S)" |
|
963 |
by (simp add: interior_def open_Union) |
|
964 |
||
965 |
lemma interior_subset: "interior S \<subseteq> S" |
|
966 |
by (auto simp add: interior_def) |
|
967 |
||
968 |
lemma interior_maximal: "T \<subseteq> S \<Longrightarrow> open T \<Longrightarrow> T \<subseteq> interior S" |
|
969 |
by (auto simp add: interior_def) |
|
970 |
||
971 |
lemma interior_open: "open S \<Longrightarrow> interior S = S" |
|
972 |
by (intro equalityI interior_subset interior_maximal subset_refl) |
|
33175 | 973 |
|
974 |
lemma interior_eq: "interior S = S \<longleftrightarrow> open S" |
|
44519 | 975 |
by (metis open_interior interior_open) |
976 |
||
977 |
lemma open_subset_interior: "open S \<Longrightarrow> S \<subseteq> interior T \<longleftrightarrow> S \<subseteq> T" |
|
33175 | 978 |
by (metis interior_maximal interior_subset subset_trans) |
979 |
||
44519 | 980 |
lemma interior_empty [simp]: "interior {} = {}" |
981 |
using open_empty by (rule interior_open) |
|
982 |
||
44522
2f7e9d890efe
rename subset_{interior,closure} to {interior,closure}_mono;
huffman
parents:
44519
diff
changeset
|
983 |
lemma interior_UNIV [simp]: "interior UNIV = UNIV" |
2f7e9d890efe
rename subset_{interior,closure} to {interior,closure}_mono;
huffman
parents:
44519
diff
changeset
|
984 |
using open_UNIV by (rule interior_open) |
2f7e9d890efe
rename subset_{interior,closure} to {interior,closure}_mono;
huffman
parents:
44519
diff
changeset
|
985 |
|
44519 | 986 |
lemma interior_interior [simp]: "interior (interior S) = interior S" |
987 |
using open_interior by (rule interior_open) |
|
988 |
||
44522
2f7e9d890efe
rename subset_{interior,closure} to {interior,closure}_mono;
huffman
parents:
44519
diff
changeset
|
989 |
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
|
990 |
by (auto simp add: interior_def) |
44519 | 991 |
|
992 |
lemma interior_unique: |
|
993 |
assumes "T \<subseteq> S" and "open T" |
|
994 |
assumes "\<And>T'. T' \<subseteq> S \<Longrightarrow> open T' \<Longrightarrow> T' \<subseteq> T" |
|
995 |
shows "interior S = T" |
|
996 |
by (intro equalityI assms interior_subset open_interior interior_maximal) |
|
997 |
||
998 |
lemma interior_inter [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
|
999 |
by (intro equalityI Int_mono Int_greatest interior_mono Int_lower1 |
44519 | 1000 |
Int_lower2 interior_maximal interior_subset open_Int open_interior) |
1001 |
||
1002 |
lemma mem_interior: "x \<in> interior S \<longleftrightarrow> (\<exists>e>0. ball x e \<subseteq> S)" |
|
1003 |
using open_contains_ball_eq [where S="interior S"] |
|
1004 |
by (simp add: open_subset_interior) |
|
33175 | 1005 |
|
1006 |
lemma interior_limit_point [intro]: |
|
1007 |
fixes x :: "'a::perfect_space" |
|
1008 |
assumes x: "x \<in> interior S" shows "x islimpt S" |
|
44072
5b970711fb39
class perfect_space inherits from topological_space;
huffman
parents:
43338
diff
changeset
|
1009 |
using x islimpt_UNIV [of x] |
5b970711fb39
class perfect_space inherits from topological_space;
huffman
parents:
43338
diff
changeset
|
1010 |
unfolding interior_def islimpt_def |
5b970711fb39
class perfect_space inherits from topological_space;
huffman
parents:
43338
diff
changeset
|
1011 |
apply (clarsimp, rename_tac T T') |
5b970711fb39
class perfect_space inherits from topological_space;
huffman
parents:
43338
diff
changeset
|
1012 |
apply (drule_tac x="T \<inter> T'" in spec) |
5b970711fb39
class perfect_space inherits from topological_space;
huffman
parents:
43338
diff
changeset
|
1013 |
apply (auto simp add: open_Int) |
5b970711fb39
class perfect_space inherits from topological_space;
huffman
parents:
43338
diff
changeset
|
1014 |
done |
33175 | 1015 |
|
1016 |
lemma interior_closed_Un_empty_interior: |
|
1017 |
assumes cS: "closed S" and iT: "interior T = {}" |
|
44519 | 1018 |
shows "interior (S \<union> T) = interior S" |
33175 | 1019 |
proof |
44519 | 1020 |
show "interior S \<subseteq> interior (S \<union> T)" |
44522
2f7e9d890efe
rename subset_{interior,closure} to {interior,closure}_mono;
huffman
parents:
44519
diff
changeset
|
1021 |
by (rule interior_mono, rule Un_upper1) |
33175 | 1022 |
next |
1023 |
show "interior (S \<union> T) \<subseteq> interior S" |
|
1024 |
proof |
|
1025 |
fix x assume "x \<in> interior (S \<union> T)" |
|
44519 | 1026 |
then obtain R where "open R" "x \<in> R" "R \<subseteq> S \<union> T" .. |
33175 | 1027 |
show "x \<in> interior S" |
1028 |
proof (rule ccontr) |
|
1029 |
assume "x \<notin> interior S" |
|
1030 |
with `x \<in> R` `open R` obtain y where "y \<in> R - S" |
|
44519 | 1031 |
unfolding interior_def by fast |
33175 | 1032 |
from `open R` `closed S` have "open (R - S)" by (rule open_Diff) |
1033 |
from `R \<subseteq> S \<union> T` have "R - S \<subseteq> T" by fast |
|
1034 |
from `y \<in> R - S` `open (R - S)` `R - S \<subseteq> T` `interior T = {}` |
|
1035 |
show "False" unfolding interior_def by fast |
|
1036 |
qed |
|
1037 |
qed |
|
1038 |
qed |
|
1039 |
||
44365 | 1040 |
lemma interior_Times: "interior (A \<times> B) = interior A \<times> interior B" |
1041 |
proof (rule interior_unique) |
|
1042 |
show "interior A \<times> interior B \<subseteq> A \<times> B" |
|
1043 |
by (intro Sigma_mono interior_subset) |
|
1044 |
show "open (interior A \<times> interior B)" |
|
1045 |
by (intro open_Times open_interior) |
|
44519 | 1046 |
fix T assume "T \<subseteq> A \<times> B" and "open T" thus "T \<subseteq> interior A \<times> interior B" |
1047 |
proof (safe) |
|
1048 |
fix x y assume "(x, y) \<in> T" |
|
1049 |
then obtain C D where "open C" "open D" "C \<times> D \<subseteq> T" "x \<in> C" "y \<in> D" |
|
1050 |
using `open T` unfolding open_prod_def by fast |
|
1051 |
hence "open C" "open D" "C \<subseteq> A" "D \<subseteq> B" "x \<in> C" "y \<in> D" |
|
1052 |
using `T \<subseteq> A \<times> B` by auto |
|
1053 |
thus "x \<in> interior A" and "y \<in> interior B" |
|
1054 |
by (auto intro: interiorI) |
|
1055 |
qed |
|
44365 | 1056 |
qed |
1057 |
||
33175 | 1058 |
|
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1059 |
subsection {* Closure of a Set *} |
33175 | 1060 |
|
1061 |
definition "closure S = S \<union> {x | x. x islimpt S}" |
|
1062 |
||
44518 | 1063 |
lemma interior_closure: "interior S = - (closure (- S))" |
1064 |
unfolding interior_def closure_def islimpt_def by auto |
|
1065 |
||
34105 | 1066 |
lemma closure_interior: "closure S = - interior (- S)" |
44518 | 1067 |
unfolding interior_closure by simp |
33175 | 1068 |
|
1069 |
lemma closed_closure[simp, intro]: "closed (closure S)" |
|
44518 | 1070 |
unfolding closure_interior by (simp add: closed_Compl) |
1071 |
||
1072 |
lemma closure_subset: "S \<subseteq> closure S" |
|
1073 |
unfolding closure_def by simp |
|
33175 | 1074 |
|
1075 |
lemma closure_hull: "closure S = closed hull S" |
|
44519 | 1076 |
unfolding hull_def closure_interior interior_def by auto |
33175 | 1077 |
|
1078 |
lemma closure_eq: "closure S = S \<longleftrightarrow> closed S" |
|
44519 | 1079 |
unfolding closure_hull using closed_Inter by (rule hull_eq) |
1080 |
||
1081 |
lemma closure_closed [simp]: "closed S \<Longrightarrow> closure S = S" |
|
1082 |
unfolding closure_eq . |
|
1083 |
||
1084 |
lemma closure_closure [simp]: "closure (closure S) = closure S" |
|
44518 | 1085 |
unfolding closure_hull by (rule hull_hull) |
33175 | 1086 |
|
44522
2f7e9d890efe
rename subset_{interior,closure} to {interior,closure}_mono;
huffman
parents:
44519
diff
changeset
|
1087 |
lemma closure_mono: "S \<subseteq> T \<Longrightarrow> closure S \<subseteq> closure T" |
44518 | 1088 |
unfolding closure_hull by (rule hull_mono) |
33175 | 1089 |
|
44519 | 1090 |
lemma closure_minimal: "S \<subseteq> T \<Longrightarrow> closed T \<Longrightarrow> closure S \<subseteq> T" |
44518 | 1091 |
unfolding closure_hull by (rule hull_minimal) |
33175 | 1092 |
|
44519 | 1093 |
lemma closure_unique: |
1094 |
assumes "S \<subseteq> T" and "closed T" |
|
1095 |
assumes "\<And>T'. S \<subseteq> T' \<Longrightarrow> closed T' \<Longrightarrow> T \<subseteq> T'" |
|
1096 |
shows "closure S = T" |
|
1097 |
using assms unfolding closure_hull by (rule hull_unique) |
|
1098 |
||
1099 |
lemma closure_empty [simp]: "closure {} = {}" |
|
44518 | 1100 |
using closed_empty by (rule closure_closed) |
33175 | 1101 |
|
44522
2f7e9d890efe
rename subset_{interior,closure} to {interior,closure}_mono;
huffman
parents:
44519
diff
changeset
|
1102 |
lemma closure_UNIV [simp]: "closure UNIV = UNIV" |
44518 | 1103 |
using closed_UNIV by (rule closure_closed) |
1104 |
||
1105 |
lemma closure_union [simp]: "closure (S \<union> T) = closure S \<union> closure T" |
|
1106 |
unfolding closure_interior by simp |
|
33175 | 1107 |
|
1108 |
lemma closure_eq_empty: "closure S = {} \<longleftrightarrow> S = {}" |
|
1109 |
using closure_empty closure_subset[of S] |
|
1110 |
by blast |
|
1111 |
||
1112 |
lemma closure_subset_eq: "closure S \<subseteq> S \<longleftrightarrow> closed S" |
|
1113 |
using closure_eq[of S] closure_subset[of S] |
|
1114 |
by simp |
|
1115 |
||
1116 |
lemma open_inter_closure_eq_empty: |
|
1117 |
"open S \<Longrightarrow> (S \<inter> closure T) = {} \<longleftrightarrow> S \<inter> T = {}" |
|
34105 | 1118 |
using open_subset_interior[of S "- T"] |
1119 |
using interior_subset[of "- T"] |
|
33175 | 1120 |
unfolding closure_interior |
1121 |
by auto |
|
1122 |
||
1123 |
lemma open_inter_closure_subset: |
|
1124 |
"open S \<Longrightarrow> (S \<inter> (closure T)) \<subseteq> closure(S \<inter> T)" |
|
1125 |
proof |
|
1126 |
fix x |
|
1127 |
assume as: "open S" "x \<in> S \<inter> closure T" |
|
1128 |
{ assume *:"x islimpt T" |
|
1129 |
have "x islimpt (S \<inter> T)" |
|
1130 |
proof (rule islimptI) |
|
1131 |
fix A |
|
1132 |
assume "x \<in> A" "open A" |
|
1133 |
with as have "x \<in> A \<inter> S" "open (A \<inter> S)" |
|
1134 |
by (simp_all add: open_Int) |
|
1135 |
with * obtain y where "y \<in> T" "y \<in> A \<inter> S" "y \<noteq> x" |
|
1136 |
by (rule islimptE) |
|
1137 |
hence "y \<in> S \<inter> T" "y \<in> A \<and> y \<noteq> x" |
|
1138 |
by simp_all |
|
1139 |
thus "\<exists>y\<in>(S \<inter> T). y \<in> A \<and> y \<noteq> x" .. |
|
1140 |
qed |
|
1141 |
} |
|
1142 |
then show "x \<in> closure (S \<inter> T)" using as |
|
1143 |
unfolding closure_def |
|
1144 |
by blast |
|
1145 |
qed |
|
1146 |
||
44519 | 1147 |
lemma closure_complement: "closure (- S) = - interior S" |
44518 | 1148 |
unfolding closure_interior by simp |
33175 | 1149 |
|
44519 | 1150 |
lemma interior_complement: "interior (- S) = - closure S" |
44518 | 1151 |
unfolding closure_interior by simp |
33175 | 1152 |
|
44365 | 1153 |
lemma closure_Times: "closure (A \<times> B) = closure A \<times> closure B" |
44519 | 1154 |
proof (rule closure_unique) |
44365 | 1155 |
show "A \<times> B \<subseteq> closure A \<times> closure B" |
1156 |
by (intro Sigma_mono closure_subset) |
|
1157 |
show "closed (closure A \<times> closure B)" |
|
1158 |
by (intro closed_Times closed_closure) |
|
44519 | 1159 |
fix T assume "A \<times> B \<subseteq> T" and "closed T" thus "closure A \<times> closure B \<subseteq> T" |
44365 | 1160 |
apply (simp add: closed_def open_prod_def, clarify) |
1161 |
apply (rule ccontr) |
|
1162 |
apply (drule_tac x="(a, b)" in bspec, simp, clarify, rename_tac C D) |
|
1163 |
apply (simp add: closure_interior interior_def) |
|
1164 |
apply (drule_tac x=C in spec) |
|
1165 |
apply (drule_tac x=D in spec) |
|
1166 |
apply auto |
|
1167 |
done |
|
1168 |
qed |
|
1169 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1170 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1171 |
subsection {* Frontier (aka boundary) *} |
33175 | 1172 |
|
1173 |
definition "frontier S = closure S - interior S" |
|
1174 |
||
1175 |
lemma frontier_closed: "closed(frontier S)" |
|
1176 |
by (simp add: frontier_def closed_Diff) |
|
1177 |
||
34105 | 1178 |
lemma frontier_closures: "frontier S = (closure S) \<inter> (closure(- S))" |
33175 | 1179 |
by (auto simp add: frontier_def interior_closure) |
1180 |
||
1181 |
lemma frontier_straddle: |
|
1182 |
fixes a :: "'a::metric_space" |
|
44909 | 1183 |
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))" |
1184 |
unfolding frontier_def closure_interior |
|
1185 |
by (auto simp add: mem_interior subset_eq ball_def) |
|
33175 | 1186 |
|
1187 |
lemma frontier_subset_closed: "closed S \<Longrightarrow> frontier S \<subseteq> S" |
|
1188 |
by (metis frontier_def closure_closed Diff_subset) |
|
1189 |
||
34964 | 1190 |
lemma frontier_empty[simp]: "frontier {} = {}" |
36362
06475a1547cb
fix lots of looping simp calls and other warnings
huffman
parents:
36360
diff
changeset
|
1191 |
by (simp add: frontier_def) |
33175 | 1192 |
|
1193 |
lemma frontier_subset_eq: "frontier S \<subseteq> S \<longleftrightarrow> closed S" |
|
1194 |
proof- |
|
1195 |
{ assume "frontier S \<subseteq> S" |
|
1196 |
hence "closure S \<subseteq> S" using interior_subset unfolding frontier_def by auto |
|
1197 |
hence "closed S" using closure_subset_eq by auto |
|
1198 |
} |
|
36362
06475a1547cb
fix lots of looping simp calls and other warnings
huffman
parents:
36360
diff
changeset
|
1199 |
thus ?thesis using frontier_subset_closed[of S] .. |
33175 | 1200 |
qed |
1201 |
||
34105 | 1202 |
lemma frontier_complement: "frontier(- S) = frontier S" |
33175 | 1203 |
by (auto simp add: frontier_def closure_complement interior_complement) |
1204 |
||
1205 |
lemma frontier_disjoint_eq: "frontier S \<inter> S = {} \<longleftrightarrow> open S" |
|
34105 | 1206 |
using frontier_complement frontier_subset_eq[of "- S"] |
1207 |
unfolding open_closed by auto |
|
33175 | 1208 |
|
44081
730f7cced3a6
rename type 'a net to 'a filter, following standard mathematical terminology
huffman
parents:
44076
diff
changeset
|
1209 |
subsection {* Filters and the ``eventually true'' quantifier *} |
730f7cced3a6
rename type 'a net to 'a filter, following standard mathematical terminology
huffman
parents:
44076
diff
changeset
|
1210 |
|
33175 | 1211 |
definition |
44081
730f7cced3a6
rename type 'a net to 'a filter, following standard mathematical terminology
huffman
parents:
44076
diff
changeset
|
1212 |
indirection :: "'a::real_normed_vector \<Rightarrow> 'a \<Rightarrow> 'a filter" |
730f7cced3a6
rename type 'a net to 'a filter, following standard mathematical terminology
huffman
parents:
44076
diff
changeset
|
1213 |
(infixr "indirection" 70) where |
33175 | 1214 |
"a indirection v = (at a) within {b. \<exists>c\<ge>0. b - a = scaleR c v}" |
1215 |
||
36437 | 1216 |
text {* Identify Trivial limits, where we can't approach arbitrarily closely. *} |
33175 | 1217 |
|
1218 |
lemma trivial_limit_within: |
|
1219 |
shows "trivial_limit (at a within S) \<longleftrightarrow> \<not> a islimpt S" |
|
1220 |
proof |
|
1221 |
assume "trivial_limit (at a within S)" |
|
1222 |
thus "\<not> a islimpt S" |
|
1223 |
unfolding trivial_limit_def |
|
36358
246493d61204
define nets directly as filters, instead of as filter bases
huffman
parents:
36336
diff
changeset
|
1224 |
unfolding eventually_within eventually_at_topological |
33175 | 1225 |
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
|
1226 |
apply (clarsimp simp add: set_eq_iff) |
33175 | 1227 |
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
|
1228 |
apply (clarsimp, drule_tac x=y in bspec, simp_all) |
33175 | 1229 |
done |
1230 |
next |
|
1231 |
assume "\<not> a islimpt S" |
|
1232 |
thus "trivial_limit (at a within S)" |
|
1233 |
unfolding trivial_limit_def |
|
36358
246493d61204
define nets directly as filters, instead of as filter bases
huffman
parents:
36336
diff
changeset
|
1234 |
unfolding eventually_within eventually_at_topological |
33175 | 1235 |
unfolding islimpt_def |
36358
246493d61204
define nets directly as filters, instead of as filter bases
huffman
parents:
36336
diff
changeset
|
1236 |
apply clarsimp |
246493d61204
define nets directly as filters, instead of as filter bases
huffman
parents:
36336
diff
changeset
|
1237 |
apply (rule_tac x=T in exI) |
246493d61204
define nets directly as filters, instead of as filter bases
huffman
parents:
36336
diff
changeset
|
1238 |
apply auto |
33175 | 1239 |
done |
1240 |
qed |
|
1241 |
||
1242 |
lemma trivial_limit_at_iff: "trivial_limit (at a) \<longleftrightarrow> \<not> a islimpt UNIV" |
|
45031 | 1243 |
using trivial_limit_within [of a UNIV] by simp |
33175 | 1244 |
|
1245 |
lemma trivial_limit_at: |
|
1246 |
fixes a :: "'a::perfect_space" |
|
1247 |
shows "\<not> trivial_limit (at a)" |
|
44571 | 1248 |
by (rule at_neq_bot) |
33175 | 1249 |
|
1250 |
lemma trivial_limit_at_infinity: |
|
44081
730f7cced3a6
rename type 'a net to 'a filter, following standard mathematical terminology
huffman
parents:
44076
diff
changeset
|
1251 |
"\<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
|
1252 |
unfolding trivial_limit_def eventually_at_infinity |
246493d61204
define nets directly as filters, instead of as filter bases
huffman
parents:
36336
diff
changeset
|
1253 |
apply clarsimp |
44072
5b970711fb39
class perfect_space inherits from topological_space;
huffman
parents:
43338
diff
changeset
|
1254 |
apply (subgoal_tac "\<exists>x::'a. x \<noteq> 0", clarify) |
5b970711fb39
class perfect_space inherits from topological_space;
huffman
parents:
43338
diff
changeset
|
1255 |
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
|
1256 |
apply (cut_tac islimpt_UNIV [of "0::'a", unfolded islimpt_def]) |
5b970711fb39
class perfect_space inherits from topological_space;
huffman
parents:
43338
diff
changeset
|
1257 |
apply (drule_tac x=UNIV in spec, simp) |
33175 | 1258 |
done |
1259 |
||
36437 | 1260 |
text {* Some property holds "sufficiently close" to the limit point. *} |
33175 | 1261 |
|
1262 |
lemma eventually_at: (* FIXME: this replaces Limits.eventually_at *) |
|
1263 |
"eventually P (at a) \<longleftrightarrow> (\<exists>d>0. \<forall>x. 0 < dist x a \<and> dist x a < d \<longrightarrow> P x)" |
|
1264 |
unfolding eventually_at dist_nz by auto |
|
1265 |
||
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
|
1266 |
lemma eventually_within: (* FIXME: this replaces Limits.eventually_within *) |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
1267 |
"eventually P (at a within S) \<longleftrightarrow> |
33175 | 1268 |
(\<exists>d>0. \<forall>x\<in>S. 0 < dist x a \<and> dist x a < d \<longrightarrow> P x)" |
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
|
1269 |
by (rule eventually_within_less) |
33175 | 1270 |
|
1271 |
lemma eventually_happens: "eventually P net ==> trivial_limit net \<or> (\<exists>x. P x)" |
|
36358
246493d61204
define nets directly as filters, instead of as filter bases
huffman
parents:
36336
diff
changeset
|
1272 |
unfolding trivial_limit_def |
246493d61204
define nets directly as filters, instead of as filter bases
huffman
parents:
36336
diff
changeset
|
1273 |
by (auto elim: eventually_rev_mp) |
33175 | 1274 |
|
1275 |
lemma trivial_limit_eventually: "trivial_limit net \<Longrightarrow> eventually P net" |
|
45031 | 1276 |
by simp |
33175 | 1277 |
|
1278 |
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
|
1279 |
by (simp add: filter_eq_iff) |
33175 | 1280 |
|
1281 |
text{* Combining theorems for "eventually" *} |
|
1282 |
||
1283 |
lemma eventually_rev_mono: |
|
1284 |
"eventually P net \<Longrightarrow> (\<forall>x. P x \<longrightarrow> Q x) \<Longrightarrow> eventually Q net" |
|
1285 |
using eventually_mono [of P Q] by fast |
|
1286 |
||
1287 |
lemma not_eventually: "(\<forall>x. \<not> P x ) \<Longrightarrow> ~(trivial_limit net) ==> ~(eventually (\<lambda>x. P x) net)" |
|
1288 |
by (simp add: eventually_False) |
|
1289 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1290 |
|
36437 | 1291 |
subsection {* Limits *} |
33175 | 1292 |
|
44081
730f7cced3a6
rename type 'a net to 'a filter, following standard mathematical terminology
huffman
parents:
44076
diff
changeset
|
1293 |
text{* Notation Lim to avoid collition with lim defined in analysis *} |
730f7cced3a6
rename type 'a net to 'a filter, following standard mathematical terminology
huffman
parents:
44076
diff
changeset
|
1294 |
|
730f7cced3a6
rename type 'a net to 'a filter, following standard mathematical terminology
huffman
parents:
44076
diff
changeset
|
1295 |
definition Lim :: "'a filter \<Rightarrow> ('a \<Rightarrow> 'b::t2_space) \<Rightarrow> 'b" |
730f7cced3a6
rename type 'a net to 'a filter, following standard mathematical terminology
huffman
parents:
44076
diff
changeset
|
1296 |
where "Lim A f = (THE l. (f ---> l) A)" |
33175 | 1297 |
|
1298 |
lemma Lim: |
|
1299 |
"(f ---> l) net \<longleftrightarrow> |
|
1300 |
trivial_limit net \<or> |
|
1301 |
(\<forall>e>0. eventually (\<lambda>x. dist (f x) l < e) net)" |
|
1302 |
unfolding tendsto_iff trivial_limit_eq by auto |
|
1303 |
||
1304 |
text{* Show that they yield usual definitions in the various cases. *} |
|
1305 |
||
1306 |
lemma Lim_within_le: "(f ---> l)(at a within S) \<longleftrightarrow> |
|
1307 |
(\<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)" |
|
1308 |
by (auto simp add: tendsto_iff eventually_within_le) |
|
1309 |
||
1310 |
lemma Lim_within: "(f ---> l) (at a within S) \<longleftrightarrow> |
|
1311 |
(\<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)" |
|
1312 |
by (auto simp add: tendsto_iff eventually_within) |
|
1313 |
||
1314 |
lemma Lim_at: "(f ---> l) (at a) \<longleftrightarrow> |
|
1315 |
(\<forall>e >0. \<exists>d>0. \<forall>x. 0 < dist x a \<and> dist x a < d \<longrightarrow> dist (f x) l < e)" |
|
1316 |
by (auto simp add: tendsto_iff eventually_at) |
|
1317 |
||
1318 |
lemma Lim_at_infinity: |
|
1319 |
"(f ---> l) at_infinity \<longleftrightarrow> (\<forall>e>0. \<exists>b. \<forall>x. norm x >= b \<longrightarrow> dist (f x) l < e)" |
|
1320 |
by (auto simp add: tendsto_iff eventually_at_infinity) |
|
1321 |
||
1322 |
lemma Lim_eventually: "eventually (\<lambda>x. f x = l) net \<Longrightarrow> (f ---> l) net" |
|
1323 |
by (rule topological_tendstoI, auto elim: eventually_rev_mono) |
|
1324 |
||
1325 |
text{* The expected monotonicity property. *} |
|
1326 |
||
1327 |
lemma Lim_within_empty: "(f ---> l) (net within {})" |
|
1328 |
unfolding tendsto_def Limits.eventually_within by simp |
|
1329 |
||
1330 |
lemma Lim_within_subset: "(f ---> l) (net within S) \<Longrightarrow> T \<subseteq> S \<Longrightarrow> (f ---> l) (net within T)" |
|
1331 |
unfolding tendsto_def Limits.eventually_within |
|
1332 |
by (auto elim!: eventually_elim1) |
|
1333 |
||
1334 |
lemma Lim_Un: assumes "(f ---> l) (net within S)" "(f ---> l) (net within T)" |
|
1335 |
shows "(f ---> l) (net within (S \<union> T))" |
|
1336 |
using assms unfolding tendsto_def Limits.eventually_within |
|
1337 |
apply clarify |
|
1338 |
apply (drule spec, drule (1) mp, drule (1) mp) |
|
1339 |
apply (drule spec, drule (1) mp, drule (1) mp) |
|
1340 |
apply (auto elim: eventually_elim2) |
|
1341 |
done |
|
1342 |
||
1343 |
lemma Lim_Un_univ: |
|
1344 |
"(f ---> l) (net within S) \<Longrightarrow> (f ---> l) (net within T) \<Longrightarrow> S \<union> T = UNIV |
|
1345 |
==> (f ---> l) net" |
|
1346 |
by (metis Lim_Un within_UNIV) |
|
1347 |
||
1348 |
text{* Interrelations between restricted and unrestricted limits. *} |
|
1349 |
||
1350 |
lemma Lim_at_within: "(f ---> l) net ==> (f ---> l)(net within S)" |
|
1351 |
(* FIXME: rename *) |
|
1352 |
unfolding tendsto_def Limits.eventually_within |
|
1353 |
apply (clarify, drule spec, drule (1) mp, drule (1) mp) |
|
1354 |
by (auto elim!: eventually_elim1) |
|
1355 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1356 |
lemma eventually_within_interior: |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1357 |
assumes "x \<in> interior S" |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1358 |
shows "eventually P (at x within S) \<longleftrightarrow> eventually P (at x)" (is "?lhs = ?rhs") |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1359 |
proof- |
44519 | 1360 |
from assms obtain T where T: "open T" "x \<in> T" "T \<subseteq> S" .. |
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1361 |
{ assume "?lhs" |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1362 |
then obtain A where "open A" "x \<in> A" "\<forall>y\<in>A. y \<noteq> x \<longrightarrow> y \<in> S \<longrightarrow> P y" |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1363 |
unfolding Limits.eventually_within Limits.eventually_at_topological |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1364 |
by auto |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1365 |
with T have "open (A \<inter> T)" "x \<in> A \<inter> T" "\<forall>y\<in>(A \<inter> T). y \<noteq> x \<longrightarrow> P y" |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1366 |
by auto |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1367 |
then have "?rhs" |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1368 |
unfolding Limits.eventually_at_topological by auto |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1369 |
} moreover |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1370 |
{ assume "?rhs" hence "?lhs" |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1371 |
unfolding Limits.eventually_within |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1372 |
by (auto elim: eventually_elim1) |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1373 |
} ultimately |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1374 |
show "?thesis" .. |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1375 |
qed |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1376 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1377 |
lemma at_within_interior: |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1378 |
"x \<in> interior S \<Longrightarrow> at x within S = at x" |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1379 |
by (simp add: filter_eq_iff eventually_within_interior) |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1380 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1381 |
lemma at_within_open: |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1382 |
"\<lbrakk>x \<in> S; open S\<rbrakk> \<Longrightarrow> at x within S = at x" |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1383 |
by (simp only: at_within_interior interior_open) |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1384 |
|
33175 | 1385 |
lemma Lim_within_open: |
1386 |
fixes f :: "'a::topological_space \<Rightarrow> 'b::topological_space" |
|
1387 |
assumes"a \<in> S" "open S" |
|
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1388 |
shows "(f ---> l)(at a within S) \<longleftrightarrow> (f ---> l)(at a)" |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1389 |
using assms by (simp only: at_within_open) |
33175 | 1390 |
|
43338 | 1391 |
lemma Lim_within_LIMSEQ: |
44584 | 1392 |
fixes a :: "'a::metric_space" |
43338 | 1393 |
assumes "\<forall>S. (\<forall>n. S n \<noteq> a \<and> S n \<in> T) \<and> S ----> a \<longrightarrow> (\<lambda>n. X (S n)) ----> L" |
1394 |
shows "(X ---> L) (at a within T)" |
|
44584 | 1395 |
using assms unfolding tendsto_def [where l=L] |
1396 |
by (simp add: sequentially_imp_eventually_within) |
|
43338 | 1397 |
|
1398 |
lemma Lim_right_bound: |
|
1399 |
fixes f :: "real \<Rightarrow> real" |
|
1400 |
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" |
|
1401 |
assumes bnd: "\<And>a. a \<in> I \<Longrightarrow> x < a \<Longrightarrow> K \<le> f a" |
|
1402 |
shows "(f ---> Inf (f ` ({x<..} \<inter> I))) (at x within ({x<..} \<inter> I))" |
|
1403 |
proof cases |
|
1404 |
assume "{x<..} \<inter> I = {}" then show ?thesis by (simp add: Lim_within_empty) |
|
1405 |
next |
|
1406 |
assume [simp]: "{x<..} \<inter> I \<noteq> {}" |
|
1407 |
show ?thesis |
|
1408 |
proof (rule Lim_within_LIMSEQ, safe) |
|
1409 |
fix S assume S: "\<forall>n. S n \<noteq> x \<and> S n \<in> {x <..} \<inter> I" "S ----> x" |
|
1410 |
||
1411 |
show "(\<lambda>n. f (S n)) ----> Inf (f ` ({x<..} \<inter> I))" |
|
1412 |
proof (rule LIMSEQ_I, rule ccontr) |
|
1413 |
fix r :: real assume "0 < r" |
|
1414 |
with Inf_close[of "f ` ({x<..} \<inter> I)" r] |
|
1415 |
obtain y where y: "x < y" "y \<in> I" "f y < Inf (f ` ({x <..} \<inter> I)) + r" by auto |
|
1416 |
from `x < y` have "0 < y - x" by auto |
|
1417 |
from S(2)[THEN LIMSEQ_D, OF this] |
|
1418 |
obtain N where N: "\<And>n. N \<le> n \<Longrightarrow> \<bar>S n - x\<bar> < y - x" by auto |
|
1419 |
||
1420 |
assume "\<not> (\<exists>N. \<forall>n\<ge>N. norm (f (S n) - Inf (f ` ({x<..} \<inter> I))) < r)" |
|
1421 |
moreover have "\<And>n. Inf (f ` ({x<..} \<inter> I)) \<le> f (S n)" |
|
1422 |
using S bnd by (intro Inf_lower[where z=K]) auto |
|
1423 |
ultimately obtain n where n: "N \<le> n" "r + Inf (f ` ({x<..} \<inter> I)) \<le> f (S n)" |
|
1424 |
by (auto simp: not_less field_simps) |
|
1425 |
with N[OF n(1)] mono[OF _ `y \<in> I`, of "S n"] S(1)[THEN spec, of n] y |
|
1426 |
show False by auto |
|
1427 |
qed |
|
1428 |
qed |
|
1429 |
qed |
|
1430 |
||
33175 | 1431 |
text{* Another limit point characterization. *} |
1432 |
||
1433 |
lemma islimpt_sequential: |
|
50883 | 1434 |
fixes x :: "'a::first_countable_topology" |
1435 |
shows "x islimpt S \<longleftrightarrow> (\<exists>f. (\<forall>n::nat. f n \<in> S - {x}) \<and> (f ---> x) sequentially)" |
|
33175 | 1436 |
(is "?lhs = ?rhs") |
1437 |
proof |
|
1438 |
assume ?lhs |
|
50883 | 1439 |
from countable_basis_at_decseq[of x] guess A . note A = this |
1440 |
def f \<equiv> "\<lambda>n. SOME y. y \<in> S \<and> y \<in> A n \<and> x \<noteq> y" |
|
1441 |
{ fix n |
|
1442 |
from `?lhs` have "\<exists>y. y \<in> S \<and> y \<in> A n \<and> x \<noteq> y" |
|
1443 |
unfolding islimpt_def using A(1,2)[of n] by auto |
|
1444 |
then have "f n \<in> S \<and> f n \<in> A n \<and> x \<noteq> f n" |
|
1445 |
unfolding f_def by (rule someI_ex) |
|
1446 |
then have "f n \<in> S" "f n \<in> A n" "x \<noteq> f n" by auto } |
|
1447 |
then have "\<forall>n. f n \<in> S - {x}" by auto |
|
1448 |
moreover have "(\<lambda>n. f n) ----> x" |
|
1449 |
proof (rule topological_tendstoI) |
|
1450 |
fix S assume "open S" "x \<in> S" |
|
1451 |
from A(3)[OF this] `\<And>n. f n \<in> A n` |
|
1452 |
show "eventually (\<lambda>x. f x \<in> S) sequentially" by (auto elim!: eventually_elim1) |
|
44584 | 1453 |
qed |
1454 |
ultimately show ?rhs by fast |
|
33175 | 1455 |
next |
1456 |
assume ?rhs |
|
50883 | 1457 |
then obtain f :: "nat \<Rightarrow> 'a" where f: "\<And>n. f n \<in> S - {x}" and lim: "f ----> x" by auto |
1458 |
show ?lhs |
|
1459 |
unfolding islimpt_def |
|
1460 |
proof safe |
|
1461 |
fix T assume "open T" "x \<in> T" |
|
1462 |
from lim[THEN topological_tendstoD, OF this] f |
|
1463 |
show "\<exists>y\<in>S. y \<in> T \<and> y \<noteq> x" |
|
1464 |
unfolding eventually_sequentially by auto |
|
1465 |
qed |
|
33175 | 1466 |
qed |
1467 |
||
44125 | 1468 |
lemma Lim_inv: (* TODO: delete *) |
44081
730f7cced3a6
rename type 'a net to 'a filter, following standard mathematical terminology
huffman
parents:
44076
diff
changeset
|
1469 |
fixes f :: "'a \<Rightarrow> real" and A :: "'a filter" |
730f7cced3a6
rename type 'a net to 'a filter, following standard mathematical terminology
huffman
parents:
44076
diff
changeset
|
1470 |
assumes "(f ---> l) A" and "l \<noteq> 0" |
730f7cced3a6
rename type 'a net to 'a filter, following standard mathematical terminology
huffman
parents:
44076
diff
changeset
|
1471 |
shows "((inverse o f) ---> inverse l) A" |
36437 | 1472 |
unfolding o_def using assms by (rule tendsto_inverse) |
1473 |
||
33175 | 1474 |
lemma Lim_null: |
1475 |
fixes f :: "'a \<Rightarrow> 'b::real_normed_vector" |
|
44125 | 1476 |
shows "(f ---> l) net \<longleftrightarrow> ((\<lambda>x. f(x) - l) ---> 0) net" |
33175 | 1477 |
by (simp add: Lim dist_norm) |
1478 |
||
1479 |
lemma Lim_null_comparison: |
|
1480 |
fixes f :: "'a \<Rightarrow> 'b::real_normed_vector" |
|
1481 |
assumes "eventually (\<lambda>x. norm (f x) \<le> g x) net" "(g ---> 0) net" |
|
1482 |
shows "(f ---> 0) net" |
|
44252
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
1483 |
proof (rule metric_tendsto_imp_tendsto) |
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
1484 |
show "(g ---> 0) net" by fact |
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
1485 |
show "eventually (\<lambda>x. dist (f x) 0 \<le> dist (g x) 0) net" |
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
1486 |
using assms(1) by (rule eventually_elim1, simp add: dist_norm) |
33175 | 1487 |
qed |
1488 |
||
1489 |
lemma Lim_transform_bound: |
|
1490 |
fixes f :: "'a \<Rightarrow> 'b::real_normed_vector" |
|
1491 |
fixes g :: "'a \<Rightarrow> 'c::real_normed_vector" |
|
1492 |
assumes "eventually (\<lambda>n. norm(f n) <= norm(g n)) net" "(g ---> 0) net" |
|
1493 |
shows "(f ---> 0) net" |
|
44252
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
1494 |
using assms(1) tendsto_norm_zero [OF assms(2)] |
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
1495 |
by (rule Lim_null_comparison) |
33175 | 1496 |
|
1497 |
text{* Deducing things about the limit from the elements. *} |
|
1498 |
||
1499 |
lemma Lim_in_closed_set: |
|
1500 |
assumes "closed S" "eventually (\<lambda>x. f(x) \<in> S) net" "\<not>(trivial_limit net)" "(f ---> l) net" |
|
1501 |
shows "l \<in> S" |
|
1502 |
proof (rule ccontr) |
|
1503 |
assume "l \<notin> S" |
|
1504 |
with `closed S` have "open (- S)" "l \<in> - S" |
|
1505 |
by (simp_all add: open_Compl) |
|
1506 |
with assms(4) have "eventually (\<lambda>x. f x \<in> - S) net" |
|
1507 |
by (rule topological_tendstoD) |
|
1508 |
with assms(2) have "eventually (\<lambda>x. False) net" |
|
1509 |
by (rule eventually_elim2) simp |
|
1510 |
with assms(3) show "False" |
|
1511 |
by (simp add: eventually_False) |
|
1512 |
qed |
|
1513 |
||
1514 |
text{* Need to prove closed(cball(x,e)) before deducing this as a corollary. *} |
|
1515 |
||
1516 |
lemma Lim_dist_ubound: |
|
1517 |
assumes "\<not>(trivial_limit net)" "(f ---> l) net" "eventually (\<lambda>x. dist a (f x) <= e) net" |
|
1518 |
shows "dist a l <= e" |
|
44252
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
1519 |
proof- |
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
1520 |
have "dist a l \<in> {..e}" |
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
1521 |
proof (rule Lim_in_closed_set) |
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
1522 |
show "closed {..e}" by simp |
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
1523 |
show "eventually (\<lambda>x. dist a (f x) \<in> {..e}) net" by (simp add: assms) |
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
1524 |
show "\<not> trivial_limit net" by fact |
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
1525 |
show "((\<lambda>x. dist a (f x)) ---> dist a l) net" by (intro tendsto_intros assms) |
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
1526 |
qed |
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
1527 |
thus ?thesis by simp |
33175 | 1528 |
qed |
1529 |
||
1530 |
lemma Lim_norm_ubound: |
|
1531 |
fixes f :: "'a \<Rightarrow> 'b::real_normed_vector" |
|
1532 |
assumes "\<not>(trivial_limit net)" "(f ---> l) net" "eventually (\<lambda>x. norm(f x) <= e) net" |
|
1533 |
shows "norm(l) <= e" |
|
44252
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
1534 |
proof- |
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
1535 |
have "norm l \<in> {..e}" |
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
1536 |
proof (rule Lim_in_closed_set) |
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
1537 |
show "closed {..e}" by simp |
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
1538 |
show "eventually (\<lambda>x. norm (f x) \<in> {..e}) net" by (simp add: assms) |
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
1539 |
show "\<not> trivial_limit net" by fact |
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
1540 |
show "((\<lambda>x. norm (f x)) ---> norm l) net" by (intro tendsto_intros assms) |
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
1541 |
qed |
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
1542 |
thus ?thesis by simp |
33175 | 1543 |
qed |
1544 |
||
1545 |
lemma Lim_norm_lbound: |
|
1546 |
fixes f :: "'a \<Rightarrow> 'b::real_normed_vector" |
|
1547 |
assumes "\<not> (trivial_limit net)" "(f ---> l) net" "eventually (\<lambda>x. e <= norm(f x)) net" |
|
1548 |
shows "e \<le> norm l" |
|
44252
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
1549 |
proof- |
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
1550 |
have "norm l \<in> {e..}" |
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
1551 |
proof (rule Lim_in_closed_set) |
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
1552 |
show "closed {e..}" by simp |
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
1553 |
show "eventually (\<lambda>x. norm (f x) \<in> {e..}) net" by (simp add: assms) |
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
1554 |
show "\<not> trivial_limit net" by fact |
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
1555 |
show "((\<lambda>x. norm (f x)) ---> norm l) net" by (intro tendsto_intros assms) |
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
1556 |
qed |
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
1557 |
thus ?thesis by simp |
33175 | 1558 |
qed |
1559 |
||
1560 |
text{* Uniqueness of the limit, when nontrivial. *} |
|
1561 |
||
1562 |
lemma tendsto_Lim: |
|
1563 |
fixes f :: "'a \<Rightarrow> 'b::t2_space" |
|
1564 |
shows "~(trivial_limit net) \<Longrightarrow> (f ---> l) net ==> Lim net f = l" |
|
41970 | 1565 |
unfolding Lim_def using tendsto_unique[of net f] by auto |
33175 | 1566 |
|
1567 |
text{* Limit under bilinear function *} |
|
1568 |
||
1569 |
lemma Lim_bilinear: |
|
1570 |
assumes "(f ---> l) net" and "(g ---> m) net" and "bounded_bilinear h" |
|
1571 |
shows "((\<lambda>x. h (f x) (g x)) ---> (h l m)) net" |
|
1572 |
using `bounded_bilinear h` `(f ---> l) net` `(g ---> m) net` |
|
1573 |
by (rule bounded_bilinear.tendsto) |
|
1574 |
||
1575 |
text{* These are special for limits out of the same vector space. *} |
|
1576 |
||
1577 |
lemma Lim_within_id: "(id ---> a) (at a within s)" |
|
45031 | 1578 |
unfolding id_def by (rule tendsto_ident_at_within) |
33175 | 1579 |
|
1580 |
lemma Lim_at_id: "(id ---> a) (at a)" |
|
45031 | 1581 |
unfolding id_def by (rule tendsto_ident_at) |
33175 | 1582 |
|
1583 |
lemma Lim_at_zero: |
|
1584 |
fixes a :: "'a::real_normed_vector" |
|
1585 |
fixes l :: "'b::topological_space" |
|
1586 |
shows "(f ---> l) (at a) \<longleftrightarrow> ((\<lambda>x. f(a + x)) ---> l) (at 0)" (is "?lhs = ?rhs") |
|
44252
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
1587 |
using LIM_offset_zero LIM_offset_zero_cancel .. |
33175 | 1588 |
|
44081
730f7cced3a6
rename type 'a net to 'a filter, following standard mathematical terminology
huffman
parents:
44076
diff
changeset
|
1589 |
text{* It's also sometimes useful to extract the limit point from the filter. *} |
33175 | 1590 |
|
1591 |
definition |
|
44081
730f7cced3a6
rename type 'a net to 'a filter, following standard mathematical terminology
huffman
parents:
44076
diff
changeset
|
1592 |
netlimit :: "'a::t2_space filter \<Rightarrow> 'a" where |
33175 | 1593 |
"netlimit net = (SOME a. ((\<lambda>x. x) ---> a) net)" |
1594 |
||
1595 |
lemma netlimit_within: |
|
1596 |
assumes "\<not> trivial_limit (at a within S)" |
|
1597 |
shows "netlimit (at a within S) = a" |
|
1598 |
unfolding netlimit_def |
|
1599 |
apply (rule some_equality) |
|
1600 |
apply (rule Lim_at_within) |
|
44568
e6f291cb5810
discontinue many legacy theorems about LIM and LIMSEQ, in favor of tendsto theorems
huffman
parents:
44533
diff
changeset
|
1601 |
apply (rule tendsto_ident_at) |
41970 | 1602 |
apply (erule tendsto_unique [OF assms]) |
33175 | 1603 |
apply (rule Lim_at_within) |
44568
e6f291cb5810
discontinue many legacy theorems about LIM and LIMSEQ, in favor of tendsto theorems
huffman
parents:
44533
diff
changeset
|
1604 |
apply (rule tendsto_ident_at) |
33175 | 1605 |
done |
1606 |
||
1607 |
lemma netlimit_at: |
|
44072
5b970711fb39
class perfect_space inherits from topological_space;
huffman
parents:
43338
diff
changeset
|
1608 |
fixes a :: "'a::{perfect_space,t2_space}" |
33175 | 1609 |
shows "netlimit (at a) = a" |
45031 | 1610 |
using netlimit_within [of a UNIV] by simp |
33175 | 1611 |
|
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1612 |
lemma lim_within_interior: |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1613 |
"x \<in> interior S \<Longrightarrow> (f ---> l) (at x within S) \<longleftrightarrow> (f ---> l) (at x)" |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1614 |
by (simp add: at_within_interior) |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1615 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1616 |
lemma netlimit_within_interior: |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1617 |
fixes x :: "'a::{t2_space,perfect_space}" |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1618 |
assumes "x \<in> interior S" |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1619 |
shows "netlimit (at x within S) = x" |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1620 |
using assms by (simp add: at_within_interior netlimit_at) |
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1621 |
|
33175 | 1622 |
text{* Transformation of limit. *} |
1623 |
||
1624 |
lemma Lim_transform: |
|
1625 |
fixes f g :: "'a::type \<Rightarrow> 'b::real_normed_vector" |
|
1626 |
assumes "((\<lambda>x. f x - g x) ---> 0) net" "(f ---> l) net" |
|
1627 |
shows "(g ---> l) net" |
|
44252
10362a07eb7c
Topology_Euclidean_Space.thy: simplify some proofs
huffman
parents:
44250
diff
changeset
|
1628 |
using tendsto_diff [OF assms(2) assms(1)] by simp |
33175 | 1629 |
|
1630 |
lemma Lim_transform_eventually: |
|
36667 | 1631 |
"eventually (\<lambda>x. f x = g x) net \<Longrightarrow> (f ---> l) net \<Longrightarrow> (g ---> l) net" |
33175 | 1632 |
apply (rule topological_tendstoI) |
1633 |
apply (drule (2) topological_tendstoD) |
|
1634 |
apply (erule (1) eventually_elim2, simp) |
|
1635 |
done |
|
1636 |
||
1637 |
lemma Lim_transform_within: |
|
36667 | 1638 |
assumes "0 < d" and "\<forall>x'\<in>S. 0 < dist x' x \<and> dist x' x < d \<longrightarrow> f x' = g x'" |
1639 |
and "(f ---> l) (at x within S)" |
|
1640 |
shows "(g ---> l) (at x within S)" |
|
1641 |
proof (rule Lim_transform_eventually) |
|
1642 |
show "eventually (\<lambda>x. f x = g x) (at x within S)" |
|
1643 |
unfolding eventually_within |
|
1644 |
using assms(1,2) by auto |
|
1645 |
show "(f ---> l) (at x within S)" by fact |
|
1646 |
qed |
|
33175 | 1647 |
|
1648 |
lemma Lim_transform_at: |
|
36667 | 1649 |
assumes "0 < d" and "\<forall>x'. 0 < dist x' x \<and> dist x' x < d \<longrightarrow> f x' = g x'" |
1650 |
and "(f ---> l) (at x)" |
|
1651 |
shows "(g ---> l) (at x)" |
|
1652 |
proof (rule Lim_transform_eventually) |
|
1653 |
show "eventually (\<lambda>x. f x = g x) (at x)" |
|
1654 |
unfolding eventually_at |
|
1655 |
using assms(1,2) by auto |
|
1656 |
show "(f ---> l) (at x)" by fact |
|
1657 |
qed |
|
33175 | 1658 |
|
1659 |
text{* Common case assuming being away from some crucial point like 0. *} |
|
1660 |
||
1661 |
lemma Lim_transform_away_within: |
|
36669 | 1662 |
fixes a b :: "'a::t1_space" |
36667 | 1663 |
assumes "a \<noteq> b" and "\<forall>x\<in>S. x \<noteq> a \<and> x \<noteq> b \<longrightarrow> f x = g x" |
33175 | 1664 |
and "(f ---> l) (at a within S)" |
1665 |
shows "(g ---> l) (at a within S)" |
|
36669 | 1666 |
proof (rule Lim_transform_eventually) |
1667 |
show "(f ---> l) (at a within S)" by fact |
|
1668 |
show "eventually (\<lambda>x. f x = g x) (at a within S)" |
|
1669 |
unfolding Limits.eventually_within eventually_at_topological |
|
1670 |
by (rule exI [where x="- {b}"], simp add: open_Compl assms) |
|
33175 | 1671 |
qed |
1672 |
||
1673 |
lemma Lim_transform_away_at: |
|
36669 | 1674 |
fixes a b :: "'a::t1_space" |
33175 | 1675 |
assumes ab: "a\<noteq>b" and fg: "\<forall>x. x \<noteq> a \<and> x \<noteq> b \<longrightarrow> f x = g x" |
1676 |
and fl: "(f ---> l) (at a)" |
|
1677 |
shows "(g ---> l) (at a)" |
|
1678 |
using Lim_transform_away_within[OF ab, of UNIV f g l] fg fl |
|
45031 | 1679 |
by simp |
33175 | 1680 |
|
1681 |
text{* Alternatively, within an open set. *} |
|
1682 |
||
1683 |
lemma Lim_transform_within_open: |
|
36667 | 1684 |
assumes "open S" and "a \<in> S" and "\<forall>x\<in>S. x \<noteq> a \<longrightarrow> f x = g x" |
1685 |
and "(f ---> l) (at a)" |
|
33175 | 1686 |
shows "(g ---> l) (at a)" |
36667 | 1687 |
proof (rule Lim_transform_eventually) |
1688 |
show "eventually (\<lambda>x. f x = g x) (at a)" |
|
1689 |
unfolding eventually_at_topological |
|
1690 |
using assms(1,2,3) by auto |
|
1691 |
show "(f ---> l) (at a)" by fact |
|
33175 | 1692 |
qed |
1693 |
||
1694 |
text{* A congruence rule allowing us to transform limits assuming not at point. *} |
|
1695 |
||
1696 |
(* FIXME: Only one congruence rule for tendsto can be used at a time! *) |
|
1697 |
||
36362
06475a1547cb
fix lots of looping simp calls and other warnings
huffman
parents:
36360
diff
changeset
|
1698 |
lemma Lim_cong_within(*[cong add]*): |
43338 | 1699 |
assumes "a = b" "x = y" "S = T" |
1700 |
assumes "\<And>x. x \<noteq> b \<Longrightarrow> x \<in> T \<Longrightarrow> f x = g x" |
|
1701 |
shows "(f ---> x) (at a within S) \<longleftrightarrow> (g ---> y) (at b within T)" |
|
36667 | 1702 |
unfolding tendsto_def Limits.eventually_within eventually_at_topological |
1703 |
using assms by simp |
|
1704 |
||
1705 |
lemma Lim_cong_at(*[cong add]*): |
|
43338 | 1706 |
assumes "a = b" "x = y" |
36667 | 1707 |
assumes "\<And>x. x \<noteq> a \<Longrightarrow> f x = g x" |
43338 | 1708 |
shows "((\<lambda>x. f x) ---> x) (at a) \<longleftrightarrow> ((g ---> y) (at a))" |
36667 | 1709 |
unfolding tendsto_def eventually_at_topological |
1710 |
using assms by simp |
|
33175 | 1711 |
|
1712 |
text{* Useful lemmas on closure and set of possible sequential limits.*} |
|
1713 |
||
1714 |
lemma closure_sequential: |
|
50883 | 1715 |
fixes l :: "'a::first_countable_topology" |
33175 | 1716 |
shows "l \<in> closure S \<longleftrightarrow> (\<exists>x. (\<forall>n. x n \<in> S) \<and> (x ---> l) sequentially)" (is "?lhs = ?rhs") |
1717 |
proof |
|
1718 |
assume "?lhs" moreover |
|
1719 |
{ assume "l \<in> S" |
|
44125 | 1720 |
hence "?rhs" using tendsto_const[of l sequentially] by auto |
33175 | 1721 |
} moreover |
1722 |
{ assume "l islimpt S" |
|
1723 |
hence "?rhs" unfolding islimpt_sequential by auto |
|
1724 |
} ultimately |
|
1725 |
show "?rhs" unfolding closure_def by auto |
|
1726 |
next |
|
1727 |
assume "?rhs" |
|
1728 |
thus "?lhs" unfolding closure_def unfolding islimpt_sequential by auto |
|
1729 |
qed |
|
1730 |
||
1731 |
lemma closed_sequential_limits: |
|
50883 | 1732 |
fixes S :: "'a::first_countable_topology set" |
33175 | 1733 |
shows "closed S \<longleftrightarrow> (\<forall>x l. (\<forall>n. x n \<in> S) \<and> (x ---> l) sequentially \<longrightarrow> l \<in> S)" |
1734 |
unfolding closed_limpt |
|
1735 |
using closure_sequential [where 'a='a] closure_closed [where 'a='a] closed_limpt [where 'a='a] islimpt_sequential [where 'a='a] mem_delete [where 'a='a] |
|
1736 |
by metis |
|
1737 |
||
1738 |
lemma closure_approachable: |
|
1739 |
fixes S :: "'a::metric_space set" |
|
1740 |
shows "x \<in> closure S \<longleftrightarrow> (\<forall>e>0. \<exists>y\<in>S. dist y x < e)" |
|
1741 |
apply (auto simp add: closure_def islimpt_approachable) |
|
1742 |
by (metis dist_self) |
|
1743 |
||
1744 |
lemma closed_approachable: |
|
1745 |
fixes S :: "'a::metric_space set" |
|
1746 |
shows "closed S ==> (\<forall>e>0. \<exists>y\<in>S. dist y x < e) \<longleftrightarrow> x \<in> S" |
|
1747 |
by (metis closure_closed closure_approachable) |
|
1748 |
||
50087 | 1749 |
subsection {* Infimum Distance *} |
1750 |
||
1751 |
definition "infdist x A = (if A = {} then 0 else Inf {dist x a|a. a \<in> A})" |
|
1752 |
||
1753 |
lemma infdist_notempty: "A \<noteq> {} \<Longrightarrow> infdist x A = Inf {dist x a|a. a \<in> A}" |
|
1754 |
by (simp add: infdist_def) |
|
1755 |
||
1756 |
lemma infdist_nonneg: |
|
1757 |
shows "0 \<le> infdist x A" |
|
1758 |
using assms by (auto simp add: infdist_def) |
|
1759 |
||
1760 |
lemma infdist_le: |
|
1761 |
assumes "a \<in> A" |
|
1762 |
assumes "d = dist x a" |
|
1763 |
shows "infdist x A \<le> d" |
|
1764 |
using assms by (auto intro!: SupInf.Inf_lower[where z=0] simp add: infdist_def) |
|
1765 |
||
1766 |
lemma infdist_zero[simp]: |
|
1767 |
assumes "a \<in> A" shows "infdist a A = 0" |
|
1768 |
proof - |
|
1769 |
from infdist_le[OF assms, of "dist a a"] have "infdist a A \<le> 0" by auto |
|
1770 |
with infdist_nonneg[of a A] assms show "infdist a A = 0" by auto |
|
1771 |
qed |
|
1772 |
||
1773 |
lemma infdist_triangle: |
|
1774 |
shows "infdist x A \<le> infdist y A + dist x y" |
|
1775 |
proof cases |
|
1776 |
assume "A = {}" thus ?thesis by (simp add: infdist_def) |
|
1777 |
next |
|
1778 |
assume "A \<noteq> {}" then obtain a where "a \<in> A" by auto |
|
1779 |
have "infdist x A \<le> Inf {dist x y + dist y a |a. a \<in> A}" |
|
1780 |
proof |
|
1781 |
from `A \<noteq> {}` show "{dist x y + dist y a |a. a \<in> A} \<noteq> {}" by simp |
|
1782 |
fix d assume "d \<in> {dist x y + dist y a |a. a \<in> A}" |
|
1783 |
then obtain a where d: "d = dist x y + dist y a" "a \<in> A" by auto |
|
1784 |
show "infdist x A \<le> d" |
|
1785 |
unfolding infdist_notempty[OF `A \<noteq> {}`] |
|
1786 |
proof (rule Inf_lower2) |
|
1787 |
show "dist x a \<in> {dist x a |a. a \<in> A}" using `a \<in> A` by auto |
|
1788 |
show "dist x a \<le> d" unfolding d by (rule dist_triangle) |
|
1789 |
fix d assume "d \<in> {dist x a |a. a \<in> A}" |
|
1790 |
then obtain a where "a \<in> A" "d = dist x a" by auto |
|
1791 |
thus "infdist x A \<le> d" by (rule infdist_le) |
|
1792 |
qed |
|
1793 |
qed |
|
1794 |
also have "\<dots> = dist x y + infdist y A" |
|
1795 |
proof (rule Inf_eq, safe) |
|
1796 |
fix a assume "a \<in> A" |
|
1797 |
thus "dist x y + infdist y A \<le> dist x y + dist y a" by (auto intro: infdist_le) |
|
1798 |
next |
|
1799 |
fix i assume inf: "\<And>d. d \<in> {dist x y + dist y a |a. a \<in> A} \<Longrightarrow> i \<le> d" |
|
1800 |
hence "i - dist x y \<le> infdist y A" unfolding infdist_notempty[OF `A \<noteq> {}`] using `a \<in> A` |
|
1801 |
by (intro Inf_greatest) (auto simp: field_simps) |
|
1802 |
thus "i \<le> dist x y + infdist y A" by simp |
|
1803 |
qed |
|
1804 |
finally show ?thesis by simp |
|
1805 |
qed |
|
1806 |
||
1807 |
lemma |
|
1808 |
in_closure_iff_infdist_zero: |
|
1809 |
assumes "A \<noteq> {}" |
|
1810 |
shows "x \<in> closure A \<longleftrightarrow> infdist x A = 0" |
|
1811 |
proof |
|
1812 |
assume "x \<in> closure A" |
|
1813 |
show "infdist x A = 0" |
|
1814 |
proof (rule ccontr) |
|
1815 |
assume "infdist x A \<noteq> 0" |
|
1816 |
with infdist_nonneg[of x A] have "infdist x A > 0" by auto |
|
1817 |
hence "ball x (infdist x A) \<inter> closure A = {}" apply auto |
|
1818 |
by (metis `0 < infdist x A` `x \<in> closure A` closure_approachable dist_commute |
|
1819 |
eucl_less_not_refl euclidean_trans(2) infdist_le) |
|
1820 |
hence "x \<notin> closure A" by (metis `0 < infdist x A` centre_in_ball disjoint_iff_not_equal) |
|
1821 |
thus False using `x \<in> closure A` by simp |
|
1822 |
qed |
|
1823 |
next |
|
1824 |
assume x: "infdist x A = 0" |
|
1825 |
then obtain a where "a \<in> A" by atomize_elim (metis all_not_in_conv assms) |
|
1826 |
show "x \<in> closure A" unfolding closure_approachable |
|
1827 |
proof (safe, rule ccontr) |
|
1828 |
fix e::real assume "0 < e" |
|
1829 |
assume "\<not> (\<exists>y\<in>A. dist y x < e)" |
|
1830 |
hence "infdist x A \<ge> e" using `a \<in> A` |
|
1831 |
unfolding infdist_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
|
1832 |
by (force simp: dist_commute) |
50087 | 1833 |
with x `0 < e` show False by auto |
1834 |
qed |
|
1835 |
qed |
|
1836 |
||
1837 |
lemma |
|
1838 |
in_closed_iff_infdist_zero: |
|
1839 |
assumes "closed A" "A \<noteq> {}" |
|
1840 |
shows "x \<in> A \<longleftrightarrow> infdist x A = 0" |
|
1841 |
proof - |
|
1842 |
have "x \<in> closure A \<longleftrightarrow> infdist x A = 0" |
|
1843 |
by (rule in_closure_iff_infdist_zero) fact |
|
1844 |
with assms show ?thesis by simp |
|
1845 |
qed |
|
1846 |
||
1847 |
lemma tendsto_infdist [tendsto_intros]: |
|
1848 |
assumes f: "(f ---> l) F" |
|
1849 |
shows "((\<lambda>x. infdist (f x) A) ---> infdist l A) F" |
|
1850 |
proof (rule tendstoI) |
|
1851 |
fix e ::real assume "0 < e" |
|
1852 |
from tendstoD[OF f this] |
|
1853 |
show "eventually (\<lambda>x. dist (infdist (f x) A) (infdist l A) < e) F" |
|
1854 |
proof (eventually_elim) |
|
1855 |
fix x |
|
1856 |
from infdist_triangle[of l A "f x"] infdist_triangle[of "f x" A l] |
|
1857 |
have "dist (infdist (f x) A) (infdist l A) \<le> dist (f x) l" |
|
1858 |
by (simp add: dist_commute dist_real_def) |
|
1859 |
also assume "dist (f x) l < e" |
|
1860 |
finally show "dist (infdist (f x) A) (infdist l A) < e" . |
|
1861 |
qed |
|
1862 |
qed |
|
1863 |
||
33175 | 1864 |
text{* Some other lemmas about sequences. *} |
1865 |
||
36441 | 1866 |
lemma sequentially_offset: |
1867 |
assumes "eventually (\<lambda>i. P i) sequentially" |
|
1868 |
shows "eventually (\<lambda>i. P (i + k)) sequentially" |
|
1869 |
using assms unfolding eventually_sequentially by (metis trans_le_add1) |
|
1870 |
||
33175 | 1871 |
lemma seq_offset: |
36441 | 1872 |
assumes "(f ---> l) sequentially" |
1873 |
shows "((\<lambda>i. f (i + k)) ---> l) sequentially" |
|
44584 | 1874 |
using assms by (rule LIMSEQ_ignore_initial_segment) (* FIXME: redundant *) |
33175 | 1875 |
|
1876 |
lemma seq_offset_neg: |
|
1877 |
"(f ---> l) sequentially ==> ((\<lambda>i. f(i - k)) ---> l) sequentially" |
|
1878 |
apply (rule topological_tendstoI) |
|
1879 |
apply (drule (2) topological_tendstoD) |
|
1880 |
apply (simp only: eventually_sequentially) |
|
1881 |
apply (subgoal_tac "\<And>N k (n::nat). N + k <= n ==> N <= n - k") |
|
1882 |
apply metis |
|
1883 |
by arith |
|
1884 |
||
1885 |
lemma seq_offset_rev: |
|
1886 |
"((\<lambda>i. f(i + k)) ---> l) sequentially ==> (f ---> l) sequentially" |
|
44584 | 1887 |
by (rule LIMSEQ_offset) (* FIXME: redundant *) |
33175 | 1888 |
|
1889 |
lemma seq_harmonic: "((\<lambda>n. inverse (real n)) ---> 0) sequentially" |
|
44584 | 1890 |
using LIMSEQ_inverse_real_of_nat by (rule LIMSEQ_imp_Suc) |
33175 | 1891 |
|
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
1892 |
subsection {* More properties of closed balls *} |
33175 | 1893 |
|
1894 |
lemma closed_cball: "closed (cball x e)" |
|
1895 |
unfolding cball_def closed_def |
|
1896 |
unfolding Collect_neg_eq [symmetric] not_le |
|
1897 |
apply (clarsimp simp add: open_dist, rename_tac y) |
|
1898 |
apply (rule_tac x="dist x y - e" in exI, clarsimp) |
|
1899 |
apply (rename_tac x') |
|
1900 |
apply (cut_tac x=x and y=x' and z=y in dist_triangle) |
|
1901 |
apply simp |
|
1902 |
done |
|
1903 |
||
1904 |
lemma open_contains_cball: "open S \<longleftrightarrow> (\<forall>x\<in>S. \<exists>e>0. cball x e \<subseteq> S)" |
|
1905 |
proof- |
|
1906 |
{ fix x and e::real assume "x\<in>S" "e>0" "ball x e \<subseteq> S" |
|
1907 |
hence "\<exists>d>0. cball x d \<subseteq> S" unfolding subset_eq by (rule_tac x="e/2" in exI, auto) |
|
1908 |
} moreover |
|
1909 |
{ fix x and e::real assume "x\<in>S" "e>0" "cball x e \<subseteq> S" |
|
1910 |
hence "\<exists>d>0. ball x d \<subseteq> S" unfolding subset_eq apply(rule_tac x="e/2" in exI) by auto |
|
1911 |
} ultimately |
|
1912 |
show ?thesis unfolding open_contains_ball by auto |
|
1913 |
qed |
|
1914 |
||
1915 |
lemma open_contains_cball_eq: "open S ==> (\<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
|
1916 |
by (metis open_contains_cball subset_eq order_less_imp_le centre_in_cball) |
33175 | 1917 |
|
1918 |
lemma mem_interior_cball: "x \<in> interior S \<longleftrightarrow> (\<exists>e>0. cball x e \<subseteq> S)" |
|
1919 |
apply (simp add: interior_def, safe) |
|
1920 |
apply (force simp add: open_contains_cball) |
|
1921 |
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
|
1922 |
apply (simp add: subset_trans [OF ball_subset_cball]) |
33175 | 1923 |
done |
1924 |
||
1925 |
lemma islimpt_ball: |
|
1926 |
fixes x y :: "'a::{real_normed_vector,perfect_space}" |
|
1927 |
shows "y islimpt ball x e \<longleftrightarrow> 0 < e \<and> y \<in> cball x e" (is "?lhs = ?rhs") |
|
1928 |
proof |
|
1929 |
assume "?lhs" |
|
1930 |
{ assume "e \<le> 0" |
|
1931 |
hence *:"ball x e = {}" using ball_eq_empty[of x e] by auto |
|
1932 |
have False using `?lhs` unfolding * using islimpt_EMPTY[of y] by auto |
|
1933 |
} |
|
1934 |
hence "e > 0" by (metis not_less) |
|
1935 |
moreover |
|
1936 |
have "y \<in> cball x e" using closed_cball[of x e] islimpt_subset[of y "ball x e" "cball x e"] ball_subset_cball[of x e] `?lhs` unfolding closed_limpt by auto |
|
1937 |
ultimately show "?rhs" by auto |
|
1938 |
next |
|
1939 |
assume "?rhs" hence "e>0" by auto |
|
1940 |
{ fix d::real assume "d>0" |
|
1941 |
have "\<exists>x'\<in>ball x e. x' \<noteq> y \<and> dist x' y < d" |
|
1942 |
proof(cases "d \<le> dist x y") |
|
1943 |
case True thus "\<exists>x'\<in>ball x e. x' \<noteq> y \<and> dist x' y < d" |
|
1944 |
proof(cases "x=y") |
|
1945 |
case True hence False using `d \<le> dist x y` `d>0` by auto |
|
1946 |
thus "\<exists>x'\<in>ball x e. x' \<noteq> y \<and> dist x' y < d" by auto |
|
1947 |
next |
|
1948 |
case False |
|
1949 |
||
1950 |
have "dist x (y - (d / (2 * dist y x)) *\<^sub>R (y - x)) |
|
1951 |
= norm (x - y + (d / (2 * norm (y - x))) *\<^sub>R (y - x))" |
|
1952 |
unfolding mem_cball mem_ball dist_norm diff_diff_eq2 diff_add_eq[THEN sym] by auto |
|
1953 |
also have "\<dots> = \<bar>- 1 + d / (2 * norm (x - y))\<bar> * norm (x - y)" |
|
1954 |
using scaleR_left_distrib[of "- 1" "d / (2 * norm (y - x))", THEN sym, of "y - x"] |
|
1955 |
unfolding scaleR_minus_left scaleR_one |
|
1956 |
by (auto simp add: norm_minus_commute) |
|
1957 |
also have "\<dots> = \<bar>- norm (x - y) + d / 2\<bar>" |
|
1958 |
unfolding abs_mult_pos[of "norm (x - y)", OF norm_ge_zero[of "x - y"]] |
|
49962
a8cc904a6820
Renamed {left,right}_distrib to distrib_{right,left}.
webertj
parents:
49834
diff
changeset
|
1959 |
unfolding distrib_right using `x\<noteq>y`[unfolded dist_nz, unfolded dist_norm] by auto |
33175 | 1960 |
also have "\<dots> \<le> e - d/2" using `d \<le> dist x y` and `d>0` and `?rhs` by(auto simp add: dist_norm) |
1961 |
finally have "y - (d / (2 * dist y x)) *\<^sub>R (y - x) \<in> ball x e" using `d>0` by auto |
|
1962 |
||
1963 |
moreover |
|
1964 |
||
1965 |
have "(d / (2*dist y x)) *\<^sub>R (y - x) \<noteq> 0" |
|
1966 |
using `x\<noteq>y`[unfolded dist_nz] `d>0` unfolding scaleR_eq_0_iff by (auto simp add: dist_commute) |
|
1967 |
moreover |
|
1968 |
have "dist (y - (d / (2 * dist y x)) *\<^sub>R (y - x)) y < d" unfolding dist_norm apply simp unfolding norm_minus_cancel |
|
1969 |
using `d>0` `x\<noteq>y`[unfolded dist_nz] dist_commute[of x y] |
|
1970 |
unfolding dist_norm by auto |
|
1971 |
ultimately show "\<exists>x'\<in>ball x e. x' \<noteq> y \<and> dist x' y < d" by (rule_tac x="y - (d / (2*dist y x)) *\<^sub>R (y - x)" in bexI) auto |
|
1972 |
qed |
|
1973 |
next |
|
1974 |
case False hence "d > dist x y" by auto |
|
1975 |
show "\<exists>x'\<in>ball x e. x' \<noteq> y \<and> dist x' y < d" |
|
1976 |
proof(cases "x=y") |
|
1977 |
case True |
|
1978 |
obtain z where **: "z \<noteq> y" "dist z y < min e d" |
|
1979 |
using perfect_choose_dist[of "min e d" y] |
|
1980 |
using `d > 0` `e>0` by auto |
|
1981 |
show "\<exists>x'\<in>ball x e. x' \<noteq> y \<and> dist x' y < d" |
|
1982 |
unfolding `x = y` |
|
1983 |
using `z \<noteq> y` ** |
|
1984 |
by (rule_tac x=z in bexI, auto simp add: dist_commute) |
|
1985 |
next |
|
1986 |
case False thus "\<exists>x'\<in>ball x e. x' \<noteq> y \<and> dist x' y < d" |
|
1987 |
using `d>0` `d > dist x y` `?rhs` by(rule_tac x=x in bexI, auto) |
|
1988 |
qed |
|
1989 |
qed } |
|
1990 |
thus "?lhs" unfolding mem_cball islimpt_approachable mem_ball by auto |
|
1991 |
qed |
|
1992 |
||
1993 |
lemma closure_ball_lemma: |
|
1994 |
fixes x y :: "'a::real_normed_vector" |
|
1995 |
assumes "x \<noteq> y" shows "y islimpt ball x (dist x y)" |
|
1996 |
proof (rule islimptI) |
|
1997 |
fix T assume "y \<in> T" "open T" |
|
1998 |
then obtain r where "0 < r" "\<forall>z. dist z y < r \<longrightarrow> z \<in> T" |
|
1999 |
unfolding open_dist by fast |
|
2000 |
(* choose point between x and y, within distance r of y. *) |
|
2001 |
def k \<equiv> "min 1 (r / (2 * dist x y))" |
|
2002 |
def z \<equiv> "y + scaleR k (x - y)" |
|
2003 |
have z_def2: "z = x + scaleR (1 - k) (y - x)" |
|
2004 |
unfolding z_def by (simp add: algebra_simps) |
|
2005 |
have "dist z y < r" |
|
2006 |
unfolding z_def k_def using `0 < r` |
|
2007 |
by (simp add: dist_norm min_def) |
|
2008 |
hence "z \<in> T" using `\<forall>z. dist z y < r \<longrightarrow> z \<in> T` by simp |
|
2009 |
have "dist x z < dist x y" |
|
2010 |
unfolding z_def2 dist_norm |
|
2011 |
apply (simp add: norm_minus_commute) |
|
2012 |
apply (simp only: dist_norm [symmetric]) |
|
2013 |
apply (subgoal_tac "\<bar>1 - k\<bar> * dist x y < 1 * dist x y", simp) |
|
2014 |
apply (rule mult_strict_right_mono) |
|
2015 |
apply (simp add: k_def divide_pos_pos zero_less_dist_iff `0 < r` `x \<noteq> y`) |
|
2016 |
apply (simp add: zero_less_dist_iff `x \<noteq> y`) |
|
2017 |
done |
|
2018 |
hence "z \<in> ball x (dist x y)" by simp |
|
2019 |
have "z \<noteq> y" |
|
2020 |
unfolding z_def k_def using `x \<noteq> y` `0 < r` |
|
2021 |
by (simp add: min_def) |
|
2022 |
show "\<exists>z\<in>ball x (dist x y). z \<in> T \<and> z \<noteq> y" |
|
2023 |
using `z \<in> ball x (dist x y)` `z \<in> T` `z \<noteq> y` |
|
2024 |
by fast |
|
2025 |
qed |
|
2026 |
||
2027 |
lemma closure_ball: |
|
2028 |
fixes x :: "'a::real_normed_vector" |
|
2029 |
shows "0 < e \<Longrightarrow> closure (ball x e) = cball x e" |
|
2030 |
apply (rule equalityI) |
|
2031 |
apply (rule closure_minimal) |
|
2032 |
apply (rule ball_subset_cball) |
|
2033 |
apply (rule closed_cball) |
|
2034 |
apply (rule subsetI, rename_tac y) |
|
2035 |
apply (simp add: le_less [where 'a=real]) |
|
2036 |
apply (erule disjE) |
|
2037 |
apply (rule subsetD [OF closure_subset], simp) |
|
2038 |
apply (simp add: closure_def) |
|
2039 |
apply clarify |
|
2040 |
apply (rule closure_ball_lemma) |
|
2041 |
apply (simp add: zero_less_dist_iff) |
|
2042 |
done |
|
2043 |
||
2044 |
(* In a trivial vector space, this fails for e = 0. *) |
|
2045 |
lemma interior_cball: |
|
2046 |
fixes x :: "'a::{real_normed_vector, perfect_space}" |
|
2047 |
shows "interior (cball x e) = ball x e" |
|
2048 |
proof(cases "e\<ge>0") |
|
2049 |
case False note cs = this |
|
2050 |
from cs have "ball x e = {}" using ball_empty[of e x] by auto moreover |
|
2051 |
{ fix y assume "y \<in> cball x e" |
|
2052 |
hence False unfolding mem_cball using dist_nz[of x y] cs by auto } |
|
2053 |
hence "cball x e = {}" by auto |
|
2054 |
hence "interior (cball x e) = {}" using interior_empty by auto |
|
2055 |
ultimately show ?thesis by blast |
|
2056 |
next |
|
2057 |
case True note cs = this |
|
2058 |
have "ball x e \<subseteq> cball x e" using ball_subset_cball by auto moreover |
|
2059 |
{ fix S y assume as: "S \<subseteq> cball x e" "open S" "y\<in>S" |
|
2060 |
then obtain d where "d>0" and d:"\<forall>x'. dist x' y < d \<longrightarrow> x' \<in> S" unfolding open_dist by blast |
|
2061 |
||
2062 |
then obtain xa where xa_y: "xa \<noteq> y" and xa: "dist xa y < d" |
|
2063 |
using perfect_choose_dist [of d] by auto |
|
2064 |
have "xa\<in>S" using d[THEN spec[where x=xa]] using xa by(auto simp add: dist_commute) |
|
2065 |
hence xa_cball:"xa \<in> cball x e" using as(1) by auto |
|
2066 |
||
2067 |
hence "y \<in> ball x e" proof(cases "x = y") |
|
2068 |
case True |
|
2069 |
hence "e>0" using xa_y[unfolded dist_nz] xa_cball[unfolded mem_cball] by (auto simp add: dist_commute) |
|
2070 |
thus "y \<in> ball x e" using `x = y ` by simp |
|
2071 |
next |
|
2072 |
case False |
|
2073 |
have "dist (y + (d / 2 / dist y x) *\<^sub>R (y - x)) y < d" unfolding dist_norm |
|
2074 |
using `d>0` norm_ge_zero[of "y - x"] `x \<noteq> y` by auto |
|
2075 |
hence *:"y + (d / 2 / dist y x) *\<^sub>R (y - x) \<in> cball x e" using d as(1)[unfolded subset_eq] by blast |
|
2076 |
have "y - x \<noteq> 0" using `x \<noteq> y` by auto |
|
2077 |
hence **:"d / (2 * norm (y - x)) > 0" unfolding zero_less_norm_iff[THEN sym] |
|
2078 |
using `d>0` divide_pos_pos[of d "2*norm (y - x)"] by auto |
|
2079 |
||
2080 |
have "dist (y + (d / 2 / dist y x) *\<^sub>R (y - x)) x = norm (y + (d / (2 * norm (y - x))) *\<^sub>R y - (d / (2 * norm (y - x))) *\<^sub>R x - x)" |
|
2081 |
by (auto simp add: dist_norm algebra_simps) |
|
2082 |
also have "\<dots> = norm ((1 + d / (2 * norm (y - x))) *\<^sub>R (y - x))" |
|
2083 |
by (auto simp add: algebra_simps) |
|
2084 |
also have "\<dots> = \<bar>1 + d / (2 * norm (y - x))\<bar> * norm (y - x)" |
|
2085 |
using ** by auto |
|
49962
a8cc904a6820
Renamed {left,right}_distrib to distrib_{right,left}.
webertj
parents:
49834
diff
changeset
|
2086 |
also have "\<dots> = (dist y x) + d/2"using ** by (auto simp add: distrib_right dist_norm) |
33175 | 2087 |
finally have "e \<ge> dist x y +d/2" using *[unfolded mem_cball] by (auto simp add: dist_commute) |
2088 |
thus "y \<in> ball x e" unfolding mem_ball using `d>0` by auto |
|
2089 |
qed } |
|
2090 |
hence "\<forall>S \<subseteq> cball x e. open S \<longrightarrow> S \<subseteq> ball x e" by auto |
|
2091 |
ultimately show ?thesis using interior_unique[of "ball x e" "cball x e"] using open_ball[of x e] by auto |
|
2092 |
qed |
|
2093 |
||
2094 |
lemma frontier_ball: |
|
2095 |
fixes a :: "'a::real_normed_vector" |
|
2096 |
shows "0 < e ==> 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
|
2097 |
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
|
2098 |
apply (simp add: set_eq_iff) |
33175 | 2099 |
by arith |
2100 |
||
2101 |
lemma frontier_cball: |
|
2102 |
fixes a :: "'a::{real_normed_vector, perfect_space}" |
|
2103 |
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
|
2104 |
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
|
2105 |
apply (simp add: set_eq_iff) |
33175 | 2106 |
by arith |
2107 |
||
2108 |
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
|
2109 |
apply (simp add: set_eq_iff not_le) |
33175 | 2110 |
by (metis zero_le_dist dist_self order_less_le_trans) |
2111 |
lemma cball_empty: "e < 0 ==> cball x e = {}" by (simp add: cball_eq_empty) |
|
2112 |
||
2113 |
lemma cball_eq_sing: |
|
44072
5b970711fb39
class perfect_space inherits from topological_space;
huffman
parents:
43338
diff
changeset
|
2114 |
fixes x :: "'a::{metric_space,perfect_space}" |
33175 | 2115 |
shows "(cball x e = {x}) \<longleftrightarrow> e = 0" |
2116 |
proof (rule linorder_cases) |
|
2117 |
assume e: "0 < e" |
|
2118 |
obtain a where "a \<noteq> x" "dist a x < e" |
|
2119 |
using perfect_choose_dist [OF e] by auto |
|
2120 |
hence "a \<noteq> x" "dist x a \<le> e" 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
|
2121 |
with e show ?thesis by (auto simp add: set_eq_iff) |
33175 | 2122 |
qed auto |
2123 |
||
2124 |
lemma cball_sing: |
|
2125 |
fixes x :: "'a::metric_space" |
|
2126 |
shows "e = 0 ==> 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
|
2127 |
by (auto simp add: set_eq_iff) |
33175 | 2128 |
|
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
2129 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
2130 |
subsection {* Boundedness *} |
33175 | 2131 |
|
2132 |
(* FIXME: This has to be unified with BSEQ!! *) |
|
44207
ea99698c2070
locale-ize some definitions, so perfect_space and heine_borel can inherit from the proper superclasses
huffman
parents:
44170
diff
changeset
|
2133 |
definition (in metric_space) |
ea99698c2070
locale-ize some definitions, so perfect_space and heine_borel can inherit from the proper superclasses
huffman
parents:
44170
diff
changeset
|
2134 |
bounded :: "'a set \<Rightarrow> bool" where |
33175 | 2135 |
"bounded S \<longleftrightarrow> (\<exists>x e. \<forall>y\<in>S. dist x y \<le> e)" |
2136 |
||
2137 |
lemma bounded_any_center: "bounded S \<longleftrightarrow> (\<exists>e. \<forall>y\<in>S. dist a y \<le> e)" |
|
2138 |
unfolding bounded_def |
|
2139 |
apply safe |
|
2140 |
apply (rule_tac x="dist a x + e" in exI, clarify) |
|
2141 |
apply (drule (1) bspec) |
|
2142 |
apply (erule order_trans [OF dist_triangle add_left_mono]) |
|
2143 |
apply auto |
|
2144 |
done |
|
2145 |
||
2146 |
lemma bounded_iff: "bounded S \<longleftrightarrow> (\<exists>a. \<forall>x\<in>S. norm x \<le> a)" |
|
2147 |
unfolding bounded_any_center [where a=0] |
|
2148 |
by (simp add: dist_norm) |
|
2149 |
||
50104 | 2150 |
lemma bounded_realI: assumes "\<forall>x\<in>s. abs (x::real) \<le> B" shows "bounded s" |
2151 |
unfolding bounded_def dist_real_def apply(rule_tac x=0 in exI) |
|
2152 |
using assms by auto |
|
2153 |
||
50948 | 2154 |
lemma bounded_empty [simp]: "bounded {}" |
2155 |
by (simp add: bounded_def) |
|
2156 |
||
33175 | 2157 |
lemma bounded_subset: "bounded T \<Longrightarrow> S \<subseteq> T ==> bounded S" |
2158 |
by (metis bounded_def subset_eq) |
|
2159 |
||
2160 |
lemma bounded_interior[intro]: "bounded S ==> bounded(interior S)" |
|
2161 |
by (metis bounded_subset interior_subset) |
|
2162 |
||
2163 |
lemma bounded_closure[intro]: assumes "bounded S" shows "bounded(closure S)" |
|
2164 |
proof- |
|
2165 |
from assms obtain x and a where a: "\<forall>y\<in>S. dist x y \<le> a" unfolding bounded_def by auto |
|
2166 |
{ fix y assume "y \<in> closure S" |
|
2167 |
then obtain f where f: "\<forall>n. f n \<in> S" "(f ---> y) sequentially" |
|
2168 |
unfolding closure_sequential by auto |
|
2169 |
have "\<forall>n. f n \<in> S \<longrightarrow> dist x (f n) \<le> a" using a by simp |
|
2170 |
hence "eventually (\<lambda>n. dist x (f n) \<le> a) sequentially" |
|
2171 |
by (rule eventually_mono, simp add: f(1)) |
|
2172 |
have "dist x y \<le> a" |
|
2173 |
apply (rule Lim_dist_ubound [of sequentially f]) |
|
2174 |
apply (rule trivial_limit_sequentially) |
|
2175 |
apply (rule f(2)) |
|
2176 |
apply fact |
|
2177 |
done |
|
2178 |
} |
|
2179 |
thus ?thesis unfolding bounded_def by auto |
|
2180 |
qed |
|
2181 |
||
2182 |
lemma bounded_cball[simp,intro]: "bounded (cball x e)" |
|
2183 |
apply (simp add: bounded_def) |
|
2184 |
apply (rule_tac x=x in exI) |
|
2185 |
apply (rule_tac x=e in exI) |
|
2186 |
apply auto |
|
2187 |
done |
|
2188 |
||
2189 |
lemma bounded_ball[simp,intro]: "bounded(ball x e)" |
|
2190 |
by (metis ball_subset_cball bounded_cball bounded_subset) |
|
2191 |
||
2192 |
lemma bounded_Un[simp]: "bounded (S \<union> T) \<longleftrightarrow> bounded S \<and> bounded T" |
|
2193 |
apply (auto simp add: bounded_def) |
|
2194 |
apply (rename_tac x y r s) |
|
2195 |
apply (rule_tac x=x in exI) |
|
2196 |
apply (rule_tac x="max r (dist x y + s)" in exI) |
|
2197 |
apply (rule ballI, rename_tac z, safe) |
|
2198 |
apply (drule (1) bspec, simp) |
|
2199 |
apply (drule (1) bspec) |
|
2200 |
apply (rule min_max.le_supI2) |
|
2201 |
apply (erule order_trans [OF dist_triangle add_left_mono]) |
|
2202 |
done |
|
2203 |
||
2204 |
lemma bounded_Union[intro]: "finite F \<Longrightarrow> (\<forall>S\<in>F. bounded S) \<Longrightarrow> bounded(\<Union>F)" |
|
2205 |
by (induct rule: finite_induct[of F], auto) |
|
2206 |
||
50955 | 2207 |
lemma bounded_UN [intro]: "finite A \<Longrightarrow> \<forall>x\<in>A. bounded (B x) \<Longrightarrow> bounded (\<Union>x\<in>A. B x)" |
2208 |
by (induct set: finite, auto) |
|
2209 |
||
50948 | 2210 |
lemma bounded_insert [simp]: "bounded (insert x S) \<longleftrightarrow> bounded S" |
2211 |
proof - |
|
2212 |
have "\<forall>y\<in>{x}. dist x y \<le> 0" by simp |
|
2213 |
hence "bounded {x}" unfolding bounded_def by fast |
|
2214 |
thus ?thesis by (metis insert_is_Un bounded_Un) |
|
2215 |
qed |
|
2216 |
||
2217 |
lemma finite_imp_bounded [intro]: "finite S \<Longrightarrow> bounded S" |
|
2218 |
by (induct set: finite, simp_all) |
|
2219 |
||
33175 | 2220 |
lemma bounded_pos: "bounded S \<longleftrightarrow> (\<exists>b>0. \<forall>x\<in> S. norm x <= b)" |
2221 |
apply (simp add: bounded_iff) |
|
2222 |
apply (subgoal_tac "\<And>x (y::real). 0 < 1 + abs y \<and> (x <= y \<longrightarrow> x <= 1 + abs y)") |
|
2223 |
by metis arith |
|
2224 |
||
2225 |
lemma bounded_Int[intro]: "bounded S \<or> bounded T \<Longrightarrow> bounded (S \<inter> T)" |
|
2226 |
by (metis Int_lower1 Int_lower2 bounded_subset) |
|
2227 |
||
2228 |
lemma bounded_diff[intro]: "bounded S ==> bounded (S - T)" |
|
2229 |
apply (metis Diff_subset bounded_subset) |
|
2230 |
done |
|
2231 |
||
2232 |
lemma not_bounded_UNIV[simp, intro]: |
|
2233 |
"\<not> bounded (UNIV :: 'a::{real_normed_vector, perfect_space} set)" |
|
2234 |
proof(auto simp add: bounded_pos not_le) |
|
2235 |
obtain x :: 'a where "x \<noteq> 0" |
|
2236 |
using perfect_choose_dist [OF zero_less_one] by fast |
|
2237 |
fix b::real assume b: "b >0" |
|
2238 |
have b1: "b +1 \<ge> 0" using b by simp |
|
2239 |
with `x \<noteq> 0` have "b < norm (scaleR (b + 1) (sgn x))" |
|
2240 |
by (simp add: norm_sgn) |
|
2241 |
then show "\<exists>x::'a. b < norm x" .. |
|
2242 |
qed |
|
2243 |
||
2244 |
lemma bounded_linear_image: |
|
2245 |
assumes "bounded S" "bounded_linear f" |
|
2246 |
shows "bounded(f ` S)" |
|
2247 |
proof- |
|
2248 |
from assms(1) obtain b where b:"b>0" "\<forall>x\<in>S. norm x \<le> b" unfolding bounded_pos by auto |
|
2249 |
from assms(2) obtain B where B:"B>0" "\<forall>x. norm (f x) \<le> B * norm x" using bounded_linear.pos_bounded by (auto simp add: mult_ac) |
|
2250 |
{ fix x assume "x\<in>S" |
|
2251 |
hence "norm x \<le> b" using b by auto |
|
2252 |
hence "norm (f x) \<le> B * b" using B(2) apply(erule_tac x=x in allE) |
|
36778
739a9379e29b
avoid using real-specific versions of generic lemmas
huffman
parents:
36669
diff
changeset
|
2253 |
by (metis B(1) B(2) order_trans mult_le_cancel_left_pos) |
33175 | 2254 |
} |
2255 |
thus ?thesis unfolding bounded_pos apply(rule_tac x="b*B" in exI) |
|
36778
739a9379e29b
avoid using real-specific versions of generic lemmas
huffman
parents:
36669
diff
changeset
|
2256 |
using b B mult_pos_pos [of b B] by (auto simp add: mult_commute) |
33175 | 2257 |
qed |
2258 |
||
2259 |
lemma bounded_scaling: |
|
2260 |
fixes S :: "'a::real_normed_vector set" |
|
2261 |
shows "bounded S \<Longrightarrow> bounded ((\<lambda>x. c *\<^sub>R x) ` S)" |
|
2262 |
apply (rule bounded_linear_image, assumption) |
|
44282
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
huffman
parents:
44252
diff
changeset
|
2263 |
apply (rule bounded_linear_scaleR_right) |
33175 | 2264 |
done |
2265 |
||
2266 |
lemma bounded_translation: |
|
2267 |
fixes S :: "'a::real_normed_vector set" |
|
2268 |
assumes "bounded S" shows "bounded ((\<lambda>x. a + x) ` S)" |
|
2269 |
proof- |
|
2270 |
from assms obtain b where b:"b>0" "\<forall>x\<in>S. norm x \<le> b" unfolding bounded_pos by auto |
|
2271 |
{ fix x assume "x\<in>S" |
|
2272 |
hence "norm (a + x) \<le> b + norm a" using norm_triangle_ineq[of a x] b by auto |
|
2273 |
} |
|
2274 |
thus ?thesis unfolding bounded_pos using norm_ge_zero[of a] b(1) using add_strict_increasing[of b 0 "norm a"] |
|
48048
87b94fb75198
remove stray reference to no-longer-existing theorem 'add'
huffman
parents:
47108
diff
changeset
|
2275 |
by (auto intro!: exI[of _ "b + norm a"]) |
33175 | 2276 |
qed |
2277 |
||
2278 |
||
2279 |
text{* Some theorems on sups and infs using the notion "bounded". *} |
|
2280 |
||
2281 |
lemma bounded_real: |
|
2282 |
fixes S :: "real set" |
|
2283 |
shows "bounded S \<longleftrightarrow> (\<exists>a. \<forall>x\<in>S. abs x <= a)" |
|
2284 |
by (simp add: bounded_iff) |
|
2285 |
||
33270 | 2286 |
lemma bounded_has_Sup: |
2287 |
fixes S :: "real set" |
|
2288 |
assumes "bounded S" "S \<noteq> {}" |
|
2289 |
shows "\<forall>x\<in>S. x <= Sup S" and "\<forall>b. (\<forall>x\<in>S. x <= b) \<longrightarrow> Sup S <= b" |
|
2290 |
proof |
|
2291 |
fix x assume "x\<in>S" |
|
2292 |
thus "x \<le> Sup S" |
|
2293 |
by (metis SupInf.Sup_upper abs_le_D1 assms(1) bounded_real) |
|
2294 |
next |
|
2295 |
show "\<forall>b. (\<forall>x\<in>S. x \<le> b) \<longrightarrow> Sup S \<le> b" using assms |
|
2296 |
by (metis SupInf.Sup_least) |
|
2297 |
qed |
|
2298 |
||
2299 |
lemma Sup_insert: |
|
2300 |
fixes S :: "real set" |
|
2301 |
shows "bounded S ==> Sup(insert x S) = (if S = {} then x else max x (Sup S))" |
|
2302 |
by auto (metis Int_absorb Sup_insert_nonempty assms bounded_has_Sup(1) disjoint_iff_not_equal) |
|
2303 |
||
2304 |
lemma Sup_insert_finite: |
|
2305 |
fixes S :: "real set" |
|
2306 |
shows "finite S \<Longrightarrow> Sup(insert x S) = (if S = {} then x else max x (Sup S))" |
|
2307 |
apply (rule Sup_insert) |
|
2308 |
apply (rule finite_imp_bounded) |
|
2309 |
by simp |
|
2310 |
||
2311 |
lemma bounded_has_Inf: |
|
2312 |
fixes S :: "real set" |
|
2313 |
assumes "bounded S" "S \<noteq> {}" |
|
2314 |
shows "\<forall>x\<in>S. x >= Inf S" and "\<forall>b. (\<forall>x\<in>S. x >= b) \<longrightarrow> Inf S >= b" |
|
33175 | 2315 |
proof |
2316 |
fix x assume "x\<in>S" |
|
2317 |
from assms(1) obtain a where a:"\<forall>x\<in>S. \<bar>x\<bar> \<le> a" unfolding bounded_real by auto |
|
33270 | 2318 |
thus "x \<ge> Inf S" using `x\<in>S` |
2319 |
by (metis Inf_lower_EX abs_le_D2 minus_le_iff) |
|
33175 | 2320 |
next |
33270 | 2321 |
show "\<forall>b. (\<forall>x\<in>S. x >= b) \<longrightarrow> Inf S \<ge> b" using assms |
2322 |
by (metis SupInf.Inf_greatest) |
|
2323 |
qed |
|
2324 |
||
2325 |
lemma Inf_insert: |
|
2326 |
fixes S :: "real set" |
|
2327 |
shows "bounded S ==> Inf(insert x S) = (if S = {} then x else min x (Inf S))" |
|
50944 | 2328 |
by auto (metis Int_absorb Inf_insert_nonempty bounded_has_Inf(1) disjoint_iff_not_equal) |
2329 |
||
33270 | 2330 |
lemma Inf_insert_finite: |
2331 |
fixes S :: "real set" |
|
2332 |
shows "finite S ==> Inf(insert x S) = (if S = {} then x else min x (Inf S))" |
|
2333 |
by (rule Inf_insert, rule finite_imp_bounded, simp) |
|
2334 |
||
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2335 |
subsection {* Compactness *} |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2336 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2337 |
subsubsection{* Open-cover compactness *} |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2338 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2339 |
definition compact :: "'a::topological_space set \<Rightarrow> bool" where |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2340 |
compact_eq_heine_borel: -- "This name is used for backwards compatibility" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2341 |
"compact S \<longleftrightarrow> (\<forall>C. (\<forall>c\<in>C. open c) \<and> S \<subseteq> \<Union>C \<longrightarrow> (\<exists>D\<subseteq>C. finite D \<and> S \<subseteq> \<Union>D))" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2342 |
|
50898 | 2343 |
lemma compactI: |
2344 |
assumes "\<And>C. \<forall>t\<in>C. open t \<Longrightarrow> s \<subseteq> \<Union> C \<Longrightarrow> \<exists>C'. C' \<subseteq> C \<and> finite C' \<and> s \<subseteq> \<Union> C'" |
|
2345 |
shows "compact s" |
|
2346 |
unfolding compact_eq_heine_borel using assms by metis |
|
2347 |
||
2348 |
lemma compactE: |
|
2349 |
assumes "compact s" and "\<forall>t\<in>C. open t" and "s \<subseteq> \<Union>C" |
|
2350 |
obtains C' where "C' \<subseteq> C" and "finite C'" and "s \<subseteq> \<Union>C'" |
|
2351 |
using assms unfolding compact_eq_heine_borel by metis |
|
2352 |
||
50944 | 2353 |
lemma compactE_image: |
2354 |
assumes "compact s" and "\<forall>t\<in>C. open (f t)" and "s \<subseteq> (\<Union>c\<in>C. f c)" |
|
2355 |
obtains C' where "C' \<subseteq> C" and "finite C'" and "s \<subseteq> (\<Union>c\<in>C'. f c)" |
|
2356 |
using assms unfolding ball_simps[symmetric] SUP_def |
|
2357 |
by (metis (lifting) finite_subset_image compact_eq_heine_borel[of s]) |
|
2358 |
||
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2359 |
subsubsection {* Bolzano-Weierstrass property *} |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2360 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2361 |
lemma heine_borel_imp_bolzano_weierstrass: |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2362 |
assumes "compact s" "infinite t" "t \<subseteq> s" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2363 |
shows "\<exists>x \<in> s. x islimpt t" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2364 |
proof(rule ccontr) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2365 |
assume "\<not> (\<exists>x \<in> s. x islimpt t)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2366 |
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)" unfolding islimpt_def |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2367 |
using bchoice[of s "\<lambda> x T. x \<in> T \<and> open T \<and> (\<forall>y\<in>t. y \<in> T \<longrightarrow> y = x)"] by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2368 |
obtain g where g:"g\<subseteq>{t. \<exists>x. x \<in> s \<and> t = f x}" "finite g" "s \<subseteq> \<Union>g" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2369 |
using assms(1)[unfolded compact_eq_heine_borel, THEN spec[where x="{t. \<exists>x. x\<in>s \<and> t = f x}"]] using f by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2370 |
from g(1,3) have g':"\<forall>x\<in>g. \<exists>xa \<in> s. x = f xa" by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2371 |
{ fix x y assume "x\<in>t" "y\<in>t" "f x = f y" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2372 |
hence "x \<in> f x" "y \<in> f x \<longrightarrow> y = x" using f[THEN bspec[where x=x]] and `t\<subseteq>s` by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2373 |
hence "x = y" using `f x = f y` and f[THEN bspec[where x=y]] and `y\<in>t` and `t\<subseteq>s` by auto } |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2374 |
hence "inj_on f t" unfolding inj_on_def by simp |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2375 |
hence "infinite (f ` t)" using assms(2) using finite_imageD by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2376 |
moreover |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2377 |
{ fix x assume "x\<in>t" "f x \<notin> g" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2378 |
from g(3) assms(3) `x\<in>t` obtain h where "h\<in>g" and "x\<in>h" by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2379 |
then obtain y where "y\<in>s" "h = f y" using g'[THEN bspec[where x=h]] by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2380 |
hence "y = x" using f[THEN bspec[where x=y]] and `x\<in>t` and `x\<in>h`[unfolded `h = f y`] by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2381 |
hence False using `f x \<notin> g` `h\<in>g` unfolding `h = f y` by auto } |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2382 |
hence "f ` t \<subseteq> g" by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2383 |
ultimately show False using g(2) using finite_subset by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2384 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2385 |
|
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
|
2386 |
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
|
2387 |
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
|
2388 |
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
|
2389 |
shows "\<exists>r. subseq r \<and> (f \<circ> r) ----> l" |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2390 |
proof - |
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
|
2391 |
from countable_basis_at_decseq[of l] guess A . note A = this |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2392 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2393 |
def s \<equiv> "\<lambda>n i. SOME j. i < j \<and> f j \<in> A (Suc n)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2394 |
{ 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
|
2395 |
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
|
2396 |
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
|
2397 |
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
|
2398 |
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
|
2399 |
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
|
2400 |
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
|
2401 |
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
|
2402 |
by (auto simp: not_le) |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2403 |
then have "i < s n i" "f (s n i) \<in> A (Suc n)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2404 |
unfolding s_def by (auto intro: someI2_ex) } |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2405 |
note s = this |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2406 |
def r \<equiv> "nat_rec (s 0 0) s" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2407 |
have "subseq r" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2408 |
by (auto simp: r_def s subseq_Suc_iff) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2409 |
moreover |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2410 |
have "(\<lambda>n. f (r n)) ----> l" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2411 |
proof (rule topological_tendstoI) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2412 |
fix S assume "open S" "l \<in> S" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2413 |
with A(3) have "eventually (\<lambda>i. A i \<subseteq> S) sequentially" by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2414 |
moreover |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2415 |
{ fix i assume "Suc 0 \<le> i" then have "f (r i) \<in> A i" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2416 |
by (cases i) (simp_all add: r_def s) } |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2417 |
then have "eventually (\<lambda>i. f (r i) \<in> A i) sequentially" by (auto simp: eventually_sequentially) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2418 |
ultimately show "eventually (\<lambda>i. f (r i) \<in> S) sequentially" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2419 |
by eventually_elim auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2420 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2421 |
ultimately show "\<exists>r. subseq r \<and> (f \<circ> r) ----> l" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2422 |
by (auto simp: convergent_def comp_def) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2423 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2424 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2425 |
lemma sequence_infinite_lemma: |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2426 |
fixes f :: "nat \<Rightarrow> 'a::t1_space" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2427 |
assumes "\<forall>n. f n \<noteq> l" and "(f ---> l) sequentially" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2428 |
shows "infinite (range f)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2429 |
proof |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2430 |
assume "finite (range f)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2431 |
hence "closed (range f)" by (rule finite_imp_closed) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2432 |
hence "open (- range f)" by (rule open_Compl) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2433 |
from assms(1) have "l \<in> - range f" by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2434 |
from assms(2) have "eventually (\<lambda>n. f n \<in> - range f) sequentially" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2435 |
using `open (- range f)` `l \<in> - range f` by (rule topological_tendstoD) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2436 |
thus False unfolding eventually_sequentially by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2437 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2438 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2439 |
lemma closure_insert: |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2440 |
fixes x :: "'a::t1_space" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2441 |
shows "closure (insert x s) = insert x (closure s)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2442 |
apply (rule closure_unique) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2443 |
apply (rule insert_mono [OF closure_subset]) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2444 |
apply (rule closed_insert [OF closed_closure]) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2445 |
apply (simp add: closure_minimal) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2446 |
done |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2447 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2448 |
lemma islimpt_insert: |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2449 |
fixes x :: "'a::t1_space" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2450 |
shows "x islimpt (insert a s) \<longleftrightarrow> x islimpt s" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2451 |
proof |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2452 |
assume *: "x islimpt (insert a s)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2453 |
show "x islimpt s" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2454 |
proof (rule islimptI) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2455 |
fix t assume t: "x \<in> t" "open t" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2456 |
show "\<exists>y\<in>s. y \<in> t \<and> y \<noteq> x" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2457 |
proof (cases "x = a") |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2458 |
case True |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2459 |
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
|
2460 |
using * t by (rule islimptE) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2461 |
with `x = a` show ?thesis by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2462 |
next |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2463 |
case False |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2464 |
with t have t': "x \<in> t - {a}" "open (t - {a})" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2465 |
by (simp_all add: open_Diff) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2466 |
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
|
2467 |
using * t' by (rule islimptE) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2468 |
thus ?thesis by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2469 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2470 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2471 |
next |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2472 |
assume "x islimpt s" thus "x islimpt (insert a s)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2473 |
by (rule islimpt_subset) auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2474 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2475 |
|
50897
078590669527
generalize lemma islimpt_finite to class t1_space
huffman
parents:
50884
diff
changeset
|
2476 |
lemma islimpt_finite: |
078590669527
generalize lemma islimpt_finite to class t1_space
huffman
parents:
50884
diff
changeset
|
2477 |
fixes x :: "'a::t1_space" |
078590669527
generalize lemma islimpt_finite to class t1_space
huffman
parents:
50884
diff
changeset
|
2478 |
shows "finite s \<Longrightarrow> \<not> x islimpt s" |
078590669527
generalize lemma islimpt_finite to class t1_space
huffman
parents:
50884
diff
changeset
|
2479 |
by (induct set: finite, simp_all add: islimpt_insert) |
078590669527
generalize lemma islimpt_finite to class t1_space
huffman
parents:
50884
diff
changeset
|
2480 |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2481 |
lemma islimpt_union_finite: |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2482 |
fixes x :: "'a::t1_space" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2483 |
shows "finite s \<Longrightarrow> x islimpt (s \<union> t) \<longleftrightarrow> x islimpt t" |
50897
078590669527
generalize lemma islimpt_finite to class t1_space
huffman
parents:
50884
diff
changeset
|
2484 |
by (simp add: islimpt_Un islimpt_finite) |
078590669527
generalize lemma islimpt_finite to class t1_space
huffman
parents:
50884
diff
changeset
|
2485 |
|
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
|
2486 |
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
|
2487 |
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
|
2488 |
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
|
2489 |
proof (safe intro!: islimptI) |
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
|
2490 |
fix U assume "l islimpt S" "l \<in> U" "open U" "finite (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
|
2491 |
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
|
2492 |
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
|
2493 |
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
|
2494 |
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
|
2495 |
next |
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
|
2496 |
fix T assume *: "\<forall>U. l\<in>U \<longrightarrow> open U \<longrightarrow> infinite (U \<inter> S)" "l \<in> T" "open 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
|
2497 |
then have "infinite (T \<inter> S - {l})" 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
|
2498 |
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
|
2499 |
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
|
2500 |
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
|
2501 |
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
|
2502 |
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
|
2503 |
|
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
|
2504 |
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
|
2505 |
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
|
2506 |
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
|
2507 |
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
|
2508 |
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
|
2509 |
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
|
2510 |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2511 |
lemma sequence_unique_limpt: |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2512 |
fixes f :: "nat \<Rightarrow> 'a::t2_space" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2513 |
assumes "(f ---> l) sequentially" and "l' islimpt (range f)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2514 |
shows "l' = l" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2515 |
proof (rule ccontr) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2516 |
assume "l' \<noteq> l" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2517 |
obtain s t where "open s" "open t" "l' \<in> s" "l \<in> t" "s \<inter> t = {}" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2518 |
using hausdorff [OF `l' \<noteq> l`] by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2519 |
have "eventually (\<lambda>n. f n \<in> t) sequentially" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2520 |
using assms(1) `open t` `l \<in> t` by (rule topological_tendstoD) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2521 |
then obtain N where "\<forall>n\<ge>N. f n \<in> t" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2522 |
unfolding eventually_sequentially by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2523 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2524 |
have "UNIV = {..<N} \<union> {N..}" by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2525 |
hence "l' islimpt (f ` ({..<N} \<union> {N..}))" using assms(2) by simp |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2526 |
hence "l' islimpt (f ` {..<N} \<union> f ` {N..})" by (simp add: image_Un) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2527 |
hence "l' islimpt (f ` {N..})" by (simp add: islimpt_union_finite) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2528 |
then obtain y where "y \<in> f ` {N..}" "y \<in> s" "y \<noteq> l'" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2529 |
using `l' \<in> s` `open s` by (rule islimptE) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2530 |
then obtain n where "N \<le> n" "f n \<in> s" "f n \<noteq> l'" by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2531 |
with `\<forall>n\<ge>N. f n \<in> t` have "f n \<in> s \<inter> t" by simp |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2532 |
with `s \<inter> t = {}` show False by simp |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2533 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2534 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2535 |
lemma bolzano_weierstrass_imp_closed: |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2536 |
fixes s :: "'a::{first_countable_topology, t2_space} set" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2537 |
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
|
2538 |
shows "closed s" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2539 |
proof- |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2540 |
{ fix x l assume as: "\<forall>n::nat. x n \<in> s" "(x ---> l) sequentially" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2541 |
hence "l \<in> s" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2542 |
proof(cases "\<forall>n. x n \<noteq> l") |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2543 |
case False thus "l\<in>s" using as(1) by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2544 |
next |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2545 |
case True note cas = this |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2546 |
with as(2) have "infinite (range x)" using sequence_infinite_lemma[of x l] by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2547 |
then obtain l' where "l'\<in>s" "l' islimpt (range x)" using assms[THEN spec[where x="range x"]] as(1) by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2548 |
thus "l\<in>s" using sequence_unique_limpt[of x l l'] using as cas by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2549 |
qed } |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2550 |
thus ?thesis unfolding closed_sequential_limits by fast |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2551 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2552 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2553 |
lemma compact_imp_closed: |
50898 | 2554 |
fixes s :: "'a::t2_space set" |
2555 |
assumes "compact s" shows "closed s" |
|
2556 |
unfolding closed_def |
|
2557 |
proof (rule openI) |
|
2558 |
fix y assume "y \<in> - s" |
|
2559 |
let ?C = "\<Union>x\<in>s. {u. open u \<and> x \<in> u \<and> eventually (\<lambda>y. y \<notin> u) (nhds y)}" |
|
2560 |
note `compact s` |
|
2561 |
moreover have "\<forall>u\<in>?C. open u" by simp |
|
2562 |
moreover have "s \<subseteq> \<Union>?C" |
|
2563 |
proof |
|
2564 |
fix x assume "x \<in> s" |
|
2565 |
with `y \<in> - s` have "x \<noteq> y" by clarsimp |
|
2566 |
hence "\<exists>u v. open u \<and> open v \<and> x \<in> u \<and> y \<in> v \<and> u \<inter> v = {}" |
|
2567 |
by (rule hausdorff) |
|
2568 |
with `x \<in> s` show "x \<in> \<Union>?C" |
|
2569 |
unfolding eventually_nhds by auto |
|
2570 |
qed |
|
2571 |
ultimately obtain D where "D \<subseteq> ?C" and "finite D" and "s \<subseteq> \<Union>D" |
|
2572 |
by (rule compactE) |
|
2573 |
from `D \<subseteq> ?C` have "\<forall>x\<in>D. eventually (\<lambda>y. y \<notin> x) (nhds y)" by auto |
|
2574 |
with `finite D` have "eventually (\<lambda>y. y \<notin> \<Union>D) (nhds y)" |
|
2575 |
by (simp add: eventually_Ball_finite) |
|
2576 |
with `s \<subseteq> \<Union>D` have "eventually (\<lambda>y. y \<notin> s) (nhds y)" |
|
2577 |
by (auto elim!: eventually_mono [rotated]) |
|
2578 |
thus "\<exists>t. open t \<and> y \<in> t \<and> t \<subseteq> - s" |
|
2579 |
by (simp add: eventually_nhds subset_eq) |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2580 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2581 |
|
50944 | 2582 |
lemma compact_imp_bounded: |
2583 |
assumes "compact U" shows "bounded U" |
|
2584 |
proof - |
|
2585 |
have "compact U" "\<forall>x\<in>U. open (ball x 1)" "U \<subseteq> (\<Union>x\<in>U. ball x 1)" using assms by auto |
|
2586 |
then obtain D where D: "D \<subseteq> U" "finite D" "U \<subseteq> (\<Union>x\<in>D. ball x 1)" |
|
2587 |
by (elim compactE_image) |
|
50955 | 2588 |
from `finite D` have "bounded (\<Union>x\<in>D. ball x 1)" |
2589 |
by (simp add: bounded_UN) |
|
2590 |
thus "bounded U" using `U \<subseteq> (\<Union>x\<in>D. ball x 1)` |
|
2591 |
by (rule bounded_subset) |
|
50944 | 2592 |
qed |
2593 |
||
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2594 |
text{* In particular, some common special cases. *} |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2595 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2596 |
lemma compact_empty[simp]: |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2597 |
"compact {}" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2598 |
unfolding compact_eq_heine_borel |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2599 |
by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2600 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2601 |
lemma compact_union [intro]: |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2602 |
assumes "compact s" "compact t" shows " compact (s \<union> t)" |
50898 | 2603 |
proof (rule compactI) |
2604 |
fix f assume *: "Ball f open" "s \<union> t \<subseteq> \<Union>f" |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2605 |
from * `compact s` obtain s' where "s' \<subseteq> f \<and> finite s' \<and> s \<subseteq> \<Union>s'" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2606 |
unfolding compact_eq_heine_borel by (auto elim!: allE[of _ f]) metis |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2607 |
moreover from * `compact t` obtain t' where "t' \<subseteq> f \<and> finite t' \<and> t \<subseteq> \<Union>t'" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2608 |
unfolding compact_eq_heine_borel by (auto elim!: allE[of _ f]) metis |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2609 |
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
|
2610 |
by (auto intro!: exI[of _ "s' \<union> t'"]) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2611 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2612 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2613 |
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
|
2614 |
by (induct set: finite) auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2615 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2616 |
lemma compact_UN [intro]: |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2617 |
"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
|
2618 |
unfolding SUP_def by (rule compact_Union) auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2619 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2620 |
lemma compact_inter_closed [intro]: |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2621 |
assumes "compact s" and "closed t" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2622 |
shows "compact (s \<inter> t)" |
50898 | 2623 |
proof (rule compactI) |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2624 |
fix C assume C: "\<forall>c\<in>C. open c" and cover: "s \<inter> t \<subseteq> \<Union>C" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2625 |
from C `closed t` have "\<forall>c\<in>C \<union> {-t}. open c" by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2626 |
moreover from cover have "s \<subseteq> \<Union>(C \<union> {-t})" by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2627 |
ultimately have "\<exists>D\<subseteq>C \<union> {-t}. finite D \<and> s \<subseteq> \<Union>D" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2628 |
using `compact s` unfolding compact_eq_heine_borel by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2629 |
then guess D .. |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2630 |
then show "\<exists>D\<subseteq>C. finite D \<and> s \<inter> t \<subseteq> \<Union>D" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2631 |
by (intro exI[of _ "D - {-t}"]) auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2632 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2633 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2634 |
lemma closed_inter_compact [intro]: |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2635 |
assumes "closed s" and "compact t" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2636 |
shows "compact (s \<inter> t)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2637 |
using compact_inter_closed [of t s] assms |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2638 |
by (simp add: Int_commute) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2639 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2640 |
lemma compact_inter [intro]: |
50898 | 2641 |
fixes s t :: "'a :: t2_space set" |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2642 |
assumes "compact s" and "compact t" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2643 |
shows "compact (s \<inter> t)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2644 |
using assms by (intro compact_inter_closed compact_imp_closed) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2645 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2646 |
lemma compact_sing [simp]: "compact {a}" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2647 |
unfolding compact_eq_heine_borel by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2648 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2649 |
lemma compact_insert [simp]: |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2650 |
assumes "compact s" shows "compact (insert x s)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2651 |
proof - |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2652 |
have "compact ({x} \<union> s)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2653 |
using compact_sing assms by (rule compact_union) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2654 |
thus ?thesis by simp |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2655 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2656 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2657 |
lemma finite_imp_compact: |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2658 |
shows "finite s \<Longrightarrow> compact s" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2659 |
by (induct set: finite) simp_all |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2660 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2661 |
lemma open_delete: |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2662 |
fixes s :: "'a::t1_space set" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2663 |
shows "open s \<Longrightarrow> open (s - {x})" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2664 |
by (simp add: open_Diff) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2665 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2666 |
text{* Finite intersection property *} |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2667 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2668 |
lemma inj_setminus: "inj_on uminus (A::'a set set)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2669 |
by (auto simp: inj_on_def) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2670 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2671 |
lemma compact_fip: |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2672 |
"compact U \<longleftrightarrow> |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2673 |
(\<forall>A. (\<forall>a\<in>A. closed a) \<longrightarrow> (\<forall>B \<subseteq> A. finite B \<longrightarrow> U \<inter> \<Inter>B \<noteq> {}) \<longrightarrow> U \<inter> \<Inter>A \<noteq> {})" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2674 |
(is "_ \<longleftrightarrow> ?R") |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2675 |
proof (safe intro!: compact_eq_heine_borel[THEN iffD2]) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2676 |
fix A assume "compact U" and A: "\<forall>a\<in>A. closed a" "U \<inter> \<Inter>A = {}" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2677 |
and fi: "\<forall>B \<subseteq> A. finite B \<longrightarrow> U \<inter> \<Inter>B \<noteq> {}" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2678 |
from A have "(\<forall>a\<in>uminus`A. open a) \<and> U \<subseteq> \<Union>uminus`A" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2679 |
by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2680 |
with `compact U` obtain B where "B \<subseteq> A" "finite (uminus`B)" "U \<subseteq> \<Union>(uminus`B)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2681 |
unfolding compact_eq_heine_borel by (metis subset_image_iff) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2682 |
with fi[THEN spec, of B] show False |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2683 |
by (auto dest: finite_imageD intro: inj_setminus) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2684 |
next |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2685 |
fix A assume ?R and cover: "\<forall>a\<in>A. open a" "U \<subseteq> \<Union>A" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2686 |
from cover have "U \<inter> \<Inter>(uminus`A) = {}" "\<forall>a\<in>uminus`A. closed a" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2687 |
by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2688 |
with `?R` obtain B where "B \<subseteq> A" "finite (uminus`B)" "U \<inter> \<Inter>uminus`B = {}" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2689 |
by (metis subset_image_iff) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2690 |
then show "\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union>T" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2691 |
by (auto intro!: exI[of _ B] inj_setminus dest: finite_imageD) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2692 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2693 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2694 |
lemma compact_imp_fip: |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2695 |
"compact s \<Longrightarrow> \<forall>t \<in> f. closed t \<Longrightarrow> \<forall>f'. finite f' \<and> f' \<subseteq> f \<longrightarrow> (s \<inter> (\<Inter> f') \<noteq> {}) \<Longrightarrow> |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2696 |
s \<inter> (\<Inter> f) \<noteq> {}" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2697 |
unfolding compact_fip by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2698 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2699 |
text{*Compactness expressed with filters*} |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2700 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2701 |
definition "filter_from_subbase B = Abs_filter (\<lambda>P. \<exists>X \<subseteq> B. finite X \<and> Inf X \<le> P)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2702 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2703 |
lemma eventually_filter_from_subbase: |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2704 |
"eventually P (filter_from_subbase B) \<longleftrightarrow> (\<exists>X \<subseteq> B. finite X \<and> Inf X \<le> P)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2705 |
(is "_ \<longleftrightarrow> ?R P") |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2706 |
unfolding filter_from_subbase_def |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2707 |
proof (rule eventually_Abs_filter is_filter.intro)+ |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2708 |
show "?R (\<lambda>x. True)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2709 |
by (rule exI[of _ "{}"]) (simp add: le_fun_def) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2710 |
next |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2711 |
fix P Q assume "?R P" then guess X .. |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2712 |
moreover assume "?R Q" then guess Y .. |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2713 |
ultimately show "?R (\<lambda>x. P x \<and> Q x)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2714 |
by (intro exI[of _ "X \<union> Y"]) auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2715 |
next |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2716 |
fix P Q |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2717 |
assume "?R P" then guess X .. |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2718 |
moreover assume "\<forall>x. P x \<longrightarrow> Q x" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2719 |
ultimately show "?R Q" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2720 |
by (intro exI[of _ X]) auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2721 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2722 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2723 |
lemma eventually_filter_from_subbaseI: "P \<in> B \<Longrightarrow> eventually P (filter_from_subbase B)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2724 |
by (subst eventually_filter_from_subbase) (auto intro!: exI[of _ "{P}"]) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2725 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2726 |
lemma filter_from_subbase_not_bot: |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2727 |
"\<forall>X \<subseteq> B. finite X \<longrightarrow> Inf X \<noteq> bot \<Longrightarrow> filter_from_subbase B \<noteq> bot" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2728 |
unfolding trivial_limit_def eventually_filter_from_subbase by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2729 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2730 |
lemma closure_iff_nhds_not_empty: |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2731 |
"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
|
2732 |
proof safe |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2733 |
assume x: "x \<in> closure X" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2734 |
fix S A assume "open S" "x \<in> S" "X \<inter> A = {}" "S \<subseteq> A" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2735 |
then have "x \<notin> closure (-S)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2736 |
by (auto simp: closure_complement subset_eq[symmetric] intro: interiorI) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2737 |
with x have "x \<in> closure X - closure (-S)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2738 |
by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2739 |
also have "\<dots> \<subseteq> closure (X \<inter> S)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2740 |
using `open S` open_inter_closure_subset[of S X] by (simp add: closed_Compl ac_simps) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2741 |
finally have "X \<inter> S \<noteq> {}" by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2742 |
then show False using `X \<inter> A = {}` `S \<subseteq> A` by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2743 |
next |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2744 |
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
|
2745 |
from this[THEN spec, of "- X", THEN spec, of "- closure X"] |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2746 |
show "x \<in> closure X" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2747 |
by (simp add: closure_subset open_Compl) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2748 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2749 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2750 |
lemma compact_filter: |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2751 |
"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
|
2752 |
proof (intro allI iffI impI compact_fip[THEN iffD2] notI) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2753 |
fix F assume "compact U" and F: "F \<noteq> bot" "eventually (\<lambda>x. x \<in> U) F" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2754 |
from F have "U \<noteq> {}" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2755 |
by (auto simp: eventually_False) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2756 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2757 |
def Z \<equiv> "closure ` {A. eventually (\<lambda>x. x \<in> A) F}" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2758 |
then have "\<forall>z\<in>Z. closed z" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2759 |
by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2760 |
moreover |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2761 |
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
|
2762 |
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
|
2763 |
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
|
2764 |
proof (intro allI impI) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2765 |
fix B assume "finite B" "B \<subseteq> Z" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2766 |
with `finite B` ev_Z have "eventually (\<lambda>x. \<forall>b\<in>B. x \<in> b) F" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2767 |
by (auto intro!: eventually_Ball_finite) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2768 |
with F(2) have "eventually (\<lambda>x. x \<in> U \<inter> (\<Inter>B)) F" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2769 |
by eventually_elim auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2770 |
with F show "U \<inter> \<Inter>B \<noteq> {}" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2771 |
by (intro notI) (simp add: eventually_False) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2772 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2773 |
ultimately have "U \<inter> \<Inter>Z \<noteq> {}" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2774 |
using `compact U` unfolding compact_fip by blast |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2775 |
then obtain x where "x \<in> U" and x: "\<And>z. z \<in> Z \<Longrightarrow> x \<in> z" by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2776 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2777 |
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
|
2778 |
unfolding eventually_inf eventually_nhds |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2779 |
proof safe |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2780 |
fix P Q R S |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2781 |
assume "eventually R F" "open S" "x \<in> S" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2782 |
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
|
2783 |
have "S \<inter> {x. R x} \<noteq> {}" by (auto simp: Z_def) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2784 |
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
|
2785 |
ultimately show False by (auto simp: set_eq_iff) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2786 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2787 |
with `x \<in> U` show "\<exists>x\<in>U. inf (nhds x) F \<noteq> bot" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2788 |
by (metis eventually_bot) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2789 |
next |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2790 |
fix A assume A: "\<forall>a\<in>A. closed a" "\<forall>B\<subseteq>A. finite B \<longrightarrow> U \<inter> \<Inter>B \<noteq> {}" "U \<inter> \<Inter>A = {}" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2791 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2792 |
def P' \<equiv> "(\<lambda>a (x::'a). x \<in> a)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2793 |
then have inj_P': "\<And>A. inj_on P' A" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2794 |
by (auto intro!: inj_onI simp: fun_eq_iff) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2795 |
def F \<equiv> "filter_from_subbase (P' ` insert U A)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2796 |
have "F \<noteq> bot" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2797 |
unfolding F_def |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2798 |
proof (safe intro!: filter_from_subbase_not_bot) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2799 |
fix X assume "X \<subseteq> P' ` insert U A" "finite X" "Inf X = bot" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2800 |
then obtain B where "B \<subseteq> insert U A" "finite B" and B: "Inf (P' ` B) = bot" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2801 |
unfolding subset_image_iff by (auto intro: inj_P' finite_imageD) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2802 |
with A(2)[THEN spec, of "B - {U}"] have "U \<inter> \<Inter>(B - {U}) \<noteq> {}" by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2803 |
with B show False by (auto simp: P'_def fun_eq_iff) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2804 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2805 |
moreover have "eventually (\<lambda>x. x \<in> U) F" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2806 |
unfolding F_def by (rule eventually_filter_from_subbaseI) (auto simp: P'_def) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2807 |
moreover 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)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2808 |
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
|
2809 |
by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2810 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2811 |
{ fix V assume "V \<in> A" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2812 |
then have V: "eventually (\<lambda>x. x \<in> V) F" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2813 |
by (auto simp add: F_def image_iff P'_def intro!: eventually_filter_from_subbaseI) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2814 |
have "x \<in> closure V" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2815 |
unfolding closure_iff_nhds_not_empty |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2816 |
proof (intro impI allI) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2817 |
fix S A assume "open S" "x \<in> S" "S \<subseteq> A" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2818 |
then have "eventually (\<lambda>x. x \<in> A) (nhds x)" by (auto simp: eventually_nhds) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2819 |
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
|
2820 |
by (auto simp: eventually_inf) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2821 |
with x show "V \<inter> A \<noteq> {}" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2822 |
by (auto simp del: Int_iff simp add: trivial_limit_def) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2823 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2824 |
then have "x \<in> V" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2825 |
using `V \<in> A` A(1) by simp } |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2826 |
with `x\<in>U` have "x \<in> U \<inter> \<Inter>A" by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2827 |
with `U \<inter> \<Inter>A = {}` show False by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2828 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2829 |
|
50941
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
2830 |
definition "countably_compact U \<longleftrightarrow> |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2831 |
(\<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
|
2832 |
|
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
2833 |
lemma countably_compactE: |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
2834 |
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
|
2835 |
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
|
2836 |
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
|
2837 |
|
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
2838 |
lemma countably_compactI: |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
2839 |
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
|
2840 |
shows "countably_compact s" |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
2841 |
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
|
2842 |
|
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
2843 |
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
|
2844 |
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
|
2845 |
|
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
2846 |
lemma countably_compact_imp_compact: |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
2847 |
assumes "countably_compact U" |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
2848 |
assumes ccover: "countable B" "\<forall>b\<in>B. open b" |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
2849 |
assumes 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" |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
2850 |
shows "compact U" |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
2851 |
using `countably_compact U` unfolding 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
|
2852 |
proof safe |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2853 |
fix A assume A: "\<forall>a\<in>A. open a" "U \<subseteq> \<Union>A" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2854 |
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
|
2855 |
|
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
2856 |
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
|
2857 |
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
|
2858 |
unfolding C_def using ccover by auto |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2859 |
moreover |
50941
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
2860 |
have "\<Union>A \<inter> U \<subseteq> \<Union>C" |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2861 |
proof safe |
50941
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
2862 |
fix x a assume "x \<in> U" "x \<in> a" "a \<in> A" |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
2863 |
with basis[of a x] A obtain b where "b \<in> B" "x \<in> b" "b \<inter> U \<subseteq> a" by blast |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
2864 |
with `a \<in> A` show "x \<in> \<Union>C" unfolding C_def |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
2865 |
by auto |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2866 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2867 |
then have "U \<subseteq> \<Union>C" using `U \<subseteq> \<Union>A` by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2868 |
ultimately obtain T where "T\<subseteq>C" "finite T" "U \<subseteq> \<Union>T" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2869 |
using * by metis |
50941
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
2870 |
moreover 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
|
2871 |
by (auto simp: C_def) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2872 |
then guess f unfolding bchoice_iff Bex_def .. |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2873 |
ultimately show "\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union>T" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2874 |
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
|
2875 |
qed |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
2876 |
|
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
2877 |
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
|
2878 |
"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
|
2879 |
proof (rule countably_compact_imp_compact) |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
2880 |
fix T and x :: 'a assume "open T" "x \<in> T" |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
2881 |
from topological_basisE[OF is_basis this] guess b . |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
2882 |
then show "\<exists>b\<in>SOME B. countable B \<and> topological_basis B. x \<in> b \<and> b \<inter> U \<subseteq> T" by auto |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
2883 |
qed (insert countable_basis topological_basis_open[OF is_basis], auto) |
36437 | 2884 |
|
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
|
2885 |
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
|
2886 |
"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
|
2887 |
using countably_compact_imp_compact_second_countable compact_imp_countably_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
|
2888 |
|
36437 | 2889 |
subsubsection{* Sequential compactness *} |
33175 | 2890 |
|
2891 |
definition |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2892 |
seq_compact :: "'a::topological_space set \<Rightarrow> bool" where |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2893 |
"seq_compact S \<longleftrightarrow> |
33175 | 2894 |
(\<forall>f. (\<forall>n. f n \<in> S) \<longrightarrow> |
2895 |
(\<exists>l\<in>S. \<exists>r. subseq r \<and> ((f o r) ---> l) sequentially))" |
|
2896 |
||
50941
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
2897 |
lemma seq_compact_imp_countably_compact: |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
2898 |
fixes U :: "'a :: first_countable_topology set" |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2899 |
assumes "seq_compact U" |
50941
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
2900 |
shows "countably_compact U" |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
2901 |
proof (safe intro!: countably_compactI) |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2902 |
fix A assume A: "\<forall>a\<in>A. open a" "U \<subseteq> \<Union>A" "countable A" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2903 |
have subseq: "\<And>X. range X \<subseteq> U \<Longrightarrow> \<exists>r x. x \<in> U \<and> subseq r \<and> (X \<circ> r) ----> x" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2904 |
using `seq_compact U` by (fastforce simp: seq_compact_def subset_eq) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2905 |
show "\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union>T" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2906 |
proof cases |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2907 |
assume "finite A" with A show ?thesis by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2908 |
next |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2909 |
assume "infinite A" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2910 |
then have "A \<noteq> {}" by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2911 |
show ?thesis |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2912 |
proof (rule ccontr) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2913 |
assume "\<not> (\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union>T)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2914 |
then have "\<forall>T. \<exists>x. T \<subseteq> A \<and> finite T \<longrightarrow> (x \<in> U - \<Union>T)" by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2915 |
then obtain X' where T: "\<And>T. T \<subseteq> A \<Longrightarrow> finite T \<Longrightarrow> X' T \<in> U - \<Union>T" by metis |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2916 |
def X \<equiv> "\<lambda>n. X' (from_nat_into A ` {.. n})" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2917 |
have X: "\<And>n. X n \<in> U - (\<Union>i\<le>n. from_nat_into A i)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2918 |
using `A \<noteq> {}` unfolding X_def SUP_def by (intro T) (auto intro: from_nat_into) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2919 |
then have "range X \<subseteq> U" by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2920 |
with subseq[of X] obtain r x where "x \<in> U" and r: "subseq r" "(X \<circ> r) ----> x" by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2921 |
from `x\<in>U` `U \<subseteq> \<Union>A` from_nat_into_surj[OF `countable A`] |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2922 |
obtain n where "x \<in> from_nat_into A n" by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2923 |
with r(2) A(1) from_nat_into[OF `A \<noteq> {}`, of n] |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2924 |
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
|
2925 |
unfolding tendsto_def by (auto simp: comp_def) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2926 |
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
|
2927 |
by (auto simp: eventually_sequentially) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2928 |
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
|
2929 |
by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2930 |
moreover from `subseq r`[THEN seq_suble, of "max n N"] have "\<exists>i. n \<le> r i \<and> N \<le> i" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2931 |
by (auto intro!: exI[of _ "max n N"]) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2932 |
ultimately show False |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2933 |
by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2934 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2935 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2936 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2937 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2938 |
lemma compact_imp_seq_compact: |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2939 |
fixes U :: "'a :: first_countable_topology set" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2940 |
assumes "compact U" shows "seq_compact U" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2941 |
unfolding seq_compact_def |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2942 |
proof safe |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2943 |
fix X :: "nat \<Rightarrow> 'a" assume "\<forall>n. X n \<in> U" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2944 |
then have "eventually (\<lambda>x. x \<in> U) (filtermap X sequentially)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2945 |
by (auto simp: eventually_filtermap) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2946 |
moreover have "filtermap X sequentially \<noteq> bot" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2947 |
by (simp add: trivial_limit_def eventually_filtermap) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2948 |
ultimately obtain x where "x \<in> U" and x: "inf (nhds x) (filtermap X sequentially) \<noteq> bot" (is "?F \<noteq> _") |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2949 |
using `compact U` by (auto simp: compact_filter) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2950 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2951 |
from countable_basis_at_decseq[of x] guess A . note A = this |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2952 |
def s \<equiv> "\<lambda>n i. SOME j. i < j \<and> X j \<in> A (Suc n)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2953 |
{ fix n i |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2954 |
have "\<exists>a. i < a \<and> X a \<in> A (Suc n)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2955 |
proof (rule ccontr) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2956 |
assume "\<not> (\<exists>a>i. X a \<in> A (Suc n))" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2957 |
then have "\<And>a. Suc i \<le> a \<Longrightarrow> X a \<notin> A (Suc n)" by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2958 |
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
|
2959 |
by (auto simp: eventually_filtermap eventually_sequentially) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2960 |
moreover have "eventually (\<lambda>x. x \<in> A (Suc n)) (nhds x)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2961 |
using A(1,2)[of "Suc n"] by (auto simp: eventually_nhds) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2962 |
ultimately have "eventually (\<lambda>x. False) ?F" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2963 |
by (auto simp add: eventually_inf) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2964 |
with x show False |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2965 |
by (simp add: eventually_False) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2966 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2967 |
then have "i < s n i" "X (s n i) \<in> A (Suc n)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2968 |
unfolding s_def by (auto intro: someI2_ex) } |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2969 |
note s = this |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2970 |
def r \<equiv> "nat_rec (s 0 0) s" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2971 |
have "subseq r" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2972 |
by (auto simp: r_def s subseq_Suc_iff) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2973 |
moreover |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2974 |
have "(\<lambda>n. X (r n)) ----> x" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2975 |
proof (rule topological_tendstoI) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2976 |
fix S assume "open S" "x \<in> S" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2977 |
with A(3) have "eventually (\<lambda>i. A i \<subseteq> S) sequentially" by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2978 |
moreover |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2979 |
{ fix i assume "Suc 0 \<le> i" then have "X (r i) \<in> A i" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2980 |
by (cases i) (simp_all add: r_def s) } |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2981 |
then have "eventually (\<lambda>i. X (r i) \<in> A i) sequentially" by (auto simp: eventually_sequentially) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2982 |
ultimately show "eventually (\<lambda>i. X (r i) \<in> S) sequentially" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2983 |
by eventually_elim auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2984 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2985 |
ultimately show "\<exists>x \<in> U. \<exists>r. subseq r \<and> (X \<circ> r) ----> x" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2986 |
using `x \<in> U` by (auto simp: convergent_def comp_def) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2987 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2988 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2989 |
lemma seq_compactI: |
44075 | 2990 |
assumes "\<And>f. \<forall>n. f n \<in> S \<Longrightarrow> \<exists>l\<in>S. \<exists>r. subseq r \<and> ((f o r) ---> l) sequentially" |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2991 |
shows "seq_compact S" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2992 |
unfolding seq_compact_def using assms by fast |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2993 |
|
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2994 |
lemma seq_compactE: |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2995 |
assumes "seq_compact S" "\<forall>n. f n \<in> S" |
44075 | 2996 |
obtains l r where "l \<in> S" "subseq r" "((f \<circ> r) ---> l) sequentially" |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2997 |
using assms unfolding seq_compact_def by fast |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
2998 |
|
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
|
2999 |
lemma 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
|
3000 |
assumes "countably_compact s" "countable t" "infinite t" "t \<subseteq> 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
|
3001 |
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
|
3002 |
proof (rule ccontr) |
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
|
3003 |
def C \<equiv> "(\<lambda>F. interior (F \<union> (- t))) ` {F. finite F \<and> F \<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
|
3004 |
note `countably_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
|
3005 |
moreover have "\<forall>t\<in>C. open 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
|
3006 |
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
|
3007 |
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
|
3008 |
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
|
3009 |
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
|
3010 |
have "s \<subseteq> \<Union>C" |
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
|
3011 |
using `t \<subseteq> 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
|
3012 |
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
|
3013 |
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
|
3014 |
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
|
3015 |
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
|
3016 |
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
|
3017 |
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
|
3018 |
from `countable t` have "countable C" |
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
|
3019 |
unfolding C_def by (auto intro: countable_Collect_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
|
3020 |
ultimately guess D by (rule countably_compactE) |
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
|
3021 |
then obtain E where E: "E \<subseteq> {F. finite F \<and> F \<subseteq> t }" "finite E" and |
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
|
3022 |
s: "s \<subseteq> (\<Union>F\<in>E. interior (F \<union> (- 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
|
3023 |
by (metis (lifting) Union_image_eq finite_subset_image 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
|
3024 |
from s `t \<subseteq> s` have "t \<subseteq> \<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
|
3025 |
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
|
3026 |
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
|
3027 |
using E 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
|
3028 |
ultimately show False using `infinite t` by (auto simp: 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
|
3029 |
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
|
3030 |
|
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
|
3031 |
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
|
3032 |
fixes s :: "'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
|
3033 |
assumes "\<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))" |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3034 |
shows "seq_compact s" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3035 |
proof - |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3036 |
{ fix f :: "nat \<Rightarrow> 'a" 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
|
3037 |
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
|
3038 |
proof (cases "finite (range f)") |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3039 |
case True |
50941
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3040 |
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
|
3041 |
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
|
3042 |
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
|
3043 |
using infinite_enumerate by blast |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3044 |
hence "subseq r \<and> (f \<circ> r) ----> f l" |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3045 |
by (simp add: fr tendsto_const o_def) |
3690724028b1
add countable compacteness; replace finite_range_imp_infinite_repeats by pigeonhole_infinite
hoelzl
parents:
50940
diff
changeset
|
3046 |
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
|
3047 |
by auto |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3048 |
next |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3049 |
case False |
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
|
3050 |
with f assms have "\<exists>x\<in>s. \<forall>U. x\<in>U \<and> open U \<longrightarrow> infinite (U \<inter> range f)" 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
|
3051 |
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
|
3052 |
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
|
3053 |
using acc_point_range_imp_convergent_subsequence[of l f] 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
|
3054 |
with `l \<in> s` 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
|
3055 |
qed |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3056 |
} |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3057 |
thus ?thesis unfolding seq_compact_def by auto |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3058 |
qed |
44075 | 3059 |
|
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
|
3060 |
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
|
3061 |
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
|
3062 |
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
|
3063 |
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
|
3064 |
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
|
3065 |
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
|
3066 |
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
|
3067 |
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
|
3068 |
|
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
|
3069 |
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
|
3070 |
fixes s :: "'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
|
3071 |
shows "seq_compact s \<longleftrightarrow> (\<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)))" |
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
|
3072 |
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
|
3073 |
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
|
3074 |
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
|
3075 |
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
|
3076 |
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
|
3077 |
|
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
|
3078 |
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
|
3079 |
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
|
3080 |
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
|
3081 |
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
|
3082 |
|
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
|
3083 |
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
|
3084 |
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
|
3085 |
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
|
3086 |
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
|
3087 |
|
50940
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3088 |
subsubsection{* Total boundedness *} |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3089 |
|
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3090 |
lemma cauchy_def: |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3091 |
"Cauchy s \<longleftrightarrow> (\<forall>e>0. \<exists>N. \<forall>m n. m \<ge> N \<and> n \<ge> N --> dist(s m)(s n) < e)" |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3092 |
unfolding Cauchy_def by blast |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3093 |
|
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3094 |
fun helper_1::"('a::metric_space set) \<Rightarrow> real \<Rightarrow> nat \<Rightarrow> 'a" where |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3095 |
"helper_1 s e n = (SOME y::'a. y \<in> s \<and> (\<forall>m<n. \<not> (dist (helper_1 s e m) y < e)))" |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3096 |
declare helper_1.simps[simp del] |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3097 |
|
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3098 |
lemma seq_compact_imp_totally_bounded: |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3099 |
assumes "seq_compact s" |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3100 |
shows "\<forall>e>0. \<exists>k. finite k \<and> k \<subseteq> s \<and> s \<subseteq> (\<Union>((\<lambda>x. ball x e) ` k))" |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3101 |
proof(rule, rule, rule ccontr) |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3102 |
fix e::real assume "e>0" and assm:"\<not> (\<exists>k. finite k \<and> k \<subseteq> s \<and> s \<subseteq> \<Union>(\<lambda>x. ball x e) ` k)" |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3103 |
def x \<equiv> "helper_1 s e" |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3104 |
{ fix n |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3105 |
have "x n \<in> s \<and> (\<forall>m<n. \<not> dist (x m) (x n) < e)" |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3106 |
proof(induct_tac rule:nat_less_induct) |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3107 |
fix n def Q \<equiv> "(\<lambda>y. y \<in> s \<and> (\<forall>m<n. \<not> dist (x m) y < e))" |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3108 |
assume as:"\<forall>m<n. x m \<in> s \<and> (\<forall>ma<m. \<not> dist (x ma) (x m) < e)" |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3109 |
have "\<not> s \<subseteq> (\<Union>x\<in>x ` {0..<n}. ball x e)" using assm apply simp apply(erule_tac x="x ` {0 ..< n}" in allE) using as by auto |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3110 |
then obtain z where z:"z\<in>s" "z \<notin> (\<Union>x\<in>x ` {0..<n}. ball x e)" unfolding subset_eq by auto |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3111 |
have "Q (x n)" unfolding x_def and helper_1.simps[of s e n] |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3112 |
apply(rule someI2[where a=z]) unfolding x_def[symmetric] and Q_def using z by auto |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3113 |
thus "x n \<in> s \<and> (\<forall>m<n. \<not> dist (x m) (x n) < e)" unfolding Q_def by auto |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3114 |
qed } |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3115 |
hence "\<forall>n::nat. x n \<in> s" and x:"\<forall>n. \<forall>m < n. \<not> (dist (x m) (x n) < e)" by blast+ |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3116 |
then obtain l r where "l\<in>s" and r:"subseq r" and "((x \<circ> r) ---> l) sequentially" using assms(1)[unfolded seq_compact_def, THEN spec[where x=x]] by auto |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3117 |
from this(3) have "Cauchy (x \<circ> r)" using LIMSEQ_imp_Cauchy by auto |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3118 |
then obtain N::nat where N:"\<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist ((x \<circ> r) m) ((x \<circ> r) n) < e" unfolding cauchy_def using `e>0` by auto |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3119 |
show False |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3120 |
using N[THEN spec[where x=N], THEN spec[where x="N+1"]] |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3121 |
using r[unfolded subseq_def, THEN spec[where x=N], THEN spec[where x="N+1"]] |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3122 |
using x[THEN spec[where x="r (N+1)"], THEN spec[where x="r (N)"]] by auto |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3123 |
qed |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3124 |
|
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3125 |
subsubsection{* Heine-Borel theorem *} |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3126 |
|
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3127 |
lemma seq_compact_imp_heine_borel: |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3128 |
fixes s :: "'a :: metric_space set" |
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
|
3129 |
assumes "seq_compact s" shows "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
|
3130 |
proof - |
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
|
3131 |
from seq_compact_imp_totally_bounded[OF `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
|
3132 |
guess f unfolding choice_iff' .. note f = this |
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
|
3133 |
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
|
3134 |
have "countably_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
|
3135 |
using `seq_compact s` by (rule 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
|
3136 |
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
|
3137 |
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
|
3138 |
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
|
3139 |
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
|
3140 |
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
|
3141 |
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
|
3142 |
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
|
3143 |
next |
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
|
3144 |
fix T x assume T: "open T" "x \<in> T" and x: "x \<in> 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
|
3145 |
from openE[OF T] obtain e where "0 < e" "ball x e \<subseteq> T" 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
|
3146 |
then have "0 < e / 2" "ball x (e / 2) \<subseteq> T" 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
|
3147 |
from Rats_dense_in_real[OF `0 < e / 2`] obtain r where "r \<in> \<rat>" "0 < r" "r < e / 2" 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
|
3148 |
from f[rule_format, of r] `0 < r` `x \<in> s` obtain k where "k \<in> f r" "x \<in> ball k r" |
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
|
3149 |
unfolding Union_image_eq 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
|
3150 |
from `r \<in> \<rat>` `0 < r` `k \<in> f r` have "ball k r \<in> K" 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
|
3151 |
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
|
3152 |
proof (rule bexI[rotated], safe) |
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
|
3153 |
fix y assume "y \<in> ball k r" |
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
|
3154 |
with `r < e / 2` `x \<in> ball k r` have "dist x y < 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
|
3155 |
by (intro dist_double[where x = k and d=e]) (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
|
3156 |
with `ball x e \<subseteq> T` show "y \<in> T" 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
|
3157 |
qed (rule `x \<in> ball k r`) |
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
|
3158 |
qed |
50940
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3159 |
qed |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3160 |
|
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3161 |
lemma compact_eq_seq_compact_metric: |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3162 |
"compact (s :: 'a::metric_space set) \<longleftrightarrow> seq_compact s" |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3163 |
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
|
3164 |
|
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3165 |
lemma compact_def: |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3166 |
"compact (S :: 'a::metric_space set) \<longleftrightarrow> |
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
|
3167 |
(\<forall>f. (\<forall>n. f n \<in> S) \<longrightarrow> (\<exists>l\<in>S. \<exists>r. subseq r \<and> (f o r) ----> l))" |
50940
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3168 |
unfolding compact_eq_seq_compact_metric seq_compact_def by auto |
a7c273a83d27
group compactness-eq-seq-compactness lemmas together
hoelzl
parents:
50939
diff
changeset
|
3169 |
|
50944 | 3170 |
subsubsection {* Complete the chain of compactness variants *} |
3171 |
||
3172 |
lemma compact_eq_bolzano_weierstrass: |
|
3173 |
fixes s :: "'a::metric_space set" |
|
3174 |
shows "compact s \<longleftrightarrow> (\<forall>t. infinite t \<and> t \<subseteq> s --> (\<exists>x \<in> s. x islimpt t))" (is "?lhs = ?rhs") |
|
3175 |
proof |
|
3176 |
assume ?lhs thus ?rhs using heine_borel_imp_bolzano_weierstrass[of s] by auto |
|
3177 |
next |
|
3178 |
assume ?rhs thus ?lhs |
|
3179 |
unfolding compact_eq_seq_compact_metric by (rule bolzano_weierstrass_imp_seq_compact) |
|
3180 |
qed |
|
3181 |
||
3182 |
lemma bolzano_weierstrass_imp_bounded: |
|
3183 |
"\<forall>t. infinite t \<and> t \<subseteq> s --> (\<exists>x \<in> s. x islimpt t) \<Longrightarrow> bounded s" |
|
3184 |
using compact_imp_bounded unfolding compact_eq_bolzano_weierstrass . |
|
3185 |
||
33175 | 3186 |
text {* |
3187 |
A metric space (or topological vector space) is said to have the |
|
3188 |
Heine-Borel property if every closed and bounded subset is compact. |
|
3189 |
*} |
|
3190 |
||
44207
ea99698c2070
locale-ize some definitions, so perfect_space and heine_borel can inherit from the proper superclasses
huffman
parents:
44170
diff
changeset
|
3191 |
class heine_borel = metric_space + |
33175 | 3192 |
assumes bounded_imp_convergent_subsequence: |
3193 |
"bounded s \<Longrightarrow> \<forall>n. f n \<in> s |
|
3194 |
\<Longrightarrow> \<exists>l r. subseq r \<and> ((f \<circ> r) ---> l) sequentially" |
|
3195 |
||
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3196 |
lemma bounded_closed_imp_seq_compact: |
33175 | 3197 |
fixes s::"'a::heine_borel set" |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3198 |
assumes "bounded s" and "closed s" shows "seq_compact s" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3199 |
proof (unfold seq_compact_def, clarify) |
33175 | 3200 |
fix f :: "nat \<Rightarrow> 'a" assume f: "\<forall>n. f n \<in> s" |
3201 |
obtain l r where r: "subseq r" and l: "((f \<circ> r) ---> l) sequentially" |
|
3202 |
using bounded_imp_convergent_subsequence [OF `bounded s` `\<forall>n. f n \<in> s`] by auto |
|
3203 |
from f have fr: "\<forall>n. (f \<circ> r) n \<in> s" by simp |
|
3204 |
have "l \<in> s" using `closed s` fr l |
|
3205 |
unfolding closed_sequential_limits by blast |
|
3206 |
show "\<exists>l\<in>s. \<exists>r. subseq r \<and> ((f \<circ> r) ---> l) sequentially" |
|
3207 |
using `l \<in> s` r l by blast |
|
3208 |
qed |
|
3209 |
||
50944 | 3210 |
lemma compact_eq_bounded_closed: |
3211 |
fixes s :: "'a::heine_borel set" |
|
3212 |
shows "compact s \<longleftrightarrow> bounded s \<and> closed s" (is "?lhs = ?rhs") |
|
3213 |
proof |
|
3214 |
assume ?lhs thus ?rhs |
|
3215 |
using compact_imp_closed compact_imp_bounded by blast |
|
3216 |
next |
|
3217 |
assume ?rhs thus ?lhs |
|
3218 |
using bounded_closed_imp_seq_compact[of s] unfolding compact_eq_seq_compact_metric by auto |
|
3219 |
qed |
|
3220 |
||
33175 | 3221 |
lemma lim_subseq: |
3222 |
"subseq r \<Longrightarrow> (s ---> l) sequentially \<Longrightarrow> ((s o r) ---> l) sequentially" |
|
3223 |
unfolding tendsto_def eventually_sequentially o_def |
|
50937 | 3224 |
by (metis seq_suble le_trans) |
33175 | 3225 |
|
3226 |
lemma num_Axiom: "EX! g. g 0 = e \<and> (\<forall>n. g (Suc n) = f n (g n))" |
|
3227 |
unfolding Ex1_def |
|
3228 |
apply (rule_tac x="nat_rec e f" in exI) |
|
3229 |
apply (rule conjI)+ |
|
3230 |
apply (rule def_nat_rec_0, simp) |
|
3231 |
apply (rule allI, rule def_nat_rec_Suc, simp) |
|
3232 |
apply (rule allI, rule impI, rule ext) |
|
3233 |
apply (erule conjE) |
|
3234 |
apply (induct_tac x) |
|
36362
06475a1547cb
fix lots of looping simp calls and other warnings
huffman
parents:
36360
diff
changeset
|
3235 |
apply simp |
33175 | 3236 |
apply (erule_tac x="n" in allE) |
3237 |
apply (simp) |
|
3238 |
done |
|
3239 |
||
3240 |
lemma convergent_bounded_increasing: fixes s ::"nat\<Rightarrow>real" |
|
3241 |
assumes "incseq s" and "\<forall>n. abs(s n) \<le> b" |
|
3242 |
shows "\<exists> l. \<forall>e::real>0. \<exists> N. \<forall>n \<ge> N. abs(s n - l) < e" |
|
3243 |
proof- |
|
3244 |
have "isUb UNIV (range s) b" using assms(2) and abs_le_D1 unfolding isUb_def and setle_def by auto |
|
3245 |
then obtain t where t:"isLub UNIV (range s) t" using reals_complete[of "range s" ] by auto |
|
3246 |
{ fix e::real assume "e>0" and as:"\<forall>N. \<exists>n\<ge>N. \<not> \<bar>s n - t\<bar> < e" |
|
3247 |
{ fix n::nat |
|
3248 |
obtain N where "N\<ge>n" and n:"\<bar>s N - t\<bar> \<ge> e" using as[THEN spec[where x=n]] by auto |
|
3249 |
have "t \<ge> s N" using isLub_isUb[OF t, unfolded isUb_def setle_def] by auto |
|
3250 |
with n have "s N \<le> t - e" using `e>0` by auto |
|
3251 |
hence "s n \<le> t - e" using assms(1)[unfolded incseq_def, THEN spec[where x=n], THEN spec[where x=N]] using `n\<le>N` by auto } |
|
3252 |
hence "isUb UNIV (range s) (t - e)" unfolding isUb_def and setle_def by auto |
|
3253 |
hence False using isLub_le_isUb[OF t, of "t - e"] and `e>0` by auto } |
|
3254 |
thus ?thesis by blast |
|
3255 |
qed |
|
3256 |
||
3257 |
lemma convergent_bounded_monotone: fixes s::"nat \<Rightarrow> real" |
|
3258 |
assumes "\<forall>n. abs(s n) \<le> b" and "monoseq s" |
|
3259 |
shows "\<exists>l. \<forall>e::real>0. \<exists>N. \<forall>n\<ge>N. abs(s n - l) < e" |
|
3260 |
using convergent_bounded_increasing[of s b] assms using convergent_bounded_increasing[of "\<lambda>n. - s n" b] |
|
3261 |
unfolding monoseq_def incseq_def |
|
3262 |
apply auto unfolding minus_add_distrib[THEN sym, unfolded diff_minus[THEN sym]] |
|
3263 |
unfolding abs_minus_cancel by(rule_tac x="-l" in exI)auto |
|
3264 |
||
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
3265 |
(* TODO: merge this lemma with the ones above *) |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
3266 |
lemma bounded_increasing_convergent: fixes s::"nat \<Rightarrow> real" |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
3267 |
assumes "bounded {s n| n::nat. True}" "\<forall>n. (s n) \<le>(s(Suc n))" |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
3268 |
shows "\<exists>l. (s ---> l) sequentially" |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
3269 |
proof- |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
3270 |
obtain a where a:"\<forall>n. \<bar> (s n)\<bar> \<le> a" using assms(1)[unfolded bounded_iff] by auto |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
3271 |
{ fix m::nat |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
3272 |
have "\<And> n. n\<ge>m \<longrightarrow> (s m) \<le> (s n)" |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
3273 |
apply(induct_tac n) apply simp using assms(2) apply(erule_tac x="na" in allE) |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
3274 |
apply(case_tac "m \<le> na") unfolding not_less_eq_eq by(auto simp add: not_less_eq_eq) } |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
3275 |
hence "\<forall>m n. m \<le> n \<longrightarrow> (s m) \<le> (s n)" by auto |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
3276 |
then obtain l where "\<forall>e>0. \<exists>N. \<forall>n\<ge>N. \<bar> (s n) - l\<bar> < e" using convergent_bounded_monotone[OF a] |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
3277 |
unfolding monoseq_def by auto |
44907
93943da0a010
remove redundant lemma Lim_sequentially in favor of lemma LIMSEQ_def
huffman
parents:
44905
diff
changeset
|
3278 |
thus ?thesis unfolding LIMSEQ_def apply(rule_tac x="l" in exI) |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
3279 |
unfolding dist_norm by auto |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
3280 |
qed |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
3281 |
|
33175 | 3282 |
lemma compact_real_lemma: |
3283 |
assumes "\<forall>n::nat. abs(s n) \<le> b" |
|
3284 |
shows "\<exists>(l::real) r. subseq r \<and> ((s \<circ> r) ---> l) sequentially" |
|
3285 |
proof- |
|
3286 |
obtain r where r:"subseq r" "monoseq (\<lambda>n. s (r n))" |
|
3287 |
using seq_monosub[of s] by auto |
|
3288 |
thus ?thesis using convergent_bounded_monotone[of "\<lambda>n. s (r n)" b] and assms |
|
3289 |
unfolding tendsto_iff dist_norm eventually_sequentially by auto |
|
3290 |
qed |
|
3291 |
||
3292 |
instance real :: heine_borel |
|
3293 |
proof |
|
3294 |
fix s :: "real set" and f :: "nat \<Rightarrow> real" |
|
3295 |
assume s: "bounded s" and f: "\<forall>n. f n \<in> s" |
|
3296 |
then obtain b where b: "\<forall>n. abs (f n) \<le> b" |
|
3297 |
unfolding bounded_iff by auto |
|
3298 |
obtain l :: real and r :: "nat \<Rightarrow> nat" where |
|
3299 |
r: "subseq r" and l: "((f \<circ> r) ---> l) sequentially" |
|
3300 |
using compact_real_lemma [OF b] by auto |
|
3301 |
thus "\<exists>l r. subseq r \<and> ((f \<circ> r) ---> l) sequentially" |
|
3302 |
by auto |
|
3303 |
qed |
|
3304 |
||
3305 |
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
|
3306 |
fixes f :: "nat \<Rightarrow> 'a::euclidean_space" |
33175 | 3307 |
assumes "bounded s" and "\<forall>n. f n \<in> s" |
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
|
3308 |
shows "\<forall>d\<subseteq>Basis. \<exists>l::'a. \<exists> r. subseq r \<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
|
3309 |
(\<forall>e>0. eventually (\<lambda>n. \<forall>i\<in>d. dist (f (r n) \<bullet> i) (l \<bullet> i) < e) sequentially)" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
3310 |
proof safe |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
3311 |
fix d :: "'a set" assume d: "d \<subseteq> 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
|
3312 |
with finite_Basis have "finite d" by (blast intro: finite_subset) |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
3313 |
from this d show "\<exists>l::'a. \<exists>r. subseq r \<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
|
3314 |
(\<forall>e>0. eventually (\<lambda>n. \<forall>i\<in>d. dist (f (r n) \<bullet> i) (l \<bullet> i) < e) sequentially)" |
33175 | 3315 |
proof(induct d) case empty thus ?case unfolding subseq_def 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
|
3316 |
next case (insert k d) have k[intro]:"k\<in>Basis" using insert by auto |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
3317 |
have s': "bounded ((\<lambda>x. x \<bullet> k) ` s)" using `bounded s` |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
3318 |
by (auto intro!: bounded_linear_image bounded_linear_inner_left) |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
3319 |
obtain l1::"'a" and r1 where r1:"subseq r1" and |
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
|
3320 |
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
|
3321 |
using insert(3) using insert(4) 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
|
3322 |
have f': "\<forall>n. f (r1 n) \<bullet> k \<in> (\<lambda>x. x \<bullet> k) ` s" using `\<forall>n. f n \<in> s` by simp |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
3323 |
obtain l2 r2 where r2:"subseq r2" and lr2:"((\<lambda>i. f (r1 (r2 i)) \<bullet> k) ---> l2) sequentially" |
33175 | 3324 |
using bounded_imp_convergent_subsequence[OF s' f'] unfolding o_def by auto |
3325 |
def r \<equiv> "r1 \<circ> r2" have r:"subseq r" |
|
3326 |
using r1 and r2 unfolding r_def o_def subseq_def by auto |
|
3327 |
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
|
3328 |
def l \<equiv> "(\<Sum>i\<in>Basis. (if i = k then l2 else l1\<bullet>i) *\<^sub>R i)::'a" |
33175 | 3329 |
{ fix e::real assume "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
|
3330 |
from lr1 `e>0` have N1:"eventually (\<lambda>n. \<forall>i\<in>d. dist (f (r1 n) \<bullet> i) (l1 \<bullet> i) < e) sequentially" 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
|
3331 |
from lr2 `e>0` have N2:"eventually (\<lambda>n. dist (f (r1 (r2 n)) \<bullet> k) l2 < e) sequentially" by (rule tendstoD) |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
3332 |
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 | 3333 |
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
|
3334 |
have "eventually (\<lambda>n. \<forall>i\<in>(insert k d). dist (f (r n) \<bullet> i) (l \<bullet> i) < e) sequentially" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
3335 |
using N1' N2 |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
3336 |
by eventually_elim (insert insert.prems, auto simp: l_def r_def o_def) |
33175 | 3337 |
} |
3338 |
ultimately show ?case by auto |
|
3339 |
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
|
3340 |
qed |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
3341 |
|
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
3342 |
instance euclidean_space \<subseteq> heine_borel |
33175 | 3343 |
proof |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
3344 |
fix s :: "'a set" and f :: "nat \<Rightarrow> 'a" |
33175 | 3345 |
assume s: "bounded s" and f: "\<forall>n. f n \<in> s" |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
3346 |
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
|
3347 |
and l: "\<forall>e>0. eventually (\<lambda>n. \<forall>i\<in>Basis. dist (f (r n) \<bullet> i) (l \<bullet> i) < e) sequentially" |
33175 | 3348 |
using compact_lemma [OF s f] by blast |
3349 |
{ fix e::real assume "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
|
3350 |
hence "0 < e / real_of_nat DIM('a)" by (auto intro!: divide_pos_pos DIM_positive) |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
3351 |
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 | 3352 |
by simp |
3353 |
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
|
3354 |
{ fix n assume n: "\<forall>i\<in>Basis. dist (f (r n) \<bullet> i) (l \<bullet> i) < e / (real_of_nat DIM('a))" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
3355 |
have "dist (f (r n)) l \<le> (\<Sum>i\<in>Basis. dist (f (r n) \<bullet> i) (l \<bullet> i))" |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
3356 |
apply(subst euclidean_dist_l2) using zero_le_dist by (rule setL2_le_setsum) |
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
|
3357 |
also have "\<dots> < (\<Sum>i\<in>(Basis::'a set). e / (real_of_nat DIM('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
|
3358 |
apply(rule setsum_strict_mono) using n 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
|
3359 |
finally have "dist (f (r n)) l < e" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
3360 |
by auto |
33175 | 3361 |
} |
3362 |
ultimately have "eventually (\<lambda>n. dist (f (r n)) l < e) sequentially" |
|
3363 |
by (rule eventually_elim1) |
|
3364 |
} |
|
3365 |
hence *:"((f \<circ> r) ---> l) sequentially" unfolding o_def tendsto_iff by simp |
|
3366 |
with r show "\<exists>l r. subseq r \<and> ((f \<circ> r) ---> l) sequentially" by auto |
|
3367 |
qed |
|
3368 |
||
3369 |
lemma bounded_fst: "bounded s \<Longrightarrow> bounded (fst ` s)" |
|
3370 |
unfolding bounded_def |
|
3371 |
apply clarify |
|
3372 |
apply (rule_tac x="a" in exI) |
|
3373 |
apply (rule_tac x="e" in exI) |
|
3374 |
apply clarsimp |
|
3375 |
apply (drule (1) bspec) |
|
3376 |
apply (simp add: dist_Pair_Pair) |
|
3377 |
apply (erule order_trans [OF real_sqrt_sum_squares_ge1]) |
|
3378 |
done |
|
3379 |
||
3380 |
lemma bounded_snd: "bounded s \<Longrightarrow> bounded (snd ` s)" |
|
3381 |
unfolding bounded_def |
|
3382 |
apply clarify |
|
3383 |
apply (rule_tac x="b" in exI) |
|
3384 |
apply (rule_tac x="e" in exI) |
|
3385 |
apply clarsimp |
|
3386 |
apply (drule (1) bspec) |
|
3387 |
apply (simp add: dist_Pair_Pair) |
|
3388 |
apply (erule order_trans [OF real_sqrt_sum_squares_ge2]) |
|
3389 |
done |
|
3390 |
||
37678
0040bafffdef
"prod" and "sum" replace "*" and "+" respectively
haftmann
parents:
37649
diff
changeset
|
3391 |
instance prod :: (heine_borel, heine_borel) heine_borel |
33175 | 3392 |
proof |
3393 |
fix s :: "('a * 'b) set" and f :: "nat \<Rightarrow> 'a * 'b" |
|
3394 |
assume s: "bounded s" and f: "\<forall>n. f n \<in> s" |
|
3395 |
from s have s1: "bounded (fst ` s)" by (rule bounded_fst) |
|
3396 |
from f have f1: "\<forall>n. fst (f n) \<in> fst ` s" by simp |
|
3397 |
obtain l1 r1 where r1: "subseq r1" |
|
3398 |
and l1: "((\<lambda>n. fst (f (r1 n))) ---> l1) sequentially" |
|
3399 |
using bounded_imp_convergent_subsequence [OF s1 f1] |
|
3400 |
unfolding o_def by fast |
|
3401 |
from s have s2: "bounded (snd ` s)" by (rule bounded_snd) |
|
3402 |
from f have f2: "\<forall>n. snd (f (r1 n)) \<in> snd ` s" by simp |
|
3403 |
obtain l2 r2 where r2: "subseq r2" |
|
3404 |
and l2: "((\<lambda>n. snd (f (r1 (r2 n)))) ---> l2) sequentially" |
|
3405 |
using bounded_imp_convergent_subsequence [OF s2 f2] |
|
3406 |
unfolding o_def by fast |
|
3407 |
have l1': "((\<lambda>n. fst (f (r1 (r2 n)))) ---> l1) sequentially" |
|
3408 |
using lim_subseq [OF r2 l1] unfolding o_def . |
|
3409 |
have l: "((f \<circ> (r1 \<circ> r2)) ---> (l1, l2)) sequentially" |
|
3410 |
using tendsto_Pair [OF l1' l2] unfolding o_def by simp |
|
3411 |
have r: "subseq (r1 \<circ> r2)" |
|
3412 |
using r1 r2 unfolding subseq_def by simp |
|
3413 |
show "\<exists>l r. subseq r \<and> ((f \<circ> r) ---> l) sequentially" |
|
3414 |
using l r by fast |
|
3415 |
qed |
|
3416 |
||
36437 | 3417 |
subsubsection{* Completeness *} |
33175 | 3418 |
|
50971 | 3419 |
definition complete :: "'a::metric_space set \<Rightarrow> bool" where |
3420 |
"complete s \<longleftrightarrow> (\<forall>f. (\<forall>n. f n \<in> s) \<and> Cauchy f \<longrightarrow> (\<exists>l\<in>s. f ----> l))" |
|
3421 |
||
3422 |
lemma compact_imp_complete: assumes "compact s" shows "complete s" |
|
3423 |
proof- |
|
3424 |
{ fix f assume as: "(\<forall>n::nat. f n \<in> s)" "Cauchy f" |
|
3425 |
from as(1) obtain l r where lr: "l\<in>s" "subseq r" "(f \<circ> r) ----> l" |
|
3426 |
using assms unfolding compact_def by blast |
|
3427 |
||
3428 |
note lr' = seq_suble [OF lr(2)] |
|
3429 |
||
3430 |
{ fix e::real assume "e>0" |
|
3431 |
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" unfolding cauchy_def using `e>0` apply (erule_tac x="e/2" in allE) by auto |
|
3432 |
from lr(3)[unfolded LIMSEQ_def, THEN spec[where x="e/2"]] obtain M where M:"\<forall>n\<ge>M. dist ((f \<circ> r) n) l < e/2" using `e>0` by auto |
|
3433 |
{ fix n::nat assume n:"n \<ge> max N M" |
|
3434 |
have "dist ((f \<circ> r) n) l < e/2" using n M by auto |
|
3435 |
moreover have "r n \<ge> N" using lr'[of n] n by auto |
|
3436 |
hence "dist (f n) ((f \<circ> r) n) < e / 2" using N using n by auto |
|
3437 |
ultimately have "dist (f n) l < e" using dist_triangle_half_r[of "f (r n)" "f n" e l] by (auto simp add: dist_commute) } |
|
3438 |
hence "\<exists>N. \<forall>n\<ge>N. dist (f n) l < e" by blast } |
|
3439 |
hence "\<exists>l\<in>s. (f ---> l) sequentially" using `l\<in>s` unfolding LIMSEQ_def by auto } |
|
3440 |
thus ?thesis unfolding complete_def by auto |
|
3441 |
qed |
|
3442 |
||
3443 |
lemma nat_approx_posE: |
|
3444 |
fixes e::real |
|
3445 |
assumes "0 < e" |
|
3446 |
obtains n::nat where "1 / (Suc n) < e" |
|
3447 |
proof atomize_elim |
|
3448 |
have " 1 / real (Suc (nat (ceiling (1/e)))) < 1 / (ceiling (1/e))" |
|
3449 |
by (rule divide_strict_left_mono) (auto intro!: mult_pos_pos simp: `0 < e`) |
|
3450 |
also have "1 / (ceiling (1/e)) \<le> 1 / (1/e)" |
|
3451 |
by (rule divide_left_mono) (auto intro!: divide_pos_pos simp: `0 < e`) |
|
3452 |
also have "\<dots> = e" by simp |
|
3453 |
finally show "\<exists>n. 1 / real (Suc n) < e" .. |
|
3454 |
qed |
|
3455 |
||
3456 |
lemma compact_eq_totally_bounded: |
|
3457 |
"compact s \<longleftrightarrow> complete s \<and> (\<forall>e>0. \<exists>k. finite k \<and> s \<subseteq> (\<Union>((\<lambda>x. ball x e) ` k)))" |
|
3458 |
(is "_ \<longleftrightarrow> ?rhs") |
|
3459 |
proof |
|
3460 |
assume assms: "?rhs" |
|
3461 |
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)" |
|
3462 |
by (auto simp: choice_iff') |
|
3463 |
||
3464 |
show "compact s" |
|
3465 |
proof cases |
|
3466 |
assume "s = {}" thus "compact s" by (simp add: compact_def) |
|
3467 |
next |
|
3468 |
assume "s \<noteq> {}" |
|
3469 |
show ?thesis |
|
3470 |
unfolding compact_def |
|
3471 |
proof safe |
|
3472 |
fix f :: "nat \<Rightarrow> 'a" assume f: "\<forall>n. f n \<in> s" |
|
3473 |
||
3474 |
def e \<equiv> "\<lambda>n. 1 / (2 * Suc n)" |
|
3475 |
then have [simp]: "\<And>n. 0 < e n" by auto |
|
3476 |
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)" |
|
3477 |
{ fix n U assume "infinite {n. f n \<in> U}" |
|
3478 |
then have "\<exists>b\<in>k (e n). infinite {i\<in>{n. f n \<in> U}. f i \<in> ball b (e n)}" |
|
3479 |
using k f by (intro pigeonhole_infinite_rel) (auto simp: subset_eq) |
|
3480 |
then guess a .. |
|
3481 |
then have "\<exists>b. infinite {i. f i \<in> b} \<and> (\<exists>x. b \<subseteq> ball x (e n) \<inter> U)" |
|
3482 |
by (intro exI[of _ "ball a (e n) \<inter> U"] exI[of _ a]) (auto simp: ac_simps) |
|
3483 |
from someI_ex[OF this] |
|
3484 |
have "infinite {i. f i \<in> B n U}" "\<exists>x. B n U \<subseteq> ball x (e n) \<inter> U" |
|
3485 |
unfolding B_def by auto } |
|
3486 |
note B = this |
|
3487 |
||
3488 |
def F \<equiv> "nat_rec (B 0 UNIV) B" |
|
3489 |
{ fix n have "infinite {i. f i \<in> F n}" |
|
3490 |
by (induct n) (auto simp: F_def B) } |
|
3491 |
then have F: "\<And>n. \<exists>x. F (Suc n) \<subseteq> ball x (e n) \<inter> F n" |
|
3492 |
using B by (simp add: F_def) |
|
3493 |
then have F_dec: "\<And>m n. m \<le> n \<Longrightarrow> F n \<subseteq> F m" |
|
3494 |
using decseq_SucI[of F] by (auto simp: decseq_def) |
|
3495 |
||
3496 |
obtain sel where sel: "\<And>k i. i < sel k i" "\<And>k i. f (sel k i) \<in> F k" |
|
3497 |
proof (atomize_elim, unfold all_conj_distrib[symmetric], intro choice allI) |
|
3498 |
fix k i |
|
3499 |
have "infinite ({n. f n \<in> F k} - {.. i})" |
|
3500 |
using `infinite {n. f n \<in> F k}` by auto |
|
3501 |
from infinite_imp_nonempty[OF this] |
|
3502 |
show "\<exists>x>i. f x \<in> F k" |
|
3503 |
by (simp add: set_eq_iff not_le conj_commute) |
|
3504 |
qed |
|
3505 |
||
3506 |
def t \<equiv> "nat_rec (sel 0 0) (\<lambda>n i. sel (Suc n) i)" |
|
3507 |
have "subseq t" |
|
3508 |
unfolding subseq_Suc_iff by (simp add: t_def sel) |
|
3509 |
moreover have "\<forall>i. (f \<circ> t) i \<in> s" |
|
3510 |
using f by auto |
|
3511 |
moreover |
|
3512 |
{ fix n have "(f \<circ> t) n \<in> F n" |
|
3513 |
by (cases n) (simp_all add: t_def sel) } |
|
3514 |
note t = this |
|
3515 |
||
3516 |
have "Cauchy (f \<circ> t)" |
|
3517 |
proof (safe intro!: metric_CauchyI exI elim!: nat_approx_posE) |
|
3518 |
fix r :: real and N n m assume "1 / Suc N < r" "Suc N \<le> n" "Suc N \<le> m" |
|
3519 |
then have "(f \<circ> t) n \<in> F (Suc N)" "(f \<circ> t) m \<in> F (Suc N)" "2 * e N < r" |
|
3520 |
using F_dec t by (auto simp: e_def field_simps real_of_nat_Suc) |
|
3521 |
with F[of N] obtain x where "dist x ((f \<circ> t) n) < e N" "dist x ((f \<circ> t) m) < e N" |
|
3522 |
by (auto simp: subset_eq) |
|
3523 |
with dist_triangle[of "(f \<circ> t) m" "(f \<circ> t) n" x] `2 * e N < r` |
|
3524 |
show "dist ((f \<circ> t) m) ((f \<circ> t) n) < r" |
|
3525 |
by (simp add: dist_commute) |
|
3526 |
qed |
|
3527 |
||
3528 |
ultimately show "\<exists>l\<in>s. \<exists>r. subseq r \<and> (f \<circ> r) ----> l" |
|
3529 |
using assms unfolding complete_def by blast |
|
3530 |
qed |
|
3531 |
qed |
|
3532 |
qed (metis compact_imp_complete compact_imp_seq_compact seq_compact_imp_totally_bounded) |
|
33175 | 3533 |
|
3534 |
lemma cauchy: "Cauchy s \<longleftrightarrow> (\<forall>e>0.\<exists> N::nat. \<forall>n\<ge>N. dist(s n)(s N) < e)" (is "?lhs = ?rhs") |
|
3535 |
proof- |
|
3536 |
{ assume ?rhs |
|
3537 |
{ fix e::real |
|
3538 |
assume "e>0" |
|
3539 |
with `?rhs` obtain N where N:"\<forall>n\<ge>N. dist (s n) (s N) < e/2" |
|
3540 |
by (erule_tac x="e/2" in allE) auto |
|
3541 |
{ fix n m |
|
3542 |
assume nm:"N \<le> m \<and> N \<le> n" |
|
3543 |
hence "dist (s m) (s n) < e" using N |
|
3544 |
using dist_triangle_half_l[of "s m" "s N" "e" "s n"] |
|
3545 |
by blast |
|
3546 |
} |
|
3547 |
hence "\<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (s m) (s n) < e" |
|
3548 |
by blast |
|
3549 |
} |
|
3550 |
hence ?lhs |
|
3551 |
unfolding cauchy_def |
|
3552 |
by blast |
|
3553 |
} |
|
3554 |
thus ?thesis |
|
3555 |
unfolding cauchy_def |
|
3556 |
using dist_triangle_half_l |
|
3557 |
by blast |
|
3558 |
qed |
|
3559 |
||
34104 | 3560 |
lemma cauchy_imp_bounded: assumes "Cauchy s" shows "bounded (range s)" |
33175 | 3561 |
proof- |
3562 |
from assms obtain N::nat where "\<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (s m) (s n) < 1" unfolding cauchy_def apply(erule_tac x= 1 in allE) by auto |
|
3563 |
hence N:"\<forall>n. N \<le> n \<longrightarrow> dist (s N) (s n) < 1" by auto |
|
3564 |
moreover |
|
3565 |
have "bounded (s ` {0..N})" using finite_imp_bounded[of "s ` {1..N}"] by auto |
|
3566 |
then obtain a where a:"\<forall>x\<in>s ` {0..N}. dist (s N) x \<le> a" |
|
3567 |
unfolding bounded_any_center [where a="s N"] by auto |
|
3568 |
ultimately show "?thesis" |
|
3569 |
unfolding bounded_any_center [where a="s N"] |
|
3570 |
apply(rule_tac x="max a 1" in exI) apply auto |
|
34104 | 3571 |
apply(erule_tac x=y in allE) apply(erule_tac x=y in ballE) by auto |
33175 | 3572 |
qed |
3573 |
||
3574 |
instance heine_borel < complete_space |
|
3575 |
proof |
|
3576 |
fix f :: "nat \<Rightarrow> 'a" assume "Cauchy f" |
|
34104 | 3577 |
hence "bounded (range f)" |
3578 |
by (rule cauchy_imp_bounded) |
|
50971 | 3579 |
hence "compact (closure (range f))" |
3580 |
unfolding compact_eq_bounded_closed by auto |
|
33175 | 3581 |
hence "complete (closure (range f))" |
50971 | 3582 |
by (rule compact_imp_complete) |
33175 | 3583 |
moreover have "\<forall>n. f n \<in> closure (range f)" |
3584 |
using closure_subset [of "range f"] by auto |
|
3585 |
ultimately have "\<exists>l\<in>closure (range f). (f ---> l) sequentially" |
|
3586 |
using `Cauchy f` unfolding complete_def by auto |
|
3587 |
then show "convergent f" |
|
36660
1cc4ab4b7ff7
make (X ----> L) an abbreviation for (X ---> L) sequentially
huffman
parents:
36659
diff
changeset
|
3588 |
unfolding convergent_def by auto |
33175 | 3589 |
qed |
3590 |
||
44632 | 3591 |
instance euclidean_space \<subseteq> banach .. |
3592 |
||
33175 | 3593 |
lemma complete_univ: "complete (UNIV :: 'a::complete_space set)" |
3594 |
proof(simp add: complete_def, rule, rule) |
|
3595 |
fix f :: "nat \<Rightarrow> 'a" assume "Cauchy f" |
|
3596 |
hence "convergent f" by (rule Cauchy_convergent) |
|
36660
1cc4ab4b7ff7
make (X ----> L) an abbreviation for (X ---> L) sequentially
huffman
parents:
36659
diff
changeset
|
3597 |
thus "\<exists>l. f ----> l" unfolding convergent_def . |
33175 | 3598 |
qed |
3599 |
||
3600 |
lemma complete_imp_closed: assumes "complete s" shows "closed s" |
|
3601 |
proof - |
|
3602 |
{ fix x assume "x islimpt s" |
|
3603 |
then obtain f where f: "\<forall>n. f n \<in> s - {x}" "(f ---> x) sequentially" |
|
3604 |
unfolding islimpt_sequential by auto |
|
3605 |
then obtain l where l: "l\<in>s" "(f ---> l) sequentially" |
|
50939
ae7cd20ed118
replace convergent_imp_cauchy by LIMSEQ_imp_Cauchy
hoelzl
parents:
50938
diff
changeset
|
3606 |
using `complete s`[unfolded complete_def] using LIMSEQ_imp_Cauchy[of f x] by auto |
41970 | 3607 |
hence "x \<in> s" using tendsto_unique[of sequentially f l x] trivial_limit_sequentially f(2) by auto |
33175 | 3608 |
} |
3609 |
thus "closed s" unfolding closed_limpt by auto |
|
3610 |
qed |
|
3611 |
||
3612 |
lemma complete_eq_closed: |
|
3613 |
fixes s :: "'a::complete_space set" |
|
3614 |
shows "complete s \<longleftrightarrow> closed s" (is "?lhs = ?rhs") |
|
3615 |
proof |
|
3616 |
assume ?lhs thus ?rhs by (rule complete_imp_closed) |
|
3617 |
next |
|
3618 |
assume ?rhs |
|
3619 |
{ fix f assume as:"\<forall>n::nat. f n \<in> s" "Cauchy f" |
|
3620 |
then obtain l where "(f ---> l) sequentially" using complete_univ[unfolded complete_def, THEN spec[where x=f]] by auto |
|
3621 |
hence "\<exists>l\<in>s. (f ---> l) sequentially" using `?rhs`[unfolded closed_sequential_limits, THEN spec[where x=f], THEN spec[where x=l]] using as(1) by auto } |
|
3622 |
thus ?lhs unfolding complete_def by auto |
|
3623 |
qed |
|
3624 |
||
3625 |
lemma convergent_eq_cauchy: |
|
3626 |
fixes s :: "nat \<Rightarrow> 'a::complete_space" |
|
44632 | 3627 |
shows "(\<exists>l. (s ---> l) sequentially) \<longleftrightarrow> Cauchy s" |
3628 |
unfolding Cauchy_convergent_iff convergent_def .. |
|
33175 | 3629 |
|
3630 |
lemma convergent_imp_bounded: |
|
3631 |
fixes s :: "nat \<Rightarrow> 'a::metric_space" |
|
44632 | 3632 |
shows "(s ---> l) sequentially \<Longrightarrow> bounded (range s)" |
50939
ae7cd20ed118
replace convergent_imp_cauchy by LIMSEQ_imp_Cauchy
hoelzl
parents:
50938
diff
changeset
|
3633 |
by (intro cauchy_imp_bounded LIMSEQ_imp_Cauchy) |
33175 | 3634 |
|
3635 |
lemma compact_cball[simp]: |
|
3636 |
fixes x :: "'a::heine_borel" |
|
3637 |
shows "compact(cball x e)" |
|
3638 |
using compact_eq_bounded_closed bounded_cball closed_cball |
|
3639 |
by blast |
|
3640 |
||
3641 |
lemma compact_frontier_bounded[intro]: |
|
3642 |
fixes s :: "'a::heine_borel set" |
|
3643 |
shows "bounded s ==> compact(frontier s)" |
|
3644 |
unfolding frontier_def |
|
3645 |
using compact_eq_bounded_closed |
|
3646 |
by blast |
|
3647 |
||
3648 |
lemma compact_frontier[intro]: |
|
3649 |
fixes s :: "'a::heine_borel set" |
|
3650 |
shows "compact s ==> compact (frontier s)" |
|
3651 |
using compact_eq_bounded_closed compact_frontier_bounded |
|
3652 |
by blast |
|
3653 |
||
3654 |
lemma frontier_subset_compact: |
|
3655 |
fixes s :: "'a::heine_borel set" |
|
3656 |
shows "compact s ==> frontier s \<subseteq> s" |
|
3657 |
using frontier_subset_closed compact_eq_bounded_closed |
|
3658 |
by blast |
|
3659 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
3660 |
subsection {* Bounded closed nest property (proof does not use Heine-Borel) *} |
33175 | 3661 |
|
3662 |
lemma bounded_closed_nest: |
|
3663 |
assumes "\<forall>n. closed(s n)" "\<forall>n. (s n \<noteq> {})" |
|
3664 |
"(\<forall>m n. m \<le> n --> s n \<subseteq> s m)" "bounded(s 0)" |
|
3665 |
shows "\<exists>a::'a::heine_borel. \<forall>n::nat. a \<in> s(n)" |
|
3666 |
proof- |
|
3667 |
from assms(2) obtain x where x:"\<forall>n::nat. x n \<in> s n" using choice[of "\<lambda>n x. x\<in> s n"] by auto |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3668 |
from assms(4,1) have *:"seq_compact (s 0)" using bounded_closed_imp_seq_compact[of "s 0"] by auto |
33175 | 3669 |
|
3670 |
then obtain l r where lr:"l\<in>s 0" "subseq r" "((x \<circ> r) ---> l) sequentially" |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3671 |
unfolding seq_compact_def apply(erule_tac x=x in allE) using x using assms(3) by blast |
33175 | 3672 |
|
3673 |
{ fix n::nat |
|
3674 |
{ fix e::real assume "e>0" |
|
44907
93943da0a010
remove redundant lemma Lim_sequentially in favor of lemma LIMSEQ_def
huffman
parents:
44905
diff
changeset
|
3675 |
with lr(3) obtain N where N:"\<forall>m\<ge>N. dist ((x \<circ> r) m) l < e" unfolding LIMSEQ_def by auto |
33175 | 3676 |
hence "dist ((x \<circ> r) (max N n)) l < e" by auto |
3677 |
moreover |
|
50937 | 3678 |
have "r (max N n) \<ge> n" using lr(2) using seq_suble[of r "max N n"] by auto |
33175 | 3679 |
hence "(x \<circ> r) (max N n) \<in> s n" |
3680 |
using x apply(erule_tac x=n in allE) |
|
3681 |
using x apply(erule_tac x="r (max N n)" in allE) |
|
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
3682 |
using assms(3) apply(erule_tac x=n in allE) apply(erule_tac x="r (max N n)" in allE) by auto |
33175 | 3683 |
ultimately have "\<exists>y\<in>s n. dist y l < e" by auto |
3684 |
} |
|
3685 |
hence "l \<in> s n" using closed_approachable[of "s n" l] assms(1) by blast |
|
3686 |
} |
|
3687 |
thus ?thesis by auto |
|
3688 |
qed |
|
3689 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
3690 |
text {* Decreasing case does not even need compactness, just completeness. *} |
33175 | 3691 |
|
3692 |
lemma decreasing_closed_nest: |
|
3693 |
assumes "\<forall>n. closed(s n)" |
|
3694 |
"\<forall>n. (s n \<noteq> {})" |
|
3695 |
"\<forall>m n. m \<le> n --> s n \<subseteq> s m" |
|
3696 |
"\<forall>e>0. \<exists>n. \<forall>x \<in> (s n). \<forall> y \<in> (s n). dist x y < e" |
|
44632 | 3697 |
shows "\<exists>a::'a::complete_space. \<forall>n::nat. a \<in> s n" |
33175 | 3698 |
proof- |
3699 |
have "\<forall>n. \<exists> x. x\<in>s n" using assms(2) by auto |
|
3700 |
hence "\<exists>t. \<forall>n. t n \<in> s n" using choice[of "\<lambda> n x. x \<in> s n"] by auto |
|
3701 |
then obtain t where t: "\<forall>n. t n \<in> s n" by auto |
|
3702 |
{ fix e::real assume "e>0" |
|
3703 |
then obtain N where N:"\<forall>x\<in>s N. \<forall>y\<in>s N. dist x y < e" using assms(4) by auto |
|
3704 |
{ fix m n ::nat assume "N \<le> m \<and> N \<le> n" |
|
3705 |
hence "t m \<in> s N" "t n \<in> s N" using assms(3) t unfolding subset_eq t by blast+ |
|
3706 |
hence "dist (t m) (t n) < e" using N by auto |
|
3707 |
} |
|
3708 |
hence "\<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (t m) (t n) < e" by auto |
|
3709 |
} |
|
3710 |
hence "Cauchy t" unfolding cauchy_def by auto |
|
3711 |
then obtain l where l:"(t ---> l) sequentially" using complete_univ unfolding complete_def by auto |
|
3712 |
{ fix n::nat |
|
3713 |
{ fix e::real assume "e>0" |
|
44907
93943da0a010
remove redundant lemma Lim_sequentially in favor of lemma LIMSEQ_def
huffman
parents:
44905
diff
changeset
|
3714 |
then obtain N::nat where N:"\<forall>n\<ge>N. dist (t n) l < e" using l[unfolded LIMSEQ_def] by auto |
33175 | 3715 |
have "t (max n N) \<in> s n" using assms(3) unfolding subset_eq apply(erule_tac x=n in allE) apply (erule_tac x="max n N" in allE) using t by auto |
3716 |
hence "\<exists>y\<in>s n. dist y l < e" apply(rule_tac x="t (max n N)" in bexI) using N by auto |
|
3717 |
} |
|
3718 |
hence "l \<in> s n" using closed_approachable[of "s n" l] assms(1) by auto |
|
3719 |
} |
|
3720 |
then show ?thesis by auto |
|
3721 |
qed |
|
3722 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
3723 |
text {* Strengthen it to the intersection actually being a singleton. *} |
33175 | 3724 |
|
3725 |
lemma decreasing_closed_nest_sing: |
|
44632 | 3726 |
fixes s :: "nat \<Rightarrow> 'a::complete_space set" |
33175 | 3727 |
assumes "\<forall>n. closed(s n)" |
3728 |
"\<forall>n. s n \<noteq> {}" |
|
3729 |
"\<forall>m n. m \<le> n --> s n \<subseteq> s m" |
|
3730 |
"\<forall>e>0. \<exists>n. \<forall>x \<in> (s n). \<forall> y\<in>(s n). dist x y < e" |
|
34104 | 3731 |
shows "\<exists>a. \<Inter>(range s) = {a}" |
33175 | 3732 |
proof- |
3733 |
obtain a where a:"\<forall>n. a \<in> s n" using decreasing_closed_nest[of s] using assms by auto |
|
34104 | 3734 |
{ fix b assume b:"b \<in> \<Inter>(range s)" |
33175 | 3735 |
{ fix e::real assume "e>0" |
3736 |
hence "dist a b < e" using assms(4 )using b using a by blast |
|
3737 |
} |
|
36778
739a9379e29b
avoid using real-specific versions of generic lemmas
huffman
parents:
36669
diff
changeset
|
3738 |
hence "dist a b = 0" by (metis dist_eq_0_iff dist_nz less_le) |
33175 | 3739 |
} |
34104 | 3740 |
with a have "\<Inter>(range s) = {a}" unfolding image_def by auto |
3741 |
thus ?thesis .. |
|
33175 | 3742 |
qed |
3743 |
||
3744 |
text{* Cauchy-type criteria for uniform convergence. *} |
|
3745 |
||
3746 |
lemma uniformly_convergent_eq_cauchy: fixes s::"nat \<Rightarrow> 'b \<Rightarrow> 'a::heine_borel" shows |
|
3747 |
"(\<exists>l. \<forall>e>0. \<exists>N. \<forall>n x. N \<le> n \<and> P x --> dist(s n x)(l x) < e) \<longleftrightarrow> |
|
3748 |
(\<forall>e>0. \<exists>N. \<forall>m n x. N \<le> m \<and> N \<le> n \<and> P x --> dist (s m x) (s n x) < e)" (is "?lhs = ?rhs") |
|
3749 |
proof(rule) |
|
3750 |
assume ?lhs |
|
3751 |
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" by auto |
|
3752 |
{ fix e::real assume "e>0" |
|
3753 |
then obtain N::nat where N:"\<forall>n x. N \<le> n \<and> P x \<longrightarrow> dist (s n x) (l x) < e / 2" using l[THEN spec[where x="e/2"]] by auto |
|
3754 |
{ fix n m::nat and x::"'b" assume "N \<le> m \<and> N \<le> n \<and> P x" |
|
3755 |
hence "dist (s m x) (s n x) < e" |
|
3756 |
using N[THEN spec[where x=m], THEN spec[where x=x]] |
|
3757 |
using N[THEN spec[where x=n], THEN spec[where x=x]] |
|
3758 |
using dist_triangle_half_l[of "s m x" "l x" e "s n x"] by auto } |
|
3759 |
hence "\<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 } |
|
3760 |
thus ?rhs by auto |
|
3761 |
next |
|
3762 |
assume ?rhs |
|
3763 |
hence "\<forall>x. P x \<longrightarrow> Cauchy (\<lambda>n. s n x)" unfolding cauchy_def apply auto by (erule_tac x=e in allE)auto |
|
3764 |
then obtain l where l:"\<forall>x. P x \<longrightarrow> ((\<lambda>n. s n x) ---> l x) sequentially" unfolding convergent_eq_cauchy[THEN sym] |
|
3765 |
using choice[of "\<lambda>x l. P x \<longrightarrow> ((\<lambda>n. s n x) ---> l) sequentially"] by auto |
|
3766 |
{ fix e::real assume "e>0" |
|
3767 |
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" |
|
3768 |
using `?rhs`[THEN spec[where x="e/2"]] by auto |
|
3769 |
{ fix x assume "P x" |
|
3770 |
then obtain M where M:"\<forall>n\<ge>M. dist (s n x) (l x) < e/2" |
|
44907
93943da0a010
remove redundant lemma Lim_sequentially in favor of lemma LIMSEQ_def
huffman
parents:
44905
diff
changeset
|
3771 |
using l[THEN spec[where x=x], unfolded LIMSEQ_def] using `e>0` by(auto elim!: allE[where x="e/2"]) |
33175 | 3772 |
fix n::nat assume "n\<ge>N" |
3773 |
hence "dist(s n x)(l x) < e" using `P x`and N[THEN spec[where x=n], THEN spec[where x="N+M"], THEN spec[where x=x]] |
|
3774 |
using M[THEN spec[where x="N+M"]] and dist_triangle_half_l[of "s n x" "s (N+M) x" e "l x"] by (auto simp add: dist_commute) } |
|
3775 |
hence "\<exists>N. \<forall>n x. N \<le> n \<and> P x \<longrightarrow> dist(s n x)(l x) < e" by auto } |
|
3776 |
thus ?lhs by auto |
|
3777 |
qed |
|
3778 |
||
3779 |
lemma uniformly_cauchy_imp_uniformly_convergent: |
|
3780 |
fixes s :: "nat \<Rightarrow> 'a \<Rightarrow> 'b::heine_borel" |
|
3781 |
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" |
|
3782 |
"\<forall>x. P x --> (\<forall>e>0. \<exists>N. \<forall>n. N \<le> n --> dist(s n x)(l x) < e)" |
|
3783 |
shows "\<forall>e>0. \<exists>N. \<forall>n x. N \<le> n \<and> P x --> dist(s n x)(l x) < e" |
|
3784 |
proof- |
|
3785 |
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" |
|
3786 |
using assms(1) unfolding uniformly_convergent_eq_cauchy[THEN sym] by auto |
|
3787 |
moreover |
|
3788 |
{ fix x assume "P x" |
|
41970 | 3789 |
hence "l x = l' x" using tendsto_unique[OF trivial_limit_sequentially, of "\<lambda>n. s n x" "l x" "l' x"] |
44907
93943da0a010
remove redundant lemma Lim_sequentially in favor of lemma LIMSEQ_def
huffman
parents:
44905
diff
changeset
|
3790 |
using l and assms(2) unfolding LIMSEQ_def by blast } |
33175 | 3791 |
ultimately show ?thesis by auto |
3792 |
qed |
|
3793 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
3794 |
|
36437 | 3795 |
subsection {* Continuity *} |
3796 |
||
3797 |
text {* Define continuity over a net to take in restrictions of the set. *} |
|
33175 | 3798 |
|
3799 |
definition |
|
44081
730f7cced3a6
rename type 'a net to 'a filter, following standard mathematical terminology
huffman
parents:
44076
diff
changeset
|
3800 |
continuous :: "'a::t2_space filter \<Rightarrow> ('a \<Rightarrow> 'b::topological_space) \<Rightarrow> bool" |
730f7cced3a6
rename type 'a net to 'a filter, following standard mathematical terminology
huffman
parents:
44076
diff
changeset
|
3801 |
where "continuous net f \<longleftrightarrow> (f ---> f(netlimit net)) net" |
33175 | 3802 |
|
3803 |
lemma continuous_trivial_limit: |
|
3804 |
"trivial_limit net ==> continuous net f" |
|
3805 |
unfolding continuous_def tendsto_def trivial_limit_eq by auto |
|
3806 |
||
3807 |
lemma continuous_within: "continuous (at x within s) f \<longleftrightarrow> (f ---> f(x)) (at x within s)" |
|
3808 |
unfolding continuous_def |
|
3809 |
unfolding tendsto_def |
|
3810 |
using netlimit_within[of x s] |
|
3811 |
by (cases "trivial_limit (at x within s)") (auto simp add: trivial_limit_eventually) |
|
3812 |
||
3813 |
lemma continuous_at: "continuous (at x) f \<longleftrightarrow> (f ---> f(x)) (at x)" |
|
45031 | 3814 |
using continuous_within [of x UNIV f] by simp |
33175 | 3815 |
|
3816 |
lemma continuous_at_within: |
|
3817 |
assumes "continuous (at x) f" shows "continuous (at x within s) f" |
|
3818 |
using assms unfolding continuous_at continuous_within |
|
3819 |
by (rule Lim_at_within) |
|
3820 |
||
3821 |
text{* Derive the epsilon-delta forms, which we often use as "definitions" *} |
|
3822 |
||
3823 |
lemma continuous_within_eps_delta: |
|
3824 |
"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)" |
|
3825 |
unfolding continuous_within and Lim_within |
|
44584 | 3826 |
apply auto unfolding dist_nz[THEN sym] apply(auto del: allE elim!:allE) apply(rule_tac x=d in exI) by auto |
33175 | 3827 |
|
3828 |
lemma continuous_at_eps_delta: "continuous (at x) f \<longleftrightarrow> (\<forall>e>0. \<exists>d>0. |
|
3829 |
\<forall>x'. dist x' x < d --> dist(f x')(f x) < e)" |
|
45031 | 3830 |
using continuous_within_eps_delta [of x UNIV f] by simp |
33175 | 3831 |
|
3832 |
text{* Versions in terms of open balls. *} |
|
3833 |
||
3834 |
lemma continuous_within_ball: |
|
3835 |
"continuous (at x within s) f \<longleftrightarrow> (\<forall>e>0. \<exists>d>0. |
|
3836 |
f ` (ball x d \<inter> s) \<subseteq> ball (f x) e)" (is "?lhs = ?rhs") |
|
3837 |
proof |
|
3838 |
assume ?lhs |
|
3839 |
{ fix e::real assume "e>0" |
|
3840 |
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" |
|
3841 |
using `?lhs`[unfolded continuous_within Lim_within] by auto |
|
3842 |
{ fix y assume "y\<in>f ` (ball x d \<inter> s)" |
|
3843 |
hence "y \<in> ball (f x) e" using d(2) unfolding dist_nz[THEN sym] |
|
36362
06475a1547cb
fix lots of looping simp calls and other warnings
huffman
parents:
36360
diff
changeset
|
3844 |
apply (auto simp add: dist_commute) apply(erule_tac x=xa in ballE) apply auto using `e>0` by auto |
33175 | 3845 |
} |
3846 |
hence "\<exists>d>0. f ` (ball x d \<inter> s) \<subseteq> ball (f x) e" using `d>0` unfolding subset_eq ball_def by (auto simp add: dist_commute) } |
|
3847 |
thus ?rhs by auto |
|
3848 |
next |
|
3849 |
assume ?rhs thus ?lhs unfolding continuous_within Lim_within ball_def subset_eq |
|
3850 |
apply (auto simp add: dist_commute) apply(erule_tac x=e in allE) by auto |
|
3851 |
qed |
|
3852 |
||
3853 |
lemma continuous_at_ball: |
|
3854 |
"continuous (at x) f \<longleftrightarrow> (\<forall>e>0. \<exists>d>0. f ` (ball x d) \<subseteq> ball (f x) e)" (is "?lhs = ?rhs") |
|
3855 |
proof |
|
3856 |
assume ?lhs thus ?rhs unfolding continuous_at Lim_at subset_eq Ball_def Bex_def image_iff mem_ball |
|
3857 |
apply auto apply(erule_tac x=e in allE) apply auto apply(rule_tac x=d in exI) apply auto apply(erule_tac x=xa in allE) apply (auto simp add: dist_commute dist_nz) |
|
3858 |
unfolding dist_nz[THEN sym] by auto |
|
3859 |
next |
|
3860 |
assume ?rhs thus ?lhs unfolding continuous_at Lim_at subset_eq Ball_def Bex_def image_iff mem_ball |
|
3861 |
apply auto apply(erule_tac x=e in allE) apply auto apply(rule_tac x=d in exI) apply auto apply(erule_tac x="f xa" in allE) by (auto simp add: dist_commute dist_nz) |
|
3862 |
qed |
|
3863 |
||
36440
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3864 |
text{* Define setwise continuity in terms of limits within the set. *} |
33175 | 3865 |
|
3866 |
definition |
|
36359 | 3867 |
continuous_on :: |
3868 |
"'a set \<Rightarrow> ('a::topological_space \<Rightarrow> 'b::topological_space) \<Rightarrow> bool" |
|
3869 |
where |
|
36440
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3870 |
"continuous_on s f \<longleftrightarrow> (\<forall>x\<in>s. (f ---> f x) (at x within s))" |
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3871 |
|
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3872 |
lemma continuous_on_topological: |
36359 | 3873 |
"continuous_on s f \<longleftrightarrow> |
3874 |
(\<forall>x\<in>s. \<forall>B. open B \<longrightarrow> f x \<in> B \<longrightarrow> |
|
36440
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3875 |
(\<exists>A. open A \<and> x \<in> A \<and> (\<forall>y\<in>s. y \<in> A \<longrightarrow> f y \<in> B)))" |
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3876 |
unfolding continuous_on_def tendsto_def |
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3877 |
unfolding Limits.eventually_within eventually_at_topological |
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3878 |
by (intro ball_cong [OF refl] all_cong imp_cong ex_cong conj_cong refl) auto |
36359 | 3879 |
|
3880 |
lemma continuous_on_iff: |
|
3881 |
"continuous_on s f \<longleftrightarrow> |
|
36440
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3882 |
(\<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)" |
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3883 |
unfolding continuous_on_def Lim_within |
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3884 |
apply (intro ball_cong [OF refl] all_cong ex_cong) |
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3885 |
apply (rename_tac y, case_tac "y = x", simp) |
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3886 |
apply (simp add: dist_nz) |
36359 | 3887 |
done |
33175 | 3888 |
|
3889 |
definition |
|
3890 |
uniformly_continuous_on :: |
|
36440
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3891 |
"'a set \<Rightarrow> ('a::metric_space \<Rightarrow> 'b::metric_space) \<Rightarrow> bool" |
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3892 |
where |
33175 | 3893 |
"uniformly_continuous_on s f \<longleftrightarrow> |
36440
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3894 |
(\<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
|
3895 |
|
33175 | 3896 |
text{* Some simple consequential lemmas. *} |
3897 |
||
3898 |
lemma uniformly_continuous_imp_continuous: |
|
3899 |
" uniformly_continuous_on s f ==> continuous_on s f" |
|
36359 | 3900 |
unfolding uniformly_continuous_on_def continuous_on_iff by blast |
33175 | 3901 |
|
3902 |
lemma continuous_at_imp_continuous_within: |
|
3903 |
"continuous (at x) f ==> continuous (at x within s) f" |
|
3904 |
unfolding continuous_within continuous_at using Lim_at_within by auto |
|
3905 |
||
36440
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3906 |
lemma Lim_trivial_limit: "trivial_limit net \<Longrightarrow> (f ---> l) net" |
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3907 |
unfolding tendsto_def by (simp add: trivial_limit_eq) |
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3908 |
|
36359 | 3909 |
lemma continuous_at_imp_continuous_on: |
36440
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3910 |
assumes "\<forall>x\<in>s. continuous (at x) f" |
33175 | 3911 |
shows "continuous_on s f" |
36440
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3912 |
unfolding continuous_on_def |
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3913 |
proof |
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3914 |
fix x assume "x \<in> s" |
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3915 |
with assms have *: "(f ---> f (netlimit (at x))) (at x)" |
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3916 |
unfolding continuous_def by simp |
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3917 |
have "(f ---> f x) (at x)" |
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3918 |
proof (cases "trivial_limit (at x)") |
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3919 |
case True thus ?thesis |
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3920 |
by (rule Lim_trivial_limit) |
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3921 |
next |
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3922 |
case False |
36667 | 3923 |
hence 1: "netlimit (at x) = x" |
45031 | 3924 |
using netlimit_within [of x UNIV] by simp |
36440
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3925 |
with * show ?thesis by simp |
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3926 |
qed |
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3927 |
thus "(f ---> f x) (at x within s)" |
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3928 |
by (rule Lim_at_within) |
33175 | 3929 |
qed |
3930 |
||
3931 |
lemma continuous_on_eq_continuous_within: |
|
36440
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3932 |
"continuous_on s f \<longleftrightarrow> (\<forall>x \<in> s. continuous (at x within s) f)" |
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3933 |
unfolding continuous_on_def continuous_def |
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3934 |
apply (rule ball_cong [OF refl]) |
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3935 |
apply (case_tac "trivial_limit (at x within s)") |
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3936 |
apply (simp add: Lim_trivial_limit) |
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3937 |
apply (simp add: netlimit_within) |
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3938 |
done |
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3939 |
|
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3940 |
lemmas continuous_on = continuous_on_def -- "legacy theorem name" |
33175 | 3941 |
|
3942 |
lemma continuous_on_eq_continuous_at: |
|
36359 | 3943 |
shows "open s ==> (continuous_on s f \<longleftrightarrow> (\<forall>x \<in> s. continuous (at x) f))" |
33175 | 3944 |
by (auto simp add: continuous_on continuous_at Lim_within_open) |
3945 |
||
3946 |
lemma continuous_within_subset: |
|
3947 |
"continuous (at x within s) f \<Longrightarrow> t \<subseteq> s |
|
3948 |
==> continuous (at x within t) f" |
|
3949 |
unfolding continuous_within by(metis Lim_within_subset) |
|
3950 |
||
3951 |
lemma continuous_on_subset: |
|
36359 | 3952 |
shows "continuous_on s f \<Longrightarrow> t \<subseteq> s ==> continuous_on t f" |
33175 | 3953 |
unfolding continuous_on by (metis subset_eq Lim_within_subset) |
3954 |
||
3955 |
lemma continuous_on_interior: |
|
44519 | 3956 |
shows "continuous_on s f \<Longrightarrow> x \<in> interior s \<Longrightarrow> continuous (at x) f" |
3957 |
by (erule interiorE, drule (1) continuous_on_subset, |
|
3958 |
simp add: continuous_on_eq_continuous_at) |
|
33175 | 3959 |
|
3960 |
lemma continuous_on_eq: |
|
36440
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3961 |
"(\<forall>x \<in> s. f x = g x) \<Longrightarrow> continuous_on s f \<Longrightarrow> continuous_on s g" |
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3962 |
unfolding continuous_on_def tendsto_def Limits.eventually_within |
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
3963 |
by simp |
33175 | 3964 |
|
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
3965 |
text {* Characterization of various kinds of continuity in terms of sequences. *} |
33175 | 3966 |
|
3967 |
lemma continuous_within_sequentially: |
|
44533
7abe4a59f75d
generalize and simplify proof of continuous_within_sequentially
huffman
parents:
44531
diff
changeset
|
3968 |
fixes f :: "'a::metric_space \<Rightarrow> 'b::topological_space" |
33175 | 3969 |
shows "continuous (at a within s) f \<longleftrightarrow> |
3970 |
(\<forall>x. (\<forall>n::nat. x n \<in> s) \<and> (x ---> a) sequentially |
|
3971 |
--> ((f o x) ---> f a) sequentially)" (is "?lhs = ?rhs") |
|
3972 |
proof |
|
3973 |
assume ?lhs |
|
44533
7abe4a59f75d
generalize and simplify proof of continuous_within_sequentially
huffman
parents:
44531
diff
changeset
|
3974 |
{ fix x::"nat \<Rightarrow> 'a" assume x:"\<forall>n. x n \<in> s" "\<forall>e>0. eventually (\<lambda>n. dist (x n) a < e) sequentially" |
7abe4a59f75d
generalize and simplify proof of continuous_within_sequentially
huffman
parents:
44531
diff
changeset
|
3975 |
fix T::"'b set" assume "open T" and "f a \<in> T" |
7abe4a59f75d
generalize and simplify proof of continuous_within_sequentially
huffman
parents:
44531
diff
changeset
|
3976 |
with `?lhs` 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" |
7abe4a59f75d
generalize and simplify proof of continuous_within_sequentially
huffman
parents:
44531
diff
changeset
|
3977 |
unfolding continuous_within tendsto_def eventually_within by auto |
7abe4a59f75d
generalize and simplify proof of continuous_within_sequentially
huffman
parents:
44531
diff
changeset
|
3978 |
have "eventually (\<lambda>n. dist (x n) a < d) sequentially" |
7abe4a59f75d
generalize and simplify proof of continuous_within_sequentially
huffman
parents:
44531
diff
changeset
|
3979 |
using x(2) `d>0` by simp |
7abe4a59f75d
generalize and simplify proof of continuous_within_sequentially
huffman
parents:
44531
diff
changeset
|
3980 |
hence "eventually (\<lambda>n. (f \<circ> x) n \<in> T) sequentially" |
46887 | 3981 |
proof eventually_elim |
3982 |
case (elim n) thus ?case |
|
44533
7abe4a59f75d
generalize and simplify proof of continuous_within_sequentially
huffman
parents:
44531
diff
changeset
|
3983 |
using d x(1) `f a \<in> T` unfolding dist_nz[THEN sym] by auto |
7abe4a59f75d
generalize and simplify proof of continuous_within_sequentially
huffman
parents:
44531
diff
changeset
|
3984 |
qed |
33175 | 3985 |
} |
44533
7abe4a59f75d
generalize and simplify proof of continuous_within_sequentially
huffman
parents:
44531
diff
changeset
|
3986 |
thus ?rhs unfolding tendsto_iff unfolding tendsto_def by simp |
33175 | 3987 |
next |
44533
7abe4a59f75d
generalize and simplify proof of continuous_within_sequentially
huffman
parents:
44531
diff
changeset
|
3988 |
assume ?rhs thus ?lhs |
7abe4a59f75d
generalize and simplify proof of continuous_within_sequentially
huffman
parents:
44531
diff
changeset
|
3989 |
unfolding continuous_within tendsto_def [where l="f a"] |
7abe4a59f75d
generalize and simplify proof of continuous_within_sequentially
huffman
parents:
44531
diff
changeset
|
3990 |
by (simp add: sequentially_imp_eventually_within) |
33175 | 3991 |
qed |
3992 |
||
3993 |
lemma continuous_at_sequentially: |
|
44533
7abe4a59f75d
generalize and simplify proof of continuous_within_sequentially
huffman
parents:
44531
diff
changeset
|
3994 |
fixes f :: "'a::metric_space \<Rightarrow> 'b::topological_space" |
33175 | 3995 |
shows "continuous (at a) f \<longleftrightarrow> (\<forall>x. (x ---> a) sequentially |
3996 |
--> ((f o x) ---> f a) sequentially)" |
|
45031 | 3997 |
using continuous_within_sequentially[of a UNIV f] by simp |
33175 | 3998 |
|
3999 |
lemma continuous_on_sequentially: |
|
44533
7abe4a59f75d
generalize and simplify proof of continuous_within_sequentially
huffman
parents:
44531
diff
changeset
|
4000 |
fixes f :: "'a::metric_space \<Rightarrow> 'b::topological_space" |
36359 | 4001 |
shows "continuous_on s f \<longleftrightarrow> |
4002 |
(\<forall>x. \<forall>a \<in> s. (\<forall>n. x(n) \<in> s) \<and> (x ---> a) sequentially |
|
33175 | 4003 |
--> ((f o x) ---> f(a)) sequentially)" (is "?lhs = ?rhs") |
4004 |
proof |
|
4005 |
assume ?rhs thus ?lhs using continuous_within_sequentially[of _ s f] unfolding continuous_on_eq_continuous_within by auto |
|
4006 |
next |
|
4007 |
assume ?lhs thus ?rhs unfolding continuous_on_eq_continuous_within using continuous_within_sequentially[of _ s f] by auto |
|
4008 |
qed |
|
4009 |
||
44648
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4010 |
lemma uniformly_continuous_on_sequentially: |
36441 | 4011 |
"uniformly_continuous_on s f \<longleftrightarrow> (\<forall>x y. (\<forall>n. x n \<in> s) \<and> (\<forall>n. y n \<in> s) \<and> |
4012 |
((\<lambda>n. dist (x n) (y n)) ---> 0) sequentially |
|
4013 |
\<longrightarrow> ((\<lambda>n. dist (f(x n)) (f(y n))) ---> 0) sequentially)" (is "?lhs = ?rhs") |
|
33175 | 4014 |
proof |
4015 |
assume ?lhs |
|
36441 | 4016 |
{ fix x y assume x:"\<forall>n. x n \<in> s" and y:"\<forall>n. y n \<in> s" and xy:"((\<lambda>n. dist (x n) (y n)) ---> 0) sequentially" |
33175 | 4017 |
{ fix e::real assume "e>0" |
4018 |
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" |
|
4019 |
using `?lhs`[unfolded uniformly_continuous_on_def, THEN spec[where x=e]] by auto |
|
44907
93943da0a010
remove redundant lemma Lim_sequentially in favor of lemma LIMSEQ_def
huffman
parents:
44905
diff
changeset
|
4020 |
obtain N where N:"\<forall>n\<ge>N. dist (x n) (y n) < d" using xy[unfolded LIMSEQ_def dist_norm] and `d>0` by auto |
33175 | 4021 |
{ fix n assume "n\<ge>N" |
36441 | 4022 |
hence "dist (f (x n)) (f (y n)) < e" |
33175 | 4023 |
using N[THEN spec[where x=n]] using d[THEN bspec[where x="x n"], THEN bspec[where x="y n"]] using x and y |
36441 | 4024 |
unfolding dist_commute by simp } |
4025 |
hence "\<exists>N. \<forall>n\<ge>N. dist (f (x n)) (f (y n)) < e" by auto } |
|
44907
93943da0a010
remove redundant lemma Lim_sequentially in favor of lemma LIMSEQ_def
huffman
parents:
44905
diff
changeset
|
4026 |
hence "((\<lambda>n. dist (f(x n)) (f(y n))) ---> 0) sequentially" unfolding LIMSEQ_def and dist_real_def by auto } |
33175 | 4027 |
thus ?rhs by auto |
4028 |
next |
|
4029 |
assume ?rhs |
|
4030 |
{ assume "\<not> ?lhs" |
|
4031 |
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" unfolding uniformly_continuous_on_def by auto |
|
4032 |
then obtain fa where fa:"\<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" |
|
4033 |
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"] unfolding Bex_def |
|
4034 |
by (auto simp add: dist_commute) |
|
4035 |
def x \<equiv> "\<lambda>n::nat. fst (fa (inverse (real n + 1)))" |
|
4036 |
def y \<equiv> "\<lambda>n::nat. snd (fa (inverse (real n + 1)))" |
|
4037 |
have xyn:"\<forall>n. x n \<in> s \<and> y n \<in> s" and xy0:"\<forall>n. dist (x n) (y n) < inverse (real n + 1)" and fxy:"\<forall>n. \<not> dist (f (x n)) (f (y n)) < e" |
|
4038 |
unfolding x_def and y_def using fa by auto |
|
4039 |
{ fix e::real assume "e>0" |
|
4040 |
then obtain N::nat where "N \<noteq> 0" and N:"0 < inverse (real N) \<and> inverse (real N) < e" unfolding real_arch_inv[of e] by auto |
|
4041 |
{ fix n::nat assume "n\<ge>N" |
|
4042 |
hence "inverse (real n + 1) < inverse (real N)" using real_of_nat_ge_zero and `N\<noteq>0` by auto |
|
4043 |
also have "\<dots> < e" using N by auto |
|
4044 |
finally have "inverse (real n + 1) < e" by auto |
|
36441 | 4045 |
hence "dist (x n) (y n) < e" using xy0[THEN spec[where x=n]] by auto } |
4046 |
hence "\<exists>N. \<forall>n\<ge>N. dist (x n) (y n) < e" by auto } |
|
44907
93943da0a010
remove redundant lemma Lim_sequentially in favor of lemma LIMSEQ_def
huffman
parents:
44905
diff
changeset
|
4047 |
hence "\<forall>e>0. \<exists>N. \<forall>n\<ge>N. dist (f (x n)) (f (y n)) < e" using `?rhs`[THEN spec[where x=x], THEN spec[where x=y]] and xyn unfolding LIMSEQ_def dist_real_def by auto |
36441 | 4048 |
hence False using fxy and `e>0` by auto } |
33175 | 4049 |
thus ?lhs unfolding uniformly_continuous_on_def by blast |
4050 |
qed |
|
4051 |
||
4052 |
text{* The usual transformation theorems. *} |
|
4053 |
||
4054 |
lemma continuous_transform_within: |
|
36667 | 4055 |
fixes f g :: "'a::metric_space \<Rightarrow> 'b::topological_space" |
33175 | 4056 |
assumes "0 < d" "x \<in> s" "\<forall>x' \<in> s. dist x' x < d --> f x' = g x'" |
4057 |
"continuous (at x within s) f" |
|
4058 |
shows "continuous (at x within s) g" |
|
36667 | 4059 |
unfolding continuous_within |
4060 |
proof (rule Lim_transform_within) |
|
4061 |
show "0 < d" by fact |
|
4062 |
show "\<forall>x'\<in>s. 0 < dist x' x \<and> dist x' x < d \<longrightarrow> f x' = g x'" |
|
4063 |
using assms(3) by auto |
|
4064 |
have "f x = g x" |
|
4065 |
using assms(1,2,3) by auto |
|
4066 |
thus "(f ---> g x) (at x within s)" |
|
4067 |
using assms(4) unfolding continuous_within by simp |
|
33175 | 4068 |
qed |
4069 |
||
4070 |
lemma continuous_transform_at: |
|
36667 | 4071 |
fixes f g :: "'a::metric_space \<Rightarrow> 'b::topological_space" |
33175 | 4072 |
assumes "0 < d" "\<forall>x'. dist x' x < d --> f x' = g x'" |
4073 |
"continuous (at x) f" |
|
4074 |
shows "continuous (at x) g" |
|
45031 | 4075 |
using continuous_transform_within [of d x UNIV f g] assms by simp |
33175 | 4076 |
|
44648
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4077 |
subsubsection {* Structural rules for pointwise continuity *} |
33175 | 4078 |
|
44647
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4079 |
lemma continuous_within_id: "continuous (at a within s) (\<lambda>x. x)" |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4080 |
unfolding continuous_within by (rule tendsto_ident_at_within) |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4081 |
|
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4082 |
lemma continuous_at_id: "continuous (at a) (\<lambda>x. x)" |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4083 |
unfolding continuous_at by (rule tendsto_ident_at) |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4084 |
|
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4085 |
lemma continuous_const: "continuous F (\<lambda>x. c)" |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4086 |
unfolding continuous_def by (rule tendsto_const) |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4087 |
|
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4088 |
lemma continuous_dist: |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4089 |
assumes "continuous F f" and "continuous F g" |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4090 |
shows "continuous F (\<lambda>x. dist (f x) (g x))" |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4091 |
using assms unfolding continuous_def by (rule tendsto_dist) |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4092 |
|
50087 | 4093 |
lemma continuous_infdist: |
4094 |
assumes "continuous F f" |
|
4095 |
shows "continuous F (\<lambda>x. infdist (f x) A)" |
|
4096 |
using assms unfolding continuous_def by (rule tendsto_infdist) |
|
4097 |
||
44647
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4098 |
lemma continuous_norm: |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4099 |
shows "continuous F f \<Longrightarrow> continuous F (\<lambda>x. norm (f x))" |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4100 |
unfolding continuous_def by (rule tendsto_norm) |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4101 |
|
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4102 |
lemma continuous_infnorm: |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4103 |
shows "continuous F f \<Longrightarrow> continuous F (\<lambda>x. infnorm (f x))" |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4104 |
unfolding continuous_def by (rule tendsto_infnorm) |
33175 | 4105 |
|
4106 |
lemma continuous_add: |
|
4107 |
fixes f g :: "'a::t2_space \<Rightarrow> 'b::real_normed_vector" |
|
44647
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4108 |
shows "\<lbrakk>continuous F f; continuous F g\<rbrakk> \<Longrightarrow> continuous F (\<lambda>x. f x + g x)" |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4109 |
unfolding continuous_def by (rule tendsto_add) |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4110 |
|
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4111 |
lemma continuous_minus: |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4112 |
fixes f :: "'a::t2_space \<Rightarrow> 'b::real_normed_vector" |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4113 |
shows "continuous F f \<Longrightarrow> continuous F (\<lambda>x. - f x)" |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4114 |
unfolding continuous_def by (rule tendsto_minus) |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4115 |
|
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4116 |
lemma continuous_diff: |
33175 | 4117 |
fixes f g :: "'a::t2_space \<Rightarrow> 'b::real_normed_vector" |
44647
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4118 |
shows "\<lbrakk>continuous F f; continuous F g\<rbrakk> \<Longrightarrow> continuous F (\<lambda>x. f x - g x)" |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4119 |
unfolding continuous_def by (rule tendsto_diff) |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4120 |
|
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4121 |
lemma continuous_scaleR: |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4122 |
fixes g :: "'a::t2_space \<Rightarrow> 'b::real_normed_vector" |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4123 |
shows "\<lbrakk>continuous F f; continuous F g\<rbrakk> \<Longrightarrow> continuous F (\<lambda>x. f x *\<^sub>R g x)" |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4124 |
unfolding continuous_def by (rule tendsto_scaleR) |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4125 |
|
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4126 |
lemma continuous_mult: |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4127 |
fixes f g :: "'a::t2_space \<Rightarrow> 'b::real_normed_algebra" |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4128 |
shows "\<lbrakk>continuous F f; continuous F g\<rbrakk> \<Longrightarrow> continuous F (\<lambda>x. f x * g x)" |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4129 |
unfolding continuous_def by (rule tendsto_mult) |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4130 |
|
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4131 |
lemma continuous_inner: |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4132 |
assumes "continuous F f" and "continuous F g" |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4133 |
shows "continuous F (\<lambda>x. inner (f x) (g x))" |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4134 |
using assms unfolding continuous_def by (rule tendsto_inner) |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4135 |
|
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4136 |
lemma continuous_inverse: |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4137 |
fixes f :: "'a::t2_space \<Rightarrow> 'b::real_normed_div_algebra" |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4138 |
assumes "continuous F f" and "f (netlimit F) \<noteq> 0" |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4139 |
shows "continuous F (\<lambda>x. inverse (f x))" |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4140 |
using assms unfolding continuous_def by (rule tendsto_inverse) |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4141 |
|
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4142 |
lemma continuous_at_within_inverse: |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4143 |
fixes f :: "'a::t2_space \<Rightarrow> 'b::real_normed_div_algebra" |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4144 |
assumes "continuous (at a within s) f" and "f a \<noteq> 0" |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4145 |
shows "continuous (at a within s) (\<lambda>x. inverse (f x))" |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4146 |
using assms unfolding continuous_within by (rule tendsto_inverse) |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4147 |
|
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4148 |
lemma continuous_at_inverse: |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4149 |
fixes f :: "'a::t2_space \<Rightarrow> 'b::real_normed_div_algebra" |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4150 |
assumes "continuous (at a) f" and "f a \<noteq> 0" |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4151 |
shows "continuous (at a) (\<lambda>x. inverse (f x))" |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4152 |
using assms unfolding continuous_at by (rule tendsto_inverse) |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4153 |
|
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4154 |
lemmas continuous_intros = continuous_at_id continuous_within_id |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4155 |
continuous_const continuous_dist continuous_norm continuous_infnorm |
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
|
4156 |
continuous_add continuous_minus continuous_diff continuous_scaleR continuous_mult |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
4157 |
continuous_inner continuous_at_inverse continuous_at_within_inverse |
34964 | 4158 |
|
44648
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4159 |
subsubsection {* Structural rules for setwise continuity *} |
33175 | 4160 |
|
44647
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4161 |
lemma continuous_on_id: "continuous_on s (\<lambda>x. x)" |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4162 |
unfolding continuous_on_def by (fast intro: tendsto_ident_at_within) |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4163 |
|
44531
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
4164 |
lemma continuous_on_const: "continuous_on s (\<lambda>x. c)" |
44125 | 4165 |
unfolding continuous_on_def by (auto intro: tendsto_intros) |
33175 | 4166 |
|
44647
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4167 |
lemma continuous_on_norm: |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4168 |
shows "continuous_on s f \<Longrightarrow> continuous_on s (\<lambda>x. norm (f x))" |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4169 |
unfolding continuous_on_def by (fast intro: tendsto_norm) |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4170 |
|
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4171 |
lemma continuous_on_infnorm: |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4172 |
shows "continuous_on s f \<Longrightarrow> continuous_on s (\<lambda>x. infnorm (f x))" |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4173 |
unfolding continuous_on by (fast intro: tendsto_infnorm) |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4174 |
|
44531
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
4175 |
lemma continuous_on_minus: |
36440
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
4176 |
fixes f :: "'a::topological_space \<Rightarrow> 'b::real_normed_vector" |
33175 | 4177 |
shows "continuous_on s f \<Longrightarrow> continuous_on s (\<lambda>x. - f x)" |
36440
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
4178 |
unfolding continuous_on_def by (auto intro: tendsto_intros) |
33175 | 4179 |
|
4180 |
lemma continuous_on_add: |
|
36440
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
4181 |
fixes f g :: "'a::topological_space \<Rightarrow> 'b::real_normed_vector" |
33175 | 4182 |
shows "continuous_on s f \<Longrightarrow> continuous_on s g |
4183 |
\<Longrightarrow> continuous_on s (\<lambda>x. f x + g x)" |
|
36440
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
4184 |
unfolding continuous_on_def by (auto intro: tendsto_intros) |
33175 | 4185 |
|
44531
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
4186 |
lemma continuous_on_diff: |
36440
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
4187 |
fixes f g :: "'a::topological_space \<Rightarrow> 'b::real_normed_vector" |
33175 | 4188 |
shows "continuous_on s f \<Longrightarrow> continuous_on s g |
4189 |
\<Longrightarrow> continuous_on s (\<lambda>x. f x - g x)" |
|
36440
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
4190 |
unfolding continuous_on_def by (auto intro: tendsto_intros) |
33175 | 4191 |
|
44531
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
4192 |
lemma (in bounded_linear) continuous_on: |
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
4193 |
"continuous_on s g \<Longrightarrow> continuous_on s (\<lambda>x. f (g x))" |
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
4194 |
unfolding continuous_on_def by (fast intro: tendsto) |
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
4195 |
|
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
4196 |
lemma (in bounded_bilinear) continuous_on: |
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
4197 |
"\<lbrakk>continuous_on s f; continuous_on s g\<rbrakk> \<Longrightarrow> continuous_on s (\<lambda>x. f x ** g x)" |
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
4198 |
unfolding continuous_on_def by (fast intro: tendsto) |
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
4199 |
|
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
4200 |
lemma continuous_on_scaleR: |
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
4201 |
fixes g :: "'a::topological_space \<Rightarrow> 'b::real_normed_vector" |
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
4202 |
assumes "continuous_on s f" and "continuous_on s g" |
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
4203 |
shows "continuous_on s (\<lambda>x. f x *\<^sub>R g x)" |
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
4204 |
using bounded_bilinear_scaleR assms |
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
4205 |
by (rule bounded_bilinear.continuous_on) |
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
4206 |
|
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
4207 |
lemma continuous_on_mult: |
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
4208 |
fixes g :: "'a::topological_space \<Rightarrow> 'b::real_normed_algebra" |
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
4209 |
assumes "continuous_on s f" and "continuous_on s g" |
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
4210 |
shows "continuous_on s (\<lambda>x. f x * g x)" |
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
4211 |
using bounded_bilinear_mult assms |
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
4212 |
by (rule bounded_bilinear.continuous_on) |
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
4213 |
|
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
4214 |
lemma continuous_on_inner: |
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
4215 |
fixes g :: "'a::topological_space \<Rightarrow> 'b::real_inner" |
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
4216 |
assumes "continuous_on s f" and "continuous_on s g" |
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
4217 |
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
|
4218 |
using bounded_bilinear_inner assms |
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
4219 |
by (rule bounded_bilinear.continuous_on) |
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
4220 |
|
44647
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4221 |
lemma continuous_on_inverse: |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4222 |
fixes f :: "'a::topological_space \<Rightarrow> 'b::real_normed_div_algebra" |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4223 |
assumes "continuous_on s f" and "\<forall>x\<in>s. f x \<noteq> 0" |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4224 |
shows "continuous_on s (\<lambda>x. inverse (f x))" |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4225 |
using assms unfolding continuous_on by (fast intro: tendsto_inverse) |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4226 |
|
44648
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4227 |
subsubsection {* Structural rules for uniform continuity *} |
33175 | 4228 |
|
44647
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4229 |
lemma uniformly_continuous_on_id: |
44648
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4230 |
shows "uniformly_continuous_on s (\<lambda>x. x)" |
44647
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4231 |
unfolding uniformly_continuous_on_def by auto |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4232 |
|
33175 | 4233 |
lemma uniformly_continuous_on_const: |
44648
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4234 |
shows "uniformly_continuous_on s (\<lambda>x. c)" |
33175 | 4235 |
unfolding uniformly_continuous_on_def by simp |
4236 |
||
44648
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4237 |
lemma uniformly_continuous_on_dist: |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4238 |
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
|
4239 |
assumes "uniformly_continuous_on s f" |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4240 |
assumes "uniformly_continuous_on s g" |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4241 |
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
|
4242 |
proof - |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4243 |
{ fix a b c d :: 'b have "\<bar>dist a b - dist c d\<bar> \<le> dist a c + dist b d" |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4244 |
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
|
4245 |
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
|
4246 |
by arith |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4247 |
} note le = this |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4248 |
{ fix x y |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4249 |
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
|
4250 |
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
|
4251 |
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
|
4252 |
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
|
4253 |
simp add: le) |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4254 |
} |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4255 |
thus ?thesis using assms unfolding uniformly_continuous_on_sequentially |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4256 |
unfolding dist_real_def by simp |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4257 |
qed |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4258 |
|
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4259 |
lemma uniformly_continuous_on_norm: |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4260 |
assumes "uniformly_continuous_on s f" |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4261 |
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
|
4262 |
unfolding norm_conv_dist using assms |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4263 |
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
|
4264 |
|
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4265 |
lemma (in bounded_linear) uniformly_continuous_on: |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4266 |
assumes "uniformly_continuous_on s g" |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4267 |
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
|
4268 |
using assms unfolding uniformly_continuous_on_sequentially |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4269 |
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
|
4270 |
by (auto intro: tendsto_zero) |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4271 |
|
33175 | 4272 |
lemma uniformly_continuous_on_cmul: |
36441 | 4273 |
fixes f :: "'a::metric_space \<Rightarrow> 'b::real_normed_vector" |
33175 | 4274 |
assumes "uniformly_continuous_on s f" |
4275 |
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
|
4276 |
using bounded_linear_scaleR_right assms |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4277 |
by (rule bounded_linear.uniformly_continuous_on) |
33175 | 4278 |
|
4279 |
lemma dist_minus: |
|
4280 |
fixes x y :: "'a::real_normed_vector" |
|
4281 |
shows "dist (- x) (- y) = dist x y" |
|
4282 |
unfolding dist_norm minus_diff_minus norm_minus_cancel .. |
|
4283 |
||
44648
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4284 |
lemma uniformly_continuous_on_minus: |
33175 | 4285 |
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
|
4286 |
shows "uniformly_continuous_on s f \<Longrightarrow> uniformly_continuous_on s (\<lambda>x. - f x)" |
33175 | 4287 |
unfolding uniformly_continuous_on_def dist_minus . |
4288 |
||
4289 |
lemma uniformly_continuous_on_add: |
|
36441 | 4290 |
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
|
4291 |
assumes "uniformly_continuous_on s f" |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4292 |
assumes "uniformly_continuous_on s g" |
33175 | 4293 |
shows "uniformly_continuous_on s (\<lambda>x. f x + g x)" |
44648
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4294 |
using assms unfolding uniformly_continuous_on_sequentially |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4295 |
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
|
4296 |
by (auto intro: tendsto_add_zero) |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4297 |
|
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4298 |
lemma uniformly_continuous_on_diff: |
36441 | 4299 |
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
|
4300 |
assumes "uniformly_continuous_on s f" and "uniformly_continuous_on s g" |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4301 |
shows "uniformly_continuous_on s (\<lambda>x. f x - g x)" |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4302 |
unfolding ab_diff_minus using assms |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4303 |
by (intro uniformly_continuous_on_add uniformly_continuous_on_minus) |
33175 | 4304 |
|
4305 |
text{* Continuity of all kinds is preserved under composition. *} |
|
4306 |
||
36441 | 4307 |
lemma continuous_within_topological: |
4308 |
"continuous (at x within s) f \<longleftrightarrow> |
|
4309 |
(\<forall>B. open B \<longrightarrow> f x \<in> B \<longrightarrow> |
|
4310 |
(\<exists>A. open A \<and> x \<in> A \<and> (\<forall>y\<in>s. y \<in> A \<longrightarrow> f y \<in> B)))" |
|
4311 |
unfolding continuous_within |
|
4312 |
unfolding tendsto_def Limits.eventually_within eventually_at_topological |
|
4313 |
by (intro ball_cong [OF refl] all_cong imp_cong ex_cong conj_cong refl) auto |
|
4314 |
||
33175 | 4315 |
lemma continuous_within_compose: |
36441 | 4316 |
assumes "continuous (at x within s) f" |
4317 |
assumes "continuous (at (f x) within f ` s) g" |
|
33175 | 4318 |
shows "continuous (at x within s) (g o f)" |
36441 | 4319 |
using assms unfolding continuous_within_topological by simp metis |
33175 | 4320 |
|
4321 |
lemma continuous_at_compose: |
|
45031 | 4322 |
assumes "continuous (at x) f" and "continuous (at (f x)) g" |
33175 | 4323 |
shows "continuous (at x) (g o f)" |
4324 |
proof- |
|
45031 | 4325 |
have "continuous (at (f x) within range f) g" using assms(2) |
4326 |
using continuous_within_subset[of "f x" UNIV g "range f"] by simp |
|
4327 |
thus ?thesis using assms(1) |
|
4328 |
using continuous_within_compose[of x UNIV f g] by simp |
|
33175 | 4329 |
qed |
4330 |
||
4331 |
lemma continuous_on_compose: |
|
36440
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
4332 |
"continuous_on s f \<Longrightarrow> continuous_on (f ` s) g \<Longrightarrow> continuous_on s (g o f)" |
89a70297564d
simplify definition of continuous_on; generalize some lemmas
huffman
parents:
36439
diff
changeset
|
4333 |
unfolding continuous_on_topological by simp metis |
33175 | 4334 |
|
4335 |
lemma uniformly_continuous_on_compose: |
|
4336 |
assumes "uniformly_continuous_on s f" "uniformly_continuous_on (f ` s) g" |
|
4337 |
shows "uniformly_continuous_on s (g o f)" |
|
4338 |
proof- |
|
4339 |
{ fix e::real assume "e>0" |
|
4340 |
then obtain d where "d>0" and d:"\<forall>x\<in>f ` s. \<forall>x'\<in>f ` s. dist x' x < d \<longrightarrow> dist (g x') (g x) < e" using assms(2) unfolding uniformly_continuous_on_def by auto |
|
4341 |
obtain d' where "d'>0" "\<forall>x\<in>s. \<forall>x'\<in>s. dist x' x < d' \<longrightarrow> dist (f x') (f x) < d" using `d>0` using assms(1) unfolding uniformly_continuous_on_def by auto |
|
4342 |
hence "\<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" using `d>0` using d by auto } |
|
4343 |
thus ?thesis using assms unfolding uniformly_continuous_on_def by auto |
|
4344 |
qed |
|
4345 |
||
44647
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4346 |
lemmas continuous_on_intros = continuous_on_id continuous_on_const |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4347 |
continuous_on_compose continuous_on_norm continuous_on_infnorm |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4348 |
continuous_on_add continuous_on_minus continuous_on_diff |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4349 |
continuous_on_scaleR continuous_on_mult continuous_on_inverse |
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
|
4350 |
continuous_on_inner |
44648
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4351 |
uniformly_continuous_on_id uniformly_continuous_on_const |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4352 |
uniformly_continuous_on_dist uniformly_continuous_on_norm |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4353 |
uniformly_continuous_on_compose uniformly_continuous_on_add |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4354 |
uniformly_continuous_on_minus uniformly_continuous_on_diff |
897f32a827f2
simplify some proofs about uniform continuity, and add some new ones;
huffman
parents:
44647
diff
changeset
|
4355 |
uniformly_continuous_on_cmul |
44647
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4356 |
|
33175 | 4357 |
text{* Continuity in terms of open preimages. *} |
4358 |
||
4359 |
lemma continuous_at_open: |
|
36441 | 4360 |
shows "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)))" |
4361 |
unfolding continuous_within_topological [of x UNIV f, unfolded within_UNIV] |
|
4362 |
unfolding imp_conjL by (intro all_cong imp_cong ex_cong conj_cong refl) auto |
|
33175 | 4363 |
|
4364 |
lemma continuous_on_open: |
|
36441 | 4365 |
shows "continuous_on s f \<longleftrightarrow> |
33175 | 4366 |
(\<forall>t. openin (subtopology euclidean (f ` s)) t |
4367 |
--> openin (subtopology euclidean s) {x \<in> s. f x \<in> t})" (is "?lhs = ?rhs") |
|
36441 | 4368 |
proof (safe) |
4369 |
fix t :: "'b set" |
|
4370 |
assume 1: "continuous_on s f" |
|
4371 |
assume 2: "openin (subtopology euclidean (f ` s)) t" |
|
4372 |
from 2 obtain B where B: "open B" and t: "t = f ` s \<inter> B" |
|
4373 |
unfolding openin_open by auto |
|
4374 |
def U == "\<Union>{A. open A \<and> (\<forall>x\<in>s. x \<in> A \<longrightarrow> f x \<in> B)}" |
|
4375 |
have "open U" unfolding U_def by (simp add: open_Union) |
|
4376 |
moreover have "\<forall>x\<in>s. x \<in> U \<longleftrightarrow> f x \<in> t" |
|
4377 |
proof (intro ballI iffI) |
|
4378 |
fix x assume "x \<in> s" and "x \<in> U" thus "f x \<in> t" |
|
4379 |
unfolding U_def t by auto |
|
4380 |
next |
|
4381 |
fix x assume "x \<in> s" and "f x \<in> t" |
|
4382 |
hence "x \<in> s" and "f x \<in> B" |
|
4383 |
unfolding t by auto |
|
4384 |
with 1 B obtain A where "open A" "x \<in> A" "\<forall>y\<in>s. y \<in> A \<longrightarrow> f y \<in> B" |
|
4385 |
unfolding t continuous_on_topological by metis |
|
4386 |
then show "x \<in> U" |
|
4387 |
unfolding U_def by auto |
|
4388 |
qed |
|
4389 |
ultimately have "open U \<and> {x \<in> s. f x \<in> t} = s \<inter> U" by auto |
|
4390 |
then show "openin (subtopology euclidean s) {x \<in> s. f x \<in> t}" |
|
4391 |
unfolding openin_open by fast |
|
33175 | 4392 |
next |
36441 | 4393 |
assume "?rhs" show "continuous_on s f" |
4394 |
unfolding continuous_on_topological |
|
4395 |
proof (clarify) |
|
4396 |
fix x and B assume "x \<in> s" and "open B" and "f x \<in> B" |
|
4397 |
have "openin (subtopology euclidean (f ` s)) (f ` s \<inter> B)" |
|
4398 |
unfolding openin_open using `open B` by auto |
|
4399 |
then have "openin (subtopology euclidean s) {x \<in> s. f x \<in> f ` s \<inter> B}" |
|
4400 |
using `?rhs` by fast |
|
4401 |
then show "\<exists>A. open A \<and> x \<in> A \<and> (\<forall>y\<in>s. y \<in> A \<longrightarrow> f y \<in> B)" |
|
4402 |
unfolding openin_open using `x \<in> s` and `f x \<in> B` by auto |
|
4403 |
qed |
|
4404 |
qed |
|
4405 |
||
4406 |
text {* Similarly in terms of closed sets. *} |
|
33175 | 4407 |
|
4408 |
lemma continuous_on_closed: |
|
36359 | 4409 |
shows "continuous_on s f \<longleftrightarrow> (\<forall>t. closedin (subtopology euclidean (f ` s)) t --> closedin (subtopology euclidean s) {x \<in> s. f x \<in> t})" (is "?lhs = ?rhs") |
33175 | 4410 |
proof |
4411 |
assume ?lhs |
|
4412 |
{ fix t |
|
4413 |
have *:"s - {x \<in> s. f x \<in> f ` s - t} = {x \<in> s. f x \<in> t}" by auto |
|
4414 |
have **:"f ` s - (f ` s - (f ` s - t)) = f ` s - t" by auto |
|
4415 |
assume as:"closedin (subtopology euclidean (f ` s)) t" |
|
4416 |
hence "closedin (subtopology euclidean (f ` s)) (f ` s - (f ` s - t))" unfolding closedin_def topspace_euclidean_subtopology unfolding ** by auto |
|
4417 |
hence "closedin (subtopology euclidean s) {x \<in> s. f x \<in> t}" using `?lhs`[unfolded continuous_on_open, THEN spec[where x="(f ` s) - t"]] |
|
4418 |
unfolding openin_closedin_eq topspace_euclidean_subtopology unfolding * by auto } |
|
4419 |
thus ?rhs by auto |
|
4420 |
next |
|
4421 |
assume ?rhs |
|
4422 |
{ fix t |
|
4423 |
have *:"s - {x \<in> s. f x \<in> f ` s - t} = {x \<in> s. f x \<in> t}" by auto |
|
4424 |
assume as:"openin (subtopology euclidean (f ` s)) t" |
|
4425 |
hence "openin (subtopology euclidean s) {x \<in> s. f x \<in> t}" using `?rhs`[THEN spec[where x="(f ` s) - t"]] |
|
4426 |
unfolding openin_closedin_eq topspace_euclidean_subtopology *[THEN sym] closedin_subtopology by auto } |
|
4427 |
thus ?lhs unfolding continuous_on_open by auto |
|
4428 |
qed |
|
4429 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
4430 |
text {* Half-global and completely global cases. *} |
33175 | 4431 |
|
4432 |
lemma continuous_open_in_preimage: |
|
4433 |
assumes "continuous_on s f" "open t" |
|
4434 |
shows "openin (subtopology euclidean s) {x \<in> s. f x \<in> t}" |
|
4435 |
proof- |
|
4436 |
have *:"\<forall>x. x \<in> s \<and> f x \<in> t \<longleftrightarrow> x \<in> s \<and> f x \<in> (t \<inter> f ` s)" by auto |
|
4437 |
have "openin (subtopology euclidean (f ` s)) (t \<inter> f ` s)" |
|
4438 |
using openin_open_Int[of t "f ` s", OF assms(2)] unfolding openin_open by auto |
|
4439 |
thus ?thesis using assms(1)[unfolded continuous_on_open, THEN spec[where x="t \<inter> f ` s"]] using * by auto |
|
4440 |
qed |
|
4441 |
||
4442 |
lemma continuous_closed_in_preimage: |
|
4443 |
assumes "continuous_on s f" "closed t" |
|
4444 |
shows "closedin (subtopology euclidean s) {x \<in> s. f x \<in> t}" |
|
4445 |
proof- |
|
4446 |
have *:"\<forall>x. x \<in> s \<and> f x \<in> t \<longleftrightarrow> x \<in> s \<and> f x \<in> (t \<inter> f ` s)" by auto |
|
4447 |
have "closedin (subtopology euclidean (f ` s)) (t \<inter> f ` s)" |
|
4448 |
using closedin_closed_Int[of t "f ` s", OF assms(2)] unfolding Int_commute by auto |
|
4449 |
thus ?thesis |
|
4450 |
using assms(1)[unfolded continuous_on_closed, THEN spec[where x="t \<inter> f ` s"]] using * by auto |
|
4451 |
qed |
|
4452 |
||
4453 |
lemma continuous_open_preimage: |
|
4454 |
assumes "continuous_on s f" "open s" "open t" |
|
4455 |
shows "open {x \<in> s. f x \<in> t}" |
|
4456 |
proof- |
|
4457 |
obtain T where T: "open T" "{x \<in> s. f x \<in> t} = s \<inter> T" |
|
4458 |
using continuous_open_in_preimage[OF assms(1,3)] unfolding openin_open by auto |
|
4459 |
thus ?thesis using open_Int[of s T, OF assms(2)] by auto |
|
4460 |
qed |
|
4461 |
||
4462 |
lemma continuous_closed_preimage: |
|
4463 |
assumes "continuous_on s f" "closed s" "closed t" |
|
4464 |
shows "closed {x \<in> s. f x \<in> t}" |
|
4465 |
proof- |
|
4466 |
obtain T where T: "closed T" "{x \<in> s. f x \<in> t} = s \<inter> T" |
|
4467 |
using continuous_closed_in_preimage[OF assms(1,3)] unfolding closedin_closed by auto |
|
4468 |
thus ?thesis using closed_Int[of s T, OF assms(2)] by auto |
|
4469 |
qed |
|
4470 |
||
4471 |
lemma continuous_open_preimage_univ: |
|
4472 |
shows "\<forall>x. continuous (at x) f \<Longrightarrow> open s \<Longrightarrow> open {x. f x \<in> s}" |
|
4473 |
using continuous_open_preimage[of UNIV f s] open_UNIV continuous_at_imp_continuous_on by auto |
|
4474 |
||
4475 |
lemma continuous_closed_preimage_univ: |
|
4476 |
shows "(\<forall>x. continuous (at x) f) \<Longrightarrow> closed s ==> closed {x. f x \<in> s}" |
|
4477 |
using continuous_closed_preimage[of UNIV f s] closed_UNIV continuous_at_imp_continuous_on by auto |
|
4478 |
||
4479 |
lemma continuous_open_vimage: |
|
4480 |
shows "\<forall>x. continuous (at x) f \<Longrightarrow> open s \<Longrightarrow> open (f -` s)" |
|
4481 |
unfolding vimage_def by (rule continuous_open_preimage_univ) |
|
4482 |
||
4483 |
lemma continuous_closed_vimage: |
|
4484 |
shows "\<forall>x. continuous (at x) f \<Longrightarrow> closed s \<Longrightarrow> closed (f -` s)" |
|
4485 |
unfolding vimage_def by (rule continuous_closed_preimage_univ) |
|
4486 |
||
36441 | 4487 |
lemma interior_image_subset: |
35172
579dd5570f96
Added integration to Multivariate-Analysis (upto FTC)
himmelma
parents:
35028
diff
changeset
|
4488 |
assumes "\<forall>x. continuous (at x) f" "inj f" |
579dd5570f96
Added integration to Multivariate-Analysis (upto FTC)
himmelma
parents:
35028
diff
changeset
|
4489 |
shows "interior (f ` s) \<subseteq> f ` (interior s)" |
44519 | 4490 |
proof |
4491 |
fix x assume "x \<in> interior (f ` s)" |
|
4492 |
then obtain T where as: "open T" "x \<in> T" "T \<subseteq> f ` s" .. |
|
4493 |
hence "x \<in> f ` s" by auto |
|
4494 |
then obtain y where y: "y \<in> s" "x = f y" by auto |
|
4495 |
have "open (vimage f T)" |
|
4496 |
using assms(1) `open T` by (rule continuous_open_vimage) |
|
4497 |
moreover have "y \<in> vimage f T" |
|
4498 |
using `x = f y` `x \<in> T` by simp |
|
4499 |
moreover have "vimage f T \<subseteq> s" |
|
4500 |
using `T \<subseteq> image f s` `inj f` unfolding inj_on_def subset_eq by auto |
|
4501 |
ultimately have "y \<in> interior s" .. |
|
4502 |
with `x = f y` show "x \<in> f ` interior s" .. |
|
4503 |
qed |
|
35172
579dd5570f96
Added integration to Multivariate-Analysis (upto FTC)
himmelma
parents:
35028
diff
changeset
|
4504 |
|
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
4505 |
text {* Equality of continuous functions on closure and related results. *} |
33175 | 4506 |
|
4507 |
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
|
4508 |
fixes f :: "_ \<Rightarrow> 'b::t1_space" |
36359 | 4509 |
shows "continuous_on s f ==> closedin (subtopology euclidean s) {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
|
4510 |
using continuous_closed_in_preimage[of s f "{a}"] by auto |
33175 | 4511 |
|
4512 |
lemma continuous_closed_preimage_constant: |
|
36668
941ba2da372e
simplify definition of t1_space; generalize lemma closed_sing and related lemmas
huffman
parents:
36667
diff
changeset
|
4513 |
fixes f :: "_ \<Rightarrow> 'b::t1_space" |
36359 | 4514 |
shows "continuous_on s f \<Longrightarrow> closed s ==> 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
|
4515 |
using continuous_closed_preimage[of s f "{a}"] by auto |
33175 | 4516 |
|
4517 |
lemma continuous_constant_on_closure: |
|
36668
941ba2da372e
simplify definition of t1_space; generalize lemma closed_sing and related lemmas
huffman
parents:
36667
diff
changeset
|
4518 |
fixes f :: "_ \<Rightarrow> 'b::t1_space" |
33175 | 4519 |
assumes "continuous_on (closure s) f" |
4520 |
"\<forall>x \<in> s. f x = a" |
|
4521 |
shows "\<forall>x \<in> (closure s). f x = a" |
|
4522 |
using continuous_closed_preimage_constant[of "closure s" f a] |
|
4523 |
assms closure_minimal[of s "{x \<in> closure s. f x = a}"] closure_subset unfolding subset_eq by auto |
|
4524 |
||
4525 |
lemma image_closure_subset: |
|
4526 |
assumes "continuous_on (closure s) f" "closed t" "(f ` s) \<subseteq> t" |
|
4527 |
shows "f ` (closure s) \<subseteq> t" |
|
4528 |
proof- |
|
4529 |
have "s \<subseteq> {x \<in> closure s. f x \<in> t}" using assms(3) closure_subset by auto |
|
4530 |
moreover have "closed {x \<in> closure s. f x \<in> t}" |
|
4531 |
using continuous_closed_preimage[OF assms(1)] and assms(2) by auto |
|
4532 |
ultimately have "closure s = {x \<in> closure s . f x \<in> t}" |
|
4533 |
using closure_minimal[of s "{x \<in> closure s. f x \<in> t}"] by auto |
|
4534 |
thus ?thesis by auto |
|
4535 |
qed |
|
4536 |
||
4537 |
lemma continuous_on_closure_norm_le: |
|
4538 |
fixes f :: "'a::metric_space \<Rightarrow> 'b::real_normed_vector" |
|
4539 |
assumes "continuous_on (closure s) f" "\<forall>y \<in> s. norm(f y) \<le> b" "x \<in> (closure s)" |
|
4540 |
shows "norm(f x) \<le> b" |
|
4541 |
proof- |
|
4542 |
have *:"f ` s \<subseteq> cball 0 b" using assms(2)[unfolded mem_cball_0[THEN sym]] by auto |
|
4543 |
show ?thesis |
|
4544 |
using image_closure_subset[OF assms(1) closed_cball[of 0 b] *] assms(3) |
|
4545 |
unfolding subset_eq apply(erule_tac x="f x" in ballE) by (auto simp add: dist_norm) |
|
4546 |
qed |
|
4547 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
4548 |
text {* Making a continuous function avoid some value in a neighbourhood. *} |
33175 | 4549 |
|
4550 |
lemma continuous_within_avoid: |
|
50898 | 4551 |
fixes f :: "'a::metric_space \<Rightarrow> 'b::t1_space" |
4552 |
assumes "continuous (at x within s) f" and "f x \<noteq> a" |
|
33175 | 4553 |
shows "\<exists>e>0. \<forall>y \<in> s. dist x y < e --> f y \<noteq> a" |
4554 |
proof- |
|
50898 | 4555 |
obtain U where "open U" and "f x \<in> U" and "a \<notin> U" |
4556 |
using t1_space [OF `f x \<noteq> a`] by fast |
|
4557 |
have "(f ---> f x) (at x within s)" |
|
4558 |
using assms(1) by (simp add: continuous_within) |
|
4559 |
hence "eventually (\<lambda>y. f y \<in> U) (at x within s)" |
|
4560 |
using `open U` and `f x \<in> U` |
|
4561 |
unfolding tendsto_def by fast |
|
4562 |
hence "eventually (\<lambda>y. f y \<noteq> a) (at x within s)" |
|
4563 |
using `a \<notin> U` by (fast elim: eventually_mono [rotated]) |
|
4564 |
thus ?thesis |
|
4565 |
unfolding Limits.eventually_within Limits.eventually_at |
|
4566 |
by (rule ex_forward, cut_tac `f x \<noteq> a`, auto simp: dist_commute) |
|
33175 | 4567 |
qed |
4568 |
||
4569 |
lemma continuous_at_avoid: |
|
50898 | 4570 |
fixes f :: "'a::metric_space \<Rightarrow> 'b::t1_space" |
45031 | 4571 |
assumes "continuous (at x) f" and "f x \<noteq> a" |
33175 | 4572 |
shows "\<exists>e>0. \<forall>y. dist x y < e \<longrightarrow> f y \<noteq> a" |
45031 | 4573 |
using assms continuous_within_avoid[of x UNIV f a] by simp |
33175 | 4574 |
|
4575 |
lemma continuous_on_avoid: |
|
50898 | 4576 |
fixes f :: "'a::metric_space \<Rightarrow> 'b::t1_space" |
33175 | 4577 |
assumes "continuous_on s f" "x \<in> s" "f x \<noteq> a" |
4578 |
shows "\<exists>e>0. \<forall>y \<in> s. dist x y < e \<longrightarrow> f y \<noteq> a" |
|
50898 | 4579 |
using assms(1)[unfolded continuous_on_eq_continuous_within, THEN bspec[where x=x], OF assms(2)] continuous_within_avoid[of x s f a] assms(3) by auto |
33175 | 4580 |
|
4581 |
lemma continuous_on_open_avoid: |
|
50898 | 4582 |
fixes f :: "'a::metric_space \<Rightarrow> 'b::t1_space" |
33175 | 4583 |
assumes "continuous_on s f" "open s" "x \<in> s" "f x \<noteq> a" |
4584 |
shows "\<exists>e>0. \<forall>y. dist x y < e \<longrightarrow> f y \<noteq> a" |
|
50898 | 4585 |
using assms(1)[unfolded continuous_on_eq_continuous_at[OF assms(2)], THEN bspec[where x=x], OF assms(3)] continuous_at_avoid[of x f a] assms(4) by auto |
33175 | 4586 |
|
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
4587 |
text {* Proving a function is constant by proving open-ness of level set. *} |
33175 | 4588 |
|
4589 |
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
|
4590 |
fixes f :: "_ \<Rightarrow> 'b::t1_space" |
36359 | 4591 |
shows "connected s \<Longrightarrow> continuous_on s f \<Longrightarrow> |
33175 | 4592 |
openin (subtopology euclidean s) {x \<in> s. f x = a} |
4593 |
==> (\<forall>x \<in> s. f x \<noteq> a) \<or> (\<forall>x \<in> s. f x = a)" |
|
4594 |
unfolding connected_clopen using continuous_closed_in_preimage_constant by auto |
|
4595 |
||
4596 |
lemma continuous_levelset_open_in: |
|
36668
941ba2da372e
simplify definition of t1_space; generalize lemma closed_sing and related lemmas
huffman
parents:
36667
diff
changeset
|
4597 |
fixes f :: "_ \<Rightarrow> 'b::t1_space" |
36359 | 4598 |
shows "connected s \<Longrightarrow> continuous_on s f \<Longrightarrow> |
33175 | 4599 |
openin (subtopology euclidean s) {x \<in> s. f x = a} \<Longrightarrow> |
4600 |
(\<exists>x \<in> s. f x = a) ==> (\<forall>x \<in> s. f x = a)" |
|
4601 |
using continuous_levelset_open_in_cases[of s f ] |
|
4602 |
by meson |
|
4603 |
||
4604 |
lemma continuous_levelset_open: |
|
36668
941ba2da372e
simplify definition of t1_space; generalize lemma closed_sing and related lemmas
huffman
parents:
36667
diff
changeset
|
4605 |
fixes f :: "_ \<Rightarrow> 'b::t1_space" |
33175 | 4606 |
assumes "connected s" "continuous_on s f" "open {x \<in> s. f x = a}" "\<exists>x \<in> s. f x = a" |
4607 |
shows "\<forall>x \<in> s. f x = a" |
|
36362
06475a1547cb
fix lots of looping simp calls and other warnings
huffman
parents:
36360
diff
changeset
|
4608 |
using continuous_levelset_open_in[OF assms(1,2), of a, unfolded openin_open] using assms (3,4) by fast |
33175 | 4609 |
|
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
4610 |
text {* Some arithmetical combinations (more to prove). *} |
33175 | 4611 |
|
4612 |
lemma open_scaling[intro]: |
|
4613 |
fixes s :: "'a::real_normed_vector set" |
|
4614 |
assumes "c \<noteq> 0" "open s" |
|
4615 |
shows "open((\<lambda>x. c *\<^sub>R x) ` s)" |
|
4616 |
proof- |
|
4617 |
{ fix x assume "x \<in> s" |
|
4618 |
then obtain e where "e>0" and e:"\<forall>x'. dist x' x < e \<longrightarrow> x' \<in> s" using assms(2)[unfolded open_dist, THEN bspec[where x=x]] by auto |
|
36778
739a9379e29b
avoid using real-specific versions of generic lemmas
huffman
parents:
36669
diff
changeset
|
4619 |
have "e * abs c > 0" using assms(1)[unfolded zero_less_abs_iff[THEN sym]] using mult_pos_pos[OF `e>0`] by auto |
33175 | 4620 |
moreover |
4621 |
{ fix y assume "dist y (c *\<^sub>R x) < e * \<bar>c\<bar>" |
|
4622 |
hence "norm ((1 / c) *\<^sub>R y - x) < e" unfolding dist_norm |
|
4623 |
using norm_scaleR[of c "(1 / c) *\<^sub>R y - x", unfolded scaleR_right_diff_distrib, unfolded scaleR_scaleR] assms(1) |
|
4624 |
assms(1)[unfolded zero_less_abs_iff[THEN sym]] by (simp del:zero_less_abs_iff) |
|
4625 |
hence "y \<in> op *\<^sub>R c ` s" using rev_image_eqI[of "(1 / c) *\<^sub>R y" s y "op *\<^sub>R c"] e[THEN spec[where x="(1 / c) *\<^sub>R y"]] assms(1) unfolding dist_norm scaleR_scaleR by auto } |
|
4626 |
ultimately have "\<exists>e>0. \<forall>x'. dist x' (c *\<^sub>R x) < e \<longrightarrow> x' \<in> op *\<^sub>R c ` s" apply(rule_tac x="e * abs c" in exI) by auto } |
|
4627 |
thus ?thesis unfolding open_dist by auto |
|
4628 |
qed |
|
4629 |
||
4630 |
lemma minus_image_eq_vimage: |
|
4631 |
fixes A :: "'a::ab_group_add set" |
|
4632 |
shows "(\<lambda>x. - x) ` A = (\<lambda>x. - x) -` A" |
|
4633 |
by (auto intro!: image_eqI [where f="\<lambda>x. - x"]) |
|
4634 |
||
4635 |
lemma open_negations: |
|
4636 |
fixes s :: "'a::real_normed_vector set" |
|
4637 |
shows "open s ==> open ((\<lambda> x. -x) ` s)" |
|
4638 |
unfolding scaleR_minus1_left [symmetric] |
|
4639 |
by (rule open_scaling, auto) |
|
4640 |
||
4641 |
lemma open_translation: |
|
4642 |
fixes s :: "'a::real_normed_vector set" |
|
4643 |
assumes "open s" shows "open((\<lambda>x. a + x) ` s)" |
|
4644 |
proof- |
|
44647
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4645 |
{ fix x have "continuous (at x) (\<lambda>x. x - a)" |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4646 |
by (intro continuous_diff continuous_at_id continuous_const) } |
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4647 |
moreover have "{x. x - a \<in> s} = op + a ` s" by force |
33175 | 4648 |
ultimately show ?thesis using continuous_open_preimage_univ[of "\<lambda>x. x - a" s] using assms by auto |
4649 |
qed |
|
4650 |
||
4651 |
lemma open_affinity: |
|
4652 |
fixes s :: "'a::real_normed_vector set" |
|
4653 |
assumes "open s" "c \<noteq> 0" |
|
4654 |
shows "open ((\<lambda>x. a + c *\<^sub>R x) ` s)" |
|
4655 |
proof- |
|
4656 |
have *:"(\<lambda>x. a + c *\<^sub>R x) = (\<lambda>x. a + x) \<circ> (\<lambda>x. c *\<^sub>R x)" unfolding o_def .. |
|
4657 |
have "op + a ` op *\<^sub>R c ` s = (op + a \<circ> op *\<^sub>R c) ` s" by auto |
|
4658 |
thus ?thesis using assms open_translation[of "op *\<^sub>R c ` s" a] unfolding * by auto |
|
4659 |
qed |
|
4660 |
||
4661 |
lemma interior_translation: |
|
4662 |
fixes s :: "'a::real_normed_vector set" |
|
4663 |
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
|
4664 |
proof (rule set_eqI, rule) |
33175 | 4665 |
fix x assume "x \<in> interior (op + a ` s)" |
4666 |
then obtain e where "e>0" and e:"ball x e \<subseteq> op + a ` s" unfolding mem_interior by auto |
|
4667 |
hence "ball (x - a) e \<subseteq> s" unfolding subset_eq Ball_def mem_ball dist_norm apply auto apply(erule_tac x="a + xa" in allE) unfolding ab_group_add_class.diff_diff_eq[THEN sym] by auto |
|
4668 |
thus "x \<in> op + a ` interior s" unfolding image_iff apply(rule_tac x="x - a" in bexI) unfolding mem_interior using `e > 0` by auto |
|
4669 |
next |
|
4670 |
fix x assume "x \<in> op + a ` interior s" |
|
4671 |
then obtain y e where "e>0" and e:"ball y e \<subseteq> s" and y:"x = a + y" unfolding image_iff Bex_def mem_interior by auto |
|
4672 |
{ fix z have *:"a + y - z = y + a - z" by auto |
|
4673 |
assume "z\<in>ball x e" |
|
45548
3e2722d66169
Groups.thy: generalize several lemmas from class ab_group_add to class group_add
huffman
parents:
45270
diff
changeset
|
4674 |
hence "z - a \<in> s" using e[unfolded subset_eq, THEN bspec[where x="z - a"]] unfolding mem_ball dist_norm y group_add_class.diff_diff_eq2 * by auto |
33175 | 4675 |
hence "z \<in> op + a ` s" unfolding image_iff by(auto intro!: bexI[where x="z - a"]) } |
4676 |
hence "ball x e \<subseteq> op + a ` s" unfolding subset_eq by auto |
|
4677 |
thus "x \<in> interior (op + a ` s)" unfolding mem_interior using `e>0` by auto |
|
4678 |
qed |
|
4679 |
||
36437 | 4680 |
text {* Topological properties of linear functions. *} |
4681 |
||
4682 |
lemma linear_lim_0: |
|
4683 |
assumes "bounded_linear f" shows "(f ---> 0) (at (0))" |
|
4684 |
proof- |
|
4685 |
interpret f: bounded_linear f by fact |
|
4686 |
have "(f ---> f 0) (at 0)" |
|
4687 |
using tendsto_ident_at by (rule f.tendsto) |
|
4688 |
thus ?thesis unfolding f.zero . |
|
4689 |
qed |
|
4690 |
||
4691 |
lemma linear_continuous_at: |
|
4692 |
assumes "bounded_linear f" shows "continuous (at a) f" |
|
4693 |
unfolding continuous_at using assms |
|
4694 |
apply (rule bounded_linear.tendsto) |
|
4695 |
apply (rule tendsto_ident_at) |
|
4696 |
done |
|
4697 |
||
4698 |
lemma linear_continuous_within: |
|
4699 |
shows "bounded_linear f ==> continuous (at x within s) f" |
|
4700 |
using continuous_at_imp_continuous_within[of x f s] using linear_continuous_at[of f] by auto |
|
4701 |
||
4702 |
lemma linear_continuous_on: |
|
4703 |
shows "bounded_linear f ==> continuous_on s f" |
|
4704 |
using continuous_at_imp_continuous_on[of s f] using linear_continuous_at[of f] by auto |
|
4705 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
4706 |
text {* Also bilinear functions, in composition form. *} |
36437 | 4707 |
|
4708 |
lemma bilinear_continuous_at_compose: |
|
4709 |
shows "continuous (at x) f \<Longrightarrow> continuous (at x) g \<Longrightarrow> bounded_bilinear h |
|
4710 |
==> continuous (at x) (\<lambda>x. h (f x) (g x))" |
|
4711 |
unfolding continuous_at using Lim_bilinear[of f "f x" "(at x)" g "g x" h] by auto |
|
4712 |
||
4713 |
lemma bilinear_continuous_within_compose: |
|
4714 |
shows "continuous (at x within s) f \<Longrightarrow> continuous (at x within s) g \<Longrightarrow> bounded_bilinear h |
|
4715 |
==> continuous (at x within s) (\<lambda>x. h (f x) (g x))" |
|
4716 |
unfolding continuous_within using Lim_bilinear[of f "f x"] by auto |
|
4717 |
||
4718 |
lemma bilinear_continuous_on_compose: |
|
4719 |
shows "continuous_on s f \<Longrightarrow> continuous_on s g \<Longrightarrow> bounded_bilinear h |
|
4720 |
==> continuous_on s (\<lambda>x. h (f x) (g x))" |
|
36441 | 4721 |
unfolding continuous_on_def |
4722 |
by (fast elim: bounded_bilinear.tendsto) |
|
36437 | 4723 |
|
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
4724 |
text {* Preservation of compactness and connectedness under continuous function. *} |
33175 | 4725 |
|
50898 | 4726 |
lemma compact_eq_openin_cover: |
4727 |
"compact S \<longleftrightarrow> |
|
4728 |
(\<forall>C. (\<forall>c\<in>C. openin (subtopology euclidean S) c) \<and> S \<subseteq> \<Union>C \<longrightarrow> |
|
4729 |
(\<exists>D\<subseteq>C. finite D \<and> S \<subseteq> \<Union>D))" |
|
4730 |
proof safe |
|
4731 |
fix C |
|
4732 |
assume "compact S" and "\<forall>c\<in>C. openin (subtopology euclidean S) c" and "S \<subseteq> \<Union>C" |
|
4733 |
hence "\<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}" |
|
4734 |
unfolding openin_open by force+ |
|
4735 |
with `compact S` obtain D where "D \<subseteq> {T. open T \<and> S \<inter> T \<in> C}" and "finite D" and "S \<subseteq> \<Union>D" |
|
4736 |
by (rule compactE) |
|
4737 |
hence "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)" |
|
4738 |
by auto |
|
4739 |
thus "\<exists>D\<subseteq>C. finite D \<and> S \<subseteq> \<Union>D" .. |
|
4740 |
next |
|
4741 |
assume 1: "\<forall>C. (\<forall>c\<in>C. openin (subtopology euclidean S) c) \<and> S \<subseteq> \<Union>C \<longrightarrow> |
|
4742 |
(\<exists>D\<subseteq>C. finite D \<and> S \<subseteq> \<Union>D)" |
|
4743 |
show "compact S" |
|
4744 |
proof (rule compactI) |
|
4745 |
fix C |
|
4746 |
let ?C = "image (\<lambda>T. S \<inter> T) C" |
|
4747 |
assume "\<forall>t\<in>C. open t" and "S \<subseteq> \<Union>C" |
|
4748 |
hence "(\<forall>c\<in>?C. openin (subtopology euclidean S) c) \<and> S \<subseteq> \<Union>?C" |
|
4749 |
unfolding openin_open by auto |
|
4750 |
with 1 obtain D where "D \<subseteq> ?C" and "finite D" and "S \<subseteq> \<Union>D" |
|
4751 |
by metis |
|
4752 |
let ?D = "inv_into C (\<lambda>T. S \<inter> T) ` D" |
|
4753 |
have "?D \<subseteq> C \<and> finite ?D \<and> S \<subseteq> \<Union>?D" |
|
4754 |
proof (intro conjI) |
|
4755 |
from `D \<subseteq> ?C` show "?D \<subseteq> C" |
|
4756 |
by (fast intro: inv_into_into) |
|
4757 |
from `finite D` show "finite ?D" |
|
4758 |
by (rule finite_imageI) |
|
4759 |
from `S \<subseteq> \<Union>D` show "S \<subseteq> \<Union>?D" |
|
4760 |
apply (rule subset_trans) |
|
4761 |
apply clarsimp |
|
4762 |
apply (frule subsetD [OF `D \<subseteq> ?C`, THEN f_inv_into_f]) |
|
4763 |
apply (erule rev_bexI, fast) |
|
4764 |
done |
|
4765 |
qed |
|
4766 |
thus "\<exists>D\<subseteq>C. finite D \<and> S \<subseteq> \<Union>D" .. |
|
4767 |
qed |
|
4768 |
qed |
|
4769 |
||
33175 | 4770 |
lemma compact_continuous_image: |
50898 | 4771 |
assumes "continuous_on s f" and "compact s" |
4772 |
shows "compact (f ` s)" |
|
4773 |
using assms (* FIXME: long unstructured proof *) |
|
4774 |
unfolding continuous_on_open |
|
4775 |
unfolding compact_eq_openin_cover |
|
4776 |
apply clarify |
|
4777 |
apply (drule_tac x="image (\<lambda>t. {x \<in> s. f x \<in> t}) C" in spec) |
|
4778 |
apply (drule mp) |
|
4779 |
apply (rule conjI) |
|
4780 |
apply simp |
|
4781 |
apply clarsimp |
|
4782 |
apply (drule subsetD) |
|
4783 |
apply (erule imageI) |
|
4784 |
apply fast |
|
4785 |
apply (erule thin_rl) |
|
4786 |
apply clarify |
|
4787 |
apply (rule_tac x="image (inv_into C (\<lambda>t. {x \<in> s. f x \<in> t})) D" in exI) |
|
4788 |
apply (intro conjI) |
|
4789 |
apply clarify |
|
4790 |
apply (rule inv_into_into) |
|
4791 |
apply (erule (1) subsetD) |
|
4792 |
apply (erule finite_imageI) |
|
4793 |
apply (clarsimp, rename_tac x) |
|
4794 |
apply (drule (1) subsetD, clarify) |
|
4795 |
apply (drule (1) subsetD, clarify) |
|
4796 |
apply (rule rev_bexI) |
|
4797 |
apply assumption |
|
4798 |
apply (subgoal_tac "{x \<in> s. f x \<in> t} \<in> (\<lambda>t. {x \<in> s. f x \<in> t}) ` C") |
|
4799 |
apply (drule f_inv_into_f) |
|
4800 |
apply fast |
|
4801 |
apply (erule imageI) |
|
4802 |
done |
|
33175 | 4803 |
|
4804 |
lemma connected_continuous_image: |
|
4805 |
assumes "continuous_on s f" "connected s" |
|
4806 |
shows "connected(f ` s)" |
|
4807 |
proof- |
|
4808 |
{ fix T assume as: "T \<noteq> {}" "T \<noteq> f ` s" "openin (subtopology euclidean (f ` s)) T" "closedin (subtopology euclidean (f ` s)) T" |
|
4809 |
have "{x \<in> s. f x \<in> T} = {} \<or> {x \<in> s. f x \<in> T} = s" |
|
4810 |
using assms(1)[unfolded continuous_on_open, THEN spec[where x=T]] |
|
4811 |
using assms(1)[unfolded continuous_on_closed, THEN spec[where x=T]] |
|
4812 |
using assms(2)[unfolded connected_clopen, THEN spec[where x="{x \<in> s. f x \<in> T}"]] as(3,4) by auto |
|
4813 |
hence False using as(1,2) |
|
4814 |
using as(4)[unfolded closedin_def topspace_euclidean_subtopology] by auto } |
|
4815 |
thus ?thesis unfolding connected_clopen by auto |
|
4816 |
qed |
|
4817 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
4818 |
text {* Continuity implies uniform continuity on a compact domain. *} |
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
|
4819 |
|
33175 | 4820 |
lemma compact_uniformly_continuous: |
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
|
4821 |
assumes f: "continuous_on s f" and s: "compact s" |
33175 | 4822 |
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
|
4823 |
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
|
4824 |
proof (cases, safe) |
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
|
4825 |
fix e :: real assume "0 < e" "s \<noteq> {}" |
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
|
4826 |
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 | 4827 |
let ?b = "(\<lambda>(y, d). ball y (d/2))" |
4828 |
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
|
4829 |
proof safe |
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
|
4830 |
fix y assume "y \<in> 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
|
4831 |
from continuous_open_in_preimage[OF f open_ball] |
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
|
4832 |
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
|
4833 |
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
|
4834 |
then obtain d where "ball y d \<subseteq> T" "0 < 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
|
4835 |
using `0 < e` `y \<in> s` by (auto elim!: openE) |
50944 | 4836 |
with T `y \<in> s` show "y \<in> (\<Union>r\<in>R. ?b r)" |
4837 |
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
|
4838 |
qed auto |
50944 | 4839 |
with s obtain D where D: "finite D" "D \<subseteq> R" "s \<subseteq> (\<Union>(y, d)\<in>D. ball y (d/2))" |
4840 |
by (rule compactE_image) |
|
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
|
4841 |
with `s \<noteq> {}` have [simp]: "\<And>x. x < Min (snd ` D) \<longleftrightarrow> (\<forall>(y, d)\<in>D. 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
|
4842 |
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
|
4843 |
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
|
4844 |
proof (rule, safe) |
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
|
4845 |
fix x x' assume in_s: "x' \<in> s" "x \<in> 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
|
4846 |
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
|
4847 |
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
|
4848 |
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
|
4849 |
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
|
4850 |
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
|
4851 |
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
|
4852 |
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
|
4853 |
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
|
4854 |
qed auto |
33175 | 4855 |
|
4856 |
text{* Continuity of inverse function on compact domain. *} |
|
4857 |
||
44647
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
4858 |
lemma continuous_on_inv: |
50898 | 4859 |
fixes f :: "'a::topological_space \<Rightarrow> 'b::t2_space" |
33175 | 4860 |
assumes "continuous_on s f" "compact s" "\<forall>x \<in> s. g (f x) = x" |
4861 |
shows "continuous_on (f ` s) g" |
|
50898 | 4862 |
unfolding continuous_on_topological |
4863 |
proof (clarsimp simp add: assms(3)) |
|
4864 |
fix x :: 'a and B :: "'a set" |
|
4865 |
assume "x \<in> s" and "open B" and "x \<in> B" |
|
4866 |
have 1: "\<forall>x\<in>s. f x \<in> f ` (s - B) \<longleftrightarrow> x \<in> s - B" |
|
4867 |
using assms(3) by (auto, metis) |
|
4868 |
have "continuous_on (s - B) f" |
|
4869 |
using `continuous_on s f` Diff_subset |
|
4870 |
by (rule continuous_on_subset) |
|
4871 |
moreover have "compact (s - B)" |
|
4872 |
using `open B` and `compact s` |
|
4873 |
unfolding Diff_eq by (intro compact_inter_closed closed_Compl) |
|
4874 |
ultimately have "compact (f ` (s - B))" |
|
4875 |
by (rule compact_continuous_image) |
|
4876 |
hence "closed (f ` (s - B))" |
|
4877 |
by (rule compact_imp_closed) |
|
4878 |
hence "open (- f ` (s - B))" |
|
4879 |
by (rule open_Compl) |
|
4880 |
moreover have "f x \<in> - f ` (s - B)" |
|
4881 |
using `x \<in> s` and `x \<in> B` by (simp add: 1) |
|
4882 |
moreover have "\<forall>y\<in>s. f y \<in> - f ` (s - B) \<longrightarrow> y \<in> B" |
|
4883 |
by (simp add: 1) |
|
4884 |
ultimately show "\<exists>A. open A \<and> f x \<in> A \<and> (\<forall>y\<in>s. f y \<in> A \<longrightarrow> y \<in> B)" |
|
4885 |
by fast |
|
33175 | 4886 |
qed |
4887 |
||
36437 | 4888 |
text {* A uniformly convergent limit of continuous functions is continuous. *} |
33175 | 4889 |
|
4890 |
lemma continuous_uniform_limit: |
|
44212
4d10e7f342b1
generalize lemma continuous_uniform_limit to class metric_space
huffman
parents:
44211
diff
changeset
|
4891 |
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
|
4892 |
assumes "\<not> trivial_limit F" |
4d10e7f342b1
generalize lemma continuous_uniform_limit to class metric_space
huffman
parents:
44211
diff
changeset
|
4893 |
assumes "eventually (\<lambda>n. continuous_on s (f n)) F" |
4d10e7f342b1
generalize lemma continuous_uniform_limit to class metric_space
huffman
parents:
44211
diff
changeset
|
4894 |
assumes "\<forall>e>0. eventually (\<lambda>n. \<forall>x\<in>s. dist (f n x) (g x) < e) F" |
33175 | 4895 |
shows "continuous_on s g" |
4896 |
proof- |
|
4897 |
{ fix x and e::real assume "x\<in>s" "e>0" |
|
44212
4d10e7f342b1
generalize lemma continuous_uniform_limit to class metric_space
huffman
parents:
44211
diff
changeset
|
4898 |
have "eventually (\<lambda>n. \<forall>x\<in>s. dist (f n x) (g x) < e / 3) F" |
4d10e7f342b1
generalize lemma continuous_uniform_limit to class metric_space
huffman
parents:
44211
diff
changeset
|
4899 |
using `e>0` assms(3)[THEN spec[where x="e/3"]] by auto |
4d10e7f342b1
generalize lemma continuous_uniform_limit to class metric_space
huffman
parents:
44211
diff
changeset
|
4900 |
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
|
4901 |
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
|
4902 |
using assms(1) by blast |
33175 | 4903 |
have "e / 3 > 0" using `e>0` by auto |
4904 |
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" |
|
36359 | 4905 |
using n(2)[unfolded continuous_on_iff, THEN bspec[where x=x], OF `x\<in>s`, THEN spec[where x="e/3"]] by blast |
44212
4d10e7f342b1
generalize lemma continuous_uniform_limit to class metric_space
huffman
parents:
44211
diff
changeset
|
4906 |
{ fix y assume "y \<in> s" and "dist y x < d" |
4d10e7f342b1
generalize lemma continuous_uniform_limit to class metric_space
huffman
parents:
44211
diff
changeset
|
4907 |
hence "dist (f n y) (f n x) < e / 3" |
4d10e7f342b1
generalize lemma continuous_uniform_limit to class metric_space
huffman
parents:
44211
diff
changeset
|
4908 |
by (rule d [rule_format]) |
4d10e7f342b1
generalize lemma continuous_uniform_limit to class metric_space
huffman
parents:
44211
diff
changeset
|
4909 |
hence "dist (f n y) (g x) < 2 * e / 3" |
4d10e7f342b1
generalize lemma continuous_uniform_limit to class metric_space
huffman
parents:
44211
diff
changeset
|
4910 |
using dist_triangle [of "f n y" "g x" "f n x"] |
4d10e7f342b1
generalize lemma continuous_uniform_limit to class metric_space
huffman
parents:
44211
diff
changeset
|
4911 |
using n(1)[THEN bspec[where x=x], OF `x\<in>s`] |
4d10e7f342b1
generalize lemma continuous_uniform_limit to class metric_space
huffman
parents:
44211
diff
changeset
|
4912 |
by auto |
4d10e7f342b1
generalize lemma continuous_uniform_limit to class metric_space
huffman
parents:
44211
diff
changeset
|
4913 |
hence "dist (g y) (g x) < e" |
4d10e7f342b1
generalize lemma continuous_uniform_limit to class metric_space
huffman
parents:
44211
diff
changeset
|
4914 |
using n(1)[THEN bspec[where x=y], OF `y\<in>s`] |
4d10e7f342b1
generalize lemma continuous_uniform_limit to class metric_space
huffman
parents:
44211
diff
changeset
|
4915 |
using dist_triangle3 [of "g y" "g x" "f n y"] |
4d10e7f342b1
generalize lemma continuous_uniform_limit to class metric_space
huffman
parents:
44211
diff
changeset
|
4916 |
by auto } |
4d10e7f342b1
generalize lemma continuous_uniform_limit to class metric_space
huffman
parents:
44211
diff
changeset
|
4917 |
hence "\<exists>d>0. \<forall>x'\<in>s. dist x' x < d \<longrightarrow> dist (g x') (g x) < e" |
4d10e7f342b1
generalize lemma continuous_uniform_limit to class metric_space
huffman
parents:
44211
diff
changeset
|
4918 |
using `d>0` by auto } |
36359 | 4919 |
thus ?thesis unfolding continuous_on_iff by auto |
33175 | 4920 |
qed |
4921 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
4922 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
4923 |
subsection {* Topological stuff lifted from and dropped to R *} |
33175 | 4924 |
|
4925 |
lemma open_real: |
|
4926 |
fixes s :: "real set" shows |
|
4927 |
"open s \<longleftrightarrow> |
|
4928 |
(\<forall>x \<in> s. \<exists>e>0. \<forall>x'. abs(x' - x) < e --> x' \<in> s)" (is "?lhs = ?rhs") |
|
4929 |
unfolding open_dist dist_norm by simp |
|
4930 |
||
4931 |
lemma islimpt_approachable_real: |
|
4932 |
fixes s :: "real set" |
|
4933 |
shows "x islimpt s \<longleftrightarrow> (\<forall>e>0. \<exists>x'\<in> s. x' \<noteq> x \<and> abs(x' - x) < e)" |
|
4934 |
unfolding islimpt_approachable dist_norm by simp |
|
4935 |
||
4936 |
lemma closed_real: |
|
4937 |
fixes s :: "real set" |
|
4938 |
shows "closed s \<longleftrightarrow> |
|
4939 |
(\<forall>x. (\<forall>e>0. \<exists>x' \<in> s. x' \<noteq> x \<and> abs(x' - x) < e) |
|
4940 |
--> x \<in> s)" |
|
4941 |
unfolding closed_limpt islimpt_approachable dist_norm by simp |
|
4942 |
||
4943 |
lemma continuous_at_real_range: |
|
4944 |
fixes f :: "'a::real_normed_vector \<Rightarrow> real" |
|
4945 |
shows "continuous (at x) f \<longleftrightarrow> (\<forall>e>0. \<exists>d>0. |
|
4946 |
\<forall>x'. norm(x' - x) < d --> abs(f x' - f x) < e)" |
|
4947 |
unfolding continuous_at unfolding Lim_at |
|
4948 |
unfolding dist_nz[THEN sym] unfolding dist_norm apply auto |
|
4949 |
apply(erule_tac x=e in allE) apply auto apply (rule_tac x=d in exI) apply auto apply (erule_tac x=x' in allE) apply auto |
|
4950 |
apply(erule_tac x=e in allE) by auto |
|
4951 |
||
4952 |
lemma continuous_on_real_range: |
|
4953 |
fixes f :: "'a::real_normed_vector \<Rightarrow> real" |
|
4954 |
shows "continuous_on s f \<longleftrightarrow> (\<forall>x \<in> s. \<forall>e>0. \<exists>d>0. (\<forall>x' \<in> s. norm(x' - x) < d --> abs(f x' - f x) < e))" |
|
36359 | 4955 |
unfolding continuous_on_iff dist_norm by simp |
33175 | 4956 |
|
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
4957 |
text {* Hence some handy theorems on distance, diameter etc. of/from a set. *} |
33175 | 4958 |
|
4959 |
lemma compact_attains_sup: |
|
4960 |
fixes s :: "real set" |
|
4961 |
assumes "compact s" "s \<noteq> {}" |
|
4962 |
shows "\<exists>x \<in> s. \<forall>y \<in> s. y \<le> x" |
|
4963 |
proof- |
|
4964 |
from assms(1) have a:"bounded s" "closed s" unfolding compact_eq_bounded_closed by auto |
|
33270 | 4965 |
{ fix e::real assume as: "\<forall>x\<in>s. x \<le> Sup s" "Sup s \<notin> s" "0 < e" "\<forall>x'\<in>s. x' = Sup s \<or> \<not> Sup s - x' < e" |
4966 |
have "isLub UNIV s (Sup s)" using Sup[OF assms(2)] unfolding setle_def using as(1) by auto |
|
4967 |
moreover have "isUb UNIV s (Sup s - e)" unfolding isUb_def unfolding setle_def using as(4,2) by auto |
|
4968 |
ultimately have False using isLub_le_isUb[of UNIV s "Sup s" "Sup s - e"] using `e>0` by auto } |
|
4969 |
thus ?thesis using bounded_has_Sup(1)[OF a(1) assms(2)] using a(2)[unfolded closed_real, THEN spec[where x="Sup s"]] |
|
4970 |
apply(rule_tac x="Sup s" in bexI) by auto |
|
4971 |
qed |
|
4972 |
||
4973 |
lemma Inf: |
|
4974 |
fixes S :: "real set" |
|
4975 |
shows "S \<noteq> {} ==> (\<exists>b. b <=* S) ==> isGlb UNIV S (Inf S)" |
|
4976 |
by (auto simp add: isLb_def setle_def setge_def isGlb_def greatestP_def) |
|
33175 | 4977 |
|
4978 |
lemma compact_attains_inf: |
|
4979 |
fixes s :: "real set" |
|
4980 |
assumes "compact s" "s \<noteq> {}" shows "\<exists>x \<in> s. \<forall>y \<in> s. x \<le> y" |
|
4981 |
proof- |
|
4982 |
from assms(1) have a:"bounded s" "closed s" unfolding compact_eq_bounded_closed by auto |
|
33270 | 4983 |
{ fix e::real assume as: "\<forall>x\<in>s. x \<ge> Inf s" "Inf s \<notin> s" "0 < e" |
4984 |
"\<forall>x'\<in>s. x' = Inf s \<or> \<not> abs (x' - Inf s) < e" |
|
4985 |
have "isGlb UNIV s (Inf s)" using Inf[OF assms(2)] unfolding setge_def using as(1) by auto |
|
33175 | 4986 |
moreover |
4987 |
{ fix x assume "x \<in> s" |
|
33270 | 4988 |
hence *:"abs (x - Inf s) = x - Inf s" using as(1)[THEN bspec[where x=x]] by auto |
4989 |
have "Inf s + e \<le> x" using as(4)[THEN bspec[where x=x]] using as(2) `x\<in>s` unfolding * by auto } |
|
4990 |
hence "isLb UNIV s (Inf s + e)" unfolding isLb_def and setge_def by auto |
|
4991 |
ultimately have False using isGlb_le_isLb[of UNIV s "Inf s" "Inf s + e"] using `e>0` by auto } |
|
4992 |
thus ?thesis using bounded_has_Inf(1)[OF a(1) assms(2)] using a(2)[unfolded closed_real, THEN spec[where x="Inf s"]] |
|
4993 |
apply(rule_tac x="Inf s" in bexI) by auto |
|
33175 | 4994 |
qed |
4995 |
||
4996 |
lemma continuous_attains_sup: |
|
50948 | 4997 |
fixes f :: "'a::topological_space \<Rightarrow> real" |
33175 | 4998 |
shows "compact s \<Longrightarrow> s \<noteq> {} \<Longrightarrow> continuous_on s f |
4999 |
==> (\<exists>x \<in> s. \<forall>y \<in> s. f y \<le> f x)" |
|
5000 |
using compact_attains_sup[of "f ` s"] |
|
5001 |
using compact_continuous_image[of s f] by auto |
|
5002 |
||
5003 |
lemma continuous_attains_inf: |
|
50948 | 5004 |
fixes f :: "'a::topological_space \<Rightarrow> real" |
33175 | 5005 |
shows "compact s \<Longrightarrow> s \<noteq> {} \<Longrightarrow> continuous_on s f |
5006 |
\<Longrightarrow> (\<exists>x \<in> s. \<forall>y \<in> s. f x \<le> f y)" |
|
5007 |
using compact_attains_inf[of "f ` s"] |
|
5008 |
using compact_continuous_image[of s f] by auto |
|
5009 |
||
5010 |
lemma distance_attains_sup: |
|
5011 |
assumes "compact s" "s \<noteq> {}" |
|
5012 |
shows "\<exists>x \<in> s. \<forall>y \<in> s. dist a y \<le> dist a x" |
|
5013 |
proof (rule continuous_attains_sup [OF assms]) |
|
5014 |
{ fix x assume "x\<in>s" |
|
5015 |
have "(dist a ---> dist a x) (at x within s)" |
|
44568
e6f291cb5810
discontinue many legacy theorems about LIM and LIMSEQ, in favor of tendsto theorems
huffman
parents:
44533
diff
changeset
|
5016 |
by (intro tendsto_dist tendsto_const Lim_at_within tendsto_ident_at) |
33175 | 5017 |
} |
5018 |
thus "continuous_on s (dist a)" |
|
5019 |
unfolding continuous_on .. |
|
5020 |
qed |
|
5021 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
5022 |
text {* For \emph{minimal} distance, we only need closure, not compactness. *} |
33175 | 5023 |
|
5024 |
lemma distance_attains_inf: |
|
5025 |
fixes a :: "'a::heine_borel" |
|
5026 |
assumes "closed s" "s \<noteq> {}" |
|
5027 |
shows "\<exists>x \<in> s. \<forall>y \<in> s. dist a x \<le> dist a y" |
|
5028 |
proof- |
|
5029 |
from assms(2) obtain b where "b\<in>s" by auto |
|
5030 |
let ?B = "cball a (dist b a) \<inter> s" |
|
5031 |
have "b \<in> ?B" using `b\<in>s` by (simp add: dist_commute) |
|
5032 |
hence "?B \<noteq> {}" by auto |
|
5033 |
moreover |
|
5034 |
{ fix x assume "x\<in>?B" |
|
5035 |
fix e::real assume "e>0" |
|
5036 |
{ fix x' assume "x'\<in>?B" and as:"dist x' x < e" |
|
5037 |
from as have "\<bar>dist a x' - dist a x\<bar> < e" |
|
5038 |
unfolding abs_less_iff minus_diff_eq |
|
5039 |
using dist_triangle2 [of a x' x] |
|
5040 |
using dist_triangle [of a x x'] |
|
5041 |
by arith |
|
5042 |
} |
|
5043 |
hence "\<exists>d>0. \<forall>x'\<in>?B. dist x' x < d \<longrightarrow> \<bar>dist a x' - dist a x\<bar> < e" |
|
5044 |
using `e>0` by auto |
|
5045 |
} |
|
5046 |
hence "continuous_on (cball a (dist b a) \<inter> s) (dist a)" |
|
5047 |
unfolding continuous_on Lim_within dist_norm real_norm_def |
|
5048 |
by fast |
|
5049 |
moreover have "compact ?B" |
|
5050 |
using compact_cball[of a "dist b a"] |
|
5051 |
unfolding compact_eq_bounded_closed |
|
5052 |
using bounded_Int and closed_Int and assms(1) by auto |
|
5053 |
ultimately obtain x where "x\<in>cball a (dist b a) \<inter> s" "\<forall>y\<in>cball a (dist b a) \<inter> s. dist a x \<le> dist a y" |
|
44890
22f665a2e91c
new fastforce replacing fastsimp - less confusing name
nipkow
parents:
44668
diff
changeset
|
5054 |
using continuous_attains_inf[of ?B "dist a"] by fastforce |
22f665a2e91c
new fastforce replacing fastsimp - less confusing name
nipkow
parents:
44668
diff
changeset
|
5055 |
thus ?thesis by fastforce |
33175 | 5056 |
qed |
5057 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
5058 |
|
36437 | 5059 |
subsection {* Pasted sets *} |
33175 | 5060 |
|
5061 |
lemma bounded_Times: |
|
5062 |
assumes "bounded s" "bounded t" shows "bounded (s \<times> t)" |
|
5063 |
proof- |
|
5064 |
obtain x y a b where "\<forall>z\<in>s. dist x z \<le> a" "\<forall>z\<in>t. dist y z \<le> b" |
|
5065 |
using assms [unfolded bounded_def] by auto |
|
5066 |
then have "\<forall>z\<in>s \<times> t. dist (x, y) z \<le> sqrt (a\<twosuperior> + b\<twosuperior>)" |
|
5067 |
by (auto simp add: dist_Pair_Pair real_sqrt_le_mono add_mono power_mono) |
|
5068 |
thus ?thesis unfolding bounded_any_center [where a="(x, y)"] by auto |
|
5069 |
qed |
|
5070 |
||
5071 |
lemma mem_Times_iff: "x \<in> A \<times> B \<longleftrightarrow> fst x \<in> A \<and> snd x \<in> B" |
|
5072 |
by (induct x) simp |
|
5073 |
||
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
5074 |
lemma seq_compact_Times: "seq_compact s \<Longrightarrow> seq_compact t \<Longrightarrow> seq_compact (s \<times> t)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
5075 |
unfolding seq_compact_def |
33175 | 5076 |
apply clarify |
5077 |
apply (drule_tac x="fst \<circ> f" in spec) |
|
5078 |
apply (drule mp, simp add: mem_Times_iff) |
|
5079 |
apply (clarify, rename_tac l1 r1) |
|
5080 |
apply (drule_tac x="snd \<circ> f \<circ> r1" in spec) |
|
5081 |
apply (drule mp, simp add: mem_Times_iff) |
|
5082 |
apply (clarify, rename_tac l2 r2) |
|
5083 |
apply (rule_tac x="(l1, l2)" in rev_bexI, simp) |
|
5084 |
apply (rule_tac x="r1 \<circ> r2" in exI) |
|
5085 |
apply (rule conjI, simp add: subseq_def) |
|
48125
602dc0215954
tuned proofs -- prefer direct "rotated" instead of old-style COMP;
wenzelm
parents:
48048
diff
changeset
|
5086 |
apply (drule_tac r=r2 in lim_subseq [rotated], assumption) |
33175 | 5087 |
apply (drule (1) tendsto_Pair) back |
5088 |
apply (simp add: o_def) |
|
5089 |
done |
|
5090 |
||
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
5091 |
text {* Generalize to @{class topological_space} *} |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
5092 |
lemma compact_Times: |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
5093 |
fixes s :: "'a::metric_space set" and t :: "'b::metric_space set" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
5094 |
shows "compact s \<Longrightarrow> compact t \<Longrightarrow> compact (s \<times> t)" |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
5095 |
unfolding compact_eq_seq_compact_metric by (rule seq_compact_Times) |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
5096 |
|
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
5097 |
text{* Hence some useful properties follow quite easily. *} |
33175 | 5098 |
|
5099 |
lemma compact_scaling: |
|
5100 |
fixes s :: "'a::real_normed_vector set" |
|
5101 |
assumes "compact s" shows "compact ((\<lambda>x. c *\<^sub>R x) ` s)" |
|
5102 |
proof- |
|
5103 |
let ?f = "\<lambda>x. scaleR c x" |
|
44282
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
huffman
parents:
44252
diff
changeset
|
5104 |
have *:"bounded_linear ?f" by (rule bounded_linear_scaleR_right) |
33175 | 5105 |
show ?thesis using compact_continuous_image[of s ?f] continuous_at_imp_continuous_on[of s ?f] |
5106 |
using linear_continuous_at[OF *] assms by auto |
|
5107 |
qed |
|
5108 |
||
5109 |
lemma compact_negations: |
|
5110 |
fixes s :: "'a::real_normed_vector set" |
|
5111 |
assumes "compact s" shows "compact ((\<lambda>x. -x) ` s)" |
|
5112 |
using compact_scaling [OF assms, of "- 1"] by auto |
|
5113 |
||
5114 |
lemma compact_sums: |
|
5115 |
fixes s t :: "'a::real_normed_vector set" |
|
5116 |
assumes "compact s" "compact t" shows "compact {x + y | x y. x \<in> s \<and> y \<in> t}" |
|
5117 |
proof- |
|
5118 |
have *:"{x + y | x y. x \<in> s \<and> y \<in> t} = (\<lambda>z. fst z + snd z) ` (s \<times> t)" |
|
5119 |
apply auto unfolding image_iff apply(rule_tac x="(xa, y)" in bexI) by auto |
|
5120 |
have "continuous_on (s \<times> t) (\<lambda>z. fst z + snd z)" |
|
5121 |
unfolding continuous_on by (rule ballI) (intro tendsto_intros) |
|
5122 |
thus ?thesis unfolding * using compact_continuous_image compact_Times [OF assms] by auto |
|
5123 |
qed |
|
5124 |
||
5125 |
lemma compact_differences: |
|
5126 |
fixes s t :: "'a::real_normed_vector set" |
|
5127 |
assumes "compact s" "compact t" shows "compact {x - y | x y. x \<in> s \<and> y \<in> t}" |
|
5128 |
proof- |
|
5129 |
have "{x - y | x y. x\<in>s \<and> y \<in> t} = {x + y | x y. x \<in> s \<and> y \<in> (uminus ` t)}" |
|
5130 |
apply auto apply(rule_tac x= xa in exI) apply auto apply(rule_tac x=xa in exI) by auto |
|
5131 |
thus ?thesis using compact_sums[OF assms(1) compact_negations[OF assms(2)]] by auto |
|
5132 |
qed |
|
5133 |
||
5134 |
lemma compact_translation: |
|
5135 |
fixes s :: "'a::real_normed_vector set" |
|
5136 |
assumes "compact s" shows "compact ((\<lambda>x. a + x) ` s)" |
|
5137 |
proof- |
|
5138 |
have "{x + y |x y. x \<in> s \<and> y \<in> {a}} = (\<lambda>x. a + x) ` s" by auto |
|
5139 |
thus ?thesis using compact_sums[OF assms compact_sing[of a]] by auto |
|
5140 |
qed |
|
5141 |
||
5142 |
lemma compact_affinity: |
|
5143 |
fixes s :: "'a::real_normed_vector set" |
|
5144 |
assumes "compact s" shows "compact ((\<lambda>x. a + c *\<^sub>R x) ` s)" |
|
5145 |
proof- |
|
5146 |
have "op + a ` op *\<^sub>R c ` s = (\<lambda>x. a + c *\<^sub>R x) ` s" by auto |
|
5147 |
thus ?thesis using compact_translation[OF compact_scaling[OF assms], of a c] by auto |
|
5148 |
qed |
|
5149 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
5150 |
text {* Hence we get the following. *} |
33175 | 5151 |
|
5152 |
lemma compact_sup_maxdistance: |
|
5153 |
fixes s :: "'a::real_normed_vector set" |
|
5154 |
assumes "compact s" "s \<noteq> {}" |
|
5155 |
shows "\<exists>x\<in>s. \<exists>y\<in>s. \<forall>u\<in>s. \<forall>v\<in>s. norm(u - v) \<le> norm(x - y)" |
|
5156 |
proof- |
|
5157 |
have "{x - y | x y . x\<in>s \<and> y\<in>s} \<noteq> {}" using `s \<noteq> {}` by auto |
|
5158 |
then obtain x where x:"x\<in>{x - y |x y. x \<in> s \<and> y \<in> s}" "\<forall>y\<in>{x - y |x y. x \<in> s \<and> y \<in> s}. norm y \<le> norm x" |
|
5159 |
using compact_differences[OF assms(1) assms(1)] |
|
36362
06475a1547cb
fix lots of looping simp calls and other warnings
huffman
parents:
36360
diff
changeset
|
5160 |
using distance_attains_sup[where 'a="'a", unfolded dist_norm, of "{x - y | x y . x\<in>s \<and> y\<in>s}" 0] by auto |
33175 | 5161 |
from x(1) obtain a b where "a\<in>s" "b\<in>s" "x = a - b" by auto |
5162 |
thus ?thesis using x(2)[unfolded `x = a - b`] by blast |
|
5163 |
qed |
|
5164 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
5165 |
text {* We can state this in terms of diameter of a set. *} |
33175 | 5166 |
|
33270 | 5167 |
definition "diameter s = (if s = {} then 0::real else Sup {norm(x - y) | x y. x \<in> s \<and> y \<in> s})" |
33175 | 5168 |
(* TODO: generalize to class metric_space *) |
5169 |
||
5170 |
lemma diameter_bounded: |
|
5171 |
assumes "bounded s" |
|
5172 |
shows "\<forall>x\<in>s. \<forall>y\<in>s. norm(x - y) \<le> diameter s" |
|
5173 |
"\<forall>d>0. d < diameter s --> (\<exists>x\<in>s. \<exists>y\<in>s. norm(x - y) > d)" |
|
5174 |
proof- |
|
5175 |
let ?D = "{norm (x - y) |x y. x \<in> s \<and> y \<in> s}" |
|
5176 |
obtain a where a:"\<forall>x\<in>s. norm x \<le> a" using assms[unfolded bounded_iff] by auto |
|
5177 |
{ fix x y assume "x \<in> s" "y \<in> s" |
|
36350 | 5178 |
hence "norm (x - y) \<le> 2 * a" using norm_triangle_ineq[of x "-y", unfolded norm_minus_cancel] a[THEN bspec[where x=x]] a[THEN bspec[where x=y]] by (auto simp add: field_simps) } |
33175 | 5179 |
note * = this |
5180 |
{ fix x y assume "x\<in>s" "y\<in>s" hence "s \<noteq> {}" by auto |
|
36362
06475a1547cb
fix lots of looping simp calls and other warnings
huffman
parents:
36360
diff
changeset
|
5181 |
have "norm(x - y) \<le> diameter s" unfolding diameter_def using `s\<noteq>{}` *[OF `x\<in>s` `y\<in>s`] `x\<in>s` `y\<in>s` |
44584 | 5182 |
by simp (blast del: Sup_upper intro!: * Sup_upper) } |
33175 | 5183 |
moreover |
5184 |
{ fix d::real assume "d>0" "d < diameter s" |
|
5185 |
hence "s\<noteq>{}" unfolding diameter_def by auto |
|
5186 |
have "\<exists>d' \<in> ?D. d' > d" |
|
5187 |
proof(rule ccontr) |
|
5188 |
assume "\<not> (\<exists>d'\<in>{norm (x - y) |x y. x \<in> s \<and> y \<in> s}. d < d')" |
|
33324 | 5189 |
hence "\<forall>d'\<in>?D. d' \<le> d" by auto (metis not_leE) |
5190 |
thus False using `d < diameter s` `s\<noteq>{}` |
|
5191 |
apply (auto simp add: diameter_def) |
|
5192 |
apply (drule Sup_real_iff [THEN [2] rev_iffD2]) |
|
5193 |
apply (auto, force) |
|
5194 |
done |
|
33175 | 5195 |
qed |
5196 |
hence "\<exists>x\<in>s. \<exists>y\<in>s. norm(x - y) > d" by auto } |
|
5197 |
ultimately show "\<forall>x\<in>s. \<forall>y\<in>s. norm(x - y) \<le> diameter s" |
|
5198 |
"\<forall>d>0. d < diameter s --> (\<exists>x\<in>s. \<exists>y\<in>s. norm(x - y) > d)" by auto |
|
5199 |
qed |
|
5200 |
||
5201 |
lemma diameter_bounded_bound: |
|
5202 |
"bounded s \<Longrightarrow> x \<in> s \<Longrightarrow> y \<in> s ==> norm(x - y) \<le> diameter s" |
|
5203 |
using diameter_bounded by blast |
|
5204 |
||
5205 |
lemma diameter_compact_attained: |
|
5206 |
fixes s :: "'a::real_normed_vector set" |
|
5207 |
assumes "compact s" "s \<noteq> {}" |
|
5208 |
shows "\<exists>x\<in>s. \<exists>y\<in>s. (norm(x - y) = diameter s)" |
|
5209 |
proof- |
|
5210 |
have b:"bounded s" using assms(1) by (rule compact_imp_bounded) |
|
5211 |
then obtain x y where xys:"x\<in>s" "y\<in>s" and xy:"\<forall>u\<in>s. \<forall>v\<in>s. norm (u - v) \<le> norm (x - y)" using compact_sup_maxdistance[OF assms] by auto |
|
36362
06475a1547cb
fix lots of looping simp calls and other warnings
huffman
parents:
36360
diff
changeset
|
5212 |
hence "diameter s \<le> norm (x - y)" |
06475a1547cb
fix lots of looping simp calls and other warnings
huffman
parents:
36360
diff
changeset
|
5213 |
unfolding diameter_def by clarsimp (rule Sup_least, fast+) |
33324 | 5214 |
thus ?thesis |
36362
06475a1547cb
fix lots of looping simp calls and other warnings
huffman
parents:
36360
diff
changeset
|
5215 |
by (metis b diameter_bounded_bound order_antisym xys) |
33175 | 5216 |
qed |
5217 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
5218 |
text {* Related results with closure as the conclusion. *} |
33175 | 5219 |
|
5220 |
lemma closed_scaling: |
|
5221 |
fixes s :: "'a::real_normed_vector set" |
|
5222 |
assumes "closed s" shows "closed ((\<lambda>x. c *\<^sub>R x) ` s)" |
|
5223 |
proof(cases "s={}") |
|
5224 |
case True thus ?thesis by auto |
|
5225 |
next |
|
5226 |
case False |
|
5227 |
show ?thesis |
|
5228 |
proof(cases "c=0") |
|
5229 |
have *:"(\<lambda>x. 0) ` s = {0}" using `s\<noteq>{}` by auto |
|
36668
941ba2da372e
simplify definition of t1_space; generalize lemma closed_sing and related lemmas
huffman
parents:
36667
diff
changeset
|
5230 |
case True thus ?thesis apply auto unfolding * by auto |
33175 | 5231 |
next |
5232 |
case False |
|
5233 |
{ fix x l assume as:"\<forall>n::nat. x n \<in> scaleR c ` s" "(x ---> l) sequentially" |
|
5234 |
{ fix n::nat have "scaleR (1 / c) (x n) \<in> s" |
|
5235 |
using as(1)[THEN spec[where x=n]] |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5236 |
using `c\<noteq>0` by auto |
33175 | 5237 |
} |
5238 |
moreover |
|
5239 |
{ fix e::real assume "e>0" |
|
5240 |
hence "0 < e *\<bar>c\<bar>" using `c\<noteq>0` mult_pos_pos[of e "abs c"] by auto |
|
5241 |
then obtain N where "\<forall>n\<ge>N. dist (x n) l < e * \<bar>c\<bar>" |
|
44907
93943da0a010
remove redundant lemma Lim_sequentially in favor of lemma LIMSEQ_def
huffman
parents:
44905
diff
changeset
|
5242 |
using as(2)[unfolded LIMSEQ_def, THEN spec[where x="e * abs c"]] by auto |
33175 | 5243 |
hence "\<exists>N. \<forall>n\<ge>N. dist (scaleR (1 / c) (x n)) (scaleR (1 / c) l) < e" |
5244 |
unfolding dist_norm unfolding scaleR_right_diff_distrib[THEN sym] |
|
5245 |
using mult_imp_div_pos_less[of "abs c" _ e] `c\<noteq>0` by auto } |
|
44907
93943da0a010
remove redundant lemma Lim_sequentially in favor of lemma LIMSEQ_def
huffman
parents:
44905
diff
changeset
|
5246 |
hence "((\<lambda>n. scaleR (1 / c) (x n)) ---> scaleR (1 / c) l) sequentially" unfolding LIMSEQ_def by auto |
33175 | 5247 |
ultimately have "l \<in> scaleR c ` s" |
5248 |
using assms[unfolded closed_sequential_limits, THEN spec[where x="\<lambda>n. scaleR (1/c) (x n)"], THEN spec[where x="scaleR (1/c) l"]] |
|
5249 |
unfolding image_iff using `c\<noteq>0` apply(rule_tac x="scaleR (1 / c) l" in bexI) by auto } |
|
5250 |
thus ?thesis unfolding closed_sequential_limits by fast |
|
5251 |
qed |
|
5252 |
qed |
|
5253 |
||
5254 |
lemma closed_negations: |
|
5255 |
fixes s :: "'a::real_normed_vector set" |
|
5256 |
assumes "closed s" shows "closed ((\<lambda>x. -x) ` s)" |
|
5257 |
using closed_scaling[OF assms, of "- 1"] by simp |
|
5258 |
||
5259 |
lemma compact_closed_sums: |
|
5260 |
fixes s :: "'a::real_normed_vector set" |
|
5261 |
assumes "compact s" "closed t" shows "closed {x + y | x y. x \<in> s \<and> y \<in> t}" |
|
5262 |
proof- |
|
5263 |
let ?S = "{x + y |x y. x \<in> s \<and> y \<in> t}" |
|
5264 |
{ fix x l assume as:"\<forall>n. x n \<in> ?S" "(x ---> l) sequentially" |
|
5265 |
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" |
|
5266 |
using choice[of "\<lambda>n y. x n = (fst y) + (snd y) \<and> fst y \<in> s \<and> snd y \<in> t"] by auto |
|
5267 |
obtain l' r where "l'\<in>s" and r:"subseq r" and lr:"(((\<lambda>n. fst (f n)) \<circ> r) ---> l') sequentially" |
|
5268 |
using assms(1)[unfolded compact_def, THEN spec[where x="\<lambda> n. fst (f n)"]] using f(2) by auto |
|
5269 |
have "((\<lambda>n. snd (f (r n))) ---> l - l') sequentially" |
|
44125 | 5270 |
using tendsto_diff[OF lim_subseq[OF r as(2)] lr] and f(1) unfolding o_def by auto |
33175 | 5271 |
hence "l - l' \<in> t" |
5272 |
using assms(2)[unfolded closed_sequential_limits, THEN spec[where x="\<lambda> n. snd (f (r n))"], THEN spec[where x="l - l'"]] |
|
5273 |
using f(3) by auto |
|
5274 |
hence "l \<in> ?S" using `l' \<in> s` apply auto apply(rule_tac x=l' in exI) apply(rule_tac x="l - l'" in exI) by auto |
|
5275 |
} |
|
5276 |
thus ?thesis unfolding closed_sequential_limits by fast |
|
5277 |
qed |
|
5278 |
||
5279 |
lemma closed_compact_sums: |
|
5280 |
fixes s t :: "'a::real_normed_vector set" |
|
5281 |
assumes "closed s" "compact t" |
|
5282 |
shows "closed {x + y | x y. x \<in> s \<and> y \<in> t}" |
|
5283 |
proof- |
|
5284 |
have "{x + y |x y. x \<in> t \<and> y \<in> s} = {x + y |x y. x \<in> s \<and> y \<in> t}" apply auto |
|
5285 |
apply(rule_tac x=y in exI) apply auto apply(rule_tac x=y in exI) by auto |
|
5286 |
thus ?thesis using compact_closed_sums[OF assms(2,1)] by simp |
|
5287 |
qed |
|
5288 |
||
5289 |
lemma compact_closed_differences: |
|
5290 |
fixes s t :: "'a::real_normed_vector set" |
|
5291 |
assumes "compact s" "closed t" |
|
5292 |
shows "closed {x - y | x y. x \<in> s \<and> y \<in> t}" |
|
5293 |
proof- |
|
5294 |
have "{x + y |x y. x \<in> s \<and> y \<in> uminus ` t} = {x - y |x y. x \<in> s \<and> y \<in> t}" |
|
5295 |
apply auto apply(rule_tac x=xa in exI) apply auto apply(rule_tac x=xa in exI) by auto |
|
5296 |
thus ?thesis using compact_closed_sums[OF assms(1) closed_negations[OF assms(2)]] by auto |
|
5297 |
qed |
|
5298 |
||
5299 |
lemma closed_compact_differences: |
|
5300 |
fixes s t :: "'a::real_normed_vector set" |
|
5301 |
assumes "closed s" "compact t" |
|
5302 |
shows "closed {x - y | x y. x \<in> s \<and> y \<in> t}" |
|
5303 |
proof- |
|
5304 |
have "{x + y |x y. x \<in> s \<and> y \<in> uminus ` t} = {x - y |x y. x \<in> s \<and> y \<in> t}" |
|
5305 |
apply auto apply(rule_tac x=xa in exI) apply auto apply(rule_tac x=xa in exI) by auto |
|
5306 |
thus ?thesis using closed_compact_sums[OF assms(1) compact_negations[OF assms(2)]] by simp |
|
5307 |
qed |
|
5308 |
||
5309 |
lemma closed_translation: |
|
5310 |
fixes a :: "'a::real_normed_vector" |
|
5311 |
assumes "closed s" shows "closed ((\<lambda>x. a + x) ` s)" |
|
5312 |
proof- |
|
5313 |
have "{a + y |y. y \<in> s} = (op + a ` s)" by auto |
|
5314 |
thus ?thesis using compact_closed_sums[OF compact_sing[of a] assms] by auto |
|
5315 |
qed |
|
5316 |
||
34105 | 5317 |
lemma translation_Compl: |
5318 |
fixes a :: "'a::ab_group_add" |
|
5319 |
shows "(\<lambda>x. a + x) ` (- t) = - ((\<lambda>x. a + x) ` t)" |
|
5320 |
apply (auto simp add: image_iff) apply(rule_tac x="x - a" in bexI) by auto |
|
5321 |
||
33175 | 5322 |
lemma translation_UNIV: |
5323 |
fixes a :: "'a::ab_group_add" shows "range (\<lambda>x. a + x) = UNIV" |
|
5324 |
apply (auto simp add: image_iff) apply(rule_tac x="x - a" in exI) by auto |
|
5325 |
||
5326 |
lemma translation_diff: |
|
5327 |
fixes a :: "'a::ab_group_add" |
|
5328 |
shows "(\<lambda>x. a + x) ` (s - t) = ((\<lambda>x. a + x) ` s) - ((\<lambda>x. a + x) ` t)" |
|
5329 |
by auto |
|
5330 |
||
5331 |
lemma closure_translation: |
|
5332 |
fixes a :: "'a::real_normed_vector" |
|
5333 |
shows "closure ((\<lambda>x. a + x) ` s) = (\<lambda>x. a + x) ` (closure s)" |
|
5334 |
proof- |
|
34105 | 5335 |
have *:"op + a ` (- s) = - op + a ` s" |
33175 | 5336 |
apply auto unfolding image_iff apply(rule_tac x="x - a" in bexI) by auto |
34105 | 5337 |
show ?thesis unfolding closure_interior translation_Compl |
5338 |
using interior_translation[of a "- s"] unfolding * by auto |
|
33175 | 5339 |
qed |
5340 |
||
5341 |
lemma frontier_translation: |
|
5342 |
fixes a :: "'a::real_normed_vector" |
|
5343 |
shows "frontier((\<lambda>x. a + x) ` s) = (\<lambda>x. a + x) ` (frontier s)" |
|
5344 |
unfolding frontier_def translation_diff interior_translation closure_translation by auto |
|
5345 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
5346 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
5347 |
subsection {* Separation between points and sets *} |
33175 | 5348 |
|
5349 |
lemma separate_point_closed: |
|
5350 |
fixes s :: "'a::heine_borel set" |
|
5351 |
shows "closed s \<Longrightarrow> a \<notin> s ==> (\<exists>d>0. \<forall>x\<in>s. d \<le> dist a x)" |
|
5352 |
proof(cases "s = {}") |
|
5353 |
case True |
|
5354 |
thus ?thesis by(auto intro!: exI[where x=1]) |
|
5355 |
next |
|
5356 |
case False |
|
5357 |
assume "closed s" "a \<notin> s" |
|
5358 |
then obtain x where "x\<in>s" "\<forall>y\<in>s. dist a x \<le> dist a y" using `s \<noteq> {}` distance_attains_inf [of s a] by blast |
|
5359 |
with `x\<in>s` show ?thesis using dist_pos_lt[of a x] and`a \<notin> s` by blast |
|
5360 |
qed |
|
5361 |
||
5362 |
lemma separate_compact_closed: |
|
50949 | 5363 |
fixes s t :: "'a::heine_borel set" |
33175 | 5364 |
assumes "compact s" and "closed t" and "s \<inter> t = {}" |
5365 |
shows "\<exists>d>0. \<forall>x\<in>s. \<forall>y\<in>t. d \<le> dist x y" |
|
50949 | 5366 |
proof - (* FIXME: long proof *) |
5367 |
let ?T = "\<Union>x\<in>s. { ball x (d / 2) | d. 0 < d \<and> (\<forall>y\<in>t. d \<le> dist x y) }" |
|
5368 |
note `compact s` |
|
5369 |
moreover have "\<forall>t\<in>?T. open t" by auto |
|
5370 |
moreover have "s \<subseteq> \<Union>?T" |
|
5371 |
apply auto |
|
5372 |
apply (rule rev_bexI, assumption) |
|
5373 |
apply (subgoal_tac "x \<notin> t") |
|
5374 |
apply (drule separate_point_closed [OF `closed t`]) |
|
5375 |
apply clarify |
|
5376 |
apply (rule_tac x="ball x (d / 2)" in exI) |
|
5377 |
apply simp |
|
5378 |
apply fast |
|
5379 |
apply (cut_tac assms(3)) |
|
5380 |
apply auto |
|
5381 |
done |
|
5382 |
ultimately obtain U where "U \<subseteq> ?T" and "finite U" and "s \<subseteq> \<Union>U" |
|
5383 |
by (rule compactE) |
|
5384 |
from `finite U` and `U \<subseteq> ?T` have "\<exists>d>0. \<forall>x\<in>\<Union>U. \<forall>y\<in>t. d \<le> dist x y" |
|
5385 |
apply (induct set: finite) |
|
5386 |
apply simp |
|
5387 |
apply (rule exI) |
|
5388 |
apply (rule zero_less_one) |
|
5389 |
apply clarsimp |
|
5390 |
apply (rename_tac y e) |
|
5391 |
apply (rule_tac x="min d (e / 2)" in exI) |
|
5392 |
apply simp |
|
5393 |
apply (subst ball_Un) |
|
5394 |
apply (rule conjI) |
|
5395 |
apply (intro ballI, rename_tac z) |
|
5396 |
apply (rule min_max.le_infI2) |
|
5397 |
apply (simp only: mem_ball) |
|
5398 |
apply (drule (1) bspec) |
|
5399 |
apply (cut_tac x=y and y=x and z=z in dist_triangle, arith) |
|
5400 |
apply simp |
|
5401 |
apply (intro ballI) |
|
5402 |
apply (rule min_max.le_infI1) |
|
5403 |
apply simp |
|
5404 |
done |
|
5405 |
with `s \<subseteq> \<Union>U` show ?thesis |
|
5406 |
by fast |
|
33175 | 5407 |
qed |
5408 |
||
5409 |
lemma separate_closed_compact: |
|
50949 | 5410 |
fixes s t :: "'a::heine_borel set" |
33175 | 5411 |
assumes "closed s" and "compact t" and "s \<inter> t = {}" |
5412 |
shows "\<exists>d>0. \<forall>x\<in>s. \<forall>y\<in>t. d \<le> dist x y" |
|
5413 |
proof- |
|
5414 |
have *:"t \<inter> s = {}" using assms(3) by auto |
|
5415 |
show ?thesis using separate_compact_closed[OF assms(2,1) *] |
|
5416 |
apply auto apply(rule_tac x=d in exI) apply auto apply (erule_tac x=y in ballE) |
|
5417 |
by (auto simp add: dist_commute) |
|
5418 |
qed |
|
5419 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
5420 |
|
36439 | 5421 |
subsection {* Intervals *} |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5422 |
|
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5423 |
lemma interval: fixes a :: "'a::ordered_euclidean_space" shows |
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
|
5424 |
"{a <..< b} = {x::'a. \<forall>i\<in>Basis. a\<bullet>i < x\<bullet>i \<and> x\<bullet>i < b\<bullet>i}" 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
|
5425 |
"{a .. b} = {x::'a. \<forall>i\<in>Basis. a\<bullet>i \<le> x\<bullet>i \<and> x\<bullet>i \<le> b\<bullet>i}" |
39302
d7728f65b353
renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
nipkow
parents:
39198
diff
changeset
|
5426 |
by(auto simp add:set_eq_iff eucl_le[where 'a='a] eucl_less[where 'a='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
|
5427 |
|
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5428 |
lemma mem_interval: fixes a :: "'a::ordered_euclidean_space" shows |
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
|
5429 |
"x \<in> {a<..<b} \<longleftrightarrow> (\<forall>i\<in>Basis. a\<bullet>i < x\<bullet>i \<and> x\<bullet>i < b\<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
|
5430 |
"x \<in> {a .. b} \<longleftrightarrow> (\<forall>i\<in>Basis. a\<bullet>i \<le> x\<bullet>i \<and> x\<bullet>i \<le> b\<bullet>i)" |
39302
d7728f65b353
renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
nipkow
parents:
39198
diff
changeset
|
5431 |
using interval[of a b] by(auto simp add: set_eq_iff eucl_le[where 'a='a] eucl_less[where 'a='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
|
5432 |
|
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5433 |
lemma interval_eq_empty: fixes a :: "'a::ordered_euclidean_space" shows |
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
|
5434 |
"({a <..< b} = {} \<longleftrightarrow> (\<exists>i\<in>Basis. b\<bullet>i \<le> a\<bullet>i))" (is ?th1) 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
|
5435 |
"({a .. b} = {} \<longleftrightarrow> (\<exists>i\<in>Basis. b\<bullet>i < a\<bullet>i))" (is ?th2) |
33175 | 5436 |
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
|
5437 |
{ fix i x assume i:"i\<in>Basis" and as:"b\<bullet>i \<le> a\<bullet>i" and x:"x\<in>{a <..< 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
|
5438 |
hence "a \<bullet> i < x \<bullet> i \<and> x \<bullet> i < b \<bullet> i" unfolding mem_interval by auto |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5439 |
hence "a\<bullet>i < b\<bullet>i" by auto |
33175 | 5440 |
hence False using as by auto } |
5441 |
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
|
5442 |
{ assume as:"\<forall>i\<in>Basis. \<not> (b\<bullet>i \<le> a\<bullet>i)" |
33175 | 5443 |
let ?x = "(1/2) *\<^sub>R (a + b)" |
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
|
5444 |
{ fix i :: 'a assume i:"i\<in>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
|
5445 |
have "a\<bullet>i < b\<bullet>i" using as[THEN bspec[where x=i]] i by auto |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5446 |
hence "a\<bullet>i < ((1/2) *\<^sub>R (a+b)) \<bullet> i" "((1/2) *\<^sub>R (a+b)) \<bullet> i < b\<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
|
5447 |
by (auto simp: inner_add_left) } |
33175 | 5448 |
hence "{a <..< b} \<noteq> {}" using mem_interval(1)[of "?x" a b] by auto } |
5449 |
ultimately show ?th1 by blast |
|
5450 |
||
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
|
5451 |
{ fix i x assume i:"i\<in>Basis" and as:"b\<bullet>i < a\<bullet>i" and x:"x\<in>{a .. 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
|
5452 |
hence "a \<bullet> i \<le> x \<bullet> i \<and> x \<bullet> i \<le> b \<bullet> i" unfolding mem_interval by auto |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5453 |
hence "a\<bullet>i \<le> b\<bullet>i" by auto |
33175 | 5454 |
hence False using as by auto } |
5455 |
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
|
5456 |
{ assume as:"\<forall>i\<in>Basis. \<not> (b\<bullet>i < a\<bullet>i)" |
33175 | 5457 |
let ?x = "(1/2) *\<^sub>R (a + b)" |
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
|
5458 |
{ fix i :: 'a assume i:"i\<in>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
|
5459 |
have "a\<bullet>i \<le> b\<bullet>i" using as[THEN bspec[where x=i]] i by auto |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5460 |
hence "a\<bullet>i \<le> ((1/2) *\<^sub>R (a+b)) \<bullet> i" "((1/2) *\<^sub>R (a+b)) \<bullet> i \<le> b\<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
|
5461 |
by (auto simp: inner_add_left) } |
33175 | 5462 |
hence "{a .. b} \<noteq> {}" using mem_interval(2)[of "?x" a b] by auto } |
5463 |
ultimately show ?th2 by blast |
|
5464 |
qed |
|
5465 |
||
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5466 |
lemma interval_ne_empty: fixes a :: "'a::ordered_euclidean_space" shows |
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
|
5467 |
"{a .. b} \<noteq> {} \<longleftrightarrow> (\<forall>i\<in>Basis. a\<bullet>i \<le> b\<bullet>i)" 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
|
5468 |
"{a <..< b} \<noteq> {} \<longleftrightarrow> (\<forall>i\<in>Basis. a\<bullet>i < b\<bullet>i)" |
44890
22f665a2e91c
new fastforce replacing fastsimp - less confusing name
nipkow
parents:
44668
diff
changeset
|
5469 |
unfolding interval_eq_empty[of a b] by fastforce+ |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5470 |
|
44584 | 5471 |
lemma interval_sing: |
5472 |
fixes a :: "'a::ordered_euclidean_space" |
|
5473 |
shows "{a .. a} = {a}" and "{a<..<a} = {}" |
|
5474 |
unfolding set_eq_iff mem_interval eq_iff [symmetric] |
|
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
|
5475 |
by (auto intro: euclidean_eqI simp: ex_in_conv) |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5476 |
|
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5477 |
lemma subset_interval_imp: fixes a :: "'a::ordered_euclidean_space" shows |
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
|
5478 |
"(\<forall>i\<in>Basis. a\<bullet>i \<le> c\<bullet>i \<and> d\<bullet>i \<le> b\<bullet>i) \<Longrightarrow> {c .. d} \<subseteq> {a .. b}" 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
|
5479 |
"(\<forall>i\<in>Basis. a\<bullet>i < c\<bullet>i \<and> d\<bullet>i < b\<bullet>i) \<Longrightarrow> {c .. d} \<subseteq> {a<..<b}" 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
|
5480 |
"(\<forall>i\<in>Basis. a\<bullet>i \<le> c\<bullet>i \<and> d\<bullet>i \<le> b\<bullet>i) \<Longrightarrow> {c<..<d} \<subseteq> {a .. b}" 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
|
5481 |
"(\<forall>i\<in>Basis. a\<bullet>i \<le> c\<bullet>i \<and> d\<bullet>i \<le> b\<bullet>i) \<Longrightarrow> {c<..<d} \<subseteq> {a<..<b}" |
44584 | 5482 |
unfolding subset_eq[unfolded Ball_def] unfolding mem_interval |
5483 |
by (best intro: order_trans less_le_trans le_less_trans less_imp_le)+ |
|
5484 |
||
5485 |
lemma interval_open_subset_closed: |
|
5486 |
fixes a :: "'a::ordered_euclidean_space" |
|
5487 |
shows "{a<..<b} \<subseteq> {a .. b}" |
|
5488 |
unfolding subset_eq [unfolded Ball_def] mem_interval |
|
5489 |
by (fast intro: less_imp_le) |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5490 |
|
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5491 |
lemma subset_interval: fixes a :: "'a::ordered_euclidean_space" shows |
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
|
5492 |
"{c .. d} \<subseteq> {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) 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
|
5493 |
"{c .. d} \<subseteq> {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) 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
|
5494 |
"{c<..<d} \<subseteq> {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) 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
|
5495 |
"{c<..<d} \<subseteq> {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) |
33175 | 5496 |
proof- |
5497 |
show ?th1 unfolding subset_eq and Ball_def and mem_interval by (auto intro: order_trans) |
|
5498 |
show ?th2 unfolding subset_eq and Ball_def and mem_interval by (auto intro: le_less_trans less_le_trans order_trans less_imp_le) |
|
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
|
5499 |
{ assume as: "{c<..<d} \<subseteq> {a .. b}" "\<forall>i\<in>Basis. c\<bullet>i < d\<bullet>i" |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5500 |
hence "{c<..<d} \<noteq> {}" unfolding interval_eq_empty 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
|
5501 |
fix i :: 'a assume i:"i\<in>Basis" |
33175 | 5502 |
(** TODO combine the following two parts as done in the HOL_light version. **) |
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
|
5503 |
{ 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" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5504 |
assume as2: "a\<bullet>i > c\<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
|
5505 |
{ fix j :: 'a assume j:"j\<in>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
|
5506 |
hence "c \<bullet> j < ?x \<bullet> j \<and> ?x \<bullet> j < d \<bullet> j" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5507 |
apply(cases "j=i") using as(2)[THEN bspec[where x=j]] i |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5508 |
by (auto simp add: as2) } |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5509 |
hence "?x\<in>{c<..<d}" using i unfolding mem_interval by auto |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5510 |
moreover |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5511 |
have "?x\<notin>{a .. b}" |
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
|
5512 |
unfolding mem_interval apply auto apply(rule_tac x=i in bexI) |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5513 |
using as(2)[THEN bspec[where x=i]] and as2 i |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5514 |
by auto |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5515 |
ultimately have False using as 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
|
5516 |
hence "a\<bullet>i \<le> c\<bullet>i" by(rule ccontr)auto |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5517 |
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
|
5518 |
{ 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" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5519 |
assume as2: "b\<bullet>i < d\<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
|
5520 |
{ fix j :: 'a assume "j\<in>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
|
5521 |
hence "d \<bullet> j > ?x \<bullet> j \<and> ?x \<bullet> j > c \<bullet> j" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5522 |
apply(cases "j=i") using as(2)[THEN bspec[where x=j]] |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5523 |
by (auto simp add: as2) } |
33175 | 5524 |
hence "?x\<in>{c<..<d}" unfolding mem_interval by auto |
5525 |
moreover |
|
5526 |
have "?x\<notin>{a .. b}" |
|
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
|
5527 |
unfolding mem_interval apply auto apply(rule_tac x=i in bexI) |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5528 |
using as(2)[THEN bspec[where x=i]] and as2 using i |
36362
06475a1547cb
fix lots of looping simp calls and other warnings
huffman
parents:
36360
diff
changeset
|
5529 |
by auto |
33175 | 5530 |
ultimately have False using as 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
|
5531 |
hence "b\<bullet>i \<ge> d\<bullet>i" by(rule ccontr)auto |
33175 | 5532 |
ultimately |
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
|
5533 |
have "a\<bullet>i \<le> c\<bullet>i \<and> d\<bullet>i \<le> b\<bullet>i" by auto |
33175 | 5534 |
} note part1 = this |
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
|
5535 |
show ?th3 |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5536 |
unfolding subset_eq and Ball_def and mem_interval |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5537 |
apply(rule,rule,rule,rule) |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5538 |
apply(rule part1) |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5539 |
unfolding subset_eq and Ball_def and mem_interval |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5540 |
prefer 4 |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5541 |
apply auto |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5542 |
by(erule_tac x=xa in allE,erule_tac x=xa in allE,fastforce)+ |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5543 |
{ assume as:"{c<..<d} \<subseteq> {a<..<b}" "\<forall>i\<in>Basis. c\<bullet>i < d\<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
|
5544 |
fix i :: 'a assume i:"i\<in>Basis" |
33175 | 5545 |
from as(1) have "{c<..<d} \<subseteq> {a..b}" using interval_open_subset_closed[of a b] 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
|
5546 |
hence "a\<bullet>i \<le> c\<bullet>i \<and> d\<bullet>i \<le> b\<bullet>i" using part1 and as(2) using i by auto } note * = this |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5547 |
show ?th4 unfolding subset_eq and Ball_def and mem_interval |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5548 |
apply(rule,rule,rule,rule) apply(rule *) unfolding subset_eq and Ball_def and mem_interval prefer 4 |
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
|
5549 |
apply auto by(erule_tac x=xa in allE, simp)+ |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5550 |
qed |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5551 |
|
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5552 |
lemma inter_interval: fixes a :: "'a::ordered_euclidean_space" shows |
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
|
5553 |
"{a .. b} \<inter> {c .. d} = {(\<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)}" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5554 |
unfolding set_eq_iff and Int_iff and mem_interval by auto |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5555 |
|
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5556 |
lemma disjoint_interval: fixes a::"'a::ordered_euclidean_space" shows |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5557 |
"{a .. b} \<inter> {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) 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
|
5558 |
"{a .. b} \<inter> {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) 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
|
5559 |
"{a<..<b} \<inter> {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) 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
|
5560 |
"{a<..<b} \<inter> {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) |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5561 |
proof- |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5562 |
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" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5563 |
have **: "\<And>P Q. (\<And>i :: 'a. i \<in> Basis \<Longrightarrow> Q ?z i \<Longrightarrow> P i) \<Longrightarrow> |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5564 |
(\<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)" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5565 |
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
|
5566 |
note * = set_eq_iff Int_iff empty_iff mem_interval ball_conj_distrib[symmetric] eq_False ball_simps(10) |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5567 |
show ?th1 unfolding * by (intro **) auto |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5568 |
show ?th2 unfolding * by (intro **) auto |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5569 |
show ?th3 unfolding * by (intro **) auto |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5570 |
show ?th4 unfolding * by (intro **) auto |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5571 |
qed |
33175 | 5572 |
|
5573 |
(* Moved interval_open_subset_closed a bit upwards *) |
|
5574 |
||
44250
9133bc634d9c
simplify proofs of lemmas open_interval, closed_interval
huffman
parents:
44233
diff
changeset
|
5575 |
lemma open_interval[intro]: |
9133bc634d9c
simplify proofs of lemmas open_interval, closed_interval
huffman
parents:
44233
diff
changeset
|
5576 |
fixes a b :: "'a::ordered_euclidean_space" shows "open {a<..<b}" |
33175 | 5577 |
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
|
5578 |
have "open (\<Inter>i\<in>Basis. (\<lambda>x. x\<bullet>i) -` {a\<bullet>i<..<b\<bullet>i})" |
44250
9133bc634d9c
simplify proofs of lemmas open_interval, closed_interval
huffman
parents:
44233
diff
changeset
|
5579 |
by (intro open_INT finite_lessThan ballI continuous_open_vimage allI |
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
|
5580 |
linear_continuous_at open_real_greaterThanLessThan finite_Basis bounded_linear_inner_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
|
5581 |
also have "(\<Inter>i\<in>Basis. (\<lambda>x. x\<bullet>i) -` {a\<bullet>i<..<b\<bullet>i}) = {a<..<b}" |
44250
9133bc634d9c
simplify proofs of lemmas open_interval, closed_interval
huffman
parents:
44233
diff
changeset
|
5582 |
by (auto simp add: eucl_less [where 'a='a]) |
9133bc634d9c
simplify proofs of lemmas open_interval, closed_interval
huffman
parents:
44233
diff
changeset
|
5583 |
finally show "open {a<..<b}" . |
9133bc634d9c
simplify proofs of lemmas open_interval, closed_interval
huffman
parents:
44233
diff
changeset
|
5584 |
qed |
9133bc634d9c
simplify proofs of lemmas open_interval, closed_interval
huffman
parents:
44233
diff
changeset
|
5585 |
|
9133bc634d9c
simplify proofs of lemmas open_interval, closed_interval
huffman
parents:
44233
diff
changeset
|
5586 |
lemma closed_interval[intro]: |
9133bc634d9c
simplify proofs of lemmas open_interval, closed_interval
huffman
parents:
44233
diff
changeset
|
5587 |
fixes a b :: "'a::ordered_euclidean_space" shows "closed {a .. b}" |
33175 | 5588 |
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
|
5589 |
have "closed (\<Inter>i\<in>Basis. (\<lambda>x. x\<bullet>i) -` {a\<bullet>i .. b\<bullet>i})" |
44250
9133bc634d9c
simplify proofs of lemmas open_interval, closed_interval
huffman
parents:
44233
diff
changeset
|
5590 |
by (intro closed_INT ballI continuous_closed_vimage allI |
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
|
5591 |
linear_continuous_at closed_real_atLeastAtMost finite_Basis bounded_linear_inner_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
|
5592 |
also have "(\<Inter>i\<in>Basis. (\<lambda>x. x\<bullet>i) -` {a\<bullet>i .. b\<bullet>i}) = {a .. b}" |
44250
9133bc634d9c
simplify proofs of lemmas open_interval, closed_interval
huffman
parents:
44233
diff
changeset
|
5593 |
by (auto simp add: eucl_le [where 'a='a]) |
9133bc634d9c
simplify proofs of lemmas open_interval, closed_interval
huffman
parents:
44233
diff
changeset
|
5594 |
finally show "closed {a .. b}" . |
33175 | 5595 |
qed |
5596 |
||
44519 | 5597 |
lemma interior_closed_interval [intro]: |
5598 |
fixes a b :: "'a::ordered_euclidean_space" |
|
5599 |
shows "interior {a..b} = {a<..<b}" (is "?L = ?R") |
|
33175 | 5600 |
proof(rule subset_antisym) |
44519 | 5601 |
show "?R \<subseteq> ?L" using interval_open_subset_closed open_interval |
5602 |
by (rule interior_maximal) |
|
33175 | 5603 |
next |
44519 | 5604 |
{ fix x assume "x \<in> interior {a..b}" |
5605 |
then obtain s where s:"open s" "x \<in> s" "s \<subseteq> {a..b}" .. |
|
33175 | 5606 |
then obtain e where "e>0" and e:"\<forall>x'. dist x' x < e \<longrightarrow> x' \<in> {a..b}" unfolding open_dist and subset_eq 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
|
5607 |
{ fix i :: 'a assume i:"i\<in>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
|
5608 |
have "dist (x - (e / 2) *\<^sub>R i) x < e" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5609 |
"dist (x + (e / 2) *\<^sub>R i) x < e" |
33175 | 5610 |
unfolding dist_norm apply 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
|
5611 |
unfolding norm_minus_cancel using norm_Basis[OF i] `e>0` by auto |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5612 |
hence "a \<bullet> i \<le> (x - (e / 2) *\<^sub>R i) \<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
|
5613 |
"(x + (e / 2) *\<^sub>R i) \<bullet> i \<le> b \<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
|
5614 |
using e[THEN spec[where x="x - (e/2) *\<^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
|
5615 |
and e[THEN spec[where x="x + (e/2) *\<^sub>R i"]] |
44584 | 5616 |
unfolding mem_interval using i by blast+ |
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
|
5617 |
hence "a \<bullet> i < x \<bullet> i" and "x \<bullet> i < b \<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
|
5618 |
using `e>0` i by (auto simp: inner_diff_left inner_Basis inner_add_left) } |
33175 | 5619 |
hence "x \<in> {a<..<b}" unfolding mem_interval by auto } |
44519 | 5620 |
thus "?L \<subseteq> ?R" .. |
33175 | 5621 |
qed |
5622 |
||
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5623 |
lemma bounded_closed_interval: fixes a :: "'a::ordered_euclidean_space" shows "bounded {a .. b}" |
33175 | 5624 |
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
|
5625 |
let ?b = "\<Sum>i\<in>Basis. \<bar>a\<bullet>i\<bar> + \<bar>b\<bullet>i\<bar>" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5626 |
{ fix x::"'a" assume x:"\<forall>i\<in>Basis. a \<bullet> i \<le> x \<bullet> i \<and> x \<bullet> i \<le> b \<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
|
5627 |
{ fix i :: 'a assume "i\<in>Basis" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5628 |
hence "\<bar>x\<bullet>i\<bar> \<le> \<bar>a\<bullet>i\<bar> + \<bar>b\<bullet>i\<bar>" using x[THEN bspec[where x=i]] by auto } |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5629 |
hence "(\<Sum>i\<in>Basis. \<bar>x \<bullet> i\<bar>) \<le> ?b" apply-apply(rule setsum_mono) by auto |
33175 | 5630 |
hence "norm x \<le> ?b" using norm_le_l1[of x] by auto } |
5631 |
thus ?thesis unfolding interval and bounded_iff by auto |
|
5632 |
qed |
|
5633 |
||
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5634 |
lemma bounded_interval: fixes a :: "'a::ordered_euclidean_space" shows |
33175 | 5635 |
"bounded {a .. b} \<and> bounded {a<..<b}" |
5636 |
using bounded_closed_interval[of a b] |
|
5637 |
using interval_open_subset_closed[of a b] |
|
5638 |
using bounded_subset[of "{a..b}" "{a<..<b}"] |
|
5639 |
by simp |
|
5640 |
||
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5641 |
lemma not_interval_univ: fixes a :: "'a::ordered_euclidean_space" shows |
33175 | 5642 |
"({a .. b} \<noteq> UNIV) \<and> ({a<..<b} \<noteq> UNIV)" |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5643 |
using bounded_interval[of a b] by auto |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5644 |
|
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5645 |
lemma compact_interval: fixes a :: "'a::ordered_euclidean_space" shows "compact {a .. b}" |
50884
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
5646 |
using bounded_closed_imp_seq_compact[of "{a..b}"] using bounded_interval[of a b] |
2b21b4e2d7cb
differentiate (cover) compactness and sequential compactness
hoelzl
parents:
50883
diff
changeset
|
5647 |
by (auto simp: compact_eq_seq_compact_metric) |
33175 | 5648 |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5649 |
lemma open_interval_midpoint: fixes a :: "'a::ordered_euclidean_space" |
33175 | 5650 |
assumes "{a<..<b} \<noteq> {}" shows "((1/2) *\<^sub>R (a + b)) \<in> {a<..<b}" |
5651 |
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
|
5652 |
{ fix i :: 'a assume "i\<in>Basis" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5653 |
hence "a \<bullet> i < ((1 / 2) *\<^sub>R (a + b)) \<bullet> i \<and> ((1 / 2) *\<^sub>R (a + b)) \<bullet> i < b \<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
|
5654 |
using assms[unfolded interval_ne_empty, THEN bspec[where x=i]] by (auto simp: inner_add_left) } |
33175 | 5655 |
thus ?thesis unfolding mem_interval by auto |
5656 |
qed |
|
5657 |
||
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5658 |
lemma open_closed_interval_convex: fixes x :: "'a::ordered_euclidean_space" |
33175 | 5659 |
assumes x:"x \<in> {a<..<b}" and y:"y \<in> {a .. b}" and e:"0 < e" "e \<le> 1" |
5660 |
shows "(e *\<^sub>R x + (1 - e) *\<^sub>R y) \<in> {a<..<b}" |
|
5661 |
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
|
5662 |
{ fix i :: 'a assume i:"i\<in>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
|
5663 |
have "a \<bullet> i = e * (a \<bullet> i) + (1 - e) * (a \<bullet> i)" unfolding left_diff_distrib by simp |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5664 |
also have "\<dots> < e * (x \<bullet> i) + (1 - e) * (y \<bullet> i)" apply(rule add_less_le_mono) |
33175 | 5665 |
using e unfolding mult_less_cancel_left and mult_le_cancel_left apply simp_all |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5666 |
using x unfolding mem_interval using i apply simp |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5667 |
using y unfolding mem_interval using i apply simp |
33175 | 5668 |
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
|
5669 |
finally have "a \<bullet> i < (e *\<^sub>R x + (1 - e) *\<^sub>R y) \<bullet> i" unfolding inner_simps by auto |
33175 | 5670 |
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
|
5671 |
have "b \<bullet> i = e * (b\<bullet>i) + (1 - e) * (b\<bullet>i)" unfolding left_diff_distrib by simp |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5672 |
also have "\<dots> > e * (x \<bullet> i) + (1 - e) * (y \<bullet> i)" apply(rule add_less_le_mono) |
33175 | 5673 |
using e unfolding mult_less_cancel_left and mult_le_cancel_left apply simp_all |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5674 |
using x unfolding mem_interval using i apply simp |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5675 |
using y unfolding mem_interval using i apply simp |
33175 | 5676 |
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
|
5677 |
finally have "(e *\<^sub>R x + (1 - e) *\<^sub>R y) \<bullet> i < b \<bullet> i" unfolding inner_simps by auto |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5678 |
} 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" by auto } |
33175 | 5679 |
thus ?thesis unfolding mem_interval by auto |
5680 |
qed |
|
5681 |
||
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5682 |
lemma closure_open_interval: fixes a :: "'a::ordered_euclidean_space" |
33175 | 5683 |
assumes "{a<..<b} \<noteq> {}" |
5684 |
shows "closure {a<..<b} = {a .. b}" |
|
5685 |
proof- |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5686 |
have ab:"a < b" using assms[unfolded interval_ne_empty] apply(subst eucl_less) by auto |
33175 | 5687 |
let ?c = "(1 / 2) *\<^sub>R (a + b)" |
5688 |
{ fix x assume as:"x \<in> {a .. b}" |
|
5689 |
def f == "\<lambda>n::nat. x + (inverse (real n + 1)) *\<^sub>R (?c - x)" |
|
5690 |
{ fix n assume fn:"f n < b \<longrightarrow> a < f n \<longrightarrow> f n = x" and xc:"x \<noteq> ?c" |
|
5691 |
have *:"0 < inverse (real n + 1)" "inverse (real n + 1) \<le> 1" unfolding inverse_le_1_iff by auto |
|
5692 |
have "(inverse (real n + 1)) *\<^sub>R ((1 / 2) *\<^sub>R (a + b)) + (1 - inverse (real n + 1)) *\<^sub>R x = |
|
5693 |
x + (inverse (real n + 1)) *\<^sub>R (((1 / 2) *\<^sub>R (a + b)) - x)" |
|
5694 |
by (auto simp add: algebra_simps) |
|
5695 |
hence "f n < b" and "a < f n" using open_closed_interval_convex[OF open_interval_midpoint[OF assms] as *] unfolding f_def by auto |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5696 |
hence False using fn unfolding f_def using xc by auto } |
33175 | 5697 |
moreover |
5698 |
{ assume "\<not> (f ---> x) sequentially" |
|
5699 |
{ fix e::real assume "e>0" |
|
5700 |
hence "\<exists>N::nat. inverse (real (N + 1)) < e" using real_arch_inv[of e] apply (auto simp add: Suc_pred') apply(rule_tac x="n - 1" in exI) by auto |
|
5701 |
then obtain N::nat where "inverse (real (N + 1)) < e" by auto |
|
5702 |
hence "\<forall>n\<ge>N. inverse (real n + 1) < e" by (auto, metis Suc_le_mono le_SucE less_imp_inverse_less nat_le_real_less order_less_trans real_of_nat_Suc real_of_nat_Suc_gt_zero) |
|
5703 |
hence "\<exists>N::nat. \<forall>n\<ge>N. inverse (real n + 1) < e" by auto } |
|
5704 |
hence "((\<lambda>n. inverse (real n + 1)) ---> 0) sequentially" |
|
44907
93943da0a010
remove redundant lemma Lim_sequentially in favor of lemma LIMSEQ_def
huffman
parents:
44905
diff
changeset
|
5705 |
unfolding LIMSEQ_def by(auto simp add: dist_norm) |
33175 | 5706 |
hence "(f ---> x) sequentially" unfolding f_def |
44125 | 5707 |
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] |
44282
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
huffman
parents:
44252
diff
changeset
|
5708 |
using tendsto_scaleR [OF _ tendsto_const, of "\<lambda>n::nat. inverse (real n + 1)" 0 sequentially "((1 / 2) *\<^sub>R (a + b) - x)"] by auto } |
33175 | 5709 |
ultimately have "x \<in> closure {a<..<b}" |
5710 |
using as and open_interval_midpoint[OF assms] unfolding closure_def unfolding islimpt_sequential by(cases "x=?c")auto } |
|
5711 |
thus ?thesis using closure_minimal[OF interval_open_subset_closed closed_interval, of a b] by blast |
|
5712 |
qed |
|
5713 |
||
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5714 |
lemma bounded_subset_open_interval_symmetric: fixes s::"('a::ordered_euclidean_space) set" |
33175 | 5715 |
assumes "bounded s" shows "\<exists>a. s \<subseteq> {-a<..<a}" |
5716 |
proof- |
|
5717 |
obtain b where "b>0" and b:"\<forall>x\<in>s. norm x \<le> b" using assms[unfolded bounded_pos] 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
|
5718 |
def a \<equiv> "(\<Sum>i\<in>Basis. (b + 1) *\<^sub>R i)::'a" |
33175 | 5719 |
{ fix x assume "x\<in>s" |
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
|
5720 |
fix i :: 'a assume i:"i\<in>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
|
5721 |
hence "(-a)\<bullet>i < x\<bullet>i" and "x\<bullet>i < a\<bullet>i" using b[THEN bspec[where x=x], OF `x\<in>s`] |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5722 |
and Basis_le_norm[OF i, of x] unfolding inner_simps and a_def by auto } |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5723 |
thus ?thesis by(auto intro: exI[where x=a] simp add: eucl_less[where 'a='a]) |
33175 | 5724 |
qed |
5725 |
||
5726 |
lemma bounded_subset_open_interval: |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5727 |
fixes s :: "('a::ordered_euclidean_space) set" |
33175 | 5728 |
shows "bounded s ==> (\<exists>a b. s \<subseteq> {a<..<b})" |
5729 |
by (auto dest!: bounded_subset_open_interval_symmetric) |
|
5730 |
||
5731 |
lemma bounded_subset_closed_interval_symmetric: |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5732 |
fixes s :: "('a::ordered_euclidean_space) set" |
33175 | 5733 |
assumes "bounded s" shows "\<exists>a. s \<subseteq> {-a .. a}" |
5734 |
proof- |
|
5735 |
obtain a where "s \<subseteq> {- a<..<a}" using bounded_subset_open_interval_symmetric[OF assms] by auto |
|
5736 |
thus ?thesis using interval_open_subset_closed[of "-a" a] by auto |
|
5737 |
qed |
|
5738 |
||
5739 |
lemma bounded_subset_closed_interval: |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5740 |
fixes s :: "('a::ordered_euclidean_space) set" |
33175 | 5741 |
shows "bounded s ==> (\<exists>a b. s \<subseteq> {a .. b})" |
5742 |
using bounded_subset_closed_interval_symmetric[of s] by auto |
|
5743 |
||
5744 |
lemma frontier_closed_interval: |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5745 |
fixes a b :: "'a::ordered_euclidean_space" |
33175 | 5746 |
shows "frontier {a .. b} = {a .. b} - {a<..<b}" |
5747 |
unfolding frontier_def unfolding interior_closed_interval and closure_closed[OF closed_interval] .. |
|
5748 |
||
5749 |
lemma frontier_open_interval: |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5750 |
fixes a b :: "'a::ordered_euclidean_space" |
33175 | 5751 |
shows "frontier {a<..<b} = (if {a<..<b} = {} then {} else {a .. b} - {a<..<b})" |
5752 |
proof(cases "{a<..<b} = {}") |
|
5753 |
case True thus ?thesis using frontier_empty by auto |
|
5754 |
next |
|
5755 |
case False thus ?thesis unfolding frontier_def and closure_open_interval[OF False] and interior_open[OF open_interval] by auto |
|
5756 |
qed |
|
5757 |
||
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5758 |
lemma inter_interval_mixed_eq_empty: fixes a :: "'a::ordered_euclidean_space" |
33175 | 5759 |
assumes "{c<..<d} \<noteq> {}" shows "{a<..<b} \<inter> {c .. d} = {} \<longleftrightarrow> {a<..<b} \<inter> {c<..<d} = {}" |
5760 |
unfolding closure_open_interval[OF assms, THEN sym] unfolding open_inter_closure_eq_empty[OF open_interval] .. |
|
5761 |
||
5762 |
||
5763 |
(* Some stuff for half-infinite intervals too; FIXME: notation? *) |
|
5764 |
||
37673
f69f4b079275
generalize more lemmas from ordered_euclidean_space to euclidean_space
huffman
parents:
37649
diff
changeset
|
5765 |
lemma closed_interval_left: fixes b::"'a::euclidean_space" |
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
|
5766 |
shows "closed {x::'a. \<forall>i\<in>Basis. x\<bullet>i \<le> b\<bullet>i}" |
33175 | 5767 |
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
|
5768 |
{ fix i :: 'a assume i:"i\<in>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
|
5769 |
fix x::"'a" assume x:"\<forall>e>0. \<exists>x'\<in>{x. \<forall>i\<in>Basis. x \<bullet> i \<le> b \<bullet> i}. x' \<noteq> x \<and> dist x' x < e" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5770 |
{ assume "x\<bullet>i > b\<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
|
5771 |
then obtain y where "y \<bullet> i \<le> b \<bullet> i" "y \<noteq> x" "dist y x < x\<bullet>i - b\<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
|
5772 |
using x[THEN spec[where x="x\<bullet>i - b\<bullet>i"]] using i by auto |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5773 |
hence False using Basis_le_norm[OF i, of "y - x"] unfolding dist_norm inner_simps using 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
|
5774 |
by auto } |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5775 |
hence "x\<bullet>i \<le> b\<bullet>i" by(rule ccontr)auto } |
33175 | 5776 |
thus ?thesis unfolding closed_limpt unfolding islimpt_approachable by blast |
5777 |
qed |
|
5778 |
||
37673
f69f4b079275
generalize more lemmas from ordered_euclidean_space to euclidean_space
huffman
parents:
37649
diff
changeset
|
5779 |
lemma closed_interval_right: fixes a::"'a::euclidean_space" |
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
|
5780 |
shows "closed {x::'a. \<forall>i\<in>Basis. a\<bullet>i \<le> x\<bullet>i}" |
33175 | 5781 |
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
|
5782 |
{ fix i :: 'a assume i:"i\<in>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
|
5783 |
fix x::"'a" assume x:"\<forall>e>0. \<exists>x'\<in>{x. \<forall>i\<in>Basis. a \<bullet> i \<le> x \<bullet> i}. x' \<noteq> x \<and> dist x' x < e" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5784 |
{ assume "a\<bullet>i > x\<bullet>i" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5785 |
then obtain y where "a \<bullet> i \<le> y \<bullet> i" "y \<noteq> x" "dist y x < a\<bullet>i - x\<bullet>i" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5786 |
using x[THEN spec[where x="a\<bullet>i - x\<bullet>i"]] i by auto |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5787 |
hence False using Basis_le_norm[OF i, of "y - x"] unfolding dist_norm inner_simps by auto } |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5788 |
hence "a\<bullet>i \<le> x\<bullet>i" by(rule ccontr)auto } |
33175 | 5789 |
thus ?thesis unfolding closed_limpt unfolding islimpt_approachable by blast |
5790 |
qed |
|
5791 |
||
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
|
5792 |
lemma open_box: "open (box a 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
|
5793 |
proof - |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5794 |
have "open (\<Inter>i\<in>Basis. (op \<bullet> i) -` {a \<bullet> i <..< b \<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
|
5795 |
by (auto intro!: continuous_open_vimage continuous_inner continuous_at_id continuous_const) |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5796 |
also have "(\<Inter>i\<in>Basis. (op \<bullet> i) -` {a \<bullet> i <..< b \<bullet> i}) = box a 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
|
5797 |
by (auto simp add: box_def inner_commute) |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5798 |
finally 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
|
5799 |
qed |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5800 |
|
50881
ae630bab13da
renamed countable_basis_space to second_countable_topology
hoelzl
parents:
50526
diff
changeset
|
5801 |
instance euclidean_space \<subseteq> second_countable_topology |
50087 | 5802 |
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
|
5803 |
def a \<equiv> "\<lambda>f :: 'a \<Rightarrow> (real \<times> real). \<Sum>i\<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
|
5804 |
then have a: "\<And>f. (\<Sum>i\<in>Basis. fst (f i) *\<^sub>R i) = a f" by simp |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5805 |
def b \<equiv> "\<lambda>f :: 'a \<Rightarrow> (real \<times> real). \<Sum>i\<in>Basis. snd (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
|
5806 |
then have b: "\<And>f. (\<Sum>i\<in>Basis. snd (f i) *\<^sub>R i) = b f" by simp |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5807 |
def B \<equiv> "(\<lambda>f. box (a f) (b f)) ` (Basis \<rightarrow>\<^isub>E (\<rat> \<times> \<rat>))" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5808 |
|
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5809 |
have "countable B" unfolding B_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
|
5810 |
by (intro countable_image countable_PiE finite_Basis countable_SIGMA countable_rat) |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
5811 |
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
|
5812 |
have "Ball B open" by (simp add: B_def open_box) |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5813 |
moreover have "(\<forall>A. open A \<longrightarrow> (\<exists>B'\<subseteq>B. \<Union>B' = A))" |
50087 | 5814 |
proof safe |
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
|
5815 |
fix A::"'a set" assume "open A" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5816 |
show "\<exists>B'\<subseteq>B. \<Union>B' = A" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5817 |
apply (rule exI[of _ "{b\<in>B. b \<subseteq> A}"]) |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5818 |
apply (subst (3) open_UNION_box[OF `open A`]) |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5819 |
apply (auto simp add: a b B_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
|
5820 |
done |
50087 | 5821 |
qed |
5822 |
ultimately |
|
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50105
diff
changeset
|
5823 |
show "\<exists>B::'a set set. countable B \<and> topological_basis B" unfolding topological_basis_def by blast |
50087 | 5824 |
qed |
5825 |
||
5826 |
instance ordered_euclidean_space \<subseteq> polish_space .. |
|
5827 |
||
36439 | 5828 |
text {* Intervals in general, including infinite and mixtures of open and closed. *} |
33175 | 5829 |
|
37732
6432bf0d7191
generalize type of is_interval to class euclidean_space
huffman
parents:
37680
diff
changeset
|
5830 |
definition "is_interval (s::('a::euclidean_space) set) \<longleftrightarrow> |
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
|
5831 |
(\<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)" |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5832 |
|
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
5833 |
lemma is_interval_interval: "is_interval {a .. b::'a::ordered_euclidean_space}" (is ?th1) |
39086
c4b809e57fe0
preimages of open sets over continuous function are open
hoelzl
parents:
38656
diff
changeset
|
5834 |
"is_interval {a<..<b}" (is ?th2) proof - |
33175 | 5835 |
show ?th1 ?th2 unfolding is_interval_def mem_interval Ball_def atLeastAtMost_iff |
44584 | 5836 |
by(meson order_trans le_less_trans less_le_trans less_trans)+ qed |
33175 | 5837 |
|
5838 |
lemma is_interval_empty: |
|
5839 |
"is_interval {}" |
|
5840 |
unfolding is_interval_def |
|
5841 |
by simp |
|
5842 |
||
5843 |
lemma is_interval_univ: |
|
5844 |
"is_interval UNIV" |
|
5845 |
unfolding is_interval_def |
|
5846 |
by simp |
|
5847 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
5848 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
5849 |
subsection {* Closure of halfspaces and hyperplanes *} |
33175 | 5850 |
|
44219
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
5851 |
lemma isCont_open_vimage: |
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
5852 |
assumes "\<And>x. isCont f x" and "open s" shows "open (f -` s)" |
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
5853 |
proof - |
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
5854 |
from assms(1) have "continuous_on UNIV f" |
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
5855 |
unfolding isCont_def continuous_on_def within_UNIV by simp |
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
5856 |
hence "open {x \<in> UNIV. f x \<in> s}" |
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
5857 |
using open_UNIV `open s` by (rule continuous_open_preimage) |
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
5858 |
thus "open (f -` s)" |
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
5859 |
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
|
5860 |
qed |
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
5861 |
|
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
5862 |
lemma isCont_closed_vimage: |
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
5863 |
assumes "\<And>x. isCont f x" and "closed s" shows "closed (f -` s)" |
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
5864 |
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
|
5865 |
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
|
5866 |
|
44213
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
5867 |
lemma open_Collect_less: |
44219
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
5868 |
fixes f g :: "'a::topological_space \<Rightarrow> real" |
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
5869 |
assumes f: "\<And>x. isCont f x" |
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
5870 |
assumes g: "\<And>x. isCont g x" |
44213
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
5871 |
shows "open {x. f x < g x}" |
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
5872 |
proof - |
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
5873 |
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
|
5874 |
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
|
5875 |
by (rule isCont_open_vimage) |
44213
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
5876 |
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
|
5877 |
by auto |
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
5878 |
finally show ?thesis . |
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
5879 |
qed |
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
5880 |
|
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
5881 |
lemma closed_Collect_le: |
44219
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
5882 |
fixes f g :: "'a::topological_space \<Rightarrow> real" |
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
5883 |
assumes f: "\<And>x. isCont f x" |
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
5884 |
assumes g: "\<And>x. isCont g x" |
44213
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
5885 |
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
|
5886 |
proof - |
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
5887 |
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
|
5888 |
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
|
5889 |
by (rule isCont_closed_vimage) |
44213
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
5890 |
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
|
5891 |
by auto |
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
5892 |
finally show ?thesis . |
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
5893 |
qed |
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
5894 |
|
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
5895 |
lemma closed_Collect_eq: |
44219
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
5896 |
fixes f g :: "'a::topological_space \<Rightarrow> 'b::t2_space" |
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
5897 |
assumes f: "\<And>x. isCont f x" |
f738e3200e24
generalize lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq to class topological_space
huffman
parents:
44216
diff
changeset
|
5898 |
assumes g: "\<And>x. isCont g x" |
44213
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
5899 |
shows "closed {x. f x = g x}" |
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
5900 |
proof - |
44216 | 5901 |
have "open {(x::'b, y::'b). x \<noteq> y}" |
5902 |
unfolding open_prod_def by (auto dest!: hausdorff) |
|
5903 |
hence "closed {(x::'b, y::'b). x = y}" |
|
5904 |
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
|
5905 |
with isCont_Pair [OF f g] |
44216 | 5906 |
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
|
5907 |
by (rule isCont_closed_vimage) |
44216 | 5908 |
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
|
5909 |
finally show ?thesis . |
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
5910 |
qed |
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44212
diff
changeset
|
5911 |
|
33175 | 5912 |
lemma continuous_at_inner: "continuous (at x) (inner a)" |
5913 |
unfolding continuous_at by (intro tendsto_intros) |
|
5914 |
||
5915 |
lemma closed_halfspace_le: "closed {x. inner a x \<le> b}" |
|
44233 | 5916 |
by (simp add: closed_Collect_le) |
33175 | 5917 |
|
5918 |
lemma closed_halfspace_ge: "closed {x. inner a x \<ge> b}" |
|
44233 | 5919 |
by (simp add: closed_Collect_le) |
33175 | 5920 |
|
5921 |
lemma closed_hyperplane: "closed {x. inner a x = b}" |
|
44233 | 5922 |
by (simp add: closed_Collect_eq) |
33175 | 5923 |
|
5924 |
lemma closed_halfspace_component_le: |
|
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
|
5925 |
shows "closed {x::'a::euclidean_space. x\<bullet>i \<le> a}" |
44233 | 5926 |
by (simp add: closed_Collect_le) |
33175 | 5927 |
|
5928 |
lemma closed_halfspace_component_ge: |
|
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
|
5929 |
shows "closed {x::'a::euclidean_space. x\<bullet>i \<ge> a}" |
44233 | 5930 |
by (simp add: closed_Collect_le) |
33175 | 5931 |
|
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
5932 |
text {* Openness of halfspaces. *} |
33175 | 5933 |
|
5934 |
lemma open_halfspace_lt: "open {x. inner a x < b}" |
|
44233 | 5935 |
by (simp add: open_Collect_less) |
33175 | 5936 |
|
5937 |
lemma open_halfspace_gt: "open {x. inner a x > b}" |
|
44233 | 5938 |
by (simp add: open_Collect_less) |
33175 | 5939 |
|
5940 |
lemma open_halfspace_component_lt: |
|
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
|
5941 |
shows "open {x::'a::euclidean_space. x\<bullet>i < a}" |
44233 | 5942 |
by (simp add: open_Collect_less) |
33175 | 5943 |
|
5944 |
lemma open_halfspace_component_gt: |
|
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
|
5945 |
shows "open {x::'a::euclidean_space. x\<bullet>i > a}" |
44233 | 5946 |
by (simp add: open_Collect_less) |
33175 | 5947 |
|
38656 | 5948 |
text{* Instantiation for intervals on @{text ordered_euclidean_space} *} |
5949 |
||
5950 |
lemma eucl_lessThan_eq_halfspaces: |
|
5951 |
fixes a :: "'a\<Colon>ordered_euclidean_space" |
|
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
|
5952 |
shows "{..<a} = (\<Inter>i\<in>Basis. {x. x \<bullet> i < a \<bullet> i})" |
38656 | 5953 |
by (auto simp: eucl_less[where 'a='a]) |
5954 |
||
5955 |
lemma eucl_greaterThan_eq_halfspaces: |
|
5956 |
fixes a :: "'a\<Colon>ordered_euclidean_space" |
|
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
|
5957 |
shows "{a<..} = (\<Inter>i\<in>Basis. {x. a \<bullet> i < x \<bullet> i})" |
38656 | 5958 |
by (auto simp: eucl_less[where 'a='a]) |
5959 |
||
5960 |
lemma eucl_atMost_eq_halfspaces: |
|
5961 |
fixes a :: "'a\<Colon>ordered_euclidean_space" |
|
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
|
5962 |
shows "{.. a} = (\<Inter>i\<in>Basis. {x. x \<bullet> i \<le> a \<bullet> i})" |
38656 | 5963 |
by (auto simp: eucl_le[where 'a='a]) |
5964 |
||
5965 |
lemma eucl_atLeast_eq_halfspaces: |
|
5966 |
fixes a :: "'a\<Colon>ordered_euclidean_space" |
|
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
|
5967 |
shows "{a ..} = (\<Inter>i\<in>Basis. {x. a \<bullet> i \<le> x \<bullet> i})" |
38656 | 5968 |
by (auto simp: eucl_le[where 'a='a]) |
5969 |
||
5970 |
lemma open_eucl_lessThan[simp, intro]: |
|
5971 |
fixes a :: "'a\<Colon>ordered_euclidean_space" |
|
5972 |
shows "open {..< a}" |
|
5973 |
by (auto simp: eucl_lessThan_eq_halfspaces open_halfspace_component_lt) |
|
5974 |
||
5975 |
lemma open_eucl_greaterThan[simp, intro]: |
|
5976 |
fixes a :: "'a\<Colon>ordered_euclidean_space" |
|
5977 |
shows "open {a <..}" |
|
5978 |
by (auto simp: eucl_greaterThan_eq_halfspaces open_halfspace_component_gt) |
|
5979 |
||
5980 |
lemma closed_eucl_atMost[simp, intro]: |
|
5981 |
fixes a :: "'a\<Colon>ordered_euclidean_space" |
|
5982 |
shows "closed {.. a}" |
|
5983 |
unfolding eucl_atMost_eq_halfspaces |
|
44233 | 5984 |
by (simp add: closed_INT closed_Collect_le) |
38656 | 5985 |
|
5986 |
lemma closed_eucl_atLeast[simp, intro]: |
|
5987 |
fixes a :: "'a\<Colon>ordered_euclidean_space" |
|
5988 |
shows "closed {a ..}" |
|
5989 |
unfolding eucl_atLeast_eq_halfspaces |
|
44233 | 5990 |
by (simp add: closed_INT closed_Collect_le) |
38656 | 5991 |
|
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
5992 |
text {* This gives a simple derivation of limit component bounds. *} |
33175 | 5993 |
|
37673
f69f4b079275
generalize more lemmas from ordered_euclidean_space to euclidean_space
huffman
parents:
37649
diff
changeset
|
5994 |
lemma Lim_component_le: fixes f :: "'a \<Rightarrow> 'b::euclidean_space" |
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
|
5995 |
assumes "(f ---> l) net" "\<not> (trivial_limit net)" "eventually (\<lambda>x. f(x)\<bullet>i \<le> b) net" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
5996 |
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
|
5997 |
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
|
5998 |
|
37673
f69f4b079275
generalize more lemmas from ordered_euclidean_space to euclidean_space
huffman
parents:
37649
diff
changeset
|
5999 |
lemma Lim_component_ge: fixes f :: "'a \<Rightarrow> 'b::euclidean_space" |
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
|
6000 |
assumes "(f ---> l) net" "\<not> (trivial_limit net)" "eventually (\<lambda>x. b \<le> (f x)\<bullet>i) net" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
6001 |
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
|
6002 |
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
|
6003 |
|
37673
f69f4b079275
generalize more lemmas from ordered_euclidean_space to euclidean_space
huffman
parents:
37649
diff
changeset
|
6004 |
lemma Lim_component_eq: fixes f :: "'a \<Rightarrow> 'b::euclidean_space" |
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
|
6005 |
assumes net:"(f ---> l) net" "~(trivial_limit net)" and ev:"eventually (\<lambda>x. f(x)\<bullet>i = b) net" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
6006 |
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
|
6007 |
using ev[unfolded order_eq_iff eventually_conj_iff] |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
6008 |
using Lim_component_ge[OF net, of b i] and Lim_component_le[OF net, of i b] by auto |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
6009 |
|
33175 | 6010 |
text{* Limits relative to a union. *} |
6011 |
||
6012 |
lemma eventually_within_Un: |
|
6013 |
"eventually P (net within (s \<union> t)) \<longleftrightarrow> |
|
6014 |
eventually P (net within s) \<and> eventually P (net within t)" |
|
6015 |
unfolding Limits.eventually_within |
|
6016 |
by (auto elim!: eventually_rev_mp) |
|
6017 |
||
6018 |
lemma Lim_within_union: |
|
6019 |
"(f ---> l) (net within (s \<union> t)) \<longleftrightarrow> |
|
6020 |
(f ---> l) (net within s) \<and> (f ---> l) (net within t)" |
|
6021 |
unfolding tendsto_def |
|
6022 |
by (auto simp add: eventually_within_Un) |
|
6023 |
||
36442 | 6024 |
lemma Lim_topological: |
6025 |
"(f ---> l) net \<longleftrightarrow> |
|
6026 |
trivial_limit net \<or> |
|
6027 |
(\<forall>S. open S \<longrightarrow> l \<in> S \<longrightarrow> eventually (\<lambda>x. f x \<in> S) net)" |
|
6028 |
unfolding tendsto_def trivial_limit_eq by auto |
|
6029 |
||
33175 | 6030 |
lemma continuous_on_union: |
6031 |
assumes "closed s" "closed t" "continuous_on s f" "continuous_on t f" |
|
6032 |
shows "continuous_on (s \<union> t) f" |
|
36442 | 6033 |
using assms unfolding continuous_on Lim_within_union |
6034 |
unfolding Lim_topological trivial_limit_within closed_limpt by auto |
|
33175 | 6035 |
|
6036 |
lemma continuous_on_cases: |
|
6037 |
assumes "closed s" "closed t" "continuous_on s f" "continuous_on t g" |
|
6038 |
"\<forall>x. (x\<in>s \<and> \<not> P x) \<or> (x \<in> t \<and> P x) \<longrightarrow> f x = g x" |
|
6039 |
shows "continuous_on (s \<union> t) (\<lambda>x. if P x then f x else g x)" |
|
6040 |
proof- |
|
6041 |
let ?h = "(\<lambda>x. if P x then f x else g x)" |
|
6042 |
have "\<forall>x\<in>s. f x = (if P x then f x else g x)" using assms(5) by auto |
|
6043 |
hence "continuous_on s ?h" using continuous_on_eq[of s f ?h] using assms(3) by auto |
|
6044 |
moreover |
|
6045 |
have "\<forall>x\<in>t. g x = (if P x then f x else g x)" using assms(5) by auto |
|
6046 |
hence "continuous_on t ?h" using continuous_on_eq[of t g ?h] using assms(4) by auto |
|
6047 |
ultimately show ?thesis using continuous_on_union[OF assms(1,2), of ?h] by auto |
|
6048 |
qed |
|
6049 |
||
6050 |
||
6051 |
text{* Some more convenient intermediate-value theorem formulations. *} |
|
6052 |
||
6053 |
lemma connected_ivt_hyperplane: |
|
6054 |
assumes "connected s" "x \<in> s" "y \<in> s" "inner a x \<le> b" "b \<le> inner a y" |
|
6055 |
shows "\<exists>z \<in> s. inner a z = b" |
|
6056 |
proof(rule ccontr) |
|
6057 |
assume as:"\<not> (\<exists>z\<in>s. inner a z = b)" |
|
6058 |
let ?A = "{x. inner a x < b}" |
|
6059 |
let ?B = "{x. inner a x > b}" |
|
6060 |
have "open ?A" "open ?B" using open_halfspace_lt and open_halfspace_gt by auto |
|
6061 |
moreover have "?A \<inter> ?B = {}" by auto |
|
6062 |
moreover have "s \<subseteq> ?A \<union> ?B" using as by auto |
|
6063 |
ultimately show False using assms(1)[unfolded connected_def not_ex, THEN spec[where x="?A"], THEN spec[where x="?B"]] and assms(2-5) by auto |
|
6064 |
qed |
|
6065 |
||
37673
f69f4b079275
generalize more lemmas from ordered_euclidean_space to euclidean_space
huffman
parents:
37649
diff
changeset
|
6066 |
lemma connected_ivt_component: fixes x::"'a::euclidean_space" shows |
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
|
6067 |
"connected s \<Longrightarrow> x \<in> s \<Longrightarrow> y \<in> s \<Longrightarrow> x\<bullet>k \<le> a \<Longrightarrow> a \<le> y\<bullet>k \<Longrightarrow> (\<exists>z\<in>s. z\<bullet>k = a)" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
6068 |
using connected_ivt_hyperplane[of s x y "k::'a" a] by (auto simp: inner_commute) |
33175 | 6069 |
|
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
6070 |
|
36437 | 6071 |
subsection {* Homeomorphisms *} |
33175 | 6072 |
|
6073 |
definition "homeomorphism s t f g \<equiv> |
|
6074 |
(\<forall>x\<in>s. (g(f x) = x)) \<and> (f ` s = t) \<and> continuous_on s f \<and> |
|
6075 |
(\<forall>y\<in>t. (f(g y) = y)) \<and> (g ` t = s) \<and> continuous_on t g" |
|
6076 |
||
6077 |
definition |
|
50898 | 6078 |
homeomorphic :: "'a::topological_space set \<Rightarrow> 'b::topological_space set \<Rightarrow> bool" |
33175 | 6079 |
(infixr "homeomorphic" 60) where |
6080 |
homeomorphic_def: "s homeomorphic t \<equiv> (\<exists>f g. homeomorphism s t f g)" |
|
6081 |
||
6082 |
lemma homeomorphic_refl: "s homeomorphic s" |
|
6083 |
unfolding homeomorphic_def |
|
6084 |
unfolding homeomorphism_def |
|
6085 |
using continuous_on_id |
|
6086 |
apply(rule_tac x = "(\<lambda>x. x)" in exI) |
|
6087 |
apply(rule_tac x = "(\<lambda>x. x)" in exI) |
|
6088 |
by blast |
|
6089 |
||
6090 |
lemma homeomorphic_sym: |
|
6091 |
"s homeomorphic t \<longleftrightarrow> t homeomorphic s" |
|
6092 |
unfolding homeomorphic_def |
|
6093 |
unfolding homeomorphism_def |
|
33324 | 6094 |
by blast |
33175 | 6095 |
|
6096 |
lemma homeomorphic_trans: |
|
6097 |
assumes "s homeomorphic t" "t homeomorphic u" shows "s homeomorphic u" |
|
6098 |
proof- |
|
6099 |
obtain f1 g1 where fg1:"\<forall>x\<in>s. g1 (f1 x) = x" "f1 ` s = t" "continuous_on s f1" "\<forall>y\<in>t. f1 (g1 y) = y" "g1 ` t = s" "continuous_on t g1" |
|
6100 |
using assms(1) unfolding homeomorphic_def homeomorphism_def by auto |
|
6101 |
obtain f2 g2 where fg2:"\<forall>x\<in>t. g2 (f2 x) = x" "f2 ` t = u" "continuous_on t f2" "\<forall>y\<in>u. f2 (g2 y) = y" "g2 ` u = t" "continuous_on u g2" |
|
6102 |
using assms(2) unfolding homeomorphic_def homeomorphism_def by auto |
|
6103 |
||
6104 |
{ fix x assume "x\<in>s" hence "(g1 \<circ> g2) ((f2 \<circ> f1) x) = x" using fg1(1)[THEN bspec[where x=x]] and fg2(1)[THEN bspec[where x="f1 x"]] and fg1(2) by auto } |
|
6105 |
moreover have "(f2 \<circ> f1) ` s = u" using fg1(2) fg2(2) by auto |
|
6106 |
moreover have "continuous_on s (f2 \<circ> f1)" using continuous_on_compose[OF fg1(3)] and fg2(3) unfolding fg1(2) by auto |
|
6107 |
moreover { fix y assume "y\<in>u" hence "(f2 \<circ> f1) ((g1 \<circ> g2) y) = y" using fg2(4)[THEN bspec[where x=y]] and fg1(4)[THEN bspec[where x="g2 y"]] and fg2(5) by auto } |
|
6108 |
moreover have "(g1 \<circ> g2) ` u = s" using fg1(5) fg2(5) by auto |
|
6109 |
moreover have "continuous_on u (g1 \<circ> g2)" using continuous_on_compose[OF fg2(6)] and fg1(6) unfolding fg2(5) by auto |
|
6110 |
ultimately show ?thesis unfolding homeomorphic_def homeomorphism_def apply(rule_tac x="f2 \<circ> f1" in exI) apply(rule_tac x="g1 \<circ> g2" in exI) by auto |
|
6111 |
qed |
|
6112 |
||
6113 |
lemma homeomorphic_minimal: |
|
6114 |
"s homeomorphic t \<longleftrightarrow> |
|
6115 |
(\<exists>f g. (\<forall>x\<in>s. f(x) \<in> t \<and> (g(f(x)) = x)) \<and> |
|
6116 |
(\<forall>y\<in>t. g(y) \<in> s \<and> (f(g(y)) = y)) \<and> |
|
6117 |
continuous_on s f \<and> continuous_on t g)" |
|
6118 |
unfolding homeomorphic_def homeomorphism_def |
|
6119 |
apply auto apply (rule_tac x=f in exI) apply (rule_tac x=g in exI) |
|
6120 |
apply auto apply (rule_tac x=f in exI) apply (rule_tac x=g in exI) apply auto |
|
6121 |
unfolding image_iff |
|
6122 |
apply(erule_tac x="g x" in ballE) apply(erule_tac x="x" in ballE) |
|
6123 |
apply auto apply(rule_tac x="g x" in bexI) apply auto |
|
6124 |
apply(erule_tac x="f x" in ballE) apply(erule_tac x="x" in ballE) |
|
6125 |
apply auto apply(rule_tac x="f x" in bexI) by auto |
|
6126 |
||
36437 | 6127 |
text {* Relatively weak hypotheses if a set is compact. *} |
33175 | 6128 |
|
6129 |
lemma homeomorphism_compact: |
|
50898 | 6130 |
fixes f :: "'a::topological_space \<Rightarrow> 'b::t2_space" |
33175 | 6131 |
assumes "compact s" "continuous_on s f" "f ` s = t" "inj_on f s" |
6132 |
shows "\<exists>g. homeomorphism s t f g" |
|
6133 |
proof- |
|
6134 |
def g \<equiv> "\<lambda>x. SOME y. y\<in>s \<and> f y = x" |
|
6135 |
have g:"\<forall>x\<in>s. g (f x) = x" using assms(3) assms(4)[unfolded inj_on_def] unfolding g_def by auto |
|
6136 |
{ fix y assume "y\<in>t" |
|
6137 |
then obtain x where x:"f x = y" "x\<in>s" using assms(3) by auto |
|
6138 |
hence "g (f x) = x" using g by auto |
|
6139 |
hence "f (g y) = y" unfolding x(1)[THEN sym] by auto } |
|
6140 |
hence g':"\<forall>x\<in>t. f (g x) = x" by auto |
|
6141 |
moreover |
|
6142 |
{ fix x |
|
6143 |
have "x\<in>s \<Longrightarrow> x \<in> g ` t" using g[THEN bspec[where x=x]] unfolding image_iff using assms(3) by(auto intro!: bexI[where x="f x"]) |
|
6144 |
moreover |
|
6145 |
{ assume "x\<in>g ` t" |
|
6146 |
then obtain y where y:"y\<in>t" "g y = x" by auto |
|
6147 |
then obtain x' where x':"x'\<in>s" "f x' = y" using assms(3) by auto |
|
6148 |
hence "x \<in> s" unfolding g_def using someI2[of "\<lambda>b. b\<in>s \<and> f b = y" x' "\<lambda>x. x\<in>s"] unfolding y(2)[THEN sym] and g_def by auto } |
|
36362
06475a1547cb
fix lots of looping simp calls and other warnings
huffman
parents:
36360
diff
changeset
|
6149 |
ultimately have "x\<in>s \<longleftrightarrow> x \<in> g ` t" .. } |
33175 | 6150 |
hence "g ` t = s" by auto |
6151 |
ultimately |
|
6152 |
show ?thesis unfolding homeomorphism_def homeomorphic_def |
|
44647
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44632
diff
changeset
|
6153 |
apply(rule_tac x=g in exI) using g and assms(3) and continuous_on_inv[OF assms(2,1), of g, unfolded assms(3)] and assms(2) by auto |
33175 | 6154 |
qed |
6155 |
||
6156 |
lemma homeomorphic_compact: |
|
50898 | 6157 |
fixes f :: "'a::topological_space \<Rightarrow> 'b::t2_space" |
33175 | 6158 |
shows "compact s \<Longrightarrow> continuous_on s f \<Longrightarrow> (f ` s = t) \<Longrightarrow> inj_on f s |
6159 |
\<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
|
6160 |
unfolding homeomorphic_def by (metis homeomorphism_compact) |
33175 | 6161 |
|
6162 |
text{* Preservation of topological properties. *} |
|
6163 |
||
6164 |
lemma homeomorphic_compactness: |
|
6165 |
"s homeomorphic t ==> (compact s \<longleftrightarrow> compact t)" |
|
6166 |
unfolding homeomorphic_def homeomorphism_def |
|
6167 |
by (metis compact_continuous_image) |
|
6168 |
||
6169 |
text{* Results on translation, scaling etc. *} |
|
6170 |
||
6171 |
lemma homeomorphic_scaling: |
|
6172 |
fixes s :: "'a::real_normed_vector set" |
|
6173 |
assumes "c \<noteq> 0" shows "s homeomorphic ((\<lambda>x. c *\<^sub>R x) ` s)" |
|
6174 |
unfolding homeomorphic_minimal |
|
6175 |
apply(rule_tac x="\<lambda>x. c *\<^sub>R x" in exI) |
|
6176 |
apply(rule_tac x="\<lambda>x. (1 / c) *\<^sub>R x" in exI) |
|
44531
1d477a2b1572
replace some continuous_on lemmas with more general versions
huffman
parents:
44530
diff
changeset
|
6177 |
using assms by (auto simp add: continuous_on_intros) |
33175 | 6178 |
|
6179 |
lemma homeomorphic_translation: |
|
6180 |
fixes s :: "'a::real_normed_vector set" |
|
6181 |
shows "s homeomorphic ((\<lambda>x. a + x) ` s)" |
|
6182 |
unfolding homeomorphic_minimal |
|
6183 |
apply(rule_tac x="\<lambda>x. a + x" in exI) |
|
6184 |
apply(rule_tac x="\<lambda>x. -a + x" in exI) |
|
6185 |
using continuous_on_add[OF continuous_on_const continuous_on_id] by auto |
|
6186 |
||
6187 |
lemma homeomorphic_affinity: |
|
6188 |
fixes s :: "'a::real_normed_vector set" |
|
6189 |
assumes "c \<noteq> 0" shows "s homeomorphic ((\<lambda>x. a + c *\<^sub>R x) ` s)" |
|
6190 |
proof- |
|
6191 |
have *:"op + a ` op *\<^sub>R c ` s = (\<lambda>x. a + c *\<^sub>R x) ` s" by auto |
|
6192 |
show ?thesis |
|
6193 |
using homeomorphic_trans |
|
6194 |
using homeomorphic_scaling[OF assms, of s] |
|
6195 |
using homeomorphic_translation[of "(\<lambda>x. c *\<^sub>R x) ` s" a] unfolding * by auto |
|
6196 |
qed |
|
6197 |
||
6198 |
lemma homeomorphic_balls: |
|
50898 | 6199 |
fixes a b ::"'a::real_normed_vector" |
33175 | 6200 |
assumes "0 < d" "0 < e" |
6201 |
shows "(ball a d) homeomorphic (ball b e)" (is ?th) |
|
6202 |
"(cball a d) homeomorphic (cball b e)" (is ?cth) |
|
6203 |
proof- |
|
6204 |
show ?th unfolding homeomorphic_minimal |
|
6205 |
apply(rule_tac x="\<lambda>x. b + (e/d) *\<^sub>R (x - a)" in exI) |
|
6206 |
apply(rule_tac x="\<lambda>x. a + (d/e) *\<^sub>R (x - b)" in exI) |
|
6207 |
using assms apply (auto simp add: dist_commute) |
|
6208 |
unfolding dist_norm |
|
6209 |
apply (auto simp add: pos_divide_less_eq mult_strict_left_mono) |
|
6210 |
unfolding continuous_on |
|
36659
f794e92784aa
adapt to removed premise on tendsto lemma (cf. 88f0125c3bd2)
huffman
parents:
36623
diff
changeset
|
6211 |
by (intro ballI tendsto_intros, simp)+ |
33175 | 6212 |
next |
6213 |
show ?cth unfolding homeomorphic_minimal |
|
6214 |
apply(rule_tac x="\<lambda>x. b + (e/d) *\<^sub>R (x - a)" in exI) |
|
6215 |
apply(rule_tac x="\<lambda>x. a + (d/e) *\<^sub>R (x - b)" in exI) |
|
6216 |
using assms apply (auto simp add: dist_commute) |
|
6217 |
unfolding dist_norm |
|
6218 |
apply (auto simp add: pos_divide_le_eq) |
|
6219 |
unfolding continuous_on |
|
36659
f794e92784aa
adapt to removed premise on tendsto lemma (cf. 88f0125c3bd2)
huffman
parents:
36623
diff
changeset
|
6220 |
by (intro ballI tendsto_intros, simp)+ |
33175 | 6221 |
qed |
6222 |
||
6223 |
text{* "Isometry" (up to constant bounds) of injective linear map etc. *} |
|
6224 |
||
6225 |
lemma cauchy_isometric: |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
6226 |
fixes x :: "nat \<Rightarrow> 'a::euclidean_space" |
33175 | 6227 |
assumes e:"0 < e" and s:"subspace s" and f:"bounded_linear f" and normf:"\<forall>x\<in>s. norm(f x) \<ge> e * norm(x)" and xs:"\<forall>n::nat. x n \<in> s" and cf:"Cauchy(f o x)" |
6228 |
shows "Cauchy x" |
|
6229 |
proof- |
|
6230 |
interpret f: bounded_linear f by fact |
|
6231 |
{ fix d::real assume "d>0" |
|
6232 |
then obtain N where N:"\<forall>n\<ge>N. norm (f (x n) - f (x N)) < e * d" |
|
6233 |
using cf[unfolded cauchy o_def dist_norm, THEN spec[where x="e*d"]] and e and mult_pos_pos[of e d] by auto |
|
6234 |
{ fix n 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
|
6235 |
have "e * norm (x n - x N) \<le> norm (f (x n - x N))" |
33175 | 6236 |
using subspace_sub[OF s, of "x n" "x N"] using xs[THEN spec[where x=N]] and xs[THEN spec[where x=n]] |
6237 |
using normf[THEN bspec[where x="x n - x N"]] 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
|
6238 |
also have "norm (f (x n - x N)) < e * d" |
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
|
6239 |
using `N \<le> n` N unfolding f.diff[THEN sym] by auto |
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
|
6240 |
finally have "norm (x n - x N) < d" using `e>0` by simp } |
33175 | 6241 |
hence "\<exists>N. \<forall>n\<ge>N. norm (x n - x N) < d" by auto } |
6242 |
thus ?thesis unfolding cauchy and dist_norm by auto |
|
6243 |
qed |
|
6244 |
||
6245 |
lemma complete_isometric_image: |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
6246 |
fixes f :: "'a::euclidean_space => 'b::euclidean_space" |
33175 | 6247 |
assumes "0 < e" and s:"subspace s" and f:"bounded_linear f" and normf:"\<forall>x\<in>s. norm(f x) \<ge> e * norm(x)" and cs:"complete s" |
6248 |
shows "complete(f ` s)" |
|
6249 |
proof- |
|
6250 |
{ fix g assume as:"\<forall>n::nat. g n \<in> f ` s" and cfg:"Cauchy g" |
|
33324 | 6251 |
then obtain x where "\<forall>n. x n \<in> s \<and> g n = f (x n)" |
33175 | 6252 |
using choice[of "\<lambda> n xa. xa \<in> s \<and> g n = f xa"] by auto |
6253 |
hence x:"\<forall>n. x n \<in> s" "\<forall>n. g n = f (x n)" by auto |
|
39302
d7728f65b353
renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
nipkow
parents:
39198
diff
changeset
|
6254 |
hence "f \<circ> x = g" unfolding fun_eq_iff by auto |
33175 | 6255 |
then obtain l where "l\<in>s" and l:"(x ---> l) sequentially" |
6256 |
using cs[unfolded complete_def, THEN spec[where x="x"]] |
|
6257 |
using cauchy_isometric[OF `0<e` s f normf] and cfg and x(1) by auto |
|
6258 |
hence "\<exists>l\<in>f ` s. (g ---> l) sequentially" |
|
6259 |
using linear_continuous_at[OF f, unfolded continuous_at_sequentially, THEN spec[where x=x], of l] |
|
6260 |
unfolding `f \<circ> x = g` by auto } |
|
6261 |
thus ?thesis unfolding complete_def by auto |
|
6262 |
qed |
|
6263 |
||
6264 |
lemma dist_0_norm: |
|
6265 |
fixes x :: "'a::real_normed_vector" |
|
6266 |
shows "dist 0 x = norm x" |
|
6267 |
unfolding dist_norm by simp |
|
6268 |
||
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
6269 |
lemma injective_imp_isometric: fixes f::"'a::euclidean_space \<Rightarrow> 'b::euclidean_space" |
33175 | 6270 |
assumes s:"closed s" "subspace s" and f:"bounded_linear f" "\<forall>x\<in>s. (f x = 0) \<longrightarrow> (x = 0)" |
6271 |
shows "\<exists>e>0. \<forall>x\<in>s. norm (f x) \<ge> e * norm(x)" |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
6272 |
proof(cases "s \<subseteq> {0::'a}") |
33175 | 6273 |
case True |
6274 |
{ fix x assume "x \<in> s" |
|
6275 |
hence "x = 0" using True by auto |
|
6276 |
hence "norm x \<le> norm (f x)" by auto } |
|
6277 |
thus ?thesis by(auto intro!: exI[where x=1]) |
|
6278 |
next |
|
6279 |
interpret f: bounded_linear f by fact |
|
6280 |
case False |
|
6281 |
then obtain a where a:"a\<noteq>0" "a\<in>s" by auto |
|
6282 |
from False have "s \<noteq> {}" by auto |
|
6283 |
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
|
6284 |
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
|
6285 |
let ?S'' = "{x::'a. norm x = norm a}" |
33175 | 6286 |
|
36362
06475a1547cb
fix lots of looping simp calls and other warnings
huffman
parents:
36360
diff
changeset
|
6287 |
have "?S'' = frontier(cball 0 (norm a))" unfolding frontier_cball and dist_norm by auto |
33175 | 6288 |
hence "compact ?S''" using compact_frontier[OF compact_cball, of 0 "norm a"] by auto |
6289 |
moreover have "?S' = s \<inter> ?S''" by auto |
|
6290 |
ultimately have "compact ?S'" using closed_inter_compact[of s ?S''] using s(1) by auto |
|
6291 |
moreover have *:"f ` ?S' = ?S" by auto |
|
6292 |
ultimately have "compact ?S" using compact_continuous_image[OF linear_continuous_on[OF f(1)], of ?S'] by auto |
|
6293 |
hence "closed ?S" using compact_imp_closed by auto |
|
6294 |
moreover have "?S \<noteq> {}" using a by auto |
|
6295 |
ultimately obtain b' where "b'\<in>?S" "\<forall>y\<in>?S. norm b' \<le> norm y" using distance_attains_inf[of ?S 0] unfolding dist_0_norm by auto |
|
6296 |
then obtain b where "b\<in>s" and ba:"norm b = norm a" and b:"\<forall>x\<in>{x \<in> s. norm x = norm a}. norm (f b) \<le> norm (f x)" unfolding *[THEN sym] unfolding image_iff by auto |
|
6297 |
||
6298 |
let ?e = "norm (f b) / norm b" |
|
6299 |
have "norm b > 0" using ba and a and norm_ge_zero by auto |
|
6300 |
moreover have "norm (f b) > 0" using f(2)[THEN bspec[where x=b], OF `b\<in>s`] using `norm b >0` unfolding zero_less_norm_iff by auto |
|
6301 |
ultimately have "0 < norm (f b) / norm b" by(simp only: divide_pos_pos) |
|
6302 |
moreover |
|
6303 |
{ fix x assume "x\<in>s" |
|
6304 |
hence "norm (f b) / norm b * norm x \<le> norm (f x)" |
|
6305 |
proof(cases "x=0") |
|
6306 |
case True thus "norm (f b) / norm b * norm x \<le> norm (f x)" by auto |
|
6307 |
next |
|
6308 |
case False |
|
6309 |
hence *:"0 < norm a / norm x" using `a\<noteq>0` unfolding zero_less_norm_iff[THEN sym] by(simp only: divide_pos_pos) |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
6310 |
have "\<forall>c. \<forall>x\<in>s. c *\<^sub>R x \<in> s" using s[unfolded subspace_def] by auto |
33175 | 6311 |
hence "(norm a / norm x) *\<^sub>R x \<in> {x \<in> s. norm x = norm a}" using `x\<in>s` and `x\<noteq>0` by auto |
6312 |
thus "norm (f b) / norm b * norm x \<le> norm (f x)" using b[THEN bspec[where x="(norm a / norm x) *\<^sub>R x"]] |
|
6313 |
unfolding f.scaleR and ba using `x\<noteq>0` `a\<noteq>0` |
|
36778
739a9379e29b
avoid using real-specific versions of generic lemmas
huffman
parents:
36669
diff
changeset
|
6314 |
by (auto simp add: mult_commute pos_le_divide_eq pos_divide_le_eq) |
33175 | 6315 |
qed } |
6316 |
ultimately |
|
6317 |
show ?thesis by auto |
|
6318 |
qed |
|
6319 |
||
6320 |
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
|
6321 |
fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" |
33175 | 6322 |
assumes "subspace s" "bounded_linear f" "\<forall>x\<in>s. f x = 0 --> x = 0" "closed s" |
6323 |
shows "closed(f ` s)" |
|
6324 |
proof- |
|
6325 |
obtain e where "e>0" and e:"\<forall>x\<in>s. e * norm x \<le> norm (f x)" using injective_imp_isometric[OF assms(4,1,2,3)] by auto |
|
6326 |
show ?thesis using complete_isometric_image[OF `e>0` assms(1,2) e] and assms(4) |
|
6327 |
unfolding complete_eq_closed[THEN sym] by auto |
|
6328 |
qed |
|
6329 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
6330 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
6331 |
subsection {* Some properties of a canonical subspace *} |
33175 | 6332 |
|
6333 |
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
|
6334 |
"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
|
6335 |
unfolding subspace_def by (auto simp: inner_add_left) |
33175 | 6336 |
|
6337 |
lemma closed_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
|
6338 |
"closed {x::'a::euclidean_space. \<forall>i\<in>Basis. P i --> x\<bullet>i = 0}" (is "closed ?A") |
33175 | 6339 |
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
|
6340 |
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
|
6341 |
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
|
6342 |
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
|
6343 |
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
|
6344 |
by auto |
d366fa5551ef
declare euclidean_simps [simp] at the point they are proved;
huffman
parents:
44365
diff
changeset
|
6345 |
finally show "closed ?A" . |
33175 | 6346 |
qed |
6347 |
||
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
|
6348 |
lemma dim_substandard: assumes d: "d \<subseteq> 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
|
6349 |
shows "dim {x::'a::euclidean_space. \<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x\<bullet>i = 0} = card d" (is "dim ?A = _") |
33175 | 6350 |
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
|
6351 |
let ?D = "Basis :: 'a set" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
6352 |
have "d \<subseteq> ?A" using d by (auto simp: inner_Basis) |
33175 | 6353 |
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
|
6354 |
{ fix x::"'a" assume "x \<in> ?A" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
6355 |
hence "finite d" "x \<in> ?A" using assms by(auto intro: finite_subset[OF _ finite_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
|
6356 |
from this d have "x \<in> span d" |
33175 | 6357 |
proof(induct d arbitrary: x) |
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
|
6358 |
case empty hence "x=0" apply(rule_tac euclidean_eqI) by auto |
33175 | 6359 |
thus ?case using subspace_0[OF subspace_span[of "{}"]] by auto |
6360 |
next |
|
6361 |
case (insert k F) |
|
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
|
6362 |
hence *:"\<forall>i\<in>Basis. i \<notin> insert k F \<longrightarrow> x \<bullet> i = 0" by auto |
33175 | 6363 |
have **:"F \<subseteq> insert k F" 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
|
6364 |
def y \<equiv> "x - (x\<bullet>k) *\<^sub>R k" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
6365 |
have y:"x = y + (x\<bullet>k) *\<^sub>R k" unfolding y_def by auto |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
6366 |
{ fix i assume i': "i \<notin> F" "i \<in> 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
|
6367 |
hence "y \<bullet> i = 0" unfolding y_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
|
6368 |
using *[THEN bspec[where x=i]] insert by (auto simp: inner_simps inner_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
|
6369 |
hence "y \<in> span F" using insert by auto |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
6370 |
hence "y \<in> span (insert k 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
|
6371 |
using span_mono[of F "insert k F"] using assms by auto |
33175 | 6372 |
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
|
6373 |
have "k \<in> span (insert k F)" by(rule span_superset, auto) |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
6374 |
hence "(x\<bullet>k) *\<^sub>R k \<in> span (insert k F)" |
36593
fb69c8cd27bd
define linear algebra concepts using scaleR instead of (op *s); generalized many lemmas, though a few theorems that used to work on type int^'n are a bit less general
huffman
parents:
36590
diff
changeset
|
6375 |
using span_mul by auto |
33175 | 6376 |
ultimately |
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
|
6377 |
have "y + (x\<bullet>k) *\<^sub>R k \<in> span (insert k F)" |
33175 | 6378 |
using span_add by auto |
6379 |
thus ?case using y by auto |
|
6380 |
qed |
|
6381 |
} |
|
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
|
6382 |
hence "?A \<subseteq> span d" by auto |
33175 | 6383 |
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
|
6384 |
{ fix x assume "x \<in> d" hence "x \<in> ?D" using assms by auto } |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
6385 |
hence "independent d" using independent_mono[OF independent_Basis, of d] and assms by auto |
33175 | 6386 |
moreover |
6387 |
have "d \<subseteq> ?D" unfolding subset_eq using assms 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
|
6388 |
ultimately show ?thesis using dim_unique[of d ?A] by auto |
33175 | 6389 |
qed |
6390 |
||
6391 |
text{* Hence closure and completeness of all subspaces. *} |
|
6392 |
||
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
|
6393 |
lemma ex_card: assumes "n \<le> card A" shows "\<exists>S\<subseteq>A. card S = 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
|
6394 |
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
|
6395 |
assume "finite A" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
6396 |
from ex_bij_betw_nat_finite[OF this] guess 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
|
6397 |
moreover with `n \<le> card A` have "{..< n} \<subseteq> {..< card A}" "inj_on f {..< 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
|
6398 |
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
|
6399 |
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
|
6400 |
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
|
6401 |
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
|
6402 |
next |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
6403 |
assume "\<not> finite A" with `n \<le> card A` show ?thesis by force |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
6404 |
qed |
33175 | 6405 |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
6406 |
lemma closed_subspace: fixes s::"('a::euclidean_space) set" |
33175 | 6407 |
assumes "subspace s" shows "closed s" |
6408 |
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
|
6409 |
have "dim s \<le> card (Basis :: 'a set)" using dim_subset_UNIV by auto |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
6410 |
with ex_card[OF this] obtain d :: "'a set" where t: "card d = dim s" and d: "d \<subseteq> Basis" by auto |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50324
diff
changeset
|
6411 |
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
|
6412 |
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
|
6413 |
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
|
6414 |
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
|
6415 |
by (intro subspace_isomorphism[OF subspace_substandard[of "\<lambda>i. i \<notin> d"]]) (auto simp: inner_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
|
6416 |
then guess f by (elim exE conjE) note f = this |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
6417 |
interpret f: bounded_linear f using f unfolding linear_conv_bounded_linear 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
|
6418 |
{ fix x have "x\<in>?t \<Longrightarrow> f x = 0 \<Longrightarrow> x = 0" using f.zero d f(3)[THEN inj_onD, of x 0] by auto } |
33175 | 6419 |
moreover have "closed ?t" using closed_substandard . |
6420 |
moreover have "subspace ?t" using subspace_substandard . |
|
6421 |
ultimately show ?thesis 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
|
6422 |
unfolding f(2) using f(1) unfolding linear_conv_bounded_linear by auto |
33175 | 6423 |
qed |
6424 |
||
6425 |
lemma complete_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
|
6426 |
fixes s :: "('a::euclidean_space) set" shows "subspace s ==> complete s" |
33175 | 6427 |
using complete_eq_closed closed_subspace |
6428 |
by auto |
|
6429 |
||
6430 |
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
|
6431 |
fixes s :: "('a::euclidean_space) set" |
33175 | 6432 |
shows "dim(closure s) = dim s" (is "?dc = ?d") |
6433 |
proof- |
|
6434 |
have "?dc \<le> ?d" using closure_minimal[OF span_inc, of s] |
|
6435 |
using closed_subspace[OF subspace_span, of s] |
|
6436 |
using dim_subset[of "closure s" "span s"] unfolding dim_span by auto |
|
6437 |
thus ?thesis using dim_subset[OF closure_subset, of s] by auto |
|
6438 |
qed |
|
6439 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
6440 |
|
36437 | 6441 |
subsection {* Affine transformations of intervals *} |
33175 | 6442 |
|
6443 |
lemma real_affinity_le: |
|
35028
108662d50512
more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
haftmann
parents:
34999
diff
changeset
|
6444 |
"0 < (m::'a::linordered_field) ==> (m * x + c \<le> y \<longleftrightarrow> x \<le> inverse(m) * y + -(c / m))" |
33175 | 6445 |
by (simp add: field_simps inverse_eq_divide) |
6446 |
||
6447 |
lemma real_le_affinity: |
|
35028
108662d50512
more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
haftmann
parents:
34999
diff
changeset
|
6448 |
"0 < (m::'a::linordered_field) ==> (y \<le> m * x + c \<longleftrightarrow> inverse(m) * y + -(c / m) \<le> x)" |
33175 | 6449 |
by (simp add: field_simps inverse_eq_divide) |
6450 |
||
6451 |
lemma real_affinity_lt: |
|
35028
108662d50512
more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
haftmann
parents:
34999
diff
changeset
|
6452 |
"0 < (m::'a::linordered_field) ==> (m * x + c < y \<longleftrightarrow> x < inverse(m) * y + -(c / m))" |
33175 | 6453 |
by (simp add: field_simps inverse_eq_divide) |
6454 |
||
6455 |
lemma real_lt_affinity: |
|
35028
108662d50512
more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
haftmann
parents:
34999
diff
changeset
|
6456 |
"0 < (m::'a::linordered_field) ==> (y < m * x + c \<longleftrightarrow> inverse(m) * y + -(c / m) < x)" |
33175 | 6457 |
by (simp add: field_simps inverse_eq_divide) |
6458 |
||
6459 |
lemma real_affinity_eq: |
|
35028
108662d50512
more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
haftmann
parents:
34999
diff
changeset
|
6460 |
"(m::'a::linordered_field) \<noteq> 0 ==> (m * x + c = y \<longleftrightarrow> x = inverse(m) * y + -(c / m))" |
33175 | 6461 |
by (simp add: field_simps inverse_eq_divide) |
6462 |
||
6463 |
lemma real_eq_affinity: |
|
35028
108662d50512
more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
haftmann
parents:
34999
diff
changeset
|
6464 |
"(m::'a::linordered_field) \<noteq> 0 ==> (y = m * x + c \<longleftrightarrow> inverse(m) * y + -(c / m) = x)" |
33175 | 6465 |
by (simp add: field_simps inverse_eq_divide) |
6466 |
||
6467 |
lemma image_affinity_interval: fixes m::real |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
6468 |
fixes a b c :: "'a::ordered_euclidean_space" |
33175 | 6469 |
shows "(\<lambda>x. m *\<^sub>R x + c) ` {a .. b} = |
6470 |
(if {a .. b} = {} then {} |
|
6471 |
else (if 0 \<le> m then {m *\<^sub>R a + c .. m *\<^sub>R b + c} |
|
6472 |
else {m *\<^sub>R b + c .. m *\<^sub>R a + c}))" |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
6473 |
proof(cases "m=0") |
33175 | 6474 |
{ fix x assume "x \<le> c" "c \<le> x" |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
6475 |
hence "x=c" unfolding eucl_le[where 'a='a] apply- |
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
|
6476 |
apply(subst euclidean_eq_iff) by (auto intro: order_antisym) } |
33175 | 6477 |
moreover case True |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
6478 |
moreover have "c \<in> {m *\<^sub>R a + c..m *\<^sub>R b + c}" unfolding True by(auto simp add: eucl_le[where 'a='a]) |
33175 | 6479 |
ultimately show ?thesis by auto |
6480 |
next |
|
6481 |
case False |
|
6482 |
{ fix y assume "a \<le> y" "y \<le> b" "m > 0" |
|
6483 |
hence "m *\<^sub>R a + c \<le> m *\<^sub>R y + c" "m *\<^sub>R y + c \<le> m *\<^sub>R b + c" |
|
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
|
6484 |
unfolding eucl_le[where 'a='a] by (auto simp: inner_simps) |
33175 | 6485 |
} moreover |
6486 |
{ fix y assume "a \<le> y" "y \<le> b" "m < 0" |
|
6487 |
hence "m *\<^sub>R b + c \<le> m *\<^sub>R y + c" "m *\<^sub>R y + c \<le> m *\<^sub>R a + c" |
|
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
|
6488 |
unfolding eucl_le[where 'a='a] by(auto simp add: mult_left_mono_neg inner_simps) |
33175 | 6489 |
} moreover |
6490 |
{ fix y assume "m > 0" "m *\<^sub>R a + c \<le> y" "y \<le> m *\<^sub>R b + c" |
|
6491 |
hence "y \<in> (\<lambda>x. m *\<^sub>R x + c) ` {a..b}" |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
6492 |
unfolding image_iff Bex_def mem_interval eucl_le[where 'a='a] |
44516
d9a496ae5d9d
move everything related to 'norm' method into new theory file Norm_Arith.thy
huffman
parents:
44457
diff
changeset
|
6493 |
apply (intro exI[where x="(1 / m) *\<^sub>R (y - c)"]) |
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
|
6494 |
by(auto simp add: pos_le_divide_eq pos_divide_le_eq mult_commute diff_le_iff inner_simps) |
33175 | 6495 |
} moreover |
6496 |
{ fix y assume "m *\<^sub>R b + c \<le> y" "y \<le> m *\<^sub>R a + c" "m < 0" |
|
6497 |
hence "y \<in> (\<lambda>x. m *\<^sub>R x + c) ` {a..b}" |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
6498 |
unfolding image_iff Bex_def mem_interval eucl_le[where 'a='a] |
44516
d9a496ae5d9d
move everything related to 'norm' method into new theory file Norm_Arith.thy
huffman
parents:
44457
diff
changeset
|
6499 |
apply (intro exI[where x="(1 / m) *\<^sub>R (y - c)"]) |
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
|
6500 |
by(auto simp add: neg_le_divide_eq neg_divide_le_eq mult_commute diff_le_iff inner_simps) |
33175 | 6501 |
} |
6502 |
ultimately show ?thesis using False by auto |
|
6503 |
qed |
|
6504 |
||
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
37452
diff
changeset
|
6505 |
lemma image_smult_interval:"(\<lambda>x. m *\<^sub>R (x::_::ordered_euclidean_space)) ` {a..b} = |
33175 | 6506 |
(if {a..b} = {} then {} else if 0 \<le> m then {m *\<^sub>R a..m *\<^sub>R b} else {m *\<^sub>R b..m *\<^sub>R a})" |
6507 |
using image_affinity_interval[of m 0 a b] by auto |
|
6508 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
6509 |
|
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
6510 |
subsection {* Banach fixed point theorem (not really topological...) *} |
33175 | 6511 |
|
6512 |
lemma banach_fix: |
|
6513 |
assumes s:"complete s" "s \<noteq> {}" and c:"0 \<le> c" "c < 1" and f:"(f ` s) \<subseteq> s" and |
|
6514 |
lipschitz:"\<forall>x\<in>s. \<forall>y\<in>s. dist (f x) (f y) \<le> c * dist x y" |
|
6515 |
shows "\<exists>! x\<in>s. (f x = x)" |
|
6516 |
proof- |
|
6517 |
have "1 - c > 0" using c by auto |
|
6518 |
||
6519 |
from s(2) obtain z0 where "z0 \<in> s" by auto |
|
6520 |
def z \<equiv> "\<lambda>n. (f ^^ n) z0" |
|
6521 |
{ fix n::nat |
|
6522 |
have "z n \<in> s" unfolding z_def |
|
6523 |
proof(induct n) case 0 thus ?case using `z0 \<in>s` by auto |
|
6524 |
next case Suc thus ?case using f by auto qed } |
|
6525 |
note z_in_s = this |
|
6526 |
||
6527 |
def d \<equiv> "dist (z 0) (z 1)" |
|
6528 |
||
6529 |
have fzn:"\<And>n. f (z n) = z (Suc n)" unfolding z_def by auto |
|
6530 |
{ fix n::nat |
|
6531 |
have "dist (z n) (z (Suc n)) \<le> (c ^ n) * d" |
|
6532 |
proof(induct n) |
|
6533 |
case 0 thus ?case unfolding d_def by auto |
|
6534 |
next |
|
6535 |
case (Suc m) |
|
6536 |
hence "c * dist (z m) (z (Suc m)) \<le> c ^ Suc m * d" |
|
38642
8fa437809c67
dropped type classes mult_mono and mult_mono1; tuned names of technical rule duplicates
haftmann
parents:
37732
diff
changeset
|
6537 |
using `0 \<le> c` using mult_left_mono[of "dist (z m) (z (Suc m))" "c ^ m * d" c] by auto |
33175 | 6538 |
thus ?case using lipschitz[THEN bspec[where x="z m"], OF z_in_s, THEN bspec[where x="z (Suc m)"], OF z_in_s] |
6539 |
unfolding fzn and mult_le_cancel_left by auto |
|
6540 |
qed |
|
6541 |
} note cf_z = this |
|
6542 |
||
6543 |
{ fix n m::nat |
|
6544 |
have "(1 - c) * dist (z m) (z (m+n)) \<le> (c ^ m) * d * (1 - c ^ n)" |
|
6545 |
proof(induct n) |
|
6546 |
case 0 show ?case by auto |
|
6547 |
next |
|
6548 |
case (Suc k) |
|
6549 |
have "(1 - c) * dist (z m) (z (m + Suc k)) \<le> (1 - c) * (dist (z m) (z (m + k)) + dist (z (m + k)) (z (Suc (m + k))))" |
|
6550 |
using dist_triangle and c by(auto simp add: dist_triangle) |
|
6551 |
also have "\<dots> \<le> (1 - c) * (dist (z m) (z (m + k)) + c ^ (m + k) * d)" |
|
6552 |
using cf_z[of "m + k"] and c by auto |
|
6553 |
also have "\<dots> \<le> c ^ m * d * (1 - c ^ k) + (1 - c) * c ^ (m + k) * d" |
|
36350 | 6554 |
using Suc by (auto simp add: field_simps) |
33175 | 6555 |
also have "\<dots> = (c ^ m) * (d * (1 - c ^ k) + (1 - c) * c ^ k * d)" |
36350 | 6556 |
unfolding power_add by (auto simp add: field_simps) |
33175 | 6557 |
also have "\<dots> \<le> (c ^ m) * d * (1 - c ^ Suc k)" |
36350 | 6558 |
using c by (auto simp add: field_simps) |
33175 | 6559 |
finally show ?case by auto |
6560 |
qed |
|
6561 |
} note cf_z2 = this |
|
6562 |
{ fix e::real assume "e>0" |
|
6563 |
hence "\<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (z m) (z n) < e" |
|
6564 |
proof(cases "d = 0") |
|
6565 |
case True |
|
41863 | 6566 |
have *: "\<And>x. ((1 - c) * x \<le> 0) = (x \<le> 0)" using `1 - c > 0` |
45051
c478d1876371
discontinued legacy theorem names from RealDef.thy
huffman
parents:
45031
diff
changeset
|
6567 |
by (metis mult_zero_left mult_commute real_mult_le_cancel_iff1) |
41863 | 6568 |
from True have "\<And>n. z n = z0" using cf_z2[of 0] and c unfolding z_def |
6569 |
by (simp add: *) |
|
33175 | 6570 |
thus ?thesis using `e>0` by auto |
6571 |
next |
|
6572 |
case False hence "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
|
6573 |
by (metis False d_def less_le) |
33175 | 6574 |
hence "0 < e * (1 - c) / d" using `e>0` and `1-c>0` |
6575 |
using divide_pos_pos[of "e * (1 - c)" d] and mult_pos_pos[of e "1 - c"] by auto |
|
6576 |
then obtain N where N:"c ^ N < e * (1 - c) / d" using real_arch_pow_inv[of "e * (1 - c) / d" c] and c by auto |
|
6577 |
{ fix m n::nat assume "m>n" and as:"m\<ge>N" "n\<ge>N" |
|
6578 |
have *:"c ^ n \<le> c ^ N" using `n\<ge>N` and c using power_decreasing[OF `n\<ge>N`, of c] by auto |
|
6579 |
have "1 - c ^ (m - n) > 0" using c and power_strict_mono[of c 1 "m - n"] using `m>n` by auto |
|
6580 |
hence **:"d * (1 - c ^ (m - n)) / (1 - c) > 0" |
|
36778
739a9379e29b
avoid using real-specific versions of generic lemmas
huffman
parents:
36669
diff
changeset
|
6581 |
using mult_pos_pos[OF `d>0`, of "1 - c ^ (m - n)"] |
33175 | 6582 |
using divide_pos_pos[of "d * (1 - c ^ (m - n))" "1 - c"] |
6583 |
using `0 < 1 - c` by auto |
|
6584 |
||
6585 |
have "dist (z m) (z n) \<le> c ^ n * d * (1 - c ^ (m - n)) / (1 - c)" |
|
6586 |
using cf_z2[of n "m - n"] and `m>n` unfolding pos_le_divide_eq[OF `1-c>0`] |
|
36778
739a9379e29b
avoid using real-specific versions of generic lemmas
huffman
parents:
36669
diff
changeset
|
6587 |
by (auto simp add: mult_commute dist_commute) |
33175 | 6588 |
also have "\<dots> \<le> c ^ N * d * (1 - c ^ (m - n)) / (1 - c)" |
6589 |
using mult_right_mono[OF * order_less_imp_le[OF **]] |
|
36778
739a9379e29b
avoid using real-specific versions of generic lemmas
huffman
parents:
36669
diff
changeset
|
6590 |
unfolding mult_assoc by auto |
33175 | 6591 |
also have "\<dots> < (e * (1 - c) / d) * d * (1 - c ^ (m - n)) / (1 - c)" |
36778
739a9379e29b
avoid using real-specific versions of generic lemmas
huffman
parents:
36669
diff
changeset
|
6592 |
using mult_strict_right_mono[OF N **] unfolding mult_assoc by auto |
33175 | 6593 |
also have "\<dots> = e * (1 - c ^ (m - n))" using c and `d>0` and `1 - c > 0` by auto |
6594 |
also have "\<dots> \<le> e" using c and `1 - c ^ (m - n) > 0` and `e>0` using mult_right_le_one_le[of e "1 - c ^ (m - n)"] by auto |
|
6595 |
finally have "dist (z m) (z n) < e" by auto |
|
6596 |
} note * = this |
|
6597 |
{ fix m n::nat assume as:"N\<le>m" "N\<le>n" |
|
6598 |
hence "dist (z n) (z m) < e" |
|
6599 |
proof(cases "n = m") |
|
6600 |
case True thus ?thesis using `e>0` by auto |
|
6601 |
next |
|
6602 |
case False thus ?thesis using as and *[of n m] *[of m n] unfolding nat_neq_iff by (auto simp add: dist_commute) |
|
6603 |
qed } |
|
6604 |
thus ?thesis by auto |
|
6605 |
qed |
|
6606 |
} |
|
6607 |
hence "Cauchy z" unfolding cauchy_def by auto |
|
6608 |
then obtain x where "x\<in>s" and x:"(z ---> x) sequentially" using s(1)[unfolded compact_def complete_def, THEN spec[where x=z]] and z_in_s by auto |
|
6609 |
||
6610 |
def e \<equiv> "dist (f x) x" |
|
6611 |
have "e = 0" proof(rule ccontr) |
|
6612 |
assume "e \<noteq> 0" hence "e>0" unfolding e_def using zero_le_dist[of "f x" x] |
|
6613 |
by (metis dist_eq_0_iff dist_nz e_def) |
|
6614 |
then obtain N where N:"\<forall>n\<ge>N. dist (z n) x < e / 2" |
|
44907
93943da0a010
remove redundant lemma Lim_sequentially in favor of lemma LIMSEQ_def
huffman
parents:
44905
diff
changeset
|
6615 |
using x[unfolded LIMSEQ_def, THEN spec[where x="e/2"]] by auto |
33175 | 6616 |
hence N':"dist (z N) x < e / 2" by auto |
6617 |
||
6618 |
have *:"c * dist (z N) x \<le> dist (z N) x" unfolding mult_le_cancel_right2 |
|
6619 |
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
|
6620 |
by (metis dist_eq_0_iff dist_nz order_less_asym less_le) |
33175 | 6621 |
have "dist (f (z N)) (f x) \<le> c * dist (z N) x" using lipschitz[THEN bspec[where x="z N"], THEN bspec[where x=x]] |
6622 |
using z_in_s[of N] `x\<in>s` using c by auto |
|
6623 |
also have "\<dots> < e / 2" using N' and c using * by auto |
|
6624 |
finally show False unfolding fzn |
|
6625 |
using N[THEN spec[where x="Suc N"]] and dist_triangle_half_r[of "z (Suc N)" "f x" e x] |
|
6626 |
unfolding e_def by auto |
|
6627 |
qed |
|
6628 |
hence "f x = x" unfolding e_def by auto |
|
6629 |
moreover |
|
6630 |
{ fix y assume "f y = y" "y\<in>s" |
|
6631 |
hence "dist x y \<le> c * dist x y" using lipschitz[THEN bspec[where x=x], THEN bspec[where x=y]] |
|
6632 |
using `x\<in>s` and `f x = x` by auto |
|
6633 |
hence "dist x y = 0" unfolding mult_le_cancel_right1 |
|
6634 |
using c and zero_le_dist[of x y] by auto |
|
6635 |
hence "y = x" by auto |
|
6636 |
} |
|
34999
5312d2ffee3b
Changed 'bounded unique existential quantifiers' from a constant to syntax translation.
hoelzl
parents:
34964
diff
changeset
|
6637 |
ultimately show ?thesis using `x\<in>s` by blast+ |
33175 | 6638 |
qed |
6639 |
||
44210
eba74571833b
Topology_Euclidean_Space.thy: organize section headings
huffman
parents:
44207
diff
changeset
|
6640 |
subsection {* Edelstein fixed point theorem *} |
33175 | 6641 |
|
6642 |
lemma edelstein_fix: |
|
50970
3e5b67f85bf9
generalized theorem edelstein_fix to class metric_space
huffman
parents:
50955
diff
changeset
|
6643 |
fixes s :: "'a::metric_space set" |
33175 | 6644 |
assumes s:"compact s" "s \<noteq> {}" and gs:"(g ` s) \<subseteq> s" |
6645 |
and dist:"\<forall>x\<in>s. \<forall>y\<in>s. x \<noteq> y \<longrightarrow> dist (g x) (g y) < dist x y" |
|
6646 |
shows "\<exists>! x\<in>s. g x = x" |
|
6647 |
proof(cases "\<exists>x\<in>s. g x \<noteq> x") |
|
6648 |
obtain x where "x\<in>s" using s(2) by auto |
|
6649 |
case False hence g:"\<forall>x\<in>s. g x = x" by auto |
|
6650 |
{ fix y assume "y\<in>s" |
|
6651 |
hence "x = y" using `x\<in>s` and dist[THEN bspec[where x=x], THEN bspec[where x=y]] |
|
6652 |
unfolding g[THEN bspec[where x=x], OF `x\<in>s`] |
|
6653 |
unfolding g[THEN bspec[where x=y], OF `y\<in>s`] by auto } |
|
34999
5312d2ffee3b
Changed 'bounded unique existential quantifiers' from a constant to syntax translation.
hoelzl
parents:
34964
diff
changeset
|
6654 |
thus ?thesis using `x\<in>s` and g by blast+ |
33175 | 6655 |
next |
6656 |
case True |
|
6657 |
then obtain x where [simp]:"x\<in>s" and "g x \<noteq> x" by auto |
|
6658 |
{ fix x y assume "x \<in> s" "y \<in> s" |
|
6659 |
hence "dist (g x) (g y) \<le> dist x y" |
|
6660 |
using dist[THEN bspec[where x=x], THEN bspec[where x=y]] by auto } note dist' = this |
|
6661 |
def y \<equiv> "g x" |
|
6662 |
have [simp]:"y\<in>s" unfolding y_def using gs[unfolded image_subset_iff] and `x\<in>s` by blast |
|
6663 |
def f \<equiv> "\<lambda>n. g ^^ n" |
|
6664 |
have [simp]:"\<And>n z. g (f n z) = f (Suc n) z" unfolding f_def by auto |
|
6665 |
have [simp]:"\<And>z. f 0 z = z" unfolding f_def by auto |
|
6666 |
{ fix n::nat and z assume "z\<in>s" |
|
6667 |
have "f n z \<in> s" unfolding f_def |
|
6668 |
proof(induct n) |
|
6669 |
case 0 thus ?case using `z\<in>s` by simp |
|
6670 |
next |
|
6671 |
case (Suc n) thus ?case using gs[unfolded image_subset_iff] by auto |
|
6672 |
qed } note fs = this |
|
6673 |
{ fix m n ::nat assume "m\<le>n" |
|
6674 |
fix w z assume "w\<in>s" "z\<in>s" |
|
6675 |
have "dist (f n w) (f n z) \<le> dist (f m w) (f m z)" using `m\<le>n` |
|
6676 |
proof(induct n) |
|
6677 |
case 0 thus ?case by auto |
|
6678 |
next |
|
6679 |
case (Suc n) |
|
6680 |
thus ?case proof(cases "m\<le>n") |
|
6681 |
case True thus ?thesis using Suc(1) |
|
6682 |
using dist'[OF fs fs, OF `w\<in>s` `z\<in>s`, of n n] by auto |
|
6683 |
next |
|
6684 |
case False hence mn:"m = Suc n" using Suc(2) by simp |
|
6685 |
show ?thesis unfolding mn by auto |
|
6686 |
qed |
|
6687 |
qed } note distf = this |
|
6688 |
||
6689 |
def h \<equiv> "\<lambda>n. (f n x, f n y)" |
|
6690 |
let ?s2 = "s \<times> s" |
|
6691 |
obtain l r where "l\<in>?s2" and r:"subseq r" and lr:"((h \<circ> r) ---> l) sequentially" |
|
6692 |
using compact_Times [OF s(1) s(1), unfolded compact_def, THEN spec[where x=h]] unfolding h_def |
|
6693 |
using fs[OF `x\<in>s`] and fs[OF `y\<in>s`] by blast |
|
6694 |
def a \<equiv> "fst l" def b \<equiv> "snd l" |
|
6695 |
have lab:"l = (a, b)" unfolding a_def b_def by simp |
|
6696 |
have [simp]:"a\<in>s" "b\<in>s" unfolding a_def b_def using `l\<in>?s2` by auto |
|
6697 |
||
6698 |
have lima:"((fst \<circ> (h \<circ> r)) ---> a) sequentially" |
|
6699 |
and limb:"((snd \<circ> (h \<circ> r)) ---> b) sequentially" |
|
6700 |
using lr |
|
44167 | 6701 |
unfolding o_def a_def b_def by (rule tendsto_intros)+ |
33175 | 6702 |
|
6703 |
{ fix n::nat |
|
50970
3e5b67f85bf9
generalized theorem edelstein_fix to class metric_space
huffman
parents:
50955
diff
changeset
|
6704 |
have *:"\<And>fx fy (x::'a) y. dist fx fy \<le> dist x y \<Longrightarrow> \<not> (\<bar>dist fx fy - dist a b\<bar> < dist a b - dist x y)" by auto |
33175 | 6705 |
|
6706 |
{ assume as:"dist a b > dist (f n x) (f n y)" |
|
6707 |
then obtain Na Nb where "\<forall>m\<ge>Na. dist (f (r m) x) a < (dist a b - dist (f n x) (f n y)) / 2" |
|
6708 |
and "\<forall>m\<ge>Nb. dist (f (r m) y) b < (dist a b - dist (f n x) (f n y)) / 2" |
|
47108
2a1953f0d20d
merged fork with new numeral representation (see NEWS)
huffman
parents:
46887
diff
changeset
|
6709 |
using lima limb unfolding h_def LIMSEQ_def by (fastforce simp del: less_divide_eq_numeral1) |
50970
3e5b67f85bf9
generalized theorem edelstein_fix to class metric_space
huffman
parents:
50955
diff
changeset
|
6710 |
hence "\<bar>dist (f (r (Na + Nb + n)) x) (f (r (Na + Nb + n)) y) - dist a b\<bar> < dist a b - dist (f n x) (f n y)" |
3e5b67f85bf9
generalized theorem edelstein_fix to class metric_space
huffman
parents:
50955
diff
changeset
|
6711 |
apply - |
3e5b67f85bf9
generalized theorem edelstein_fix to class metric_space
huffman
parents:
50955
diff
changeset
|
6712 |
apply (drule_tac x="Na+Nb+n" in spec, drule mp, simp) |
3e5b67f85bf9
generalized theorem edelstein_fix to class metric_space
huffman
parents:
50955
diff
changeset
|
6713 |
apply (drule_tac x="Na+Nb+n" in spec, drule mp, simp) |
3e5b67f85bf9
generalized theorem edelstein_fix to class metric_space
huffman
parents:
50955
diff
changeset
|
6714 |
apply (drule (1) add_strict_mono, simp only: real_sum_of_halves) |
3e5b67f85bf9
generalized theorem edelstein_fix to class metric_space
huffman
parents:
50955
diff
changeset
|
6715 |
apply (erule le_less_trans [rotated]) |
3e5b67f85bf9
generalized theorem edelstein_fix to class metric_space
huffman
parents:
50955
diff
changeset
|
6716 |
apply (erule thin_rl) |
3e5b67f85bf9
generalized theorem edelstein_fix to class metric_space
huffman
parents:
50955
diff
changeset
|
6717 |
apply (rule abs_leI) |
3e5b67f85bf9
generalized theorem edelstein_fix to class metric_space
huffman
parents:
50955
diff
changeset
|
6718 |
apply (simp add: diff_le_iff add_assoc) |
3e5b67f85bf9
generalized theorem edelstein_fix to class metric_space
huffman
parents:
50955
diff
changeset
|
6719 |
apply (rule order_trans [OF dist_triangle add_left_mono]) |
3e5b67f85bf9
generalized theorem edelstein_fix to class metric_space
huffman
parents:
50955
diff
changeset
|
6720 |
apply (subst add_commute, rule dist_triangle2) |
3e5b67f85bf9
generalized theorem edelstein_fix to class metric_space
huffman
parents:
50955
diff
changeset
|
6721 |
apply (simp add: diff_le_iff add_assoc) |
3e5b67f85bf9
generalized theorem edelstein_fix to class metric_space
huffman
parents:
50955
diff
changeset
|
6722 |
apply (rule order_trans [OF dist_triangle3 add_left_mono]) |
3e5b67f85bf9
generalized theorem edelstein_fix to class metric_space
huffman
parents:
50955
diff
changeset
|
6723 |
apply (subst add_commute, rule dist_triangle) |
3e5b67f85bf9
generalized theorem edelstein_fix to class metric_space
huffman
parents:
50955
diff
changeset
|
6724 |
done |
33175 | 6725 |
moreover |
50970
3e5b67f85bf9
generalized theorem edelstein_fix to class metric_space
huffman
parents:
50955
diff
changeset
|
6726 |
have "\<bar>dist (f (r (Na + Nb + n)) x) (f (r (Na + Nb + n)) y) - dist a b\<bar> \<ge> dist a b - dist (f n x) (f n y)" |
33175 | 6727 |
using distf[of n "r (Na+Nb+n)", OF _ `x\<in>s` `y\<in>s`] |
50937 | 6728 |
using seq_suble[OF r, of "Na+Nb+n"] |
33175 | 6729 |
using *[of "f (r (Na + Nb + n)) x" "f (r (Na + Nb + n)) y" "f n x" "f n y"] by auto |
6730 |
ultimately have False by simp |
|
6731 |
} |
|
6732 |
hence "dist a b \<le> dist (f n x) (f n y)" by(rule ccontr)auto } |
|
6733 |
note ab_fn = this |
|
6734 |
||
6735 |
have [simp]:"a = b" proof(rule ccontr) |
|
6736 |
def e \<equiv> "dist a b - dist (g a) (g b)" |
|
44890
22f665a2e91c
new fastforce replacing fastsimp - less confusing name
nipkow
parents:
44668
diff
changeset
|
6737 |
assume "a\<noteq>b" hence "e > 0" unfolding e_def using dist by fastforce |
33175 | 6738 |
hence "\<exists>n. dist (f n x) a < e/2 \<and> dist (f n y) b < e/2" |
44907
93943da0a010
remove redundant lemma Lim_sequentially in favor of lemma LIMSEQ_def
huffman
parents:
44905
diff
changeset
|
6739 |
using lima limb unfolding LIMSEQ_def |
93943da0a010
remove redundant lemma Lim_sequentially in favor of lemma LIMSEQ_def
huffman
parents:
44905
diff
changeset
|
6740 |
apply (auto elim!: allE[where x="e/2"]) apply(rename_tac N N', rule_tac x="r (max N N')" in exI) unfolding h_def by fastforce |
33175 | 6741 |
then obtain n where n:"dist (f n x) a < e/2 \<and> dist (f n y) b < e/2" by auto |
6742 |
have "dist (f (Suc n) x) (g a) \<le> dist (f n x) a" |
|
6743 |
using dist[THEN bspec[where x="f n x"], THEN bspec[where x="a"]] and fs by auto |
|
6744 |
moreover have "dist (f (Suc n) y) (g b) \<le> dist (f n y) b" |
|
6745 |
using dist[THEN bspec[where x="f n y"], THEN bspec[where x="b"]] and fs by auto |
|
6746 |
ultimately have "dist (f (Suc n) x) (g a) + dist (f (Suc n) y) (g b) < e" using n by auto |
|
50970
3e5b67f85bf9
generalized theorem edelstein_fix to class metric_space
huffman
parents:
50955
diff
changeset
|
6747 |
thus False unfolding e_def using ab_fn[of "Suc n"] |
3e5b67f85bf9
generalized theorem edelstein_fix to class metric_space
huffman
parents:
50955
diff
changeset
|
6748 |
using dist_triangle2 [of "f (Suc n) y" "g a" "g b"] |
3e5b67f85bf9
generalized theorem edelstein_fix to class metric_space
huffman
parents:
50955
diff
changeset
|
6749 |
using dist_triangle2 [of "f (Suc n) x" "f (Suc n) y" "g a"] |
3e5b67f85bf9
generalized theorem edelstein_fix to class metric_space
huffman
parents:
50955
diff
changeset
|
6750 |
by auto |
33175 | 6751 |
qed |
6752 |
||
6753 |
have [simp]:"\<And>n. f (Suc n) x = f n y" unfolding f_def y_def by(induct_tac n)auto |
|
6754 |
{ fix x y assume "x\<in>s" "y\<in>s" moreover |
|
6755 |
fix e::real assume "e>0" ultimately |
|
44890
22f665a2e91c
new fastforce replacing fastsimp - less confusing name
nipkow
parents:
44668
diff
changeset
|
6756 |
have "dist y x < e \<longrightarrow> dist (g y) (g x) < e" using dist by fastforce } |
36359 | 6757 |
hence "continuous_on s g" unfolding continuous_on_iff by auto |
33175 | 6758 |
|
6759 |
hence "((snd \<circ> h \<circ> r) ---> g a) sequentially" unfolding continuous_on_sequentially |
|
6760 |
apply (rule allE[where x="\<lambda>n. (fst \<circ> h \<circ> r) n"]) apply (erule ballE[where x=a]) |
|
6761 |
using lima unfolding h_def o_def using fs[OF `x\<in>s`] by (auto simp add: y_def) |
|
41970 | 6762 |
hence "g a = a" using tendsto_unique[OF trivial_limit_sequentially limb, of "g a"] |
33175 | 6763 |
unfolding `a=b` and o_assoc by auto |
6764 |
moreover |
|
6765 |
{ fix x assume "x\<in>s" "g x = x" "x\<noteq>a" |
|
6766 |
hence "False" using dist[THEN bspec[where x=a], THEN bspec[where x=x]] |
|
6767 |
using `g a = a` and `a\<in>s` by auto } |
|
34999
5312d2ffee3b
Changed 'bounded unique existential quantifiers' from a constant to syntax translation.
hoelzl
parents:
34964
diff
changeset
|
6768 |
ultimately show "\<exists>!x\<in>s. g x = x" using `a\<in>s` by blast |
33175 | 6769 |
qed |
6770 |
||
44131
5fc334b94e00
declare tendsto_const [intro] (accidentally removed in 230a8665c919)
huffman
parents:
44129
diff
changeset
|
6771 |
declare tendsto_const [intro] (* FIXME: move *) |
5fc334b94e00
declare tendsto_const [intro] (accidentally removed in 230a8665c919)
huffman
parents:
44129
diff
changeset
|
6772 |
|
33175 | 6773 |
end |