100 hence "ereal y <= Inf S" by (metis Compl_anti_mono Compl_lessThan atLeast_iff |
100 hence "ereal y <= Inf S" by (metis Compl_anti_mono Compl_lessThan atLeast_iff |
101 complete_lattice_class.Inf_greatest double_complement set_rev_mp) |
101 complete_lattice_class.Inf_greatest double_complement set_rev_mp) |
102 then show False using MInf by auto |
102 then show False using MInf by auto |
103 next |
103 next |
104 case PInf then have "S={\<infinity>}" by (metis Inf_eq_PInfty assms(2)) |
104 case PInf then have "S={\<infinity>}" by (metis Inf_eq_PInfty assms(2)) |
105 then show False by (metis `Inf S ~: S` insert_code mem_def PInf) |
105 then show False using `Inf S ~: S` by simp |
106 next |
106 next |
107 case (real r) then have fin: "\<bar>Inf S\<bar> \<noteq> \<infinity>" by simp |
107 case (real r) then have fin: "\<bar>Inf S\<bar> \<noteq> \<infinity>" by simp |
108 from ereal_open_cont_interval[OF a this] guess e . note e = this |
108 from ereal_open_cont_interval[OF a this] guess e . note e = this |
109 { fix x assume "x:S" hence "x>=Inf S" by (rule complete_lattice_class.Inf_lower) |
109 { fix x assume "x:S" hence "x>=Inf S" by (rule complete_lattice_class.Inf_lower) |
110 hence *: "x>Inf S-e" using e by (metis fin ereal_between(1) order_less_le_trans) |
110 hence *: "x>Inf S-e" using e by (metis fin ereal_between(1) order_less_le_trans) |
282 qed |
282 qed |
283 |
283 |
284 lemma ereal_open_mono_set: |
284 lemma ereal_open_mono_set: |
285 fixes S :: "ereal set" |
285 fixes S :: "ereal set" |
286 defines "a \<equiv> Inf S" |
286 defines "a \<equiv> Inf S" |
287 shows "(open S \<and> mono S) \<longleftrightarrow> (S = UNIV \<or> S = {a <..})" |
287 shows "(open S \<and> mono_set S) \<longleftrightarrow> (S = UNIV \<or> S = {a <..})" |
288 by (metis Inf_UNIV a_def atLeast_eq_UNIV_iff ereal_open_atLeast |
288 by (metis Inf_UNIV a_def atLeast_eq_UNIV_iff ereal_open_atLeast |
289 ereal_open_closed mono_set_iff open_ereal_greaterThan) |
289 ereal_open_closed mono_set_iff open_ereal_greaterThan) |
290 |
290 |
291 lemma ereal_closed_mono_set: |
291 lemma ereal_closed_mono_set: |
292 fixes S :: "ereal set" |
292 fixes S :: "ereal set" |
293 shows "(closed S \<and> mono S) \<longleftrightarrow> (S = {} \<or> S = {Inf S ..})" |
293 shows "(closed S \<and> mono_set S) \<longleftrightarrow> (S = {} \<or> S = {Inf S ..})" |
294 by (metis Inf_UNIV atLeast_eq_UNIV_iff closed_ereal_atLeast |
294 by (metis Inf_UNIV atLeast_eq_UNIV_iff closed_ereal_atLeast |
295 ereal_open_closed mono_empty mono_set_iff open_ereal_greaterThan) |
295 ereal_open_closed mono_empty mono_set_iff open_ereal_greaterThan) |
296 |
296 |
297 lemma ereal_Liminf_Sup_monoset: |
297 lemma ereal_Liminf_Sup_monoset: |
298 fixes f :: "'a => ereal" |
298 fixes f :: "'a => ereal" |
299 shows "Liminf net f = Sup {l. \<forall>S. open S \<longrightarrow> mono S \<longrightarrow> l \<in> S \<longrightarrow> eventually (\<lambda>x. f x \<in> S) net}" |
299 shows "Liminf net f = Sup {l. \<forall>S. open S \<longrightarrow> mono_set S \<longrightarrow> l \<in> S \<longrightarrow> eventually (\<lambda>x. f x \<in> S) net}" |
300 unfolding Liminf_Sup |
300 unfolding Liminf_Sup |
301 proof (intro arg_cong[where f="\<lambda>P. Sup (Collect P)"] ext iffI allI impI) |
301 proof (intro arg_cong[where f="\<lambda>P. Sup (Collect P)"] ext iffI allI impI) |
302 fix l S assume ev: "\<forall>y<l. eventually (\<lambda>x. y < f x) net" and "open S" "mono S" "l \<in> S" |
302 fix l S assume ev: "\<forall>y<l. eventually (\<lambda>x. y < f x) net" and "open S" "mono_set S" "l \<in> S" |
303 then have "S = UNIV \<or> S = {Inf S <..}" |
303 then have "S = UNIV \<or> S = {Inf S <..}" |
304 using ereal_open_mono_set[of S] by auto |
304 using ereal_open_mono_set[of S] by auto |
305 then show "eventually (\<lambda>x. f x \<in> S) net" |
305 then show "eventually (\<lambda>x. f x \<in> S) net" |
306 proof |
306 proof |
307 assume S: "S = {Inf S<..}" |
307 assume S: "S = {Inf S<..}" |
308 then have "Inf S < l" using `l \<in> S` by auto |
308 then have "Inf S < l" using `l \<in> S` by auto |
309 then have "eventually (\<lambda>x. Inf S < f x) net" using ev by auto |
309 then have "eventually (\<lambda>x. Inf S < f x) net" using ev by auto |
310 then show "eventually (\<lambda>x. f x \<in> S) net" by (subst S) auto |
310 then show "eventually (\<lambda>x. f x \<in> S) net" by (subst S) auto |
311 qed auto |
311 qed auto |
312 next |
312 next |
313 fix l y assume S: "\<forall>S. open S \<longrightarrow> mono S \<longrightarrow> l \<in> S \<longrightarrow> eventually (\<lambda>x. f x \<in> S) net" "y < l" |
313 fix l y assume S: "\<forall>S. open S \<longrightarrow> mono_set S \<longrightarrow> l \<in> S \<longrightarrow> eventually (\<lambda>x. f x \<in> S) net" "y < l" |
314 have "eventually (\<lambda>x. f x \<in> {y <..}) net" |
314 have "eventually (\<lambda>x. f x \<in> {y <..}) net" |
315 using `y < l` by (intro S[rule_format]) auto |
315 using `y < l` by (intro S[rule_format]) auto |
316 then show "eventually (\<lambda>x. y < f x) net" by auto |
316 then show "eventually (\<lambda>x. y < f x) net" by auto |
317 qed |
317 qed |
318 |
318 |
319 lemma ereal_Limsup_Inf_monoset: |
319 lemma ereal_Limsup_Inf_monoset: |
320 fixes f :: "'a => ereal" |
320 fixes f :: "'a => ereal" |
321 shows "Limsup net f = Inf {l. \<forall>S. open S \<longrightarrow> mono (uminus ` S) \<longrightarrow> l \<in> S \<longrightarrow> eventually (\<lambda>x. f x \<in> S) net}" |
321 shows "Limsup net f = Inf {l. \<forall>S. open S \<longrightarrow> mono_set (uminus ` S) \<longrightarrow> l \<in> S \<longrightarrow> eventually (\<lambda>x. f x \<in> S) net}" |
322 unfolding Limsup_Inf |
322 unfolding Limsup_Inf |
323 proof (intro arg_cong[where f="\<lambda>P. Inf (Collect P)"] ext iffI allI impI) |
323 proof (intro arg_cong[where f="\<lambda>P. Inf (Collect P)"] ext iffI allI impI) |
324 fix l S assume ev: "\<forall>y>l. eventually (\<lambda>x. f x < y) net" and "open S" "mono (uminus`S)" "l \<in> S" |
324 fix l S assume ev: "\<forall>y>l. eventually (\<lambda>x. f x < y) net" and "open S" "mono_set (uminus`S)" "l \<in> S" |
325 then have "open (uminus`S) \<and> mono (uminus`S)" by (simp add: ereal_open_uminus) |
325 then have "open (uminus`S) \<and> mono_set (uminus`S)" by (simp add: ereal_open_uminus) |
326 then have "S = UNIV \<or> S = {..< Sup S}" |
326 then have "S = UNIV \<or> S = {..< Sup S}" |
327 unfolding ereal_open_mono_set ereal_Inf_uminus_image_eq ereal_image_uminus_shift by simp |
327 unfolding ereal_open_mono_set ereal_Inf_uminus_image_eq ereal_image_uminus_shift by simp |
328 then show "eventually (\<lambda>x. f x \<in> S) net" |
328 then show "eventually (\<lambda>x. f x \<in> S) net" |
329 proof |
329 proof |
330 assume S: "S = {..< Sup S}" |
330 assume S: "S = {..< Sup S}" |
331 then have "l < Sup S" using `l \<in> S` by auto |
331 then have "l < Sup S" using `l \<in> S` by auto |
332 then have "eventually (\<lambda>x. f x < Sup S) net" using ev by auto |
332 then have "eventually (\<lambda>x. f x < Sup S) net" using ev by auto |
333 then show "eventually (\<lambda>x. f x \<in> S) net" by (subst S) auto |
333 then show "eventually (\<lambda>x. f x \<in> S) net" by (subst S) auto |
334 qed auto |
334 qed auto |
335 next |
335 next |
336 fix l y assume S: "\<forall>S. open S \<longrightarrow> mono (uminus`S) \<longrightarrow> l \<in> S \<longrightarrow> eventually (\<lambda>x. f x \<in> S) net" "l < y" |
336 fix l y assume S: "\<forall>S. open S \<longrightarrow> mono_set (uminus`S) \<longrightarrow> l \<in> S \<longrightarrow> eventually (\<lambda>x. f x \<in> S) net" "l < y" |
337 have "eventually (\<lambda>x. f x \<in> {..< y}) net" |
337 have "eventually (\<lambda>x. f x \<in> {..< y}) net" |
338 using `l < y` by (intro S[rule_format]) auto |
338 using `l < y` by (intro S[rule_format]) auto |
339 then show "eventually (\<lambda>x. f x < y) net" by auto |
339 then show "eventually (\<lambda>x. f x < y) net" by auto |
340 qed |
340 qed |
341 |
341 |
467 using dec |
467 using dec |
468 by (intro ereal_lim_mono[of N, OF _ lim tendsto_const]) (simp add: decseq_def) |
468 by (intro ereal_lim_mono[of N, OF _ lim tendsto_const]) (simp add: decseq_def) |
469 |
469 |
470 lemma liminf_bounded_open: |
470 lemma liminf_bounded_open: |
471 fixes x :: "nat \<Rightarrow> ereal" |
471 fixes x :: "nat \<Rightarrow> ereal" |
472 shows "x0 \<le> liminf x \<longleftrightarrow> (\<forall>S. open S \<longrightarrow> mono S \<longrightarrow> x0 \<in> S \<longrightarrow> (\<exists>N. \<forall>n\<ge>N. x n \<in> S))" |
472 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))" |
473 (is "_ \<longleftrightarrow> ?P x0") |
473 (is "_ \<longleftrightarrow> ?P x0") |
474 proof |
474 proof |
475 assume "?P x0" then show "x0 \<le> liminf x" |
475 assume "?P x0" then show "x0 \<le> liminf x" |
476 unfolding ereal_Liminf_Sup_monoset eventually_sequentially |
476 unfolding ereal_Liminf_Sup_monoset eventually_sequentially |
477 by (intro complete_lattice_class.Sup_upper) auto |
477 by (intro complete_lattice_class.Sup_upper) auto |
478 next |
478 next |
479 assume "x0 \<le> liminf x" |
479 assume "x0 \<le> liminf x" |
480 { fix S :: "ereal set" assume om: "open S & mono S & x0:S" |
480 { fix S :: "ereal set" assume om: "open S & mono_set S & x0:S" |
481 { assume "S = UNIV" hence "EX N. (ALL n>=N. x n : S)" by auto } |
481 { assume "S = UNIV" hence "EX N. (ALL n>=N. x n : S)" by auto } |
482 moreover |
482 moreover |
483 { assume "~(S=UNIV)" |
483 { assume "~(S=UNIV)" |
484 then obtain B where B_def: "S = {B<..}" using om ereal_open_mono_set by auto |
484 then obtain B where B_def: "S = {B<..}" using om ereal_open_mono_set by auto |
485 hence "B<x0" using om by auto |
485 hence "B<x0" using om by auto |