src/HOL/Topological_Spaces.thy
changeset 63332 f164526d8727
parent 63317 ca187a9f66da
child 63494 ac0a3b9c6dae
equal deleted inserted replaced
63331:247eac9758dd 63332:f164526d8727
     4 *)
     4 *)
     5 
     5 
     6 section \<open>Topological Spaces\<close>
     6 section \<open>Topological Spaces\<close>
     7 
     7 
     8 theory Topological_Spaces
     8 theory Topological_Spaces
     9 imports Main Conditionally_Complete_Lattices
     9 imports Main
    10 begin
    10 begin
    11 
    11 
    12 named_theorems continuous_intros "structural introduction rules for continuity"
    12 named_theorems continuous_intros "structural introduction rules for continuity"
    13 
    13 
    14 subsection \<open>Topological space\<close>
    14 subsection \<open>Topological space\<close>
  1799 qed (metis filterlim_iff tendsto_at_iff_tendsto_nhds isCont_def eventually_filtermap cont)
  1799 qed (metis filterlim_iff tendsto_at_iff_tendsto_nhds isCont_def eventually_filtermap cont)
  1800 
  1800 
  1801 lemma continuous_at_split:
  1801 lemma continuous_at_split:
  1802   "continuous (at (x::'a::linorder_topology)) f = (continuous (at_left x) f \<and> continuous (at_right x) f)"
  1802   "continuous (at (x::'a::linorder_topology)) f = (continuous (at_left x) f \<and> continuous (at_right x) f)"
  1803   by (simp add: continuous_within filterlim_at_split)
  1803   by (simp add: continuous_within filterlim_at_split)
       
  1804 
       
  1805 (* The following open/closed Collect lemmas are ported from Sébastien Gouëzel's Ergodic_Theory *)
       
  1806 lemma open_Collect_neq:
       
  1807   fixes f g :: "'a :: topological_space \<Rightarrow> 'b::t2_space"
       
  1808   assumes f: "continuous_on UNIV f" and g: "continuous_on UNIV g"
       
  1809   shows "open {x. f x \<noteq> g x}"
       
  1810 proof (rule openI)
       
  1811   fix t assume "t \<in> {x. f x \<noteq> g x}"
       
  1812   then obtain U V where *: "open U" "open V" "f t \<in> U" "g t \<in> V" "U \<inter> V = {}"
       
  1813     by (auto simp add: separation_t2)
       
  1814   with open_vimage[OF \<open>open U\<close> f] open_vimage[OF \<open>open V\<close> g]
       
  1815   show "\<exists>T. open T \<and> t \<in> T \<and> T \<subseteq> {x. f x \<noteq> g x}"
       
  1816     by (intro exI[of _ "f -` U \<inter> g -` V"]) auto
       
  1817 qed
       
  1818 
       
  1819 lemma closed_Collect_eq:
       
  1820   fixes f g :: "'a :: topological_space \<Rightarrow> 'b::t2_space"
       
  1821   assumes f: "continuous_on UNIV f" and g: "continuous_on UNIV g"
       
  1822   shows "closed {x. f x = g x}"
       
  1823   using open_Collect_neq[OF f g] by (simp add: closed_def Collect_neg_eq)
       
  1824 
       
  1825 lemma open_Collect_less:
       
  1826   fixes f g :: "'a :: topological_space \<Rightarrow> 'b::linorder_topology"
       
  1827   assumes f: "continuous_on UNIV f" and g: "continuous_on UNIV g"
       
  1828   shows "open {x. f x < g x}"
       
  1829 proof (rule openI)
       
  1830   fix t assume t: "t \<in> {x. f x < g x}"
       
  1831   show "\<exists>T. open T \<and> t \<in> T \<and> T \<subseteq> {x. f x < g x}"
       
  1832   proof (cases)
       
  1833     assume "\<exists>z. f t < z \<and> z < g t"
       
  1834     then obtain z where z: "f t < z \<and> z < g t" by blast
       
  1835     then show ?thesis
       
  1836       using open_vimage[OF _ f, of "{..< z}"] open_vimage[OF _ g, of "{z <..}"]
       
  1837       by (intro exI[of _ "f -` {..<z} \<inter> g -` {z<..}"]) auto
       
  1838   next
       
  1839     assume "\<not>(\<exists>z. f t < z \<and> z < g t)"
       
  1840     then have *: "{g t ..} = {f t <..}" "{..< g t} = {.. f t}"
       
  1841       using t by (auto intro: leI)
       
  1842     show ?thesis
       
  1843       using open_vimage[OF _ f, of "{..< g t}"] open_vimage[OF _ g, of "{f t <..}"] t
       
  1844       apply (intro exI[of _ "f -` {..< g t} \<inter> g -` {f t<..}"])
       
  1845       apply (simp add: open_Int)
       
  1846       apply (auto simp add: *)
       
  1847       done
       
  1848   qed
       
  1849 qed
       
  1850 
       
  1851 lemma closed_Collect_le:
       
  1852   fixes f g :: "'a :: topological_space \<Rightarrow> 'b::linorder_topology"
       
  1853   assumes f: "continuous_on UNIV f" and g: "continuous_on UNIV g"
       
  1854   shows "closed {x. f x \<le> g x}"
       
  1855   using open_Collect_less[OF g f] by (simp add: closed_def Collect_neg_eq[symmetric] not_le)
  1804 
  1856 
  1805 subsubsection \<open>Open-cover compactness\<close>
  1857 subsubsection \<open>Open-cover compactness\<close>
  1806 
  1858 
  1807 context topological_space
  1859 context topological_space
  1808 begin
  1860 begin