src/HOL/Library/Liminf_Limsup.thy
changeset 61810 3c5040d5694a
parent 61806 d2e62ae01cd8
child 61880 ff4d33058566
equal deleted inserted replaced
61809:81d34cf268d8 61810:3c5040d5694a
    98 qed
    98 qed
    99 
    99 
   100 lemma Liminf_eq:
   100 lemma Liminf_eq:
   101   assumes "eventually (\<lambda>x. f x = g x) F"
   101   assumes "eventually (\<lambda>x. f x = g x) F"
   102   shows "Liminf F f = Liminf F g"
   102   shows "Liminf F f = Liminf F g"
   103   by (intro antisym Liminf_mono eventually_mono'[OF assms]) auto
   103   by (intro antisym Liminf_mono eventually_mono[OF assms]) auto
   104 
   104 
   105 lemma Limsup_mono:
   105 lemma Limsup_mono:
   106   assumes ev: "eventually (\<lambda>x. f x \<le> g x) F"
   106   assumes ev: "eventually (\<lambda>x. f x \<le> g x) F"
   107   shows "Limsup F f \<le> Limsup F g"
   107   shows "Limsup F f \<le> Limsup F g"
   108   unfolding Limsup_def
   108   unfolding Limsup_def
   114 qed
   114 qed
   115 
   115 
   116 lemma Limsup_eq:
   116 lemma Limsup_eq:
   117   assumes "eventually (\<lambda>x. f x = g x) net"
   117   assumes "eventually (\<lambda>x. f x = g x) net"
   118   shows "Limsup net f = Limsup net g"
   118   shows "Limsup net f = Limsup net g"
   119   by (intro antisym Limsup_mono eventually_mono'[OF assms]) auto
   119   by (intro antisym Limsup_mono eventually_mono[OF assms]) auto
   120 
   120 
   121 lemma Liminf_le_Limsup:
   121 lemma Liminf_le_Limsup:
   122   assumes ntriv: "\<not> trivial_limit F"
   122   assumes ntriv: "\<not> trivial_limit F"
   123   shows "Liminf F f \<le> Limsup F f"
   123   shows "Liminf F f \<le> Limsup F f"
   124   unfolding Limsup_def Liminf_def
   124   unfolding Limsup_def Liminf_def
   165   fixes X :: "_ \<Rightarrow> _ :: complete_linorder"
   165   fixes X :: "_ \<Rightarrow> _ :: complete_linorder"
   166   shows "C \<le> Liminf F X \<longleftrightarrow> (\<forall>y<C. eventually (\<lambda>x. y < X x) F)"
   166   shows "C \<le> Liminf F X \<longleftrightarrow> (\<forall>y<C. eventually (\<lambda>x. y < X x) F)"
   167 proof -
   167 proof -
   168   have "eventually (\<lambda>x. y < X x) F"
   168   have "eventually (\<lambda>x. y < X x) F"
   169     if "eventually P F" "y < INFIMUM (Collect P) X" for y P
   169     if "eventually P F" "y < INFIMUM (Collect P) X" for y P
   170     using that by (auto elim!: eventually_elim1 dest: less_INF_D)
   170     using that by (auto elim!: eventually_mono dest: less_INF_D)
   171   moreover
   171   moreover
   172   have "\<exists>P. eventually P F \<and> y < INFIMUM (Collect P) X"
   172   have "\<exists>P. eventually P F \<and> y < INFIMUM (Collect P) X"
   173     if "y < C" and y: "\<forall>y<C. eventually (\<lambda>x. y < X x) F" for y P
   173     if "y < C" and y: "\<forall>y<C. eventually (\<lambda>x. y < X x) F" for y P
   174   proof (cases "\<exists>z. y < z \<and> z < C")
   174   proof (cases "\<exists>z. y < z \<and> z < C")
   175     case True
   175     case True
   216     proof (rule classical)
   216     proof (rule classical)
   217       assume "\<not> f0 \<le> y"
   217       assume "\<not> f0 \<le> y"
   218       then have "eventually (\<lambda>x. y < f x) F"
   218       then have "eventually (\<lambda>x. y < f x) F"
   219         using lim[THEN topological_tendstoD, of "{y <..}"] by auto
   219         using lim[THEN topological_tendstoD, of "{y <..}"] by auto
   220       then have "eventually (\<lambda>x. f0 \<le> f x) F"
   220       then have "eventually (\<lambda>x. f0 \<le> f x) F"
   221         using discrete by (auto elim!: eventually_elim1)
   221         using discrete by (auto elim!: eventually_mono)
   222       then have "INFIMUM {x. f0 \<le> f x} f \<le> y"
   222       then have "INFIMUM {x. f0 \<le> f x} f \<le> y"
   223         by (rule upper)
   223         by (rule upper)
   224       moreover have "f0 \<le> INFIMUM {x. f0 \<le> f x} f"
   224       moreover have "f0 \<le> INFIMUM {x. f0 \<le> f x} f"
   225         by (intro INF_greatest) simp
   225         by (intro INF_greatest) simp
   226       ultimately show "f0 \<le> y" by simp
   226       ultimately show "f0 \<le> y" by simp
   255     proof (rule classical)
   255     proof (rule classical)
   256       assume "\<not> y \<le> f0"
   256       assume "\<not> y \<le> f0"
   257       then have "eventually (\<lambda>x. f x < y) F"
   257       then have "eventually (\<lambda>x. f x < y) F"
   258         using lim[THEN topological_tendstoD, of "{..< y}"] by auto
   258         using lim[THEN topological_tendstoD, of "{..< y}"] by auto
   259       then have "eventually (\<lambda>x. f x \<le> f0) F"
   259       then have "eventually (\<lambda>x. f x \<le> f0) F"
   260         using False by (auto elim!: eventually_elim1 simp: not_less)
   260         using False by (auto elim!: eventually_mono simp: not_less)
   261       then have "y \<le> SUPREMUM {x. f x \<le> f0} f"
   261       then have "y \<le> SUPREMUM {x. f x \<le> f0} f"
   262         by (rule lower)
   262         by (rule lower)
   263       moreover have "SUPREMUM {x. f x \<le> f0} f \<le> f0"
   263       moreover have "SUPREMUM {x. f x \<le> f0} f \<le> f0"
   264         by (intro SUP_least) simp
   264         by (intro SUP_least) simp
   265       ultimately show "y \<le> f0" by simp
   265       ultimately show "y \<le> f0" by simp
   276   fix a assume "f0 < a"
   276   fix a assume "f0 < a"
   277   with assms have "Limsup F f < a" by simp
   277   with assms have "Limsup F f < a" by simp
   278   then obtain P where "eventually P F" "SUPREMUM (Collect P) f < a"
   278   then obtain P where "eventually P F" "SUPREMUM (Collect P) f < a"
   279     unfolding Limsup_def INF_less_iff by auto
   279     unfolding Limsup_def INF_less_iff by auto
   280   then show "eventually (\<lambda>x. f x < a) F"
   280   then show "eventually (\<lambda>x. f x < a) F"
   281     by (auto elim!: eventually_elim1 dest: SUP_lessD)
   281     by (auto elim!: eventually_mono dest: SUP_lessD)
   282 next
   282 next
   283   fix a assume "a < f0"
   283   fix a assume "a < f0"
   284   with assms have "a < Liminf F f" by simp
   284   with assms have "a < Liminf F f" by simp
   285   then obtain P where "eventually P F" "a < INFIMUM (Collect P) f"
   285   then obtain P where "eventually P F" "a < INFIMUM (Collect P) f"
   286     unfolding Liminf_def less_SUP_iff by auto
   286     unfolding Liminf_def less_SUP_iff by auto
   287   then show "eventually (\<lambda>x. a < f x) F"
   287   then show "eventually (\<lambda>x. a < f x) F"
   288     by (auto elim!: eventually_elim1 dest: less_INF_D)
   288     by (auto elim!: eventually_mono dest: less_INF_D)
   289 qed
   289 qed
   290 
   290 
   291 lemma tendsto_iff_Liminf_eq_Limsup:
   291 lemma tendsto_iff_Liminf_eq_Limsup:
   292   fixes f0 :: "'a :: {complete_linorder,linorder_topology}"
   292   fixes f0 :: "'a :: {complete_linorder,linorder_topology}"
   293   shows "\<not> trivial_limit F \<Longrightarrow> (f ---> f0) F \<longleftrightarrow> (Liminf F f = f0 \<and> Limsup F f = f0)"
   293   shows "\<not> trivial_limit F \<Longrightarrow> (f ---> f0) F \<longleftrightarrow> (Liminf F f = f0 \<and> Limsup F f = f0)"