src/HOL/Hyperreal/Lim.thy
changeset 22627 2b093ba973bc
parent 22613 2f119f54d150
child 22631 7ae5a6ab7bd6
equal deleted inserted replaced
22626:7e35b6c8ab5b 22627:2b093ba973bc
   161 by (erule LIM_imp_LIM, simp)
   161 by (erule LIM_imp_LIM, simp)
   162 
   162 
   163 lemma LIM_norm_zero_iff: "(\<lambda>x. norm (f x)) -- a --> 0 = f -- a --> 0"
   163 lemma LIM_norm_zero_iff: "(\<lambda>x. norm (f x)) -- a --> 0 = f -- a --> 0"
   164 by (rule iffI [OF LIM_norm_zero_cancel LIM_norm_zero])
   164 by (rule iffI [OF LIM_norm_zero_cancel LIM_norm_zero])
   165 
   165 
       
   166 lemma LIM_rabs: "f -- a --> (l::real) \<Longrightarrow> (\<lambda>x. \<bar>f x\<bar>) -- a --> \<bar>l\<bar>"
       
   167 by (fold real_norm_def, rule LIM_norm)
       
   168 
       
   169 lemma LIM_rabs_zero: "f -- a --> (0::real) \<Longrightarrow> (\<lambda>x. \<bar>f x\<bar>) -- a --> 0"
       
   170 by (fold real_norm_def, rule LIM_norm_zero)
       
   171 
       
   172 lemma LIM_rabs_zero_cancel: "(\<lambda>x. \<bar>f x\<bar>) -- a --> (0::real) \<Longrightarrow> f -- a --> 0"
       
   173 by (fold real_norm_def, rule LIM_norm_zero_cancel)
       
   174 
       
   175 lemma LIM_rabs_zero_iff: "(\<lambda>x. \<bar>f x\<bar>) -- a --> (0::real) = f -- a --> 0"
       
   176 by (fold real_norm_def, rule LIM_norm_zero_iff)
       
   177 
   166 lemma LIM_const_not_eq:
   178 lemma LIM_const_not_eq:
   167   fixes a :: "'a::real_normed_div_algebra"
   179   fixes a :: "'a::real_normed_div_algebra"
   168   shows "k \<noteq> L ==> ~ ((%x. k) -- a --> L)"
   180   shows "k \<noteq> L ==> ~ ((%x. k) -- a --> L)"
   169 apply (simp add: LIM_eq)
   181 apply (simp add: LIM_eq)
   170 apply (rule_tac x="norm (k - L)" in exI, simp, safe)
   182 apply (rule_tac x="norm (k - L)" in exI, simp, safe)
   184   fixes a :: "'a::real_normed_div_algebra"
   196   fixes a :: "'a::real_normed_div_algebra"
   185   shows "[| f -- a --> L; f -- a --> M |] ==> L = M"
   197   shows "[| f -- a --> L; f -- a --> M |] ==> L = M"
   186 apply (drule LIM_diff, assumption)
   198 apply (drule LIM_diff, assumption)
   187 apply (auto dest!: LIM_const_eq)
   199 apply (auto dest!: LIM_const_eq)
   188 done
   200 done
   189 
       
   190 lemma LIM_mult_zero:
       
   191   fixes f g :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_algebra"
       
   192   assumes f: "f -- a --> 0" and g: "g -- a --> 0"
       
   193   shows "(%x. f(x) * g(x)) -- a --> 0"
       
   194 proof (rule LIM_I, simp)
       
   195   fix r :: real
       
   196   assume r: "0<r"
       
   197   from LIM_D [OF f zero_less_one]
       
   198   obtain fs
       
   199     where fs:    "0 < fs"
       
   200       and fs_lt: "\<forall>x. x \<noteq> a & norm (x-a) < fs --> norm (f x) < 1"
       
   201   by auto
       
   202   from LIM_D [OF g r]
       
   203   obtain gs
       
   204     where gs:    "0 < gs"
       
   205       and gs_lt: "\<forall>x. x \<noteq> a & norm (x-a) < gs --> norm (g x) < r"
       
   206   by auto
       
   207   show "\<exists>s. 0 < s \<and> (\<forall>x. x \<noteq> a \<and> norm (x-a) < s \<longrightarrow> norm (f x * g x) < r)"
       
   208   proof (intro exI conjI strip)
       
   209     show "0 < min fs gs"  by (simp add: fs gs)
       
   210     fix x :: 'a
       
   211     assume "x \<noteq> a \<and> norm (x-a) < min fs gs"
       
   212     hence  "x \<noteq> a \<and> norm (x-a) < fs \<and> norm (x-a) < gs" by simp
       
   213     with fs_lt gs_lt
       
   214     have "norm (f x) < 1" and "norm (g x) < r" by blast+
       
   215     hence "norm (f x) * norm (g x) < 1*r"
       
   216       by (rule mult_strict_mono' [OF _ _ norm_ge_zero norm_ge_zero])
       
   217     thus "norm (f x * g x) < r"
       
   218       by (simp add: order_le_less_trans [OF norm_mult_ineq])
       
   219   qed
       
   220 qed
       
   221 
   201 
   222 lemma LIM_self: "(%x. x) -- a --> a"
   202 lemma LIM_self: "(%x. x) -- a --> a"
   223 by (auto simp add: LIM_def)
   203 by (auto simp add: LIM_def)
   224 
   204 
   225 text{*Limits are equal for functions equal except at limit point*}
   205 text{*Limits are equal for functions equal except at limit point*}
   384 
   364 
   385 lemmas LIM_mult_right_zero = bounded_bilinear_mult.LIM_right_zero
   365 lemmas LIM_mult_right_zero = bounded_bilinear_mult.LIM_right_zero
   386 
   366 
   387 lemmas LIM_scaleR = bounded_bilinear_scaleR.LIM
   367 lemmas LIM_scaleR = bounded_bilinear_scaleR.LIM
   388 
   368 
       
   369 lemmas LIM_of_real = bounded_linear_of_real.LIM
       
   370 
       
   371 lemma LIM_power:
       
   372   fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::{recpower,real_normed_algebra}"
       
   373   assumes f: "f -- a --> l"
       
   374   shows "(\<lambda>x. f x ^ n) -- a --> l ^ n"
       
   375 by (induct n, simp, simp add: power_Suc LIM_mult f)
       
   376 
   389 subsubsection {* Purely nonstandard proofs *}
   377 subsubsection {* Purely nonstandard proofs *}
   390 
   378 
   391 lemma NSLIM_I:
   379 lemma NSLIM_I:
   392   "(\<And>x. \<lbrakk>x \<noteq> star_of a; x \<approx> star_of a\<rbrakk> \<Longrightarrow> starfun f x \<approx> star_of L)
   380   "(\<And>x. \<lbrakk>x \<noteq> star_of a; x \<approx> star_of a\<rbrakk> \<Longrightarrow> starfun f x \<approx> star_of L)
   393    \<Longrightarrow> f -- a --NS> L"
   381    \<Longrightarrow> f -- a --NS> L"
   581   unfolding isCont_def by (rule LIM_const)
   569   unfolding isCont_def by (rule LIM_const)
   582 
   570 
   583 lemma isCont_norm: "isCont f a \<Longrightarrow> isCont (\<lambda>x. norm (f x)) a"
   571 lemma isCont_norm: "isCont f a \<Longrightarrow> isCont (\<lambda>x. norm (f x)) a"
   584   unfolding isCont_def by (rule LIM_norm)
   572   unfolding isCont_def by (rule LIM_norm)
   585 
   573 
       
   574 lemma isCont_rabs: "isCont f a \<Longrightarrow> isCont (\<lambda>x. \<bar>f x :: real\<bar>) a"
       
   575   unfolding isCont_def by (rule LIM_rabs)
       
   576 
   586 lemma isCont_add: "\<lbrakk>isCont f a; isCont g a\<rbrakk> \<Longrightarrow> isCont (\<lambda>x. f x + g x) a"
   577 lemma isCont_add: "\<lbrakk>isCont f a; isCont g a\<rbrakk> \<Longrightarrow> isCont (\<lambda>x. f x + g x) a"
   587   unfolding isCont_def by (rule LIM_add)
   578   unfolding isCont_def by (rule LIM_add)
   588 
   579 
   589 lemma isCont_minus: "isCont f a \<Longrightarrow> isCont (\<lambda>x. - f x) a"
   580 lemma isCont_minus: "isCont f a \<Longrightarrow> isCont (\<lambda>x. - f x) a"
   590   unfolding isCont_def by (rule LIM_minus)
   581   unfolding isCont_def by (rule LIM_minus)
   618 lemma (in bounded_bilinear) isCont:
   609 lemma (in bounded_bilinear) isCont:
   619   "\<lbrakk>isCont f a; isCont g a\<rbrakk> \<Longrightarrow> isCont (\<lambda>x. f x ** g x) a"
   610   "\<lbrakk>isCont f a; isCont g a\<rbrakk> \<Longrightarrow> isCont (\<lambda>x. f x ** g x) a"
   620   unfolding isCont_def by (rule LIM)
   611   unfolding isCont_def by (rule LIM)
   621 
   612 
   622 lemmas isCont_scaleR = bounded_bilinear_scaleR.isCont
   613 lemmas isCont_scaleR = bounded_bilinear_scaleR.isCont
       
   614 
       
   615 lemma isCont_of_real:
       
   616   "isCont f a \<Longrightarrow> isCont (\<lambda>x. of_real (f x)) a"
       
   617   unfolding isCont_def by (rule LIM_of_real)
       
   618 
       
   619 lemma isCont_power:
       
   620   fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::{recpower,real_normed_algebra}"
       
   621   shows "isCont f a \<Longrightarrow> isCont (\<lambda>x. f x ^ n) a"
       
   622   unfolding isCont_def by (rule LIM_power)
   623 
   623 
   624 subsubsection {* Nonstandard proofs *}
   624 subsubsection {* Nonstandard proofs *}
   625 
   625 
   626 lemma isNSContD:
   626 lemma isNSContD:
   627   "\<lbrakk>isNSCont f a; y \<approx> star_of a\<rbrakk> \<Longrightarrow> ( *f* f) y \<approx> star_of (f a)"
   627   "\<lbrakk>isNSCont f a; y \<approx> star_of a\<rbrakk> \<Longrightarrow> ( *f* f) y \<approx> star_of (f a)"