src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy
changeset 63114 27afe7af7379
parent 63105 c445b0924e3a
child 63128 24708cf4ba61
equal deleted inserted replaced
63107:932cf444f2fe 63114:27afe7af7379
   859 lemma mem_cball_0 [simp]:
   859 lemma mem_cball_0 [simp]:
   860   fixes x :: "'a::real_normed_vector"
   860   fixes x :: "'a::real_normed_vector"
   861   shows "x \<in> cball 0 e \<longleftrightarrow> norm x \<le> e"
   861   shows "x \<in> cball 0 e \<longleftrightarrow> norm x \<le> e"
   862   by (simp add: dist_norm)
   862   by (simp add: dist_norm)
   863 
   863 
       
   864 lemma mem_sphere_0 [simp]:
       
   865   fixes x :: "'a::real_normed_vector"
       
   866   shows "x \<in> sphere 0 e \<longleftrightarrow> norm x = e"
       
   867   by (simp add: dist_norm)
       
   868 
   864 lemma centre_in_ball [simp]: "x \<in> ball x e \<longleftrightarrow> 0 < e"
   869 lemma centre_in_ball [simp]: "x \<in> ball x e \<longleftrightarrow> 0 < e"
   865   by simp
   870   by simp
   866 
   871 
   867 lemma centre_in_cball [simp]: "x \<in> cball x e \<longleftrightarrow> 0 \<le> e"
   872 lemma centre_in_cball [simp]: "x \<in> cball x e \<longleftrightarrow> 0 \<le> e"
   868   by simp
   873   by simp
   983 
   988 
   984 subsection \<open>Boxes\<close>
   989 subsection \<open>Boxes\<close>
   985 
   990 
   986 abbreviation One :: "'a::euclidean_space"
   991 abbreviation One :: "'a::euclidean_space"
   987   where "One \<equiv> \<Sum>Basis"
   992   where "One \<equiv> \<Sum>Basis"
       
   993 
       
   994 lemma One_non_0: assumes "One = (0::'a::euclidean_space)" shows False
       
   995 proof -
       
   996   have "dependent (Basis :: 'a set)"
       
   997     apply (simp add: dependent_finite)
       
   998     apply (rule_tac x="\<lambda>i. 1" in exI)
       
   999     using SOME_Basis apply (auto simp: assms)
       
  1000     done
       
  1001   with independent_Basis show False by force
       
  1002 qed
       
  1003 
       
  1004 corollary One_neq_0[iff]: "One \<noteq> 0"
       
  1005   by (metis One_non_0)
       
  1006 
       
  1007 corollary Zero_neq_One[iff]: "0 \<noteq> One"
       
  1008   by (metis One_non_0)
   988 
  1009 
   989 definition (in euclidean_space) eucl_less (infix "<e" 50)
  1010 definition (in euclidean_space) eucl_less (infix "<e" 50)
   990   where "eucl_less a b \<longleftrightarrow> (\<forall>i\<in>Basis. a \<bullet> i < b \<bullet> i)"
  1011   where "eucl_less a b \<longleftrightarrow> (\<forall>i\<in>Basis. a \<bullet> i < b \<bullet> i)"
   991 
  1012 
   992 definition box_eucl_less: "box a b = {x. a <e x \<and> x <e b}"
  1013 definition box_eucl_less: "box a b = {x. a <e x \<and> x <e b}"
  5786     (\<forall>t. closedin (subtopology euclidean (f ` s)) t \<longrightarrow>
  5807     (\<forall>t. closedin (subtopology euclidean (f ` s)) t \<longrightarrow>
  5787       closedin (subtopology euclidean s) {x \<in> s. f x \<in> t})"
  5808       closedin (subtopology euclidean s) {x \<in> s. f x \<in> t})"
  5788   unfolding continuous_on_closed_invariant closedin_closed Int_def vimage_def Int_commute
  5809   unfolding continuous_on_closed_invariant closedin_closed Int_def vimage_def Int_commute
  5789   by (simp add: imp_ex imageI conj_commute eq_commute cong: conj_cong)
  5810   by (simp add: imp_ex imageI conj_commute eq_commute cong: conj_cong)
  5790 
  5811 
  5791 text \<open>Half-global and completely global cases.\<close>
  5812 subsection \<open>Half-global and completely global cases.\<close>
  5792 
  5813 
  5793 lemma continuous_openin_preimage:
  5814 lemma continuous_openin_preimage:
  5794   assumes "continuous_on s f"  "open t"
  5815   assumes "continuous_on s f"  "open t"
  5795   shows "openin (subtopology euclidean s) {x \<in> s. f x \<in> t}"
  5816   shows "openin (subtopology euclidean s) {x \<in> s. f x \<in> t}"
  5796 proof -
  5817 proof -
  5872     using \<open>T \<subseteq> image f s\<close> \<open>inj f\<close> unfolding inj_on_def subset_eq by auto
  5893     using \<open>T \<subseteq> image f s\<close> \<open>inj f\<close> unfolding inj_on_def subset_eq by auto
  5873   ultimately have "y \<in> interior s" ..
  5894   ultimately have "y \<in> interior s" ..
  5874   with \<open>x = f y\<close> show "x \<in> f ` interior s" ..
  5895   with \<open>x = f y\<close> show "x \<in> f ` interior s" ..
  5875 qed
  5896 qed
  5876 
  5897 
  5877 text \<open>Equality of continuous functions on closure and related results.\<close>
  5898 subsection \<open>Equality of continuous functions on closure and related results.\<close>
  5878 
  5899 
  5879 lemma continuous_closedin_preimage_constant:
  5900 lemma continuous_closedin_preimage_constant:
  5880   fixes f :: "_ \<Rightarrow> 'b::t1_space"
  5901   fixes f :: "_ \<Rightarrow> 'b::t1_space"
  5881   shows "continuous_on s f \<Longrightarrow> closedin (subtopology euclidean s) {x \<in> s. f x = a}"
  5902   shows "continuous_on s f \<Longrightarrow> closedin (subtopology euclidean s) {x \<in> s. f x = a}"
  5882   using continuous_closedin_preimage[of s f "{a}"] by auto
  5903   using continuous_closedin_preimage[of s f "{a}"] by auto
  7236 lemma translation_diff:
  7257 lemma translation_diff:
  7237   fixes a :: "'a::ab_group_add"
  7258   fixes a :: "'a::ab_group_add"
  7238   shows "(\<lambda>x. a + x) ` (s - t) = ((\<lambda>x. a + x) ` s) - ((\<lambda>x. a + x) ` t)"
  7259   shows "(\<lambda>x. a + x) ` (s - t) = ((\<lambda>x. a + x) ` s) - ((\<lambda>x. a + x) ` t)"
  7239   by auto
  7260   by auto
  7240 
  7261 
       
  7262 lemma translation_Int:
       
  7263   fixes a :: "'a::ab_group_add"
       
  7264   shows "(\<lambda>x. a + x) ` (s \<inter> t) = ((\<lambda>x. a + x) ` s) \<inter> ((\<lambda>x. a + x) ` t)"
       
  7265   by auto
       
  7266 
  7241 lemma closure_translation:
  7267 lemma closure_translation:
  7242   fixes a :: "'a::real_normed_vector"
  7268   fixes a :: "'a::real_normed_vector"
  7243   shows "closure ((\<lambda>x. a + x) ` s) = (\<lambda>x. a + x) ` (closure s)"
  7269   shows "closure ((\<lambda>x. a + x) ` s) = (\<lambda>x. a + x) ` (closure s)"
  7244 proof -
  7270 proof -
  7245   have *: "op + a ` (- s) = - op + a ` s"
  7271   have *: "op + a ` (- s) = - op + a ` s"
  7258 lemma frontier_translation:
  7284 lemma frontier_translation:
  7259   fixes a :: "'a::real_normed_vector"
  7285   fixes a :: "'a::real_normed_vector"
  7260   shows "frontier((\<lambda>x. a + x) ` s) = (\<lambda>x. a + x) ` (frontier s)"
  7286   shows "frontier((\<lambda>x. a + x) ` s) = (\<lambda>x. a + x) ` (frontier s)"
  7261   unfolding frontier_def translation_diff interior_translation closure_translation
  7287   unfolding frontier_def translation_diff interior_translation closure_translation
  7262   by auto
  7288   by auto
       
  7289 
       
  7290 lemma sphere_translation:
       
  7291   fixes a :: "'n::euclidean_space"
       
  7292   shows "sphere (a+c) r = op+a ` sphere c r"
       
  7293 apply safe
       
  7294 apply (rule_tac x="x-a" in image_eqI)
       
  7295 apply (auto simp: dist_norm algebra_simps)
       
  7296 done
       
  7297 
       
  7298 lemma cball_translation:
       
  7299   fixes a :: "'n::euclidean_space"
       
  7300   shows "cball (a+c) r = op+a ` cball c r"
       
  7301 apply safe
       
  7302 apply (rule_tac x="x-a" in image_eqI)
       
  7303 apply (auto simp: dist_norm algebra_simps)
       
  7304 done
       
  7305 
       
  7306 lemma ball_translation:
       
  7307   fixes a :: "'n::euclidean_space"
       
  7308   shows "ball (a+c) r = op+a ` ball c r"
       
  7309 apply safe
       
  7310 apply (rule_tac x="x-a" in image_eqI)
       
  7311 apply (auto simp: dist_norm algebra_simps)
       
  7312 done
  7263 
  7313 
  7264 
  7314 
  7265 subsection \<open>Separation between points and sets\<close>
  7315 subsection \<open>Separation between points and sets\<close>
  7266 
  7316 
  7267 lemma separate_point_closed:
  7317 lemma separate_point_closed:
  8209   apply auto
  8259   apply auto
  8210   apply (rule_tac x="f x" in bexI)
  8260   apply (rule_tac x="f x" in bexI)
  8211   apply auto
  8261   apply auto
  8212   done
  8262   done
  8213 
  8263 
       
  8264 lemma homeomorphicI [intro?]:
       
  8265    "\<lbrakk>f ` S = T; g ` T = S;
       
  8266      continuous_on S f; continuous_on T g;
       
  8267      \<And>x. x \<in> S \<Longrightarrow> g(f(x)) = x;
       
  8268      \<And>y. y \<in> T \<Longrightarrow> f(g(y)) = y\<rbrakk> \<Longrightarrow> S homeomorphic T"
       
  8269 unfolding homeomorphic_def homeomorphism_def by metis
       
  8270 
       
  8271 lemma homeomorphism_of_subsets:
       
  8272    "\<lbrakk>homeomorphism S T f g; S' \<subseteq> S; T'' \<subseteq> T; f ` S' = T'\<rbrakk>
       
  8273     \<Longrightarrow> homeomorphism S' T' f g"
       
  8274 apply (auto simp: homeomorphism_def elim!: continuous_on_subset)
       
  8275 by (metis contra_subsetD imageI)
       
  8276 
       
  8277 lemma homeomorphism_apply1: "\<lbrakk>homeomorphism S T f g; x \<in> S\<rbrakk> \<Longrightarrow> g(f x) = x"
       
  8278   by (simp add: homeomorphism_def)
       
  8279 
       
  8280 lemma homeomorphism_apply2: "\<lbrakk>homeomorphism S T f g; x \<in> T\<rbrakk> \<Longrightarrow> f(g x) = x"
       
  8281   by (simp add: homeomorphism_def)
       
  8282 
       
  8283 lemma homeomorphism_image1: "homeomorphism S T f g \<Longrightarrow> f ` S = T"
       
  8284   by (simp add: homeomorphism_def)
       
  8285 
       
  8286 lemma homeomorphism_image2: "homeomorphism S T f g \<Longrightarrow> g ` T = S"
       
  8287   by (simp add: homeomorphism_def)
       
  8288 
       
  8289 lemma homeomorphism_cont1: "homeomorphism S T f g \<Longrightarrow> continuous_on S f"
       
  8290   by (simp add: homeomorphism_def)
       
  8291 
       
  8292 lemma homeomorphism_cont2: "homeomorphism S T f g \<Longrightarrow> continuous_on T g"
       
  8293   by (simp add: homeomorphism_def)
       
  8294 
  8214 text \<open>Relatively weak hypotheses if a set is compact.\<close>
  8295 text \<open>Relatively weak hypotheses if a set is compact.\<close>
  8215 
  8296 
  8216 lemma homeomorphism_compact:
  8297 lemma homeomorphism_compact:
  8217   fixes f :: "'a::topological_space \<Rightarrow> 'b::t2_space"
  8298   fixes f :: "'a::topological_space \<Rightarrow> 'b::t2_space"
  8218   assumes "compact s" "continuous_on s f"  "f ` s = t"  "inj_on f s"
  8299   assumes "compact s" "continuous_on s f"  "f ` s = t"  "inj_on f s"
  8330     apply (auto intro!: continuous_intros
  8411     apply (auto intro!: continuous_intros
  8331       simp: dist_commute dist_norm pos_divide_le_eq mult_strict_left_mono)
  8412       simp: dist_commute dist_norm pos_divide_le_eq mult_strict_left_mono)
  8332     done
  8413     done
  8333 qed
  8414 qed
  8334 
  8415 
  8335 text\<open>"Isometry" (up to constant bounds) of injective linear map etc.\<close>
  8416 subsection\<open>Inverse function property for open/closed maps\<close>
       
  8417 
       
  8418 lemma continuous_on_inverse_open_map:
       
  8419   assumes contf: "continuous_on S f"
       
  8420       and imf: "f ` S = T"
       
  8421       and injf: "\<And>x. x \<in> S \<Longrightarrow> g(f x) = x"
       
  8422       and oo: "\<And>U. openin (subtopology euclidean S) U
       
  8423                     \<Longrightarrow> openin (subtopology euclidean T) (f ` U)"
       
  8424     shows "continuous_on T g"
       
  8425 proof -
       
  8426   have gTS: "g ` T = S"
       
  8427     using imf injf by force
       
  8428   have fU: "U \<subseteq> S \<Longrightarrow> (f ` U) = {x \<in> T. g x \<in> U}" for U
       
  8429     using imf injf by force
       
  8430   show ?thesis
       
  8431     apply (simp add: continuous_on_open [of T g] gTS)
       
  8432     apply (metis openin_imp_subset fU oo)
       
  8433     done
       
  8434 qed
       
  8435 
       
  8436 lemma continuous_on_inverse_closed_map:
       
  8437   assumes contf: "continuous_on S f"
       
  8438       and imf: "f ` S = T"
       
  8439       and injf: "\<And>x. x \<in> S \<Longrightarrow> g(f x) = x"
       
  8440       and oo: "\<And>U. closedin (subtopology euclidean S) U
       
  8441                     \<Longrightarrow> closedin (subtopology euclidean T) (f ` U)"
       
  8442     shows "continuous_on T g"
       
  8443 proof -
       
  8444   have gTS: "g ` T = S"
       
  8445     using imf injf by force
       
  8446   have fU: "U \<subseteq> S \<Longrightarrow> (f ` U) = {x \<in> T. g x \<in> U}" for U
       
  8447     using imf injf by force
       
  8448   show ?thesis
       
  8449     apply (simp add: continuous_on_closed [of T g] gTS)
       
  8450     apply (metis closedin_imp_subset fU oo)
       
  8451     done
       
  8452 qed
       
  8453 
       
  8454 lemma homeomorphism_injective_open_map:
       
  8455   assumes contf: "continuous_on S f"
       
  8456       and imf: "f ` S = T"
       
  8457       and injf: "inj_on f S"
       
  8458       and oo: "\<And>U. openin (subtopology euclidean S) U
       
  8459                     \<Longrightarrow> openin (subtopology euclidean T) (f ` U)"
       
  8460   obtains g where "homeomorphism S T f g"
       
  8461 proof -
       
  8462   have "continuous_on T (inv_into S f)"
       
  8463     by (metis contf continuous_on_inverse_open_map imf injf inv_into_f_f oo)
       
  8464   then show ?thesis
       
  8465     apply (rule_tac g = "inv_into S f" in that)
       
  8466     using imf injf contf apply (auto simp: homeomorphism_def)
       
  8467     done
       
  8468 qed
       
  8469 
       
  8470 lemma homeomorphism_injective_closed_map:
       
  8471   assumes contf: "continuous_on S f"
       
  8472       and imf: "f ` S = T"
       
  8473       and injf: "inj_on f S"
       
  8474       and oo: "\<And>U. closedin (subtopology euclidean S) U
       
  8475                     \<Longrightarrow> closedin (subtopology euclidean T) (f ` U)"
       
  8476   obtains g where "homeomorphism S T f g"
       
  8477 proof -
       
  8478   have "continuous_on T (inv_into S f)"
       
  8479     by (metis contf continuous_on_inverse_closed_map imf injf inv_into_f_f oo)
       
  8480   then show ?thesis
       
  8481     apply (rule_tac g = "inv_into S f" in that)
       
  8482     using imf injf contf apply (auto simp: homeomorphism_def)
       
  8483     done
       
  8484 qed
       
  8485 
       
  8486 lemma homeomorphism_imp_open_map:
       
  8487   assumes hom: "homeomorphism S T f g"
       
  8488       and oo: "openin (subtopology euclidean S) U"
       
  8489     shows "openin (subtopology euclidean T) (f ` U)"
       
  8490 proof -
       
  8491   have [simp]: "f ` U = {y. y \<in> T \<and> g y \<in> U}"
       
  8492     using assms openin_subset
       
  8493     by (fastforce simp: homeomorphism_def rev_image_eqI)
       
  8494   have "continuous_on T g"
       
  8495     using hom homeomorphism_def by blast
       
  8496   moreover have "g ` T = S"
       
  8497     by (metis hom homeomorphism_def)
       
  8498   ultimately show ?thesis
       
  8499     by (simp add: continuous_on_open oo)
       
  8500 qed
       
  8501 
       
  8502 lemma homeomorphism_imp_closed_map:
       
  8503   assumes hom: "homeomorphism S T f g"
       
  8504       and oo: "closedin (subtopology euclidean S) U"
       
  8505     shows "closedin (subtopology euclidean T) (f ` U)"
       
  8506 proof -
       
  8507   have [simp]: "f ` U = {y. y \<in> T \<and> g y \<in> U}"
       
  8508     using assms closedin_subset
       
  8509     by (fastforce simp: homeomorphism_def rev_image_eqI)
       
  8510   have "continuous_on T g"
       
  8511     using hom homeomorphism_def by blast
       
  8512   moreover have "g ` T = S"
       
  8513     by (metis hom homeomorphism_def)
       
  8514   ultimately show ?thesis
       
  8515     by (simp add: continuous_on_closed oo)
       
  8516 qed
       
  8517 
       
  8518 subsection\<open>"Isometry" (up to constant bounds) of injective linear map etc.\<close>
  8336 
  8519 
  8337 lemma cauchy_isometric:
  8520 lemma cauchy_isometric:
  8338   assumes e: "e > 0"
  8521   assumes e: "e > 0"
  8339     and s: "subspace s"
  8522     and s: "subspace s"
  8340     and f: "bounded_linear f"
  8523     and f: "bounded_linear f"
  8352       by auto
  8535       by auto
  8353     {
  8536     {
  8354       fix n
  8537       fix n
  8355       assume "n\<ge>N"
  8538       assume "n\<ge>N"
  8356       have "e * norm (x n - x N) \<le> norm (f (x n - x N))"
  8539       have "e * norm (x n - x N) \<le> norm (f (x n - x N))"
  8357         using subspace_sub[OF s, of "x n" "x N"]
  8540         using subspace_diff[OF s, of "x n" "x N"]
  8358         using xs[THEN spec[where x=N]] and xs[THEN spec[where x=n]]
  8541         using xs[THEN spec[where x=N]] and xs[THEN spec[where x=n]]
  8359         using normf[THEN bspec[where x="x n - x N"]]
  8542         using normf[THEN bspec[where x="x n - x N"]]
  8360         by auto
  8543         by auto
  8361       also have "norm (f (x n - x N)) < e * d"
  8544       also have "norm (f (x n - x N)) < e * d"
  8362         using \<open>N \<le> n\<close> N unfolding f.diff[symmetric] by auto
  8545         using \<open>N \<le> n\<close> N unfolding f.diff[symmetric] by auto