src/HOL/Topological_Spaces.thy
changeset 68860 f443ec10447d
parent 68802 3974935e0252
child 68965 1254f3e57fed
equal deleted inserted replaced
68859:9207ada0ca31 68860:f443ec10447d
   509 lemma (in discrete_topology) nhds_discrete: "nhds x = principal {x}"
   509 lemma (in discrete_topology) nhds_discrete: "nhds x = principal {x}"
   510   by (simp add: nhds_discrete_open open_discrete)
   510   by (simp add: nhds_discrete_open open_discrete)
   511 
   511 
   512 lemma (in discrete_topology) at_discrete: "at x within S = bot"
   512 lemma (in discrete_topology) at_discrete: "at x within S = bot"
   513   unfolding at_within_def nhds_discrete by simp
   513   unfolding at_within_def nhds_discrete by simp
       
   514 
       
   515 lemma (in discrete_topology) tendsto_discrete:
       
   516   "filterlim (f :: 'b \<Rightarrow> 'a) (nhds y) F \<longleftrightarrow> eventually (\<lambda>x. f x = y) F"
       
   517   by (auto simp: nhds_discrete filterlim_principal)
   514 
   518 
   515 lemma (in topological_space) at_within_eq:
   519 lemma (in topological_space) at_within_eq:
   516   "at x within s = (INF S:{S. open S \<and> x \<in> S}. principal (S \<inter> s - {x}))"
   520   "at x within s = (INF S:{S. open S \<and> x \<in> S}. principal (S \<inter> s - {x}))"
   517   unfolding nhds_def at_within_def
   521   unfolding nhds_def at_within_def
   518   by (subst INF_inf_const2[symmetric]) (auto simp: Diff_Int_distrib)
   522   by (subst INF_inf_const2[symmetric]) (auto simp: Diff_Int_distrib)
   878 lemma (in t2_space) tendsto_const_iff:
   882 lemma (in t2_space) tendsto_const_iff:
   879   fixes a b :: 'a
   883   fixes a b :: 'a
   880   assumes "\<not> trivial_limit F"
   884   assumes "\<not> trivial_limit F"
   881   shows "((\<lambda>x. a) \<longlongrightarrow> b) F \<longleftrightarrow> a = b"
   885   shows "((\<lambda>x. a) \<longlongrightarrow> b) F \<longleftrightarrow> a = b"
   882   by (auto intro!: tendsto_unique [OF assms tendsto_const])
   886   by (auto intro!: tendsto_unique [OF assms tendsto_const])
       
   887 
       
   888 lemma Lim_in_closed_set:
       
   889   assumes "closed S" "eventually (\<lambda>x. f(x) \<in> S) F" "F \<noteq> bot" "(f \<longlongrightarrow> l) F"
       
   890   shows "l \<in> S"
       
   891 proof (rule ccontr)
       
   892   assume "l \<notin> S"
       
   893   with \<open>closed S\<close> have "open (- S)" "l \<in> - S"
       
   894     by (simp_all add: open_Compl)
       
   895   with assms(4) have "eventually (\<lambda>x. f x \<in> - S) F"
       
   896     by (rule topological_tendstoD)
       
   897   with assms(2) have "eventually (\<lambda>x. False) F"
       
   898     by (rule eventually_elim2) simp
       
   899   with assms(3) show "False"
       
   900     by (simp add: eventually_False)
       
   901 qed
       
   902 
       
   903 lemma (in t3_space) nhds_closed:
       
   904   assumes "x \<in> A" and "open A"
       
   905   shows   "\<exists>A'. x \<in> A' \<and> closed A' \<and> A' \<subseteq> A \<and> eventually (\<lambda>y. y \<in> A') (nhds x)"
       
   906 proof -
       
   907   from assms have "\<exists>U V. open U \<and> open V \<and> x \<in> U \<and> - A \<subseteq> V \<and> U \<inter> V = {}"
       
   908     by (intro t3_space) auto
       
   909   then obtain U V where UV: "open U" "open V" "x \<in> U" "-A \<subseteq> V" "U \<inter> V = {}"
       
   910     by auto
       
   911   have "eventually (\<lambda>y. y \<in> U) (nhds x)"
       
   912     using \<open>open U\<close> and \<open>x \<in> U\<close> by (intro eventually_nhds_in_open)
       
   913   hence "eventually (\<lambda>y. y \<in> -V) (nhds x)"
       
   914     by eventually_elim (use UV in auto)
       
   915   with UV show ?thesis by (intro exI[of _ "-V"]) auto
       
   916 qed
   883 
   917 
   884 lemma (in order_topology) increasing_tendsto:
   918 lemma (in order_topology) increasing_tendsto:
   885   assumes bdd: "eventually (\<lambda>n. f n \<le> l) F"
   919   assumes bdd: "eventually (\<lambda>n. f n \<le> l) F"
   886     and en: "\<And>x. x < l \<Longrightarrow> eventually (\<lambda>n. x < f n) F"
   920     and en: "\<And>x. x < l \<Longrightarrow> eventually (\<lambda>n. x < f n) F"
   887   shows "(f \<longlongrightarrow> l) F"
   921   shows "(f \<longlongrightarrow> l) F"
  2080     and continuous_on_Icc_at_leftD: "(f \<longlongrightarrow> f b) (at_left b)"
  2114     and continuous_on_Icc_at_leftD: "(f \<longlongrightarrow> f b) (at_left b)"
  2081   using assms
  2115   using assms
  2082   by (auto simp: at_within_Icc_at_right at_within_Icc_at_left continuous_on_def
  2116   by (auto simp: at_within_Icc_at_right at_within_Icc_at_left continuous_on_def
  2083       dest: bspec[where x=a] bspec[where x=b])
  2117       dest: bspec[where x=a] bspec[where x=b])
  2084 
  2118 
       
  2119 lemma continuous_on_discrete [simp, continuous_intros]:
       
  2120   "continuous_on A (f :: 'a :: discrete_topology \<Rightarrow> _)"
       
  2121   by (auto simp: continuous_on_def at_discrete)
  2085 
  2122 
  2086 subsubsection \<open>Continuity at a point\<close>
  2123 subsubsection \<open>Continuity at a point\<close>
  2087 
  2124 
  2088 definition continuous :: "'a::t2_space filter \<Rightarrow> ('a \<Rightarrow> 'b::topological_space) \<Rightarrow> bool"
  2125 definition continuous :: "'a::t2_space filter \<Rightarrow> ('a \<Rightarrow> 'b::topological_space) \<Rightarrow> bool"
  2089   where "continuous F f \<longleftrightarrow> (f \<longlongrightarrow> f (Lim F (\<lambda>x. x))) F"
  2126   where "continuous F f \<longleftrightarrow> (f \<longlongrightarrow> f (Lim F (\<lambda>x. x))) F"
  2122   unfolding continuous_def by (rule tendsto_const)
  2159   unfolding continuous_def by (rule tendsto_const)
  2123 
  2160 
  2124 lemma continuous_on_eq_continuous_within:
  2161 lemma continuous_on_eq_continuous_within:
  2125   "continuous_on s f \<longleftrightarrow> (\<forall>x\<in>s. continuous (at x within s) f)"
  2162   "continuous_on s f \<longleftrightarrow> (\<forall>x\<in>s. continuous (at x within s) f)"
  2126   unfolding continuous_on_def continuous_within ..
  2163   unfolding continuous_on_def continuous_within ..
       
  2164 
       
  2165 lemma continuous_discrete [simp, continuous_intros]:
       
  2166   "continuous (at x within A) (f :: 'a :: discrete_topology \<Rightarrow> _)"
       
  2167   by (auto simp: continuous_def at_discrete)
  2127 
  2168 
  2128 abbreviation isCont :: "('a::t2_space \<Rightarrow> 'b::topological_space) \<Rightarrow> 'a \<Rightarrow> bool"
  2169 abbreviation isCont :: "('a::t2_space \<Rightarrow> 'b::topological_space) \<Rightarrow> 'a \<Rightarrow> bool"
  2129   where "isCont f a \<equiv> continuous (at a) f"
  2170   where "isCont f a \<equiv> continuous (at a) f"
  2130 
  2171 
  2131 lemma isCont_def: "isCont f a \<longleftrightarrow> f \<midarrow>a\<rightarrow> f a"
  2172 lemma isCont_def: "isCont f a \<longleftrightarrow> f \<midarrow>a\<rightarrow> f a"