src/HOL/Analysis/Topology_Euclidean_Space.thy
changeset 63881 b746b19197bd
parent 63627 6ddb43c6b711
child 63928 d81fb5b46a5c
equal deleted inserted replaced
63880:729accd056ad 63881:b746b19197bd
   761   by (simp add: closedin_subtopology closed_closedin Int_ac)
   761   by (simp add: closedin_subtopology closed_closedin Int_ac)
   762 
   762 
   763 lemma closedin_closed_Int: "closed S \<Longrightarrow> closedin (subtopology euclidean U) (U \<inter> S)"
   763 lemma closedin_closed_Int: "closed S \<Longrightarrow> closedin (subtopology euclidean U) (U \<inter> S)"
   764   by (metis closedin_closed)
   764   by (metis closedin_closed)
   765 
   765 
   766 lemma closed_closedin_trans:
       
   767   "closed S \<Longrightarrow> closed T \<Longrightarrow> T \<subseteq> S \<Longrightarrow> closedin (subtopology euclidean S) T"
       
   768   by (metis closedin_closed inf.absorb2)
       
   769 
       
   770 lemma closed_subset: "S \<subseteq> T \<Longrightarrow> closed S \<Longrightarrow> closedin (subtopology euclidean T) S"
   766 lemma closed_subset: "S \<subseteq> T \<Longrightarrow> closed S \<Longrightarrow> closedin (subtopology euclidean T) S"
   771   by (auto simp add: closedin_closed)
   767   by (auto simp add: closedin_closed)
   772 
   768 
   773 lemma closedin_singleton [simp]:
   769 lemma closedin_singleton [simp]:
   774   fixes a :: "'a::t1_space"
   770   fixes a :: "'a::t1_space"
   927 
   923 
   928 lemma mem_sphere_0 [simp]:
   924 lemma mem_sphere_0 [simp]:
   929   fixes x :: "'a::real_normed_vector"
   925   fixes x :: "'a::real_normed_vector"
   930   shows "x \<in> sphere 0 e \<longleftrightarrow> norm x = e"
   926   shows "x \<in> sphere 0 e \<longleftrightarrow> norm x = e"
   931   by (simp add: dist_norm)
   927   by (simp add: dist_norm)
       
   928 
       
   929 lemma sphere_empty [simp]:
       
   930   fixes a :: "'a::metric_space"
       
   931   shows "r < 0 \<Longrightarrow> sphere a r = {}"
       
   932 by auto
   932 
   933 
   933 lemma centre_in_ball [simp]: "x \<in> ball x e \<longleftrightarrow> 0 < e"
   934 lemma centre_in_ball [simp]: "x \<in> ball x e \<longleftrightarrow> 0 < e"
   934   by simp
   935   by simp
   935 
   936 
   936 lemma centre_in_cball [simp]: "x \<in> cball x e \<longleftrightarrow> 0 \<le> e"
   937 lemma centre_in_cball [simp]: "x \<in> cball x e \<longleftrightarrow> 0 \<le> e"
  7310 text \<open>We can state this in terms of diameter of a set.\<close>
  7311 text \<open>We can state this in terms of diameter of a set.\<close>
  7311 
  7312 
  7312 definition diameter :: "'a::metric_space set \<Rightarrow> real" where
  7313 definition diameter :: "'a::metric_space set \<Rightarrow> real" where
  7313   "diameter S = (if S = {} then 0 else SUP (x,y):S\<times>S. dist x y)"
  7314   "diameter S = (if S = {} then 0 else SUP (x,y):S\<times>S. dist x y)"
  7314 
  7315 
       
  7316 lemma diameter_le:
       
  7317   assumes "S \<noteq> {} \<or> 0 \<le> d"
       
  7318       and no: "\<And>x y. \<lbrakk>x \<in> S; y \<in> S\<rbrakk> \<Longrightarrow> norm(x - y) \<le> d"
       
  7319     shows "diameter S \<le> d"
       
  7320 using assms
       
  7321   by (auto simp: dist_norm diameter_def intro: cSUP_least)
       
  7322 
  7315 lemma diameter_bounded_bound:
  7323 lemma diameter_bounded_bound:
  7316   fixes s :: "'a :: metric_space set"
  7324   fixes s :: "'a :: metric_space set"
  7317   assumes s: "bounded s" "x \<in> s" "y \<in> s"
  7325   assumes s: "bounded s" "x \<in> s" "y \<in> s"
  7318   shows "dist x y \<le> diameter s"
  7326   shows "dist x y \<le> diameter s"
  7319 proof -
  7327 proof -
  8056   }
  8064   }
  8057   then show ?thesis
  8065   then show ?thesis
  8058     unfolding mem_box by auto
  8066     unfolding mem_box by auto
  8059 qed
  8067 qed
  8060 
  8068 
  8061 lemma closure_box:
  8069 lemma closure_cbox [simp]: "closure (cbox a b) = cbox a b"
       
  8070   by (simp add: closed_cbox)
       
  8071 
       
  8072 lemma closure_box [simp]:
  8062   fixes a :: "'a::euclidean_space"
  8073   fixes a :: "'a::euclidean_space"
  8063    assumes "box a b \<noteq> {}"
  8074    assumes "box a b \<noteq> {}"
  8064   shows "closure (box a b) = cbox a b"
  8075   shows "closure (box a b) = cbox a b"
  8065 proof -
  8076 proof -
  8066   have ab: "a <e b"
  8077   have ab: "a <e b"