src/HOL/Analysis/Connected.thy
changeset 67155 9e5b05d54f9d
parent 66953 826a5fd4d36c
child 67237 1fe0ec14a90a
equal deleted inserted replaced
67154:c7def8f836d0 67155:9e5b05d54f9d
  2852 qed
  2852 qed
  2853 
  2853 
  2854 lemma diameter_cbox:
  2854 lemma diameter_cbox:
  2855   fixes a b::"'a::euclidean_space"
  2855   fixes a b::"'a::euclidean_space"
  2856   shows "(\<forall>i \<in> Basis. a \<bullet> i \<le> b \<bullet> i) \<Longrightarrow> diameter (cbox a b) = dist a b"
  2856   shows "(\<forall>i \<in> Basis. a \<bullet> i \<le> b \<bullet> i) \<Longrightarrow> diameter (cbox a b) = dist a b"
  2857   by (force simp: diameter_def intro!: cSup_eq_maximum setL2_mono
  2857   by (force simp: diameter_def intro!: cSup_eq_maximum L2_set_mono
  2858      simp: euclidean_dist_l2[where 'a='a] cbox_def dist_norm)
  2858      simp: euclidean_dist_l2[where 'a='a] cbox_def dist_norm)
  2859 
  2859 
  2860 subsection \<open>Separation between points and sets\<close>
  2860 subsection \<open>Separation between points and sets\<close>
  2861 
  2861 
  2862 lemma separate_point_closed:
  2862 lemma separate_point_closed:
  5036 
  5036 
  5037 subsection\<open>Componentwise limits and continuity\<close>
  5037 subsection\<open>Componentwise limits and continuity\<close>
  5038 
  5038 
  5039 text\<open>But is the premise really necessary? Need to generalise @{thm euclidean_dist_l2}\<close>
  5039 text\<open>But is the premise really necessary? Need to generalise @{thm euclidean_dist_l2}\<close>
  5040 lemma Euclidean_dist_upper: "i \<in> Basis \<Longrightarrow> dist (x \<bullet> i) (y \<bullet> i) \<le> dist x y"
  5040 lemma Euclidean_dist_upper: "i \<in> Basis \<Longrightarrow> dist (x \<bullet> i) (y \<bullet> i) \<le> dist x y"
  5041   by (metis (no_types) member_le_setL2 euclidean_dist_l2 finite_Basis)
  5041   by (metis (no_types) member_le_L2_set euclidean_dist_l2 finite_Basis)
  5042 
  5042 
  5043 text\<open>But is the premise @{term \<open>i \<in> Basis\<close>} really necessary?\<close>
  5043 text\<open>But is the premise @{term \<open>i \<in> Basis\<close>} really necessary?\<close>
  5044 lemma open_preimage_inner:
  5044 lemma open_preimage_inner:
  5045   assumes "open S" "i \<in> Basis"
  5045   assumes "open S" "i \<in> Basis"
  5046     shows "open {x. x \<bullet> i \<in> S}"
  5046     shows "open {x. x \<bullet> i \<in> S}"
  5085   show ?lhs
  5085   show ?lhs
  5086   unfolding tendsto_iff
  5086   unfolding tendsto_iff
  5087   proof clarify
  5087   proof clarify
  5088     fix e::real
  5088     fix e::real
  5089     assume "0 < e"
  5089     assume "0 < e"
  5090     have *: "setL2 (\<lambda>i. dist (f x \<bullet> i) (l \<bullet> i)) Basis < e"
  5090     have *: "L2_set (\<lambda>i. dist (f x \<bullet> i) (l \<bullet> i)) Basis < e"
  5091              if "\<forall>i\<in>Basis. dist (f x \<bullet> i) (l \<bullet> i) < e / real DIM('b)" for x
  5091              if "\<forall>i\<in>Basis. dist (f x \<bullet> i) (l \<bullet> i) < e / real DIM('b)" for x
  5092     proof -
  5092     proof -
  5093       have "setL2 (\<lambda>i. dist (f x \<bullet> i) (l \<bullet> i)) Basis \<le> sum (\<lambda>i. dist (f x \<bullet> i) (l \<bullet> i)) Basis"
  5093       have "L2_set (\<lambda>i. dist (f x \<bullet> i) (l \<bullet> i)) Basis \<le> sum (\<lambda>i. dist (f x \<bullet> i) (l \<bullet> i)) Basis"
  5094         by (simp add: setL2_le_sum)
  5094         by (simp add: L2_set_le_sum)
  5095       also have "... < DIM('b) * (e / real DIM('b))"
  5095       also have "... < DIM('b) * (e / real DIM('b))"
  5096         apply (rule sum_bounded_above_strict)
  5096         apply (rule sum_bounded_above_strict)
  5097         using that by auto
  5097         using that by auto
  5098       also have "... = e"
  5098       also have "... = e"
  5099         by (simp add: field_simps)
  5099         by (simp add: field_simps)
  5100       finally show "setL2 (\<lambda>i. dist (f x \<bullet> i) (l \<bullet> i)) Basis < e" .
  5100       finally show "L2_set (\<lambda>i. dist (f x \<bullet> i) (l \<bullet> i)) Basis < e" .
  5101     qed
  5101     qed
  5102     have "\<forall>\<^sub>F x in F. \<forall>i\<in>Basis. dist (f x \<bullet> i) (l \<bullet> i) < e / DIM('b)"
  5102     have "\<forall>\<^sub>F x in F. \<forall>i\<in>Basis. dist (f x \<bullet> i) (l \<bullet> i) < e / DIM('b)"
  5103       apply (rule R')
  5103       apply (rule R')
  5104       using \<open>0 < e\<close> by simp
  5104       using \<open>0 < e\<close> by simp
  5105     then show "\<forall>\<^sub>F x in F. dist (f x) l < e"
  5105     then show "\<forall>\<^sub>F x in F. dist (f x) l < e"
  5514   then have "(\<Sum>i\<in>Basis. (dist (clamp a b y \<bullet> i) (clamp a b x \<bullet> i))\<^sup>2) \<le>
  5514   then have "(\<Sum>i\<in>Basis. (dist (clamp a b y \<bullet> i) (clamp a b x \<bullet> i))\<^sup>2) \<le>
  5515     (\<Sum>i\<in>Basis. (dist (y \<bullet> i) (x \<bullet> i))\<^sup>2)"
  5515     (\<Sum>i\<in>Basis. (dist (y \<bullet> i) (x \<bullet> i))\<^sup>2)"
  5516     by (auto intro!: sum_mono simp: clamp_def dist_real_def abs_le_square_iff[symmetric])
  5516     by (auto intro!: sum_mono simp: clamp_def dist_real_def abs_le_square_iff[symmetric])
  5517   then show ?thesis
  5517   then show ?thesis
  5518     by (auto intro: real_sqrt_le_mono
  5518     by (auto intro: real_sqrt_le_mono
  5519       simp: euclidean_dist_l2[where y=x] euclidean_dist_l2[where y="clamp a b x"] setL2_def)
  5519       simp: euclidean_dist_l2[where y=x] euclidean_dist_l2[where y="clamp a b x"] L2_set_def)
  5520 qed (auto simp: clamp_def)
  5520 qed (auto simp: clamp_def)
  5521 
  5521 
  5522 lemma clamp_continuous_at:
  5522 lemma clamp_continuous_at:
  5523   fixes f :: "'a::euclidean_space \<Rightarrow> 'b::metric_space"
  5523   fixes f :: "'a::euclidean_space \<Rightarrow> 'b::metric_space"
  5524     and x :: 'a
  5524     and x :: 'a