src/HOL/Analysis/Topology_Euclidean_Space.thy
changeset 64845 e5d4bc2016a6
parent 64791 05a2b3b20664
child 64910 6108dddad9f0
equal deleted inserted replaced
64844:bb70dc05cd38 64845:e5d4bc2016a6
    95 lemma continuous_on_cases:
    95 lemma continuous_on_cases:
    96   "closed s \<Longrightarrow> closed t \<Longrightarrow> continuous_on s f \<Longrightarrow> continuous_on t g \<Longrightarrow>
    96   "closed s \<Longrightarrow> closed t \<Longrightarrow> continuous_on s f \<Longrightarrow> continuous_on t g \<Longrightarrow>
    97     \<forall>x. (x\<in>s \<and> \<not> P x) \<or> (x \<in> t \<and> P x) \<longrightarrow> f x = g x \<Longrightarrow>
    97     \<forall>x. (x\<in>s \<and> \<not> P x) \<or> (x \<in> t \<and> P x) \<longrightarrow> f x = g x \<Longrightarrow>
    98     continuous_on (s \<union> t) (\<lambda>x. if P x then f x else g x)"
    98     continuous_on (s \<union> t) (\<lambda>x. if P x then f x else g x)"
    99   by (rule continuous_on_If) auto
    99   by (rule continuous_on_If) auto
       
   100 
       
   101 lemma open_sums:
       
   102   fixes T :: "('b::real_normed_vector) set"
       
   103   assumes "open S \<or> open T"
       
   104   shows "open (\<Union>x\<in> S. \<Union>y \<in> T. {x + y})"
       
   105   using assms
       
   106 proof
       
   107   assume S: "open S"
       
   108   show ?thesis
       
   109   proof (clarsimp simp: open_dist)
       
   110     fix x y
       
   111     assume "x \<in> S" "y \<in> T"
       
   112     with S obtain e where "e > 0" and e: "\<And>x'. dist x' x < e \<Longrightarrow> x' \<in> S"
       
   113       by (auto simp: open_dist)
       
   114     then have "\<And>z. dist z (x + y) < e \<Longrightarrow> \<exists>x\<in>S. \<exists>y\<in>T. z = x + y"
       
   115       by (metis \<open>y \<in> T\<close> diff_add_cancel dist_add_cancel2)
       
   116     then show "\<exists>e>0. \<forall>z. dist z (x + y) < e \<longrightarrow> (\<exists>x\<in>S. \<exists>y\<in>T. z = x + y)"
       
   117       using \<open>0 < e\<close> \<open>x \<in> S\<close> by blast
       
   118   qed
       
   119 next
       
   120   assume T: "open T"
       
   121   show ?thesis
       
   122   proof (clarsimp simp: open_dist)
       
   123     fix x y
       
   124     assume "x \<in> S" "y \<in> T"
       
   125     with T obtain e where "e > 0" and e: "\<And>x'. dist x' y < e \<Longrightarrow> x' \<in> T"
       
   126       by (auto simp: open_dist)
       
   127     then have "\<And>z. dist z (x + y) < e \<Longrightarrow> \<exists>x\<in>S. \<exists>y\<in>T. z = x + y"
       
   128       by (metis \<open>x \<in> S\<close> add_diff_cancel_left' add_diff_eq diff_diff_add dist_norm)
       
   129     then show "\<exists>e>0. \<forall>z. dist z (x + y) < e \<longrightarrow> (\<exists>x\<in>S. \<exists>y\<in>T. z = x + y)"
       
   130       using \<open>0 < e\<close> \<open>y \<in> T\<close> by blast
       
   131   qed
       
   132 qed
   100 
   133 
   101 
   134 
   102 subsection \<open>Topological Basis\<close>
   135 subsection \<open>Topological Basis\<close>
   103 
   136 
   104 context topological_space
   137 context topological_space
   631   assume H: ?rhs
   664   assume H: ?rhs
   632   let ?t = "\<Union>{T. openin U T \<and> T \<subseteq> S}"
   665   let ?t = "\<Union>{T. openin U T \<and> T \<subseteq> S}"
   633   have "openin U ?t" by (force simp add: openin_Union)
   666   have "openin U ?t" by (force simp add: openin_Union)
   634   also have "?t = S" using H by auto
   667   also have "?t = S" using H by auto
   635   finally show "openin U S" .
   668   finally show "openin U S" .
       
   669 qed
       
   670 
       
   671 lemma openin_INT [intro]:
       
   672   assumes "finite I"
       
   673           "\<And>i. i \<in> I \<Longrightarrow> openin T (U i)"
       
   674   shows "openin T ((\<Inter>i \<in> I. U i) \<inter> topspace T)"
       
   675 using assms by (induct, auto simp add: inf_sup_aci(2) openin_Int)
       
   676 
       
   677 lemma openin_INT2 [intro]:
       
   678   assumes "finite I" "I \<noteq> {}"
       
   679           "\<And>i. i \<in> I \<Longrightarrow> openin T (U i)"
       
   680   shows "openin T (\<Inter>i \<in> I. U i)"
       
   681 proof -
       
   682   have "(\<Inter>i \<in> I. U i) \<subseteq> topspace T"
       
   683     using `I \<noteq> {}` openin_subset[OF assms(3)] by auto
       
   684   then show ?thesis
       
   685     using openin_INT[of _ _ U, OF assms(1) assms(3)] by (simp add: inf.absorb2 inf_commute)
   636 qed
   686 qed
   637 
   687 
   638 
   688 
   639 subsubsection \<open>Closed sets\<close>
   689 subsubsection \<open>Closed sets\<close>
   640 
   690 
  2121 lemma closure_complement: "closure (- S) = - interior S"
  2171 lemma closure_complement: "closure (- S) = - interior S"
  2122   by (simp add: closure_interior)
  2172   by (simp add: closure_interior)
  2123 
  2173 
  2124 lemma interior_complement: "interior (- S) = - closure S"
  2174 lemma interior_complement: "interior (- S) = - closure S"
  2125   by (simp add: closure_interior)
  2175   by (simp add: closure_interior)
       
  2176    
       
  2177 lemma interior_diff: "interior(S - T) = interior S - closure T"
       
  2178   by (simp add: Diff_eq interior_complement)
  2126 
  2179 
  2127 lemma closure_Times: "closure (A \<times> B) = closure A \<times> closure B"
  2180 lemma closure_Times: "closure (A \<times> B) = closure A \<times> closure B"
  2128 proof (rule closure_unique)
  2181 proof (rule closure_unique)
  2129   show "A \<times> B \<subseteq> closure A \<times> closure B"
  2182   show "A \<times> B \<subseteq> closure A \<times> closure B"
  2130     by (intro Sigma_mono closure_subset)
  2183     by (intro Sigma_mono closure_subset)