# HG changeset patch # User huffman # Date 1244746272 25200 # Node ID da5a5589418e176505f70f90c958e9a2326eb80b # Parent d2abf6f6f619b087e98096cd147259adff4ae783 theorem attribute [tendsto_intros] diff -r d2abf6f6f619 -r da5a5589418e src/HOL/Library/Convex_Euclidean_Space.thy --- a/src/HOL/Library/Convex_Euclidean_Space.thy Thu Jun 11 10:37:02 2009 -0700 +++ b/src/HOL/Library/Convex_Euclidean_Space.thy Thu Jun 11 11:51:12 2009 -0700 @@ -1217,7 +1217,8 @@ unfolding open_vector_def all_1 by (auto simp add: dest_vec1_def) -lemma tendsto_dest_vec1: "(f ---> l) net \ ((\x. dest_vec1 (f x)) ---> dest_vec1 l) net" +lemma tendsto_dest_vec1 [tendsto_intros]: + "(f ---> l) net \ ((\x. dest_vec1 (f x)) ---> dest_vec1 l) net" unfolding tendsto_def apply clarify apply (drule_tac x="dest_vec1 -` S" in spec) @@ -1276,19 +1277,13 @@ apply (rule_tac x=u in rev_bexI, simp) apply (erule rev_bexI, erule rev_bexI, simp) by auto - { fix u::"real" fix x y assume as:"0 \ u" "u \ 1" "x \ s" "y \ t" - hence "continuous (at (u, x, y)) - (\z. fst (snd z) - fst z *s fst (snd z) + fst z *s snd (snd z))" - apply (auto intro!: continuous_add continuous_sub continuous_mul) - unfolding continuous_at - by (safe intro!: tendsto_fst tendsto_snd Lim_at_id [unfolded id_def]) - } - hence "continuous_on ({0..1} \ s \ t) + have "continuous_on ({0..1} \ s \ t) (\z. (1 - fst z) *s fst (snd z) + fst z *s snd (snd z))" - apply(rule_tac continuous_at_imp_continuous_on) by auto - thus ?thesis unfolding * apply(rule compact_continuous_image) - defer apply(rule compact_Times) defer apply(rule compact_Times) - using compact_real_interval assms by auto + unfolding continuous_on by (rule ballI) (intro tendsto_intros) + thus ?thesis unfolding * + apply (rule compact_continuous_image) + apply (intro compact_Times compact_real_interval assms) + done qed lemma compact_convex_hull: fixes s::"(real^'n::finite) set" diff -r d2abf6f6f619 -r da5a5589418e src/HOL/Library/Product_Vector.thy --- a/src/HOL/Library/Product_Vector.thy Thu Jun 11 10:37:02 2009 -0700 +++ b/src/HOL/Library/Product_Vector.thy Thu Jun 11 11:51:12 2009 -0700 @@ -177,7 +177,7 @@ lemma dist_snd_le: "dist (snd x) (snd y) \ dist x y" unfolding dist_prod_def by simp -lemma tendsto_fst: +lemma tendsto_fst [tendsto_intros]: assumes "(f ---> a) net" shows "((\x. fst (f x)) ---> fst a) net" proof (rule topological_tendstoI) @@ -196,7 +196,7 @@ by simp qed -lemma tendsto_snd: +lemma tendsto_snd [tendsto_intros]: assumes "(f ---> a) net" shows "((\x. snd (f x)) ---> snd a) net" proof (rule topological_tendstoI) @@ -215,7 +215,7 @@ by simp qed -lemma tendsto_Pair: +lemma tendsto_Pair [tendsto_intros]: assumes "(f ---> a) net" and "(g ---> b) net" shows "((\x. (f x, g x)) ---> (a, b)) net" proof (rule topological_tendstoI) diff -r d2abf6f6f619 -r da5a5589418e src/HOL/Library/Topology_Euclidean_Space.thy --- a/src/HOL/Library/Topology_Euclidean_Space.thy Thu Jun 11 10:37:02 2009 -0700 +++ b/src/HOL/Library/Topology_Euclidean_Space.thy Thu Jun 11 11:51:12 2009 -0700 @@ -1274,39 +1274,6 @@ shows "(f ---> l) net \ (g ---> m) net \ ((\x. f(x) - g(x)) ---> l - m) net" by (rule tendsto_diff) -lemma dist_triangle3: (* TODO: move *) - fixes x y :: "'a::metric_space" - shows "dist x y \ dist a x + dist a y" -using dist_triangle2 [of x y a] -by (simp add: dist_commute) - -lemma tendsto_dist: (* TODO: move *) - assumes f: "(f ---> l) net" and g: "(g ---> m) net" - shows "((\x. dist (f x) (g x)) ---> dist l m) net" -proof (rule tendstoI) - fix e :: real assume "0 < e" - hence e2: "0 < e/2" by simp - from tendstoD [OF f e2] tendstoD [OF g e2] - show "eventually (\x. dist (dist (f x) (g x)) (dist l m) < e) net" - proof (rule eventually_elim2) - fix x assume x: "dist (f x) l < e/2" "dist (g x) m < e/2" - have "dist (f x) (g x) - dist l m \ dist (f x) l + dist (g x) m" - using dist_triangle2 [of "f x" "g x" "l"] - using dist_triangle2 [of "g x" "l" "m"] - by arith - moreover - have "dist l m - dist (f x) (g x) \ dist (f x) l + dist (g x) m" - using dist_triangle3 [of "l" "m" "f x"] - using dist_triangle [of "f x" "m" "g x"] - by arith - ultimately - have "dist (dist (f x) (g x)) (dist l m) \ dist (f x) l + dist (g x) m" - unfolding dist_norm real_norm_def by arith - with x show "dist (dist (f x) (g x)) (dist l m) < e" - by arith - qed -qed - lemma Lim_null: fixes f :: "'a \ 'b::real_normed_vector" shows "(f ---> l) net \ ((\x. f(x) - l) ---> 0) net" by (simp add: Lim dist_norm) @@ -4265,7 +4232,7 @@ subsection{* We can now extend limit compositions to consider the scalar multiplier. *} -lemma Lim_mul: +lemma Lim_mul [tendsto_intros]: fixes f :: "'a \ real ^ _" assumes "(c ---> d) net" "(f ---> l) net" shows "((\x. c(x) *s f x) ---> (d *s l)) net" diff -r d2abf6f6f619 -r da5a5589418e src/HOL/Limits.thy --- a/src/HOL/Limits.thy Thu Jun 11 10:37:02 2009 -0700 +++ b/src/HOL/Limits.thy Thu Jun 11 11:51:12 2009 -0700 @@ -358,6 +358,14 @@ where [code del]: "(f ---> l) net \ (\S. open S \ l \ S \ eventually (\x. f x \ S) net)" +ML{* +structure TendstoIntros = + NamedThmsFun(val name = "tendsto_intros" + val description = "introduction rules for tendsto"); +*} + +setup TendstoIntros.setup + lemma topological_tendstoI: "(\S. open S \ l \ S \ eventually (\x. f x \ S) net) \ (f ---> l) net" @@ -395,12 +403,38 @@ lemma tendsto_Zfun_iff: "(f ---> a) net = Zfun (\x. f x - a) net" by (simp only: tendsto_iff Zfun_def dist_norm) -lemma tendsto_const: "((\x. k) ---> k) net" +lemma tendsto_ident_at [tendsto_intros]: "((\x. x) ---> a) (at a)" +unfolding tendsto_def eventually_at_topological by auto + +lemma tendsto_ident_at_within [tendsto_intros]: + "a \ S \ ((\x. x) ---> a) (at a within S)" +unfolding tendsto_def eventually_within eventually_at_topological by auto + +lemma tendsto_const [tendsto_intros]: "((\x. k) ---> k) net" by (simp add: tendsto_def) -lemma tendsto_norm: - fixes a :: "'a::real_normed_vector" - shows "(f ---> a) net \ ((\x. norm (f x)) ---> norm a) net" +lemma tendsto_dist [tendsto_intros]: + assumes f: "(f ---> l) net" and g: "(g ---> m) net" + shows "((\x. dist (f x) (g x)) ---> dist l m) net" +proof (rule tendstoI) + fix e :: real assume "0 < e" + hence e2: "0 < e/2" by simp + from tendstoD [OF f e2] tendstoD [OF g e2] + show "eventually (\x. dist (dist (f x) (g x)) (dist l m) < e) net" + proof (rule eventually_elim2) + fix x assume "dist (f x) l < e/2" "dist (g x) m < e/2" + then show "dist (dist (f x) (g x)) (dist l m) < e" + unfolding dist_real_def + using dist_triangle2 [of "f x" "g x" "l"] + using dist_triangle2 [of "g x" "l" "m"] + using dist_triangle3 [of "l" "m" "f x"] + using dist_triangle [of "f x" "m" "g x"] + by arith + qed +qed + +lemma tendsto_norm [tendsto_intros]: + "(f ---> a) net \ ((\x. norm (f x)) ---> norm a) net" apply (simp add: tendsto_iff dist_norm, safe) apply (drule_tac x="e" in spec, safe) apply (erule eventually_elim1) @@ -417,12 +451,12 @@ shows "(- a) - (- b) = - (a - b)" by simp -lemma tendsto_add: +lemma tendsto_add [tendsto_intros]: fixes a b :: "'a::real_normed_vector" shows "\(f ---> a) net; (g ---> b) net\ \ ((\x. f x + g x) ---> a + b) net" by (simp only: tendsto_Zfun_iff add_diff_add Zfun_add) -lemma tendsto_minus: +lemma tendsto_minus [tendsto_intros]: fixes a :: "'a::real_normed_vector" shows "(f ---> a) net \ ((\x. - f x) ---> - a) net" by (simp only: tendsto_Zfun_iff minus_diff_minus Zfun_minus) @@ -432,16 +466,16 @@ shows "((\x. - f x) ---> - a) net \ (f ---> a) net" by (drule tendsto_minus, simp) -lemma tendsto_diff: +lemma tendsto_diff [tendsto_intros]: fixes a b :: "'a::real_normed_vector" shows "\(f ---> a) net; (g ---> b) net\ \ ((\x. f x - g x) ---> a - b) net" by (simp add: diff_minus tendsto_add tendsto_minus) -lemma (in bounded_linear) tendsto: +lemma (in bounded_linear) tendsto [tendsto_intros]: "(g ---> a) net \ ((\x. f (g x)) ---> f a) net" by (simp only: tendsto_Zfun_iff diff [symmetric] Zfun) -lemma (in bounded_bilinear) tendsto: +lemma (in bounded_bilinear) tendsto [tendsto_intros]: "\(f ---> a) net; (g ---> b) net\ \ ((\x. f x ** g x) ---> a ** b) net" by (simp only: tendsto_Zfun_iff prod_diff_prod Zfun_add Zfun Zfun_left Zfun_right) @@ -556,7 +590,7 @@ apply (simp add: tendsto_Zfun_iff) done -lemma tendsto_inverse: +lemma tendsto_inverse [tendsto_intros]: fixes a :: "'a::real_normed_div_algebra" assumes f: "(f ---> a) net" assumes a: "a \ 0" @@ -571,7 +605,7 @@ by (rule tendsto_inverse_lemma) qed -lemma tendsto_divide: +lemma tendsto_divide [tendsto_intros]: fixes a b :: "'a::real_normed_field" shows "\(f ---> a) net; (g ---> b) net; b \ 0\ \ ((\x. f x / g x) ---> a / b) net" diff -r d2abf6f6f619 -r da5a5589418e src/HOL/RealVector.thy --- a/src/HOL/RealVector.thy Thu Jun 11 10:37:02 2009 -0700 +++ b/src/HOL/RealVector.thy Thu Jun 11 11:51:12 2009 -0700 @@ -530,6 +530,9 @@ lemma dist_triangle: "dist x z \ dist x y + dist y z" using dist_triangle2 [of x z y] by (simp add: dist_commute) +lemma dist_triangle3: "dist x y \ dist a x + dist a y" +using dist_triangle2 [of x y a] by (simp add: dist_commute) + subclass topological_space proof have "\e::real. 0 < e"