src/HOL/Analysis/Uniform_Limit.thy
changeset 65204 d23eded35a33
parent 65037 2cf841ff23be
child 66827 c94531b5007d
equal deleted inserted replaced
65203:314246c6eeaa 65204:d23eded35a33
   201   unfolding uniformly_convergent_on_def by blast
   201   unfolding uniformly_convergent_on_def by blast
   202 
   202 
   203 lemma uniformly_convergent_on_empty [iff]: "uniformly_convergent_on {} f"
   203 lemma uniformly_convergent_on_empty [iff]: "uniformly_convergent_on {} f"
   204   by (simp add: uniformly_convergent_on_def uniform_limit_sequentially_iff)
   204   by (simp add: uniformly_convergent_on_def uniform_limit_sequentially_iff)
   205 
   205 
       
   206 text\<open>Cauchy-type criteria for uniform convergence.\<close>
       
   207 
   206 lemma Cauchy_uniformly_convergent:
   208 lemma Cauchy_uniformly_convergent:
   207   fixes f :: "nat \<Rightarrow> 'a \<Rightarrow> 'b :: complete_space"
   209   fixes f :: "nat \<Rightarrow> 'a \<Rightarrow> 'b :: complete_space"
   208   assumes "uniformly_Cauchy_on X f"
   210   assumes "uniformly_Cauchy_on X f"
   209   shows   "uniformly_convergent_on X f"
   211   shows   "uniformly_convergent_on X f"
   210 unfolding uniformly_convergent_uniform_limit_iff uniform_limit_iff
   212 unfolding uniformly_convergent_uniform_limit_iff uniform_limit_iff
   233       finally show "dist (f n x) (?f x) < e" by simp
   235       finally show "dist (f n x) (?f x) < e" by simp
   234     qed
   236     qed
   235   qed
   237   qed
   236 qed
   238 qed
   237 
   239 
       
   240 lemma uniformly_convergent_Cauchy:
       
   241   assumes "uniformly_convergent_on X f"
       
   242   shows "uniformly_Cauchy_on X f"
       
   243 proof (rule uniformly_Cauchy_onI)
       
   244   fix e::real assume "e > 0"
       
   245   then have "0 < e / 2" by simp
       
   246   with assms[unfolded uniformly_convergent_on_def uniform_limit_sequentially_iff]
       
   247   obtain l N where l:"x \<in> X \<Longrightarrow> n \<ge> N \<Longrightarrow> dist (f n x) (l x) < e / 2" for n x
       
   248     by metis
       
   249   from l l have "x \<in> X \<Longrightarrow> n \<ge> N \<Longrightarrow> m \<ge> N \<Longrightarrow> dist (f n x) (f m x) < e" for n m x
       
   250     by (rule dist_triangle_half_l)
       
   251   then show "\<exists>M. \<forall>x\<in>X. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (f m x) (f n x) < e" by blast
       
   252 qed
       
   253 
       
   254 lemma uniformly_convergent_eq_Cauchy:
       
   255   "uniformly_convergent_on X f = uniformly_Cauchy_on X f" for f::"nat \<Rightarrow> 'b \<Rightarrow> 'a::complete_space"
       
   256   using Cauchy_uniformly_convergent uniformly_convergent_Cauchy by blast
       
   257 
       
   258 lemma uniformly_convergent_eq_cauchy:
       
   259   fixes s::"nat \<Rightarrow> 'b \<Rightarrow> 'a::complete_space"
       
   260   shows
       
   261     "(\<exists>l. \<forall>e>0. \<exists>N. \<forall>n x. N \<le> n \<and> P x \<longrightarrow> dist(s n x)(l x) < e) \<longleftrightarrow>
       
   262       (\<forall>e>0. \<exists>N. \<forall>m n x. N \<le> m \<and> N \<le> n \<and> P x  \<longrightarrow> dist (s m x) (s n x) < e)"
       
   263 proof -
       
   264   have *: "(\<forall>n\<ge>N. \<forall>x. Q x \<longrightarrow> R n x) \<longleftrightarrow> (\<forall>n x. N \<le> n \<and> Q x \<longrightarrow> R n x)"
       
   265     "(\<forall>x. Q x \<longrightarrow> (\<forall>m\<ge>N. \<forall>n\<ge>N. S n m x)) \<longleftrightarrow> (\<forall>m n x. N \<le> m \<and> N \<le> n \<and> Q x \<longrightarrow> S n m x)"
       
   266     for N::nat and Q::"'b \<Rightarrow> bool" and R S
       
   267     by blast+
       
   268   show ?thesis
       
   269     using uniformly_convergent_eq_Cauchy[of "Collect P" s]
       
   270     unfolding uniformly_convergent_on_def uniformly_Cauchy_on_def uniform_limit_sequentially_iff
       
   271     by (simp add: *)
       
   272 qed
       
   273 
       
   274 lemma uniformly_cauchy_imp_uniformly_convergent:
       
   275   fixes s :: "nat \<Rightarrow> 'a \<Rightarrow> 'b::complete_space"
       
   276   assumes "\<forall>e>0.\<exists>N. \<forall>m (n::nat) x. N \<le> m \<and> N \<le> n \<and> P x --> dist(s m x)(s n x) < e"
       
   277     and "\<forall>x. P x --> (\<forall>e>0. \<exists>N. \<forall>n. N \<le> n \<longrightarrow> dist(s n x)(l x) < e)"
       
   278   shows "\<forall>e>0. \<exists>N. \<forall>n x. N \<le> n \<and> P x \<longrightarrow> dist(s n x)(l x) < e"
       
   279 proof -
       
   280   obtain l' where l:"\<forall>e>0. \<exists>N. \<forall>n x. N \<le> n \<and> P x \<longrightarrow> dist (s n x) (l' x) < e"
       
   281     using assms(1) unfolding uniformly_convergent_eq_cauchy[symmetric] by auto
       
   282   moreover
       
   283   {
       
   284     fix x
       
   285     assume "P x"
       
   286     then have "l x = l' x"
       
   287       using tendsto_unique[OF trivial_limit_sequentially, of "\<lambda>n. s n x" "l x" "l' x"]
       
   288       using l and assms(2) unfolding lim_sequentially by blast
       
   289   }
       
   290   ultimately show ?thesis by auto
       
   291 qed
       
   292 
       
   293 text \<open>TODO: remove explicit formulations
       
   294   @{thm uniformly_convergent_eq_cauchy uniformly_cauchy_imp_uniformly_convergent}?!\<close>
       
   295 
   238 lemma uniformly_convergent_imp_convergent:
   296 lemma uniformly_convergent_imp_convergent:
   239   "uniformly_convergent_on X f \<Longrightarrow> x \<in> X \<Longrightarrow> convergent (\<lambda>n. f n x)"
   297   "uniformly_convergent_on X f \<Longrightarrow> x \<in> X \<Longrightarrow> convergent (\<lambda>n. f n x)"
   240   unfolding uniformly_convergent_on_def convergent_def
   298   unfolding uniformly_convergent_on_def convergent_def
   241   by (auto dest: tendsto_uniform_limitI)
   299   by (auto dest: tendsto_uniform_limitI)
   242 
   300 
   361   bounded_linear.uniform_limit[OF bounded_linear_scaleR_left]
   419   bounded_linear.uniform_limit[OF bounded_linear_scaleR_left]
   362 
   420 
   363 lemmas uniform_limit_uminus[uniform_limit_intros] =
   421 lemmas uniform_limit_uminus[uniform_limit_intros] =
   364   bounded_linear.uniform_limit[OF bounded_linear_minus[OF bounded_linear_ident]]
   422   bounded_linear.uniform_limit[OF bounded_linear_minus[OF bounded_linear_ident]]
   365 
   423 
   366 lemma uniform_limit_const[uniform_limit_intros]: "uniform_limit S (\<lambda>x y. c) (\<lambda>x. c) f"
   424 lemma uniform_limit_const[uniform_limit_intros]: "uniform_limit S (\<lambda>x. c) c f"
   367   by (auto intro!: uniform_limitI)
   425   by (auto intro!: uniform_limitI)
   368 
   426 
   369 lemma uniform_limit_add[uniform_limit_intros]:
   427 lemma uniform_limit_add[uniform_limit_intros]:
   370   fixes f g::"'a \<Rightarrow> 'b \<Rightarrow> 'c::real_normed_vector"
   428   fixes f g::"'a \<Rightarrow> 'b \<Rightarrow> 'c::real_normed_vector"
   371   assumes "uniform_limit X f l F"
   429   assumes "uniform_limit X f l F"
   572 
   630 
   573 lemma uniform_limit_on_subset:
   631 lemma uniform_limit_on_subset:
   574   "uniform_limit J f g F \<Longrightarrow> I \<subseteq> J \<Longrightarrow> uniform_limit I f g F"
   632   "uniform_limit J f g F \<Longrightarrow> I \<subseteq> J \<Longrightarrow> uniform_limit I f g F"
   575   by (auto intro!: uniform_limitI dest!: uniform_limitD intro: eventually_mono)
   633   by (auto intro!: uniform_limitI dest!: uniform_limitD intro: eventually_mono)
   576 
   634 
       
   635 lemma uniform_limit_bounded:
       
   636   fixes f::"'i \<Rightarrow> 'a::topological_space \<Rightarrow> 'b::metric_space"
       
   637   assumes l: "uniform_limit S f l F"
       
   638   assumes bnd: "\<forall>\<^sub>F i in F. bounded (f i ` S)"
       
   639   assumes "F \<noteq> bot"
       
   640   shows "bounded (l ` S)"
       
   641 proof -
       
   642   from l have "\<forall>\<^sub>F n in F. \<forall>x\<in>S. dist (l x) (f n x) < 1"
       
   643     by (auto simp: uniform_limit_iff dist_commute dest!: spec[where x=1])
       
   644   with bnd
       
   645   have "\<forall>\<^sub>F n in F. \<exists>M. \<forall>x\<in>S. dist undefined (l x) \<le> M + 1"
       
   646     by eventually_elim
       
   647       (auto intro!: order_trans[OF dist_triangle2 add_mono] intro: less_imp_le
       
   648         simp: bounded_any_center[where a=undefined])
       
   649   then show ?thesis using assms
       
   650     by (auto simp: bounded_any_center[where a=undefined] dest!: eventually_happens)
       
   651 qed
       
   652 
   577 lemma uniformly_convergent_add:
   653 lemma uniformly_convergent_add:
   578   "uniformly_convergent_on A f \<Longrightarrow> uniformly_convergent_on A g\<Longrightarrow>
   654   "uniformly_convergent_on A f \<Longrightarrow> uniformly_convergent_on A g\<Longrightarrow>
   579       uniformly_convergent_on A (\<lambda>k x. f k x + g k x :: 'a :: {real_normed_algebra})"
   655       uniformly_convergent_on A (\<lambda>k x. f k x + g k x :: 'a :: {real_normed_algebra})"
   580   unfolding uniformly_convergent_on_def by (blast dest: uniform_limit_add)
   656   unfolding uniformly_convergent_on_def by (blast dest: uniform_limit_add)
   581 
   657