src/HOL/Analysis/Continuous_Extension.thy
changeset 69922 4a9167f377b0
parent 69918 eddcc7c726f3
child 70136 f03a01a18c6e
equal deleted inserted replaced
69918:eddcc7c726f3 69922:4a9167f377b0
    31   case False
    31   case False
    32     have nonneg: "0 \<le> supp_sum (\<lambda>V. setdist {x} (S - V)) \<C>" for x
    32     have nonneg: "0 \<le> supp_sum (\<lambda>V. setdist {x} (S - V)) \<C>" for x
    33       by (simp add: supp_sum_def sum_nonneg)
    33       by (simp add: supp_sum_def sum_nonneg)
    34     have sd_pos: "0 < setdist {x} (S - V)" if "V \<in> \<C>" "x \<in> S" "x \<in> V" for V x
    34     have sd_pos: "0 < setdist {x} (S - V)" if "V \<in> \<C>" "x \<in> S" "x \<in> V" for V x
    35     proof -
    35     proof -
    36       have "closedin (subtopology euclidean S) (S - V)"
    36       have "closedin (top_of_set S) (S - V)"
    37         by (simp add: Diff_Diff_Int closedin_def opC openin_open_Int \<open>V \<in> \<C>\<close>)
    37         by (simp add: Diff_Diff_Int closedin_def opC openin_open_Int \<open>V \<in> \<C>\<close>)
    38       with that False  setdist_pos_le [of "{x}" "S - V"]
    38       with that False  setdist_pos_le [of "{x}" "S - V"]
    39       show ?thesis
    39       show ?thesis
    40         using setdist_gt_0_closedin by fastforce
    40         using setdist_gt_0_closedin by fastforce
    41     qed
    41     qed
    65         have *: "continuous_on S (\<lambda>x. supp_sum (\<lambda>V. setdist {x} (S - V)) \<C>)"
    65         have *: "continuous_on S (\<lambda>x. supp_sum (\<lambda>V. setdist {x} (S - V)) \<C>)"
    66         proof (clarsimp simp add: continuous_on_eq_continuous_within)
    66         proof (clarsimp simp add: continuous_on_eq_continuous_within)
    67           fix x assume "x \<in> S"
    67           fix x assume "x \<in> S"
    68           then obtain X where "open X" and x: "x \<in> S \<inter> X" and finX: "finite {U \<in> \<C>. U \<inter> X \<noteq> {}}"
    68           then obtain X where "open X" and x: "x \<in> S \<inter> X" and finX: "finite {U \<in> \<C>. U \<inter> X \<noteq> {}}"
    69             using assms by blast
    69             using assms by blast
    70           then have OSX: "openin (subtopology euclidean S) (S \<inter> X)" by blast
    70           then have OSX: "openin (top_of_set S) (S \<inter> X)" by blast
    71           have sumeq: "\<And>x. x \<in> S \<inter> X \<Longrightarrow>
    71           have sumeq: "\<And>x. x \<in> S \<inter> X \<Longrightarrow>
    72                      (\<Sum>V | V \<in> \<C> \<and> V \<inter> X \<noteq> {}. setdist {x} (S - V))
    72                      (\<Sum>V | V \<in> \<C> \<and> V \<inter> X \<noteq> {}. setdist {x} (S - V))
    73                      = supp_sum (\<lambda>V. setdist {x} (S - V)) \<C>"
    73                      = supp_sum (\<lambda>V. setdist {x} (S - V)) \<C>"
    74             apply (simp add: supp_sum_def)
    74             apply (simp add: supp_sum_def)
    75             apply (rule sum.mono_neutral_right [OF finX])
    75             apply (rule sum.mono_neutral_right [OF finX])
   112 subsection\<open>Urysohn's Lemma for Euclidean Spaces\<close>
   112 subsection\<open>Urysohn's Lemma for Euclidean Spaces\<close>
   113 
   113 
   114 text \<open>For Euclidean spaces the proof is easy using distances.\<close>
   114 text \<open>For Euclidean spaces the proof is easy using distances.\<close>
   115 
   115 
   116 lemma Urysohn_both_ne:
   116 lemma Urysohn_both_ne:
   117   assumes US: "closedin (subtopology euclidean U) S"
   117   assumes US: "closedin (top_of_set U) S"
   118       and UT: "closedin (subtopology euclidean U) T"
   118       and UT: "closedin (top_of_set U) T"
   119       and "S \<inter> T = {}" "S \<noteq> {}" "T \<noteq> {}" "a \<noteq> b"
   119       and "S \<inter> T = {}" "S \<noteq> {}" "T \<noteq> {}" "a \<noteq> b"
   120   obtains f :: "'a::euclidean_space \<Rightarrow> 'b::real_normed_vector"
   120   obtains f :: "'a::euclidean_space \<Rightarrow> 'b::real_normed_vector"
   121     where "continuous_on U f"
   121     where "continuous_on U f"
   122           "\<And>x. x \<in> U \<Longrightarrow> f x \<in> closed_segment a b"
   122           "\<And>x. x \<in> U \<Longrightarrow> f x \<in> closed_segment a b"
   123           "\<And>x. x \<in> U \<Longrightarrow> (f x = a \<longleftrightarrow> x \<in> S)"
   123           "\<And>x. x \<in> U \<Longrightarrow> (f x = a \<longleftrightarrow> x \<in> S)"
   165     qed
   165     qed
   166   qed
   166   qed
   167 qed
   167 qed
   168 
   168 
   169 proposition Urysohn_local_strong:
   169 proposition Urysohn_local_strong:
   170   assumes US: "closedin (subtopology euclidean U) S"
   170   assumes US: "closedin (top_of_set U) S"
   171       and UT: "closedin (subtopology euclidean U) T"
   171       and UT: "closedin (top_of_set U) T"
   172       and "S \<inter> T = {}" "a \<noteq> b"
   172       and "S \<inter> T = {}" "a \<noteq> b"
   173   obtains f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
   173   obtains f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
   174     where "continuous_on U f"
   174     where "continuous_on U f"
   175           "\<And>x. x \<in> U \<Longrightarrow> f x \<in> closed_segment a b"
   175           "\<And>x. x \<in> U \<Longrightarrow> f x \<in> closed_segment a b"
   176           "\<And>x. x \<in> U \<Longrightarrow> (f x = a \<longleftrightarrow> x \<in> S)"
   176           "\<And>x. x \<in> U \<Longrightarrow> (f x = a \<longleftrightarrow> x \<in> S)"
   248       by blast
   248       by blast
   249   qed
   249   qed
   250 qed
   250 qed
   251 
   251 
   252 lemma Urysohn_local:
   252 lemma Urysohn_local:
   253   assumes US: "closedin (subtopology euclidean U) S"
   253   assumes US: "closedin (top_of_set U) S"
   254       and UT: "closedin (subtopology euclidean U) T"
   254       and UT: "closedin (top_of_set U) T"
   255       and "S \<inter> T = {}"
   255       and "S \<inter> T = {}"
   256   obtains f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
   256   obtains f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
   257     where "continuous_on U f"
   257     where "continuous_on U f"
   258           "\<And>x. x \<in> U \<Longrightarrow> f x \<in> closed_segment a b"
   258           "\<And>x. x \<in> U \<Longrightarrow> f x \<in> closed_segment a b"
   259           "\<And>x. x \<in> S \<Longrightarrow> f x = a"
   259           "\<And>x. x \<in> S \<Longrightarrow> f x = a"
   299 text \<open>See \cite{dugundji}.\<close>
   299 text \<open>See \cite{dugundji}.\<close>
   300 
   300 
   301 theorem Dugundji:
   301 theorem Dugundji:
   302   fixes f :: "'a::{metric_space,second_countable_topology} \<Rightarrow> 'b::real_inner"
   302   fixes f :: "'a::{metric_space,second_countable_topology} \<Rightarrow> 'b::real_inner"
   303   assumes "convex C" "C \<noteq> {}"
   303   assumes "convex C" "C \<noteq> {}"
   304       and cloin: "closedin (subtopology euclidean U) S"
   304       and cloin: "closedin (top_of_set U) S"
   305       and contf: "continuous_on S f" and "f ` S \<subseteq> C"
   305       and contf: "continuous_on S f" and "f ` S \<subseteq> C"
   306   obtains g where "continuous_on U g" "g ` U \<subseteq> C"
   306   obtains g where "continuous_on U g" "g ` U \<subseteq> C"
   307                   "\<And>x. x \<in> S \<Longrightarrow> g x = f x"
   307                   "\<And>x. x \<in> S \<Longrightarrow> g x = f x"
   308 proof (cases "S = {}")
   308 proof (cases "S = {}")
   309   case True then show thesis
   309   case True then show thesis
   425       next
   425       next
   426         case False
   426         case False
   427         obtain N where N: "open N" "a \<in> N"
   427         obtain N where N: "open N" "a \<in> N"
   428                    and finN: "finite {U \<in> \<C>. \<exists>a\<in>N. H U a \<noteq> 0}"
   428                    and finN: "finite {U \<in> \<C>. \<exists>a\<in>N. H U a \<noteq> 0}"
   429           using Hfin False \<open>a \<in> U\<close> by auto
   429           using Hfin False \<open>a \<in> U\<close> by auto
   430         have oUS: "openin (subtopology euclidean U) (U - S)"
   430         have oUS: "openin (top_of_set U) (U - S)"
   431           using cloin by (simp add: openin_diff)
   431           using cloin by (simp add: openin_diff)
   432         have HcontU: "continuous (at a within U) (H T)" if "T \<in> \<C>" for T
   432         have HcontU: "continuous (at a within U) (H T)" if "T \<in> \<C>" for T
   433           using Hcont [OF \<open>T \<in> \<C>\<close>] False  \<open>a \<in> U\<close> \<open>T \<in> \<C>\<close>
   433           using Hcont [OF \<open>T \<in> \<C>\<close>] False  \<open>a \<in> U\<close> \<open>T \<in> \<C>\<close>
   434           apply (simp add: continuous_on_eq_continuous_within continuous_within)
   434           apply (simp add: continuous_on_eq_continuous_within continuous_within)
   435           apply (rule Lim_transform_within_set)
   435           apply (rule Lim_transform_within_set)
   442           proof (rule continuous_transform_within_openin)
   442           proof (rule continuous_transform_within_openin)
   443             show "continuous (at a within U)
   443             show "continuous (at a within U)
   444                     (\<lambda>x. \<Sum>T\<in>{U \<in> \<C>. \<exists>x\<in>N. H U x \<noteq> 0}. H T x *\<^sub>R f (\<A> T))"
   444                     (\<lambda>x. \<Sum>T\<in>{U \<in> \<C>. \<exists>x\<in>N. H U x \<noteq> 0}. H T x *\<^sub>R f (\<A> T))"
   445               by (force intro: continuous_intros HcontU)+
   445               by (force intro: continuous_intros HcontU)+
   446           next
   446           next
   447             show "openin (subtopology euclidean U) ((U - S) \<inter> N)"
   447             show "openin (top_of_set U) ((U - S) \<inter> N)"
   448               using N oUS openin_trans by blast
   448               using N oUS openin_trans by blast
   449           next
   449           next
   450             show "a \<in> (U - S) \<inter> N" using False \<open>a \<in> U\<close> N by blast
   450             show "a \<in> (U - S) \<inter> N" using False \<open>a \<in> U\<close> N by blast
   451           next
   451           next
   452             show "\<And>x. x \<in> (U - S) \<inter> N \<Longrightarrow>
   452             show "\<And>x. x \<in> (U - S) \<inter> N \<Longrightarrow>
   473 
   473 
   474 
   474 
   475 corollary Tietze:
   475 corollary Tietze:
   476   fixes f :: "'a::{metric_space,second_countable_topology} \<Rightarrow> 'b::real_inner"
   476   fixes f :: "'a::{metric_space,second_countable_topology} \<Rightarrow> 'b::real_inner"
   477   assumes "continuous_on S f"
   477   assumes "continuous_on S f"
   478     and "closedin (subtopology euclidean U) S"
   478     and "closedin (top_of_set U) S"
   479     and "0 \<le> B"
   479     and "0 \<le> B"
   480     and "\<And>x. x \<in> S \<Longrightarrow> norm(f x) \<le> B"
   480     and "\<And>x. x \<in> S \<Longrightarrow> norm(f x) \<le> B"
   481   obtains g where "continuous_on U g" "\<And>x. x \<in> S \<Longrightarrow> g x = f x"
   481   obtains g where "continuous_on U g" "\<And>x. x \<in> S \<Longrightarrow> g x = f x"
   482     "\<And>x. x \<in> U \<Longrightarrow> norm(g x) \<le> B"
   482     "\<And>x. x \<in> U \<Longrightarrow> norm(g x) \<le> B"
   483   using assms by (auto simp: image_subset_iff intro: Dugundji [of "cball 0 B" U S f])
   483   using assms by (auto simp: image_subset_iff intro: Dugundji [of "cball 0 B" U S f])
   484 
   484 
   485 corollary%unimportant Tietze_closed_interval:
   485 corollary%unimportant Tietze_closed_interval:
   486   fixes f :: "'a::{metric_space,second_countable_topology} \<Rightarrow> 'b::euclidean_space"
   486   fixes f :: "'a::{metric_space,second_countable_topology} \<Rightarrow> 'b::euclidean_space"
   487   assumes "continuous_on S f"
   487   assumes "continuous_on S f"
   488     and "closedin (subtopology euclidean U) S"
   488     and "closedin (top_of_set U) S"
   489     and "cbox a b \<noteq> {}"
   489     and "cbox a b \<noteq> {}"
   490     and "\<And>x. x \<in> S \<Longrightarrow> f x \<in> cbox a b"
   490     and "\<And>x. x \<in> S \<Longrightarrow> f x \<in> cbox a b"
   491   obtains g where "continuous_on U g" "\<And>x. x \<in> S \<Longrightarrow> g x = f x"
   491   obtains g where "continuous_on U g" "\<And>x. x \<in> S \<Longrightarrow> g x = f x"
   492     "\<And>x. x \<in> U \<Longrightarrow> g x \<in> cbox a b"
   492     "\<And>x. x \<in> U \<Longrightarrow> g x \<in> cbox a b"
   493   apply (rule Dugundji [of "cbox a b" U S f])
   493   apply (rule Dugundji [of "cbox a b" U S f])
   494   using assms by auto
   494   using assms by auto
   495 
   495 
   496 corollary%unimportant Tietze_closed_interval_1:
   496 corollary%unimportant Tietze_closed_interval_1:
   497   fixes f :: "'a::{metric_space,second_countable_topology} \<Rightarrow> real"
   497   fixes f :: "'a::{metric_space,second_countable_topology} \<Rightarrow> real"
   498   assumes "continuous_on S f"
   498   assumes "continuous_on S f"
   499     and "closedin (subtopology euclidean U) S"
   499     and "closedin (top_of_set U) S"
   500     and "a \<le> b"
   500     and "a \<le> b"
   501     and "\<And>x. x \<in> S \<Longrightarrow> f x \<in> cbox a b"
   501     and "\<And>x. x \<in> S \<Longrightarrow> f x \<in> cbox a b"
   502   obtains g where "continuous_on U g" "\<And>x. x \<in> S \<Longrightarrow> g x = f x"
   502   obtains g where "continuous_on U g" "\<And>x. x \<in> S \<Longrightarrow> g x = f x"
   503     "\<And>x. x \<in> U \<Longrightarrow> g x \<in> cbox a b"
   503     "\<And>x. x \<in> U \<Longrightarrow> g x \<in> cbox a b"
   504   apply (rule Dugundji [of "cbox a b" U S f])
   504   apply (rule Dugundji [of "cbox a b" U S f])
   505   using assms by (auto simp: image_subset_iff)
   505   using assms by (auto simp: image_subset_iff)
   506 
   506 
   507 corollary%unimportant Tietze_open_interval:
   507 corollary%unimportant Tietze_open_interval:
   508   fixes f :: "'a::{metric_space,second_countable_topology} \<Rightarrow> 'b::euclidean_space"
   508   fixes f :: "'a::{metric_space,second_countable_topology} \<Rightarrow> 'b::euclidean_space"
   509   assumes "continuous_on S f"
   509   assumes "continuous_on S f"
   510     and "closedin (subtopology euclidean U) S"
   510     and "closedin (top_of_set U) S"
   511     and "box a b \<noteq> {}"
   511     and "box a b \<noteq> {}"
   512     and "\<And>x. x \<in> S \<Longrightarrow> f x \<in> box a b"
   512     and "\<And>x. x \<in> S \<Longrightarrow> f x \<in> box a b"
   513   obtains g where "continuous_on U g" "\<And>x. x \<in> S \<Longrightarrow> g x = f x"
   513   obtains g where "continuous_on U g" "\<And>x. x \<in> S \<Longrightarrow> g x = f x"
   514     "\<And>x. x \<in> U \<Longrightarrow> g x \<in> box a b"
   514     "\<And>x. x \<in> U \<Longrightarrow> g x \<in> box a b"
   515   apply (rule Dugundji [of "box a b" U S f])
   515   apply (rule Dugundji [of "box a b" U S f])
   516   using assms by auto
   516   using assms by auto
   517 
   517 
   518 corollary%unimportant Tietze_open_interval_1:
   518 corollary%unimportant Tietze_open_interval_1:
   519   fixes f :: "'a::{metric_space,second_countable_topology} \<Rightarrow> real"
   519   fixes f :: "'a::{metric_space,second_countable_topology} \<Rightarrow> real"
   520   assumes "continuous_on S f"
   520   assumes "continuous_on S f"
   521     and "closedin (subtopology euclidean U) S"
   521     and "closedin (top_of_set U) S"
   522     and "a < b"
   522     and "a < b"
   523     and no: "\<And>x. x \<in> S \<Longrightarrow> f x \<in> box a b"
   523     and no: "\<And>x. x \<in> S \<Longrightarrow> f x \<in> box a b"
   524   obtains g where "continuous_on U g" "\<And>x. x \<in> S \<Longrightarrow> g x = f x"
   524   obtains g where "continuous_on U g" "\<And>x. x \<in> S \<Longrightarrow> g x = f x"
   525     "\<And>x. x \<in> U \<Longrightarrow> g x \<in> box a b"
   525     "\<And>x. x \<in> U \<Longrightarrow> g x \<in> box a b"
   526   apply (rule Dugundji [of "box a b" U S f])
   526   apply (rule Dugundji [of "box a b" U S f])
   527   using assms by (auto simp: image_subset_iff)
   527   using assms by (auto simp: image_subset_iff)
   528 
   528 
   529 corollary%unimportant Tietze_unbounded:
   529 corollary%unimportant Tietze_unbounded:
   530   fixes f :: "'a::{metric_space,second_countable_topology} \<Rightarrow> 'b::real_inner"
   530   fixes f :: "'a::{metric_space,second_countable_topology} \<Rightarrow> 'b::real_inner"
   531   assumes "continuous_on S f"
   531   assumes "continuous_on S f"
   532     and "closedin (subtopology euclidean U) S"
   532     and "closedin (top_of_set U) S"
   533   obtains g where "continuous_on U g" "\<And>x. x \<in> S \<Longrightarrow> g x = f x"
   533   obtains g where "continuous_on U g" "\<And>x. x \<in> S \<Longrightarrow> g x = f x"
   534   apply (rule Dugundji [of UNIV U S f])
   534   apply (rule Dugundji [of UNIV U S f])
   535   using assms by auto
   535   using assms by auto
   536 
   536 
   537 end
   537 end