1 (* Title: HOL/Multivariate_Analysis/Extended_Real_Limits.thy |
|
2 Author: Johannes Hölzl, TU München |
|
3 Author: Robert Himmelmann, TU München |
|
4 Author: Armin Heller, TU München |
|
5 Author: Bogdan Grechuk, University of Edinburgh |
|
6 *) |
|
7 |
|
8 section \<open>Limits on the Extended real number line\<close> |
|
9 |
|
10 theory Extended_Real_Limits |
|
11 imports |
|
12 Topology_Euclidean_Space |
|
13 "~~/src/HOL/Library/Extended_Real" |
|
14 "~~/src/HOL/Library/Extended_Nonnegative_Real" |
|
15 "~~/src/HOL/Library/Indicator_Function" |
|
16 begin |
|
17 |
|
18 lemma compact_UNIV: |
|
19 "compact (UNIV :: 'a::{complete_linorder,linorder_topology,second_countable_topology} set)" |
|
20 using compact_complete_linorder |
|
21 by (auto simp: seq_compact_eq_compact[symmetric] seq_compact_def) |
|
22 |
|
23 lemma compact_eq_closed: |
|
24 fixes S :: "'a::{complete_linorder,linorder_topology,second_countable_topology} set" |
|
25 shows "compact S \<longleftrightarrow> closed S" |
|
26 using closed_Int_compact[of S, OF _ compact_UNIV] compact_imp_closed |
|
27 by auto |
|
28 |
|
29 lemma closed_contains_Sup_cl: |
|
30 fixes S :: "'a::{complete_linorder,linorder_topology,second_countable_topology} set" |
|
31 assumes "closed S" |
|
32 and "S \<noteq> {}" |
|
33 shows "Sup S \<in> S" |
|
34 proof - |
|
35 from compact_eq_closed[of S] compact_attains_sup[of S] assms |
|
36 obtain s where S: "s \<in> S" "\<forall>t\<in>S. t \<le> s" |
|
37 by auto |
|
38 then have "Sup S = s" |
|
39 by (auto intro!: Sup_eqI) |
|
40 with S show ?thesis |
|
41 by simp |
|
42 qed |
|
43 |
|
44 lemma closed_contains_Inf_cl: |
|
45 fixes S :: "'a::{complete_linorder,linorder_topology,second_countable_topology} set" |
|
46 assumes "closed S" |
|
47 and "S \<noteq> {}" |
|
48 shows "Inf S \<in> S" |
|
49 proof - |
|
50 from compact_eq_closed[of S] compact_attains_inf[of S] assms |
|
51 obtain s where S: "s \<in> S" "\<forall>t\<in>S. s \<le> t" |
|
52 by auto |
|
53 then have "Inf S = s" |
|
54 by (auto intro!: Inf_eqI) |
|
55 with S show ?thesis |
|
56 by simp |
|
57 qed |
|
58 |
|
59 instance ereal :: second_countable_topology |
|
60 proof (standard, intro exI conjI) |
|
61 let ?B = "(\<Union>r\<in>\<rat>. {{..< r}, {r <..}} :: ereal set set)" |
|
62 show "countable ?B" |
|
63 by (auto intro: countable_rat) |
|
64 show "open = generate_topology ?B" |
|
65 proof (intro ext iffI) |
|
66 fix S :: "ereal set" |
|
67 assume "open S" |
|
68 then show "generate_topology ?B S" |
|
69 unfolding open_generated_order |
|
70 proof induct |
|
71 case (Basis b) |
|
72 then obtain e where "b = {..<e} \<or> b = {e<..}" |
|
73 by auto |
|
74 moreover have "{..<e} = \<Union>{{..<x}|x. x \<in> \<rat> \<and> x < e}" "{e<..} = \<Union>{{x<..}|x. x \<in> \<rat> \<and> e < x}" |
|
75 by (auto dest: ereal_dense3 |
|
76 simp del: ex_simps |
|
77 simp add: ex_simps[symmetric] conj_commute Rats_def image_iff) |
|
78 ultimately show ?case |
|
79 by (auto intro: generate_topology.intros) |
|
80 qed (auto intro: generate_topology.intros) |
|
81 next |
|
82 fix S |
|
83 assume "generate_topology ?B S" |
|
84 then show "open S" |
|
85 by induct auto |
|
86 qed |
|
87 qed |
|
88 |
|
89 text \<open>This is a copy from \<open>ereal :: second_countable_topology\<close>. Maybe find a common super class of |
|
90 topological spaces where the rational numbers are densely embedded ?\<close> |
|
91 instance ennreal :: second_countable_topology |
|
92 proof (standard, intro exI conjI) |
|
93 let ?B = "(\<Union>r\<in>\<rat>. {{..< r}, {r <..}} :: ennreal set set)" |
|
94 show "countable ?B" |
|
95 by (auto intro: countable_rat) |
|
96 show "open = generate_topology ?B" |
|
97 proof (intro ext iffI) |
|
98 fix S :: "ennreal set" |
|
99 assume "open S" |
|
100 then show "generate_topology ?B S" |
|
101 unfolding open_generated_order |
|
102 proof induct |
|
103 case (Basis b) |
|
104 then obtain e where "b = {..<e} \<or> b = {e<..}" |
|
105 by auto |
|
106 moreover have "{..<e} = \<Union>{{..<x}|x. x \<in> \<rat> \<and> x < e}" "{e<..} = \<Union>{{x<..}|x. x \<in> \<rat> \<and> e < x}" |
|
107 by (auto dest: ennreal_rat_dense |
|
108 simp del: ex_simps |
|
109 simp add: ex_simps[symmetric] conj_commute Rats_def image_iff) |
|
110 ultimately show ?case |
|
111 by (auto intro: generate_topology.intros) |
|
112 qed (auto intro: generate_topology.intros) |
|
113 next |
|
114 fix S |
|
115 assume "generate_topology ?B S" |
|
116 then show "open S" |
|
117 by induct auto |
|
118 qed |
|
119 qed |
|
120 |
|
121 lemma ereal_open_closed_aux: |
|
122 fixes S :: "ereal set" |
|
123 assumes "open S" |
|
124 and "closed S" |
|
125 and S: "(-\<infinity>) \<notin> S" |
|
126 shows "S = {}" |
|
127 proof (rule ccontr) |
|
128 assume "\<not> ?thesis" |
|
129 then have *: "Inf S \<in> S" |
|
130 |
|
131 by (metis assms(2) closed_contains_Inf_cl) |
|
132 { |
|
133 assume "Inf S = -\<infinity>" |
|
134 then have False |
|
135 using * assms(3) by auto |
|
136 } |
|
137 moreover |
|
138 { |
|
139 assume "Inf S = \<infinity>" |
|
140 then have "S = {\<infinity>}" |
|
141 by (metis Inf_eq_PInfty \<open>S \<noteq> {}\<close>) |
|
142 then have False |
|
143 by (metis assms(1) not_open_singleton) |
|
144 } |
|
145 moreover |
|
146 { |
|
147 assume fin: "\<bar>Inf S\<bar> \<noteq> \<infinity>" |
|
148 from ereal_open_cont_interval[OF assms(1) * fin] |
|
149 obtain e where e: "e > 0" "{Inf S - e<..<Inf S + e} \<subseteq> S" . |
|
150 then obtain b where b: "Inf S - e < b" "b < Inf S" |
|
151 using fin ereal_between[of "Inf S" e] dense[of "Inf S - e"] |
|
152 by auto |
|
153 then have "b: {Inf S - e <..< Inf S + e}" |
|
154 using e fin ereal_between[of "Inf S" e] |
|
155 by auto |
|
156 then have "b \<in> S" |
|
157 using e by auto |
|
158 then have False |
|
159 using b by (metis complete_lattice_class.Inf_lower leD) |
|
160 } |
|
161 ultimately show False |
|
162 by auto |
|
163 qed |
|
164 |
|
165 lemma ereal_open_closed: |
|
166 fixes S :: "ereal set" |
|
167 shows "open S \<and> closed S \<longleftrightarrow> S = {} \<or> S = UNIV" |
|
168 proof - |
|
169 { |
|
170 assume lhs: "open S \<and> closed S" |
|
171 { |
|
172 assume "-\<infinity> \<notin> S" |
|
173 then have "S = {}" |
|
174 using lhs ereal_open_closed_aux by auto |
|
175 } |
|
176 moreover |
|
177 { |
|
178 assume "-\<infinity> \<in> S" |
|
179 then have "- S = {}" |
|
180 using lhs ereal_open_closed_aux[of "-S"] by auto |
|
181 } |
|
182 ultimately have "S = {} \<or> S = UNIV" |
|
183 by auto |
|
184 } |
|
185 then show ?thesis |
|
186 by auto |
|
187 qed |
|
188 |
|
189 lemma ereal_open_atLeast: |
|
190 fixes x :: ereal |
|
191 shows "open {x..} \<longleftrightarrow> x = -\<infinity>" |
|
192 proof |
|
193 assume "x = -\<infinity>" |
|
194 then have "{x..} = UNIV" |
|
195 by auto |
|
196 then show "open {x..}" |
|
197 by auto |
|
198 next |
|
199 assume "open {x..}" |
|
200 then have "open {x..} \<and> closed {x..}" |
|
201 by auto |
|
202 then have "{x..} = UNIV" |
|
203 unfolding ereal_open_closed by auto |
|
204 then show "x = -\<infinity>" |
|
205 by (simp add: bot_ereal_def atLeast_eq_UNIV_iff) |
|
206 qed |
|
207 |
|
208 lemma mono_closed_real: |
|
209 fixes S :: "real set" |
|
210 assumes mono: "\<forall>y z. y \<in> S \<and> y \<le> z \<longrightarrow> z \<in> S" |
|
211 and "closed S" |
|
212 shows "S = {} \<or> S = UNIV \<or> (\<exists>a. S = {a..})" |
|
213 proof - |
|
214 { |
|
215 assume "S \<noteq> {}" |
|
216 { assume ex: "\<exists>B. \<forall>x\<in>S. B \<le> x" |
|
217 then have *: "\<forall>x\<in>S. Inf S \<le> x" |
|
218 using cInf_lower[of _ S] ex by (metis bdd_below_def) |
|
219 then have "Inf S \<in> S" |
|
220 apply (subst closed_contains_Inf) |
|
221 using ex \<open>S \<noteq> {}\<close> \<open>closed S\<close> |
|
222 apply auto |
|
223 done |
|
224 then have "\<forall>x. Inf S \<le> x \<longleftrightarrow> x \<in> S" |
|
225 using mono[rule_format, of "Inf S"] * |
|
226 by auto |
|
227 then have "S = {Inf S ..}" |
|
228 by auto |
|
229 then have "\<exists>a. S = {a ..}" |
|
230 by auto |
|
231 } |
|
232 moreover |
|
233 { |
|
234 assume "\<not> (\<exists>B. \<forall>x\<in>S. B \<le> x)" |
|
235 then have nex: "\<forall>B. \<exists>x\<in>S. x < B" |
|
236 by (simp add: not_le) |
|
237 { |
|
238 fix y |
|
239 obtain x where "x\<in>S" and "x < y" |
|
240 using nex by auto |
|
241 then have "y \<in> S" |
|
242 using mono[rule_format, of x y] by auto |
|
243 } |
|
244 then have "S = UNIV" |
|
245 by auto |
|
246 } |
|
247 ultimately have "S = UNIV \<or> (\<exists>a. S = {a ..})" |
|
248 by blast |
|
249 } |
|
250 then show ?thesis |
|
251 by blast |
|
252 qed |
|
253 |
|
254 lemma mono_closed_ereal: |
|
255 fixes S :: "real set" |
|
256 assumes mono: "\<forall>y z. y \<in> S \<and> y \<le> z \<longrightarrow> z \<in> S" |
|
257 and "closed S" |
|
258 shows "\<exists>a. S = {x. a \<le> ereal x}" |
|
259 proof - |
|
260 { |
|
261 assume "S = {}" |
|
262 then have ?thesis |
|
263 apply (rule_tac x=PInfty in exI) |
|
264 apply auto |
|
265 done |
|
266 } |
|
267 moreover |
|
268 { |
|
269 assume "S = UNIV" |
|
270 then have ?thesis |
|
271 apply (rule_tac x="-\<infinity>" in exI) |
|
272 apply auto |
|
273 done |
|
274 } |
|
275 moreover |
|
276 { |
|
277 assume "\<exists>a. S = {a ..}" |
|
278 then obtain a where "S = {a ..}" |
|
279 by auto |
|
280 then have ?thesis |
|
281 apply (rule_tac x="ereal a" in exI) |
|
282 apply auto |
|
283 done |
|
284 } |
|
285 ultimately show ?thesis |
|
286 using mono_closed_real[of S] assms by auto |
|
287 qed |
|
288 |
|
289 lemma Liminf_within: |
|
290 fixes f :: "'a::metric_space \<Rightarrow> 'b::complete_lattice" |
|
291 shows "Liminf (at x within S) f = (SUP e:{0<..}. INF y:(S \<inter> ball x e - {x}). f y)" |
|
292 unfolding Liminf_def eventually_at |
|
293 proof (rule SUP_eq, simp_all add: Ball_def Bex_def, safe) |
|
294 fix P d |
|
295 assume "0 < d" and "\<forall>y. y \<in> S \<longrightarrow> y \<noteq> x \<and> dist y x < d \<longrightarrow> P y" |
|
296 then have "S \<inter> ball x d - {x} \<subseteq> {x. P x}" |
|
297 by (auto simp: zero_less_dist_iff dist_commute) |
|
298 then show "\<exists>r>0. INFIMUM (Collect P) f \<le> INFIMUM (S \<inter> ball x r - {x}) f" |
|
299 by (intro exI[of _ d] INF_mono conjI \<open>0 < d\<close>) auto |
|
300 next |
|
301 fix d :: real |
|
302 assume "0 < d" |
|
303 then show "\<exists>P. (\<exists>d>0. \<forall>xa. xa \<in> S \<longrightarrow> xa \<noteq> x \<and> dist xa x < d \<longrightarrow> P xa) \<and> |
|
304 INFIMUM (S \<inter> ball x d - {x}) f \<le> INFIMUM (Collect P) f" |
|
305 by (intro exI[of _ "\<lambda>y. y \<in> S \<inter> ball x d - {x}"]) |
|
306 (auto intro!: INF_mono exI[of _ d] simp: dist_commute) |
|
307 qed |
|
308 |
|
309 lemma Limsup_within: |
|
310 fixes f :: "'a::metric_space \<Rightarrow> 'b::complete_lattice" |
|
311 shows "Limsup (at x within S) f = (INF e:{0<..}. SUP y:(S \<inter> ball x e - {x}). f y)" |
|
312 unfolding Limsup_def eventually_at |
|
313 proof (rule INF_eq, simp_all add: Ball_def Bex_def, safe) |
|
314 fix P d |
|
315 assume "0 < d" and "\<forall>y. y \<in> S \<longrightarrow> y \<noteq> x \<and> dist y x < d \<longrightarrow> P y" |
|
316 then have "S \<inter> ball x d - {x} \<subseteq> {x. P x}" |
|
317 by (auto simp: zero_less_dist_iff dist_commute) |
|
318 then show "\<exists>r>0. SUPREMUM (S \<inter> ball x r - {x}) f \<le> SUPREMUM (Collect P) f" |
|
319 by (intro exI[of _ d] SUP_mono conjI \<open>0 < d\<close>) auto |
|
320 next |
|
321 fix d :: real |
|
322 assume "0 < d" |
|
323 then show "\<exists>P. (\<exists>d>0. \<forall>xa. xa \<in> S \<longrightarrow> xa \<noteq> x \<and> dist xa x < d \<longrightarrow> P xa) \<and> |
|
324 SUPREMUM (Collect P) f \<le> SUPREMUM (S \<inter> ball x d - {x}) f" |
|
325 by (intro exI[of _ "\<lambda>y. y \<in> S \<inter> ball x d - {x}"]) |
|
326 (auto intro!: SUP_mono exI[of _ d] simp: dist_commute) |
|
327 qed |
|
328 |
|
329 lemma Liminf_at: |
|
330 fixes f :: "'a::metric_space \<Rightarrow> 'b::complete_lattice" |
|
331 shows "Liminf (at x) f = (SUP e:{0<..}. INF y:(ball x e - {x}). f y)" |
|
332 using Liminf_within[of x UNIV f] by simp |
|
333 |
|
334 lemma Limsup_at: |
|
335 fixes f :: "'a::metric_space \<Rightarrow> 'b::complete_lattice" |
|
336 shows "Limsup (at x) f = (INF e:{0<..}. SUP y:(ball x e - {x}). f y)" |
|
337 using Limsup_within[of x UNIV f] by simp |
|
338 |
|
339 lemma min_Liminf_at: |
|
340 fixes f :: "'a::metric_space \<Rightarrow> 'b::complete_linorder" |
|
341 shows "min (f x) (Liminf (at x) f) = (SUP e:{0<..}. INF y:ball x e. f y)" |
|
342 unfolding inf_min[symmetric] Liminf_at |
|
343 apply (subst inf_commute) |
|
344 apply (subst SUP_inf) |
|
345 apply (intro SUP_cong[OF refl]) |
|
346 apply (cut_tac A="ball x xa - {x}" and B="{x}" and M=f in INF_union) |
|
347 apply (drule sym) |
|
348 apply auto |
|
349 apply (metis INF_absorb centre_in_ball) |
|
350 done |
|
351 |
|
352 subsection \<open>monoset\<close> |
|
353 |
|
354 definition (in order) mono_set: |
|
355 "mono_set S \<longleftrightarrow> (\<forall>x y. x \<le> y \<longrightarrow> x \<in> S \<longrightarrow> y \<in> S)" |
|
356 |
|
357 lemma (in order) mono_greaterThan [intro, simp]: "mono_set {B<..}" unfolding mono_set by auto |
|
358 lemma (in order) mono_atLeast [intro, simp]: "mono_set {B..}" unfolding mono_set by auto |
|
359 lemma (in order) mono_UNIV [intro, simp]: "mono_set UNIV" unfolding mono_set by auto |
|
360 lemma (in order) mono_empty [intro, simp]: "mono_set {}" unfolding mono_set by auto |
|
361 |
|
362 lemma (in complete_linorder) mono_set_iff: |
|
363 fixes S :: "'a set" |
|
364 defines "a \<equiv> Inf S" |
|
365 shows "mono_set S \<longleftrightarrow> S = {a <..} \<or> S = {a..}" (is "_ = ?c") |
|
366 proof |
|
367 assume "mono_set S" |
|
368 then have mono: "\<And>x y. x \<le> y \<Longrightarrow> x \<in> S \<Longrightarrow> y \<in> S" |
|
369 by (auto simp: mono_set) |
|
370 show ?c |
|
371 proof cases |
|
372 assume "a \<in> S" |
|
373 show ?c |
|
374 using mono[OF _ \<open>a \<in> S\<close>] |
|
375 by (auto intro: Inf_lower simp: a_def) |
|
376 next |
|
377 assume "a \<notin> S" |
|
378 have "S = {a <..}" |
|
379 proof safe |
|
380 fix x assume "x \<in> S" |
|
381 then have "a \<le> x" |
|
382 unfolding a_def by (rule Inf_lower) |
|
383 then show "a < x" |
|
384 using \<open>x \<in> S\<close> \<open>a \<notin> S\<close> by (cases "a = x") auto |
|
385 next |
|
386 fix x assume "a < x" |
|
387 then obtain y where "y < x" "y \<in> S" |
|
388 unfolding a_def Inf_less_iff .. |
|
389 with mono[of y x] show "x \<in> S" |
|
390 by auto |
|
391 qed |
|
392 then show ?c .. |
|
393 qed |
|
394 qed auto |
|
395 |
|
396 lemma ereal_open_mono_set: |
|
397 fixes S :: "ereal set" |
|
398 shows "open S \<and> mono_set S \<longleftrightarrow> S = UNIV \<or> S = {Inf S <..}" |
|
399 by (metis Inf_UNIV atLeast_eq_UNIV_iff ereal_open_atLeast |
|
400 ereal_open_closed mono_set_iff open_ereal_greaterThan) |
|
401 |
|
402 lemma ereal_closed_mono_set: |
|
403 fixes S :: "ereal set" |
|
404 shows "closed S \<and> mono_set S \<longleftrightarrow> S = {} \<or> S = {Inf S ..}" |
|
405 by (metis Inf_UNIV atLeast_eq_UNIV_iff closed_ereal_atLeast |
|
406 ereal_open_closed mono_empty mono_set_iff open_ereal_greaterThan) |
|
407 |
|
408 lemma ereal_Liminf_Sup_monoset: |
|
409 fixes f :: "'a \<Rightarrow> ereal" |
|
410 shows "Liminf net f = |
|
411 Sup {l. \<forall>S. open S \<longrightarrow> mono_set S \<longrightarrow> l \<in> S \<longrightarrow> eventually (\<lambda>x. f x \<in> S) net}" |
|
412 (is "_ = Sup ?A") |
|
413 proof (safe intro!: Liminf_eqI complete_lattice_class.Sup_upper complete_lattice_class.Sup_least) |
|
414 fix P |
|
415 assume P: "eventually P net" |
|
416 fix S |
|
417 assume S: "mono_set S" "INFIMUM (Collect P) f \<in> S" |
|
418 { |
|
419 fix x |
|
420 assume "P x" |
|
421 then have "INFIMUM (Collect P) f \<le> f x" |
|
422 by (intro complete_lattice_class.INF_lower) simp |
|
423 with S have "f x \<in> S" |
|
424 by (simp add: mono_set) |
|
425 } |
|
426 with P show "eventually (\<lambda>x. f x \<in> S) net" |
|
427 by (auto elim: eventually_mono) |
|
428 next |
|
429 fix y l |
|
430 assume S: "\<forall>S. open S \<longrightarrow> mono_set S \<longrightarrow> l \<in> S \<longrightarrow> eventually (\<lambda>x. f x \<in> S) net" |
|
431 assume P: "\<forall>P. eventually P net \<longrightarrow> INFIMUM (Collect P) f \<le> y" |
|
432 show "l \<le> y" |
|
433 proof (rule dense_le) |
|
434 fix B |
|
435 assume "B < l" |
|
436 then have "eventually (\<lambda>x. f x \<in> {B <..}) net" |
|
437 by (intro S[rule_format]) auto |
|
438 then have "INFIMUM {x. B < f x} f \<le> y" |
|
439 using P by auto |
|
440 moreover have "B \<le> INFIMUM {x. B < f x} f" |
|
441 by (intro INF_greatest) auto |
|
442 ultimately show "B \<le> y" |
|
443 by simp |
|
444 qed |
|
445 qed |
|
446 |
|
447 lemma ereal_Limsup_Inf_monoset: |
|
448 fixes f :: "'a \<Rightarrow> ereal" |
|
449 shows "Limsup net f = |
|
450 Inf {l. \<forall>S. open S \<longrightarrow> mono_set (uminus ` S) \<longrightarrow> l \<in> S \<longrightarrow> eventually (\<lambda>x. f x \<in> S) net}" |
|
451 (is "_ = Inf ?A") |
|
452 proof (safe intro!: Limsup_eqI complete_lattice_class.Inf_lower complete_lattice_class.Inf_greatest) |
|
453 fix P |
|
454 assume P: "eventually P net" |
|
455 fix S |
|
456 assume S: "mono_set (uminus`S)" "SUPREMUM (Collect P) f \<in> S" |
|
457 { |
|
458 fix x |
|
459 assume "P x" |
|
460 then have "f x \<le> SUPREMUM (Collect P) f" |
|
461 by (intro complete_lattice_class.SUP_upper) simp |
|
462 with S(1)[unfolded mono_set, rule_format, of "- SUPREMUM (Collect P) f" "- f x"] S(2) |
|
463 have "f x \<in> S" |
|
464 by (simp add: inj_image_mem_iff) } |
|
465 with P show "eventually (\<lambda>x. f x \<in> S) net" |
|
466 by (auto elim: eventually_mono) |
|
467 next |
|
468 fix y l |
|
469 assume S: "\<forall>S. open S \<longrightarrow> mono_set (uminus ` S) \<longrightarrow> l \<in> S \<longrightarrow> eventually (\<lambda>x. f x \<in> S) net" |
|
470 assume P: "\<forall>P. eventually P net \<longrightarrow> y \<le> SUPREMUM (Collect P) f" |
|
471 show "y \<le> l" |
|
472 proof (rule dense_ge) |
|
473 fix B |
|
474 assume "l < B" |
|
475 then have "eventually (\<lambda>x. f x \<in> {..< B}) net" |
|
476 by (intro S[rule_format]) auto |
|
477 then have "y \<le> SUPREMUM {x. f x < B} f" |
|
478 using P by auto |
|
479 moreover have "SUPREMUM {x. f x < B} f \<le> B" |
|
480 by (intro SUP_least) auto |
|
481 ultimately show "y \<le> B" |
|
482 by simp |
|
483 qed |
|
484 qed |
|
485 |
|
486 lemma liminf_bounded_open: |
|
487 fixes x :: "nat \<Rightarrow> ereal" |
|
488 shows "x0 \<le> liminf x \<longleftrightarrow> (\<forall>S. open S \<longrightarrow> mono_set S \<longrightarrow> x0 \<in> S \<longrightarrow> (\<exists>N. \<forall>n\<ge>N. x n \<in> S))" |
|
489 (is "_ \<longleftrightarrow> ?P x0") |
|
490 proof |
|
491 assume "?P x0" |
|
492 then show "x0 \<le> liminf x" |
|
493 unfolding ereal_Liminf_Sup_monoset eventually_sequentially |
|
494 by (intro complete_lattice_class.Sup_upper) auto |
|
495 next |
|
496 assume "x0 \<le> liminf x" |
|
497 { |
|
498 fix S :: "ereal set" |
|
499 assume om: "open S" "mono_set S" "x0 \<in> S" |
|
500 { |
|
501 assume "S = UNIV" |
|
502 then have "\<exists>N. \<forall>n\<ge>N. x n \<in> S" |
|
503 by auto |
|
504 } |
|
505 moreover |
|
506 { |
|
507 assume "S \<noteq> UNIV" |
|
508 then obtain B where B: "S = {B<..}" |
|
509 using om ereal_open_mono_set by auto |
|
510 then have "B < x0" |
|
511 using om by auto |
|
512 then have "\<exists>N. \<forall>n\<ge>N. x n \<in> S" |
|
513 unfolding B |
|
514 using \<open>x0 \<le> liminf x\<close> liminf_bounded_iff |
|
515 by auto |
|
516 } |
|
517 ultimately have "\<exists>N. \<forall>n\<ge>N. x n \<in> S" |
|
518 by auto |
|
519 } |
|
520 then show "?P x0" |
|
521 by auto |
|
522 qed |
|
523 |
|
524 subsection "Relate extended reals and the indicator function" |
|
525 |
|
526 lemma ereal_indicator_le_0: "(indicator S x::ereal) \<le> 0 \<longleftrightarrow> x \<notin> S" |
|
527 by (auto split: split_indicator simp: one_ereal_def) |
|
528 |
|
529 lemma ereal_indicator: "ereal (indicator A x) = indicator A x" |
|
530 by (auto simp: indicator_def one_ereal_def) |
|
531 |
|
532 lemma ereal_mult_indicator: "ereal (x * indicator A y) = ereal x * indicator A y" |
|
533 by (simp split: split_indicator) |
|
534 |
|
535 lemma ereal_indicator_mult: "ereal (indicator A y * x) = indicator A y * ereal x" |
|
536 by (simp split: split_indicator) |
|
537 |
|
538 lemma ereal_indicator_nonneg[simp, intro]: "0 \<le> (indicator A x ::ereal)" |
|
539 unfolding indicator_def by auto |
|
540 |
|
541 lemma indicator_inter_arith_ereal: "indicator A x * indicator B x = (indicator (A \<inter> B) x :: ereal)" |
|
542 by (simp split: split_indicator) |
|
543 |
|
544 end |
|