src/HOL/Limits.thy
changeset 41970 47d6e13d1710
parent 39302 d7728f65b353
child 44079 bcc60791b7b9
equal deleted inserted replaced
41969:1cf3e4107a2a 41970:47d6e13d1710
   100   assumes "eventually (\<lambda>i. P i) net"
   100   assumes "eventually (\<lambda>i. P i) net"
   101   assumes "eventually (\<lambda>i. Q i) net"
   101   assumes "eventually (\<lambda>i. Q i) net"
   102   assumes "\<And>i. P i \<Longrightarrow> Q i \<Longrightarrow> R i"
   102   assumes "\<And>i. P i \<Longrightarrow> Q i \<Longrightarrow> R i"
   103   shows "eventually (\<lambda>i. R i) net"
   103   shows "eventually (\<lambda>i. R i) net"
   104 using assms by (auto elim!: eventually_rev_mp)
   104 using assms by (auto elim!: eventually_rev_mp)
   105 
       
   106 
   105 
   107 subsection {* Finer-than relation *}
   106 subsection {* Finer-than relation *}
   108 
   107 
   109 text {* @{term "net \<le> net'"} means that @{term net} is finer than
   108 text {* @{term "net \<le> net'"} means that @{term net} is finer than
   110 @{term net'}. *}
   109 @{term net'}. *}
   229 
   228 
   230 lemma eventually_False:
   229 lemma eventually_False:
   231   "eventually (\<lambda>x. False) net \<longleftrightarrow> net = bot"
   230   "eventually (\<lambda>x. False) net \<longleftrightarrow> net = bot"
   232 unfolding expand_net_eq by (auto elim: eventually_rev_mp)
   231 unfolding expand_net_eq by (auto elim: eventually_rev_mp)
   233 
   232 
   234 
       
   235 subsection {* Map function for nets *}
   233 subsection {* Map function for nets *}
   236 
   234 
   237 definition netmap :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a net \<Rightarrow> 'b net" where
   235 definition netmap :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a net \<Rightarrow> 'b net" where
   238   "netmap f net = Abs_net (\<lambda>P. eventually (\<lambda>x. P (f x)) net)"
   236   "netmap f net = Abs_net (\<lambda>P. eventually (\<lambda>x. P (f x)) net)"
   239 
   237 
   284 lemma le_sequentially:
   282 lemma le_sequentially:
   285   "net \<le> sequentially \<longleftrightarrow> (\<forall>N. eventually (\<lambda>n. N \<le> n) net)"
   283   "net \<le> sequentially \<longleftrightarrow> (\<forall>N. eventually (\<lambda>n. N \<le> n) net)"
   286 unfolding le_net_def eventually_sequentially
   284 unfolding le_net_def eventually_sequentially
   287 by (safe, fast, drule_tac x=N in spec, auto elim: eventually_rev_mp)
   285 by (safe, fast, drule_tac x=N in spec, auto elim: eventually_rev_mp)
   288 
   286 
       
   287 
       
   288 definition
       
   289   trivial_limit :: "'a net \<Rightarrow> bool" where
       
   290   "trivial_limit net \<longleftrightarrow> eventually (\<lambda>x. False) net"
       
   291 
       
   292 lemma trivial_limit_sequentially[intro]: "\<not> trivial_limit sequentially"
       
   293   by (auto simp add: trivial_limit_def eventually_sequentially)
   289 
   294 
   290 subsection {* Standard Nets *}
   295 subsection {* Standard Nets *}
   291 
   296 
   292 definition within :: "'a net \<Rightarrow> 'a set \<Rightarrow> 'a net" (infixr "within" 70) where
   297 definition within :: "'a net \<Rightarrow> 'a set \<Rightarrow> 'a net" (infixr "within" 70) where
   293   "net within S = Abs_net (\<lambda>P. eventually (\<lambda>x. x \<in> S \<longrightarrow> P x) net)"
   298   "net within S = Abs_net (\<lambda>P. eventually (\<lambda>x. x \<in> S \<longrightarrow> P x) net)"
   825   fixes a b :: "'a::real_normed_field"
   830   fixes a b :: "'a::real_normed_field"
   826   shows "\<lbrakk>(f ---> a) net; (g ---> b) net; b \<noteq> 0\<rbrakk>
   831   shows "\<lbrakk>(f ---> a) net; (g ---> b) net; b \<noteq> 0\<rbrakk>
   827     \<Longrightarrow> ((\<lambda>x. f x / g x) ---> a / b) net"
   832     \<Longrightarrow> ((\<lambda>x. f x / g x) ---> a / b) net"
   828 by (simp add: mult.tendsto tendsto_inverse divide_inverse)
   833 by (simp add: mult.tendsto tendsto_inverse divide_inverse)
   829 
   834 
       
   835 lemma tendsto_unique:
       
   836   fixes f :: "'a \<Rightarrow> 'b::t2_space"
       
   837   assumes "\<not> trivial_limit net"  "(f ---> l) net"  "(f ---> l') net"
       
   838   shows "l = l'"
       
   839 proof (rule ccontr)
       
   840   assume "l \<noteq> l'"
       
   841   obtain U V where "open U" "open V" "l \<in> U" "l' \<in> V" "U \<inter> V = {}"
       
   842     using hausdorff [OF `l \<noteq> l'`] by fast
       
   843   have "eventually (\<lambda>x. f x \<in> U) net"
       
   844     using `(f ---> l) net` `open U` `l \<in> U` by (rule topological_tendstoD)
       
   845   moreover
       
   846   have "eventually (\<lambda>x. f x \<in> V) net"
       
   847     using `(f ---> l') net` `open V` `l' \<in> V` by (rule topological_tendstoD)
       
   848   ultimately
       
   849   have "eventually (\<lambda>x. False) net"
       
   850   proof (rule eventually_elim2)
       
   851     fix x
       
   852     assume "f x \<in> U" "f x \<in> V"
       
   853     hence "f x \<in> U \<inter> V" by simp
       
   854     with `U \<inter> V = {}` show "False" by simp
       
   855   qed
       
   856   with `\<not> trivial_limit net` show "False"
       
   857     by (simp add: trivial_limit_def)
       
   858 qed
       
   859 
   830 end
   860 end