src/HOL/Analysis/Connected.thy
changeset 70136 f03a01a18c6e
parent 69922 4a9167f377b0
child 71137 3c0a26b8b49a
equal deleted inserted replaced
70135:ad6d4a14adb5 70136:f03a01a18c6e
     7 theory Connected
     7 theory Connected
     8   imports
     8   imports
     9     Abstract_Topology_2
     9     Abstract_Topology_2
    10 begin
    10 begin
    11 
    11 
    12 subsection%unimportant \<open>Connectedness\<close>
    12 subsection\<^marker>\<open>tag unimportant\<close> \<open>Connectedness\<close>
    13 
    13 
    14 lemma connected_local:
    14 lemma connected_local:
    15  "connected S \<longleftrightarrow>
    15  "connected S \<longleftrightarrow>
    16   \<not> (\<exists>e1 e2.
    16   \<not> (\<exists>e1 e2.
    17       openin (top_of_set S) e1 \<and>
    17       openin (top_of_set S) e1 \<and>
    66     by (simp add: th0 th1)
    66     by (simp add: th0 th1)
    67 qed
    67 qed
    68 
    68 
    69 subsection \<open>Connected components, considered as a connectedness relation or a set\<close>
    69 subsection \<open>Connected components, considered as a connectedness relation or a set\<close>
    70 
    70 
    71 definition%important "connected_component s x y \<equiv> \<exists>t. connected t \<and> t \<subseteq> s \<and> x \<in> t \<and> y \<in> t"
    71 definition\<^marker>\<open>tag important\<close> "connected_component s x y \<equiv> \<exists>t. connected t \<and> t \<subseteq> s \<and> x \<in> t \<and> y \<in> t"
    72 
    72 
    73 abbreviation "connected_component_set s x \<equiv> Collect (connected_component s x)"
    73 abbreviation "connected_component_set s x \<equiv> Collect (connected_component s x)"
    74 
    74 
    75 lemma connected_componentI:
    75 lemma connected_componentI:
    76   "connected t \<Longrightarrow> t \<subseteq> s \<Longrightarrow> x \<in> t \<Longrightarrow> y \<in> t \<Longrightarrow> connected_component s x y"
    76   "connected t \<Longrightarrow> t \<subseteq> s \<Longrightarrow> x \<in> t \<Longrightarrow> y \<in> t \<Longrightarrow> connected_component s x y"
   266   using connected_component_eq_empty by blast
   266   using connected_component_eq_empty by blast
   267 
   267 
   268 
   268 
   269 subsection \<open>The set of connected components of a set\<close>
   269 subsection \<open>The set of connected components of a set\<close>
   270 
   270 
   271 definition%important components:: "'a::topological_space set \<Rightarrow> 'a set set"
   271 definition\<^marker>\<open>tag important\<close> components:: "'a::topological_space set \<Rightarrow> 'a set set"
   272   where "components s \<equiv> connected_component_set s ` s"
   272   where "components s \<equiv> connected_component_set s ` s"
   273 
   273 
   274 lemma components_iff: "s \<in> components u \<longleftrightarrow> (\<exists>x. x \<in> u \<and> s = connected_component_set u x)"
   274 lemma components_iff: "s \<in> components u \<longleftrightarrow> (\<exists>x. x \<in> u \<and> s = connected_component_set u x)"
   275   by (auto simp: components_def)
   275   by (auto simp: components_def)
   276 
   276 
   425 lemma closedin_component:
   425 lemma closedin_component:
   426    "C \<in> components s \<Longrightarrow> closedin (top_of_set s) C"
   426    "C \<in> components s \<Longrightarrow> closedin (top_of_set s) C"
   427   using closedin_connected_component componentsE by blast
   427   using closedin_connected_component componentsE by blast
   428 
   428 
   429 
   429 
   430 subsection%unimportant \<open>Proving a function is constant on a connected set
   430 subsection\<^marker>\<open>tag unimportant\<close> \<open>Proving a function is constant on a connected set
   431   by proving that a level set is open\<close>
   431   by proving that a level set is open\<close>
   432 
   432 
   433 lemma continuous_levelset_openin_cases:
   433 lemma continuous_levelset_openin_cases:
   434   fixes f :: "_ \<Rightarrow> 'b::t1_space"
   434   fixes f :: "_ \<Rightarrow> 'b::t1_space"
   435   shows "connected s \<Longrightarrow> continuous_on s f \<Longrightarrow>
   435   shows "connected s \<Longrightarrow> continuous_on s f \<Longrightarrow>
   456   using continuous_levelset_openin[OF assms(1,2), of a, unfolded openin_open]
   456   using continuous_levelset_openin[OF assms(1,2), of a, unfolded openin_open]
   457   using assms (3,4)
   457   using assms (3,4)
   458   by fast
   458   by fast
   459 
   459 
   460 
   460 
   461 subsection%unimportant \<open>Preservation of Connectedness\<close>
   461 subsection\<^marker>\<open>tag unimportant\<close> \<open>Preservation of Connectedness\<close>
   462 
   462 
   463 lemma homeomorphic_connectedness:
   463 lemma homeomorphic_connectedness:
   464   assumes "s homeomorphic t"
   464   assumes "s homeomorphic t"
   465   shows "connected s \<longleftrightarrow> connected t"
   465   shows "connected s \<longleftrightarrow> connected t"
   466 using assms unfolding homeomorphic_def homeomorphism_def by (metis connected_continuous_image)
   466 using assms unfolding homeomorphic_def homeomorphism_def by (metis connected_continuous_image)
   686     using * [of "S \<inter> H3" "S \<inter> H4"] \<open>H3 \<inter> H4 = {}\<close> \<open>C \<subseteq> U - S\<close> \<open>H3 \<union> H4 = U - C\<close> \<open>S \<subseteq> U\<close> 
   686     using * [of "S \<inter> H3" "S \<inter> H4"] \<open>H3 \<inter> H4 = {}\<close> \<open>C \<subseteq> U - S\<close> \<open>H3 \<union> H4 = U - C\<close> \<open>S \<subseteq> U\<close> 
   687     by auto
   687     by auto
   688 qed
   688 qed
   689 
   689 
   690 
   690 
   691 subsection%unimportant\<open>Constancy of a function from a connected set into a finite, disconnected or discrete set\<close>
   691 subsection\<^marker>\<open>tag unimportant\<close>\<open>Constancy of a function from a connected set into a finite, disconnected or discrete set\<close>
   692 
   692 
   693 text\<open>Still missing: versions for a set that is smaller than R, or countable.\<close>
   693 text\<open>Still missing: versions for a set that is smaller than R, or countable.\<close>
   694 
   694 
   695 lemma continuous_disconnected_range_constant:
   695 lemma continuous_disconnected_range_constant:
   696   assumes S: "connected S"
   696   assumes S: "connected S"