# HG changeset patch # User huffman # Date 1244475753 25200 # Node ID 472b844f860732fe57fbfe50ce2f9704939ba8ab # Parent bd96f81f657214c93fbe7b920ed1030cdec727d3 generalize some lemmas diff -r bd96f81f6572 -r 472b844f8607 src/HOL/Library/Topology_Euclidean_Space.thy --- a/src/HOL/Library/Topology_Euclidean_Space.thy Mon Jun 08 07:22:35 2009 -0700 +++ b/src/HOL/Library/Topology_Euclidean_Space.thy Mon Jun 08 08:42:33 2009 -0700 @@ -1141,10 +1141,8 @@ lemma Lim_sequentially_iff_LIMSEQ: "(S ---> l) sequentially \ S ----> l" unfolding Lim_sequentially LIMSEQ_def .. -lemma Lim_eventually: - fixes l :: "'a::metric_space" (* FIXME: generalize to t2_space *) - shows "eventually (\x. f x = l) net \ (f ---> l) net" - unfolding tendsto_iff by (auto elim: eventually_rev_mono) +lemma Lim_eventually: "eventually (\x. f x = l) net \ (f ---> l) net" + by (rule topological_tendstoI, auto elim: eventually_rev_mono) text{* The expected monotonicity property. *} @@ -1172,31 +1170,32 @@ text{* Interrelations between restricted and unrestricted limits. *} lemma Lim_at_within: "(f ---> l) net ==> (f ---> l)(net within S)" + (* FIXME: rename *) unfolding tendsto_def Limits.eventually_within apply (clarify, drule spec, drule (1) mp, drule (1) mp) by (auto elim!: eventually_elim1) lemma Lim_within_open: - fixes l :: "'a::metric_space" (* FIXME: generalize to topological_space *) + fixes f :: "'a::topological_space \ 'b::topological_space" assumes"a \ S" "open S" shows "(f ---> l)(at a within S) \ (f ---> l)(at a)" (is "?lhs \ ?rhs") proof assume ?lhs - { fix e::real assume "e>0" - have "eventually (\x. dist (f x) l < e) (at a within S)" - using `?lhs` `e>0` by (rule tendstoD) - hence "eventually (\x. x \ S \ dist (f x) l < e) (at a)" + { fix A assume "open A" "l \ A" + with `?lhs` have "eventually (\x. f x \ A) (at a within S)" + by (rule topological_tendstoD) + hence "eventually (\x. x \ S \ f x \ A) (at a)" unfolding Limits.eventually_within . - then obtain T where "open T" "a \ T" "\x\T. x \ a \ x \ S \ dist (f x) l < e" + then obtain T where "open T" "a \ T" "\x\T. x \ a \ x \ S \ f x \ A" unfolding eventually_at_topological by fast - hence "open (T \ S)" "a \ T \ S" "\x\(T \ S). x \ a \ dist (f x) l < e" + hence "open (T \ S)" "a \ T \ S" "\x\(T \ S). x \ a \ f x \ A" using assms by auto - hence "\T. open T \ a \ T \ (\x\T. x \ a \ dist (f x) l < e)" + hence "\T. open T \ a \ T \ (\x\T. x \ a \ f x \ A)" by fast - hence "eventually (\x. dist (f x) l < e) (at a)" + hence "eventually (\x. f x \ A) (at a)" unfolding eventually_at_topological . } - thus ?rhs by (rule tendstoI) + thus ?rhs by (rule topological_tendstoI) next assume ?rhs thus ?lhs by (rule Lim_at_within) @@ -1260,7 +1259,7 @@ qed lemma Lim_const: "((\x. a) ---> a) net" - unfolding tendsto_def by simp + by (rule tendsto_const) lemma Lim_cmul: fixes f :: "'a \ real ^ 'n::finite" @@ -1274,34 +1273,16 @@ lemma Lim_neg: fixes f :: "'a \ 'b::real_normed_vector" shows "(f ---> l) net ==> ((\x. -(f x)) ---> -l) net" - apply (simp add: Lim dist_norm group_simps) - apply (subst minus_diff_eq[symmetric]) - unfolding norm_minus_cancel by simp + by (rule tendsto_minus) lemma Lim_add: fixes f :: "'a \ 'b::real_normed_vector" shows "(f ---> l) net \ (g ---> m) net \ ((\x. f(x) + g(x)) ---> l + m) net" -proof- - assume as:"(f ---> l) net" "(g ---> m) net" - { fix e::real - assume "e>0" - hence *:"eventually (\x. dist (f x) l < e/2) net" - "eventually (\x. dist (g x) m < e/2) net" using as - by (auto intro: tendstoD simp del: less_divide_eq_number_of1) - hence "eventually (\x. dist (f x + g x) (l + m) < e) net" - apply (elim eventually_rev_mp) - apply (rule always_eventually, clarify) - apply (rule le_less_trans [OF dist_triangle_add]) - apply simp - done - } - thus ?thesis unfolding tendsto_iff by simp -qed + by (rule tendsto_add) lemma Lim_sub: fixes f :: "'a \ 'b::real_normed_vector" shows "(f ---> l) net \ (g ---> m) net \ ((\x. f(x) - g(x)) ---> l - m) net" - unfolding diff_minus - by (simp add: Lim_add Lim_neg) + by (rule tendsto_diff) lemma Lim_null: fixes f :: "'a \ 'b::real_normed_vector" @@ -1347,7 +1328,7 @@ fixes g :: "'a \ 'c::real_normed_vector" assumes "eventually (\n. norm(f n) <= norm(g n)) net" "(g ---> 0) net" shows "(f ---> 0) net" -proof(simp add: tendsto_iff, rule+) +proof (rule tendstoI) fix e::real assume "e>0" { fix x assume "norm (f x) \ norm (g x)" "dist (g x) 0 < e" @@ -1361,20 +1342,18 @@ text{* Deducing things about the limit from the elements. *} lemma Lim_in_closed_set: - fixes l :: "'a::metric_space" (* FIXME: generalize to topological_space *) - assumes "closed S" "eventually (\x. f(x) \ S) net" "\(trivial_limit net)" "(f ---> l) net" + assumes "closed S" "eventually (\x. f(x) \ S) net" "\(trivial_limit net)" "(f ---> l) net" shows "l \ S" proof (rule ccontr) assume "l \ S" - obtain e where e:"e>0" "ball l e \ UNIV - S" using assms(1) `l \ S` unfolding closed_def open_contains_ball Compl_eq_Diff_UNIV by auto - hence *:"\x. dist l x < e \ x \ S" by auto - have "eventually (\x. dist (f x) l < e) net" - using assms(4) `e>0` by (rule tendstoD) - with assms(2) have "eventually (\x. f x \ S \ dist (f x) l < e) net" - by (rule eventually_conjI) - then obtain x where "f x \ S" "dist (f x) l < e" - using assms(3) eventually_happens by auto - with * show "False" by (simp add: dist_commute) + with `closed S` have "open (- S)" "l \ - S" + by (simp_all add: open_Compl) + with assms(4) have "eventually (\x. f x \ - S) net" + by (rule topological_tendstoD) + with assms(2) have "eventually (\x. False) net" + by (rule eventually_elim2) simp + with assms(3) show "False" + by (simp add: eventually_False) qed text{* Need to prove closed(cball(x,e)) before deducing this as a corollary. *}