src/HOL/Limits.thy
changeset 44194 0639898074ae
parent 44081 730f7cced3a6
child 44195 f5363511b212
equal deleted inserted replaced
44193:013f7b14f6ff 44194:0639898074ae
   621       using dist_triangle [of "f x" "m" "g x"]
   621       using dist_triangle [of "f x" "m" "g x"]
   622       by arith
   622       by arith
   623   qed
   623   qed
   624 qed
   624 qed
   625 
   625 
       
   626 subsubsection {* Norms *}
       
   627 
   626 lemma norm_conv_dist: "norm x = dist x 0"
   628 lemma norm_conv_dist: "norm x = dist x 0"
   627   unfolding dist_norm by simp
   629   unfolding dist_norm by simp
   628 
   630 
   629 lemma tendsto_norm [tendsto_intros]:
   631 lemma tendsto_norm [tendsto_intros]:
   630   "(f ---> a) A \<Longrightarrow> ((\<lambda>x. norm (f x)) ---> norm a) A"
   632   "(f ---> a) A \<Longrightarrow> ((\<lambda>x. norm (f x)) ---> norm a) A"
   639   unfolding tendsto_iff dist_norm by simp
   641   unfolding tendsto_iff dist_norm by simp
   640 
   642 
   641 lemma tendsto_norm_zero_iff:
   643 lemma tendsto_norm_zero_iff:
   642   "((\<lambda>x. norm (f x)) ---> 0) A \<longleftrightarrow> (f ---> 0) A"
   644   "((\<lambda>x. norm (f x)) ---> 0) A \<longleftrightarrow> (f ---> 0) A"
   643   unfolding tendsto_iff dist_norm by simp
   645   unfolding tendsto_iff dist_norm by simp
       
   646 
       
   647 lemma tendsto_rabs [tendsto_intros]:
       
   648   "(f ---> (l::real)) A \<Longrightarrow> ((\<lambda>x. \<bar>f x\<bar>) ---> \<bar>l\<bar>) A"
       
   649   by (fold real_norm_def, rule tendsto_norm)
       
   650 
       
   651 lemma tendsto_rabs_zero:
       
   652   "(f ---> (0::real)) A \<Longrightarrow> ((\<lambda>x. \<bar>f x\<bar>) ---> 0) A"
       
   653   by (fold real_norm_def, rule tendsto_norm_zero)
       
   654 
       
   655 lemma tendsto_rabs_zero_cancel:
       
   656   "((\<lambda>x. \<bar>f x\<bar>) ---> (0::real)) A \<Longrightarrow> (f ---> 0) A"
       
   657   by (fold real_norm_def, rule tendsto_norm_zero_cancel)
       
   658 
       
   659 lemma tendsto_rabs_zero_iff:
       
   660   "((\<lambda>x. \<bar>f x\<bar>) ---> (0::real)) A \<longleftrightarrow> (f ---> 0) A"
       
   661   by (fold real_norm_def, rule tendsto_norm_zero_iff)
       
   662 
       
   663 subsubsection {* Addition and subtraction *}
   644 
   664 
   645 lemma tendsto_add [tendsto_intros]:
   665 lemma tendsto_add [tendsto_intros]:
   646   fixes a b :: "'a::real_normed_vector"
   666   fixes a b :: "'a::real_normed_vector"
   647   shows "\<lbrakk>(f ---> a) A; (g ---> b) A\<rbrakk> \<Longrightarrow> ((\<lambda>x. f x + g x) ---> a + b) A"
   667   shows "\<lbrakk>(f ---> a) A; (g ---> b) A\<rbrakk> \<Longrightarrow> ((\<lambda>x. f x + g x) ---> a + b) A"
   648   by (simp only: tendsto_Zfun_iff add_diff_add Zfun_add)
   668   by (simp only: tendsto_Zfun_iff add_diff_add Zfun_add)
       
   669 
       
   670 lemma tendsto_add_zero:
       
   671   fixes f g :: "'a::type \<Rightarrow> 'b::real_normed_vector"
       
   672   shows "\<lbrakk>(f ---> 0) A; (g ---> 0) A\<rbrakk> \<Longrightarrow> ((\<lambda>x. f x + g x) ---> 0) A"
       
   673   by (drule (1) tendsto_add, simp)
   649 
   674 
   650 lemma tendsto_minus [tendsto_intros]:
   675 lemma tendsto_minus [tendsto_intros]:
   651   fixes a :: "'a::real_normed_vector"
   676   fixes a :: "'a::real_normed_vector"
   652   shows "(f ---> a) A \<Longrightarrow> ((\<lambda>x. - f x) ---> - a) A"
   677   shows "(f ---> a) A \<Longrightarrow> ((\<lambda>x. - f x) ---> - a) A"
   653   by (simp only: tendsto_Zfun_iff minus_diff_minus Zfun_minus)
   678   by (simp only: tendsto_Zfun_iff minus_diff_minus Zfun_minus)
   666   fixes f :: "'a \<Rightarrow> 'b \<Rightarrow> 'c::real_normed_vector"
   691   fixes f :: "'a \<Rightarrow> 'b \<Rightarrow> 'c::real_normed_vector"
   667   assumes "\<And>i. i \<in> S \<Longrightarrow> (f i ---> a i) A"
   692   assumes "\<And>i. i \<in> S \<Longrightarrow> (f i ---> a i) A"
   668   shows "((\<lambda>x. \<Sum>i\<in>S. f i x) ---> (\<Sum>i\<in>S. a i)) A"
   693   shows "((\<lambda>x. \<Sum>i\<in>S. f i x) ---> (\<Sum>i\<in>S. a i)) A"
   669 proof (cases "finite S")
   694 proof (cases "finite S")
   670   assume "finite S" thus ?thesis using assms
   695   assume "finite S" thus ?thesis using assms
   671   proof (induct set: finite)
   696     by (induct, simp add: tendsto_const, simp add: tendsto_add)
   672     case empty show ?case
       
   673       by (simp add: tendsto_const)
       
   674   next
       
   675     case (insert i F) thus ?case
       
   676       by (simp add: tendsto_add)
       
   677   qed
       
   678 next
   697 next
   679   assume "\<not> finite S" thus ?thesis
   698   assume "\<not> finite S" thus ?thesis
   680     by (simp add: tendsto_const)
   699     by (simp add: tendsto_const)
   681 qed
   700 qed
       
   701 
       
   702 subsubsection {* Linear operators and multiplication *}
   682 
   703 
   683 lemma (in bounded_linear) tendsto [tendsto_intros]:
   704 lemma (in bounded_linear) tendsto [tendsto_intros]:
   684   "(g ---> a) A \<Longrightarrow> ((\<lambda>x. f (g x)) ---> f a) A"
   705   "(g ---> a) A \<Longrightarrow> ((\<lambda>x. f (g x)) ---> f a) A"
   685   by (simp only: tendsto_Zfun_iff diff [symmetric] Zfun)
   706   by (simp only: tendsto_Zfun_iff diff [symmetric] Zfun)
       
   707 
       
   708 lemma (in bounded_linear) tendsto_zero:
       
   709   "(g ---> 0) A \<Longrightarrow> ((\<lambda>x. f (g x)) ---> 0) A"
       
   710   by (drule tendsto, simp only: zero)
   686 
   711 
   687 lemma (in bounded_bilinear) tendsto [tendsto_intros]:
   712 lemma (in bounded_bilinear) tendsto [tendsto_intros]:
   688   "\<lbrakk>(f ---> a) A; (g ---> b) A\<rbrakk> \<Longrightarrow> ((\<lambda>x. f x ** g x) ---> a ** b) A"
   713   "\<lbrakk>(f ---> a) A; (g ---> b) A\<rbrakk> \<Longrightarrow> ((\<lambda>x. f x ** g x) ---> a ** b) A"
   689   by (simp only: tendsto_Zfun_iff prod_diff_prod
   714   by (simp only: tendsto_Zfun_iff prod_diff_prod
   690                  Zfun_add Zfun Zfun_left Zfun_right)
   715                  Zfun_add Zfun Zfun_left Zfun_right)
   691 
   716 
   692 
   717 lemma (in bounded_bilinear) tendsto_zero:
   693 subsection {* Continuity of Inverse *}
   718   assumes f: "(f ---> 0) A"
       
   719   assumes g: "(g ---> 0) A"
       
   720   shows "((\<lambda>x. f x ** g x) ---> 0) A"
       
   721   using tendsto [OF f g] by (simp add: zero_left)
       
   722 
       
   723 lemma (in bounded_bilinear) tendsto_left_zero:
       
   724   "(f ---> 0) A \<Longrightarrow> ((\<lambda>x. f x ** c) ---> 0) A"
       
   725   by (rule bounded_linear.tendsto_zero [OF bounded_linear_left])
       
   726 
       
   727 lemma (in bounded_bilinear) tendsto_right_zero:
       
   728   "(f ---> 0) A \<Longrightarrow> ((\<lambda>x. c ** f x) ---> 0) A"
       
   729   by (rule bounded_linear.tendsto_zero [OF bounded_linear_right])
       
   730 
       
   731 lemmas tendsto_mult = mult.tendsto
       
   732 
       
   733 lemma tendsto_power [tendsto_intros]:
       
   734   fixes f :: "'a \<Rightarrow> 'b::{power,real_normed_algebra}"
       
   735   shows "(f ---> a) A \<Longrightarrow> ((\<lambda>x. f x ^ n) ---> a ^ n) A"
       
   736   by (induct n) (simp_all add: tendsto_const tendsto_mult)
       
   737 
       
   738 lemma tendsto_setprod [tendsto_intros]:
       
   739   fixes f :: "'a \<Rightarrow> 'b \<Rightarrow> 'c::{real_normed_algebra,comm_ring_1}"
       
   740   assumes "\<And>i. i \<in> S \<Longrightarrow> (f i ---> L i) A"
       
   741   shows "((\<lambda>x. \<Prod>i\<in>S. f i x) ---> (\<Prod>i\<in>S. L i)) A"
       
   742 proof (cases "finite S")
       
   743   assume "finite S" thus ?thesis using assms
       
   744     by (induct, simp add: tendsto_const, simp add: tendsto_mult)
       
   745 next
       
   746   assume "\<not> finite S" thus ?thesis
       
   747     by (simp add: tendsto_const)
       
   748 qed
       
   749 
       
   750 subsubsection {* Inverse and division *}
   694 
   751 
   695 lemma (in bounded_bilinear) Zfun_prod_Bfun:
   752 lemma (in bounded_bilinear) Zfun_prod_Bfun:
   696   assumes f: "Zfun f A"
   753   assumes f: "Zfun f A"
   697   assumes g: "Bfun g A"
   754   assumes g: "Bfun g A"
   698   shows "Zfun (\<lambda>x. f x ** g x) A"
   755   shows "Zfun (\<lambda>x. f x ** g x) A"
   813   fixes a b :: "'a::real_normed_field"
   870   fixes a b :: "'a::real_normed_field"
   814   shows "\<lbrakk>(f ---> a) A; (g ---> b) A; b \<noteq> 0\<rbrakk>
   871   shows "\<lbrakk>(f ---> a) A; (g ---> b) A; b \<noteq> 0\<rbrakk>
   815     \<Longrightarrow> ((\<lambda>x. f x / g x) ---> a / b) A"
   872     \<Longrightarrow> ((\<lambda>x. f x / g x) ---> a / b) A"
   816   by (simp add: mult.tendsto tendsto_inverse divide_inverse)
   873   by (simp add: mult.tendsto tendsto_inverse divide_inverse)
   817 
   874 
       
   875 lemma tendsto_sgn [tendsto_intros]:
       
   876   fixes l :: "'a::real_normed_vector"
       
   877   shows "\<lbrakk>(f ---> l) A; l \<noteq> 0\<rbrakk> \<Longrightarrow> ((\<lambda>x. sgn (f x)) ---> sgn l) A"
       
   878   unfolding sgn_div_norm by (simp add: tendsto_intros)
       
   879 
       
   880 subsubsection {* Uniqueness *}
       
   881 
   818 lemma tendsto_unique:
   882 lemma tendsto_unique:
   819   fixes f :: "'a \<Rightarrow> 'b::t2_space"
   883   fixes f :: "'a \<Rightarrow> 'b::t2_space"
   820   assumes "\<not> trivial_limit A"  "(f ---> l) A"  "(f ---> l') A"
   884   assumes "\<not> trivial_limit A"  "(f ---> l) A"  "(f ---> l') A"
   821   shows "l = l'"
   885   shows "l = l'"
   822 proof (rule ccontr)
   886 proof (rule ccontr)