src/HOL/Topological_Spaces.thy
changeset 57275 0ddb5b755cdc
parent 57025 e7fd64f82876
child 57276 49c51eeaa623
equal deleted inserted replaced
57274:0acfdb151e52 57275:0ddb5b755cdc
   787 
   787 
   788 lemma at_neq_bot [simp]: "at (a::'a::perfect_space) \<noteq> bot"
   788 lemma at_neq_bot [simp]: "at (a::'a::perfect_space) \<noteq> bot"
   789   by (simp add: at_eq_bot_iff not_open_singleton)
   789   by (simp add: at_eq_bot_iff not_open_singleton)
   790 
   790 
   791 lemma eventually_at_right:
   791 lemma eventually_at_right:
   792   fixes x :: "'a :: {no_top, linorder_topology}"
   792   fixes x :: "'a :: linorder_topology"
       
   793   assumes gt_ex: "x < y"
   793   shows "eventually P (at_right x) \<longleftrightarrow> (\<exists>b. x < b \<and> (\<forall>z. x < z \<and> z < b \<longrightarrow> P z))"
   794   shows "eventually P (at_right x) \<longleftrightarrow> (\<exists>b. x < b \<and> (\<forall>z. x < z \<and> z < b \<longrightarrow> P z))"
   794   unfolding eventually_at_topological
   795   unfolding eventually_at_topological
   795 proof safe
   796 proof safe
   796   obtain y where "x < y" using gt_ex[of x] ..
   797   note gt_ex
   797   moreover fix S assume "open S" "x \<in> S" note open_right[OF this, of y]
   798   moreover fix S assume "open S" "x \<in> S" note open_right[OF this, of y]
   798   moreover note gt_ex[of x]
       
   799   moreover assume "\<forall>s\<in>S. s \<noteq> x \<longrightarrow> s \<in> {x<..} \<longrightarrow> P s"
   799   moreover assume "\<forall>s\<in>S. s \<noteq> x \<longrightarrow> s \<in> {x<..} \<longrightarrow> P s"
   800   ultimately show "\<exists>b>x. \<forall>z. x < z \<and> z < b \<longrightarrow> P z"
   800   ultimately show "\<exists>b>x. \<forall>z. x < z \<and> z < b \<longrightarrow> P z"
   801     by (auto simp: subset_eq Ball_def)
   801     by (auto simp: subset_eq Ball_def)
   802 next
   802 next
   803   fix b assume "x < b" "\<forall>z. x < z \<and> z < b \<longrightarrow> P z"
   803   fix b assume "x < b" "\<forall>z. x < z \<and> z < b \<longrightarrow> P z"
   804   then show "\<exists>S. open S \<and> x \<in> S \<and> (\<forall>xa\<in>S. xa \<noteq> x \<longrightarrow> xa \<in> {x<..} \<longrightarrow> P xa)"
   804   then show "\<exists>S. open S \<and> x \<in> S \<and> (\<forall>xa\<in>S. xa \<noteq> x \<longrightarrow> xa \<in> {x<..} \<longrightarrow> P xa)"
   805     by (intro exI[of _ "{..< b}"]) auto
   805     by (intro exI[of _ "{..< b}"]) auto
   806 qed
   806 qed
   807 
   807 
   808 lemma eventually_at_left:
   808 lemma eventually_at_left:
   809   fixes x :: "'a :: {no_bot, linorder_topology}"
   809   fixes x :: "'a :: linorder_topology"
       
   810   assumes lt_ex: "y < x"
   810   shows "eventually P (at_left x) \<longleftrightarrow> (\<exists>b. x > b \<and> (\<forall>z. b < z \<and> z < x \<longrightarrow> P z))"
   811   shows "eventually P (at_left x) \<longleftrightarrow> (\<exists>b. x > b \<and> (\<forall>z. b < z \<and> z < x \<longrightarrow> P z))"
   811   unfolding eventually_at_topological
   812   unfolding eventually_at_topological
   812 proof safe
   813 proof safe
   813   obtain y where "y < x" using lt_ex[of x] ..
   814   note lt_ex
   814   moreover fix S assume "open S" "x \<in> S" note open_left[OF this, of y]
   815   moreover fix S assume "open S" "x \<in> S" note open_left[OF this, of y]
   815   moreover assume "\<forall>s\<in>S. s \<noteq> x \<longrightarrow> s \<in> {..<x} \<longrightarrow> P s"
   816   moreover assume "\<forall>s\<in>S. s \<noteq> x \<longrightarrow> s \<in> {..<x} \<longrightarrow> P s"
   816   ultimately show "\<exists>b<x. \<forall>z. b < z \<and> z < x \<longrightarrow> P z"
   817   ultimately show "\<exists>b<x. \<forall>z. b < z \<and> z < x \<longrightarrow> P z"
   817     by (auto simp: subset_eq Ball_def)
   818     by (auto simp: subset_eq Ball_def)
   818 next
   819 next
   819   fix b assume "b < x" "\<forall>z. b < z \<and> z < x \<longrightarrow> P z"
   820   fix b assume "b < x" "\<forall>z. b < z \<and> z < x \<longrightarrow> P z"
   820   then show "\<exists>S. open S \<and> x \<in> S \<and> (\<forall>s\<in>S. s \<noteq> x \<longrightarrow> s \<in> {..<x} \<longrightarrow> P s)"
   821   then show "\<exists>S. open S \<and> x \<in> S \<and> (\<forall>s\<in>S. s \<noteq> x \<longrightarrow> s \<in> {..<x} \<longrightarrow> P s)"
   821     by (intro exI[of _ "{b <..}"]) auto
   822     by (intro exI[of _ "{b <..}"]) auto
   822 qed
   823 qed
   823 
   824 
       
   825 lemma trivial_limit_at_right_top: "at_right (top::_::{order_top, linorder_topology}) = bot"
       
   826   unfolding filter_eq_iff eventually_at_topological by auto
       
   827 
       
   828 lemma trivial_limit_at_left_bot: "at_left (bot::_::{order_bot, linorder_topology}) = bot"
       
   829   unfolding filter_eq_iff eventually_at_topological by auto
       
   830 
   824 lemma trivial_limit_at_left_real [simp]:
   831 lemma trivial_limit_at_left_real [simp]:
   825   "\<not> trivial_limit (at_left (x::'a::{no_bot, unbounded_dense_linorder, linorder_topology}))"
   832   "\<not> trivial_limit (at_left (x::'a::{no_bot, dense_order, linorder_topology}))"
   826   unfolding trivial_limit_def eventually_at_left by (auto dest: dense)
   833   using lt_ex[of x]
       
   834   by safe (auto simp add: trivial_limit_def eventually_at_left dest: dense)
   827 
   835 
   828 lemma trivial_limit_at_right_real [simp]:
   836 lemma trivial_limit_at_right_real [simp]:
   829   "\<not> trivial_limit (at_right (x::'a::{no_top, unbounded_dense_linorder, linorder_topology}))"
   837   "\<not> trivial_limit (at_right (x::'a::{no_top, dense_order, linorder_topology}))"
   830   unfolding trivial_limit_def eventually_at_right by (auto dest: dense)
   838   using gt_ex[of x]
       
   839   by safe (auto simp add: trivial_limit_def eventually_at_right dest: dense)
   831 
   840 
   832 lemma at_eq_sup_left_right: "at (x::'a::linorder_topology) = sup (at_left x) (at_right x)"
   841 lemma at_eq_sup_left_right: "at (x::'a::linorder_topology) = sup (at_left x) (at_right x)"
   833   by (auto simp: eventually_at_filter filter_eq_iff eventually_sup 
   842   by (auto simp: eventually_at_filter filter_eq_iff eventually_sup 
   834            elim: eventually_elim2 eventually_elim1)
   843            elim: eventually_elim2 eventually_elim1)
   835 
   844 
   864   by (simp add: filterlim_def filtermap_ident)
   873   by (simp add: filterlim_def filtermap_ident)
   865 
   874 
   866 lemma filterlim_cong:
   875 lemma filterlim_cong:
   867   "F1 = F1' \<Longrightarrow> F2 = F2' \<Longrightarrow> eventually (\<lambda>x. f x = g x) F2 \<Longrightarrow> filterlim f F1 F2 = filterlim g F1' F2'"
   876   "F1 = F1' \<Longrightarrow> F2 = F2' \<Longrightarrow> eventually (\<lambda>x. f x = g x) F2 \<Longrightarrow> filterlim f F1 F2 = filterlim g F1' F2'"
   868   by (auto simp: filterlim_def le_filter_def eventually_filtermap elim: eventually_elim2)
   877   by (auto simp: filterlim_def le_filter_def eventually_filtermap elim: eventually_elim2)
       
   878 
       
   879 lemma filterlim_mono_eventually:
       
   880   assumes "filterlim f F G" and ord: "F \<le> F'" "G' \<le> G"
       
   881   assumes eq: "eventually (\<lambda>x. f x = f' x) G'"
       
   882   shows "filterlim f' F' G'"
       
   883   apply (rule filterlim_cong[OF refl refl eq, THEN iffD1])
       
   884   apply (rule filterlim_mono[OF _ ord])
       
   885   apply fact
       
   886   done
   869 
   887 
   870 lemma filterlim_principal:
   888 lemma filterlim_principal:
   871   "(LIM x F. f x :> principal S) \<longleftrightarrow> (eventually (\<lambda>x. f x \<in> S) F)"
   889   "(LIM x F. f x :> principal S) \<longleftrightarrow> (eventually (\<lambda>x. f x \<in> S) F)"
   872   unfolding filterlim_def eventually_filtermap le_principal ..
   890   unfolding filterlim_def eventually_filtermap le_principal ..
   873 
   891 
  1177   fixes f :: "'a \<Rightarrow> ('b::unbounded_dense_linorder)" and c :: "'b"
  1195   fixes f :: "'a \<Rightarrow> ('b::unbounded_dense_linorder)" and c :: "'b"
  1178   shows "(LIM x F. f x :> at_bot) \<longleftrightarrow> (\<forall>Z<c. eventually (\<lambda>x. Z \<ge> f x) F)"
  1196   shows "(LIM x F. f x :> at_bot) \<longleftrightarrow> (\<forall>Z<c. eventually (\<lambda>x. Z \<ge> f x) F)"
  1179   by (metis filterlim_at_bot filterlim_at_bot_le lt_ex order_le_less_trans)
  1197   by (metis filterlim_at_bot filterlim_at_bot_le lt_ex order_le_less_trans)
  1180 
  1198 
  1181 lemma filterlim_at_bot_at_right:
  1199 lemma filterlim_at_bot_at_right:
  1182   fixes f :: "'a::{no_top, linorder_topology} \<Rightarrow> 'b::linorder"
  1200   fixes f :: "'a::linorder_topology \<Rightarrow> 'b::linorder"
  1183   assumes mono: "\<And>x y. Q x \<Longrightarrow> Q y \<Longrightarrow> x \<le> y \<Longrightarrow> f x \<le> f y"
  1201   assumes mono: "\<And>x y. Q x \<Longrightarrow> Q y \<Longrightarrow> x \<le> y \<Longrightarrow> f x \<le> f y"
  1184   assumes bij: "\<And>x. P x \<Longrightarrow> f (g x) = x" "\<And>x. P x \<Longrightarrow> Q (g x)"
  1202   assumes bij: "\<And>x. P x \<Longrightarrow> f (g x) = x" "\<And>x. P x \<Longrightarrow> Q (g x)"
  1185   assumes Q: "eventually Q (at_right a)" and bound: "\<And>b. Q b \<Longrightarrow> a < b"
  1203   assumes Q: "eventually Q (at_right a)" and bound: "\<And>b. Q b \<Longrightarrow> a < b"
  1186   assumes P: "eventually P at_bot"
  1204   assumes P: "eventually P at_bot"
  1187   shows "filterlim f at_bot (at_right a)"
  1205   shows "filterlim f at_bot (at_right a)"
  1192   proof (intro filterlim_at_bot_le[THEN iffD2] allI impI)
  1210   proof (intro filterlim_at_bot_le[THEN iffD2] allI impI)
  1193     fix z assume "z \<le> x"
  1211     fix z assume "z \<le> x"
  1194     with x have "P z" by auto
  1212     with x have "P z" by auto
  1195     have "eventually (\<lambda>x. x \<le> g z) (at_right a)"
  1213     have "eventually (\<lambda>x. x \<le> g z) (at_right a)"
  1196       using bound[OF bij(2)[OF `P z`]]
  1214       using bound[OF bij(2)[OF `P z`]]
  1197       unfolding eventually_at_right by (auto intro!: exI[of _ "g z"])
  1215       unfolding eventually_at_right[OF bound[OF bij(2)[OF `P z`]]] by (auto intro!: exI[of _ "g z"])
  1198     with Q show "eventually (\<lambda>x. f x \<le> z) (at_right a)"
  1216     with Q show "eventually (\<lambda>x. f x \<le> z) (at_right a)"
  1199       by eventually_elim (metis bij `P z` mono)
  1217       by eventually_elim (metis bij `P z` mono)
  1200   qed
  1218   qed
  1201 qed
  1219 qed
  1202 
  1220 
  1203 lemma filterlim_at_top_at_left:
  1221 lemma filterlim_at_top_at_left:
  1204   fixes f :: "'a::{no_bot, linorder_topology} \<Rightarrow> 'b::linorder"
  1222   fixes f :: "'a::linorder_topology \<Rightarrow> 'b::linorder"
  1205   assumes mono: "\<And>x y. Q x \<Longrightarrow> Q y \<Longrightarrow> x \<le> y \<Longrightarrow> f x \<le> f y"
  1223   assumes mono: "\<And>x y. Q x \<Longrightarrow> Q y \<Longrightarrow> x \<le> y \<Longrightarrow> f x \<le> f y"
  1206   assumes bij: "\<And>x. P x \<Longrightarrow> f (g x) = x" "\<And>x. P x \<Longrightarrow> Q (g x)"
  1224   assumes bij: "\<And>x. P x \<Longrightarrow> f (g x) = x" "\<And>x. P x \<Longrightarrow> Q (g x)"
  1207   assumes Q: "eventually Q (at_left a)" and bound: "\<And>b. Q b \<Longrightarrow> b < a"
  1225   assumes Q: "eventually Q (at_left a)" and bound: "\<And>b. Q b \<Longrightarrow> b < a"
  1208   assumes P: "eventually P at_top"
  1226   assumes P: "eventually P at_top"
  1209   shows "filterlim f at_top (at_left a)"
  1227   shows "filterlim f at_top (at_left a)"
  1214   proof (intro filterlim_at_top_ge[THEN iffD2] allI impI)
  1232   proof (intro filterlim_at_top_ge[THEN iffD2] allI impI)
  1215     fix z assume "x \<le> z"
  1233     fix z assume "x \<le> z"
  1216     with x have "P z" by auto
  1234     with x have "P z" by auto
  1217     have "eventually (\<lambda>x. g z \<le> x) (at_left a)"
  1235     have "eventually (\<lambda>x. g z \<le> x) (at_left a)"
  1218       using bound[OF bij(2)[OF `P z`]]
  1236       using bound[OF bij(2)[OF `P z`]]
  1219       unfolding eventually_at_left by (auto intro!: exI[of _ "g z"])
  1237       unfolding eventually_at_left[OF bound[OF bij(2)[OF `P z`]]] by (auto intro!: exI[of _ "g z"])
  1220     with Q show "eventually (\<lambda>x. z \<le> f x) (at_left a)"
  1238     with Q show "eventually (\<lambda>x. z \<le> f x) (at_left a)"
  1221       by eventually_elim (metis bij `P z` mono)
  1239       by eventually_elim (metis bij `P z` mono)
  1222   qed
  1240   qed
  1223 qed
  1241 qed
  1224 
  1242