diff -r 261d42f0bfac -r 979cdfdf7a79 src/HOL/Topological_Spaces.thy --- a/src/HOL/Topological_Spaces.thy Mon Oct 17 15:20:06 2016 +0200 +++ b/src/HOL/Topological_Spaces.thy Thu Oct 13 18:36:06 2016 +0200 @@ -1440,6 +1440,42 @@ at_within_def eventually_nhds_within_iff_sequentially comp_def by metis +lemma approx_from_above_dense_linorder: + fixes x::"'a::{dense_linorder, linorder_topology, first_countable_topology}" + assumes "x < y" + shows "\u. (\n. u n > x) \ (u \ x)" +proof - + obtain A :: "nat \ 'a set" where A: "\i. open (A i)" "\i. x \ A i" + "\F. (\n. F n \ A n) \ F \ x" + by (metis first_countable_topology_class.countable_basis) + define u where "u = (\n. SOME z. z \ A n \ z > x)" + have "\z. z \ U \ x < z" if "x \ U" "open U" for U + using open_right[OF `open U` `x \ U` `x < y`] + by (meson atLeastLessThan_iff dense less_imp_le subset_eq) + then have *: "u n \ A n \ x < u n" for n + using `x \ A n` `open (A n)` unfolding u_def by (metis (no_types, lifting) someI_ex) + then have "u \ x" using A(3) by simp + then show ?thesis using * by auto +qed + +lemma approx_from_below_dense_linorder: + fixes x::"'a::{dense_linorder, linorder_topology, first_countable_topology}" + assumes "x > y" + shows "\u. (\n. u n < x) \ (u \ x)" +proof - + obtain A :: "nat \ 'a set" where A: "\i. open (A i)" "\i. x \ A i" + "\F. (\n. F n \ A n) \ F \ x" + by (metis first_countable_topology_class.countable_basis) + define u where "u = (\n. SOME z. z \ A n \ z < x)" + have "\z. z \ U \ z < x" if "x \ U" "open U" for U + using open_left[OF `open U` `x \ U` `x > y`] + by (meson dense greaterThanAtMost_iff less_imp_le subset_eq) + then have *: "u n \ A n \ u n < x" for n + using `x \ A n` `open (A n)` unfolding u_def by (metis (no_types, lifting) someI_ex) + then have "u \ x" using A(3) by simp + then show ?thesis using * by auto +qed + subsection \Function limit at a point\