src/HOL/Analysis/Topology_Euclidean_Space.thy
changeset 64758 3b33d2fc5fc0
parent 64539 a868c83aa66e
child 64773 223b2ebdda79
equal deleted inserted replaced
64757:7e3924224769 64758:3b33d2fc5fc0
   792 
   792 
   793 lemma subtopology_UNIV[simp]: "subtopology U UNIV = U"
   793 lemma subtopology_UNIV[simp]: "subtopology U UNIV = U"
   794   by (simp add: subtopology_superset)
   794   by (simp add: subtopology_superset)
   795 
   795 
   796 lemma openin_subtopology_empty:
   796 lemma openin_subtopology_empty:
   797    "openin (subtopology U {}) s \<longleftrightarrow> s = {}"
   797    "openin (subtopology U {}) S \<longleftrightarrow> S = {}"
   798 by (metis Int_empty_right openin_empty openin_subtopology)
   798 by (metis Int_empty_right openin_empty openin_subtopology)
   799 
   799 
   800 lemma closedin_subtopology_empty:
   800 lemma closedin_subtopology_empty:
   801    "closedin (subtopology U {}) s \<longleftrightarrow> s = {}"
   801    "closedin (subtopology U {}) S \<longleftrightarrow> S = {}"
   802 by (metis Int_empty_right closedin_empty closedin_subtopology)
   802 by (metis Int_empty_right closedin_empty closedin_subtopology)
   803 
   803 
   804 lemma closedin_subtopology_refl:
   804 lemma closedin_subtopology_refl [simp]:
   805    "closedin (subtopology U u) u \<longleftrightarrow> u \<subseteq> topspace U"
   805    "closedin (subtopology U X) X \<longleftrightarrow> X \<subseteq> topspace U"
   806 by (metis closedin_def closedin_topspace inf.absorb_iff2 le_inf_iff topspace_subtopology)
   806 by (metis closedin_def closedin_topspace inf.absorb_iff2 le_inf_iff topspace_subtopology)
   807 
   807 
   808 lemma openin_imp_subset:
   808 lemma openin_imp_subset:
   809    "openin (subtopology U s) t \<Longrightarrow> t \<subseteq> s"
   809    "openin (subtopology U S) T \<Longrightarrow> T \<subseteq> S"
   810 by (metis Int_iff openin_subtopology subsetI)
   810 by (metis Int_iff openin_subtopology subsetI)
   811 
   811 
   812 lemma closedin_imp_subset:
   812 lemma closedin_imp_subset:
   813    "closedin (subtopology U s) t \<Longrightarrow> t \<subseteq> s"
   813    "closedin (subtopology U S) T \<Longrightarrow> T \<subseteq> S"
   814 by (simp add: closedin_def topspace_subtopology)
   814 by (simp add: closedin_def topspace_subtopology)
   815 
   815 
   816 lemma openin_subtopology_Un:
   816 lemma openin_subtopology_Un:
   817     "openin (subtopology U t) s \<and> openin (subtopology U u) s
   817     "openin (subtopology U T) S \<and> openin (subtopology U u) S
   818      \<Longrightarrow> openin (subtopology U (t \<union> u)) s"
   818      \<Longrightarrow> openin (subtopology U (T \<union> u)) S"
   819 by (simp add: openin_subtopology) blast
   819 by (simp add: openin_subtopology) blast
   820 
   820 
   821 
   821 
   822 subsubsection \<open>The standard Euclidean topology\<close>
   822 subsubsection \<open>The standard Euclidean topology\<close>
   823 
   823 
  1059   by (simp add: subset_eq)
  1059   by (simp add: subset_eq)
  1060 
  1060 
  1061 lemma sphere_cball [simp,intro]: "sphere z r \<subseteq> cball z r"
  1061 lemma sphere_cball [simp,intro]: "sphere z r \<subseteq> cball z r"
  1062   by force
  1062   by force
  1063 
  1063 
       
  1064 lemma cball_diff_sphere: "cball a r - sphere a r = ball a r"
       
  1065   by auto
       
  1066 
  1064 lemma subset_ball[intro]: "d \<le> e \<Longrightarrow> ball x d \<subseteq> ball x e"
  1067 lemma subset_ball[intro]: "d \<le> e \<Longrightarrow> ball x d \<subseteq> ball x e"
  1065   by (simp add: subset_eq)
  1068   by (simp add: subset_eq)
  1066 
  1069 
  1067 lemma subset_cball[intro]: "d \<le> e \<Longrightarrow> cball x d \<subseteq> cball x e"
  1070 lemma subset_cball[intro]: "d \<le> e \<Longrightarrow> cball x d \<subseteq> cball x e"
  1068   by (simp add: subset_eq)
  1071   by (simp add: subset_eq)
  1069 
  1072 
  1070 lemma ball_max_Un: "ball a (max r s) = ball a r \<union> ball a s"
  1073 lemma ball_max_Un: "ball a (max r s) = ball a r \<union> ball a s"
  1071   by (simp add: set_eq_iff) arith
  1074   by (simp add: set_eq_iff) arith
  1072 
  1075 
  1073 lemma ball_min_Int: "ball a (min r s) = ball a r \<inter> ball a s"
  1076 lemma ball_min_Int: "ball a (min r s) = ball a r \<inter> ball a s"
       
  1077   by (simp add: set_eq_iff)
       
  1078 
       
  1079 lemma cball_max_Un: "cball a (max r s) = cball a r \<union> cball a s"
       
  1080   by (simp add: set_eq_iff) arith
       
  1081 
       
  1082 lemma cball_min_Int: "cball a (min r s) = cball a r \<inter> cball a s"
  1074   by (simp add: set_eq_iff)
  1083   by (simp add: set_eq_iff)
  1075 
  1084 
  1076 lemma cball_diff_eq_sphere: "cball a r - ball a r =  {x. dist x a = r}"
  1085 lemma cball_diff_eq_sphere: "cball a r - ball a r =  {x. dist x a = r}"
  1077   by (auto simp: cball_def ball_def dist_commute)
  1086   by (auto simp: cball_def ball_def dist_commute)
  1078 
  1087 
  2460         "\<lbrakk>connected_component_set u a \<subseteq> t; t \<subseteq> u\<rbrakk>
  2469         "\<lbrakk>connected_component_set u a \<subseteq> t; t \<subseteq> u\<rbrakk>
  2461         \<Longrightarrow> connected_component_set t a = connected_component_set u a"
  2470         \<Longrightarrow> connected_component_set t a = connected_component_set u a"
  2462   apply (case_tac "a \<in> u")
  2471   apply (case_tac "a \<in> u")
  2463   apply (simp add: connected_component_maximal connected_component_mono subset_antisym)
  2472   apply (simp add: connected_component_maximal connected_component_mono subset_antisym)
  2464   using connected_component_eq_empty by blast
  2473   using connected_component_eq_empty by blast
       
  2474 
       
  2475 proposition connected_Times:
       
  2476   assumes S: "connected S" and T: "connected T"
       
  2477   shows "connected (S \<times> T)"
       
  2478 proof (clarsimp simp add: connected_iff_connected_component)
       
  2479   fix x y x' y'
       
  2480   assume xy: "x \<in> S" "y \<in> T" "x' \<in> S" "y' \<in> T"
       
  2481   with xy obtain U V where U: "connected U" "U \<subseteq> S" "x \<in> U" "x' \<in> U"
       
  2482                        and V: "connected V" "V \<subseteq> T" "y \<in> V" "y' \<in> V"
       
  2483     using S T \<open>x \<in> S\<close> \<open>x' \<in> S\<close> by blast+
       
  2484   show "connected_component (S \<times> T) (x, y) (x', y')"
       
  2485     unfolding connected_component_def
       
  2486   proof (intro exI conjI)
       
  2487     show "connected ((\<lambda>x. (x, y)) ` U \<union> Pair x' ` V)"
       
  2488     proof (rule connected_Un)
       
  2489       have "continuous_on U (\<lambda>x. (x, y))"
       
  2490         by (intro continuous_intros)
       
  2491       then show "connected ((\<lambda>x. (x, y)) ` U)"
       
  2492         by (rule connected_continuous_image) (rule \<open>connected U\<close>)
       
  2493       have "continuous_on V (Pair x')"
       
  2494         by (intro continuous_intros)
       
  2495       then show "connected (Pair x' ` V)"
       
  2496         by (rule connected_continuous_image) (rule \<open>connected V\<close>)
       
  2497     qed (use U V in auto)
       
  2498   qed (use U V in auto)
       
  2499 qed
       
  2500 
       
  2501 corollary connected_Times_eq [simp]:
       
  2502    "connected (S \<times> T) \<longleftrightarrow> S = {} \<or> T = {} \<or> connected S \<and> connected T"  (is "?lhs = ?rhs")
       
  2503 proof
       
  2504   assume L: ?lhs
       
  2505   show ?rhs
       
  2506   proof (cases "S = {} \<or> T = {}")
       
  2507     case True
       
  2508     then show ?thesis by auto
       
  2509   next
       
  2510     case False
       
  2511     have "connected (fst ` (S \<times> T))" "connected (snd ` (S \<times> T))"
       
  2512       using continuous_on_fst continuous_on_snd continuous_on_id
       
  2513       by (blast intro: connected_continuous_image [OF _ L])+
       
  2514     with False show ?thesis
       
  2515       by auto
       
  2516   qed
       
  2517 next
       
  2518   assume ?rhs
       
  2519   then show ?lhs
       
  2520     by (auto simp: connected_Times)
       
  2521 qed
  2465 
  2522 
  2466 
  2523 
  2467 subsection \<open>The set of connected components of a set\<close>
  2524 subsection \<open>The set of connected components of a set\<close>
  2468 
  2525 
  2469 definition components:: "'a::topological_space set \<Rightarrow> 'a set set"
  2526 definition components:: "'a::topological_space set \<Rightarrow> 'a set set"
  7238   fix C
  7295   fix C
  7239   assume "compact S" and "\<forall>c\<in>C. openin (subtopology euclidean S) c" and "S \<subseteq> \<Union>C"
  7296   assume "compact S" and "\<forall>c\<in>C. openin (subtopology euclidean S) c" and "S \<subseteq> \<Union>C"
  7240   then have "\<forall>c\<in>{T. open T \<and> S \<inter> T \<in> C}. open c" and "S \<subseteq> \<Union>{T. open T \<and> S \<inter> T \<in> C}"
  7297   then have "\<forall>c\<in>{T. open T \<and> S \<inter> T \<in> C}. open c" and "S \<subseteq> \<Union>{T. open T \<and> S \<inter> T \<in> C}"
  7241     unfolding openin_open by force+
  7298     unfolding openin_open by force+
  7242   with \<open>compact S\<close> obtain D where "D \<subseteq> {T. open T \<and> S \<inter> T \<in> C}" and "finite D" and "S \<subseteq> \<Union>D"
  7299   with \<open>compact S\<close> obtain D where "D \<subseteq> {T. open T \<and> S \<inter> T \<in> C}" and "finite D" and "S \<subseteq> \<Union>D"
  7243     by (rule compactE)
  7300     by (meson compactE)
  7244   then have "image (\<lambda>T. S \<inter> T) D \<subseteq> C \<and> finite (image (\<lambda>T. S \<inter> T) D) \<and> S \<subseteq> \<Union>(image (\<lambda>T. S \<inter> T) D)"
  7301   then have "image (\<lambda>T. S \<inter> T) D \<subseteq> C \<and> finite (image (\<lambda>T. S \<inter> T) D) \<and> S \<subseteq> \<Union>(image (\<lambda>T. S \<inter> T) D)"
  7245     by auto
  7302     by auto
  7246   then show "\<exists>D\<subseteq>C. finite D \<and> S \<subseteq> \<Union>D" ..
  7303   then show "\<exists>D\<subseteq>C. finite D \<and> S \<subseteq> \<Union>D" ..
  7247 next
  7304 next
  7248   assume 1: "\<forall>C. (\<forall>c\<in>C. openin (subtopology euclidean S) c) \<and> S \<subseteq> \<Union>C \<longrightarrow>
  7305   assume 1: "\<forall>C. (\<forall>c\<in>C. openin (subtopology euclidean S) c) \<and> S \<subseteq> \<Union>C \<longrightarrow>
 10187   then obtain X0 Y where
 10244   then obtain X0 Y where
 10188     *: "\<forall>y \<in> K. open (X0 y) \<and> open (Y y) \<and> x0 \<in> X0 y \<and> y \<in> Y y \<and> X0 y \<times> Y y \<subseteq> W"
 10245     *: "\<forall>y \<in> K. open (X0 y) \<and> open (Y y) \<and> x0 \<in> X0 y \<and> y \<in> Y y \<and> X0 y \<times> Y y \<subseteq> W"
 10189     by metis
 10246     by metis
 10190   from * have "\<forall>t\<in>Y ` K. open t" "K \<subseteq> \<Union>(Y ` K)" by auto
 10247   from * have "\<forall>t\<in>Y ` K. open t" "K \<subseteq> \<Union>(Y ` K)" by auto
 10191   with \<open>compact K\<close> obtain CC where CC: "CC \<subseteq> Y ` K" "finite CC" "K \<subseteq> \<Union>CC"
 10248   with \<open>compact K\<close> obtain CC where CC: "CC \<subseteq> Y ` K" "finite CC" "K \<subseteq> \<Union>CC"
 10192     by (rule compactE)
 10249     by (meson compactE)
 10193   then obtain c where c: "\<And>C. C \<in> CC \<Longrightarrow> c C \<in> K \<and> C = Y (c C)"
 10250   then obtain c where c: "\<And>C. C \<in> CC \<Longrightarrow> c C \<in> K \<and> C = Y (c C)"
 10194     by (force intro!: choice)
 10251     by (force intro!: choice)
 10195   with * CC show ?thesis
 10252   with * CC show ?thesis
 10196     by (force intro!: exI[where x="\<Inter>C\<in>CC. X0 (c C)"]) (* SLOW *)
 10253     by (force intro!: exI[where x="\<Inter>C\<in>CC. X0 (c C)"]) (* SLOW *)
 10197 qed
 10254 qed