--- a/src/HOL/Lim.thy Tue Mar 26 14:38:44 2013 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,225 +0,0 @@
-(* Title : Lim.thy
- Author : Jacques D. Fleuriot
- Copyright : 1998 University of Cambridge
- Conversion to Isar and new proofs by Lawrence C Paulson, 2004
-*)
-
-header{* Limits and Continuity *}
-
-theory Lim
-imports SEQ
-begin
-
-subsection {* Limits of Functions *}
-
-lemma LIM_eq:
- fixes a :: "'a::real_normed_vector" and L :: "'b::real_normed_vector"
- shows "f -- a --> L =
- (\<forall>r>0.\<exists>s>0.\<forall>x. x \<noteq> a & norm (x-a) < s --> norm (f x - L) < r)"
-by (simp add: LIM_def dist_norm)
-
-lemma LIM_I:
- fixes a :: "'a::real_normed_vector" and L :: "'b::real_normed_vector"
- shows "(!!r. 0<r ==> \<exists>s>0.\<forall>x. x \<noteq> a & norm (x-a) < s --> norm (f x - L) < r)
- ==> f -- a --> L"
-by (simp add: LIM_eq)
-
-lemma LIM_D:
- fixes a :: "'a::real_normed_vector" and L :: "'b::real_normed_vector"
- shows "[| f -- a --> L; 0<r |]
- ==> \<exists>s>0.\<forall>x. x \<noteq> a & norm (x-a) < s --> norm (f x - L) < r"
-by (simp add: LIM_eq)
-
-lemma LIM_offset:
- fixes a :: "'a::real_normed_vector"
- shows "f -- a --> L \<Longrightarrow> (\<lambda>x. f (x + k)) -- a - k --> L"
-apply (rule topological_tendstoI)
-apply (drule (2) topological_tendstoD)
-apply (simp only: eventually_at dist_norm)
-apply (clarify, rule_tac x=d in exI, safe)
-apply (drule_tac x="x + k" in spec)
-apply (simp add: algebra_simps)
-done
-
-lemma LIM_offset_zero:
- fixes a :: "'a::real_normed_vector"
- shows "f -- a --> L \<Longrightarrow> (\<lambda>h. f (a + h)) -- 0 --> L"
-by (drule_tac k="a" in LIM_offset, simp add: add_commute)
-
-lemma LIM_offset_zero_cancel:
- fixes a :: "'a::real_normed_vector"
- shows "(\<lambda>h. f (a + h)) -- 0 --> L \<Longrightarrow> f -- a --> L"
-by (drule_tac k="- a" in LIM_offset, simp)
-
-lemma LIM_zero:
- fixes f :: "'a::topological_space \<Rightarrow> 'b::real_normed_vector"
- shows "(f ---> l) F \<Longrightarrow> ((\<lambda>x. f x - l) ---> 0) F"
-unfolding tendsto_iff dist_norm by simp
-
-lemma LIM_zero_cancel:
- fixes f :: "'a::topological_space \<Rightarrow> 'b::real_normed_vector"
- shows "((\<lambda>x. f x - l) ---> 0) F \<Longrightarrow> (f ---> l) F"
-unfolding tendsto_iff dist_norm by simp
-
-lemma LIM_zero_iff:
- fixes f :: "'a::metric_space \<Rightarrow> 'b::real_normed_vector"
- shows "((\<lambda>x. f x - l) ---> 0) F = (f ---> l) F"
-unfolding tendsto_iff dist_norm by simp
-
-lemma LIM_imp_LIM:
- fixes f :: "'a::topological_space \<Rightarrow> 'b::real_normed_vector"
- fixes g :: "'a::topological_space \<Rightarrow> 'c::real_normed_vector"
- assumes f: "f -- a --> l"
- assumes le: "\<And>x. x \<noteq> a \<Longrightarrow> norm (g x - m) \<le> norm (f x - l)"
- shows "g -- a --> m"
- by (rule metric_LIM_imp_LIM [OF f],
- simp add: dist_norm le)
-
-lemma LIM_equal2:
- fixes f g :: "'a::real_normed_vector \<Rightarrow> 'b::topological_space"
- assumes 1: "0 < R"
- assumes 2: "\<And>x. \<lbrakk>x \<noteq> a; norm (x - a) < R\<rbrakk> \<Longrightarrow> f x = g x"
- shows "g -- a --> l \<Longrightarrow> f -- a --> l"
-by (rule metric_LIM_equal2 [OF 1 2], simp_all add: dist_norm)
-
-lemma LIM_compose2:
- fixes a :: "'a::real_normed_vector"
- assumes f: "f -- a --> b"
- assumes g: "g -- b --> c"
- assumes inj: "\<exists>d>0. \<forall>x. x \<noteq> a \<and> norm (x - a) < d \<longrightarrow> f x \<noteq> b"
- shows "(\<lambda>x. g (f x)) -- a --> c"
-by (rule metric_LIM_compose2 [OF f g inj [folded dist_norm]])
-
-lemma real_LIM_sandwich_zero:
- fixes f g :: "'a::topological_space \<Rightarrow> real"
- assumes f: "f -- a --> 0"
- assumes 1: "\<And>x. x \<noteq> a \<Longrightarrow> 0 \<le> g x"
- assumes 2: "\<And>x. x \<noteq> a \<Longrightarrow> g x \<le> f x"
- shows "g -- a --> 0"
-proof (rule LIM_imp_LIM [OF f]) (* FIXME: use tendsto_sandwich *)
- fix x assume x: "x \<noteq> a"
- have "norm (g x - 0) = g x" by (simp add: 1 x)
- also have "g x \<le> f x" by (rule 2 [OF x])
- also have "f x \<le> \<bar>f x\<bar>" by (rule abs_ge_self)
- also have "\<bar>f x\<bar> = norm (f x - 0)" by simp
- finally show "norm (g x - 0) \<le> norm (f x - 0)" .
-qed
-
-
-subsection {* Continuity *}
-
-lemma LIM_isCont_iff:
- fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::topological_space"
- shows "(f -- a --> f a) = ((\<lambda>h. f (a + h)) -- 0 --> f a)"
-by (rule iffI [OF LIM_offset_zero LIM_offset_zero_cancel])
-
-lemma isCont_iff:
- fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::topological_space"
- shows "isCont f x = (\<lambda>h. f (x + h)) -- 0 --> f x"
-by (simp add: isCont_def LIM_isCont_iff)
-
-lemma isCont_LIM_compose2:
- fixes a :: "'a::real_normed_vector"
- assumes f [unfolded isCont_def]: "isCont f a"
- assumes g: "g -- f a --> l"
- assumes inj: "\<exists>d>0. \<forall>x. x \<noteq> a \<and> norm (x - a) < d \<longrightarrow> f x \<noteq> f a"
- shows "(\<lambda>x. g (f x)) -- a --> l"
-by (rule LIM_compose2 [OF f g inj])
-
-
-lemma isCont_norm [simp]:
- fixes f :: "'a::t2_space \<Rightarrow> 'b::real_normed_vector"
- shows "isCont f a \<Longrightarrow> isCont (\<lambda>x. norm (f x)) a"
- by (fact continuous_norm)
-
-lemma isCont_rabs [simp]:
- fixes f :: "'a::t2_space \<Rightarrow> real"
- shows "isCont f a \<Longrightarrow> isCont (\<lambda>x. \<bar>f x\<bar>) a"
- by (fact continuous_rabs)
-
-lemma isCont_add [simp]:
- fixes f :: "'a::t2_space \<Rightarrow> 'b::real_normed_vector"
- shows "\<lbrakk>isCont f a; isCont g a\<rbrakk> \<Longrightarrow> isCont (\<lambda>x. f x + g x) a"
- by (fact continuous_add)
-
-lemma isCont_minus [simp]:
- fixes f :: "'a::t2_space \<Rightarrow> 'b::real_normed_vector"
- shows "isCont f a \<Longrightarrow> isCont (\<lambda>x. - f x) a"
- by (fact continuous_minus)
-
-lemma isCont_diff [simp]:
- fixes f :: "'a::t2_space \<Rightarrow> 'b::real_normed_vector"
- shows "\<lbrakk>isCont f a; isCont g a\<rbrakk> \<Longrightarrow> isCont (\<lambda>x. f x - g x) a"
- by (fact continuous_diff)
-
-lemma isCont_mult [simp]:
- fixes f g :: "'a::t2_space \<Rightarrow> 'b::real_normed_algebra"
- shows "\<lbrakk>isCont f a; isCont g a\<rbrakk> \<Longrightarrow> isCont (\<lambda>x. f x * g x) a"
- by (fact continuous_mult)
-
-lemma (in bounded_linear) isCont:
- "isCont g a \<Longrightarrow> isCont (\<lambda>x. f (g x)) a"
- by (fact continuous)
-
-lemma (in bounded_bilinear) isCont:
- "\<lbrakk>isCont f a; isCont g a\<rbrakk> \<Longrightarrow> isCont (\<lambda>x. f x ** g x) a"
- by (fact continuous)
-
-lemmas isCont_scaleR [simp] =
- bounded_bilinear.isCont [OF bounded_bilinear_scaleR]
-
-lemmas isCont_of_real [simp] =
- bounded_linear.isCont [OF bounded_linear_of_real]
-
-lemma isCont_power [simp]:
- fixes f :: "'a::t2_space \<Rightarrow> 'b::{power,real_normed_algebra}"
- shows "isCont f a \<Longrightarrow> isCont (\<lambda>x. f x ^ n) a"
- by (fact continuous_power)
-
-lemma isCont_setsum [simp]:
- fixes f :: "'a \<Rightarrow> 'b::t2_space \<Rightarrow> 'c::real_normed_vector"
- shows "\<forall>i\<in>A. isCont (f i) a \<Longrightarrow> isCont (\<lambda>x. \<Sum>i\<in>A. f i x) a"
- by (auto intro: continuous_setsum)
-
-lemmas isCont_intros =
- isCont_ident isCont_const isCont_norm isCont_rabs isCont_add isCont_minus
- isCont_diff isCont_mult isCont_inverse isCont_divide isCont_scaleR
- isCont_of_real isCont_power isCont_sgn isCont_setsum
-
-subsection {* Uniform Continuity *}
-
-lemma (in bounded_linear) isUCont: "isUCont f"
-unfolding isUCont_def dist_norm
-proof (intro allI impI)
- fix r::real assume r: "0 < r"
- obtain K where K: "0 < K" and norm_le: "\<And>x. norm (f x) \<le> norm x * K"
- using pos_bounded by fast
- show "\<exists>s>0. \<forall>x y. norm (x - y) < s \<longrightarrow> norm (f x - f y) < r"
- proof (rule exI, safe)
- from r K show "0 < r / K" by (rule divide_pos_pos)
- next
- fix x y :: 'a
- assume xy: "norm (x - y) < r / K"
- have "norm (f x - f y) = norm (f (x - y))" by (simp only: diff)
- also have "\<dots> \<le> norm (x - y) * K" by (rule norm_le)
- also from K xy have "\<dots> < r" by (simp only: pos_less_divide_eq)
- finally show "norm (f x - f y) < r" .
- qed
-qed
-
-lemma (in bounded_linear) Cauchy: "Cauchy X \<Longrightarrow> Cauchy (\<lambda>n. f (X n))"
-by (rule isUCont [THEN isUCont_Cauchy])
-
-
-lemma LIM_less_bound:
- fixes f :: "real \<Rightarrow> real"
- assumes ev: "b < x" "\<forall> x' \<in> { b <..< x}. 0 \<le> f x'" and "isCont f x"
- shows "0 \<le> f x"
-proof (rule tendsto_le_const)
- show "(f ---> f x) (at_left x)"
- using `isCont f x` by (simp add: filterlim_at_split isCont_def)
- show "eventually (\<lambda>x. 0 \<le> f x) (at_left x)"
- using ev by (auto simp: eventually_within_less dist_real_def intro!: exI[of _ "x - b"])
-qed simp
-
-end