# HG changeset patch # User huffman # Date 1312842444 25200 # Node ID cddb05f941835956c8f813830fd5b97d9d62f764 # Parent 5952bd355779072b8bccc20dce1557eac7a805a1 generalize sequence lemmas diff -r 5952bd355779 -r cddb05f94183 src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy --- a/src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy Mon Aug 08 15:11:38 2011 -0700 +++ b/src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy Mon Aug 08 15:27:24 2011 -0700 @@ -2913,36 +2913,83 @@ qed lemma sequence_infinite_lemma: - fixes l :: "'a::metric_space" (* TODO: generalize *) - assumes "\n::nat. (f n \ l)" "(f ---> l) sequentially" + fixes f :: "nat \ 'a::t1_space" + assumes "\n. f n \ l" and "(f ---> l) sequentially" shows "infinite (range f)" proof - let ?A = "(\x. dist x l) ` range f" assume "finite (range f)" - hence **:"finite ?A" "?A \ {}" by auto - obtain k where k:"dist (f k) l = Min ?A" using Min_in[OF **] by auto - have "0 < Min ?A" using assms(1) unfolding dist_nz unfolding Min_gr_iff[OF **] by auto - then obtain N where "dist (f N) l < Min ?A" using assms(2)[unfolded Lim_sequentially, THEN spec[where x="Min ?A"]] by auto - moreover have "dist (f N) l \ ?A" by auto - ultimately show False using Min_le[OF **(1), of "dist (f N) l"] by auto -qed - + hence "closed (range f)" by (rule finite_imp_closed) + hence "open (- range f)" by (rule open_Compl) + from assms(1) have "l \ - range f" by auto + from assms(2) have "eventually (\n. f n \ - range f) sequentially" + using `open (- range f)` `l \ - range f` by (rule topological_tendstoD) + thus False unfolding eventually_sequentially by auto +qed + +lemma closure_insert: + fixes x :: "'a::t1_space" + shows "closure (insert x s) = insert x (closure s)" +apply (rule closure_unique) +apply (rule conjI [OF insert_mono [OF closure_subset]]) +apply (rule conjI [OF closed_insert [OF closed_closure]]) +apply (simp add: closure_minimal) +done + +lemma islimpt_insert: + fixes x :: "'a::t1_space" + shows "x islimpt (insert a s) \ x islimpt s" +proof + assume *: "x islimpt (insert a s)" + show "x islimpt s" + proof (rule islimptI) + fix t assume t: "x \ t" "open t" + show "\y\s. y \ t \ y \ x" + proof (cases "x = a") + case True + obtain y where "y \ insert a s" "y \ t" "y \ x" + using * t by (rule islimptE) + with `x = a` show ?thesis by auto + next + case False + with t have t': "x \ t - {a}" "open (t - {a})" + by (simp_all add: open_Diff) + obtain y where "y \ insert a s" "y \ t - {a}" "y \ x" + using * t' by (rule islimptE) + thus ?thesis by auto + qed + qed +next + assume "x islimpt s" thus "x islimpt (insert a s)" + by (rule islimpt_subset) auto +qed + +lemma islimpt_union_finite: + fixes x :: "'a::t1_space" + shows "finite s \ x islimpt (s \ t) \ x islimpt t" +by (induct set: finite, simp_all add: islimpt_insert) + lemma sequence_unique_limpt: - fixes l :: "'a::metric_space" (* TODO: generalize *) - assumes "\n::nat. (f n \ l)" "(f ---> l) sequentially" "l' islimpt (range f)" + fixes f :: "nat \ 'a::t2_space" + assumes "(f ---> l) sequentially" and "l' islimpt (range f)" shows "l' = l" -proof(rule ccontr) - def e \ "dist l' l" - assume "l' \ l" hence "e>0" unfolding dist_nz e_def by auto - then obtain N::nat where N:"\n\N. dist (f n) l < e / 2" - using assms(2)[unfolded Lim_sequentially, THEN spec[where x="e/2"]] by auto - def d \ "Min (insert (e/2) ((\n. if dist (f n) l' = 0 then e/2 else dist (f n) l') ` {0 .. N}))" - have "d>0" using `e>0` unfolding d_def e_def using zero_le_dist[of _ l', unfolded order_le_less] by auto - obtain k where k:"f k \ l'" "dist (f k) l' < d" using `d>0` and assms(3)[unfolded islimpt_approachable, THEN spec[where x="d"]] by auto - have "k\N" using k(1)[unfolded dist_nz] using k(2)[unfolded d_def] - by (force simp del: Min.insert_idem) - hence "dist l' l < e" using N[THEN spec[where x=k]] using k(2)[unfolded d_def] and dist_triangle_half_r[of "f k" l' e l] by (auto simp del: Min.insert_idem) - thus False unfolding e_def by auto +proof (rule ccontr) + assume "l' \ l" + obtain s t where "open s" "open t" "l' \ s" "l \ t" "s \ t = {}" + using hausdorff [OF `l' \ l`] by auto + have "eventually (\n. f n \ t) sequentially" + using assms(1) `open t` `l \ t` by (rule topological_tendstoD) + then obtain N where "\n\N. f n \ t" + unfolding eventually_sequentially by auto + + have "UNIV = {.. {N..}" by auto + hence "l' islimpt (f ` ({.. {N..}))" using assms(2) by simp + hence "l' islimpt (f ` {.. f ` {N..})" by (simp add: image_Un) + hence "l' islimpt (f ` {N..})" by (simp add: islimpt_union_finite) + then obtain y where "y \ f ` {N..}" "y \ s" "y \ l'" + using `l' \ s` `open s` by (rule islimptE) + then obtain n where "N \ n" "f n \ s" "f n \ l'" by auto + with `\n\N. f n \ t` have "f n \ s \ t" by simp + with `s \ t = {}` show False by simp qed lemma bolzano_weierstrass_imp_closed: