author | paulson <lp15@cam.ac.uk> |
Tue, 02 May 2023 12:51:05 +0100 | |
changeset 77934 | 01c88cf514fc |
parent 77223 | 607e1e345e8f |
child 78093 | cec875dcc59e |
permissions | -rw-r--r-- |
52265 | 1 |
(* Title: HOL/Topological_Spaces.thy |
51471 | 2 |
Author: Brian Huffman |
3 |
Author: Johannes Hölzl |
|
4 |
*) |
|
5 |
||
60758 | 6 |
section \<open>Topological Spaces\<close> |
51471 | 7 |
|
8 |
theory Topological_Spaces |
|
63494 | 9 |
imports Main |
51471 | 10 |
begin |
11 |
||
57953 | 12 |
named_theorems continuous_intros "structural introduction rules for continuity" |
13 |
||
60758 | 14 |
subsection \<open>Topological space\<close> |
51471 | 15 |
|
16 |
class "open" = |
|
17 |
fixes "open" :: "'a set \<Rightarrow> bool" |
|
18 |
||
19 |
class topological_space = "open" + |
|
20 |
assumes open_UNIV [simp, intro]: "open UNIV" |
|
21 |
assumes open_Int [intro]: "open S \<Longrightarrow> open T \<Longrightarrow> open (S \<inter> T)" |
|
60585 | 22 |
assumes open_Union [intro]: "\<forall>S\<in>K. open S \<Longrightarrow> open (\<Union>K)" |
51471 | 23 |
begin |
24 |
||
63494 | 25 |
definition closed :: "'a set \<Rightarrow> bool" |
26 |
where "closed S \<longleftrightarrow> open (- S)" |
|
51471 | 27 |
|
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56329
diff
changeset
|
28 |
lemma open_empty [continuous_intros, intro, simp]: "open {}" |
51471 | 29 |
using open_Union [of "{}"] by simp |
30 |
||
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56329
diff
changeset
|
31 |
lemma open_Un [continuous_intros, intro]: "open S \<Longrightarrow> open T \<Longrightarrow> open (S \<union> T)" |
51471 | 32 |
using open_Union [of "{S, T}"] by simp |
33 |
||
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56329
diff
changeset
|
34 |
lemma open_UN [continuous_intros, intro]: "\<forall>x\<in>A. open (B x) \<Longrightarrow> open (\<Union>x\<in>A. B x)" |
56166 | 35 |
using open_Union [of "B ` A"] by simp |
51471 | 36 |
|
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56329
diff
changeset
|
37 |
lemma open_Inter [continuous_intros, intro]: "finite S \<Longrightarrow> \<forall>T\<in>S. open T \<Longrightarrow> open (\<Inter>S)" |
73832 | 38 |
by (induction set: finite) auto |
51471 | 39 |
|
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56329
diff
changeset
|
40 |
lemma open_INT [continuous_intros, intro]: "finite A \<Longrightarrow> \<forall>x\<in>A. open (B x) \<Longrightarrow> open (\<Inter>x\<in>A. B x)" |
56166 | 41 |
using open_Inter [of "B ` A"] by simp |
51471 | 42 |
|
51478
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51474
diff
changeset
|
43 |
lemma openI: |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51474
diff
changeset
|
44 |
assumes "\<And>x. x \<in> S \<Longrightarrow> \<exists>T. open T \<and> x \<in> T \<and> T \<subseteq> S" |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51474
diff
changeset
|
45 |
shows "open S" |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51474
diff
changeset
|
46 |
proof - |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51474
diff
changeset
|
47 |
have "open (\<Union>{T. open T \<and> T \<subseteq> S})" by auto |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51474
diff
changeset
|
48 |
moreover have "\<Union>{T. open T \<and> T \<subseteq> S} = S" by (auto dest!: assms) |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51474
diff
changeset
|
49 |
ultimately show "open S" by simp |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51474
diff
changeset
|
50 |
qed |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51474
diff
changeset
|
51 |
|
71063 | 52 |
lemma open_subopen: "open S \<longleftrightarrow> (\<forall>x\<in>S. \<exists>T. open T \<and> x \<in> T \<and> T \<subseteq> S)" |
53 |
by (auto intro: openI) |
|
54 |
||
63494 | 55 |
lemma closed_empty [continuous_intros, intro, simp]: "closed {}" |
51471 | 56 |
unfolding closed_def by simp |
57 |
||
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56329
diff
changeset
|
58 |
lemma closed_Un [continuous_intros, intro]: "closed S \<Longrightarrow> closed T \<Longrightarrow> closed (S \<union> T)" |
51471 | 59 |
unfolding closed_def by auto |
60 |
||
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56329
diff
changeset
|
61 |
lemma closed_UNIV [continuous_intros, intro, simp]: "closed UNIV" |
51471 | 62 |
unfolding closed_def by simp |
63 |
||
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56329
diff
changeset
|
64 |
lemma closed_Int [continuous_intros, intro]: "closed S \<Longrightarrow> closed T \<Longrightarrow> closed (S \<inter> T)" |
51471 | 65 |
unfolding closed_def by auto |
66 |
||
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56329
diff
changeset
|
67 |
lemma closed_INT [continuous_intros, intro]: "\<forall>x\<in>A. closed (B x) \<Longrightarrow> closed (\<Inter>x\<in>A. B x)" |
51471 | 68 |
unfolding closed_def by auto |
69 |
||
60585 | 70 |
lemma closed_Inter [continuous_intros, intro]: "\<forall>S\<in>K. closed S \<Longrightarrow> closed (\<Inter>K)" |
51471 | 71 |
unfolding closed_def uminus_Inf by auto |
72 |
||
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56329
diff
changeset
|
73 |
lemma closed_Union [continuous_intros, intro]: "finite S \<Longrightarrow> \<forall>T\<in>S. closed T \<Longrightarrow> closed (\<Union>S)" |
51471 | 74 |
by (induct set: finite) auto |
75 |
||
63494 | 76 |
lemma closed_UN [continuous_intros, intro]: |
77 |
"finite A \<Longrightarrow> \<forall>x\<in>A. closed (B x) \<Longrightarrow> closed (\<Union>x\<in>A. B x)" |
|
56166 | 78 |
using closed_Union [of "B ` A"] by simp |
51471 | 79 |
|
80 |
lemma open_closed: "open S \<longleftrightarrow> closed (- S)" |
|
63170 | 81 |
by (simp add: closed_def) |
51471 | 82 |
|
83 |
lemma closed_open: "closed S \<longleftrightarrow> open (- S)" |
|
63170 | 84 |
by (rule closed_def) |
51471 | 85 |
|
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56329
diff
changeset
|
86 |
lemma open_Diff [continuous_intros, intro]: "open S \<Longrightarrow> closed T \<Longrightarrow> open (S - T)" |
63170 | 87 |
by (simp add: closed_open Diff_eq open_Int) |
51471 | 88 |
|
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56329
diff
changeset
|
89 |
lemma closed_Diff [continuous_intros, intro]: "closed S \<Longrightarrow> open T \<Longrightarrow> closed (S - T)" |
63170 | 90 |
by (simp add: open_closed Diff_eq closed_Int) |
51471 | 91 |
|
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56329
diff
changeset
|
92 |
lemma open_Compl [continuous_intros, intro]: "closed S \<Longrightarrow> open (- S)" |
63170 | 93 |
by (simp add: closed_open) |
51471 | 94 |
|
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56329
diff
changeset
|
95 |
lemma closed_Compl [continuous_intros, intro]: "open S \<Longrightarrow> closed (- S)" |
63170 | 96 |
by (simp add: open_closed) |
51471 | 97 |
|
57447
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57276
diff
changeset
|
98 |
lemma open_Collect_neg: "closed {x. P x} \<Longrightarrow> open {x. \<not> P x}" |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57276
diff
changeset
|
99 |
unfolding Collect_neg_eq by (rule open_Compl) |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57276
diff
changeset
|
100 |
|
63494 | 101 |
lemma open_Collect_conj: |
102 |
assumes "open {x. P x}" "open {x. Q x}" |
|
103 |
shows "open {x. P x \<and> Q x}" |
|
57447
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57276
diff
changeset
|
104 |
using open_Int[OF assms] by (simp add: Int_def) |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57276
diff
changeset
|
105 |
|
63494 | 106 |
lemma open_Collect_disj: |
107 |
assumes "open {x. P x}" "open {x. Q x}" |
|
108 |
shows "open {x. P x \<or> Q x}" |
|
57447
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57276
diff
changeset
|
109 |
using open_Un[OF assms] by (simp add: Un_def) |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57276
diff
changeset
|
110 |
|
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57276
diff
changeset
|
111 |
lemma open_Collect_ex: "(\<And>i. open {x. P i x}) \<Longrightarrow> open {x. \<exists>i. P i x}" |
62102
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
hoelzl
parents:
62101
diff
changeset
|
112 |
using open_UN[of UNIV "\<lambda>i. {x. P i x}"] unfolding Collect_ex_eq by simp |
57447
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57276
diff
changeset
|
113 |
|
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57276
diff
changeset
|
114 |
lemma open_Collect_imp: "closed {x. P x} \<Longrightarrow> open {x. Q x} \<Longrightarrow> open {x. P x \<longrightarrow> Q x}" |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57276
diff
changeset
|
115 |
unfolding imp_conv_disj by (intro open_Collect_disj open_Collect_neg) |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57276
diff
changeset
|
116 |
|
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57276
diff
changeset
|
117 |
lemma open_Collect_const: "open {x. P}" |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57276
diff
changeset
|
118 |
by (cases P) auto |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57276
diff
changeset
|
119 |
|
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57276
diff
changeset
|
120 |
lemma closed_Collect_neg: "open {x. P x} \<Longrightarrow> closed {x. \<not> P x}" |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57276
diff
changeset
|
121 |
unfolding Collect_neg_eq by (rule closed_Compl) |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57276
diff
changeset
|
122 |
|
63494 | 123 |
lemma closed_Collect_conj: |
124 |
assumes "closed {x. P x}" "closed {x. Q x}" |
|
125 |
shows "closed {x. P x \<and> Q x}" |
|
57447
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57276
diff
changeset
|
126 |
using closed_Int[OF assms] by (simp add: Int_def) |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57276
diff
changeset
|
127 |
|
63494 | 128 |
lemma closed_Collect_disj: |
129 |
assumes "closed {x. P x}" "closed {x. Q x}" |
|
130 |
shows "closed {x. P x \<or> Q x}" |
|
57447
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57276
diff
changeset
|
131 |
using closed_Un[OF assms] by (simp add: Un_def) |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57276
diff
changeset
|
132 |
|
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57276
diff
changeset
|
133 |
lemma closed_Collect_all: "(\<And>i. closed {x. P i x}) \<Longrightarrow> closed {x. \<forall>i. P i x}" |
63494 | 134 |
using closed_INT[of UNIV "\<lambda>i. {x. P i x}"] by (simp add: Collect_all_eq) |
57447
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57276
diff
changeset
|
135 |
|
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57276
diff
changeset
|
136 |
lemma closed_Collect_imp: "open {x. P x} \<Longrightarrow> closed {x. Q x} \<Longrightarrow> closed {x. P x \<longrightarrow> Q x}" |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57276
diff
changeset
|
137 |
unfolding imp_conv_disj by (intro closed_Collect_disj closed_Collect_neg) |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57276
diff
changeset
|
138 |
|
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57276
diff
changeset
|
139 |
lemma closed_Collect_const: "closed {x. P}" |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57276
diff
changeset
|
140 |
by (cases P) auto |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57276
diff
changeset
|
141 |
|
51471 | 142 |
end |
143 |
||
63494 | 144 |
|
145 |
subsection \<open>Hausdorff and other separation properties\<close> |
|
51471 | 146 |
|
147 |
class t0_space = topological_space + |
|
148 |
assumes t0_space: "x \<noteq> y \<Longrightarrow> \<exists>U. open U \<and> \<not> (x \<in> U \<longleftrightarrow> y \<in> U)" |
|
149 |
||
150 |
class t1_space = topological_space + |
|
151 |
assumes t1_space: "x \<noteq> y \<Longrightarrow> \<exists>U. open U \<and> x \<in> U \<and> y \<notin> U" |
|
152 |
||
153 |
instance t1_space \<subseteq> t0_space |
|
63494 | 154 |
by standard (fast dest: t1_space) |
155 |
||
65204
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
156 |
context t1_space begin |
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
157 |
|
63494 | 158 |
lemma separation_t1: "x \<noteq> y \<longleftrightarrow> (\<exists>U. open U \<and> x \<in> U \<and> y \<notin> U)" |
51471 | 159 |
using t1_space[of x y] by blast |
160 |
||
63494 | 161 |
lemma closed_singleton [iff]: "closed {a}" |
51471 | 162 |
proof - |
163 |
let ?T = "\<Union>{S. open S \<and> a \<notin> S}" |
|
63494 | 164 |
have "open ?T" |
165 |
by (simp add: open_Union) |
|
51471 | 166 |
also have "?T = - {a}" |
63494 | 167 |
by (auto simp add: set_eq_iff separation_t1) |
168 |
finally show "closed {a}" |
|
169 |
by (simp only: closed_def) |
|
51471 | 170 |
qed |
171 |
||
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56329
diff
changeset
|
172 |
lemma closed_insert [continuous_intros, simp]: |
63494 | 173 |
assumes "closed S" |
174 |
shows "closed (insert a S)" |
|
51471 | 175 |
proof - |
63494 | 176 |
from closed_singleton assms have "closed ({a} \<union> S)" |
177 |
by (rule closed_Un) |
|
178 |
then show "closed (insert a S)" |
|
179 |
by simp |
|
51471 | 180 |
qed |
181 |
||
63494 | 182 |
lemma finite_imp_closed: "finite S \<Longrightarrow> closed S" |
183 |
by (induct pred: finite) simp_all |
|
184 |
||
65204
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
185 |
end |
51471 | 186 |
|
60758 | 187 |
text \<open>T2 spaces are also known as Hausdorff spaces.\<close> |
51471 | 188 |
|
189 |
class t2_space = topological_space + |
|
190 |
assumes hausdorff: "x \<noteq> y \<Longrightarrow> \<exists>U V. open U \<and> open V \<and> x \<in> U \<and> y \<in> V \<and> U \<inter> V = {}" |
|
191 |
||
192 |
instance t2_space \<subseteq> t1_space |
|
63494 | 193 |
by standard (fast dest: hausdorff) |
194 |
||
65204
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
195 |
lemma (in t2_space) separation_t2: "x \<noteq> y \<longleftrightarrow> (\<exists>U V. open U \<and> open V \<and> x \<in> U \<and> y \<in> V \<and> U \<inter> V = {})" |
63494 | 196 |
using hausdorff [of x y] by blast |
197 |
||
65204
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
198 |
lemma (in t0_space) separation_t0: "x \<noteq> y \<longleftrightarrow> (\<exists>U. open U \<and> \<not> (x \<in> U \<longleftrightarrow> y \<in> U))" |
63494 | 199 |
using t0_space [of x y] by blast |
200 |
||
51471 | 201 |
|
67454 | 202 |
text \<open>A classical separation axiom for topological space, the T3 axiom -- also called regularity: |
203 |
if a point is not in a closed set, then there are open sets separating them.\<close> |
|
204 |
||
205 |
class t3_space = t2_space + |
|
206 |
assumes t3_space: "closed S \<Longrightarrow> y \<notin> S \<Longrightarrow> \<exists>U V. open U \<and> open V \<and> y \<in> U \<and> S \<subseteq> V \<and> U \<inter> V = {}" |
|
207 |
||
208 |
text \<open>A classical separation axiom for topological space, the T4 axiom -- also called normality: |
|
209 |
if two closed sets are disjoint, then there are open sets separating them.\<close> |
|
210 |
||
211 |
class t4_space = t2_space + |
|
212 |
assumes t4_space: "closed S \<Longrightarrow> closed T \<Longrightarrow> S \<inter> T = {} \<Longrightarrow> \<exists>U V. open U \<and> open V \<and> S \<subseteq> U \<and> T \<subseteq> V \<and> U \<inter> V = {}" |
|
213 |
||
214 |
text \<open>T4 is stronger than T3, and weaker than metric.\<close> |
|
215 |
||
216 |
instance t4_space \<subseteq> t3_space |
|
217 |
proof |
|
218 |
fix S and y::'a assume "closed S" "y \<notin> S" |
|
219 |
then show "\<exists>U V. open U \<and> open V \<and> y \<in> U \<and> S \<subseteq> V \<and> U \<inter> V = {}" |
|
220 |
using t4_space[of "{y}" S] by auto |
|
221 |
qed |
|
222 |
||
60758 | 223 |
text \<open>A perfect space is a topological space with no isolated points.\<close> |
51471 | 224 |
|
225 |
class perfect_space = topological_space + |
|
226 |
assumes not_open_singleton: "\<not> open {x}" |
|
227 |
||
65204
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
228 |
lemma (in perfect_space) UNIV_not_singleton: "UNIV \<noteq> {x}" |
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
229 |
for x::'a |
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
230 |
by (metis (no_types) open_UNIV not_open_singleton) |
62381
a6479cb85944
New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents:
62369
diff
changeset
|
231 |
|
51471 | 232 |
|
60758 | 233 |
subsection \<open>Generators for toplogies\<close> |
51471 | 234 |
|
63494 | 235 |
inductive generate_topology :: "'a set set \<Rightarrow> 'a set \<Rightarrow> bool" for S :: "'a set set" |
236 |
where |
|
237 |
UNIV: "generate_topology S UNIV" |
|
238 |
| Int: "generate_topology S (a \<inter> b)" if "generate_topology S a" and "generate_topology S b" |
|
239 |
| UN: "generate_topology S (\<Union>K)" if "(\<And>k. k \<in> K \<Longrightarrow> generate_topology S k)" |
|
240 |
| Basis: "generate_topology S s" if "s \<in> S" |
|
51471 | 241 |
|
62102
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
hoelzl
parents:
62101
diff
changeset
|
242 |
hide_fact (open) UNIV Int UN Basis |
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
hoelzl
parents:
62101
diff
changeset
|
243 |
|
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
hoelzl
parents:
62101
diff
changeset
|
244 |
lemma generate_topology_Union: |
51471 | 245 |
"(\<And>k. k \<in> I \<Longrightarrow> generate_topology S (K k)) \<Longrightarrow> generate_topology S (\<Union>k\<in>I. K k)" |
56166 | 246 |
using generate_topology.UN [of "K ` I"] by auto |
51471 | 247 |
|
63494 | 248 |
lemma topological_space_generate_topology: "class.topological_space (generate_topology S)" |
61169 | 249 |
by standard (auto intro: generate_topology.intros) |
51471 | 250 |
|
63494 | 251 |
|
60758 | 252 |
subsection \<open>Order topologies\<close> |
51471 | 253 |
|
254 |
class order_topology = order + "open" + |
|
255 |
assumes open_generated_order: "open = generate_topology (range (\<lambda>a. {..< a}) \<union> range (\<lambda>a. {a <..}))" |
|
256 |
begin |
|
257 |
||
258 |
subclass topological_space |
|
259 |
unfolding open_generated_order |
|
260 |
by (rule topological_space_generate_topology) |
|
261 |
||
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56329
diff
changeset
|
262 |
lemma open_greaterThan [continuous_intros, simp]: "open {a <..}" |
51471 | 263 |
unfolding open_generated_order by (auto intro: generate_topology.Basis) |
264 |
||
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56329
diff
changeset
|
265 |
lemma open_lessThan [continuous_intros, simp]: "open {..< a}" |
51471 | 266 |
unfolding open_generated_order by (auto intro: generate_topology.Basis) |
267 |
||
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56329
diff
changeset
|
268 |
lemma open_greaterThanLessThan [continuous_intros, simp]: "open {a <..< b}" |
51471 | 269 |
unfolding greaterThanLessThan_eq by (simp add: open_Int) |
270 |
||
271 |
end |
|
272 |
||
273 |
class linorder_topology = linorder + order_topology |
|
274 |
||
63494 | 275 |
lemma closed_atMost [continuous_intros, simp]: "closed {..a}" |
276 |
for a :: "'a::linorder_topology" |
|
51471 | 277 |
by (simp add: closed_open) |
278 |
||
63494 | 279 |
lemma closed_atLeast [continuous_intros, simp]: "closed {a..}" |
280 |
for a :: "'a::linorder_topology" |
|
51471 | 281 |
by (simp add: closed_open) |
282 |
||
63494 | 283 |
lemma closed_atLeastAtMost [continuous_intros, simp]: "closed {a..b}" |
284 |
for a b :: "'a::linorder_topology" |
|
51471 | 285 |
proof - |
286 |
have "{a .. b} = {a ..} \<inter> {.. b}" |
|
287 |
by auto |
|
288 |
then show ?thesis |
|
289 |
by (simp add: closed_Int) |
|
290 |
qed |
|
291 |
||
70749
5d06b7bb9d22
More type class generalisations. Note that linorder_antisym_conv1 and linorder_antisym_conv2 no longer exist.
paulson <lp15@cam.ac.uk>
parents:
70723
diff
changeset
|
292 |
lemma (in order) less_separate: |
51471 | 293 |
assumes "x < y" |
294 |
shows "\<exists>a b. x \<in> {..< a} \<and> y \<in> {b <..} \<and> {..< a} \<inter> {b <..} = {}" |
|
53381 | 295 |
proof (cases "\<exists>z. x < z \<and> z < y") |
296 |
case True |
|
297 |
then obtain z where "x < z \<and> z < y" .. |
|
51471 | 298 |
then have "x \<in> {..< z} \<and> y \<in> {z <..} \<and> {z <..} \<inter> {..< z} = {}" |
299 |
by auto |
|
300 |
then show ?thesis by blast |
|
301 |
next |
|
53381 | 302 |
case False |
63494 | 303 |
with \<open>x < y\<close> have "x \<in> {..< y}" "y \<in> {x <..}" "{x <..} \<inter> {..< y} = {}" |
51471 | 304 |
by auto |
305 |
then show ?thesis by blast |
|
306 |
qed |
|
307 |
||
308 |
instance linorder_topology \<subseteq> t2_space |
|
309 |
proof |
|
310 |
fix x y :: 'a |
|
311 |
show "x \<noteq> y \<Longrightarrow> \<exists>U V. open U \<and> open V \<and> x \<in> U \<and> y \<in> V \<and> U \<inter> V = {}" |
|
63494 | 312 |
using less_separate [of x y] less_separate [of y x] |
313 |
by (elim neqE; metis open_lessThan open_greaterThan Int_commute) |
|
51471 | 314 |
qed |
315 |
||
51480
3793c3a11378
move connected to HOL image; used to show intermediate value theorem
hoelzl
parents:
51479
diff
changeset
|
316 |
lemma (in linorder_topology) open_right: |
63494 | 317 |
assumes "open S" "x \<in> S" |
318 |
and gt_ex: "x < y" |
|
319 |
shows "\<exists>b>x. {x ..< b} \<subseteq> S" |
|
320 |
using assms unfolding open_generated_order |
|
321 |
proof induct |
|
322 |
case UNIV |
|
323 |
then show ?case by blast |
|
324 |
next |
|
325 |
case (Int A B) |
|
326 |
then obtain a b where "a > x" "{x ..< a} \<subseteq> A" "b > x" "{x ..< b} \<subseteq> B" |
|
327 |
by auto |
|
328 |
then show ?case |
|
329 |
by (auto intro!: exI[of _ "min a b"]) |
|
330 |
next |
|
331 |
case UN |
|
332 |
then show ?case by blast |
|
333 |
next |
|
334 |
case Basis |
|
335 |
then show ?case |
|
336 |
by (fastforce intro: exI[of _ y] gt_ex) |
|
337 |
qed |
|
338 |
||
339 |
lemma (in linorder_topology) open_left: |
|
340 |
assumes "open S" "x \<in> S" |
|
341 |
and lt_ex: "y < x" |
|
342 |
shows "\<exists>b<x. {b <.. x} \<subseteq> S" |
|
51471 | 343 |
using assms unfolding open_generated_order |
344 |
proof induction |
|
63494 | 345 |
case UNIV |
346 |
then show ?case by blast |
|
347 |
next |
|
51471 | 348 |
case (Int A B) |
63494 | 349 |
then obtain a b where "a < x" "{a <.. x} \<subseteq> A" "b < x" "{b <.. x} \<subseteq> B" |
350 |
by auto |
|
351 |
then show ?case |
|
352 |
by (auto intro!: exI[of _ "max a b"]) |
|
51471 | 353 |
next |
63494 | 354 |
case UN |
355 |
then show ?case by blast |
|
51471 | 356 |
next |
63494 | 357 |
case Basis |
358 |
then show ?case |
|
359 |
by (fastforce intro: exI[of _ y] lt_ex) |
|
360 |
qed |
|
361 |
||
51471 | 362 |
|
62369 | 363 |
subsection \<open>Setup some topologies\<close> |
364 |
||
60758 | 365 |
subsubsection \<open>Boolean is an order topology\<close> |
59106 | 366 |
|
62369 | 367 |
class discrete_topology = topological_space + |
368 |
assumes open_discrete: "\<And>A. open A" |
|
369 |
||
370 |
instance discrete_topology < t2_space |
|
371 |
proof |
|
63494 | 372 |
fix x y :: 'a |
373 |
assume "x \<noteq> y" |
|
374 |
then show "\<exists>U V. open U \<and> open V \<and> x \<in> U \<and> y \<in> V \<and> U \<inter> V = {}" |
|
62369 | 375 |
by (intro exI[of _ "{_}"]) (auto intro!: open_discrete) |
376 |
qed |
|
377 |
||
378 |
instantiation bool :: linorder_topology |
|
59106 | 379 |
begin |
380 |
||
63494 | 381 |
definition open_bool :: "bool set \<Rightarrow> bool" |
382 |
where "open_bool = generate_topology (range (\<lambda>a. {..< a}) \<union> range (\<lambda>a. {a <..}))" |
|
59106 | 383 |
|
384 |
instance |
|
63494 | 385 |
by standard (rule open_bool_def) |
59106 | 386 |
|
387 |
end |
|
388 |
||
62369 | 389 |
instance bool :: discrete_topology |
390 |
proof |
|
391 |
fix A :: "bool set" |
|
59106 | 392 |
have *: "{False <..} = {True}" "{..< True} = {False}" |
393 |
by auto |
|
394 |
have "A = UNIV \<or> A = {} \<or> A = {False <..} \<or> A = {..< True}" |
|
63171 | 395 |
using subset_UNIV[of A] unfolding UNIV_bool * by blast |
59106 | 396 |
then show "open A" |
397 |
by auto |
|
398 |
qed |
|
399 |
||
62369 | 400 |
instantiation nat :: linorder_topology |
401 |
begin |
|
402 |
||
63494 | 403 |
definition open_nat :: "nat set \<Rightarrow> bool" |
404 |
where "open_nat = generate_topology (range (\<lambda>a. {..< a}) \<union> range (\<lambda>a. {a <..}))" |
|
62369 | 405 |
|
406 |
instance |
|
63494 | 407 |
by standard (rule open_nat_def) |
62369 | 408 |
|
409 |
end |
|
410 |
||
411 |
instance nat :: discrete_topology |
|
412 |
proof |
|
413 |
fix A :: "nat set" |
|
414 |
have "open {n}" for n :: nat |
|
415 |
proof (cases n) |
|
416 |
case 0 |
|
417 |
moreover have "{0} = {..<1::nat}" |
|
418 |
by auto |
|
419 |
ultimately show ?thesis |
|
420 |
by auto |
|
421 |
next |
|
422 |
case (Suc n') |
|
63494 | 423 |
then have "{n} = {..<Suc n} \<inter> {n' <..}" |
62369 | 424 |
by auto |
63494 | 425 |
with Suc show ?thesis |
62369 | 426 |
by (auto intro: open_lessThan open_greaterThan) |
427 |
qed |
|
428 |
then have "open (\<Union>a\<in>A. {a})" |
|
429 |
by (intro open_UN) auto |
|
430 |
then show "open A" |
|
431 |
by simp |
|
432 |
qed |
|
433 |
||
434 |
instantiation int :: linorder_topology |
|
435 |
begin |
|
436 |
||
63494 | 437 |
definition open_int :: "int set \<Rightarrow> bool" |
438 |
where "open_int = generate_topology (range (\<lambda>a. {..< a}) \<union> range (\<lambda>a. {a <..}))" |
|
62369 | 439 |
|
440 |
instance |
|
63494 | 441 |
by standard (rule open_int_def) |
62369 | 442 |
|
443 |
end |
|
444 |
||
445 |
instance int :: discrete_topology |
|
446 |
proof |
|
447 |
fix A :: "int set" |
|
448 |
have "{..<i + 1} \<inter> {i-1 <..} = {i}" for i :: int |
|
449 |
by auto |
|
450 |
then have "open {i}" for i :: int |
|
451 |
using open_Int[OF open_lessThan[of "i + 1"] open_greaterThan[of "i - 1"]] by auto |
|
452 |
then have "open (\<Union>a\<in>A. {a})" |
|
453 |
by (intro open_UN) auto |
|
454 |
then show "open A" |
|
455 |
by simp |
|
456 |
qed |
|
457 |
||
63494 | 458 |
|
60758 | 459 |
subsubsection \<open>Topological filters\<close> |
51471 | 460 |
|
461 |
definition (in topological_space) nhds :: "'a \<Rightarrow> 'a filter" |
|
68802 | 462 |
where "nhds a = (INF S\<in>{S. open S \<and> a \<in> S}. principal S)" |
51471 | 463 |
|
63494 | 464 |
definition (in topological_space) at_within :: "'a \<Rightarrow> 'a set \<Rightarrow> 'a filter" |
465 |
("at (_)/ within (_)" [1000, 60] 60) |
|
51641
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents:
51518
diff
changeset
|
466 |
where "at a within s = inf (nhds a) (principal (s - {a}))" |
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents:
51518
diff
changeset
|
467 |
|
63494 | 468 |
abbreviation (in topological_space) at :: "'a \<Rightarrow> 'a filter" ("at") |
469 |
where "at x \<equiv> at x within (CONST UNIV)" |
|
470 |
||
471 |
abbreviation (in order_topology) at_right :: "'a \<Rightarrow> 'a filter" |
|
472 |
where "at_right x \<equiv> at x within {x <..}" |
|
473 |
||
474 |
abbreviation (in order_topology) at_left :: "'a \<Rightarrow> 'a filter" |
|
475 |
where "at_left x \<equiv> at x within {..< x}" |
|
51471 | 476 |
|
57448
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
477 |
lemma (in topological_space) nhds_generated_topology: |
68802 | 478 |
"open = generate_topology T \<Longrightarrow> nhds x = (INF S\<in>{S\<in>T. x \<in> S}. principal S)" |
57448
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
479 |
unfolding nhds_def |
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
480 |
proof (safe intro!: antisym INF_greatest) |
63494 | 481 |
fix S |
482 |
assume "generate_topology T S" "x \<in> S" |
|
68802 | 483 |
then show "(INF S\<in>{S \<in> T. x \<in> S}. principal S) \<le> principal S" |
63494 | 484 |
by induct |
485 |
(auto intro: INF_lower order_trans simp: inf_principal[symmetric] simp del: inf_principal) |
|
57448
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
486 |
qed (auto intro!: INF_lower intro: generate_topology.intros) |
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
487 |
|
51473 | 488 |
lemma (in topological_space) eventually_nhds: |
51471 | 489 |
"eventually P (nhds a) \<longleftrightarrow> (\<exists>S. open S \<and> a \<in> S \<and> (\<forall>x\<in>S. P x))" |
57276 | 490 |
unfolding nhds_def by (subst eventually_INF_base) (auto simp: eventually_principal) |
51471 | 491 |
|
65036
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents:
64969
diff
changeset
|
492 |
lemma eventually_eventually: |
64969 | 493 |
"eventually (\<lambda>y. eventually P (nhds y)) (nhds x) = eventually P (nhds x)" |
65036
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents:
64969
diff
changeset
|
494 |
by (auto simp: eventually_nhds) |
64969 | 495 |
|
62102
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
hoelzl
parents:
62101
diff
changeset
|
496 |
lemma (in topological_space) eventually_nhds_in_open: |
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61520
diff
changeset
|
497 |
"open s \<Longrightarrow> x \<in> s \<Longrightarrow> eventually (\<lambda>y. y \<in> s) (nhds x)" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61520
diff
changeset
|
498 |
by (subst eventually_nhds) blast |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61520
diff
changeset
|
499 |
|
65204
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
500 |
lemma (in topological_space) eventually_nhds_x_imp_x: "eventually P (nhds x) \<Longrightarrow> P x" |
63295
52792bb9126e
Facts about HK integration, complex powers, Gamma function
eberlm
parents:
63171
diff
changeset
|
501 |
by (subst (asm) eventually_nhds) blast |
52792bb9126e
Facts about HK integration, complex powers, Gamma function
eberlm
parents:
63171
diff
changeset
|
502 |
|
65204
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
503 |
lemma (in topological_space) nhds_neq_bot [simp]: "nhds a \<noteq> bot" |
63494 | 504 |
by (simp add: trivial_limit_def eventually_nhds) |
505 |
||
506 |
lemma (in t1_space) t1_space_nhds: "x \<noteq> y \<Longrightarrow> (\<forall>\<^sub>F x in nhds x. x \<noteq> y)" |
|
60182
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60172
diff
changeset
|
507 |
by (drule t1_space) (auto simp: eventually_nhds) |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60172
diff
changeset
|
508 |
|
62369 | 509 |
lemma (in topological_space) nhds_discrete_open: "open {x} \<Longrightarrow> nhds x = principal {x}" |
510 |
by (auto simp: nhds_def intro!: antisym INF_greatest INF_lower2[of "{x}"]) |
|
511 |
||
512 |
lemma (in discrete_topology) nhds_discrete: "nhds x = principal {x}" |
|
513 |
by (simp add: nhds_discrete_open open_discrete) |
|
514 |
||
515 |
lemma (in discrete_topology) at_discrete: "at x within S = bot" |
|
516 |
unfolding at_within_def nhds_discrete by simp |
|
517 |
||
68860
f443ec10447d
Some basic materials on filters and topology
Manuel Eberl <eberlm@in.tum.de>
parents:
68802
diff
changeset
|
518 |
lemma (in discrete_topology) tendsto_discrete: |
f443ec10447d
Some basic materials on filters and topology
Manuel Eberl <eberlm@in.tum.de>
parents:
68802
diff
changeset
|
519 |
"filterlim (f :: 'b \<Rightarrow> 'a) (nhds y) F \<longleftrightarrow> eventually (\<lambda>x. f x = y) F" |
f443ec10447d
Some basic materials on filters and topology
Manuel Eberl <eberlm@in.tum.de>
parents:
68802
diff
changeset
|
520 |
by (auto simp: nhds_discrete filterlim_principal) |
f443ec10447d
Some basic materials on filters and topology
Manuel Eberl <eberlm@in.tum.de>
parents:
68802
diff
changeset
|
521 |
|
65204
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
522 |
lemma (in topological_space) at_within_eq: |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69164
diff
changeset
|
523 |
"at x within s = (INF S\<in>{S. open S \<and> x \<in> S}. principal (S \<inter> s - {x}))" |
63494 | 524 |
unfolding nhds_def at_within_def |
525 |
by (subst INF_inf_const2[symmetric]) (auto simp: Diff_Int_distrib) |
|
57448
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
526 |
|
65204
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
527 |
lemma (in topological_space) eventually_at_filter: |
51641
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents:
51518
diff
changeset
|
528 |
"eventually P (at a within s) \<longleftrightarrow> eventually (\<lambda>x. x \<noteq> a \<longrightarrow> x \<in> s \<longrightarrow> P x) (nhds a)" |
63494 | 529 |
by (simp add: at_within_def eventually_inf_principal imp_conjL[symmetric] conj_commute) |
51641
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents:
51518
diff
changeset
|
530 |
|
65204
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
531 |
lemma (in topological_space) at_le: "s \<subseteq> t \<Longrightarrow> at x within s \<le> at x within t" |
51641
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents:
51518
diff
changeset
|
532 |
unfolding at_within_def by (intro inf_mono) auto |
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents:
51518
diff
changeset
|
533 |
|
65204
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
534 |
lemma (in topological_space) eventually_at_topological: |
51641
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents:
51518
diff
changeset
|
535 |
"eventually P (at a within s) \<longleftrightarrow> (\<exists>S. open S \<and> a \<in> S \<and> (\<forall>x\<in>S. x \<noteq> a \<longrightarrow> x \<in> s \<longrightarrow> P x))" |
63494 | 536 |
by (simp add: eventually_nhds eventually_at_filter) |
51471 | 537 |
|
77138
c8597292cd41
Moved in a large number of highly useful library lemmas, mostly due to Manuel Eberl
paulson <lp15@cam.ac.uk>
parents:
76724
diff
changeset
|
538 |
lemma eventually_at_in_open: |
c8597292cd41
Moved in a large number of highly useful library lemmas, mostly due to Manuel Eberl
paulson <lp15@cam.ac.uk>
parents:
76724
diff
changeset
|
539 |
assumes "open A" "x \<in> A" |
c8597292cd41
Moved in a large number of highly useful library lemmas, mostly due to Manuel Eberl
paulson <lp15@cam.ac.uk>
parents:
76724
diff
changeset
|
540 |
shows "eventually (\<lambda>y. y \<in> A - {x}) (at x)" |
c8597292cd41
Moved in a large number of highly useful library lemmas, mostly due to Manuel Eberl
paulson <lp15@cam.ac.uk>
parents:
76724
diff
changeset
|
541 |
using assms eventually_at_topological by blast |
c8597292cd41
Moved in a large number of highly useful library lemmas, mostly due to Manuel Eberl
paulson <lp15@cam.ac.uk>
parents:
76724
diff
changeset
|
542 |
|
c8597292cd41
Moved in a large number of highly useful library lemmas, mostly due to Manuel Eberl
paulson <lp15@cam.ac.uk>
parents:
76724
diff
changeset
|
543 |
lemma eventually_at_in_open': |
c8597292cd41
Moved in a large number of highly useful library lemmas, mostly due to Manuel Eberl
paulson <lp15@cam.ac.uk>
parents:
76724
diff
changeset
|
544 |
assumes "open A" "x \<in> A" |
c8597292cd41
Moved in a large number of highly useful library lemmas, mostly due to Manuel Eberl
paulson <lp15@cam.ac.uk>
parents:
76724
diff
changeset
|
545 |
shows "eventually (\<lambda>y. y \<in> A) (at x)" |
c8597292cd41
Moved in a large number of highly useful library lemmas, mostly due to Manuel Eberl
paulson <lp15@cam.ac.uk>
parents:
76724
diff
changeset
|
546 |
using assms eventually_at_topological by blast |
c8597292cd41
Moved in a large number of highly useful library lemmas, mostly due to Manuel Eberl
paulson <lp15@cam.ac.uk>
parents:
76724
diff
changeset
|
547 |
|
65204
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
548 |
lemma (in topological_space) at_within_open: "a \<in> S \<Longrightarrow> open S \<Longrightarrow> at a within S = at a" |
51641
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents:
51518
diff
changeset
|
549 |
unfolding filter_eq_iff eventually_at_topological by (metis open_Int Int_iff UNIV_I) |
51481
ef949192e5d6
move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents:
51480
diff
changeset
|
550 |
|
65204
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
551 |
lemma (in topological_space) at_within_open_NO_MATCH: |
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
552 |
"a \<in> s \<Longrightarrow> open s \<Longrightarrow> NO_MATCH UNIV s \<Longrightarrow> at a within s = at a" |
61234 | 553 |
by (simp only: at_within_open) |
554 |
||
65204
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
555 |
lemma (in topological_space) at_within_open_subset: |
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
556 |
"a \<in> S \<Longrightarrow> open S \<Longrightarrow> S \<subseteq> T \<Longrightarrow> at a within T = at a" |
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
557 |
by (metis at_le at_within_open dual_order.antisym subset_UNIV) |
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
558 |
|
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
559 |
lemma (in topological_space) at_within_nhd: |
61245 | 560 |
assumes "x \<in> S" "open S" "T \<inter> S - {x} = U \<inter> S - {x}" |
561 |
shows "at x within T = at x within U" |
|
562 |
unfolding filter_eq_iff eventually_at_filter |
|
563 |
proof (intro allI eventually_subst) |
|
564 |
have "eventually (\<lambda>x. x \<in> S) (nhds x)" |
|
565 |
using \<open>x \<in> S\<close> \<open>open S\<close> by (auto simp: eventually_nhds) |
|
62102
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
hoelzl
parents:
62101
diff
changeset
|
566 |
then show "\<forall>\<^sub>F n in nhds x. (n \<noteq> x \<longrightarrow> n \<in> T \<longrightarrow> P n) = (n \<noteq> x \<longrightarrow> n \<in> U \<longrightarrow> P n)" for P |
61245 | 567 |
by eventually_elim (insert \<open>T \<inter> S - {x} = U \<inter> S - {x}\<close>, blast) |
568 |
qed |
|
569 |
||
65204
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
570 |
lemma (in topological_space) at_within_empty [simp]: "at a within {} = bot" |
53859 | 571 |
unfolding at_within_def by simp |
572 |
||
65204
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
573 |
lemma (in topological_space) at_within_union: |
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
574 |
"at x within (S \<union> T) = sup (at x within S) (at x within T)" |
53860 | 575 |
unfolding filter_eq_iff eventually_sup eventually_at_filter |
576 |
by (auto elim!: eventually_rev_mp) |
|
577 |
||
65204
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
578 |
lemma (in topological_space) at_eq_bot_iff: "at a = bot \<longleftrightarrow> open {a}" |
51471 | 579 |
unfolding trivial_limit_def eventually_at_topological |
74668 | 580 |
by (metis UNIV_I empty_iff is_singletonE is_singletonI' singleton_iff) |
63494 | 581 |
|
77138
c8597292cd41
Moved in a large number of highly useful library lemmas, mostly due to Manuel Eberl
paulson <lp15@cam.ac.uk>
parents:
76724
diff
changeset
|
582 |
lemma (in t1_space) eventually_neq_at_within: |
c8597292cd41
Moved in a large number of highly useful library lemmas, mostly due to Manuel Eberl
paulson <lp15@cam.ac.uk>
parents:
76724
diff
changeset
|
583 |
"eventually (\<lambda>w. w \<noteq> x) (at z within A)" |
c8597292cd41
Moved in a large number of highly useful library lemmas, mostly due to Manuel Eberl
paulson <lp15@cam.ac.uk>
parents:
76724
diff
changeset
|
584 |
by (smt (verit, ccfv_threshold) eventually_True eventually_at_topological separation_t1) |
c8597292cd41
Moved in a large number of highly useful library lemmas, mostly due to Manuel Eberl
paulson <lp15@cam.ac.uk>
parents:
76724
diff
changeset
|
585 |
|
65204
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
586 |
lemma (in perfect_space) at_neq_bot [simp]: "at a \<noteq> bot" |
51471 | 587 |
by (simp add: at_eq_bot_iff not_open_singleton) |
588 |
||
63494 | 589 |
lemma (in order_topology) nhds_order: |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69164
diff
changeset
|
590 |
"nhds x = inf (INF a\<in>{x <..}. principal {..< a}) (INF a\<in>{..< x}. principal {a <..})" |
57448
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
591 |
proof - |
62102
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
hoelzl
parents:
62101
diff
changeset
|
592 |
have 1: "{S \<in> range lessThan \<union> range greaterThan. x \<in> S} = |
57448
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
593 |
(\<lambda>a. {..< a}) ` {x <..} \<union> (\<lambda>a. {a <..}) ` {..< x}" |
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
594 |
by auto |
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
595 |
show ?thesis |
63494 | 596 |
by (simp only: nhds_generated_topology[OF open_generated_order] INF_union 1 INF_image comp_def) |
51471 | 597 |
qed |
598 |
||
65204
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
599 |
lemma (in topological_space) filterlim_at_within_If: |
63295
52792bb9126e
Facts about HK integration, complex powers, Gamma function
eberlm
parents:
63171
diff
changeset
|
600 |
assumes "filterlim f G (at x within (A \<inter> {x. P x}))" |
63494 | 601 |
and "filterlim g G (at x within (A \<inter> {x. \<not>P x}))" |
602 |
shows "filterlim (\<lambda>x. if P x then f x else g x) G (at x within A)" |
|
63295
52792bb9126e
Facts about HK integration, complex powers, Gamma function
eberlm
parents:
63171
diff
changeset
|
603 |
proof (rule filterlim_If) |
52792bb9126e
Facts about HK integration, complex powers, Gamma function
eberlm
parents:
63171
diff
changeset
|
604 |
note assms(1) |
52792bb9126e
Facts about HK integration, complex powers, Gamma function
eberlm
parents:
63171
diff
changeset
|
605 |
also have "at x within (A \<inter> {x. P x}) = inf (nhds x) (principal (A \<inter> Collect P - {x}))" |
52792bb9126e
Facts about HK integration, complex powers, Gamma function
eberlm
parents:
63171
diff
changeset
|
606 |
by (simp add: at_within_def) |
63494 | 607 |
also have "A \<inter> Collect P - {x} = (A - {x}) \<inter> Collect P" |
608 |
by blast |
|
63295
52792bb9126e
Facts about HK integration, complex powers, Gamma function
eberlm
parents:
63171
diff
changeset
|
609 |
also have "inf (nhds x) (principal \<dots>) = inf (at x within A) (principal (Collect P))" |
52792bb9126e
Facts about HK integration, complex powers, Gamma function
eberlm
parents:
63171
diff
changeset
|
610 |
by (simp add: at_within_def inf_assoc) |
52792bb9126e
Facts about HK integration, complex powers, Gamma function
eberlm
parents:
63171
diff
changeset
|
611 |
finally show "filterlim f G (inf (at x within A) (principal (Collect P)))" . |
52792bb9126e
Facts about HK integration, complex powers, Gamma function
eberlm
parents:
63171
diff
changeset
|
612 |
next |
52792bb9126e
Facts about HK integration, complex powers, Gamma function
eberlm
parents:
63171
diff
changeset
|
613 |
note assms(2) |
63494 | 614 |
also have "at x within (A \<inter> {x. \<not> P x}) = inf (nhds x) (principal (A \<inter> {x. \<not> P x} - {x}))" |
63295
52792bb9126e
Facts about HK integration, complex powers, Gamma function
eberlm
parents:
63171
diff
changeset
|
615 |
by (simp add: at_within_def) |
63494 | 616 |
also have "A \<inter> {x. \<not> P x} - {x} = (A - {x}) \<inter> {x. \<not> P x}" |
617 |
by blast |
|
618 |
also have "inf (nhds x) (principal \<dots>) = inf (at x within A) (principal {x. \<not> P x})" |
|
63295
52792bb9126e
Facts about HK integration, complex powers, Gamma function
eberlm
parents:
63171
diff
changeset
|
619 |
by (simp add: at_within_def inf_assoc) |
63494 | 620 |
finally show "filterlim g G (inf (at x within A) (principal {x. \<not> P x}))" . |
63295
52792bb9126e
Facts about HK integration, complex powers, Gamma function
eberlm
parents:
63171
diff
changeset
|
621 |
qed |
52792bb9126e
Facts about HK integration, complex powers, Gamma function
eberlm
parents:
63171
diff
changeset
|
622 |
|
65204
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
623 |
lemma (in topological_space) filterlim_at_If: |
63295
52792bb9126e
Facts about HK integration, complex powers, Gamma function
eberlm
parents:
63171
diff
changeset
|
624 |
assumes "filterlim f G (at x within {x. P x})" |
63494 | 625 |
and "filterlim g G (at x within {x. \<not>P x})" |
626 |
shows "filterlim (\<lambda>x. if P x then f x else g x) G (at x)" |
|
63295
52792bb9126e
Facts about HK integration, complex powers, Gamma function
eberlm
parents:
63171
diff
changeset
|
627 |
using assms by (intro filterlim_at_within_If) simp_all |
63494 | 628 |
lemma (in linorder_topology) at_within_order: |
629 |
assumes "UNIV \<noteq> {x}" |
|
630 |
shows "at x within s = |
|
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69164
diff
changeset
|
631 |
inf (INF a\<in>{x <..}. principal ({..< a} \<inter> s - {x})) |
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69164
diff
changeset
|
632 |
(INF a\<in>{..< x}. principal ({a <..} \<inter> s - {x}))" |
63494 | 633 |
proof (cases "{x <..} = {}" "{..< x} = {}" rule: case_split [case_product case_split]) |
634 |
case True_True |
|
635 |
have "UNIV = {..< x} \<union> {x} \<union> {x <..}" |
|
57448
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
636 |
by auto |
63494 | 637 |
with assms True_True show ?thesis |
57448
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
638 |
by auto |
63494 | 639 |
qed (auto simp del: inf_principal simp: at_within_def nhds_order Int_Diff |
640 |
inf_principal[symmetric] INF_inf_const2 inf_sup_aci[where 'a="'a filter"]) |
|
57448
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
641 |
|
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
642 |
lemma (in linorder_topology) at_left_eq: |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69164
diff
changeset
|
643 |
"y < x \<Longrightarrow> at_left x = (INF a\<in>{..< x}. principal {a <..< x})" |
57448
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
644 |
by (subst at_within_order) |
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
645 |
(auto simp: greaterThan_Int_greaterThan greaterThanLessThan_eq[symmetric] min.absorb2 INF_constant |
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
646 |
intro!: INF_lower2 inf_absorb2) |
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
647 |
|
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
648 |
lemma (in linorder_topology) eventually_at_left: |
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
649 |
"y < x \<Longrightarrow> eventually P (at_left x) \<longleftrightarrow> (\<exists>b<x. \<forall>y>b. y < x \<longrightarrow> P y)" |
63494 | 650 |
unfolding at_left_eq |
651 |
by (subst eventually_INF_base) (auto simp: eventually_principal Ball_def) |
|
57448
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
652 |
|
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
653 |
lemma (in linorder_topology) at_right_eq: |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69164
diff
changeset
|
654 |
"x < y \<Longrightarrow> at_right x = (INF a\<in>{x <..}. principal {x <..< a})" |
57448
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
655 |
by (subst at_within_order) |
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
656 |
(auto simp: lessThan_Int_lessThan greaterThanLessThan_eq[symmetric] max.absorb2 INF_constant Int_commute |
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
657 |
intro!: INF_lower2 inf_absorb1) |
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
658 |
|
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
659 |
lemma (in linorder_topology) eventually_at_right: |
159e45728ceb
more equalities of topological filters; strengthen dependent_nat_choice; tuned a couple of proofs
hoelzl
parents:
57447
diff
changeset
|
660 |
"x < y \<Longrightarrow> eventually P (at_right x) \<longleftrightarrow> (\<exists>b>x. \<forall>y>x. y < b \<longrightarrow> P y)" |
63494 | 661 |
unfolding at_right_eq |
662 |
by (subst eventually_INF_base) (auto simp: eventually_principal Ball_def) |
|
51471 | 663 |
|
62083 | 664 |
lemma eventually_at_right_less: "\<forall>\<^sub>F y in at_right (x::'a::{linorder_topology, no_top}). x < y" |
665 |
using gt_ex[of x] eventually_at_right[of x] by auto |
|
666 |
||
63494 | 667 |
lemma trivial_limit_at_right_top: "at_right (top::_::{order_top,linorder_topology}) = bot" |
668 |
by (auto simp: filter_eq_iff eventually_at_topological) |
|
669 |
||
670 |
lemma trivial_limit_at_left_bot: "at_left (bot::_::{order_bot,linorder_topology}) = bot" |
|
671 |
by (auto simp: filter_eq_iff eventually_at_topological) |
|
672 |
||
673 |
lemma trivial_limit_at_left_real [simp]: "\<not> trivial_limit (at_left x)" |
|
674 |
for x :: "'a::{no_bot,dense_order,linorder_topology}" |
|
675 |
using lt_ex [of x] |
|
57275
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57025
diff
changeset
|
676 |
by safe (auto simp add: trivial_limit_def eventually_at_left dest: dense) |
51471 | 677 |
|
63494 | 678 |
lemma trivial_limit_at_right_real [simp]: "\<not> trivial_limit (at_right x)" |
679 |
for x :: "'a::{no_top,dense_order,linorder_topology}" |
|
57275
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57025
diff
changeset
|
680 |
using gt_ex[of x] |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57025
diff
changeset
|
681 |
by safe (auto simp add: trivial_limit_def eventually_at_right dest: dense) |
51471 | 682 |
|
65204
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
683 |
lemma (in linorder_topology) at_eq_sup_left_right: "at x = sup (at_left x) (at_right x)" |
62102
877463945ce9
fix code generation for uniformity: uniformity is a non-computable pure data.
hoelzl
parents:
62101
diff
changeset
|
684 |
by (auto simp: eventually_at_filter filter_eq_iff eventually_sup |
63494 | 685 |
elim: eventually_elim2 eventually_mono) |
51471 | 686 |
|
65204
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
687 |
lemma (in linorder_topology) eventually_at_split: |
63494 | 688 |
"eventually P (at x) \<longleftrightarrow> eventually P (at_left x) \<and> eventually P (at_right x)" |
51471 | 689 |
by (subst at_eq_sup_left_right) (simp add: eventually_sup) |
690 |
||
65204
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
691 |
lemma (in order_topology) eventually_at_leftI: |
63713 | 692 |
assumes "\<And>x. x \<in> {a<..<b} \<Longrightarrow> P x" "a < b" |
693 |
shows "eventually P (at_left b)" |
|
694 |
using assms unfolding eventually_at_topological by (intro exI[of _ "{a<..}"]) auto |
|
695 |
||
65204
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
696 |
lemma (in order_topology) eventually_at_rightI: |
63713 | 697 |
assumes "\<And>x. x \<in> {a<..<b} \<Longrightarrow> P x" "a < b" |
698 |
shows "eventually P (at_right a)" |
|
699 |
using assms unfolding eventually_at_topological by (intro exI[of _ "{..<b}"]) auto |
|
700 |
||
66162 | 701 |
lemma eventually_filtercomap_nhds: |
702 |
"eventually P (filtercomap f (nhds x)) \<longleftrightarrow> (\<exists>S. open S \<and> x \<in> S \<and> (\<forall>x. f x \<in> S \<longrightarrow> P x))" |
|
703 |
unfolding eventually_filtercomap eventually_nhds by auto |
|
704 |
||
705 |
lemma eventually_filtercomap_at_topological: |
|
706 |
"eventually P (filtercomap f (at A within B)) \<longleftrightarrow> |
|
707 |
(\<exists>S. open S \<and> A \<in> S \<and> (\<forall>x. f x \<in> S \<inter> B - {A} \<longrightarrow> P x))" (is "?lhs = ?rhs") |
|
708 |
unfolding at_within_def filtercomap_inf eventually_inf_principal filtercomap_principal |
|
709 |
eventually_filtercomap_nhds eventually_principal by blast |
|
67685
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67577
diff
changeset
|
710 |
|
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67577
diff
changeset
|
711 |
lemma eventually_at_right_field: |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67577
diff
changeset
|
712 |
"eventually P (at_right x) \<longleftrightarrow> (\<exists>b>x. \<forall>y>x. y < b \<longrightarrow> P y)" |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67577
diff
changeset
|
713 |
for x :: "'a::{linordered_field, linorder_topology}" |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67577
diff
changeset
|
714 |
using linordered_field_no_ub[rule_format, of x] |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67577
diff
changeset
|
715 |
by (auto simp: eventually_at_right) |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67577
diff
changeset
|
716 |
|
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67577
diff
changeset
|
717 |
lemma eventually_at_left_field: |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67577
diff
changeset
|
718 |
"eventually P (at_left x) \<longleftrightarrow> (\<exists>b<x. \<forall>y>b. y < x \<longrightarrow> P y)" |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67577
diff
changeset
|
719 |
for x :: "'a::{linordered_field, linorder_topology}" |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67577
diff
changeset
|
720 |
using linordered_field_no_lb[rule_format, of x] |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67577
diff
changeset
|
721 |
by (auto simp: eventually_at_left) |
66162 | 722 |
|
77140
9a60c1759543
Lots more new material thanks to Manuel Eberl
paulson <lp15@cam.ac.uk>
parents:
77138
diff
changeset
|
723 |
lemma filtermap_nhds_eq_imp_filtermap_at_eq: |
9a60c1759543
Lots more new material thanks to Manuel Eberl
paulson <lp15@cam.ac.uk>
parents:
77138
diff
changeset
|
724 |
assumes "filtermap f (nhds z) = nhds (f z)" |
9a60c1759543
Lots more new material thanks to Manuel Eberl
paulson <lp15@cam.ac.uk>
parents:
77138
diff
changeset
|
725 |
assumes "eventually (\<lambda>x. f x = f z \<longrightarrow> x = z) (at z)" |
9a60c1759543
Lots more new material thanks to Manuel Eberl
paulson <lp15@cam.ac.uk>
parents:
77138
diff
changeset
|
726 |
shows "filtermap f (at z) = at (f z)" |
9a60c1759543
Lots more new material thanks to Manuel Eberl
paulson <lp15@cam.ac.uk>
parents:
77138
diff
changeset
|
727 |
proof (rule filter_eqI) |
9a60c1759543
Lots more new material thanks to Manuel Eberl
paulson <lp15@cam.ac.uk>
parents:
77138
diff
changeset
|
728 |
fix P :: "'a \<Rightarrow> bool" |
9a60c1759543
Lots more new material thanks to Manuel Eberl
paulson <lp15@cam.ac.uk>
parents:
77138
diff
changeset
|
729 |
have "eventually P (filtermap f (at z)) \<longleftrightarrow> (\<forall>\<^sub>F x in nhds z. x \<noteq> z \<longrightarrow> P (f x))" |
9a60c1759543
Lots more new material thanks to Manuel Eberl
paulson <lp15@cam.ac.uk>
parents:
77138
diff
changeset
|
730 |
by (simp add: eventually_filtermap eventually_at_filter) |
9a60c1759543
Lots more new material thanks to Manuel Eberl
paulson <lp15@cam.ac.uk>
parents:
77138
diff
changeset
|
731 |
also have "\<dots> \<longleftrightarrow> (\<forall>\<^sub>F x in nhds z. f x \<noteq> f z \<longrightarrow> P (f x))" |
9a60c1759543
Lots more new material thanks to Manuel Eberl
paulson <lp15@cam.ac.uk>
parents:
77138
diff
changeset
|
732 |
by (rule eventually_cong [OF assms(2)[unfolded eventually_at_filter]]) auto |
9a60c1759543
Lots more new material thanks to Manuel Eberl
paulson <lp15@cam.ac.uk>
parents:
77138
diff
changeset
|
733 |
also have "\<dots> \<longleftrightarrow> (\<forall>\<^sub>F x in filtermap f (nhds z). x \<noteq> f z \<longrightarrow> P x)" |
9a60c1759543
Lots more new material thanks to Manuel Eberl
paulson <lp15@cam.ac.uk>
parents:
77138
diff
changeset
|
734 |
by (simp add: eventually_filtermap) |
9a60c1759543
Lots more new material thanks to Manuel Eberl
paulson <lp15@cam.ac.uk>
parents:
77138
diff
changeset
|
735 |
also have "filtermap f (nhds z) = nhds (f z)" |
9a60c1759543
Lots more new material thanks to Manuel Eberl
paulson <lp15@cam.ac.uk>
parents:
77138
diff
changeset
|
736 |
by (rule assms) |
9a60c1759543
Lots more new material thanks to Manuel Eberl
paulson <lp15@cam.ac.uk>
parents:
77138
diff
changeset
|
737 |
also have "(\<forall>\<^sub>F x in nhds (f z). x \<noteq> f z \<longrightarrow> P x) \<longleftrightarrow> (\<forall>\<^sub>F x in at (f z). P x)" |
9a60c1759543
Lots more new material thanks to Manuel Eberl
paulson <lp15@cam.ac.uk>
parents:
77138
diff
changeset
|
738 |
by (simp add: eventually_at_filter) |
9a60c1759543
Lots more new material thanks to Manuel Eberl
paulson <lp15@cam.ac.uk>
parents:
77138
diff
changeset
|
739 |
finally show "eventually P (filtermap f (at z)) = eventually P (at (f z))" . |
9a60c1759543
Lots more new material thanks to Manuel Eberl
paulson <lp15@cam.ac.uk>
parents:
77138
diff
changeset
|
740 |
qed |
63494 | 741 |
|
60758 | 742 |
subsubsection \<open>Tendsto\<close> |
51471 | 743 |
|
744 |
abbreviation (in topological_space) |
|
63494 | 745 |
tendsto :: "('b \<Rightarrow> 'a) \<Rightarrow> 'a \<Rightarrow> 'b filter \<Rightarrow> bool" (infixr "\<longlongrightarrow>" 55) |
746 |
where "(f \<longlongrightarrow> l) F \<equiv> filterlim f (nhds l) F" |
|
747 |
||
748 |
definition (in t2_space) Lim :: "'f filter \<Rightarrow> ('f \<Rightarrow> 'a) \<Rightarrow> 'a" |
|
749 |
where "Lim A f = (THE l. (f \<longlongrightarrow> l) A)" |
|
51478
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51474
diff
changeset
|
750 |
|
65204
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
751 |
lemma (in topological_space) tendsto_eq_rhs: "(f \<longlongrightarrow> x) F \<Longrightarrow> x = y \<Longrightarrow> (f \<longlongrightarrow> y) F" |
51471 | 752 |
by simp |
753 |
||
57953 | 754 |
named_theorems tendsto_intros "introduction rules for tendsto" |
60758 | 755 |
setup \<open> |
67149 | 756 |
Global_Theory.add_thms_dynamic (\<^binding>\<open>tendsto_eq_intros\<close>, |
57953 | 757 |
fn context => |
69593 | 758 |
Named_Theorems.get (Context.proof_of context) \<^named_theorems>\<open>tendsto_intros\<close> |
57953 | 759 |
|> map_filter (try (fn thm => @{thm tendsto_eq_rhs} OF [thm]))) |
60758 | 760 |
\<close> |
51471 | 761 |
|
65204
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
762 |
context topological_space begin |
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
763 |
|
d23eded35a33
modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents:
65036
diff
changeset
|
764 |
lemma tendsto_def: |
61973 | 765 |
"(f \<longlongrightarrow> l) F \<longleftrightarrow> (\<forall>S. open S \<longrightarrow> l \<in> S \<longrightarrow> eventually (\<lambda>x. f x \<in> S) F)" |
57276 | 766 |
unfolding nhds_def filterlim_INF filterlim_principal by auto |
51471 | 767 |
|
63494 | 768 |
lemma tendsto_cong: "(f \<longlongrightarrow> c) F \<longleftrightarrow> (g \<longlongrightarrow> c) F" if "eventually (\<lambda>x. f x = g x) F" |
769 |
by (rule filterlim_cong [OF refl refl that]) |
|
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61520
diff
changeset
|
770 |
|
61973 | 771 |
lemma tendsto_mono: "F \<le> F' \<Longrightarrow> (f \<longlongrightarrow> l) F' \<Longrightarrow> (f \<longlongrightarrow> l) F" |