# HG changeset patch # User paulson # Date 1504871380 -3600 # Node ID ff2e0115fea4166cc93ce63b68b8a5bd78f0bd01 # Parent c61c957b04394bbea59da7615b5bc81a0f425432 Simplicial complexes and triangulations; Baire Category Theorem diff -r c61c957b0439 -r ff2e0115fea4 NEWS --- a/NEWS Fri Sep 08 11:09:56 2017 +0200 +++ b/NEWS Fri Sep 08 12:49:40 2017 +0100 @@ -254,8 +254,8 @@ * Theory "HOL-Library.Uprod" formalizes the type of unordered pairs. * Session HOL-Analysis: more material involving arcs, paths, covering -spaces, innessential maps, retracts, material on infinite products. -Major results include the Jordan Curve Theorem and the Great Picard +spaces, innessential maps, retracts, infinite products, simplicial complexes. +Baire Category theory. Major results include the Jordan Curve Theorem and the Great Picard Theorem. * Session HOL-Algebra has been extended by additional lattice theory: diff -r c61c957b0439 -r ff2e0115fea4 src/HOL/Analysis/Convex_Euclidean_Space.thy --- a/src/HOL/Analysis/Convex_Euclidean_Space.thy Fri Sep 08 11:09:56 2017 +0200 +++ b/src/HOL/Analysis/Convex_Euclidean_Space.thy Fri Sep 08 12:49:40 2017 +0100 @@ -3979,6 +3979,41 @@ shows "aff_dim S < 0 \S = {}" by (metis aff_dim_empty aff_dim_geq diff_0 eq_iff zle_diff1_eq) +lemma aff_lowdim_subset_hyperplane: + fixes S :: "'a::euclidean_space set" + assumes "aff_dim S < DIM('a)" + obtains a b where "a \ 0" "S \ {x. a \ x = b}" +proof (cases "S={}") + case True + moreover + have "(SOME b. b \ Basis) \ 0" + by (metis norm_some_Basis norm_zero zero_neq_one) + ultimately show ?thesis + using that by blast +next + case False + then obtain c S' where "c \ S'" "S = insert c S'" + by (meson equals0I mk_disjoint_insert) + have "dim (op + (-c) ` S) < DIM('a)" + by (metis \S = insert c S'\ aff_dim_eq_dim assms hull_inc insertI1 of_nat_less_imp_less) + then obtain a where "a \ 0" "span (op + (-c) ` S) \ {x. a \ x = 0}" + using lowdim_subset_hyperplane by blast + moreover + have "a \ w = a \ c" if "span (op + (- c) ` S) \ {x. a \ x = 0}" "w \ S" for w + proof - + have "w-c \ span (op + (- c) ` S)" + by (simp add: span_superset \w \ S\) + with that have "w-c \ {x. a \ x = 0}" + by blast + then show ?thesis + by (auto simp: algebra_simps) + qed + ultimately have "S \ {x. a \ x = a \ c}" + by blast + then show ?thesis + by (rule that[OF \a \ 0\]) +qed + lemma affine_independent_card_dim_diffs: fixes S :: "'a :: euclidean_space set" assumes "~ affine_dependent S" "a \ S" diff -r c61c957b0439 -r ff2e0115fea4 src/HOL/Analysis/Linear_Algebra.thy --- a/src/HOL/Analysis/Linear_Algebra.thy Fri Sep 08 11:09:56 2017 +0200 +++ b/src/HOL/Analysis/Linear_Algebra.thy Fri Sep 08 12:49:40 2017 +0100 @@ -310,7 +310,7 @@ lemma span_minimal: "S \ T \ subspace T \ span S \ T" unfolding span_def by (rule hull_minimal) -lemma span_UNIV: "span UNIV = UNIV" +lemma span_UNIV [simp]: "span UNIV = UNIV" by (intro span_unique) auto lemma (in real_vector) span_induct: diff -r c61c957b0439 -r ff2e0115fea4 src/HOL/Analysis/Polytope.thy --- a/src/HOL/Analysis/Polytope.thy Fri Sep 08 11:09:56 2017 +0200 +++ b/src/HOL/Analysis/Polytope.thy Fri Sep 08 12:49:40 2017 +0100 @@ -3811,4 +3811,113 @@ qed qed +subsection\Some results on cell division with full-dimensional cells only\ + +lemma convex_Union_fulldim_cells: + assumes "finite \" and clo: "\C. C \ \ \ closed C" and con: "\C. C \ \ \ convex C" + and eq: "\\ = U"and "convex U" + shows "\{C \ \. aff_dim C = aff_dim U} = U" (is "?lhs = U") +proof - + have "closed U" + using \finite \\ clo eq by blast + have "?lhs \ U" + using eq by blast + moreover have "U \ ?lhs" + proof (cases "\C \ \. aff_dim C = aff_dim U") + case True + then show ?thesis + using eq by blast + next + case False + have "closed ?lhs" + by (simp add: \finite \\ clo closed_Union) + moreover have "U \ closure ?lhs" + proof - + have "U \ closure(\{U - C |C. C \ \ \ aff_dim C < aff_dim U})" + proof (rule Baire [OF \closed U\]) + show "countable {U - C |C. C \ \ \ aff_dim C < aff_dim U}" + using \finite \\ uncountable_infinite by fastforce + have "\C. C \ \ \ openin (subtopology euclidean U) (U-C)" + by (metis Sup_upper clo closed_limpt closedin_limpt eq openin_diff openin_subtopology_self) + then show "openin (subtopology euclidean U) T \ U \ closure T" + if "T \ {U - C |C. C \ \ \ aff_dim C < aff_dim U}" for T + using that dense_complement_convex_closed \closed U\ \convex U\ by auto + qed + also have "... \ closure ?lhs" + proof - + obtain C where "C \ \" "aff_dim C < aff_dim U" + by (metis False Sup_upper aff_dim_subset eq eq_iff not_le) + have "\X. X \ \ \ aff_dim X = aff_dim U \ x \ X" + if "\V. (\C. V = U - C \ C \ \ \ aff_dim C < aff_dim U) \ x \ V" for x + proof - + have "x \ U \ x \ \\" + using \C \ \\ \aff_dim C < aff_dim U\ eq that by blast + then show ?thesis + by (metis Diff_iff Sup_upper Union_iff aff_dim_subset dual_order.order_iff_strict eq that) + qed + then show ?thesis + by (auto intro!: closure_mono) + qed + finally show ?thesis . + qed + ultimately show ?thesis + using closure_subset_eq by blast + qed + ultimately show ?thesis by blast +qed + +proposition fine_triangular_subdivision_of_cell_complex: + assumes "0 < e" "finite \" + and poly: "\C. C \ \ \ polytope C" + and aff: "\C. C \ \ \ aff_dim C = d" + and face: "\C1 C2. \C1 \ \; C2 \ \\ \ C1 \ C2 face_of C1 \ C1 \ C2 face_of C2" + obtains \ where "triangulation \" "\k. k \ \ \ diameter k < e" + "\k. k \ \ \ aff_dim k = d" "\\ = \\" + "\C. C \ \ \ \f. finite f \ f \ \ \ C = \f" + "\k. k \ \ \ \C. C \ \ \ k \ C" +proof - + obtain \ where "simplicial_complex \" + and dia\: "\K. K \ \ \ diameter K < e" + and "\\ = \\" + and in\: "\C. C \ \ \ \F. finite F \ F \ \ \ C = \F" + and in\: "\K. K \ \ \ \C. C \ \ \ K \ C" + by (blast intro: fine_simplicial_subdivision_of_cell_complex [OF \e > 0\ \finite \\ poly face]) + let ?\ = "{K \ \. aff_dim K = d}" + show thesis + proof + show "triangulation ?\" + using \simplicial_complex \\ by (auto simp: triangulation_def simplicial_complex_def) + show "diameter L < e" if "L \ {K \ \. aff_dim K = d}" for L + using that by (auto simp: dia\) + show "aff_dim L = d" if "L \ {K \ \. aff_dim K = d}" for L + using that by auto + show "\F. finite F \ F \ {K \ \. aff_dim K = d} \ C = \F" if "C \ \" for C + proof - + obtain F where "finite F" "F \ \" "C = \F" + using in\ [OF \C \ \\] by auto + show ?thesis + proof (intro exI conjI) + show "finite {K \ F. aff_dim K = d}" + by (simp add: \finite F\) + show "{K \ F. aff_dim K = d} \ {K \ \. aff_dim K = d}" + using \F \ \\ by blast + have "d = aff_dim C" + by (simp add: aff that) + moreover have "\K. K \ F \ closed K \ convex K" + using \simplicial_complex \\ \F \ \\ + unfolding simplicial_complex_def by (metis subsetCE \F \ \\ closed_simplex convex_simplex) + moreover have "convex (\F)" + using \C = \F\ poly polytope_imp_convex that by blast + ultimately show "C = \{K \ F. aff_dim K = d}" + by (simp add: convex_Union_fulldim_cells \C = \F\ \finite F\) + qed + qed + then show "\{K \ \. aff_dim K = d} = \\" + by auto (meson in\ subsetCE) + show "\C. C \ \ \ L \ C" + if "L \ {K \ \. aff_dim K = d}" for L + using that by (auto simp: in\) + qed +qed + end diff -r c61c957b0439 -r ff2e0115fea4 src/HOL/Analysis/Starlike.thy --- a/src/HOL/Analysis/Starlike.thy Fri Sep 08 11:09:56 2017 +0200 +++ b/src/HOL/Analysis/Starlike.thy Fri Sep 08 12:49:40 2017 +0100 @@ -7041,6 +7041,70 @@ by (rule that [OF 1 2 3 4 5 6]) qed + +proposition orthogonal_to_subspace_exists_gen: + fixes S :: "'a :: euclidean_space set" + assumes "span S \ span T" + obtains x where "x \ 0" "x \ span T" "\y. y \ span S \ orthogonal x y" +proof - + obtain B where "B \ span S" and orthB: "pairwise orthogonal B" + and "\x. x \ B \ norm x = 1" + and "independent B" "card B = dim S" "span B = span S" + by (rule orthonormal_basis_subspace [of "span S"]) auto + with assms obtain u where spanBT: "span B \ span T" and "u \ span B" "u \ span T" + by auto + obtain C where orthBC: "pairwise orthogonal (B \ C)" and spanBC: "span (B \ C) = span (B \ {u})" + by (blast intro: orthogonal_extension [OF orthB]) + show thesis + proof (cases "C \ insert 0 B") + case True + then have "C \ span B" + using Linear_Algebra.span_eq + by (metis span_insert_0 subset_trans) + moreover have "u \ span (B \ C)" + using \span (B \ C) = span (B \ {u})\ span_inc by force + ultimately show ?thesis + by (metis \u \ span B\ span_Un span_span sup.orderE) + next + case False + then obtain x where "x \ C" "x \ 0" "x \ B" + by blast + then have "x \ span T" + by (metis (no_types, lifting) Un_insert_right Un_upper2 \u \ span T\ spanBT spanBC \u \ span T\ insert_subset span_inc span_mono span_span subsetCE subset_trans sup_bot.comm_neutral) + moreover have "orthogonal x y" if "y \ span B" for y + using that + proof (rule span_induct) + show "subspace {a. orthogonal x a}" + by (simp add: subspace_orthogonal_to_vector) + show "\b. b \ B \ orthogonal x b" + by (metis Un_iff \x \ C\ \x \ B\ orthBC pairwise_def) + qed + ultimately show ?thesis + using \x \ 0\ that \span B = span S\ by auto + qed +qed + +corollary orthogonal_to_subspace_exists: + fixes S :: "'a :: euclidean_space set" + assumes "dim S < DIM('a)" + obtains x where "x \ 0" "\y. y \ span S \ orthogonal x y" +proof - +have "span S \ UNIV" + by (metis assms dim_eq_full less_irrefl top.not_eq_extremum) + with orthogonal_to_subspace_exists_gen [of S UNIV] that show ?thesis by auto +qed + +corollary orthogonal_to_vector_exists: + fixes x :: "'a :: euclidean_space" + assumes "2 \ DIM('a)" + obtains y where "y \ 0" "orthogonal x y" +proof - + have "dim {x} < DIM('a)" + using assms by auto + then show thesis + by (rule orthogonal_to_subspace_exists) (simp add: orthogonal_commute span_clauses(1) that) +qed + proposition orthogonal_subspace_decomp_exists: fixes S :: "'a :: euclidean_space set" obtains y z where "y \ span S" "\w. w \ span S \ orthogonal z w" "x = y + z" @@ -7202,6 +7266,119 @@ finally show "dim T \ dim S" by simp qed +subsection\Lower-dimensional affine subsets are nowhere dense.\ + +proposition dense_complement_subspace: + fixes S :: "'a :: euclidean_space set" + assumes dim_less: "dim T < dim S" and "subspace S" shows "closure(S - T) = S" +proof - + have "closure(S - U) = S" if "dim U < dim S" "U \ S" for U + proof - + have "span U \ span S" + by (metis neq_iff psubsetI span_eq_dim span_mono that) + then obtain a where "a \ 0" "a \ span S" and a: "\y. y \ span U \ orthogonal a y" + using orthogonal_to_subspace_exists_gen by metis + show ?thesis + proof + have "closed S" + by (simp add: \subspace S\ closed_subspace) + then show "closure (S - U) \ S" + by (simp add: Diff_subset closure_minimal) + show "S \ closure (S - U)" + proof (clarsimp simp: closure_approachable) + fix x and e::real + assume "x \ S" "0 < e" + show "\y\S - U. dist y x < e" + proof (cases "x \ U") + case True + let ?y = "x + (e/2 / norm a) *\<^sub>R a" + show ?thesis + proof + show "dist ?y x < e" + using \0 < e\ by (simp add: dist_norm) + next + have "?y \ S" + by (metis span_eq \a \ span S\ \x \ S\ \subspace S\ subspace_add subspace_mul) + moreover have "?y \ U" + proof - + have "e/2 / norm a \ 0" + using \0 < e\ \a \ 0\ by auto + then show ?thesis + by (metis True \a \ 0\ a orthogonal_scaleR orthogonal_self real_vector.scale_eq_0_iff span_add_eq span_clauses(1)) + qed + ultimately show "?y \ S - U" by blast + qed + next + case False + with \0 < e\ \x \ S\ show ?thesis by force + qed + qed + qed + qed + moreover have "S - S \ T = S-T" + by blast + moreover have "dim (S \ T) < dim S" + by (metis dim_less dim_subset inf.cobounded2 inf.orderE inf.strict_boundedE not_le) + ultimately show ?thesis + by force +qed + +corollary dense_complement_affine: + fixes S :: "'a :: euclidean_space set" + assumes less: "aff_dim T < aff_dim S" and "affine S" shows "closure(S - T) = S" +proof (cases "S \ T = {}") + case True + then show ?thesis + by (metis Diff_triv affine_hull_eq \affine S\ closure_same_affine_hull closure_subset hull_subset subset_antisym) +next + case False + then obtain z where z: "z \ S \ T" by blast + then have "subspace (op + (- z) ` S)" + by (meson IntD1 affine_diffs_subspace \affine S\) + moreover have "int (dim (op + (- z) ` T)) < int (dim (op + (- z) ` S))" + using z less by (simp add: aff_dim_eq_dim [symmetric] hull_inc) + ultimately have "closure((op + (- z) ` S) - (op + (- z) ` T)) = (op + (- z) ` S)" + by (simp add: dense_complement_subspace) + then show ?thesis + by (metis closure_translation translation_diff translation_invert) +qed + +corollary dense_complement_openin_affine_hull: + fixes S :: "'a :: euclidean_space set" + assumes less: "aff_dim T < aff_dim S" + and ope: "openin (subtopology euclidean (affine hull S)) S" + shows "closure(S - T) = closure S" +proof - + have "affine hull S - T \ affine hull S" + by blast + then have "closure (S \ closure (affine hull S - T)) = closure (S \ (affine hull S - T))" + by (rule closure_openin_Int_closure [OF ope]) + then show ?thesis + by (metis Int_Diff aff_dim_affine_hull affine_affine_hull dense_complement_affine hull_subset inf.orderE less) +qed + +corollary dense_complement_convex: + fixes S :: "'a :: euclidean_space set" + assumes "aff_dim T < aff_dim S" "convex S" + shows "closure(S - T) = closure S" +proof + show "closure (S - T) \ closure S" + by (simp add: Diff_subset closure_mono) + have "closure (rel_interior S - T) = closure (rel_interior S)" + apply (rule dense_complement_openin_affine_hull) + apply (simp add: assms rel_interior_aff_dim) + using \convex S\ rel_interior_rel_open rel_open by blast + then show "closure S \ closure (S - T)" + by (metis Diff_mono \convex S\ closure_mono convex_closure_rel_interior order_refl rel_interior_subset) +qed + +corollary dense_complement_convex_closed: + fixes S :: "'a :: euclidean_space set" + assumes "aff_dim T < aff_dim S" "convex S" "closed S" + shows "closure(S - T) = S" + by (simp add: assms dense_complement_convex) + + subsection\Parallel slices, etc.\ text\ If we take a slice out of a set, we can do it perpendicularly, diff -r c61c957b0439 -r ff2e0115fea4 src/HOL/Analysis/Topology_Euclidean_Space.thy --- a/src/HOL/Analysis/Topology_Euclidean_Space.thy Fri Sep 08 11:09:56 2017 +0200 +++ b/src/HOL/Analysis/Topology_Euclidean_Space.thy Fri Sep 08 12:49:40 2017 +0100 @@ -2356,6 +2356,28 @@ done qed +lemma closure_openin_Int_closure: + assumes ope: "openin (subtopology euclidean U) S" and "T \ U" + shows "closure(S \ closure T) = closure(S \ T)" +proof + obtain V where "open V" and S: "S = U \ V" + using ope using openin_open by metis + show "closure (S \ closure T) \ closure (S \ T)" + proof (clarsimp simp: S) + fix x + assume "x \ closure (U \ V \ closure T)" + then have "V \ closure T \ A \ x \ closure A" for A + by (metis closure_mono subsetD inf.coboundedI2 inf_assoc) + then have "x \ closure (T \ V)" + by (metis \open V\ closure_closure inf_commute open_Int_closure_subset) + then show "x \ closure (U \ V \ T)" + by (metis \T \ U\ inf.absorb_iff2 inf_assoc inf_commute) + qed +next + show "closure (S \ T) \ closure (S \ closure T)" + by (meson Int_mono closure_mono closure_subset order_refl) +qed + lemma islimpt_in_closure: "(x islimpt S) = (x:closure(S-{x}))" unfolding closure_def using islimpt_punctured by blast @@ -3520,6 +3542,12 @@ apply (metis dist_self) done +lemma closure_approachable_le: + fixes S :: "'a::metric_space set" + shows "x \ closure S \ (\e>0. \y\S. dist y x \ e)" + unfolding closure_approachable + using dense by force + lemma closed_approachable: fixes S :: "'a::metric_space set" shows "closed S \ (\e>0. \y\S. dist y x < e) \ x \ S" @@ -3544,6 +3572,17 @@ then show ?thesis unfolding closure_approachable by auto qed +lemma closure_Int_ballI: + fixes S :: "'a :: metric_space set" + assumes "\U. \openin (subtopology euclidean S) U; U \ {}\ \ T \ U \ {}" + shows "S \ closure T" +proof (clarsimp simp: closure_approachable dist_commute) + fix x and e::real + assume "x \ S" "0 < e" + with assms [of "S \ ball x e"] show "\y\T. dist x y < e" + by force +qed + lemma closed_contains_Inf: fixes S :: "real set" shows "S \ {} \ bdd_below S \ closed S \ Inf S \ S" @@ -4802,6 +4841,11 @@ by (simp add: closure_subset open_Compl) qed +corollary closure_Int_ball_not_empty: + assumes "S \ closure T" "x \ S" "r > 0" + shows "T \ ball x r \ {}" + using assms centre_in_ball closure_iff_nhds_not_empty by blast + lemma compact_filter: "compact U \ (\F. F \ bot \ eventually (\x. x \ U) F \ (\x\U. inf (nhds x) F \ bot))" proof (intro allI iffI impI compact_fip[THEN iffD2] notI) @@ -5630,6 +5674,115 @@ done qed +text\The Baire propery of dense sets\ +theorem Baire: + fixes S::"'a::{real_normed_vector,heine_borel} set" + assumes "closed S" "countable \" + and ope: "\T. T \ \ \ openin (subtopology euclidean S) T \ S \ closure T" + shows "S \ closure(\\)" +proof (cases "\ = {}") + case True + then show ?thesis + using closure_subset by auto +next + let ?g = "from_nat_into \" + case False + then have gin: "?g n \ \" for n + by (simp add: from_nat_into) + show ?thesis + proof (clarsimp simp: closure_approachable) + fix x and e::real + assume "x \ S" "0 < e" + obtain TF where opeF: "\n. openin (subtopology euclidean S) (TF n)" + and ne: "\n. TF n \ {}" + and subg: "\n. S \ closure(TF n) \ ?g n" + and subball: "\n. closure(TF n) \ ball x e" + and decr: "\n. TF(Suc n) \ TF n" + proof - + have *: "\Y. (openin (subtopology euclidean S) Y \ Y \ {} \ + S \ closure Y \ ?g n \ closure Y \ ball x e) \ Y \ U" + if opeU: "openin (subtopology euclidean S) U" and "U \ {}" and cloU: "closure U \ ball x e" for U n + proof - + obtain T where T: "open T" "U = T \ S" + using \openin (subtopology euclidean S) U\ by (auto simp: openin_subtopology) + with \U \ {}\ have "T \ closure (?g n) \ {}" + using gin ope by fastforce + then have "T \ ?g n \ {}" + using \open T\ open_Int_closure_eq_empty by blast + then obtain y where "y \ U" "y \ ?g n" + using T ope [of "?g n", OF gin] by (blast dest: openin_imp_subset) + moreover have "openin (subtopology euclidean S) (U \ ?g n)" + using gin ope opeU by blast + ultimately obtain d where U: "U \ ?g n \ S" and "d > 0" and d: "ball y d \ S \ U \ ?g n" + by (force simp add: openin_contains_ball) + show ?thesis + proof (intro exI conjI) + show "openin (subtopology euclidean S) (S \ ball y (d/2))" + by (simp add: openin_open_Int) + show "S \ ball y (d/2) \ {}" + using \0 < d\ \y \ U\ opeU openin_imp_subset by fastforce + have "S \ closure (S \ ball y (d/2)) \ S \ closure (ball y (d/2))" + using closure_mono by blast + also have "... \ ?g n" + using \d > 0\ d by force + finally show "S \ closure (S \ ball y (d/2)) \ ?g n" . + have "closure (S \ ball y (d/2)) \ S \ ball y d" + proof - + have "closure (ball y (d/2)) \ ball y d" + using \d > 0\ by auto + then have "closure (S \ ball y (d/2)) \ ball y d" + by (meson closure_mono inf.cobounded2 subset_trans) + then show ?thesis + by (simp add: \closed S\ closure_minimal) + qed + also have "... \ ball x e" + using cloU closure_subset d by blast + finally show "closure (S \ ball y (d/2)) \ ball x e" . + show "S \ ball y (d/2) \ U" + using ball_divide_subset_numeral d by blast + qed + qed + let ?\ = "\n X. openin (subtopology euclidean S) X \ X \ {} \ + S \ closure X \ ?g n \ closure X \ ball x e" + have "closure (S \ ball x (e / 2)) \ closure(ball x (e/2))" + by (simp add: closure_mono) + also have "... \ ball x e" + using \e > 0\ by auto + finally have "closure (S \ ball x (e / 2)) \ ball x e" . + moreover have"openin (subtopology euclidean S) (S \ ball x (e / 2))" "S \ ball x (e / 2) \ {}" + using \0 < e\ \x \ S\ by auto + ultimately obtain Y where Y: "?\ 0 Y \ Y \ S \ ball x (e / 2)" + using * [of "S \ ball x (e/2)" 0] by metis + show thesis + proof (rule exE [OF dependent_nat_choice [of ?\ "\n X Y. Y \ X"]]) + show "\x. ?\ 0 x" + using Y by auto + show "\Y. ?\ (Suc n) Y \ Y \ X" if "?\ n X" for X n + using that by (blast intro: *) + qed (use that in metis) + qed + have "(\n. S \ closure (TF n)) \ {}" + proof (rule compact_nest) + show "\n. compact (S \ closure (TF n))" + by (metis closed_closure subball bounded_subset_ballI compact_eq_bounded_closed closed_Int_compact [OF \closed S\]) + show "\n. S \ closure (TF n) \ {}" + by (metis Int_absorb1 opeF \closed S\ closure_eq_empty closure_minimal ne openin_imp_subset) + show "\m n. m \ n \ S \ closure (TF n) \ S \ closure (TF m)" + by (meson closure_mono decr dual_order.refl inf_mono lift_Suc_antimono_le) + qed + moreover have "(\n. S \ closure (TF n)) \ {y \ \\. dist y x < e}" + proof (clarsimp, intro conjI) + fix y + assume "y \ S" and y: "\n. y \ closure (TF n)" + then show "\T\\. y \ T" + by (metis Int_iff from_nat_into_surj [OF \countable \\] set_mp subg) + show "dist y x < e" + by (metis y dist_commute mem_ball subball subsetCE) + qed + ultimately show "\y \ \\. dist y x < e" + by auto + qed +qed subsubsection \Completeness\