src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy
changeset 62343 24106dc44def
parent 62131 1baed43f453e
child 62381 a6479cb85944
equal deleted inserted replaced
62342:1cf129590be8 62343:24106dc44def
   530   using Ke Kc unfolding closedin_def Diff_Inter by auto
   530   using Ke Kc unfolding closedin_def Diff_Inter by auto
   531 
   531 
   532 lemma closedin_INT[intro]:
   532 lemma closedin_INT[intro]:
   533   assumes "A \<noteq> {}" "\<And>x. x \<in> A \<Longrightarrow> closedin U (B x)"
   533   assumes "A \<noteq> {}" "\<And>x. x \<in> A \<Longrightarrow> closedin U (B x)"
   534   shows "closedin U (\<Inter>x\<in>A. B x)"
   534   shows "closedin U (\<Inter>x\<in>A. B x)"
   535   unfolding Inter_image_eq [symmetric]
       
   536   apply (rule closedin_Inter)
   535   apply (rule closedin_Inter)
   537   using assms
   536   using assms
   538   apply auto
   537   apply auto
   539   done
   538   done
   540 
   539 
   603     moreover have "openin U (\<Union>Sk)"
   602     moreover have "openin U (\<Union>Sk)"
   604       using Sk by (auto simp add: subset_eq)
   603       using Sk by (auto simp add: subset_eq)
   605     ultimately have "?L (\<Union>K)" by blast
   604     ultimately have "?L (\<Union>K)" by blast
   606   }
   605   }
   607   ultimately show ?thesis
   606   ultimately show ?thesis
   608     unfolding subset_eq mem_Collect_eq istopology_def by blast
   607     unfolding subset_eq mem_Collect_eq istopology_def by auto
   609 qed
   608 qed
   610 
   609 
   611 lemma openin_subtopology: "openin (subtopology U V) S \<longleftrightarrow> (\<exists>T. openin U T \<and> S = T \<inter> V)"
   610 lemma openin_subtopology: "openin (subtopology U V) S \<longleftrightarrow> (\<exists>T. openin U T \<and> S = T \<inter> V)"
   612   unfolding subtopology_def topology_inverse'[OF istopology_subtopology]
   611   unfolding subtopology_def topology_inverse'[OF istopology_subtopology]
   613   by auto
   612   by auto
  2424     assume a: "a < Inf (f ` ({x<..} \<inter> I))"
  2423     assume a: "a < Inf (f ` ({x<..} \<inter> I))"
  2425     {
  2424     {
  2426       fix y
  2425       fix y
  2427       assume "y \<in> {x<..} \<inter> I"
  2426       assume "y \<in> {x<..} \<inter> I"
  2428       with False bnd have "Inf (f ` ({x<..} \<inter> I)) \<le> f y"
  2427       with False bnd have "Inf (f ` ({x<..} \<inter> I)) \<le> f y"
  2429         by (auto intro!: cInf_lower bdd_belowI2 simp del: Inf_image_eq)
  2428         by (auto intro!: cInf_lower bdd_belowI2)
  2430       with a have "a < f y"
  2429       with a have "a < f y"
  2431         by (blast intro: less_le_trans)
  2430         by (blast intro: less_le_trans)
  2432     }
  2431     }
  2433     then show "eventually (\<lambda>x. a < f x) (at x within ({x<..} \<inter> I))"
  2432     then show "eventually (\<lambda>x. a < f x) (at x within ({x<..} \<inter> I))"
  2434       by (auto simp: eventually_at_filter intro: exI[of _ 1] zero_less_one)
  2433       by (auto simp: eventually_at_filter intro: exI[of _ 1] zero_less_one)
  3800 lemma compact_Union [intro]: "finite S \<Longrightarrow> (\<And>T. T \<in> S \<Longrightarrow> compact T) \<Longrightarrow> compact (\<Union>S)"
  3799 lemma compact_Union [intro]: "finite S \<Longrightarrow> (\<And>T. T \<in> S \<Longrightarrow> compact T) \<Longrightarrow> compact (\<Union>S)"
  3801   by (induct set: finite) auto
  3800   by (induct set: finite) auto
  3802 
  3801 
  3803 lemma compact_UN [intro]:
  3802 lemma compact_UN [intro]:
  3804   "finite A \<Longrightarrow> (\<And>x. x \<in> A \<Longrightarrow> compact (B x)) \<Longrightarrow> compact (\<Union>x\<in>A. B x)"
  3803   "finite A \<Longrightarrow> (\<And>x. x \<in> A \<Longrightarrow> compact (B x)) \<Longrightarrow> compact (\<Union>x\<in>A. B x)"
  3805   unfolding SUP_def by (rule compact_Union) auto
  3804   by (rule compact_Union) auto
  3806 
  3805 
  3807 lemma closed_inter_compact [intro]:
  3806 lemma closed_inter_compact [intro]:
  3808   assumes "closed s"
  3807   assumes "closed s"
  3809     and "compact t"
  3808     and "compact t"
  3810   shows "compact (s \<inter> t)"
  3809   shows "compact (s \<inter> t)"
  4088         by auto
  4087         by auto
  4089       then obtain X' where T: "\<And>T. T \<subseteq> A \<Longrightarrow> finite T \<Longrightarrow> X' T \<in> U - \<Union>T"
  4088       then obtain X' where T: "\<And>T. T \<subseteq> A \<Longrightarrow> finite T \<Longrightarrow> X' T \<in> U - \<Union>T"
  4090         by metis
  4089         by metis
  4091       def X \<equiv> "\<lambda>n. X' (from_nat_into A ` {.. n})"
  4090       def X \<equiv> "\<lambda>n. X' (from_nat_into A ` {.. n})"
  4092       have X: "\<And>n. X n \<in> U - (\<Union>i\<le>n. from_nat_into A i)"
  4091       have X: "\<And>n. X n \<in> U - (\<Union>i\<le>n. from_nat_into A i)"
  4093         using \<open>A \<noteq> {}\<close> unfolding X_def SUP_def by (intro T) (auto intro: from_nat_into)
  4092         using \<open>A \<noteq> {}\<close> unfolding X_def by (intro T) (auto intro: from_nat_into)
  4094       then have "range X \<subseteq> U"
  4093       then have "range X \<subseteq> U"
  4095         by auto
  4094         by auto
  4096       with subseq[of X] obtain r x where "x \<in> U" and r: "subseq r" "(X \<circ> r) \<longlonglongrightarrow> x"
  4095       with subseq[of X] obtain r x where "x \<in> U" and r: "subseq r" "(X \<circ> r) \<longlonglongrightarrow> x"
  4097         by auto
  4096         by auto
  4098       from \<open>x\<in>U\<close> \<open>U \<subseteq> \<Union>A\<close> from_nat_into_surj[OF \<open>countable A\<close>]
  4097       from \<open>x\<in>U\<close> \<open>U \<subseteq> \<Union>A\<close> from_nat_into_surj[OF \<open>countable A\<close>]
  4196   moreover
  4195   moreover
  4197   assume "\<not> (\<exists>x\<in>s. \<forall>U. x\<in>U \<and> open U \<longrightarrow> infinite (U \<inter> t))"
  4196   assume "\<not> (\<exists>x\<in>s. \<forall>U. x\<in>U \<and> open U \<longrightarrow> infinite (U \<inter> t))"
  4198   then have s: "\<And>x. x \<in> s \<Longrightarrow> \<exists>U. x\<in>U \<and> open U \<and> finite (U \<inter> t)" by metis
  4197   then have s: "\<And>x. x \<in> s \<Longrightarrow> \<exists>U. x\<in>U \<and> open U \<and> finite (U \<inter> t)" by metis
  4199   have "s \<subseteq> \<Union>C"
  4198   have "s \<subseteq> \<Union>C"
  4200     using \<open>t \<subseteq> s\<close>
  4199     using \<open>t \<subseteq> s\<close>
  4201     unfolding C_def Union_image_eq
  4200     unfolding C_def
  4202     apply (safe dest!: s)
  4201     apply (safe dest!: s)
  4203     apply (rule_tac a="U \<inter> t" in UN_I)
  4202     apply (rule_tac a="U \<inter> t" in UN_I)
  4204     apply (auto intro!: interiorI simp add: finite_subset)
  4203     apply (auto intro!: interiorI simp add: finite_subset)
  4205     done
  4204     done
  4206   moreover
  4205   moreover
  4209   ultimately
  4208   ultimately
  4210   obtain D where "D \<subseteq> C" "finite D" "s \<subseteq> \<Union>D"
  4209   obtain D where "D \<subseteq> C" "finite D" "s \<subseteq> \<Union>D"
  4211     by (rule countably_compactE)
  4210     by (rule countably_compactE)
  4212   then obtain E where E: "E \<subseteq> {F. finite F \<and> F \<subseteq> t }" "finite E"
  4211   then obtain E where E: "E \<subseteq> {F. finite F \<and> F \<subseteq> t }" "finite E"
  4213     and s: "s \<subseteq> (\<Union>F\<in>E. interior (F \<union> (- t)))"
  4212     and s: "s \<subseteq> (\<Union>F\<in>E. interior (F \<union> (- t)))"
  4214     by (metis (lifting) Union_image_eq finite_subset_image C_def)
  4213     by (metis (lifting) finite_subset_image C_def)
  4215   from s \<open>t \<subseteq> s\<close> have "t \<subseteq> \<Union>E"
  4214   from s \<open>t \<subseteq> s\<close> have "t \<subseteq> \<Union>E"
  4216     using interior_subset by blast
  4215     using interior_subset by blast
  4217   moreover have "finite (\<Union>E)"
  4216   moreover have "finite (\<Union>E)"
  4218     using E by auto
  4217     using E by auto
  4219   ultimately show False using \<open>infinite t\<close>
  4218   ultimately show False using \<open>infinite t\<close>
  4346     then have "0 < e / 2" "ball x (e / 2) \<subseteq> T"
  4345     then have "0 < e / 2" "ball x (e / 2) \<subseteq> T"
  4347       by auto
  4346       by auto
  4348     from Rats_dense_in_real[OF \<open>0 < e / 2\<close>] obtain r where "r \<in> \<rat>" "0 < r" "r < e / 2"
  4347     from Rats_dense_in_real[OF \<open>0 < e / 2\<close>] obtain r where "r \<in> \<rat>" "0 < r" "r < e / 2"
  4349       by auto
  4348       by auto
  4350     from f[rule_format, of r] \<open>0 < r\<close> \<open>x \<in> s\<close> obtain k where "k \<in> f r" "x \<in> ball k r"
  4349     from f[rule_format, of r] \<open>0 < r\<close> \<open>x \<in> s\<close> obtain k where "k \<in> f r" "x \<in> ball k r"
  4351       unfolding Union_image_eq by auto
  4350       by auto
  4352     from \<open>r \<in> \<rat>\<close> \<open>0 < r\<close> \<open>k \<in> f r\<close> have "ball k r \<in> K"
  4351     from \<open>r \<in> \<rat>\<close> \<open>0 < r\<close> \<open>k \<in> f r\<close> have "ball k r \<in> K"
  4353       by (auto simp: K_def)
  4352       by (auto simp: K_def)
  4354     then show "\<exists>b\<in>K. x \<in> b \<and> b \<inter> s \<subseteq> T"
  4353     then show "\<exists>b\<in>K. x \<in> b \<and> b \<inter> s \<subseteq> T"
  4355     proof (rule bexI[rotated], safe)
  4354     proof (rule bexI[rotated], safe)
  4356       fix y
  4355       fix y
  7410   unfolding open_inter_closure_eq_empty[OF open_box] ..
  7409   unfolding open_inter_closure_eq_empty[OF open_box] ..
  7411 
  7410 
  7412 lemma diameter_cbox:
  7411 lemma diameter_cbox:
  7413   fixes a b::"'a::euclidean_space"
  7412   fixes a b::"'a::euclidean_space"
  7414   shows "(\<forall>i \<in> Basis. a \<bullet> i \<le> b \<bullet> i) \<Longrightarrow> diameter (cbox a b) = dist a b"
  7413   shows "(\<forall>i \<in> Basis. a \<bullet> i \<le> b \<bullet> i) \<Longrightarrow> diameter (cbox a b) = dist a b"
  7415   by (force simp add: diameter_def SUP_def simp del: Sup_image_eq intro!: cSup_eq_maximum setL2_mono
  7414   by (force simp add: diameter_def intro!: cSup_eq_maximum setL2_mono
  7416      simp: euclidean_dist_l2[where 'a='a] cbox_def dist_norm)
  7415      simp: euclidean_dist_l2[where 'a='a] cbox_def dist_norm)
  7417 
  7416 
  7418 lemma eucl_less_eq_halfspaces:
  7417 lemma eucl_less_eq_halfspaces:
  7419   fixes a :: "'a::euclidean_space"
  7418   fixes a :: "'a::euclidean_space"
  7420   shows "{x. x <e a} = (\<Inter>i\<in>Basis. {x. x \<bullet> i < a \<bullet> i})"
  7419   shows "{x. x <e a} = (\<Inter>i\<in>Basis. {x. x \<bullet> i < a \<bullet> i})"